@chaibuilder/sdk 4.0.0-beta.24 → 4.0.0-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/{2SSKDMRQ-DTcPSOGn.js → 2SSKDMRQ-Bk_4y8lw.js} +2 -2
  2. package/dist/{2SSKDMRQ-C6XmPkPR.cjs → 2SSKDMRQ-vWeQ_IyI.cjs} +1 -1
  3. package/dist/{AP7HFJJL-6aBLUYOi.cjs → AP7HFJJL-CMPLeI6t.cjs} +1 -1
  4. package/dist/{AP7HFJJL-CVazlaEj.js → AP7HFJJL-D_mI2XSw.js} +1 -1
  5. package/dist/{IconPicker-sbWeQ9M9.cjs → IconPicker-DB_PpKvH.cjs} +1 -1
  6. package/dist/{IconPicker-CcBoA1K0.js → IconPicker-jc6_JzXf.js} +1 -1
  7. package/dist/{WDYDFRGG-CwiYliX0.js → WDYDFRGG-B4H3RPcp.js} +2 -2
  8. package/dist/{WDYDFRGG-BtzyRDmj.cjs → WDYDFRGG-D7vzbPjk.cjs} +1 -1
  9. package/dist/{active-in-another-tab-B4O3FEEg.js → active-in-another-tab-CDhFxBU7.js} +2 -2
  10. package/dist/{active-in-another-tab-DRJY0QqU.cjs → active-in-another-tab-CMPHyyHE.cjs} +1 -1
  11. package/dist/{add-new-language-page-BfYL9jXF.js → add-new-language-page-BliZ46WW.js} +3 -3
  12. package/dist/{add-new-language-page-CKIRTFjr.cjs → add-new-language-page-IbMzbf4v.cjs} +1 -1
  13. package/dist/{add-new-page-dzN_CD2c.cjs → add-new-page-BJJqSKp0.cjs} +1 -1
  14. package/dist/{add-new-page-DVgxz4fs.js → add-new-page-DUCKfyWo.js} +2 -2
  15. package/dist/{ai-panel-content-Dyw4RHCV.cjs → ai-panel-content-DWOqjq3Z.cjs} +1 -1
  16. package/dist/{ai-panel-content-D5eFLI_B.js → ai-panel-content-GeQIaXy8.js} +3 -3
  17. package/dist/{ai-panel-default-lang-DEj9Qx2M.cjs → ai-panel-default-lang-DGNDrfam.cjs} +2 -2
  18. package/dist/{ai-panel-default-lang-Cj7meZBD.js → ai-panel-default-lang-VQsV6KB3.js} +3 -3
  19. package/dist/{ai-panel-other-lang-Da2XLEcm.cjs → ai-panel-other-lang-DvXF0Nn5.cjs} +1 -1
  20. package/dist/{ai-panel-other-lang-Cbi6HKzd.js → ai-panel-other-lang-SuC8jyfr.js} +3 -3
  21. package/dist/{ai-prompt-input-B6QoqT9B.js → ai-prompt-input-CB6iQAmE.js} +1 -1
  22. package/dist/{ai-prompt-input-DXS8gzex.cjs → ai-prompt-input-a8s-JrZb.cjs} +1 -1
  23. package/dist/{ai-translation-prompt-Dmq_Ahjf.js → ai-translation-prompt-CoNVDclG.js} +1 -1
  24. package/dist/{ai-translation-prompt-Uswft8iz.cjs → ai-translation-prompt-Qn1Sz4BI.cjs} +1 -1
  25. package/dist/change-password-modal-BtdsU0mm.cjs +1 -0
  26. package/dist/change-password-modal-CMEo8lEm.js +137 -0
  27. package/dist/{code-editor-wQWmwFKW.js → code-editor-CTMQr0aU.js} +1 -1
  28. package/dist/{code-editor-DbSBrsUA.cjs → code-editor-CjatfjZe.cjs} +1 -1
  29. package/dist/{continue-editing-in-this-client-Dkkzk8YZ.cjs → continue-editing-in-this-client-7swLl0kq.cjs} +1 -1
  30. package/dist/{continue-editing-in-this-client-BV0OrgEU.js → continue-editing-in-this-client-CNVJZvXQ.js} +2 -2
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.js +1 -1
  33. package/dist/{css-import-modal-Co_YLkLB.js → css-import-modal-B3XY8Hzw.js} +1 -1
  34. package/dist/{css-import-modal-C3f5sphx.cjs → css-import-modal-D2RqE-V0.cjs} +1 -1
  35. package/dist/{delete-design-token-CJPAcsWp.js → delete-design-token-DEyYFVHU.js} +1 -1
  36. package/dist/{delete-design-token-zzNmNYLR.cjs → delete-design-token-Dd3b86G7.cjs} +1 -1
  37. package/dist/{delete-page-CQTjB7ZZ.js → delete-page-BSn5mRvk.js} +2 -2
  38. package/dist/{delete-page-6lInxYM_.cjs → delete-page-BfsmsTek.cjs} +1 -1
  39. package/dist/{design-token-usage-blwlGuEE.cjs → design-token-usage-BY8meqAt.cjs} +1 -1
  40. package/dist/{design-token-usage-BQY6eqzE.js → design-token-usage-f20BdlHE.js} +1 -1
  41. package/dist/{digital-asset-manager-cGUpTcu3.cjs → digital-asset-manager-Pi0YiB35.cjs} +1 -1
  42. package/dist/{digital-asset-manager-lPKoJ4FH.js → digital-asset-manager-iXt27NlP.js} +3 -3
  43. package/dist/{duplicate-page-Dmgqp93w.js → duplicate-page-BuVub6uY.js} +3 -3
  44. package/dist/{duplicate-page-rYeBMwHR.cjs → duplicate-page-g5hiQkrZ.cjs} +1 -1
  45. package/dist/{dynamic-page-selector-CVyA9Zp0.js → dynamic-page-selector-NZ-rKLo3.js} +2 -2
  46. package/dist/{dynamic-page-selector-zqGqpcww.cjs → dynamic-page-selector-z6UGEjk1.cjs} +1 -1
  47. package/dist/{get-chai-builder-theme-CfJkQYZc.js → get-chai-builder-theme-CHXhAcdV.js} +1 -1
  48. package/dist/{get-chai-builder-theme-Dm1z70lQ.cjs → get-chai-builder-theme-CMypjJk8.cjs} +1 -1
  49. package/dist/{image-editor-mVBb0VD_.js → image-editor--WT9183_.js} +1 -1
  50. package/dist/{image-editor-Cn1DgrNp.cjs → image-editor-C6cZZNbB.cjs} +1 -1
  51. package/dist/index-BGGNVIKx.cjs +5 -0
  52. package/dist/{index-EFWvSWoi.cjs → index-CfsIhbT2.cjs} +3 -3
  53. package/dist/{index-GfOB5KV1.js → index-ckjNCVor.js} +990 -978
  54. package/dist/{index-lm46VtIP.js → index-iRqgNs2O.js} +14 -10
  55. package/dist/{json-diff-viewer-D5yJoFh1.js → json-diff-viewer-DAQ-qSHk.js} +2 -2
  56. package/dist/{json-diff-viewer-BeSMdSd5.cjs → json-diff-viewer-DheqS084.cjs} +1 -1
  57. package/dist/{lang-panel-7qTejsLm.js → lang-panel-DRDPvY1i.js} +3 -3
  58. package/dist/{lang-panel-B-QUotOn.cjs → lang-panel-oLc-QyU4.cjs} +1 -1
  59. package/dist/{manage-design-tokens-TeWNZekH.cjs → manage-design-tokens-Hu25ejcC.cjs} +1 -1
  60. package/dist/{manage-design-tokens-DeH-yNJN.js → manage-design-tokens-rEzXQJRW.js} +2 -2
  61. package/dist/{mark-as-template-RkfNETRW.js → mark-as-template-BNbn5zQG.js} +2 -2
  62. package/dist/{mark-as-template-Co00KkhA.cjs → mark-as-template-DEThYoS6.cjs} +1 -1
  63. package/dist/{nested-path-selector-content-Dimjyy8J.js → nested-path-selector-content-BERhs6_L.js} +1 -1
  64. package/dist/{nested-path-selector-content-hBvmT_2A.cjs → nested-path-selector-content-Dz3-bNqT.cjs} +1 -1
  65. package/dist/{no-language-page-content-Bk3sTsdM.js → no-language-page-content-CPVIz5rC.js} +2 -2
  66. package/dist/{no-language-page-content-CLovr1bL.cjs → no-language-page-content-CrUkIrUJ.cjs} +1 -1
  67. package/dist/{no-language-page-dialog-C21Fq-UD.cjs → no-language-page-dialog-964r8feg.cjs} +1 -1
  68. package/dist/{no-language-page-dialog-Cx-YOrAd.js → no-language-page-dialog-DPDJ6gkQ.js} +2 -2
  69. package/dist/{page-creator-BBuYY84G.js → page-creator-CDcfL4al.js} +3 -3
  70. package/dist/{page-creator-BDmospqO.cjs → page-creator-kvymje2i.cjs} +1 -1
  71. package/dist/{page-lock-BrGWj326.js → page-lock-BpUGSiCT.js} +2 -2
  72. package/dist/{page-lock-DG5IvZaG.cjs → page-lock-gOE-Tt7g.cjs} +1 -1
  73. package/dist/{page-locked-dialog-DUktYJzU.js → page-locked-dialog-UQeYxWz1.js} +2 -2
  74. package/dist/{page-locked-dialog-DKnQpIMB.cjs → page-locked-dialog-aJFtoEzq.cjs} +1 -1
  75. package/dist/{page-manager-new-iYsDkUzG.cjs → page-manager-new-DBomYOFT.cjs} +1 -1
  76. package/dist/{page-manager-new-BfKYDWs7.js → page-manager-new-Dg02OZtc.js} +22 -22
  77. package/dist/{page-manager-search-and-filter-DVAGxnlw.js → page-manager-search-and-filter-CCTh5gkC.js} +2 -2
  78. package/dist/{page-manager-search-and-filter-CIspvIW2.cjs → page-manager-search-and-filter-pWHXOgMJ.cjs} +1 -1
  79. package/dist/{page-revisions-content-B84UtAxm.cjs → page-revisions-content-BDY8RXJW.cjs} +1 -1
  80. package/dist/{page-revisions-content-DB4mj_Cw.js → page-revisions-content-C6YjUAx9.js} +7 -7
  81. package/dist/pages.cjs +1 -1
  82. package/dist/pages.js +12 -12
  83. package/dist/{plugin-DVNaUexn.js → plugin-DH3BDqys.js} +7 -7
  84. package/dist/{plugin-BfC_qpW2.cjs → plugin-DO5QAuc1.cjs} +7 -7
  85. package/dist/{publish-pages-content-BRKsIr9W.js → publish-pages-content-8MQN9iLc.js} +17 -17
  86. package/dist/{publish-pages-content-ysv37LxZ.cjs → publish-pages-content-DjUd9oWi.cjs} +1 -1
  87. package/dist/render.cjs +1 -1
  88. package/dist/render.js +2 -2
  89. package/dist/{rte-widget-modal-Dj5BvA-1.js → rte-widget-modal-Bj7lxFEs.js} +1 -1
  90. package/dist/{rte-widget-modal-BS040t_9.cjs → rte-widget-modal-O31cHitM.cjs} +1 -1
  91. package/dist/{save-to-lib-D3kp0ovZ.js → save-to-lib-BMlowHNl.js} +2 -2
  92. package/dist/{save-to-lib-ClCCNy6W.cjs → save-to-lib-vxpiXsok.cjs} +1 -1
  93. package/dist/sdk.css +1 -1
  94. package/dist/{selected-block-display-BvRoOMt9.cjs → selected-block-display-BjhZTfSL.cjs} +1 -1
  95. package/dist/{selected-block-display-BtlTAkei.js → selected-block-display-BxHTDLna.js} +2 -2
  96. package/dist/{seo-panel-C_Cnwj1-.js → seo-panel-197ULlty.js} +2 -2
  97. package/dist/{seo-panel-CHGdB8_7.cjs → seo-panel-MrGhioya.cjs} +1 -1
  98. package/dist/{shared-json-ld-DA0wz-k3.cjs → shared-json-ld-6ovlKZ7L.cjs} +1 -1
  99. package/dist/{shared-json-ld-DPr0Douk.js → shared-json-ld-B2kfIim8.js} +24 -24
  100. package/dist/{slug-input-CqhlfgAe.js → slug-input-CSqTWSv8.js} +1 -1
  101. package/dist/{slug-input-DltqfQ3y.cjs → slug-input-CV-Dvosn.cjs} +1 -1
  102. package/dist/supabase-actions.cjs +1 -1
  103. package/dist/supabase-actions.d.ts +34 -0
  104. package/dist/supabase-actions.js +231 -192
  105. package/dist/{take-over-request-Bq7OF5Gp.cjs → take-over-request-BFZbLBOK.cjs} +1 -1
  106. package/dist/{take-over-request-ByUlm_HK.js → take-over-request-Ds_-1dOv.js} +2 -2
  107. package/dist/{theme-panel-footer-DG7Z5YjD.js → theme-panel-footer-C1f2KMBq.js} +2 -2
  108. package/dist/{theme-panel-footer-XYoM6sn5.cjs → theme-panel-footer-dHh8VGgj.cjs} +1 -1
  109. package/dist/{translation-warning-modal-DaBUipEY.js → translation-warning-modal-DPdVK3CD.js} +1 -1
  110. package/dist/{translation-warning-modal-DTxxfo0H.cjs → translation-warning-modal-HD8Mlj1e.cjs} +1 -1
  111. package/dist/{unmark-as-template-C9EXTj0X.cjs → unmark-as-template-D8wEsu9z.cjs} +1 -1
  112. package/dist/{unmark-as-template-BOFHOO0_.js → unmark-as-template-DLVNotM_.js} +2 -2
  113. package/dist/{unpublish-page-B5rev9W3.cjs → unpublish-page-Cl2R_dfN.cjs} +1 -1
  114. package/dist/{unpublish-page-KDM7kEEV.js → unpublish-page-ik9a66Rz.js} +2 -2
  115. package/dist/utils.cjs +1 -1
  116. package/dist/utils.js +1 -1
  117. package/dist/web-blocks.cjs +1 -1
  118. package/dist/web-blocks.js +23 -22
  119. package/dist/{web-preview-CvpevNzM.cjs → web-preview-CE39XTw0.cjs} +1 -1
  120. package/dist/{web-preview-BDgUTTr8.js → web-preview-ztlGD_Xm.js} +1 -1
  121. package/package.json +1 -1
  122. package/dist/index-B5qvHqN5.cjs +0 -5
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./register-chai-top-bar-DWTuRU53.cjs"),r=require("./index-EFWvSWoi.cjs"),t=require("./index-B5qvHqN5.cjs"),l=require("lucide-react"),j=require("react"),p=require("react-i18next"),T=()=>{const i=t.useSendRealtimeEvent(),{pageLockMeta:n}=t.usePageLockMeta(),{setPageStatus:d}=t.usePageLockStatus(),{savePageAsync:x}=r.useSavePage(),h=n==null?void 0:n.requestingUserId,{data:s,isFetching:g}=t.useChaiUserInfo(h||""),o=g?"Fetching user...":(s==null?void 0:s.name)||"Current editor",[u,c]=j.useState(!1),N=async()=>{c(!0),await x(),i(t.EVENT.CONTINUE_EDITING_IN_THIS_CLIENT,n),d(t.PAGE_STATUS.CHECKING),setTimeout(()=>c(!1),2e3)},f=()=>{c(!0),i(t.EVENT.TAKE_OVER_REJECTED,n),d(t.PAGE_STATUS.EDITING),setTimeout(()=>c(!1),2e3)},{t:a}=p.useTranslation();return e.jsx(t.BlurContainer,{children:e.jsxs(r.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(r.CardHeader,{className:"space-y-1",children:e.jsxs(r.CardTitle,{className:"flex items-center gap-2 text-xl",children:[e.jsx(l.AlertCircle,{className:"h-8 w-8 rounded-md bg-amber-500/20 p-1.5 text-amber-500"}),a("Take Over Requested")]})}),e.jsxs(r.CardContent,{className:"space-y-4",children:[e.jsxs("div",{className:"relative rounded-md border border-green-500 px-2 pb-2 pt-4",children:[e.jsx("div",{className:"absolute -top-2.5 left-3 w-max rounded-full bg-green-500 px-3 py-1 text-xs font-medium leading-3 text-white",children:"Requested by"}),e.jsxs("div",{className:"flex items-center space-x-4 p-1",children:[s!=null&&s.avatar?e.jsx("img",{src:s.avatar,alt:s.name,className:"h-12 w-12 flex-shrink-0 rounded-full bg-black text-white"}):e.jsx(l.UserIcon,{className:"h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white"}),e.jsxs("div",{className:"flex-1 space-y-0",children:[e.jsx("div",{className:"truncate font-medium leading-tight text-black",children:o}),(s==null?void 0:s.email)&&e.jsx("p",{className:"truncate text-sm leading-tight text-muted-foreground",children:s.email})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-gray-700",children:o})," ",a("has requested to")," ",e.jsx("span",{className:"font-medium text-gray-500",children:"take over"})," ",a("editing this page."),"."," ",a("Do you want to allow them to continue?")]})]}),e.jsxs(r.CardFooter,{className:"flex gap-2",children:[e.jsxs(m.Button,{disabled:u,variant:"default",onClick:N,className:"flex-1 gap-2",children:[e.jsx(l.Check,{className:"h-4 w-4"}),a("Accept")]}),e.jsxs(m.Button,{disabled:u,variant:"outline",onClick:f,className:"flex-1 gap-2",children:[e.jsx(l.X,{className:"h-4 w-4"}),a("Reject")]})]})]})})};exports.default=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./register-chai-top-bar-DWTuRU53.cjs"),r=require("./index-CfsIhbT2.cjs"),t=require("./index-BGGNVIKx.cjs"),l=require("lucide-react"),j=require("react"),p=require("react-i18next"),T=()=>{const i=t.useSendRealtimeEvent(),{pageLockMeta:n}=t.usePageLockMeta(),{setPageStatus:d}=t.usePageLockStatus(),{savePageAsync:x}=r.useSavePage(),h=n==null?void 0:n.requestingUserId,{data:s,isFetching:g}=t.useChaiUserInfo(h||""),o=g?"Fetching user...":(s==null?void 0:s.name)||"Current editor",[u,c]=j.useState(!1),N=async()=>{c(!0),await x(),i(t.EVENT.CONTINUE_EDITING_IN_THIS_CLIENT,n),d(t.PAGE_STATUS.CHECKING),setTimeout(()=>c(!1),2e3)},f=()=>{c(!0),i(t.EVENT.TAKE_OVER_REJECTED,n),d(t.PAGE_STATUS.EDITING),setTimeout(()=>c(!1),2e3)},{t:a}=p.useTranslation();return e.jsx(t.BlurContainer,{children:e.jsxs(r.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(r.CardHeader,{className:"space-y-1",children:e.jsxs(r.CardTitle,{className:"flex items-center gap-2 text-xl",children:[e.jsx(l.AlertCircle,{className:"h-8 w-8 rounded-md bg-amber-500/20 p-1.5 text-amber-500"}),a("Take Over Requested")]})}),e.jsxs(r.CardContent,{className:"space-y-4",children:[e.jsxs("div",{className:"relative rounded-md border border-green-500 px-2 pb-2 pt-4",children:[e.jsx("div",{className:"absolute -top-2.5 left-3 w-max rounded-full bg-green-500 px-3 py-1 text-xs font-medium leading-3 text-white",children:"Requested by"}),e.jsxs("div",{className:"flex items-center space-x-4 p-1",children:[s!=null&&s.avatar?e.jsx("img",{src:s.avatar,alt:s.name,className:"h-12 w-12 flex-shrink-0 rounded-full bg-black text-white"}):e.jsx(l.UserIcon,{className:"h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white"}),e.jsxs("div",{className:"flex-1 space-y-0",children:[e.jsx("div",{className:"truncate font-medium leading-tight text-black",children:o}),(s==null?void 0:s.email)&&e.jsx("p",{className:"truncate text-sm leading-tight text-muted-foreground",children:s.email})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-gray-700",children:o})," ",a("has requested to")," ",e.jsx("span",{className:"font-medium text-gray-500",children:"take over"})," ",a("editing this page."),"."," ",a("Do you want to allow them to continue?")]})]}),e.jsxs(r.CardFooter,{className:"flex gap-2",children:[e.jsxs(m.Button,{disabled:u,variant:"default",onClick:N,className:"flex-1 gap-2",children:[e.jsx(l.Check,{className:"h-4 w-4"}),a("Accept")]}),e.jsxs(m.Button,{disabled:u,variant:"outline",onClick:f,className:"flex-1 gap-2",children:[e.jsx(l.X,{className:"h-4 w-4"}),a("Reject")]})]})]})})};exports.default=T;
@@ -1,7 +1,7 @@
1
1
  import { jsx as a, jsxs as t } from "react/jsx-runtime";
