useblocks 1.1.46 → 1.1.53
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/iframe/js/amp.BP7EklKo.js +1 -0
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.4N5s3OV-.js +1 -1
- package/monacoeditorwork/css.worker.bundle.js +40524 -40442
- package/monacoeditorwork/editor.worker.bundle.js +9740 -9697
- package/monacoeditorwork/html.worker.bundle.js +50513 -50431
- package/monacoeditorwork/json.worker.bundle.js +14570 -14527
- package/monacoeditorwork/ts.worker.bundle.js +119593 -119455
- package/npm-publish.manifest.json +7 -7
- package/package.json +1 -1
- package/runtime/@ant-design/cssinjs/index.js +1 -1
- package/runtime/@ant-design/icons/index.js +2 -2
- package/runtime/README.md +1 -1
- package/runtime/THIRD_PARTY_LICENSES.txt +71 -43
- package/runtime/antd/index.js +1 -1
- package/runtime/react/index.js +3 -3
- package/runtime/react/jsx-runtime/index.js +1 -1
- package/runtime/react-dom/client/index.js +4 -4
- package/runtime/react-dom/index.js +3 -3
- package/runtime/react-router-dom/index.js +2 -2
- package/singlepage_headless_plugin.html +1 -1
- package/static/core/{6b8432a3.js → 139e4380.js} +3 -3
- package/static/core/{90ec6d2b2.js → 1995fb0a2.js} +182 -153
- package/static/core/{6df04323.js → 1f5e1fc9.js} +573 -554
- package/static/core/31e98e6e.js +2095 -0
- package/static/core/5318562c.js +924 -0
- package/static/core/{6e2d88d5.js → 75737a9d.js} +6209 -6155
- package/static/core/{cc8f145d.js → 9929a348.js} +64 -64
- package/static/core/b408f33a.js +655 -0
- package/static/core/{526b23c2.js → bc7e3d2b.js} +7 -7
- package/static/core/{4eb628d3.js → c3058168.js} +3958 -3702
- package/static/core/ce0410b1.js +467 -0
- package/static/core/{b9529b8a.js → d1eb3c68.js} +17060 -16835
- package/static/core/{b8b730b2.js → dc1f9e4f.js} +17 -17
- package/static/core/{4a2af478.js → e1d239ab.js} +41 -41
- package/static/core/{9c1c1b89.js → e5e07f1d.js} +856 -755
- package/static/core/{350eac23.js → ebd852b6.js} +1756 -1702
- package/static/core/{cefd6620.js → ee0ddb51.js} +7782 -6601
- package/static/core/{a321a57d.js → f3cff4c9.js} +159 -159
- package/static/esm/{dab4cdfd.js → 448d4bb0.js} +70 -70
- package/static/esm/{7c5227f0.js → d180c108.js} +50 -47
- package/static/runtime/{DownloadOutlined-CgJ8OpH_.js → DownloadOutlined-Dg_G2xO7.js} +4 -4
- package/static/runtime/client-CfXgU5Vo.js +7580 -0
- package/static/runtime/{defineProperty-B-FyVNQF.js → defineProperty-C_9hhJHt.js} +1 -1
- package/static/runtime/dom-export-CHgQ7Ws9.js +8069 -0
- package/static/runtime/{es-DnZp8dh1.js → es-BPfImJ0x.js} +5 -5
- package/static/runtime/{es-B2DS-PLP.js → es-DcH6fwd6.js} +2 -2
- package/static/runtime/{es-deqzngIL.js → es-_OY-D9g1.js} +2 -2
- package/static/runtime/{jsx-dev-runtime-Wj1_6O79.js → jsx-dev-runtime-DDukXY54.js} +2 -2
- package/static/runtime/jsx-runtime-BodCQYDg.js +22 -0
- package/static/runtime/react-BHNx_xzv.js +290 -0
- package/static/runtime/react-dom-CyByzibb.js +127 -0
- package/two_step_headless_plugin.html +1 -1
- package/ui-kit/index.js +49 -47
- package/{useblocks-core.2116f1b9.js → useblocks-core.2a5dade1.js} +82 -76
- package/useblocks-esm.js +628 -3198
- package/useblocks.d.ts +184 -52
- package/useblocks.js +818 -12588
- package/vite/index.cjs +46 -21
- package/vite/index.d.ts +0 -1
- package/vite/index.js +46 -21
- package/vite/pluginDev/index.d.ts +0 -1
- package/webpack/index.cjs +46 -21
- package/webpack/index.d.ts +0 -1
- package/webpack/index.js +46 -21
- package/webpack/pluginDev/index.d.ts +0 -1
- package/iframe/js/amp.CVC2Iq48.js +0 -1
- package/static/core/35e13192.js +0 -463
- package/static/core/9421a704.js +0 -869
- package/static/core/9c79239d.js +0 -2063
- package/static/core/df0652cc.js +0 -1119
- package/static/esm/2fb07398.js +0 -3480
- package/static/esm/352121c5.js +0 -55
- package/static/esm/64966e1c.js +0 -18
- package/static/runtime/client-CM3WFcip.js +0 -7
- package/static/runtime/dist-DUS42Hru.js +0 -3421
- package/static/runtime/jsx-runtime-DmPQfqtr.js +0 -28
- package/static/runtime/react-DIf5CLST.js +0 -258
- package/static/runtime/react-dom-Cc3IcUkg.js +0 -5604
- /package/iframe/{iframe-eblock.2116f1b9.html → iframe-eblock.2a5dade1.html} +0 -0
- /package/iframe/{iframe.2116f1b9.html → iframe.2a5dade1.html} +0 -0
|
@@ -0,0 +1,924 @@
|
|
|
1
|
+
__useblocks__.define("static/core/5318562c.js", [
|
|
2
|
+
"require",
|
|
3
|
+
"exports",
|
|
4
|
+
"module",
|
|
5
|
+
"static/core/bd36b180.js",
|
|
6
|
+
"static/core/ee0ddb51.js"
|
|
7
|
+
], function(Ee, g, Bt) {
|
|
8
|
+
const ke = Ee("./bd36b180.js"), y = Ee("./ee0ddb51.js");
|
|
9
|
+
function Ae(t) {
|
|
10
|
+
return function(r) {
|
|
11
|
+
return {
|
|
12
|
+
setOptions: () => {},
|
|
13
|
+
instance: {},
|
|
14
|
+
dispose: () => {},
|
|
15
|
+
...t(r) || {}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function We(t) {
|
|
20
|
+
return (r) => {
|
|
21
|
+
const o = {}, s = [];
|
|
22
|
+
for (const h of t) s.push(h(r));
|
|
23
|
+
for (const h of s) Object.assign(o, h.instance);
|
|
24
|
+
return {
|
|
25
|
+
instance: o,
|
|
26
|
+
setOptions: async (h) => {
|
|
27
|
+
for (const S of s) await S.setOptions(h);
|
|
28
|
+
},
|
|
29
|
+
dispose: () => {
|
|
30
|
+
for (const h of s) h.dispose();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function xe() {
|
|
36
|
+
const t = new Date();
|
|
37
|
+
return t.valueOf() - t.getTimezoneOffset() * 60 * 1e3;
|
|
38
|
+
}
|
|
39
|
+
function $e(t) {
|
|
40
|
+
const r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), o = atob(r), s = new Uint8Array(o.length);
|
|
41
|
+
for (let c = 0; c < o.length; c++) s[c] = o.charCodeAt(c);
|
|
42
|
+
return new TextDecoder().decode(s);
|
|
43
|
+
}
|
|
44
|
+
function Ie(t) {
|
|
45
|
+
const [r, o, s] = t.split("."), c = JSON.parse($e(o));
|
|
46
|
+
return {
|
|
47
|
+
exp: c.exp,
|
|
48
|
+
createdAt: c.iat,
|
|
49
|
+
data: c
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
var ae = y.createIdentifier$1();
|
|
53
|
+
function Je(t, r, o, s) {
|
|
54
|
+
t.inject(ae, void 0), t.injectFactory(ae, async (c, d) => {
|
|
55
|
+
try {
|
|
56
|
+
let h = d ? await d : void 0;
|
|
57
|
+
if (!h) {
|
|
58
|
+
const S = t.getInstance(y.STANDALONE_BOOTSTRAP_TOKEN_ID);
|
|
59
|
+
S && (h = await S);
|
|
60
|
+
}
|
|
61
|
+
return r ? !h || (Ie(h)?.exp ?? 0) * 1e3 <= xe() ? await r(o, s, h) : h : "";
|
|
62
|
+
} catch {
|
|
63
|
+
return "";
|
|
64
|
+
}
|
|
65
|
+
}, !0);
|
|
66
|
+
}
|
|
67
|
+
var Xe = Ae((t) => {
|
|
68
|
+
let r, o, s;
|
|
69
|
+
return t.addService(y.REQUEST_HANDLER_ID, { execute: async (c) => {
|
|
70
|
+
if (r) {
|
|
71
|
+
const d = await t.getInstanceAsync(ae);
|
|
72
|
+
d && c.headers.append("authorization", `Bearer ${d}`);
|
|
73
|
+
}
|
|
74
|
+
} }), { setOptions(c) {
|
|
75
|
+
const d = !y.deepEqual(o, c.user), h = s !== c.project;
|
|
76
|
+
(r !== c.getAuthToken || d || h) && (r = c.getAuthToken, o = c.user, s = c.project, Je(t, r, c.user, c.project));
|
|
77
|
+
} };
|
|
78
|
+
}), Pe = ke.__commonJSMin(((t, r) => {
|
|
79
|
+
(function(o) {
|
|
80
|
+
"use strict";
|
|
81
|
+
var s = o.setTimeout, c = o.clearTimeout, d = o.XMLHttpRequest, h = o.XDomainRequest, S = o.ActiveXObject, G = o.EventSource, O = o.document, k = o.Promise, Q = o.fetch, M = o.Response, N = o.TextDecoder, Y = o.TextEncoder, $ = o.AbortController;
|
|
82
|
+
if (typeof window < "u" && typeof O < "u" && !("readyState" in O) && O.body == null && (O.readyState = "loading", window.addEventListener("load", function(e) {
|
|
83
|
+
O.readyState = "complete";
|
|
84
|
+
}, !1)), d == null && S != null && (d = function() {
|
|
85
|
+
return new S("Microsoft.XMLHTTP");
|
|
86
|
+
}), Object.create == null && (Object.create = function(e) {
|
|
87
|
+
function a() {}
|
|
88
|
+
return a.prototype = e, new a();
|
|
89
|
+
}), Date.now || (Date.now = function() {
|
|
90
|
+
return new Date().getTime();
|
|
91
|
+
}), $ == null) {
|
|
92
|
+
var K = Q;
|
|
93
|
+
Q = function(e, a) {
|
|
94
|
+
var i = a.signal;
|
|
95
|
+
return K(e, {
|
|
96
|
+
headers: a.headers,
|
|
97
|
+
credentials: a.credentials,
|
|
98
|
+
cache: a.cache
|
|
99
|
+
}).then(function(n) {
|
|
100
|
+
var l = n.body.getReader();
|
|
101
|
+
return i._reader = l, i._aborted && i._reader.cancel(), {
|
|
102
|
+
status: n.status,
|
|
103
|
+
statusText: n.statusText,
|
|
104
|
+
headers: n.headers,
|
|
105
|
+
body: { getReader: function() {
|
|
106
|
+
return l;
|
|
107
|
+
} }
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
}, $ = function() {
|
|
111
|
+
this.signal = {
|
|
112
|
+
_reader: null,
|
|
113
|
+
_aborted: !1
|
|
114
|
+
}, this.abort = function() {
|
|
115
|
+
this.signal._reader != null && this.signal._reader.cancel(), this.signal._aborted = !0;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function le() {
|
|
120
|
+
this.bitsNeeded = 0, this.codePoint = 0;
|
|
121
|
+
}
|
|
122
|
+
le.prototype.decode = function(e) {
|
|
123
|
+
function a(m, b, f) {
|
|
124
|
+
if (f === 1) return m >= 128 >> b && m << b <= 2047;
|
|
125
|
+
if (f === 2) return m >= 2048 >> b && m << b <= 55295 || m >= 57344 >> b && m << b <= 65535;
|
|
126
|
+
if (f === 3) return m >= 65536 >> b && m << b <= 1114111;
|
|
127
|
+
throw new Error();
|
|
128
|
+
}
|
|
129
|
+
function i(m, b) {
|
|
130
|
+
if (m === 6) return b >> 6 > 15 ? 3 : b > 31 ? 2 : 1;
|
|
131
|
+
if (m === 12) return b > 15 ? 3 : 2;
|
|
132
|
+
if (m === 18) return 3;
|
|
133
|
+
throw new Error();
|
|
134
|
+
}
|
|
135
|
+
for (var n = 65533, l = "", u = this.bitsNeeded, p = this.codePoint, T = 0; T < e.length; T += 1) {
|
|
136
|
+
var v = e[T];
|
|
137
|
+
u !== 0 && (v < 128 || v > 191 || !a(p << 6 | v & 63, u - 6, i(u, p))) && (u = 0, p = n, l += String.fromCharCode(p)), u === 0 ? (v >= 0 && v <= 127 ? (u = 0, p = v) : v >= 192 && v <= 223 ? (u = 6, p = v & 31) : v >= 224 && v <= 239 ? (u = 12, p = v & 15) : v >= 240 && v <= 247 ? (u = 18, p = v & 7) : (u = 0, p = n), u !== 0 && !a(p, u, i(u, p)) && (u = 0, p = n)) : (u -= 6, p = p << 6 | v & 63), u === 0 && (p <= 65535 ? l += String.fromCharCode(p) : (l += String.fromCharCode(55296 + (p - 65535 - 1 >> 10)), l += String.fromCharCode(56320 + (p - 65535 - 1 & 1023))));
|
|
138
|
+
}
|
|
139
|
+
return this.bitsNeeded = u, this.codePoint = p, l;
|
|
140
|
+
};
|
|
141
|
+
var Rt = function() {
|
|
142
|
+
try {
|
|
143
|
+
return new N().decode(new Y().encode("test"), { stream: !0 }) === "test";
|
|
144
|
+
} catch {}
|
|
145
|
+
return !1;
|
|
146
|
+
};
|
|
147
|
+
(N == null || Y == null || !Rt()) && (N = le);
|
|
148
|
+
var D = function() {};
|
|
149
|
+
function J(e) {
|
|
150
|
+
this.withCredentials = !1, this.readyState = 0, this.status = 0, this.statusText = "", this.responseText = "", this.onprogress = D, this.onload = D, this.onerror = D, this.onreadystatechange = D, this._contentType = "", this._xhr = e, this._sendTimeout = 0, this._abort = D;
|
|
151
|
+
}
|
|
152
|
+
J.prototype.open = function(e, a) {
|
|
153
|
+
this._abort(!0);
|
|
154
|
+
var i = this, n = this._xhr, l = 1, u = 0;
|
|
155
|
+
this._abort = function(f) {
|
|
156
|
+
i._sendTimeout !== 0 && (c(i._sendTimeout), i._sendTimeout = 0), (l === 1 || l === 2 || l === 3) && (l = 4, n.onload = D, n.onerror = D, n.onabort = D, n.onprogress = D, n.onreadystatechange = D, n.abort(), u !== 0 && (c(u), u = 0), f || (i.readyState = 4, i.onabort(null), i.onreadystatechange())), l = 0;
|
|
157
|
+
};
|
|
158
|
+
var p = function() {
|
|
159
|
+
if (l === 1) {
|
|
160
|
+
var f = 0, w = "", F = void 0;
|
|
161
|
+
if ("contentType" in n) f = 200, w = "OK", F = n.contentType;
|
|
162
|
+
else try {
|
|
163
|
+
f = n.status, w = n.statusText, F = n.getResponseHeader("Content-Type");
|
|
164
|
+
} catch {
|
|
165
|
+
f = 0, w = "", F = void 0;
|
|
166
|
+
}
|
|
167
|
+
f !== 0 && (l = 2, i.readyState = 2, i.status = f, i.statusText = w, i._contentType = F, i.onreadystatechange());
|
|
168
|
+
}
|
|
169
|
+
}, T = function() {
|
|
170
|
+
if (p(), l === 2 || l === 3) {
|
|
171
|
+
l = 3;
|
|
172
|
+
var f = "";
|
|
173
|
+
try {
|
|
174
|
+
f = n.responseText;
|
|
175
|
+
} catch {}
|
|
176
|
+
i.readyState = 3, i.responseText = f, i.onprogress();
|
|
177
|
+
}
|
|
178
|
+
}, v = function(f, w) {
|
|
179
|
+
if ((w == null || w.preventDefault == null) && (w = { preventDefault: D }), T(), l === 1 || l === 2 || l === 3) {
|
|
180
|
+
if (l = 4, u !== 0 && (c(u), u = 0), i.readyState = 4, f === "load") i.onload(w);
|
|
181
|
+
else if (f === "error") i.onerror(w);
|
|
182
|
+
else if (f === "abort") i.onabort(w);
|
|
183
|
+
else throw new TypeError();
|
|
184
|
+
i.onreadystatechange();
|
|
185
|
+
}
|
|
186
|
+
}, m = function(f) {
|
|
187
|
+
n != null && (n.readyState === 4 ? (!("onload" in n) || !("onerror" in n) || !("onabort" in n)) && v(n.responseText === "" ? "error" : "load", f) : n.readyState === 3 ? "onprogress" in n || T() : n.readyState === 2 && p());
|
|
188
|
+
}, b = function() {
|
|
189
|
+
u = s(function() {
|
|
190
|
+
b();
|
|
191
|
+
}, 500), n.readyState === 3 && T();
|
|
192
|
+
};
|
|
193
|
+
"onload" in n && (n.onload = function(f) {
|
|
194
|
+
v("load", f);
|
|
195
|
+
}), "onerror" in n && (n.onerror = function(f) {
|
|
196
|
+
v("error", f);
|
|
197
|
+
}), "onabort" in n && (n.onabort = function(f) {
|
|
198
|
+
v("abort", f);
|
|
199
|
+
}), "onprogress" in n && (n.onprogress = T), "onreadystatechange" in n && (n.onreadystatechange = function(f) {
|
|
200
|
+
m(f);
|
|
201
|
+
}), ("contentType" in n || !("ontimeout" in d.prototype)) && (a += (a.indexOf("?") === -1 ? "?" : "&") + "padding=true"), n.open(e, a, !0), "readyState" in n && (u = s(function() {
|
|
202
|
+
b();
|
|
203
|
+
}, 0));
|
|
204
|
+
}, J.prototype.abort = function() {
|
|
205
|
+
this._abort(!1);
|
|
206
|
+
}, J.prototype.getResponseHeader = function(e) {
|
|
207
|
+
return this._contentType;
|
|
208
|
+
}, J.prototype.setRequestHeader = function(e, a) {
|
|
209
|
+
var i = this._xhr;
|
|
210
|
+
"setRequestHeader" in i && i.setRequestHeader(e, a);
|
|
211
|
+
}, J.prototype.getAllResponseHeaders = function() {
|
|
212
|
+
return this._xhr.getAllResponseHeaders != null && this._xhr.getAllResponseHeaders() || "";
|
|
213
|
+
}, J.prototype.send = function() {
|
|
214
|
+
if ((!("ontimeout" in d.prototype) || !("sendAsBinary" in d.prototype) && !("mozAnon" in d.prototype)) && O != null && O.readyState != null && O.readyState !== "complete") {
|
|
215
|
+
var e = this;
|
|
216
|
+
e._sendTimeout = s(function() {
|
|
217
|
+
e._sendTimeout = 0, e.send();
|
|
218
|
+
}, 4);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
var a = this._xhr;
|
|
222
|
+
"withCredentials" in a && (a.withCredentials = this.withCredentials);
|
|
223
|
+
try {
|
|
224
|
+
a.send(void 0);
|
|
225
|
+
} catch (i) {
|
|
226
|
+
throw i;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
function Me(e) {
|
|
230
|
+
return e.replace(/[A-Z]/g, function(a) {
|
|
231
|
+
return String.fromCharCode(a.charCodeAt(0) + 32);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function Ne(e) {
|
|
235
|
+
for (var a = Object.create(null), i = e.split(`\r
|
|
236
|
+
`), n = 0; n < i.length; n += 1) {
|
|
237
|
+
var l = i[n].split(": "), u = l.shift(), p = l.join(": ");
|
|
238
|
+
a[Me(u)] = p;
|
|
239
|
+
}
|
|
240
|
+
this._map = a;
|
|
241
|
+
}
|
|
242
|
+
Ne.prototype.get = function(e) {
|
|
243
|
+
return this._map[Me(e)];
|
|
244
|
+
}, d != null && d.HEADERS_RECEIVED == null && (d.HEADERS_RECEIVED = 2);
|
|
245
|
+
function De() {}
|
|
246
|
+
De.prototype.open = function(e, a, i, n, l, u, p) {
|
|
247
|
+
e.open("GET", l);
|
|
248
|
+
var T = 0;
|
|
249
|
+
e.onprogress = function() {
|
|
250
|
+
var m = e.responseText.slice(T);
|
|
251
|
+
T += m.length, i(m);
|
|
252
|
+
}, e.onerror = function(m) {
|
|
253
|
+
m.preventDefault(), n(new Error("NetworkError"));
|
|
254
|
+
}, e.onload = function() {
|
|
255
|
+
n(null);
|
|
256
|
+
}, e.onabort = function() {
|
|
257
|
+
n(null);
|
|
258
|
+
}, e.onreadystatechange = function() {
|
|
259
|
+
if (e.readyState === d.HEADERS_RECEIVED) {
|
|
260
|
+
var m = e.status, b = e.statusText;
|
|
261
|
+
a(m, b, e.getResponseHeader("Content-Type"), new Ne(e.getAllResponseHeaders()));
|
|
262
|
+
}
|
|
263
|
+
}, e.withCredentials = u;
|
|
264
|
+
for (var v in p) Object.prototype.hasOwnProperty.call(p, v) && e.setRequestHeader(v, p[v]);
|
|
265
|
+
return e.send(), e;
|
|
266
|
+
};
|
|
267
|
+
function Ue(e) {
|
|
268
|
+
this._headers = e;
|
|
269
|
+
}
|
|
270
|
+
Ue.prototype.get = function(e) {
|
|
271
|
+
return this._headers.get(e);
|
|
272
|
+
};
|
|
273
|
+
function qe() {}
|
|
274
|
+
qe.prototype.open = function(e, a, i, n, l, u, p) {
|
|
275
|
+
var T = null, v = new $(), m = v.signal, b = new N();
|
|
276
|
+
return Q(l, {
|
|
277
|
+
headers: p,
|
|
278
|
+
credentials: u ? "include" : "same-origin",
|
|
279
|
+
signal: m,
|
|
280
|
+
cache: "no-store"
|
|
281
|
+
}).then(function(f) {
|
|
282
|
+
return T = f.body.getReader(), a(f.status, f.statusText, f.headers.get("Content-Type"), new Ue(f.headers)), new k(function(w, F) {
|
|
283
|
+
var ce = function() {
|
|
284
|
+
T.read().then(function(C) {
|
|
285
|
+
C.done ? w(void 0) : (i(b.decode(C.value, { stream: !0 })), ce());
|
|
286
|
+
}).catch(function(C) {
|
|
287
|
+
F(C);
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
ce();
|
|
291
|
+
});
|
|
292
|
+
}).catch(function(f) {
|
|
293
|
+
if (f.name !== "AbortError") return f;
|
|
294
|
+
}).then(function(f) {
|
|
295
|
+
n(f);
|
|
296
|
+
}), { abort: function() {
|
|
297
|
+
T?.cancel(), v.abort();
|
|
298
|
+
} };
|
|
299
|
+
};
|
|
300
|
+
function ie() {
|
|
301
|
+
this._listeners = Object.create(null);
|
|
302
|
+
}
|
|
303
|
+
function Ge(e) {
|
|
304
|
+
s(function() {
|
|
305
|
+
throw e;
|
|
306
|
+
}, 0);
|
|
307
|
+
}
|
|
308
|
+
ie.prototype.dispatchEvent = function(e) {
|
|
309
|
+
e.target = this;
|
|
310
|
+
var a = this._listeners[e.type];
|
|
311
|
+
if (a != null) for (var i = a.length, n = 0; n < i; n += 1) {
|
|
312
|
+
var l = a[n];
|
|
313
|
+
try {
|
|
314
|
+
typeof l.handleEvent == "function" ? l.handleEvent(e) : l.call(this, e);
|
|
315
|
+
} catch (u) {
|
|
316
|
+
Ge(u);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}, ie.prototype.addEventListener = function(e, a) {
|
|
320
|
+
e = String(e);
|
|
321
|
+
var i = this._listeners, n = i[e];
|
|
322
|
+
n == null && (n = [], i[e] = n);
|
|
323
|
+
for (var l = !1, u = 0; u < n.length; u += 1) n[u] === a && (l = !0);
|
|
324
|
+
l || n.push(a);
|
|
325
|
+
}, ie.prototype.removeEventListener = function(e, a) {
|
|
326
|
+
e = String(e);
|
|
327
|
+
var i = this._listeners, n = i[e];
|
|
328
|
+
if (n != null) {
|
|
329
|
+
for (var l = [], u = 0; u < n.length; u += 1) n[u] !== a && l.push(n[u]);
|
|
330
|
+
l.length === 0 ? delete i[e] : i[e] = l;
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
function Z(e) {
|
|
334
|
+
this.type = e, this.target = void 0;
|
|
335
|
+
}
|
|
336
|
+
function Qe(e, a) {
|
|
337
|
+
Z.call(this, e), this.data = a.data, this.lastEventId = a.lastEventId;
|
|
338
|
+
}
|
|
339
|
+
Qe.prototype = Object.create(Z.prototype);
|
|
340
|
+
function he(e, a) {
|
|
341
|
+
Z.call(this, e), this.status = a.status, this.statusText = a.statusText, this.headers = a.headers;
|
|
342
|
+
}
|
|
343
|
+
he.prototype = Object.create(Z.prototype);
|
|
344
|
+
function Fe(e, a) {
|
|
345
|
+
Z.call(this, e), this.error = a.error;
|
|
346
|
+
}
|
|
347
|
+
Fe.prototype = Object.create(Z.prototype);
|
|
348
|
+
var ye = -1, W = 0, ee = 1, se = 2, ge = -1, x = 0, me = 1, Be = 2, Lt = 3, Mt = /^text\/event\-stream(;.*)?$/i, Nt = 1e3, Dt = 18e6, Se = function(e, a) {
|
|
349
|
+
var i = e == null ? a : parseInt(e, 10);
|
|
350
|
+
return i !== i && (i = a), be(i);
|
|
351
|
+
}, be = function(e) {
|
|
352
|
+
return Math.min(Math.max(e, Nt), Dt);
|
|
353
|
+
}, te = function(e, a, i) {
|
|
354
|
+
try {
|
|
355
|
+
typeof a == "function" && a.call(e, i);
|
|
356
|
+
} catch (n) {
|
|
357
|
+
Ge(n);
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
function U(e, a) {
|
|
361
|
+
ie.call(this), a = a || {}, this.onopen = void 0, this.onmessage = void 0, this.onerror = void 0, this.url = void 0, this.readyState = void 0, this.withCredentials = void 0, this.headers = void 0, this._close = void 0, Gt(this, e, a);
|
|
362
|
+
}
|
|
363
|
+
function Ut() {
|
|
364
|
+
return d != null && "withCredentials" in d.prototype || h == null ? new d() : new h();
|
|
365
|
+
}
|
|
366
|
+
var qt = Q != null && M != null && "body" in M.prototype;
|
|
367
|
+
function Gt(e, a, i) {
|
|
368
|
+
a = String(a);
|
|
369
|
+
var n = !!i.withCredentials, l = i.lastEventIdQueryParameterName || "lastEventId", u = be(1e3), p = Se(i.heartbeatTimeout, 45e3), T = "", v = u, m = !1, b = 0, f = i.headers || {}, w = i.Transport, F = qt && w == null ? void 0 : new J(w != null ? new w() : Ut()), ce = w != null && typeof w != "string" ? new w() : F == null ? new qe() : new De(), C = void 0, j = 0, q = ye, re = "", fe = "", B = "", pe = "", P = x, Te = 0, X = 0, Qt = function(A, E, R, L) {
|
|
370
|
+
if (q === W) if (A === 200 && R != null && Mt.test(R)) {
|
|
371
|
+
q = ee, m = Date.now(), v = u, e.readyState = ee;
|
|
372
|
+
var _ = new he("open", {
|
|
373
|
+
status: A,
|
|
374
|
+
statusText: E,
|
|
375
|
+
headers: L
|
|
376
|
+
});
|
|
377
|
+
e.dispatchEvent(_), te(e, e.onopen, _);
|
|
378
|
+
} else {
|
|
379
|
+
A !== 200 ? (E && (E = E.replace(/\s+/g, " ")), "" + A + E) : "" + (R == null ? "-" : R.replace(/\s+/g, " ")), we();
|
|
380
|
+
var _ = new he("error", {
|
|
381
|
+
status: A,
|
|
382
|
+
statusText: E,
|
|
383
|
+
headers: L
|
|
384
|
+
});
|
|
385
|
+
e.dispatchEvent(_), te(e, e.onerror, _);
|
|
386
|
+
}
|
|
387
|
+
}, Ft = function(A) {
|
|
388
|
+
if (q === ee) {
|
|
389
|
+
for (var E = -1, R = 0; R < A.length; R += 1) {
|
|
390
|
+
var L = A.charCodeAt(R);
|
|
391
|
+
(L === 10 || L === 13) && (E = R);
|
|
392
|
+
}
|
|
393
|
+
var _ = (E !== -1 ? pe : "") + A.slice(0, E + 1);
|
|
394
|
+
pe = (E === -1 ? pe : "") + A.slice(E + 1), A !== "" && (m = Date.now(), b += A.length);
|
|
395
|
+
for (var I = 0; I < _.length; I += 1) {
|
|
396
|
+
var L = _.charCodeAt(I);
|
|
397
|
+
if (P === ge && L === 10) P = x;
|
|
398
|
+
else if (P === ge && (P = x), L === 13 || L === 10) {
|
|
399
|
+
if (P !== x) {
|
|
400
|
+
P === me && (X = I + 1);
|
|
401
|
+
var z = _.slice(Te, X - 1), H = _.slice(X + (X < I && _.charCodeAt(X) === 32 ? 1 : 0), I);
|
|
402
|
+
z === "data" ? (re += `
|
|
403
|
+
`, re += H) : z === "id" ? fe = H : z === "event" ? B = H : z === "retry" ? (u = Se(H, u), v = u) : z === "heartbeatTimeout" && (p = Se(H, p), j !== 0 && (c(j), j = s(function() {
|
|
404
|
+
ue();
|
|
405
|
+
}, p)));
|
|
406
|
+
}
|
|
407
|
+
if (P === x) {
|
|
408
|
+
if (re !== "") {
|
|
409
|
+
T = fe, B === "" && (B = "message");
|
|
410
|
+
var ne = new Qe(B, {
|
|
411
|
+
data: re.slice(1),
|
|
412
|
+
lastEventId: fe
|
|
413
|
+
});
|
|
414
|
+
if (e.dispatchEvent(ne), B === "open" ? te(e, e.onopen, ne) : B === "message" ? te(e, e.onmessage, ne) : B === "error" && te(e, e.onerror, ne), q === se) return;
|
|
415
|
+
}
|
|
416
|
+
re = "", B = "";
|
|
417
|
+
}
|
|
418
|
+
P = L === 13 ? ge : x;
|
|
419
|
+
} else P === x && (Te = I, P = me), P === me ? L === 58 && (X = I + 1, P = Be) : P === Be && (P = Lt);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}, He = function(A) {
|
|
423
|
+
if (q === ee || q === W) {
|
|
424
|
+
q = ye, j !== 0 && (c(j), j = 0), j = s(function() {
|
|
425
|
+
ue();
|
|
426
|
+
}, v), v = be(Math.min(u * 16, v * 2)), e.readyState = W;
|
|
427
|
+
var E = new Fe("error", { error: A });
|
|
428
|
+
e.dispatchEvent(E), te(e, e.onerror, E);
|
|
429
|
+
}
|
|
430
|
+
}, we = function() {
|
|
431
|
+
q = se, C != null && (C.abort(), C = void 0), j !== 0 && (c(j), j = 0), e.readyState = se;
|
|
432
|
+
}, ue = function() {
|
|
433
|
+
if (j = 0, q !== ye) {
|
|
434
|
+
if (!m && C != null) He(new Error("No activity within " + p + " milliseconds. " + (q === W ? "No response received." : b + " chars received.") + " Reconnecting.")), C != null && (C.abort(), C = void 0);
|
|
435
|
+
else {
|
|
436
|
+
var A = Math.max((m || Date.now()) + p - Date.now(), 1);
|
|
437
|
+
m = !1, j = s(function() {
|
|
438
|
+
ue();
|
|
439
|
+
}, A);
|
|
440
|
+
}
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
m = !1, b = 0, j = s(function() {
|
|
444
|
+
ue();
|
|
445
|
+
}, p), q = W, re = "", B = "", fe = T, pe = "", Te = 0, X = 0, P = x;
|
|
446
|
+
var E = a;
|
|
447
|
+
if (a.slice(0, 5) !== "data:" && a.slice(0, 5) !== "blob:" && T !== "") {
|
|
448
|
+
var R = a.indexOf("?");
|
|
449
|
+
E = R === -1 ? a : a.slice(0, R + 1) + a.slice(R + 1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g, function(H, ne) {
|
|
450
|
+
return ne === l ? "" : H;
|
|
451
|
+
}), E += (a.indexOf("?") === -1 ? "?" : "&") + l + "=" + encodeURIComponent(T);
|
|
452
|
+
}
|
|
453
|
+
var L = e.withCredentials, _ = {};
|
|
454
|
+
_.Accept = "text/event-stream";
|
|
455
|
+
var I = e.headers;
|
|
456
|
+
if (I != null) for (var z in I) Object.prototype.hasOwnProperty.call(I, z) && (_[z] = I[z]);
|
|
457
|
+
try {
|
|
458
|
+
C = ce.open(F, Qt, Ft, He, E, L, _);
|
|
459
|
+
} catch (H) {
|
|
460
|
+
throw we(), H;
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
e.url = a, e.readyState = W, e.withCredentials = n, e.headers = f, e._close = we, ue();
|
|
464
|
+
}
|
|
465
|
+
U.prototype = Object.create(ie.prototype), U.prototype.CONNECTING = W, U.prototype.OPEN = ee, U.prototype.CLOSED = se, U.prototype.close = function() {
|
|
466
|
+
this._close();
|
|
467
|
+
}, U.CONNECTING = W, U.OPEN = ee, U.CLOSED = se, U.prototype.withCredentials = void 0;
|
|
468
|
+
var ze = G;
|
|
469
|
+
d != null && (G == null || !("withCredentials" in G.prototype)) && (ze = U), (function(e) {
|
|
470
|
+
if (typeof r == "object" && typeof r.exports == "object") {
|
|
471
|
+
var a = e(t);
|
|
472
|
+
a !== void 0 && (r.exports = a);
|
|
473
|
+
} else typeof define == "function" && define.amd ? define(["exports"], e) : e(o);
|
|
474
|
+
})(function(e) {
|
|
475
|
+
e.EventSourcePolyfill = U, e.NativeEventSource = G, e.EventSource = ze;
|
|
476
|
+
});
|
|
477
|
+
})(typeof globalThis > "u" ? typeof window < "u" ? window : typeof self < "u" ? self : t : globalThis);
|
|
478
|
+
})), Ve = Pe();
|
|
479
|
+
function Ye({ candidates: t, headers: r, createEventSource: o, onMessage: s, onError: c }) {
|
|
480
|
+
const d = t.filter(Boolean);
|
|
481
|
+
let h = !1, S = null;
|
|
482
|
+
const G = () => {
|
|
483
|
+
S?.close(), S = null;
|
|
484
|
+
}, O = (k) => {
|
|
485
|
+
if (h) return;
|
|
486
|
+
const Q = d[k];
|
|
487
|
+
if (!Q) {
|
|
488
|
+
c?.(new Error("Failed to connect to EventSource through proxy chain"));
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
G();
|
|
492
|
+
const M = o(Q, { headers: r });
|
|
493
|
+
S = M, M.onmessage = (N) => {
|
|
494
|
+
h || S !== M || s(N);
|
|
495
|
+
}, M.onerror = (N) => {
|
|
496
|
+
if (!(h || S !== M)) {
|
|
497
|
+
if (G(), k + 1 < d.length) {
|
|
498
|
+
O(k + 1);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
c?.(N);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
return O(0), { close() {
|
|
506
|
+
h = !0, G();
|
|
507
|
+
} };
|
|
508
|
+
}
|
|
509
|
+
var Ke = "https://api.unsplash.com", Ze = "https://api.giphy.com/v1/gifs";
|
|
510
|
+
function oe(t) {
|
|
511
|
+
return { error: t instanceof Error ? t : new Error(String(t)) };
|
|
512
|
+
}
|
|
513
|
+
async function de(t) {
|
|
514
|
+
if (!t.ok) throw new Error(`Request failed with status ${t.status}`);
|
|
515
|
+
const r = await t.text();
|
|
516
|
+
try {
|
|
517
|
+
return r ? JSON.parse(r) : null;
|
|
518
|
+
} catch (o) {
|
|
519
|
+
throw o;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
function et(t) {
|
|
523
|
+
return t && Array.isArray(t.results) ? t : t?.data && Array.isArray(t.data.results) ? t.data : t?.response && Array.isArray(t.response.results) ? t.response : {
|
|
524
|
+
...t || {},
|
|
525
|
+
results: []
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
var _e = y.createApi({
|
|
529
|
+
reducerPath: "imageApi",
|
|
530
|
+
baseQuery: void 0,
|
|
531
|
+
endpoints: (t) => ({
|
|
532
|
+
getImageInfo: t.query({ queryFn: async function(r, o) {
|
|
533
|
+
try {
|
|
534
|
+
const s = o.getState().configSlice?.config?.imageInfoToolUrl || "https://scr.useblocks.io/imageinfo";
|
|
535
|
+
return { data: await de(await fetch(`${s}?url=${encodeURIComponent(r)}`)) };
|
|
536
|
+
} catch (s) {
|
|
537
|
+
return oe(s);
|
|
538
|
+
}
|
|
539
|
+
} }),
|
|
540
|
+
getSearchImage: t.query({ queryFn: async function({ query: r, page: o }, s) {
|
|
541
|
+
const c = r.keywords.replace(/[^\w\d\sа-яёА-ЯЁ]|_/g, "").replace(/[\s_-]+/g, " ");
|
|
542
|
+
try {
|
|
543
|
+
const d = s.getState().configSlice?.config, h = y.di.getInstance(s, y.SECURITY_MODULE_ID) !== void 0, S = new URL(`${Ke}/search/photos`);
|
|
544
|
+
return S.searchParams.set("client_id", "S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o"), S.searchParams.set("lang", "ru"), S.searchParams.set("per_page", "18"), S.searchParams.set("query", c), S.searchParams.set("page", String(o)), r.color !== "" && S.searchParams.set("color", r.color), r.orientation !== "" && S.searchParams.set("orientation", r.orientation), { data: et(await de(await y.fetchWithResourceProxy(S.toString(), {
|
|
545
|
+
config: d,
|
|
546
|
+
standalone: h,
|
|
547
|
+
resourceType: "stockImages",
|
|
548
|
+
intent: "metadata"
|
|
549
|
+
}))) };
|
|
550
|
+
} catch (d) {
|
|
551
|
+
return oe(d);
|
|
552
|
+
}
|
|
553
|
+
} }),
|
|
554
|
+
getUnsplashImage: t.query({ queryFn: async function(r, o) {
|
|
555
|
+
try {
|
|
556
|
+
const s = o.getState().configSlice?.config, c = y.di.getInstance(o, y.SECURITY_MODULE_ID) !== void 0, d = new URL(r);
|
|
557
|
+
return d.searchParams.set("client_id", "S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o"), { data: await de(await y.fetchWithResourceProxy(d.toString(), {
|
|
558
|
+
config: s,
|
|
559
|
+
standalone: c,
|
|
560
|
+
resourceType: "stockImages",
|
|
561
|
+
intent: "metadata"
|
|
562
|
+
})) };
|
|
563
|
+
} catch (s) {
|
|
564
|
+
return oe(s);
|
|
565
|
+
}
|
|
566
|
+
} }),
|
|
567
|
+
sendAiImageRequest: t.query({ queryFn: async function({ body: r }, o) {
|
|
568
|
+
try {
|
|
569
|
+
return await y.getClient(o).aiGenerator.ai_create(r);
|
|
570
|
+
} catch (s) {
|
|
571
|
+
throw new Error(s);
|
|
572
|
+
}
|
|
573
|
+
} }),
|
|
574
|
+
getAiImage: t.query({ queryFn: async function(r, o) {
|
|
575
|
+
try {
|
|
576
|
+
return await y.getClient(o).aiGenerator.ai_status_list(r);
|
|
577
|
+
} catch (s) {
|
|
578
|
+
return oe(s);
|
|
579
|
+
}
|
|
580
|
+
} }),
|
|
581
|
+
getAiImageSSE: t.query({
|
|
582
|
+
queryFn: (r) => ({ data: [] }),
|
|
583
|
+
async onCacheEntryAdded({ task_id: r, entity_id: o, setError: s }, c) {
|
|
584
|
+
const { updateCachedData: d, cacheEntryRemoved: h } = c, S = y.getClient(c).baseUrl || y.normalizeBaseUrl("https://app.useblocks.io/api"), G = c.getState().configSlice?.config, O = y.di.getInstance(c, y.SECURITY_MODULE_ID) !== void 0, k = y.PLUGIN.isPlugin ? await y.di.getInstance(c, ae) : y.api.get(y.APP_COOKIES.em_token), Q = k ? { Authorization: `Bearer ${k}` } : {}, M = `${S}/ai-generator/v1/ai-status?entity_id=${o}&stream=1&task_id=${r}`, N = y.resolveBackendProxyRequestCandidates(M, {
|
|
585
|
+
config: G,
|
|
586
|
+
method: "GET",
|
|
587
|
+
requestType: "ai",
|
|
588
|
+
standalone: O
|
|
589
|
+
}), Y = Ye({
|
|
590
|
+
candidates: N.length > 0 ? N : [M],
|
|
591
|
+
headers: Q,
|
|
592
|
+
createEventSource: ($, K) => new Ve.EventSourcePolyfill($, K),
|
|
593
|
+
onMessage: ($) => {
|
|
594
|
+
const K = JSON.parse($.data);
|
|
595
|
+
d((le) => {
|
|
596
|
+
le.push(K);
|
|
597
|
+
}), K.progress === 100 && Y.close();
|
|
598
|
+
},
|
|
599
|
+
onError: () => {
|
|
600
|
+
Y.close();
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
await h, Y.close();
|
|
604
|
+
}
|
|
605
|
+
}),
|
|
606
|
+
getSearchGif: t.query({ queryFn: async function({ query: r, page: o }, s) {
|
|
607
|
+
const c = r.keywords.replace(/[^\w\d\sа-яёА-ЯЁ]|_/g, "").replace(/[\s_-]+/g, " ");
|
|
608
|
+
try {
|
|
609
|
+
const d = s.getState().configSlice?.config, h = y.di.getInstance(s, y.SECURITY_MODULE_ID) !== void 0;
|
|
610
|
+
return { data: await de(await y.fetchWithResourceProxy(`${Ze}/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${encodeURIComponent(c)}&limit=25&offset=${o}&lang=en`, {
|
|
611
|
+
config: d,
|
|
612
|
+
standalone: h,
|
|
613
|
+
resourceType: "generic",
|
|
614
|
+
intent: "metadata"
|
|
615
|
+
})) };
|
|
616
|
+
} catch (d) {
|
|
617
|
+
return oe(d);
|
|
618
|
+
}
|
|
619
|
+
} })
|
|
620
|
+
})
|
|
621
|
+
}), { useLazyGetImageInfoQuery: tt, useGetImageInfoQuery: zt, useGetSearchImageQuery: Ht, useLazyGetSearchImageQuery: rt, useSendAiImageRequestQuery: kt, useLazySendAiImageRequestQuery: nt, useGetAiImageQuery: Wt, useLazyGetAiImageQuery: xt, useGetUnsplashImageQuery: $t, useLazyGetUnsplashImageQuery: at, useGetSearchGifQuery: Jt, useLazyGetSearchGifQuery: ot, useGetAiImageSSEQuery: Xt, useLazyGetAiImageSSEQuery: it } = _e, st = "https://app.useblocks.io/api".replaceAll(/[\\/]$/g, ""), ve = "wp-json/limits/v1", ct = "wp-json/subscription/v2", Oe = y.createApi({
|
|
622
|
+
reducerPath: "limitsApi",
|
|
623
|
+
baseQuery: y.fetchBaseQueryApp({ baseUrl: st }),
|
|
624
|
+
tagTypes: [
|
|
625
|
+
"LimitsStats",
|
|
626
|
+
"LimitsWarnings",
|
|
627
|
+
"SubscriptionMe"
|
|
628
|
+
],
|
|
629
|
+
endpoints: (t) => ({
|
|
630
|
+
getLimitsStats: t.query({
|
|
631
|
+
query: () => ({
|
|
632
|
+
url: `${ve}/stats`,
|
|
633
|
+
method: "GET"
|
|
634
|
+
}),
|
|
635
|
+
providesTags: ["LimitsStats"]
|
|
636
|
+
}),
|
|
637
|
+
getLimitsStatsByType: t.query({
|
|
638
|
+
query: (r) => ({
|
|
639
|
+
url: `${ve}/stats/${r}`,
|
|
640
|
+
method: "GET"
|
|
641
|
+
}),
|
|
642
|
+
providesTags: (r, o, s) => [{
|
|
643
|
+
type: "LimitsStats",
|
|
644
|
+
id: s
|
|
645
|
+
}]
|
|
646
|
+
}),
|
|
647
|
+
getLimitsWarnings: t.query({
|
|
648
|
+
query: () => ({
|
|
649
|
+
url: `${ve}/warnings`,
|
|
650
|
+
method: "GET"
|
|
651
|
+
}),
|
|
652
|
+
providesTags: ["LimitsWarnings"]
|
|
653
|
+
}),
|
|
654
|
+
getSubscriptionMeV2: t.query({
|
|
655
|
+
query: () => ({
|
|
656
|
+
url: `${ct}/me`,
|
|
657
|
+
method: "GET"
|
|
658
|
+
}),
|
|
659
|
+
providesTags: ["SubscriptionMe"]
|
|
660
|
+
})
|
|
661
|
+
})
|
|
662
|
+
}), { useGetLimitsStatsQuery: ut, useLazyGetLimitsStatsQuery: Vt, useGetLimitsStatsByTypeQuery: Yt, useLazyGetLimitsStatsByTypeQuery: dt, useGetLimitsWarningsQuery: lt, useLazyGetLimitsWarningsQuery: Kt, useGetSubscriptionMeV2Query: Zt, useLazyGetSubscriptionMeV2Query: er } = Oe, Ce = new URLSearchParams(window.location.search), je = Ce.get("tag"), ft = Ce.get("folder"), pt = y.createState({
|
|
663
|
+
activeModal: "",
|
|
664
|
+
switchToPlanRequestTitle: "",
|
|
665
|
+
secondModal: "",
|
|
666
|
+
projectsTotal: "",
|
|
667
|
+
projectsTotalPages: "",
|
|
668
|
+
folders: [],
|
|
669
|
+
activeTagId: je || null,
|
|
670
|
+
activeFolderId: ft || (je ? null : "all"),
|
|
671
|
+
activeTab: null,
|
|
672
|
+
activeIntegration: null,
|
|
673
|
+
addNewProjectInitialTitle: null
|
|
674
|
+
}), V = "projectsPageSlice", Re = y.createSlice({
|
|
675
|
+
name: V,
|
|
676
|
+
initialState: pt,
|
|
677
|
+
reducers: {
|
|
678
|
+
openModal(t, r) {
|
|
679
|
+
t.activeModal = r.payload;
|
|
680
|
+
},
|
|
681
|
+
openAddNewProjectModal(t, r) {
|
|
682
|
+
t.activeModal = y.MODALS.ADD_NEW_PROJECT_MODAL, t.addNewProjectInitialTitle = r.payload ?? null;
|
|
683
|
+
},
|
|
684
|
+
setSwitchToPlanRequestTitle(t, r) {
|
|
685
|
+
t.switchToPlanRequestTitle = typeof r.payload == "string" ? r.payload : "";
|
|
686
|
+
},
|
|
687
|
+
setActiveTab(t, r) {
|
|
688
|
+
t.activeTab = r.payload;
|
|
689
|
+
},
|
|
690
|
+
closeModal(t) {
|
|
691
|
+
t.activeModal = "", t.activeIntegration = null, t.addNewProjectInitialTitle = null, t.switchToPlanRequestTitle = "";
|
|
692
|
+
},
|
|
693
|
+
openSecondModal(t, r) {
|
|
694
|
+
t.secondModal = r.payload;
|
|
695
|
+
},
|
|
696
|
+
closeSecondModal(t) {
|
|
697
|
+
t.secondModal = "";
|
|
698
|
+
},
|
|
699
|
+
setFolders(t, { payload: r }) {
|
|
700
|
+
t.folders = r;
|
|
701
|
+
},
|
|
702
|
+
setActiveTagId(t, { payload: r }) {
|
|
703
|
+
t.activeTagId = r;
|
|
704
|
+
},
|
|
705
|
+
setActiveIntegration(t, r) {
|
|
706
|
+
t.activeIntegration = r.payload;
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
extraReducers: (t) => {
|
|
710
|
+
t.addMatcher(y.projectsApi.endpoints.getProjects.matchFulfilled, (r, o) => {
|
|
711
|
+
const s = o.meta, c = s.baseQueryMeta, d = s.projectsListPagination ?? c?.projectsListPagination;
|
|
712
|
+
if (d != null && typeof d.total == "number" && Number.isFinite(d.total) && d.total >= 0) {
|
|
713
|
+
r.projectsTotal = String(d.total), r.projectsTotalPages = String(typeof d.totalPages == "number" && Number.isFinite(d.totalPages) ? d.totalPages : "");
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
const h = c?.response?.headers?.get?.("X-WP-Total"), S = c?.response?.headers?.get?.("X-WP-TotalPages");
|
|
717
|
+
r.projectsTotal = h ?? "", r.projectsTotalPages = S ?? "";
|
|
718
|
+
}), t.addMatcher(y.taxonomiesApi.endpoints.getTerms.matchFulfilled, (r, { meta: o, payload: s }) => {
|
|
719
|
+
const c = o.arg.originalArgs?.kind;
|
|
720
|
+
(c === "folder" || c === "blockfolder") && (r.folders = s);
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
}), { openModal: vt, openAddNewProjectModal: tr, setSwitchToPlanRequestTitle: ht, setActiveTab: yt, closeModal: gt, openSecondModal: mt, closeSecondModal: St, setFolders: rr, setActiveTagId: nr, setActiveIntegration: ar } = Re.actions, bt = (t) => t[V].activeTab, Tt = (t) => t[V].activeModal, wt = (t) => t[V].secondModal, Et = (t) => t[V].projectsTotal, At = (t) => t[V].activeIntegration, It = 3, Pt = /^(.+\.[a-zA-Z0-9]{1,8})\?[^?#]*$/;
|
|
724
|
+
function _t(t) {
|
|
725
|
+
let r = t;
|
|
726
|
+
for (let o = 0; o < It; o++) try {
|
|
727
|
+
const s = decodeURIComponent(r);
|
|
728
|
+
if (s === r) break;
|
|
729
|
+
r = s;
|
|
730
|
+
} catch {
|
|
731
|
+
break;
|
|
732
|
+
}
|
|
733
|
+
return r.normalize("NFC");
|
|
734
|
+
}
|
|
735
|
+
function Ot(t) {
|
|
736
|
+
const r = t.match(Pt);
|
|
737
|
+
return r ? r[1] : t;
|
|
738
|
+
}
|
|
739
|
+
function Ct(t) {
|
|
740
|
+
if (/^https?:\/\//i.test(t)) return new URL(t).pathname.split("/").filter(Boolean).pop();
|
|
741
|
+
if (t.startsWith("//")) return new URL(t, "https://placeholder.invalid").pathname.split("/").filter(Boolean).pop();
|
|
742
|
+
}
|
|
743
|
+
function Le(t) {
|
|
744
|
+
const r = t.replaceAll("\\", "/").trim();
|
|
745
|
+
if (!r) return r;
|
|
746
|
+
let o;
|
|
747
|
+
try {
|
|
748
|
+
o = Ct(r);
|
|
749
|
+
} catch {}
|
|
750
|
+
if (!o) {
|
|
751
|
+
o = Ot(r.split("/").pop() ?? "");
|
|
752
|
+
const s = o.indexOf("#");
|
|
753
|
+
s >= 0 && (o = o.slice(0, s));
|
|
754
|
+
}
|
|
755
|
+
return _t(o);
|
|
756
|
+
}
|
|
757
|
+
function jt(t) {
|
|
758
|
+
const r = t.trim();
|
|
759
|
+
if (r) {
|
|
760
|
+
if (!(/^https?:\/\//i.test(r) || r.startsWith("//"))) try {
|
|
761
|
+
new URL(r);
|
|
762
|
+
} catch {
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
return Le(r) || void 0;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
Object.defineProperty(g, "OAuthMixin", {
|
|
769
|
+
enumerable: !0,
|
|
770
|
+
get: function() {
|
|
771
|
+
return Xe;
|
|
772
|
+
}
|
|
773
|
+
}), Object.defineProperty(g, "TOKEN_ID", {
|
|
774
|
+
enumerable: !0,
|
|
775
|
+
get: function() {
|
|
776
|
+
return ae;
|
|
777
|
+
}
|
|
778
|
+
}), Object.defineProperty(g, "closeModal", {
|
|
779
|
+
enumerable: !0,
|
|
780
|
+
get: function() {
|
|
781
|
+
return gt;
|
|
782
|
+
}
|
|
783
|
+
}), Object.defineProperty(g, "closeSecondModal", {
|
|
784
|
+
enumerable: !0,
|
|
785
|
+
get: function() {
|
|
786
|
+
return St;
|
|
787
|
+
}
|
|
788
|
+
}), Object.defineProperty(g, "combineMixins", {
|
|
789
|
+
enumerable: !0,
|
|
790
|
+
get: function() {
|
|
791
|
+
return We;
|
|
792
|
+
}
|
|
793
|
+
}), Object.defineProperty(g, "decodeFileNameFromPath", {
|
|
794
|
+
enumerable: !0,
|
|
795
|
+
get: function() {
|
|
796
|
+
return Le;
|
|
797
|
+
}
|
|
798
|
+
}), Object.defineProperty(g, "decodeFileNameFromUrl", {
|
|
799
|
+
enumerable: !0,
|
|
800
|
+
get: function() {
|
|
801
|
+
return jt;
|
|
802
|
+
}
|
|
803
|
+
}), Object.defineProperty(g, "decodeJwt", {
|
|
804
|
+
enumerable: !0,
|
|
805
|
+
get: function() {
|
|
806
|
+
return Ie;
|
|
807
|
+
}
|
|
808
|
+
}), Object.defineProperty(g, "defineMixin", {
|
|
809
|
+
enumerable: !0,
|
|
810
|
+
get: function() {
|
|
811
|
+
return Ae;
|
|
812
|
+
}
|
|
813
|
+
}), Object.defineProperty(g, "imageApi", {
|
|
814
|
+
enumerable: !0,
|
|
815
|
+
get: function() {
|
|
816
|
+
return _e;
|
|
817
|
+
}
|
|
818
|
+
}), Object.defineProperty(g, "limitsApi", {
|
|
819
|
+
enumerable: !0,
|
|
820
|
+
get: function() {
|
|
821
|
+
return Oe;
|
|
822
|
+
}
|
|
823
|
+
}), Object.defineProperty(g, "openModal", {
|
|
824
|
+
enumerable: !0,
|
|
825
|
+
get: function() {
|
|
826
|
+
return vt;
|
|
827
|
+
}
|
|
828
|
+
}), Object.defineProperty(g, "openSecondModal", {
|
|
829
|
+
enumerable: !0,
|
|
830
|
+
get: function() {
|
|
831
|
+
return mt;
|
|
832
|
+
}
|
|
833
|
+
}), Object.defineProperty(g, "projectsPageSlice", {
|
|
834
|
+
enumerable: !0,
|
|
835
|
+
get: function() {
|
|
836
|
+
return Re;
|
|
837
|
+
}
|
|
838
|
+
}), Object.defineProperty(g, "require_eventsource", {
|
|
839
|
+
enumerable: !0,
|
|
840
|
+
get: function() {
|
|
841
|
+
return Pe;
|
|
842
|
+
}
|
|
843
|
+
}), Object.defineProperty(g, "selectActiveIntegration", {
|
|
844
|
+
enumerable: !0,
|
|
845
|
+
get: function() {
|
|
846
|
+
return At;
|
|
847
|
+
}
|
|
848
|
+
}), Object.defineProperty(g, "selectActiveModal", {
|
|
849
|
+
enumerable: !0,
|
|
850
|
+
get: function() {
|
|
851
|
+
return Tt;
|
|
852
|
+
}
|
|
853
|
+
}), Object.defineProperty(g, "selectActiveTab", {
|
|
854
|
+
enumerable: !0,
|
|
855
|
+
get: function() {
|
|
856
|
+
return bt;
|
|
857
|
+
}
|
|
858
|
+
}), Object.defineProperty(g, "selectProjectsTotal", {
|
|
859
|
+
enumerable: !0,
|
|
860
|
+
get: function() {
|
|
861
|
+
return Et;
|
|
862
|
+
}
|
|
863
|
+
}), Object.defineProperty(g, "selectSecondModal", {
|
|
864
|
+
enumerable: !0,
|
|
865
|
+
get: function() {
|
|
866
|
+
return wt;
|
|
867
|
+
}
|
|
868
|
+
}), Object.defineProperty(g, "setActiveTab", {
|
|
869
|
+
enumerable: !0,
|
|
870
|
+
get: function() {
|
|
871
|
+
return yt;
|
|
872
|
+
}
|
|
873
|
+
}), Object.defineProperty(g, "setSwitchToPlanRequestTitle", {
|
|
874
|
+
enumerable: !0,
|
|
875
|
+
get: function() {
|
|
876
|
+
return ht;
|
|
877
|
+
}
|
|
878
|
+
}), Object.defineProperty(g, "useGetLimitsStatsQuery", {
|
|
879
|
+
enumerable: !0,
|
|
880
|
+
get: function() {
|
|
881
|
+
return ut;
|
|
882
|
+
}
|
|
883
|
+
}), Object.defineProperty(g, "useGetLimitsWarningsQuery", {
|
|
884
|
+
enumerable: !0,
|
|
885
|
+
get: function() {
|
|
886
|
+
return lt;
|
|
887
|
+
}
|
|
888
|
+
}), Object.defineProperty(g, "useLazyGetAiImageSSEQuery", {
|
|
889
|
+
enumerable: !0,
|
|
890
|
+
get: function() {
|
|
891
|
+
return it;
|
|
892
|
+
}
|
|
893
|
+
}), Object.defineProperty(g, "useLazyGetImageInfoQuery", {
|
|
894
|
+
enumerable: !0,
|
|
895
|
+
get: function() {
|
|
896
|
+
return tt;
|
|
897
|
+
}
|
|
898
|
+
}), Object.defineProperty(g, "useLazyGetLimitsStatsByTypeQuery", {
|
|
899
|
+
enumerable: !0,
|
|
900
|
+
get: function() {
|
|
901
|
+
return dt;
|
|
902
|
+
}
|
|
903
|
+
}), Object.defineProperty(g, "useLazyGetSearchGifQuery", {
|
|
904
|
+
enumerable: !0,
|
|
905
|
+
get: function() {
|
|
906
|
+
return ot;
|
|
907
|
+
}
|
|
908
|
+
}), Object.defineProperty(g, "useLazyGetSearchImageQuery", {
|
|
909
|
+
enumerable: !0,
|
|
910
|
+
get: function() {
|
|
911
|
+
return rt;
|
|
912
|
+
}
|
|
913
|
+
}), Object.defineProperty(g, "useLazyGetUnsplashImageQuery", {
|
|
914
|
+
enumerable: !0,
|
|
915
|
+
get: function() {
|
|
916
|
+
return at;
|
|
917
|
+
}
|
|
918
|
+
}), Object.defineProperty(g, "useLazySendAiImageRequestQuery", {
|
|
919
|
+
enumerable: !0,
|
|
920
|
+
get: function() {
|
|
921
|
+
return nt;
|
|
922
|
+
}
|
|
923
|
+
});
|
|
924
|
+
});
|