@chaibuilder/sdk 2.0.0-beta.60 → 2.0.0-beta.62
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/core.cjs +3 -3
- package/dist/core.js +302 -314
- package/dist/getSplitClasses-DodqA_KW.cjs +1 -0
- package/dist/getSplitClasses-DphwgQiE.js +48 -0
- package/dist/render.cjs +2 -2
- package/dist/render.js +66 -66
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +4 -2
- package/package.json +1 -1
- package/dist/STRINGS-DtEft2kY.js +0 -5
- package/dist/STRINGS-n7COZtKr.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a="#styles:",r="__ADD_BLOCK_INTERNAL_ROOT",n=s=>{if(s=s.replace(a,""),!s)return{baseClasses:"",classes:""};const e=s.split(/,(?![^\[]*\])/);if(e.length===1)return{baseClasses:"",classes:e[0].trim()};const[t,...l]=e;return{baseClasses:t.trim(),classes:l.join(",").trim().replace(/ +(?= )/g,"")}};exports.ROOT_TEMP_KEY=r;exports.STYLES_KEY=a;exports.getSplitChaiClasses=n;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const t = "#styles:", n = "__ADD_BLOCK_INTERNAL_ROOT", r = (s) => {
|
|
2
|
+
if (s = s.replace(t, ""), !s) return { baseClasses: "", classes: "" };
|
|
3
|
+
const e = s.split(/,(?![^\[]*\])/);
|
|
4
|
+
if (e.length === 1)
|
|
5
|
+
return { baseClasses: "", classes: e[0].trim() };
|
|
6
|
+
const [a, ...l] = e;
|
|
7
|
+
return {
|
|
8
|
+
baseClasses: a.trim(),
|
|
9
|
+
classes: l.join(",").trim().replace(/ +(?= )/g, "")
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
import.meta.vitest && describe("getSplitChaiClasses", () => {
|
|
13
|
+
it("should return the base classes and the classes", () => {
|
|
14
|
+
const s = {
|
|
15
|
+
",styles-2": { baseClasses: "", classes: "styles-2" },
|
|
16
|
+
"styles-1,styles-2": { baseClasses: "styles-1", classes: "styles-2" },
|
|
17
|
+
",bg-[linear-gradient(-10deg,black,transparent_100%)]": {
|
|
18
|
+
baseClasses: "",
|
|
19
|
+
classes: "bg-[linear-gradient(-10deg,black,transparent_100%)]"
|
|
20
|
+
},
|
|
21
|
+
"styles-1,bg-[linear-gradient(-10deg,black,transparent_100%)]": {
|
|
22
|
+
baseClasses: "styles-1",
|
|
23
|
+
classes: "bg-[linear-gradient(-10deg,black,transparent_100%)]"
|
|
24
|
+
},
|
|
25
|
+
someclass: {
|
|
26
|
+
baseClasses: "",
|
|
27
|
+
classes: "someclass"
|
|
28
|
+
},
|
|
29
|
+
",bg-red-500 text-center font-bold": {
|
|
30
|
+
baseClasses: "",
|
|
31
|
+
classes: "bg-red-500 text-center font-bold"
|
|
32
|
+
},
|
|
33
|
+
"bg-[linear-gradient(-10deg,black,transparent_100%)], bg-[linear-gradient(-10deg,black,transparent_100%)]": {
|
|
34
|
+
baseClasses: "bg-[linear-gradient(-10deg,black,transparent_100%)]",
|
|
35
|
+
classes: "bg-[linear-gradient(-10deg,black,transparent_100%)]"
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
for (let e in s) {
|
|
39
|
+
const a = r(`${t}${e}`);
|
|
40
|
+
expect(a).toEqual(s[e]);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
n as R,
|
|
46
|
+
t as S,
|
|
47
|
+
r as g
|
|
48
|
+
};
|
package/dist/render.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./ChaiThemeFn-DQu-2Eh9.cjs"),r=require("lodash-es"),h=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./ChaiThemeFn-DQu-2Eh9.cjs"),r=require("lodash-es"),h=require("./getSplitClasses-DodqA_KW.cjs"),P=require("@mhsdesign/jit-browser-tailwindcss"),q=require("@tailwindcss/aspect-ratio"),F=require("@tailwindcss/container-queries"),v=require("@tailwindcss/forms"),O=require("@tailwindcss/typography"),C=require("./plugin-2xcljWGM.cjs"),a=require("./jsx-runtime-qcKc-DpB.cjs"),$=require("@chaibuilder/runtime"),p=require("react"),N=require("tailwind-merge"),Y=(e,s="")=>{const{classes:n}=h.getSplitChaiClasses(e),t=n.split(" ").map(i=>i.split(" ").map(l=>{if(l==="")return"";if(l.includes(":")){const u=l.split(":");return u[u.length-1]=s+r.last(u),u.join(":")}return`${s}${l}`}).join(" "));return r.flattenDeep(t).join(" ")},k=e=>{if(!e)return[];try{return JSON.parse(A(e)).filter(n=>!n._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function A(e){const s=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(s,n=>{const t=decodeURIComponent(n),i=t.indexOf("public");return i!==-1?t.substring(i+6):t})}async function I(e,s,n=[],t="",i){return await P.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:n,theme:{extend:C.getChaiBuilderTheme(e)},plugins:[v,O,q,F,C.chaiBuilderPlugin],corePlugins:{preflight:i},...t?{prefix:`${t}`}:{}}}).generateStylesFromContent(` ${i?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
|
-
@tailwind utilities;`,s)}const
|
|
3
|
+
@tailwind utilities;`,s)}const M=(e,s,n)=>{const t=JSON.stringify(e).replace(/#styles:([^"]*)/g,(i,o)=>`#styles:${o.replace(/,/g," ")}`.replace(/#styles:/g,""));return I(s,[t],[],"",n)},J=async(e,s=f.defaultThemeOptions,n=!1)=>await M(e,s,n);async function K(e){const s=await(e==null?void 0:e.dataProvider(e.block,e.lang,e.metadata));return a.jsxRuntimeExports.jsx(p.Suspense,{children:p.createElement(e.component,{...e.props,...s})})}const L=r.memoize((e,s)=>{const{baseClasses:n,classes:t}=h.getSplitChaiClasses(e),i=N.twMerge(n,t);return s===""?i.replace(h.STYLES_KEY,"").trim():Y(i,s).replace(h.STYLES_KEY,"").trim()});function b(e,s){const n=r.get(e,`${s}_attrs`,{}),t=r.keys(n).join(" ");return r.includes(t,"x-show")&&!r.includes(t,"x-transition")&&(n["x-transition"]=""),n}function U(e,s){const n={};return Object.keys(e).forEach(t=>{if(r.isString(e[t])&&e[t].startsWith(h.STYLES_KEY)){const i=L(e[t],s);n[t]={className:i,...b(e,t)}}}),n}function V(e,s){const n=r.get(e,"_bindings",{});return r.isEmpty(n)?{...e}:(r.each(n,(t,i)=>{r.isString(t)&&r.get(s,t,null)&&(e[i]=r.get(s,t,null))}),e)}function W(e,s,n){if(r.isEmpty(s))return e;const t=r.cloneDeep(e),i=r.get(n,"i18nProps",[]);return r.forEach(r.keys(t),o=>{i.includes(o)&&!r.isEmpty(s)&&(t[o]=r.get(t,`${o}-${s}`,t[o]))}),t}const z=()=>a.jsxRuntimeExports.jsx("span",{children:"Loading..."});function E({blocks:e,parent:s,classPrefix:n="",externalData:t={},blockModifierCallback:i=null,lang:o="",fallbackLang:g="",metadata:l={}}){const u=e,j=c=>U(c,n),T=s?r.filter(e,{_parent:s}):r.filter(e,c=>r.isEmpty(c._parent));return a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:p.Children.toArray(T.map((c,w)=>{const S={},B=r.filter(u,{_parent:c._id});S.children=B.length>0?a.jsxRuntimeExports.jsx(E,{externalData:t,classPrefix:n,parent:c._id,blocks:u,lang:o||g,metadata:l}):null;const d=$.getRegisteredChaiBlock(c._type);if(d!==null){let m=c;const x=d.component;m={...d.defaults,...c},i&&(m=i(m));const R=o===g?"":o,y=r.omit({blockProps:{},inBuilder:!1,...m,index:w,...V(W(c,R,d),t),...j(m),...S,metadata:l,lang:o||g},["_parent"]);if(r.has(d,"dataProvider")){const _=r.get(d,"suspenseFallback",z);return a.jsxRuntimeExports.jsx(p.Suspense,{fallback:p.createElement(_),children:a.jsxRuntimeExports.jsx(K,{lang:o||g,metadata:l,dataProvider:d.dataProvider,block:c,component:x,props:y})})}return a.jsxRuntimeExports.jsx(p.Suspense,{children:p.createElement(x,y)})}return a.jsxRuntimeExports.jsxs("noscript",{children:[c._type," not found"]})}))})}exports.getChaiThemeCssVariables=f.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=f.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=f.getThemeFontsLinkMarkup;exports.RenderChaiBlocks=E;exports.convertToBlocks=k;exports.getStylesForBlocks=J;
|
package/dist/render.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { a as
|
|
3
|
-
import { last as
|
|
4
|
-
import { S as
|
|
5
|
-
import { createTailwindcss as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { d as v } from "./ChaiThemeFn-Cort9tch.js";
|
|
2
|
+
import { a as Bt, b as Et, c as $t } from "./ChaiThemeFn-Cort9tch.js";
|
|
3
|
+
import { last as N, flattenDeep as R, memoize as A, filter as g, isEmpty as f, omit as I, has as J, get as p, each as U, isString as j, cloneDeep as K, forEach as M, keys as P, includes as _ } from "lodash-es";
|
|
4
|
+
import { g as T, S as h } from "./getSplitClasses-DphwgQiE.js";
|
|
5
|
+
import { createTailwindcss as W } from "@mhsdesign/jit-browser-tailwindcss";
|
|
6
|
+
import Y from "@tailwindcss/aspect-ratio";
|
|
7
|
+
import b from "@tailwindcss/container-queries";
|
|
8
8
|
import z from "@tailwindcss/forms";
|
|
9
9
|
import D from "@tailwindcss/typography";
|
|
10
10
|
import { g as L, c as Q } from "./plugin-kUMxtQR5.js";
|
|
11
11
|
import { j as a } from "./jsx-runtime-Drh4NO5G.js";
|
|
12
12
|
import { getRegisteredChaiBlock as V } from "@chaibuilder/runtime";
|
|
13
|
-
import
|
|
14
|
-
import { twMerge as
|
|
15
|
-
const
|
|
16
|
-
const
|
|
13
|
+
import S, { Suspense as y, createElement as q } from "react";
|
|
14
|
+
import { twMerge as G } from "tailwind-merge";
|
|
15
|
+
const H = (t, s = "") => {
|
|
16
|
+
const { classes: n } = T(t), e = n.split(" ").map((r) => r.split(" ").map((c) => {
|
|
17
17
|
if (c === "") return "";
|
|
18
18
|
if (c.includes(":")) {
|
|
19
19
|
const l = c.split(":");
|
|
20
|
-
return l[l.length - 1] = s +
|
|
20
|
+
return l[l.length - 1] = s + N(l), l.join(":");
|
|
21
21
|
}
|
|
22
22
|
return `${s}${c}`;
|
|
23
23
|
}).join(" "));
|
|
24
|
-
return
|
|
24
|
+
return R(e).join(" ");
|
|
25
25
|
}, _t = (t) => {
|
|
26
26
|
if (!t) return [];
|
|
27
27
|
try {
|
|
28
|
-
return JSON.parse(
|
|
28
|
+
return JSON.parse(X(t)).filter((n) => !n._type.startsWith("@chai"));
|
|
29
29
|
} catch {
|
|
30
30
|
return [{ _type: "Paragraph", _id: "error", content: "Invalid JSON. Please check the JSON string." }];
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
function
|
|
33
|
+
function X(t) {
|
|
34
34
|
const s = /(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;
|
|
35
35
|
return t.replace(s, (n) => {
|
|
36
36
|
const e = decodeURIComponent(n), r = e.indexOf("public");
|
|
37
37
|
return r !== -1 ? e.substring(r + 6) : e;
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
async function
|
|
41
|
-
return await
|
|
40
|
+
async function Z(t, s, n = [], e = "", r) {
|
|
41
|
+
return await W({
|
|
42
42
|
tailwindConfig: {
|
|
43
43
|
darkMode: "class",
|
|
44
44
|
safelist: n,
|
|
45
45
|
theme: { extend: L(t) },
|
|
46
|
-
plugins: [z, D,
|
|
46
|
+
plugins: [z, D, Y, b, Q],
|
|
47
47
|
corePlugins: { preflight: r },
|
|
48
48
|
...e ? { prefix: `${e}` } : {}
|
|
49
49
|
}
|
|
@@ -54,49 +54,49 @@ async function X(t, s, n = [], e = "", r) {
|
|
|
54
54
|
s
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const k = (t, s, n) => {
|
|
58
58
|
const e = JSON.stringify(t).replace(/#styles:([^"]*)/g, (r, i) => `#styles:${i.replace(/,/g, " ")}`.replace(/#styles:/g, ""));
|
|
59
|
-
return
|
|
60
|
-
}, jt = async (t, s =
|
|
61
|
-
async function
|
|
59
|
+
return Z(s, [e], [], "", n);
|
|
60
|
+
}, jt = async (t, s = v, n = !1) => await k(t, s, n);
|
|
61
|
+
async function tt(t) {
|
|
62
62
|
const s = await (t == null ? void 0 : t.dataProvider(t.block, t.lang, t.metadata));
|
|
63
|
-
return /* @__PURE__ */ a.jsx(
|
|
63
|
+
return /* @__PURE__ */ a.jsx(y, { children: S.createElement(t.component, { ...t.props, ...s }) });
|
|
64
64
|
}
|
|
65
|
-
const
|
|
66
|
-
const n = t
|
|
67
|
-
return s === "" ?
|
|
65
|
+
const et = A((t, s) => {
|
|
66
|
+
const { baseClasses: n, classes: e } = T(t), r = G(n, e);
|
|
67
|
+
return s === "" ? r.replace(h, "").trim() : H(r, s).replace(h, "").trim();
|
|
68
68
|
});
|
|
69
|
-
function
|
|
69
|
+
function st(t, s) {
|
|
70
70
|
const n = p(t, `${s}_attrs`, {}), e = P(n).join(" ");
|
|
71
|
-
return
|
|
71
|
+
return _(e, "x-show") && !_(e, "x-transition") && (n["x-transition"] = ""), n;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function nt(t, s) {
|
|
74
74
|
const n = {};
|
|
75
75
|
return Object.keys(t).forEach((e) => {
|
|
76
|
-
if (
|
|
77
|
-
const r =
|
|
76
|
+
if (j(t[e]) && t[e].startsWith(h)) {
|
|
77
|
+
const r = et(t[e], s);
|
|
78
78
|
n[e] = {
|
|
79
79
|
className: r,
|
|
80
|
-
...
|
|
80
|
+
...st(t, e)
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
}), n;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function rt(t, s) {
|
|
86
86
|
const n = p(t, "_bindings", {});
|
|
87
|
-
return
|
|
88
|
-
|
|
87
|
+
return f(n) ? { ...t } : (U(n, (e, r) => {
|
|
88
|
+
j(e) && p(s, e, null) && (t[r] = p(s, e, null));
|
|
89
89
|
}), t);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
if (
|
|
93
|
-
const e =
|
|
94
|
-
return
|
|
95
|
-
r.includes(i) && !
|
|
91
|
+
function it(t, s, n) {
|
|
92
|
+
if (f(s)) return t;
|
|
93
|
+
const e = K(t), r = p(n, "i18nProps", []);
|
|
94
|
+
return M(P(e), (i) => {
|
|
95
|
+
r.includes(i) && !f(s) && (e[i] = p(e, `${i}-${s}`, e[i]));
|
|
96
96
|
}), e;
|
|
97
97
|
}
|
|
98
|
-
const
|
|
99
|
-
function
|
|
98
|
+
const ot = () => /* @__PURE__ */ a.jsx("span", { children: "Loading..." });
|
|
99
|
+
function at({
|
|
100
100
|
blocks: t,
|
|
101
101
|
parent: s,
|
|
102
102
|
classPrefix: n = "",
|
|
@@ -106,12 +106,12 @@ function ot({
|
|
|
106
106
|
fallbackLang: d = "",
|
|
107
107
|
metadata: c = {}
|
|
108
108
|
}) {
|
|
109
|
-
const l = t,
|
|
110
|
-
return /* @__PURE__ */ a.jsx(a.Fragment, { children:
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
const l = t, B = (o) => nt(o, n), E = s ? g(t, { _parent: s }) : g(t, (o) => f(o._parent));
|
|
110
|
+
return /* @__PURE__ */ a.jsx(a.Fragment, { children: S.Children.toArray(
|
|
111
|
+
E.map((o, $) => {
|
|
112
|
+
const C = {}, F = g(l, { _parent: o._id });
|
|
113
|
+
C.children = F.length > 0 ? /* @__PURE__ */ a.jsx(
|
|
114
|
+
at,
|
|
115
115
|
{
|
|
116
116
|
externalData: e,
|
|
117
117
|
classPrefix: n,
|
|
@@ -124,41 +124,41 @@ function ot({
|
|
|
124
124
|
const u = V(o._type);
|
|
125
125
|
if (u !== null) {
|
|
126
126
|
let m = o;
|
|
127
|
-
const
|
|
127
|
+
const x = u.component;
|
|
128
128
|
m = { ...u.defaults, ...o }, r && (m = r(m));
|
|
129
|
-
const
|
|
129
|
+
const w = I(
|
|
130
130
|
{
|
|
131
131
|
blockProps: {},
|
|
132
132
|
inBuilder: !1,
|
|
133
133
|
...m,
|
|
134
|
-
index:
|
|
135
|
-
...
|
|
136
|
-
...
|
|
137
|
-
...
|
|
134
|
+
index: $,
|
|
135
|
+
...rt(it(o, i === d ? "" : i, u), e),
|
|
136
|
+
...B(m),
|
|
137
|
+
...C,
|
|
138
138
|
metadata: c,
|
|
139
139
|
lang: i || d
|
|
140
140
|
},
|
|
141
141
|
["_parent"]
|
|
142
142
|
);
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
143
|
+
if (J(u, "dataProvider")) {
|
|
144
|
+
const O = p(
|
|
145
145
|
u,
|
|
146
146
|
"suspenseFallback",
|
|
147
|
-
|
|
147
|
+
ot
|
|
148
148
|
);
|
|
149
|
-
return /* @__PURE__ */ a.jsx(
|
|
150
|
-
|
|
149
|
+
return /* @__PURE__ */ a.jsx(y, { fallback: q(O), children: /* @__PURE__ */ a.jsx(
|
|
150
|
+
tt,
|
|
151
151
|
{
|
|
152
152
|
lang: i || d,
|
|
153
153
|
metadata: c,
|
|
154
154
|
dataProvider: u.dataProvider,
|
|
155
155
|
block: o,
|
|
156
|
-
component:
|
|
157
|
-
props:
|
|
156
|
+
component: x,
|
|
157
|
+
props: w
|
|
158
158
|
}
|
|
159
159
|
) });
|
|
160
160
|
}
|
|
161
|
-
return /* @__PURE__ */ a.jsx(
|
|
161
|
+
return /* @__PURE__ */ a.jsx(y, { children: S.createElement(x, w) });
|
|
162
162
|
}
|
|
163
163
|
return /* @__PURE__ */ a.jsxs("noscript", { children: [
|
|
164
164
|
o._type,
|
|
@@ -168,10 +168,10 @@ function ot({
|
|
|
168
168
|
) });
|
|
169
169
|
}
|
|
170
170
|
export {
|
|
171
|
-
|
|
171
|
+
at as RenderChaiBlocks,
|
|
172
172
|
_t as convertToBlocks,
|
|
173
|
-
|
|
173
|
+
Bt as getChaiThemeCssVariables,
|
|
174
174
|
jt as getStylesForBlocks,
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
Et as getThemeFontsCSSImport,
|
|
176
|
+
$t as getThemeFontsLinkMarkup
|
|
177
177
|
};
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@chaibuilder/runtime"),i=require("./jsx-runtime-qcKc-DpB.cjs"),w=require("react"),k=require("./iconBase-Cn2BsTrq.cjs"),y=require("@radix-ui/react-icons"),m=require("lodash-es"),S=require("lucide-react");function M(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(l,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return l.default=e,Object.freeze(l)}const b=M(w),j=({className:e="",inBuilder:l})=>l?i.jsxRuntimeExports.jsx("div",{className:k.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:i.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:i.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,D=e=>{const{blockProps:l,inBuilder:r,backgroundImage:o,children:s,tag:n="div",styles:a}=e;let d=s;s||(d=i.jsxRuntimeExports.jsx(j,{inBuilder:r}));let c={};return o&&(c={backgroundImage:`url(${o})`}),b.createElement(n,{...l,...a,style:c},d)},$={type:"Box",label:"Box",category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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},T=e=>{const{blockProps:l,iconSize:r,icon:o,content:s,styles:n,children:a,iconPos:d,link:c,inBuilder:p}=e,g=o,h=a||i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:s}),g&&i.jsxRuntimeExports.jsx("div",{style:{width:r+"px"},className:d+" "+(d==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:g}})]}),u=w.createElement("button",{...l,...n,type:"button","aria-label":s},h);return m.isEmpty(m.get(c,"href"))?u:p?i.jsxRuntimeExports.jsx("span",{children:u}):i.jsxRuntimeExports.jsx("a",{"aria-label":s,href:m.get(c,"href")||"/",target:m.get(c,"target","_self"),children:u})},A={type:"Button",label:"Button",category:"core",icon:y.ButtonIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@chaibuilder/runtime"),i=require("./jsx-runtime-qcKc-DpB.cjs"),w=require("react"),k=require("./iconBase-Cn2BsTrq.cjs"),y=require("@radix-ui/react-icons"),m=require("lodash-es"),S=require("lucide-react");function M(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(l,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return l.default=e,Object.freeze(l)}const b=M(w),j=({className:e="",inBuilder:l})=>l?i.jsxRuntimeExports.jsx("div",{className:k.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:i.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:i.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,D=e=>{const{blockProps:l,inBuilder:r,backgroundImage:o,children:s,tag:n="div",styles:a}=e;let d=s;s||(d=i.jsxRuntimeExports.jsx(j,{inBuilder:r}));let c={};return o&&(c={backgroundImage:`url(${o})`}),b.createElement(n,{...l,...a,style:c},d)},$={type:"Box",label:"Box",category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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},T=e=>{const{blockProps:l,iconSize:r,icon:o,content:s,styles:n,children:a,iconPos:d,link:c,inBuilder:p}=e,g=o,h=a||i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:s}),g&&i.jsxRuntimeExports.jsx("div",{style:{width:r+"px"},className:d+" "+(d==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:g}})]}),u=w.createElement("button",{...l,...n,type:"button","aria-label":s},h);return m.isEmpty(m.get(c,"href"))?u:p?i.jsxRuntimeExports.jsx("span",{children:u}):i.jsxRuntimeExports.jsx("a",{"aria-label":s,href:m.get(c,"href")||"/",target:m.get(c,"target","_self"),children:u})},A={type:"Button",label:"Button",category:"core",icon:y.ButtonIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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"}}}}),i18nProps:["content"],aiProps:["content"]},z=e=>{const{blockProps:l,styles:r,htmlCode:o,inBuilder:s}=e;return s?i.jsxRuntimeExports.jsxs("div",{className:"relative",children:[s?i.jsxRuntimeExports.jsx("div",{...l,...r,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...r,dangerouslySetInnerHTML:{__html:o.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...l,...r,dangerouslySetInnerHTML:{__html:o}})},H={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:y.CodeIcon,group:"advanced",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}})},q=e=>{const{blockProps:l,styles:r,backgroundImage:o}=e;let s={};return o&&(s={backgroundImage:`url(${o})`}),b.createElement("div",{...l,...r,style:s})},U={type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image"}}}})},O=e=>{const{blockProps:l,styles:r,content:o,tag:s="h1",children:n=null}=e;return n?b.createElement(s,{...r,...l},n):b.createElement(s,{...r,...l,dangerouslySetInnerHTML:{__html:o}})},F={type:"Heading",label:"web_blocks.heading",category:"core",icon:y.HeadingIcon,group:"typography",...t.registerChaiBlockSchema({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:t.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"},G=e=>{const{blockProps:l,styles:r,content:o}=e;return m.isNull(e.children)?b.createElement("p",{...r,...l,dangerouslySetInnerHTML:{__html:o}}):b.createElement("p",{...r,...l},e.children)},V={type:"Paragraph",label:"Paragraph",category:"core",icon:y.TextIcon,group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.
|
|
2
2
|
Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus
|
|
3
|
-
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"},W=e=>{const{blockProps:l,content:r,styles:o}=e;return i.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i.jsxRuntimeExports.jsx("div",{...l,...o,dangerouslySetInnerHTML:{__html:r}})})},X={type:"RichText",label:"Rich Text",category:"core",icon:y.CursorTextIcon,group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.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"]},Y=e=>{const{blockProps:l,styles:r,content:o,children:s=null,tag:n}=e;return s?b.createElement("span",{...r,...l},s):b.createElement(n||"span",{...r,...l,dangerouslySetInnerHTML:{__html:o||""}})},Z={type:"Span",label:"Span",category:"core",group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0};function J(e){return k.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(e)}const K=e=>{const{scripts:l,inBuilder:r,blockProps:o}=e;return r?i.jsxRuntimeExports.jsx("div",{...o,children:i.jsxRuntimeExports.jsx("div",{className:k.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:i.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:i.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):i.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:l}})},Q={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:J,group:"advanced",...t.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},ee=e=>i.jsxRuntimeExports.jsxs("div",{...e.blockProps,...e.styles,children:[e.mode,e.children]}),te=e=>e.mode==="dark"?null:i.jsxRuntimeExports.jsx("button",{"aria-label":"dark mode button",...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(te,{type:"DarkModeButton",label:"Dark Mode Button",category:"core",icon:y.MoonIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp("")}})});const le=e=>e.mode==="light"?null:i.jsxRuntimeExports.jsx("button",{"aria-label":"light mode button",...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(le,{type:"LightModeButton",label:"Light Mode Button",category:"core",icon:y.SunIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp(""),fake:{type:"string",default:""}}})});const re={type:"DarkModeSwitcher",label:"web_blocks.dark_mode",category:"core",icon:y.MoonIcon,group:"advanced",wrapper:!0,...t.registerChaiBlockSchema({properties:{mode:{title:"Mode",type:"string",enum:["dark","light"],default:"light"},styles:t.stylesProp("")}}),blocks:()=>[{_id:"ultqCh",_type:"DarkModeSwitcher",mode:"light",styles:"#styles:,",_name:"Dark Mode Theme"},{_id:"vroabi",_parent:"ultqCh",_type:"LightModeButton",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"nltBrv",_parent:"vroabi",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"DarkModeButton",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white hidden dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"AdDwBC",_parent:"gesydi",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},se=e=>{const{blockProps:l,styles:r}=e;return w.createElement("hr",{...r,...l})},oe={type:"Divider",label:"web_blocks.divider",category:"core",icon:y.DividerHorizontalIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},ie=e=>{const{blockProps:l,inBuilder:r,children:o,globalBlock:s}=e;return r&&!s?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-4 bg-gray-100 rounded-lg gap-y-1 dark:bg-gray-800",...l,children:[i.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",s]}),i.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...l},o)},ne={type:"GlobalBlock",label:"Global Block",icon:S.GlobeIcon,category:"core",group:"advanced",...t.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},N=(e,...l)=>({...e,className:k.cn(e.className,...l)}),ae=e=>{const{blockProps:l,icon:r,styles:o,width:s,inBuilder:n,height:a}=e,d=N(o,"");if(m.isEmpty(r))return i.jsxRuntimeExports.jsx(j,{inBuilder:n,className:"h-8 w-14"});const c=r.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...l,...d,style:{width:s?`${s}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:c}})},ce={type:"Icon",label:"web_blocks.icon",category:"core",icon:y.SketchLogoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.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"}}})},de=e=>{const{blockProps:l,image:r,mobileImage:o,styles:s,alt:n,height:a,width:d,lazyLoading:c}=e;return m.isEmpty(r)?i.jsxRuntimeExports.jsx(j,{className:"h-36"}):i.jsxRuntimeExports.jsxs("picture",{children:[o&&i.jsxRuntimeExports.jsx("source",{srcSet:o,media:"(max-width: 480px)"}),i.jsxRuntimeExports.jsx("img",{...l,...s,src:r,alt:n,loading:c?"lazy":"eager",width:d,height:a})]})},ue={type:"Image",label:"Image",category:"core",icon:y.ImageIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.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"}}}}),aiProps:["alt"],i18nProps:["alt"]},pe=e=>{const{blockProps:l,children:r,styles:o,inBuilder:s,content:n,href:a}=e,{hrefType:d,autoplay:c,maxWidth:p,backdropColor:g,galleryName:h}=e,u=N(o,"cb-lightbox");if(!r&&m.isEmpty(o==null?void 0:o.className)&&m.isEmpty(n))return i.jsxRuntimeExports.jsx(j,{inBuilder:s});if(s)return r?i.jsxRuntimeExports.jsx("span",{...l,...u,children:r}):b.createElement("span",{...l,...u,dangerouslySetInnerHTML:{__html:n}});const x={};return d!=="image"&&(x["data-vbtype"]=d),c&&(x["data-autoplay"]="true"),p&&(x["data-maxwidth"]=p+"px"),g&&(x["data-overlay"]=g),h&&(x["data-gall"]=h),r?i.jsxRuntimeExports.jsx("a",{"aria-label":n,...x,href:a||"#/",...l,...u,children:r}):b.createElement("a",{...l,...u,...x,href:a||"#",dangerouslySetInnerHTML:{__html:n},"aria-label":n})},ge={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:y.ImageIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"Link text or drop blocks inside"},hrefType:{type:"string",title:"Type",default:"image",enum:["image","video","iframe","inline","ajax"],enumNames:["Image","Video","Iframe","Inline","Ajax"]},href:{type:"string",title:"Href",default:""},autoplay:{type:"boolean",title:"Autoplay (Video only)",default:!1},maxWidth:{type:"number",title:"Max Width",default:""},backdropColor:{type:"string",title:"Backdrop Color",default:""},galleryName:{type:"string",title:"Gallery Name",default:""}},dependencies:{autoplay:["hrefType","video"]}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},me=e=>{const{blockProps:l,link:r,children:o,styles:s,inBuilder:n,content:a}=e;let d={};return!o&&m.isEmpty(a)&&(d={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?o?i.jsxRuntimeExports.jsx("span",{...l,style:d,...s,children:o}):w.createElement("span",{...l,...s,style:d},a):o?i.jsxRuntimeExports.jsx("a",{"aria-label":a,href:(r==null?void 0:r.href)||"#/",target:r==null?void 0:r.target,...l,...s,children:o}):w.createElement("a",{...l,...s,href:(r==null?void 0:r.href)||"#",target:(r==null?void 0:r.target)||"_self","aria-label":a},a)},he={type:"Link",label:"Link",category:"core",icon:y.Link1Icon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e!=="Link"},ye=e=>{const{blockProps:l,children:r,listType:o,styles:s,tag:n,inBuilder:a}=e,d=k.cn(m.get(s,"className",""),o);return!r&&m.isEmpty(s==null?void 0:s.className)?i.jsxRuntimeExports.jsx(j,{inBuilder:a}):b.createElement(n||(o==="list-decimal"?"ol":"ul"),{...l,...s,className:d},r)},xe={type:"List",label:"web_blocks.list",icon:y.RowsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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"}]},fe=e=>{const{blockProps:l,content:r,styles:o,children:s,tag:n}=e;return s?b.createElement(n||"li",{...o,...l},s):b.createElement(n||"li",{...o,...l,dangerouslySetInnerHTML:{__html:r}})},be={type:"ListItem",label:"List Item",icon:y.ColumnsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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"},ke=e=>e.inBuilder||e.forceWrapper?i.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Se={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:y.SpaceBetweenVerticallyIcon,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-black"),content:{type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},I=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,R=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,L=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,Be=e=>{if(I.test(e)){const l=e.match(I);return l?`https://www.youtube.com/embed/${l[4]}`:e}if(R.test(e)){const l=e.match(R);return l?`https://player.vimeo.com/video/${l[3]}`:e}if(L.test(e)){const l=e.match(L);return l?`https://www.dailymotion.com/embed/video/${l[4]}`:e}return null},we=b.memo(e=>{const{blockProps:l,inBuilder:r,styles:o,url:s,controls:n}=e,a=m.get(n,"autoPlay",!1),d=m.get(n,"controls",!1),c=a||m.get(n,"muted",!0),p=m.get(n,"loop",!1);if(m.isEmpty(s))return i.jsxRuntimeExports.jsx(j,{inBuilder:r,className:"h-36"});let g=Be(s),h=null;if(g){if(!m.isEmpty(g)){const u=[];u.push(`autoplay=${a?1:0}`),u.push(`controls=${n?1:0}`),u.push(`mute=${c?1:0}&muted=${c?1:0}`),u.push(`loop=${p?1:0}`),g=`${g}?${u.join("&")}`}h=b.createElement("iframe",{...l,className:"absolute inset-0 w-full h-full",src:g,allow:r?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else h=b.createElement("video",{...l,className:"absolute inset-0 w-full h-full",src:s,controls:d,muted:c,autoPlay:r?!1:a,loop:p});return i.jsxRuntimeExports.jsx("div",{...m.pick(o,["className"]),children:i.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[r?i.jsxRuntimeExports.jsx("div",{...l,...m.omit(o,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,h]})})}),je={type:"Video",label:"Video",category:"core",icon:y.VideoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),url:{type:"string",title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"},controls:{type:"object",title:"Controls",default:{autoplay:!1,controls:!0,loop:!1,muted:!1},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}}}}}),i18nProps:["url"]},_={wrapper:{"x-data":"{ open: false }"},button:{"x-on:click":"open = !open"},menu:{"x-show":"open","x-on:click.away":"open = false","x-cloak":"","x-transition":""}},Ce=e=>{const{blockProps:l,content:r,icon:o,iconWidth:s,iconHeight:n,styles:a,show:d}=e;return i.jsxRuntimeExports.jsxs("button",{"aria-label":r,...l,...a,..._.button,children:[r,i.jsxRuntimeExports.jsx("span",{className:d?"rotate-180":"",dangerouslySetInnerHTML:{__html:o},style:{width:s,height:n}})]})};t.registerChaiBlock(Ce,{type:"DropdownButton",label:"Dropdown Button",group:"advanced",category:"core",hidden:!0,canMove:()=>!1,canDelete:()=>!1,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),content:{type:"string",title:"Title",default:"Menu Item"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconWidth:{type:"string",title:"Icon Width",default:"16px"},iconHeight:{type:"string",title:"Icon Height",default:"16px"},styles:t.StylesProp("flex items-center gap-2 px-4 py-1")}})});const ve=e=>{const{blockProps:l,children:r,styles:o,show:s,inBuilder:n}=e;return n&&!s?null:i.jsxRuntimeExports.jsx("div",{...l,..._.menu,...o,children:r})};t.registerChaiBlock(ve,{type:"DropdownContent",label:"Dropdown Content",group:"basic",hidden:!0,canMove:()=>!1,canDelete:()=>!1,canAcceptBlock:()=>!0,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),styles:t.StylesProp("absolute left-0 p-2 w-80 mt-2 bg-white rounded-lg shadow-lg z-50")}})});const Pe=e=>{const{blockProps:l,children:r,styles:o}=e;return i.jsxRuntimeExports.jsx("div",{...l,...o,..._.wrapper,children:r})},_e={type:"Dropdown",label:"Dropdown",group:"basic",icon:y.DropdownMenuIcon,blocks:()=>[{_type:"Dropdown",_id:"dropdown"},{_type:"DropdownButton",_id:"button",_parent:"dropdown",title:"Menu Item",icon:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24"> <path d="M16.293 9.293 12 13.586 7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z"/> </svg>',styles:"#styles:,flex items-center gap-2 px-4 py-1"},{_type:"DropdownContent",_id:"content",_parent:"dropdown",styles:"#styles:,absolute left-0 w-80 mt-0.5 bg-white rounded-lg shadow-lg z-50"},{_type:"Link",_id:"link",_parent:"content",content:"Link",styles:"#styles:,flex items-center gap-2 px-4 py-1",link:{href:"https://www.google.com",type:"url",target:"_self"}}],category:"core",wrapper:!0,...t.registerChaiBlockSchema({properties:{showDropdown:t.runtimeProp({type:"boolean",title:"Show Dropdown",default:!1}),styles:t.StylesProp("relative w-max")}})},Ee=e=>{const{blockProps:l,fieldName:r,label:o,styles:s,inputStyles:n,required:a,checked:d,showLabel:c=!0}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...s,...l,children:[i.jsxRuntimeExports.jsx("input",{...n,name:r,id:p,type:"checkbox",required:a,defaultChecked:d}),o&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o})]}):i.jsxRuntimeExports.jsx("input",{id:p,...l,...n,...s,type:"checkbox",required:a,name:r})},Ie={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:y.CheckboxIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),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"]},Re=e=>{const{children:l,blockProps:r,errorMessage:o,successMessage:s,action:n,styles:a,inBuilder:d}=e;let c=l;l||(c=i.jsxRuntimeExports.jsx(j,{inBuilder:d}));const p={"x-data":"{}","x-on:submit.prevent":"post"},g={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxRuntimeExports.jsxs("form",{...p,"data-error":o,"data-success":s,method:"post",action:n,...r,...a,children:[i.jsxRuntimeExports.jsx("div",{...g}),c]})},Le={type:"Form",label:"Form",category:"core",icon:S.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,"}],...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form/submit"},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},Ne=e=>{const{blockProps:l,inBuilder:r,label:o,styles:s,inputStyles:n,icon:a,iconSize:d,iconPos:c}=e,p=k.generateUUID(),g={"x-bind:disabled":"formLoading"};return i.jsxRuntimeExports.jsxs("button",{id:p,...g,...n,...s,...l||{},type:r?"button":"submit","aria-label":o,children:[o,a&&i.jsxRuntimeExports.jsx("div",{style:{width:d+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Me={type:"FormButton",label:"Submit Button",category:"core",icon:y.ButtonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),inputStyles:t.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"]},De=e=>{const{blockProps:l,fieldName:r,label:o,placeholder:s,styles:n,inputStyles:a,showLabel:d,required:c,inputType:p}=e,g=k.generateUUID();return d?i.jsxRuntimeExports.jsxs("div",{...n,...l,children:[d&&i.jsxRuntimeExports.jsx("label",{htmlFor:g,children:o}),i.jsxRuntimeExports.jsx("input",{name:r,...a,id:g,type:p,placeholder:s,required:c})]}):i.jsxRuntimeExports.jsx("input",{id:g,name:r,...l,...a,...n,type:p,placeholder:s,required:c})},$e={type:"Input",label:"web_blocks.input",category:"core",icon:y.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),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},inputType:{type:"string",title:"Input Type",default:"text",enum:["text","email","password","number","tel","file","hidden","range","submit","color","date","time"]}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Te=e=>{const{blockProps:l,content:r,styles:o,children:s}=e,n={...o,...l};return s?b.createElement("label",n,s):b.createElement("label",{...n,dangerouslySetInnerHTML:{__html:r}})},Ae={type:"Label",label:"Label",category:"core",icon:y.LetterCaseToggleIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(),content:{type:"string",title:"Content",default:""}}})},ze=e=>{const{blockProps:l,fieldName:r,label:o,styles:s,inputStyles:n,required:a,checked:d,showLabel:c=!0}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...s,...l,children:[i.jsxRuntimeExports.jsx("input",{...n,name:r,id:p,type:"radio",required:a,defaultChecked:d}),o&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o})]}):i.jsxRuntimeExports.jsx("input",{id:p,...l,...n,...s,type:"radio",required:a,checked:d,name:r})},He={type:"Radio",label:"web_blocks.radio",category:"core",icon:y.RadiobuttonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),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"]},qe=e=>{const{blockProps:l,fieldName:r,label:o,placeholder:s,styles:n,inputStyles:a,required:d,showLabel:c,_multiple:p,options:g}=e,h=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...l,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:h,children:o}),i.jsxRuntimeExports.jsxs("select",{...a,id:h,required:d,multiple:p,name:r,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),m.map(g,u=>i.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})]}):i.jsxRuntimeExports.jsxs("select",{id:h,...n,...l,required:d,multiple:p,name:r,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),m.map(g,u=>i.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})},Ue={type:"Select",label:"web_blocks.select",category:"core",icon:y.DropdownMenuIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),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"]},Oe=e=>{const{blockProps:l,fieldName:r,label:o,placeholder:s,styles:n,inputStyles:a,_rows:d,showLabel:c}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...l,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o}),i.jsxRuntimeExports.jsx("textarea",{name:r,...a,id:p,placeholder:s,rows:d})]}):i.jsxRuntimeExports.jsx("textarea",{id:p,name:r,...l,...a,...n,placeholder:s,rows:d})},Fe={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:y.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.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}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Ge=e=>{const{blockProps:l,backgroundImage:r,children:o,styles:s,tag:n}=e;let a={};return r&&(a={backgroundImage:`url(${r})`}),w.createElement(n||"div",{...l,...s,style:a},o)},Ve={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("font-body antialiased"),backgroundImage:{type:"string",title:"Image",default:"",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,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},We=e=>{const{blockProps:l,styles:r}=e;return w.createElement("br",{...l,...r})},Xe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},P={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"}},Ye=e=>{const{blockProps:l,children:r,styles:o,colSpan:s,tabletColSpan:n,desktopColSpan:a}=e,c={className:[m.get(o,"className",""),m.get(P,["SMALL",isNaN(s)||!s?6:s],""),n?m.get(P,["MEDIUM",n||s],""):"",a?m.get(P,["LARGE",n||s],""):""].join(" ")};return i.jsxRuntimeExports.jsx("div",{...l,...o,...c,children:r||i.jsxRuntimeExports.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},Ze={type:"Column",label:"Column",group:"basic",category:"core",icon:S.Columns,wrapper:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...t.registerChaiBlockSchema({properties:{styles:t.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]}}})},Je=e=>{const{blockProps:l,children:r,styles:o,gutter:s}=e,a={className:[m.get(o,"className","")," grid grid-cols-12"].join()};return typeof(o==null?void 0:o.style)=="object"?o.style.gap=`${s}px`:a.style={gap:`${s}px`},i.jsxRuntimeExports.jsx("div",{...l,...o,...a,children:r})},Ke={type:"Row",label:"Row",group:"basic",icon:S.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",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},C=(e,l)=>({slider:{"x-data":`{
|
|
3
|
+
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"},W=e=>{const{blockProps:l,content:r,styles:o}=e;return i.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:i.jsxRuntimeExports.jsx("div",{...l,...o,dangerouslySetInnerHTML:{__html:r}})})},X={type:"RichText",label:"Rich Text",category:"core",icon:y.CursorTextIcon,group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.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"]},Y=e=>{const{blockProps:l,styles:r,content:o,children:s=null,tag:n}=e;return s?b.createElement("span",{...r,...l},s):b.createElement(n||"span",{...r,...l,dangerouslySetInnerHTML:{__html:o||""}})},Z={type:"Span",label:"Span",category:"core",group:"typography",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0};function J(e){return k.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(e)}const K=e=>{const{scripts:l,inBuilder:r,blockProps:o}=e;return r?i.jsxRuntimeExports.jsx("div",{...o,children:i.jsxRuntimeExports.jsx("div",{className:k.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:i.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:i.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):i.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:l}})},Q={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:J,group:"advanced",...t.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},ee=e=>i.jsxRuntimeExports.jsxs("div",{...e.blockProps,...e.styles,children:[e.mode,e.children]}),te=e=>e.mode==="dark"?null:i.jsxRuntimeExports.jsx("button",{"aria-label":"dark mode button",...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(te,{type:"DarkModeButton",label:"Dark Mode Button",category:"core",icon:y.MoonIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp("")}})});const le=e=>e.mode==="light"?null:i.jsxRuntimeExports.jsx("button",{"aria-label":"light mode button",...e.blockProps,...e.styles,children:e.children});t.registerChaiBlock(le,{type:"LightModeButton",label:"Light Mode Button",category:"core",icon:y.SunIcon,group:"advanced",hidden:!0,...t.registerChaiBlockSchema({properties:{mode:t.closestBlockProp("DarkModeSwitcher","mode"),styles:t.stylesProp(""),fake:{type:"string",default:""}}})});const re={type:"DarkModeSwitcher",label:"web_blocks.dark_mode",category:"core",icon:y.MoonIcon,group:"advanced",wrapper:!0,...t.registerChaiBlockSchema({properties:{mode:{title:"Mode",type:"string",enum:["dark","light"],default:"light"},styles:t.stylesProp("")}}),blocks:()=>[{_id:"ultqCh",_type:"DarkModeSwitcher",mode:"light",styles:"#styles:,",_name:"Dark Mode Theme"},{_id:"vroabi",_parent:"ultqCh",_type:"LightModeButton",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"nltBrv",_parent:"vroabi",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"DarkModeButton",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white hidden dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"AdDwBC",_parent:"gesydi",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},se=e=>{const{blockProps:l,styles:r}=e;return w.createElement("hr",{...r,...l})},oe={type:"Divider",label:"web_blocks.divider",category:"core",icon:y.DividerHorizontalIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},ie=e=>{const{blockProps:l,inBuilder:r,children:o,globalBlock:s}=e;return r&&!s?i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-4 bg-gray-100 rounded-lg gap-y-1 dark:bg-gray-800",...l,children:[i.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",s]}),i.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...l},o)},ne={type:"GlobalBlock",label:"Global Block",icon:S.GlobeIcon,category:"core",group:"advanced",...t.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},N=(e,...l)=>({...e,className:k.cn(e.className,...l)}),ae=e=>{const{blockProps:l,icon:r,styles:o,width:s,inBuilder:n,height:a}=e,d=N(o,"");if(m.isEmpty(r))return i.jsxRuntimeExports.jsx(j,{inBuilder:n,className:"h-8 w-14"});const c=r.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...l,...d,style:{width:s?`${s}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:c}})},ce={type:"Icon",label:"web_blocks.icon",category:"core",icon:y.SketchLogoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.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"}}})},de=e=>{const{blockProps:l,image:r,mobileImage:o,styles:s,alt:n,height:a,width:d,lazyLoading:c}=e;return m.isEmpty(r)?i.jsxRuntimeExports.jsx(j,{className:"h-36"}):i.jsxRuntimeExports.jsxs("picture",{children:[o&&i.jsxRuntimeExports.jsx("source",{srcSet:o,media:"(max-width: 480px)"}),i.jsxRuntimeExports.jsx("img",{...l,...s,src:r,alt:n,loading:c?"lazy":"eager",width:d,height:a})]})},ue={type:"Image",label:"Image",category:"core",icon:y.ImageIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.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"}}}}),aiProps:["alt"],i18nProps:["alt"]},pe=e=>{const{blockProps:l,children:r,styles:o,inBuilder:s,content:n,href:a}=e,{hrefType:d,autoplay:c,maxWidth:p,backdropColor:g,galleryName:h}=e,u=N(o,"cb-lightbox");if(!r&&m.isEmpty(o==null?void 0:o.className)&&m.isEmpty(n))return i.jsxRuntimeExports.jsx(j,{inBuilder:s});if(s)return r?i.jsxRuntimeExports.jsx("span",{...l,...u,children:r}):b.createElement("span",{...l,...u,dangerouslySetInnerHTML:{__html:n}});const x={};return d!=="image"&&(x["data-vbtype"]=d),c&&(x["data-autoplay"]="true"),p&&(x["data-maxwidth"]=p+"px"),g&&(x["data-overlay"]=g),h&&(x["data-gall"]=h),r?i.jsxRuntimeExports.jsx("a",{"aria-label":n,...x,href:a||"#/",...l,...u,children:r}):b.createElement("a",{...l,...u,...x,href:a||"#",dangerouslySetInnerHTML:{__html:n},"aria-label":n})},ge={type:"LightBoxLink",label:"Lightbox Link",category:"core",icon:y.ImageIcon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),content:{type:"string",title:"Content",default:"Link text or drop blocks inside"},hrefType:{type:"string",title:"Type",default:"image",enum:["image","video","iframe","inline","ajax"],enumNames:["Image","Video","Iframe","Inline","Ajax"]},href:{type:"string",title:"Href",default:""},autoplay:{type:"boolean",title:"Autoplay (Video only)",default:!1},maxWidth:{type:"number",title:"Max Width",default:""},backdropColor:{type:"string",title:"Backdrop Color",default:""},galleryName:{type:"string",title:"Gallery Name",default:""}},dependencies:{autoplay:["hrefType","video"]}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="Link"&&e!=="LightBoxLink"},me=e=>{const{blockProps:l,link:r,children:o,styles:s,inBuilder:n,content:a}=e;let d={};return!o&&m.isEmpty(a)&&(d={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),n?o?i.jsxRuntimeExports.jsx("span",{...l,style:d,...s,children:o}):w.createElement("span",{...l,...s,style:d},a):o?i.jsxRuntimeExports.jsx("a",{"aria-label":a,href:(r==null?void 0:r.href)||"#/",target:r==null?void 0:r.target,...l,...s,children:o}):w.createElement("a",{...l,...s,href:(r==null?void 0:r.href)||"#",target:(r==null?void 0:r.target)||"_self","aria-label":a},a)},he={type:"Link",label:"Link",category:"core",icon:y.Link1Icon,group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e!=="Link"},ye=e=>{const{blockProps:l,children:r,listType:o,styles:s,tag:n,inBuilder:a}=e,d=k.cn(m.get(s,"className",""),o);return!r&&m.isEmpty(s==null?void 0:s.className)?i.jsxRuntimeExports.jsx(j,{inBuilder:a}):b.createElement(n||(o==="list-decimal"?"ol":"ul"),{...l,...s,className:d},r)},xe={type:"List",label:"web_blocks.list",icon:y.RowsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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"}]},fe=e=>{const{blockProps:l,content:r,styles:o,children:s,tag:n}=e;return s?b.createElement(n||"li",{...o,...l},s):b.createElement(n||"li",{...o,...l,dangerouslySetInnerHTML:{__html:r}})},be={type:"ListItem",label:"List Item",icon:y.ColumnsIcon,category:"core",group:"basic",...t.registerChaiBlockSchema({properties:{styles:t.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"},ke=e=>e.inBuilder||e.forceWrapper?i.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Se={type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:y.SpaceBetweenVerticallyIcon,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-black"),content:{type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},I=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,R=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,L=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,Be=e=>{if(I.test(e)){const l=e.match(I);return l?`https://www.youtube.com/embed/${l[4]}`:e}if(R.test(e)){const l=e.match(R);return l?`https://player.vimeo.com/video/${l[3]}`:e}if(L.test(e)){const l=e.match(L);return l?`https://www.dailymotion.com/embed/video/${l[4]}`:e}return null},we=b.memo(e=>{const{blockProps:l,inBuilder:r,styles:o,url:s,controls:n}=e,a=m.get(n,"autoPlay",!1),d=m.get(n,"controls",!1),c=a||m.get(n,"muted",!0),p=m.get(n,"loop",!1);if(m.isEmpty(s))return i.jsxRuntimeExports.jsx(j,{inBuilder:r,className:"h-36"});let g=Be(s),h=null;if(g){if(!m.isEmpty(g)){const u=[];u.push(`autoplay=${a?1:0}`),u.push(`controls=${n?1:0}`),u.push(`mute=${c?1:0}&muted=${c?1:0}`),u.push(`loop=${p?1:0}`),g=`${g}?${u.join("&")}`}h=b.createElement("iframe",{...l,className:"absolute inset-0 w-full h-full",src:g,allow:r?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else h=b.createElement("video",{...l,className:"absolute inset-0 w-full h-full",src:s,controls:d,muted:c,autoPlay:r?!1:a,loop:p});return i.jsxRuntimeExports.jsx("div",{...m.pick(o,["className"]),children:i.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[r?i.jsxRuntimeExports.jsx("div",{...l,...m.omit(o,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,h]})})}),je={type:"Video",label:"Video",category:"core",icon:y.VideoIcon,group:"media",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),url:{type:"string",title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"},controls:{type:"object",title:"Controls",default:{autoplay:!1,controls:!0,loop:!1,muted:!1},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}}}}}),i18nProps:["url"]},_={wrapper:{"x-data":"{ open: false }"},button:{"x-on:click":"open = !open"},menu:{"x-show":"open","x-on:click.away":"open = false","x-cloak":"","x-transition":""}},Ce=e=>{const{blockProps:l,content:r,icon:o,iconWidth:s,iconHeight:n,styles:a,show:d}=e;return i.jsxRuntimeExports.jsxs("button",{"aria-label":r,...l,...a,..._.button,children:[r,i.jsxRuntimeExports.jsx("span",{className:d?"rotate-180":"",dangerouslySetInnerHTML:{__html:o},style:{width:s,height:n}})]})};t.registerChaiBlock(Ce,{type:"DropdownButton",label:"Dropdown Button",group:"advanced",category:"core",hidden:!0,canMove:()=>!1,canDelete:()=>!1,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),content:{type:"string",title:"Title",default:"Menu Item"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconWidth:{type:"string",title:"Icon Width",default:"16px"},iconHeight:{type:"string",title:"Icon Height",default:"16px"},styles:t.StylesProp("flex items-center gap-2 px-4 py-1")}}),i18nProps:["content"],aiProps:["content"]});const ve=e=>{const{blockProps:l,children:r,styles:o,show:s,inBuilder:n}=e;return n&&!s?null:i.jsxRuntimeExports.jsx("div",{...l,..._.menu,...o,children:r})};t.registerChaiBlock(ve,{type:"DropdownContent",label:"Dropdown Content",group:"basic",hidden:!0,canMove:()=>!1,canDelete:()=>!1,canAcceptBlock:()=>!0,...t.registerChaiBlockSchema({properties:{show:t.closestBlockProp("Dropdown","showDropdown"),styles:t.StylesProp("absolute left-0 p-2 w-80 mt-2 bg-white rounded-lg shadow-lg z-50")}})});const Pe=e=>{const{blockProps:l,children:r,styles:o}=e;return i.jsxRuntimeExports.jsx("div",{...l,...o,..._.wrapper,children:r})},_e={type:"Dropdown",label:"Dropdown",group:"basic",icon:y.DropdownMenuIcon,blocks:()=>[{_type:"Dropdown",_id:"dropdown"},{_type:"DropdownButton",_id:"button",_parent:"dropdown",title:"Menu Item",icon:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24"> <path d="M16.293 9.293 12 13.586 7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z"/> </svg>',styles:"#styles:,flex items-center gap-2 px-4 py-1"},{_type:"DropdownContent",_id:"content",_parent:"dropdown",styles:"#styles:,absolute left-0 w-80 mt-0.5 bg-white rounded-lg shadow-lg z-50"},{_type:"Link",_id:"link",_parent:"content",content:"Link",styles:"#styles:,flex items-center gap-2 px-4 py-1",link:{href:"https://www.google.com",type:"url",target:"_self"}}],category:"core",wrapper:!0,...t.registerChaiBlockSchema({properties:{showDropdown:t.runtimeProp({type:"boolean",title:"Show Dropdown",default:!1}),styles:t.StylesProp("relative w-max")}})},Ee=e=>{const{blockProps:l,fieldName:r,label:o,styles:s,inputStyles:n,required:a,checked:d,showLabel:c=!0}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...s,...l,children:[i.jsxRuntimeExports.jsx("input",{...n,name:r,id:p,type:"checkbox",required:a,defaultChecked:d}),o&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o})]}):i.jsxRuntimeExports.jsx("input",{id:p,...l,...n,...s,type:"checkbox",required:a,name:r})},Ie={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:y.CheckboxIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),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"]},Re=e=>{const{children:l,blockProps:r,errorMessage:o,successMessage:s,action:n,styles:a,inBuilder:d}=e;let c=l;l||(c=i.jsxRuntimeExports.jsx(j,{inBuilder:d}));const p={"x-data":"{}","x-on:submit.prevent":"post"},g={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return i.jsxRuntimeExports.jsxs("form",{...p,"data-error":o,"data-success":s,method:"post",action:n,...r,...a,children:[i.jsxRuntimeExports.jsx("div",{...g}),c]})},Le={type:"Form",label:"Form",category:"core",icon:S.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,"}],...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form/submit"},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},Ne=e=>{const{blockProps:l,inBuilder:r,label:o,styles:s,inputStyles:n,icon:a,iconSize:d,iconPos:c}=e,p=k.generateUUID(),g={"x-bind:disabled":"formLoading"};return i.jsxRuntimeExports.jsxs("button",{id:p,...g,...n,...s,...l||{},type:r?"button":"submit","aria-label":o,children:[o,a&&i.jsxRuntimeExports.jsx("div",{style:{width:d+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Me={type:"FormButton",label:"Submit Button",category:"core",icon:y.ButtonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),inputStyles:t.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"]},De=e=>{const{blockProps:l,fieldName:r,label:o,placeholder:s,styles:n,inputStyles:a,showLabel:d,required:c,inputType:p}=e,g=k.generateUUID();return d?i.jsxRuntimeExports.jsxs("div",{...n,...l,children:[d&&i.jsxRuntimeExports.jsx("label",{htmlFor:g,children:o}),i.jsxRuntimeExports.jsx("input",{name:r,...a,id:g,type:p,placeholder:s,required:c})]}):i.jsxRuntimeExports.jsx("input",{id:g,name:r,...l,...a,...n,type:p,placeholder:s,required:c})},$e={type:"Input",label:"web_blocks.input",category:"core",icon:y.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),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},inputType:{type:"string",title:"Input Type",default:"text",enum:["text","email","password","number","tel","file","hidden","range","submit","color","date","time"]}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Te=e=>{const{blockProps:l,content:r,styles:o,children:s}=e,n={...o,...l};return s?b.createElement("label",n,s):b.createElement("label",{...n,dangerouslySetInnerHTML:{__html:r}})},Ae={type:"Label",label:"Label",category:"core",icon:y.LetterCaseToggleIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(),content:{type:"string",title:"Content",default:""}}})},ze=e=>{const{blockProps:l,fieldName:r,label:o,styles:s,inputStyles:n,required:a,checked:d,showLabel:c=!0}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...s,...l,children:[i.jsxRuntimeExports.jsx("input",{...n,name:r,id:p,type:"radio",required:a,defaultChecked:d}),o&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o})]}):i.jsxRuntimeExports.jsx("input",{id:p,...l,...n,...s,type:"radio",required:a,checked:d,name:r})},He={type:"Radio",label:"web_blocks.radio",category:"core",icon:y.RadiobuttonIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("flex items-center gap-x-2"),inputStyles:t.StylesProp(""),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"]},qe=e=>{const{blockProps:l,fieldName:r,label:o,placeholder:s,styles:n,inputStyles:a,required:d,showLabel:c,_multiple:p,options:g}=e,h=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...l,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:h,children:o}),i.jsxRuntimeExports.jsxs("select",{...a,id:h,required:d,multiple:p,name:r,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),m.map(g,u=>i.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})]}):i.jsxRuntimeExports.jsxs("select",{id:h,...n,...l,required:d,multiple:p,name:r,children:[i.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:s}),m.map(g,u=>i.jsxRuntimeExports.jsx("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})},Ue={type:"Select",label:"web_blocks.select",category:"core",icon:y.DropdownMenuIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.StylesProp("w-full p-1"),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"]},Oe=e=>{const{blockProps:l,fieldName:r,label:o,placeholder:s,styles:n,inputStyles:a,_rows:d,showLabel:c}=e,p=k.generateUUID();return c?i.jsxRuntimeExports.jsxs("div",{...n,...l,children:[c&&i.jsxRuntimeExports.jsx("label",{htmlFor:p,children:o}),i.jsxRuntimeExports.jsx("textarea",{name:r,...a,id:p,placeholder:s,rows:d})]}):i.jsxRuntimeExports.jsx("textarea",{id:p,name:r,...l,...a,...n,placeholder:s,rows:d})},Fe={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:y.InputIcon,group:"form",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),inputStyles:t.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}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Ge=e=>{const{blockProps:l,backgroundImage:r,children:o,styles:s,tag:n}=e;let a={};return r&&(a={backgroundImage:`url(${r})`}),w.createElement(n||"div",{...l,...s,style:a},o)},Ve={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("font-body antialiased"),backgroundImage:{type:"string",title:"Image",default:"",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,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},We=e=>{const{blockProps:l,styles:r}=e;return w.createElement("br",{...l,...r})},Xe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...t.registerChaiBlockSchema({properties:{styles:t.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},P={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"}},Ye=e=>{const{blockProps:l,children:r,styles:o,colSpan:s,tabletColSpan:n,desktopColSpan:a}=e,c={className:[m.get(o,"className",""),m.get(P,["SMALL",isNaN(s)||!s?6:s],""),n?m.get(P,["MEDIUM",n||s],""):"",a?m.get(P,["LARGE",n||s],""):""].join(" ")};return i.jsxRuntimeExports.jsx("div",{...l,...o,...c,children:r||i.jsxRuntimeExports.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},Ze={type:"Column",label:"Column",group:"basic",category:"core",icon:S.Columns,wrapper:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...t.registerChaiBlockSchema({properties:{styles:t.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]}}})},Je=e=>{const{blockProps:l,children:r,styles:o,gutter:s}=e,a={className:[m.get(o,"className","")," grid grid-cols-12"].join()};return typeof(o==null?void 0:o.style)=="object"?o.style.gap=`${s}px`:a.style={gap:`${s}px`},i.jsxRuntimeExports.jsx("div",{...l,...o,...a,children:r})},Ke={type:"Row",label:"Row",group:"basic",icon:S.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",...t.registerChaiBlockSchema({properties:{styles:t.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},C=(e,l)=>({slider:{"x-data":`{
|
|
4
4
|
currentSlide: 0,
|
|
5
5
|
totalSlides: ${(l==null?void 0:l.totalSlides)||0},
|
|
6
6
|
autoplay: ${!!(l!=null&&l.autoplay)},
|
package/dist/web-blocks.js
CHANGED
|
@@ -98,7 +98,7 @@ const _ = ({ className: e = "", inBuilder: t }) => t ? /* @__PURE__ */ o.jsx("di
|
|
|
98
98
|
iconSize: {
|
|
99
99
|
type: "number",
|
|
100
100
|
title: "Icon size",
|
|
101
|
-
default:
|
|
101
|
+
default: 16
|
|
102
102
|
},
|
|
103
103
|
iconPos: {
|
|
104
104
|
type: "string",
|
|
@@ -916,7 +916,9 @@ u(ct, {
|
|
|
916
916
|
iconHeight: { type: "string", title: "Icon Height", default: "16px" },
|
|
917
917
|
styles: d("flex items-center gap-2 px-4 py-1")
|
|
918
918
|
}
|
|
919
|
-
})
|
|
919
|
+
}),
|
|
920
|
+
i18nProps: ["content"],
|
|
921
|
+
aiProps: ["content"]
|
|
920
922
|
});
|
|
921
923
|
const dt = (e) => {
|
|
922
924
|
const { blockProps: t, children: l, styles: n, show: r, inBuilder: s } = e;
|
package/package.json
CHANGED
package/dist/STRINGS-DtEft2kY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const _="#styles:",E="__ADD_BLOCK_INTERNAL_ROOT";exports.ROOT_TEMP_KEY=E;exports.STYLES_KEY=_;
|