2
2
  import { B as m } from "./register-chai-top-bar-CX_JkRJn.js";
3
- import { R as N, U as C, V as b, W as v, X as E, Y as T } from "./index-lm46VtIP.js";
4
- import { ao as w, b as I, a as k, ap as y, B as R, E as d, P as u } from "./index-GfOB5KV1.js";
3
+ import { R as N, U as C, V as b, W as v, X as E, Y as T } from "./index-iRqgNs2O.js";
4
+ import { ao as w, b as I, a as k, ap as y, B as R, E as d, P as u } from "./index-ckjNCVor.js";
5
5
  import { AlertCircle as S, UserIcon as A, Check as P, X as U } from "lucide-react";
6
6
  import { useState as _ } from "react";
7
7
  import { useTranslation as q } from "react-i18next";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
2
  import { B as o } from "./register-chai-top-bar-CX_JkRJn.js";
3
- import { i as d } from "./index-lm46VtIP.js";
4
- import { e as h, f as u, t as f } from "./index-GfOB5KV1.js";
3
+ import { i as d } from "./index-iRqgNs2O.js";
4
+ import { e as h, f as u, t as f } from "./index-ckjNCVor.js";
5
5
  import { useTranslation as p } from "react-i18next";
6
6
  const v = () => {
7
7
  const [e] = d(), { mutate: r, isPending: s } = h(), { mutateAsync: t, isPending: i } = u(), { t: n } = p(), m = () => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DWTuRU53.cjs"),d=require("./index-EFWvSWoi.cjs"),s=require("./index-B5qvHqN5.cjs"),h=require("react-i18next"),m=()=>{const[t]=d.useTheme(),{mutate:c,isPending:i}=s.usePublishPages(),{mutateAsync:n,isPending:r}=s.useUpdateWebsiteFields(),{t:a}=h.useTranslation(),u=()=>{n({settings:{theme:t}})},l=async()=>{await n({settings:{theme:t}}),c({ids:["THEME"]},{onSuccess:()=>{s.throwConfetti("BOTTOM_RIGHT")}})};return e.jsxs("div",{className:"flex items-center justify-center gap-x-3 border-t bg-white py-3",children:[e.jsx(o.Button,{size:"sm",variant:"outline",disabled:i||r,onClick:u,children:a("Save draft")}),e.jsx(o.Button,{size:"sm",disabled:i||r,onClick:l,children:a("Publish")})]})};exports.default=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DWTuRU53.cjs"),d=require("./index-CfsIhbT2.cjs"),s=require("./index-BGGNVIKx.cjs"),h=require("react-i18next"),m=()=>{const[t]=d.useTheme(),{mutate:c,isPending:i}=s.usePublishPages(),{mutateAsync:n,isPending:r}=s.useUpdateWebsiteFields(),{t:a}=h.useTranslation(),u=()=>{n({settings:{theme:t}})},l=async()=>{await n({settings:{theme:t}}),c({ids:["THEME"]},{onSuccess:()=>{s.throwConfetti("BOTTOM_RIGHT")}})};return e.jsxs("div",{className:"flex items-center justify-center gap-x-3 border-t bg-white py-3",children:[e.jsx(o.Button,{size:"sm",variant:"outline",disabled:i||r,onClick:u,children:a("Save draft")}),e.jsx(o.Button,{size:"sm",disabled:i||r,onClick:l,children:a("Publish")})]})};exports.default=m;
