@chaibuilder/pages 0.1.0-beta.3 → 0.1.0-beta.30
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/index.cjs +10 -10
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1616 -1162
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +50 -3
- package/dist/server.js +319 -34
- package/dist/style.css +6 -6
- package/package.json +3 -8
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { loadWebBlocks as
|
|
3
|
-
import { getBlocksFromHTML as
|
|
4
|
-
import { useQueryClient as
|
|
5
|
-
import { useToast as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { get as
|
|
8
|
-
var
|
|
1
|
+
import Rt, { useCallback as Xe, useState as R, useEffect as ge, useMemo as z, useRef as At } from "react";
|
|
2
|
+
import { loadWebBlocks as xa } from "@chaibuilder/sdk/web-blocks";
|
|
3
|
+
import { getBlocksFromHTML as pa, useLanguages as Ze, useTranslation as va, ChaiBuilderEditor as ba } from "@chaibuilder/sdk";
|
|
4
|
+
import { useQueryClient as Z, useQuery as V, useMutation as se, QueryClient as ya, QueryClientProvider as ja } from "@tanstack/react-query";
|
|
5
|
+
import { useToast as re, Accordion as et, AccordionItem as J, AccordionTrigger as Y, AccordionContent as Q, Label as A, Input as q, Textarea as Oe, Button as _, Popover as wa, PopoverTrigger as Na, PopoverContent as Ca, Dialog as xe, DialogContent as pe, DialogHeader as ve, DialogTitle as be, DialogDescription as ye, DialogFooter as je, Tabs as ka, TabsList as Sa, TabsTrigger as Nt, DropdownMenu as Ea, DropdownMenuTrigger as Ta, DropdownMenuContent as Pa, DropdownMenuItem as Ye, Sheet as Oa, SheetContent as _a } from "@chaibuilder/sdk/ui";
|
|
6
|
+
import { StarIcon as Ra, PencilIcon as Ft, TrashIcon as Dt, Plus as Aa, GlobeIcon as Re, File as Ae, MoreVertical as Fa, Power as Da, EyeIcon as La, ArrowLeftRightIcon as Ia, RocketIcon as Ba } from "lucide-react";
|
|
7
|
+
import { get as $, find as X, isEmpty as D, filter as B, includes as fe, startCase as Fe, reverse as Ua, sortBy as Ga, isEqual as _e, map as H, startsWith as Ct, toLower as Ma, trim as qa, groupBy as $a, orderBy as Ka, first as kt, concat as Qe, uniq as St, isString as Et } from "lodash-es";
|
|
8
|
+
var He = { exports: {} }, de = {};
|
|
9
9
|
/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
@@ -15,21 +15,21 @@ var Le = { exports: {} }, ee = {};
|
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
17
|
*/
|
|
18
|
-
var
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
for (
|
|
27
|
-
if (
|
|
28
|
-
return { $$typeof:
|
|
18
|
+
var Tt;
|
|
19
|
+
function za() {
|
|
20
|
+
if (Tt) return de;
|
|
21
|
+
Tt = 1;
|
|
22
|
+
var a = Rt, s = Symbol.for("react.element"), l = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, r = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
23
|
+
function o(d, f, v) {
|
|
24
|
+
var b, E = {}, p = null, k = null;
|
|
25
|
+
v !== void 0 && (p = "" + v), f.key !== void 0 && (p = "" + f.key), f.ref !== void 0 && (k = f.ref);
|
|
26
|
+
for (b in f) n.call(f, b) && !c.hasOwnProperty(b) && (E[b] = f[b]);
|
|
27
|
+
if (d && d.defaultProps) for (b in f = d.defaultProps, f) E[b] === void 0 && (E[b] = f[b]);
|
|
28
|
+
return { $$typeof: s, type: d, key: p, ref: k, props: E, _owner: r.current };
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return de.Fragment = l, de.jsx = o, de.jsxs = o, de;
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var he = {};
|
|
33
33
|
/**
|
|
34
34
|
* @license React
|
|
35
35
|
* react-jsx-runtime.development.js
|
|
@@ -39,91 +39,91 @@ var te = {};
|
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
41
|
*/
|
|
42
|
-
var
|
|
43
|
-
function
|
|
44
|
-
return
|
|
45
|
-
var
|
|
46
|
-
function
|
|
47
|
-
if (
|
|
42
|
+
var Pt;
|
|
43
|
+
function Va() {
|
|
44
|
+
return Pt || (Pt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
45
|
+
var a = Rt, s = Symbol.for("react.element"), l = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), d = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), N = Symbol.iterator, m = "@@iterator";
|
|
46
|
+
function x(t) {
|
|
47
|
+
if (t === null || typeof t != "object")
|
|
48
48
|
return null;
|
|
49
|
-
var
|
|
50
|
-
return typeof
|
|
49
|
+
var i = N && t[N] || t[m];
|
|
50
|
+
return typeof i == "function" ? i : null;
|
|
51
51
|
}
|
|
52
|
-
var
|
|
53
|
-
function
|
|
52
|
+
var h = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
53
|
+
function y(t) {
|
|
54
54
|
{
|
|
55
|
-
for (var
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
for (var i = arguments.length, u = new Array(i > 1 ? i - 1 : 0), g = 1; g < i; g++)
|
|
56
|
+
u[g - 1] = arguments[g];
|
|
57
|
+
le("error", t, u);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function le(t, i, u) {
|
|
61
61
|
{
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
var
|
|
65
|
-
return String(
|
|
62
|
+
var g = h.ReactDebugCurrentFrame, C = g.getStackAddendum();
|
|
63
|
+
C !== "" && (i += "%s", u = u.concat([C]));
|
|
64
|
+
var S = u.map(function(w) {
|
|
65
|
+
return String(w);
|
|
66
66
|
});
|
|
67
|
-
|
|
67
|
+
S.unshift("Warning: " + i), Function.prototype.apply.call(console[t], console, S);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
function
|
|
73
|
-
return !!(typeof
|
|
70
|
+
var Le = !1, we = !1, Ie = !1, Ne = !1, Be = !1, oe;
|
|
71
|
+
oe = Symbol.for("react.module.reference");
|
|
72
|
+
function ee(t) {
|
|
73
|
+
return !!(typeof t == "string" || typeof t == "function" || t === n || t === c || Be || t === r || t === v || t === b || Ne || t === k || Le || we || Ie || typeof t == "object" && t !== null && (t.$$typeof === p || t.$$typeof === E || t.$$typeof === o || t.$$typeof === d || t.$$typeof === f || // This needs to include all possible module reference object
|
|
74
74
|
// types supported by any Flight configuration anywhere since
|
|
75
75
|
// we don't know which Flight build this will end up being used
|
|
76
76
|
// with.
|
|
77
|
-
|
|
77
|
+
t.$$typeof === oe || t.getModuleId !== void 0));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
var
|
|
81
|
-
if (
|
|
82
|
-
return
|
|
83
|
-
var
|
|
84
|
-
return
|
|
79
|
+
function Ue(t, i, u) {
|
|
80
|
+
var g = t.displayName;
|
|
81
|
+
if (g)
|
|
82
|
+
return g;
|
|
83
|
+
var C = i.displayName || i.name || "";
|
|
84
|
+
return C !== "" ? u + "(" + C + ")" : u;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
86
|
+
function Ce(t) {
|
|
87
|
+
return t.displayName || "Context";
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
if (
|
|
89
|
+
function U(t) {
|
|
90
|
+
if (t == null)
|
|
91
91
|
return null;
|
|
92
|
-
if (typeof
|
|
93
|
-
return
|
|
94
|
-
if (typeof
|
|
95
|
-
return
|
|
96
|
-
switch (
|
|
97
|
-
case
|
|
92
|
+
if (typeof t.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
93
|
+
return t.displayName || t.name || null;
|
|
94
|
+
if (typeof t == "string")
|
|
95
|
+
return t;
|
|
96
|
+
switch (t) {
|
|
97
|
+
case n:
|
|
98
98
|
return "Fragment";
|
|
99
|
-
case
|
|
99
|
+
case l:
|
|
100
100
|
return "Portal";
|
|
101
|
-
case
|
|
101
|
+
case c:
|
|
102
102
|
return "Profiler";
|
|
103
|
-
case
|
|
103
|
+
case r:
|
|
104
104
|
return "StrictMode";
|
|
105
|
-
case
|
|
105
|
+
case v:
|
|
106
106
|
return "Suspense";
|
|
107
|
-
case
|
|
107
|
+
case b:
|
|
108
108
|
return "SuspenseList";
|
|
109
109
|
}
|
|
110
|
-
if (typeof
|
|
111
|
-
switch (
|
|
110
|
+
if (typeof t == "object")
|
|
111
|
+
switch (t.$$typeof) {
|
|
112
|
+
case d:
|
|
113
|
+
var i = t;
|
|
114
|
+
return Ce(i) + ".Consumer";
|
|
115
|
+
case o:
|
|
116
|
+
var u = t;
|
|
117
|
+
return Ce(u._context) + ".Provider";
|
|
112
118
|
case f:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return ce(e, e.render, "ForwardRef");
|
|
120
|
-
case m:
|
|
121
|
-
var d = e.displayName || null;
|
|
122
|
-
return d !== null ? d : T(e.type) || "Memo";
|
|
123
|
-
case h: {
|
|
124
|
-
var y = e, j = y._payload, x = y._init;
|
|
119
|
+
return Ue(t, t.render, "ForwardRef");
|
|
120
|
+
case E:
|
|
121
|
+
var g = t.displayName || null;
|
|
122
|
+
return g !== null ? g : U(t.type) || "Memo";
|
|
123
|
+
case p: {
|
|
124
|
+
var C = t, S = C._payload, w = C._init;
|
|
125
125
|
try {
|
|
126
|
-
return
|
|
126
|
+
return U(w(S));
|
|
127
127
|
} catch {
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
@@ -131,647 +131,597 @@ function Da() {
|
|
|
131
131
|
}
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
-
var
|
|
135
|
-
function
|
|
134
|
+
var K = Object.assign, T = 0, M, te, ke, st, rt, it, lt;
|
|
135
|
+
function ot() {
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
function
|
|
137
|
+
ot.__reactDisabledLog = !0;
|
|
138
|
+
function $t() {
|
|
139
139
|
{
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
var
|
|
140
|
+
if (T === 0) {
|
|
141
|
+
M = console.log, te = console.info, ke = console.warn, st = console.error, rt = console.group, it = console.groupCollapsed, lt = console.groupEnd;
|
|
142
|
+
var t = {
|
|
143
143
|
configurable: !0,
|
|
144
144
|
enumerable: !0,
|
|
145
|
-
value:
|
|
145
|
+
value: ot,
|
|
146
146
|
writable: !0
|
|
147
147
|
};
|
|
148
148
|
Object.defineProperties(console, {
|
|
149
|
-
info:
|
|
150
|
-
log:
|
|
151
|
-
warn:
|
|
152
|
-
error:
|
|
153
|
-
group:
|
|
154
|
-
groupCollapsed:
|
|
155
|
-
groupEnd:
|
|
149
|
+
info: t,
|
|
150
|
+
log: t,
|
|
151
|
+
warn: t,
|
|
152
|
+
error: t,
|
|
153
|
+
group: t,
|
|
154
|
+
groupCollapsed: t,
|
|
155
|
+
groupEnd: t
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
T++;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Kt() {
|
|
162
162
|
{
|
|
163
|
-
if (
|
|
164
|
-
var
|
|
163
|
+
if (T--, T === 0) {
|
|
164
|
+
var t = {
|
|
165
165
|
configurable: !0,
|
|
166
166
|
enumerable: !0,
|
|
167
167
|
writable: !0
|
|
168
168
|
};
|
|
169
169
|
Object.defineProperties(console, {
|
|
170
|
-
log:
|
|
171
|
-
value:
|
|
170
|
+
log: K({}, t, {
|
|
171
|
+
value: M
|
|
172
172
|
}),
|
|
173
|
-
info:
|
|
174
|
-
value:
|
|
173
|
+
info: K({}, t, {
|
|
174
|
+
value: te
|
|
175
175
|
}),
|
|
176
|
-
warn:
|
|
177
|
-
value:
|
|
176
|
+
warn: K({}, t, {
|
|
177
|
+
value: ke
|
|
178
178
|
}),
|
|
179
|
-
error:
|
|
180
|
-
value:
|
|
179
|
+
error: K({}, t, {
|
|
180
|
+
value: st
|
|
181
181
|
}),
|
|
182
|
-
group:
|
|
183
|
-
value:
|
|
182
|
+
group: K({}, t, {
|
|
183
|
+
value: rt
|
|
184
184
|
}),
|
|
185
|
-
groupCollapsed:
|
|
186
|
-
value:
|
|
185
|
+
groupCollapsed: K({}, t, {
|
|
186
|
+
value: it
|
|
187
187
|
}),
|
|
188
|
-
groupEnd:
|
|
189
|
-
value:
|
|
188
|
+
groupEnd: K({}, t, {
|
|
189
|
+
value: lt
|
|
190
190
|
})
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
T < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
var
|
|
197
|
-
function
|
|
196
|
+
var Ge = h.ReactCurrentDispatcher, Me;
|
|
197
|
+
function Se(t, i, u) {
|
|
198
198
|
{
|
|
199
|
-
if (
|
|
199
|
+
if (Me === void 0)
|
|
200
200
|
try {
|
|
201
201
|
throw Error();
|
|
202
|
-
} catch (
|
|
203
|
-
var
|
|
204
|
-
|
|
202
|
+
} catch (C) {
|
|
203
|
+
var g = C.stack.trim().match(/\n( *(at )?)/);
|
|
204
|
+
Me = g && g[1] || "";
|
|
205
205
|
}
|
|
206
206
|
return `
|
|
207
|
-
` +
|
|
207
|
+
` + Me + t;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
var
|
|
210
|
+
var qe = !1, Ee;
|
|
211
211
|
{
|
|
212
|
-
var
|
|
213
|
-
|
|
212
|
+
var zt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
213
|
+
Ee = new zt();
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
if (!
|
|
215
|
+
function ct(t, i) {
|
|
216
|
+
if (!t || qe)
|
|
217
217
|
return "";
|
|
218
218
|
{
|
|
219
|
-
var
|
|
220
|
-
if (
|
|
221
|
-
return
|
|
219
|
+
var u = Ee.get(t);
|
|
220
|
+
if (u !== void 0)
|
|
221
|
+
return u;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
var
|
|
223
|
+
var g;
|
|
224
|
+
qe = !0;
|
|
225
|
+
var C = Error.prepareStackTrace;
|
|
226
226
|
Error.prepareStackTrace = void 0;
|
|
227
|
-
var
|
|
228
|
-
|
|
227
|
+
var S;
|
|
228
|
+
S = Ge.current, Ge.current = null, $t();
|
|
229
229
|
try {
|
|
230
|
-
if (
|
|
231
|
-
var
|
|
230
|
+
if (i) {
|
|
231
|
+
var w = function() {
|
|
232
232
|
throw Error();
|
|
233
233
|
};
|
|
234
|
-
if (Object.defineProperty(
|
|
234
|
+
if (Object.defineProperty(w.prototype, "props", {
|
|
235
235
|
set: function() {
|
|
236
236
|
throw Error();
|
|
237
237
|
}
|
|
238
238
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
239
239
|
try {
|
|
240
|
-
Reflect.construct(
|
|
241
|
-
} catch (
|
|
242
|
-
|
|
240
|
+
Reflect.construct(w, []);
|
|
241
|
+
} catch (I) {
|
|
242
|
+
g = I;
|
|
243
243
|
}
|
|
244
|
-
Reflect.construct(
|
|
244
|
+
Reflect.construct(t, [], w);
|
|
245
245
|
} else {
|
|
246
246
|
try {
|
|
247
|
-
|
|
248
|
-
} catch (
|
|
249
|
-
|
|
247
|
+
w.call();
|
|
248
|
+
} catch (I) {
|
|
249
|
+
g = I;
|
|
250
250
|
}
|
|
251
|
-
|
|
251
|
+
t.call(w.prototype);
|
|
252
252
|
}
|
|
253
253
|
} else {
|
|
254
254
|
try {
|
|
255
255
|
throw Error();
|
|
256
|
-
} catch (
|
|
257
|
-
|
|
256
|
+
} catch (I) {
|
|
257
|
+
g = I;
|
|
258
258
|
}
|
|
259
|
-
|
|
259
|
+
t();
|
|
260
260
|
}
|
|
261
|
-
} catch (
|
|
262
|
-
if (
|
|
263
|
-
for (var
|
|
264
|
-
`),
|
|
265
|
-
`),
|
|
266
|
-
|
|
267
|
-
for (;
|
|
268
|
-
if (
|
|
269
|
-
if (
|
|
261
|
+
} catch (I) {
|
|
262
|
+
if (I && g && typeof I.stack == "string") {
|
|
263
|
+
for (var j = I.stack.split(`
|
|
264
|
+
`), F = g.stack.split(`
|
|
265
|
+
`), P = j.length - 1, O = F.length - 1; P >= 1 && O >= 0 && j[P] !== F[O]; )
|
|
266
|
+
O--;
|
|
267
|
+
for (; P >= 1 && O >= 0; P--, O--)
|
|
268
|
+
if (j[P] !== F[O]) {
|
|
269
|
+
if (P !== 1 || O !== 1)
|
|
270
270
|
do
|
|
271
|
-
if (
|
|
272
|
-
var
|
|
273
|
-
` +
|
|
274
|
-
return
|
|
271
|
+
if (P--, O--, O < 0 || j[P] !== F[O]) {
|
|
272
|
+
var G = `
|
|
273
|
+
` + j[P].replace(" at new ", " at ");
|
|
274
|
+
return t.displayName && G.includes("<anonymous>") && (G = G.replace("<anonymous>", t.displayName)), typeof t == "function" && Ee.set(t, G), G;
|
|
275
275
|
}
|
|
276
|
-
while (
|
|
276
|
+
while (P >= 1 && O >= 0);
|
|
277
277
|
break;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
} finally {
|
|
281
|
-
|
|
281
|
+
qe = !1, Ge.current = S, Kt(), Error.prepareStackTrace = C;
|
|
282
282
|
}
|
|
283
|
-
var
|
|
284
|
-
return typeof
|
|
283
|
+
var ne = t ? t.displayName || t.name : "", W = ne ? Se(ne) : "";
|
|
284
|
+
return typeof t == "function" && Ee.set(t, W), W;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
return
|
|
286
|
+
function Vt(t, i, u) {
|
|
287
|
+
return ct(t, !1);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
var
|
|
291
|
-
return !!(
|
|
289
|
+
function Wt(t) {
|
|
290
|
+
var i = t.prototype;
|
|
291
|
+
return !!(i && i.isReactComponent);
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
if (
|
|
293
|
+
function Te(t, i, u) {
|
|
294
|
+
if (t == null)
|
|
295
295
|
return "";
|
|
296
|
-
if (typeof
|
|
297
|
-
return
|
|
298
|
-
if (typeof
|
|
299
|
-
return
|
|
300
|
-
switch (
|
|
301
|
-
case
|
|
302
|
-
return
|
|
303
|
-
case
|
|
304
|
-
return
|
|
296
|
+
if (typeof t == "function")
|
|
297
|
+
return ct(t, Wt(t));
|
|
298
|
+
if (typeof t == "string")
|
|
299
|
+
return Se(t);
|
|
300
|
+
switch (t) {
|
|
301
|
+
case v:
|
|
302
|
+
return Se("Suspense");
|
|
303
|
+
case b:
|
|
304
|
+
return Se("SuspenseList");
|
|
305
305
|
}
|
|
306
|
-
if (typeof
|
|
307
|
-
switch (
|
|
308
|
-
case
|
|
309
|
-
return
|
|
310
|
-
case
|
|
311
|
-
return
|
|
312
|
-
case
|
|
313
|
-
var
|
|
306
|
+
if (typeof t == "object")
|
|
307
|
+
switch (t.$$typeof) {
|
|
308
|
+
case f:
|
|
309
|
+
return Vt(t.render);
|
|
310
|
+
case E:
|
|
311
|
+
return Te(t.type, i, u);
|
|
312
|
+
case p: {
|
|
313
|
+
var g = t, C = g._payload, S = g._init;
|
|
314
314
|
try {
|
|
315
|
-
return
|
|
315
|
+
return Te(S(C), i, u);
|
|
316
316
|
} catch {
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
return "";
|
|
321
321
|
}
|
|
322
|
-
var
|
|
323
|
-
function
|
|
324
|
-
if (
|
|
325
|
-
var
|
|
326
|
-
|
|
322
|
+
var ce = Object.prototype.hasOwnProperty, ut = {}, dt = h.ReactDebugCurrentFrame;
|
|
323
|
+
function Pe(t) {
|
|
324
|
+
if (t) {
|
|
325
|
+
var i = t._owner, u = Te(t.type, t._source, i ? i.type : null);
|
|
326
|
+
dt.setExtraStackFrame(u);
|
|
327
327
|
} else
|
|
328
|
-
|
|
328
|
+
dt.setExtraStackFrame(null);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function Jt(t, i, u, g, C) {
|
|
331
331
|
{
|
|
332
|
-
var
|
|
333
|
-
for (var
|
|
334
|
-
if (
|
|
335
|
-
var
|
|
332
|
+
var S = Function.call.bind(ce);
|
|
333
|
+
for (var w in t)
|
|
334
|
+
if (S(t, w)) {
|
|
335
|
+
var j = void 0;
|
|
336
336
|
try {
|
|
337
|
-
if (typeof
|
|
338
|
-
var
|
|
339
|
-
throw
|
|
337
|
+
if (typeof t[w] != "function") {
|
|
338
|
+
var F = Error((g || "React class") + ": " + u + " type `" + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[w] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
339
|
+
throw F.name = "Invariant Violation", F;
|
|
340
340
|
}
|
|
341
|
-
|
|
342
|
-
} catch (
|
|
343
|
-
|
|
341
|
+
j = t[w](i, w, g, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
342
|
+
} catch (P) {
|
|
343
|
+
j = P;
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
j && !(j instanceof Error) && (Pe(C), y("%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).", g || "React class", u, w, typeof j), Pe(null)), j instanceof Error && !(j.message in ut) && (ut[j.message] = !0, Pe(C), y("Failed %s type: %s", u, j.message), Pe(null));
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
var
|
|
350
|
-
function
|
|
351
|
-
return
|
|
349
|
+
var Yt = Array.isArray;
|
|
350
|
+
function $e(t) {
|
|
351
|
+
return Yt(t);
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Qt(t) {
|
|
354
354
|
{
|
|
355
|
-
var
|
|
356
|
-
return
|
|
355
|
+
var i = typeof Symbol == "function" && Symbol.toStringTag, u = i && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
356
|
+
return u;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Ht(t) {
|
|
360
360
|
try {
|
|
361
|
-
return
|
|
361
|
+
return ht(t), !1;
|
|
362
362
|
} catch {
|
|
363
363
|
return !0;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
return "" +
|
|
366
|
+
function ht(t) {
|
|
367
|
+
return "" + t;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
if (
|
|
371
|
-
return
|
|
369
|
+
function ft(t) {
|
|
370
|
+
if (Ht(t))
|
|
371
|
+
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qt(t)), ht(t);
|
|
372
372
|
}
|
|
373
|
-
var
|
|
373
|
+
var ue = h.ReactCurrentOwner, Xt = {
|
|
374
374
|
key: !0,
|
|
375
375
|
ref: !0,
|
|
376
376
|
__self: !0,
|
|
377
377
|
__source: !0
|
|
378
|
-
},
|
|
379
|
-
|
|
380
|
-
function
|
|
381
|
-
if (
|
|
382
|
-
var
|
|
383
|
-
if (
|
|
378
|
+
}, mt, gt, Ke;
|
|
379
|
+
Ke = {};
|
|
380
|
+
function Zt(t) {
|
|
381
|
+
if (ce.call(t, "ref")) {
|
|
382
|
+
var i = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
383
|
+
if (i && i.isReactWarning)
|
|
384
384
|
return !1;
|
|
385
385
|
}
|
|
386
|
-
return
|
|
386
|
+
return t.ref !== void 0;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
if (
|
|
390
|
-
var
|
|
391
|
-
if (
|
|
388
|
+
function ea(t) {
|
|
389
|
+
if (ce.call(t, "key")) {
|
|
390
|
+
var i = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
391
|
+
if (i && i.isReactWarning)
|
|
392
392
|
return !1;
|
|
393
393
|
}
|
|
394
|
-
return
|
|
394
|
+
return t.key !== void 0;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
if (typeof
|
|
398
|
-
var
|
|
399
|
-
|
|
396
|
+
function ta(t, i) {
|
|
397
|
+
if (typeof t.ref == "string" && ue.current && i && ue.current.stateNode !== i) {
|
|
398
|
+
var u = U(ue.current.type);
|
|
399
|
+
Ke[u] || (y('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', U(ue.current.type), t.ref), Ke[u] = !0);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function aa(t, i) {
|
|
403
403
|
{
|
|
404
|
-
var
|
|
405
|
-
|
|
404
|
+
var u = function() {
|
|
405
|
+
mt || (mt = !0, y("%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)", i));
|
|
406
406
|
};
|
|
407
|
-
|
|
408
|
-
get:
|
|
407
|
+
u.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
408
|
+
get: u,
|
|
409
409
|
configurable: !0
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function na(t, i) {
|
|
414
414
|
{
|
|
415
|
-
var
|
|
416
|
-
|
|
415
|
+
var u = function() {
|
|
416
|
+
gt || (gt = !0, y("%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)", i));
|
|
417
417
|
};
|
|
418
|
-
|
|
419
|
-
get:
|
|
418
|
+
u.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
419
|
+
get: u,
|
|
420
420
|
configurable: !0
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
var
|
|
425
|
-
var
|
|
424
|
+
var sa = function(t, i, u, g, C, S, w) {
|
|
425
|
+
var j = {
|
|
426
426
|
// This tag allows us to uniquely identify this as a React Element
|
|
427
|
-
$$typeof:
|
|
427
|
+
$$typeof: s,
|
|
428
428
|
// Built-in properties that belong on the element
|
|
429
|
-
type:
|
|
430
|
-
key:
|
|
431
|
-
ref:
|
|
432
|
-
props:
|
|
429
|
+
type: t,
|
|
430
|
+
key: i,
|
|
431
|
+
ref: u,
|
|
432
|
+
props: w,
|
|
433
433
|
// Record the component responsible for creating this element.
|
|
434
|
-
_owner:
|
|
434
|
+
_owner: S
|
|
435
435
|
};
|
|
436
|
-
return
|
|
436
|
+
return j._store = {}, Object.defineProperty(j._store, "validated", {
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
439
439
|
writable: !0,
|
|
440
440
|
value: !1
|
|
441
|
-
}), Object.defineProperty(
|
|
441
|
+
}), Object.defineProperty(j, "_self", {
|
|
442
442
|
configurable: !1,
|
|
443
443
|
enumerable: !1,
|
|
444
444
|
writable: !1,
|
|
445
|
-
value:
|
|
446
|
-
}), Object.defineProperty(
|
|
445
|
+
value: g
|
|
446
|
+
}), Object.defineProperty(j, "_source", {
|
|
447
447
|
configurable: !1,
|
|
448
448
|
enumerable: !1,
|
|
449
449
|
writable: !1,
|
|
450
|
-
value:
|
|
451
|
-
}), Object.freeze && (Object.freeze(
|
|
450
|
+
value: C
|
|
451
|
+
}), Object.freeze && (Object.freeze(j.props), Object.freeze(j)), j;
|
|
452
452
|
};
|
|
453
|
-
function
|
|
453
|
+
function ra(t, i, u, g, C) {
|
|
454
454
|
{
|
|
455
|
-
var
|
|
456
|
-
|
|
457
|
-
for (
|
|
458
|
-
|
|
459
|
-
if (
|
|
460
|
-
var
|
|
461
|
-
for (
|
|
462
|
-
|
|
455
|
+
var S, w = {}, j = null, F = null;
|
|
456
|
+
u !== void 0 && (ft(u), j = "" + u), ea(i) && (ft(i.key), j = "" + i.key), Zt(i) && (F = i.ref, ta(i, C));
|
|
457
|
+
for (S in i)
|
|
458
|
+
ce.call(i, S) && !Xt.hasOwnProperty(S) && (w[S] = i[S]);
|
|
459
|
+
if (t && t.defaultProps) {
|
|
460
|
+
var P = t.defaultProps;
|
|
461
|
+
for (S in P)
|
|
462
|
+
w[S] === void 0 && (w[S] = P[S]);
|
|
463
463
|
}
|
|
464
|
-
if (
|
|
465
|
-
var
|
|
466
|
-
|
|
464
|
+
if (j || F) {
|
|
465
|
+
var O = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
466
|
+
j && aa(w, O), F && na(w, O);
|
|
467
467
|
}
|
|
468
|
-
return
|
|
468
|
+
return sa(t, j, F, C, g, ue.current, w);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
var
|
|
472
|
-
function
|
|
473
|
-
if (
|
|
474
|
-
var
|
|
475
|
-
|
|
471
|
+
var ze = h.ReactCurrentOwner, xt = h.ReactDebugCurrentFrame;
|
|
472
|
+
function ae(t) {
|
|
473
|
+
if (t) {
|
|
474
|
+
var i = t._owner, u = Te(t.type, t._source, i ? i.type : null);
|
|
475
|
+
xt.setExtraStackFrame(u);
|
|
476
476
|
} else
|
|
477
|
-
|
|
477
|
+
xt.setExtraStackFrame(null);
|
|
478
478
|
}
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
function
|
|
482
|
-
return typeof
|
|
479
|
+
var Ve;
|
|
480
|
+
Ve = !1;
|
|
481
|
+
function We(t) {
|
|
482
|
+
return typeof t == "object" && t !== null && t.$$typeof === s;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function pt() {
|
|
485
485
|
{
|
|
486
|
-
if (
|
|
487
|
-
var
|
|
488
|
-
if (
|
|
486
|
+
if (ze.current) {
|
|
487
|
+
var t = U(ze.current.type);
|
|
488
|
+
if (t)
|
|
489
489
|
return `
|
|
490
490
|
|
|
491
|
-
Check the render method of \`` +
|
|
491
|
+
Check the render method of \`` + t + "`.";
|
|
492
492
|
}
|
|
493
493
|
return "";
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function ia(t) {
|
|
497
497
|
return "";
|
|
498
498
|
}
|
|
499
|
-
var
|
|
500
|
-
function
|
|
499
|
+
var vt = {};
|
|
500
|
+
function la(t) {
|
|
501
501
|
{
|
|
502
|
-
var
|
|
503
|
-
if (!
|
|
504
|
-
var
|
|
505
|
-
|
|
502
|
+
var i = pt();
|
|
503
|
+
if (!i) {
|
|
504
|
+
var u = typeof t == "string" ? t : t.displayName || t.name;
|
|
505
|
+
u && (i = `
|
|
506
506
|
|
|
507
|
-
Check the top-level render call using <` +
|
|
507
|
+
Check the top-level render call using <` + u + ">.");
|
|
508
508
|
}
|
|
509
|
-
return
|
|
509
|
+
return i;
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function bt(t, i) {
|
|
513
513
|
{
|
|
514
|
-
if (!
|
|
514
|
+
if (!t._store || t._store.validated || t.key != null)
|
|
515
515
|
return;
|
|
516
|
-
|
|
517
|
-
var
|
|
518
|
-
if (
|
|
516
|
+
t._store.validated = !0;
|
|
517
|
+
var u = la(i);
|
|
518
|
+
if (vt[u])
|
|
519
519
|
return;
|
|
520
|
-
|
|
521
|
-
var
|
|
522
|
-
|
|
520
|
+
vt[u] = !0;
|
|
521
|
+
var g = "";
|
|
522
|
+
t && t._owner && t._owner !== ze.current && (g = " It was passed a child from " + U(t._owner.type) + "."), ae(t), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, g), ae(null);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function yt(t, i) {
|
|
526
526
|
{
|
|
527
|
-
if (typeof
|
|
527
|
+
if (typeof t != "object")
|
|
528
528
|
return;
|
|
529
|
-
if (
|
|
530
|
-
for (var
|
|
531
|
-
var
|
|
532
|
-
|
|
529
|
+
if ($e(t))
|
|
530
|
+
for (var u = 0; u < t.length; u++) {
|
|
531
|
+
var g = t[u];
|
|
532
|
+
We(g) && bt(g, i);
|
|
533
533
|
}
|
|
534
|
-
else if (
|
|
535
|
-
|
|
536
|
-
else if (
|
|
537
|
-
var
|
|
538
|
-
if (typeof
|
|
539
|
-
for (var
|
|
540
|
-
|
|
534
|
+
else if (We(t))
|
|
535
|
+
t._store && (t._store.validated = !0);
|
|
536
|
+
else if (t) {
|
|
537
|
+
var C = x(t);
|
|
538
|
+
if (typeof C == "function" && C !== t.entries)
|
|
539
|
+
for (var S = C.call(t), w; !(w = S.next()).done; )
|
|
540
|
+
We(w.value) && bt(w.value, i);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function oa(t) {
|
|
545
545
|
{
|
|
546
|
-
var
|
|
547
|
-
if (
|
|
546
|
+
var i = t.type;
|
|
547
|
+
if (i == null || typeof i == "string")
|
|
548
548
|
return;
|
|
549
|
-
var
|
|
550
|
-
if (typeof
|
|
551
|
-
|
|
552
|
-
else if (typeof
|
|
549
|
+
var u;
|
|
550
|
+
if (typeof i == "function")
|
|
551
|
+
u = i.propTypes;
|
|
552
|
+
else if (typeof i == "object" && (i.$$typeof === f || // Note: Memo only checks outer props here.
|
|
553
553
|
// Inner props are checked in the reconciler.
|
|
554
|
-
|
|
555
|
-
|
|
554
|
+
i.$$typeof === E))
|
|
555
|
+
u = i.propTypes;
|
|
556
556
|
else
|
|
557
557
|
return;
|
|
558
|
-
if (
|
|
559
|
-
var
|
|
560
|
-
|
|
561
|
-
} else if (
|
|
562
|
-
|
|
563
|
-
var
|
|
564
|
-
|
|
558
|
+
if (u) {
|
|
559
|
+
var g = U(i);
|
|
560
|
+
Jt(u, t.props, "prop", g, t);
|
|
561
|
+
} else if (i.PropTypes !== void 0 && !Ve) {
|
|
562
|
+
Ve = !0;
|
|
563
|
+
var C = U(i);
|
|
564
|
+
y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", C || "Unknown");
|
|
565
565
|
}
|
|
566
|
-
typeof
|
|
566
|
+
typeof i.getDefaultProps == "function" && !i.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function ca(t) {
|
|
570
570
|
{
|
|
571
|
-
for (var
|
|
572
|
-
var
|
|
573
|
-
if (
|
|
574
|
-
|
|
571
|
+
for (var i = Object.keys(t.props), u = 0; u < i.length; u++) {
|
|
572
|
+
var g = i[u];
|
|
573
|
+
if (g !== "children" && g !== "key") {
|
|
574
|
+
ae(t), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), ae(null);
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
|
|
578
|
+
t.ref !== null && (ae(t), y("Invalid attribute `ref` supplied to `React.Fragment`."), ae(null));
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
var
|
|
582
|
-
function
|
|
581
|
+
var jt = {};
|
|
582
|
+
function wt(t, i, u, g, C, S) {
|
|
583
583
|
{
|
|
584
|
-
var
|
|
585
|
-
if (!
|
|
586
|
-
var
|
|
587
|
-
(
|
|
588
|
-
var
|
|
589
|
-
|
|
590
|
-
var
|
|
591
|
-
|
|
584
|
+
var w = ee(t);
|
|
585
|
+
if (!w) {
|
|
586
|
+
var j = "";
|
|
587
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (j += " 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 F = ia();
|
|
589
|
+
F ? j += F : j += pt();
|
|
590
|
+
var P;
|
|
591
|
+
t === null ? P = "null" : $e(t) ? P = "array" : t !== void 0 && t.$$typeof === s ? (P = "<" + (U(t.type) || "Unknown") + " />", j = " Did you accidentally export a JSX literal instead of a component?") : P = typeof t, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", P, j);
|
|
592
592
|
}
|
|
593
|
-
var
|
|
594
|
-
if (
|
|
595
|
-
return
|
|
596
|
-
if (
|
|
597
|
-
var
|
|
598
|
-
if (
|
|
599
|
-
if (
|
|
600
|
-
if (
|
|
601
|
-
for (var
|
|
602
|
-
|
|
603
|
-
Object.freeze && Object.freeze(
|
|
593
|
+
var O = ra(t, i, u, C, S);
|
|
594
|
+
if (O == null)
|
|
595
|
+
return O;
|
|
596
|
+
if (w) {
|
|
597
|
+
var G = i.children;
|
|
598
|
+
if (G !== void 0)
|
|
599
|
+
if (g)
|
|
600
|
+
if ($e(G)) {
|
|
601
|
+
for (var ne = 0; ne < G.length; ne++)
|
|
602
|
+
yt(G[ne], t);
|
|
603
|
+
Object.freeze && Object.freeze(G);
|
|
604
604
|
} else
|
|
605
|
-
|
|
605
|
+
y("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
606
|
else
|
|
607
|
-
|
|
607
|
+
yt(G, t);
|
|
608
608
|
}
|
|
609
|
-
if (
|
|
610
|
-
var
|
|
611
|
-
return
|
|
612
|
-
}),
|
|
613
|
-
if (!
|
|
614
|
-
var
|
|
615
|
-
|
|
609
|
+
if (ce.call(i, "key")) {
|
|
610
|
+
var W = U(t), I = Object.keys(i).filter(function(ga) {
|
|
611
|
+
return ga !== "key";
|
|
612
|
+
}), Je = I.length > 0 ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
613
|
+
if (!jt[W + Je]) {
|
|
614
|
+
var ma = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
|
|
615
|
+
y(`A props object containing a "key" prop is being spread into JSX:
|
|
616
616
|
let props = %s;
|
|
617
617
|
<%s {...props} />
|
|
618
618
|
React keys must be passed directly to JSX without using spread:
|
|
619
619
|
let props = %s;
|
|
620
|
-
<%s key={someKey} {...props} />`,
|
|
620
|
+
<%s key={someKey} {...props} />`, Je, W, ma, W), jt[W + Je] = !0;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
return
|
|
623
|
+
return t === n ? ca(O) : oa(O), O;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
function
|
|
627
|
-
return
|
|
626
|
+
function ua(t, i, u) {
|
|
627
|
+
return wt(t, i, u, !0);
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
return
|
|
629
|
+
function da(t, i, u) {
|
|
630
|
+
return wt(t, i, u, !1);
|
|
631
631
|
}
|
|
632
|
-
var
|
|
633
|
-
|
|
634
|
-
}()),
|
|
635
|
-
}
|
|
636
|
-
process.env.NODE_ENV === "production" ? Le.exports = Ra() : Le.exports = Da();
|
|
637
|
-
var t = Le.exports;
|
|
638
|
-
const Aa = (r, i) => {
|
|
639
|
-
const a = J().getQueryData(["builder_props"]);
|
|
640
|
-
return q(a, r, i);
|
|
641
|
-
}, A = () => Aa("apiUrl", "/chai/api");
|
|
642
|
-
function H() {
|
|
643
|
-
const [r, i] = I(
|
|
644
|
-
new URLSearchParams(window.location.search)
|
|
645
|
-
);
|
|
646
|
-
return Ie(() => {
|
|
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];
|
|
632
|
+
var ha = da, fa = ua;
|
|
633
|
+
he.Fragment = n, he.jsx = ha, he.jsxs = fa;
|
|
634
|
+
}()), he;
|
|
654
635
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
data: { id: i, draft: !0 }
|
|
666
|
-
})
|
|
667
|
-
})).json()).blocks ?? [],
|
|
668
|
-
enabled: !!i
|
|
669
|
-
});
|
|
670
|
-
}, Pt = () => {
|
|
671
|
-
const r = A(), i = J(), { toast: o } = Y(), { data: a } = Tt(), [s] = H(), w = s.get("page"), c = q(
|
|
672
|
-
se(a, { _type: "@chai/ai-context" }),
|
|
673
|
-
"_value",
|
|
674
|
-
""
|
|
675
|
-
), { mutateAsync: f } = re({
|
|
676
|
-
mutationFn: async ({ page: u, aiContext: p }) => {
|
|
677
|
-
const g = {
|
|
678
|
-
_type: "@chai/ai-context",
|
|
679
|
-
_value: Ae(p) ? p : ""
|
|
680
|
-
}, m = ae(
|
|
681
|
-
a,
|
|
682
|
-
(S) => (S == null ? void 0 : S._type) !== g._type
|
|
683
|
-
);
|
|
684
|
-
return m.push(g), 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: m }
|
|
690
|
-
})
|
|
691
|
-
});
|
|
692
|
-
},
|
|
693
|
-
onSuccess: (u, { aiContext: p }) => {
|
|
694
|
-
i.setQueryData(["page", w], () => {
|
|
695
|
-
const g = {
|
|
696
|
-
_type: "@chai/ai-context",
|
|
697
|
-
_value: Ae(p) ? p : ""
|
|
698
|
-
}, m = ae(
|
|
699
|
-
a,
|
|
700
|
-
(h) => (h == null ? void 0 : h._type) !== g._type
|
|
701
|
-
);
|
|
702
|
-
return m.push(g), m;
|
|
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
|
-
}
|
|
636
|
+
process.env.NODE_ENV === "production" ? He.exports = za() : He.exports = Va();
|
|
637
|
+
var e = He.exports;
|
|
638
|
+
const Lt = (a, s) => {
|
|
639
|
+
const n = Z().getQueryData(["builder_props"]);
|
|
640
|
+
return $(n, a, s);
|
|
641
|
+
}, L = () => Lt("apiUrl", "/chai/api"), tt = () => {
|
|
642
|
+
const a = Z(), { data: s } = V({
|
|
643
|
+
queryKey: ["ai-context"],
|
|
644
|
+
initialData: "",
|
|
645
|
+
queryFn: () => ""
|
|
712
646
|
});
|
|
713
|
-
return {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
647
|
+
return { setAiContext: Xe((n) => {
|
|
648
|
+
a.setQueryData(["ai-context"], n);
|
|
649
|
+
}, []), aiContext: s };
|
|
650
|
+
}, Wa = () => {
|
|
651
|
+
const a = L(), { aiContext: s } = tt();
|
|
652
|
+
return Xe(
|
|
653
|
+
async (l, n, r, c) => {
|
|
654
|
+
const d = await (await fetch(a, {
|
|
719
655
|
method: "POST",
|
|
720
656
|
headers: {
|
|
721
657
|
"Content-Type": "application/json"
|
|
722
658
|
},
|
|
723
659
|
body: JSON.stringify({
|
|
724
660
|
action: "ASK_AI",
|
|
725
|
-
data: { type:
|
|
661
|
+
data: { type: l, prompt: n, blocks: r, context: s, lang: c }
|
|
726
662
|
})
|
|
727
663
|
})).json();
|
|
728
|
-
return console.log("data",
|
|
664
|
+
return console.log("data", d), d.error ? { error: new Error(d.error) } : d;
|
|
729
665
|
},
|
|
730
|
-
[
|
|
666
|
+
[a, s]
|
|
731
667
|
);
|
|
732
|
-
},
|
|
733
|
-
const
|
|
734
|
-
return { getUILibraryBlock: async (c,
|
|
735
|
-
const
|
|
736
|
-
c.url + (
|
|
668
|
+
}, Ja = () => {
|
|
669
|
+
const a = L(), { toast: s } = re();
|
|
670
|
+
return { getUILibraryBlock: async (c, o) => {
|
|
671
|
+
const v = (await (await fetch(
|
|
672
|
+
c.url + (o.path ? "/blocks/" + o.path : "/" + o.uuid + ".html")
|
|
737
673
|
)).text()).replace(/---([\s\S]*?)---/g, "");
|
|
738
|
-
return
|
|
674
|
+
return pa(`${v}`);
|
|
739
675
|
}, getUILibraryBlocks: async (c) => {
|
|
740
676
|
try {
|
|
741
|
-
return (await (await fetch(c.url + "/blocks.json")).json()).map((
|
|
742
|
-
...
|
|
743
|
-
preview: c.url.replace("chaiblocks", "") +
|
|
677
|
+
return (await (await fetch(c.url + "/blocks.json")).json()).map((f) => ({
|
|
678
|
+
...f,
|
|
679
|
+
preview: c.url.replace("chaiblocks", "") + f.preview
|
|
744
680
|
}));
|
|
745
|
-
} catch (
|
|
746
|
-
return console.error(
|
|
681
|
+
} catch (o) {
|
|
682
|
+
return console.error(o), [];
|
|
747
683
|
}
|
|
748
684
|
}, onSave: async ({
|
|
749
685
|
page: c,
|
|
750
|
-
blocks:
|
|
686
|
+
blocks: o
|
|
751
687
|
}) => {
|
|
752
688
|
try {
|
|
753
|
-
return (await fetch(
|
|
689
|
+
return (await fetch(a, {
|
|
754
690
|
method: "POST",
|
|
755
691
|
headers: { "Content-Type": "application/json" },
|
|
756
692
|
body: JSON.stringify({
|
|
757
693
|
action: "UPDATE_PAGE",
|
|
758
|
-
data: { id: c, blocks:
|
|
694
|
+
data: { id: c, blocks: o }
|
|
759
695
|
})
|
|
760
|
-
})).ok ? (
|
|
696
|
+
})).ok ? (s({
|
|
761
697
|
title: "Success",
|
|
762
698
|
description: "Page saved successfully",
|
|
763
699
|
variant: "default"
|
|
764
700
|
}), !0) : new Error("Failed to save blocks");
|
|
765
|
-
} catch (
|
|
766
|
-
return
|
|
701
|
+
} catch (d) {
|
|
702
|
+
return d;
|
|
767
703
|
}
|
|
768
704
|
} };
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
|
|
705
|
+
};
|
|
706
|
+
function ie() {
|
|
707
|
+
const [a, s] = R(
|
|
708
|
+
new URLSearchParams(window.location.search)
|
|
709
|
+
);
|
|
710
|
+
return ge(() => {
|
|
711
|
+
const l = () => {
|
|
712
|
+
s(new URLSearchParams(window.location.search));
|
|
713
|
+
};
|
|
714
|
+
return window.addEventListener("popstate", l), () => {
|
|
715
|
+
window.removeEventListener("popstate", l);
|
|
716
|
+
};
|
|
717
|
+
}, []), [a, s];
|
|
718
|
+
}
|
|
719
|
+
const at = () => {
|
|
720
|
+
const a = L();
|
|
721
|
+
return V({
|
|
772
722
|
queryKey: ["project-pages"],
|
|
773
|
-
|
|
774
|
-
queryFn: async () => await (await fetch(
|
|
723
|
+
staleTime: 1e3 * 60 * 5,
|
|
724
|
+
queryFn: async () => await (await fetch(a, {
|
|
775
725
|
method: "POST",
|
|
776
726
|
headers: {
|
|
777
727
|
"Content-Type": "application/json"
|
|
@@ -781,13 +731,13 @@ const Tt = () => {
|
|
|
781
731
|
})
|
|
782
732
|
})).json()
|
|
783
733
|
});
|
|
784
|
-
},
|
|
785
|
-
const [
|
|
786
|
-
return { data:
|
|
787
|
-
() =>
|
|
788
|
-
[
|
|
789
|
-
), isFetching:
|
|
790
|
-
},
|
|
734
|
+
}, De = () => {
|
|
735
|
+
const [a] = ie(), s = a.get("page"), { data: l, isFetching: n } = at();
|
|
736
|
+
return { data: z(
|
|
737
|
+
() => X(l, { id: s }) || {},
|
|
738
|
+
[l, s]
|
|
739
|
+
), isFetching: n };
|
|
740
|
+
}, Ya = () => V({
|
|
791
741
|
queryKey: ["uiLibraries"],
|
|
792
742
|
initialData: [],
|
|
793
743
|
queryFn: async () => [
|
|
@@ -802,97 +752,78 @@ const Tt = () => {
|
|
|
802
752
|
url: "https://chaibuilder.com/chaiblocks"
|
|
803
753
|
}
|
|
804
754
|
]
|
|
805
|
-
}),
|
|
806
|
-
|
|
755
|
+
}), Qa = () => {
|
|
756
|
+
const [a] = ie(), s = a.get("page"), l = L(), { setAiContext: n } = tt();
|
|
757
|
+
return V({
|
|
758
|
+
queryKey: ["page", s],
|
|
759
|
+
initialData: [],
|
|
760
|
+
queryFn: async () => {
|
|
761
|
+
const o = (await (await fetch(`${l}`, {
|
|
762
|
+
method: "POST",
|
|
763
|
+
headers: { "Content-Type": "application/json" },
|
|
764
|
+
body: JSON.stringify({
|
|
765
|
+
action: "GET_PAGE",
|
|
766
|
+
data: { id: s, draft: !0 }
|
|
767
|
+
})
|
|
768
|
+
})).json()).blocks ?? [], d = X(o, { _type: "@chai/ai-context" });
|
|
769
|
+
return n($(d, "_value", "") || ""), o;
|
|
770
|
+
},
|
|
771
|
+
enabled: !!s
|
|
772
|
+
});
|
|
773
|
+
}, Ha = (a) => z(() => {
|
|
774
|
+
if (!a || D(a))
|
|
807
775
|
return {
|
|
808
776
|
blocks: [],
|
|
809
777
|
theme: {}
|
|
810
778
|
};
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
(
|
|
779
|
+
const s = X(a, { _type: "@chai/theme" }), l = $(s, "_value", {}) || {}, n = B(
|
|
780
|
+
a,
|
|
781
|
+
(r) => !fe(r == null ? void 0 : r._type, "@chai/")
|
|
814
782
|
);
|
|
815
|
-
return { theme:
|
|
816
|
-
}, [
|
|
817
|
-
const
|
|
818
|
-
return
|
|
819
|
-
queryKey: ["
|
|
820
|
-
initialData: {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
783
|
+
return { theme: l, blocks: n };
|
|
784
|
+
}, [a]), It = () => {
|
|
785
|
+
const a = L();
|
|
786
|
+
return V({
|
|
787
|
+
queryKey: ["website-settings"],
|
|
788
|
+
initialData: {
|
|
789
|
+
theme: {},
|
|
790
|
+
fallbackLang: "",
|
|
791
|
+
languages: []
|
|
792
|
+
},
|
|
793
|
+
queryFn: async () => {
|
|
794
|
+
const l = await (await fetch(a, {
|
|
795
|
+
method: "POST",
|
|
796
|
+
headers: {
|
|
797
|
+
"Content-Type": "application/json"
|
|
798
|
+
},
|
|
799
|
+
body: JSON.stringify({ action: "GET_WEBSITE_SETTINGS" })
|
|
800
|
+
})).json();
|
|
801
|
+
if (l != null && l.error) throw new Error(l.error);
|
|
802
|
+
return l;
|
|
803
|
+
}
|
|
828
804
|
});
|
|
829
|
-
},
|
|
830
|
-
const { data:
|
|
805
|
+
}, Xa = () => {
|
|
806
|
+
const { data: a } = at(), s = L();
|
|
831
807
|
return {
|
|
832
808
|
getGlobalBlocks: async () => {
|
|
833
|
-
const
|
|
834
|
-
for (const
|
|
835
|
-
|
|
836
|
-
name:
|
|
809
|
+
const l = {};
|
|
810
|
+
for (const n of a ?? [])
|
|
811
|
+
D(n == null ? void 0 : n.slug) && (l[n.id] = {
|
|
812
|
+
name: Fe(n.name ?? n.slug),
|
|
837
813
|
description: ""
|
|
838
814
|
});
|
|
839
|
-
return
|
|
815
|
+
return l;
|
|
840
816
|
},
|
|
841
|
-
getGlobalBlockBlocks: async (
|
|
817
|
+
getGlobalBlockBlocks: async (l) => l ? (await (await fetch(`${s}`, {
|
|
842
818
|
method: "POST",
|
|
843
819
|
headers: { "Content-Type": "application/json" },
|
|
844
820
|
body: JSON.stringify({
|
|
845
821
|
action: "GET_PAGE",
|
|
846
|
-
data: { id:
|
|
822
|
+
data: { id: l, draft: !0 }
|
|
847
823
|
})
|
|
848
824
|
})).json()).blocks : []
|
|
849
825
|
};
|
|
850
|
-
},
|
|
851
|
-
const r = A();
|
|
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 = A(), { toast: i } = Y();
|
|
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
|
-
}, qe = () => {
|
|
878
|
-
const r = A(), [i] = H(), 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 ka(Ta(s, "primaryPage"));
|
|
893
|
-
}
|
|
894
|
-
});
|
|
895
|
-
}, ye = {
|
|
826
|
+
}, Za = () => ({ uploadFile: async (s) => (console.log("uploadFile", s), {}) }), me = {
|
|
896
827
|
ab: "Abkhazian",
|
|
897
828
|
aa: "Afar",
|
|
898
829
|
af: "Afrikaans",
|
|
@@ -1080,99 +1011,181 @@ const Tt = () => {
|
|
|
1080
1011
|
yo: "Yoruba",
|
|
1081
1012
|
za: "Zhuang, Chuang",
|
|
1082
1013
|
zu: "Zulu"
|
|
1083
|
-
},
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
1086
|
-
mutationFn: async (
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1014
|
+
}, Bt = () => {
|
|
1015
|
+
const a = L(), s = Z(), { toast: l } = re();
|
|
1016
|
+
return se({
|
|
1017
|
+
mutationFn: async (n) => {
|
|
1018
|
+
var o;
|
|
1019
|
+
const c = await (await fetch(a, {
|
|
1020
|
+
method: "POST",
|
|
1021
|
+
headers: {
|
|
1022
|
+
"Content-Type": "application/json"
|
|
1023
|
+
},
|
|
1024
|
+
body: JSON.stringify({
|
|
1025
|
+
action: "CREATE_PAGE",
|
|
1026
|
+
data: n
|
|
1027
|
+
})
|
|
1028
|
+
})).json();
|
|
1029
|
+
if (c != null && c.error)
|
|
1030
|
+
throw new Error(((o = c == null ? void 0 : c.error) == null ? void 0 : o.message) || "Something went wrong.");
|
|
1031
|
+
return c;
|
|
1032
|
+
},
|
|
1033
|
+
onSuccess: (n, r) => {
|
|
1034
|
+
r && (r != null && r.primaryPage) ? s.invalidateQueries({
|
|
1035
|
+
queryKey: ["language-pages", r == null ? void 0 : r.primaryPage]
|
|
1036
|
+
}) : s.invalidateQueries({ queryKey: ["project-pages"] }), l({
|
|
1037
|
+
title: `New ${r.global ? "global block" : "page"} added successfully.`
|
|
1101
1038
|
});
|
|
1102
1039
|
},
|
|
1103
|
-
onError: (
|
|
1104
|
-
|
|
1040
|
+
onError: (n, r) => {
|
|
1041
|
+
l({
|
|
1105
1042
|
variant: "destructive",
|
|
1106
|
-
title: `Failed to add new ${
|
|
1107
|
-
description:
|
|
1043
|
+
title: `Failed to add new ${r.global ? "global block" : "page"}.`,
|
|
1044
|
+
description: n.message
|
|
1108
1045
|
});
|
|
1109
1046
|
}
|
|
1110
1047
|
});
|
|
1111
|
-
},
|
|
1112
|
-
const
|
|
1113
|
-
return
|
|
1114
|
-
mutationFn: async (
|
|
1048
|
+
}, nt = () => {
|
|
1049
|
+
const a = L(), s = Z(), { toast: l } = re();
|
|
1050
|
+
return se({
|
|
1051
|
+
mutationFn: async (n) => (await fetch(a, {
|
|
1115
1052
|
method: "POST",
|
|
1116
1053
|
headers: {
|
|
1117
1054
|
"Content-Type": "application/json"
|
|
1118
1055
|
},
|
|
1119
1056
|
body: JSON.stringify({
|
|
1120
1057
|
action: "UPDATE_PAGE",
|
|
1121
|
-
data:
|
|
1058
|
+
data: n
|
|
1122
1059
|
})
|
|
1123
1060
|
})).json(),
|
|
1124
|
-
onSuccess: (
|
|
1125
|
-
|
|
1126
|
-
queryKey: ["language-pages",
|
|
1127
|
-
}) :
|
|
1061
|
+
onSuccess: (n, r) => {
|
|
1062
|
+
r && (r != null && r.primaryPage || r != null && r.seo) ? s.invalidateQueries({
|
|
1063
|
+
queryKey: ["language-pages", r == null ? void 0 : r.primaryPage]
|
|
1064
|
+
}) : s.invalidateQueries({ queryKey: ["project-pages"] }), r != null && r.seo ? l({
|
|
1128
1065
|
title: "SEO Settings updated successfully."
|
|
1129
|
-
}) :
|
|
1130
|
-
title: `${
|
|
1066
|
+
}) : l({
|
|
1067
|
+
title: `${r.global ? "Global block" : "Page"} updated successfully.`
|
|
1131
1068
|
});
|
|
1132
1069
|
},
|
|
1133
|
-
onError: (
|
|
1134
|
-
|
|
1070
|
+
onError: (n, r) => {
|
|
1071
|
+
l({
|
|
1135
1072
|
variant: "destructive",
|
|
1136
|
-
title: `Failed to update ${
|
|
1137
|
-
description:
|
|
1073
|
+
title: `Failed to update ${r.global ? "global block" : "page"}.`,
|
|
1074
|
+
description: n.message
|
|
1138
1075
|
});
|
|
1139
1076
|
}
|
|
1140
1077
|
});
|
|
1141
|
-
},
|
|
1142
|
-
const
|
|
1143
|
-
return
|
|
1144
|
-
mutationFn: async (
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1078
|
+
}, Ut = () => {
|
|
1079
|
+
const a = L(), s = Z(), { toast: l } = re();
|
|
1080
|
+
return se({
|
|
1081
|
+
mutationFn: async (n) => {
|
|
1082
|
+
const c = await (await fetch(a, {
|
|
1083
|
+
method: "POST",
|
|
1084
|
+
headers: {
|
|
1085
|
+
"Content-Type": "application/json"
|
|
1086
|
+
},
|
|
1087
|
+
body: JSON.stringify({
|
|
1088
|
+
action: "DELETE_PAGE",
|
|
1089
|
+
data: { id: n == null ? void 0 : n.id }
|
|
1090
|
+
})
|
|
1091
|
+
})).json();
|
|
1092
|
+
if (c != null && c.error) throw c == null ? void 0 : c.error;
|
|
1093
|
+
return c;
|
|
1094
|
+
},
|
|
1095
|
+
onSuccess: (n, r) => {
|
|
1096
|
+
r && (r != null && r.primaryPage) ? s.invalidateQueries({
|
|
1097
|
+
queryKey: ["language-pages", r == null ? void 0 : r.primaryPage]
|
|
1098
|
+
}) : s.invalidateQueries({ queryKey: ["project-pages"] }), l({
|
|
1099
|
+
title: `${r.global ? "Global block" : "Page"} deleted successfully.`
|
|
1100
|
+
});
|
|
1101
|
+
},
|
|
1102
|
+
onError: (n, r) => {
|
|
1103
|
+
l({
|
|
1104
|
+
variant: "destructive",
|
|
1105
|
+
title: `Failed to delete ${r.global ? "global block" : "page"}.`,
|
|
1106
|
+
description: n.message
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
});
|
|
1110
|
+
}, en = () => {
|
|
1111
|
+
const a = L(), s = Z(), { toast: l } = re();
|
|
1112
|
+
return se({
|
|
1113
|
+
mutationFn: async (n) => {
|
|
1114
|
+
const c = await (await fetch(a, {
|
|
1115
|
+
method: "POST",
|
|
1116
|
+
headers: {
|
|
1117
|
+
"Content-Type": "application/json"
|
|
1118
|
+
},
|
|
1119
|
+
body: JSON.stringify({
|
|
1120
|
+
action: "TAKE_OFFLINE",
|
|
1121
|
+
data: { id: n == null ? void 0 : n.id }
|
|
1122
|
+
})
|
|
1123
|
+
})).json();
|
|
1124
|
+
if (c != null && c.error) throw c == null ? void 0 : c.error;
|
|
1125
|
+
return c;
|
|
1126
|
+
},
|
|
1127
|
+
onSuccess: (n, r) => {
|
|
1128
|
+
r && (r != null && r.primaryPage) ? s.invalidateQueries({
|
|
1129
|
+
queryKey: ["language-pages", r == null ? void 0 : r.primaryPage]
|
|
1130
|
+
}) : s.invalidateQueries({ queryKey: ["project-pages"] }), l({
|
|
1131
|
+
title: `${r.global ? "Global block" : "Page"} taken offline successfully.`
|
|
1159
1132
|
});
|
|
1160
1133
|
},
|
|
1161
|
-
onError: (
|
|
1162
|
-
|
|
1134
|
+
onError: (n, r) => {
|
|
1135
|
+
l({
|
|
1163
1136
|
variant: "destructive",
|
|
1164
|
-
title: `Failed to
|
|
1165
|
-
description:
|
|
1137
|
+
title: `Failed to take offline ${r.global ? "global block" : "page"}.`,
|
|
1138
|
+
description: n.message
|
|
1166
1139
|
});
|
|
1167
1140
|
}
|
|
1168
1141
|
});
|
|
1169
|
-
},
|
|
1170
|
-
const
|
|
1171
|
-
return
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1142
|
+
}, tn = () => {
|
|
1143
|
+
const a = L(), { toast: s } = re(), l = Z();
|
|
1144
|
+
return se({
|
|
1145
|
+
mutationFn: async ({ ids: n, theme: r }) => {
|
|
1146
|
+
const o = await (await fetch(`${a}`, {
|
|
1147
|
+
method: "POST",
|
|
1148
|
+
headers: { "Content-Type": "application/json" },
|
|
1149
|
+
body: JSON.stringify({
|
|
1150
|
+
action: "PUBLISH_CHANGES",
|
|
1151
|
+
data: { ids: n, theme: r }
|
|
1152
|
+
})
|
|
1153
|
+
})).json();
|
|
1154
|
+
if (o != null && o.error) throw o == null ? void 0 : o.error;
|
|
1155
|
+
return o;
|
|
1156
|
+
},
|
|
1157
|
+
onSuccess: () => {
|
|
1158
|
+
s({ title: "Pages published" }), l.invalidateQueries({ queryKey: ["get-page-changes"] }), l.invalidateQueries({ queryKey: ["project-pages"] });
|
|
1159
|
+
},
|
|
1160
|
+
onError: () => {
|
|
1161
|
+
s({ title: "Failed to publish pages.", variant: "destructive" });
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
}, Gt = () => {
|
|
1165
|
+
const a = L(), [s] = ie(), l = s.get("page");
|
|
1166
|
+
return V({
|
|
1167
|
+
queryKey: ["language-pages", l],
|
|
1168
|
+
initialData: [],
|
|
1169
|
+
queryFn: async () => {
|
|
1170
|
+
if (!l) return null;
|
|
1171
|
+
const r = await (await fetch(a, {
|
|
1172
|
+
method: "POST",
|
|
1173
|
+
headers: { "Content-Type": "application/json" },
|
|
1174
|
+
body: JSON.stringify({
|
|
1175
|
+
action: "GET_LANGUAGE_PAGES",
|
|
1176
|
+
data: { id: l }
|
|
1177
|
+
})
|
|
1178
|
+
})).json();
|
|
1179
|
+
return Ua(Ga(r, "primaryPage"));
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
}, an = () => {
|
|
1183
|
+
const { selectedLang: a } = Ze(), { data: s, isFetching: l } = Gt();
|
|
1184
|
+
return { data: z(() => X(s, { lang: a || "" }) || {}, [s, a]), isFetching: l };
|
|
1185
|
+
}, Mt = () => {
|
|
1186
|
+
const { data: a, isFetching: s } = an(), l = a == null ? void 0 : a.seo, [n, r] = R({
|
|
1187
|
+
title: "",
|
|
1188
|
+
description: "",
|
|
1176
1189
|
cononicalUrl: "",
|
|
1177
1190
|
noIndex: !1,
|
|
1178
1191
|
noFollow: "",
|
|
@@ -1182,12 +1195,12 @@ const Tt = () => {
|
|
|
1182
1195
|
searchTitle: "",
|
|
1183
1196
|
searchDescription: "",
|
|
1184
1197
|
jsonLD: "",
|
|
1185
|
-
...
|
|
1186
|
-
}),
|
|
1187
|
-
|
|
1188
|
-
!
|
|
1189
|
-
|
|
1190
|
-
|
|
1198
|
+
...l
|
|
1199
|
+
}), c = At({ initial: n, updated: n }), { selectedLang: o, fallbackLang: d, languages: f } = Ze(), v = o.length ? o : d, { mutate: b, isPending: E } = nt(), p = E;
|
|
1200
|
+
ge(() => {
|
|
1201
|
+
!s && l && r({
|
|
1202
|
+
title: "",
|
|
1203
|
+
description: "",
|
|
1191
1204
|
cononicalUrl: "",
|
|
1192
1205
|
noIndex: !1,
|
|
1193
1206
|
noFollow: "",
|
|
@@ -1197,629 +1210,828 @@ const Tt = () => {
|
|
|
1197
1210
|
searchTitle: "",
|
|
1198
1211
|
searchDescription: "",
|
|
1199
1212
|
jsonLD: "",
|
|
1200
|
-
...
|
|
1213
|
+
...l
|
|
1201
1214
|
});
|
|
1202
|
-
}, [
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1205
|
-
},
|
|
1206
|
-
|
|
1207
|
-
...
|
|
1208
|
-
ogTitle:
|
|
1209
|
-
ogDescription:
|
|
1215
|
+
}, [s, l]);
|
|
1216
|
+
const k = async () => {
|
|
1217
|
+
b({ id: a == null ? void 0 : a.id, seo: n }), c.current.initial = n, c.current.updated = n;
|
|
1218
|
+
}, N = () => {
|
|
1219
|
+
r({
|
|
1220
|
+
...n,
|
|
1221
|
+
ogTitle: n.title,
|
|
1222
|
+
ogDescription: n.description
|
|
1210
1223
|
});
|
|
1211
|
-
},
|
|
1212
|
-
|
|
1213
|
-
...
|
|
1214
|
-
searchTitle:
|
|
1215
|
-
searchDescription:
|
|
1224
|
+
}, m = () => {
|
|
1225
|
+
r({
|
|
1226
|
+
...n,
|
|
1227
|
+
searchTitle: n.ogTitle,
|
|
1228
|
+
searchDescription: n.ogDescription
|
|
1216
1229
|
});
|
|
1217
|
-
},
|
|
1218
|
-
const
|
|
1219
|
-
...
|
|
1220
|
-
[
|
|
1230
|
+
}, x = (h) => {
|
|
1231
|
+
const y = {
|
|
1232
|
+
...n,
|
|
1233
|
+
[h.target.name]: h.target.name === "noIndex" || h.target.name === "noFollow" ? h.target.checked : h.target.value
|
|
1221
1234
|
};
|
|
1222
|
-
|
|
1235
|
+
r(y), c.current.updated = y;
|
|
1223
1236
|
};
|
|
1224
|
-
return /* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
1226
|
-
"
|
|
1227
|
-
|
|
1228
|
-
|
|
1237
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "relative pb-40", children: [
|
|
1238
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-xs bg-gray-100 p-2 rounded-md text-left", children: [
|
|
1239
|
+
"Slug: ",
|
|
1240
|
+
a == null ? void 0 : a.slug,
|
|
1241
|
+
" ",
|
|
1242
|
+
f.length > 0 && /* @__PURE__ */ e.jsxs("span", { className: "text-blue-500 font-semibold", children: [
|
|
1243
|
+
"(",
|
|
1244
|
+
$(me, v, v),
|
|
1245
|
+
")"
|
|
1246
|
+
] })
|
|
1229
1247
|
] }),
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
|
|
1248
|
+
/* @__PURE__ */ e.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ e.jsxs(et, { type: "multiple", defaultValue: ["page"], children: [
|
|
1249
|
+
/* @__PURE__ */ e.jsxs(J, { value: "page", children: [
|
|
1250
|
+
/* @__PURE__ */ e.jsx(Y, { className: "text-blue-500", children: "Seo Page" }),
|
|
1251
|
+
/* @__PURE__ */ e.jsx(Q, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1252
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1253
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "title", children: "SEO Title" }),
|
|
1254
|
+
/* @__PURE__ */ e.jsx(
|
|
1255
|
+
q,
|
|
1238
1256
|
{
|
|
1239
1257
|
type: "text",
|
|
1240
|
-
id: "
|
|
1241
|
-
name: "
|
|
1242
|
-
value:
|
|
1243
|
-
onChange:
|
|
1244
|
-
disabled:
|
|
1258
|
+
id: "title",
|
|
1259
|
+
name: "title",
|
|
1260
|
+
value: n.title,
|
|
1261
|
+
onChange: x,
|
|
1262
|
+
disabled: p,
|
|
1245
1263
|
placeholder: "Enter SEO title"
|
|
1246
1264
|
}
|
|
1247
1265
|
),
|
|
1248
|
-
/* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The title should be between 10 and 60 characters." })
|
|
1249
1267
|
] }),
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
/* @__PURE__ */
|
|
1253
|
-
|
|
1268
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1269
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "description", children: "SEO Description" }),
|
|
1270
|
+
/* @__PURE__ */ e.jsx(
|
|
1271
|
+
Oe,
|
|
1254
1272
|
{
|
|
1255
|
-
id: "
|
|
1256
|
-
name: "
|
|
1257
|
-
value:
|
|
1258
|
-
onChange:
|
|
1259
|
-
disabled:
|
|
1273
|
+
id: "description",
|
|
1274
|
+
name: "description",
|
|
1275
|
+
value: n.description,
|
|
1276
|
+
onChange: x,
|
|
1277
|
+
disabled: p,
|
|
1260
1278
|
placeholder: "Enter SEO description"
|
|
1261
1279
|
}
|
|
1262
1280
|
),
|
|
1263
|
-
/* @__PURE__ */
|
|
1281
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The description should be between 50 and 160 characters." })
|
|
1264
1282
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
/* @__PURE__ */
|
|
1268
|
-
|
|
1283
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1284
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "title", children: "Canonical URL" }),
|
|
1285
|
+
/* @__PURE__ */ e.jsx(
|
|
1286
|
+
q,
|
|
1269
1287
|
{
|
|
1270
1288
|
type: "text",
|
|
1271
1289
|
id: "canonicalUrl",
|
|
1272
1290
|
name: "canonicalUrl",
|
|
1273
|
-
value:
|
|
1274
|
-
onChange:
|
|
1275
|
-
disabled:
|
|
1291
|
+
value: n.canonicalUrl,
|
|
1292
|
+
onChange: x,
|
|
1293
|
+
disabled: p,
|
|
1276
1294
|
placeholder: "Enter Canonical URL"
|
|
1277
1295
|
}
|
|
1278
1296
|
)
|
|
1279
1297
|
] }),
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
|
|
1298
|
+
/* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
1299
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1300
|
+
/* @__PURE__ */ e.jsx(
|
|
1301
|
+
q,
|
|
1284
1302
|
{
|
|
1285
1303
|
type: "checkbox",
|
|
1286
1304
|
id: "noIndex",
|
|
1287
1305
|
name: "noIndex",
|
|
1288
|
-
checked:
|
|
1289
|
-
onChange:
|
|
1290
|
-
disabled:
|
|
1306
|
+
checked: n.noIndex,
|
|
1307
|
+
onChange: x,
|
|
1308
|
+
disabled: p,
|
|
1291
1309
|
className: "h-4 w-4"
|
|
1292
1310
|
}
|
|
1293
1311
|
),
|
|
1294
|
-
/* @__PURE__ */
|
|
1312
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Index" })
|
|
1295
1313
|
] }),
|
|
1296
|
-
/* @__PURE__ */
|
|
1314
|
+
/* @__PURE__ */ e.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
1315
|
] }),
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1316
|
+
/* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
1317
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1318
|
+
/* @__PURE__ */ e.jsx(
|
|
1319
|
+
q,
|
|
1320
|
+
{
|
|
1321
|
+
type: "checkbox",
|
|
1322
|
+
id: "noFollow",
|
|
1323
|
+
name: "noFollow",
|
|
1324
|
+
checked: n.noFollow,
|
|
1325
|
+
onChange: x,
|
|
1326
|
+
disabled: p,
|
|
1327
|
+
className: "h-4 w-4"
|
|
1328
|
+
}
|
|
1329
|
+
),
|
|
1330
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Follow" })
|
|
1331
|
+
] }),
|
|
1332
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-2 text-[10px] font-light text-gray-400", children: "Check this if you don't want search engines to follow links on this page." })
|
|
1312
1333
|
] })
|
|
1313
1334
|
] }) })
|
|
1314
1335
|
] }),
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
|
|
1336
|
+
/* @__PURE__ */ e.jsxs(J, { value: "og", children: [
|
|
1337
|
+
/* @__PURE__ */ e.jsx(Y, { className: "text-blue-500", children: "OG" }),
|
|
1338
|
+
/* @__PURE__ */ e.jsx(Q, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1339
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsx(
|
|
1340
|
+
_,
|
|
1320
1341
|
{
|
|
1321
1342
|
type: "button",
|
|
1322
1343
|
variant: "outline",
|
|
1323
1344
|
size: "sm",
|
|
1324
|
-
onClick:
|
|
1345
|
+
onClick: N,
|
|
1325
1346
|
children: "Copy from SEO Settings"
|
|
1326
1347
|
}
|
|
1327
1348
|
) }),
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
|
|
1349
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1350
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "ogTitle", children: "OG Title" }),
|
|
1351
|
+
/* @__PURE__ */ e.jsx(
|
|
1352
|
+
q,
|
|
1332
1353
|
{
|
|
1333
1354
|
type: "text",
|
|
1334
1355
|
id: "ogTitle",
|
|
1335
1356
|
name: "ogTitle",
|
|
1336
|
-
value:
|
|
1337
|
-
onChange:
|
|
1338
|
-
disabled:
|
|
1357
|
+
value: n.ogTitle,
|
|
1358
|
+
onChange: x,
|
|
1359
|
+
disabled: p,
|
|
1339
1360
|
placeholder: "Enter OG title"
|
|
1340
1361
|
}
|
|
1341
1362
|
),
|
|
1342
|
-
/* @__PURE__ */
|
|
1363
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG title should be between 10 and 60 characters." })
|
|
1343
1364
|
] }),
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
|
|
1365
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
|
|
1366
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "ogDescription", children: "OG Description" }),
|
|
1367
|
+
/* @__PURE__ */ e.jsx(
|
|
1368
|
+
Oe,
|
|
1348
1369
|
{
|
|
1349
1370
|
id: "ogDescription",
|
|
1350
1371
|
name: "ogDescription",
|
|
1351
|
-
value:
|
|
1352
|
-
onChange:
|
|
1353
|
-
disabled:
|
|
1372
|
+
value: n.ogDescription,
|
|
1373
|
+
onChange: x,
|
|
1374
|
+
disabled: p,
|
|
1354
1375
|
placeholder: "Enter OG description"
|
|
1355
1376
|
}
|
|
1356
1377
|
),
|
|
1357
|
-
/* @__PURE__ */
|
|
1378
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG description should be between 50 and 160 characters." })
|
|
1358
1379
|
] }),
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
|
|
1380
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
|
|
1381
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "ogImage", children: "OG Image URL" }),
|
|
1382
|
+
/* @__PURE__ */ e.jsx(
|
|
1383
|
+
q,
|
|
1363
1384
|
{
|
|
1364
1385
|
type: "text",
|
|
1365
1386
|
id: "ogImage",
|
|
1366
1387
|
name: "ogImage",
|
|
1367
|
-
value:
|
|
1368
|
-
onChange:
|
|
1369
|
-
disabled:
|
|
1388
|
+
value: n.ogImage,
|
|
1389
|
+
onChange: x,
|
|
1390
|
+
disabled: p,
|
|
1370
1391
|
placeholder: "Enter OG image URL"
|
|
1371
1392
|
}
|
|
1372
1393
|
),
|
|
1373
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "Enter a valid URL for the OG image." })
|
|
1374
1395
|
] })
|
|
1375
1396
|
] }) })
|
|
1376
1397
|
] }),
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
|
|
1398
|
+
/* @__PURE__ */ e.jsxs(J, { value: "search", children: [
|
|
1399
|
+
/* @__PURE__ */ e.jsx(Y, { className: "text-blue-500", children: "Search" }),
|
|
1400
|
+
/* @__PURE__ */ e.jsx(Q, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1401
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsx(
|
|
1402
|
+
_,
|
|
1382
1403
|
{
|
|
1383
1404
|
type: "button",
|
|
1384
1405
|
variant: "outline",
|
|
1385
1406
|
size: "sm",
|
|
1386
|
-
onClick:
|
|
1407
|
+
onClick: m,
|
|
1387
1408
|
children: "Copy from OG Settings"
|
|
1388
1409
|
}
|
|
1389
1410
|
) }),
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
|
|
1411
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1412
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "searchTitle", children: "Search Title" }),
|
|
1413
|
+
/* @__PURE__ */ e.jsx(
|
|
1414
|
+
q,
|
|
1394
1415
|
{
|
|
1395
1416
|
type: "text",
|
|
1396
1417
|
id: "searchTitle",
|
|
1397
1418
|
name: "searchTitle",
|
|
1398
|
-
value:
|
|
1399
|
-
onChange:
|
|
1400
|
-
disabled:
|
|
1419
|
+
value: n.searchTitle,
|
|
1420
|
+
onChange: x,
|
|
1421
|
+
disabled: p,
|
|
1401
1422
|
placeholder: "Enter search title"
|
|
1402
1423
|
}
|
|
1403
1424
|
),
|
|
1404
|
-
/* @__PURE__ */
|
|
1425
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search title should be between 10 and 60 characters." })
|
|
1405
1426
|
] }),
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
|
|
1427
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1428
|
+
/* @__PURE__ */ e.jsx(A, { className: "text-xs pb-1", htmlFor: "searchDescription", children: "Search Description" }),
|
|
1429
|
+
/* @__PURE__ */ e.jsx(
|
|
1430
|
+
Oe,
|
|
1410
1431
|
{
|
|
1411
1432
|
id: "searchDescription",
|
|
1412
1433
|
name: "searchDescription",
|
|
1413
|
-
value:
|
|
1414
|
-
onChange:
|
|
1434
|
+
value: n.searchDescription,
|
|
1435
|
+
onChange: x,
|
|
1415
1436
|
placeholder: "Enter search description"
|
|
1416
1437
|
}
|
|
1417
1438
|
),
|
|
1418
|
-
/* @__PURE__ */
|
|
1439
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search description should be between 50 and 160 characters." })
|
|
1419
1440
|
] })
|
|
1420
1441
|
] }) })
|
|
1421
1442
|
] }),
|
|
1422
|
-
/* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
|
|
1443
|
+
/* @__PURE__ */ e.jsxs(J, { value: "jsonLD", children: [
|
|
1444
|
+
/* @__PURE__ */ e.jsx(Y, { className: "text-blue-500", children: "JSON-LD" }),
|
|
1445
|
+
/* @__PURE__ */ e.jsx(Q, { children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
1446
|
+
Oe,
|
|
1426
1447
|
{
|
|
1427
1448
|
id: "jsonLD",
|
|
1428
1449
|
name: "jsonLD",
|
|
1429
1450
|
rows: 3,
|
|
1430
|
-
value:
|
|
1431
|
-
onChange:
|
|
1451
|
+
value: n.jsonLD,
|
|
1452
|
+
onChange: x,
|
|
1432
1453
|
placeholder: "Enter JSON-LD"
|
|
1433
1454
|
}
|
|
1434
1455
|
) }) }) })
|
|
1435
1456
|
] })
|
|
1436
1457
|
] }) }),
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
|
|
1458
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-end mt-4", children: /* @__PURE__ */ e.jsx(
|
|
1459
|
+
_,
|
|
1439
1460
|
{
|
|
1440
1461
|
size: "lg",
|
|
1441
1462
|
variant: "default",
|
|
1442
|
-
onClick:
|
|
1443
|
-
disabled:
|
|
1444
|
-
children:
|
|
1463
|
+
onClick: k,
|
|
1464
|
+
disabled: _e(c.current.initial, n) || p,
|
|
1465
|
+
children: E ? "Saving..." : "Save"
|
|
1445
1466
|
}
|
|
1446
1467
|
) })
|
|
1447
1468
|
] });
|
|
1448
1469
|
};
|
|
1449
|
-
|
|
1450
|
-
const
|
|
1451
|
-
langProps:
|
|
1452
|
-
onClose:
|
|
1453
|
-
|
|
1470
|
+
Mt.displayName = "SeoPanel";
|
|
1471
|
+
const nn = ({
|
|
1472
|
+
langProps: a,
|
|
1473
|
+
onClose: s,
|
|
1474
|
+
languages: l
|
|
1454
1475
|
}) => {
|
|
1455
|
-
const { data:
|
|
1456
|
-
|
|
1457
|
-
(
|
|
1458
|
-
), D = () => {
|
|
1459
|
-
r.edit ? h(
|
|
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
|
-
) : g(
|
|
1469
|
-
{
|
|
1470
|
-
name: s,
|
|
1471
|
-
slug: u,
|
|
1472
|
-
lang: c,
|
|
1473
|
-
primaryPage: a == null ? void 0 : a.id
|
|
1474
|
-
},
|
|
1475
|
-
{ onSuccess: i }
|
|
1476
|
-
);
|
|
1476
|
+
const { data: n } = De(), [r, c] = R(a.name || ""), [o, d] = R(a.edit ? a.lang : ""), [f, v] = R(a.edit ? a.slug : ""), { mutate: b, isPending: E } = Bt(), { mutate: p, isPending: k } = nt(), N = !!(a != null && a.global), m = E || k, x = () => {
|
|
1477
|
+
const h = { name: r, lang: o, primaryPage: n == null ? void 0 : n.id, slug: f };
|
|
1478
|
+
h.global = N, a.edit && (h.id = a == null ? void 0 : a.id), a.edit ? p(h, { onSuccess: s }) : b(h, { onSuccess: s });
|
|
1477
1479
|
};
|
|
1478
|
-
return /* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ e.jsx(xe, { open: !!a, onOpenChange: s, children: /* @__PURE__ */ e.jsxs(pe, { className: "sm:max-w-[425px]", children: [
|
|
1481
|
+
/* @__PURE__ */ e.jsxs(ve, { children: [
|
|
1482
|
+
/* @__PURE__ */ e.jsx(be, { children: a.edit ? "Edit language" : "Add New language" }),
|
|
1483
|
+
/* @__PURE__ */ e.jsx(ye, { children: "Enter the details for the language" })
|
|
1482
1484
|
] }),
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1485
|
+
/* @__PURE__ */ e.jsxs("form", { children: [
|
|
1486
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1487
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1488
|
+
/* @__PURE__ */ e.jsx(A, { htmlFor: "lang", className: "text-right", children: "Language" }),
|
|
1489
|
+
/* @__PURE__ */ e.jsxs(
|
|
1488
1490
|
"select",
|
|
1489
1491
|
{
|
|
1490
|
-
value:
|
|
1491
|
-
disabled:
|
|
1492
|
-
onChange: (
|
|
1492
|
+
value: o,
|
|
1493
|
+
disabled: a.edit || D(l),
|
|
1494
|
+
onChange: (h) => {
|
|
1495
|
+
const y = h.target.value;
|
|
1496
|
+
d(y), !N && v(`/${y}`);
|
|
1497
|
+
},
|
|
1493
1498
|
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
1499
|
children: [
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
|
|
1500
|
+
/* @__PURE__ */ e.jsx("option", { value: "", disabled: !0, selected: !0, children: a.edit ? $(me, a.lang, a.lang) : D(l) ? "All available language page is created." : "Choose language" }),
|
|
1501
|
+
H(l, (h) => /* @__PURE__ */ e.jsx("option", { value: h, children: $(me, h, h) }, h))
|
|
1497
1502
|
]
|
|
1498
1503
|
}
|
|
1499
1504
|
)
|
|
1500
1505
|
] }),
|
|
1501
|
-
/* @__PURE__ */
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
|
|
1506
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1507
|
+
/* @__PURE__ */ e.jsx(A, { htmlFor: "slug", className: "text-right", children: "Page Name" }),
|
|
1508
|
+
/* @__PURE__ */ e.jsx(
|
|
1509
|
+
q,
|
|
1505
1510
|
{
|
|
1506
1511
|
id: "name",
|
|
1507
|
-
value:
|
|
1508
|
-
onChange: (
|
|
1512
|
+
value: r,
|
|
1513
|
+
onChange: (h) => c(h.target.value),
|
|
1509
1514
|
className: "col-span-3",
|
|
1510
1515
|
required: !0,
|
|
1511
1516
|
placeholder: "Enter page name"
|
|
1512
1517
|
}
|
|
1513
1518
|
)
|
|
1514
1519
|
] }),
|
|
1515
|
-
/* @__PURE__ */
|
|
1516
|
-
/* @__PURE__ */
|
|
1520
|
+
!N && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1521
|
+
/* @__PURE__ */ e.jsxs(A, { htmlFor: "slug", className: "text-right", children: [
|
|
1517
1522
|
"Slug",
|
|
1518
1523
|
" ",
|
|
1519
|
-
/* @__PURE__ */
|
|
1524
|
+
/* @__PURE__ */ e.jsxs("small", { className: "font-light", children: [
|
|
1525
|
+
"(Slug should start with /",
|
|
1526
|
+
o,
|
|
1527
|
+
")"
|
|
1528
|
+
] })
|
|
1520
1529
|
] }),
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
|
|
1530
|
+
/* @__PURE__ */ e.jsx(
|
|
1531
|
+
q,
|
|
1523
1532
|
{
|
|
1524
1533
|
id: "slug",
|
|
1525
|
-
value:
|
|
1526
|
-
onChange: (
|
|
1534
|
+
value: f,
|
|
1535
|
+
onChange: (h) => {
|
|
1536
|
+
const y = h.target.value;
|
|
1537
|
+
Ct(y, `/${o}`) && v(Ma(qa(y)));
|
|
1538
|
+
},
|
|
1527
1539
|
className: "col-span-3",
|
|
1528
1540
|
required: !0,
|
|
1529
1541
|
pattern: "^/.*",
|
|
1542
|
+
disabled: D(o),
|
|
1530
1543
|
title: "Slug must start with /",
|
|
1531
|
-
placeholder: "Enter page slug"
|
|
1544
|
+
placeholder: D(o) ? "Choose language to add slug" : "Enter page slug"
|
|
1532
1545
|
}
|
|
1533
1546
|
)
|
|
1534
1547
|
] })
|
|
1535
1548
|
] }),
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
|
|
1549
|
+
/* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsx(
|
|
1550
|
+
_,
|
|
1538
1551
|
{
|
|
1539
|
-
onClick:
|
|
1552
|
+
onClick: x,
|
|
1540
1553
|
type: "button",
|
|
1541
|
-
disabled:
|
|
1542
|
-
children:
|
|
1554
|
+
disabled: m || !o || !N && !Ct(f, `/${o}`),
|
|
1555
|
+
children: m ? a.edit ? "Updating..." : "Adding..." : a.edit ? "Update" : "Add new language"
|
|
1543
1556
|
}
|
|
1544
1557
|
) })
|
|
1545
1558
|
] })
|
|
1546
1559
|
] }) });
|
|
1547
|
-
},
|
|
1548
|
-
const [
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
] })
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1560
|
+
}, sn = () => {
|
|
1561
|
+
const [a, s] = R(null), { selectedLang: l, fallbackLang: n, setSelectedLang: r } = Ze(), { data: c, isFetching: o } = Gt(), { mutate: d, isPending: f } = Ut(), { data: v } = De(), { data: b } = It(), E = B(
|
|
1562
|
+
$(b, "languages") || ["en"],
|
|
1563
|
+
(p) => !X(c, { lang: p }) && p !== $(b, "fallbackLang")
|
|
1564
|
+
);
|
|
1565
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
1566
|
+
/* @__PURE__ */ e.jsx("ul", { className: "space-y-2 mt-4", children: o ? /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1567
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1568
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1569
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1570
|
+
] }) : H(c, (p) => {
|
|
1571
|
+
const k = p.lang, N = p.slug, m = !p.primaryPage, x = k === l;
|
|
1572
|
+
return m ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1573
|
+
/* @__PURE__ */ e.jsxs(
|
|
1574
|
+
"li",
|
|
1575
|
+
{
|
|
1576
|
+
className: `w-full p-2 rounded cursor-pointer flex items-center justify-between ${x ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
1577
|
+
onClick: () => r(k),
|
|
1578
|
+
children: [
|
|
1579
|
+
/* @__PURE__ */ e.jsxs("div", { className: " flex-1 gap-x-3", children: [
|
|
1580
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-[13px]", children: $(me, m ? n : k, k) }),
|
|
1581
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1582
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1583
|
+
"Slug:",
|
|
1584
|
+
/* @__PURE__ */ e.jsxs("b", { children: [
|
|
1585
|
+
" ",
|
|
1586
|
+
N
|
|
1587
|
+
] })
|
|
1588
|
+
] }),
|
|
1589
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1590
|
+
"Name:",
|
|
1591
|
+
/* @__PURE__ */ e.jsxs("b", { children: [
|
|
1592
|
+
" ",
|
|
1593
|
+
p.name,
|
|
1594
|
+
" "
|
|
1582
1595
|
] })
|
|
1583
|
-
] })
|
|
1584
|
-
] }),
|
|
1585
|
-
S ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
1586
|
-
/* @__PURE__ */ t.jsx(wa, { fill: "orange", className: "w-3 h-3" }),
|
|
1587
|
-
/* @__PURE__ */ t.jsx("b", { children: " Default" })
|
|
1588
|
-
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1589
|
-
/* @__PURE__ */ t.jsx(
|
|
1590
|
-
Et,
|
|
1591
|
-
{
|
|
1592
|
-
onClick: (E) => {
|
|
1593
|
-
E.stopPropagation(), i({ ...g, edit: !0 });
|
|
1594
|
-
},
|
|
1595
|
-
className: "w-3 h-3 hover:text-blue-500"
|
|
1596
|
-
}
|
|
1597
|
-
),
|
|
1598
|
-
/* @__PURE__ */ t.jsxs(gt, { children: [
|
|
1599
|
-
/* @__PURE__ */ t.jsx(mt, { children: /* @__PURE__ */ t.jsx(Ct, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1600
|
-
/* @__PURE__ */ t.jsx(vt, { children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1601
|
-
/* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1602
|
-
"Are you sure you want to remove",
|
|
1603
|
-
" ",
|
|
1604
|
-
/* @__PURE__ */ t.jsx("b", { children: q(ye, m, m) }),
|
|
1605
|
-
" language?"
|
|
1606
|
-
] }),
|
|
1607
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
|
|
1608
|
-
B,
|
|
1609
|
-
{
|
|
1610
|
-
size: "sm",
|
|
1611
|
-
variant: "destructive",
|
|
1612
|
-
disabled: p,
|
|
1613
|
-
onClick: () => u(g),
|
|
1614
|
-
children: p ? "Deleting..." : "Delete"
|
|
1615
|
-
}
|
|
1616
|
-
) })
|
|
1617
|
-
] }) })
|
|
1618
1596
|
] })
|
|
1619
1597
|
] })
|
|
1620
|
-
]
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1598
|
+
] }),
|
|
1599
|
+
m ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
1600
|
+
/* @__PURE__ */ e.jsx(Ra, { fill: "orange", className: "w-3 h-3" }),
|
|
1601
|
+
/* @__PURE__ */ e.jsx("b", { children: " Default" })
|
|
1602
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1603
|
+
/* @__PURE__ */ e.jsx(
|
|
1604
|
+
Ft,
|
|
1605
|
+
{
|
|
1606
|
+
onClick: (h) => {
|
|
1607
|
+
h.stopPropagation(), s({ ...p, edit: !0 });
|
|
1608
|
+
},
|
|
1609
|
+
className: "w-3 h-3 hover:text-blue-500"
|
|
1610
|
+
}
|
|
1611
|
+
),
|
|
1612
|
+
/* @__PURE__ */ e.jsxs(wa, { children: [
|
|
1613
|
+
/* @__PURE__ */ e.jsx(Na, { children: /* @__PURE__ */ e.jsx(Dt, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1614
|
+
/* @__PURE__ */ e.jsx(Ca, { children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1615
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1616
|
+
"Are you sure you want to remove",
|
|
1617
|
+
" ",
|
|
1618
|
+
/* @__PURE__ */ e.jsx("b", { children: $(me, k, k) }),
|
|
1619
|
+
" language?"
|
|
1620
|
+
] }),
|
|
1621
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ e.jsx(
|
|
1622
|
+
_,
|
|
1623
|
+
{
|
|
1624
|
+
size: "sm",
|
|
1625
|
+
variant: "destructive",
|
|
1626
|
+
disabled: f,
|
|
1627
|
+
onClick: () => d(p),
|
|
1628
|
+
children: f ? "Deleting..." : "Delete"
|
|
1629
|
+
}
|
|
1630
|
+
) })
|
|
1631
|
+
] }) })
|
|
1632
|
+
] })
|
|
1633
|
+
] })
|
|
1634
|
+
]
|
|
1635
|
+
},
|
|
1636
|
+
p.id
|
|
1637
|
+
),
|
|
1638
|
+
/* @__PURE__ */ e.jsx("div", { className: "h-1 w-full border-b" })
|
|
1639
|
+
] });
|
|
1640
|
+
}) }),
|
|
1641
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ e.jsx(
|
|
1642
|
+
_,
|
|
1630
1643
|
{
|
|
1631
1644
|
variant: "default",
|
|
1632
1645
|
size: "sm",
|
|
1633
|
-
|
|
1646
|
+
disabled: D(E),
|
|
1647
|
+
onClick: () => {
|
|
1648
|
+
s({
|
|
1649
|
+
name: v == null ? void 0 : v.name,
|
|
1650
|
+
global: v == null ? void 0 : v.global,
|
|
1651
|
+
lang: "",
|
|
1652
|
+
slug: "",
|
|
1653
|
+
edit: !1
|
|
1654
|
+
});
|
|
1655
|
+
},
|
|
1634
1656
|
children: "+ Add new language"
|
|
1635
1657
|
}
|
|
1636
1658
|
) }),
|
|
1637
|
-
|
|
1638
|
-
|
|
1659
|
+
a && /* @__PURE__ */ e.jsx(
|
|
1660
|
+
nn,
|
|
1639
1661
|
{
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
onClose: () =>
|
|
1662
|
+
languages: E,
|
|
1663
|
+
langProps: a,
|
|
1664
|
+
onClose: () => s(null)
|
|
1643
1665
|
}
|
|
1644
1666
|
)
|
|
1645
1667
|
] });
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1668
|
+
};
|
|
1669
|
+
function rn({
|
|
1670
|
+
page: a,
|
|
1671
|
+
onClose: s,
|
|
1672
|
+
onDelete: l
|
|
1673
|
+
}) {
|
|
1674
|
+
const [, n] = ie(), { mutate: r, isPending: c } = Ut(), o = () => {
|
|
1675
|
+
r(a, {
|
|
1676
|
+
onSuccess: () => {
|
|
1677
|
+
window.history.replaceState(null, "", "/"), n(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")), l();
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
};
|
|
1681
|
+
return /* @__PURE__ */ e.jsx(xe, { open: !!a, onOpenChange: s, children: /* @__PURE__ */ e.jsxs(pe, { children: [
|
|
1682
|
+
/* @__PURE__ */ e.jsxs(ve, { children: [
|
|
1683
|
+
/* @__PURE__ */ e.jsx(be, { children: "Confirm Deletion" }),
|
|
1684
|
+
/* @__PURE__ */ e.jsxs(ye, { children: [
|
|
1685
|
+
"Are you sure you want to remove ",
|
|
1686
|
+
/* @__PURE__ */ e.jsx("b", { children: (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.slug) }),
|
|
1687
|
+
" ",
|
|
1688
|
+
a != null && a.global ? "global block?" : "page? This will also delete all associated language pages."
|
|
1689
|
+
] })
|
|
1690
|
+
] }),
|
|
1691
|
+
/* @__PURE__ */ e.jsxs(je, { children: [
|
|
1692
|
+
/* @__PURE__ */ e.jsx(_, { variant: "outline", onClick: s, children: "Cancel" }),
|
|
1693
|
+
/* @__PURE__ */ e.jsx(
|
|
1694
|
+
_,
|
|
1695
|
+
{
|
|
1696
|
+
variant: "destructive",
|
|
1697
|
+
disabled: c,
|
|
1698
|
+
onClick: o,
|
|
1699
|
+
children: c ? "Deleting..." : "Delete"
|
|
1700
|
+
}
|
|
1701
|
+
)
|
|
1702
|
+
] })
|
|
1703
|
+
] }) });
|
|
1704
|
+
}
|
|
1705
|
+
const ln = ({
|
|
1706
|
+
page: a,
|
|
1707
|
+
onClose: s,
|
|
1708
|
+
onUnpublish: l
|
|
1709
|
+
}) => {
|
|
1710
|
+
const { mutate: n, isPending: r } = en(), c = async () => {
|
|
1711
|
+
n(a, {
|
|
1712
|
+
onSuccess: () => {
|
|
1713
|
+
l();
|
|
1714
|
+
}
|
|
1715
|
+
});
|
|
1716
|
+
};
|
|
1717
|
+
return /* @__PURE__ */ e.jsx(xe, { open: !!a, onOpenChange: s, children: /* @__PURE__ */ e.jsxs(pe, { children: [
|
|
1718
|
+
/* @__PURE__ */ e.jsxs(ve, { children: [
|
|
1719
|
+
/* @__PURE__ */ e.jsx(be, { children: "Confirm action" }),
|
|
1720
|
+
/* @__PURE__ */ e.jsxs(ye, { children: [
|
|
1721
|
+
"Are you sure you want to take offline",
|
|
1722
|
+
" ",
|
|
1723
|
+
/* @__PURE__ */ e.jsx("b", { children: (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.slug) }),
|
|
1724
|
+
"?"
|
|
1725
|
+
] })
|
|
1726
|
+
] }),
|
|
1727
|
+
/* @__PURE__ */ e.jsxs(je, { children: [
|
|
1728
|
+
/* @__PURE__ */ e.jsx(_, { variant: "outline", onClick: s, children: "Cancel" }),
|
|
1729
|
+
/* @__PURE__ */ e.jsx(
|
|
1730
|
+
_,
|
|
1731
|
+
{
|
|
1732
|
+
variant: "destructive",
|
|
1733
|
+
disabled: r,
|
|
1734
|
+
onClick: c,
|
|
1735
|
+
children: r ? "Updating..." : "Take offline"
|
|
1736
|
+
}
|
|
1737
|
+
)
|
|
1738
|
+
] })
|
|
1739
|
+
] }) });
|
|
1740
|
+
}, on = ({
|
|
1741
|
+
activePage: a,
|
|
1742
|
+
editPage: s,
|
|
1743
|
+
onShowUpsertPage: l
|
|
1650
1744
|
}) => {
|
|
1651
|
-
const [
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1745
|
+
const [n, r] = R("pages"), { data: c, isFetching: o } = at(), [d, f] = R(
|
|
1746
|
+
null
|
|
1747
|
+
), [v, b] = R(null), E = (k) => {
|
|
1748
|
+
var x;
|
|
1749
|
+
if (n === "globalBlocks")
|
|
1750
|
+
return p(B(k, (h) => !h.slug));
|
|
1751
|
+
const N = $a(
|
|
1752
|
+
B(k, (h) => h.slug),
|
|
1753
|
+
"collection"
|
|
1754
|
+
), m = Object.entries(N).sort(
|
|
1755
|
+
([h], [y]) => h ? !y || h.toLowerCase() === "page" ? -1 : y.toLowerCase() === "page" ? 1 : h.localeCompare(y) : 1
|
|
1756
|
+
);
|
|
1757
|
+
return /* @__PURE__ */ e.jsx(
|
|
1758
|
+
et,
|
|
1759
|
+
{
|
|
1760
|
+
type: "single",
|
|
1761
|
+
collapsible: !0,
|
|
1762
|
+
className: "w-full",
|
|
1763
|
+
defaultValue: ((x = m[0]) == null ? void 0 : x[0]) || "uncategorized",
|
|
1764
|
+
children: m.map(([h, y]) => /* @__PURE__ */ e.jsxs(J, { value: h || "uncategorized", children: [
|
|
1765
|
+
/* @__PURE__ */ e.jsx(Y, { className: "px-2", children: Fe(h) || "Uncategorized" }),
|
|
1766
|
+
/* @__PURE__ */ e.jsx(Q, { className: "bg-white", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: p(y) }) })
|
|
1767
|
+
] }, h))
|
|
1768
|
+
}
|
|
1769
|
+
);
|
|
1770
|
+
}, p = (k) => Ka(k, "online", "desc").map((m) => /* @__PURE__ */ e.jsxs(
|
|
1771
|
+
_,
|
|
1657
1772
|
{
|
|
1658
|
-
onClick: () =>
|
|
1659
|
-
variant:
|
|
1660
|
-
className: "flex justify-between items-center w-full space-x-2 py-1",
|
|
1773
|
+
onClick: () => s(m.id),
|
|
1774
|
+
variant: m.id === a ? "default" : "ghost",
|
|
1775
|
+
className: "flex justify-between items-center h-auto w-full space-x-2 py-1",
|
|
1661
1776
|
children: [
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
|
|
1664
|
-
/* @__PURE__ */
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1777
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start space-x-2 relative", children: [
|
|
1778
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-1", children: m.global ? /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Ae, { className: "h-4 w-4" }) }),
|
|
1779
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start", children: [
|
|
1780
|
+
/* @__PURE__ */ e.jsxs("span", { className: "flex items-center space-x-1", children: [
|
|
1781
|
+
m.name ?? m.slug,
|
|
1782
|
+
" ",
|
|
1783
|
+
(m == null ? void 0 : m.online) && /* @__PURE__ */ e.jsx(
|
|
1784
|
+
"div",
|
|
1785
|
+
{
|
|
1786
|
+
style: {
|
|
1787
|
+
backgroundColor: "lightgreen"
|
|
1788
|
+
},
|
|
1789
|
+
className: "rounded-full w-2 h-2 mr-2"
|
|
1790
|
+
}
|
|
1791
|
+
)
|
|
1792
|
+
] }),
|
|
1793
|
+
(m == null ? void 0 : m.slug) && /* @__PURE__ */ e.jsx("span", { className: "text-xs font-light", children: m.slug })
|
|
1669
1794
|
] })
|
|
1670
1795
|
] }),
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
/* @__PURE__ */
|
|
1673
|
-
|
|
1796
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ e.jsxs(Ea, { children: [
|
|
1797
|
+
/* @__PURE__ */ e.jsx(Ta, { asChild: !0, onClick: (x) => x.stopPropagation(), children: /* @__PURE__ */ e.jsx(
|
|
1798
|
+
_,
|
|
1674
1799
|
{
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
}
|
|
1800
|
+
variant: "ghost",
|
|
1801
|
+
size: "sm",
|
|
1802
|
+
className: `h-8 w-8 p-0 hover:bg-transparent ${m.id === a ? " hover:text-gray-200" : "bg-transparent "}`,
|
|
1803
|
+
children: /* @__PURE__ */ e.jsx(Fa, { className: "h-4 w-4" })
|
|
1679
1804
|
}
|
|
1680
|
-
),
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
"
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1805
|
+
) }),
|
|
1806
|
+
/* @__PURE__ */ e.jsxs(Pa, { align: "end", className: "text-sm", children: [
|
|
1807
|
+
/* @__PURE__ */ e.jsxs(
|
|
1808
|
+
Ye,
|
|
1809
|
+
{
|
|
1810
|
+
className: "flex items-center gap-2 cursor-pointer",
|
|
1811
|
+
onClick: (x) => {
|
|
1812
|
+
x.stopPropagation(), l({ ...m, global: n === "globalBlocks" });
|
|
1813
|
+
},
|
|
1814
|
+
children: [
|
|
1815
|
+
/* @__PURE__ */ e.jsx(Ft, { className: "size-3" }),
|
|
1816
|
+
"Edit"
|
|
1817
|
+
]
|
|
1818
|
+
}
|
|
1819
|
+
),
|
|
1820
|
+
/* @__PURE__ */ e.jsxs(
|
|
1821
|
+
Ye,
|
|
1822
|
+
{
|
|
1823
|
+
className: "flex items-center gap-2 cursor-pointer",
|
|
1824
|
+
onClick: (x) => {
|
|
1825
|
+
x.stopPropagation(), f(m);
|
|
1826
|
+
},
|
|
1827
|
+
children: [
|
|
1828
|
+
/* @__PURE__ */ e.jsx(Dt, { className: "size-3" }),
|
|
1829
|
+
"Delete"
|
|
1830
|
+
]
|
|
1831
|
+
}
|
|
1832
|
+
),
|
|
1833
|
+
(m == null ? void 0 : m.online) && /* @__PURE__ */ e.jsxs(
|
|
1834
|
+
Ye,
|
|
1835
|
+
{
|
|
1836
|
+
className: "flex items-center gap-2 cursor-pointer",
|
|
1837
|
+
onClick: (x) => {
|
|
1838
|
+
x.stopPropagation(), b(m);
|
|
1839
|
+
},
|
|
1840
|
+
children: [
|
|
1841
|
+
/* @__PURE__ */ e.jsx(Da, { className: "size-3" }),
|
|
1842
|
+
"Take offline"
|
|
1843
|
+
]
|
|
1844
|
+
}
|
|
1845
|
+
)
|
|
1704
1846
|
] })
|
|
1705
|
-
] })
|
|
1847
|
+
] }) })
|
|
1706
1848
|
]
|
|
1707
1849
|
},
|
|
1708
|
-
|
|
1850
|
+
m.id
|
|
1709
1851
|
));
|
|
1710
|
-
return /* @__PURE__ */
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
/* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1852
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1853
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
1854
|
+
/* @__PURE__ */ e.jsxs(ka, { value: n, className: "w-full", onValueChange: r, children: [
|
|
1855
|
+
/* @__PURE__ */ e.jsxs(Sa, { className: "w-full", children: [
|
|
1856
|
+
/* @__PURE__ */ e.jsx(Nt, { value: "pages", className: "w-full", children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: "Pages" }) }),
|
|
1857
|
+
/* @__PURE__ */ e.jsx(Nt, { value: "globalBlocks", className: "w-full", children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: "Global Blocks" }) })
|
|
1716
1858
|
] }),
|
|
1717
|
-
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
] }) : /* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
|
|
1724
|
-
a === "pages" ? "pages" : "global blocks"
|
|
1725
|
-
] }) }),
|
|
1726
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-full flex justify-center", children: /* @__PURE__ */ t.jsxs(
|
|
1727
|
-
B,
|
|
1859
|
+
o ? /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1860
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1861
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1862
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1863
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "py-4 space-y-3", children: [
|
|
1864
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full flex justify-start", children: /* @__PURE__ */ e.jsxs(
|
|
1865
|
+
_,
|
|
1728
1866
|
{
|
|
1729
1867
|
variant: "default",
|
|
1730
1868
|
size: "sm",
|
|
1731
|
-
disabled:
|
|
1732
|
-
onClick: () =>
|
|
1869
|
+
disabled: o,
|
|
1870
|
+
onClick: () => l({
|
|
1733
1871
|
slug: "",
|
|
1734
1872
|
name: "",
|
|
1735
|
-
global:
|
|
1873
|
+
global: n === "globalBlocks"
|
|
1736
1874
|
}),
|
|
1737
1875
|
className: "mb-4 w-1/2 bg-blue-500 hover:bg-blue-400",
|
|
1738
1876
|
children: [
|
|
1739
|
-
/* @__PURE__ */
|
|
1740
|
-
|
|
1877
|
+
/* @__PURE__ */ e.jsx(Aa, { className: "h-4 w-4 mr-2" }),
|
|
1878
|
+
o ? "Loading..." : `Add ${n === "pages" ? "page" : "Global Block"}`
|
|
1741
1879
|
]
|
|
1742
1880
|
}
|
|
1743
1881
|
) }),
|
|
1744
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__PURE__ */ e.jsx("div", { className: "pt-0", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: o ? /* @__PURE__ */ e.jsx(cn, {}) : E(c) }) })
|
|
1745
1883
|
] })
|
|
1746
|
-
] })
|
|
1884
|
+
] }),
|
|
1885
|
+
/* @__PURE__ */ e.jsx(
|
|
1886
|
+
rn,
|
|
1887
|
+
{
|
|
1888
|
+
page: d,
|
|
1889
|
+
onClose: () => f(null),
|
|
1890
|
+
onDelete: () => {
|
|
1891
|
+
f(null);
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
),
|
|
1895
|
+
/* @__PURE__ */ e.jsx(
|
|
1896
|
+
ln,
|
|
1897
|
+
{
|
|
1898
|
+
page: v,
|
|
1899
|
+
onClose: () => b(null),
|
|
1900
|
+
onUnpublish: () => {
|
|
1901
|
+
b(null);
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
)
|
|
1747
1905
|
] });
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1906
|
+
};
|
|
1907
|
+
function cn() {
|
|
1908
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-32 w-full flex justify-center items-center text-sm animate-pulse", children: "Loading..." });
|
|
1909
|
+
}
|
|
1910
|
+
const qt = () => {
|
|
1911
|
+
const a = L();
|
|
1912
|
+
return V({
|
|
1913
|
+
queryKey: ["project-collections"],
|
|
1914
|
+
initialData: [],
|
|
1915
|
+
queryFn: async () => await (await fetch(a, {
|
|
1916
|
+
method: "POST",
|
|
1917
|
+
headers: {
|
|
1918
|
+
"Content-Type": "application/json"
|
|
1919
|
+
},
|
|
1920
|
+
body: JSON.stringify({ action: "GET_COLLECTIONS" })
|
|
1921
|
+
})).json()
|
|
1922
|
+
});
|
|
1923
|
+
}, un = () => {
|
|
1924
|
+
const a = L();
|
|
1925
|
+
return se({
|
|
1926
|
+
mutationFn: async ({ collection: s, query: l }) => {
|
|
1927
|
+
try {
|
|
1928
|
+
return await (await fetch(a, {
|
|
1929
|
+
method: "POST",
|
|
1930
|
+
headers: {
|
|
1931
|
+
"Content-Type": "application/json"
|
|
1932
|
+
},
|
|
1933
|
+
body: JSON.stringify({
|
|
1934
|
+
action: "SEARCH_PAGES",
|
|
1935
|
+
data: {
|
|
1936
|
+
collection: s,
|
|
1937
|
+
query: Array.isArray(l) && l.length > 0 ? l[0] : l
|
|
1938
|
+
}
|
|
1939
|
+
})
|
|
1940
|
+
})).json() || [];
|
|
1941
|
+
} catch {
|
|
1942
|
+
return [];
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
});
|
|
1946
|
+
}, dn = ({
|
|
1947
|
+
editPage: a,
|
|
1948
|
+
showUpsertPage: s,
|
|
1949
|
+
setShowUpsertPage: l
|
|
1752
1950
|
}) => {
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1951
|
+
const n = s.id, [r, c] = R(n && s.name || ""), [o, d] = R(n && s.slug || ""), [f, v] = R(
|
|
1952
|
+
n ? s.pageType || "" : "page"
|
|
1953
|
+
), { data: b = [] } = qt(), { mutate: E, isPending: p } = Bt(), { mutate: k, isPending: N } = nt(), m = p || N, x = () => {
|
|
1954
|
+
n ? k(
|
|
1755
1955
|
{
|
|
1756
|
-
name:
|
|
1757
|
-
slug:
|
|
1758
|
-
id:
|
|
1759
|
-
|
|
1956
|
+
name: r,
|
|
1957
|
+
slug: o,
|
|
1958
|
+
id: s.id,
|
|
1959
|
+
collection: s.global ? "global" : f
|
|
1760
1960
|
},
|
|
1761
1961
|
{
|
|
1762
1962
|
onSuccess: () => {
|
|
1763
|
-
|
|
1963
|
+
l(void 0);
|
|
1764
1964
|
}
|
|
1765
1965
|
}
|
|
1766
|
-
) :
|
|
1966
|
+
) : E(
|
|
1767
1967
|
{
|
|
1768
|
-
name:
|
|
1769
|
-
slug:
|
|
1770
|
-
|
|
1968
|
+
name: r,
|
|
1969
|
+
slug: o,
|
|
1970
|
+
collection: s.global ? "global" : f
|
|
1771
1971
|
},
|
|
1772
1972
|
{
|
|
1773
|
-
onSuccess: (
|
|
1774
|
-
|
|
1973
|
+
onSuccess: (h) => {
|
|
1974
|
+
a(h.page.id);
|
|
1775
1975
|
}
|
|
1776
1976
|
}
|
|
1777
1977
|
);
|
|
1778
1978
|
};
|
|
1779
|
-
return /* @__PURE__ */
|
|
1780
|
-
|
|
1979
|
+
return /* @__PURE__ */ e.jsx(
|
|
1980
|
+
xe,
|
|
1781
1981
|
{
|
|
1782
|
-
open: !!
|
|
1783
|
-
onOpenChange: () =>
|
|
1784
|
-
children: /* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1787
|
-
|
|
1982
|
+
open: !!s,
|
|
1983
|
+
onOpenChange: () => l(void 0),
|
|
1984
|
+
children: /* @__PURE__ */ e.jsxs(pe, { className: "sm:max-w-[425px]", children: [
|
|
1985
|
+
/* @__PURE__ */ e.jsxs(ve, { children: [
|
|
1986
|
+
/* @__PURE__ */ e.jsxs(be, { children: [
|
|
1987
|
+
n ? "Edit" : "Add New",
|
|
1788
1988
|
" ",
|
|
1789
|
-
|
|
1989
|
+
s.global ? "Global Block" : Fe(f)
|
|
1790
1990
|
] }),
|
|
1791
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ e.jsxs(ye, { children: [
|
|
1792
1992
|
"Enter the details for the new",
|
|
1793
1993
|
" ",
|
|
1794
|
-
|
|
1994
|
+
s.global ? "Global Block" : `${Fe(f)}. Slug must start with /`
|
|
1795
1995
|
] })
|
|
1796
1996
|
] }),
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
/* @__PURE__ */
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
/* @__PURE__ */
|
|
1802
|
-
|
|
1997
|
+
/* @__PURE__ */ e.jsxs("form", { children: [
|
|
1998
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1999
|
+
!s.global && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
2000
|
+
/* @__PURE__ */ e.jsx(A, { htmlFor: "pageType", children: "Type" }),
|
|
2001
|
+
/* @__PURE__ */ e.jsx(
|
|
2002
|
+
"select",
|
|
2003
|
+
{
|
|
2004
|
+
value: f,
|
|
2005
|
+
onChange: (h) => v(h.target.value),
|
|
2006
|
+
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
2007
|
+
children: b.map((h) => /* @__PURE__ */ e.jsx("option", { value: h.key, children: h.name }, h.key))
|
|
2008
|
+
}
|
|
2009
|
+
)
|
|
2010
|
+
] }),
|
|
2011
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
2012
|
+
/* @__PURE__ */ e.jsx(A, { htmlFor: "name", className: "text-right", children: "Name" }),
|
|
2013
|
+
/* @__PURE__ */ e.jsx(
|
|
2014
|
+
q,
|
|
1803
2015
|
{
|
|
1804
2016
|
id: "name",
|
|
1805
|
-
value:
|
|
1806
|
-
placeholder: `Enter ${
|
|
1807
|
-
onChange: (
|
|
2017
|
+
value: r,
|
|
2018
|
+
placeholder: `Enter ${s.global ? "global block" : "page"} name`,
|
|
2019
|
+
onChange: (h) => c(h.target.value),
|
|
1808
2020
|
className: "col-span-3",
|
|
1809
2021
|
required: !0
|
|
1810
2022
|
}
|
|
1811
2023
|
)
|
|
1812
2024
|
] }),
|
|
1813
|
-
!
|
|
1814
|
-
/* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
|
|
2025
|
+
!s.global && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
2026
|
+
/* @__PURE__ */ e.jsx(A, { htmlFor: "slug", className: "text-right", children: s.global ? "Identifier" : "Slug" }),
|
|
2027
|
+
/* @__PURE__ */ e.jsx(
|
|
2028
|
+
q,
|
|
1817
2029
|
{
|
|
1818
2030
|
id: "slug",
|
|
1819
|
-
value:
|
|
1820
|
-
onChange: (
|
|
1821
|
-
var
|
|
1822
|
-
return
|
|
2031
|
+
value: o,
|
|
2032
|
+
onChange: (h) => {
|
|
2033
|
+
var y;
|
|
2034
|
+
return d((y = h.target.value) == null ? void 0 : y.trim().toLowerCase());
|
|
1823
2035
|
},
|
|
1824
2036
|
className: "col-span-3",
|
|
1825
2037
|
required: !0,
|
|
@@ -1828,15 +2040,15 @@ const $a = ({
|
|
|
1828
2040
|
placeholder: "Enter page slug"
|
|
1829
2041
|
}
|
|
1830
2042
|
)
|
|
1831
|
-
] })
|
|
2043
|
+
] }) })
|
|
1832
2044
|
] }),
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
|
|
2045
|
+
/* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsx(
|
|
2046
|
+
_,
|
|
1835
2047
|
{
|
|
1836
|
-
onClick:
|
|
2048
|
+
onClick: x,
|
|
1837
2049
|
type: "button",
|
|
1838
|
-
disabled:
|
|
1839
|
-
children:
|
|
2050
|
+
disabled: m || !r || !s.global && !o.startsWith("/") || _e(s.name, r) && _e(s.slug, o) && _e(s.pageType, f),
|
|
2051
|
+
children: m ? n ? "Updating..." : "Adding..." : s.global ? `${n ? "Update" : "Add"} global block` : `${n ? "Update" : "Add"} Page`
|
|
1840
2052
|
}
|
|
1841
2053
|
) })
|
|
1842
2054
|
] })
|
|
@@ -1844,37 +2056,37 @@ const $a = ({
|
|
|
1844
2056
|
}
|
|
1845
2057
|
);
|
|
1846
2058
|
};
|
|
1847
|
-
function
|
|
1848
|
-
const { activePage:
|
|
1849
|
-
window.history.pushState({}, "", `?page=${
|
|
2059
|
+
function hn(a) {
|
|
2060
|
+
const { activePage: s, canClose: l, open: n, close: r } = a, [, c] = ie(), [o, d] = R(), f = (v) => {
|
|
2061
|
+
window.history.pushState({}, "", `?page=${v}`), c(new URLSearchParams({ page: v })), window.dispatchEvent(new PopStateEvent("popstate")), d(void 0), r();
|
|
1850
2062
|
};
|
|
1851
|
-
return /* @__PURE__ */
|
|
1852
|
-
|
|
2063
|
+
return /* @__PURE__ */ e.jsx(
|
|
2064
|
+
Oa,
|
|
1853
2065
|
{
|
|
1854
|
-
open:
|
|
1855
|
-
onOpenChange: (
|
|
1856
|
-
!
|
|
2066
|
+
open: n,
|
|
2067
|
+
onOpenChange: (v) => {
|
|
2068
|
+
!v && l && r();
|
|
1857
2069
|
},
|
|
1858
|
-
children: /* @__PURE__ */
|
|
1859
|
-
|
|
2070
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
2071
|
+
_a,
|
|
1860
2072
|
{
|
|
1861
2073
|
side: "left",
|
|
1862
|
-
className: `border-border w-full ${
|
|
2074
|
+
className: `border-border w-full ${l ? "" : "sheet-hide-close-btn"}`,
|
|
1863
2075
|
children: [
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
|
|
2076
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
2077
|
+
on,
|
|
1866
2078
|
{
|
|
1867
|
-
onShowUpsertPage: (
|
|
1868
|
-
activePage:
|
|
1869
|
-
editPage:
|
|
2079
|
+
onShowUpsertPage: (v) => d(v),
|
|
2080
|
+
activePage: s,
|
|
2081
|
+
editPage: f
|
|
1870
2082
|
}
|
|
1871
2083
|
) }),
|
|
1872
|
-
|
|
1873
|
-
|
|
2084
|
+
o && /* @__PURE__ */ e.jsx(
|
|
2085
|
+
dn,
|
|
1874
2086
|
{
|
|
1875
|
-
editPage:
|
|
1876
|
-
showUpsertPage:
|
|
1877
|
-
setShowUpsertPage:
|
|
2087
|
+
editPage: f,
|
|
2088
|
+
showUpsertPage: o,
|
|
2089
|
+
setShowUpsertPage: d
|
|
1878
2090
|
}
|
|
1879
2091
|
)
|
|
1880
2092
|
]
|
|
@@ -1883,87 +2095,328 @@ function za(r) {
|
|
|
1883
2095
|
}
|
|
1884
2096
|
);
|
|
1885
2097
|
}
|
|
1886
|
-
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
2098
|
+
const fn = () => {
|
|
2099
|
+
const { t: a } = va(), { data: s, isFetching: l } = De(), n = Lt(
|
|
2100
|
+
"getPreviewUrl",
|
|
2101
|
+
async (o) => o
|
|
2102
|
+
), [r, c] = R("");
|
|
2103
|
+
return ge(() => {
|
|
2104
|
+
(async () => {
|
|
2105
|
+
if (!n || !(s != null && s.slug)) {
|
|
2106
|
+
c("");
|
|
2107
|
+
return;
|
|
2108
|
+
}
|
|
2109
|
+
const o = await n((s == null ? void 0 : s.slug) || "");
|
|
2110
|
+
c(o);
|
|
2111
|
+
})();
|
|
2112
|
+
}, [n, s == null ? void 0 : s.slug]), !r || s != null && s.global || l ? null : /* @__PURE__ */ e.jsxs(_, { variant: "outline", size: "sm", className: "ml-2", children: [
|
|
2113
|
+
/* @__PURE__ */ e.jsx(La, { className: "h-4 w-4 mr-2" }),
|
|
2114
|
+
/* @__PURE__ */ e.jsx("a", { href: r, target: "_blank", children: a("Preview") })
|
|
2115
|
+
] });
|
|
2116
|
+
}, mn = () => {
|
|
2117
|
+
const a = L();
|
|
2118
|
+
return V({
|
|
2119
|
+
queryKey: ["get-page-changes"],
|
|
2120
|
+
queryFn: async () => await (await fetch(a, {
|
|
2121
|
+
method: "POST",
|
|
2122
|
+
headers: {
|
|
2123
|
+
"Content-Type": "application/json"
|
|
2124
|
+
},
|
|
2125
|
+
body: JSON.stringify({
|
|
2126
|
+
action: "GET_CHANGES"
|
|
2127
|
+
})
|
|
2128
|
+
})).json()
|
|
2129
|
+
});
|
|
2130
|
+
}, Ot = ({
|
|
2131
|
+
pages: a,
|
|
2132
|
+
selectedPages: s,
|
|
2133
|
+
handleCheckboxChange: l,
|
|
2134
|
+
loading: n,
|
|
2135
|
+
type: r
|
|
2136
|
+
}) => {
|
|
2137
|
+
if (n)
|
|
2138
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 px-1", children: [
|
|
2139
|
+
/* @__PURE__ */ e.jsx("div", { className: "bg-gray-200 h-6 w-full rounded animate-pulse mt-2" }),
|
|
2140
|
+
/* @__PURE__ */ e.jsx("div", { className: "bg-gray-200 h-6 w-full rounded animate-pulse" })
|
|
2141
|
+
] });
|
|
2142
|
+
if (D(a))
|
|
2143
|
+
return /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center text-gray-400 font-medium", children: "No changes available to publish" });
|
|
2144
|
+
const c = B(a, { online: !0 }), o = B(a, { online: !1 });
|
|
2145
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 px-1", children: [
|
|
2146
|
+
H(c, (d, f) => /* @__PURE__ */ e.jsxs(
|
|
2147
|
+
"div",
|
|
2148
|
+
{
|
|
2149
|
+
className: `pt-2 flex justify-between ${f > 0 ? "border-t" : ""}`,
|
|
2150
|
+
children: [
|
|
2151
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-x-2", children: [
|
|
2152
|
+
/* @__PURE__ */ e.jsx(
|
|
2153
|
+
"input",
|
|
2154
|
+
{
|
|
2155
|
+
checked: fe(s, d.id),
|
|
2156
|
+
onChange: () => l(d.id),
|
|
2157
|
+
type: "checkbox",
|
|
2158
|
+
className: "rounded focus:outline-none focus:ring-0 cursor-pointer"
|
|
2159
|
+
}
|
|
2160
|
+
),
|
|
2161
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-xs", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 text-gray-400", children: [
|
|
2162
|
+
d.global ? /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Ae, { className: "h-4 w-4" }),
|
|
2163
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800", children: d.name }),
|
|
2164
|
+
" ",
|
|
2165
|
+
/* @__PURE__ */ e.jsx("span", { children: d.slug && !d.global && /* @__PURE__ */ e.jsx("span", { children: d.slug }) })
|
|
2166
|
+
] }) })
|
|
2167
|
+
] }),
|
|
2168
|
+
/* @__PURE__ */ e.jsx("div", { className: " text-gray-500 text-xs font-medium", children: kt(d == null ? void 0 : d.changes) })
|
|
2169
|
+
]
|
|
2170
|
+
},
|
|
2171
|
+
d.id
|
|
2172
|
+
)),
|
|
2173
|
+
!D(o) && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2174
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative py-0 -ml-2 !mt-3", children: [
|
|
2175
|
+
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-full border-t border-gray-200" }) }),
|
|
2176
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative flex justify-left", children: /* @__PURE__ */ e.jsxs("span", { className: "bg-white px-2 text-xs text-gray-500", children: [
|
|
2177
|
+
"Offline ",
|
|
2178
|
+
r
|
|
2179
|
+
] }) })
|
|
2180
|
+
] }),
|
|
2181
|
+
H(o, (d, f) => /* @__PURE__ */ e.jsxs(
|
|
2182
|
+
"div",
|
|
2183
|
+
{
|
|
2184
|
+
className: `pt-2 flex justify-between ${f > 0 ? "border-t" : ""}`,
|
|
2185
|
+
children: [
|
|
2186
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-x-2", children: [
|
|
2187
|
+
/* @__PURE__ */ e.jsx(
|
|
2188
|
+
"input",
|
|
2189
|
+
{
|
|
2190
|
+
checked: fe(s, d.id),
|
|
2191
|
+
onChange: () => l(d.id),
|
|
2192
|
+
type: "checkbox",
|
|
2193
|
+
className: "rounded focus:outline-none focus:ring-0 cursor-pointer"
|
|
2194
|
+
}
|
|
2195
|
+
),
|
|
2196
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-xs", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 text-gray-400", children: [
|
|
2197
|
+
d.global ? /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Ae, { className: "h-4 w-4" }),
|
|
2198
|
+
/* @__PURE__ */ e.jsxs("span", { className: "font-medium text-gray-800", children: [
|
|
2199
|
+
d.name,
|
|
2200
|
+
" ",
|
|
2201
|
+
d.lang && `(${d.lang})`
|
|
2202
|
+
] }),
|
|
2203
|
+
" ",
|
|
2204
|
+
/* @__PURE__ */ e.jsx("span", { children: d.slug && !d.global && /* @__PURE__ */ e.jsx("span", { children: d.slug }) })
|
|
2205
|
+
] }) })
|
|
2206
|
+
] }),
|
|
2207
|
+
/* @__PURE__ */ e.jsx("div", { className: " text-gray-500 text-xs font-medium", children: kt(d == null ? void 0 : d.changes) })
|
|
2208
|
+
]
|
|
2209
|
+
},
|
|
2210
|
+
d.id
|
|
2211
|
+
))
|
|
2212
|
+
] })
|
|
2213
|
+
] });
|
|
2214
|
+
};
|
|
2215
|
+
function gn({
|
|
2216
|
+
onClose: a = () => console.log("Cancelled")
|
|
2217
|
+
}) {
|
|
2218
|
+
const [s, l] = R([]), { data: n, isFetching: r } = mn(), c = z(
|
|
2219
|
+
() => [
|
|
2220
|
+
...B(n, { global: !1, online: !0 }),
|
|
2221
|
+
...B(n, { global: !1, online: !1 })
|
|
2222
|
+
],
|
|
2223
|
+
[n]
|
|
2224
|
+
), o = z(
|
|
2225
|
+
() => [
|
|
2226
|
+
...B(n, { global: !0, online: !0 }),
|
|
2227
|
+
...B(n, { global: !0, online: !1 })
|
|
2228
|
+
],
|
|
2229
|
+
[n]
|
|
2230
|
+
), { mutate: d, isPending: f } = tn();
|
|
2231
|
+
ge(() => {
|
|
2232
|
+
l(H(B(n, { online: !0 }), "id"));
|
|
2233
|
+
}, [n]);
|
|
2234
|
+
const { isAllPagesSelected: v, isAllGlobalBlocksSelected: b } = z(() => {
|
|
2235
|
+
const N = c.length > 0 && c.every((x) => s.includes(x.id)), m = o.length > 0 && o.every((x) => s.includes(x.id));
|
|
2236
|
+
return {
|
|
2237
|
+
isAllPagesSelected: N,
|
|
2238
|
+
isAllGlobalBlocksSelected: m
|
|
1893
2239
|
};
|
|
1894
|
-
|
|
1895
|
-
|
|
2240
|
+
}, [c, o, s]), E = (N) => {
|
|
2241
|
+
l(
|
|
2242
|
+
(m) => fe(m, N) ? B(m, (x) => x !== N) : Qe(m, N)
|
|
2243
|
+
);
|
|
2244
|
+
}, p = (N) => {
|
|
2245
|
+
l(N === "globalBlocks" ? (x) => b ? B(x, (h) => !X(o, { id: h })) : St(Qe(x, H(o, "id"))) : (x) => v ? B(x, (h) => !X(c, { id: h })) : St(Qe(x, H(c, "id"))));
|
|
2246
|
+
}, k = () => {
|
|
2247
|
+
d(
|
|
2248
|
+
{ ids: s, theme: !1 },
|
|
2249
|
+
{
|
|
2250
|
+
onSuccess: () => {
|
|
2251
|
+
a();
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
);
|
|
2255
|
+
};
|
|
2256
|
+
return /* @__PURE__ */ e.jsx(xe, { open: !0, onOpenChange: f ? () => {
|
|
2257
|
+
} : a, children: /* @__PURE__ */ e.jsxs(pe, { className: "sm:max-w-[525px]", children: [
|
|
2258
|
+
/* @__PURE__ */ e.jsxs(ve, { children: [
|
|
2259
|
+
/* @__PURE__ */ e.jsx(be, { children: "Publish changes" }),
|
|
2260
|
+
/* @__PURE__ */ e.jsx(ye, { className: "text-xs", children: "Select the pages you want to publish. Click publish when you're done." })
|
|
2261
|
+
] }),
|
|
2262
|
+
/* @__PURE__ */ e.jsx("div", { className: "max-h-[400px] overflow-y-auto", children: /* @__PURE__ */ e.jsxs(et, { type: "multiple", defaultValue: ["pages", "globalBlocks"], children: [
|
|
2263
|
+
/* @__PURE__ */ e.jsxs(J, { value: "pages", defaultChecked: !0, children: [
|
|
2264
|
+
/* @__PURE__ */ e.jsx(Y, { className: "bg-gray-100 rounded px-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 pl-2 -mx-1", children: [
|
|
2265
|
+
!D(c) && /* @__PURE__ */ e.jsx(
|
|
2266
|
+
"input",
|
|
2267
|
+
{
|
|
2268
|
+
checked: v,
|
|
2269
|
+
onClick: (N) => {
|
|
2270
|
+
N.stopPropagation(), p("pages");
|
|
2271
|
+
},
|
|
2272
|
+
type: "checkbox",
|
|
2273
|
+
className: "rounded focus:outline-none focus:ring-0 mt-1 cursor-pointer"
|
|
2274
|
+
}
|
|
2275
|
+
),
|
|
2276
|
+
"Pages"
|
|
2277
|
+
] }) }),
|
|
2278
|
+
/* @__PURE__ */ e.jsx(Q, { className: "px-4 pt-2", children: /* @__PURE__ */ e.jsx(
|
|
2279
|
+
Ot,
|
|
2280
|
+
{
|
|
2281
|
+
type: "Pages",
|
|
2282
|
+
loading: r,
|
|
2283
|
+
pages: c,
|
|
2284
|
+
selectedPages: s,
|
|
2285
|
+
handleCheckboxChange: E
|
|
2286
|
+
}
|
|
2287
|
+
) })
|
|
2288
|
+
] }),
|
|
2289
|
+
/* @__PURE__ */ e.jsxs(J, { value: "globalBlocks", children: [
|
|
2290
|
+
/* @__PURE__ */ e.jsx(Y, { className: "bg-gray-100 rounded px-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 pl-2 -mx-1", children: [
|
|
2291
|
+
!D(o) && /* @__PURE__ */ e.jsx(
|
|
2292
|
+
"input",
|
|
2293
|
+
{
|
|
2294
|
+
checked: b,
|
|
2295
|
+
onClick: (N) => {
|
|
2296
|
+
N.stopPropagation(), p("globalBlocks");
|
|
2297
|
+
},
|
|
2298
|
+
type: "checkbox",
|
|
2299
|
+
className: "rounded focus:outline-none focus:ring-0 mt-1 cursor-pointer"
|
|
2300
|
+
}
|
|
2301
|
+
),
|
|
2302
|
+
"Global Block"
|
|
2303
|
+
] }) }),
|
|
2304
|
+
/* @__PURE__ */ e.jsx(Q, { className: "px-4 pt-2", children: /* @__PURE__ */ e.jsx(
|
|
2305
|
+
Ot,
|
|
2306
|
+
{
|
|
2307
|
+
type: "Global Blocks",
|
|
2308
|
+
loading: r,
|
|
2309
|
+
pages: o,
|
|
2310
|
+
selectedPages: s,
|
|
2311
|
+
handleCheckboxChange: E
|
|
2312
|
+
}
|
|
2313
|
+
) })
|
|
2314
|
+
] })
|
|
2315
|
+
] }) }),
|
|
2316
|
+
/* @__PURE__ */ e.jsxs(je, { children: [
|
|
2317
|
+
/* @__PURE__ */ e.jsx(_, { disabled: f, variant: "outline", onClick: a, children: "Cancel" }),
|
|
2318
|
+
/* @__PURE__ */ e.jsx(
|
|
2319
|
+
_,
|
|
2320
|
+
{
|
|
2321
|
+
disabled: f || r || D(n),
|
|
2322
|
+
onClick: k,
|
|
2323
|
+
children: f ? "Publishing..." : "Publish"
|
|
2324
|
+
}
|
|
2325
|
+
)
|
|
2326
|
+
] })
|
|
2327
|
+
] }) });
|
|
2328
|
+
}
|
|
2329
|
+
xa();
|
|
2330
|
+
const xn = (a) => {
|
|
2331
|
+
const s = At([]), [l] = ie(), n = l.get("page"), { data: r, isFetching: c } = De(), { data: o } = Ya(), { data: d, isFetching: f } = Qa(), { blocks: v } = Ha(d), { data: b } = It(), { data: E } = qt(), p = Wa(), { uploadFile: k } = Za(), { getUILibraryBlock: N, getUILibraryBlocks: m, onSave: x } = Ja(), { getGlobalBlocks: h, getGlobalBlockBlocks: y } = Xa(), { aiContext: le, setAiContext: Le } = tt(), { mutateAsync: we } = un();
|
|
2332
|
+
s.current = v;
|
|
2333
|
+
const [Ie, Ne] = R(!1), [Be, oe] = R(!1), [ee, Ue] = R("SAVED");
|
|
2334
|
+
ge(() => {
|
|
2335
|
+
const T = (M) => {
|
|
2336
|
+
ee === "UNSAVED" && (M.preventDefault(), M.returnValue = !1);
|
|
1896
2337
|
};
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
2338
|
+
return ee === "UNSAVED" && window.addEventListener("beforeunload", T), () => {
|
|
2339
|
+
window.removeEventListener("beforeunload", T);
|
|
2340
|
+
};
|
|
2341
|
+
}, [ee]);
|
|
2342
|
+
const Ce = z(() => {
|
|
2343
|
+
const T = {};
|
|
2344
|
+
return a.mediaManagerComponent && (T.mediaManagerComponent = a.mediaManagerComponent, T.uploadMediaCallback = k), T;
|
|
2345
|
+
}, [a.mediaManagerComponent, k]), U = z(() => Array.isArray(a == null ? void 0 : a.uiLibraries) ? [...o, ...a == null ? void 0 : a.uiLibraries] : o, [o, a == null ? void 0 : a.uiLibraries]), K = Xe(
|
|
2346
|
+
async (T, M) => await we({ collection: T, query: M }),
|
|
2347
|
+
[we]
|
|
2348
|
+
);
|
|
2349
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2350
|
+
/* @__PURE__ */ e.jsx(
|
|
2351
|
+
ba,
|
|
1905
2352
|
{
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
uiLibraries:
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
if (!o) return !0;
|
|
1928
|
-
const G = {
|
|
1929
|
-
_type: "@chai/theme",
|
|
1930
|
-
_value: T
|
|
1931
|
-
}, M = {
|
|
2353
|
+
loading: f,
|
|
2354
|
+
fallbackLang: b.fallbackLang || "en",
|
|
2355
|
+
languages: b.languages || [],
|
|
2356
|
+
brandingOptions: (b == null ? void 0 : b.theme) || {},
|
|
2357
|
+
translations: a.translations || {},
|
|
2358
|
+
locale: a.locale || "en",
|
|
2359
|
+
htmlDir: a.htmlDir || "ltr",
|
|
2360
|
+
autoSaveSupport: a.autoSaveSupport || !1,
|
|
2361
|
+
autoSaveInterval: a.autoSaveInterval || 15,
|
|
2362
|
+
onError: a.onError || console.error,
|
|
2363
|
+
getGlobalBlockBlocks: y,
|
|
2364
|
+
getGlobalBlocks: h,
|
|
2365
|
+
blocks: v,
|
|
2366
|
+
getUILibraryBlock: N,
|
|
2367
|
+
getUILibraryBlocks: m,
|
|
2368
|
+
uiLibraries: U,
|
|
2369
|
+
collections: E,
|
|
2370
|
+
searchCollectionItems: K,
|
|
2371
|
+
saveAiContextCallback: async (T) => {
|
|
2372
|
+
if (!n) return !0;
|
|
2373
|
+
const M = s.current, te = {
|
|
1932
2374
|
_type: "@chai/ai-context",
|
|
1933
|
-
_value:
|
|
1934
|
-
},
|
|
1935
|
-
return await
|
|
2375
|
+
_value: Et(T) ? T : ""
|
|
2376
|
+
}, ke = [...M, te];
|
|
2377
|
+
return await x({ page: n, blocks: ke }), Le(T), !0;
|
|
2378
|
+
},
|
|
2379
|
+
onSaveStateChange: (T) => Ue(T),
|
|
2380
|
+
aiContext: le,
|
|
2381
|
+
askAiCallBack: p,
|
|
2382
|
+
onSave: async ({ blocks: T }) => {
|
|
2383
|
+
if (!n) return !0;
|
|
2384
|
+
s.current = T;
|
|
2385
|
+
const M = {
|
|
2386
|
+
_type: "@chai/ai-context",
|
|
2387
|
+
_value: Et(le) ? le : ""
|
|
2388
|
+
}, te = [...T, M];
|
|
2389
|
+
return await x({ page: n, blocks: te }), s.current = T, !0;
|
|
1936
2390
|
},
|
|
1937
2391
|
topBarComponents: {
|
|
1938
2392
|
left: [
|
|
1939
|
-
() => /* @__PURE__ */
|
|
1940
|
-
|
|
2393
|
+
() => /* @__PURE__ */ e.jsxs(
|
|
2394
|
+
_,
|
|
1941
2395
|
{
|
|
1942
2396
|
variant: "default",
|
|
1943
2397
|
className: "flex justify-start max-w-[250px] items-center w-full space-x-2 py-1",
|
|
1944
|
-
onClick: () =>
|
|
2398
|
+
onClick: () => Ne(!0),
|
|
1945
2399
|
children: [
|
|
1946
|
-
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
2400
|
+
fe(r.slug, "/") ? /* @__PURE__ */ e.jsx(Ae, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4" }),
|
|
2401
|
+
/* @__PURE__ */ e.jsx("span", { className: "truncate", children: (r == null ? void 0 : r.name) ?? "" }),
|
|
2402
|
+
/* @__PURE__ */ e.jsx(Ia, { className: "h-4 w-4" })
|
|
1949
2403
|
]
|
|
1950
2404
|
},
|
|
1951
2405
|
"template-viewer"
|
|
1952
2406
|
)
|
|
1953
2407
|
],
|
|
1954
2408
|
right: [
|
|
1955
|
-
|
|
1956
|
-
|
|
2409
|
+
fn,
|
|
2410
|
+
() => /* @__PURE__ */ e.jsxs(
|
|
2411
|
+
_,
|
|
1957
2412
|
{
|
|
1958
|
-
disabled:
|
|
2413
|
+
disabled: ee !== "SAVED",
|
|
1959
2414
|
size: "sm",
|
|
1960
2415
|
variant: "default",
|
|
1961
|
-
onClick: () =>
|
|
2416
|
+
onClick: () => oe(!0),
|
|
1962
2417
|
children: [
|
|
1963
|
-
/* @__PURE__ */
|
|
1964
|
-
"
|
|
1965
|
-
" ",
|
|
1966
|
-
ie ? "Publishing..." : "Publish"
|
|
2418
|
+
/* @__PURE__ */ e.jsx(Ba, { className: "h-4 w-4" }),
|
|
2419
|
+
" Publish"
|
|
1967
2420
|
]
|
|
1968
2421
|
}
|
|
1969
2422
|
)
|
|
@@ -1971,11 +2424,11 @@ const Ja = (r) => {
|
|
|
1971
2424
|
},
|
|
1972
2425
|
sideBarComponents: {
|
|
1973
2426
|
top: [
|
|
1974
|
-
...
|
|
2427
|
+
...(r == null ? void 0 : r.collection) !== "global" ? [
|
|
1975
2428
|
{
|
|
1976
2429
|
label: "SEO Setting",
|
|
1977
|
-
component:
|
|
1978
|
-
icon: /* @__PURE__ */
|
|
2430
|
+
component: Mt,
|
|
2431
|
+
icon: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
1979
2432
|
"svg",
|
|
1980
2433
|
{
|
|
1981
2434
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1984,25 +2437,25 @@ const Ja = (r) => {
|
|
|
1984
2437
|
width: "21",
|
|
1985
2438
|
height: "21",
|
|
1986
2439
|
children: [
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */
|
|
2440
|
+
/* @__PURE__ */ e.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" }),
|
|
2441
|
+
/* @__PURE__ */ e.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" })
|
|
1989
2442
|
]
|
|
1990
2443
|
}
|
|
1991
2444
|
) })
|
|
1992
2445
|
}
|
|
1993
2446
|
] : [],
|
|
1994
|
-
...(
|
|
2447
|
+
...D(b == null ? void 0 : b.languages) ? [] : [
|
|
1995
2448
|
{
|
|
1996
2449
|
label: "Language Pages",
|
|
1997
|
-
component:
|
|
1998
|
-
icon: /* @__PURE__ */
|
|
2450
|
+
component: sn,
|
|
2451
|
+
icon: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
1999
2452
|
"svg",
|
|
2000
2453
|
{
|
|
2001
2454
|
width: "21",
|
|
2002
2455
|
height: "21",
|
|
2003
2456
|
viewBox: "0 0 21 21",
|
|
2004
2457
|
fill: "currentColor",
|
|
2005
|
-
children: /* @__PURE__ */
|
|
2458
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
2006
2459
|
"g",
|
|
2007
2460
|
{
|
|
2008
2461
|
fill: "none",
|
|
@@ -2011,35 +2464,36 @@ const Ja = (r) => {
|
|
|
2011
2464
|
"stroke-linecap": "round",
|
|
2012
2465
|
"stroke-linejoin": "round",
|
|
2013
2466
|
children: [
|
|
2014
|
-
/* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
2016
|
-
/* @__PURE__ */
|
|
2017
|
-
/* @__PURE__ */
|
|
2467
|
+
/* @__PURE__ */ e.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" }),
|
|
2468
|
+
/* @__PURE__ */ e.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" }),
|
|
2469
|
+
/* @__PURE__ */ e.jsx("path", { d: "M7.5 12.503h-3M9 14l-1 1q-.5.5-2.5 1.5" }),
|
|
2470
|
+
/* @__PURE__ */ e.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" })
|
|
2018
2471
|
]
|
|
2019
2472
|
}
|
|
2020
2473
|
)
|
|
2021
2474
|
}
|
|
2022
2475
|
) })
|
|
2023
2476
|
}
|
|
2024
|
-
]
|
|
2477
|
+
]
|
|
2025
2478
|
]
|
|
2026
2479
|
},
|
|
2027
|
-
...
|
|
2480
|
+
...Ce
|
|
2028
2481
|
}
|
|
2029
2482
|
),
|
|
2030
|
-
/* @__PURE__ */
|
|
2031
|
-
|
|
2483
|
+
/* @__PURE__ */ e.jsx(
|
|
2484
|
+
hn,
|
|
2032
2485
|
{
|
|
2033
|
-
activePage:
|
|
2034
|
-
canClose: !!
|
|
2035
|
-
open: !
|
|
2036
|
-
close: () =>
|
|
2486
|
+
activePage: n || "",
|
|
2487
|
+
canClose: !!n && !D(r),
|
|
2488
|
+
open: !n || !c && D(r) || Ie,
|
|
2489
|
+
close: () => Ne(!1)
|
|
2037
2490
|
}
|
|
2038
|
-
)
|
|
2491
|
+
),
|
|
2492
|
+
Be && /* @__PURE__ */ e.jsx(gn, { onClose: () => oe(!1) })
|
|
2039
2493
|
] });
|
|
2040
|
-
},
|
|
2494
|
+
}, _t = new ya({
|
|
2041
2495
|
defaultOptions: { queries: { refetchOnWindowFocus: !1 } }
|
|
2042
|
-
}),
|
|
2496
|
+
}), Cn = (a) => (_t.setQueryData(["builder_props"], a), /* @__PURE__ */ e.jsx(ja, { client: _t, children: /* @__PURE__ */ e.jsx(xn, { ...a }) }));
|
|
2043
2497
|
export {
|
|
2044
|
-
|
|
2498
|
+
Cn as default
|
|
2045
2499
|
};
|