@chaibuilder/sdk 2.2.33 → 2.2.35

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 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"),x=require("@tailwindcss/aspect-ratio"),I=require("@tailwindcss/forms"),q=require("@tailwindcss/typography");require("tailwindcss-animate");const $=require("./get-chai-builder-theme-B1tr_NJB.cjs"),E=require("@mhsdesign/jit-browser-tailwindcss"),F=require("@tailwindcss/container-queries"),m=require("react/jsx-runtime"),u=require("react"),L=require("@chaibuilder/runtime");function R(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 D=e=>{if(!e)return[];try{return JSON.parse(j(e)).filter(n=>!n._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function j(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 M(e,t,n=[],i="",l){return await E.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:n,theme:{extend:$.getChaiBuilderTheme(e)},plugins:[I,q,x,F,y.chaiBuilderPlugin],corePlugins:{preflight:l},...i?{prefix:`${i}`}:{}}}).generateStylesFromContent(` ${l?"@tailwind base;":""}
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 O=(e,t,n)=>{const i=JSON.stringify(e).replace(/#styles:([^"]*)/g,(l,s)=>`#styles:${s.replace(/,/g," ")}`.replace(/#styles:/g,""));return M(t,[i],[],"",n)},A=async(e,t=y.defaultThemeOptions,n=!1)=>await O(e,t,n);async function K(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 N=()=>m.jsx("div",{}),J=e=>{const{block:t,lang:n,fallbackLang:i,children:l,externalData:s,blocks:a,draft:o,pageProps:c,dataProviderMetadataCallback:h}=e,d=L.getRegisteredChaiBlock(t._type),f=r.get(d,"component",null),k=r.get(e.repeaterData,"index",-1),P=r.get(e.repeaterData,"dataKey",""),b=n===i?"":n,g=p.applyBindingToBlockProps(p.applyLanguage(t,b,d),s,{index:k,key:P}),C=p.getBlockTagAttributes(t,!1),w=V(a,t._id,p.getBlockRuntimeProps(t._type)),S=r.has(d,"dataProvider")&&r.isFunction(d.dataProvider),_={blockProps:{},inBuilder:!1,lang:n||i,...g,...C,...w};if(r.isNull(f))return null;if(S){const T=r.get(d,"suspenseFallback",N);return m.jsx(u.Suspense,{fallback:u.createElement(T),children:m.jsx(K,{lang:n,pageProps:c,block:t,dataProvider:d.dataProvider,...h?{dataProviderMetadataCallback:h}:{},draft:o,children:v=>u.createElement(f,{..._,...v,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,{..._,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(J,{...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)},V=(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 U(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=U;exports.convertToBlocks=D;exports.getMergedPartialBlocks=R;exports.getStylesForBlocks=A;
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 R, c as F } from "./plugin-BOcGV_IY.js";
2
- import { a as Ce, b as Se, e as ve } from "./plugin-BOcGV_IY.js";
3
- import { a as O, b as K, g as M, c as A, d as w } from "./apply-binding-CkrtJykq.js";
4
- import { e as Ie } from "./apply-binding-CkrtJykq.js";
5
- import { get as s, cloneDeep as N, isEmpty as u, has as B, isFunction as v, omit as J, isNull as E, isArray as _, uniqBy as j, filter as C, map as q, find as y } from "lodash-es";
6
- import U from "@tailwindcss/aspect-ratio";
7
- import V from "@tailwindcss/forms";
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 W } from "./get-chai-builder-theme-BarMkcGH.js";
11
- import { createTailwindcss as z } from "@mhsdesign/jit-browser-tailwindcss";
12
- import H from "@tailwindcss/container-queries";
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 S, createElement as g } from "react";
15
- import { getRegisteredChaiBlock as Q } from "@chaibuilder/runtime";
16
- function ye(e, t) {
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 = N(s(t, l, []));
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 _e = (e) => {
28
+ const be = (e) => {
29
29
  if (!e) return [];
30
30
  try {
31
- return JSON.parse(X(e)).filter((r) => !r._type.startsWith("@chai"));
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 X(e) {
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 Y(e, t, r = [], n = "", i) {
44
- return await z({
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: W(e) },
49
- plugins: [V, G, U, H, F],
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 Z = (e, t, r) => {
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 Y(t, [n], [], "", r);
63
- }, Pe = async (e, t = R, r = !1) => await Z(e, t, r);
64
- async function ee(e) {
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") && v(e.dataProviderMetadataCallback) && e.dataProviderMetadataCallback(e.block, t.$metadata), e.children({
73
- ...J(t, "$metadata")
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 te = () => /* @__PURE__ */ m("div", {}), ae = (e) => {
77
- const { block: t, lang: r, fallbackLang: n, children: i, externalData: l, blocks: a, draft: o, pageProps: c, dataProviderMetadataCallback: f } = e, d = Q(t._type), h = s(d, "component", null), k = s(e.repeaterData, "index", -1), x = s(e.repeaterData, "dataKey", ""), p = O(
78
- K(t, r === n ? "" : r, d),
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: x }
81
- ), I = M(t, !1), $ = re(a, t._id, A(t._type)), T = B(d, "dataProvider") && v(d.dataProvider), b = {
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
- ...p,
86
- ...I,
87
- ...$
89
+ ...P
88
90
  };
89
- if (E(h)) return null;
90
- if (T) {
91
- const L = s(d, "suspenseFallback", te);
92
- return /* @__PURE__ */ m(S, { fallback: g(L), children: /* @__PURE__ */ m(
93
- ee,
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: t,
99
+ block: P,
98
100
  dataProvider: d.dataProvider,
99
101
  ...f ? { dataProviderMetadataCallback: f } : {},
100
102
  draft: o,
101
- children: (D) => g(h, {
102
- ...b,
103
- ...D,
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: w(p.repeaterItems, t),
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(S, { children: g(h, {
117
- ...b,
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: w(p.repeaterItems, t),
124
+ repeaterItems: C(p.repeaterItems, t),
123
125
  $repeaterItemsKey: p.$repeaterItemsKey
124
126
  } : {}
125
127
  })
126
128
  }) });
127
- }, P = (e) => {
129
+ }, b = (e) => {
128
130
  const { blocks: t, parent: r, repeaterData: n } = e;
129
- let i = j(
130
- C(t, (a) => B(a, "_id") && (u(r) ? !a._parent : a._parent === r)),
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) => C(t, (o) => o._parent === a).length > 0;
134
- return q(i, (a) => a ? /* @__PURE__ */ g(ae, { ...e, key: a._id, block: a }, ({ _id: o, _type: c, repeaterItems: f, $repeaterItemsKey: d }) => c === "Repeater" ? _(f) && f.map((h, k) => /* @__PURE__ */ g(
135
- P,
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
- P,
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
- }, re = (e, t, r) => u(r) ? {} : Object.entries(r).reduce((n, [i, l]) => {
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 Be(e) {
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(P, { ...e, lang: t, fallbackLang: r });
167
+ return /* @__PURE__ */ m(b, { ...e, lang: t, fallbackLang: r });
166
168
  }
167
169
  export {
168
- Be as RenderChaiBlocks,
169
- Ie as applyChaiDataBinding,
170
- _e as convertToBlocks,
171
- Ce as getChaiThemeCssVariables,
172
- ye as getMergedPartialBlocks,
173
- Pe as getStylesForBlocks,
174
- Se as getThemeFontsCSSImport,
175
- ve as getThemeFontsLinkMarkup
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
  };