@@ -1,6 +1,6 @@
1
1
  import { jsx as n, jsxs as e } from "react/jsx-runtime";
2
2
  import { B as i } from "./register-chai-top-bar-CX_JkRJn.js";
3
- import { D as c, e as d, f as h, g, p as m, r as u } from "./index-lm46VtIP.js";
3
+ import { D as c, e as d, f as h, g, p as m, r as u } from "./index-iRqgNs2O.js";
4
4
  const x = ({
5
5
  isOpen: l,
6
6
  onClose: o,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("./register-chai-top-bar-DWTuRU53.cjs"),n=require("./index-EFWvSWoi.cjs"),u=({isOpen:o,onClose:i,onContinue:t,isPending:a=!1,title:r="Translation Warning",description:s="Some blocks need translations before publishing. Do you want to continue anyway?"})=>{const c=()=>{i()},d=()=>{t()};return e.jsx(n.Dialog,{open:o,onOpenChange:i,children:o&&e.jsxs(n.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(n.DialogHeader,{children:[e.jsx(n.DialogTitle,{children:r}),e.jsx(n.DialogDescription,{children:s})]}),e.jsxs(n.DialogFooter,{className:"flex gap-2",children:[e.jsx(l.Button,{variant:"outline",onClick:c,disabled:a,children:"Cancel"}),e.jsx(l.Button,{onClick:d,disabled:a,children:a?"Publishing...":"Continue Anyway"})]})]})})};exports.default=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("./register-chai-top-bar-DWTuRU53.cjs"),n=require("./index-CfsIhbT2.cjs"),u=({isOpen:o,onClose:i,onContinue:t,isPending:a=!1,title:r="Translation Warning",description:s="Some blocks need translations before publishing. Do you want to continue anyway?"})=>{const c=()=>{i()},d=()=>{t()};return e.jsx(n.Dialog,{open:o,onOpenChange:i,children:o&&e.jsxs(n.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(n.DialogHeader,{children:[e.jsx(n.DialogTitle,{children:r}),e.jsx(n.DialogDescription,{children:s})]}),e.jsxs(n.DialogFooter,{className:"flex gap-2",children:[e.jsx(l.Button,{variant:"outline",onClick:c,disabled:a,children:"Cancel"}),e.jsx(l.Button,{onClick:d,disabled:a,children:a?"Publishing...":"Continue Anyway"})]})]})})};exports.default=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DWTuRU53.cjs"),t=require("./index-EFWvSWoi.cjs"),p=require("./index-B5qvHqN5.cjs"),d=require("react"),m=require("react-i18next"),g=({page:i,onClose:n})=>{const{t:a}=m.useTranslation(),[r,s]=d.useState(!1),l=p.useUnmarkAsTemplate(),c=()=>{s(!0),l.mutate(i,{onSuccess:()=>{s(!1),n()},onError:()=>{s(!1)}})};return e.jsx(t.Dialog,{open:!0,onOpenChange:n,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:a("Unmark as template")}),e.jsx(t.DialogDescription,{className:"space-y-1 py-4 text-xs text-slate-500",children:a("Are you sure you want to unmark this page as a template?")})]}),e.jsxs(t.DialogFooter,{className:r?"pointer-events-none opacity-75":"",children:[e.jsx(o.Button,{variant:"outline",onClick:u=>{u.stopPropagation(),n()},children:a("Cancel")}),e.jsx(o.Button,{variant:"default",disabled:r,onClick:c,children:a("Unmark as template")})]})]})})};exports.default=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DWTuRU53.cjs"),t=require("./index-CfsIhbT2.cjs"),p=require("./index-BGGNVIKx.cjs"),d=require("react"),m=require("react-i18next"),g=({page:i,onClose:n})=>{const{t:a}=m.useTranslation(),[r,s]=d.useState(!1),l=p.useUnmarkAsTemplate(),c=()=>{s(!0),l.mutate(i,{onSuccess:()=>{s(!1),n()},onError:()=>{s(!1)}})};return e.jsx(t.Dialog,{open:!0,onOpenChange:n,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:a("Unmark as template")}),e.jsx(t.DialogDescription,{className:"space-y-1 py-4 text-xs text-slate-500",children:a("Are you sure you want to unmark this page as a template?")})]}),e.jsxs(t.DialogFooter,{className:r?"pointer-events-none opacity-75":"",children:[e.jsx(o.Button,{variant:"outline",onClick:u=>{u.stopPropagation(),n()},children:a("Cancel")}),e.jsx(o.Button,{variant:"default",disabled:r,onClick:c,children:a("Unmark as template")})]})]})})};exports.default=g;
@@ -1,7 +1,7 @@
1
1
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
2
  import { B as s } from "./register-chai-top-bar-CX_JkRJn.js";
3
- import { D as p, e as u, f as d, g as f, p as g, r as h } from "./index-lm46VtIP.js";
4
- import { r as k } from "./index-GfOB5KV1.js";
3
+ import { D as p, e as u, f as d, g as f, p as g, r as h } from "./index-iRqgNs2O.js";
4
+ import { r as k } from "./index-ckjNCVor.js";
5
5
  import { useState as D } from "react";
6
6
  import { useTranslation as x } from "react-i18next";
7
7
  const j = ({ page: i, onClose: t }) => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DWTuRU53.cjs"),e=require("./index-EFWvSWoi.cjs"),c=require("./index-B5qvHqN5.cjs"),a=require("react-i18next"),d=({page:i,onClose:t})=>{const{t:s}=a.useTranslation(),{mutate:l,isPending:r}=c.useUnpublishPage(),u=async()=>{l(i,{onSuccess:t})};return n.jsx(e.Dialog,{open:!!i,onOpenChange:t,children:n.jsxs(e.DialogContent,{children:[n.jsxs(e.DialogHeader,{children:[n.jsx(e.DialogTitle,{children:s("Confirm action")}),n.jsxs(e.DialogDescription,{children:[s("Are you sure you want to unpublish")," ",n.jsx("b",{children:(i==null?void 0:i.name)??(i==null?void 0:i.slug)}),"?"]})]}),n.jsxs(e.DialogFooter,{children:[n.jsx(o.Button,{variant:"outline",onClick:t,children:s("Cancel")}),n.jsx(o.Button,{variant:"destructive",disabled:r,onClick:u,children:s(r?"Updating...":"Unpublish")})]})]})})};exports.default=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DWTuRU53.cjs"),e=require("./index-CfsIhbT2.cjs"),c=require("./index-BGGNVIKx.cjs"),a=require("react-i18next"),d=({page:i,onClose:t})=>{const{t:s}=a.useTranslation(),{mutate:l,isPending:r}=c.useUnpublishPage(),u=async()=>{l(i,{onSuccess:t})};return n.jsx(e.Dialog,{open:!!i,onOpenChange:t,children:n.jsxs(e.DialogContent,{children:[n.jsxs(e.DialogHeader,{children:[n.jsx(e.DialogTitle,{children:s("Confirm action")}),n.jsxs(e.DialogDescription,{children:[s("Are you sure you want to unpublish")," ",n.jsx("b",{children:(i==null?void 0:i.name)??(i==null?void 0:i.slug)}),"?"]})]}),n.jsxs(e.DialogFooter,{children:[n.jsx(o.Button,{variant:"outline",onClick:t,children:s("Cancel")}),n.jsx(o.Button,{variant:"destructive",disabled:r,onClick:u,children:s(r?"Updating...":"Unpublish")})]})]})})};exports.default=d;
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, jsxs as o } from "react/jsx-runtime";
2
2
  import { B as l } from "./register-chai-top-bar-CX_JkRJn.js";
3
- import { D as c, e as u, f as h, g as d, p as m, r as b } from "./index-lm46VtIP.js";
4
- import { s as f } from "./index-GfOB5KV1.js";
3
+ import { D as c, e as u, f as h, g as d, p as m, r as b } from "./index-iRqgNs2O.js";
4
+ import { s as f } from "./index-ckjNCVor.js";
5
5
  import { useTranslation as D } from "react-i18next";
6
6
  const v = ({ page: n, onClose: r }) => {
7
7
  const { t: i } = D(), { mutate: e, isPending: t } = f(), a = async () => {
package/dist/utils.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./get-chai-builder-theme-Dm1z70lQ.cjs"),e=require("./get-chai-builder-tailwind-config-DNp8Vhme.cjs");exports.chaiBuilderPlugin=i.chaiBuilderPlugin;exports.getChaiBuilderTheme=i.getChaiBuilderTheme;exports.getChaiBuilderTailwindConfig=e.getChaiBuilderTailwindConfig;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./get-chai-builder-theme-CMypjJk8.cjs"),e=require("./get-chai-builder-tailwind-config-DNp8Vhme.cjs");exports.chaiBuilderPlugin=i.chaiBuilderPlugin;exports.getChaiBuilderTheme=i.getChaiBuilderTheme;exports.getChaiBuilderTailwindConfig=e.getChaiBuilderTailwindConfig;
package/dist/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as a, g as r } from "./get-chai-builder-theme-CfJkQYZc.js";
1
+ import { c as a, g as r } from "./get-chai-builder-theme-CHXhAcdV.js";
2
2
  import { g as l } from "./get-chai-builder-tailwind-config-k8l5sdcw.js";
