@chaibuilder/pages 0.1.0-beta.7 → 0.1.0-beta.71
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/BMGNQTAT-F9rCaqv9.js +33 -0
- package/dist/BMGNQTAT-zZxZgtfv.cjs +1 -0
- package/dist/ChaiBuilderPages-QYQG9fO9.js +5677 -0
- package/dist/ChaiBuilderPages-Zm5IIBmc.cjs +31 -0
- package/dist/STCWXWCR-BnYmoNt5.cjs +1200 -0
- package/dist/STCWXWCR-CepHkonc.js +9104 -0
- package/dist/UODQIBEW-B8zYbjpc.js +42 -0
- package/dist/UODQIBEW-DGMYkaBj.cjs +1 -0
- package/dist/index.cjs +1 -30
- package/dist/index.d.ts +10 -3
- package/dist/index.js +8 -2041
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.js +0 -1
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +57 -3
- package/dist/server.js +334 -24
- package/dist/style.css +6 -6
- package/package.json +13 -10
package/dist/index.js
CHANGED
|
@@ -1,2043 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
var Ie = { exports: {} }, ee = {};
|
|
9
|
-
/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/
|
|
18
|
-
var dt;
|
|
19
|
-
function Ra() {
|
|
20
|
-
if (dt) return ee;
|
|
21
|
-
dt = 1;
|
|
22
|
-
var r = pt, i = Symbol.for("react.element"), o = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, s = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, w = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
23
|
-
function c(p, u, m) {
|
|
24
|
-
var h, g = {}, f = null, S = null;
|
|
25
|
-
m !== void 0 && (f = "" + m), u.key !== void 0 && (f = "" + u.key), u.ref !== void 0 && (S = u.ref);
|
|
26
|
-
for (h in u) a.call(u, h) && !w.hasOwnProperty(h) && (g[h] = u[h]);
|
|
27
|
-
if (p && p.defaultProps) for (h in u = p.defaultProps, u) g[h] === void 0 && (g[h] = u[h]);
|
|
28
|
-
return { $$typeof: i, type: p, key: f, ref: S, props: g, _owner: s.current };
|
|
29
|
-
}
|
|
30
|
-
return ee.Fragment = o, ee.jsx = c, ee.jsxs = c, ee;
|
|
31
|
-
}
|
|
32
|
-
var te = {};
|
|
33
|
-
/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-jsx-runtime.development.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/
|
|
42
|
-
var ht;
|
|
43
|
-
function Da() {
|
|
44
|
-
return ht || (ht = 1, process.env.NODE_ENV !== "production" && function() {
|
|
45
|
-
var r = pt, i = Symbol.for("react.element"), o = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), p = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), T = Symbol.iterator, E = "@@iterator";
|
|
46
|
-
function A(e) {
|
|
47
|
-
if (e === null || typeof e != "object")
|
|
48
|
-
return null;
|
|
49
|
-
var n = T && e[T] || e[E];
|
|
50
|
-
return typeof n == "function" ? n : null;
|
|
51
|
-
}
|
|
52
|
-
var R = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
53
|
-
function b(e) {
|
|
54
|
-
{
|
|
55
|
-
for (var n = arguments.length, l = new Array(n > 1 ? n - 1 : 0), d = 1; d < n; d++)
|
|
56
|
-
l[d - 1] = arguments[d];
|
|
57
|
-
je("error", e, l);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function je(e, n, l) {
|
|
61
|
-
{
|
|
62
|
-
var d = R.ReactDebugCurrentFrame, y = d.getStackAddendum();
|
|
63
|
-
y !== "" && (n += "%s", l = l.concat([y]));
|
|
64
|
-
var j = l.map(function(x) {
|
|
65
|
-
return String(x);
|
|
66
|
-
});
|
|
67
|
-
j.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, j);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
var ie = !1, H = !1, we = !1, Se = !1, oe = !1, q;
|
|
71
|
-
q = Symbol.for("react.module.reference");
|
|
72
|
-
function Ee(e) {
|
|
73
|
-
return !!(typeof e == "string" || typeof e == "function" || e === a || e === w || oe || e === s || e === m || e === h || Se || e === S || ie || H || we || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === g || e.$$typeof === c || e.$$typeof === p || e.$$typeof === u || // This needs to include all possible module reference object
|
|
74
|
-
// types supported by any Flight configuration anywhere since
|
|
75
|
-
// we don't know which Flight build this will end up being used
|
|
76
|
-
// with.
|
|
77
|
-
e.$$typeof === q || e.getModuleId !== void 0));
|
|
78
|
-
}
|
|
79
|
-
function Ce(e, n, l) {
|
|
80
|
-
var d = e.displayName;
|
|
81
|
-
if (d)
|
|
82
|
-
return d;
|
|
83
|
-
var y = n.displayName || n.name || "";
|
|
84
|
-
return y !== "" ? l + "(" + y + ")" : l;
|
|
85
|
-
}
|
|
86
|
-
function Q(e) {
|
|
87
|
-
return e.displayName || "Context";
|
|
88
|
-
}
|
|
89
|
-
function C(e) {
|
|
90
|
-
if (e == null)
|
|
91
|
-
return null;
|
|
92
|
-
if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
93
|
-
return e.displayName || e.name || null;
|
|
94
|
-
if (typeof e == "string")
|
|
95
|
-
return e;
|
|
96
|
-
switch (e) {
|
|
97
|
-
case a:
|
|
98
|
-
return "Fragment";
|
|
99
|
-
case o:
|
|
100
|
-
return "Portal";
|
|
101
|
-
case w:
|
|
102
|
-
return "Profiler";
|
|
103
|
-
case s:
|
|
104
|
-
return "StrictMode";
|
|
105
|
-
case m:
|
|
106
|
-
return "Suspense";
|
|
107
|
-
case h:
|
|
108
|
-
return "SuspenseList";
|
|
109
|
-
}
|
|
110
|
-
if (typeof e == "object")
|
|
111
|
-
switch (e.$$typeof) {
|
|
112
|
-
case p:
|
|
113
|
-
var n = e;
|
|
114
|
-
return Q(n) + ".Consumer";
|
|
115
|
-
case c:
|
|
116
|
-
var l = e;
|
|
117
|
-
return Q(l._context) + ".Provider";
|
|
118
|
-
case u:
|
|
119
|
-
return Ce(e, e.render, "ForwardRef");
|
|
120
|
-
case g:
|
|
121
|
-
var d = e.displayName || null;
|
|
122
|
-
return d !== null ? d : C(e.type) || "Memo";
|
|
123
|
-
case f: {
|
|
124
|
-
var y = e, j = y._payload, x = y._init;
|
|
125
|
-
try {
|
|
126
|
-
return C(x(j));
|
|
127
|
-
} catch {
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
var F = Object.assign, M = 0, le, ce, Ke, Ve, We, ze, Je;
|
|
135
|
-
function Ye() {
|
|
136
|
-
}
|
|
137
|
-
Ye.__reactDisabledLog = !0;
|
|
138
|
-
function Ft() {
|
|
139
|
-
{
|
|
140
|
-
if (M === 0) {
|
|
141
|
-
le = console.log, ce = console.info, Ke = console.warn, Ve = console.error, We = console.group, ze = console.groupCollapsed, Je = console.groupEnd;
|
|
142
|
-
var e = {
|
|
143
|
-
configurable: !0,
|
|
144
|
-
enumerable: !0,
|
|
145
|
-
value: Ye,
|
|
146
|
-
writable: !0
|
|
147
|
-
};
|
|
148
|
-
Object.defineProperties(console, {
|
|
149
|
-
info: e,
|
|
150
|
-
log: e,
|
|
151
|
-
warn: e,
|
|
152
|
-
error: e,
|
|
153
|
-
group: e,
|
|
154
|
-
groupCollapsed: e,
|
|
155
|
-
groupEnd: e
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
M++;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
function Lt() {
|
|
162
|
-
{
|
|
163
|
-
if (M--, M === 0) {
|
|
164
|
-
var e = {
|
|
165
|
-
configurable: !0,
|
|
166
|
-
enumerable: !0,
|
|
167
|
-
writable: !0
|
|
168
|
-
};
|
|
169
|
-
Object.defineProperties(console, {
|
|
170
|
-
log: F({}, e, {
|
|
171
|
-
value: le
|
|
172
|
-
}),
|
|
173
|
-
info: F({}, e, {
|
|
174
|
-
value: ce
|
|
175
|
-
}),
|
|
176
|
-
warn: F({}, e, {
|
|
177
|
-
value: Ke
|
|
178
|
-
}),
|
|
179
|
-
error: F({}, e, {
|
|
180
|
-
value: Ve
|
|
181
|
-
}),
|
|
182
|
-
group: F({}, e, {
|
|
183
|
-
value: We
|
|
184
|
-
}),
|
|
185
|
-
groupCollapsed: F({}, e, {
|
|
186
|
-
value: ze
|
|
187
|
-
}),
|
|
188
|
-
groupEnd: F({}, e, {
|
|
189
|
-
value: Je
|
|
190
|
-
})
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
M < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
var ke = R.ReactCurrentDispatcher, Ne;
|
|
197
|
-
function ue(e, n, l) {
|
|
198
|
-
{
|
|
199
|
-
if (Ne === void 0)
|
|
200
|
-
try {
|
|
201
|
-
throw Error();
|
|
202
|
-
} catch (y) {
|
|
203
|
-
var d = y.stack.trim().match(/\n( *(at )?)/);
|
|
204
|
-
Ne = d && d[1] || "";
|
|
205
|
-
}
|
|
206
|
-
return `
|
|
207
|
-
` + Ne + e;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
var Te = !1, de;
|
|
211
|
-
{
|
|
212
|
-
var It = typeof WeakMap == "function" ? WeakMap : Map;
|
|
213
|
-
de = new It();
|
|
214
|
-
}
|
|
215
|
-
function He(e, n) {
|
|
216
|
-
if (!e || Te)
|
|
217
|
-
return "";
|
|
218
|
-
{
|
|
219
|
-
var l = de.get(e);
|
|
220
|
-
if (l !== void 0)
|
|
221
|
-
return l;
|
|
222
|
-
}
|
|
223
|
-
var d;
|
|
224
|
-
Te = !0;
|
|
225
|
-
var y = Error.prepareStackTrace;
|
|
226
|
-
Error.prepareStackTrace = void 0;
|
|
227
|
-
var j;
|
|
228
|
-
j = ke.current, ke.current = null, Ft();
|
|
229
|
-
try {
|
|
230
|
-
if (n) {
|
|
231
|
-
var x = function() {
|
|
232
|
-
throw Error();
|
|
233
|
-
};
|
|
234
|
-
if (Object.defineProperty(x.prototype, "props", {
|
|
235
|
-
set: function() {
|
|
236
|
-
throw Error();
|
|
237
|
-
}
|
|
238
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
239
|
-
try {
|
|
240
|
-
Reflect.construct(x, []);
|
|
241
|
-
} catch (O) {
|
|
242
|
-
d = O;
|
|
243
|
-
}
|
|
244
|
-
Reflect.construct(e, [], x);
|
|
245
|
-
} else {
|
|
246
|
-
try {
|
|
247
|
-
x.call();
|
|
248
|
-
} catch (O) {
|
|
249
|
-
d = O;
|
|
250
|
-
}
|
|
251
|
-
e.call(x.prototype);
|
|
252
|
-
}
|
|
253
|
-
} else {
|
|
254
|
-
try {
|
|
255
|
-
throw Error();
|
|
256
|
-
} catch (O) {
|
|
257
|
-
d = O;
|
|
258
|
-
}
|
|
259
|
-
e();
|
|
260
|
-
}
|
|
261
|
-
} catch (O) {
|
|
262
|
-
if (O && d && typeof O.stack == "string") {
|
|
263
|
-
for (var v = O.stack.split(`
|
|
264
|
-
`), P = d.stack.split(`
|
|
265
|
-
`), k = v.length - 1, N = P.length - 1; k >= 1 && N >= 0 && v[k] !== P[N]; )
|
|
266
|
-
N--;
|
|
267
|
-
for (; k >= 1 && N >= 0; k--, N--)
|
|
268
|
-
if (v[k] !== P[N]) {
|
|
269
|
-
if (k !== 1 || N !== 1)
|
|
270
|
-
do
|
|
271
|
-
if (k--, N--, N < 0 || v[k] !== P[N]) {
|
|
272
|
-
var L = `
|
|
273
|
-
` + v[k].replace(" at new ", " at ");
|
|
274
|
-
return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" && de.set(e, L), L;
|
|
275
|
-
}
|
|
276
|
-
while (k >= 1 && N >= 0);
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
} finally {
|
|
281
|
-
Te = !1, ke.current = j, Lt(), Error.prepareStackTrace = y;
|
|
282
|
-
}
|
|
283
|
-
var V = e ? e.displayName || e.name : "", $ = V ? ue(V) : "";
|
|
284
|
-
return typeof e == "function" && de.set(e, $), $;
|
|
285
|
-
}
|
|
286
|
-
function Bt(e, n, l) {
|
|
287
|
-
return He(e, !1);
|
|
288
|
-
}
|
|
289
|
-
function Ut(e) {
|
|
290
|
-
var n = e.prototype;
|
|
291
|
-
return !!(n && n.isReactComponent);
|
|
292
|
-
}
|
|
293
|
-
function he(e, n, l) {
|
|
294
|
-
if (e == null)
|
|
295
|
-
return "";
|
|
296
|
-
if (typeof e == "function")
|
|
297
|
-
return He(e, Ut(e));
|
|
298
|
-
if (typeof e == "string")
|
|
299
|
-
return ue(e);
|
|
300
|
-
switch (e) {
|
|
301
|
-
case m:
|
|
302
|
-
return ue("Suspense");
|
|
303
|
-
case h:
|
|
304
|
-
return ue("SuspenseList");
|
|
305
|
-
}
|
|
306
|
-
if (typeof e == "object")
|
|
307
|
-
switch (e.$$typeof) {
|
|
308
|
-
case u:
|
|
309
|
-
return Bt(e.render);
|
|
310
|
-
case g:
|
|
311
|
-
return he(e.type, n, l);
|
|
312
|
-
case f: {
|
|
313
|
-
var d = e, y = d._payload, j = d._init;
|
|
314
|
-
try {
|
|
315
|
-
return he(j(y), n, l);
|
|
316
|
-
} catch {
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
return "";
|
|
321
|
-
}
|
|
322
|
-
var X = Object.prototype.hasOwnProperty, Qe = {}, Xe = R.ReactDebugCurrentFrame;
|
|
323
|
-
function fe(e) {
|
|
324
|
-
if (e) {
|
|
325
|
-
var n = e._owner, l = he(e.type, e._source, n ? n.type : null);
|
|
326
|
-
Xe.setExtraStackFrame(l);
|
|
327
|
-
} else
|
|
328
|
-
Xe.setExtraStackFrame(null);
|
|
329
|
-
}
|
|
330
|
-
function Gt(e, n, l, d, y) {
|
|
331
|
-
{
|
|
332
|
-
var j = Function.call.bind(X);
|
|
333
|
-
for (var x in e)
|
|
334
|
-
if (j(e, x)) {
|
|
335
|
-
var v = void 0;
|
|
336
|
-
try {
|
|
337
|
-
if (typeof e[x] != "function") {
|
|
338
|
-
var P = Error((d || "React class") + ": " + l + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
339
|
-
throw P.name = "Invariant Violation", P;
|
|
340
|
-
}
|
|
341
|
-
v = e[x](n, x, d, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
342
|
-
} catch (k) {
|
|
343
|
-
v = k;
|
|
344
|
-
}
|
|
345
|
-
v && !(v instanceof Error) && (fe(y), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", d || "React class", l, x, typeof v), fe(null)), v instanceof Error && !(v.message in Qe) && (Qe[v.message] = !0, fe(y), b("Failed %s type: %s", l, v.message), fe(null));
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
var qt = Array.isArray;
|
|
350
|
-
function Pe(e) {
|
|
351
|
-
return qt(e);
|
|
352
|
-
}
|
|
353
|
-
function Mt(e) {
|
|
354
|
-
{
|
|
355
|
-
var n = typeof Symbol == "function" && Symbol.toStringTag, l = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
356
|
-
return l;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
function $t(e) {
|
|
360
|
-
try {
|
|
361
|
-
return Ze(e), !1;
|
|
362
|
-
} catch {
|
|
363
|
-
return !0;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
function Ze(e) {
|
|
367
|
-
return "" + e;
|
|
368
|
-
}
|
|
369
|
-
function et(e) {
|
|
370
|
-
if ($t(e))
|
|
371
|
-
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Mt(e)), Ze(e);
|
|
372
|
-
}
|
|
373
|
-
var Z = R.ReactCurrentOwner, Kt = {
|
|
374
|
-
key: !0,
|
|
375
|
-
ref: !0,
|
|
376
|
-
__self: !0,
|
|
377
|
-
__source: !0
|
|
378
|
-
}, tt, at, _e;
|
|
379
|
-
_e = {};
|
|
380
|
-
function Vt(e) {
|
|
381
|
-
if (X.call(e, "ref")) {
|
|
382
|
-
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
383
|
-
if (n && n.isReactWarning)
|
|
384
|
-
return !1;
|
|
385
|
-
}
|
|
386
|
-
return e.ref !== void 0;
|
|
387
|
-
}
|
|
388
|
-
function Wt(e) {
|
|
389
|
-
if (X.call(e, "key")) {
|
|
390
|
-
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
391
|
-
if (n && n.isReactWarning)
|
|
392
|
-
return !1;
|
|
393
|
-
}
|
|
394
|
-
return e.key !== void 0;
|
|
395
|
-
}
|
|
396
|
-
function zt(e, n) {
|
|
397
|
-
if (typeof e.ref == "string" && Z.current && n && Z.current.stateNode !== n) {
|
|
398
|
-
var l = C(Z.current.type);
|
|
399
|
-
_e[l] || (b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', C(Z.current.type), e.ref), _e[l] = !0);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
function Jt(e, n) {
|
|
403
|
-
{
|
|
404
|
-
var l = function() {
|
|
405
|
-
tt || (tt = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
406
|
-
};
|
|
407
|
-
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
408
|
-
get: l,
|
|
409
|
-
configurable: !0
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
function Yt(e, n) {
|
|
414
|
-
{
|
|
415
|
-
var l = function() {
|
|
416
|
-
at || (at = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
417
|
-
};
|
|
418
|
-
l.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
419
|
-
get: l,
|
|
420
|
-
configurable: !0
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
var Ht = function(e, n, l, d, y, j, x) {
|
|
425
|
-
var v = {
|
|
426
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
427
|
-
$$typeof: i,
|
|
428
|
-
// Built-in properties that belong on the element
|
|
429
|
-
type: e,
|
|
430
|
-
key: n,
|
|
431
|
-
ref: l,
|
|
432
|
-
props: x,
|
|
433
|
-
// Record the component responsible for creating this element.
|
|
434
|
-
_owner: j
|
|
435
|
-
};
|
|
436
|
-
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
437
|
-
configurable: !1,
|
|
438
|
-
enumerable: !1,
|
|
439
|
-
writable: !0,
|
|
440
|
-
value: !1
|
|
441
|
-
}), Object.defineProperty(v, "_self", {
|
|
442
|
-
configurable: !1,
|
|
443
|
-
enumerable: !1,
|
|
444
|
-
writable: !1,
|
|
445
|
-
value: d
|
|
446
|
-
}), Object.defineProperty(v, "_source", {
|
|
447
|
-
configurable: !1,
|
|
448
|
-
enumerable: !1,
|
|
449
|
-
writable: !1,
|
|
450
|
-
value: y
|
|
451
|
-
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
452
|
-
};
|
|
453
|
-
function Qt(e, n, l, d, y) {
|
|
454
|
-
{
|
|
455
|
-
var j, x = {}, v = null, P = null;
|
|
456
|
-
l !== void 0 && (et(l), v = "" + l), Wt(n) && (et(n.key), v = "" + n.key), Vt(n) && (P = n.ref, zt(n, y));
|
|
457
|
-
for (j in n)
|
|
458
|
-
X.call(n, j) && !Kt.hasOwnProperty(j) && (x[j] = n[j]);
|
|
459
|
-
if (e && e.defaultProps) {
|
|
460
|
-
var k = e.defaultProps;
|
|
461
|
-
for (j in k)
|
|
462
|
-
x[j] === void 0 && (x[j] = k[j]);
|
|
463
|
-
}
|
|
464
|
-
if (v || P) {
|
|
465
|
-
var N = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
466
|
-
v && Jt(x, N), P && Yt(x, N);
|
|
467
|
-
}
|
|
468
|
-
return Ht(e, v, P, y, d, Z.current, x);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
var Oe = R.ReactCurrentOwner, nt = R.ReactDebugCurrentFrame;
|
|
472
|
-
function K(e) {
|
|
473
|
-
if (e) {
|
|
474
|
-
var n = e._owner, l = he(e.type, e._source, n ? n.type : null);
|
|
475
|
-
nt.setExtraStackFrame(l);
|
|
476
|
-
} else
|
|
477
|
-
nt.setExtraStackFrame(null);
|
|
478
|
-
}
|
|
479
|
-
var Re;
|
|
480
|
-
Re = !1;
|
|
481
|
-
function De(e) {
|
|
482
|
-
return typeof e == "object" && e !== null && e.$$typeof === i;
|
|
483
|
-
}
|
|
484
|
-
function rt() {
|
|
485
|
-
{
|
|
486
|
-
if (Oe.current) {
|
|
487
|
-
var e = C(Oe.current.type);
|
|
488
|
-
if (e)
|
|
489
|
-
return `
|
|
490
|
-
|
|
491
|
-
Check the render method of \`` + e + "`.";
|
|
492
|
-
}
|
|
493
|
-
return "";
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
function Xt(e) {
|
|
497
|
-
return "";
|
|
498
|
-
}
|
|
499
|
-
var st = {};
|
|
500
|
-
function Zt(e) {
|
|
501
|
-
{
|
|
502
|
-
var n = rt();
|
|
503
|
-
if (!n) {
|
|
504
|
-
var l = typeof e == "string" ? e : e.displayName || e.name;
|
|
505
|
-
l && (n = `
|
|
506
|
-
|
|
507
|
-
Check the top-level render call using <` + l + ">.");
|
|
508
|
-
}
|
|
509
|
-
return n;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
function it(e, n) {
|
|
513
|
-
{
|
|
514
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
515
|
-
return;
|
|
516
|
-
e._store.validated = !0;
|
|
517
|
-
var l = Zt(n);
|
|
518
|
-
if (st[l])
|
|
519
|
-
return;
|
|
520
|
-
st[l] = !0;
|
|
521
|
-
var d = "";
|
|
522
|
-
e && e._owner && e._owner !== Oe.current && (d = " It was passed a child from " + C(e._owner.type) + "."), K(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, d), K(null);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
function ot(e, n) {
|
|
526
|
-
{
|
|
527
|
-
if (typeof e != "object")
|
|
528
|
-
return;
|
|
529
|
-
if (Pe(e))
|
|
530
|
-
for (var l = 0; l < e.length; l++) {
|
|
531
|
-
var d = e[l];
|
|
532
|
-
De(d) && it(d, n);
|
|
533
|
-
}
|
|
534
|
-
else if (De(e))
|
|
535
|
-
e._store && (e._store.validated = !0);
|
|
536
|
-
else if (e) {
|
|
537
|
-
var y = A(e);
|
|
538
|
-
if (typeof y == "function" && y !== e.entries)
|
|
539
|
-
for (var j = y.call(e), x; !(x = j.next()).done; )
|
|
540
|
-
De(x.value) && it(x.value, n);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
function ea(e) {
|
|
545
|
-
{
|
|
546
|
-
var n = e.type;
|
|
547
|
-
if (n == null || typeof n == "string")
|
|
548
|
-
return;
|
|
549
|
-
var l;
|
|
550
|
-
if (typeof n == "function")
|
|
551
|
-
l = n.propTypes;
|
|
552
|
-
else if (typeof n == "object" && (n.$$typeof === u || // Note: Memo only checks outer props here.
|
|
553
|
-
// Inner props are checked in the reconciler.
|
|
554
|
-
n.$$typeof === g))
|
|
555
|
-
l = n.propTypes;
|
|
556
|
-
else
|
|
557
|
-
return;
|
|
558
|
-
if (l) {
|
|
559
|
-
var d = C(n);
|
|
560
|
-
Gt(l, e.props, "prop", d, e);
|
|
561
|
-
} else if (n.PropTypes !== void 0 && !Re) {
|
|
562
|
-
Re = !0;
|
|
563
|
-
var y = C(n);
|
|
564
|
-
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", y || "Unknown");
|
|
565
|
-
}
|
|
566
|
-
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
function ta(e) {
|
|
570
|
-
{
|
|
571
|
-
for (var n = Object.keys(e.props), l = 0; l < n.length; l++) {
|
|
572
|
-
var d = n[l];
|
|
573
|
-
if (d !== "children" && d !== "key") {
|
|
574
|
-
K(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), K(null);
|
|
575
|
-
break;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
e.ref !== null && (K(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
var lt = {};
|
|
582
|
-
function ct(e, n, l, d, y, j) {
|
|
583
|
-
{
|
|
584
|
-
var x = Ee(e);
|
|
585
|
-
if (!x) {
|
|
586
|
-
var v = "";
|
|
587
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
588
|
-
var P = Xt();
|
|
589
|
-
P ? v += P : v += rt();
|
|
590
|
-
var k;
|
|
591
|
-
e === null ? k = "null" : Pe(e) ? k = "array" : e !== void 0 && e.$$typeof === i ? (k = "<" + (C(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : k = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, v);
|
|
592
|
-
}
|
|
593
|
-
var N = Qt(e, n, l, y, j);
|
|
594
|
-
if (N == null)
|
|
595
|
-
return N;
|
|
596
|
-
if (x) {
|
|
597
|
-
var L = n.children;
|
|
598
|
-
if (L !== void 0)
|
|
599
|
-
if (d)
|
|
600
|
-
if (Pe(L)) {
|
|
601
|
-
for (var V = 0; V < L.length; V++)
|
|
602
|
-
ot(L[V], e);
|
|
603
|
-
Object.freeze && Object.freeze(L);
|
|
604
|
-
} else
|
|
605
|
-
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
606
|
-
else
|
|
607
|
-
ot(L, e);
|
|
608
|
-
}
|
|
609
|
-
if (X.call(n, "key")) {
|
|
610
|
-
var $ = C(e), O = Object.keys(n).filter(function(oa) {
|
|
611
|
-
return oa !== "key";
|
|
612
|
-
}), Ae = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
613
|
-
if (!lt[$ + Ae]) {
|
|
614
|
-
var ia = O.length > 0 ? "{" + O.join(": ..., ") + ": ...}" : "{}";
|
|
615
|
-
b(`A props object containing a "key" prop is being spread into JSX:
|
|
616
|
-
let props = %s;
|
|
617
|
-
<%s {...props} />
|
|
618
|
-
React keys must be passed directly to JSX without using spread:
|
|
619
|
-
let props = %s;
|
|
620
|
-
<%s key={someKey} {...props} />`, Ae, $, ia, $), lt[$ + Ae] = !0;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
return e === a ? ta(N) : ea(N), N;
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
function aa(e, n, l) {
|
|
627
|
-
return ct(e, n, l, !0);
|
|
628
|
-
}
|
|
629
|
-
function na(e, n, l) {
|
|
630
|
-
return ct(e, n, l, !1);
|
|
631
|
-
}
|
|
632
|
-
var ra = na, sa = aa;
|
|
633
|
-
te.Fragment = a, te.jsx = ra, te.jsxs = sa;
|
|
634
|
-
}()), te;
|
|
635
|
-
}
|
|
636
|
-
process.env.NODE_ENV === "production" ? Ie.exports = Ra() : Ie.exports = Da();
|
|
637
|
-
var t = Ie.exports;
|
|
638
|
-
const Aa = (r, i) => {
|
|
639
|
-
const a = z().getQueryData(["builder_props"]);
|
|
640
|
-
return G(a, r, i);
|
|
641
|
-
}, D = () => Aa("apiUrl", "/chai/api");
|
|
642
|
-
function Y() {
|
|
643
|
-
const [r, i] = I(
|
|
644
|
-
new URLSearchParams(window.location.search)
|
|
645
|
-
);
|
|
646
|
-
return Be(() => {
|
|
647
|
-
const o = () => {
|
|
648
|
-
i(new URLSearchParams(window.location.search));
|
|
649
|
-
};
|
|
650
|
-
return window.addEventListener("popstate", o), () => {
|
|
651
|
-
window.removeEventListener("popstate", o);
|
|
652
|
-
};
|
|
653
|
-
}, []), [r, i];
|
|
654
|
-
}
|
|
655
|
-
const Tt = () => {
|
|
656
|
-
const [r] = Y(), i = r.get("page"), o = D();
|
|
657
|
-
return ne({
|
|
658
|
-
queryKey: ["page", i],
|
|
659
|
-
initialData: [],
|
|
660
|
-
queryFn: async () => (await (await fetch(`${o}`, {
|
|
661
|
-
method: "POST",
|
|
662
|
-
headers: { "Content-Type": "application/json" },
|
|
663
|
-
body: JSON.stringify({
|
|
664
|
-
action: "GET_PAGE",
|
|
665
|
-
data: { id: i, draft: !0 }
|
|
666
|
-
})
|
|
667
|
-
})).json()).blocks ?? [],
|
|
668
|
-
enabled: !!i
|
|
669
|
-
});
|
|
670
|
-
}, Pt = () => {
|
|
671
|
-
const r = D(), i = z(), { toast: o } = J(), { data: a } = Tt(), [s] = Y(), w = s.get("page"), c = G(
|
|
672
|
-
se(a, { _type: "@chai/ai-context" }),
|
|
673
|
-
"_value",
|
|
674
|
-
""
|
|
675
|
-
), { mutateAsync: p } = re({
|
|
676
|
-
mutationFn: async ({ page: u, aiContext: m }) => {
|
|
677
|
-
const h = {
|
|
678
|
-
_type: "@chai/ai-context",
|
|
679
|
-
_value: Fe(m) ? m : ""
|
|
680
|
-
}, g = ae(
|
|
681
|
-
a,
|
|
682
|
-
(S) => (S == null ? void 0 : S._type) !== h._type
|
|
683
|
-
);
|
|
684
|
-
return g.push(h), await fetch(r, {
|
|
685
|
-
method: "POST",
|
|
686
|
-
headers: { "Content-Type": "application/json" },
|
|
687
|
-
body: JSON.stringify({
|
|
688
|
-
action: "UPDATE_PAGE",
|
|
689
|
-
data: { id: u, blocks: g }
|
|
690
|
-
})
|
|
691
|
-
});
|
|
692
|
-
},
|
|
693
|
-
onSuccess: (u, { aiContext: m }) => {
|
|
694
|
-
i.setQueryData(["page", w], () => {
|
|
695
|
-
const h = {
|
|
696
|
-
_type: "@chai/ai-context",
|
|
697
|
-
_value: Fe(m) ? m : ""
|
|
698
|
-
}, g = ae(
|
|
699
|
-
a,
|
|
700
|
-
(f) => (f == null ? void 0 : f._type) !== h._type
|
|
701
|
-
);
|
|
702
|
-
return g.push(h), g;
|
|
703
|
-
}), o({ title: "AI context updated successfully." });
|
|
704
|
-
},
|
|
705
|
-
onError: (u) => {
|
|
706
|
-
o({
|
|
707
|
-
variant: "destructive",
|
|
708
|
-
title: "Failed to update AI context",
|
|
709
|
-
description: u.message
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
return { aiContext: c, updateAiContext: p };
|
|
714
|
-
}, Fa = () => {
|
|
715
|
-
const r = D(), { aiContext: i } = Pt();
|
|
716
|
-
return la(
|
|
717
|
-
async (o, a, s, w) => {
|
|
718
|
-
const p = await (await fetch(r, {
|
|
719
|
-
method: "POST",
|
|
720
|
-
headers: {
|
|
721
|
-
"Content-Type": "application/json"
|
|
722
|
-
},
|
|
723
|
-
body: JSON.stringify({
|
|
724
|
-
action: "ASK_AI",
|
|
725
|
-
data: { type: o, prompt: a, blocks: s, aiContext: i, lang: w }
|
|
726
|
-
})
|
|
727
|
-
})).json();
|
|
728
|
-
return console.log("data", p), p.error ? { error: new Error(p.error) } : p;
|
|
729
|
-
},
|
|
730
|
-
[r, i]
|
|
731
|
-
);
|
|
732
|
-
}, La = () => {
|
|
733
|
-
const r = D(), { toast: i } = J(), o = z();
|
|
734
|
-
return { getUILibraryBlock: async (c, p) => {
|
|
735
|
-
const h = (await (await fetch(
|
|
736
|
-
c.url + (p.path ? "/blocks/" + p.path : "/" + p.uuid + ".html")
|
|
737
|
-
)).text()).replace(/---([\s\S]*?)---/g, "");
|
|
738
|
-
return da(`${h}`);
|
|
739
|
-
}, getUILibraryBlocks: async (c) => {
|
|
740
|
-
try {
|
|
741
|
-
return (await (await fetch(c.url + "/blocks.json")).json()).map((m) => ({
|
|
742
|
-
...m,
|
|
743
|
-
preview: c.url.replace("chaiblocks", "") + m.preview
|
|
744
|
-
}));
|
|
745
|
-
} catch (p) {
|
|
746
|
-
return console.error(p), [];
|
|
747
|
-
}
|
|
748
|
-
}, onSave: async ({
|
|
749
|
-
page: c,
|
|
750
|
-
blocks: p
|
|
751
|
-
}) => {
|
|
752
|
-
try {
|
|
753
|
-
return (await fetch(r, {
|
|
754
|
-
method: "POST",
|
|
755
|
-
headers: { "Content-Type": "application/json" },
|
|
756
|
-
body: JSON.stringify({
|
|
757
|
-
action: "UPDATE_PAGE",
|
|
758
|
-
data: { id: c, blocks: p }
|
|
759
|
-
})
|
|
760
|
-
})).ok ? (o.setQueryData(["page", c], p), i({
|
|
761
|
-
title: "Success",
|
|
762
|
-
description: "Page saved successfully",
|
|
763
|
-
variant: "default"
|
|
764
|
-
}), !0) : new Error("Failed to save blocks");
|
|
765
|
-
} catch (u) {
|
|
766
|
-
return u;
|
|
767
|
-
}
|
|
768
|
-
} };
|
|
769
|
-
}, qe = () => {
|
|
770
|
-
const r = D();
|
|
771
|
-
return ne({
|
|
772
|
-
queryKey: ["project-pages"],
|
|
773
|
-
staleTime: 1e3 * 60 * 5,
|
|
774
|
-
queryFn: async () => await (await fetch(r, {
|
|
775
|
-
method: "POST",
|
|
776
|
-
headers: {
|
|
777
|
-
"Content-Type": "application/json"
|
|
778
|
-
},
|
|
779
|
-
body: JSON.stringify({
|
|
780
|
-
action: "GET_PROJECT_PAGES"
|
|
781
|
-
})
|
|
782
|
-
})).json()
|
|
783
|
-
});
|
|
784
|
-
}, _t = () => {
|
|
785
|
-
const [r] = Y(), i = r.get("page"), { data: o, isFetching: a } = qe();
|
|
786
|
-
return { data: ye(
|
|
787
|
-
() => se(o, { id: i }) || {},
|
|
788
|
-
[o, i]
|
|
789
|
-
), isFetching: a };
|
|
790
|
-
}, Ia = () => ne({
|
|
791
|
-
queryKey: ["uiLibraries"],
|
|
792
|
-
initialData: [],
|
|
793
|
-
queryFn: async () => [
|
|
794
|
-
{
|
|
795
|
-
uuid: "meraki-ui",
|
|
796
|
-
name: "Meraki UI",
|
|
797
|
-
url: "https://chai-ui-blocks.vercel.app"
|
|
798
|
-
},
|
|
799
|
-
{
|
|
800
|
-
uuid: "chaiblocks",
|
|
801
|
-
name: "UI Blocks",
|
|
802
|
-
url: "https://chaibuilder.com/chaiblocks"
|
|
803
|
-
}
|
|
804
|
-
]
|
|
805
|
-
}), Ba = (r) => ye(() => {
|
|
806
|
-
if (!r || W(r))
|
|
807
|
-
return {
|
|
808
|
-
blocks: [],
|
|
809
|
-
theme: {}
|
|
810
|
-
};
|
|
811
|
-
const i = se(r, { _type: "@chai/theme" }), o = G(i, "_value", {}) || {}, a = ae(
|
|
812
|
-
r,
|
|
813
|
-
(s) => !xe(s == null ? void 0 : s._type, "@chai/")
|
|
814
|
-
);
|
|
815
|
-
return { theme: o, blocks: a };
|
|
816
|
-
}, [r]), Ot = () => {
|
|
817
|
-
const r = D();
|
|
818
|
-
return ne({
|
|
819
|
-
queryKey: ["project-config"],
|
|
820
|
-
initialData: { theme: {} },
|
|
821
|
-
queryFn: async () => await (await fetch(r, {
|
|
822
|
-
method: "POST",
|
|
823
|
-
headers: {
|
|
824
|
-
"Content-Type": "application/json"
|
|
825
|
-
},
|
|
826
|
-
body: JSON.stringify({ action: "GET_PROJECT_CONFIG" })
|
|
827
|
-
})).json()
|
|
828
|
-
});
|
|
829
|
-
}, Ua = () => {
|
|
830
|
-
const { data: r } = qe(), i = D();
|
|
831
|
-
return {
|
|
832
|
-
getGlobalBlocks: async () => {
|
|
833
|
-
const o = {};
|
|
834
|
-
for (const a of r ?? [])
|
|
835
|
-
W(a == null ? void 0 : a.slug) && (o[a.id] = {
|
|
836
|
-
name: ka(a.name ?? a.slug),
|
|
837
|
-
description: ""
|
|
838
|
-
});
|
|
839
|
-
return o;
|
|
840
|
-
},
|
|
841
|
-
getGlobalBlockBlocks: async (o) => o ? (await (await fetch(`${i}`, {
|
|
842
|
-
method: "POST",
|
|
843
|
-
headers: { "Content-Type": "application/json" },
|
|
844
|
-
body: JSON.stringify({
|
|
845
|
-
action: "GET_PAGE",
|
|
846
|
-
data: { id: o, draft: !0 }
|
|
847
|
-
})
|
|
848
|
-
})).json()).blocks : []
|
|
849
|
-
};
|
|
850
|
-
}, Ga = () => {
|
|
851
|
-
const r = D();
|
|
852
|
-
return { uploadFile: async (o) => {
|
|
853
|
-
const a = new FormData();
|
|
854
|
-
return a.append("action", "UPLOAD_FILE"), a.append("file", o), (await fetch(r, {
|
|
855
|
-
method: "POST",
|
|
856
|
-
body: a
|
|
857
|
-
})).json();
|
|
858
|
-
} };
|
|
859
|
-
}, qa = () => {
|
|
860
|
-
const r = D(), { toast: i } = J();
|
|
861
|
-
return re({
|
|
862
|
-
mutationFn: async (o) => (await fetch(`${r}`, {
|
|
863
|
-
method: "POST",
|
|
864
|
-
headers: { "Content-Type": "application/json" },
|
|
865
|
-
body: JSON.stringify({
|
|
866
|
-
action: "PUBLISH_PAGE",
|
|
867
|
-
data: { id: o }
|
|
868
|
-
})
|
|
869
|
-
})).json(),
|
|
870
|
-
onSuccess: () => {
|
|
871
|
-
i({
|
|
872
|
-
title: "Pages published",
|
|
873
|
-
description: "Your page has been published"
|
|
874
|
-
});
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
}, Me = () => {
|
|
878
|
-
const r = D(), [i] = Y(), o = i.get("page");
|
|
879
|
-
return ne({
|
|
880
|
-
queryKey: ["language-pages", o],
|
|
881
|
-
initialData: [],
|
|
882
|
-
queryFn: async () => {
|
|
883
|
-
if (!o) return null;
|
|
884
|
-
const s = await (await fetch(r, {
|
|
885
|
-
method: "POST",
|
|
886
|
-
headers: { "Content-Type": "application/json" },
|
|
887
|
-
body: JSON.stringify({
|
|
888
|
-
action: "GET_LANGUAGE_PAGES",
|
|
889
|
-
data: { id: o }
|
|
890
|
-
})
|
|
891
|
-
})).json();
|
|
892
|
-
return Na(Ta(s, "primaryPage"));
|
|
893
|
-
}
|
|
894
|
-
});
|
|
895
|
-
}, be = {
|
|
896
|
-
ab: "Abkhazian",
|
|
897
|
-
aa: "Afar",
|
|
898
|
-
af: "Afrikaans",
|
|
899
|
-
ak: "Akan",
|
|
900
|
-
sq: "Albanian",
|
|
901
|
-
am: "Amharic",
|
|
902
|
-
ar: "Arabic",
|
|
903
|
-
an: "Aragonese",
|
|
904
|
-
hy: "Armenian",
|
|
905
|
-
as: "Assamese",
|
|
906
|
-
av: "Avaric",
|
|
907
|
-
ae: "Avestan",
|
|
908
|
-
ay: "Aymara",
|
|
909
|
-
az: "Azerbaijani",
|
|
910
|
-
bm: "Bambara",
|
|
911
|
-
ba: "Bashkir",
|
|
912
|
-
eu: "Basque",
|
|
913
|
-
be: "Belarusian",
|
|
914
|
-
bn: "Bengali",
|
|
915
|
-
bh: "Bihari",
|
|
916
|
-
bi: "Bislama",
|
|
917
|
-
bs: "Bosnian",
|
|
918
|
-
br: "Breton",
|
|
919
|
-
bg: "Bulgarian",
|
|
920
|
-
my: "Burmese",
|
|
921
|
-
ca: "Catalan",
|
|
922
|
-
ch: "Chamorro",
|
|
923
|
-
ce: "Chechen",
|
|
924
|
-
ny: "Chichewa",
|
|
925
|
-
zh: "Chinese",
|
|
926
|
-
"zh-Hans": "Chinese (Simplified)",
|
|
927
|
-
"zh-Hant": "Chinese (Traditional)",
|
|
928
|
-
cv: "Chuvash",
|
|
929
|
-
kw: "Cornish",
|
|
930
|
-
co: "Corsican",
|
|
931
|
-
cr: "Cree",
|
|
932
|
-
hr: "Croatian",
|
|
933
|
-
cs: "Czech",
|
|
934
|
-
da: "Danish",
|
|
935
|
-
dv: "Maldivian",
|
|
936
|
-
nl: "Dutch",
|
|
937
|
-
dz: "Dzongkha",
|
|
938
|
-
en: "English",
|
|
939
|
-
eo: "Esperanto",
|
|
940
|
-
et: "Estonian",
|
|
941
|
-
ee: "Ewe",
|
|
942
|
-
fo: "Faroese",
|
|
943
|
-
fj: "Fijian",
|
|
944
|
-
fi: "Finnish",
|
|
945
|
-
fr: "French",
|
|
946
|
-
ff: "Fula, Pular",
|
|
947
|
-
gl: "Galician",
|
|
948
|
-
gd: "Gaelic (Scottish)",
|
|
949
|
-
gv: "Manx",
|
|
950
|
-
ka: "Georgian",
|
|
951
|
-
de: "German",
|
|
952
|
-
el: "Greek",
|
|
953
|
-
kl: "Kalaallisut",
|
|
954
|
-
gn: "Guarani",
|
|
955
|
-
gu: "Gujarati",
|
|
956
|
-
ht: "Haitian Creole",
|
|
957
|
-
ha: "Hausa",
|
|
958
|
-
he: "Hebrew",
|
|
959
|
-
hz: "Herero",
|
|
960
|
-
hi: "Hindi",
|
|
961
|
-
ho: "Hiri Motu",
|
|
962
|
-
hu: "Hungarian",
|
|
963
|
-
is: "Icelandic",
|
|
964
|
-
io: "Ido",
|
|
965
|
-
ig: "Igbo",
|
|
966
|
-
id: "Indonesian",
|
|
967
|
-
ia: "Interlingua",
|
|
968
|
-
ie: "Interlingue",
|
|
969
|
-
iu: "Inuktitut",
|
|
970
|
-
ik: "Inupiak",
|
|
971
|
-
ga: "Irish",
|
|
972
|
-
it: "Italian",
|
|
973
|
-
ja: "Japanese",
|
|
974
|
-
jv: "Javanese",
|
|
975
|
-
kn: "Kannada",
|
|
976
|
-
kr: "Kanuri",
|
|
977
|
-
ks: "Kashmiri",
|
|
978
|
-
kk: "Kazakh",
|
|
979
|
-
km: "Khmer",
|
|
980
|
-
ki: "Kikuyu",
|
|
981
|
-
rw: "Kinyarwanda",
|
|
982
|
-
rn: "Kirundi",
|
|
983
|
-
ky: "Kyrgyz",
|
|
984
|
-
kv: "Komi",
|
|
985
|
-
kg: "Kongo",
|
|
986
|
-
ko: "Korean",
|
|
987
|
-
ku: "Kurdish",
|
|
988
|
-
kj: "Kwanyama",
|
|
989
|
-
lo: "Lao",
|
|
990
|
-
la: "Latin",
|
|
991
|
-
lv: "Latvian",
|
|
992
|
-
li: "Limburgish",
|
|
993
|
-
ln: "Lingala",
|
|
994
|
-
lt: "Lithuanian",
|
|
995
|
-
lu: "Luga-Katanga",
|
|
996
|
-
lg: "Luganda, Ganda",
|
|
997
|
-
lb: "Luxembourgish",
|
|
998
|
-
mk: "Macedonian",
|
|
999
|
-
mg: "Malagasy",
|
|
1000
|
-
ms: "Malay",
|
|
1001
|
-
ml: "Malayalam",
|
|
1002
|
-
mt: "Maltese",
|
|
1003
|
-
mi: "Maori",
|
|
1004
|
-
mr: "Marathi",
|
|
1005
|
-
mh: "Marshallese",
|
|
1006
|
-
mo: "Moldavian",
|
|
1007
|
-
mn: "Mongolian",
|
|
1008
|
-
na: "Nauru",
|
|
1009
|
-
nv: "Navajo",
|
|
1010
|
-
ng: "Ndonga",
|
|
1011
|
-
nd: "Northern Ndebele",
|
|
1012
|
-
ne: "Nepali",
|
|
1013
|
-
no: "Norwegian",
|
|
1014
|
-
nb: "Norwegian bokmål",
|
|
1015
|
-
nn: "Norwegian nynorsk",
|
|
1016
|
-
ii: "Sichuan Yi",
|
|
1017
|
-
oc: "Occitan",
|
|
1018
|
-
oj: "Ojibwe",
|
|
1019
|
-
cu: "Old Church Slavonic",
|
|
1020
|
-
or: "Oriya",
|
|
1021
|
-
om: "Oromo",
|
|
1022
|
-
os: "Ossetian",
|
|
1023
|
-
pi: "Pāli",
|
|
1024
|
-
ps: "Pashto, Pushto",
|
|
1025
|
-
fa: "Persian (Farsi)",
|
|
1026
|
-
pl: "Polish",
|
|
1027
|
-
pt: "Portuguese",
|
|
1028
|
-
pa: "Punjabi (Eastern)",
|
|
1029
|
-
qu: "Quechua",
|
|
1030
|
-
rm: "Romansh",
|
|
1031
|
-
ro: "Romanian",
|
|
1032
|
-
ru: "Russian",
|
|
1033
|
-
se: "Sami",
|
|
1034
|
-
sm: "Samoan",
|
|
1035
|
-
sg: "Sango",
|
|
1036
|
-
sa: "Sanskrit",
|
|
1037
|
-
sr: "Serbian",
|
|
1038
|
-
sh: "Serbo-Croatian",
|
|
1039
|
-
st: "Sesotho",
|
|
1040
|
-
tn: "Setswana",
|
|
1041
|
-
sn: "Shona",
|
|
1042
|
-
sd: "Sindhi",
|
|
1043
|
-
si: "Sinhalese",
|
|
1044
|
-
ss: "Swati",
|
|
1045
|
-
sk: "Slovak",
|
|
1046
|
-
sl: "Slovenian",
|
|
1047
|
-
so: "Somali",
|
|
1048
|
-
nr: "Southern Ndebele",
|
|
1049
|
-
es: "Spanish",
|
|
1050
|
-
su: "Sundanese",
|
|
1051
|
-
sw: "Swahili (Kiswahili)",
|
|
1052
|
-
sv: "Swedish",
|
|
1053
|
-
tl: "Tagalog",
|
|
1054
|
-
ty: "Tahitian",
|
|
1055
|
-
tg: "Tajik",
|
|
1056
|
-
ta: "Tamil",
|
|
1057
|
-
tt: "Tatar",
|
|
1058
|
-
te: "Telugu",
|
|
1059
|
-
th: "Thai",
|
|
1060
|
-
bo: "Tibetan",
|
|
1061
|
-
ti: "Tigrinya",
|
|
1062
|
-
to: "Tonga",
|
|
1063
|
-
ts: "Tsonga",
|
|
1064
|
-
tr: "Turkish",
|
|
1065
|
-
tk: "Turkmen",
|
|
1066
|
-
tw: "Twi",
|
|
1067
|
-
ug: "Uyghur",
|
|
1068
|
-
uk: "Ukrainian",
|
|
1069
|
-
ur: "Urdu",
|
|
1070
|
-
uz: "Uzbek",
|
|
1071
|
-
ve: "Venda",
|
|
1072
|
-
vi: "Vietnamese",
|
|
1073
|
-
vo: "Volapük",
|
|
1074
|
-
wa: "Wallon",
|
|
1075
|
-
cy: "Welsh",
|
|
1076
|
-
wo: "Wolof",
|
|
1077
|
-
fy: "Western Frisian",
|
|
1078
|
-
xh: "Xhosa",
|
|
1079
|
-
yi: "Yiddish",
|
|
1080
|
-
yo: "Yoruba",
|
|
1081
|
-
za: "Zhuang, Chuang",
|
|
1082
|
-
zu: "Zulu"
|
|
1083
|
-
}, Rt = () => {
|
|
1084
|
-
const r = D(), i = z(), { toast: o } = J();
|
|
1085
|
-
return re({
|
|
1086
|
-
mutationFn: async (a) => await (await fetch(r, {
|
|
1087
|
-
method: "POST",
|
|
1088
|
-
headers: {
|
|
1089
|
-
"Content-Type": "application/json"
|
|
1090
|
-
},
|
|
1091
|
-
body: JSON.stringify({
|
|
1092
|
-
action: "CREATE_PAGE",
|
|
1093
|
-
data: a
|
|
1094
|
-
})
|
|
1095
|
-
})).json(),
|
|
1096
|
-
onSuccess: (a, s) => {
|
|
1097
|
-
s && (s != null && s.primaryPage) ? i.invalidateQueries({
|
|
1098
|
-
queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
|
|
1099
|
-
}) : i.invalidateQueries({ queryKey: ["project-pages"] }), o({
|
|
1100
|
-
title: `New ${s.global ? "global block" : "page"} added successfully.`
|
|
1101
|
-
});
|
|
1102
|
-
},
|
|
1103
|
-
onError: (a, s) => {
|
|
1104
|
-
o({
|
|
1105
|
-
variant: "destructive",
|
|
1106
|
-
title: `Failed to add new ${s.global ? "global block" : "page"}.`,
|
|
1107
|
-
description: a.message
|
|
1108
|
-
});
|
|
1109
|
-
}
|
|
1110
|
-
});
|
|
1111
|
-
}, $e = () => {
|
|
1112
|
-
const r = D(), i = z(), { toast: o } = J();
|
|
1113
|
-
return re({
|
|
1114
|
-
mutationFn: async (a) => (await fetch(r, {
|
|
1115
|
-
method: "POST",
|
|
1116
|
-
headers: {
|
|
1117
|
-
"Content-Type": "application/json"
|
|
1118
|
-
},
|
|
1119
|
-
body: JSON.stringify({
|
|
1120
|
-
action: "UPDATE_PAGE",
|
|
1121
|
-
data: a
|
|
1122
|
-
})
|
|
1123
|
-
})).json(),
|
|
1124
|
-
onSuccess: (a, s) => {
|
|
1125
|
-
s && (s != null && s.primaryPage || s != null && s.seo) ? i.invalidateQueries({
|
|
1126
|
-
queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
|
|
1127
|
-
}) : i.invalidateQueries({ queryKey: ["project-pages"] }), s != null && s.seo ? o({
|
|
1128
|
-
title: "SEO Settings updated successfully."
|
|
1129
|
-
}) : o({
|
|
1130
|
-
title: `${s.global ? "Global block" : "Page"} updated successfully.`
|
|
1131
|
-
});
|
|
1132
|
-
},
|
|
1133
|
-
onError: (a, s) => {
|
|
1134
|
-
o({
|
|
1135
|
-
variant: "destructive",
|
|
1136
|
-
title: `Failed to update ${s.global ? "global block" : "page"}.`,
|
|
1137
|
-
description: a.message
|
|
1138
|
-
});
|
|
1139
|
-
}
|
|
1140
|
-
});
|
|
1141
|
-
}, Dt = () => {
|
|
1142
|
-
const r = D(), i = z(), { toast: o } = J();
|
|
1143
|
-
return re({
|
|
1144
|
-
mutationFn: async (a) => (await fetch(r, {
|
|
1145
|
-
method: "POST",
|
|
1146
|
-
headers: {
|
|
1147
|
-
"Content-Type": "application/json"
|
|
1148
|
-
},
|
|
1149
|
-
body: JSON.stringify({
|
|
1150
|
-
action: "DELETE_PAGE",
|
|
1151
|
-
data: { id: a == null ? void 0 : a.id }
|
|
1152
|
-
})
|
|
1153
|
-
})).json(),
|
|
1154
|
-
onSuccess: (a, s) => {
|
|
1155
|
-
s && (s != null && s.primaryPage) ? i.invalidateQueries({
|
|
1156
|
-
queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
|
|
1157
|
-
}) : i.invalidateQueries({ queryKey: ["project-pages"] }), o({
|
|
1158
|
-
title: `${s.global ? "Global block" : "Page"} deleted successfully.`
|
|
1159
|
-
});
|
|
1160
|
-
},
|
|
1161
|
-
onError: (a, s) => {
|
|
1162
|
-
o({
|
|
1163
|
-
variant: "destructive",
|
|
1164
|
-
title: `Failed to delete ${s.global ? "global block" : "page"}.`,
|
|
1165
|
-
description: a.message
|
|
1166
|
-
});
|
|
1167
|
-
}
|
|
1168
|
-
});
|
|
1169
|
-
}, Ma = () => {
|
|
1170
|
-
const { selectedLang: r } = Ue(), { data: i, isFetching: o } = Me();
|
|
1171
|
-
return { data: ye(() => se(i, { lang: r || "" }) || {}, [i, r]), isFetching: o };
|
|
1172
|
-
}, At = () => {
|
|
1173
|
-
const { data: r, isFetching: i } = Ma(), o = r == null ? void 0 : r.seo, [a, s] = I({
|
|
1174
|
-
seoTitle: "",
|
|
1175
|
-
seoDescription: "",
|
|
1176
|
-
cononicalUrl: "",
|
|
1177
|
-
noIndex: !1,
|
|
1178
|
-
noFollow: "",
|
|
1179
|
-
ogTitle: "",
|
|
1180
|
-
ogDescription: "",
|
|
1181
|
-
ogImage: "",
|
|
1182
|
-
searchTitle: "",
|
|
1183
|
-
searchDescription: "",
|
|
1184
|
-
jsonLD: "",
|
|
1185
|
-
...o
|
|
1186
|
-
}), w = ca({ initial: a, updated: a }), { selectedLang: c, fallbackLang: p } = Ue(), u = c.length ? c : p, { mutate: m, isPending: h } = $e(), g = h;
|
|
1187
|
-
Be(() => {
|
|
1188
|
-
!i && o && s({
|
|
1189
|
-
seoTitle: "",
|
|
1190
|
-
seoDescription: "",
|
|
1191
|
-
cononicalUrl: "",
|
|
1192
|
-
noIndex: !1,
|
|
1193
|
-
noFollow: "",
|
|
1194
|
-
ogTitle: "",
|
|
1195
|
-
ogDescription: "",
|
|
1196
|
-
ogImage: "",
|
|
1197
|
-
searchTitle: "",
|
|
1198
|
-
searchDescription: "",
|
|
1199
|
-
jsonLD: "",
|
|
1200
|
-
...o
|
|
1201
|
-
});
|
|
1202
|
-
}, [i, o]);
|
|
1203
|
-
const f = async () => {
|
|
1204
|
-
m({ id: r == null ? void 0 : r.id, seo: a }), w.current.initial = a, w.current.updated = a;
|
|
1205
|
-
}, S = () => {
|
|
1206
|
-
s({
|
|
1207
|
-
...a,
|
|
1208
|
-
ogTitle: a.seoTitle,
|
|
1209
|
-
ogDescription: a.seoDescription
|
|
1210
|
-
});
|
|
1211
|
-
}, T = () => {
|
|
1212
|
-
s({
|
|
1213
|
-
...a,
|
|
1214
|
-
searchTitle: a.ogTitle,
|
|
1215
|
-
searchDescription: a.ogDescription
|
|
1216
|
-
});
|
|
1217
|
-
}, E = (A) => {
|
|
1218
|
-
const R = {
|
|
1219
|
-
...a,
|
|
1220
|
-
[A.target.name]: A.target.name === "noIndex" ? A.target.checked : A.target.value
|
|
1221
|
-
};
|
|
1222
|
-
s(R), w.current.updated = R;
|
|
1223
|
-
};
|
|
1224
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "relative pb-40", children: [
|
|
1225
|
-
/* @__PURE__ */ t.jsxs("div", { className: "text-xs bg-gray-100 p-2 rounded-md text-center", children: [
|
|
1226
|
-
"Current language:",
|
|
1227
|
-
" ",
|
|
1228
|
-
/* @__PURE__ */ t.jsx("span", { className: "text-blue-500 font-semibold", children: G(be, u, u) })
|
|
1229
|
-
] }),
|
|
1230
|
-
/* @__PURE__ */ t.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ t.jsxs(ga, { type: "multiple", defaultValue: ["page"], children: [
|
|
1231
|
-
/* @__PURE__ */ t.jsxs(pe, { value: "page", children: [
|
|
1232
|
-
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "Seo Page" }),
|
|
1233
|
-
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
|
|
1234
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1235
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoTitle", children: "SEO Title" }),
|
|
1236
|
-
/* @__PURE__ */ t.jsx(
|
|
1237
|
-
U,
|
|
1238
|
-
{
|
|
1239
|
-
type: "text",
|
|
1240
|
-
id: "seoTitle",
|
|
1241
|
-
name: "seoTitle",
|
|
1242
|
-
value: a.seoTitle,
|
|
1243
|
-
onChange: E,
|
|
1244
|
-
disabled: g,
|
|
1245
|
-
placeholder: "Enter SEO title"
|
|
1246
|
-
}
|
|
1247
|
-
),
|
|
1248
|
-
/* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The title should be between 10 and 60 characters." })
|
|
1249
|
-
] }),
|
|
1250
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1251
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoDescription", children: "SEO Description" }),
|
|
1252
|
-
/* @__PURE__ */ t.jsx(
|
|
1253
|
-
ve,
|
|
1254
|
-
{
|
|
1255
|
-
id: "seoDescription",
|
|
1256
|
-
name: "seoDescription",
|
|
1257
|
-
value: a.seoDescription,
|
|
1258
|
-
onChange: E,
|
|
1259
|
-
disabled: g,
|
|
1260
|
-
placeholder: "Enter SEO description"
|
|
1261
|
-
}
|
|
1262
|
-
),
|
|
1263
|
-
/* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The description should be between 50 and 160 characters." })
|
|
1264
|
-
] }),
|
|
1265
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1266
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoTitle", children: "Canonical URL" }),
|
|
1267
|
-
/* @__PURE__ */ t.jsx(
|
|
1268
|
-
U,
|
|
1269
|
-
{
|
|
1270
|
-
type: "text",
|
|
1271
|
-
id: "canonicalUrl",
|
|
1272
|
-
name: "canonicalUrl",
|
|
1273
|
-
value: a.canonicalUrl,
|
|
1274
|
-
onChange: E,
|
|
1275
|
-
disabled: g,
|
|
1276
|
-
placeholder: "Enter Canonical URL"
|
|
1277
|
-
}
|
|
1278
|
-
)
|
|
1279
|
-
] }),
|
|
1280
|
-
/* @__PURE__ */ t.jsxs("div", { className: "", children: [
|
|
1281
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1282
|
-
/* @__PURE__ */ t.jsx(
|
|
1283
|
-
U,
|
|
1284
|
-
{
|
|
1285
|
-
type: "checkbox",
|
|
1286
|
-
id: "noIndex",
|
|
1287
|
-
name: "noIndex",
|
|
1288
|
-
checked: a.noIndex,
|
|
1289
|
-
onChange: E,
|
|
1290
|
-
disabled: g,
|
|
1291
|
-
className: "h-4 w-4"
|
|
1292
|
-
}
|
|
1293
|
-
),
|
|
1294
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Index" })
|
|
1295
|
-
] }),
|
|
1296
|
-
/* @__PURE__ */ t.jsx("p", { className: "mt-2 text-[10px] font-light text-gray-400", children: "Check this if you don't want search engines to index this page." })
|
|
1297
|
-
] }),
|
|
1298
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1299
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoTitle", children: "No Follow" }),
|
|
1300
|
-
/* @__PURE__ */ t.jsx(
|
|
1301
|
-
U,
|
|
1302
|
-
{
|
|
1303
|
-
type: "text",
|
|
1304
|
-
id: "noFollow",
|
|
1305
|
-
name: "noFollow",
|
|
1306
|
-
value: a.noFollow,
|
|
1307
|
-
onChange: E,
|
|
1308
|
-
disabled: g,
|
|
1309
|
-
placeholder: "Enter No follow"
|
|
1310
|
-
}
|
|
1311
|
-
)
|
|
1312
|
-
] })
|
|
1313
|
-
] }) })
|
|
1314
|
-
] }),
|
|
1315
|
-
/* @__PURE__ */ t.jsxs(pe, { value: "og", children: [
|
|
1316
|
-
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "OG" }),
|
|
1317
|
-
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
|
|
1318
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ t.jsx(
|
|
1319
|
-
B,
|
|
1320
|
-
{
|
|
1321
|
-
type: "button",
|
|
1322
|
-
variant: "outline",
|
|
1323
|
-
size: "sm",
|
|
1324
|
-
onClick: S,
|
|
1325
|
-
children: "Copy from SEO Settings"
|
|
1326
|
-
}
|
|
1327
|
-
) }),
|
|
1328
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1329
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "ogTitle", children: "OG Title" }),
|
|
1330
|
-
/* @__PURE__ */ t.jsx(
|
|
1331
|
-
U,
|
|
1332
|
-
{
|
|
1333
|
-
type: "text",
|
|
1334
|
-
id: "ogTitle",
|
|
1335
|
-
name: "ogTitle",
|
|
1336
|
-
value: a.ogTitle,
|
|
1337
|
-
onChange: E,
|
|
1338
|
-
disabled: g,
|
|
1339
|
-
placeholder: "Enter OG title"
|
|
1340
|
-
}
|
|
1341
|
-
),
|
|
1342
|
-
/* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG title should be between 10 and 60 characters." })
|
|
1343
|
-
] }),
|
|
1344
|
-
/* @__PURE__ */ t.jsxs("div", { className: "mt-4", children: [
|
|
1345
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "ogDescription", children: "OG Description" }),
|
|
1346
|
-
/* @__PURE__ */ t.jsx(
|
|
1347
|
-
ve,
|
|
1348
|
-
{
|
|
1349
|
-
id: "ogDescription",
|
|
1350
|
-
name: "ogDescription",
|
|
1351
|
-
value: a.ogDescription,
|
|
1352
|
-
onChange: E,
|
|
1353
|
-
disabled: g,
|
|
1354
|
-
placeholder: "Enter OG description"
|
|
1355
|
-
}
|
|
1356
|
-
),
|
|
1357
|
-
/* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG description should be between 50 and 160 characters." })
|
|
1358
|
-
] }),
|
|
1359
|
-
/* @__PURE__ */ t.jsxs("div", { className: "mt-4", children: [
|
|
1360
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "ogImage", children: "OG Image URL" }),
|
|
1361
|
-
/* @__PURE__ */ t.jsx(
|
|
1362
|
-
U,
|
|
1363
|
-
{
|
|
1364
|
-
type: "text",
|
|
1365
|
-
id: "ogImage",
|
|
1366
|
-
name: "ogImage",
|
|
1367
|
-
value: a.ogImage,
|
|
1368
|
-
onChange: E,
|
|
1369
|
-
disabled: g,
|
|
1370
|
-
placeholder: "Enter OG image URL"
|
|
1371
|
-
}
|
|
1372
|
-
),
|
|
1373
|
-
/* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "Enter a valid URL for the OG image." })
|
|
1374
|
-
] })
|
|
1375
|
-
] }) })
|
|
1376
|
-
] }),
|
|
1377
|
-
/* @__PURE__ */ t.jsxs(pe, { value: "search", children: [
|
|
1378
|
-
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "Search" }),
|
|
1379
|
-
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
|
|
1380
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ t.jsx(
|
|
1381
|
-
B,
|
|
1382
|
-
{
|
|
1383
|
-
type: "button",
|
|
1384
|
-
variant: "outline",
|
|
1385
|
-
size: "sm",
|
|
1386
|
-
onClick: T,
|
|
1387
|
-
children: "Copy from OG Settings"
|
|
1388
|
-
}
|
|
1389
|
-
) }),
|
|
1390
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1391
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "searchTitle", children: "Search Title" }),
|
|
1392
|
-
/* @__PURE__ */ t.jsx(
|
|
1393
|
-
U,
|
|
1394
|
-
{
|
|
1395
|
-
type: "text",
|
|
1396
|
-
id: "searchTitle",
|
|
1397
|
-
name: "searchTitle",
|
|
1398
|
-
value: a.searchTitle,
|
|
1399
|
-
onChange: E,
|
|
1400
|
-
disabled: g,
|
|
1401
|
-
placeholder: "Enter search title"
|
|
1402
|
-
}
|
|
1403
|
-
),
|
|
1404
|
-
/* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search title should be between 10 and 60 characters." })
|
|
1405
|
-
] }),
|
|
1406
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1407
|
-
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "searchDescription", children: "Search Description" }),
|
|
1408
|
-
/* @__PURE__ */ t.jsx(
|
|
1409
|
-
ve,
|
|
1410
|
-
{
|
|
1411
|
-
id: "searchDescription",
|
|
1412
|
-
name: "searchDescription",
|
|
1413
|
-
value: a.searchDescription,
|
|
1414
|
-
onChange: E,
|
|
1415
|
-
placeholder: "Enter search description"
|
|
1416
|
-
}
|
|
1417
|
-
),
|
|
1418
|
-
/* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search description should be between 50 and 160 characters." })
|
|
1419
|
-
] })
|
|
1420
|
-
] }) })
|
|
1421
|
-
] }),
|
|
1422
|
-
/* @__PURE__ */ t.jsxs(pe, { value: "jsonLD", children: [
|
|
1423
|
-
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "JSON-LD" }),
|
|
1424
|
-
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1425
|
-
ve,
|
|
1426
|
-
{
|
|
1427
|
-
id: "jsonLD",
|
|
1428
|
-
name: "jsonLD",
|
|
1429
|
-
rows: 3,
|
|
1430
|
-
value: a.jsonLD,
|
|
1431
|
-
onChange: E,
|
|
1432
|
-
placeholder: "Enter JSON-LD"
|
|
1433
|
-
}
|
|
1434
|
-
) }) }) })
|
|
1435
|
-
] })
|
|
1436
|
-
] }) }),
|
|
1437
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-full flex items-center justify-end mt-4", children: /* @__PURE__ */ t.jsx(
|
|
1438
|
-
B,
|
|
1439
|
-
{
|
|
1440
|
-
size: "lg",
|
|
1441
|
-
variant: "default",
|
|
1442
|
-
onClick: f,
|
|
1443
|
-
disabled: Le(w.current.initial, a) || g,
|
|
1444
|
-
children: h ? "Saving..." : "Save"
|
|
1445
|
-
}
|
|
1446
|
-
) })
|
|
1447
|
-
] });
|
|
1448
|
-
};
|
|
1449
|
-
At.displayName = "SeoPanel";
|
|
1450
|
-
const $a = ({
|
|
1451
|
-
langProps: r,
|
|
1452
|
-
onClose: i,
|
|
1453
|
-
languagePages: o
|
|
1454
|
-
}) => {
|
|
1455
|
-
const { data: a } = _t(), [s, w] = I(r.edit ? r.name : ""), [c, p] = I(r.edit ? r.lang : ""), [u, m] = I(r.edit ? r.slug : ""), { mutate: h, isPending: g } = Rt(), { mutate: f, isPending: S } = $e(), T = g || S, { data: E } = Ot(), A = ae(
|
|
1456
|
-
G(E, "languages") || ["en"],
|
|
1457
|
-
(b) => !se(o, { lang: b }) && b !== G(E, "fallbackLang")
|
|
1458
|
-
), R = () => {
|
|
1459
|
-
r.edit ? f(
|
|
1460
|
-
{
|
|
1461
|
-
name: s,
|
|
1462
|
-
slug: u,
|
|
1463
|
-
lang: c,
|
|
1464
|
-
id: r == null ? void 0 : r.id,
|
|
1465
|
-
primaryPage: r == null ? void 0 : r.primaryPage
|
|
1466
|
-
},
|
|
1467
|
-
{ onSuccess: i }
|
|
1468
|
-
) : h(
|
|
1469
|
-
{
|
|
1470
|
-
name: s,
|
|
1471
|
-
slug: u,
|
|
1472
|
-
lang: c,
|
|
1473
|
-
primaryPage: a == null ? void 0 : a.id
|
|
1474
|
-
},
|
|
1475
|
-
{ onSuccess: i }
|
|
1476
|
-
);
|
|
1477
|
-
};
|
|
1478
|
-
return /* @__PURE__ */ t.jsx(xt, { open: !!r, onOpenChange: i, children: /* @__PURE__ */ t.jsxs(bt, { className: "sm:max-w-[425px]", children: [
|
|
1479
|
-
/* @__PURE__ */ t.jsxs(yt, { children: [
|
|
1480
|
-
/* @__PURE__ */ t.jsx(jt, { children: r.edit ? "Edit language" : "Add New language" }),
|
|
1481
|
-
/* @__PURE__ */ t.jsx(wt, { children: "Enter the details for the language" })
|
|
1482
|
-
] }),
|
|
1483
|
-
/* @__PURE__ */ t.jsxs("form", { children: [
|
|
1484
|
-
/* @__PURE__ */ t.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1485
|
-
/* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1486
|
-
/* @__PURE__ */ t.jsx(_, { htmlFor: "lang", className: "text-right", children: "Language" }),
|
|
1487
|
-
/* @__PURE__ */ t.jsxs(
|
|
1488
|
-
"select",
|
|
1489
|
-
{
|
|
1490
|
-
value: c,
|
|
1491
|
-
disabled: r.edit || W(A),
|
|
1492
|
-
onChange: (b) => p(b.target.value),
|
|
1493
|
-
className: "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 col-span-3",
|
|
1494
|
-
children: [
|
|
1495
|
-
/* @__PURE__ */ t.jsx("option", { value: "", disabled: !0, selected: !0, children: W(A) ? "All available language page is created." : "Choose language" }),
|
|
1496
|
-
Ge(A, (b) => /* @__PURE__ */ t.jsx("option", { value: b, children: G(be, b, b) }, b))
|
|
1497
|
-
]
|
|
1498
|
-
}
|
|
1499
|
-
)
|
|
1500
|
-
] }),
|
|
1501
|
-
/* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1502
|
-
/* @__PURE__ */ t.jsx(_, { htmlFor: "slug", className: "text-right", children: "Page Name" }),
|
|
1503
|
-
/* @__PURE__ */ t.jsx(
|
|
1504
|
-
U,
|
|
1505
|
-
{
|
|
1506
|
-
id: "name",
|
|
1507
|
-
value: s,
|
|
1508
|
-
onChange: (b) => w(b.target.value),
|
|
1509
|
-
className: "col-span-3",
|
|
1510
|
-
required: !0,
|
|
1511
|
-
placeholder: "Enter page name"
|
|
1512
|
-
}
|
|
1513
|
-
)
|
|
1514
|
-
] }),
|
|
1515
|
-
/* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1516
|
-
/* @__PURE__ */ t.jsxs(_, { htmlFor: "slug", className: "text-right", children: [
|
|
1517
|
-
"Slug",
|
|
1518
|
-
" ",
|
|
1519
|
-
/* @__PURE__ */ t.jsx("small", { className: "font-light", children: "(Slug should start with /)" })
|
|
1520
|
-
] }),
|
|
1521
|
-
/* @__PURE__ */ t.jsx(
|
|
1522
|
-
U,
|
|
1523
|
-
{
|
|
1524
|
-
id: "slug",
|
|
1525
|
-
value: u,
|
|
1526
|
-
onChange: (b) => m(Pa(_a(b.target.value))),
|
|
1527
|
-
className: "col-span-3",
|
|
1528
|
-
required: !0,
|
|
1529
|
-
pattern: "^/.*",
|
|
1530
|
-
title: "Slug must start with /",
|
|
1531
|
-
placeholder: "Enter page slug"
|
|
1532
|
-
}
|
|
1533
|
-
)
|
|
1534
|
-
] })
|
|
1535
|
-
] }),
|
|
1536
|
-
/* @__PURE__ */ t.jsx(St, { children: /* @__PURE__ */ t.jsx(
|
|
1537
|
-
B,
|
|
1538
|
-
{
|
|
1539
|
-
onClick: R,
|
|
1540
|
-
type: "button",
|
|
1541
|
-
disabled: T || !c || !u || !u.startsWith("/"),
|
|
1542
|
-
children: T ? r.edit ? "Updating..." : "Adding..." : r.edit ? "Update" : "Add new language"
|
|
1543
|
-
}
|
|
1544
|
-
) })
|
|
1545
|
-
] })
|
|
1546
|
-
] }) });
|
|
1547
|
-
}, Ka = () => {
|
|
1548
|
-
const [r, i] = I(null), { selectedLang: o, fallbackLang: a, setSelectedLang: s, languages: w } = Ue(), { data: c, isFetching: p } = Me(), { mutate: u, isPending: m } = Dt();
|
|
1549
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
1550
|
-
/* @__PURE__ */ t.jsx("ul", { className: "space-y-2 mt-4", children: p ? /* @__PURE__ */ t.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1551
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1552
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1553
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1554
|
-
] }) : Ge(c, (h) => {
|
|
1555
|
-
const g = h.lang, f = h.slug, S = !h.primaryPage, T = g === o;
|
|
1556
|
-
return S ? null : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1557
|
-
/* @__PURE__ */ t.jsxs(
|
|
1558
|
-
"li",
|
|
1559
|
-
{
|
|
1560
|
-
className: `w-full p-2 rounded cursor-pointer flex items-center justify-between ${T ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
1561
|
-
onClick: () => s(g),
|
|
1562
|
-
children: [
|
|
1563
|
-
/* @__PURE__ */ t.jsxs("div", { className: " flex-1 gap-x-3", children: [
|
|
1564
|
-
/* @__PURE__ */ t.jsx("div", { className: "text-[13px]", children: G(be, S ? a : g, g) }),
|
|
1565
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1566
|
-
/* @__PURE__ */ t.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1567
|
-
"Slug:",
|
|
1568
|
-
/* @__PURE__ */ t.jsxs("b", { children: [
|
|
1569
|
-
" ",
|
|
1570
|
-
f
|
|
1571
|
-
] })
|
|
1572
|
-
] }),
|
|
1573
|
-
/* @__PURE__ */ t.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1574
|
-
"Name:",
|
|
1575
|
-
/* @__PURE__ */ t.jsxs("b", { children: [
|
|
1576
|
-
" ",
|
|
1577
|
-
h.name,
|
|
1578
|
-
" "
|
|
1579
|
-
] })
|
|
1580
|
-
] })
|
|
1581
|
-
] })
|
|
1582
|
-
] }),
|
|
1583
|
-
S ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
1584
|
-
/* @__PURE__ */ t.jsx(wa, { fill: "orange", className: "w-3 h-3" }),
|
|
1585
|
-
/* @__PURE__ */ t.jsx("b", { children: " Default" })
|
|
1586
|
-
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1587
|
-
/* @__PURE__ */ t.jsx(
|
|
1588
|
-
Et,
|
|
1589
|
-
{
|
|
1590
|
-
onClick: (E) => {
|
|
1591
|
-
E.stopPropagation(), i({ ...h, edit: !0 });
|
|
1592
|
-
},
|
|
1593
|
-
className: "w-3 h-3 hover:text-blue-500"
|
|
1594
|
-
}
|
|
1595
|
-
),
|
|
1596
|
-
/* @__PURE__ */ t.jsxs(gt, { children: [
|
|
1597
|
-
/* @__PURE__ */ t.jsx(mt, { children: /* @__PURE__ */ t.jsx(Ct, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1598
|
-
/* @__PURE__ */ t.jsx(vt, { children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1599
|
-
/* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1600
|
-
"Are you sure you want to remove",
|
|
1601
|
-
" ",
|
|
1602
|
-
/* @__PURE__ */ t.jsx("b", { children: G(be, g, g) }),
|
|
1603
|
-
" language?"
|
|
1604
|
-
] }),
|
|
1605
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
|
|
1606
|
-
B,
|
|
1607
|
-
{
|
|
1608
|
-
size: "sm",
|
|
1609
|
-
variant: "destructive",
|
|
1610
|
-
disabled: m,
|
|
1611
|
-
onClick: () => u(h),
|
|
1612
|
-
children: m ? "Deleting..." : "Delete"
|
|
1613
|
-
}
|
|
1614
|
-
) })
|
|
1615
|
-
] }) })
|
|
1616
|
-
] })
|
|
1617
|
-
] })
|
|
1618
|
-
]
|
|
1619
|
-
},
|
|
1620
|
-
h.id
|
|
1621
|
-
),
|
|
1622
|
-
/* @__PURE__ */ t.jsx("div", { className: "h-1 w-full border-b" })
|
|
1623
|
-
] });
|
|
1624
|
-
}) }),
|
|
1625
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex justify-center w-full", children: ((c == null ? void 0 : c.length) || 0) >= w.length && /* @__PURE__ */ t.jsx(
|
|
1626
|
-
B,
|
|
1627
|
-
{
|
|
1628
|
-
variant: "default",
|
|
1629
|
-
size: "sm",
|
|
1630
|
-
onClick: () => i({ name: "", lang: "", slug: "", edit: !1 }),
|
|
1631
|
-
children: "+ Add new language"
|
|
1632
|
-
}
|
|
1633
|
-
) }),
|
|
1634
|
-
r && /* @__PURE__ */ t.jsx(
|
|
1635
|
-
$a,
|
|
1636
|
-
{
|
|
1637
|
-
langProps: r,
|
|
1638
|
-
languagePages: c,
|
|
1639
|
-
onClose: () => i(null)
|
|
1640
|
-
}
|
|
1641
|
-
)
|
|
1642
|
-
] });
|
|
1643
|
-
}, Va = ({
|
|
1644
|
-
activePage: r,
|
|
1645
|
-
editPage: i,
|
|
1646
|
-
onShowUpsertPage: o
|
|
1647
|
-
}) => {
|
|
1648
|
-
const [a, s] = I("pages"), { data: w, isFetching: c } = qe(), { mutate: p, isPending: u } = Dt(), m = (h) => Oa(
|
|
1649
|
-
ae(h, (f) => a === "pages" ? f.slug : !f.slug),
|
|
1650
|
-
"name",
|
|
1651
|
-
"asc"
|
|
1652
|
-
).map((f) => /* @__PURE__ */ t.jsxs(
|
|
1653
|
-
B,
|
|
1654
|
-
{
|
|
1655
|
-
onClick: () => i(f.id),
|
|
1656
|
-
variant: f.id === r ? "default" : "ghost",
|
|
1657
|
-
className: "flex justify-between items-center w-full space-x-2 py-1",
|
|
1658
|
-
children: [
|
|
1659
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1660
|
-
f.global ? /* @__PURE__ */ t.jsx(kt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(Nt, { className: "h-4 w-4" }),
|
|
1661
|
-
/* @__PURE__ */ t.jsx("span", { children: f.name ?? f.slug }),
|
|
1662
|
-
(f == null ? void 0 : f.slug) && /* @__PURE__ */ t.jsxs("span", { className: "text-xs font-light", children: [
|
|
1663
|
-
"( ",
|
|
1664
|
-
f.slug,
|
|
1665
|
-
" )"
|
|
1666
|
-
] })
|
|
1667
|
-
] }),
|
|
1668
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
1669
|
-
/* @__PURE__ */ t.jsx(
|
|
1670
|
-
Et,
|
|
1671
|
-
{
|
|
1672
|
-
className: "h-3 w-3 hover:text-blue-500",
|
|
1673
|
-
onClick: (S) => {
|
|
1674
|
-
S.stopPropagation(), o({ ...f, global: a === "globalBlocks" });
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
),
|
|
1678
|
-
/* @__PURE__ */ t.jsxs(gt, { children: [
|
|
1679
|
-
/* @__PURE__ */ t.jsx(mt, { onClick: (S) => S.stopPropagation(), children: /* @__PURE__ */ t.jsx(Ct, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1680
|
-
/* @__PURE__ */ t.jsx(vt, { children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1681
|
-
/* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1682
|
-
"Are you sure you want to remove",
|
|
1683
|
-
" ",
|
|
1684
|
-
/* @__PURE__ */ t.jsx("b", { children: f.name ?? (f == null ? void 0 : f.slug) }),
|
|
1685
|
-
" ",
|
|
1686
|
-
f.global ? "global block?" : "page? This will also delete all associated language pages."
|
|
1687
|
-
] }),
|
|
1688
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
|
|
1689
|
-
B,
|
|
1690
|
-
{
|
|
1691
|
-
size: "sm",
|
|
1692
|
-
variant: "destructive",
|
|
1693
|
-
disabled: u,
|
|
1694
|
-
onClick: (S) => {
|
|
1695
|
-
S.stopPropagation(), p(f);
|
|
1696
|
-
},
|
|
1697
|
-
children: u ? "Deleting..." : "Delete"
|
|
1698
|
-
}
|
|
1699
|
-
) })
|
|
1700
|
-
] }) })
|
|
1701
|
-
] })
|
|
1702
|
-
] })
|
|
1703
|
-
]
|
|
1704
|
-
},
|
|
1705
|
-
f.id
|
|
1706
|
-
));
|
|
1707
|
-
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1708
|
-
/* @__PURE__ */ t.jsx("br", {}),
|
|
1709
|
-
/* @__PURE__ */ t.jsxs(ma, { value: a, className: "w-full", onValueChange: s, children: [
|
|
1710
|
-
/* @__PURE__ */ t.jsxs(va, { className: "w-full", children: [
|
|
1711
|
-
/* @__PURE__ */ t.jsx(ut, { value: "pages", className: "w-full", children: /* @__PURE__ */ t.jsx("div", { className: "px-4", children: "Pages" }) }),
|
|
1712
|
-
/* @__PURE__ */ t.jsx(ut, { value: "globalBlocks", className: "w-full", children: /* @__PURE__ */ t.jsx("div", { className: "px-4", children: "Global Blocks" }) })
|
|
1713
|
-
] }),
|
|
1714
|
-
c ? /* @__PURE__ */ t.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1715
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1716
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1717
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1718
|
-
] }) : /* @__PURE__ */ t.jsxs("div", { className: "py-4 space-y-3", children: [
|
|
1719
|
-
/* @__PURE__ */ t.jsx(xa, { children: /* @__PURE__ */ t.jsxs(ba, { className: "text-xs text-muted-foreground text-center text-light", children: [
|
|
1720
|
-
"Manage your ",
|
|
1721
|
-
a === "pages" ? "pages" : "global blocks"
|
|
1722
|
-
] }) }),
|
|
1723
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-full flex justify-center", children: /* @__PURE__ */ t.jsxs(
|
|
1724
|
-
B,
|
|
1725
|
-
{
|
|
1726
|
-
variant: "default",
|
|
1727
|
-
size: "sm",
|
|
1728
|
-
disabled: c,
|
|
1729
|
-
onClick: () => o({
|
|
1730
|
-
slug: "",
|
|
1731
|
-
name: "",
|
|
1732
|
-
global: a === "globalBlocks"
|
|
1733
|
-
}),
|
|
1734
|
-
className: "mb-4 w-1/2 bg-blue-500 hover:bg-blue-400",
|
|
1735
|
-
children: [
|
|
1736
|
-
/* @__PURE__ */ t.jsx(Sa, { className: "h-4 w-4 mr-2" }),
|
|
1737
|
-
c ? "Loading..." : `Add new ${a === "pages" ? "page" : "global block"}`
|
|
1738
|
-
]
|
|
1739
|
-
}
|
|
1740
|
-
) }),
|
|
1741
|
-
/* @__PURE__ */ t.jsx("div", { className: "pt-4", children: /* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: c ? /* @__PURE__ */ t.jsx("div", { className: "h-32 w-full flex justify-center items-center text-sm animate-pulse", children: "Loading..." }) : m(w) }) })
|
|
1742
|
-
] })
|
|
1743
|
-
] })
|
|
1744
|
-
] });
|
|
1745
|
-
}, Wa = ({
|
|
1746
|
-
editPage: r,
|
|
1747
|
-
showUpsertPage: i,
|
|
1748
|
-
setShowUpsertPage: o
|
|
1749
|
-
}) => {
|
|
1750
|
-
const a = i.id, [s, w] = I(a && i.name || ""), [c, p] = I(a && i.slug || ""), { mutate: u, isPending: m } = Rt(), { mutate: h, isPending: g } = $e(), f = m || g, S = () => {
|
|
1751
|
-
a ? h(
|
|
1752
|
-
{
|
|
1753
|
-
name: s,
|
|
1754
|
-
slug: c,
|
|
1755
|
-
id: i.id,
|
|
1756
|
-
global: !!i.global
|
|
1757
|
-
},
|
|
1758
|
-
{
|
|
1759
|
-
onSuccess: () => {
|
|
1760
|
-
o(void 0);
|
|
1761
|
-
}
|
|
1762
|
-
}
|
|
1763
|
-
) : u(
|
|
1764
|
-
{
|
|
1765
|
-
name: s,
|
|
1766
|
-
slug: c,
|
|
1767
|
-
global: !!i.global
|
|
1768
|
-
},
|
|
1769
|
-
{
|
|
1770
|
-
onSuccess: (T) => {
|
|
1771
|
-
r(T.id);
|
|
1772
|
-
}
|
|
1773
|
-
}
|
|
1774
|
-
);
|
|
1775
|
-
};
|
|
1776
|
-
return /* @__PURE__ */ t.jsx(
|
|
1777
|
-
xt,
|
|
1778
|
-
{
|
|
1779
|
-
open: !!i,
|
|
1780
|
-
onOpenChange: () => o(void 0),
|
|
1781
|
-
children: /* @__PURE__ */ t.jsxs(bt, { className: "sm:max-w-[425px]", children: [
|
|
1782
|
-
/* @__PURE__ */ t.jsxs(yt, { children: [
|
|
1783
|
-
/* @__PURE__ */ t.jsxs(jt, { children: [
|
|
1784
|
-
a ? "Edit" : "Add New",
|
|
1785
|
-
" ",
|
|
1786
|
-
i.global ? "Global Block" : "Page"
|
|
1787
|
-
] }),
|
|
1788
|
-
/* @__PURE__ */ t.jsxs(wt, { children: [
|
|
1789
|
-
"Enter the details for the new",
|
|
1790
|
-
" ",
|
|
1791
|
-
i.global ? "global block. Identifier should be unique." : "page. Slug must start with /"
|
|
1792
|
-
] })
|
|
1793
|
-
] }),
|
|
1794
|
-
/* @__PURE__ */ t.jsxs("form", { children: [
|
|
1795
|
-
/* @__PURE__ */ t.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1796
|
-
/* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1797
|
-
/* @__PURE__ */ t.jsx(_, { htmlFor: "name", className: "text-right", children: "Name" }),
|
|
1798
|
-
/* @__PURE__ */ t.jsx(
|
|
1799
|
-
U,
|
|
1800
|
-
{
|
|
1801
|
-
id: "name",
|
|
1802
|
-
value: s,
|
|
1803
|
-
placeholder: `Enter ${i.global ? "global block" : "page"} name`,
|
|
1804
|
-
onChange: (T) => w(T.target.value),
|
|
1805
|
-
className: "col-span-3",
|
|
1806
|
-
required: !0
|
|
1807
|
-
}
|
|
1808
|
-
)
|
|
1809
|
-
] }),
|
|
1810
|
-
!i.global && /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1811
|
-
/* @__PURE__ */ t.jsx(_, { htmlFor: "slug", className: "text-right", children: i.global ? "Identifier" : "Slug" }),
|
|
1812
|
-
/* @__PURE__ */ t.jsx(
|
|
1813
|
-
U,
|
|
1814
|
-
{
|
|
1815
|
-
id: "slug",
|
|
1816
|
-
value: c,
|
|
1817
|
-
onChange: (T) => {
|
|
1818
|
-
var E;
|
|
1819
|
-
return p((E = T.target.value) == null ? void 0 : E.trim().toLowerCase());
|
|
1820
|
-
},
|
|
1821
|
-
className: "col-span-3",
|
|
1822
|
-
required: !0,
|
|
1823
|
-
pattern: "^/.*",
|
|
1824
|
-
title: "Slug must start with /",
|
|
1825
|
-
placeholder: "Enter page slug"
|
|
1826
|
-
}
|
|
1827
|
-
)
|
|
1828
|
-
] })
|
|
1829
|
-
] }),
|
|
1830
|
-
/* @__PURE__ */ t.jsx(St, { children: /* @__PURE__ */ t.jsx(
|
|
1831
|
-
B,
|
|
1832
|
-
{
|
|
1833
|
-
onClick: S,
|
|
1834
|
-
type: "button",
|
|
1835
|
-
disabled: f || !s || !i.global && !c.startsWith("/") || Le(i.name, s) && Le(i.slug, c),
|
|
1836
|
-
children: f ? a ? "Updating..." : "Adding..." : i.global ? `${a ? "Update" : "Add"} global block` : `${a ? "Update" : "Add"} Page`
|
|
1837
|
-
}
|
|
1838
|
-
) })
|
|
1839
|
-
] })
|
|
1840
|
-
] })
|
|
1841
|
-
}
|
|
1842
|
-
);
|
|
1843
|
-
};
|
|
1844
|
-
function za(r) {
|
|
1845
|
-
const { activePage: i, canClose: o, open: a, close: s } = r, [, w] = Y(), [c, p] = I(), u = (m) => {
|
|
1846
|
-
window.history.pushState({}, "", `?page=${m}`), w(new URLSearchParams({ page: m })), window.dispatchEvent(new PopStateEvent("popstate")), p(void 0), s();
|
|
1847
|
-
};
|
|
1848
|
-
return /* @__PURE__ */ t.jsx(
|
|
1849
|
-
ya,
|
|
1850
|
-
{
|
|
1851
|
-
open: a,
|
|
1852
|
-
onOpenChange: (m) => {
|
|
1853
|
-
!m && o && s();
|
|
1854
|
-
},
|
|
1855
|
-
children: /* @__PURE__ */ t.jsxs(
|
|
1856
|
-
ja,
|
|
1857
|
-
{
|
|
1858
|
-
side: "left",
|
|
1859
|
-
className: `border-border w-full ${o ? "" : "sheet-hide-close-btn"}`,
|
|
1860
|
-
children: [
|
|
1861
|
-
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1862
|
-
Va,
|
|
1863
|
-
{
|
|
1864
|
-
onShowUpsertPage: (m) => p(m),
|
|
1865
|
-
activePage: i,
|
|
1866
|
-
editPage: u
|
|
1867
|
-
}
|
|
1868
|
-
) }),
|
|
1869
|
-
c && /* @__PURE__ */ t.jsx(
|
|
1870
|
-
Wa,
|
|
1871
|
-
{
|
|
1872
|
-
editPage: u,
|
|
1873
|
-
showUpsertPage: c,
|
|
1874
|
-
setShowUpsertPage: p
|
|
1875
|
-
}
|
|
1876
|
-
)
|
|
1877
|
-
]
|
|
1878
|
-
}
|
|
1879
|
-
)
|
|
1880
|
-
}
|
|
1881
|
-
);
|
|
1882
|
-
}
|
|
1883
|
-
ua();
|
|
1884
|
-
const Ja = (r) => {
|
|
1885
|
-
var Q;
|
|
1886
|
-
const [i] = Y(), o = i.get("page"), { data: a, isFetching: s } = _t(), { data: w } = Ia(), { data: c, isFetching: p } = Tt(), { blocks: u, theme: m } = Ba(c), { data: h } = Ot(), { data: g } = Me(), f = Fa(), { uploadFile: S } = Ga(), { getUILibraryBlock: T, getUILibraryBlocks: E, onSave: A } = La(), { getGlobalBlocks: R, getGlobalBlockBlocks: b } = Ua(), { mutate: je, isPending: ie } = qa(), { aiContext: H, updateAiContext: we } = Pt(), [Se, oe] = I(!1), [q, Ee] = I("SAVED");
|
|
1887
|
-
Be(() => {
|
|
1888
|
-
const C = (F) => {
|
|
1889
|
-
q === "UNSAVED" && (F.preventDefault(), F.returnValue = !1);
|
|
1890
|
-
};
|
|
1891
|
-
return q === "UNSAVED" && window.addEventListener("beforeunload", C), () => {
|
|
1892
|
-
window.removeEventListener("beforeunload", C);
|
|
1893
|
-
};
|
|
1894
|
-
}, [q]);
|
|
1895
|
-
const Ce = ye(() => {
|
|
1896
|
-
const C = {};
|
|
1897
|
-
return h != null && h.theme && (C.brandingOptions = h.theme), C;
|
|
1898
|
-
}, [h]);
|
|
1899
|
-
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1900
|
-
/* @__PURE__ */ t.jsx(
|
|
1901
|
-
ha,
|
|
1902
|
-
{
|
|
1903
|
-
loading: p,
|
|
1904
|
-
fallbackLang: r.fallbackLang || "en",
|
|
1905
|
-
languages: Ge(g, "lang") || [],
|
|
1906
|
-
translations: r.translations || {},
|
|
1907
|
-
locale: r.locale || "en",
|
|
1908
|
-
htmlDir: r.htmlDir || "ltr",
|
|
1909
|
-
autoSaveSupport: r.autoSaveSupport || !1,
|
|
1910
|
-
autoSaveInterval: r.autoSaveInterval || 15,
|
|
1911
|
-
uploadMediaCallback: S,
|
|
1912
|
-
onError: r.onError || console.error,
|
|
1913
|
-
getGlobalBlockBlocks: b,
|
|
1914
|
-
getGlobalBlocks: R,
|
|
1915
|
-
blocks: u,
|
|
1916
|
-
getUILibraryBlock: T,
|
|
1917
|
-
getUILibraryBlocks: E,
|
|
1918
|
-
brandingOptions: m,
|
|
1919
|
-
uiLibraries: w,
|
|
1920
|
-
saveAiContextCallback: async (C) => (await we({ page: o, aiContext: C }), !0),
|
|
1921
|
-
onSaveStateChange: (C) => Ee(C),
|
|
1922
|
-
aiContext: H,
|
|
1923
|
-
askAiCallBack: f,
|
|
1924
|
-
onSave: async ({ blocks: C, themeConfiguration: F }) => {
|
|
1925
|
-
if (!o) return !0;
|
|
1926
|
-
const M = {
|
|
1927
|
-
_type: "@chai/theme",
|
|
1928
|
-
_value: F
|
|
1929
|
-
}, le = {
|
|
1930
|
-
_type: "@chai/ai-context",
|
|
1931
|
-
_value: Fe(H) ? H : ""
|
|
1932
|
-
}, ce = [...C, M, le];
|
|
1933
|
-
return await A({ page: o, blocks: ce }), !0;
|
|
1934
|
-
},
|
|
1935
|
-
topBarComponents: {
|
|
1936
|
-
left: [
|
|
1937
|
-
() => /* @__PURE__ */ t.jsxs(
|
|
1938
|
-
B,
|
|
1939
|
-
{
|
|
1940
|
-
variant: "default",
|
|
1941
|
-
className: "flex justify-start max-w-[250px] items-center w-full space-x-2 py-1",
|
|
1942
|
-
onClick: () => oe(!0),
|
|
1943
|
-
children: [
|
|
1944
|
-
xe(a.slug, "/") ? /* @__PURE__ */ t.jsx(Nt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(kt, { className: "h-4 w-4" }),
|
|
1945
|
-
/* @__PURE__ */ t.jsx("span", { className: "truncate", children: (a == null ? void 0 : a.name) ?? "" }),
|
|
1946
|
-
/* @__PURE__ */ t.jsx(Ea, { className: "h-4 w-4" })
|
|
1947
|
-
]
|
|
1948
|
-
},
|
|
1949
|
-
"template-viewer"
|
|
1950
|
-
)
|
|
1951
|
-
],
|
|
1952
|
-
right: [
|
|
1953
|
-
() => /* @__PURE__ */ t.jsxs(
|
|
1954
|
-
B,
|
|
1955
|
-
{
|
|
1956
|
-
disabled: ie || q !== "SAVED",
|
|
1957
|
-
size: "sm",
|
|
1958
|
-
variant: "default",
|
|
1959
|
-
onClick: () => je(o),
|
|
1960
|
-
children: [
|
|
1961
|
-
/* @__PURE__ */ t.jsx(Ca, { className: "h-4 w-4" }),
|
|
1962
|
-
" ",
|
|
1963
|
-
" ",
|
|
1964
|
-
ie ? "Publishing..." : "Publish"
|
|
1965
|
-
]
|
|
1966
|
-
}
|
|
1967
|
-
)
|
|
1968
|
-
]
|
|
1969
|
-
},
|
|
1970
|
-
sideBarComponents: {
|
|
1971
|
-
top: [
|
|
1972
|
-
...xe(a.slug, "/") ? [
|
|
1973
|
-
{
|
|
1974
|
-
label: "SEO Setting",
|
|
1975
|
-
component: At,
|
|
1976
|
-
icon: /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs(
|
|
1977
|
-
"svg",
|
|
1978
|
-
{
|
|
1979
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1980
|
-
viewBox: "0 0 21 21",
|
|
1981
|
-
fill: "currentColor",
|
|
1982
|
-
width: "21",
|
|
1983
|
-
height: "21",
|
|
1984
|
-
children: [
|
|
1985
|
-
/* @__PURE__ */ t.jsx("path", { d: "M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249" }),
|
|
1986
|
-
/* @__PURE__ */ t.jsx("path", { d: "M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z" })
|
|
1987
|
-
]
|
|
1988
|
-
}
|
|
1989
|
-
) })
|
|
1990
|
-
}
|
|
1991
|
-
] : [],
|
|
1992
|
-
...(Q = r.languages) != null && Q.length && xe(a.slug, "/") ? [
|
|
1993
|
-
{
|
|
1994
|
-
label: "Language Pages",
|
|
1995
|
-
component: Ka,
|
|
1996
|
-
icon: /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
1997
|
-
"svg",
|
|
1998
|
-
{
|
|
1999
|
-
width: "21",
|
|
2000
|
-
height: "21",
|
|
2001
|
-
viewBox: "0 0 21 21",
|
|
2002
|
-
fill: "currentColor",
|
|
2003
|
-
children: /* @__PURE__ */ t.jsxs(
|
|
2004
|
-
"g",
|
|
2005
|
-
{
|
|
2006
|
-
fill: "none",
|
|
2007
|
-
"fill-rule": "evenodd",
|
|
2008
|
-
stroke: "currentColor",
|
|
2009
|
-
"stroke-linecap": "round",
|
|
2010
|
-
"stroke-linejoin": "round",
|
|
2011
|
-
children: [
|
|
2012
|
-
/* @__PURE__ */ t.jsx("path", { d: "M18.5 10.5v-6a2 2 0 0 0-2-2h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2" }),
|
|
2013
|
-
/* @__PURE__ */ t.jsx("path", { d: "M6.5 8.503h-2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h.003l6-.01a2 2 0 0 0 1.997-2V14.5" }),
|
|
2014
|
-
/* @__PURE__ */ t.jsx("path", { d: "M7.5 12.503h-3M9 14l-1 1q-.5.5-2.5 1.5" }),
|
|
2015
|
-
/* @__PURE__ */ t.jsx("path", { d: "M5.5 12.503q.501 1.75 1.5 2.499c1 .749 1.5.999 2.5 1.498m4-12-3 6m3-6 3 6m-1-2h-4" })
|
|
2016
|
-
]
|
|
2017
|
-
}
|
|
2018
|
-
)
|
|
2019
|
-
}
|
|
2020
|
-
) })
|
|
2021
|
-
}
|
|
2022
|
-
] : []
|
|
2023
|
-
]
|
|
2024
|
-
},
|
|
2025
|
-
...Ce
|
|
2026
|
-
}
|
|
2027
|
-
),
|
|
2028
|
-
/* @__PURE__ */ t.jsx(
|
|
2029
|
-
za,
|
|
2030
|
-
{
|
|
2031
|
-
activePage: o || "",
|
|
2032
|
-
canClose: !!o && !W(a),
|
|
2033
|
-
open: !o || !s && W(a) || Se,
|
|
2034
|
-
close: () => oe(!1)
|
|
2035
|
-
}
|
|
2036
|
-
)
|
|
2037
|
-
] });
|
|
2038
|
-
}, ft = new fa({
|
|
2039
|
-
defaultOptions: { queries: { refetchOnWindowFocus: !1 } }
|
|
2040
|
-
}), an = (r) => (ft.setQueryData(["builder_props"], r), /* @__PURE__ */ t.jsx(pa, { client: ft, children: /* @__PURE__ */ t.jsx(Ja, { ...r }) }));
|
|
1
|
+
import { W as f } from "./ChaiBuilderPages-QYQG9fO9.js";
|
|
2
|
+
import "@chaibuilder/sdk/web-blocks";
|
|
3
|
+
import "@chaibuilder/sdk";
|
|
4
|
+
import "@tanstack/react-query";
|
|
5
|
+
import "react";
|
|
6
|
+
import "lodash-es";
|
|
7
|
+
import "lucide-react";
|
|
2041
8
|
export {
|
|
2042
|
-
|
|
9
|
+
f as default
|
|
2043
10
|
};
|