useblocks 1.1.49 → 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.
Files changed (34) hide show
  1. package/iframe/js/amp.BP7EklKo.js +1 -1
  2. package/iframe/js/iframe-eblock.js +1 -1
  3. package/iframe/js/iframe.js +1 -1
  4. package/iframe/js/rules.4N5s3OV-.js +1 -1
  5. package/npm-publish.manifest.json +7 -7
  6. package/package.json +1 -1
  7. package/runtime/THIRD_PARTY_LICENSES.txt +1 -1
  8. package/singlepage_headless_plugin.html +1 -1
  9. package/static/core/{8c81db36.js → 139e4380.js} +3 -3
  10. package/static/core/{1ca5f3772.js → 1995fb0a2.js} +10 -10
  11. package/static/core/{3b4845f7.js → 1f5e1fc9.js} +321 -321
  12. package/static/core/{59023866.js → 31e98e6e.js} +616 -611
  13. package/static/core/{13f581cc.js → 5318562c.js} +3 -3
  14. package/static/core/{386cf7b3.js → 75737a9d.js} +5156 -5116
  15. package/static/core/{11296a18.js → 9929a348.js} +107 -107
  16. package/static/core/{e7c24fe9.js → b408f33a.js} +179 -173
  17. package/static/core/{3dea3b87.js → bc7e3d2b.js} +7 -7
  18. package/static/core/{de79e0c5.js → c3058168.js} +524 -510
  19. package/static/core/ce0410b1.js +467 -0
  20. package/static/core/{339377b8.js → d1eb3c68.js} +13244 -13200
  21. package/static/core/{8e110c69.js → dc1f9e4f.js} +31 -31
  22. package/static/core/{7a229b90.js → e1d239ab.js} +41 -41
  23. package/static/core/{aacf134d.js → e5e07f1d.js} +514 -494
  24. package/static/core/{acb049cb.js → ebd852b6.js} +1267 -1265
  25. package/static/core/{c59f9731.js → ee0ddb51.js} +4036 -3900
  26. package/static/core/{13d197af.js → f3cff4c9.js} +169 -169
  27. package/two_step_headless_plugin.html +1 -1
  28. package/ui-kit/index.js +49 -47
  29. package/{useblocks-core.15a9129c.js → useblocks-core.2a5dade1.js} +6 -6
  30. package/useblocks-esm.js +3 -3
  31. package/useblocks.js +3 -3
  32. package/static/core/a11c28c2.js +0 -467
  33. /package/iframe/{iframe-eblock.15a9129c.html → iframe-eblock.2a5dade1.html} +0 -0
  34. /package/iframe/{iframe.15a9129c.html → iframe.2a5dade1.html} +0 -0