3
3
  export {
4
4
  a as chaiBuilderPlugin,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-es"),r=require("react/jsx-runtime"),n=require("./runtime.cjs"),P=require("./common-functions-B3a4xKt_.cjs"),x=require("react"),m=require("@radix-ui/react-icons"),d=require("./core-BWQrViOY.cjs");function S(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=S(x),k=({className:e="",inBuilder:o})=>o?r.jsx("div",{className:P.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:r.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,_=e=>{const{blockProps:o,inBuilder:t,backgroundImage:l,children:s,tag:i="div",styles:a}=e;let c=s;s||(c=r.jsx(k,{inBuilder:t}));let p={};return l&&(p={backgroundImage:`url(${l})`}),b.createElement(i,{...o,...a,style:p},c)},N={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.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","ui:allowEmpty":!0}}}}),canAcceptBlock:()=>!0},T=e=>{const{blockProps:o,iconSize:t,icon:l,content:s,styles:i,children:a,iconPos:c,link:p,inBuilder:h}=e,y=l,C=a||r.jsxs(r.Fragment,{children:[s&&r.jsx("span",{children:s}),y&&r.jsx("div",{style:{width:t+"px"},className:c+" "+(s?c==="order-first"?"mr-2":"ml-2":"")||"",dangerouslySetInnerHTML:{__html:y}})]}),f=x.createElement("button",{...o,...i,type:"button","aria-label":s},C);return u.isEmpty(u.get(p,"href"))?f:h?r.jsx("span",{children:f}):r.jsx("a",{"aria-label":s,href:u.get(p,"href")||"/",target:u.get(p,"target","_self"),children:f})},E={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:m.ButtonIcon,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.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"],enumNames:["Left","Right"]},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"]},R=e=>{const{blockProps:o,styles:t,htmlCode:l,inBuilder:s}=e;return s?r.jsxs("div",{className:"relative",...o,children:[s?r.jsx("div",{...t,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...t,dangerouslySetInnerHTML:{__html:l.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:l}})},A={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:m.CodeIcon,group:"advanced",props:n.registerChaiBlockProps({properties:{styles:n.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:l}=e;return t?r.jsx("div",{...l,children:r.jsx("div",{className:P.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:r.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"})})})}):r.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},H={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:m.CodeIcon,hidden:!0,group:"advanced",props:n.registerChaiBlockProps({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},$=e=>{const{blockProps:o,inBuilder:t,children:l,globalBlock:s}=e;return t&&!s?r.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:[r.jsxs("h1",{children:["Global Block - ",s]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},D={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,props:n.registerChaiBlockProps({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},I=(e,...o)=>({...e,className:P.cn(e.className,...o)}),V=e=>{const{blockProps:o,icon:t,styles:l,width:s,inBuilder:i,height:a}=e,c=I(l,"");if(u.isEmpty(t))return r.jsx(k,{inBuilder:i,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...c,style:{width:s?`${s}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},z={type:"Icon",label:"web_blocks.icon",category:"core",description:"Icon block is used to display an icon/svg.",icon:m.SketchLogoIcon,group:"media",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),icon:{type:"string",title:"Icon",default:'<svg xmlns="http://www.w3.org/2000/svg" class="chai-default-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-diamond-icon lucide-diamond"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"/></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},F=e=>{const{blockProps:o,inBuilder:t,children:l,partialBlockId:s}=e;return t&&!s?r.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:[r.jsxs("h1",{children:["Partial Block - ",s]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},U={type:"PartialBlock",description:"A partial block component. Partial blocks are global blocks that can be used in multiple pages.",label:"Partial Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,props:n.registerChaiBlockProps({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"}},q=e=>{const{blockProps:o,children:t,styles:l,colSpan:s,tabletColSpan:i,desktopColSpan:a}=e,p={className:[u.get(l,"className",""),u.get(w,["SMALL",isNaN(s)||!s?6:s],""),i?u.get(w,["MEDIUM",i||s],""):"",a?u.get(w,["LARGE",i||s],""):""].join(" ")};return r.jsx("div",{...o,...l,...p,children:t||r.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},O={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:m.LayoutIcon,wrapper:!0,hidden:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",props:n.registerChaiBlockProps({properties:{styles:n.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]}}})},Z=e=>{const{blockProps:o,children:t,styles:l,gutter:s}=e,a={className:[u.get(l,"className","")," grid grid-cols-12"].join()};return typeof(l==null?void 0:l.style)=="object"&&l.style!==null?a.style={...l.style,gap:`${s}px`}:a.style={gap:`${s}px`},r.jsx("div",{...o,...l,...a,children:t})},G={type:"Row",description:"A row component",label:"Row",group:"basic",icon:m.RowsIcon,hidden:!0,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",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},W=e=>{const{blockProps:o,styles:t}=e;return x.createElement("hr",{...t,...o})},Y={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},Q=e=>{const{blockProps:o,styles:t,backgroundImage:l}=e;let s={};return l&&(s={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...t,style:s})},J={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}})},X=e=>{const{blockProps:o,fieldName:t,label:l,styles:s,inputStyles:i,required:a,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...s,...o,children:[r.jsx("input",{...i,name:t,type:"checkbox",required:a,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...i,...s,type:"checkbox",required:a,defaultChecked:c})},K={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("flex items-center gap-x-2"),inputStyles:n.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{children:o,blockProps:t,errorMessage:l,successMessage:s,styles:i,inBuilder:a}=e;let c=o;o||(c=r.jsx(k,{inBuilder:a}));const p={"x-data":"{}","x-on:submit.prevent":"post"},h={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return r.jsxs("form",{...p,"data-error":l,"data-success":s,method:"post",...t,...i,children:[r.jsx("div",{...h}),c]})},te={type:"Form",label:"Form",category:"core",icon:m.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,"}],props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),formName:{type:"string",title:"Form Name",default:"contact"},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},oe=e=>{const{blockProps:o,inBuilder:t,label:l,styles:s,icon:i,iconSize:a,iconPos:c}=e;return r.jsxs("button",{...s,...o||{},type:t?"button":"submit","aria-label":l,children:[l,i&&r.jsx("div",{style:{width:a+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:i}})]})},le={type:"FormButton",label:"Submit Button",category:"core",icon:m.ButtonIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.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"]},re=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},se=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:a,showLabel:c,required:p,inputType:h,defaultValue:y}=e,{type:C,autoComplete:f}=re(h);return c?r.jsxs("div",{...i,...o,children:[c&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("input",{name:t,defaultValue:y,...a,type:C,placeholder:s,required:p,autoComplete:f,...C==="hidden"&&y?{value:y}:{}})]}):r.jsx("input",{name:t,...o,...a,...i,type:C,placeholder:s,required:p,autoComplete:f,defaultValue:y,...C==="hidden"&&y?{value:y}:{}})},ie={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),inputStyles:n.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"]},ne=e=>{const{blockProps:o,content:t,styles:l,children:s}=e,i={...l,...o};return s?b.createElement("label",i,s):b.createElement("label",{...i,dangerouslySetInnerHTML:{__html:t}})},ae={type:"Label",label:"Label",category:"core",icon:m.LetterCaseToggleIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},ce=e=>{const{blockProps:o,fieldName:t,label:l,styles:s,inputStyles:i,required:a,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...s,...o,children:[r.jsx("input",{...i,name:t,type:"radio",required:a,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...i,...s,type:"radio",required:a,checked:c})},pe={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("flex items-center gap-x-2"),inputStyles:n.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"]},de=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:a,required:c,showLabel:p,_multiple:h,options:y,defaultValue:C}=e,f=h&&C?C.split(",").map(g=>g.trim()):C||"";return p?r.jsxs("div",{...i,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsxs("select",{...a,required:c,multiple:h,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:s}),u.map(y,g=>r.jsx("option",{value:g==null?void 0:g.value,children:g==null?void 0:g.label},g==null?void 0:g.value))]})]}):r.jsxs("select",{...i,...o,required:c,multiple:h,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:s}),u.map(y,g=>r.jsx("option",{value:g==null?void 0:g.value,children:g==null?void 0:g.label},g==null?void 0:g.value))]})},ue={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),inputStyles:n.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"]},me=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:a,rows:c,showLabel:p,required:h,defaultValue:y}=e;return p?r.jsxs("div",{...i,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("textarea",{name:t,...a,placeholder:s,rows:c,required:h,defaultValue:y})]}):r.jsx("textarea",{name:t,...o,...a,...i,placeholder:s,rows:c,required:h,defaultValue:y})},ye={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",props:n.registerChaiBlockProps({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:n.stylesProp(""),inputStyles:n.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"]},ge=e=>{const{blockProps:o,styles:t,content:l,tag:s="h1",children:i=null}=e;return i?b.createElement(s,{...t,...o},i):b.createElement(s,{...t,...o,dangerouslySetInnerHTML:{__html:l}})},he={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:m.HeadingIcon,group:"typography",props:n.registerChaiBlockProps({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:n.stylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea","ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},be=e=>{const{blockProps:o,styles:t}=e;return x.createElement("br",{...o,...t})},fe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},xe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("table",{...o,...l},t):r.jsx(k,{})},Ce=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("thead",{...o,...l},t):r.jsx(k,{})},ke=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tbody",{...o,...l},t):r.jsx(k,{})},Pe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tr",{...o,...l},t):r.jsx(k,{})},Be=e=>{const{blockProps:o,children:t,content:l,styles:s}=e;return!t&&u.isEmpty(l)?r.jsx(k,{}):t?x.createElement("td",{...o,...s},t):x.createElement("td",{...o,...s,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(xe,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:m.TableIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),blocks:B("Table")});d.registerChaiBlock(Ce,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:m.BorderTopIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),blocks:B("TableHead")});d.registerChaiBlock(ke,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:m.BorderAllIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),blocks:B("TableBody")});d.registerChaiBlock(Pe,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:m.ViewHorizontalIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),blocks:B("TableRow")});d.registerChaiBlock(Be,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:m.DragHandleHorizontalIcon,props:n.registerChaiBlockProps({properties:{styles:n.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=(i,a)=>({_id:P.generateUUID(),_parent:i,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+a}`}),t=i=>{const a=P.generateUUID(),c={_type:"TableRow",_id:a,styles:"#styles:,border-b"};return i&&(c._parent=i),[c,o(a,"1"),o(a,"2"),o(a,"3")]},l=i=>{const a=P.generateUUID(),c={_id:a,_type:"TableHead",styles:"#styles:,font-medium"};return i&&(c._parent=i),[c,...t(a)]},s=i=>{const a=P.generateUUID(),c={_id:a,_type:"TableBody",styles:"#styles:,"};return i&&(c._parent=i),[c,...t(a),...t(a)]};if(e==="Table"){const i=P.generateUUID();return[{_id:i,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...l(i),...s(i)]}return e==="TableRow"?t():e==="TableHead"?l():e==="TableBody"?s():[]}const we="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",ve=e=>{const{blockProps:o,image:t,mobileImage:l,styles:s,alt:i,height:a,width:c,lazyLoading:p,mobileWidth:h,mobileHeight:y}=e;return u.isEmpty(t)?r.jsx(k,{className:"h-36"}):r.jsxs("picture",{children:[l&&r.jsx("source",{srcSet:l,media:"(max-width: 480px)",width:h,height:y}),r.jsx("img",{...o,...s,src:t,alt:i,loading:p?"lazy":"eager",width:c,height:a})]})},Ie={type:"Image",description:"A image component",label:"Image",category:"core",icon:m.ImageIcon,group:"media",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("w-full h-full object-cover"),image:{type:"string",title:"Image",default:we,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"]},je=e=>{const{blockProps:o,link:t,children:l,styles:s,inBuilder:i,content:a}=e;let c={};return!l&&u.isEmpty(a)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),i?l?r.jsx("span",{role:"link",...o,style:c,...s,children:l}):x.createElement("span",{...o,...s,style:c,role:"link"},a):l?r.jsx("a",{"aria-label":a,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...s,children:l}):x.createElement("a",{...o,...s,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":a},a)},Le={type:"Link",description:"A link component",label:"Link",category:"core",icon:m.Link1Icon,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("block"),content:{type:"string",default:"Link text 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"},Se=e=>{const{blockProps:o,children:t,styles:l,tag:s,inBuilder:i}=e;return!t&&u.isEmpty(l==null?void 0:l.className)?r.jsx(k,{inBuilder:i}):b.createElement(s||"ul",{...o,...l},t)},_e={type:"List",description:"A list component",label:"List",icon:m.RowsIcon,category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.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"}]},Ne=e=>{const{blockProps:o,content:t,styles:l,children:s,tag:i}=e;return s?b.createElement(i||"li",{...l,...o},s):b.createElement(i||"li",{...l,...o,dangerouslySetInnerHTML:{__html:t}})},Te={type:"ListItem",description:"A list item component",label:"List Item",icon:m.ColumnsIcon,category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.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"},Ee=e=>{const{blockProps:o,styles:t,content:l}=e;if(!u.isNull(e.children))return b.createElement("p",{...t,...o},e.children);const s=I(t,"rte");return b.createElement("div",{...s,...o,dangerouslySetInnerHTML:{__html:l}})},Re={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:m.TextIcon,group:"typography",props:n.registerChaiBlockProps({properties:{styles:n.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"},Ae=e=>{const{blockProps:o,content:t,styles:l}=e,s=I(l,"rte");return r.jsx("div",{...o,...s,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",hidden:!0,category:"core",icon:m.CursorTextIcon,group:"typography",props:n.registerChaiBlockProps({properties:{styles:n.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"]},He=e=>{const{blockProps:o,styles:t,content:l,children:s=null,tag:i}=e;return s?b.createElement("span",{...t,...o},s):b.createElement(i||"span",{...t,...o,dangerouslySetInnerHTML:{__html:l||""}})},$e={type:"Span",description:"A span component",label:"Span",category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},De=e=>e.inBuilder||e.forceWrapper?r.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Ve={type:"Text",description:"A text component with no styling",label:"Text",category:"core",group:"typography",blocks:()=>[{_id:"a",_type:"Text",_name:"Text",content:""}],icon:m.SpaceBetweenVerticallyIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},v={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}}},j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,L=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/,ze=(e,o)=>{const t=u.get(o,"autoplay",!1),l=u.get(o,"controls",!1),s=u.get(o,"loop",!1),i=t||u.get(o,"muted",!0);if(j.test(e)){const a=e.match(j);if(a){const c=a[4];let p=`https://www.youtube.com/embed/${c}`,h=t?"autoplay=1":"";return h+=s?`&loop=1&playlist=${c}`:"",h+=i?"&mute=1&muted=1":"",h+=l?"&controls=1":"&controls=0",`${p}?${h}`}}if(L.test(e)){const a=e.match(L);if(a){const c=a[1];let p="";return p+=t?"autoplay=1":"",p+=l?"&controls=1":"&controls=0",p+=i?"&muted=1":"",p+=s?"&loop=1":"",`https://player.vimeo.com/video/${c}?${p}`}}return null},Fe=e=>{const{url:o,blockProps:t,styles:l,controls:s,videoSource:i,inBuilder:a,title:c}=e,p=ze(o,s);return r.jsxs("div",{...u.omit(l,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!p&&a?r.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:u.isEmpty(o)?`Provided ${i} video link in settings Video URL.`:`Provided ${i} video link is invalid.`}):r.jsx("iframe",{width:"100%",src:p??"",title:c||"Video player",...u.pick(l,"className")}),a&&r.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Ue=e=>{const{url:o,styles:t,controls:l,sources:s,poster:i,blockProps:a,title:c}=e;let p=i;const h=[...u.get(s,"srcsets",[])||[]];o&&typeof o=="string"&&h.push({url:o,width:9999});const y=h.sort((f,g)=>f.width-g.width).filter(f=>!u.isEmpty(f.url)&&!u.isEmpty(f.width));y.length===0&&!p&&(p="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const C=u.get(l,"autoplay",!1)||u.get(l,"muted",!0);return(p||!u.isEmpty(y))&&r.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:x.createElement("video",{...t,...a,title:c||"Video player",key:JSON.stringify(y),controls:u.get(l,"controls",!1),autoPlay:u.get(l,"autoplay",!1),loop:u.get(l,"loop",!1),poster:p,...C?{muted:!0}:{}},y.map(f=>{if(!f.url||f.url.length<4||isNaN(f.width))return null;const g=`(max-width: ${f.width}px)`;return r.jsx("source",{src:f.url,media:g,type:f.type},f.url)}),"Your browser does not support the video tag.")})},qe=e=>{const{videoSource:o}=e;return o==="Custom"?r.jsx(Ue,{...e}):o==="Youtube"||o==="Vimeo"?r.jsx(Fe,{...e}):r.jsxs("div",{children:["Invalid video source : ",o]})},Oe={type:"Video",label:"Video",category:"core",icon:m.VideoIcon,group:"media",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"},title:{type:"string",title:"Video Title",default:"Video player"}},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:{...v}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""},controls:{...v}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""},controls:{...v}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url","title"]},Ze=e=>{const{paginationStyles:o}=e,t=d.getRegisteredChaiBlock("Pagination");return r.jsx("div",{...o,children:t?b.createElement(t.component,{...u.omit(e,["paginationStyles"]),blockProps:{}}):r.jsxs(r.Fragment,{children:[r.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:r.jsx(m.ChevronLeftIcon,{className:"h-4 w-4"})}),r.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"}),r.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"}),r.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"}),r.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"}),r.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"}),r.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:r.jsx(m.ChevronRightIcon,{className:"h-4 w-4"})})]})})},Ge=e=>{const{children:o,tag:t,styles:l,blockProps:s,$loading:i}=e,{pagination:a,inBuilder:c}=e;let p=o;return u.isEmpty(p)&&c&&(p=r.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"?i&&c?Array.from({length:2}).map((h,y)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},y)):p:r.jsxs(r.Fragment,{children:[b.createElement(t,{...s,...l},i&&c?Array.from({length:2}).map((h,y)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},y)):p),a&&r.jsx(Ze,{...u.pick(e,["limit","totalItems","paginationStrategy","inBuilder","draft","lang","paginationStyles"])})]})},We={type:"Repeater",label:"Repeater",icon:m.LoopIcon,group:"basic",description:"Repeater block is used to display a list of items based on data binding in repeaterItems",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"}],props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),paginationStyles:n.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"]},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"},Ye=({children:e,blockProps:o,styles:t,parentTag:l,inBuilder:s})=>{let i="li";switch(l){case"ul":i="li";break;case"ol":i="li";break;default:i="div"}return!e&&s?b.createElement(i,{...o,...t},r.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"})):b.createElement(i,{...o,...t},e)},Qe={type:"RepeaterItem",label:"Repeater Item",icon:m.LoopIcon,hidden:!0,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),parentTag:d.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Je=({children:e,blockProps:o,styles:t})=>b.createElement("div",{...o,...t},e),Xe={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Ke=()=>{d.registerChaiBlock(_,N),d.registerChaiBlock(Q,J),d.registerChaiBlock(T,E),d.registerChaiBlock(ge,he),d.registerChaiBlock(Ee,Re),d.registerChaiBlock(He,$e),d.registerChaiBlock(Ae,Me),d.registerChaiBlock(je,Le),d.registerChaiBlock(Se,_e),d.registerChaiBlock(Ne,Te),d.registerChaiBlock(V,z),d.registerChaiBlock(ve,Ie),d.registerChaiBlock(qe,Oe),d.registerChaiBlock(R,A),d.registerChaiBlock(M,H),d.registerChaiBlock(De,Ve),d.registerChaiBlock(ee,te),d.registerChaiBlock(oe,le),d.registerChaiBlock(se,ie),d.registerChaiBlock(X,K),d.registerChaiBlock(ce,pe),d.registerChaiBlock(de,ue),d.registerChaiBlock(me,ye),d.registerChaiBlock(ne,ae),d.registerChaiBlock(be,fe),d.registerChaiBlock(W,Y),d.registerChaiBlock($,D),d.registerChaiBlock(F,U),d.registerChaiBlock(Z,G),d.registerChaiBlock(q,O),d.registerChaiBlock(Ge,We),d.registerChaiBlock(Ye,Qe),d.registerChaiBlock(Je,Xe)};exports.loadWebBlocks=Ke;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-es"),r=require("react/jsx-runtime"),n=require("./runtime.cjs"),P=require("./common-functions-B3a4xKt_.cjs"),x=require("react"),m=require("@radix-ui/react-icons"),d=require("./core-BWQrViOY.cjs");function S(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=S(x),k=({className:e="",inBuilder:o})=>o?r.jsx("div",{className:P.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:r.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,_=e=>{const{blockProps:o,inBuilder:t,backgroundImage:l,children:s,tag:i="div",styles:a}=e;let c=s;s||(c=r.jsx(k,{inBuilder:t}));let p={};return l&&(p={backgroundImage:`url(${l})`}),b.createElement(i,{...o,...a,style:p},c)},N={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.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","ui:allowEmpty":!0}}}}),canAcceptBlock:()=>!0},T=e=>{const{blockProps:o,iconSize:t,icon:l,content:s,styles:i,children:a,iconPos:c,link:p,inBuilder:h}=e,y=l,C=a||r.jsxs(r.Fragment,{children:[s&&r.jsx("span",{children:s}),y&&r.jsx("div",{style:{width:t+"px"},className:c+" "+(s?c==="order-first"?"mr-2":"ml-2":"")||"",dangerouslySetInnerHTML:{__html:y}})]}),f=x.createElement("button",{...o,...i,type:"button","aria-label":s},C);return u.isEmpty(u.get(p,"href"))?f:h?r.jsx("span",{children:f}):r.jsx("a",{"aria-label":s,href:u.get(p,"href")||"/",target:u.get(p,"target","_self"),children:f})},E={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:m.ButtonIcon,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.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"],enumNames:["Left","Right"]},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"]},R=e=>{const{blockProps:o,styles:t,htmlCode:l,inBuilder:s}=e;return s?r.jsxs("div",{className:"relative",...o,children:[s?r.jsx("div",{...t,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...t,dangerouslySetInnerHTML:{__html:l.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:l}})},A={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:m.CodeIcon,group:"advanced",props:n.registerChaiBlockProps({properties:{styles:n.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:l}=e;return t?r.jsx("div",{...l,children:r.jsx("div",{className:P.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:r.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"})})})}):r.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},H={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:m.CodeIcon,hidden:!0,group:"advanced",props:n.registerChaiBlockProps({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},$=e=>{const{blockProps:o,inBuilder:t,children:l,globalBlock:s}=e;return t&&!s?r.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:[r.jsxs("h1",{children:["Global Block - ",s]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},D={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,props:n.registerChaiBlockProps({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},I=(e,...o)=>({...e,className:P.cn(e.className,...o)}),V=e=>{const{blockProps:o,icon:t,styles:l,width:s,inBuilder:i,height:a}=e,c=I(l,"");if(u.isEmpty(t))return r.jsx(k,{inBuilder:i,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...c,style:{width:s?`${s}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},z={type:"Icon",label:"web_blocks.icon",category:"core",description:"Icon block is used to display an icon/svg.",icon:m.SketchLogoIcon,group:"media",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),icon:{type:"string",title:"Icon",default:'<svg xmlns="http://www.w3.org/2000/svg" class="chai-default-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-diamond-icon lucide-diamond"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"/></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},U=e=>{const{blockProps:o,inBuilder:t,children:l,partialBlockId:s}=e;return t&&!s?r.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:[r.jsxs("h1",{children:["Partial Block - ",s]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},F={type:"PartialBlock",description:"A partial block component. Partial blocks are global blocks that can be used in multiple pages.",label:"Partial Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,props:n.registerChaiBlockProps({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"}},q=e=>{const{blockProps:o,children:t,styles:l,colSpan:s,tabletColSpan:i,desktopColSpan:a}=e,p={className:[u.get(l,"className",""),u.get(w,["SMALL",isNaN(s)||!s?6:s],""),i?u.get(w,["MEDIUM",i||s],""):"",a?u.get(w,["LARGE",i||s],""):""].join(" ")};return r.jsx("div",{...o,...l,...p,children:t||r.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},O={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:m.LayoutIcon,wrapper:!0,hidden:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",props:n.registerChaiBlockProps({properties:{styles:n.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]}}})},Z=e=>{const{blockProps:o,children:t,styles:l,gutter:s}=e,a={className:[u.get(l,"className","")," grid grid-cols-12"].join()};return typeof(l==null?void 0:l.style)=="object"&&l.style!==null?a.style={...l.style,gap:`${s}px`}:a.style={gap:`${s}px`},r.jsx("div",{...o,...l,...a,children:t})},G={type:"Row",description:"A row component",label:"Row",group:"basic",icon:m.RowsIcon,hidden:!0,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",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},W=e=>{const{blockProps:o,styles:t}=e;return x.createElement("hr",{...t,...o})},Y={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},Q=e=>{const{blockProps:o,styles:t,backgroundImage:l}=e;let s={};return l&&(s={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...t,style:s})},J={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}})},X=e=>{const{blockProps:o,fieldName:t,label:l,styles:s,inputStyles:i,required:a,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...s,...o,children:[r.jsx("input",{...i,name:t,type:"checkbox",required:a,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...i,...s,type:"checkbox",required:a,defaultChecked:c})},K={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("flex items-center gap-x-2"),inputStyles:n.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{children:o,blockProps:t,errorMessage:l,successMessage:s,action:i,styles:a,inBuilder:c}=e;let p=o;o||(p=r.jsx(k,{inBuilder:c}));const h={"x-data":"{}","x-on:submit.prevent":"post"},y={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return r.jsxs("form",{...h,"data-error":l,"data-success":s,method:"post",action:i,...t,...a,children:[r.jsx("div",{...y}),p]})},te={type:"Form",label:"Form",category:"core",icon:m.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,"}],props:n.registerChaiBlockProps({properties:{styles:n.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},oe=e=>{const{blockProps:o,inBuilder:t,label:l,styles:s,icon:i,iconSize:a,iconPos:c}=e;return r.jsxs("button",{...s,...o||{},type:t?"button":"submit","aria-label":l,children:[l,i&&r.jsx("div",{style:{width:a+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:i}})]})},le={type:"FormButton",label:"Submit Button",category:"core",icon:m.ButtonIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.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"]},re=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},se=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:a,showLabel:c,required:p,inputType:h,defaultValue:y}=e,{type:C,autoComplete:f}=re(h);return c?r.jsxs("div",{...i,...o,children:[c&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("input",{name:t,defaultValue:y,...a,type:C,placeholder:s,required:p,autoComplete:f,...C==="hidden"&&y?{value:y}:{}})]}):r.jsx("input",{name:t,...o,...a,...i,type:C,placeholder:s,required:p,autoComplete:f,defaultValue:y,...C==="hidden"&&y?{value:y}:{}})},ie={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),inputStyles:n.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"]},ne=e=>{const{blockProps:o,content:t,styles:l,children:s}=e,i={...l,...o};return s?b.createElement("label",i,s):b.createElement("label",{...i,dangerouslySetInnerHTML:{__html:t}})},ae={type:"Label",label:"Label",category:"core",icon:m.LetterCaseToggleIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},ce=e=>{const{blockProps:o,fieldName:t,label:l,styles:s,inputStyles:i,required:a,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...s,...o,children:[r.jsx("input",{...i,name:t,type:"radio",required:a,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...i,...s,type:"radio",required:a,checked:c})},pe={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("flex items-center gap-x-2"),inputStyles:n.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"]},de=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:a,required:c,showLabel:p,_multiple:h,options:y,defaultValue:C}=e,f=h&&C?C.split(",").map(g=>g.trim()):C||"";return p?r.jsxs("div",{...i,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsxs("select",{...a,required:c,multiple:h,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:s}),u.map(y,g=>r.jsx("option",{value:g==null?void 0:g.value,children:g==null?void 0:g.label},g==null?void 0:g.value))]})]}):r.jsxs("select",{...i,...o,required:c,multiple:h,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:s}),u.map(y,g=>r.jsx("option",{value:g==null?void 0:g.value,children:g==null?void 0:g.label},g==null?void 0:g.value))]})},ue={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),inputStyles:n.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"]},me=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:a,rows:c,showLabel:p,required:h,defaultValue:y}=e;return p?r.jsxs("div",{...i,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("textarea",{name:t,...a,placeholder:s,rows:c,required:h,defaultValue:y})]}):r.jsx("textarea",{name:t,...o,...a,...i,placeholder:s,rows:c,required:h,defaultValue:y})},ye={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",props:n.registerChaiBlockProps({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:n.stylesProp(""),inputStyles:n.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"]},ge=e=>{const{blockProps:o,styles:t,content:l,tag:s="h1",children:i=null}=e;return i?b.createElement(s,{...t,...o},i):b.createElement(s,{...t,...o,dangerouslySetInnerHTML:{__html:l}})},he={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:m.HeadingIcon,group:"typography",props:n.registerChaiBlockProps({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:n.stylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea","ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},be=e=>{const{blockProps:o,styles:t}=e;return x.createElement("br",{...o,...t})},fe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},xe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("table",{...o,...l},t):r.jsx(k,{})},Ce=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("thead",{...o,...l},t):r.jsx(k,{})},ke=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tbody",{...o,...l},t):r.jsx(k,{})},Pe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tr",{...o,...l},t):r.jsx(k,{})},Be=e=>{const{blockProps:o,children:t,content:l,styles:s}=e;return!t&&u.isEmpty(l)?r.jsx(k,{}):t?x.createElement("td",{...o,...s},t):x.createElement("td",{...o,...s,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(xe,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:m.TableIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),blocks:B("Table")});d.registerChaiBlock(Ce,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:m.BorderTopIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),blocks:B("TableHead")});d.registerChaiBlock(ke,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:m.BorderAllIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),blocks:B("TableBody")});d.registerChaiBlock(Pe,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:m.ViewHorizontalIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("")}}),blocks:B("TableRow")});d.registerChaiBlock(Be,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:m.DragHandleHorizontalIcon,props:n.registerChaiBlockProps({properties:{styles:n.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=(i,a)=>({_id:P.generateUUID(),_parent:i,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+a}`}),t=i=>{const a=P.generateUUID(),c={_type:"TableRow",_id:a,styles:"#styles:,border-b"};return i&&(c._parent=i),[c,o(a,"1"),o(a,"2"),o(a,"3")]},l=i=>{const a=P.generateUUID(),c={_id:a,_type:"TableHead",styles:"#styles:,font-medium"};return i&&(c._parent=i),[c,...t(a)]},s=i=>{const a=P.generateUUID(),c={_id:a,_type:"TableBody",styles:"#styles:,"};return i&&(c._parent=i),[c,...t(a),...t(a)]};if(e==="Table"){const i=P.generateUUID();return[{_id:i,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...l(i),...s(i)]}return e==="TableRow"?t():e==="TableHead"?l():e==="TableBody"?s():[]}const we="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",ve=e=>{const{blockProps:o,image:t,mobileImage:l,styles:s,alt:i,height:a,width:c,lazyLoading:p,mobileWidth:h,mobileHeight:y}=e;return u.isEmpty(t)?r.jsx(k,{className:"h-36"}):r.jsxs("picture",{children:[l&&r.jsx("source",{srcSet:l,media:"(max-width: 480px)",width:h,height:y}),r.jsx("img",{...o,...s,src:t,alt:i,loading:p?"lazy":"eager",width:c,height:a})]})},Ie={type:"Image",description:"A image component",label:"Image",category:"core",icon:m.ImageIcon,group:"media",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("w-full h-full object-cover"),image:{type:"string",title:"Image",default:we,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"]},je=e=>{const{blockProps:o,link:t,children:l,styles:s,inBuilder:i,content:a}=e;let c={};return!l&&u.isEmpty(a)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),i?l?r.jsx("span",{role:"link",...o,style:c,...s,children:l}):x.createElement("span",{...o,...s,style:c,role:"link"},a):l?r.jsx("a",{"aria-label":a,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...s,children:l}):x.createElement("a",{...o,...s,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":a},a)},Le={type:"Link",description:"A link component",label:"Link",category:"core",icon:m.Link1Icon,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("block"),content:{type:"string",default:"Link text 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"},Se=e=>{const{blockProps:o,children:t,styles:l,tag:s,inBuilder:i}=e;return!t&&u.isEmpty(l==null?void 0:l.className)?r.jsx(k,{inBuilder:i}):b.createElement(s||"ul",{...o,...l},t)},_e={type:"List",description:"A list component",label:"List",icon:m.RowsIcon,category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.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"}]},Ne=e=>{const{blockProps:o,content:t,styles:l,children:s,tag:i}=e;return s?b.createElement(i||"li",{...l,...o},s):b.createElement(i||"li",{...l,...o,dangerouslySetInnerHTML:{__html:t}})},Te={type:"ListItem",description:"A list item component",label:"List Item",icon:m.ColumnsIcon,category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.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"},Ee=e=>{const{blockProps:o,styles:t,content:l}=e;if(!u.isNull(e.children))return b.createElement("p",{...t,...o},e.children);const s=I(t,"rte");return b.createElement("div",{...s,...o,dangerouslySetInnerHTML:{__html:l}})},Re={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:m.TextIcon,group:"typography",props:n.registerChaiBlockProps({properties:{styles:n.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"},Ae=e=>{const{blockProps:o,content:t,styles:l}=e,s=I(l,"rte");return r.jsx("div",{...o,...s,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",hidden:!0,category:"core",icon:m.CursorTextIcon,group:"typography",props:n.registerChaiBlockProps({properties:{styles:n.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"]},He=e=>{const{blockProps:o,styles:t,content:l,children:s=null,tag:i}=e;return s?b.createElement("span",{...t,...o},s):b.createElement(i||"span",{...t,...o,dangerouslySetInnerHTML:{__html:l||""}})},$e={type:"Span",description:"A span component",label:"Span",category:"core",group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},De=e=>e.inBuilder||e.forceWrapper?r.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Ve={type:"Text",description:"A text component with no styling",label:"Text",category:"core",group:"typography",blocks:()=>[{_id:"a",_type:"Text",_name:"Text",content:""}],icon:m.SpaceBetweenVerticallyIcon,props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},v={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}}},j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,L=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/,ze=(e,o)=>{const t=u.get(o,"autoplay",!1),l=u.get(o,"controls",!1),s=u.get(o,"loop",!1),i=t||u.get(o,"muted",!0);if(j.test(e)){const a=e.match(j);if(a){const c=a[4];let p=`https://www.youtube.com/embed/${c}`,h=t?"autoplay=1":"";return h+=s?`&loop=1&playlist=${c}`:"",h+=i?"&mute=1&muted=1":"",h+=l?"&controls=1":"&controls=0",`${p}?${h}`}}if(L.test(e)){const a=e.match(L);if(a){const c=a[1];let p="";return p+=t?"autoplay=1":"",p+=l?"&controls=1":"&controls=0",p+=i?"&muted=1":"",p+=s?"&loop=1":"",`https://player.vimeo.com/video/${c}?${p}`}}return null},Ue=e=>{const{url:o,blockProps:t,styles:l,controls:s,videoSource:i,inBuilder:a,title:c}=e,p=ze(o,s);return r.jsxs("div",{...u.omit(l,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!p&&a?r.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:u.isEmpty(o)?`Provided ${i} video link in settings Video URL.`:`Provided ${i} video link is invalid.`}):r.jsx("iframe",{width:"100%",src:p??"",title:c||"Video player",...u.pick(l,"className")}),a&&r.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Fe=e=>{const{url:o,styles:t,controls:l,sources:s,poster:i,blockProps:a,title:c}=e;let p=i;const h=[...u.get(s,"srcsets",[])||[]];o&&typeof o=="string"&&h.push({url:o,width:9999});const y=h.sort((f,g)=>f.width-g.width).filter(f=>!u.isEmpty(f.url)&&!u.isEmpty(f.width));y.length===0&&!p&&(p="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const C=u.get(l,"autoplay",!1)||u.get(l,"muted",!0);return(p||!u.isEmpty(y))&&r.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:x.createElement("video",{...t,...a,title:c||"Video player",key:JSON.stringify(y),controls:u.get(l,"controls",!1),autoPlay:u.get(l,"autoplay",!1),loop:u.get(l,"loop",!1),poster:p,...C?{muted:!0}:{}},y.map(f=>{if(!f.url||f.url.length<4||isNaN(f.width))return null;const g=`(max-width: ${f.width}px)`;return r.jsx("source",{src:f.url,media:g,type:f.type},f.url)}),"Your browser does not support the video tag.")})},qe=e=>{const{videoSource:o}=e;return o==="Custom"?r.jsx(Fe,{...e}):o==="Youtube"||o==="Vimeo"?r.jsx(Ue,{...e}):r.jsxs("div",{children:["Invalid video source : ",o]})},Oe={type:"Video",label:"Video",category:"core",icon:m.VideoIcon,group:"media",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"},title:{type:"string",title:"Video Title",default:"Video player"}},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:{...v}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""},controls:{...v}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""},controls:{...v}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url","title"]},Ze=e=>{const{paginationStyles:o}=e,t=d.getRegisteredChaiBlock("Pagination");return r.jsx("div",{...o,children:t?b.createElement(t.component,{...u.omit(e,["paginationStyles"]),blockProps:{}}):r.jsxs(r.Fragment,{children:[r.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:r.jsx(m.ChevronLeftIcon,{className:"h-4 w-4"})}),r.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"}),r.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"}),r.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"}),r.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"}),r.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"}),r.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:r.jsx(m.ChevronRightIcon,{className:"h-4 w-4"})})]})})},Ge=e=>{const{children:o,tag:t,styles:l,blockProps:s,$loading:i}=e,{pagination:a,inBuilder:c}=e;let p=o;return u.isEmpty(p)&&c&&(p=r.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"?i&&c?Array.from({length:2}).map((h,y)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},y)):p:r.jsxs(r.Fragment,{children:[b.createElement(t,{...s,...l},i&&c?Array.from({length:2}).map((h,y)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},y)):p),a&&r.jsx(Ze,{...u.pick(e,["limit","totalItems","paginationStrategy","inBuilder","draft","lang","paginationStyles"])})]})},We={type:"Repeater",label:"Repeater",icon:m.LoopIcon,group:"basic",description:"Repeater block is used to display a list of items based on data binding in repeaterItems",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"}],props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),paginationStyles:n.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"]},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"},Ye=({children:e,blockProps:o,styles:t,parentTag:l,inBuilder:s})=>{let i="li";switch(l){case"ul":i="li";break;case"ol":i="li";break;default:i="div"}return!e&&s?b.createElement(i,{...o,...t},r.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"})):b.createElement(i,{...o,...t},e)},Qe={type:"RepeaterItem",label:"Repeater Item",icon:m.LoopIcon,hidden:!0,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp(""),parentTag:d.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Je=({children:e,blockProps:o,styles:t})=>b.createElement("div",{...o,...t},e),Xe={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",props:n.registerChaiBlockProps({properties:{styles:n.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Ke=()=>{d.registerChaiBlock(_,N),d.registerChaiBlock(Q,J),d.registerChaiBlock(T,E),d.registerChaiBlock(ge,he),d.registerChaiBlock(Ee,Re),d.registerChaiBlock(He,$e),d.registerChaiBlock(Ae,Me),d.registerChaiBlock(je,Le),d.registerChaiBlock(Se,_e),d.registerChaiBlock(Ne,Te),d.registerChaiBlock(V,z),d.registerChaiBlock(ve,Ie),d.registerChaiBlock(qe,Oe),d.registerChaiBlock(R,A),d.registerChaiBlock(M,H),d.registerChaiBlock(De,Ve),d.registerChaiBlock(ee,te),d.registerChaiBlock(oe,le),d.registerChaiBlock(se,ie),d.registerChaiBlock(X,K),d.registerChaiBlock(ce,pe),d.registerChaiBlock(de,ue),d.registerChaiBlock(me,ye),d.registerChaiBlock(ne,ae),d.registerChaiBlock(be,fe),d.registerChaiBlock(W,Y),d.registerChaiBlock($,D),d.registerChaiBlock(U,F),d.registerChaiBlock(Z,G),d.registerChaiBlock(q,O),d.registerChaiBlock(Ge,We),d.registerChaiBlock(Ye,Qe),d.registerChaiBlock(Je,Xe)};exports.loadWebBlocks=Ke;
@@ -1,12 +1,12 @@
1
1
  import { isEmpty as w, get as C, map as T, isNull as F, omit as E, pick as M } from "lodash-es";
2
2
  import { jsx as i, jsxs as h, Fragment as S } from "react/jsx-runtime";
3
3
  import { registerChaiBlockProps as u, stylesProp as p } from "./runtime.js";
4
- import { c as N, g as I } from "./common-functions-D2lMFR6K.js";
4
+ import { c as _, g as I } from "./common-functions-D2lMFR6K.js";
5
5
  import * as b from "react";
6
6
  import { createElement as x } from "react";
7
7
  import { ButtonIcon as H, CodeIcon as $, FrameIcon as j, SketchLogoIcon as U, RowsIcon as D, LayoutIcon as Z, DividerHorizontalIcon as q, CheckboxIcon as G, FileTextIcon as W, InputIcon as V, LetterCaseToggleIcon as O, RadiobuttonIcon as Y, DropdownMenuIcon as Q, HeadingIcon as J, TableIcon as X, BorderTopIcon as K, BorderAllIcon as ee, ViewHorizontalIcon as te, DragHandleHorizontalIcon as oe, ImageIcon as le, Link1Icon as re, ColumnsIcon as ne, TextIcon as ie, CursorTextIcon as ae, SpaceBetweenVerticallyIcon as se, VideoIcon as ce, ChevronLeftIcon as pe, ChevronRightIcon as de, LoopIcon as z } from "@radix-ui/react-icons";
8
8
  import { r as d, e as ue, c as me } from "./core-QlWEXm1d.js";
9
- const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div", { className: N("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ i("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ i("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, ye = (e) => {
9
+ const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div", { className: _("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ i("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ i("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, ye = (e) => {
10
10
  const { blockProps: o, inBuilder: t, backgroundImage: l, children: r, tag: n = "div", styles: a } = e;
11
11
  let s = r;
12
12
  r || (s = /* @__PURE__ */ i(v, { inBuilder: t }));
@@ -165,7 +165,7 @@ const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
165
165
  i18nProps: ["htmlCode"]
166
166
  }, ke = (e) => {
167
167
  const { scripts: o, inBuilder: t, blockProps: l } = e;
168
- return t ? /* @__PURE__ */ i("div", { ...l, children: /* @__PURE__ */ i("div", { className: N("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ i("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ i("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" }) }) }) }) : /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: o } });
168
+ return t ? /* @__PURE__ */ i("div", { ...l, children: /* @__PURE__ */ i("div", { className: _("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ i("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ i("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" }) }) }) }) : /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: o } });
169
169
  }, xe = {
170
170
  type: "CustomScript",
171
171
  description: "similar to a script element in HTML",
@@ -219,11 +219,11 @@ const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
219
219
  }
220
220
  }
221
221
  })
