@chaibuilder/sdk 2.2.33 → 2.2.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/render.cjs +2 -2
- package/dist/render.js +68 -66
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +127 -127
- package/package.json +1 -1
package/dist/render.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./plugin-CSgw-f78.cjs"),p=require("./apply-binding-DpBwzIf9.cjs"),r=require("lodash-es"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./plugin-CSgw-f78.cjs"),p=require("./apply-binding-DpBwzIf9.cjs"),r=require("lodash-es"),I=require("@tailwindcss/aspect-ratio"),q=require("@tailwindcss/forms"),$=require("@tailwindcss/typography");require("tailwindcss-animate");const E=require("./get-chai-builder-theme-B1tr_NJB.cjs"),F=require("@mhsdesign/jit-browser-tailwindcss"),L=require("@tailwindcss/container-queries"),m=require("react/jsx-runtime"),u=require("react"),R=require("@chaibuilder/runtime");function D(e,t){const n=e.filter(({_type:i})=>i==="GlobalBlock"||i==="PartialBlock");for(let i=0;i<n.length;i++){const l=n[i],s=r.get(l,"partialBlockId",r.get(l,"globalBlock",""));if(s==="")continue;let a=r.cloneDeep(r.get(t,s,[]));l._parent&&(a==null?void 0:a.length)>0&&(a=a.map(c=>(r.isEmpty(c._parent)&&(c._parent=l._parent),c)));const o=e.indexOf(l);e.splice(o,1,...a)}return e}const j=e=>{if(!e)return[];try{return JSON.parse(M(e)).filter(n=>!n._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function M(e){const t=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(t,n=>{const i=decodeURIComponent(n),l=i.indexOf("public");return l!==-1?i.substring(l+6):i})}async function O(e,t,n=[],i="",l){return await F.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:n,theme:{extend:E.getChaiBuilderTheme(e)},plugins:[q,$,I,L,y.chaiBuilderPlugin],corePlugins:{preflight:l},...i?{prefix:`${i}`}:{}}}).generateStylesFromContent(` ${l?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
|
-
@tailwind utilities;`,t)}const
|
|
3
|
+
@tailwind utilities;`,t)}const A=(e,t,n)=>{const i=JSON.stringify(e).replace(/#styles:([^"]*)/g,(l,s)=>`#styles:${s.replace(/,/g," ")}`.replace(/#styles:/g,""));return O(t,[i],[],"",n)},K=async(e,t=y.defaultThemeOptions,n=!1)=>await A(e,t,n);async function N(e){const t=await e.dataProvider({pageProps:e.pageProps,block:e.block,lang:e.lang,draft:e.draft,inBuilder:!1});return r.has(t,"$metadata")&&r.isFunction(e.dataProviderMetadataCallback)&&e.dataProviderMetadataCallback(e.block,t.$metadata),e.children({...r.omit(t,"$metadata")})}const J=()=>m.jsx("div",{}),V=e=>{const{block:t,lang:n,fallbackLang:i,children:l,externalData:s,blocks:a,draft:o,pageProps:c,dataProviderMetadataCallback:h}=e,d=R.getRegisteredChaiBlock(t._type),f=r.get(d,"component",null),k=r.get(e.repeaterData,"index",-1),b=r.get(e.repeaterData,"dataKey",""),C=n===i?"":n,g=p.applyBindingToBlockProps(p.applyLanguage(t,C,d),s,{index:k,key:b}),w=p.getBlockTagAttributes(t,!1),S=U(a,t._id,p.getBlockRuntimeProps(t._type)),T=r.has(d,"dataProvider")&&r.isFunction(d.dataProvider),_={...g,...w,...S},P={blockProps:{},inBuilder:!1,lang:n||i,..._};if(r.isNull(f))return null;if(T){const v=r.get(d,"suspenseFallback",J);return m.jsx(u.Suspense,{fallback:u.createElement(v),children:m.jsx(N,{lang:n,pageProps:c,block:_,dataProvider:d.dataProvider,...h?{dataProviderMetadataCallback:h}:{},draft:o,children:x=>u.createElement(f,{...P,...x,children:l({_id:t._id,_type:t._type,...r.isArray(g.repeaterItems)?{repeaterItems:p.applyLimit(g.repeaterItems,t),$repeaterItemsKey:g.$repeaterItemsKey}:{}})})})})}return m.jsx(u.Suspense,{children:u.createElement(f,{...P,children:l({_id:t._id,_type:t._type,...r.isArray(g.repeaterItems)?{repeaterItems:p.applyLimit(g.repeaterItems,t),$repeaterItemsKey:g.$repeaterItemsKey}:{}})})})},B=e=>{const{blocks:t,parent:n,repeaterData:i}=e;let l=r.uniqBy(r.filter(t,a=>r.has(a,"_id")&&(r.isEmpty(n)?!a._parent:a._parent===n)),"_id");const s=a=>r.filter(t,o=>o._parent===a).length>0;return r.map(l,a=>a?u.createElement(V,{...e,key:a._id,block:a},({_id:o,_type:c,repeaterItems:h,$repeaterItemsKey:d})=>c==="Repeater"?r.isArray(h)&&h.map((f,k)=>u.createElement(B,{...e,parent:a._id,key:`${r.get(a,"_parent","root")}-${a._id}-${k}`,repeaterData:{index:k,dataKey:d}})):s(o)?u.createElement(B,{...e,parent:a._id,key:`${r.get(a,"_parent","root")}-${a._id}`,repeaterData:i}):null):null)},U=(e,t,n)=>r.isEmpty(n)?{}:Object.entries(n).reduce((i,[l,s])=>{const a=[];let o=r.find(e,{_id:t});for(;o;)a.push(o),o=r.find(e,{_id:o._parent});const c=r.find(a,{_type:s.block});return c&&(i[l]=r.get(c,r.get(s,"prop"),null)),i},{});function W(e){if(r.isEmpty(e.lang)&&!r.isEmpty(e.fallbackLang))throw new Error("lang prop is required when fallbackLang is provided");if(r.isEmpty(e.blocks))return null;const t=e.lang??"en",n=e.fallbackLang??t;return m.jsx(B,{...e,lang:t,fallbackLang:n})}exports.getChaiThemeCssVariables=y.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=y.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=y.getThemeFontsLinkMarkup;exports.applyChaiDataBinding=p.applyChaiDataBinding;exports.RenderChaiBlocks=W;exports.convertToBlocks=j;exports.getMergedPartialBlocks=D;exports.getStylesForBlocks=K;
|
package/dist/render.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as
|
|
4
|
-
import { e as
|
|
5
|
-
import { get as s, cloneDeep as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { d as F, c as O } from "./plugin-BOcGV_IY.js";
|
|
2
|
+
import { a as Se, b as ve, e as xe } from "./plugin-BOcGV_IY.js";
|
|
3
|
+
import { a as K, b as M, g as A, c as N, d as C } from "./apply-binding-CkrtJykq.js";
|
|
4
|
+
import { e as $e } from "./apply-binding-CkrtJykq.js";
|
|
5
|
+
import { get as s, cloneDeep as J, isEmpty as u, has as B, isFunction as x, omit as E, isNull as j, isArray as _, uniqBy as q, filter as S, map as U, find as y } from "lodash-es";
|
|
6
|
+
import V from "@tailwindcss/aspect-ratio";
|
|
7
|
+
import W from "@tailwindcss/forms";
|
|
8
8
|
import G from "@tailwindcss/typography";
|
|
9
9
|
import "tailwindcss-animate";
|
|
10
|
-
import { g as
|
|
11
|
-
import { createTailwindcss as
|
|
12
|
-
import
|
|
10
|
+
import { g as z } from "./get-chai-builder-theme-BarMkcGH.js";
|
|
11
|
+
import { createTailwindcss as H } from "@mhsdesign/jit-browser-tailwindcss";
|
|
12
|
+
import Q from "@tailwindcss/container-queries";
|
|
13
13
|
import { jsx as m } from "react/jsx-runtime";
|
|
14
|
-
import { Suspense as
|
|
15
|
-
import { getRegisteredChaiBlock as
|
|
16
|
-
function
|
|
14
|
+
import { Suspense as v, createElement as g } from "react";
|
|
15
|
+
import { getRegisteredChaiBlock as X } from "@chaibuilder/runtime";
|
|
16
|
+
function _e(e, t) {
|
|
17
17
|
const r = e.filter(({ _type: n }) => n === "GlobalBlock" || n === "PartialBlock");
|
|
18
18
|
for (let n = 0; n < r.length; n++) {
|
|
19
19
|
const i = r[n], l = s(i, "partialBlockId", s(i, "globalBlock", ""));
|
|
20
20
|
if (l === "") continue;
|
|
21
|
-
let a =
|
|
21
|
+
let a = J(s(t, l, []));
|
|
22
22
|
i._parent && (a == null ? void 0 : a.length) > 0 && (a = a.map((c) => (u(c._parent) && (c._parent = i._parent), c)));
|
|
23
23
|
const o = e.indexOf(i);
|
|
24
24
|
e.splice(o, 1, ...a);
|
|
25
25
|
}
|
|
26
26
|
return e;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const be = (e) => {
|
|
29
29
|
if (!e) return [];
|
|
30
30
|
try {
|
|
31
|
-
return JSON.parse(
|
|
31
|
+
return JSON.parse(Y(e)).filter((r) => !r._type.startsWith("@chai"));
|
|
32
32
|
} catch {
|
|
33
33
|
return [{ _type: "Paragraph", _id: "error", content: "Invalid JSON. Please check the JSON string." }];
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
function
|
|
36
|
+
function Y(e) {
|
|
37
37
|
const t = /(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;
|
|
38
38
|
return e.replace(t, (r) => {
|
|
39
39
|
const n = decodeURIComponent(r), i = n.indexOf("public");
|
|
40
40
|
return i !== -1 ? n.substring(i + 6) : n;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
async function
|
|
44
|
-
return await
|
|
43
|
+
async function Z(e, t, r = [], n = "", i) {
|
|
44
|
+
return await H({
|
|
45
45
|
tailwindConfig: {
|
|
46
46
|
darkMode: "class",
|
|
47
47
|
safelist: r,
|
|
48
|
-
theme: { extend:
|
|
49
|
-
plugins: [
|
|
48
|
+
theme: { extend: z(e) },
|
|
49
|
+
plugins: [W, G, V, Q, O],
|
|
50
50
|
corePlugins: { preflight: i },
|
|
51
51
|
...n ? { prefix: `${n}` } : {}
|
|
52
52
|
}
|
|
@@ -57,11 +57,11 @@ async function Y(e, t, r = [], n = "", i) {
|
|
|
57
57
|
t
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const ee = (e, t, r) => {
|
|
61
61
|
const n = JSON.stringify(e).replace(/#styles:([^"]*)/g, (i, l) => `#styles:${l.replace(/,/g, " ")}`.replace(/#styles:/g, ""));
|
|
62
|
-
return
|
|
63
|
-
},
|
|
64
|
-
async function
|
|
62
|
+
return Z(t, [n], [], "", r);
|
|
63
|
+
}, Be = async (e, t = F, r = !1) => await ee(e, t, r);
|
|
64
|
+
async function te(e) {
|
|
65
65
|
const t = await e.dataProvider({
|
|
66
66
|
pageProps: e.pageProps,
|
|
67
67
|
block: e.block,
|
|
@@ -69,43 +69,45 @@ async function ee(e) {
|
|
|
69
69
|
draft: e.draft,
|
|
70
70
|
inBuilder: !1
|
|
71
71
|
});
|
|
72
|
-
return B(t, "$metadata") &&
|
|
73
|
-
...
|
|
72
|
+
return B(t, "$metadata") && x(e.dataProviderMetadataCallback) && e.dataProviderMetadataCallback(e.block, t.$metadata), e.children({
|
|
73
|
+
...E(t, "$metadata")
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
const
|
|
77
|
-
const { block: t, lang: r, fallbackLang: n, children: i, externalData: l, blocks: a, draft: o, pageProps: c, dataProviderMetadataCallback: f } = e, d =
|
|
78
|
-
|
|
76
|
+
const ae = () => /* @__PURE__ */ m("div", {}), re = (e) => {
|
|
77
|
+
const { block: t, lang: r, fallbackLang: n, children: i, externalData: l, blocks: a, draft: o, pageProps: c, dataProviderMetadataCallback: f } = e, d = X(t._type), h = s(d, "component", null), k = s(e.repeaterData, "index", -1), I = s(e.repeaterData, "dataKey", ""), p = K(
|
|
78
|
+
M(t, r === n ? "" : r, d),
|
|
79
79
|
l,
|
|
80
|
-
{ index: k, key:
|
|
81
|
-
),
|
|
80
|
+
{ index: k, key: I }
|
|
81
|
+
), $ = A(t, !1), T = ne(a, t._id, N(t._type)), L = B(d, "dataProvider") && x(d.dataProvider), P = {
|
|
82
|
+
...p,
|
|
83
|
+
...$,
|
|
84
|
+
...T
|
|
85
|
+
}, w = {
|
|
82
86
|
blockProps: {},
|
|
83
87
|
inBuilder: !1,
|
|
84
88
|
lang: r || n,
|
|
85
|
-
...
|
|
86
|
-
...I,
|
|
87
|
-
...$
|
|
89
|
+
...P
|
|
88
90
|
};
|
|
89
|
-
if (
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
return /* @__PURE__ */ m(
|
|
93
|
-
|
|
91
|
+
if (j(h)) return null;
|
|
92
|
+
if (L) {
|
|
93
|
+
const D = s(d, "suspenseFallback", ae);
|
|
94
|
+
return /* @__PURE__ */ m(v, { fallback: g(D), children: /* @__PURE__ */ m(
|
|
95
|
+
te,
|
|
94
96
|
{
|
|
95
97
|
lang: r,
|
|
96
98
|
pageProps: c,
|
|
97
|
-
block:
|
|
99
|
+
block: P,
|
|
98
100
|
dataProvider: d.dataProvider,
|
|
99
101
|
...f ? { dataProviderMetadataCallback: f } : {},
|
|
100
102
|
draft: o,
|
|
101
|
-
children: (
|
|
102
|
-
...
|
|
103
|
-
...
|
|
103
|
+
children: (R) => g(h, {
|
|
104
|
+
...w,
|
|
105
|
+
...R,
|
|
104
106
|
children: i({
|
|
105
107
|
_id: t._id,
|
|
106
108
|
_type: t._type,
|
|
107
109
|
..._(p.repeaterItems) ? {
|
|
108
|
-
repeaterItems:
|
|
110
|
+
repeaterItems: C(p.repeaterItems, t),
|
|
109
111
|
$repeaterItemsKey: p.$repeaterItemsKey
|
|
110
112
|
} : {}
|
|
111
113
|
})
|
|
@@ -113,26 +115,26 @@ const te = () => /* @__PURE__ */ m("div", {}), ae = (e) => {
|
|
|
113
115
|
}
|
|
114
116
|
) });
|
|
115
117
|
}
|
|
116
|
-
return /* @__PURE__ */ m(
|
|
117
|
-
...
|
|
118
|
+
return /* @__PURE__ */ m(v, { children: g(h, {
|
|
119
|
+
...w,
|
|
118
120
|
children: i({
|
|
119
121
|
_id: t._id,
|
|
120
122
|
_type: t._type,
|
|
121
123
|
..._(p.repeaterItems) ? {
|
|
122
|
-
repeaterItems:
|
|
124
|
+
repeaterItems: C(p.repeaterItems, t),
|
|
123
125
|
$repeaterItemsKey: p.$repeaterItemsKey
|
|
124
126
|
} : {}
|
|
125
127
|
})
|
|
126
128
|
}) });
|
|
127
|
-
},
|
|
129
|
+
}, b = (e) => {
|
|
128
130
|
const { blocks: t, parent: r, repeaterData: n } = e;
|
|
129
|
-
let i =
|
|
130
|
-
|
|
131
|
+
let i = q(
|
|
132
|
+
S(t, (a) => B(a, "_id") && (u(r) ? !a._parent : a._parent === r)),
|
|
131
133
|
"_id"
|
|
132
134
|
);
|
|
133
|
-
const l = (a) =>
|
|
134
|
-
return
|
|
135
|
-
|
|
135
|
+
const l = (a) => S(t, (o) => o._parent === a).length > 0;
|
|
136
|
+
return U(i, (a) => a ? /* @__PURE__ */ g(re, { ...e, key: a._id, block: a }, ({ _id: o, _type: c, repeaterItems: f, $repeaterItemsKey: d }) => c === "Repeater" ? _(f) && f.map((h, k) => /* @__PURE__ */ g(
|
|
137
|
+
b,
|
|
136
138
|
{
|
|
137
139
|
...e,
|
|
138
140
|
parent: a._id,
|
|
@@ -140,7 +142,7 @@ const te = () => /* @__PURE__ */ m("div", {}), ae = (e) => {
|
|
|
140
142
|
repeaterData: { index: k, dataKey: d }
|
|
141
143
|
}
|
|
142
144
|
)) : l(o) ? /* @__PURE__ */ g(
|
|
143
|
-
|
|
145
|
+
b,
|
|
144
146
|
{
|
|
145
147
|
...e,
|
|
146
148
|
parent: a._id,
|
|
@@ -148,7 +150,7 @@ const te = () => /* @__PURE__ */ m("div", {}), ae = (e) => {
|
|
|
148
150
|
repeaterData: n
|
|
149
151
|
}
|
|
150
152
|
) : null) : null);
|
|
151
|
-
},
|
|
153
|
+
}, ne = (e, t, r) => u(r) ? {} : Object.entries(r).reduce((n, [i, l]) => {
|
|
152
154
|
const a = [];
|
|
153
155
|
let o = y(e, { _id: t });
|
|
154
156
|
for (; o; )
|
|
@@ -156,21 +158,21 @@ const te = () => /* @__PURE__ */ m("div", {}), ae = (e) => {
|
|
|
156
158
|
const c = y(a, { _type: l.block });
|
|
157
159
|
return c && (n[i] = s(c, s(l, "prop"), null)), n;
|
|
158
160
|
}, {});
|
|
159
|
-
function
|
|
161
|
+
function Pe(e) {
|
|
160
162
|
if (u(e.lang) && !u(e.fallbackLang))
|
|
161
163
|
throw new Error("lang prop is required when fallbackLang is provided");
|
|
162
164
|
if (u(e.blocks))
|
|
163
165
|
return null;
|
|
164
166
|
const t = e.lang ?? "en", r = e.fallbackLang ?? t;
|
|
165
|
-
return /* @__PURE__ */ m(
|
|
167
|
+
return /* @__PURE__ */ m(b, { ...e, lang: t, fallbackLang: r });
|
|
166
168
|
}
|
|
167
169
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
Pe as RenderChaiBlocks,
|
|
171
|
+
$e as applyChaiDataBinding,
|
|
172
|
+
be as convertToBlocks,
|
|
173
|
+
Se as getChaiThemeCssVariables,
|
|
174
|
+
_e as getMergedPartialBlocks,
|
|
175
|
+
Be as getStylesForBlocks,
|
|
176
|
+
ve as getThemeFontsCSSImport,
|
|
177
|
+
xe as getThemeFontsLinkMarkup
|
|
176
178
|
};
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@chaibuilder/runtime"),i=require("react/jsx-runtime"),f=require("./common-functions-BZmyleS1.cjs"),k=require("react"),y=require("@radix-ui/react-icons"),u=require("lodash-es"),C=require("lucide-react");function I(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const g=I(k),x=({className:e="",inBuilder:o})=>o?i.jsx("div",{className:f.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:i.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:i.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,L=e=>{const{blockProps:o,inBuilder:t,backgroundImage:r,children:s,tag:n="div",styles:a}=e;let c=s;s||(c=i.jsx(x,{inBuilder:t}));let p={};return r&&(p={backgroundImage:`url(${r})`}),g.createElement(n,{...o,...a,style:p},c)},j={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image"}},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"}]}}}),canAcceptBlock:()=>!0},_=e=>{const{blockProps:o,iconSize:t,icon:r,content:s,styles:n,children:a,iconPos:c,link:p,inBuilder:d}=e,b=r,h=a||i.jsxs(i.Fragment,{children:[i.jsx("span",{"data-ai-key":"content",children:s}),b&&i.jsx("div",{style:{width:t+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:b}})]}),m=k.createElement("button",{...o,...n,type:"button","aria-label":s},h);return u.isEmpty(u.get(p,"href"))?m:d?i.jsx("span",{children:m}):i.jsx("a",{"aria-label":s,href:u.get(p,"href")||"/",target:u.get(p,"target","_self"),children:m})},T={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:y.ButtonIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),i18nProps:["content"],aiProps:["content"]},E=e=>{const{blockProps:o,iconSize:t,icon:r,content:s,styles:n}=e,a=r,c=i.jsxs(i.Fragment,{children:[i.jsx("span",{"data-ai-key":"content",children:s}),a&&i.jsx("div",{style:{width:t+"px"},dangerouslySetInnerHTML:{__html:a}})]});return k.createElement("button",{...o,...n,type:"button","aria-label":s},c)},N={type:"CopyButton",description:"A copy button component",label:"Copy Button",category:"core",icon:y.CopyIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("p-2 rounded-md flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-copy'><path d='M8 17L19 8M8 17V7a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v10'/></svg>",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:20}}}),i18nProps:["content"],aiProps:["content"]},R=e=>{const{blockProps:o,styles:t,htmlCode:r,inBuilder:s}=e;return s?i.jsxs("div",{className:"relative",children:[s?i.jsx("div",{...o,...t,className:"absolute z-20 h-full w-full"}):null,g.createElement("div",{...t,dangerouslySetInnerHTML:{__html:r.replace(/<script.*?>.*?<\/script>/g,"")}})]}):g.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:r}})},M={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:y.CodeIcon,group:"advanced",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}}),i18nProps:["htmlCode"]},A=e=>{const{scripts:o,inBuilder:t,blockProps:r}=e;return t?i.jsx("div",{...r,children:i.jsx("div",{className:f.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:i.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:i.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"})})})}):i.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},$={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:C.FileCode,group:"advanced",...l.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},H=e=>{const{blockProps:o,styles:t}=e;return k.createElement("hr",{...t,...o})},U={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:y.DividerHorizontalIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},D=e=>{const{blockProps:o,styles:t,backgroundImage:r}=e;let s={};return r&&(s={backgroundImage:`url(${r})`}),g.createElement("div",{...o,...t,style:s})},z={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image"}}}})},q=e=>{const{blockProps:o,fieldName:t,label:r,styles:s,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,d=f.generateUUID();return p?i.jsxs("div",{...s,...o,children:[i.jsx("input",{...n,name:t,id:d,type:"checkbox",required:a,defaultChecked:c}),r&&i.jsx("label",{htmlFor:d,children:r})]}):i.jsx("input",{id:d,...o,...n,...s,type:"checkbox",required:a,name:t})},F={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:y.CheckboxIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("flex items-center gap-x-2"),inputStyles:l.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},O=e=>{const{children:o,blockProps:t,errorMessage:r,successMessage:s,action:n,styles:a,inBuilder:c}=e;let p=o;o||(p=i.jsx(x,{inBuilder:c}));const d={"x-data":"{}","x-on:submit.prevent":"post"},b={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxs("form",{...d,"data-error":r,"data-success":s,method:"post",action:n,...t,...a,children:[i.jsx("div",{...b}),p]})},V={type:"Form",label:"Form",category:"core",icon:C.GroupIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},G=e=>{const{blockProps:o,inBuilder:t,label:r,styles:s,inputStyles:n,icon:a,iconSize:c,iconPos:p}=e,d=f.generateUUID(),b={"x-bind:disabled":"formLoading"};return i.jsxs("button",{id:d,...b,...n,...s,...o||{},type:t?"button":"submit","aria-label":r,children:[r,a&&i.jsx("div",{style:{width:c+"px"},className:p+" "+(p==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Y={type:"FormButton",label:"Submit Button",category:"core",icon:y.ButtonIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),inputStyles:l.StylesProp(""),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"]},W=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"},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},X=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:s,styles:n,inputStyles:a,showLabel:c,required:p,inputType:d}=e,b=f.generateUUID(),{type:h,autocomplete:m}=W(d);return c?i.jsxs("div",{...n,...o,children:[c&&i.jsx("label",{htmlFor:b,children:r}),i.jsx("input",{name:t,...a,id:b,type:h,placeholder:s,required:p,autoComplete:m})]}):i.jsx("input",{id:b,name:t,...o,...a,...n,type:h,placeholder:s,required:p,autoComplete:m})},J={type:"Input",label:"web_blocks.input",category:"core",icon:y.InputIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},inputType:{type:"string",title:"Type",default:"email",oneOf:[{const:"text",title:"Text"},{const:"email",title:"Email"},{const:"password",title:"Password"},{const:"number",title:"Number"},{const:"tel",title:"Telephone"},{const:"hidden",title:"Hidden"},{const:"range",title:"Range"},{const:"color",title:"Color"},{const:"date",title:"Date"},{const:"time",title:"Time"},{const:"url",title:"URL"},{const:"name",title:"Name"},{const:"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}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Q=e=>{const{blockProps:o,content:t,styles:r,children:s}=e,n={...r,...o};return s?g.createElement("label",n,s):g.createElement("label",{...n,dangerouslySetInnerHTML:{__html:t}})},Z={type:"Label",label:"Label",category:"core",icon:y.LetterCaseToggleIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},K=e=>{const{blockProps:o,fieldName:t,label:r,styles:s,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,d=f.generateUUID();return p?i.jsxs("div",{...s,...o,children:[i.jsx("input",{...n,name:t,id:d,type:"radio",required:a,defaultChecked:c}),r&&i.jsx("label",{htmlFor:d,children:r})]}):i.jsx("input",{id:d,...o,...n,...s,type:"radio",required:a,checked:c,name:t})},ee={type:"Radio",label:"web_blocks.radio",category:"core",icon:y.RadiobuttonIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("flex items-center gap-x-2"),inputStyles:l.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},te=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:s,styles:n,inputStyles:a,required:c,showLabel:p,_multiple:d,options:b}=e,h=f.generateUUID();return p?i.jsxs("div",{...n,...o,children:[p&&i.jsx("label",{htmlFor:h,children:r}),i.jsxs("select",{...a,id:h,required:c,multiple:d,name:t,children:[i.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),u.map(b,m=>i.jsx("option",{value:m==null?void 0:m.value,children:m==null?void 0:m.label},m==null?void 0:m.value))]})]}):i.jsxs("select",{id:h,...n,...o,required:c,multiple:d,name:t,children:[i.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),u.map(b,m=>i.jsx("option",{value:m==null?void 0:m.value,children:m==null?void 0:m.label},m==null?void 0:m.value))]})},oe={type:"Select",label:"web_blocks.select",category:"core",icon:y.DropdownMenuIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},_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"]},le=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:s,styles:n,inputStyles:a,rows:c,showLabel:p,required:d}=e,b=f.generateUUID();return p?i.jsxs("div",{...n,...o,children:[p&&i.jsx("label",{htmlFor:b,children:r}),i.jsx("textarea",{name:t,...a,id:b,placeholder:s,rows:c,required:d})]}):i.jsx("textarea",{id:b,name:t,...o,...a,...n,placeholder:s,rows:c,required:d})},re={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:y.InputIcon,group:"form",...l.registerChaiBlockSchema({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},rows:{type:"number",title:"Rows",default:3},required:{type:"boolean",title:"Required",default:!1}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},se=e=>{const{blockProps:o,inBuilder:t,children:r,globalBlock:s}=e;return t&&!s?i.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:[i.jsxs("h1",{children:["Global Block - ",s]}),i.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):g.createElement("span",{...o},r)},ie={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:C.GlobeIcon,category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},ne=e=>{const{blockProps:o,styles:t,content:r,tag:s="h1",children:n=null}=e;return n?g.createElement(s,{...t,...o},n):g.createElement(s,{...t,...o,dangerouslySetInnerHTML:{__html:r}})},ae={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:y.HeadingIcon,group:"typography",...l.registerChaiBlockSchema({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:l.StylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Text"},ce=e=>{const{blockProps:o,styles:t}=e;return k.createElement("br",{...o,...t})},pe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},de=e=>{const{blockProps:o,children:t,styles:r}=e;return t?k.createElement("table",{...o,...r},t):i.jsx(x,{})},ue=e=>{const{blockProps:o,children:t,styles:r}=e;return t?k.createElement("thead",{...o,...r},t):i.jsx(x,{})},me=e=>{const{blockProps:o,children:t,styles:r}=e;return t?k.createElement("tbody",{...o,...r},t):i.jsx(x,{})},ye=e=>{const{blockProps:o,children:t,styles:r}=e;return t?k.createElement("tr",{...o,...r},t):i.jsx(x,{})},ge=e=>{const{blockProps:o,children:t,content:r,styles:s}=e;return!t&&u.isEmpty(r)?i.jsx(x,{}):t?k.createElement("td",{...o,...s},t):k.createElement("td",{...o,...s,dangerouslySetInnerHTML:{__html:r}})};l.registerChaiBlock(de,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:y.TableIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("Table")});l.registerChaiBlock(ue,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:y.BorderTopIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("TableHead")});l.registerChaiBlock(me,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:y.BorderAllIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("TableBody")});l.registerChaiBlock(ye,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:y.ViewHorizontalIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("TableRow")});l.registerChaiBlock(ge,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:y.DragHandleHorizontalIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),blocks:B("TableCell"),i18nProps:["content"],aiProps:["content"]});function B(e){const o=(n,a)=>({_id:f.generateUUID(),_parent:n,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+a}`}),t=n=>{const a=f.generateUUID(),c={_type:"TableRow",_id:a,styles:"#styles:,border-b"};return n&&(c._parent=n),[c,o(a,"1"),o(a,"2"),o(a,"3")]},r=n=>{const a=f.generateUUID(),c={_id:a,_type:"TableHead",styles:"#styles:,font-medium"};return n&&(c._parent=n),[c,...t(a)]},s=n=>{const a=f.generateUUID(),c={_id:a,_type:"TableBody",styles:"#styles:,"};return n&&(c._parent=n),[c,...t(a),...t(a)]};if(e==="Table"){const n=f.generateUUID();return[{_id:n,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...r(n),...s(n)]}return e==="TableRow"?t():e==="TableHead"?r():e==="TableBody"?s():[]}const v=(e,...o)=>({...e,className:f.cn(e.className,...o)}),he=e=>{const{blockProps:o,icon:t,styles:r,width:s,inBuilder:n,height:a}=e,c=v(r,"");if(u.isEmpty(t))return i.jsx(x,{inBuilder:n,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return g.createElement("span",{...o,...c,style:{width:s?`${s}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},be={type:"Icon",label:"web_blocks.icon",category:"core",icon:y.SketchLogoIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),icon:{type:"string",title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},fe=e=>{const{blockProps:o,image:t,mobileImage:r,styles:s,alt:n,height:a,width:c,lazyLoading:p}=e;return u.isEmpty(t)?i.jsx(x,{className:"h-36"}):i.jsxs("picture",{children:[r&&i.jsx("source",{srcSet:r,media:"(max-width: 480px)"}),i.jsx("img",{...o,...s,src:t,alt:n,loading:p?"lazy":"eager",width:c,height:a})]})},ke={type:"Image",description:"A image component",label:"Image",category:"core",icon:y.ImageIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),image:{type:"string",title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas",ui:{"ui:widget":"image"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0},width:{type:"number",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"number",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}},assetId:{type:"string",title:"Asset ID",default:"",ui:{"ui:widget":"hidden"}}}}),aiProps:["alt"],i18nProps:["alt"]},xe=e=>{const{blockProps:o,link:t,children:r,styles:s,inBuilder:n,content:a}=e;let c={};return!r&&u.isEmpty(a)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?r?i.jsx("span",{...o,style:c,...s,children:r}):k.createElement("span",{...o,...s,style:c},a):r?i.jsx("a",{"aria-label":a,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...s,children:r}):k.createElement("a",{...o,...s,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":a},a)},Ce={type:"Link",description:"A link component",label:"Link",category:"core",icon:y.Link1Icon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"Link goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e!=="Link"},Be=e=>{const{blockProps:o,children:t,listType:r,styles:s,tag:n,inBuilder:a}=e,c=f.cn(u.get(s,"className",""),r);return!t&&u.isEmpty(s==null?void 0:s.className)?i.jsx(x,{inBuilder:a}):g.createElement(n||(r==="list-decimal"?"ol":"ul"),{...o,...s,className:c},t)},Se={type:"List",description:"A list component",label:"List",icon:y.RowsIcon,category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),listType:{type:"string",title:"List Type",default:"list-none",oneOf:[{enum:["list-none"],title:"List None"},{enum:["list-disc"],title:"Disc"},{enum:["list-decimal"],title:"Decimal"}]}}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]},we=e=>{const{blockProps:o,content:t,styles:r,children:s,tag:n}=e;return s?g.createElement(n||"li",{...r,...o},s):g.createElement(n||"li",{...r,...o,dangerouslySetInnerHTML:{__html:t}})},Pe={type:"ListItem",description:"A list item component",label:"List Item",icon:y.ColumnsIcon,category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"||e==="Repeater"},ve=e=>{const{blockProps:o,styles:t,content:r}=e;return u.isNull(e.children)?g.createElement("p",{...t,...o,dangerouslySetInnerHTML:{__html:r}}):g.createElement("p",{...t,...o},e.children)},Ie={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:y.TextIcon,group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},Le=e=>{const{blockProps:o,inBuilder:t,children:r,partialBlockId:s}=e;return t&&!s?i.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:[i.jsxs("h1",{children:["Partial Block - ",s]}),i.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):g.createElement("span",{...o},r)},je={type:"PartialBlock",description:"A partial block component",label:"Partial Block",icon:C.GlobeIcon,category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{partialBlockId:{type:"string",title:"Partial Block",default:"",ui:{"ui:widget":"hidden"}}}})},S={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},_e=e=>{const{blockProps:o,children:t,styles:r,colSpan:s,tabletColSpan:n,desktopColSpan:a}=e,p={className:[u.get(r,"className",""),u.get(S,["SMALL",isNaN(s)||!s?6:s],""),n?u.get(S,["MEDIUM",n||s],""):"",a?u.get(S,["LARGE",n||s],""):""].join(" ")};return i.jsx("div",{...o,...r,...p,children:t||i.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},Te={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:C.Columns,wrapper:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Ee=e=>{const{blockProps:o,children:t,styles:r,gutter:s}=e,a={className:[u.get(r,"className","")," grid grid-cols-12"].join()};return typeof(r==null?void 0:r.style)=="object"?r.style.gap=`${s}px`:a.style={gap:`${s}px`},i.jsx("div",{...o,...r,...a,children:t})},Ne={type:"Row",description:"A row component",label:"Row",group:"basic",icon:C.Rows,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},Re=e=>{const{blockProps:o,content:t,styles:r}=e,s=v(r,"prose dark:prose-invert prose-p:m-0 prose-p:min-h-[1rem] prose-blockquote:m-2 prose-blockquote:ml-4 prose-ul:m-0 prose-ol:m-0 prose-li:m-0","max-w-full");return i.jsx("div",{...o,...s,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",category:"core",icon:y.CursorTextIcon,group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},Ae=e=>{const{blockProps:o,styles:t,content:r,children:s=null,tag:n}=e;return s?g.createElement("span",{...t,...o},s):g.createElement(n||"span",{...t,...o,dangerouslySetInnerHTML:{__html:r||""}})},$e={type:"Span",description:"A span component",label:"Span",category:"core",group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},He=e=>e.inBuilder||e.forceWrapper?i.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Ue={type:"Text",description:"A text component with no styling",label:"Text",hidden:!0,category:"core",group:"typography",icon:y.SpaceBetweenVerticallyIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},De={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}}},w=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,P=/(?: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),r=u.get(o,"controls",!1),s=u.get(o,"loop",!1),n=t||u.get(o,"muted",!0);if(w.test(e)){const a=e.match(w);if(a){const c=a[4];let p=`https://www.youtube.com/embed/${c}`,d=t?"autoplay=1":"";return d+=s?`&loop=1&playlist=${c}`:"",d+=n?"&mute=1&muted=1":"",d+=r?"&controls=1":"&controls=0",`${p}?${d}`}}if(P.test(e)){const a=e.match(P);if(a){const c=a[1];let p="";return p+=t?"autoplay=1":"",p+=r?"&controls=1":"&controls=0",p+=n?"&muted=1":"",p+=s?"&loop=1":"",`https://player.vimeo.com/video/${c}?${p}`}}return null},qe=e=>{const{url:o,blockProps:t,styles:r,controls:s,videoSource:n,inBuilder:a}=e,c=ze(o,s);return i.jsxs("div",{...u.omit(r,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!c&&a?i.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:u.isEmpty(o)?`Provided ${n} video link in settings Video URL.`:`Provided ${n} video link is invalid.`}):i.jsx("iframe",{width:"100%",src:c,...u.pick(r,"className")}),a&&i.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Fe=e=>{const{url:o,styles:t,controls:r,sources:s,poster:n,blockProps:a}=e;let c=n;const p=[...u.get(s,"srcsets",[])||[]];o&&typeof o=="string"&&p.push({url:o,width:"9999"});const d=p.sort((h,m)=>parseInt(h.width)-parseInt(m.width)).filter(h=>!u.isEmpty(h.url)&&!u.isEmpty(h.width));d.length===0&&!c&&(c="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const b=u.get(r,"autoplay",!1)||u.get(r,"muted",!0);return(c||!u.isEmpty(d))&&i.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:k.createElement("video",{...t,...a,key:JSON.stringify(d),controls:u.get(r,"controls",!1),autoPlay:u.get(r,"autoplay",!1),loop:u.get(r,"loop",!1),poster:c,...b?{muted:!0}:{}},d.map(h=>{if(!h.url||h.url.length<4||isNaN(h.width))return null;const m=`(max-width: ${h.width}px)`;return i.jsx("source",{src:h.url,media:m,type:h.type},h.url)}),"Your browser does not support the video tag.")})},Oe=e=>{const{videoSource:o}=e;return o==="Custom"?i.jsx(Fe,{...e}):o==="Youtube"||o==="Vimeo"?i.jsx(qe,{...e}):i.jsxs("div",{children:["Invalid video source : ",o]})},Ve={type:"Video",label:"Video",category:"core",icon:y.VideoIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"}},allOf:[{if:{properties:{videoSource:{const:"Custom"}}},then:{properties:{url:{type:"string",title:"Video URL",default:""},poster:{type:"string",title:"Poster URL",default:""},sources:{type:"object",default:{srcsets:[]}},controls:{...De}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url"]},Ge=e=>{const{children:o,tag:t,styles:r,blockProps:s,inBuilder:n,$loading:a}=e;let c=o;return u.isEmpty(c)&&n&&(c=i.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Choose a collection to display items"})),t==="none"?a&&n?Array.from({length:2}).map((p,d)=>i.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[i.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),i.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},d)):c:g.createElement(t,{...s,...r},a&&n?Array.from({length:2}).map((p,d)=>i.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[i.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),i.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},d)):c)},Ye={type:"Repeater",label:"Repeater",icon:y.LoopIcon,group:"basic",dataProviderMode:"live",dataProviderDependencies:["filter","sort","limit","repeaterItems"],blocks:()=>[{_id:"A",_type:"Repeater",tag:"ul"},{_id:"B",_name:"Repeater Item",_type:"RepeaterItem",parentTag:"ul",_parent:"A"}],...l.registerChaiBlockSchema({properties:{styles:l.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),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"]},limit:{title:"Limit",type:"number",default:3},filter:{title:"Filter by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},sort:{title:"Sort by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}}}})},We=({children:e,blockProps:o,styles:t,parentTag:r,inBuilder:s})=>{let n="li";switch(r){case"ul":n="li";break;case"ol":n="li";break;default:n="div"}return!e&&s?g.createElement(n,{...o,...t},i.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"})):g.createElement(n,{...o,...t},e)},Xe={type:"RepeaterItem",label:"Repeater Item",icon:y.LoopIcon,hidden:!0,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.stylesProp(""),parentTag:l.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Je=({children:e,blockProps:o,styles:t})=>g.createElement("div",{...o,...t},e),Qe={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Ze=()=>{l.registerChaiBlock(L,j),l.registerChaiBlock(D,z),l.registerChaiBlock(_,T),l.registerChaiBlock(ne,ae),l.registerChaiBlock(ve,Ie),l.registerChaiBlock(Ae,$e),l.registerChaiBlock(Re,Me),l.registerChaiBlock(xe,Ce),l.registerChaiBlock(Be,Se),l.registerChaiBlock(we,Pe),l.registerChaiBlock(he,be),l.registerChaiBlock(fe,ke),l.registerChaiBlock(Oe,Ve),l.registerChaiBlock(R,M),l.registerChaiBlock(A,$),l.registerChaiBlock(He,Ue),l.registerChaiBlock(O,V),l.registerChaiBlock(G,Y),l.registerChaiBlock(X,J),l.registerChaiBlock(q,F),l.registerChaiBlock(K,ee),l.registerChaiBlock(te,oe),l.registerChaiBlock(le,re),l.registerChaiBlock(Q,Z),l.registerChaiBlock(ce,pe),l.registerChaiBlock(H,U),l.registerChaiBlock(se,ie),l.registerChaiBlock(Le,je),l.registerChaiBlock(Ee,Ne),l.registerChaiBlock(_e,Te),l.registerChaiBlock(E,N),l.registerChaiBlock(Ge,Ye),l.registerChaiBlock(We,Xe),l.registerChaiBlock(Je,Qe)};exports.loadWebBlocks=Ze;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@chaibuilder/runtime"),i=require("react/jsx-runtime"),f=require("./common-functions-BZmyleS1.cjs"),k=require("react"),y=require("@radix-ui/react-icons"),u=require("lodash-es"),C=require("lucide-react");function I(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const g=I(k),x=({className:e="",inBuilder:o})=>o?i.jsx("div",{className:f.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:i.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:i.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,L=e=>{const{blockProps:o,inBuilder:t,backgroundImage:r,children:s,tag:n="div",styles:a}=e;let c=s;s||(c=i.jsx(x,{inBuilder:t}));let p={};return r&&(p={backgroundImage:`url(${r})`}),g.createElement(n,{...o,...a,style:p},c)},j={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image"}},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"}]}}}),canAcceptBlock:()=>!0},_=e=>{const{blockProps:o,iconSize:t,icon:r,content:s,styles:n,children:a,iconPos:c,link:p,inBuilder:d}=e,b=r,h=a||i.jsxs(i.Fragment,{children:[i.jsx("span",{"data-ai-key":"content",children:s}),b&&i.jsx("div",{style:{width:t+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:b}})]}),m=k.createElement("button",{...o,...n,type:"button","aria-label":s},h);return u.isEmpty(u.get(p,"href"))?m:d?i.jsx("span",{children:m}):i.jsx("a",{"aria-label":s,href:u.get(p,"href")||"/",target:u.get(p,"target","_self"),children:m})},T={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:y.ButtonIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),i18nProps:["content"],aiProps:["content"]},E=e=>{const{blockProps:o,iconSize:t,icon:r,content:s,styles:n}=e,a=r,c=i.jsxs(i.Fragment,{children:[i.jsx("span",{"data-ai-key":"content",children:s}),a&&i.jsx("div",{style:{width:t+"px"},dangerouslySetInnerHTML:{__html:a}})]});return k.createElement("button",{...o,...n,type:"button","aria-label":s},c)},N={type:"CopyButton",description:"A copy button component",label:"Copy Button",category:"core",icon:y.CopyIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("p-2 rounded-md flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-copy'><path d='M8 17L19 8M8 17V7a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v10'/></svg>",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:20}}}),i18nProps:["content"],aiProps:["content"]},R=e=>{const{blockProps:o,styles:t,htmlCode:r,inBuilder:s}=e;return s?i.jsxs("div",{className:"relative",children:[s?i.jsx("div",{...o,...t,className:"absolute z-20 h-full w-full"}):null,g.createElement("div",{...t,dangerouslySetInnerHTML:{__html:r.replace(/<script.*?>.*?<\/script>/g,"")}})]}):g.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:r}})},M={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:y.CodeIcon,group:"advanced",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}}),i18nProps:["htmlCode"]},A=e=>{const{scripts:o,inBuilder:t,blockProps:r}=e;return t?i.jsx("div",{...r,children:i.jsx("div",{className:f.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:i.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:i.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"})})})}):i.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},$={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:C.FileCode,group:"advanced",...l.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},H=e=>{const{blockProps:o,styles:t}=e;return k.createElement("hr",{...t,...o})},U={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:y.DividerHorizontalIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},D=e=>{const{blockProps:o,styles:t,backgroundImage:r}=e;let s={};return r&&(s={backgroundImage:`url(${r})`}),g.createElement("div",{...o,...t,style:s})},z={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image"}}}})},q=e=>{const{blockProps:o,fieldName:t,label:r,styles:s,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,d=f.generateUUID();return p?i.jsxs("div",{...s,...o,children:[i.jsx("input",{...n,name:t,id:d,type:"checkbox",required:a,defaultChecked:c}),r&&i.jsx("label",{htmlFor:d,children:r})]}):i.jsx("input",{id:d,...o,...n,...s,type:"checkbox",required:a,name:t})},F={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:y.CheckboxIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("flex items-center gap-x-2"),inputStyles:l.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},O=e=>{const{children:o,blockProps:t,errorMessage:r,successMessage:s,action:n,styles:a,inBuilder:c}=e;let p=o;o||(p=i.jsx(x,{inBuilder:c}));const d={"x-data":"{}","x-on:submit.prevent":"post"},b={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxs("form",{...d,"data-error":r,"data-success":s,method:"post",action:n,...t,...a,children:[i.jsx("div",{...b}),p]})},V={type:"Form",label:"Form",category:"core",icon:C.GroupIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},G=e=>{const{blockProps:o,inBuilder:t,label:r,styles:s,inputStyles:n,icon:a,iconSize:c,iconPos:p}=e,d=f.generateUUID(),b={"x-bind:disabled":"formLoading"};return i.jsxs("button",{id:d,...b,...n,...s,...o||{},type:t?"button":"submit","aria-label":r,children:[r,a&&i.jsx("div",{style:{width:c+"px"},className:p+" "+(p==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Y={type:"FormButton",label:"Submit Button",category:"core",icon:y.ButtonIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),inputStyles:l.StylesProp(""),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"]},W=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"},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},X=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:s,styles:n,inputStyles:a,showLabel:c,required:p,inputType:d}=e,b=f.generateUUID(),{type:h,autocomplete:m}=W(d);return c?i.jsxs("div",{...n,...o,children:[c&&i.jsx("label",{htmlFor:b,children:r}),i.jsx("input",{name:t,...a,id:b,type:h,placeholder:s,required:p,autoComplete:m})]}):i.jsx("input",{id:b,name:t,...o,...a,...n,type:h,placeholder:s,required:p,autoComplete:m})},J={type:"Input",label:"web_blocks.input",category:"core",icon:y.InputIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},inputType:{type:"string",title:"Type",default:"email",oneOf:[{const:"text",title:"Text"},{const:"email",title:"Email"},{const:"password",title:"Password"},{const:"number",title:"Number"},{const:"tel",title:"Telephone"},{const:"hidden",title:"Hidden"},{const:"range",title:"Range"},{const:"color",title:"Color"},{const:"date",title:"Date"},{const:"time",title:"Time"},{const:"url",title:"URL"},{const:"name",title:"Name"},{const:"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}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Q=e=>{const{blockProps:o,content:t,styles:r,children:s}=e,n={...r,...o};return s?g.createElement("label",n,s):g.createElement("label",{...n,dangerouslySetInnerHTML:{__html:t}})},Z={type:"Label",label:"Label",category:"core",icon:y.LetterCaseToggleIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},K=e=>{const{blockProps:o,fieldName:t,label:r,styles:s,inputStyles:n,required:a,checked:c,showLabel:p=!0}=e,d=f.generateUUID();return p?i.jsxs("div",{...s,...o,children:[i.jsx("input",{...n,name:t,id:d,type:"radio",required:a,defaultChecked:c}),r&&i.jsx("label",{htmlFor:d,children:r})]}):i.jsx("input",{id:d,...o,...n,...s,type:"radio",required:a,checked:c,name:t})},ee={type:"Radio",label:"web_blocks.radio",category:"core",icon:y.RadiobuttonIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("flex items-center gap-x-2"),inputStyles:l.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},te=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:s,styles:n,inputStyles:a,required:c,showLabel:p,_multiple:d,options:b}=e,h=f.generateUUID();return p?i.jsxs("div",{...n,...o,children:[p&&i.jsx("label",{htmlFor:h,children:r}),i.jsxs("select",{...a,id:h,required:c,multiple:d,name:t,children:[i.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),u.map(b,m=>i.jsx("option",{value:m==null?void 0:m.value,children:m==null?void 0:m.label},m==null?void 0:m.value))]})]}):i.jsxs("select",{id:h,...n,...o,required:c,multiple:d,name:t,children:[i.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),u.map(b,m=>i.jsx("option",{value:m==null?void 0:m.value,children:m==null?void 0:m.label},m==null?void 0:m.value))]})},oe={type:"Select",label:"web_blocks.select",category:"core",icon:y.DropdownMenuIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},_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"]},le=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:s,styles:n,inputStyles:a,rows:c,showLabel:p,required:d}=e,b=f.generateUUID();return p?i.jsxs("div",{...n,...o,children:[p&&i.jsx("label",{htmlFor:b,children:r}),i.jsx("textarea",{name:t,...a,id:b,placeholder:s,rows:c,required:d})]}):i.jsx("textarea",{id:b,name:t,...o,...a,...n,placeholder:s,rows:c,required:d})},re={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:y.InputIcon,group:"form",...l.registerChaiBlockSchema({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},rows:{type:"number",title:"Rows",default:3},required:{type:"boolean",title:"Required",default:!1}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},se=e=>{const{blockProps:o,inBuilder:t,children:r,globalBlock:s}=e;return t&&!s?i.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:[i.jsxs("h1",{children:["Global Block - ",s]}),i.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):g.createElement("span",{...o},r)},ie={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:C.GlobeIcon,category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},ne=e=>{const{blockProps:o,styles:t,content:r,tag:s="h1",children:n=null}=e;return n?g.createElement(s,{...t,...o},n):g.createElement(s,{...t,...o,dangerouslySetInnerHTML:{__html:r}})},ae={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:y.HeadingIcon,group:"typography",...l.registerChaiBlockSchema({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:l.StylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Text"},ce=e=>{const{blockProps:o,styles:t}=e;return k.createElement("br",{...o,...t})},pe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},de=e=>{const{blockProps:o,children:t,styles:r}=e;return t?k.createElement("table",{...o,...r},t):i.jsx(x,{})},ue=e=>{const{blockProps:o,children:t,styles:r}=e;return t?k.createElement("thead",{...o,...r},t):i.jsx(x,{})},me=e=>{const{blockProps:o,children:t,styles:r}=e;return t?k.createElement("tbody",{...o,...r},t):i.jsx(x,{})},ye=e=>{const{blockProps:o,children:t,styles:r}=e;return t?k.createElement("tr",{...o,...r},t):i.jsx(x,{})},ge=e=>{const{blockProps:o,children:t,content:r,styles:s}=e;return!t&&u.isEmpty(r)?i.jsx(x,{}):t?k.createElement("td",{...o,...s},t):k.createElement("td",{...o,...s,dangerouslySetInnerHTML:{__html:r}})};l.registerChaiBlock(de,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:y.TableIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("Table")});l.registerChaiBlock(ue,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:y.BorderTopIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("TableHead")});l.registerChaiBlock(me,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:y.BorderAllIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("TableBody")});l.registerChaiBlock(ye,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:y.ViewHorizontalIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("TableRow")});l.registerChaiBlock(ge,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:y.DragHandleHorizontalIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),blocks:B("TableCell"),i18nProps:["content"],aiProps:["content"]});function B(e){const o=(n,a)=>({_id:f.generateUUID(),_parent:n,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+a}`}),t=n=>{const a=f.generateUUID(),c={_type:"TableRow",_id:a,styles:"#styles:,border-b"};return n&&(c._parent=n),[c,o(a,"1"),o(a,"2"),o(a,"3")]},r=n=>{const a=f.generateUUID(),c={_id:a,_type:"TableHead",styles:"#styles:,font-medium"};return n&&(c._parent=n),[c,...t(a)]},s=n=>{const a=f.generateUUID(),c={_id:a,_type:"TableBody",styles:"#styles:,"};return n&&(c._parent=n),[c,...t(a),...t(a)]};if(e==="Table"){const n=f.generateUUID();return[{_id:n,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...r(n),...s(n)]}return e==="TableRow"?t():e==="TableHead"?r():e==="TableBody"?s():[]}const v=(e,...o)=>({...e,className:f.cn(e.className,...o)}),he=e=>{const{blockProps:o,icon:t,styles:r,width:s,inBuilder:n,height:a}=e,c=v(r,"");if(u.isEmpty(t))return i.jsx(x,{inBuilder:n,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return g.createElement("span",{...o,...c,style:{width:s?`${s}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},be={type:"Icon",label:"web_blocks.icon",category:"core",icon:y.SketchLogoIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),icon:{type:"string",title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},fe=e=>{const{blockProps:o,image:t,mobileImage:r,styles:s,alt:n,height:a,width:c,lazyLoading:p}=e;return u.isEmpty(t)?i.jsx(x,{className:"h-36"}):i.jsxs("picture",{children:[r&&i.jsx("source",{srcSet:r,media:"(max-width: 480px)"}),i.jsx("img",{...o,...s,src:t,alt:n,loading:p?"lazy":"eager",width:c,height:a})]})},ke={type:"Image",description:"A image component",label:"Image",category:"core",icon:y.ImageIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),image:{type:"string",title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas",ui:{"ui:widget":"image"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0},width:{type:"number",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"number",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}},assetId:{type:"string",title:"Asset ID",default:"",ui:{"ui:widget":"hidden"}}}}),aiProps:["alt"],i18nProps:["alt"]},xe=e=>{const{blockProps:o,link:t,children:r,styles:s,inBuilder:n,content:a}=e;let c={};return!r&&u.isEmpty(a)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?r?i.jsx("a",{...o,style:c,...s,children:r}):k.createElement("a",{...o,...s,style:c},a):r?i.jsx("a",{"aria-label":a,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...s,children:r}):k.createElement("a",{...o,...s,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":a},a)},Ce={type:"Link",description:"A link component",label:"Link",category:"core",icon:y.Link1Icon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"Link goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e!=="Link"},Be=e=>{const{blockProps:o,children:t,listType:r,styles:s,tag:n,inBuilder:a}=e,c=f.cn(u.get(s,"className",""),r);return!t&&u.isEmpty(s==null?void 0:s.className)?i.jsx(x,{inBuilder:a}):g.createElement(n||(r==="list-decimal"?"ol":"ul"),{...o,...s,className:c},t)},Se={type:"List",description:"A list component",label:"List",icon:y.RowsIcon,category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),listType:{type:"string",title:"List Type",default:"list-none",oneOf:[{enum:["list-none"],title:"List None"},{enum:["list-disc"],title:"Disc"},{enum:["list-decimal"],title:"Decimal"}]}}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]},we=e=>{const{blockProps:o,content:t,styles:r,children:s,tag:n}=e;return s?g.createElement(n||"li",{...r,...o},s):g.createElement(n||"li",{...r,...o,dangerouslySetInnerHTML:{__html:t}})},Pe={type:"ListItem",description:"A list item component",label:"List Item",icon:y.ColumnsIcon,category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"||e==="Repeater"},ve=e=>{const{blockProps:o,styles:t,content:r}=e;return u.isNull(e.children)?g.createElement("p",{...t,...o,dangerouslySetInnerHTML:{__html:r}}):g.createElement("p",{...t,...o},e.children)},Ie={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:y.TextIcon,group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},Le=e=>{const{blockProps:o,inBuilder:t,children:r,partialBlockId:s}=e;return t&&!s?i.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:[i.jsxs("h1",{children:["Partial Block - ",s]}),i.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):g.createElement("span",{...o},r)},je={type:"PartialBlock",description:"A partial block component",label:"Partial Block",icon:C.GlobeIcon,category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{partialBlockId:{type:"string",title:"Partial Block",default:"",ui:{"ui:widget":"hidden"}}}})},S={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},_e=e=>{const{blockProps:o,children:t,styles:r,colSpan:s,tabletColSpan:n,desktopColSpan:a}=e,p={className:[u.get(r,"className",""),u.get(S,["SMALL",isNaN(s)||!s?6:s],""),n?u.get(S,["MEDIUM",n||s],""):"",a?u.get(S,["LARGE",n||s],""):""].join(" ")};return i.jsx("div",{...o,...r,...p,children:t||i.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},Te={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:C.Columns,wrapper:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Ee=e=>{const{blockProps:o,children:t,styles:r,gutter:s}=e,a={className:[u.get(r,"className","")," grid grid-cols-12"].join()};return typeof(r==null?void 0:r.style)=="object"?r.style.gap=`${s}px`:a.style={gap:`${s}px`},i.jsx("div",{...o,...r,...a,children:t})},Ne={type:"Row",description:"A row component",label:"Row",group:"basic",icon:C.Rows,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},Re=e=>{const{blockProps:o,content:t,styles:r}=e,s=v(r,"prose dark:prose-invert prose-p:m-0 prose-p:min-h-[1rem] prose-blockquote:m-2 prose-blockquote:ml-4 prose-ul:m-0 prose-ol:m-0 prose-li:m-0","max-w-full");return i.jsx("div",{...o,...s,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",category:"core",icon:y.CursorTextIcon,group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},Ae=e=>{const{blockProps:o,styles:t,content:r,children:s=null,tag:n}=e;return s?g.createElement("span",{...t,...o},s):g.createElement(n||"span",{...t,...o,dangerouslySetInnerHTML:{__html:r||""}})},$e={type:"Span",description:"A span component",label:"Span",category:"core",group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},He=e=>e.inBuilder||e.forceWrapper?i.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Ue={type:"Text",description:"A text component with no styling",label:"Text",hidden:!0,category:"core",group:"typography",icon:y.SpaceBetweenVerticallyIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},De={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}}},w=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,P=/(?: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),r=u.get(o,"controls",!1),s=u.get(o,"loop",!1),n=t||u.get(o,"muted",!0);if(w.test(e)){const a=e.match(w);if(a){const c=a[4];let p=`https://www.youtube.com/embed/${c}`,d=t?"autoplay=1":"";return d+=s?`&loop=1&playlist=${c}`:"",d+=n?"&mute=1&muted=1":"",d+=r?"&controls=1":"&controls=0",`${p}?${d}`}}if(P.test(e)){const a=e.match(P);if(a){const c=a[1];let p="";return p+=t?"autoplay=1":"",p+=r?"&controls=1":"&controls=0",p+=n?"&muted=1":"",p+=s?"&loop=1":"",`https://player.vimeo.com/video/${c}?${p}`}}return null},qe=e=>{const{url:o,blockProps:t,styles:r,controls:s,videoSource:n,inBuilder:a}=e,c=ze(o,s);return i.jsxs("div",{...u.omit(r,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!c&&a?i.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:u.isEmpty(o)?`Provided ${n} video link in settings Video URL.`:`Provided ${n} video link is invalid.`}):i.jsx("iframe",{width:"100%",src:c,...u.pick(r,"className")}),a&&i.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Fe=e=>{const{url:o,styles:t,controls:r,sources:s,poster:n,blockProps:a}=e;let c=n;const p=[...u.get(s,"srcsets",[])||[]];o&&typeof o=="string"&&p.push({url:o,width:"9999"});const d=p.sort((h,m)=>parseInt(h.width)-parseInt(m.width)).filter(h=>!u.isEmpty(h.url)&&!u.isEmpty(h.width));d.length===0&&!c&&(c="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const b=u.get(r,"autoplay",!1)||u.get(r,"muted",!0);return(c||!u.isEmpty(d))&&i.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:k.createElement("video",{...t,...a,key:JSON.stringify(d),controls:u.get(r,"controls",!1),autoPlay:u.get(r,"autoplay",!1),loop:u.get(r,"loop",!1),poster:c,...b?{muted:!0}:{}},d.map(h=>{if(!h.url||h.url.length<4||isNaN(h.width))return null;const m=`(max-width: ${h.width}px)`;return i.jsx("source",{src:h.url,media:m,type:h.type},h.url)}),"Your browser does not support the video tag.")})},Oe=e=>{const{videoSource:o}=e;return o==="Custom"?i.jsx(Fe,{...e}):o==="Youtube"||o==="Vimeo"?i.jsx(qe,{...e}):i.jsxs("div",{children:["Invalid video source : ",o]})},Ve={type:"Video",label:"Video",category:"core",icon:y.VideoIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"}},allOf:[{if:{properties:{videoSource:{const:"Custom"}}},then:{properties:{url:{type:"string",title:"Video URL",default:""},poster:{type:"string",title:"Poster URL",default:""},sources:{type:"object",default:{srcsets:[]}},controls:{...De}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url"]},Ge=e=>{const{children:o,tag:t,styles:r,blockProps:s,inBuilder:n,$loading:a}=e;let c=o;return u.isEmpty(c)&&n&&(c=i.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Choose a collection to display items"})),t==="none"?a&&n?Array.from({length:2}).map((p,d)=>i.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[i.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),i.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},d)):c:g.createElement(t,{...s,...r},a&&n?Array.from({length:2}).map((p,d)=>i.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[i.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),i.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},d)):c)},Ye={type:"Repeater",label:"Repeater",icon:y.LoopIcon,group:"basic",dataProviderMode:"live",dataProviderDependencies:["filter","sort","limit","repeaterItems"],blocks:()=>[{_id:"A",_type:"Repeater",tag:"ul"},{_id:"B",_name:"Repeater Item",_type:"RepeaterItem",parentTag:"ul",_parent:"A"}],...l.registerChaiBlockSchema({properties:{styles:l.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),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"]},limit:{title:"Limit",type:"number",default:3},filter:{title:"Filter by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},sort:{title:"Sort by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}}}})},We=({children:e,blockProps:o,styles:t,parentTag:r,inBuilder:s})=>{let n="li";switch(r){case"ul":n="li";break;case"ol":n="li";break;default:n="div"}return!e&&s?g.createElement(n,{...o,...t},i.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"})):g.createElement(n,{...o,...t},e)},Xe={type:"RepeaterItem",label:"Repeater Item",icon:y.LoopIcon,hidden:!0,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.stylesProp(""),parentTag:l.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Je=({children:e,blockProps:o,styles:t})=>g.createElement("div",{...o,...t},e),Qe={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Ze=()=>{l.registerChaiBlock(L,j),l.registerChaiBlock(D,z),l.registerChaiBlock(_,T),l.registerChaiBlock(ne,ae),l.registerChaiBlock(ve,Ie),l.registerChaiBlock(Ae,$e),l.registerChaiBlock(Re,Me),l.registerChaiBlock(xe,Ce),l.registerChaiBlock(Be,Se),l.registerChaiBlock(we,Pe),l.registerChaiBlock(he,be),l.registerChaiBlock(fe,ke),l.registerChaiBlock(Oe,Ve),l.registerChaiBlock(R,M),l.registerChaiBlock(A,$),l.registerChaiBlock(He,Ue),l.registerChaiBlock(O,V),l.registerChaiBlock(G,Y),l.registerChaiBlock(X,J),l.registerChaiBlock(q,F),l.registerChaiBlock(K,ee),l.registerChaiBlock(te,oe),l.registerChaiBlock(le,re),l.registerChaiBlock(Q,Z),l.registerChaiBlock(ce,pe),l.registerChaiBlock(H,U),l.registerChaiBlock(se,ie),l.registerChaiBlock(Le,je),l.registerChaiBlock(Ee,Ne),l.registerChaiBlock(_e,Te),l.registerChaiBlock(E,N),l.registerChaiBlock(Ge,Ye),l.registerChaiBlock(We,Xe),l.registerChaiBlock(Je,Qe)};exports.loadWebBlocks=Ze;
|
package/dist/web-blocks.js
CHANGED
|
@@ -3,15 +3,15 @@ import { jsx as s, jsxs as f, Fragment as N } from "react/jsx-runtime";
|
|
|
3
3
|
import { c as B, g as w } from "./common-functions-BGzDsf1z.js";
|
|
4
4
|
import * as g from "react";
|
|
5
5
|
import { createElement as x } from "react";
|
|
6
|
-
import { ButtonIcon as R, CopyIcon as z, CodeIcon as D, DividerHorizontalIcon as j, CheckboxIcon as U, InputIcon as A, LetterCaseToggleIcon as q, RadiobuttonIcon as F, DropdownMenuIcon as V, HeadingIcon as O, TableIcon as G, BorderTopIcon as Y, BorderAllIcon as W, ViewHorizontalIcon as X, DragHandleHorizontalIcon as J, SketchLogoIcon as Q, ImageIcon as Z, Link1Icon as K, RowsIcon as ee, ColumnsIcon as te, TextIcon as oe, CursorTextIcon as le, SpaceBetweenVerticallyIcon as
|
|
6
|
+
import { ButtonIcon as R, CopyIcon as z, CodeIcon as D, DividerHorizontalIcon as j, CheckboxIcon as U, InputIcon as A, LetterCaseToggleIcon as q, RadiobuttonIcon as F, DropdownMenuIcon as V, HeadingIcon as O, TableIcon as G, BorderTopIcon as Y, BorderAllIcon as W, ViewHorizontalIcon as X, DragHandleHorizontalIcon as J, SketchLogoIcon as Q, ImageIcon as Z, Link1Icon as K, RowsIcon as ee, ColumnsIcon as te, TextIcon as oe, CursorTextIcon as le, SpaceBetweenVerticallyIcon as re, VideoIcon as ne, LoopIcon as M } from "@radix-ui/react-icons";
|
|
7
7
|
import { isEmpty as C, get as h, map as S, isNull as ie, omit as se, pick as ae } from "lodash-es";
|
|
8
8
|
import { FileCode as ce, GroupIcon as pe, GlobeIcon as E, Columns as de, Rows as ue } from "lucide-react";
|
|
9
9
|
const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div", { className: B("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ s("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ s("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, me = (e) => {
|
|
10
|
-
const { blockProps: t, inBuilder: o, backgroundImage: l, children:
|
|
11
|
-
let a =
|
|
12
|
-
|
|
10
|
+
const { blockProps: t, inBuilder: o, backgroundImage: l, children: r, tag: n = "div", styles: i } = e;
|
|
11
|
+
let a = r;
|
|
12
|
+
r || (a = /* @__PURE__ */ s(v, { inBuilder: o }));
|
|
13
13
|
let c = {};
|
|
14
|
-
return l && (c = { backgroundImage: `url(${l})` }), g.createElement(
|
|
14
|
+
return l && (c = { backgroundImage: `url(${l})` }), g.createElement(n, { ...t, ...i, style: c }, a);
|
|
15
15
|
}, ye = {
|
|
16
16
|
type: "Box",
|
|
17
17
|
description: "Similar to a div or section elements in HTML",
|
|
@@ -55,8 +55,8 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
55
55
|
}),
|
|
56
56
|
canAcceptBlock: () => !0
|
|
57
57
|
}, ge = (e) => {
|
|
58
|
-
const { blockProps: t, iconSize: o, icon: l, content:
|
|
59
|
-
/* @__PURE__ */ s("span", { "data-ai-key": "content", children:
|
|
58
|
+
const { blockProps: t, iconSize: o, icon: l, content: r, styles: n, children: i, iconPos: a, link: c, inBuilder: m } = e, k = l, b = i || /* @__PURE__ */ f(N, { children: [
|
|
59
|
+
/* @__PURE__ */ s("span", { "data-ai-key": "content", children: r }),
|
|
60
60
|
k && /* @__PURE__ */ s(
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
@@ -69,13 +69,13 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
69
69
|
"button",
|
|
70
70
|
{
|
|
71
71
|
...t,
|
|
72
|
-
...
|
|
72
|
+
...n,
|
|
73
73
|
type: "button",
|
|
74
|
-
"aria-label":
|
|
74
|
+
"aria-label": r
|
|
75
75
|
},
|
|
76
76
|
b
|
|
77
77
|
);
|
|
78
|
-
return C(h(c, "href")) ? y : m ? /* @__PURE__ */ s("span", { children: y }) : /* @__PURE__ */ s("a", { "aria-label":
|
|
78
|
+
return C(h(c, "href")) ? y : m ? /* @__PURE__ */ s("span", { children: y }) : /* @__PURE__ */ s("a", { "aria-label": r, href: h(c, "href") || "/", target: h(c, "target", "_self"), children: y });
|
|
79
79
|
}, be = {
|
|
80
80
|
type: "Button",
|
|
81
81
|
description: "similar to a button element in HTML",
|
|
@@ -134,17 +134,17 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
134
134
|
i18nProps: ["content"],
|
|
135
135
|
aiProps: ["content"]
|
|
136
136
|
}, fe = (e) => {
|
|
137
|
-
const { blockProps: t, iconSize: o, icon: l, content:
|
|
138
|
-
/* @__PURE__ */ s("span", { "data-ai-key": "content", children:
|
|
137
|
+
const { blockProps: t, iconSize: o, icon: l, content: r, styles: n } = e, i = l, a = /* @__PURE__ */ f(N, { children: [
|
|
138
|
+
/* @__PURE__ */ s("span", { "data-ai-key": "content", children: r }),
|
|
139
139
|
i && /* @__PURE__ */ s("div", { style: { width: o + "px" }, dangerouslySetInnerHTML: { __html: i } })
|
|
140
140
|
] });
|
|
141
141
|
return x(
|
|
142
142
|
"button",
|
|
143
143
|
{
|
|
144
144
|
...t,
|
|
145
|
-
...
|
|
145
|
+
...n,
|
|
146
146
|
type: "button",
|
|
147
|
-
"aria-label":
|
|
147
|
+
"aria-label": r
|
|
148
148
|
},
|
|
149
149
|
a
|
|
150
150
|
);
|
|
@@ -179,9 +179,9 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
179
179
|
i18nProps: ["content"],
|
|
180
180
|
aiProps: ["content"]
|
|
181
181
|
}, ke = (e) => {
|
|
182
|
-
const { blockProps: t, styles: o, htmlCode: l, inBuilder:
|
|
183
|
-
return
|
|
184
|
-
|
|
182
|
+
const { blockProps: t, styles: o, htmlCode: l, inBuilder: r } = e;
|
|
183
|
+
return r ? /* @__PURE__ */ f("div", { className: "relative", children: [
|
|
184
|
+
r ? /* @__PURE__ */ s("div", { ...t, ...o, className: "absolute z-20 h-full w-full" }) : null,
|
|
185
185
|
g.createElement("div", {
|
|
186
186
|
...o,
|
|
187
187
|
dangerouslySetInnerHTML: { __html: l.replace(/<script.*?>.*?<\/script>/g, "") }
|
|
@@ -247,8 +247,8 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
247
247
|
})
|
|
248
248
|
}, Be = (e) => {
|
|
249
249
|
const { blockProps: t, styles: o, backgroundImage: l } = e;
|
|
250
|
-
let
|
|
251
|
-
return l && (
|
|
250
|
+
let r = {};
|
|
251
|
+
return l && (r = { backgroundImage: `url(${l})` }), g.createElement("div", { ...t, ...o, style: r });
|
|
252
252
|
}, Ie = {
|
|
253
253
|
type: "EmptyBox",
|
|
254
254
|
description: "A box component with no children",
|
|
@@ -267,12 +267,12 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
267
267
|
}
|
|
268
268
|
})
|
|
269
269
|
}, Pe = (e) => {
|
|
270
|
-
const { blockProps: t, fieldName: o, label: l, styles:
|
|
271
|
-
return c ? /* @__PURE__ */ f("div", { ...
|
|
270
|
+
const { blockProps: t, fieldName: o, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e, m = w();
|
|
271
|
+
return c ? /* @__PURE__ */ f("div", { ...r, ...t, children: [
|
|
272
272
|
/* @__PURE__ */ s(
|
|
273
273
|
"input",
|
|
274
274
|
{
|
|
275
|
-
...
|
|
275
|
+
...n,
|
|
276
276
|
name: o,
|
|
277
277
|
id: m,
|
|
278
278
|
type: "checkbox",
|
|
@@ -286,8 +286,8 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
286
286
|
{
|
|
287
287
|
id: m,
|
|
288
288
|
...t,
|
|
289
|
-
...r,
|
|
290
289
|
...n,
|
|
290
|
+
...r,
|
|
291
291
|
type: "checkbox",
|
|
292
292
|
required: i,
|
|
293
293
|
name: o
|
|
@@ -333,7 +333,7 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
333
333
|
aiProps: ["label"],
|
|
334
334
|
i18nProps: ["label"]
|
|
335
335
|
}, _e = (e) => {
|
|
336
|
-
const { children: t, blockProps: o, errorMessage: l, successMessage:
|
|
336
|
+
const { children: t, blockProps: o, errorMessage: l, successMessage: r, action: n, styles: i, inBuilder: a } = e;
|
|
337
337
|
let c = t;
|
|
338
338
|
return t || (c = /* @__PURE__ */ s(v, { inBuilder: a })), /* @__PURE__ */ f(
|
|
339
339
|
"form",
|
|
@@ -343,9 +343,9 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
343
343
|
"x-on:submit.prevent": "post"
|
|
344
344
|
},
|
|
345
345
|
"data-error": l,
|
|
346
|
-
"data-success":
|
|
346
|
+
"data-success": r,
|
|
347
347
|
method: "post",
|
|
348
|
-
action:
|
|
348
|
+
action: n,
|
|
349
349
|
...o,
|
|
350
350
|
...i,
|
|
351
351
|
children: [
|
|
@@ -399,7 +399,7 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
399
399
|
aiProps: ["errorMessage", "successMessage"],
|
|
400
400
|
canAcceptBlock: () => !0
|
|
401
401
|
}, Ne = (e) => {
|
|
402
|
-
const { blockProps: t, inBuilder: o, label: l, styles:
|
|
402
|
+
const { blockProps: t, inBuilder: o, label: l, styles: r, inputStyles: n, icon: i, iconSize: a, iconPos: c } = e, m = w();
|
|
403
403
|
return /* @__PURE__ */ f(
|
|
404
404
|
"button",
|
|
405
405
|
{
|
|
@@ -407,8 +407,8 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
407
407
|
...{
|
|
408
408
|
"x-bind:disabled": "formLoading"
|
|
409
409
|
},
|
|
410
|
-
...r,
|
|
411
410
|
...n,
|
|
411
|
+
...r,
|
|
412
412
|
...t || {},
|
|
413
413
|
type: o ? "button" : "submit",
|
|
414
414
|
"aria-label": l,
|
|
@@ -532,8 +532,8 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
532
532
|
language: { type: "text", autocomplete: "language" }
|
|
533
533
|
}[e] || t : t;
|
|
534
534
|
}, Me = (e) => {
|
|
535
|
-
const { blockProps: t, fieldName: o, label: l, placeholder:
|
|
536
|
-
return a ? /* @__PURE__ */ f("div", { ...
|
|
535
|
+
const { blockProps: t, fieldName: o, label: l, placeholder: r, styles: n, inputStyles: i, showLabel: a, required: c, inputType: m } = e, k = w(), { type: b, autocomplete: y } = Ae(m);
|
|
536
|
+
return a ? /* @__PURE__ */ f("div", { ...n, ...t, children: [
|
|
537
537
|
a && /* @__PURE__ */ s("label", { htmlFor: k, children: l }),
|
|
538
538
|
/* @__PURE__ */ s(
|
|
539
539
|
"input",
|
|
@@ -542,7 +542,7 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
542
542
|
...i,
|
|
543
543
|
id: k,
|
|
544
544
|
type: b,
|
|
545
|
-
placeholder:
|
|
545
|
+
placeholder: r,
|
|
546
546
|
required: c,
|
|
547
547
|
autoComplete: y
|
|
548
548
|
}
|
|
@@ -554,9 +554,9 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
554
554
|
name: o,
|
|
555
555
|
...t,
|
|
556
556
|
...i,
|
|
557
|
-
...
|
|
557
|
+
...n,
|
|
558
558
|
type: b,
|
|
559
|
-
placeholder:
|
|
559
|
+
placeholder: r,
|
|
560
560
|
required: c,
|
|
561
561
|
autoComplete: y
|
|
562
562
|
}
|
|
@@ -670,9 +670,9 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
670
670
|
aiProps: ["label", "placeholder"],
|
|
671
671
|
i18nProps: ["label", "placeholder"]
|
|
672
672
|
}, $e = (e) => {
|
|
673
|
-
const { blockProps: t, content: o, styles: l, children:
|
|
674
|
-
return
|
|
675
|
-
...
|
|
673
|
+
const { blockProps: t, content: o, styles: l, children: r } = e, n = { ...l, ...t };
|
|
674
|
+
return r ? g.createElement("label", n, r) : g.createElement("label", {
|
|
675
|
+
...n,
|
|
676
676
|
dangerouslySetInnerHTML: { __html: o }
|
|
677
677
|
});
|
|
678
678
|
}, He = {
|
|
@@ -694,17 +694,17 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
694
694
|
aiProps: ["content"],
|
|
695
695
|
i18nProps: ["content"]
|
|
696
696
|
}, ze = (e) => {
|
|
697
|
-
const { blockProps: t, fieldName: o, label: l, styles:
|
|
698
|
-
return c ? /* @__PURE__ */ f("div", { ...
|
|
699
|
-
/* @__PURE__ */ s("input", { ...
|
|
697
|
+
const { blockProps: t, fieldName: o, label: l, styles: r, inputStyles: n, required: i, checked: a, showLabel: c = !0 } = e, m = w();
|
|
698
|
+
return c ? /* @__PURE__ */ f("div", { ...r, ...t, children: [
|
|
699
|
+
/* @__PURE__ */ s("input", { ...n, name: o, id: m, type: "radio", required: i, defaultChecked: a }),
|
|
700
700
|
l && /* @__PURE__ */ s("label", { htmlFor: m, children: l })
|
|
701
701
|
] }) : /* @__PURE__ */ s(
|
|
702
702
|
"input",
|
|
703
703
|
{
|
|
704
704
|
id: m,
|
|
705
705
|
...t,
|
|
706
|
-
...r,
|
|
707
706
|
...n,
|
|
707
|
+
...r,
|
|
708
708
|
type: "radio",
|
|
709
709
|
required: i,
|
|
710
710
|
checked: a,
|
|
@@ -751,15 +751,15 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
751
751
|
aiProps: ["label"],
|
|
752
752
|
i18nProps: ["label"]
|
|
753
753
|
}, je = (e) => {
|
|
754
|
-
const { blockProps: t, fieldName: o, label: l, placeholder:
|
|
755
|
-
return c ? /* @__PURE__ */ f("div", { ...
|
|
754
|
+
const { blockProps: t, fieldName: o, label: l, placeholder: r, styles: n, inputStyles: i, required: a, showLabel: c, _multiple: m, options: k } = e, b = w();
|
|
755
|
+
return c ? /* @__PURE__ */ f("div", { ...n, ...t, children: [
|
|
756
756
|
c && /* @__PURE__ */ s("label", { htmlFor: b, children: l }),
|
|
757
757
|
/* @__PURE__ */ f("select", { ...i, id: b, required: a, multiple: m, name: o, children: [
|
|
758
|
-
/* @__PURE__ */ s("option", { value: "", disabled: !0, selected: !0, hidden: !0, children:
|
|
758
|
+
/* @__PURE__ */ s("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: r }),
|
|
759
759
|
S(k, (y) => /* @__PURE__ */ s("option", { value: y == null ? void 0 : y.value, children: y == null ? void 0 : y.label }, y == null ? void 0 : y.value))
|
|
760
760
|
] })
|
|
761
|
-
] }) : /* @__PURE__ */ f("select", { id: b, ...
|
|
762
|
-
/* @__PURE__ */ s("option", { value: "", disabled: !0, selected: !0, hidden: !0, children:
|
|
761
|
+
] }) : /* @__PURE__ */ f("select", { id: b, ...n, ...t, required: a, multiple: m, name: o, children: [
|
|
762
|
+
/* @__PURE__ */ s("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: r }),
|
|
763
763
|
S(k, (y) => /* @__PURE__ */ s("option", { value: y == null ? void 0 : y.value, children: y == null ? void 0 : y.label }, y == null ? void 0 : y.value))
|
|
764
764
|
] });
|
|
765
765
|
}, Ue = {
|
|
@@ -827,8 +827,8 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
827
827
|
aiProps: ["label", "placeholder"],
|
|
828
828
|
i18nProps: ["label", "placeholder"]
|
|
829
829
|
}, qe = (e) => {
|
|
830
|
-
const { blockProps: t, fieldName: o, label: l, placeholder:
|
|
831
|
-
return c ? /* @__PURE__ */ f("div", { ...
|
|
830
|
+
const { blockProps: t, fieldName: o, label: l, placeholder: r, styles: n, inputStyles: i, rows: a, showLabel: c, required: m } = e, k = w();
|
|
831
|
+
return c ? /* @__PURE__ */ f("div", { ...n, ...t, children: [
|
|
832
832
|
c && /* @__PURE__ */ s("label", { htmlFor: k, children: l }),
|
|
833
833
|
/* @__PURE__ */ s(
|
|
834
834
|
"textarea",
|
|
@@ -836,7 +836,7 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
836
836
|
name: o,
|
|
837
837
|
...i,
|
|
838
838
|
id: k,
|
|
839
|
-
placeholder:
|
|
839
|
+
placeholder: r,
|
|
840
840
|
rows: a,
|
|
841
841
|
required: m
|
|
842
842
|
}
|
|
@@ -848,8 +848,8 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
848
848
|
name: o,
|
|
849
849
|
...t,
|
|
850
850
|
...i,
|
|
851
|
-
...
|
|
852
|
-
placeholder:
|
|
851
|
+
...n,
|
|
852
|
+
placeholder: r,
|
|
853
853
|
rows: a,
|
|
854
854
|
required: m
|
|
855
855
|
}
|
|
@@ -900,8 +900,8 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
900
900
|
aiProps: ["label", "placeholder"],
|
|
901
901
|
i18nProps: ["label", "placeholder"]
|
|
902
902
|
}, Ve = (e) => {
|
|
903
|
-
const { blockProps: t, inBuilder: o, children: l, globalBlock:
|
|
904
|
-
return o && !
|
|
903
|
+
const { blockProps: t, inBuilder: o, children: l, globalBlock: r } = e;
|
|
904
|
+
return o && !r ? /* @__PURE__ */ f(
|
|
905
905
|
"div",
|
|
906
906
|
{
|
|
907
907
|
className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
|
|
@@ -909,7 +909,7 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
909
909
|
children: [
|
|
910
910
|
/* @__PURE__ */ f("h1", { children: [
|
|
911
911
|
"Global Block - ",
|
|
912
|
-
|
|
912
|
+
r
|
|
913
913
|
] }),
|
|
914
914
|
/* @__PURE__ */ s("p", { children: "Choose a block from the sidebar to add it to this page." })
|
|
915
915
|
]
|
|
@@ -934,8 +934,8 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
934
934
|
}
|
|
935
935
|
})
|
|
936
936
|
}, Ge = (e) => {
|
|
937
|
-
const { blockProps: t, styles: o, content: l, tag:
|
|
938
|
-
return
|
|
937
|
+
const { blockProps: t, styles: o, content: l, tag: r = "h1", children: n = null } = e;
|
|
938
|
+
return n ? g.createElement(r, { ...o, ...t }, n) : g.createElement(r, {
|
|
939
939
|
...o,
|
|
940
940
|
...t,
|
|
941
941
|
dangerouslySetInnerHTML: { __html: l }
|
|
@@ -998,10 +998,10 @@ const v = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ s("div",
|
|
|
998
998
|
const { blockProps: t, children: o, styles: l } = e;
|
|
999
999
|
return o ? x("tr", { ...t, ...l }, o) : /* @__PURE__ */ s(v, {});
|
|
1000
1000
|
}, et = (e) => {
|
|
1001
|
-
const { blockProps: t, children: o, content: l, styles:
|
|
1002
|
-
return !o && C(l) ? /* @__PURE__ */ s(v, {}) : o ? x("td", { ...t, ...
|
|
1001
|
+
const { blockProps: t, children: o, content: l, styles: r } = e;
|
|
1002
|
+
return !o && C(l) ? /* @__PURE__ */ s(v, {}) : o ? x("td", { ...t, ...r }, o) : x("td", {
|
|
1003
1003
|
...t,
|
|
1004
|
-
...
|
|
1004
|
+
...r,
|
|
1005
1005
|
dangerouslySetInnerHTML: { __html: l }
|
|
1006
1006
|
});
|
|
1007
1007
|
};
|
|
@@ -1084,61 +1084,61 @@ p(et, {
|
|
|
1084
1084
|
aiProps: ["content"]
|
|
1085
1085
|
});
|
|
1086
1086
|
function L(e) {
|
|
1087
|
-
const t = (
|
|
1087
|
+
const t = (n, i) => ({
|
|
1088
1088
|
_id: w(),
|
|
1089
|
-
_parent:
|
|
1089
|
+
_parent: n,
|
|
1090
1090
|
_type: "TableCell",
|
|
1091
1091
|
styles: "#styles:,",
|
|
1092
1092
|
content: `${e === "TableHead" ? "Table Head" : "Table Cell " + i}`
|
|
1093
|
-
}), o = (
|
|
1093
|
+
}), o = (n) => {
|
|
1094
1094
|
const i = w(), a = {
|
|
1095
1095
|
_type: "TableRow",
|
|
1096
1096
|
_id: i,
|
|
1097
1097
|
styles: "#styles:,border-b"
|
|
1098
1098
|
};
|
|
1099
|
-
return
|
|
1100
|
-
}, l = (
|
|
1099
|
+
return n && (a._parent = n), [a, t(i, "1"), t(i, "2"), t(i, "3")];
|
|
1100
|
+
}, l = (n) => {
|
|
1101
1101
|
const i = w(), a = {
|
|
1102
1102
|
_id: i,
|
|
1103
1103
|
_type: "TableHead",
|
|
1104
1104
|
styles: "#styles:,font-medium"
|
|
1105
1105
|
};
|
|
1106
|
-
return
|
|
1107
|
-
},
|
|
1106
|
+
return n && (a._parent = n), [a, ...o(i)];
|
|
1107
|
+
}, r = (n) => {
|
|
1108
1108
|
const i = w(), a = {
|
|
1109
1109
|
_id: i,
|
|
1110
1110
|
_type: "TableBody",
|
|
1111
1111
|
styles: "#styles:,"
|
|
1112
1112
|
};
|
|
1113
|
-
return
|
|
1113
|
+
return n && (a._parent = n), [a, ...o(i), ...o(i)];
|
|
1114
1114
|
};
|
|
1115
1115
|
if (e === "Table") {
|
|
1116
|
-
const
|
|
1116
|
+
const n = w();
|
|
1117
1117
|
return [
|
|
1118
1118
|
{
|
|
1119
|
-
_id:
|
|
1119
|
+
_id: n,
|
|
1120
1120
|
_type: "Table",
|
|
1121
1121
|
styles: "#styles:,w-full text-left text-gray-500 dark:text-gray-400"
|
|
1122
1122
|
},
|
|
1123
|
-
...l(
|
|
1124
|
-
...n
|
|
1123
|
+
...l(n),
|
|
1124
|
+
...r(n)
|
|
1125
1125
|
];
|
|
1126
1126
|
}
|
|
1127
|
-
return e === "TableRow" ? o() : e === "TableHead" ? l() : e === "TableBody" ?
|
|
1127
|
+
return e === "TableRow" ? o() : e === "TableHead" ? l() : e === "TableBody" ? r() : [];
|
|
1128
1128
|
}
|
|
1129
1129
|
const $ = (e, ...t) => ({
|
|
1130
1130
|
...e,
|
|
1131
1131
|
className: B(e.className, ...t)
|
|
1132
1132
|
}), tt = (e) => {
|
|
1133
|
-
const { blockProps: t, icon: o, styles: l, width:
|
|
1133
|
+
const { blockProps: t, icon: o, styles: l, width: r, inBuilder: n, height: i } = e, a = $(l, "");
|
|
1134
1134
|
if (C(o))
|
|
1135
|
-
return /* @__PURE__ */ s(v, { inBuilder:
|
|
1135
|
+
return /* @__PURE__ */ s(v, { inBuilder: n, className: "h-8 w-14" });
|
|
1136
1136
|
const c = o.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
|
|
1137
1137
|
return g.createElement("span", {
|
|
1138
1138
|
...t,
|
|
1139
1139
|
...a,
|
|
1140
1140
|
style: {
|
|
1141
|
-
width:
|
|
1141
|
+
width: r ? `${r}px` : "auto",
|
|
1142
1142
|
height: i ? `${i}px` : "auto"
|
|
1143
1143
|
},
|
|
1144
1144
|
dangerouslySetInnerHTML: { __html: c }
|
|
@@ -1171,23 +1171,23 @@ const $ = (e, ...t) => ({
|
|
|
1171
1171
|
}
|
|
1172
1172
|
})
|
|
1173
1173
|
}, lt = (e) => {
|
|
1174
|
-
const { blockProps: t, image: o, mobileImage: l, styles:
|
|
1174
|
+
const { blockProps: t, image: o, mobileImage: l, styles: r, alt: n, height: i, width: a, lazyLoading: c } = e;
|
|
1175
1175
|
return C(o) ? /* @__PURE__ */ s(v, { className: "h-36" }) : /* @__PURE__ */ f("picture", { children: [
|
|
1176
1176
|
l && /* @__PURE__ */ s("source", { srcSet: l, media: "(max-width: 480px)" }),
|
|
1177
1177
|
/* @__PURE__ */ s(
|
|
1178
1178
|
"img",
|
|
1179
1179
|
{
|
|
1180
1180
|
...t,
|
|
1181
|
-
...
|
|
1181
|
+
...r,
|
|
1182
1182
|
src: o,
|
|
1183
|
-
alt:
|
|
1183
|
+
alt: n,
|
|
1184
1184
|
loading: c ? "lazy" : "eager",
|
|
1185
1185
|
width: a,
|
|
1186
1186
|
height: i
|
|
1187
1187
|
}
|
|
1188
1188
|
)
|
|
1189
1189
|
] });
|
|
1190
|
-
},
|
|
1190
|
+
}, rt = {
|
|
1191
1191
|
type: "Image",
|
|
1192
1192
|
description: "A image component",
|
|
1193
1193
|
label: "Image",
|
|
@@ -1242,22 +1242,22 @@ const $ = (e, ...t) => ({
|
|
|
1242
1242
|
}),
|
|
1243
1243
|
aiProps: ["alt"],
|
|
1244
1244
|
i18nProps: ["alt"]
|
|
1245
|
-
},
|
|
1246
|
-
const { blockProps: t, link: o, children: l, styles:
|
|
1245
|
+
}, nt = (e) => {
|
|
1246
|
+
const { blockProps: t, link: o, children: l, styles: r, inBuilder: n, content: i } = e;
|
|
1247
1247
|
let a = {};
|
|
1248
|
-
return !l && C(i) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }),
|
|
1249
|
-
"
|
|
1248
|
+
return !l && C(i) && (a = { minHeight: "50px", display: "flex", alignItems: "center", justifyContent: "center" }), n ? l ? /* @__PURE__ */ s("a", { ...t, style: a, ...r, children: l }) : x(
|
|
1249
|
+
"a",
|
|
1250
1250
|
{
|
|
1251
1251
|
...t,
|
|
1252
|
-
...
|
|
1252
|
+
...r,
|
|
1253
1253
|
style: a
|
|
1254
1254
|
},
|
|
1255
1255
|
i
|
|
1256
|
-
) : l ? /* @__PURE__ */ s("a", { "aria-label": i, href: (o == null ? void 0 : o.href) || "#/", target: o == null ? void 0 : o.target, ...t, ...
|
|
1256
|
+
) : l ? /* @__PURE__ */ s("a", { "aria-label": i, href: (o == null ? void 0 : o.href) || "#/", target: o == null ? void 0 : o.target, ...t, ...r, children: l }) : x(
|
|
1257
1257
|
"a",
|
|
1258
1258
|
{
|
|
1259
1259
|
...t,
|
|
1260
|
-
...
|
|
1260
|
+
...r,
|
|
1261
1261
|
href: (o == null ? void 0 : o.href) || "#",
|
|
1262
1262
|
target: (o == null ? void 0 : o.target) || "_self",
|
|
1263
1263
|
"aria-label": i
|
|
@@ -1306,10 +1306,10 @@ const $ = (e, ...t) => ({
|
|
|
1306
1306
|
i18nProps: ["content"],
|
|
1307
1307
|
canAcceptBlock: (e) => e !== "Link"
|
|
1308
1308
|
}, st = (e) => {
|
|
1309
|
-
const { blockProps: t, children: o, listType: l, styles:
|
|
1310
|
-
return !o && C(
|
|
1311
|
-
|
|
1312
|
-
{ ...t, ...
|
|
1309
|
+
const { blockProps: t, children: o, listType: l, styles: r, tag: n, inBuilder: i } = e, a = B(h(r, "className", ""), l);
|
|
1310
|
+
return !o && C(r == null ? void 0 : r.className) ? /* @__PURE__ */ s(v, { inBuilder: i }) : g.createElement(
|
|
1311
|
+
n || (l === "list-decimal" ? "ol" : "ul"),
|
|
1312
|
+
{ ...t, ...r, className: a },
|
|
1313
1313
|
o
|
|
1314
1314
|
);
|
|
1315
1315
|
}, at = {
|
|
@@ -1360,8 +1360,8 @@ const $ = (e, ...t) => ({
|
|
|
1360
1360
|
}
|
|
1361
1361
|
]
|
|
1362
1362
|
}, ct = (e) => {
|
|
1363
|
-
const { blockProps: t, content: o, styles: l, children:
|
|
1364
|
-
return
|
|
1363
|
+
const { blockProps: t, content: o, styles: l, children: r, tag: n } = e;
|
|
1364
|
+
return r ? g.createElement(n || "li", { ...l, ...t }, r) : g.createElement(n || "li", {
|
|
1365
1365
|
...l,
|
|
1366
1366
|
...t,
|
|
1367
1367
|
dangerouslySetInnerHTML: { __html: o }
|
|
@@ -1419,8 +1419,8 @@ const $ = (e, ...t) => ({
|
|
|
1419
1419
|
aiProps: ["content"],
|
|
1420
1420
|
canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
|
|
1421
1421
|
}, mt = (e) => {
|
|
1422
|
-
const { blockProps: t, inBuilder: o, children: l, partialBlockId:
|
|
1423
|
-
return o && !
|
|
1422
|
+
const { blockProps: t, inBuilder: o, children: l, partialBlockId: r } = e;
|
|
1423
|
+
return o && !r ? /* @__PURE__ */ f(
|
|
1424
1424
|
"div",
|
|
1425
1425
|
{
|
|
1426
1426
|
className: "flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",
|
|
@@ -1428,7 +1428,7 @@ const $ = (e, ...t) => ({
|
|
|
1428
1428
|
children: [
|
|
1429
1429
|
/* @__PURE__ */ f("h1", { children: [
|
|
1430
1430
|
"Partial Block - ",
|
|
1431
|
-
|
|
1431
|
+
r
|
|
1432
1432
|
] }),
|
|
1433
1433
|
/* @__PURE__ */ s("p", { children: "Choose a block from the sidebar to add it to this page." })
|
|
1434
1434
|
]
|
|
@@ -1496,11 +1496,11 @@ const $ = (e, ...t) => ({
|
|
|
1496
1496
|
12: "lg:col-span-12"
|
|
1497
1497
|
}
|
|
1498
1498
|
}, gt = (e) => {
|
|
1499
|
-
const { blockProps: t, children: o, styles: l, colSpan:
|
|
1499
|
+
const { blockProps: t, children: o, styles: l, colSpan: r, tabletColSpan: n, desktopColSpan: i } = e, c = { className: [
|
|
1500
1500
|
h(l, "className", ""),
|
|
1501
|
-
h(I, ["SMALL", isNaN(
|
|
1502
|
-
|
|
1503
|
-
i ? h(I, ["LARGE",
|
|
1501
|
+
h(I, ["SMALL", isNaN(r) || !r ? 6 : r], ""),
|
|
1502
|
+
n ? h(I, ["MEDIUM", n || r], "") : "",
|
|
1503
|
+
i ? h(I, ["LARGE", n || r], "") : ""
|
|
1504
1504
|
].join(" ") };
|
|
1505
1505
|
return /* @__PURE__ */ s("div", { ...t, ...l, ...c, children: o || /* @__PURE__ */ s("div", { className: "h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900" }) });
|
|
1506
1506
|
}, bt = {
|
|
@@ -1540,8 +1540,8 @@ const $ = (e, ...t) => ({
|
|
|
1540
1540
|
}
|
|
1541
1541
|
})
|
|
1542
1542
|
}, ft = (e) => {
|
|
1543
|
-
const { blockProps: t, children: o, styles: l, gutter:
|
|
1544
|
-
return typeof (l == null ? void 0 : l.style) == "object" ? l.style.gap = `${
|
|
1543
|
+
const { blockProps: t, children: o, styles: l, gutter: r } = e, i = { className: [h(l, "className", ""), " grid grid-cols-12"].join() };
|
|
1544
|
+
return typeof (l == null ? void 0 : l.style) == "object" ? l.style.gap = `${r}px` : i.style = { gap: `${r}px` }, /* @__PURE__ */ s("div", { ...t, ...l, ...i, children: o });
|
|
1545
1545
|
}, ht = {
|
|
1546
1546
|
type: "Row",
|
|
1547
1547
|
description: "A row component",
|
|
@@ -1574,12 +1574,12 @@ const $ = (e, ...t) => ({
|
|
|
1574
1574
|
}
|
|
1575
1575
|
})
|
|
1576
1576
|
}, kt = (e) => {
|
|
1577
|
-
const { blockProps: t, content: o, styles: l } = e,
|
|
1577
|
+
const { blockProps: t, content: o, styles: l } = e, r = $(
|
|
1578
1578
|
l,
|
|
1579
1579
|
"prose dark:prose-invert prose-p:m-0 prose-p:min-h-[1rem] prose-blockquote:m-2 prose-blockquote:ml-4 prose-ul:m-0 prose-ol:m-0 prose-li:m-0",
|
|
1580
1580
|
"max-w-full"
|
|
1581
1581
|
);
|
|
1582
|
-
return /* @__PURE__ */ s("div", { ...t, ...
|
|
1582
|
+
return /* @__PURE__ */ s("div", { ...t, ...r, dangerouslySetInnerHTML: { __html: o } });
|
|
1583
1583
|
}, xt = {
|
|
1584
1584
|
type: "RichText",
|
|
1585
1585
|
description: "A rich text block",
|
|
@@ -1601,8 +1601,8 @@ const $ = (e, ...t) => ({
|
|
|
1601
1601
|
aiProps: ["content"],
|
|
1602
1602
|
i18nProps: ["content"]
|
|
1603
1603
|
}, wt = (e) => {
|
|
1604
|
-
const { blockProps: t, styles: o, content: l, children:
|
|
1605
|
-
return
|
|
1604
|
+
const { blockProps: t, styles: o, content: l, children: r = null, tag: n } = e;
|
|
1605
|
+
return r ? g.createElement("span", { ...o, ...t }, r) : g.createElement(n || "span", {
|
|
1606
1606
|
...o,
|
|
1607
1607
|
...t,
|
|
1608
1608
|
dangerouslySetInnerHTML: { __html: l || "" }
|
|
@@ -1634,7 +1634,7 @@ const $ = (e, ...t) => ({
|
|
|
1634
1634
|
hidden: !0,
|
|
1635
1635
|
category: "core",
|
|
1636
1636
|
group: "typography",
|
|
1637
|
-
icon:
|
|
1637
|
+
icon: re,
|
|
1638
1638
|
...u({
|
|
1639
1639
|
properties: {
|
|
1640
1640
|
styles: d("text-black"),
|
|
@@ -1679,13 +1679,13 @@ const $ = (e, ...t) => ({
|
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
1681
|
}, _ = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, T = /(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/, It = (e, t) => {
|
|
1682
|
-
const o = h(t, "autoplay", !1), l = h(t, "controls", !1),
|
|
1682
|
+
const o = h(t, "autoplay", !1), l = h(t, "controls", !1), r = h(t, "loop", !1), n = o || h(t, "muted", !0);
|
|
1683
1683
|
if (_.test(e)) {
|
|
1684
1684
|
const i = e.match(_);
|
|
1685
1685
|
if (i) {
|
|
1686
1686
|
const a = i[4];
|
|
1687
1687
|
let c = `https://www.youtube.com/embed/${a}`, m = o ? "autoplay=1" : "";
|
|
1688
|
-
return m +=
|
|
1688
|
+
return m += r ? `&loop=1&playlist=${a}` : "", m += n ? "&mute=1&muted=1" : "", m += l ? "&controls=1" : "&controls=0", `${c}?${m}`;
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
1691
|
if (T.test(e)) {
|
|
@@ -1693,20 +1693,20 @@ const $ = (e, ...t) => ({
|
|
|
1693
1693
|
if (i) {
|
|
1694
1694
|
const a = i[1];
|
|
1695
1695
|
let c = "";
|
|
1696
|
-
return c += o ? "autoplay=1" : "", c += l ? "&controls=1" : "&controls=0", c +=
|
|
1696
|
+
return c += o ? "autoplay=1" : "", c += l ? "&controls=1" : "&controls=0", c += n ? "&muted=1" : "", c += r ? "&loop=1" : "", `https://player.vimeo.com/video/${a}?${c}`;
|
|
1697
1697
|
}
|
|
1698
1698
|
}
|
|
1699
1699
|
return null;
|
|
1700
1700
|
}, Pt = (e) => {
|
|
1701
|
-
const { url: t, blockProps: o, styles: l, controls:
|
|
1701
|
+
const { url: t, blockProps: o, styles: l, controls: r, videoSource: n, inBuilder: i } = e, a = It(t, r);
|
|
1702
1702
|
return /* @__PURE__ */ f("div", { ...se(l, "className"), className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
|
|
1703
|
-
!a && i ? /* @__PURE__ */ s("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: C(t) ? `Provided ${
|
|
1703
|
+
!a && i ? /* @__PURE__ */ s("div", { className: "absolute flex h-full w-full items-center justify-center bg-gray-300 text-center", children: C(t) ? `Provided ${n} video link in settings Video URL.` : `Provided ${n} video link is invalid.` }) : /* @__PURE__ */ s("iframe", { width: "100%", src: a, ...ae(l, "className") }),
|
|
1704
1704
|
i && /* @__PURE__ */ s("div", { ...o, className: "absolute top-0 h-full w-full" })
|
|
1705
1705
|
] });
|
|
1706
1706
|
}, St = (e) => {
|
|
1707
|
-
const { url: t, styles: o, controls: l, sources:
|
|
1708
|
-
let a =
|
|
1709
|
-
const c = [...h(
|
|
1707
|
+
const { url: t, styles: o, controls: l, sources: r, poster: n, blockProps: i } = e;
|
|
1708
|
+
let a = n;
|
|
1709
|
+
const c = [...h(r, "srcsets", []) || []];
|
|
1710
1710
|
t && typeof t == "string" && c.push({ url: t, width: "9999" });
|
|
1711
1711
|
const m = c.sort((b, y) => parseInt(b.width) - parseInt(y.width)).filter((b) => !C(b.url) && !C(b.width));
|
|
1712
1712
|
m.length === 0 && !a && (a = "https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");
|
|
@@ -1740,7 +1740,7 @@ const $ = (e, ...t) => ({
|
|
|
1740
1740
|
type: "Video",
|
|
1741
1741
|
label: "Video",
|
|
1742
1742
|
category: "core",
|
|
1743
|
-
icon:
|
|
1743
|
+
icon: ne,
|
|
1744
1744
|
group: "media",
|
|
1745
1745
|
...u({
|
|
1746
1746
|
properties: {
|
|
@@ -1820,15 +1820,15 @@ const $ = (e, ...t) => ({
|
|
|
1820
1820
|
}),
|
|
1821
1821
|
i18nProps: ["url"]
|
|
1822
1822
|
}, Nt = (e) => {
|
|
1823
|
-
const { children: t, tag: o, styles: l, blockProps:
|
|
1823
|
+
const { children: t, tag: o, styles: l, blockProps: r, inBuilder: n, $loading: i } = e;
|
|
1824
1824
|
let a = t;
|
|
1825
|
-
return C(a) &&
|
|
1825
|
+
return C(a) && n && (a = /* @__PURE__ */ s("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" })), o === "none" ? i && n ? Array.from({ length: 2 }).map((c, m) => /* @__PURE__ */ f("div", { className: "animate-pulse rounded-md bg-primary/10 p-5", children: [
|
|
1826
1826
|
/* @__PURE__ */ s("div", { className: "h-6 w-1/2 rounded-md bg-primary/10" }),
|
|
1827
1827
|
/* @__PURE__ */ s("div", { className: "mt-2 h-4 w-1/2 rounded-md bg-primary/10" })
|
|
1828
1828
|
] }, m)) : a : g.createElement(
|
|
1829
1829
|
o,
|
|
1830
|
-
{ ...
|
|
1831
|
-
i &&
|
|
1830
|
+
{ ...r, ...l },
|
|
1831
|
+
i && n ? Array.from({ length: 2 }).map((c, m) => /* @__PURE__ */ f("div", { className: "animate-pulse rounded-md bg-primary/10 p-5", children: [
|
|
1832
1832
|
/* @__PURE__ */ s("div", { className: "h-6 w-1/2 rounded-md bg-primary/10" }),
|
|
1833
1833
|
/* @__PURE__ */ s("div", { className: "mt-2 h-4 w-1/2 rounded-md bg-primary/10" })
|
|
1834
1834
|
] }, m)) : a
|
|
@@ -1896,24 +1896,24 @@ const $ = (e, ...t) => ({
|
|
|
1896
1896
|
blockProps: t,
|
|
1897
1897
|
styles: o,
|
|
1898
1898
|
parentTag: l,
|
|
1899
|
-
inBuilder:
|
|
1899
|
+
inBuilder: r
|
|
1900
1900
|
}) => {
|
|
1901
|
-
let
|
|
1901
|
+
let n = "li";
|
|
1902
1902
|
switch (l) {
|
|
1903
1903
|
case "ul":
|
|
1904
|
-
|
|
1904
|
+
n = "li";
|
|
1905
1905
|
break;
|
|
1906
1906
|
case "ol":
|
|
1907
|
-
|
|
1907
|
+
n = "li";
|
|
1908
1908
|
break;
|
|
1909
1909
|
default:
|
|
1910
|
-
|
|
1910
|
+
n = "div";
|
|
1911
1911
|
}
|
|
1912
|
-
return !e &&
|
|
1913
|
-
|
|
1912
|
+
return !e && r ? g.createElement(
|
|
1913
|
+
n,
|
|
1914
1914
|
{ ...t, ...o },
|
|
1915
1915
|
/* @__PURE__ */ s("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" })
|
|
1916
|
-
) : g.createElement(
|
|
1916
|
+
) : g.createElement(n, { ...t, ...o }, e);
|
|
1917
1917
|
}, Mt = {
|
|
1918
1918
|
type: "RepeaterItem",
|
|
1919
1919
|
label: "Repeater Item",
|
|
@@ -1947,7 +1947,7 @@ const $ = (e, ...t) => ({
|
|
|
1947
1947
|
canMove: () => !1,
|
|
1948
1948
|
canDuplicate: () => !1
|
|
1949
1949
|
}, Vt = () => {
|
|
1950
|
-
p(me, ye), p(Be, Ie), p(ge, be), p(Ge, Ye), p(dt, ut), p(wt, Ct), p(kt, xt), p(
|
|
1950
|
+
p(me, ye), p(Be, Ie), p(ge, be), p(Ge, Ye), p(dt, ut), p(wt, Ct), p(kt, xt), p(nt, it), p(st, at), p(ct, pt), p(tt, ot), p(lt, rt), p(_t, Tt), p(ke, xe), p(we, Ce), p(vt, Lt), p(_e, Te), p(Ne, Re), p(Me, Ee), p(Pe, Se), p(ze, De), p(je, Ue), p(qe, Fe), p($e, He), p(We, Xe), p(ve, Le), p(Ve, Oe), p(mt, yt), p(ft, ht), p(gt, bt), p(fe, he), p(Nt, Rt), p(At, Mt), p(Et, $t);
|
|
1951
1951
|
};
|
|
1952
1952
|
export {
|
|
1953
1953
|
Vt as loadWebBlocks
|