@@ -1,25 +1,26 @@
1
1
  (function(){try{if(typeof document<"u"){var o=document.createElement("style");o.setAttribute("data-useblocks","true"),o.appendChild(document.createTextNode(".blocks-app .image-preview{text-align:center;min-height:100px;position:relative}.blocks-app .image-preview .image-editor-modal{border:1px solid red}.blocks-app .image-preview__edit-button{position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-preview img{border:1px solid var(--colorBorder);border-radius:6px;max-width:100%;max-height:500px}.blocks-app .image-editor-modal .ant-modal-container{flex-direction:column;min-height:100vh;display:flex;border-radius:0!important}.blocks-app .image-editor-modal .ant-modal-body{flex-grow:1;display:flex}.blocks-app .image-editor-modal .ant-modal-body #pixie-editor{flex-grow:1;height:calc(100vh - 70px);min-height:calc(100vh - 70px);overflow:hidden}.blocks-app .image-editor-modal .pi .text-on-primary{background:var(--colorPrimary);border-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary:hover{background:var(--colorPrimaryHover);border-color:var(--colorPrimaryHover)}.blocks-app .image-editor-modal .pi .text-on-primary.rounded-full{border-radius:calc(var(--borderRadius) * 1px)}.blocks-app .image-editor-modal .pi .shadow-xl{box-shadow:none}.blocks-app .image-editor-modal .w-\\[4ch\\].text-sm.text-center{width:5ch}.blocks-app .image-editor-modal .pi .border-white{border-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .bg-white\\/50{background-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary{color:var(--colorWhite)}.blocks-app .serach-results .ant-row{align-items:center}.blocks-app .serach-results .blocks-search__divider-wrapper{margin-top:12px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{border-top:1px solid var(--colorBorderSecondary);background:0 0;width:100%;height:1px;min-height:0;margin:0;position:static}.blocks-app .slideshow-container{width:524px;height:350px;margin:auto;position:relative;overflow:hidden}.blocks-app .slideshow-image{opacity:0;width:100%;height:100%;position:absolute;top:0;left:0}.blocks-app .image-ai .slideshow-image{width:auto;height:auto}.blocks-app .image-ai__image-item{text-align:center;border-radius:6px;justify-content:center;align-items:center;min-height:100px;display:flex;position:relative}.blocks-app .image-ai__image-item .buttons{justify-content:space-between;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-ai .text-area-input-hybrid{border:none;outline:none;min-height:0;padding:0 0 0 1px}.blocks-app .image-ai .text-area-input-hybrid textarea{height:32px;min-height:32px;padding:3px 11px;line-height:26px}.blocks-app .image-ai__loading{justify-content:center;align-items:center;min-height:150px;display:flex}.blocks-app .image-ai__loading .spin{flex-direction:column;justify-content:center;align-items:center;height:150px;display:flex}.blocks-app .image-ai__loading .status{margin:3px 0 0}.blocks-app .image-ai__preview{border-radius:6px;margin-top:24px;overflow:hidden}.blocks-app .image-ai__preview .image-ai__image-item img{border-radius:calc(var(--borderRadius) * 1px);object-fit:contain;max-height:100%;transition:height 1s;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}.blocks-app .image-ai .small{width:302px;height:202px}.blocks-app .image-ai .large{width:524px;height:350px}.blocks-app .image-ai .image-ai__row{padding:0 2px}.blocks-app .image-ai .image-ai__input-affix-wrapper{border-style:solid;border-width:calc(var(--borderWidth) * 1px);border-color:var(--colorFillSecondaryDarken);border-radius:calc(var(--borderRadius) * 1px);width:100%;padding-left:0;display:inline-flex}.blocks-app .image-ai .image-ai__input-affix-wrapper:hover{border-color:var(--borderColorHover)}.blocks-app .image-ai .image-ai__input-affix-wrapper.ant-input-affix-wrapper-focused{border-color:var(--colorPrimaryBorder)}.blocks-app .image-ai .image-ai__textarea{font-size:16px}.blocks-app .image-ai .image-ai__input-icon{font-size:16px;top:0;right:0}.dark .blocks-app .image-ai .image-ai__preview .image-ai__image-item img{background:#2b2b2b;border:1px solid #434343}.dark .blocks-app .image-ai .ant-btn{background:#1f1f1f}.dark .blocks-app .image-ai .ant-btn:hover{color:var(--colorPrimary)}.blocks-app .stock-tab img{border-radius:0;max-width:none;max-height:none}.blocks-app .stock-tab .stock-search-input{padding:0 2px}.blocks-app .stock-tab .my-masonry-grid{text-align:center;width:auto;display:flex}.blocks-app .stock-tab .my-masonry-grid_column{background-clip:padding-box}.blocks-app .stock-tab .list-item{cursor:pointer;background:#f0f2f5;border:1px solid #f0f2f5;border-radius:6px;min-height:100px;max-height:100px;margin-bottom:20px;transition:all .3s;display:inline-block;position:relative;overflow:hidden}.blocks-app .stock-tab .list-item .overlay-image{opacity:0;background-size:cover;width:110px;height:40px;transition:opacity .5s;position:absolute;bottom:10px;right:10px}.blocks-app .stock-tab .list-item .ant-spin{color:#f0f2f5;font-size:20px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.blocks-app .stock-tab .list-item img{object-fit:cover;opacity:0;border-radius:6px;height:auto;transition:opacity .5s ease-in-out;display:block}.blocks-app .stock-tab .list-item.loaded{border:1px solid #d9d9d9;max-height:1000px}.blocks-app .stock-tab .list-item.loaded img{opacity:1;height:100%}.blocks-app .stock-tab .list-item.loaded .loaded-image{opacity:.5}.blocks-app .stock-tab .list-item:hover{box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #00000017}.blocks-app .stock-tab .list-item:hover p.creator-info,.blocks-app .stock-tab .list-item:hover .overlay-image{opacity:1}.blocks-app .stock-tab .list-item p.creator-info{color:#fff;opacity:0;background-color:#00000080;border-radius:0 0 6px;margin:0;padding:5px;font-size:10px;line-height:1.2;position:absolute;bottom:0;right:0}.blocks-app .stock-tab .list-item p.creator-info:hover a{color:#fff;text-decoration:underline}.blocks-app .stock-tab .list-item p.creator-info a{color:#fff;text-decoration:none}.blocks-app .stock-color-filter{display:flex}.blocks-app .stock-color-filter label{border-width:1px;width:24px;height:24px;margin:4px;padding:0;font-size:0;border-radius:6px!important}.blocks-app .stock-color-filter label.all-colors{background-image:linear-gradient(135deg,red,#ff7f00,#ff0,#0f0,#00f,#8b00ff)}.blocks-app .stock-color-filter label.black-color{background:#222}.blocks-app .stock-color-filter label.bw-color{background-image:linear-gradient(135deg,#222 50%,#fff 50%)}.blocks-app .stock-color-filter label.white-color{background:#fff}.blocks-app .stock-color-filter label.orange-color{background:#fa8c16}.blocks-app .stock-color-filter label.red-color{background:#f5222d}.blocks-app .stock-color-filter label.purple-color{background:#722ed1}.blocks-app .stock-color-filter label.magenta-color{background:#eb2f96}.blocks-app .stock-color-filter label.green-color{background:#52c41a}.blocks-app .stock-color-filter label.teal-color{background:#43c3c3}.blocks-app .stock-color-filter label.blue-color{background:#1677ff}.blocks-app .stock-color-filter .ant-radio-button-wrapper:not(:first-child):before{display:none}.blocks-app .serach-results{padding-top:6px}.blocks-app .serach-results .stock-search-input{width:322px;padding:0 2px}.blocks-app .serach-results .blocks-search__divider-wrapper{width:calc(100% + 48px);margin-top:12px;margin-left:-24px;margin-right:-24px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{pointer-events:none;border-top:1px solid var(--colorBorderSecondary);background:linear-gradient(180deg, var(--colorBgContainerDisabled), transparent 40%);border-bottom:none;width:100%;height:20px;min-height:20px;margin:0;position:relative;bottom:auto;left:auto;right:auto}.dark .blocks-app .image-center .stock-tab .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{background:linear-gradient(180deg, var(--colorBgBase), transparent 40%)}.dark .blocks-app .stock-tab .list-item{background:#2b2b2b;border:1px solid #2b2b2b}.dark .blocks-app .stock-tab .list-item.loaded{border:1px solid #434343}.blocks-app .image-center .image-center-image-preview{justify-content:center;align-items:center;display:flex}.blocks-app .image-center .ant-divider-horizontal{pointer-events:none;z-index:1;background:linear-gradient(180deg, var(--colorBgContainerDisabled), transparent 40%);width:calc(100% + 48px);height:20px;margin:24px -24px 0;position:absolute;bottom:-19px}.dark .blocks-app .image-center .ant-divider-horizontal{background:linear-gradient(180deg, var(--colorBgBase), transparent 40%)}.blocks-app .image-center .ant-divider-horizontal.ant-divider-with-text{background:0 0;width:calc(100% + 38px);margin:0 -24px 20px;position:relative;top:0}.blocks-app .image-center img{border-radius:4px;max-width:524px;max-height:352px}.blocks-app .image-center .image-size{justify-content:center;margin-top:6px;font-size:14px;line-height:22px;display:flex}.blocks-app .image-center .ant-upload.ant-upload-drag{border-radius:6px}.blocks-app .image-center .ant-modal-body .stock-search-input{margin-bottom:0}.blocks-app .image-center .ant-modal-body .serach-results .stock-search-input{margin-bottom:10px}.blocks-app .image-center .ant-modal-body .ant-form:not(.serach-results) .ant-form-item:last-child{margin-bottom:0}.blocks-app .image-center .ant-modal-body .ant-tabs{transition:all .7s cubic-bezier(.075,.82,.165,1)}.blocks-app .image-center .ant-modal-body .ant-tabs .ant-tabs-content-holder{overflow-y:clip}.blocks-app .ant-modal{transition:width .7s ease-in-out}")),document.head.appendChild(o)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- __useblocks__.define("static/core/59023866.js", [
2
+ __useblocks__.define("static/core/31e98e6e.js", [
3
3
  "require",
4
4
  "exports",
5
5
  "module",
6
6
  "static/core/bd36b180.js",
7
- "static/core/c59f9731.js",
8
- "static/core/13f581cc.js",
9
- "static/core/acb049cb.js",
10
- "static/core/386cf7b3.js",
11
- "static/core/1ca5f3772.js",
12
- "static/core/3b4845f7.js",
7
+ "static/core/ee0ddb51.js",
8
+ "static/core/5318562c.js",
9
+ "static/core/ebd852b6.js",
10
+ "static/core/75737a9d.js",
11
+ "static/core/1995fb0a2.js",
12
+ "static/core/1f5e1fc9.js",
13
13
  "react",
14
+ "prop-types",
14
15
  "react-router-dom",
15
- "react/jsx-runtime",
16
- "prop-types"
17
- ], function(le, vt, un) {
18
- const Je = le("./bd36b180.js"), u = le("./c59f9731.js"), Y = le("./13f581cc.js"), f = le("./acb049cb.js"), Ct = le("./386cf7b3.js"), T = le("./1ca5f3772.js"), re = le("./3b4845f7.js");
16
+ "react/jsx-runtime"
17
+ ], function(le, vt, dn) {
18
+ const Je = le("./bd36b180.js"), u = le("./ee0ddb51.js"), _ = le("./5318562c.js"), m = le("./ebd852b6.js"), Ct = le("./75737a9d.js"), F = le("./1995fb0a2.js"), ne = le("./1f5e1fc9.js");
19
19
  let n = le("react");
20
20
  n = Je.__toESM(n);
21
- let Te = le("react-router-dom"), r = le("react/jsx-runtime"), Ne = le("prop-types");
22
- Ne = Je.__toESM(Ne);
21
+ let Te = le("prop-types");
22
+ Te = Je.__toESM(Te);
23
+ let Ne = le("react-router-dom"), r = le("react/jsx-runtime");
23
24
  function bt(t, e) {
24
25
  return { [t]: {
25
26
  Filter: e("Filter"),
@@ -110,11 +111,11 @@ __useblocks__.define("static/core/59023866.js", [
110
111
  let o = t.trim(), a = e?.trim() || "application/octet-stream";
111
112
  const i = o.indexOf(",");
112
113
  if (o.startsWith("data:") && i >= 0) {
113
- const m = o.slice(5, i).split(";")[0]?.trim();
114
- m && (a = m), o = o.slice(i + 1);
114
+ const d = o.slice(5, i).split(";")[0]?.trim();
115
+ d && (a = d), o = o.slice(i + 1);
115
116
  }
116
- const l = o.replace(/\s/g, ""), C = atob(l), g = new Uint8Array(C.length);
117
- for (let m = 0; m < C.length; m++) g[m] = C.charCodeAt(m);
117
+ const l = o.replace(/\s/g, ""), b = atob(l), g = new Uint8Array(b.length);
118
+ for (let d = 0; d < b.length; d++) g[d] = b.charCodeAt(d);
118
119
  return new Blob([g], { type: a });
119
120
  }
120
121
  var wt = "static/media/image-editor", At = { text: {
@@ -241,58 +242,60 @@ __useblocks__.define("static/core/59023866.js", [
241
242
  const o = `image/${t}`;
242
243
  return $e(e.replace(/data:image\/([a-z]*)?;base64,/, ""), o);
243
244
  }
244
- var xt = ({ currentImageLink: t, prefetchedBlob: e, onSave: o, uploadImageResultIsLoading: a }) => {
245
- const i = re.useCookieManager(), [l, C] = (0, n.useState)(), [g, m] = (0, n.useState)(), { __: x } = f.useI18n();
246
- let R = u.useDispatch();
247
- const p = u.useStore(), b = u.useAppConfig(), j = u.useSelector(u.selectedCurrentUser), w = u.useSelector(Y.selectSecondModal), L = u.useSelector(u.selectProject), h = (0, n.useMemo)(() => {
248
- if (!b?.icons) return;
249
- const E = {};
250
- for (const [P, O] of Object.entries(b.icons)) typeof O == "string" && (E[P] = T.sanitizeHtml(O));
251
- return Object.keys(E).length > 0 ? E : void 0;
252
- }, [b?.icons]), D = (0, n.useRef)(!1), [k, z] = (0, n.useState)(), V = u.useEventEmitter(u.events.FILE_PROXY_EVENT_ID);
245
+ var xt = ({ currentImageLink: t, prefetchedBlob: e, resolveImageBlob: o, onSave: a, uploadImageResultIsLoading: i }) => {
246
+ const l = ne.useCookieManager(), [b, g] = (0, n.useState)(), [d, R] = (0, n.useState)(), { __: x } = m.useI18n();
247
+ let p = u.useDispatch();
248
+ const w = u.useStore(), j = u.useAppConfig(), C = u.useSelector(u.selectedCurrentUser), U = u.useSelector(_.selectSecondModal), y = u.useSelector(u.selectProject), D = (0, n.useMemo)(() => {
249
+ if (!j?.icons) return;
250
+ const k = {};
251
+ for (const [P, E] of Object.entries(j.icons)) typeof E == "string" && (k[P] = F.sanitizeHtml(E));
252
+ return Object.keys(k).length > 0 ? k : void 0;
253
+ }, [j?.icons]), O = (0, n.useRef)(!1), [T, Q] = (0, n.useState)(), N = u.useEventEmitter(u.events.FILE_PROXY_EVENT_ID);
253
254
  (0, n.useEffect)(() => {
254
- let E = !1;
255
+ let k = !1;
255
256
  return (async () => {
256
- const O = t;
257
- if (!O && !e) return;
257
+ const E = t;
258
+ if (!E && !e) return;
258
259
  let I = e;
259
- if (!I && O) try {
260
- I = await (await fetch(O)).blob();
260
+ if (!I && E) try {
261
+ typeof o == "function" ? I = await o(E) : I = await (await fetch(E)).blob();
261
262
  } catch {
262
- if (I = await V.fire({
263
- url: O,
264
- project: L
265
- }).filter((A) => A instanceof Blob)[0], !I) {
266
- const A = i.get(u.APP_COOKIES.em_token) || await u.di.getInstance(p, Y.TOKEN_ID);
267
- I = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(O)}`, { headers: { authorization: `Bearer ${A}` } })).blob();
263
+ if (k) return;
264
+ if (I = await N.fire({
265
+ url: E,
266
+ project: y
267
+ }).filter((L) => L instanceof Blob)[0], !I) {
268
+ const L = l.get(u.APP_COOKIES.em_token) || await u.di.getInstance(w, _.TOKEN_ID);
269
+ I = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(E)}`, { headers: { authorization: `Bearer ${L}` } })).blob();
268
270
  }
269
271
  }
270
- if (E || !I) return;
271
- const W = new FileReader();
272
- W.onload = () => {
273
- if (E) return;
274
- const A = W.result;
275
- typeof A == "string" && (C(A), m(I.type), k?.tools.import.openBackgroundImage(A));
276
- }, W.onerror = () => {}, W.readAsDataURL(I);
277
- })().catch((O) => {}), () => {
278
- E = !0;
272
+ if (k || !I) return;
273
+ const A = new FileReader();
274
+ A.onload = () => {
275
+ if (k) return;
276
+ const L = A.result;
277
+ typeof L == "string" && (g(L), R(I.type), T?.tools.import.openBackgroundImage(L));
278
+ }, A.onerror = () => {}, A.readAsDataURL(I);
279
+ })().catch((E) => {}), () => {
280
+ k = !0;
279
281
  };
280
282
  }, [
281
283
  t,
282
284
  e,
283
- i,
284
- k,
285
- V,
286
- L,
287
- p
285
+ o,
286
+ l,
287
+ T,
288
+ N,
289
+ y,
290
+ w
288
291
  ]);
289
- const U = (0, n.useCallback)(() => {
290
- C(null), m(null), R(Y.closeSecondModal()), R(Y.closeModal(u.MODALS.UPLOAD_IMAGE_MODAL));
291
- }, [R]), M = (0, n.useRef)();
292
- M.current = async function(E, P, O) {
292
+ const M = (0, n.useCallback)(() => {
293
+ g(null), R(null), p(_.closeSecondModal()), p(_.closeModal(u.MODALS.UPLOAD_IMAGE_MODAL));
294
+ }, [p]), z = (0, n.useRef)();
295
+ z.current = async function(k, P, E) {
293
296
  try {
294
- const I = It(O, E);
295
- o && await o(new File([I], P, {
297
+ const I = It(E, k);
298
+ a && await a(new File([I], P, {
296
299
  lastModified: Date.now(),
297
300
  type: I.type
298
301
  }));
@@ -300,14 +303,14 @@ __useblocks__.define("static/core/59023866.js", [
300
303
  throw I;
301
304
  }
302
305
  };
303
- const K = (0, n.useCallback)((E) => {
304
- if (E && !(D.current && k)) {
305
- D.current = !0;
306
- const P = j.locale ? j.locale.replace("_", "-") : "en-US", O = j.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? u.DARK : u.LIGHT : j.theme;
306
+ const ee = (0, n.useCallback)((k) => {
307
+ if (k && !(O.current && T)) {
308
+ O.current = !0;
309
+ const P = C.locale ? C.locale.replace("_", "-") : "en-US", E = C.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? u.DARK : u.LIGHT : C.theme;
307
310
  Ct.Tf.init({
308
311
  selector: "#pixie-editor",
309
- baseUrl: f.getBundledHostAssetUrl(wt),
310
- image: l,
312
+ baseUrl: m.getBundledHostAssetUrl(wt),
313
+ image: b,
311
314
  activeLanguage: P,
312
315
  languages: bt(P, x),
313
316
  tools: At,
@@ -326,9 +329,9 @@ __useblocks__.define("static/core/59023866.js", [
326
329
  },
327
330
  {
328
331
  type: "button",
329
- icon: (0, r.jsx)(f.EmIcons, {
332
+ icon: (0, r.jsx)(m.EmIcons, {
330
333
  icon: "HistoryOutlined",
331
- configIcons: h,
334
+ configIcons: D,
332
335
  style: { fontSize: 20 }
333
336
  }),
334
337
  align: "right",
@@ -339,49 +342,49 @@ __useblocks__.define("static/core/59023866.js", [
339
342
  },
340
343
  {
341
344
  type: "button",
342
- icon: (0, r.jsx)(f.EmIcons, {
345
+ icon: (0, r.jsx)(m.EmIcons, {
343
346
  icon: "CloseOutlined",
344
- configIcons: h,
347
+ configIcons: D,
345
348
  style: { fontSize: 20 }
346
349
  }),
347
350
  align: "right",
348
351
  desktopOnly: !0,
349
- action: () => U()
352
+ action: () => M()
350
353
  }
351
354
  ]
352
355
  },
353
356
  nav: { position: "top" },
354
- activeTheme: O,
357
+ activeTheme: E,
355
358
  mode: "inline",
356
359
  forceOverlayModeOnMobile: !1
357
360
  },
358
- onSave: async function(I, W, A) {
361
+ onSave: async function(I, A, L) {
359
362
  try {
360
- await M.current(I, W, A);
363
+ await z.current(I, A, L);
361
364
  } catch {}
362
365
  }
363
366
  }).then((I) => {
364
- z(I);
367
+ Q(I);
365
368
  }).catch((I) => {});
366
369
  }
367
370
  }, [
368
- j.theme,
369
- l,
370
- k,
371
- z,
372
- j.locale,
371
+ C.theme,
372
+ b,
373
+ T,
374
+ Q,
375
+ C.locale,
373
376
  x,
374
- U,
375
- h
376
- ]), ee = (0, n.useCallback)(() => {
377
- k?.tools.export.save(t?.split("/").pop().split(".")[0], g?.split("/")[1]);
377
+ M,
378
+ D
379
+ ]), K = (0, n.useCallback)(() => {
380
+ T?.tools.export.save(t?.split("/").pop().split(".")[0], d?.split("/")[1]);
378
381
  }, [
379
- k,
382
+ T,
380
383
  t,
381
- g
384
+ d
382
385
  ]);
383
- return (0, r.jsxs)(f.Modal, {
384
- afterOpenChange: K,
386
+ return (0, r.jsxs)(m.Modal, {
387
+ afterOpenChange: ee,
385
388
  width: "100%",
386
389
  style: {
387
390
  maxWidth: "100%",
@@ -392,19 +395,19 @@ __useblocks__.define("static/core/59023866.js", [
392
395
  closable: !1,
393
396
  zIndex: 1100,
394
397
  mask: !1,
395
- open: w,
396
- footer: [(0, r.jsx)(f.Button, {
398
+ open: U,
399
+ footer: [(0, r.jsx)(m.Button, {
397
400
  className: "em-analytics__profile-cancel",
398
- onClick: U,
401
+ onClick: M,
399
402
  children: x("Cancel")
400
- }, "Cancel"), (0, r.jsx)(f.Button, {
403
+ }, "Cancel"), (0, r.jsx)(m.Button, {
401
404
  className: "em-analytics__profile-updapixiete",
402
405
  id: "save",
403
406
  type: "primary",
404
- onClick: ee,
407
+ onClick: K,
405
408
  children: x("Update")
406
409
  }, "Ok")],
407
- children: [a && (0, r.jsx)("div", {
410
+ children: [i && (0, r.jsx)("div", {
408
411
  style: {
409
412
  position: "absolute",
410
413
  height: "100%",
@@ -416,14 +419,14 @@ __useblocks__.define("static/core/59023866.js", [
416
419
  zIndex: 10,
417
420
  opacity: .7
418
421
  },
419
- children: (0, r.jsx)(f.Spin, { size: "large" })
422
+ children: (0, r.jsx)(m.Spin, { size: "large" })
420
423
  }), (0, r.jsx)("div", { id: "pixie-editor" })]
421
424
  });
422
- }, St = ({ currentImageLink: t, newLink: e, previewDisplayUrl: o, resolvedPreviewObjectUrl: a, resolvedPreviewBlob: i, onSave: l, uploadImageResultIsLoading: C }) => {
423
- const g = o || a;
425
+ }, St = ({ currentImageLink: t, newLink: e, previewDisplayUrl: o, resolvedPreviewObjectUrl: a, resolvedPreviewBlob: i, resolveImageBlob: l, onSave: b, uploadImageResultIsLoading: g }) => {
426
+ const d = o || a;
424
427
  return (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)("div", { children: (0, r.jsxs)("div", {
425
428
  className: "image-preview",
426
- children: [C && (0, r.jsx)("div", {
429
+ children: [g && (0, r.jsx)("div", {
427
430
  style: {
428
431
  position: "absolute",
429
432
  height: "100%",
@@ -435,111 +438,112 @@ __useblocks__.define("static/core/59023866.js", [
435
438
  zIndex: 10,
436
439
  opacity: .7
437
440
  },
438
- children: (0, r.jsx)(f.Spin, { size: "large" })
439
- }), g && (0, r.jsx)("img", {
441
+ children: (0, r.jsx)(m.Spin, { size: "large" })
442
+ }), d && (0, r.jsx)("img", {
440
443
  alt: "uploadedImage",
441
- src: g
444
+ src: d
442
445
  })]
443
446
  }) }), (0, r.jsx)(xt, {
444
447
  currentImageLink: t,
445
448
  prefetchedBlob: i,
449
+ resolveImageBlob: l,
446
450
  newLink: e,
447
- onSave: l,
448
- uploadImageResultIsLoading: C
451
+ onSave: b,
452
+ uploadImageResultIsLoading: g
449
453
  })] });
450
- }, xe = {
454
+ }, Re = {
451
455
  Pixel: "Pixel",
452
456
  Percent: "Percent"
453
457
  }, et = {
454
- unit: xe.Percent,
458
+ unit: Re.Percent,
455
459
  value: 80
456
460
  };
457
461
  function Rt(t) {
458
462
  return typeof t == "number" ? {
459
- unit: xe.Percent,
463
+ unit: Re.Percent,
460
464
  value: t * 100
461
465
  } : typeof t == "string" ? /^(\d*(\.\d+)?)px$/.exec(t) ? {
462
- unit: xe.Pixel,
466
+ unit: Re.Pixel,
463
467
  value: parseFloat(t)
464
468
  } : /^(\d*(\.\d+)?)%$/.exec(t) ? {
465
- unit: xe.Percent,
469
+ unit: Re.Percent,
466
470
  value: parseFloat(t)
467
471
  } : et : et;
468
472
  }
469
473
  function jt(t, e) {
470
474
  const o = Rt(t);
471
475
  let a;
472
- return o.unit === xe.Pixel ? a = `${o.value}px` : a = `${100 - o.value}%`, e ? `${a} 0px 0px 0px` : `0px 0px ${a} 0px`;
476
+ return o.unit === Re.Pixel ? a = `${o.value}px` : a = `${100 - o.value}%`, e ? `${a} 0px 0px 0px` : `0px 0px ${a} 0px`;
473
477
  }
474
- function tt({ next: t, hasMore: e, children: o, loader: a, scrollThreshold: i = .8, endMessage: l, style: C, height: g, scrollableTarget: m, hasChildren: x, inverse: R = !1, pullDownToRefresh: p = !1, pullDownToRefreshContent: b, releaseToRefreshContent: j, pullDownToRefreshThreshold: w = 100, refreshFunction: L, onScroll: h, dataLength: D, initialScrollY: k, className: z = "", role: V, tabIndex: U, id: M, ...K }) {
475
- const [ee, E] = (0, n.useState)(!1), [P, O] = (0, n.useState)(!1), [I, W] = (0, n.useState)(0), A = (0, n.useRef)(null), Q = (0, n.useRef)(null), J = (0, n.useRef)(null), q = (0, n.useRef)(t);
478
+ function tt({ next: t, hasMore: e, children: o, loader: a, scrollThreshold: i = .8, endMessage: l, style: b, height: g, scrollableTarget: d, hasChildren: R, inverse: x = !1, pullDownToRefresh: p = !1, pullDownToRefreshContent: w, releaseToRefreshContent: j, pullDownToRefreshThreshold: C = 100, refreshFunction: U, onScroll: y, dataLength: D, initialScrollY: O, className: T = "", role: Q, tabIndex: N, id: M, ...z }) {
479
+ const [ee, K] = (0, n.useState)(!1), [k, P] = (0, n.useState)(!1), [E, I] = (0, n.useState)(0), A = (0, n.useRef)(null), L = (0, n.useRef)(null), J = (0, n.useRef)(null), q = (0, n.useRef)(t);
476
480
  q.current = t;
477
- const s = (0, n.useRef)(L);
478
- s.current = L;
479
- const y = (0, n.useRef)(w);
480
- y.current = w;
481
- const F = (0, n.useRef)(!1), ce = (0, n.useRef)(!1), Z = (0, n.useRef)(0), $ = (0, n.useRef)(0), X = (0, n.useRef)(0), G = (0, n.useCallback)(() => m instanceof HTMLElement ? m : typeof m == "string" ? document.getElementById(m) : null, [m]);
481
+ const s = (0, n.useRef)(U);
482
+ s.current = U;
483
+ const h = (0, n.useRef)(C);
484
+ h.current = C;
485
+ const W = (0, n.useRef)(!1), ce = (0, n.useRef)(!1), Z = (0, n.useRef)(0), $ = (0, n.useRef)(0), X = (0, n.useRef)(0), H = (0, n.useCallback)(() => d instanceof HTMLElement ? d : typeof d == "string" ? document.getElementById(d) : null, [d]);
482
486
  (0, n.useEffect)(() => {
483
487
  if (typeof D > "u") throw new Error("mandatory prop \"dataLength\" is missing. The prop is needed when loading more content. Check README.md for usage");
484
- if (p && typeof L != "function") throw new Error(`Mandatory prop "refreshFunction" missing.
488
+ if (p && typeof U != "function") throw new Error(`Mandatory prop "refreshFunction" missing.
485
489
  Pull Down To Refresh functionality will not work
486
490
  as expected. Check README.md for usage'`);
487
- if (typeof k == "number") {
488
- const _ = g ? A.current : G();
489
- _ && _.scrollHeight > k && _.scrollTo(0, k);
491
+ if (typeof O == "number") {
492
+ const Y = g ? A.current : H();
493
+ Y && Y.scrollHeight > O && Y.scrollTo(0, O);
490
494
  }
491
495
  }, []), (0, n.useEffect)(() => {
492
- F.current = !1, E(!1);
496
+ W.current = !1, K(!1);
493
497
  }, [D]), (0, n.useEffect)(() => {
494
498
  if (!e || typeof IntersectionObserver > "u") return;
495
- const _ = Q.current;
496
- if (!_) return;
497
- const se = g ? A.current : G(), B = new IntersectionObserver(([ae]) => {
498
- !ae.isIntersecting || F.current || (F.current = !0, E(!0), q.current());
499
+ const Y = L.current;
500
+ if (!Y) return;
501
+ const se = g ? A.current : H(), B = new IntersectionObserver(([ae]) => {
502
+ !ae.isIntersecting || W.current || (W.current = !0, K(!0), q.current());
499
503
  }, {
500
504
  root: se,
501
- rootMargin: jt(i, R),
505
+ rootMargin: jt(i, x),
502
506
  threshold: 0
503
507
  });
504
- return B.observe(_), () => B.disconnect();
508
+ return B.observe(Y), () => B.disconnect();
505
509
  }, [
506
510
  e,
507
511
  i,
508
- R,
512
+ x,
509
513
  g,
510
- G
514
+ H
511
515
  ]), (0, n.useEffect)(() => {
512
- var _;
513
- if (!h) return;
514
- const se = (_ = g ? A.current : G()) !== null && _ !== void 0 ? _ : typeof window < "u" ? window : null;
516
+ var Y;
517
+ if (!y) return;
518
+ const se = (Y = g ? A.current : H()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
515
519
  if (!se) return;
516
520
  const B = (ae) => {
517
- setTimeout(() => h(ae), 0);
521
+ setTimeout(() => y(ae), 0);
518
522
  };
519
523
  return se.addEventListener("scroll", B), () => se.removeEventListener("scroll", B);
520
524
  }, [
521
- h,
525
+ y,
522
526
  g,
523
- G
527
+ H
524
528
  ]), (0, n.useEffect)(() => {
525
- var _, se;
529
+ var Y, se;
526
530
  if (!p) return;
527
- const B = (_ = g ? A.current : G()) !== null && _ !== void 0 ? _ : typeof window < "u" ? window : null;
531
+ const B = (Y = g ? A.current : H()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
528
532
  if (!B) return;
529
533
  if (!((se = J.current) === null || se === void 0) && se.firstChild) {
530
- const N = J.current.firstChild.getBoundingClientRect().height;
531
- X.current = N, W(N);
534
+ const G = J.current.firstChild.getBoundingClientRect().height;
535
+ X.current = G, I(G);
532
536
  }
533
- const ae = (N) => {
534
- (B instanceof HTMLElement ? B.scrollTop : document.documentElement.scrollTop) > 0 || (ce.current = !0, N instanceof MouseEvent ? Z.current = N.pageY : N instanceof TouchEvent && (Z.current = N.touches[0].pageY), $.current = Z.current, A.current && (A.current.style.willChange = "transform", A.current.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
535
- }, v = (N) => {
536
- if (!ce.current || (N instanceof MouseEvent ? $.current = N.pageY : N instanceof TouchEvent && ($.current = N.touches[0].pageY), $.current < Z.current)) return;
537
+ const ae = (G) => {
538
+ (B instanceof HTMLElement ? B.scrollTop : document.documentElement.scrollTop) > 0 || (ce.current = !0, G instanceof MouseEvent ? Z.current = G.pageY : G instanceof TouchEvent && (Z.current = G.touches[0].pageY), $.current = Z.current, A.current && (A.current.style.willChange = "transform", A.current.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
539
+ }, v = (G) => {
540
+ if (!ce.current || (G instanceof MouseEvent ? $.current = G.pageY : G instanceof TouchEvent && ($.current = G.touches[0].pageY), $.current < Z.current)) return;
537
541
  const fe = $.current - Z.current;
538
- fe >= y.current && O(!0), !(fe > X.current * 1.5) && A.current && (A.current.style.overflow = "visible", A.current.style.transform = `translate3d(0px, ${fe}px, 0px)`);
542
+ fe >= h.current && P(!0), !(fe > X.current * 1.5) && A.current && (A.current.style.overflow = "visible", A.current.style.transform = `translate3d(0px, ${fe}px, 0px)`);
539
543
  }, te = () => {
540
- Z.current = 0, $.current = 0, ce.current = !1, O((N) => {
544
+ Z.current = 0, $.current = 0, ce.current = !1, P((G) => {
541
545
  var fe;
542
- return N && ((fe = s.current) === null || fe === void 0 || fe.call(s)), !1;
546
+ return G && ((fe = s.current) === null || fe === void 0 || fe.call(s)), !1;
543
547
  }), requestAnimationFrame(() => {
544
548
  A.current && (A.current.style.overflow = "auto", A.current.style.transform = "none", A.current.style.willChange = "unset");
545
549
  });
@@ -550,26 +554,26 @@ __useblocks__.define("static/core/59023866.js", [
550
554
  }, [
551
555
  p,
552
556
  g,
553
- G
557
+ H
554
558
  ]);
555
559
  const ie = {
556
560
  height: g ?? "auto",
557
561
  overflow: "auto",
558
562
  WebkitOverflowScrolling: "touch",
559
- ...C
560
- }, he = x || !!(o && o instanceof Array && o.length), ye = p && g ? { overflow: "auto" } : {}, ue = e ? (0, r.jsx)("div", {
561
- ref: Q,
563
+ ...b
564
+ }, he = R || !!(o && o instanceof Array && o.length), ye = p && g ? { overflow: "auto" } : {}, ue = e ? (0, r.jsx)("div", {
565
+ ref: L,
562
566
  style: { height: 1 }
563
567
  }) : null;
564
568
  return (0, r.jsx)("div", {
565
569
  style: ye,
566
570
  className: "infinite-scroll-component__outerdiv",
567
571
  children: (0, r.jsxs)("div", {
568
- ...K,
569
- role: V,
570
- tabIndex: U,
572
+ ...z,
573
+ role: Q,
574
+ tabIndex: N,
571
575
  id: M,
572
- className: ["infinite-scroll-component", z].filter(Boolean).join(" "),
576
+ className: ["infinite-scroll-component", T].filter(Boolean).join(" "),
573
577
  ref: A,
574
578
  style: ie,
575
579
  children: [
@@ -581,9 +585,9 @@ __useblocks__.define("static/core/59023866.js", [
581
585
  position: "absolute",
582
586
  left: 0,
583
587
  right: 0,
584
- top: -1 * I
588
+ top: -1 * E
585
589
  },
586
- children: P ? j : b
590
+ children: k ? j : w
587
591
  })
588
592
  }),
589
593
  o,
@@ -629,7 +633,7 @@ __useblocks__.define("static/core/59023866.js", [
629
633
  }
630
634
  return o;
631
635
  }
632
- function Se(t) {
636
+ function je(t) {
633
637
  for (var e = 1; e < arguments.length; e++) {
634
638
  var o = arguments[e] != null ? arguments[e] : {};
635
639
  e % 2 ? nt(Object(o), !0).forEach(function(a) {
@@ -702,15 +706,15 @@ __useblocks__.define("static/core/59023866.js", [
702
706
  const { column: t, columnAttrs: e = {}, columnClassName: o } = this.props, a = this.itemsInColumns(), i = `${100 / a.length}%`;
703
707
  let l = o;
704
708
  l && typeof l != "string" && (this.logDeprecated("The property \"columnClassName\" requires a string"), typeof l > "u" && (l = "my-masonry-grid_column"));
705
- const C = Se(Se(Se({}, t), e), {}, {
706
- style: Se(Se({}, e.style), {}, { width: i }),
709
+ const b = je(je(je({}, t), e), {}, {
710
+ style: je(je({}, e.style), {}, { width: i }),
707
711
  className: l
708
712
  });
709
- return a.map((g, m) => n.default.createElement("div", De({}, C, { key: m }), g));
713
+ return a.map((g, d) => n.default.createElement("div", De({}, b, { key: d }), g));
710
714
  }
711
715
  logDeprecated(t) {}
712
716
  render() {
713
- const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: C } = t, g = kt(t, [
717
+ const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: b } = t, g = kt(t, [
714
718
  "children",
715
719
  "breakpointCols",
716
720
  "columnClassName",
@@ -718,8 +722,8 @@ __useblocks__.define("static/core/59023866.js", [
718
722
  "column",
719
723
  "className"
720
724
  ]);
721
- let m = C;
722
- return typeof C != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof C > "u" && (m = "my-masonry-grid")), n.default.createElement("div", De({}, g, { className: m }), this.renderColumns());
725
+ let d = b;
726
+ return typeof b != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof b > "u" && (d = "my-masonry-grid")), n.default.createElement("div", De({}, g, { className: d }), this.renderColumns());
723
727
  }
724
728
  };
725
729
  Ge.defaultProps = Lt;
@@ -733,20 +737,20 @@ __useblocks__.define("static/core/59023866.js", [
733
737
  } : null;
734
738
  }
735
739
  function rt({ items: t, getItemId: e, getRequestUrl: o, createController: a }) {
736
- const [i, l] = (0, n.useState)({}), C = (0, n.useRef)(new Map()), g = (0, n.useCallback)((m) => {
737
- const x = e(m), R = o(m), p = `${x}:${R}`;
738
- if (C.current.has(p)) return {
739
- itemId: x,
740
- requestUrl: R,
740
+ const [i, l] = (0, n.useState)({}), b = (0, n.useRef)(new Map()), g = (0, n.useCallback)((d) => {
741
+ const R = e(d), x = o(d), p = `${R}:${x}`;
742
+ if (b.current.has(p)) return {
743
+ itemId: R,
744
+ requestUrl: x,
741
745
  cacheKey: p,
742
- controller: C.current.get(p)
746
+ controller: b.current.get(p)
743
747
  };
744
- const b = a(R);
745
- return C.current.set(p, b), {
746
- itemId: x,
747
- requestUrl: R,
748
+ const w = a(x);
749
+ return b.current.set(p, w), {
750
+ itemId: R,
751
+ requestUrl: x,
748
752
  cacheKey: p,
749
- controller: b
753
+ controller: w
750
754
  };
751
755
  }, [
752
756
  a,
@@ -754,118 +758,118 @@ __useblocks__.define("static/core/59023866.js", [
754
758
  o
755
759
  ]);
756
760
  return (0, n.useEffect)(() => {
757
- const m = new Set(), x = {}, R = t.map((p) => {
758
- const { itemId: b, cacheKey: j, controller: w } = g(p);
759
- m.add(j), x[b] = w.src;
760
- const L = ze(w.handleChangeSrc?.(), w.src);
761
- return L?.changed && L.src && (x[b] = L.src), w.subscribeToSrcChange?.((h) => {
762
- const D = ze(h, w.src);
763
- !D?.changed || !D.src || l((k) => k[b] === D.src ? k : {
764
- ...k,
765
- [b]: D.src
761
+ const d = new Set(), R = {}, x = t.map((p) => {
762
+ const { itemId: w, cacheKey: j, controller: C } = g(p);
763
+ d.add(j), R[w] = C.src;
764
+ const U = ze(C.handleChangeSrc?.(), C.src);
765
+ return U?.changed && U.src && (R[w] = U.src), C.subscribeToSrcChange?.((y) => {
766
+ const D = ze(y, C.src);
767
+ !D?.changed || !D.src || l((O) => O[w] === D.src ? O : {
768
+ ...O,
769
+ [w]: D.src
766
770
  });
767
771
  });
768
772
  }).filter(Boolean);
769
- return C.current.forEach((p, b) => {
770
- m.has(b) || C.current.delete(b);
771
- }), l(x), () => {
772
- R.forEach((p) => p?.());
773
+ return b.current.forEach((p, w) => {
774
+ d.has(w) || b.current.delete(w);
775
+ }), l(R), () => {
776
+ x.forEach((p) => p?.());
773
777
  };
774
778
  }, [g, t]), {
775
- getDisplaySrc: (0, n.useCallback)((m) => {
776
- const { itemId: x, requestUrl: R, controller: p } = g(m);
777
- return i[x] || p.src || R;
779
+ getDisplaySrc: (0, n.useCallback)((d) => {
780
+ const { itemId: R, requestUrl: x, controller: p } = g(d);
781
+ return i[R] || p.src || x;
778
782
  }, [i, g]),
779
- handleLoad: (0, n.useCallback)((m) => {
780
- g(m).controller.handleSuccess();
783
+ handleLoad: (0, n.useCallback)((d) => {
784
+ g(d).controller.handleSuccess();
781
785
  }, [g]),
782
- handleError: (0, n.useCallback)((m) => {
783
- const { itemId: x, controller: R } = g(m), p = ze(R.handleError(), R.src);
784
- p?.changed && p.src && l((b) => ({
785
- ...b,
786
- [x]: p.src
786
+ handleError: (0, n.useCallback)((d) => {
787
+ const { itemId: R, controller: x } = g(d), p = ze(x.handleError(), x.src);
788
+ p?.changed && p.src && l((w) => ({
789
+ ...w,
790
+ [R]: p.src
787
791
  }));
788
792
  }, [g])
789
793
  };
790
794
  }
791
- var st = "blocks", Dt = ({ setCurrentImageLink: t, setModalHeight: e, setModalWidth: o, setImageStockList: a, imageStockList: i, currentReq: l, setCurrentReq: C, inputRef: g, setStockLink: m, customRequest: x }) => {
792
- const R = u.useAppConfig(), p = u.useIsStandalone(), [b, j] = (0, n.useState)(!1), [w, L] = (0, n.useState)(2), { __: h } = f.useI18n(), D = f.useNotification(), [k] = Y.useLazyGetUnsplashImageQuery(), [z] = Y.useLazyGetSearchImageQuery(), V = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : h("Failed to load stock images through the configured proxy chain."), [h]), U = (0, n.useCallback)((s) => {
795
+ var st = "blocks", Dt = ({ setCurrentImageLink: t, setModalHeight: e, setModalWidth: o, setImageStockList: a, imageStockList: i, currentReq: l, setCurrentReq: b, inputRef: g, setStockLink: d, customRequest: R }) => {
796
+ const x = u.useAppConfig(), p = u.useIsStandalone(), [w, j] = (0, n.useState)(!1), [C, U] = (0, n.useState)(2), { __: y } = m.useI18n(), D = m.useNotification(), [O] = _.useLazyGetUnsplashImageQuery(), [T] = _.useLazyGetSearchImageQuery(), Q = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : y("Failed to load stock images through the configured proxy chain."), [y]), N = (0, n.useCallback)((s) => {
793
797
  D.error({
794
798
  id: "STOCK_IMAGES_SEARCH_FAILED",
795
- title: h("Failed to load stock images"),
796
- description: V(s)
799
+ title: y("Failed to load stock images"),
800
+ description: Q(s)
797
801
  });
798
802
  }, [
799
- h,
800
- V,
803
+ y,
804
+ Q,
801
805
  D
802
806
  ]), M = async () => {
803
- b || (j(!0), z({
807
+ w || (j(!0), T({
804
808
  query: l,
805
- page: w
809
+ page: C
806
810
  }).then((s) => {
807
811
  if (s?.error) {
808
- U(s.error), j(!1);
812
+ N(s.error), j(!1);
809
813
  return;
810
814
  }
811
- const y = s?.data?.results || [];
812
- a((F) => [...F, ...y]), j(!1), L((F) => F + 1);
815
+ const h = s?.data?.results || [];
816
+ a((W) => [...W, ...h]), j(!1), U((W) => W + 1);
813
817
  }).catch(() => {
814
818
  j(!1);
815
819
  }));
816
820
  };
817
821
  (0, n.useEffect)(() => {
818
- l.keywords !== "" && K();
822
+ l.keywords !== "" && z();
819
823
  }, [l.color, l.orientation]);
820
- const K = async () => {
821
- const s = await z({
824
+ const z = async () => {
825
+ const s = await T({
822
826
  query: l,
823
827
  page: 1
824
828
  });
825
829
  if (s?.error) {
826
- U(s.error), a([]);
830
+ N(s.error), a([]);
827
831
  return;
828
832
  }
829
- const y = s?.data?.results || [];
830
- y.length > 0 ? (a(y), setTimeout(() => {
833
+ const h = s?.data?.results || [];
834
+ h.length > 0 ? (a(h), setTimeout(() => {
831
835
  o(1060), e("84vh");
832
836
  }, 0)) : a([]);
833
- }, [ee, E] = (0, n.useState)(null), P = (0, n.useCallback)((s, y, F) => `${s}${s.includes("?") ? "&" : "?"}w=${y}&q=${F}`, []), O = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
834
- config: R,
837
+ }, [ee, K] = (0, n.useState)(null), k = (0, n.useCallback)((s, h, W) => `${s}${s.includes("?") ? "&" : "?"}w=${h}&q=${W}`, []), P = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
838
+ config: x,
835
839
  standalone: p,
836
840
  resourceType: "stockImages",
837
841
  intent: "display"
838
- }), [R, p]), { getDisplaySrc: I, handleLoad: W, handleError: A } = rt({
842
+ }), [x, p]), { getDisplaySrc: E, handleLoad: I, handleError: A } = rt({
839
843
  items: i,
840
844
  getItemId: (0, n.useCallback)((s) => s.id, []),
841
- getRequestUrl: (0, n.useCallback)((s) => P(s.urls.raw, 644, 96), [P]),
842
- createController: O
843
- }), Q = (s) => (y) => {
844
- W(s), y.target.parentNode.classList.add("loaded");
845
+ getRequestUrl: (0, n.useCallback)((s) => k(s.urls.raw, 644, 96), [k]),
846
+ createController: P
847
+ }), L = (s) => (h) => {
848
+ I(s), h.target.parentNode.classList.add("loaded");
845
849
  }, J = (s) => () => {
846
850
  A(s);
847
- }, q = (s, y, F) => {
848
- k(y.download_location), E(F), setTimeout(() => E(null), 2e3), m(`${s.raw}&w=1200&q=96`), t(`${s.raw}&w=1200&q=96`), x(`${s.raw}&w=1200&q=96`);
851
+ }, q = (s, h, W) => {
852
+ O(h.download_location), K(W), setTimeout(() => K(null), 2e3), d(`${s.raw}&w=1200&q=96`), t(`${s.raw}&w=1200&q=96`), R(`${s.raw}&w=1200&q=96`);
849
853
  };
850
854
  return (0, r.jsxs)("div", {
851
855
  className: "stock-tab",
852
- children: [(0, r.jsxs)(f.Form, {
853
- onValuesChange: K,
856
+ children: [(0, r.jsxs)(m.Form, {
857
+ onValuesChange: z,
854
858
  className: i.length > 0 ? "serach-results" : "",
855
- children: [(0, r.jsxs)(f.Row, {
859
+ children: [(0, r.jsxs)(m.Row, {
856
860
  gutter: 24,
857
- children: [(0, r.jsx)(f.Col, {
861
+ children: [(0, r.jsx)(m.Col, {
858
862
  span: i.length > 0 ? "" : 24,
859
- children: (0, r.jsx)(f.Form.Item, {
863
+ children: (0, r.jsx)(m.Form.Item, {
860
864
  className: "stock-search-input",
861
- children: (0, r.jsx)(f.SearchInput, {
862
- onSearch: K,
865
+ children: (0, r.jsx)(m.SearchInput, {
866
+ onSearch: z,
863
867
  allowClear: !0,
864
868
  size: i.length > 0 ? "medium" : "large",
865
- placeholder: h("Search image"),
869
+ placeholder: y("Search image"),
866
870
  value: l.keywords,
867
- onChange: (s) => C((y) => ({
868
- ...y,
871
+ onChange: (s) => b((h) => ({
872
+ ...h,
869
873
  keywords: s.target.value
870
874
  })),
871
875
  ref: g,
@@ -873,107 +877,107 @@ __useblocks__.define("static/core/59023866.js", [
873
877
  enterButton: !1
874
878
  })
875
879
  })
876
- }), i.length > 0 && (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)(f.Col, { children: (0, r.jsxs)(f.Radio.Group, {
880
+ }), i.length > 0 && (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)(m.Col, { children: (0, r.jsxs)(m.Radio.Group, {
877
881
  defaultValue: "",
878
- onChange: (s) => C((y) => ({
879
- ...y,
882
+ onChange: (s) => b((h) => ({
883
+ ...h,
880
884
  orientation: s.target.value
881
885
  })),
882
886
  children: [
883
- (0, r.jsx)(f.Tooltip, {
884
- title: h("All"),
887
+ (0, r.jsx)(m.Tooltip, {
888
+ title: y("All"),
885
889
  placement: "top",
886
- children: (0, r.jsx)(f.Radio.Button, {
890
+ children: (0, r.jsx)(m.Radio.Button, {
887
891
  value: "",
888
- children: (0, r.jsx)(T.EmIcons, { icon: "MixedView" })
892
+ children: (0, r.jsx)(F.EmIcons, { icon: "MixedView" })
889
893
  })
890
894
  }),
891
- (0, r.jsx)(f.Tooltip, {
892
- title: h("Landscape"),
895
+ (0, r.jsx)(m.Tooltip, {
896
+ title: y("Landscape"),
893
897
  placement: "top",
894
- children: (0, r.jsx)(f.Radio.Button, {
898
+ children: (0, r.jsx)(m.Radio.Button, {
895
899
  value: "landscape",
896
- children: (0, r.jsx)(T.EmIcons, { icon: "LandscapeView" })
900
+ children: (0, r.jsx)(F.EmIcons, { icon: "LandscapeView" })
897
901
  })
898
902
  }),
899
- (0, r.jsx)(f.Tooltip, {
900
- title: h("Portrait"),
903
+ (0, r.jsx)(m.Tooltip, {
904
+ title: y("Portrait"),
901
905
  placement: "top",
902
- children: (0, r.jsx)(f.Radio.Button, {
906
+ children: (0, r.jsx)(m.Radio.Button, {
903
907
  value: "portrait",
904
- children: (0, r.jsx)(T.EmIcons, { icon: "PortraitView" })
908
+ children: (0, r.jsx)(F.EmIcons, { icon: "PortraitView" })
905
909
  })
906
910
  }),
907
- (0, r.jsx)(f.Tooltip, {
908
- title: h("Squarish"),
911
+ (0, r.jsx)(m.Tooltip, {
912
+ title: y("Squarish"),
909
913
  placement: "top",
910
- children: (0, r.jsx)(f.Radio.Button, {
914
+ children: (0, r.jsx)(m.Radio.Button, {
911
915
  value: "squarish",
912
- children: (0, r.jsx)(T.EmIcons, { icon: "SquareView" })
916
+ children: (0, r.jsx)(F.EmIcons, { icon: "SquareView" })
913
917
  })
914
918
  })
915
919
  ]
916
- }) }), (0, r.jsx)(f.Col, { children: (0, r.jsx)(f.RadioColorFilter, {
920
+ }) }), (0, r.jsx)(m.Col, { children: (0, r.jsx)(m.RadioColorFilter, {
917
921
  defaultValue: "",
918
- onChange: (s) => C((y) => ({
919
- ...y,
922
+ onChange: (s) => b((h) => ({
923
+ ...h,
920
924
  color: s.target.value
921
925
  })),
922
926
  options: [
923
927
  {
924
928
  value: "",
925
929
  colorClass: "all-colors",
926
- label: h("All")
930
+ label: y("All")
927
931
  },
928
932
  {
929
933
  value: "black",
930
934
  colorClass: "black-color",
931
- label: h("Black")
935
+ label: y("Black")
932
936
  },
933
937
  {
934
938
  value: "black_and_white",
935
939
  colorClass: "bw-color",
936
- label: h("Black and White")
940
+ label: y("Black and White")
937
941
  },
938
942
  {
939
943
  value: "white",
940
944
  colorClass: "white-color",
941
- label: h("White")
945
+ label: y("White")
942
946
  },
943
947
  {
944
948
  value: "orange",
945
949
  colorClass: "orange-color",
946
- label: h("Orange")
950
+ label: y("Orange")
947
951
  },
948
952
  {
949
953
  value: "red",
950
954
  colorClass: "red-color",
951
- label: h("Red")
955
+ label: y("Red")
952
956
  },
953
957
  {
954
958
  value: "purple",
955
959
  colorClass: "purple-color",
956
- label: h("Purple")
960
+ label: y("Purple")
957
961
  },
958
962
  {
959
963
  value: "magenta",
960
964
  colorClass: "magenta-color",
961
- label: h("Magenta")
965
+ label: y("Magenta")
962
966
  },
963
967
  {
964
968
  value: "green",
965
969
  colorClass: "green-color",
966
- label: h("Green")
970
+ label: y("Green")
967
971
  },
968
972
  {
969
973
  value: "teal",
970
974
  colorClass: "teal-color",
971
- label: h("Teal")
975
+ label: y("Teal")
972
976
  },
973
977
  {
974
978
  value: "blue",
975
979
  colorClass: "blue-color",
976
- label: h("Blue")
980
+ label: y("Blue")
977
981
  }
978
982
  ],
979
983
  tooltipPlacement: "top"
@@ -1005,9 +1009,9 @@ __useblocks__.define("static/core/59023866.js", [
1005
1009
  dataLength: i && i.length,
1006
1010
  next: M,
1007
1011
  hasMore: i,
1008
- endMessage: (0, r.jsxs)(f.Divider, {
1012
+ endMessage: (0, r.jsxs)(m.Divider, {
1009
1013
  plain: !0,
1010
- children: [h("That`s all we could find."), " 🤐"]
1014
+ children: [y("That`s all we could find."), " 🤐"]
1011
1015
  }),
1012
1016
  scrollableTarget: "scrollableDiv",
1013
1017
  style: { overflow: "visible" },
@@ -1023,14 +1027,14 @@ __useblocks__.define("static/core/59023866.js", [
1023
1027
  (0, r.jsx)("img", {
1024
1028
  className: ee === s.id ? "loaded-image" : "",
1025
1029
  width: "322px",
1026
- src: I(s),
1030
+ src: E(s),
1027
1031
  alt: s.description,
1028
- onLoad: Q(s),
1032
+ onLoad: L(s),
1029
1033
  onError: J(s)
1030
1034
  }),
1031
1035
  (0, r.jsxs)("p", {
1032
1036
  className: "creator-info",
1033
- onClick: (y) => y.stopPropagation(),
1037
+ onClick: (h) => h.stopPropagation(),
1034
1038
  children: [
1035
1039
  "Photo by",
1036
1040
  " ",
@@ -1051,7 +1055,7 @@ __useblocks__.define("static/core/59023866.js", [
1051
1055
  })
1052
1056
  ]
1053
1057
  }),
1054
- ee === s.id && (0, r.jsx)(f.Spin, {
1058
+ ee === s.id && (0, r.jsx)(m.Spin, {
1055
1059
  className: "ant-spin",
1056
1060
  size: "small"
1057
1061
  })
@@ -1079,10 +1083,10 @@ __useblocks__.define("static/core/59023866.js", [
1079
1083
  src: i,
1080
1084
  opacity: 0
1081
1085
  }]), setTimeout(() => {
1082
- a((l) => l.map((C, g) => g === l.length - 1 ? {
1083
- ...C,
1086
+ a((l) => l.map((b, g) => g === l.length - 1 ? {
1087
+ ...b,
1084
1088
  opacity: 1
1085
- } : C));
1089
+ } : b));
1086
1090
  }, 1e3);
1087
1091
  }
1088
1092
  }, [t]), (0, r.jsx)("div", {
@@ -1098,28 +1102,28 @@ __useblocks__.define("static/core/59023866.js", [
1098
1102
  }, l))
1099
1103
  });
1100
1104
  };
1101
- function Mt({ setModalHeight: t, customRequest: e, aiTabRef: o, isImageUploaded: a, setIsImageUploaded: i, aiImageRequest: l, imageAiList: C, setImageAiList: g, isLoadingAi: m, setIsLoadingAi: x, onPluginAiImageLimitExceeded: R, onImageGenerateLimitExceeded: p }) {
1102
- const { __: b } = f.useI18n(), j = u.useAppConfig(), w = f.useNotification(), L = u.usePushToDataLayer(), { emailId: h, blockId: D, projectId: k } = (0, Te.useParams)(), [z] = Y.useLazySendAiImageRequestQuery(), [V, { data: U = [] }] = Y.useLazyGetAiImageSSEQuery(), [M] = Y.useLazyGetLimitsStatsByTypeQuery(), K = j?.sendAIImageRequest || z, ee = j?.trigger || V, E = j?.handleLimitUsageEmitter || u.useEventEmitter(u.events.ON_LIMIT_ID), [P, O] = (0, n.useState)(0), [I, W] = (0, n.useState)(null), [A, Q] = (0, n.useState)(!1), [J, q] = (0, n.useState)(b("Evaluating the task")), [s, y] = (0, n.useState)(!1), F = h || D, { limits: ce } = j?.limits ? j : { limits: { ai_img_limit: 0 } }, { ai_img_limit: Z } = ce, $ = !!(j.limits && j.counters) && u.PLUGIN.isPlugin, X = u.useEventEmitter(u.events.AI_IMAGE_REQUEST_ID).hasListeners(), G = re.shouldCountAiUsage({
1105
+ function Mt({ setModalHeight: t, customRequest: e, aiTabRef: o, isImageUploaded: a, setIsImageUploaded: i, aiImageRequest: l, imageAiList: b, setImageAiList: g, isLoadingAi: d, setIsLoadingAi: R, onPluginAiImageLimitExceeded: x, onImageGenerateLimitExceeded: p }) {
1106
+ const { __: w } = m.useI18n(), j = u.useAppConfig(), C = m.useNotification(), U = u.usePushToDataLayer(), { emailId: y, blockId: D, projectId: O } = (0, Ne.useParams)(), [T] = _.useLazySendAiImageRequestQuery(), [Q, { data: N = [] }] = _.useLazyGetAiImageSSEQuery(), [M] = _.useLazyGetLimitsStatsByTypeQuery(), z = j?.sendAIImageRequest || T, ee = j?.trigger || Q, K = j?.handleLimitUsageEmitter || u.useEventEmitter(u.events.ON_LIMIT_ID), [k, P] = (0, n.useState)(0), [E, I] = (0, n.useState)(null), [A, L] = (0, n.useState)(!1), [J, q] = (0, n.useState)(w("Evaluating the task")), [s, h] = (0, n.useState)(!1), W = y || D, { limits: ce } = j?.limits ? j : { limits: { ai_img_limit: 0 } }, { ai_img_limit: Z } = ce, $ = !!(j.limits && j.counters) && u.PLUGIN.isPlugin, X = u.useEventEmitter(u.events.AI_IMAGE_REQUEST_ID).hasListeners(), H = ne.shouldCountAiUsage({
1103
1107
  limitsInPlugin: $,
1104
1108
  hostedAiActive: X
1105
- }), ie = !X && Z > 0 && P >= Z, he = (0, n.useCallback)(() => {
1106
- E.fire({
1109
+ }), ie = !X && Z > 0 && k >= Z, he = (0, n.useCallback)(() => {
1110
+ K.fire({
1107
1111
  name: "AiImgCount",
1108
- count: P + 1
1112
+ count: k + 1
1109
1113
  });
1110
- }, [E, P]), ye = (0, n.useMemo)(() => !ie && (!G || Z === 0 || P < Z), [
1114
+ }, [K, k]), ye = (0, n.useMemo)(() => !ie && (!H || Z === 0 || k < Z), [
1111
1115
  ie,
1112
- G,
1113
- P,
1116
+ H,
1117
+ k,
1114
1118
  Z
1115
1119
  ]), ue = (0, n.useCallback)(async () => {
1116
- q(b("Evaluating the task")), l !== "" && !m && (x(!0), y(!0), g([]), L({
1120
+ q(w("Evaluating the task")), l !== "" && !d && (R(!0), h(!0), g([]), U({
1117
1121
  event: "submit_form",
1118
1122
  action: "ai_image_generation",
1119
- entity_id: h,
1120
- project_id: k
1121
- }), K({ body: {
1122
- project_id: k,
1123
+ entity_id: y,
1124
+ project_id: O
1125
+ }), z({ body: {
1126
+ project_id: O,
1123
1127
  request: "create-image",
1124
1128
  connection: "midjourney",
1125
1129
  message: l
@@ -1127,54 +1131,54 @@ __useblocks__.define("static/core/59023866.js", [
1127
1131
  if (te) throw te;
1128
1132
  if (v.data.status === 401) throw new Error(u.ERROR);
1129
1133
  if (v?.data?._eventResult) {
1130
- g(v.data.task.images), x(!1), y(!1), q(b("Evaluating the task"));
1134
+ g(v.data.task.images), R(!1), h(!1), q(w("Evaluating the task"));
1131
1135
  return;
1132
1136
  }
1133
- v?.data.status === 200 ? (v?.data.task.id && (q(v.data.task.message), W(v.data.task.id)), v.message && w.success({
1137
+ v?.data.status === 200 ? (v?.data.task.id && (q(v.data.task.message), I(v.data.task.id)), v.message && C.success({
1134
1138
  id: "AI_IMAGE_SEND_SUCCESS",
1135
1139
  title: v.message,
1136
1140
  placement: "bottomRight",
1137
1141
  data: l
1138
1142
  }), ee({
1139
1143
  task_id: v?.data.task.id,
1140
- entity_id: F
1141
- })) : (x(!1), y(!1), w.error({
1144
+ entity_id: W
1145
+ })) : (R(!1), h(!1), C.error({
1142
1146
  id: "AI_IMAGE_SEND_ERROR",
1143
- title: v?.message || b("Something went wrong, please try again"),
1147
+ title: v?.message || w("Something went wrong, please try again"),
1144
1148
  placement: "bottomRight",
1145
1149
  data: l,
1146
1150
  innerException: v
1147
1151
  }));
1148
1152
  }).catch((v) => {
1149
- x(!1), y(!1), (v?.error || v?.data) && w.fromError("AI_IMAGE_SEND_ERROR", l, v.error || v);
1153
+ R(!1), h(!1), (v?.error || v?.data) && C.fromError("AI_IMAGE_SEND_ERROR", l, v.error || v);
1150
1154
  }));
1151
1155
  }, [
1152
1156
  l,
1153
- m,
1154
- x,
1155
- y,
1156
- g,
1157
- L,
1157
+ d,
1158
+ R,
1158
1159
  h,
1159
- k,
1160
- K,
1161
- w,
1160
+ g,
1161
+ U,
1162
+ y,
1163
+ O,
1164
+ z,
1165
+ C,
1162
1166
  ee,
1163
- F,
1164
- b
1165
- ]), _ = (0, n.useCallback)(async () => {
1167
+ W,
1168
+ w
1169
+ ]), Y = (0, n.useCallback)(async () => {
1166
1170
  if (ye) {
1167
1171
  if (!u.PLUGIN.isPlugin && !X) {
1168
- const v = T.resolveLimitActionPreflightExceededForType("image_generate", (await M("image_generate")).data?.stats);
1172
+ const v = F.resolveLimitActionPreflightExceededForType("image_generate", (await M("image_generate")).data?.stats);
1169
1173
  if (v) {
1170
1174
  p?.(v);
1171
1175
  return;
1172
1176
  }
1173
1177
  }
1174
- G && (O((v) => v + 1), he()), ue();
1175
- } else $ && (R ? R() : w.error({
1176
- title: b("The usage limit has been exceeded"),
1177
- description: b(`The maximum number of requests for the current subscription period has been reached.
1178
+ H && (P((v) => v + 1), he()), ue();
1179
+ } else $ && (x ? x() : C.error({
1180
+ title: w("The usage limit has been exceeded"),
1181
+ description: w(`The maximum number of requests for the current subscription period has been reached.
1178
1182
  Select the appropriate plan to fulfil more requests`),
1179
1183
  placement: "bottomRight"
1180
1184
  }));
@@ -1182,23 +1186,23 @@ Select the appropriate plan to fulfil more requests`),
1182
1186
  ye,
1183
1187
  $,
1184
1188
  X,
1185
- G,
1189
+ H,
1186
1190
  M,
1187
1191
  p,
1188
- O,
1192
+ P,
1189
1193
  he,
1190
1194
  ue,
1195
+ C,
1191
1196
  w,
1192
- b,
1193
- R
1197
+ x
1194
1198
  ]);
1195
1199
  (0, n.useEffect)(() => {
1196
- $ && O(j?.counters?.ai_img_counter || 0);
1200
+ $ && P(j?.counters?.ai_img_counter || 0);
1197
1201
  }, [j, $]);
1198
1202
  const se = u.useEventEmitter(u.events.AI_IMAGE_PROGRESS_ID);
1199
1203
  (0, n.useEffect)(() => {
1200
- const v = se.event(({ progress: te, status: N }) => {
1201
- q(N || `${Math.round(te)}%`);
1204
+ const v = se.event(({ progress: te, status: G }) => {
1205
+ q(G || `${Math.round(te)}%`);
1202
1206
  });
1203
1207
  return () => v.dispose();
1204
1208
  }, [se]);
@@ -1217,168 +1221,168 @@ Select the appropriate plan to fulfil more requests`),
1217
1221
  i,
1218
1222
  e
1219
1223
  ]), ae = (0, n.useCallback)((v) => {
1220
- v.status !== "error" && v.status !== "Canceled" ? v.images ? (q(v.status), v.progress === 100 && (g(v.images), q(b("Evaluating the task")), W(null), y(!1))) : (g([v.data]), x(!1)) : (x(!1), y(!1), w.error({
1224
+ v.status !== "error" && v.status !== "Canceled" ? v.images ? (q(v.status), v.progress === 100 && (g(v.images), q(w("Evaluating the task")), I(null), h(!1))) : (g([v.data]), R(!1)) : (R(!1), h(!1), C.error({
1221
1225
  id: "AI_IMAGE_GET_ERROR",
1222
- title: b("Something went wrong, please try again"),
1226
+ title: w("Something went wrong, please try again"),
1223
1227
  placement: "bottomRight",
1224
- data: I
1228
+ data: E
1225
1229
  }));
1226
1230
  }, [
1227
1231
  g,
1228
1232
  q,
1229
- b,
1230
- x,
1231
- t,
1232
- I,
1233
1233
  w,
1234
- y
1234
+ R,
1235
+ t,
1236
+ E,
1237
+ C,
1238
+ h
1235
1239
  ]);
1236
1240
  return (0, n.useEffect)(() => {
1237
- U.length > 1 && ae(U[U.length - 1]);
1238
- }, [U, ae]), (0, n.useEffect)(() => {
1239
- (m || C.length > 0) && setTimeout(() => {
1241
+ N.length > 1 && ae(N[N.length - 1]);
1242
+ }, [N, ae]), (0, n.useEffect)(() => {
1243
+ (d || b.length > 0) && setTimeout(() => {
1240
1244
  let v = 550;
1241
1245
  o.current && (v = o.current.offsetHeight + 68), t(v);
1242
1246
  }, 0);
1243
1247
  }, [
1244
1248
  o,
1245
- U,
1246
- C.length,
1247
- m,
1249
+ N,
1250
+ b.length,
1251
+ d,
1248
1252
  t
1249
1253
  ]), {
1250
- aiImageCounter: P,
1251
- setAiImageCounter: O,
1254
+ aiImageCounter: k,
1255
+ setAiImageCounter: P,
1252
1256
  currentAiImgLimits: Z,
1253
1257
  isFieldsDisabled: ie,
1254
1258
  canGenerateImage: ye,
1255
1259
  aiImageRequest: l,
1256
- imageAiList: C,
1260
+ imageAiList: b,
1257
1261
  setImageAiList: g,
1258
- isLoadingAi: m,
1259
- setIsLoadingAi: x,
1262
+ isLoadingAi: d,
1263
+ setIsLoadingAi: R,
1260
1264
  loadingDuringGeneration: s,
1261
- setLoadingDuringGeneration: y,
1265
+ setLoadingDuringGeneration: h,
1262
1266
  requestStatus: J,
1263
1267
  setRequestStatus: q,
1264
- handleGenerate: _,
1268
+ handleGenerate: Y,
1265
1269
  handleLimitAiImgCount: he,
1266
1270
  convertBase64ToFile: B,
1267
1271
  isShiftPressed: A,
1268
- setIsShiftPressed: Q,
1269
- currentReqId: I,
1270
- setCurrentReqId: W,
1272
+ setIsShiftPressed: L,
1273
+ currentReqId: E,
1274
+ setCurrentReqId: I,
1271
1275
  limitsInPlugin: $
1272
1276
  };
1273
1277
  }
1274
- var Pt = ({ setModalHeight: t, customRequest: e, aiTabRef: o, inputAiRef: a, isImageUploaded: i, setIsImageUploaded: l, aiImageRequest: C, setAiImageRequest: g, imageAiList: m, setImageAiList: x, isLoadingAi: R, setIsLoadingAi: p }) => {
1275
- const b = (0, Te.useNavigate)(), j = u.useDispatch(), { __: w, _n: L } = f.useI18n(), h = u.useAppConfig(), [D, k] = (0, n.useState)(!1), [z, V] = (0, n.useState)(null), { aiImageCounter: U, currentAiImgLimits: M, loadingDuringGeneration: K, requestStatus: ee, handleGenerate: E, convertBase64ToFile: P, isShiftPressed: O, setIsShiftPressed: I, limitsInPlugin: W } = Mt({
1278
+ var Pt = ({ setModalHeight: t, customRequest: e, aiTabRef: o, inputAiRef: a, isImageUploaded: i, setIsImageUploaded: l, aiImageRequest: b, setAiImageRequest: g, imageAiList: d, setImageAiList: R, isLoadingAi: x, setIsLoadingAi: p }) => {
1279
+ const w = (0, Ne.useNavigate)(), j = u.useDispatch(), { __: C, _n: U } = m.useI18n(), y = u.useAppConfig(), [D, O] = (0, n.useState)(!1), [T, Q] = (0, n.useState)(null), { aiImageCounter: N, currentAiImgLimits: M, loadingDuringGeneration: z, requestStatus: ee, handleGenerate: K, convertBase64ToFile: k, isShiftPressed: P, setIsShiftPressed: E, limitsInPlugin: I } = Mt({
1276
1280
  setModalHeight: t,
1277
1281
  customRequest: e,
1278
1282
  aiTabRef: o,
1279
1283
  isImageUploaded: i,
1280
1284
  setIsImageUploaded: l,
1281
- aiImageRequest: C,
1282
- imageAiList: m,
1283
- setImageAiList: x,
1284
- isLoadingAi: R,
1285
+ aiImageRequest: b,
1286
+ imageAiList: d,
1287
+ setImageAiList: R,
1288
+ isLoadingAi: x,
1285
1289
  setIsLoadingAi: p,
1286
- onPluginAiImageLimitExceeded: () => k(!0),
1287
- onImageGenerateLimitExceeded: V
1288
- }), A = D && M > 0 ? re.getAiTariffUpgradeStep(M) : null, Q = A ? T.getLimitUpgradePresetDefinition(A.presetId) : null, J = z ? T.getLimitUpgradePresetDefinition(z.presetId) : null, [q, s] = (0, n.useState)(!1), y = (0, n.useCallback)(() => s(!0), []), F = (0, n.useCallback)(() => s(!1), []), ce = (0, n.useCallback)((G) => g(G.target.value), [g]), Z = (0, n.useCallback)((G) => {
1289
- G.key === "Shift" ? I(!0) : G.key === "Enter" && !O && (G.preventDefault(), E());
1290
+ onPluginAiImageLimitExceeded: () => O(!0),
1291
+ onImageGenerateLimitExceeded: Q
1292
+ }), A = D && M > 0 ? ne.getAiTariffUpgradeStep(M) : null, L = A ? F.getLimitUpgradePresetDefinition(A.presetId) : null, J = T ? F.getLimitUpgradePresetDefinition(T.presetId) : null, [q, s] = (0, n.useState)(!1), h = (0, n.useCallback)(() => s(!0), []), W = (0, n.useCallback)(() => s(!1), []), ce = (0, n.useCallback)((H) => g(H.target.value), [g]), Z = (0, n.useCallback)((H) => {
1293
+ H.key === "Shift" ? E(!0) : H.key === "Enter" && !P && (H.preventDefault(), K());
1290
1294
  }, [
1291
- O,
1292
- E,
1293
- I
1294
- ]), $ = (0, n.useCallback)((G) => {
1295
- G.key === "Shift" && I(!1);
1296
- }, [I]), X = m[m.length - 1];
1295
+ P,
1296
+ K,
1297
+ E
1298
+ ]), $ = (0, n.useCallback)((H) => {
1299
+ H.key === "Shift" && E(!1);
1300
+ }, [E]), X = d[d.length - 1];
1297
1301
  return (0, r.jsxs)("div", {
1298
1302
  className: "image-ai",
1299
1303
  children: [
1300
- Q && A ? (0, r.jsx)(T.LimitUpgradeModal, {
1304
+ L && A ? (0, r.jsx)(F.LimitUpgradeModal, {
1301
1305
  open: !0,
1302
- onClose: () => k(!1),
1303
- title: w(Q.titleKey),
1304
- subtitle: w(Q.subtitleKey),
1305
- usageResource: Q.usageResource,
1306
- previousDisplay: T.presetLimitDisplay(A.previousLimit),
1307
- nextDisplay: T.presetLimitDisplay(A.nextLimit),
1306
+ onClose: () => O(!1),
1307
+ title: C(L.titleKey),
1308
+ subtitle: C(L.subtitleKey),
1309
+ usageResource: L.usageResource,
1310
+ previousDisplay: F.presetLimitDisplay(A.previousLimit),
1311
+ nextDisplay: F.presetLimitDisplay(A.nextLimit),
1308
1312
  onChangePlan: () => {
1309
- k(!1), document.body.classList.remove("editor"), b("/billing"), j(Y.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1313
+ O(!1), document.body.classList.remove("editor"), w("/billing"), j(_.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1310
1314
  }
1311
1315
  }) : null,
1312
- J && z ? (0, r.jsx)(T.LimitUpgradeModal, {
1316
+ J && T ? (0, r.jsx)(F.LimitUpgradeModal, {
1313
1317
  open: !0,
1314
- onClose: () => V(null),
1315
- title: w(J.titleKey),
1316
- subtitle: w(J.subtitleKey),
1318
+ onClose: () => Q(null),
1319
+ title: C(J.titleKey),
1320
+ subtitle: C(J.subtitleKey),
1317
1321
  usageResource: J.usageResource,
1318
- previousDisplay: T.presetLimitDisplay(z.previousLimit),
1319
- nextDisplay: T.presetLimitDisplay(z.nextLimit),
1322
+ previousDisplay: F.presetLimitDisplay(T.previousLimit),
1323
+ nextDisplay: F.presetLimitDisplay(T.nextLimit),
1320
1324
  onChangePlan: () => {
1321
- V(null), document.body.classList.remove("editor"), b("/billing"), j(Y.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1325
+ Q(null), document.body.classList.remove("editor"), w("/billing"), j(_.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1322
1326
  }
1323
1327
  }) : null,
1324
- W && (0, r.jsx)(f.LimitsCounter, {
1325
- text: `${U} ${w("of")} ${M > 0 ? M : "∞"} images ${L("was used", "were used", U)}`,
1326
- exceeded: M > 0 && U >= M,
1328
+ I && (0, r.jsx)(m.LimitsCounter, {
1329
+ text: `${N} ${C("of")} ${M > 0 ? M : "∞"} images ${U("was used", "were used", N)}`,
1330
+ exceeded: M > 0 && N >= M,
1327
1331
  style: { marginTop: -25 },
1328
1332
  extra: (0, r.jsx)("span", {
1329
1333
  style: {
1330
1334
  textDecoration: "underline",
1331
1335
  cursor: "pointer"
1332
1336
  },
1333
- onClick: () => b(h.billingPageUrl || u.APP_ROUTES.billing),
1334
- children: w("Need more?")
1337
+ onClick: () => w(y.billingPageUrl || u.APP_ROUTES.billing),
1338
+ children: C("Need more?")
1335
1339
  })
1336
1340
  }),
1337
- (0, r.jsx)(f.Row, {
1341
+ (0, r.jsx)(m.Row, {
1338
1342
  gutter: 24,
1339
1343
  className: "image-ai__row",
1340
- children: (0, r.jsx)(f.Col, {
1344
+ children: (0, r.jsx)(m.Col, {
1341
1345
  span: 24,
1342
- children: (0, r.jsx)(f.Form.Item, {
1346
+ children: (0, r.jsx)(m.Form.Item, {
1343
1347
  style: { margin: 0 },
1344
1348
  children: (0, r.jsxs)("span", {
1345
1349
  className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${q ? " ant-input-affix-wrapper-focused" : ""}`,
1346
- children: [(0, r.jsx)(f.TextArea, {
1350
+ children: [(0, r.jsx)(m.TextArea, {
1347
1351
  ref: a,
1348
1352
  onKeyDown: Z,
1349
1353
  onKeyUp: $,
1350
- onFocus: y,
1351
- onBlur: F,
1354
+ onFocus: h,
1355
+ onBlur: W,
1352
1356
  autoSize: !0,
1353
1357
  allowClear: !0,
1354
1358
  className: "text-area-input-hybrid image-ai__textarea",
1355
- placeholder: w("Generate image"),
1356
- value: C,
1359
+ placeholder: C("Generate image"),
1360
+ value: b,
1357
1361
  onChange: ce,
1358
1362
  spellCheck: "false"
1359
1363
  }), (0, r.jsx)("span", {
1360
1364
  className: "ant-input-suffix image-ai__input-suffix",
1361
- children: R || K ? (0, r.jsx)(T.EmIcons, {
1365
+ children: x || z ? (0, r.jsx)(F.EmIcons, {
1362
1366
  icon: "LoadingOutlined",
1363
1367
  className: "input-icon image-ai__input-icon",
1364
1368
  spin: !0
1365
- }) : (0, r.jsx)(T.EmIcons, {
1369
+ }) : (0, r.jsx)(F.EmIcons, {
1366
1370
  icon: "AI",
1367
1371
  className: "input-icon image-ai__input-icon",
1368
- onClick: E
1372
+ onClick: K
1369
1373
  })
1370
1374
  })]
1371
1375
  })
1372
1376
  })
1373
1377
  })
1374
1378
  }),
1375
- (R || m.length > 0) && (0, r.jsxs)("div", {
1379
+ (x || d.length > 0) && (0, r.jsxs)("div", {
1376
1380
  className: "image-ai__preview",
1377
- children: [R && m.length === 0 && (0, r.jsx)("div", {
1381
+ children: [x && d.length === 0 && (0, r.jsx)("div", {
1378
1382
  className: "image-ai__loading",
1379
1383
  children: (0, r.jsxs)("div", {
1380
1384
  className: "spin",
1381
- children: [(0, r.jsx)(T.EmIcons, {
1385
+ children: [(0, r.jsx)(F.EmIcons, {
1382
1386
  icon: "LoadingOutlined",
1383
1387
  style: { fontSize: 48 },
1384
1388
  spin: !0
@@ -1387,23 +1391,23 @@ Select the appropriate plan to fulfil more requests`),
1387
1391
  children: ee
1388
1392
  })]
1389
1393
  })
1390
- }), m.length > 0 && (0, r.jsxs)("div", {
1394
+ }), d.length > 0 && (0, r.jsxs)("div", {
1391
1395
  className: "image-ai__image-item",
1392
- children: [(0, r.jsx)(Ut, { images: m }), (0, r.jsx)("div", {
1396
+ children: [(0, r.jsx)(Ut, { images: d }), (0, r.jsx)("div", {
1393
1397
  className: "buttons",
1394
- children: (0, r.jsx)(f.Button, {
1395
- onClick: () => P(X),
1396
- icon: (0, r.jsx)(T.EmIcons, { icon: "CheckOutlined" }),
1397
- children: w("Use this one")
1398
+ children: (0, r.jsx)(m.Button, {
1399
+ onClick: () => k(X),
1400
+ icon: (0, r.jsx)(F.EmIcons, { icon: "CheckOutlined" }),
1401
+ children: C("Use this one")
1398
1402
  })
1399
1403
  })]
1400
1404
  })]
1401
1405
  })
1402
1406
  ]
1403
1407
  });
1404
- }, Tt = ({ setNewLink: t, setCurrentImageLink: e, setModalHeight: o, setModalWidth: a, setImageGifList: i, imageGifList: l, currentReqGif: C, setCurrentReqGif: g, inputRef: m, setStockLink: x, customRequest: R }) => {
1405
- const { __: p } = f.useI18n(), b = u.useAppConfig(), j = u.useIsStandalone(), w = f.useNotification(), [L, h] = (0, n.useState)(null), [D, k] = (0, n.useState)(!1), [z, V] = (0, n.useState)(25), [U] = Y.useLazyGetSearchGifQuery(), M = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : p("Failed to load GIFs through the configured proxy chain."), [p]), K = (0, n.useCallback)((s) => {
1406
- w.error({
1408
+ }, Tt = ({ setNewLink: t, setCurrentImageLink: e, setModalHeight: o, setModalWidth: a, setImageGifList: i, imageGifList: l, currentReqGif: b, setCurrentReqGif: g, inputRef: d, setStockLink: R, customRequest: x }) => {
1409
+ const { __: p } = m.useI18n(), w = u.useAppConfig(), j = u.useIsStandalone(), C = m.useNotification(), [U, y] = (0, n.useState)(null), [D, O] = (0, n.useState)(!1), [T, Q] = (0, n.useState)(25), [N] = _.useLazyGetSearchGifQuery(), M = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : p("Failed to load GIFs through the configured proxy chain."), [p]), z = (0, n.useCallback)((s) => {
1410
+ C.error({
1407
1411
  id: "STOCK_GIFS_SEARCH_FAILED",
1408
1412
  title: p("Failed to load GIFs"),
1409
1413
  description: M(s)
@@ -1411,73 +1415,73 @@ Select the appropriate plan to fulfil more requests`),
1411
1415
  }, [
1412
1416
  p,
1413
1417
  M,
1414
- w
1418
+ C
1415
1419
  ]), ee = async () => {
1416
- D || (k(!0), U({
1417
- query: C,
1418
- page: z
1420
+ D || (O(!0), N({
1421
+ query: b,
1422
+ page: T
1419
1423
  }).then((s) => {
1420
1424
  if (s?.error) {
1421
- K(s.error), k(!1);
1425
+ z(s.error), O(!1);
1422
1426
  return;
1423
1427
  }
1424
- i((y) => [...y, ...s.data.data]), k(!1), V((y) => y + 25);
1428
+ i((h) => [...h, ...s.data.data]), O(!1), Q((h) => h + 25);
1425
1429
  }).catch(() => {
1426
- k(!1);
1430
+ O(!1);
1427
1431
  }));
1428
- }, E = async () => {
1429
- const s = await U({
1430
- query: C,
1432
+ }, K = async () => {
1433
+ const s = await N({
1434
+ query: b,
1431
1435
  page: 0
1432
1436
  });
1433
1437
  if (s?.error) {
1434
- K(s.error), i([]);
1438
+ z(s.error), i([]);
1435
1439
  return;
1436
1440
  }
1437
1441
  s?.data?.data?.length > 0 && (i(s.data.data), setTimeout(() => {
1438
1442
  o("84vh"), a(1060);
1439
1443
  }, 0));
1440
- }, P = (s, y) => {
1441
- h(y), setTimeout(() => {
1442
- h(null);
1443
- }, 2e3), x(`${s}`), e(`${s}`), R(`${s}`);
1444
- }, O = { default: 3 }, I = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
1445
- config: b,
1444
+ }, k = (s, h) => {
1445
+ y(h), setTimeout(() => {
1446
+ y(null);
1447
+ }, 2e3), R(`${s}`), e(`${s}`), x(`${s}`);
1448
+ }, P = { default: 3 }, E = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
1449
+ config: w,
1446
1450
  standalone: j,
1447
1451
  resourceType: "generic",
1448
1452
  intent: "display"
1449
- }), [b, j]), { getDisplaySrc: W, handleLoad: A, handleError: Q } = rt({
1453
+ }), [w, j]), { getDisplaySrc: I, handleLoad: A, handleError: L } = rt({
1450
1454
  items: l,
1451
1455
  getItemId: (0, n.useCallback)((s) => s.id, []),
1452
1456
  getRequestUrl: (0, n.useCallback)((s) => s.images.downsized.url, []),
1453
- createController: I
1454
- }), J = (s) => (y) => {
1455
- A(s), y.target.parentNode.classList.add("loaded");
1457
+ createController: E
1458
+ }), J = (s) => (h) => {
1459
+ A(s), h.target.parentNode.classList.add("loaded");
1456
1460
  }, q = (s) => () => {
1457
- Q(s);
1461
+ L(s);
1458
1462
  };
1459
1463
  return (0, r.jsxs)("div", {
1460
1464
  className: "stock-tab",
1461
- children: [(0, r.jsxs)(f.Form, {
1462
- onValuesChange: E,
1465
+ children: [(0, r.jsxs)(m.Form, {
1466
+ onValuesChange: K,
1463
1467
  className: l.length > 0 ? "serach-results" : "",
1464
- children: [(0, r.jsx)(f.Row, {
1468
+ children: [(0, r.jsx)(m.Row, {
1465
1469
  gutter: 24,
1466
- children: (0, r.jsx)(f.Col, {
1470
+ children: (0, r.jsx)(m.Col, {
1467
1471
  span: l.length > 0 ? "" : 24,
1468
- children: (0, r.jsx)(f.Form.Item, {
1472
+ children: (0, r.jsx)(m.Form.Item, {
1469
1473
  className: "stock-search-input",
1470
- children: (0, r.jsx)(f.SearchInput, {
1471
- onSearch: E,
1474
+ children: (0, r.jsx)(m.SearchInput, {
1475
+ onSearch: K,
1472
1476
  allowClear: !0,
1473
1477
  size: l.length > 0 ? "medium" : "large",
1474
1478
  placeholder: p("Search GIFs"),
1475
- value: C.keywords,
1476
- onChange: (s) => g((y) => ({
1477
- ...y,
1479
+ value: b.keywords,
1480
+ onChange: (s) => g((h) => ({
1481
+ ...h,
1478
1482
  keywords: s.target.value
1479
1483
  })),
1480
- ref: m,
1484
+ ref: d,
1481
1485
  spellCheck: "false",
1482
1486
  enterButton: !1
1483
1487
  })
@@ -1510,25 +1514,25 @@ Select the appropriate plan to fulfil more requests`),
1510
1514
  dataLength: l && l.length,
1511
1515
  next: ee,
1512
1516
  hasMore: l,
1513
- endMessage: (0, r.jsxs)(f.Divider, {
1517
+ endMessage: (0, r.jsxs)(m.Divider, {
1514
1518
  plain: !0,
1515
1519
  children: [p("That`s all we could find."), " 🤐"]
1516
1520
  }),
1517
1521
  scrollableTarget: "scrollableDiv",
1518
1522
  style: { overflow: "visible" },
1519
- loader: (0, r.jsx)(f.Spin, { size: "small" }),
1523
+ loader: (0, r.jsx)(m.Spin, { size: "small" }),
1520
1524
  children: (0, r.jsx)(Ge, {
1521
- breakpointCols: O,
1525
+ breakpointCols: P,
1522
1526
  className: "my-masonry-grid",
1523
1527
  columnClassName: "my-masonry-grid_column",
1524
- children: l.map((s, y) => (0, r.jsxs)("div", {
1528
+ children: l.map((s, h) => (0, r.jsxs)("div", {
1525
1529
  className: "list-item",
1526
- onClick: () => P(s.images.downsized.url, s.id),
1530
+ onClick: () => k(s.images.downsized.url, s.id),
1527
1531
  children: [
1528
1532
  (0, r.jsx)("img", {
1529
- className: L === s.id ? "loaded-image" : "",
1533
+ className: U === s.id ? "loaded-image" : "",
1530
1534
  width: "322px",
1531
- src: W(s),
1535
+ src: I(s),
1532
1536
  alt: s.title,
1533
1537
  onLoad: J(s),
1534
1538
  onError: q(s)
@@ -1537,18 +1541,18 @@ Select the appropriate plan to fulfil more requests`),
1537
1541
  rel: "noreferrer",
1538
1542
  href: "https://giphy.com/",
1539
1543
  target: "_blank",
1540
- onClick: (F) => F.stopPropagation(),
1544
+ onClick: (W) => W.stopPropagation(),
1541
1545
  children: (0, r.jsx)("div", {
1542
1546
  className: "overlay-image",
1543
1547
  style: { backgroundImage: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAkCAYAAAB/up84AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABSBJREFUeNrsWjFv2zoQVoMW8BZ18xaN3qLRW9QtW9OtW92to98vaPoP3K1b1S1b3c2jvWlUNm3lw1s8Mpu3PAo4Iocr70jKlp0COuCQlpKPx/t43x1pv3h8fEwGeT5yNoTgeclLZvza6NgxXoNaGRktjE6MpjC2NVqh92bwt4HxBI1ro0s0dgN2tvD5a8a/9vkq0M+xYKdG81A7Gp6pyBjZddrnO6N36Hkbqyn8u4L3vYC0hjLHeAbPVhC4TwAK/ewNvLsEhyxgFXLK2l/D4tvnOVrUiPEh1k/JjvLYyWENdeTcKazBBr6AdY4AqBTmbkIzhO4gvMumYLxAYKzgPTvhBBajYNwCksHYhOyYiow1KONaKYlfO8bPEWyGEfi5Iu+Vjizg7EzB3xvwWTMxWkHG4mDnMF6BnSnYncLzHWGG4BqiwZkKQMC7I0cOVTCJhvRUKNgNCmCOxhNmrBEWzwGi0Y6rIihbsnOH/JgE2hshKrLZv4Px9yhj1twafRlid/UIGWvlFdlVLirIkIM12nETGLeO2tTPECBUZuT/a7JBMpSxUybYLjulUCN2iEpHQoyuGWZJUCa8R/VGSZvGB0iOdjAO9n8EtC2zUxICSIoW0ICTmA53DCDKQzWZg89XAXZ2B2iMavBnjDKpBX6B1tnAM5aqQgGhnU2D6GmHuqw7AkaOPmP/bsHpFC1kTLqVhglS6fFNgX1MCXUHO1zR1h5AFOoSc1jjmKx/An/1PoBQasBSoZZ3hpyaOrg0IW2sRkG8JsU8CaCaLckAhfi6AG0cmeuzkyMQMtL+SiySkY3oA/EgGeICK0UOZYQKVsQpDAjm2BpsaAGQLMKnMdok3yLtpKS70yT7OUBcm7UTHb5grk5y1Csrj40MqUbUpgW7NXo+RunckODkQvdXM37iwm7b1VA7lAaVB4jUUZOUIzNxfOougAwy3GUN0qWG2IJJ09V2NcvIFE8c54nQelEHFM6C6chUhI+WZjjffDQkrenPhqmlrAC9Naof/aLhXZeNNfMZOk+MtPOVRjNmTpfcCut0+biGZ3PBj1ywWTOfqV3v+yjLFuDPRs8Ddu05vLtmsuHQ0s73wehvR0t7aGkPevfCM5fcGr0MbOW9NSSFwF52cP5KcLIv+X4EUGbCemcOqpoz73/haE4CZNkRjAR20vwENXHRc2bWEMyQuUuGVe4hc6K6rBmg7pKN0XdGX7dts9E3Rr8afUATFl1PqgLAG6T3AoX1nSVtMP9l5r5FVyiu+D14/YssRHOheGVQYNMeinrhsMcV2WVPRR1rIRT4QmiA5r4G6oxp0y6ZzFh4LvhmB84MHz1xta9vWQMrcFR/3iF+7DmEu2YoyTshRbuMvGE9hnwGPQR1tdR04aCueKrqAIgiu/AqcCf1JXPhfuoYosGHn4Hgqa6AnCK4IfSkCa1eCJRxLGnn+mX0rfDOJok4AsQAUpwQlND2++HIgNiOVO1LVRIgtXDPs0bpunEU08vktHLMpoJS1/d9qEo6h6gAzq7RRaPV+QmBeICzUUh2fIHzk0s3HedXwkEy2ReQmjn4XDzDjqkN4D/J04/y/np5KbSrrtbwAyx+kTxdf9tfpvSZIW9O3FScHJAF8PEFc5F2lQzSi5wJheoG3U/t0xYOcgBAcOHuAkr7mY9ditoAiCz2q8uvEcD8gJpSDuGNl5hfnaTJ0/fpheMUr4CitHCO6fqdesj359xh1tWiqggfdUCmcz9ZivZ7+BnQM5P/BRgABx8sJWqTxoYAAAAASUVORK5CYII=)" }
1544
1548
  })
1545
1549
  }),
1546
- L === s.id && (0, r.jsx)(f.Spin, {
1550
+ U === s.id && (0, r.jsx)(m.Spin, {
1547
1551
  className: "ant-spin",
1548
1552
  size: "small"
1549
1553
  })
1550
1554
  ]
1551
- }, s.id + y))
1555
+ }, s.id + h))
1552
1556
  })
1553
1557
  })
1554
1558
  })
@@ -1627,79 +1631,79 @@ Select the appropriate plan to fulfil more requests`),
1627
1631
  url: l
1628
1632
  } : void 0;
1629
1633
  }
1630
- var ot = "IMG", it = "BACKGROUND", Wt = "GALLERY", we = "EDITOR", pe = "UPLOAD", Ke = "STOCK", We = "GIF", He = "AI", Ht = { mode: "select" }, Vt = { mode: "save" }, { Dragger: Qt } = f.Upload, qt = (t, e = "image") => Y.decodeFileNameFromUrl(t) ?? e, Re = re.normalizeImageFormatForDisplay, _t = (t, e) => {
1631
- const o = Re(e);
1634
+ var ot = "IMG", it = "BACKGROUND", Wt = "GALLERY", Ae = "EDITOR", pe = "UPLOAD", Ke = "STOCK", We = "GIF", He = "AI", Ht = { mode: "select" }, Vt = { mode: "save" }, { Dragger: Qt } = m.Upload, qt = (t, e = "image") => _.decodeFileNameFromUrl(t) ?? e, ke = ne.normalizeImageFormatForDisplay, Yt = (t, e) => {
1635
+ const o = ke(e);
1632
1636
  return !o || t.includes(".") ? t : `${t}.${o}`;
1633
- }, Yt = (t, e) => new File([t], _t(qt(e), t.type), { type: t.type || "application/octet-stream" }), lt = ({ dataProvider: t }) => {
1634
- const e = u.useAppConfig(), o = u.useIsStandalone(), { __: a } = f.useI18n(), i = u.useDispatch(), { projectId: l } = (0, Te.useParams)(), [C] = Y.useLazyGetImageInfoQuery(), { modal: g } = f.App.useApp(), m = f.useNotification(), x = u.useSelector(u.selectedIsUserPaySmth), R = u.useSelector(u.selectedCurrentUser), p = u.useSelector(Y.selectActiveModal), { request: b, resolveImagePicker: j } = T.useImagePicker(), [w, L] = (0, n.useState)(""), [h, D] = (0, n.useState)(""), [k, z] = (0, n.useState)(""), [V, U] = (0, n.useState)(""), [M, K] = (0, n.useState)(pe), [ee, E] = (0, n.useState)({
1637
+ }, _t = (t, e) => new File([t], Yt(qt(e), t.type), { type: t.type || "application/octet-stream" }), lt = ({ dataProvider: t }) => {
1638
+ const e = u.useAppConfig(), o = u.useIsStandalone(), { __: a } = m.useI18n(), i = u.useDispatch(), { projectId: l } = (0, Ne.useParams)(), [b] = _.useLazyGetImageInfoQuery(), { modal: g } = m.App.useApp(), d = m.useNotification(), R = u.useSelector(u.selectedIsUserPaySmth), x = u.useSelector(u.selectedCurrentUser), p = u.useSelector(_.selectActiveModal), { request: w, resolveImagePicker: j } = F.useImagePicker(), [C, U] = (0, n.useState)(""), [y, D] = (0, n.useState)(""), [O, T] = (0, n.useState)(""), [Q, N] = (0, n.useState)(""), [M, z] = (0, n.useState)(pe), [ee, K] = (0, n.useState)({
1635
1639
  width: "",
1636
1640
  height: "",
1637
1641
  size: "",
1638
1642
  format: ""
1639
- }), [P, O] = (0, n.useState)("success"), [I, W] = (0, n.useState)(!1), A = n.default.useRef(null), Q = n.default.useRef(null), J = n.default.useRef(null), q = n.default.useRef(null), s = n.default.useRef(null), y = n.default.useRef(null), F = n.default.useRef(null), ce = n.default.useRef(null), Z = n.default.useRef(null), [$, X] = (0, n.useState)("auto"), [G, ie] = (0, n.useState)(572), [he, ye] = (0, n.useState)(!1), [ue, _] = (0, n.useState)({
1643
+ }), [k, P] = (0, n.useState)("success"), [E, I] = (0, n.useState)(!1), A = n.default.useRef(null), L = n.default.useRef(null), J = n.default.useRef(null), q = n.default.useRef(null), s = n.default.useRef(null), h = n.default.useRef(null), W = n.default.useRef(null), ce = n.default.useRef(null), Z = n.default.useRef(null), [$, X] = (0, n.useState)("auto"), [H, ie] = (0, n.useState)(572), [he, ye] = (0, n.useState)(!1), [ue, Y] = (0, n.useState)({
1640
1644
  keywords: "",
1641
1645
  color: "",
1642
1646
  orientation: ""
1643
- }), [se, B] = (0, n.useState)({ keywords: "" }), [ae, v] = (0, n.useState)([]), [te, N] = (0, n.useState)([]), [fe, Zt] = (0, n.useState)([]), [ct, ut] = (0, n.useState)(!1), [dt, Ve] = (0, n.useState)(""), [Xt, je] = (0, n.useState)(!1), [Jt, Be] = (0, n.useState)(0), Qe = u.useSelector(u.selectProject), ft = Qe?.id !== void 0 ? String(Qe.id) : l || "", mt = u.useEventEmitter(u.events.UPLOAD_EVENT_ID), ke = n.default.useRef(re.createImageUrlBlobResolver()), qe = n.default.useRef(""), be = n.default.useRef(0), Ae = n.default.useRef(""), [$t, pt] = (0, n.useState)(""), [en, gt] = (0, n.useState)(null), [tn, _e] = (0, n.useState)(""), Ue = (0, n.useCallback)((c) => {
1647
+ }), [se, B] = (0, n.useState)({ keywords: "" }), [ae, v] = (0, n.useState)([]), [te, G] = (0, n.useState)([]), [fe, Zt] = (0, n.useState)([]), [ct, ut] = (0, n.useState)(!1), [dt, Ve] = (0, n.useState)(""), [Xt, Ee] = (0, n.useState)(!1), [Jt, Be] = (0, n.useState)(0), Qe = u.useSelector(u.selectProject), ft = Qe?.id !== void 0 ? String(Qe.id) : l || "", mt = u.useEventEmitter(u.events.UPLOAD_EVENT_ID), Ie = n.default.useRef(ne.createImageUrlBlobResolver()), qe = n.default.useRef(""), be = n.default.useRef(0), xe = n.default.useRef(""), [$t, pt] = (0, n.useState)(""), [en, gt] = (0, n.useState)(null), [tn, Ye] = (0, n.useState)(""), Ue = (0, n.useCallback)((c) => {
1644
1648
  if (!(c instanceof Blob)) return;
1645
- Ae.current && URL.revokeObjectURL(Ae.current);
1646
- const d = URL.createObjectURL(c);
1647
- Ae.current = d, pt(d), gt(c);
1649
+ xe.current && URL.revokeObjectURL(xe.current);
1650
+ const f = URL.createObjectURL(c);
1651
+ xe.current = f, pt(f), gt(c);
1648
1652
  }, []), ge = (0, n.useCallback)(() => {
1649
- Ae.current && (URL.revokeObjectURL(Ae.current), Ae.current = ""), pt(""), gt(null);
1653
+ xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""), pt(""), gt(null);
1650
1654
  }, []), de = (0, n.useCallback)(() => {
1651
- _e("");
1655
+ Ye("");
1652
1656
  }, []);
1653
- let ve = !(x || !T.isProjectOwner(Qe, R));
1657
+ let ve = !(R || !F.isProjectOwner(Qe, x));
1654
1658
  const nn = (c) => {
1655
1659
  D(c.target.value);
1656
- }, Me = (0, n.useCallback)((c, d, S = a("The image could not be uploaded.")) => {
1657
- const H = d instanceof Error ? d.message : S;
1658
- m.error({
1660
+ }, Me = (0, n.useCallback)((c, f, S = a("The image could not be uploaded.")) => {
1661
+ const V = f instanceof Error ? f.message : S;
1662
+ d.error({
1659
1663
  id: "IMAGE_UPLOAD_ERROR",
1660
1664
  data: c,
1661
1665
  title: a("Upload failed"),
1662
- description: H
1666
+ description: V
1663
1667
  });
1664
- }, [a, m]), rn = (0, n.useCallback)(async (c) => T.pickUploadImageUrlFromFireResults(await mt.fire({
1668
+ }, [a, d]), rn = (0, n.useCallback)(async (c) => F.pickUploadImageUrlFromFireResults(await mt.fire({
1665
1669
  file: c,
1666
1670
  project: ft
1667
- })), [ft, mt]), Ee = re.useImageBlobFetch(), Pe = async (c) => {
1671
+ })), [ft, mt]), we = ne.useImageBlobFetch(), sn = (0, n.useCallback)((c) => Ie.current.resolve(ne.canonicalImageUrlKey(c), void 0, we), [we]), Pe = async (c) => {
1668
1672
  if (c) try {
1669
- const d = await sn(c);
1670
- d && Ze(d) ? await Oe({ file: d }) : d || Me({ url: c }, null, a("Failed to download image from URL."));
1671
- } catch (d) {
1672
- Me({ url: c }, d, a("Failed to process image URL."));
1673
+ const f = await an(c);
1674
+ f && Ze(f) ? await Oe({ file: f }) : f || Me({ url: c }, null, a("Failed to download image from URL."));
1675
+ } catch (f) {
1676
+ Me({ url: c }, f, a("Failed to process image URL."));
1673
1677
  }
1674
1678
  }, ht = n.default.useRef(Pe);
1675
1679
  ht.current = Pe, n.default.useEffect(() => {
1676
- if (M !== pe || !V) return;
1677
- const c = h.trim();
1680
+ if (M !== pe || !Q) return;
1681
+ const c = y.trim();
1678
1682
  if (!c || !c.toLowerCase().startsWith("http")) return;
1679
- const d = setTimeout(() => {
1683
+ const f = setTimeout(() => {
1680
1684
  ht.current(c);
1681
1685
  }, 1e3);
1682
1686
  return () => {
1683
- clearTimeout(d);
1687
+ clearTimeout(f);
1684
1688
  };
1685
1689
  }, [
1686
- h,
1690
+ y,
1687
1691
  M,
1688
- V
1692
+ Q
1689
1693
  ]);
1690
- const sn = async (c) => {
1694
+ const an = async (c) => {
1691
1695
  try {
1692
- const d = re.canonicalImageUrlKey(c);
1693
- return Yt(await ke.current.resolve(d, void 0, Ee), d);
1696
+ const f = ne.canonicalImageUrlKey(c);
1697
+ return _t(await Ie.current.resolve(f, void 0, we), f);
1694
1698
  } catch {}
1695
1699
  };
1696
1700
  document.onpaste = function(c) {
1697
- const d = c.clipboardData?.items?.[0];
1698
- if (M === pe && V) {
1699
- if (d?.type?.indexOf("image") === 0 && e.imageCenterLocalUploadEnabled !== !1) {
1700
- const H = d.getAsFile();
1701
- Ze(H);
1702
- const oe = { file: H };
1701
+ const f = c.clipboardData?.items?.[0];
1702
+ if (M === pe && Q) {
1703
+ if (f?.type?.indexOf("image") === 0 && e.imageCenterLocalUploadEnabled !== !1) {
1704
+ const V = f.getAsFile();
1705
+ Ze(V);
1706
+ const oe = { file: V };
1703
1707
  D(""), Oe(oe);
1704
1708
  return;
1705
1709
  }
@@ -1708,181 +1712,181 @@ Select the appropriate plan to fulfil more requests`),
1708
1712
  c.preventDefault(), c.stopPropagation(), D(S.trim());
1709
1713
  return;
1710
1714
  }
1711
- d?.type?.indexOf("text") === 0 && d.getAsString((H) => {
1712
- if (H.trim().toLowerCase().startsWith("http")) D(H.trim());
1713
- else if (H.toString().slice(1, 5) === "meta") {
1714
- const oe = H.toString().split("\"")[1];
1715
+ f?.type?.indexOf("text") === 0 && f.getAsString((V) => {
1716
+ if (V.trim().toLowerCase().startsWith("http")) D(V.trim());
1717
+ else if (V.toString().slice(1, 5) === "meta") {
1718
+ const oe = V.toString().split("\"")[1];
1715
1719
  oe && D(oe);
1716
1720
  }
1717
1721
  });
1718
1722
  }
1719
1723
  }, (0, n.useEffect)(() => {
1720
- const c = (d) => {
1724
+ const c = (f) => {
1721
1725
  let S = null;
1722
- b?.kind === "background" ? (S = it, U(it)) : b?.kind === "img" && (U(ot), S = ot), b?.currentUrl && S && (L(b.currentUrl), K(d));
1726
+ w?.kind === "background" ? (S = it, N(it)) : w?.kind === "img" && (N(ot), S = ot), w?.currentUrl && S && (U(w.currentUrl), z(f));
1723
1727
  };
1724
- p === u.MODALS.UPLOAD_IMAGE_MODAL || p === u.MODALS.UPLOAD_BACKGROUND_MODAL ? c(we) : p === u.MODALS.UPLOAD_IMAGE_MODAL_AI || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (ve ? (je(!0), Be(2)) : c(He), setTimeout(() => Z.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(pe), setTimeout(() => y.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_STOCK || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (ve ? (je(!0), Be(3)) : c(Ke), setTimeout(() => ce.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_GIF || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (ve ? (je(!0), Be(3)) : c(We), setTimeout(() => F.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_EDIT || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (ve ? (je(!0), Be(5)) : c(we), i(Y.openSecondModal(u.MODALS.IMAGE_EDITOR_MODAL))) : U("");
1728
+ p === u.MODALS.UPLOAD_IMAGE_MODAL || p === u.MODALS.UPLOAD_BACKGROUND_MODAL ? c(Ae) : p === u.MODALS.UPLOAD_IMAGE_MODAL_AI || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (ve ? (Ee(!0), Be(2)) : c(He), setTimeout(() => Z.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(pe), setTimeout(() => h.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_STOCK || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (ve ? (Ee(!0), Be(3)) : c(Ke), setTimeout(() => ce.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_GIF || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (ve ? (Ee(!0), Be(3)) : c(We), setTimeout(() => W.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_EDIT || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (ve ? (Ee(!0), Be(5)) : c(Ae), i(_.openSecondModal(u.MODALS.IMAGE_EDITOR_MODAL))) : N("");
1725
1729
  }, [
1726
1730
  p,
1727
1731
  i,
1728
1732
  ve,
1729
- b
1733
+ w
1730
1734
  ]);
1731
- const Ye = (0, n.useCallback)(({ url: c = w || "", meta: d = Ht }) => {
1732
- L(c), j({
1735
+ const _e = (0, n.useCallback)(({ url: c = C || "", meta: f = Ht }) => {
1736
+ U(c), j({
1733
1737
  url: c,
1734
- meta: d
1738
+ meta: f
1735
1739
  }), setTimeout(() => {
1736
- de(), ge(), _({
1740
+ de(), ge(), Y({
1737
1741
  keywords: "",
1738
1742
  color: "",
1739
1743
  orientation: ""
1740
- }), B({ keywords: "" }), N([]), v([]), U(""), Ve(""), ut(!1), z(""), D(""), K(pe);
1741
- }, 200), i(Y.closeModal()), i(Y.closeSecondModal());
1744
+ }), B({ keywords: "" }), G([]), v([]), N(""), Ve(""), ut(!1), T(""), D(""), z(pe);
1745
+ }, 200), i(_.closeModal()), i(_.closeSecondModal());
1742
1746
  }, [
1743
- w,
1747
+ C,
1744
1748
  de,
1745
1749
  i,
1746
1750
  j,
1747
1751
  ge
1748
- ]), yt = (0, n.useCallback)((c, d) => (X("auto"), W(!1), Ye({
1752
+ ]), yt = (0, n.useCallback)((c, f) => (X("auto"), I(!1), _e({
1749
1753
  url: c,
1750
1754
  meta: Vt
1751
- }), m.success({
1755
+ }), d.success({
1752
1756
  id: "IMAGE_UPLOAD_SUCCESS",
1753
- data: d,
1757
+ data: f,
1754
1758
  title: a("The image was successfully uploaded.")
1755
1759
  }), c), [
1756
1760
  a,
1757
- Ye,
1758
- m
1761
+ _e,
1762
+ d
1759
1763
  ]);
1760
1764
  (0, n.useEffect)(() => {
1761
- const c = h || k, d = re.canonicalImageUrlKey(c);
1762
- if (!c || !d) {
1763
- O(""), qe.current = "", de(), ge(), ke.current.invalidateAll();
1765
+ const c = y || O, f = ne.canonicalImageUrlKey(c);
1766
+ if (!c || !f) {
1767
+ P(""), qe.current = "", de(), ge(), Ie.current.invalidateAll();
1764
1768
  return;
1765
1769
  }
1766
1770
  const S = qe.current;
1767
- S && S !== d && (ke.current.abandonKey(S), de(), ge()), qe.current = d;
1768
- const H = new AbortController(), oe = h ? 800 : 0, ne = ++be.current, Xe = setTimeout(async () => {
1771
+ S && S !== f && (Ie.current.abandonKey(S), de(), ge()), qe.current = f;
1772
+ const V = new AbortController(), oe = y ? 800 : 0, re = ++be.current, Xe = setTimeout(async () => {
1769
1773
  try {
1770
- const Ie = async () => {
1771
- const me = await ke.current.resolve(d, H.signal, Ee);
1772
- if (ne !== be.current) return;
1773
- const { width: Ce, height: cn } = await re.getImageDimensionsFromBlob(me);
1774
- ne === be.current && (E({
1774
+ const Se = async () => {
1775
+ const me = await Ie.current.resolve(f, V.signal, we);
1776
+ if (re !== be.current) return;
1777
+ const { width: Ce, height: un } = await ne.getImageDimensionsFromBlob(me);
1778
+ re === be.current && (K({
1775
1779
  width: Ce,
1776
- height: cn,
1780
+ height: un,
1777
1781
  size: (me.size / 1024).toFixed(2),
1778
- format: Re(me.type)
1782
+ format: ke(me.type)
1779
1783
  }), de(), Ue(me));
1780
1784
  };
1781
- if (o) await Ie();
1785
+ if (o) await Se();
1782
1786
  else {
1783
- const me = await re.resolveDataProviderPreview(t, d);
1784
- if (me?.previewUrl && ne === be.current) {
1785
- _e(me.previewUrl), ge();
1787
+ const me = await ne.resolveDataProviderPreview(t, f);
1788
+ if (me?.previewUrl && re === be.current) {
1789
+ Ye(me.previewUrl), ge();
1786
1790
  try {
1787
- const { data: Ce } = await C(d);
1788
- if (ne !== be.current) return;
1789
- Ce ? E({
1791
+ const { data: Ce } = await b(f);
1792
+ if (re !== be.current) return;
1793
+ Ce ? K({
1790
1794
  width: Ce?.width,
1791
1795
  height: Ce?.height,
1792
1796
  size: Ce?.fileSize != null ? (Ce.fileSize / 1024).toFixed(2) : "",
1793
- format: Re(Ce?.format)
1794
- }) : await Ie();
1797
+ format: ke(Ce?.format)
1798
+ }) : await Se();
1795
1799
  } catch {
1796
- await Ie();
1800
+ await Se();
1797
1801
  }
1798
- } else await Ie();
1802
+ } else await Se();
1799
1803
  }
1800
- if (ne !== be.current) return;
1801
- O("success"), L(c), ie(572), setTimeout(() => {
1804
+ if (re !== be.current) return;
1805
+ P("success"), U(c), ie(572), setTimeout(() => {
1802
1806
  let me = 0;
1803
- Q.current && (me = Q.current.offsetHeight + 62), X(me);
1807
+ L.current && (me = L.current.offsetHeight + 62), X(me);
1804
1808
  }, 0);
1805
- } catch (Ie) {
1806
- if (Ie?.name === "AbortError" || H.signal.aborted || ne !== be.current) return;
1807
- de(), ge(), O("error");
1809
+ } catch (Se) {
1810
+ if (Se?.name === "AbortError" || V.signal.aborted || re !== be.current) return;
1811
+ de(), ge(), P("error");
1808
1812
  }
1809
1813
  }, oe);
1810
1814
  return () => {
1811
- clearTimeout(Xe), H.abort();
1815
+ clearTimeout(Xe), V.abort();
1812
1816
  };
1813
1817
  }, [
1814
- h,
1815
- k,
1818
+ y,
1819
+ O,
1816
1820
  o,
1817
1821
  de,
1818
- Ee,
1819
- C,
1822
+ we,
1823
+ b,
1820
1824
  ge,
1821
1825
  t,
1822
1826
  Ue
1823
1827
  ]), (0, n.useEffect)(() => {
1824
- if (!w || h || k) return;
1825
- const c = re.canonicalImageUrlKey(w), d = new AbortController();
1828
+ if (!C || y || O) return;
1829
+ const c = ne.canonicalImageUrlKey(C), f = new AbortController();
1826
1830
  let S = !1;
1827
- const H = async () => {
1828
- const oe = await ke.current.resolve(c, d.signal, Ee);
1831
+ const V = async () => {
1832
+ const oe = await Ie.current.resolve(c, f.signal, we);
1829
1833
  if (S) return;
1830
- const { width: ne, height: Xe } = await re.getImageDimensionsFromBlob(oe);
1831
- S || (de(), Ue(oe), E({
1832
- width: ne,
1834
+ const { width: re, height: Xe } = await ne.getImageDimensionsFromBlob(oe);
1835
+ S || (de(), Ue(oe), K({
1836
+ width: re,
1833
1837
  height: Xe,
1834
1838
  size: (oe.size / 1024).toFixed(2),
1835
- format: Re(oe.type)
1839
+ format: ke(oe.type)
1836
1840
  }));
1837
1841
  };
1838
1842
  return (async () => {
1839
1843
  try {
1840
1844
  if (!o) {
1841
- const oe = await re.resolveDataProviderPreview(t, c);
1845
+ const oe = await ne.resolveDataProviderPreview(t, c);
1842
1846
  if (oe?.previewUrl && !S) {
1843
- _e(oe.previewUrl), ge();
1847
+ Ye(oe.previewUrl), ge();
1844
1848
  try {
1845
- const { data: ne } = await C(c);
1849
+ const { data: re } = await b(c);
1846
1850
  if (S) return;
1847
- ne ? E({
1848
- width: ne?.width,
1849
- height: ne?.height,
1850
- size: ne?.fileSize != null ? (ne.fileSize / 1024).toFixed(2) : "",
1851
- format: Re(ne?.format)
1852
- }) : await H();
1851
+ re ? K({
1852
+ width: re?.width,
1853
+ height: re?.height,
1854
+ size: re?.fileSize != null ? (re.fileSize / 1024).toFixed(2) : "",
1855
+ format: ke(re?.format)
1856
+ }) : await V();
1853
1857
  return;
1854
1858
  } catch {
1855
- await H();
1859
+ await V();
1856
1860
  }
1857
1861
  }
1858
1862
  }
1859
- await H();
1863
+ await V();
1860
1864
  } catch {
1861
1865
  S || de();
1862
1866
  }
1863
1867
  })(), () => {
1864
- S = !0, d.abort();
1868
+ S = !0, f.abort();
1865
1869
  };
1866
1870
  }, [
1867
1871
  o,
1868
1872
  de,
1869
- w,
1870
- Ee,
1871
1873
  C,
1874
+ we,
1875
+ b,
1872
1876
  t,
1873
- h,
1874
- k,
1877
+ y,
1878
+ O,
1875
1879
  Ue
1876
1880
  ]);
1877
- const an = () => {
1878
- i(Y.closeModal()), setTimeout(() => {
1879
- de(), ge(), L(""), D(""), N([]), N([]), _({
1881
+ const on = () => {
1882
+ i(_.closeModal()), setTimeout(() => {
1883
+ de(), ge(), U(""), D(""), G([]), G([]), Y({
1880
1884
  keywords: "",
1881
1885
  color: "",
1882
1886
  orientation: ""
1883
- }), B({ keywords: "" }), X("auto"), !ct && Ve(""), ie(572), K(pe);
1887
+ }), B({ keywords: "" }), X("auto"), !ct && Ve(""), ie(572), z(pe);
1884
1888
  }, 200);
1885
- }, on = (c) => {
1889
+ }, ln = (c) => {
1886
1890
  c === Wt ? g.success({
1887
1891
  mask: { closable: !0 },
1888
1892
  centered: !0,
@@ -1890,54 +1894,54 @@ Select the appropriate plan to fulfil more requests`),
1890
1894
  content: a("The feature is under development."),
1891
1895
  okText: a("Ok. I'll be waiting"),
1892
1896
  onOk: () => {}
1893
- }) : c === we && w === "" ? g.warning({
1897
+ }) : c === Ae && C === "" ? g.warning({
1894
1898
  mask: { closable: !0 },
1895
1899
  centered: !0,
1896
1900
  title: a(""),
1897
1901
  content: a("To preview and edit the uploaded image"),
1898
1902
  okText: a("Upload Image"),
1899
1903
  onOk: () => {
1900
- K(pe);
1904
+ z(pe);
1901
1905
  }
1902
1906
  }) : (setTimeout(() => {
1903
- let d = 0, S = 0;
1904
- c === pe && A.current ? (ue.keywords === "" && y.current?.focus({ cursor: "start" }), d = 300, S = 572) : c === we && Q.current ? (d = Q.current.offsetHeight + 62, S = 572) : c === Ke && J.current ? (ue.keywords === "" && ce.current?.focus({ cursor: "start" }), d = 130, S = 572, te.length > 0 && (S = 1060, d = "84vh")) : c === We && q.current ? (ue.keywords === "" && F.current?.focus({ cursor: "start" }), d = 130, S = 572, ae.length > 0 && (S = 1060, d = "84vh")) : c === He && s.current && (dt === "" && fe.length === 0 ? (Z.current?.focus({ cursor: "start" }), d = 130) : d = s.current.offsetHeight + 82, S = 572), X(d), ie(S);
1905
- }, 0), K(c));
1907
+ let f = 0, S = 0;
1908
+ c === pe && A.current ? (ue.keywords === "" && h.current?.focus({ cursor: "start" }), f = 300, S = 572) : c === Ae && L.current ? (f = L.current.offsetHeight + 62, S = 572) : c === Ke && J.current ? (ue.keywords === "" && ce.current?.focus({ cursor: "start" }), f = 130, S = 572, te.length > 0 && (S = 1060, f = "84vh")) : c === We && q.current ? (ue.keywords === "" && W.current?.focus({ cursor: "start" }), f = 130, S = 572, ae.length > 0 && (S = 1060, f = "84vh")) : c === He && s.current && (dt === "" && fe.length === 0 ? (Z.current?.focus({ cursor: "start" }), f = 130) : f = s.current.offsetHeight + 82, S = 572), X(f), ie(S);
1909
+ }, 0), z(c));
1906
1910
  };
1907
1911
  (0, n.useEffect)(() => {
1908
- ue.keywords === "" && (y?.current?.focus({ cursor: "start" }), N([]), setTimeout(() => {
1912
+ ue.keywords === "" && (h?.current?.focus({ cursor: "start" }), G([]), setTimeout(() => {
1909
1913
  X("auto"), ie(572);
1910
1914
  }, 0));
1911
1915
  }, [
1912
1916
  ue,
1913
- N,
1917
+ G,
1914
1918
  X,
1915
1919
  ie
1916
1920
  ]);
1917
1921
  const Ze = (c) => {
1918
- const d = c.type === "image/jpeg" || c.type === "image/png" || c.type === "image/jpg" || c.type === "image/webp" || c.type === "image/gif" || c.type === "image/svg+xml";
1919
- return d || m.error({
1922
+ const f = c.type === "image/jpeg" || c.type === "image/png" || c.type === "image/jpg" || c.type === "image/webp" || c.type === "image/gif" || c.type === "image/svg+xml";
1923
+ return f || d.error({
1920
1924
  id: "IMAGE_UPLOAD_WRONG_FORMAT",
1921
1925
  data: c,
1922
1926
  title: "Upload",
1923
1927
  description: "You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!"
1924
- }), d;
1928
+ }), f;
1925
1929
  }, Oe = async ({ file: c }) => {
1926
1930
  try {
1927
1931
  ye(!0);
1928
- const d = await re.prepareImageForEditorUpload(c, e), S = await rn(d);
1929
- if (S) return yt(S, d), S;
1930
- const H = await Kt(d, t);
1931
- if (H?.url) return yt(H.url, d), H.url;
1932
- Me(d, null);
1932
+ const f = await ne.prepareImageForEditorUpload(c, e), S = await rn(f);
1933
+ if (S) return yt(S, f), S;
1934
+ const V = await Kt(f, t);
1935
+ if (V?.url) return yt(V.url, f), V.url;
1936
+ Me(f, null);
1933
1937
  return;
1934
- } catch (d) {
1935
- Me(c, d);
1938
+ } catch (f) {
1939
+ Me(c, f);
1936
1940
  return;
1937
1941
  } finally {
1938
1942
  ye(!1);
1939
1943
  }
1940
- }, ln = (c) => Oe({ file: c });
1944
+ }, cn = (c) => Oe({ file: c });
1941
1945
  let Le = [{
1942
1946
  label: a("Upload"),
1943
1947
  key: pe,
@@ -1955,7 +1959,7 @@ Select the appropriate plan to fulfil more requests`),
1955
1959
  children: [
1956
1960
  (0, r.jsx)("p", {
1957
1961
  className: "ant-upload-drag-icon",
1958
- children: (0, r.jsx)(T.EmIcons, { icon: "InboxOutlined" })
1962
+ children: (0, r.jsx)(F.EmIcons, { icon: "InboxOutlined" })
1959
1963
  }),
1960
1964
  (0, r.jsx)("p", {
1961
1965
  className: "ant-upload-text",
@@ -1966,16 +1970,16 @@ Select the appropriate plan to fulfil more requests`),
1966
1970
  children: a("Accepted formats: PNG, JPG, WEBP, SVG or GIF.")
1967
1971
  })
1968
1972
  ]
1969
- }), (0, r.jsx)(f.Form, {
1973
+ }), (0, r.jsx)(m.Form, {
1970
1974
  style: { padding: "0 2px 0 2px" },
1971
- children: (0, r.jsx)(f.Form.Item, {
1972
- validateStatus: P,
1973
- children: (0, r.jsx)(f.Input, {
1974
- ref: y,
1975
+ children: (0, r.jsx)(m.Form.Item, {
1976
+ validateStatus: k,
1977
+ children: (0, r.jsx)(m.Input, {
1978
+ ref: h,
1975
1979
  allowClear: !0,
1976
1980
  size: "large",
1977
1981
  placeholder: a("Paste image URL here"),
1978
- value: h,
1982
+ value: y,
1979
1983
  onChange: nn,
1980
1984
  spellCheck: "false"
1981
1985
  })
@@ -1991,13 +1995,13 @@ Select the appropriate plan to fulfil more requests`),
1991
1995
  style: { paddingBottom: 24 },
1992
1996
  children: (0, r.jsx)(Dt, {
1993
1997
  currentReq: ue,
1994
- setCurrentReq: _,
1998
+ setCurrentReq: Y,
1995
1999
  imageStockList: te,
1996
- setImageStockList: N,
2000
+ setImageStockList: G,
1997
2001
  setModalWidth: ie,
1998
2002
  setModalHeight: X,
1999
- setStockLink: z,
2000
- setCurrentImageLink: L,
2003
+ setStockLink: T,
2004
+ setCurrentImageLink: U,
2001
2005
  inputRef: ce,
2002
2006
  customRequest: Pe
2003
2007
  })
@@ -2015,9 +2019,9 @@ Select the appropriate plan to fulfil more requests`),
2015
2019
  setImageGifList: v,
2016
2020
  setModalWidth: ie,
2017
2021
  setModalHeight: X,
2018
- setStockLink: z,
2019
- setCurrentImageLink: L,
2020
- inputRef: F,
2022
+ setStockLink: T,
2023
+ setCurrentImageLink: U,
2024
+ inputRef: W,
2021
2025
  customRequest: Pe
2022
2026
  })
2023
2027
  })
@@ -2038,40 +2042,41 @@ Select the appropriate plan to fulfil more requests`),
2038
2042
  setIsLoadingAi: ut,
2039
2043
  aiTabRef: s,
2040
2044
  inputAiRef: Z,
2041
- isImageUploaded: I,
2042
- setIsImageUploaded: W
2045
+ isImageUploaded: E,
2046
+ setIsImageUploaded: I
2043
2047
  })
2044
2048
  })
2045
2049
  }), e.imageCenterEditorEnabled && Le.push({
2046
2050
  label: "",
2047
- key: we,
2051
+ key: Ae,
2048
2052
  children: (0, r.jsx)("div", {
2049
- ref: Q,
2053
+ ref: L,
2050
2054
  children: (0, r.jsx)(St, {
2051
- currentImageLink: w,
2052
- newLink: h,
2055
+ currentImageLink: C,
2056
+ newLink: y,
2053
2057
  previewDisplayUrl: tn,
2054
2058
  resolvedPreviewObjectUrl: $t,
2055
2059
  resolvedPreviewBlob: en,
2060
+ resolveImageBlob: sn,
2056
2061
  imageSize: ee,
2057
- onSave: ln,
2062
+ onSave: cn,
2058
2063
  uploadImageResultIsLoading: he || !1
2059
2064
  })
2060
2065
  })
2061
- }), (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)(f.Modal, {
2062
- width: G,
2066
+ }), (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)(m.Modal, {
2067
+ width: H,
2063
2068
  className: "image-center",
2064
2069
  title: a("Image Center"),
2065
2070
  style: { minHeight: 390 },
2066
- open: !!V,
2067
- onOk: Ye,
2068
- onCancel: an,
2069
- footer: M === we ? (0, r.jsx)(r.Fragment, {}) : null,
2070
- children: (0, r.jsx)(f.Spin, {
2071
+ open: !!Q,
2072
+ onOk: _e,
2073
+ onCancel: on,
2074
+ footer: M === Ae ? (0, r.jsx)(r.Fragment, {}) : null,
2075
+ children: (0, r.jsx)(m.Spin, {
2071
2076
  spinning: he,
2072
- children: (0, r.jsx)(f.Tabs, {
2077
+ children: (0, r.jsx)(m.Tabs, {
2073
2078
  activeKey: M,
2074
- onChange: on,
2079
+ onChange: ln,
2075
2080
  items: Le,
2076
2081
  className: "modal-tabs",
2077
2082
  style: {
@@ -2080,11 +2085,11 @@ Select the appropriate plan to fulfil more requests`),
2080
2085
  }
2081
2086
  })
2082
2087
  })
2083
- }), (0, r.jsx)(T.ModalToChangeConfigOnFree, {
2088
+ }), (0, r.jsx)(F.ModalToChangeConfigOnFree, {
2084
2089
  open: Xt,
2085
- onCancel: () => je(!1),
2090
+ onCancel: () => Ee(!1),
2086
2091
  initialSlide: Jt
2087
2092
  })] });
2088
2093
  };
2089
- lt.propTypes = { dataProvider: Ne.default.object }, vt.default = lt;
2094
+ lt.propTypes = { dataProvider: Te.default.object }, vt.default = lt;
2090
2095
  });