222
- }, _ = (e, ...o) => ({
222
+ }, N = (e, ...o) => ({
223
223
  ...e,
224
- className: N(e.className, ...o)
224
+ className: _(e.className, ...o)
225
225
  }), Ie = (e) => {
226
- const { blockProps: o, icon: t, styles: l, width: r, inBuilder: n, height: a } = e, s = _(l, "");
226
+ const { blockProps: o, icon: t, styles: l, width: r, inBuilder: n, height: a } = e, s = N(l, "");
227
227
  if (w(t))
228
228
  return /* @__PURE__ */ i(v, { inBuilder: n, className: "h-8 w-14" });
229
229
  const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
@@ -349,7 +349,7 @@ const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
349
349
  a ? C(L, ["LARGE", n || r], "") : ""
350
350
  ].join(" ") };
351
351
  return /* @__PURE__ */ i("div", { ...o, ...l, ...c, children: t || /* @__PURE__ */ i("div", { className: "h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900" }) });
352
- }, Ne = {
352
+ }, _e = {
353
353
  type: "Column",
354
354
  description: "A column component",
355
355
  label: "Column",
@@ -386,7 +386,7 @@ const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
386
386
  }
387
387
  }
388
388
  })
389
- }, _e = (e) => {
389
+ }, Ne = (e) => {
390
390
  const { blockProps: o, children: t, styles: l, gutter: r } = e, a = { className: [C(l, "className", ""), " grid grid-cols-12"].join() };
391
391
  return typeof (l == null ? void 0 : l.style) == "object" && l.style !== null ? a.style = { ...l.style, gap: `${r}px` } : a.style = { gap: `${r}px` }, /* @__PURE__ */ i("div", { ...o, ...l, ...a, children: t });
392
392
  }, Te = {
@@ -514,9 +514,9 @@ const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
514
514
  aiProps: ["label"],
515
515
  i18nProps: ["label"]
516
516
  }, je = (e) => {
517
- const { children: o, blockProps: t, errorMessage: l, successMessage: r, styles: n, inBuilder: a } = e;
518
- let s = o;
519
- return o || (s = /* @__PURE__ */ i(v, { inBuilder: a })), /* @__PURE__ */ h(
517
+ const { children: o, blockProps: t, errorMessage: l, successMessage: r, action: n, styles: a, inBuilder: s } = e;
518
+ let c = o;
519
+ return o || (c = /* @__PURE__ */ i(v, { inBuilder: s })), /* @__PURE__ */ h(
520
520
  "form",
521
521
  {
522
522
  ...{
@@ -526,14 +526,15 @@ const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
526
526
  "data-error": l,
527
527
  "data-success": r,
528
528
  method: "post",
529
+ action: n,
529
530
  ...t,
530
- ...n,
531
+ ...a,
531
532
  children: [
532
533
  /* @__PURE__ */ i("div", { ...{
533
534
  "x-html": "",
534
535
  ":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
535
536
  } }),
536
- s
537
+ c
537
538
  ]
538
539
  }
539
540
  );
@@ -556,10 +557,10 @@ const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div",
556
557
  props: u({
557
558
  properties: {
558
559
  styles: p(""),
559
- formName: {
560
+ action: {
560
561
  type: "string",
561
- title: "Form Name",
562
- default: "contact"
562
+ title: "Submit URL",
563
+ default: "/api/form"
563
564
  },
564
565
  errorMessage: {
565
566
  type: "string",
@@ -1538,7 +1539,7 @@ const st = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1538
1539
  }, ft = (e) => {
1539
1540
  const { blockProps: o, styles: t, content: l } = e;
1540
1541
  if (!F(e.children)) return b.createElement("p", { ...t, ...o }, e.children);
1541
- const r = _(t, "rte");
1542
+ const r = N(t, "rte");
1542
1543
  return b.createElement("div", {
1543
1544
  ...r,
1544
1545
  ...o,
@@ -1566,7 +1567,7 @@ const st = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1566
1567
  aiProps: ["content"],
1567
1568
  canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
1568
1569
  }, Ct = (e) => {
1569
- const { blockProps: o, content: t, styles: l } = e, r = _(l, "rte");
1570
+ const { blockProps: o, content: t, styles: l } = e, r = N(l, "rte");
1570
1571
  return /* @__PURE__ */ i("div", { ...o, ...r, dangerouslySetInnerHTML: { __html: t } });
1571
1572
  }, kt = {
1572
1573
  type: "RichText",
@@ -1726,7 +1727,7 @@ const st = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1726
1727
  "Invalid video source : ",
1727
1728
  o
1728
1729
  ] });
1729
- }, Nt = {
1730
+ }, _t = {
1730
1731
  type: "Video",
1731
1732
  label: "Video",
1732
1733
  category: "core",
@@ -1816,7 +1817,7 @@ const st = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1816
1817
  }
1817
1818
  }),
1818
1819
  i18nProps: ["url", "title"]
1819
- }, _t = (e) => {
1820
+ }, Nt = (e) => {
1820
1821
  const { paginationStyles: o } = e, t = ue("Pagination");
1821
1822
  return /* @__PURE__ */ i("div", { ...o, children: t ? b.createElement(t.component, { ...E(e, ["paginationStyles"]), blockProps: {} }) : /* @__PURE__ */ h(S, { children: [
1822
1823
  /* @__PURE__ */ i(
@@ -1850,7 +1851,7 @@ const st = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
1850
1851
  ] }, m)) : c
1851
1852
  ),
1852
1853
  a && /* @__PURE__ */ i(
1853
- _t,
1854
+ Nt,
1854
1855
  {
1855
1856
  ...M(e, [
1856
1857
  "limit",
@@ -2014,7 +2015,7 @@ const st = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG
2014
2015
  canMove: () => !1,
2015
2016
  canDuplicate: () => !1
2016
2017
  }, Zt = () => {
2017
- d(ye, ge), d(Ee, Me), d(be, fe), d(Ke, et), d(ft, ht), d(xt, wt), d(Ct, kt), d(dt, ut), d(mt, yt), d(gt, bt), d(Ie, Pe), d(ct, pt), d(St, Nt), d(he, Ce), d(ke, xe), d(vt, It), d(je, De), d(Ve, ze), d(Ue, Ze), d(He, $e), d(We, Oe), d(Ye, Qe), d(Je, Xe), d(qe, Ge), d(tt, ot), d(Re, Ae), d(we, ve), d(Le, Be), d(_e, Te), d(Se, Ne), d(Tt, Rt), d(At, Et), d(Mt, Ht);
2018
+ d(ye, ge), d(Ee, Me), d(be, fe), d(Ke, et), d(ft, ht), d(xt, wt), d(Ct, kt), d(dt, ut), d(mt, yt), d(gt, bt), d(Ie, Pe), d(ct, pt), d(St, _t), d(he, Ce), d(ke, xe), d(vt, It), d(je, De), d(Ve, ze), d(Ue, Ze), d(He, $e), d(We, Oe), d(Ye, Qe), d(Je, Xe), d(qe, Ge), d(tt, ot), d(Re, Ae), d(we, ve), d(Le, Be), d(Ne, Te), d(Se, _e), d(Tt, Rt), d(At, Et), d(Mt, Ht);
2018
2019
  };
2019
2020
  export {
2020
2021
  Zt as loadWebBlocks
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),a=require("./register-chai-top-bar-DWTuRU53.cjs"),u=require("jotai"),x=require("lodash-es"),n=require("lucide-react"),c=require("./index-B5qvHqN5.cjs"),m=[{title:"mobile_xs_title",content:"mobile_xs_content",icon:e.jsx(n.Smartphone,{className:"h-4 w-4"}),width:400},{title:"tablet_md_title",content:"tablet_md_content",icon:e.jsx(n.Tablet,{className:"h-4 w-4"}),width:800},{title:"desktop_xl_title",content:"desktop_xl_content",icon:e.jsx(n.Laptop,{className:"h-4 w-4"}),width:1200},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",icon:e.jsx(n.LaptopMinimal,{className:"h-4 w-4"}),width:1600}],w=({currentWidth:t,width:s,icon:o,setIframeWidth:r})=>e.jsx(a.Button,{className:"px-3 py-3",onClick:()=>r(s),variant:s===t?"default":"ghost",children:o}),p=()=>{const[t,s]=l.useState(1200),o=i=>s(i),[r,d]=u.useAtom(c.previewUrlAtom);if(!r)return null;const h=()=>{d("")};return e.jsxs("div",{className:"absolute inset-0 z-[999999] flex h-screen w-screen flex-col overflow-hidden bg-gray-100",children:[e.jsxs("div",{className:"flex h-[50px] items-center justify-center border-b border-gray-200 px-4 shadow-sm",children:[e.jsx("div",{className:"flex items-center justify-center rounded-md border border-gray-300",children:x.map(m,i=>l.createElement(w,{...i,setIframeWidth:o,key:i.title,currentWidth:t}))})," ",e.jsx(c.Tooltip,{content:"Exit Preview",delayDuration:0,children:e.jsx(a.Button,{variant:"destructive",size:"sm",onClick:h,children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:"currentColor",fillRule:"evenodd","clip-rule":"evenodd"})})})})]}),e.jsx("iframe",{style:{width:`${t}px`,transition:"width 0.3s ease-in-out"},className:"no-scrollbar mx-auto h-full overflow-y-auto border bg-white",src:r})]})};exports.default=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),a=require("./register-chai-top-bar-DWTuRU53.cjs"),u=require("jotai"),x=require("lodash-es"),n=require("lucide-react"),c=require("./index-BGGNVIKx.cjs"),m=[{title:"mobile_xs_title",content:"mobile_xs_content",icon:e.jsx(n.Smartphone,{className:"h-4 w-4"}),width:400},{title:"tablet_md_title",content:"tablet_md_content",icon:e.jsx(n.Tablet,{className:"h-4 w-4"}),width:800},{title:"desktop_xl_title",content:"desktop_xl_content",icon:e.jsx(n.Laptop,{className:"h-4 w-4"}),width:1200},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",icon:e.jsx(n.LaptopMinimal,{className:"h-4 w-4"}),width:1600}],w=({currentWidth:t,width:s,icon:o,setIframeWidth:r})=>e.jsx(a.Button,{className:"px-3 py-3",onClick:()=>r(s),variant:s===t?"default":"ghost",children:o}),p=()=>{const[t,s]=l.useState(1200),o=i=>s(i),[r,d]=u.useAtom(c.previewUrlAtom);if(!r)return null;const h=()=>{d("")};return e.jsxs("div",{className:"absolute inset-0 z-[999999] flex h-screen w-screen flex-col overflow-hidden bg-gray-100",children:[e.jsxs("div",{className:"flex h-[50px] items-center justify-center border-b border-gray-200 px-4 shadow-sm",children:[e.jsx("div",{className:"flex items-center justify-center rounded-md border border-gray-300",children:x.map(m,i=>l.createElement(w,{...i,setIframeWidth:o,key:i.title,currentWidth:t}))})," ",e.jsx(c.Tooltip,{content:"Exit Preview",delayDuration:0,children:e.jsx(a.Button,{variant:"destructive",size:"sm",onClick:h,children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:"currentColor",fillRule:"evenodd","clip-rule":"evenodd"})})})})]}),e.jsx("iframe",{style:{width:`${t}px`,transition:"width 0.3s ease-in-out"},className:"no-scrollbar mx-auto h-full overflow-y-auto border bg-white",src:r})]})};exports.default=p;
@@ -4,7 +4,7 @@ import { B as s } from "./register-chai-top-bar-CX_JkRJn.js";
4
4
  import { useAtom as h } from "jotai";
5
5
  import { map as p } from "lodash-es";
6
6
  import { Smartphone as w, Tablet as f, Laptop as u, LaptopMinimal as x } from "lucide-react";
7
- import { p as v, T as _ } from "./index-GfOB5KV1.js";
7
+ import { p as v, T as _ } from "./index-ckjNCVor.js";
8
8
  const b = [
9
9
  {
10
10
  title: "mobile_xs_title",
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Suraj Air",
6
6
  "license": "BSD-3-Clause",
7
7
  "homepage": "https://chaibuilder.com",
8
- "version": "4.0.0-beta.24",
8
+ "version": "4.0.0-beta.26",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",