@emailmaker/emailmaker 1.1.43 → 1.1.45-alpha.1

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 (35) hide show
  1. package/emailmaker-core.7f77c8e5.js +663 -0
  2. package/emailmaker-esm.js +1587 -1384
  3. package/emailmaker.d.ts +8 -0
  4. package/emailmaker.js +4077 -3766
  5. package/iframe/js/amp.Op4DZt9X.js +1 -1
  6. package/iframe/js/iframe-eblock.js +1 -1
  7. package/iframe/js/iframe.js +1 -1
  8. package/iframe/js/rules.B-wCbIo7.js +1 -1
  9. package/npm-publish.manifest.json +57 -0
  10. package/package.json +2 -3
  11. package/singlepage_headless_plugin.html +1 -1
  12. package/static/core/{5235ce86.js → 1e9b3ac0.js} +158 -158
  13. package/static/core/{3aa157fc.js → 3061fb0a.js} +84 -84
  14. package/static/core/{b76b2f0e.js → 3684652a.js} +24 -24
  15. package/static/core/{4bd9eb47.js → 392598f0.js} +4368 -4050
  16. package/static/core/{817fa7b9.js → 39da69f4.js} +2846 -2642
  17. package/static/core/{2fc2fdef.js → 3b17491b.js} +3 -3
  18. package/static/core/{10304f0f.js → 41282200.js} +5996 -5988
  19. package/static/core/{b9218a7a.js → 56cdb425.js} +4 -4
  20. package/static/core/{7572b4092.js → 80fb5b6a2.js} +7 -7
  21. package/static/core/{855e2647.js → 87cde128.js} +2641 -2564
  22. package/static/core/{5734d163.js → a5701653.js} +21 -21
  23. package/static/core/{2f7f1bbb.js → b039deae.js} +3 -3
  24. package/static/core/{c197c069.js → c189c538.js} +76 -76
  25. package/static/core/{1a072c1f.js → e8d51fcb.js} +149 -149
  26. package/static/core/{2abd616a.js → f34c0a04.js} +3 -3
  27. package/static/core/{9053f080.js → f910bde1.js} +151 -146
  28. package/static/core/{c42188e4.js → fa02d83e.js} +7 -7
  29. package/static/esm/176b4cb2.js +131 -0
  30. package/static/esm/{b8792b4f.js → 705e2770.js} +907 -793
  31. package/two_step_headless_plugin.html +1 -1
  32. package/emailmaker-core.8b808ca0.js +0 -637
  33. package/static/esm/c951742a.js +0 -127
  34. /package/iframe/{iframe-eblock.8b808ca0.html → iframe-eblock.7f77c8e5.html} +0 -0
  35. /package/iframe/{iframe.8b808ca0.html → iframe.7f77c8e5.html} +0 -0
package/emailmaker-esm.js CHANGED
@@ -1,16 +1,16 @@
1
- import { a as Xr, c as lt, d as Rt, i as h, l as Pe, n as $r, o as Se, r as Nt, s as F, t as Wr, u as Bt } from "./static/esm/e21389f1.js";
2
- import { a as P, i as Lt, n as Ft, r as ke, t as O } from "./static/esm/c951742a.js";
3
- import { a as ae, i as jt, n as $, r as qt, t as W } from "./static/esm/b8792b4f.js";
4
- import { t as Ut } from "./static/esm/352121c5.js";
5
- import { useEffect as Ce, useMemo as st, useRef as Gt, useState as xe } from "@emailmaker/emailmaker/runtime/react";
1
+ import { a as Ri, c as ht, d as Zt, i as b, l as Me, n as Ni, o as we, r as en, s as q, t as Fi, u as tn } from "./static/esm/e21389f1.js";
2
+ import { a as k, i as nn, n as rn, r as De, t as R } from "./static/esm/176b4cb2.js";
3
+ import { a as de, i as an, n as Q, o as bt, r as on, t as K } from "./static/esm/705e2770.js";
4
+ import { t as ln } from "./static/esm/352121c5.js";
5
+ import { useEffect as Re, useMemo as yt, useRef as sn, useState as Ne } from "@emailmaker/emailmaker/runtime/react";
6
6
  (function() {
7
7
  "use strict";
8
- var t = window.__emailmaker__ = window.__emailmaker__ || {};
9
- t.__facadeSentinel = "@shared-runtime:init-complete", __emailmaker__.publicPath || (__emailmaker__.publicPath = (function() {
8
+ var e = window.__emailmaker__ = window.__emailmaker__ || {};
9
+ e.__facadeSentinel = "@shared-runtime:init-complete", __emailmaker__.publicPath || (__emailmaker__.publicPath = (function() {
10
10
  var s = (function() {
11
11
  if (typeof document < "u" && document.querySelector) try {
12
- var u = document.querySelector("script[src*=\"emailmaker-esm.js\"]") || document.querySelector("script[src*=\"emailmaker.js\"]");
13
- if (u && u.src) return u.src.substring(0, u.src.lastIndexOf("/") + 1);
12
+ var d = document.querySelector("script[src*=\"emailmaker-esm.js\"]") || document.querySelector("script[src*=\"emailmaker.js\"]");
13
+ if (d && d.src) return d.src.substring(0, d.src.lastIndexOf("/") + 1);
14
14
  } catch {}
15
15
  try {
16
16
  var E = import.meta.url;
@@ -22,8 +22,8 @@ import { useEffect as Ce, useMemo as st, useRef as Gt, useState as xe } from "@e
22
22
  try {
23
23
  var l = String(s);
24
24
  if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(l) || l.indexOf("//") === 0) return l;
25
- var d = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
26
- return d ? new URL(l, d).href : l;
25
+ var u = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
26
+ return u ? new URL(l, u).href : l;
27
27
  } catch {
28
28
  return String(s);
29
29
  }
@@ -31,12 +31,12 @@ import { useEffect as Ce, useMemo as st, useRef as Gt, useState as xe } from "@e
31
31
  var l = s == null ? "" : String(s);
32
32
  l || (l = "./");
33
33
  try {
34
- var d = l;
35
- if (!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(d) && d.indexOf("//") !== 0) {
36
- var u = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
37
- d = u ? new URL(d, u).href : d;
34
+ var u = l;
35
+ if (!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(u) && u.indexOf("//") !== 0) {
36
+ var d = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
37
+ u = d ? new URL(u, d).href : u;
38
38
  }
39
- __emailmaker__.publicPath = d.charAt(d.length - 1) === "/" ? d : d + "/";
39
+ __emailmaker__.publicPath = u.charAt(u.length - 1) === "/" ? u : u + "/";
40
40
  } catch {
41
41
  __emailmaker__.publicPath = l;
42
42
  }
@@ -45,79 +45,79 @@ import { useEffect as Ce, useMemo as st, useRef as Gt, useState as xe } from "@e
45
45
  var s = String(__emailmaker__.publicPath || "");
46
46
  if (s.indexOf("file:") !== 0 && !(s && s !== "./")) try {
47
47
  if (typeof window < "u") {
48
- for (var d in window) if (!(d === "__emailmaker__" || !/^__[^_].*__$/.test(d))) {
49
- var u;
48
+ for (var u in window) if (!(u === "__emailmaker__" || !/^__[^_].*__$/.test(u))) {
49
+ var d;
50
50
  try {
51
- u = window[d];
51
+ d = window[u];
52
52
  } catch {
53
53
  continue;
54
54
  }
55
- if (u && typeof u == "object" && u.publicPath) {
56
- "" + d;
55
+ if (d && typeof d == "object" && d.publicPath) {
56
+ "" + u;
57
57
  break;
58
58
  }
59
59
  }
60
60
  }
61
61
  } catch {}
62
62
  })()), __emailmaker__.assetUrl || (__emailmaker__.assetUrl = function(s) {
63
- function l(I) {
63
+ function l(w) {
64
64
  try {
65
- var N = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
66
- return N ? new URL(String(I || ""), N).href : String(I || "");
65
+ var L = typeof document < "u" && document.baseURI ? document.baseURI : typeof window < "u" && window.location ? window.location.href : "";
66
+ return L ? new URL(String(w || ""), L).href : String(w || "");
67
67
  } catch {
68
- return String(I || "");
68
+ return String(w || "");
69
69
  }
70
70
  }
71
- var d = String(s || "");
72
- if (!d) return "";
73
- if (/^(?:data:|blob:)/.test(d)) return d;
74
- if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(d) || d.indexOf("//") === 0 || d.charAt(0) === "/") return l(d);
75
- var u = d.replace(/^\.\/+/, "").replace(/^\/+/, ""), E = "static/media".replace(/^\.\/+/, "").replace(/^\/+/, "").replace(/\/+$/, ""), g = E && u.indexOf(E + "/") !== 0 ? E + "/" + u : u, b = __emailmaker__.publicPath || "./";
71
+ var u = String(s || "");
72
+ if (!u) return "";
73
+ if (/^(?:data:|blob:)/.test(u)) return u;
74
+ if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(u) || u.indexOf("//") === 0 || u.charAt(0) === "/") return l(u);
75
+ var d = u.replace(/^\.\/+/, "").replace(/^\/+/, ""), E = "static/media".replace(/^\.\/+/, "").replace(/^\/+/, "").replace(/\/+$/, ""), g = E && d.indexOf(E + "/") !== 0 ? E + "/" + d : d, h = __emailmaker__.publicPath || "./";
76
76
  try {
77
- return new URL(g, b).href;
77
+ return new URL(g, h).href;
78
78
  } catch {
79
- return b.slice(-1) !== "/" && (b += "/"), l(b + g);
79
+ return h.slice(-1) !== "/" && (h += "/"), l(h + g);
80
80
  }
81
- }), t.version || (t.version = "1.1.43");
82
- var e = t.modules = /* @__PURE__ */ Object.create(null), n = import("./runtime/index.js"), r = import("./ui-kit/index.js");
83
- e.React = n.then(function(s) {
81
+ }), e.version || (e.version = "1.1.45-alpha.1");
82
+ var t = e.modules = /* @__PURE__ */ Object.create(null), n = import("./runtime/index.js"), r = import("./ui-kit/index.js");
83
+ t.React = n.then(function(s) {
84
84
  return s.React;
85
- }), e.ReactDom = n.then(function(s) {
85
+ }), t.ReactDom = n.then(function(s) {
86
86
  return s.ReactDom;
87
- }), e.ReactDomClient = n.then(function(s) {
87
+ }), t.ReactDomClient = n.then(function(s) {
88
88
  return s.ReactDomClient;
89
- }), e.ReactJsxRuntime = n.then(function(s) {
89
+ }), t.ReactJsxRuntime = n.then(function(s) {
90
90
  return s.ReactJsxRuntime;
91
- }), e.ReactJsxDevRuntime = n.then(function(s) {
91
+ }), t.ReactJsxDevRuntime = n.then(function(s) {
92
92
  return s.ReactJsxDevRuntime;
93
- }), e.PropTypes = n.then(function(s) {
93
+ }), t.PropTypes = n.then(function(s) {
94
94
  return s.PropTypes;
95
- }), e.ReactRouterDom = n.then(function(s) {
95
+ }), t.ReactRouterDom = n.then(function(s) {
96
96
  return s.ReactRouterDom;
97
- }), e.Antd = n.then(function(s) {
97
+ }), t.Antd = n.then(function(s) {
98
98
  return s.Antd;
99
- }), e.AntDesignIcons = n.then(function(s) {
99
+ }), t.AntDesignIcons = n.then(function(s) {
100
100
  return s.AntDesignIcons;
101
- }), e.AntDesignCssinjs = n.then(function(s) {
101
+ }), t.AntDesignCssinjs = n.then(function(s) {
102
102
  return s.AntDesignCssinjs;
103
- }), e.Classnames = n.then(function(s) {
103
+ }), t.Classnames = n.then(function(s) {
104
104
  return s.Classnames;
105
- }), e.Dayjs = n.then(function(s) {
105
+ }), t.Dayjs = n.then(function(s) {
106
106
  return s.Dayjs;
107
- }), e.Uuid = n.then(function(s) {
107
+ }), t.Uuid = n.then(function(s) {
108
108
  return s.Uuid;
109
- }), e.UiKit = r.then(function(s) {
109
+ }), t.UiKit = r.then(function(s) {
110
110
  return s.UiKit !== void 0 ? s.UiKit : s;
111
111
  });
112
112
  var i = Promise.all([n, r]).then(function(s) {
113
- var l = s[0] || /* @__PURE__ */ Object.create(null), d = /* @__PURE__ */ Object.create(null);
114
- for (var u in l) Object.prototype.hasOwnProperty.call(l, u) && (d[u] = l[u]);
113
+ var l = s[0] || /* @__PURE__ */ Object.create(null), u = /* @__PURE__ */ Object.create(null);
114
+ for (var d in l) Object.prototype.hasOwnProperty.call(l, d) && (u[d] = l[d]);
115
115
  var E = s[1] || /* @__PURE__ */ Object.create(null);
116
- d.UiKit = E.UiKit !== void 0 ? E.UiKit : E;
117
- for (var g in d) Object.prototype.hasOwnProperty.call(d, g) && (e[g] = d[g]);
118
- return d;
119
- }), a = e, o = i;
120
- if (typeof t.define != "function") new Function("__amdEnv", `/**
116
+ u.UiKit = E.UiKit !== void 0 ? E.UiKit : E;
117
+ for (var g in u) Object.prototype.hasOwnProperty.call(u, g) && (t[g] = u[g]);
118
+ return u;
119
+ }), a = t, o = i;
120
+ if (typeof e.define != "function") new Function("__amdEnv", `/**
121
121
  * Async AMD Loader (IIFE version for injection)
122
122
  *
123
123
  * This file is injected at the beginning of iframe entry points.
@@ -788,365 +788,365 @@ import { useEffect as Ce, useMemo as st, useRef as Gt, useState as xe } from "@e
788
788
  __amdEnv.require = require;
789
789
  __amdEnv.syncRequire = syncRequire;
790
790
  })();
791
- `)(t), typeof t.require == "function" && typeof t.require.config == "function" && t.require.config({
791
+ `)(e), typeof e.require == "function" && typeof e.require.config == "function" && e.require.config({
792
792
  baseUrl: "./",
793
- paths: { core: "emailmaker-core.8b808ca0.js" }
793
+ paths: { core: "emailmaker-core.7f77c8e5.js" }
794
794
  });
795
- var m = typeof t.prefetch == "function" ? t.prefetch : void 0;
796
- if (t.prefetch = function() {
795
+ var m = typeof e.prefetch == "function" ? e.prefetch : void 0;
796
+ if (e.prefetch = function() {
797
797
  return i.then(function() {
798
- if (typeof m == "function") return m.call(t);
798
+ if (typeof m == "function") return m.call(e);
799
799
  });
800
- }, typeof t.define == "function") {
800
+ }, typeof e.define == "function") {
801
801
  let s = function(l) {
802
802
  if (!l || typeof l != "object" && typeof l != "function" || l.__esModule) return l;
803
803
  if (p) {
804
- var d = p.get(l);
805
- if (d) return d;
804
+ var u = p.get(l);
805
+ if (u) return u;
806
806
  }
807
- var u = /* @__PURE__ */ Object.create(null);
808
- Object.defineProperties(u, {
807
+ var d = /* @__PURE__ */ Object.create(null);
808
+ Object.defineProperties(d, {
809
809
  __esModule: { value: !0 },
810
810
  [Symbol.toStringTag]: { value: "Module" }
811
811
  });
812
812
  for (var E = Reflect.ownKeys(l), g = 0; g < E.length; g++) {
813
- var b = E[g];
814
- if (b !== "__esModule") {
815
- var I = Object.getOwnPropertyDescriptor(l, b);
816
- I && Object.defineProperty(u, b, I);
813
+ var h = E[g];
814
+ if (h !== "__esModule") {
815
+ var w = Object.getOwnPropertyDescriptor(l, h);
816
+ w && Object.defineProperty(d, h, w);
817
817
  }
818
818
  }
819
- return Object.prototype.hasOwnProperty.call(u, "default") || Object.defineProperty(u, "default", {
819
+ return Object.prototype.hasOwnProperty.call(d, "default") || Object.defineProperty(d, "default", {
820
820
  enumerable: !0,
821
821
  value: l,
822
822
  writable: !1
823
- }), p && p.set(l, u), u;
823
+ }), p && p.set(l, d), d;
824
824
  };
825
825
  var p = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : null;
826
- t.define("react", [], function() {
826
+ e.define("react", [], function() {
827
827
  var l = a.React;
828
- return l && typeof l.then == "function" ? o.then(function(d) {
829
- var u = d.React;
830
- return s(u);
831
- }) : l !== void 0 ? s(l) : o.then(function(d) {
832
- var u = d.React;
833
- return s(u);
828
+ return l && typeof l.then == "function" ? o.then(function(u) {
829
+ var d = u.React;
830
+ return s(d);
831
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
832
+ var d = u.React;
833
+ return s(d);
834
834
  });
835
- }), t.define("@emailmaker/emailmaker/runtime/react", [], function() {
835
+ }), e.define("@emailmaker/emailmaker/runtime/react", [], function() {
836
836
  var l = a.React;
837
- return l && typeof l.then == "function" ? o.then(function(d) {
838
- var u = d.React;
839
- return s(u);
840
- }) : l !== void 0 ? s(l) : o.then(function(d) {
841
- var u = d.React;
842
- return s(u);
837
+ return l && typeof l.then == "function" ? o.then(function(u) {
838
+ var d = u.React;
839
+ return s(d);
840
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
841
+ var d = u.React;
842
+ return s(d);
843
843
  });
844
- }), t.define("react-dom", [], function() {
844
+ }), e.define("react-dom", [], function() {
845
845
  var l = a.ReactDom;
846
- return l && typeof l.then == "function" ? o.then(function(d) {
847
- var u = d.ReactDom;
848
- return s(u);
849
- }) : l !== void 0 ? s(l) : o.then(function(d) {
850
- var u = d.ReactDom;
851
- return s(u);
846
+ return l && typeof l.then == "function" ? o.then(function(u) {
847
+ var d = u.ReactDom;
848
+ return s(d);
849
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
850
+ var d = u.ReactDom;
851
+ return s(d);
852
852
  });
853
- }), t.define("@emailmaker/emailmaker/runtime/react-dom", [], function() {
853
+ }), e.define("@emailmaker/emailmaker/runtime/react-dom", [], function() {
854
854
  var l = a.ReactDom;
855
- return l && typeof l.then == "function" ? o.then(function(d) {
856
- var u = d.ReactDom;
857
- return s(u);
858
- }) : l !== void 0 ? s(l) : o.then(function(d) {
859
- var u = d.ReactDom;
860
- return s(u);
855
+ return l && typeof l.then == "function" ? o.then(function(u) {
856
+ var d = u.ReactDom;
857
+ return s(d);
858
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
859
+ var d = u.ReactDom;
860
+ return s(d);
861
861
  });
862
- }), t.define("react-dom/client", [], function() {
862
+ }), e.define("react-dom/client", [], function() {
863
863
  var l = a.ReactDomClient;
864
- return l && typeof l.then == "function" ? o.then(function(d) {
865
- var u = d.ReactDomClient;
866
- return s(u);
867
- }) : l !== void 0 ? s(l) : o.then(function(d) {
868
- var u = d.ReactDomClient;
869
- return s(u);
864
+ return l && typeof l.then == "function" ? o.then(function(u) {
865
+ var d = u.ReactDomClient;
866
+ return s(d);
867
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
868
+ var d = u.ReactDomClient;
869
+ return s(d);
870
870
  });
871
- }), t.define("@emailmaker/emailmaker/runtime/react-dom/client", [], function() {
871
+ }), e.define("@emailmaker/emailmaker/runtime/react-dom/client", [], function() {
872
872
  var l = a.ReactDomClient;
873
- return l && typeof l.then == "function" ? o.then(function(d) {
874
- var u = d.ReactDomClient;
875
- return s(u);
876
- }) : l !== void 0 ? s(l) : o.then(function(d) {
877
- var u = d.ReactDomClient;
878
- return s(u);
873
+ return l && typeof l.then == "function" ? o.then(function(u) {
874
+ var d = u.ReactDomClient;
875
+ return s(d);
876
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
877
+ var d = u.ReactDomClient;
878
+ return s(d);
879
879
  });
880
- }), t.define("react/jsx-runtime", [], function() {
880
+ }), e.define("react/jsx-runtime", [], function() {
881
881
  var l = a.ReactJsxRuntime;
882
- return l && typeof l.then == "function" ? o.then(function(d) {
883
- var u = d.ReactJsxRuntime;
884
- return s(u);
885
- }) : l !== void 0 ? s(l) : o.then(function(d) {
886
- var u = d.ReactJsxRuntime;
887
- return s(u);
882
+ return l && typeof l.then == "function" ? o.then(function(u) {
883
+ var d = u.ReactJsxRuntime;
884
+ return s(d);
885
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
886
+ var d = u.ReactJsxRuntime;
887
+ return s(d);
888
888
  });
889
- }), t.define("@emailmaker/emailmaker/runtime/react/jsx-runtime", [], function() {
889
+ }), e.define("@emailmaker/emailmaker/runtime/react/jsx-runtime", [], function() {
890
890
  var l = a.ReactJsxRuntime;
891
- return l && typeof l.then == "function" ? o.then(function(d) {
892
- var u = d.ReactJsxRuntime;
893
- return s(u);
894
- }) : l !== void 0 ? s(l) : o.then(function(d) {
895
- var u = d.ReactJsxRuntime;
896
- return s(u);
891
+ return l && typeof l.then == "function" ? o.then(function(u) {
892
+ var d = u.ReactJsxRuntime;
893
+ return s(d);
894
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
895
+ var d = u.ReactJsxRuntime;
896
+ return s(d);
897
897
  });
898
- }), t.define("react/jsx-dev-runtime", [], function() {
898
+ }), e.define("react/jsx-dev-runtime", [], function() {
899
899
  var l = a.ReactJsxDevRuntime;
900
- return l && typeof l.then == "function" ? o.then(function(d) {
901
- var u = d.ReactJsxDevRuntime;
902
- return s(u);
903
- }) : l !== void 0 ? s(l) : o.then(function(d) {
904
- var u = d.ReactJsxDevRuntime;
905
- return s(u);
900
+ return l && typeof l.then == "function" ? o.then(function(u) {
901
+ var d = u.ReactJsxDevRuntime;
902
+ return s(d);
903
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
904
+ var d = u.ReactJsxDevRuntime;
905
+ return s(d);
906
906
  });
907
- }), t.define("@emailmaker/emailmaker/runtime/react/jsx-dev-runtime", [], function() {
907
+ }), e.define("@emailmaker/emailmaker/runtime/react/jsx-dev-runtime", [], function() {
908
908
  var l = a.ReactJsxDevRuntime;
909
- return l && typeof l.then == "function" ? o.then(function(d) {
910
- var u = d.ReactJsxDevRuntime;
911
- return s(u);
912
- }) : l !== void 0 ? s(l) : o.then(function(d) {
913
- var u = d.ReactJsxDevRuntime;
914
- return s(u);
909
+ return l && typeof l.then == "function" ? o.then(function(u) {
910
+ var d = u.ReactJsxDevRuntime;
911
+ return s(d);
912
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
913
+ var d = u.ReactJsxDevRuntime;
914
+ return s(d);
915
915
  });
916
- }), t.define("prop-types", [], function() {
916
+ }), e.define("prop-types", [], function() {
917
917
  var l = a.PropTypes;
918
- return l && typeof l.then == "function" ? o.then(function(d) {
919
- var u = d.PropTypes;
920
- return s(u);
921
- }) : l !== void 0 ? s(l) : o.then(function(d) {
922
- var u = d.PropTypes;
923
- return s(u);
918
+ return l && typeof l.then == "function" ? o.then(function(u) {
919
+ var d = u.PropTypes;
920
+ return s(d);
921
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
922
+ var d = u.PropTypes;
923
+ return s(d);
924
924
  });
925
- }), t.define("@emailmaker/emailmaker/runtime/prop-types", [], function() {
925
+ }), e.define("@emailmaker/emailmaker/runtime/prop-types", [], function() {
926
926
  var l = a.PropTypes;
927
- return l && typeof l.then == "function" ? o.then(function(d) {
928
- var u = d.PropTypes;
929
- return s(u);
930
- }) : l !== void 0 ? s(l) : o.then(function(d) {
931
- var u = d.PropTypes;
932
- return s(u);
927
+ return l && typeof l.then == "function" ? o.then(function(u) {
928
+ var d = u.PropTypes;
929
+ return s(d);
930
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
931
+ var d = u.PropTypes;
932
+ return s(d);
933
933
  });
934
- }), t.define("react-router-dom", [], function() {
934
+ }), e.define("react-router-dom", [], function() {
935
935
  var l = a.ReactRouterDom;
936
- return l && typeof l.then == "function" ? o.then(function(d) {
937
- var u = d.ReactRouterDom;
938
- return s(u);
939
- }) : l !== void 0 ? s(l) : o.then(function(d) {
940
- var u = d.ReactRouterDom;
941
- return s(u);
936
+ return l && typeof l.then == "function" ? o.then(function(u) {
937
+ var d = u.ReactRouterDom;
938
+ return s(d);
939
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
940
+ var d = u.ReactRouterDom;
941
+ return s(d);
942
942
  });
943
- }), t.define("@emailmaker/emailmaker/runtime/react-router-dom", [], function() {
943
+ }), e.define("@emailmaker/emailmaker/runtime/react-router-dom", [], function() {
944
944
  var l = a.ReactRouterDom;
945
- return l && typeof l.then == "function" ? o.then(function(d) {
946
- var u = d.ReactRouterDom;
947
- return s(u);
948
- }) : l !== void 0 ? s(l) : o.then(function(d) {
949
- var u = d.ReactRouterDom;
950
- return s(u);
945
+ return l && typeof l.then == "function" ? o.then(function(u) {
946
+ var d = u.ReactRouterDom;
947
+ return s(d);
948
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
949
+ var d = u.ReactRouterDom;
950
+ return s(d);
951
951
  });
952
- }), t.define("antd", [], function() {
952
+ }), e.define("antd", [], function() {
953
953
  var l = a.Antd;
954
- return l && typeof l.then == "function" ? o.then(function(d) {
955
- var u = d.Antd;
956
- return s(u);
957
- }) : l !== void 0 ? s(l) : o.then(function(d) {
958
- var u = d.Antd;
959
- return s(u);
954
+ return l && typeof l.then == "function" ? o.then(function(u) {
955
+ var d = u.Antd;
956
+ return s(d);
957
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
958
+ var d = u.Antd;
959
+ return s(d);
960
960
  });
961
- }), t.define("@emailmaker/emailmaker/runtime/antd", [], function() {
961
+ }), e.define("@emailmaker/emailmaker/runtime/antd", [], function() {
962
962
  var l = a.Antd;
963
- return l && typeof l.then == "function" ? o.then(function(d) {
964
- var u = d.Antd;
965
- return s(u);
966
- }) : l !== void 0 ? s(l) : o.then(function(d) {
967
- var u = d.Antd;
968
- return s(u);
963
+ return l && typeof l.then == "function" ? o.then(function(u) {
964
+ var d = u.Antd;
965
+ return s(d);
966
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
967
+ var d = u.Antd;
968
+ return s(d);
969
969
  });
970
- }), t.define("@ant-design/icons", [], function() {
970
+ }), e.define("@ant-design/icons", [], function() {
971
971
  var l = a.AntDesignIcons;
972
- return l && typeof l.then == "function" ? o.then(function(d) {
973
- var u = d.AntDesignIcons;
974
- return s(u);
975
- }) : l !== void 0 ? s(l) : o.then(function(d) {
976
- var u = d.AntDesignIcons;
977
- return s(u);
972
+ return l && typeof l.then == "function" ? o.then(function(u) {
973
+ var d = u.AntDesignIcons;
974
+ return s(d);
975
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
976
+ var d = u.AntDesignIcons;
977
+ return s(d);
978
978
  });
979
- }), t.define("@emailmaker/emailmaker/runtime/@ant-design/icons", [], function() {
979
+ }), e.define("@emailmaker/emailmaker/runtime/@ant-design/icons", [], function() {
980
980
  var l = a.AntDesignIcons;
981
- return l && typeof l.then == "function" ? o.then(function(d) {
982
- var u = d.AntDesignIcons;
983
- return s(u);
984
- }) : l !== void 0 ? s(l) : o.then(function(d) {
985
- var u = d.AntDesignIcons;
986
- return s(u);
981
+ return l && typeof l.then == "function" ? o.then(function(u) {
982
+ var d = u.AntDesignIcons;
983
+ return s(d);
984
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
985
+ var d = u.AntDesignIcons;
986
+ return s(d);
987
987
  });
988
- }), t.define("@ant-design/cssinjs", [], function() {
988
+ }), e.define("@ant-design/cssinjs", [], function() {
989
989
  var l = a.AntDesignCssinjs;
990
- return l && typeof l.then == "function" ? o.then(function(d) {
991
- var u = d.AntDesignCssinjs;
992
- return s(u);
993
- }) : l !== void 0 ? s(l) : o.then(function(d) {
994
- var u = d.AntDesignCssinjs;
995
- return s(u);
990
+ return l && typeof l.then == "function" ? o.then(function(u) {
991
+ var d = u.AntDesignCssinjs;
992
+ return s(d);
993
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
994
+ var d = u.AntDesignCssinjs;
995
+ return s(d);
996
996
  });
997
- }), t.define("@emailmaker/emailmaker/runtime/@ant-design/cssinjs", [], function() {
997
+ }), e.define("@emailmaker/emailmaker/runtime/@ant-design/cssinjs", [], function() {
998
998
  var l = a.AntDesignCssinjs;
999
- return l && typeof l.then == "function" ? o.then(function(d) {
1000
- var u = d.AntDesignCssinjs;
1001
- return s(u);
1002
- }) : l !== void 0 ? s(l) : o.then(function(d) {
1003
- var u = d.AntDesignCssinjs;
1004
- return s(u);
999
+ return l && typeof l.then == "function" ? o.then(function(u) {
1000
+ var d = u.AntDesignCssinjs;
1001
+ return s(d);
1002
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
1003
+ var d = u.AntDesignCssinjs;
1004
+ return s(d);
1005
1005
  });
1006
- }), t.define("classnames", [], function() {
1006
+ }), e.define("classnames", [], function() {
1007
1007
  var l = a.Classnames;
1008
- return l && typeof l.then == "function" ? o.then(function(d) {
1009
- var u = d.Classnames;
1010
- return s(u);
1011
- }) : l !== void 0 ? s(l) : o.then(function(d) {
1012
- var u = d.Classnames;
1013
- return s(u);
1008
+ return l && typeof l.then == "function" ? o.then(function(u) {
1009
+ var d = u.Classnames;
1010
+ return s(d);
1011
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
1012
+ var d = u.Classnames;
1013
+ return s(d);
1014
1014
  });
1015
- }), t.define("@emailmaker/emailmaker/runtime/classnames", [], function() {
1015
+ }), e.define("@emailmaker/emailmaker/runtime/classnames", [], function() {
1016
1016
  var l = a.Classnames;
1017
- return l && typeof l.then == "function" ? o.then(function(d) {
1018
- var u = d.Classnames;
1019
- return s(u);
1020
- }) : l !== void 0 ? s(l) : o.then(function(d) {
1021
- var u = d.Classnames;
1022
- return s(u);
1017
+ return l && typeof l.then == "function" ? o.then(function(u) {
1018
+ var d = u.Classnames;
1019
+ return s(d);
1020
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
1021
+ var d = u.Classnames;
1022
+ return s(d);
1023
1023
  });
1024
- }), t.define("dayjs", [], function() {
1024
+ }), e.define("dayjs", [], function() {
1025
1025
  var l = a.Dayjs;
1026
- return l && typeof l.then == "function" ? o.then(function(d) {
1027
- var u = d.Dayjs;
1028
- return s(u);
1029
- }) : l !== void 0 ? s(l) : o.then(function(d) {
1030
- var u = d.Dayjs;
1031
- return s(u);
1026
+ return l && typeof l.then == "function" ? o.then(function(u) {
1027
+ var d = u.Dayjs;
1028
+ return s(d);
1029
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
1030
+ var d = u.Dayjs;
1031
+ return s(d);
1032
1032
  });
1033
- }), t.define("@emailmaker/emailmaker/runtime/dayjs", [], function() {
1033
+ }), e.define("@emailmaker/emailmaker/runtime/dayjs", [], function() {
1034
1034
  var l = a.Dayjs;
1035
- return l && typeof l.then == "function" ? o.then(function(d) {
1036
- var u = d.Dayjs;
1037
- return s(u);
1038
- }) : l !== void 0 ? s(l) : o.then(function(d) {
1039
- var u = d.Dayjs;
1040
- return s(u);
1035
+ return l && typeof l.then == "function" ? o.then(function(u) {
1036
+ var d = u.Dayjs;
1037
+ return s(d);
1038
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
1039
+ var d = u.Dayjs;
1040
+ return s(d);
1041
1041
  });
1042
- }), t.define("uuid", [], function() {
1042
+ }), e.define("uuid", [], function() {
1043
1043
  var l = a.Uuid;
1044
- return l && typeof l.then == "function" ? o.then(function(d) {
1045
- var u = d.Uuid;
1046
- return s(u);
1047
- }) : l !== void 0 ? s(l) : o.then(function(d) {
1048
- var u = d.Uuid;
1049
- return s(u);
1044
+ return l && typeof l.then == "function" ? o.then(function(u) {
1045
+ var d = u.Uuid;
1046
+ return s(d);
1047
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
1048
+ var d = u.Uuid;
1049
+ return s(d);
1050
1050
  });
1051
- }), t.define("@emailmaker/emailmaker/runtime/uuid", [], function() {
1051
+ }), e.define("@emailmaker/emailmaker/runtime/uuid", [], function() {
1052
1052
  var l = a.Uuid;
1053
- return l && typeof l.then == "function" ? o.then(function(d) {
1054
- var u = d.Uuid;
1055
- return s(u);
1056
- }) : l !== void 0 ? s(l) : o.then(function(d) {
1057
- var u = d.Uuid;
1058
- return s(u);
1053
+ return l && typeof l.then == "function" ? o.then(function(u) {
1054
+ var d = u.Uuid;
1055
+ return s(d);
1056
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
1057
+ var d = u.Uuid;
1058
+ return s(d);
1059
1059
  });
1060
- }), t.define("@emailmaker/ui-kit", [], function() {
1060
+ }), e.define("@emailmaker/ui-kit", [], function() {
1061
1061
  var l = a.UiKit;
1062
- return l && typeof l.then == "function" ? o.then(function(d) {
1063
- var u = d.UiKit;
1064
- return s(u);
1065
- }) : l !== void 0 ? s(l) : o.then(function(d) {
1066
- var u = d.UiKit;
1067
- return s(u);
1062
+ return l && typeof l.then == "function" ? o.then(function(u) {
1063
+ var d = u.UiKit;
1064
+ return s(d);
1065
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
1066
+ var d = u.UiKit;
1067
+ return s(d);
1068
1068
  });
1069
- }), t.define("@emailmaker/emailmaker/ui-kit", [], function() {
1069
+ }), e.define("@emailmaker/emailmaker/ui-kit", [], function() {
1070
1070
  var l = a.UiKit;
1071
- return l && typeof l.then == "function" ? o.then(function(d) {
1072
- var u = d.UiKit;
1073
- return s(u);
1074
- }) : l !== void 0 ? s(l) : o.then(function(d) {
1075
- var u = d.UiKit;
1076
- return s(u);
1071
+ return l && typeof l.then == "function" ? o.then(function(u) {
1072
+ var d = u.UiKit;
1073
+ return s(d);
1074
+ }) : l !== void 0 ? s(l) : o.then(function(u) {
1075
+ var d = u.UiKit;
1076
+ return s(d);
1077
1077
  });
1078
1078
  });
1079
1079
  }
1080
1080
  globalThis.__SHARED_RUNTIME_INIT_SENTINEL__ = "@shared-runtime:init-complete";
1081
1081
  })();
1082
- var se = null, zt = "core";
1083
- function Vt() {
1084
- return typeof window.__emailmaker__?.require != "function" ? Promise.reject(/* @__PURE__ */ new Error("[loadEngine] AMD loader is unavailable")) : new Promise((t, e) => {
1085
- window.__emailmaker__.require([zt], (n) => t(n), (n) => e(n instanceof Error ? n : /* @__PURE__ */ new Error("[loadEngine] Failed to require core module")));
1082
+ var me = null, un = "core";
1083
+ function dn() {
1084
+ return typeof window.__emailmaker__?.require != "function" ? Promise.reject(/* @__PURE__ */ new Error("[loadEngine] AMD loader is unavailable")) : new Promise((e, t) => {
1085
+ window.__emailmaker__.require([un], (n) => e(n), (n) => t(n instanceof Error ? n : /* @__PURE__ */ new Error("[loadEngine] Failed to require core module")));
1086
1086
  });
1087
1087
  }
1088
- function Me() {
1089
- return se || (se = Vt()), se;
1088
+ function Fe() {
1089
+ return me || (me = dn()), me;
1090
1090
  }
1091
- var de = null, ue = null;
1092
- async function Ht(t) {
1093
- typeof t?.prefetch == "function" && await t.prefetch();
1091
+ var pe = null, _e = null;
1092
+ async function cn(e) {
1093
+ typeof e?.prefetch == "function" && await e.prefetch();
1094
1094
  }
1095
- function dt() {
1096
- return de || (de = Me().then(() => {})), de;
1095
+ function vt() {
1096
+ return pe || (pe = Fe().then(() => {})), pe;
1097
1097
  }
1098
- function De(t) {
1099
- return ue || (ue = Ht(t)), ue;
1098
+ function Le(e) {
1099
+ return _e || (_e = cn(e)), _e;
1100
1100
  }
1101
- function ut(t) {
1102
- return Promise.all([dt(), De(t)]).then(() => {});
1101
+ function St(e) {
1102
+ return Promise.all([vt(), Le(e)]).then(() => {});
1103
1103
  }
1104
- function Xt(t) {
1105
- const e = t?.startupPrefetchMode;
1106
- return e === "eager" || e === "idle" || e === "manual" || e === "off" ? e : "eager";
1104
+ function fn(e) {
1105
+ const t = e?.startupPrefetchMode;
1106
+ return t === "eager" || t === "idle" || t === "manual" || t === "off" ? t : "eager";
1107
1107
  }
1108
- function ce(t) {
1109
- Promise.resolve().then(() => ut(t)).catch(() => {});
1108
+ function Ee(e) {
1109
+ Promise.resolve().then(() => St(e)).catch(() => {});
1110
1110
  }
1111
- function $t(t) {
1112
- Promise.resolve().then(() => De(t)).catch(() => {});
1111
+ function mn(e) {
1112
+ Promise.resolve().then(() => Le(e)).catch(() => {});
1113
1113
  }
1114
- function Wt(t) {
1115
- const e = Xt(t);
1116
- if (e === "eager") ce(t);
1117
- else if (e === "idle") {
1114
+ function pn(e) {
1115
+ const t = fn(e);
1116
+ if (t === "eager") Ee(e);
1117
+ else if (t === "idle") {
1118
1118
  const n = window.requestIdleCallback;
1119
- typeof n == "function" ? n(() => ce(t), { timeout: 1500 }) : setTimeout(() => ce(t), 0);
1119
+ typeof n == "function" ? n(() => Ee(e), { timeout: 1500 }) : setTimeout(() => Ee(e), 0);
1120
1120
  }
1121
1121
  }
1122
- var H = /* @__PURE__ */ new WeakMap(), Qt = "data-emailmaker-config-styles";
1123
- function Kt(t) {
1124
- return typeof t == "string" ? t.trim() : "";
1122
+ var $ = /* @__PURE__ */ new WeakMap(), _n = "data-emailmaker-config-styles";
1123
+ function En(e) {
1124
+ return typeof e == "string" ? e.trim() : "";
1125
1125
  }
1126
- function Ue(t, e) {
1127
- if (t.firstChild) {
1128
- t.insertBefore(e, t.firstChild);
1126
+ function Xe(e, t) {
1127
+ if (e.firstChild) {
1128
+ e.insertBefore(t, e.firstChild);
1129
1129
  return;
1130
1130
  }
1131
- t.appendChild(e);
1131
+ e.appendChild(t);
1132
1132
  }
1133
- function Jt(t, e, n) {
1134
- if (!t || typeof document > "u") return null;
1135
- const r = Kt(e), i = H.get(t), a = n || t;
1136
- if (!r) return i && (i.remove(), H.delete(t)), null;
1137
- if (i) return i.textContent !== r && (i.textContent = r), (i.parentNode !== a || i !== a.firstChild) && Ue(a, i), i;
1133
+ function gn(e, t, n) {
1134
+ if (!e || typeof document > "u") return null;
1135
+ const r = En(t), i = $.get(e), a = n || e;
1136
+ if (!r) return i && (i.remove(), $.delete(e)), null;
1137
+ if (i) return i.textContent !== r && (i.textContent = r), (i.parentNode !== a || i !== a.firstChild) && Xe(a, i), i;
1138
1138
  const o = document.createElement("style");
1139
- return o.setAttribute(Qt, "true"), o.textContent = r, Ue(a, o), H.set(t, o), o;
1139
+ return o.setAttribute(_n, "true"), o.textContent = r, Xe(a, o), $.set(e, o), o;
1140
1140
  }
1141
- function Yt(t) {
1142
- if (!t) return;
1143
- const e = H.get(t);
1144
- e && (e.remove(), H.delete(t));
1141
+ function hn(e) {
1142
+ if (!e) return;
1143
+ const t = $.get(e);
1144
+ t && (t.remove(), $.delete(e));
1145
1145
  }
1146
- function ct() {
1146
+ function At() {
1147
1147
  return !1;
1148
1148
  }
1149
- var Zt = `
1149
+ var bn = `
1150
1150
  .blocks-app-initial-spinner-wrapper {
1151
1151
  width: 100%;
1152
1152
  height: 100%;
@@ -1176,12 +1176,12 @@ var Zt = `
1176
1176
  transform: rotate(360deg);
1177
1177
  }
1178
1178
  }`;
1179
- function en() {
1179
+ function yn() {
1180
1180
  return () => {};
1181
1181
  }
1182
- function tn(t, e) {
1183
- if (!ct() || !t || typeof document > "u") return en();
1184
- t.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((o) => {
1182
+ function vn(e, t) {
1183
+ if (!At() || !e || typeof document > "u") return yn();
1184
+ e.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((o) => {
1185
1185
  o.remove();
1186
1186
  });
1187
1187
  const n = document.createElement("div");
@@ -1189,286 +1189,343 @@ function tn(t, e) {
1189
1189
  const r = document.createElement("div");
1190
1190
  r.classList.add("blocks-app-initial-spinner"), n.appendChild(r);
1191
1191
  const i = document.createElement("style");
1192
- i.setAttribute(e, "true"), i.textContent = Zt, document.head?.appendChild(i), t.appendChild(n);
1192
+ i.setAttribute(t, "true"), i.textContent = bn, document.head?.appendChild(i), e.appendChild(n);
1193
1193
  let a = !1;
1194
1194
  return () => {
1195
1195
  a || (a = !0, n.remove(), i.remove());
1196
1196
  };
1197
1197
  }
1198
- var k = /* @__PURE__ */ (function(t) {
1199
- return t.Json = "application/json", t.FormData = "multipart/form-data", t.UrlEncoded = "application/x-www-form-urlencoded", t.Text = "text/plain", t;
1200
- })({}), ft = "INJECTION";
1201
- function nn(t) {
1202
- return t.getState;
1198
+ function N(e) {
1199
+ for (; e.endsWith("/");) e = e.slice(0, e.length - 1);
1200
+ return /\/wp-json$/i.test(e) ? e : `${e}/wp-json`;
1201
+ }
1202
+ var Qe = 3e5, T = null, Ke = !1;
1203
+ function Sn() {
1204
+ return !0;
1205
+ }
1206
+ function An() {
1207
+ const e = String(bt.env.REACT_APP_OPENAPI_FAILOVER_TTL_MS || "").trim();
1208
+ if (!e) return Qe;
1209
+ const t = Number(e);
1210
+ return Number.isFinite(t) && t > 0 ? t : Qe;
1211
+ }
1212
+ function Tn() {
1213
+ return N("https://app.emailmaker.ru/api/".trim());
1214
+ }
1215
+ function In(e) {
1216
+ const t = e.trim();
1217
+ if (!t) return [];
1218
+ if (t.startsWith("[")) try {
1219
+ const n = JSON.parse(t);
1220
+ if (!Array.isArray(n)) throw new Error("expected JSON array");
1221
+ return n.map((r) => String(r).trim()).filter(Boolean);
1222
+ } catch {
1223
+ return Ke || (Ke = !0), [];
1224
+ }
1225
+ return t.split(",").map((n) => n.trim()).filter(Boolean);
1203
1226
  }
1204
- function v(t) {
1205
- if (nn(t)) {
1206
- const e = t.getState()[ft];
1207
- return e && Se.getInstance(e);
1208
- } else return t;
1227
+ function wn(e) {
1228
+ const t = /* @__PURE__ */ new Set(), n = [];
1229
+ for (const r of e) {
1230
+ const i = N(r);
1231
+ t.has(i) || (t.add(i), n.push(i));
1232
+ }
1233
+ return n;
1209
1234
  }
1210
- function fe(t, e) {
1211
- for (const n of t) if (n && e in n) return n[e];
1235
+ function Tt(e) {
1236
+ const t = String(e || "").trim();
1237
+ return t ? N(t) : Tn();
1212
1238
  }
1213
- function Oe(t) {
1214
- return Object.assign({}, ...t);
1239
+ function It(e, t = []) {
1240
+ return e ? wn([e, ...t]).slice(0, 3) : [];
1215
1241
  }
1216
- var mt = [
1217
- "generic",
1218
- "stockImages",
1219
- "emFiles",
1220
- "cdn"
1221
- ];
1222
- function Re(t) {
1223
- return !!t && typeof t == "object" && !Array.isArray(t);
1242
+ function wt() {
1243
+ return In(String(bt.env.REACT_APP_OPENAPI_FAILOVER_BASE_URLS || "").trim());
1224
1244
  }
1225
- function Ge(t) {
1226
- return !Re(t) || "match" in t || "rewrite" in t || "proxyBase" in t ? !1 : Object.keys(t).some((e) => mt.includes(e));
1245
+ function Pn(e = Date.now()) {
1246
+ return T ? e - T.switchedAt >= An() : !0;
1227
1247
  }
1228
- function pt(t) {
1229
- return t.length === 0 ? [] : t.length === 1 ? t[0] : t;
1248
+ function Pt(e = Date.now()) {
1249
+ T && Pn(e) && (T = null);
1230
1250
  }
1231
- function _t(t) {
1232
- let e = !1, n = [];
1233
- for (const r of t) if (r !== void 0) {
1234
- if (e = !0, Array.isArray(r)) {
1235
- n = [...r, ...n];
1236
- continue;
1237
- }
1238
- n = [r, ...n];
1251
+ function se(e) {
1252
+ if (!Sn()) return !1;
1253
+ const t = Tt(e);
1254
+ if (!t) return !1;
1255
+ const n = wt();
1256
+ return n.length === 0 ? !1 : It(t, n).length > 1;
1257
+ }
1258
+ function J(e) {
1259
+ const t = Tt(e);
1260
+ if (!t) return [];
1261
+ const n = wt();
1262
+ return n.length === 0 ? [t] : It(t, n);
1263
+ }
1264
+ function Pe(e) {
1265
+ const t = J(e);
1266
+ if (t.length === 0) return "";
1267
+ if (Pt(), T) {
1268
+ const n = t.indexOf(T.activeUrl);
1269
+ if (n >= 0) return t[n];
1239
1270
  }
1240
- if (e) return pt(n);
1241
- }
1242
- function rn(t) {
1243
- return Re(t) && ("value" in t || "replace" in t);
1271
+ return t[0];
1272
+ }
1273
+ function kn(e) {
1274
+ const t = J(e);
1275
+ if (t.length <= 1 || (Pt(), !T || !t.includes(T.activeUrl))) return t;
1276
+ const n = T.activeUrl;
1277
+ return [n, ...t.filter((r) => r !== n)];
1278
+ }
1279
+ function Cn(e) {
1280
+ return e === 502 || e === 503 || e === 504;
1281
+ }
1282
+ function xn(e) {
1283
+ return !((e instanceof DOMException || e instanceof Error) && e.name === "AbortError");
1284
+ }
1285
+ var kt;
1286
+ function On(e) {
1287
+ kt = e;
1288
+ }
1289
+ function Je(e, t) {
1290
+ if (!se(t)) return;
1291
+ const n = J(t);
1292
+ if (n.length <= 1) return;
1293
+ const r = n.indexOf(N(e));
1294
+ if (r < 0) return;
1295
+ const i = r + 1;
1296
+ if (i >= n.length) return;
1297
+ const a = n[i], o = T?.activeUrl;
1298
+ T = {
1299
+ activeUrl: a,
1300
+ switchedAt: Date.now()
1301
+ }, o !== a && kt?.();
1302
+ }
1303
+ function Mn(e, t) {
1304
+ if (!se(t)) return;
1305
+ const n = N(e);
1306
+ J(t).includes(n) && (T = {
1307
+ activeUrl: n,
1308
+ switchedAt: Date.now()
1309
+ });
1244
1310
  }
1245
- function ze(t, e) {
1246
- return e === void 0 ? t : Array.isArray(e) ? [...e, ...t] : [e, ...t];
1311
+ function Dn() {
1312
+ T = null;
1247
1313
  }
1248
- function an(t) {
1249
- let e = !1, n = [], r = !1;
1250
- for (const a of t) if (a !== void 0) {
1251
- if (rn(a)) {
1252
- e = !0, a.replace && (n = [], r = !0), a.value !== void 0 && (n = ze(n, a.value), r = !0);
1253
- continue;
1314
+ async function Rn(e, t, n) {
1315
+ const r = se(n) ? kn(n) : J(n).length > 0 ? [Pe(n)] : [];
1316
+ if (r.length === 0) throw new Error("[apiOriginFailover] no API base URL configured");
1317
+ const i = e.startsWith("/") ? e : `/${e}`;
1318
+ let a, o;
1319
+ for (let c = 0; c < r.length; c++) {
1320
+ const f = r[c], m = c === r.length - 1;
1321
+ try {
1322
+ const p = await fetch(`${f}${i}`, t);
1323
+ if (!p.ok && Cn(p.status)) {
1324
+ if (a = p, !m) {
1325
+ Je(f, n);
1326
+ continue;
1327
+ }
1328
+ break;
1329
+ }
1330
+ return p.ok && Mn(f, n), p;
1331
+ } catch (p) {
1332
+ if (!xn(p)) throw p;
1333
+ o = p, m || Je(f, n);
1254
1334
  }
1255
- n = ze(n, a), r = !0;
1256
1335
  }
1257
- const i = r ? pt(n) : void 0;
1258
- if (!e) return i;
1259
- if (i !== void 0) return { value: i };
1336
+ if (se(n) && Dn(), a) return a;
1337
+ throw o instanceof Error ? o : /* @__PURE__ */ new Error("[apiOriginFailover] fetch chain failed");
1260
1338
  }
1261
- function on(t) {
1262
- const e = t.filter((r) => r !== void 0);
1263
- if (e.length === 0) return;
1264
- if (!e.some((r) => Ge(r))) return _t(e);
1265
- const n = {};
1266
- for (const r of mt) {
1267
- const i = an(t.map((a) => {
1268
- if (a !== void 0) return Ge(a) ? a[r] : r === "generic" ? a : void 0;
1269
- }));
1270
- i !== void 0 && (n[r] = i);
1271
- }
1272
- return Object.keys(n).length > 0 ? n : void 0;
1339
+ function Ct(e) {
1340
+ return String(e.standaloneKey || "").trim() || void 0;
1273
1341
  }
1274
- function ln(t) {
1275
- return _t(t);
1342
+ function Nn(e) {
1343
+ return e.standaloneOnAuthFailure === !0 ? !0 : e.config?.standaloneOnAuthFailure === !0;
1276
1344
  }
1277
- function sn(t) {
1278
- if (t !== void 0) {
1279
- if (Array.isArray(t)) return {
1280
- replace: !1,
1281
- hosts: t
1282
- };
1283
- if (Re(t) && Array.isArray(t.value)) return {
1284
- replace: !!t.replace,
1285
- hosts: t.value
1286
- };
1287
- }
1345
+ function Fn(e) {
1346
+ return Nn(e) ? !!Ct(e) : !1;
1288
1347
  }
1289
- function dn(t, e) {
1290
- const n = [...t], r = new Set(n.map((i) => i.toLowerCase()));
1291
- for (const i of e) {
1292
- const a = i.trim().replace(/:\d+$/, "");
1293
- if (!a) continue;
1294
- const o = a.toLowerCase();
1295
- r.has(o) || (r.add(o), n.push(a));
1296
- }
1297
- return n;
1348
+ function Ln(e) {
1349
+ return !!Ct(e) && !Fn(e);
1298
1350
  }
1299
- function un(t) {
1300
- let e = [], n = !1;
1301
- for (const r of t) {
1302
- const i = sn(r);
1303
- i && (n = !0, i.replace && (e = []), e = dn(e, i.hosts));
1304
- }
1305
- return n ? e : void 0;
1351
+ function xt(e) {
1352
+ return Ln(e);
1306
1353
  }
1307
- function cn(t) {
1308
- const e = t.filter((i) => i !== void 0);
1309
- if (e.length === 0) return;
1310
- const n = Oe(e.map(({ directHosts: i, ...a }) => a)), r = un(e.map((i) => i?.directHosts));
1311
- return r !== void 0 && (n.directHosts = r), n;
1354
+ var oe = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Set();
1355
+ function Bn(e, t) {
1356
+ ke.has(e) || ke.add(e);
1312
1357
  }
1313
- function Ae(t) {
1314
- for (; t.endsWith("/");) t = t.slice(0, t.length - 1);
1315
- return /\/wp-json$/i.test(t) ? t : `${t}/wp-json`;
1316
- }
1317
- Ae("https://app.emailmaker.ru/api/");
1318
- F();
1319
- F();
1320
- F();
1321
- var fn = F(), Ve;
1322
- (function(t) {
1323
- const e = "https://racs.emcdn.ru/v3";
1324
- function n(i, a) {
1325
- const o = {
1326
- method: "POST",
1327
- headers: {
1328
- "Content-Type": "application/json",
1329
- Accept: "application/json"
1330
- },
1331
- body: JSON.stringify(a)
1332
- };
1333
- return fetch(`${e}?resource=${i}&dataset=${document.location.hostname}`, o);
1334
- }
1335
- t.post = n;
1336
- async function r(i, a = 0) {
1337
- const o = {
1338
- method: "POST",
1339
- headers: {
1340
- "Content-Type": "application/json",
1341
- Accept: "application/json"
1342
- },
1343
- body: `{"filter":{},"limit":${a}}`
1344
- };
1345
- return await (await fetch(`${e}/get?resource=${i}&dataset=${document.location.hostname}`, o)).json();
1358
+ function Be() {
1359
+ oe.clear(), ke.clear();
1360
+ }
1361
+ On(Be);
1362
+ var Ye = /* @__PURE__ */ new WeakMap();
1363
+ function je(e) {
1364
+ const t = String(e || "").trim();
1365
+ if (t) return Pe(t) || N(t);
1366
+ const n = "https://app.emailmaker.ru/api/".trim();
1367
+ return Pe() || N(n);
1368
+ }
1369
+ async function jn(e) {
1370
+ if (!e.getAuthToken) return;
1371
+ const t = await e.getAuthToken(e.user, e.project, void 0), n = String(t || "").trim();
1372
+ return n ? `Bearer ${n}` : void 0;
1373
+ }
1374
+ async function qn(e) {
1375
+ if (!e.getAuthToken) return !0;
1376
+ try {
1377
+ const t = await e.getAuthToken(e.user, e.project, void 0);
1378
+ return !!String(t || "").trim();
1379
+ } catch {
1380
+ return !1;
1346
1381
  }
1347
- t.getAll = r;
1348
- })(Ve || (Ve = {}));
1349
- var me = /* @__PURE__ */ new Map(), He = /* @__PURE__ */ new WeakMap();
1350
- function Et(t) {
1351
- const e = String(t || "").trim();
1352
- if (e) return Ae(e);
1353
- return Ae("https://app.emailmaker.ru/api/".trim());
1354
- }
1355
- async function mn(t) {
1356
- if (!t.getAuthToken) return;
1357
- const e = await t.getAuthToken(t.user, t.project, void 0);
1358
- return e ? `Bearer ${e}` : void 0;
1359
- }
1360
- function pn(t) {
1361
- return async ({ baseUrl: e }) => {
1362
- const n = Et(e);
1382
+ }
1383
+ function Un(e) {
1384
+ return async ({ baseUrl: t }) => {
1385
+ const n = je(t);
1363
1386
  if (!n) throw new Error("[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL");
1364
1387
  const r = new Headers({
1365
1388
  Accept: "application/json",
1366
1389
  "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
1367
- }), i = await mn(t);
1390
+ }), i = await jn(e);
1391
+ if (e.getAuthToken && !i) throw new Error("[Loader] appInit skipped: empty auth token");
1368
1392
  i && r.set("authorization", i);
1369
- const a = await fetch(`${n}/app/v1/app_init`, {
1393
+ const a = await Rn("/app/v1/app_init", {
1370
1394
  method: "POST",
1371
1395
  headers: r,
1372
1396
  body: new URLSearchParams(),
1373
1397
  credentials: "same-origin"
1374
- });
1398
+ }, n);
1375
1399
  if (!a.ok) throw new Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);
1376
1400
  return a.json();
1377
1401
  };
1378
1402
  }
1379
- function _n(t) {
1403
+ function Gn(e) {
1380
1404
  return JSON.stringify({
1381
- baseUrl: Et(t.baseUrl) || "",
1382
- project: t.project ?? "",
1383
- userId: t.user?.id ?? ""
1405
+ baseUrl: je(e.baseUrl) || "",
1406
+ project: e.project ?? "",
1407
+ userId: e.user?.id ?? ""
1384
1408
  });
1385
1409
  }
1386
- function En(t) {
1387
- return async (e) => {
1388
- const n = _n(e), r = me.get(n);
1410
+ function zn(e) {
1411
+ const t = e instanceof Error ? e.message : String(e);
1412
+ return t.includes("[Loader] appInit skipped: empty auth token") ? !0 : /\b(403|404)\b/.test(t);
1413
+ }
1414
+ function Vn(e) {
1415
+ return e.appInit ? !0 : !(e.jwtAuth && !e.getAuthToken);
1416
+ }
1417
+ function Hn(e) {
1418
+ return async (t) => {
1419
+ const n = Gn(t), r = oe.get(n);
1389
1420
  if (r) return r;
1390
- const i = Promise.resolve(t(e)).catch((a) => {
1391
- throw me.delete(n), a;
1421
+ const i = Promise.resolve(e(t)).catch((a) => {
1422
+ throw Bn(n, a), zn(a) || oe.delete(n), a;
1392
1423
  });
1393
- return me.set(n, i), i;
1424
+ return oe.set(n, i), i;
1394
1425
  };
1395
1426
  }
1396
- function gn(t) {
1397
- if (t.standaloneKey) return t;
1398
- const e = t.appInit || pn(t);
1399
- let n = He.get(e);
1400
- return n || (n = En(e), He.set(e, n)), Promise.resolve(n({
1401
- baseUrl: t.baseUrl,
1402
- user: t.user,
1403
- project: t.project,
1404
- prevApp: void 0
1405
- })).catch((r) => {}), {
1406
- ...t,
1427
+ function Wn(e) {
1428
+ if (xt(e) || !e.appInit && !je(e.baseUrl) || !Vn(e)) return e;
1429
+ const t = e.appInit || Un(e);
1430
+ let n = Ye.get(t);
1431
+ return n || (n = Hn(t), Ye.set(t, n)), (async () => {
1432
+ await qn(e) && await n({
1433
+ baseUrl: e.baseUrl,
1434
+ user: e.user,
1435
+ project: e.project,
1436
+ prevApp: void 0
1437
+ });
1438
+ })().catch(() => {}), {
1439
+ ...e,
1407
1440
  appInit: n
1408
1441
  };
1409
1442
  }
1410
- var Xe = /* @__PURE__ */ new WeakMap();
1411
- function bn(t) {
1412
- let e = null;
1413
- return async (n, r, i) => (e || (e = Promise.resolve(t(n, r, i)).finally(() => {
1414
- e = null;
1415
- })), e);
1416
- }
1417
- function hn(t) {
1418
- if (t.standaloneKey) return t;
1419
- const e = t.getAuthToken;
1420
- if (!e) return t;
1421
- let n = Xe.get(e);
1422
- return n || (n = bn(e), Xe.set(e, n)), Promise.resolve(n(t.user, t.project, void 0)).catch((r) => {}), {
1423
- ...t,
1443
+ var Ot = 0;
1444
+ function $n() {
1445
+ return Ot;
1446
+ }
1447
+ function Xn() {
1448
+ Ot += 1, Be();
1449
+ }
1450
+ var Ze = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap();
1451
+ function Qn(e, t) {
1452
+ return JSON.stringify({
1453
+ userId: e?.id ?? "",
1454
+ project: t ?? ""
1455
+ });
1456
+ }
1457
+ function Kn(e) {
1458
+ const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1459
+ return async (r, i, a) => {
1460
+ const o = Qn(r, i);
1461
+ if (a) return n.delete(o), t.delete(o), Be(), e(r, i, a);
1462
+ const c = n.get(o);
1463
+ if (c && !t.has(o)) return c;
1464
+ let f = t.get(o);
1465
+ return f || (f = Promise.resolve(e(r, i, a)).then((m) => (String(m || "").trim() && n.set(o, m), m)).finally(() => {
1466
+ t.delete(o);
1467
+ }), t.set(o, f)), f;
1468
+ };
1469
+ }
1470
+ function Jn(e) {
1471
+ if (xt(e)) return e;
1472
+ const t = e.getAuthToken;
1473
+ if (!t) return e;
1474
+ let n = Ze.get(t);
1475
+ const r = $n();
1476
+ return (!n || et.get(t) !== r) && (n = Kn(t), Ze.set(t, n), et.set(t, r)), Promise.resolve(n(e.user, e.project, void 0)).catch((i) => {}), {
1477
+ ...e,
1424
1478
  getAuthToken: n
1425
1479
  };
1426
1480
  }
1427
- function gt(...t) {
1428
- const e = t.filter((a) => a != null);
1429
- if (e.length === 0) return;
1430
- if (e.length === 1) return e[0];
1431
- const n = e.find((a) => a.aborted);
1481
+ function Mt(...e) {
1482
+ const t = e.filter((a) => a != null);
1483
+ if (t.length === 0) return;
1484
+ if (t.length === 1) return t[0];
1485
+ const n = t.find((a) => a.aborted);
1432
1486
  if (n) return n;
1433
- if (typeof AbortSignal < "u" && typeof AbortSignal.any == "function") return AbortSignal.any(e);
1487
+ if (typeof AbortSignal < "u" && typeof AbortSignal.any == "function") return AbortSignal.any(t);
1434
1488
  const r = new AbortController(), i = (a) => {
1435
1489
  r.signal.aborted || r.abort(a.reason);
1436
1490
  };
1437
- for (const a of e) a.addEventListener("abort", () => i(a), { once: !0 });
1491
+ for (const a of t) a.addEventListener("abort", () => i(a), { once: !0 });
1438
1492
  return r.signal;
1439
1493
  }
1440
- function Q(t, e = !1) {
1494
+ var C = /* @__PURE__ */ (function(e) {
1495
+ return e.Json = "application/json", e.FormData = "multipart/form-data", e.UrlEncoded = "application/x-www-form-urlencoded", e.Text = "text/plain", e;
1496
+ })({});
1497
+ function Y(e, t = !1) {
1441
1498
  const n = {};
1442
- for (const r of Object.keys(t)) {
1443
- let i = t[r];
1444
- i !== void 0 && !(typeof i == "number" && Number.isNaN(i)) && (e && typeof i == "object" && i !== null && (i = Q(i)), n[r] = i);
1499
+ for (const r of Object.keys(e)) {
1500
+ let i = e[r];
1501
+ i !== void 0 && !(typeof i == "number" && Number.isNaN(i)) && (t && typeof i == "object" && i !== null && (i = Y(i)), n[r] = i);
1445
1502
  }
1446
1503
  return n;
1447
1504
  }
1448
- function A(t) {
1449
- return typeof t == "object" && t;
1505
+ function A(e) {
1506
+ return typeof e == "object" && e;
1450
1507
  }
1451
- function T(t) {
1452
- const e = Number(t);
1453
- return isNaN(e) ? t : e;
1508
+ function I(e) {
1509
+ const t = Number(e);
1510
+ return isNaN(t) ? e : t;
1454
1511
  }
1455
- function y(t) {
1456
- return typeof t == "number" ? String(t) : t;
1512
+ function y(e) {
1513
+ return typeof e == "number" ? String(e) : e;
1457
1514
  }
1458
- function R(t) {
1459
- return typeof t == "object" ? t.rendered : t;
1515
+ function F(e) {
1516
+ return typeof e == "object" ? e.rendered : e;
1460
1517
  }
1461
- function yn(t) {
1462
- return typeof t == "object" && t !== null ? t : void 0;
1518
+ function Yn(e) {
1519
+ return typeof e == "object" && e !== null ? e : void 0;
1463
1520
  }
1464
- function x({ id: t, title: e, meta: n, type: r, guid: i, acf: { lock: a, subject: o, description: c, html: f, project: m, tags: p, utm_parameters: s, parent_email: l, common_styles: d, is_template: u }, author: E, ...g }) {
1465
- const b = yn(n);
1521
+ function O({ id: e, title: t, meta: n, type: r, guid: i, acf: { lock: a, subject: o, description: c, html: f, project: m, tags: p, utm_parameters: s, parent_email: l, common_styles: u, is_template: d }, author: E, ...g }) {
1522
+ const h = Yn(n);
1466
1523
  return {
1467
1524
  ...g,
1468
- ...b !== void 0 ? { meta: b } : {},
1469
- id: y(t),
1525
+ ...h !== void 0 ? { meta: h } : {},
1526
+ id: y(e),
1470
1527
  author: y(E),
1471
- title: R(e) || "",
1528
+ title: F(t) || "",
1472
1529
  lock: a,
1473
1530
  description: c,
1474
1531
  html: f,
@@ -1478,185 +1535,331 @@ function x({ id: t, title: e, meta: n, type: r, guid: i, acf: { lock: a, subject
1478
1535
  tags: p,
1479
1536
  utm_parameters: s,
1480
1537
  parent_email: y(l instanceof Array && l[0] ? l[0].ID : l),
1481
- common_styles: d,
1482
- is_template: u
1538
+ common_styles: u,
1539
+ is_template: d
1483
1540
  };
1484
1541
  }
1485
- function $e({ title: t, lock: e, subject: n, description: r, html: i, project: a, tags: o, renderGuid: c, utm_parameters: f, parent_email: m, common_styles: p, is_template: s, author: l, meta: d, ...u }) {
1542
+ function tt({ title: e, lock: t, subject: n, description: r, html: i, project: a, tags: o, renderGuid: c, utm_parameters: f, parent_email: m, common_styles: p, is_template: s, author: l, meta: u, ...d }) {
1486
1543
  return {
1487
- ...u,
1488
- author: T(l),
1489
- title: t,
1544
+ ...d,
1545
+ author: I(l),
1546
+ title: e,
1490
1547
  acf: {
1491
- lock: e,
1548
+ lock: t,
1492
1549
  description: r,
1493
1550
  html: i,
1494
1551
  project: a,
1495
1552
  tags: o,
1496
1553
  utm_parameters: f,
1497
- parent_email: T(m),
1554
+ parent_email: I(m),
1498
1555
  common_styles: p,
1499
1556
  is_template: s
1500
1557
  }
1501
1558
  };
1502
1559
  }
1503
- function vn(t) {
1504
- return typeof t == "object" && t !== null ? t : void 0;
1560
+ function Zn(e) {
1561
+ return typeof e == "object" && e !== null ? e : void 0;
1505
1562
  }
1506
- function We({ id: t, title: e, meta: n, acf: { html: r, common_styles: i }, parent: a, excerpt: o, author: c, ...f }) {
1507
- const m = vn(n);
1563
+ function nt({ id: e, title: t, meta: n, acf: { html: r, common_styles: i }, parent: a, excerpt: o, author: c, ...f }) {
1564
+ const m = Zn(n);
1508
1565
  return {
1509
1566
  ...f,
1510
1567
  ...m !== void 0 ? { meta: m } : {},
1511
1568
  author: y(c),
1512
- id: y(t),
1569
+ id: y(e),
1513
1570
  parent: y(a),
1514
- title: R(e) || "",
1571
+ title: F(t) || "",
1515
1572
  html: r,
1516
1573
  common_styles: i,
1517
1574
  excerpt: A(o) ? o.rendered : o
1518
1575
  };
1519
1576
  }
1520
- function Sn({ parent: t, title: e, html: n, project: r, subject: i, preheader: a, common_styles: o, author: c, parent_email: f, meta: m, ...p }) {
1577
+ function er({ parent: e, title: t, html: n, project: r, subject: i, preheader: a, common_styles: o, author: c, parent_email: f, meta: m, ...p }) {
1521
1578
  return {
1522
1579
  ...p,
1523
- author: T(c),
1524
- title: e,
1525
- parent: T(t),
1580
+ author: I(c),
1581
+ title: t,
1582
+ parent: I(e),
1526
1583
  "acf[html]": n,
1527
1584
  "acf[project]": A(r) ? r.id || r.ID : r,
1528
1585
  "acf[parent_email]": f,
1529
1586
  "acf[common_styles]": o
1530
1587
  };
1531
1588
  }
1532
- function oe({ data: t, ...e }, n) {
1533
- return e.error ? e : {
1534
- data: n(t, e.meta),
1535
- ...e
1589
+ function ce({ data: e, ...t }, n) {
1590
+ return t.error ? t : {
1591
+ data: n(e, t.meta),
1592
+ ...t
1536
1593
  };
1537
1594
  }
1538
- function An({ data: t, ...e }, n) {
1539
- return e.error ? e : {
1540
- data: t.map((r) => n(r, e.meta)),
1541
- ...e
1595
+ function tr({ data: e, ...t }, n) {
1596
+ return t.error ? t : {
1597
+ data: e.map((r) => n(r, t.meta)),
1598
+ ...t
1542
1599
  };
1543
1600
  }
1544
- function S(t) {
1545
- return (e) => oe(e, t);
1601
+ function S(e) {
1602
+ return (t) => ce(t, e);
1603
+ }
1604
+ function nr(e) {
1605
+ return !e.hasOwnProperty("previous");
1546
1606
  }
1547
- function Tn(t) {
1548
- return !t.hasOwnProperty("previous");
1607
+ function qe(e) {
1608
+ return (t) => ce(t, (n, r) => nr(n) ? e(n, r) : e(n.previous, r));
1549
1609
  }
1550
- function Ne(t) {
1551
- return (e) => oe(e, (n, r) => Tn(n) ? t(n, r) : t(n.previous, r));
1610
+ function x(e) {
1611
+ return (t) => tr(t, e);
1552
1612
  }
1553
- function C(t) {
1554
- return (e) => An(e, t);
1613
+ var Dt = "INJECTION";
1614
+ function rr(e) {
1615
+ return e.getState;
1555
1616
  }
1556
- var In = ft, wn = (t, e) => {
1557
- if (!t) {
1558
- const n = Se.createChild(), r = F();
1559
- return Se.inject(r, n), r;
1617
+ function v(e) {
1618
+ if (rr(e)) {
1619
+ const t = e.getState()[Dt];
1620
+ return t && we.getInstance(t);
1621
+ } else return e;
1622
+ }
1623
+ var ir = Dt, ar = (e, t) => {
1624
+ if (!e) {
1625
+ const n = we.createChild(), r = q();
1626
+ return we.inject(r, n), r;
1560
1627
  }
1561
- return t;
1628
+ return e;
1562
1629
  };
1563
- function Pn() {
1564
- const t = v($());
1565
- return function(e, n) {
1566
- t.inject(e, n);
1630
+ function or() {
1631
+ const e = v(Q());
1632
+ return function(t, n) {
1633
+ e.inject(t, n);
1567
1634
  };
1568
1635
  }
1569
- function kn() {
1570
- const t = v($());
1571
- return function(e, n, r) {
1572
- t.injectFactory(e, n, r);
1636
+ function lr() {
1637
+ const e = v(Q());
1638
+ return function(t, n, r) {
1639
+ e.injectFactory(t, n, r);
1573
1640
  };
1574
1641
  }
1575
- function Cn(t, e) {
1576
- const n = $(), r = st(() => e || v(n), [n, e]), [i, a] = xe(() => r?.getInstance(t));
1577
- return Ce(() => {
1642
+ function sr(e, t) {
1643
+ const n = Q(), r = yt(() => t || v(n), [n, t]), [i, a] = Ne(() => r?.getInstance(e));
1644
+ return Re(() => {
1578
1645
  const o = r?.onInject((c) => {
1579
- c === t && a(r.getInstance(t));
1646
+ c === e && a(r.getInstance(e));
1580
1647
  });
1581
1648
  return () => o?.dispose();
1582
- }, [t, r]), i;
1649
+ }, [e, r]), i;
1583
1650
  }
1584
- function xn(t) {
1585
- const [e, n] = xe(), r = $(), i = Gt(Promise.resolve()), a = v(r);
1586
- return Ce(() => {
1587
- const o = i.current = i.current.then(() => a?.getInstanceAsync(t)).then((c) => {
1651
+ function ur(e) {
1652
+ const [t, n] = Ne(), r = Q(), i = sn(Promise.resolve()), a = v(r);
1653
+ return Re(() => {
1654
+ const o = i.current = i.current.then(() => a?.getInstanceAsync(e)).then((c) => {
1588
1655
  o === i.current && n(c);
1589
1656
  }, (c) => {});
1590
- }, [t, a]), e;
1657
+ }, [e, a]), t;
1591
1658
  }
1592
- function Mn(t, e) {
1593
- const n = $(), r = st(() => e || v(n), [n, e]), [i, a] = xe(() => r?.getServices(t) || []);
1594
- return Ce(() => {
1659
+ function dr(e, t) {
1660
+ const n = Q(), r = yt(() => t || v(n), [n, t]), [i, a] = Ne(() => r?.getServices(e) || []);
1661
+ return Re(() => {
1595
1662
  if (!r) return;
1596
1663
  const o = r.onInject((c) => {
1597
- c === Bt(t) && a(r.getServices(t));
1664
+ c === tn(e) && a(r.getServices(e));
1598
1665
  });
1599
1666
  return () => {
1600
1667
  o?.dispose();
1601
1668
  };
1602
- }, [t, r]), i;
1669
+ }, [e, r]), i;
1603
1670
  }
1604
- function Te(t) {
1605
- return (e, n, r, i) => t(v(n))(e, n, r, i);
1671
+ function Ce(e) {
1672
+ return (t, n, r, i) => e(v(n))(t, n, r, i);
1606
1673
  }
1607
- function Dn(t, e) {
1608
- return (t instanceof Pe ? t : v(t)).getInstance(e);
1674
+ function cr(e, t) {
1675
+ return (e instanceof Me ? e : v(e)).getInstance(t);
1609
1676
  }
1610
- function On(t, e) {
1611
- return (t instanceof Pe ? t : v(t)).getInstanceAsync(e);
1677
+ function fr(e, t) {
1678
+ return (e instanceof Me ? e : v(e)).getInstanceAsync(t);
1612
1679
  }
1613
- function Rn(t, e, n) {
1614
- return (t instanceof Pe ? t : v(t)).getOrCreateInstance(e, n);
1680
+ function mr(e, t, n) {
1681
+ return (e instanceof Me ? e : v(e)).getOrCreateInstance(t, n);
1615
1682
  }
1616
- function Nn(t, e, n) {
1617
- v(t).inject(e, n);
1683
+ function pr(e, t, n) {
1684
+ v(e).inject(t, n);
1618
1685
  }
1619
- function Bn(t, e, n, r) {
1620
- v(t).injectFactory(e, n, r);
1686
+ function _r(e, t, n, r) {
1687
+ v(e).injectFactory(t, n, r);
1621
1688
  }
1622
- function Ln(t, e, n) {
1623
- return v(t).addService(e, n);
1689
+ function Er(e, t, n) {
1690
+ return v(e).addService(t, n);
1624
1691
  }
1625
- function Fn(t, e, n, r) {
1626
- return v(t).addServiceFactory(e, n, r);
1692
+ function gr(e, t, n, r) {
1693
+ return v(e).addServiceFactory(t, n, r);
1627
1694
  }
1628
- function jn(t, e) {
1629
- return v(t).getServices(e);
1695
+ function hr(e, t) {
1696
+ return v(e).getServices(t);
1630
1697
  }
1631
- var bt = {
1698
+ var Rt = {
1632
1699
  getContainer: v,
1633
- createIdentifier: F,
1634
- reducer: wn,
1635
- reducerPath: In,
1636
- getInstance: Dn,
1637
- getInstanceAsync: On,
1638
- getOrCreateInstance: Rn,
1639
- inject: Nn,
1640
- injectFactory: Bn,
1641
- addService: Ln,
1642
- addServiceFactory: Fn,
1643
- getServices: jn,
1644
- useInstance: Cn,
1645
- useInstanceAsync: xn,
1646
- useServices: Mn,
1647
- useInject: Pn,
1648
- useInjectFactory: kn
1649
- }, _ = (t) => bt.getInstance(t, Nt);
1650
- function K(t) {
1651
- return (e, n, r) => {
1652
- const i = bt.getInstance(n, fn);
1653
- return qt({
1654
- ...t,
1700
+ createIdentifier: q,
1701
+ reducer: ar,
1702
+ reducerPath: ir,
1703
+ getInstance: cr,
1704
+ getInstanceAsync: fr,
1705
+ getOrCreateInstance: mr,
1706
+ inject: pr,
1707
+ injectFactory: _r,
1708
+ addService: Er,
1709
+ addServiceFactory: gr,
1710
+ getServices: hr,
1711
+ useInstance: sr,
1712
+ useInstanceAsync: ur,
1713
+ useServices: dr,
1714
+ useInject: or,
1715
+ useInjectFactory: lr
1716
+ };
1717
+ function ge(e, t) {
1718
+ for (const n of e) if (n && t in n) return n[t];
1719
+ }
1720
+ function Ue(e) {
1721
+ return Object.assign({}, ...e);
1722
+ }
1723
+ var Nt = [
1724
+ "generic",
1725
+ "stockImages",
1726
+ "emFiles",
1727
+ "cdn"
1728
+ ];
1729
+ function Ge(e) {
1730
+ return !!e && typeof e == "object" && !Array.isArray(e);
1731
+ }
1732
+ function rt(e) {
1733
+ return !Ge(e) || "match" in e || "rewrite" in e || "proxyBase" in e ? !1 : Object.keys(e).some((t) => Nt.includes(t));
1734
+ }
1735
+ function Ft(e) {
1736
+ return e.length === 0 ? [] : e.length === 1 ? e[0] : e;
1737
+ }
1738
+ function Lt(e) {
1739
+ let t = !1, n = [];
1740
+ for (const r of e) if (r !== void 0) {
1741
+ if (t = !0, Array.isArray(r)) {
1742
+ n = [...r, ...n];
1743
+ continue;
1744
+ }
1745
+ n = [r, ...n];
1746
+ }
1747
+ if (t) return Ft(n);
1748
+ }
1749
+ function br(e) {
1750
+ return Ge(e) && ("value" in e || "replace" in e);
1751
+ }
1752
+ function it(e, t) {
1753
+ return t === void 0 ? e : Array.isArray(t) ? [...t, ...e] : [t, ...e];
1754
+ }
1755
+ function yr(e) {
1756
+ let t = !1, n = [], r = !1;
1757
+ for (const a of e) if (a !== void 0) {
1758
+ if (br(a)) {
1759
+ t = !0, a.replace && (n = [], r = !0), a.value !== void 0 && (n = it(n, a.value), r = !0);
1760
+ continue;
1761
+ }
1762
+ n = it(n, a), r = !0;
1763
+ }
1764
+ const i = r ? Ft(n) : void 0;
1765
+ if (!t) return i;
1766
+ if (i !== void 0) return { value: i };
1767
+ }
1768
+ function vr(e) {
1769
+ const t = e.filter((r) => r !== void 0);
1770
+ if (t.length === 0) return;
1771
+ if (!t.some((r) => rt(r))) return Lt(t);
1772
+ const n = {};
1773
+ for (const r of Nt) {
1774
+ const i = yr(e.map((a) => {
1775
+ if (a !== void 0) return rt(a) ? a[r] : r === "generic" ? a : void 0;
1776
+ }));
1777
+ i !== void 0 && (n[r] = i);
1778
+ }
1779
+ return Object.keys(n).length > 0 ? n : void 0;
1780
+ }
1781
+ function Sr(e) {
1782
+ return Lt(e);
1783
+ }
1784
+ function Ar(e) {
1785
+ if (e !== void 0) {
1786
+ if (Array.isArray(e)) return {
1787
+ replace: !1,
1788
+ hosts: e
1789
+ };
1790
+ if (Ge(e) && Array.isArray(e.value)) return {
1791
+ replace: !!e.replace,
1792
+ hosts: e.value
1793
+ };
1794
+ }
1795
+ }
1796
+ function Tr(e, t) {
1797
+ const n = [...e], r = new Set(n.map((i) => i.toLowerCase()));
1798
+ for (const i of t) {
1799
+ const a = i.trim().replace(/:\d+$/, "");
1800
+ if (!a) continue;
1801
+ const o = a.toLowerCase();
1802
+ r.has(o) || (r.add(o), n.push(a));
1803
+ }
1804
+ return n;
1805
+ }
1806
+ function Ir(e) {
1807
+ let t = [], n = !1;
1808
+ for (const r of e) {
1809
+ const i = Ar(r);
1810
+ i && (n = !0, i.replace && (t = []), t = Tr(t, i.hosts));
1811
+ }
1812
+ return n ? t : void 0;
1813
+ }
1814
+ function wr(e) {
1815
+ const t = e.filter((i) => i !== void 0);
1816
+ if (t.length === 0) return;
1817
+ const n = Ue(t.map(({ directHosts: i, ...a }) => a)), r = Ir(t.map((i) => i?.directHosts));
1818
+ return r !== void 0 && (n.directHosts = r), n;
1819
+ }
1820
+ N("https://app.emailmaker.ru/api/");
1821
+ q();
1822
+ q();
1823
+ q();
1824
+ var Pr = q(), at;
1825
+ (function(e) {
1826
+ const t = "https://racs.emcdn.ru/v3";
1827
+ function n(i, a) {
1828
+ const o = {
1829
+ method: "POST",
1830
+ headers: {
1831
+ "Content-Type": "application/json",
1832
+ Accept: "application/json"
1833
+ },
1834
+ body: JSON.stringify(a)
1835
+ };
1836
+ return fetch(`${t}?resource=${i}&dataset=${document.location.hostname}`, o);
1837
+ }
1838
+ e.post = n;
1839
+ async function r(i, a = 0) {
1840
+ const o = {
1841
+ method: "POST",
1842
+ headers: {
1843
+ "Content-Type": "application/json",
1844
+ Accept: "application/json"
1845
+ },
1846
+ body: `{"filter":{},"limit":${a}}`
1847
+ };
1848
+ return await (await fetch(`${t}/get?resource=${i}&dataset=${document.location.hostname}`, o)).json();
1849
+ }
1850
+ e.getAll = r;
1851
+ })(at || (at = {}));
1852
+ var _ = (e) => Rt.getInstance(e, en);
1853
+ function Z(e) {
1854
+ return (t, n, r) => {
1855
+ const i = Rt.getInstance(n, Pr);
1856
+ return on({
1857
+ ...e,
1655
1858
  fetchFn: i?.execute || fetch
1656
- })(e, n, r);
1859
+ })(t, n, r);
1657
1860
  };
1658
1861
  }
1659
- var { setRevisionToApply: U, clearRevisionToApply: ri, setIsRecovering: pe, markContentReady: Qe, markEmailInited: ii, resetContentReady: ai, resetEmailInited: oi, resetShowReady: li, beginForcedHeaderSync: si, endForcedHeaderSync: di } = ae({
1862
+ var { setRevisionToApply: z, clearRevisionToApply: Hi, setIsRecovering: he, markContentReady: ot, markEmailInited: Wi, resetContentReady: $i, resetEmailInited: Xi, resetShowReady: Qi, beginForcedHeaderSync: Ki, endForcedHeaderSync: Ji } = de({
1660
1863
  name: "autosaveRecovery",
1661
1864
  initialState: {
1662
1865
  revisionToApply: null,
@@ -1666,153 +1869,153 @@ var { setRevisionToApply: U, clearRevisionToApply: ri, setIsRecovering: pe, mark
1666
1869
  forcedHeaderSync: null
1667
1870
  },
1668
1871
  reducers: {
1669
- setRevisionToApply: (t, { payload: e }) => {
1670
- t.revisionToApply = e;
1872
+ setRevisionToApply: (e, { payload: t }) => {
1873
+ e.revisionToApply = t;
1671
1874
  },
1672
- clearRevisionToApply: (t) => {
1673
- t.revisionToApply = null;
1875
+ clearRevisionToApply: (e) => {
1876
+ e.revisionToApply = null;
1674
1877
  },
1675
- setIsRecovering: (t, { payload: e }) => {
1676
- t.isRecovering = e;
1878
+ setIsRecovering: (e, { payload: t }) => {
1879
+ e.isRecovering = t;
1677
1880
  },
1678
- markContentReady: (t, { payload: e }) => {
1679
- t.contentReadyEmailId = e;
1881
+ markContentReady: (e, { payload: t }) => {
1882
+ e.contentReadyEmailId = t;
1680
1883
  },
1681
- markEmailInited: (t, { payload: e }) => {
1682
- t.initedShowToken = e;
1884
+ markEmailInited: (e, { payload: t }) => {
1885
+ e.initedShowToken = t;
1683
1886
  },
1684
- resetContentReady: (t) => {
1685
- t.contentReadyEmailId = null;
1887
+ resetContentReady: (e) => {
1888
+ e.contentReadyEmailId = null;
1686
1889
  },
1687
- resetEmailInited: (t) => {
1688
- t.initedShowToken = 0;
1890
+ resetEmailInited: (e) => {
1891
+ e.initedShowToken = 0;
1689
1892
  },
1690
- resetShowReady: (t) => {
1691
- t.contentReadyEmailId = null, t.initedShowToken = 0;
1893
+ resetShowReady: (e) => {
1894
+ e.contentReadyEmailId = null, e.initedShowToken = 0;
1692
1895
  },
1693
- beginForcedHeaderSync: (t, { payload: e }) => {
1694
- t.forcedHeaderSync = e;
1896
+ beginForcedHeaderSync: (e, { payload: t }) => {
1897
+ e.forcedHeaderSync = t;
1695
1898
  },
1696
- endForcedHeaderSync: (t) => {
1697
- t.forcedHeaderSync = null;
1899
+ endForcedHeaderSync: (e) => {
1900
+ e.forcedHeaderSync = null;
1698
1901
  }
1699
1902
  }
1700
- }).actions, Gn = "em_autosave_pending", zn = 2e3, Vn = 5, Hn = 5e3, Xn = 4, $n = 6e4, Wn = 5e3;
1701
- function ie(t) {
1702
- return `${Gn}_${t}`;
1903
+ }).actions, xr = "em_autosave_pending", Or = 2e3, Mr = 5, Dr = 5e3, Rr = 4, Nr = 6e4, Fr = 5e3;
1904
+ function ue(e) {
1905
+ return `${xr}_${e}`;
1703
1906
  }
1704
- function Qn(t, e) {
1907
+ function Lr(e, t) {
1705
1908
  try {
1706
- sessionStorage.setItem(ie(t), JSON.stringify(e));
1909
+ sessionStorage.setItem(ue(e), JSON.stringify(t));
1707
1910
  } catch {}
1708
1911
  }
1709
- function Kn(t) {
1912
+ function Br(e) {
1710
1913
  try {
1711
- const e = sessionStorage.getItem(ie(t));
1712
- if (!e) return null;
1713
- const n = JSON.parse(e);
1714
- return Date.now() - n.sentAt > $n ? (sessionStorage.removeItem(ie(t)), null) : n;
1914
+ const t = sessionStorage.getItem(ue(e));
1915
+ if (!t) return null;
1916
+ const n = JSON.parse(t);
1917
+ return Date.now() - n.sentAt > Nr ? (sessionStorage.removeItem(ue(e)), null) : n;
1715
1918
  } catch {
1716
1919
  return null;
1717
1920
  }
1718
1921
  }
1719
- function G(t) {
1922
+ function V(e) {
1720
1923
  try {
1721
- sessionStorage.removeItem(ie(t));
1924
+ sessionStorage.removeItem(ue(e));
1722
1925
  } catch {}
1723
1926
  }
1724
- function ht(t) {
1725
- return !!t?.slug?.includes("autosave");
1927
+ function Bt(e) {
1928
+ return !!e?.slug?.includes("autosave");
1726
1929
  }
1727
- function _e(t, e) {
1728
- return ht(t) && Date.parse(t.modified) >= e - Wn;
1930
+ function be(e, t) {
1931
+ return Bt(e) && Date.parse(e.modified) >= t - Fr;
1729
1932
  }
1730
- function J(t) {
1731
- return ht(t) && !!t?.html?.trim();
1933
+ function ee(e) {
1934
+ return Bt(e) && !!e?.html?.trim();
1732
1935
  }
1733
- function Jn(t) {
1734
- return t?.length ? [...t].sort((e, n) => Date.parse(n.modified) - Date.parse(e.modified))[0] : null;
1936
+ function jr(e) {
1937
+ return e?.length ? [...e].sort((t, n) => Date.parse(n.modified) - Date.parse(t.modified))[0] : null;
1735
1938
  }
1736
- function Yn() {
1939
+ function qr() {
1737
1940
  return typeof performance < "u" && typeof performance.timeOrigin == "number" ? performance.timeOrigin : Date.now();
1738
1941
  }
1739
- function Zn(t, e) {
1740
- return t == null || e == null ? !1 : t.replaceAll(`\r
1942
+ function Ur(e, t) {
1943
+ return e == null || t == null ? !1 : e.replaceAll(`\r
1741
1944
  `, `
1742
- `) === e.replaceAll(`\r
1945
+ `) === t.replaceAll(`\r
1743
1946
  `, `
1744
1947
  `);
1745
1948
  }
1746
- var er = class {
1949
+ var Gr = class {
1747
1950
  pageLoadTs;
1748
1951
  polls = /* @__PURE__ */ new Map();
1749
1952
  processedEmails = /* @__PURE__ */ new Set();
1750
- constructor(t = Yn()) {
1751
- this.pageLoadTs = t;
1953
+ constructor(e = qr()) {
1954
+ this.pageLoadTs = e;
1752
1955
  }
1753
- onAutoSaveStarted(t, e) {
1754
- Qn(t, e);
1956
+ onAutoSaveStarted(e, t) {
1957
+ Lr(e, t);
1755
1958
  }
1756
- onAutoSaveCompleted(t) {}
1757
- onHistoryFetched(t, e, n, r, i = !1, a = null) {
1758
- const o = Jn(e), c = this.polls.get(t);
1959
+ onAutoSaveCompleted(e) {}
1960
+ onHistoryFetched(e, t, n, r, i = !1, a = null) {
1961
+ const o = jr(t), c = this.polls.get(e);
1759
1962
  if (c && (c.triggerRefetch = r, c.dispatch = n), i && c?.phase === "fast") {
1760
- J(o) && _e(o, c.pending.sentAt) && (G(t), this.cancelPolling(t), n(U({
1761
- emailId: t,
1963
+ ee(o) && be(o, c.pending.sentAt) && (V(e), this.cancelPolling(e), n(z({
1964
+ emailId: e,
1762
1965
  payload: o,
1763
1966
  phase: "found"
1764
- })), this.processedEmails.add(t));
1967
+ })), this.processedEmails.add(e));
1765
1968
  return;
1766
1969
  }
1767
1970
  if (i && c?.phase === "bg") {
1768
- J(o) && _e(o, c.pending.sentAt) && (G(t), this.cancelPolling(t), n(U({
1769
- emailId: t,
1971
+ ee(o) && be(o, c.pending.sentAt) && (V(e), this.cancelPolling(e), n(z({
1972
+ emailId: e,
1770
1973
  payload: o,
1771
1974
  phase: "bg"
1772
- })), this.processedEmails.add(t));
1975
+ })), this.processedEmails.add(e));
1773
1976
  return;
1774
1977
  }
1775
- if (this.processedEmails.has(t)) return;
1776
- const f = i ? Kn(t) : null, m = f && (f.sentAt < this.pageLoadTs || !Zn(f.html, a)) ? f : null;
1777
- m ? J(o) && _e(o, m.sentAt) ? (G(t), n(U({
1778
- emailId: t,
1978
+ if (this.processedEmails.has(e)) return;
1979
+ const f = i ? Br(e) : null, m = f && (f.sentAt < this.pageLoadTs || !Ur(f.html, a)) ? f : null;
1980
+ m ? ee(o) && be(o, m.sentAt) ? (V(e), n(z({
1981
+ emailId: e,
1779
1982
  payload: o,
1780
1983
  phase: "found"
1781
- })), this.processedEmails.add(t)) : this.startFastPoll(t, m, n, r) : (J(o) ? n(U({
1782
- emailId: t,
1984
+ })), this.processedEmails.add(e)) : this.startFastPoll(e, m, n, r) : (ee(o) ? n(z({
1985
+ emailId: e,
1783
1986
  payload: o,
1784
1987
  phase: "normal"
1785
- })) : n(Qe(t)), this.processedEmails.add(t));
1988
+ })) : n(ot(e)), this.processedEmails.add(e));
1786
1989
  }
1787
- onHistoryFetchError(t, e) {
1788
- this.polls.has(t) || e(Qe(t));
1990
+ onHistoryFetchError(e, t) {
1991
+ this.polls.has(e) || t(ot(e));
1789
1992
  }
1790
- cancelPolling(t) {
1791
- const e = this.polls.get(t);
1792
- e?.timer && clearTimeout(e.timer), e && e.dispatch(pe(!1)), this.polls.delete(t), this.processedEmails.delete(t);
1993
+ cancelPolling(e) {
1994
+ const t = this.polls.get(e);
1995
+ t?.timer && clearTimeout(t.timer), t && t.dispatch(he(!1)), this.polls.delete(e), this.processedEmails.delete(e);
1793
1996
  }
1794
- startFastPoll(t, e, n, r) {
1795
- n(pe(!0));
1997
+ startFastPoll(e, t, n, r) {
1998
+ n(he(!0));
1796
1999
  const i = {
1797
2000
  phase: "fast",
1798
2001
  attempts: 0,
1799
- pending: e,
2002
+ pending: t,
1800
2003
  timer: null,
1801
2004
  triggerRefetch: r,
1802
2005
  dispatch: n
1803
2006
  };
1804
- this.polls.set(t, i), this.scheduleNextPoll(t);
2007
+ this.polls.set(e, i), this.scheduleNextPoll(e);
1805
2008
  }
1806
- scheduleNextPoll(t) {
1807
- const e = this.polls.get(t);
1808
- if (!e) return;
1809
- const n = e.phase === "fast", r = n ? zn : Hn, i = n ? Vn : Xn;
1810
- e.timer = setTimeout(() => {
1811
- const a = this.polls.get(t);
2009
+ scheduleNextPoll(e) {
2010
+ const t = this.polls.get(e);
2011
+ if (!t) return;
2012
+ const n = t.phase === "fast", r = n ? Or : Dr, i = n ? Mr : Rr;
2013
+ t.timer = setTimeout(() => {
2014
+ const a = this.polls.get(e);
1812
2015
  if (a) if (a.attempts++, a.triggerRefetch(), n && a.attempts >= i) {
1813
2016
  const { pending: o, dispatch: c } = a;
1814
- G(t), c(pe(!1)), c(U({
1815
- emailId: t,
2017
+ V(e), c(he(!1)), c(z({
2018
+ emailId: e,
1816
2019
  payload: {
1817
2020
  html: o.html,
1818
2021
  common_styles: o.common_styles,
@@ -1820,11 +2023,11 @@ var er = class {
1820
2023
  preheader: o.preheader
1821
2024
  },
1822
2025
  phase: "timeout"
1823
- })), this.processedEmails.add(t), a.phase = "bg", a.attempts = 0, this.scheduleNextPoll(t);
1824
- } else !n && a.attempts >= i ? (G(t), this.cancelPolling(t), this.processedEmails.add(t)) : this.scheduleNextPoll(t);
2026
+ })), this.processedEmails.add(e), a.phase = "bg", a.attempts = 0, this.scheduleNextPoll(e);
2027
+ } else !n && a.attempts >= i ? (V(e), this.cancelPolling(e), this.processedEmails.add(e)) : this.scheduleNextPoll(e);
1825
2028
  }, r);
1826
2029
  }
1827
- }, z = new er(), Ke = {
2030
+ }, H = new Gr(), lt = {
1828
2031
  pro: {
1829
2032
  config: {
1830
2033
  mode: "pro",
@@ -2483,38 +2686,38 @@ var er = class {
2483
2686
  showToken: 0
2484
2687
  }
2485
2688
  }
2486
- }, yt = (t) => {
2487
- return Ke[t] || Ke.editor;
2689
+ }, jt = (e) => {
2690
+ return lt[e] || lt.editor;
2488
2691
  };
2489
- function M({ id: t, type: e, title: n, excerpt: r, author: i, acf: { subject: a, description: o, html: c, project: f, related_email: m, tags: p, type: s, is_template: l, global_block: d, lock: u }, ...E }) {
2692
+ function M({ id: e, type: t, title: n, excerpt: r, author: i, acf: { subject: a, description: o, html: c, project: f, related_email: m, tags: p, type: s, is_template: l, global_block: u, lock: d }, ...E }) {
2490
2693
  return {
2491
2694
  ...E,
2492
- id: String(t),
2695
+ id: String(e),
2493
2696
  author: String(i),
2494
- renderGuid: lt(),
2697
+ renderGuid: ht(),
2495
2698
  description: o,
2496
2699
  html: c,
2497
- excerpt: R(n),
2700
+ excerpt: F(n),
2498
2701
  project: A(f) ? f.ID : f,
2499
2702
  project_author: A(f) ? f.post_author : void 0,
2500
2703
  project_title: A(f) ? f.post_title : void 0,
2501
2704
  tags: p,
2502
2705
  is_template: l,
2503
- global_block: d,
2706
+ global_block: u,
2504
2707
  type: s,
2505
2708
  related_email: y(A(m) ? m.ID : m),
2506
- title: R(n) || "",
2507
- lock: u
2709
+ title: F(n) || "",
2710
+ lock: d
2508
2711
  };
2509
2712
  }
2510
- function Je({ title: t, subject: e, description: n, renderGuid: r, html: i, project: a, tags: o, type: c, related_email: f, is_template: m, global_block: p, lock: s, author: l, ...d }) {
2713
+ function st({ title: e, subject: t, description: n, renderGuid: r, html: i, project: a, tags: o, type: c, related_email: f, is_template: m, global_block: p, lock: s, author: l, ...u }) {
2511
2714
  return {
2512
- ...d,
2513
- author: T(l),
2514
- title: t,
2715
+ ...u,
2716
+ author: I(l),
2717
+ title: e,
2515
2718
  acf: {
2516
2719
  description: n,
2517
- related_email: T(f),
2720
+ related_email: I(f),
2518
2721
  html: i,
2519
2722
  project: a,
2520
2723
  tags: o,
@@ -2525,28 +2728,28 @@ function Je({ title: t, subject: e, description: n, renderGuid: r, html: i, proj
2525
2728
  }
2526
2729
  };
2527
2730
  }
2528
- function Ye({ id: t, title: e, acf: { html: n }, excerpt: r, parent: i, author: a, ...o }) {
2731
+ function ut({ id: e, title: t, acf: { html: n }, excerpt: r, parent: i, author: a, ...o }) {
2529
2732
  return {
2530
2733
  ...o,
2531
- id: y(t),
2734
+ id: y(e),
2532
2735
  author: y(a),
2533
2736
  parent: y(i),
2534
- title: R(e) || "",
2737
+ title: F(t) || "",
2535
2738
  html: n,
2536
2739
  excerpt: A(r) ? r.rendered : r
2537
2740
  };
2538
2741
  }
2539
- function ar({ parent: t, title: e, html: n, project: r, author: i, ...a }) {
2742
+ function $r({ parent: e, title: t, html: n, project: r, author: i, ...a }) {
2540
2743
  return {
2541
2744
  ...a,
2542
- author: T(i),
2543
- parent: T(t),
2544
- title: R(e),
2745
+ author: I(i),
2746
+ parent: I(e),
2747
+ title: F(t),
2545
2748
  "acf[html]": n,
2546
2749
  "acf[project]": A(r) ? r.id || r.ID : r
2547
2750
  };
2548
2751
  }
2549
- var re = { isPlugin: !0 }, or = {
2752
+ var le = { isPlugin: !0 }, Xr = {
2550
2753
  em_token: "em_access_token",
2551
2754
  em_refresh_token: "em_refresh_token",
2552
2755
  em_elements_view: "em_elements_view",
@@ -2577,13 +2780,13 @@ var re = { isPlugin: !0 }, or = {
2577
2780
  em_last_active_page: "em_last_active_page",
2578
2781
  em_layout_convert_never_suggest: "em_layout_convert_never_suggest"
2579
2782
  };
2580
- h("application_element_settings_set"), h("application_subject_update"), h("application_preheader_update"), h("application_domparser_error"), h("application_update_entity"), h("application_iframe_drag_event"), h("application_has_amp"), h("application_atom_inserted"), h("SANDBOX_READY"), h("sandbox_subject_update"), h("sandbox_preheader_update"), h("sandbox_drag_event"), h("sandbox_add_mergetag"), h("sandbox_send_translations"), h("sandbox_send_theme_variables"), h("sandbox_set_entity"), h("sandbox_init_start"), h("sandbox_inited"), h("sandbox_update_entity"), h("reload"), h("sandbox_add_extensions"), h("sandbox_remove_extensions"), h("sandbox_add_script"), h("sandbox_is_email_empty"), h("sandbox_switch_theme");
2581
- var lr = {
2783
+ b("application_element_settings_set"), b("application_subject_update"), b("application_preheader_update"), b("application_domparser_error"), b("application_update_entity"), b("application_iframe_drag_event"), b("application_has_amp"), b("application_atom_inserted"), b("SANDBOX_READY"), b("sandbox_subject_update"), b("sandbox_preheader_update"), b("sandbox_drag_event"), b("sandbox_add_mergetag"), b("sandbox_send_translations"), b("sandbox_send_theme_variables"), b("sandbox_set_entity"), b("sandbox_init_start"), b("sandbox_inited"), b("sandbox_update_entity"), b("reload"), b("sandbox_add_extensions"), b("sandbox_remove_extensions"), b("sandbox_add_script"), b("sandbox_is_email_empty"), b("sandbox_switch_theme");
2784
+ var Qr = {
2582
2785
  ALL: "All",
2583
2786
  STANDARD: "Standard",
2584
2787
  PROJECT: "Project"
2585
2788
  };
2586
- var sr = "Edit selected element", Ze = "Build", vt = "desktop", dr = "mobile", St = W({
2789
+ var Kr = "Edit selected element", dt = "Build", qt = "desktop", Jr = "mobile", Ut = K({
2587
2790
  reducerPath: "blocksApi",
2588
2791
  tagTypes: [
2589
2792
  "Blocks",
@@ -2591,24 +2794,24 @@ var sr = "Edit selected element", Ze = "Build", vt = "desktop", dr = "mobile", S
2591
2794
  "ParentsBlocks",
2592
2795
  "Block"
2593
2796
  ],
2594
- baseQuery: K({ baseUrl: "https://app.emailmaker.ru/api/wp-json/wp/v2/" }),
2595
- endpoints: (t) => ({
2596
- getBlocks: t.query({
2597
- queryFn(e, n) {
2797
+ baseQuery: Z({ baseUrl: "https://app.emailmaker.ru/api/wp-json/wp/v2/" }),
2798
+ endpoints: (e) => ({
2799
+ getBlocks: e.query({
2800
+ queryFn(t, n) {
2598
2801
  const r = _(n), i = {
2599
2802
  order: "desc",
2600
2803
  orderby: "modified"
2601
2804
  }, a = {};
2602
- if (e.notEmbed || (a._embed = ""), e.projectId && (a._embed = "author", a._fields = "id,title,blocktags,blockfolder,group,modified,date,type,acf.lock,acf.project.ID,acf.type,author,acf.is_template,acf.global_block,acf.html,_embedded", i["filter[meta_key]"] = "project", i["filter[meta_value]"] = e.projectId), e.fields && (a._fields = e.fields), e.page && (i.page = e.page), e.order && (i.order = e.order), e.orderby && (i.orderby = e.orderby), e.folderTag && e.folderTag !== "all" ? (i["filter[tax_query][relation]"] = "AND", i["filter[tax_query][0][taxonomy]"] = "blockfolder", i["filter[tax_query][0][field]"] = "id", i["filter[tax_query][0][terms]"] = e.folderTag, i["filter[tax_query][0][include_children]"] = "0") : e.hasOwnProperty("folderTag") && (e.folderTag !== "all" || typeof e.folderTag == "object" && e.folderTag === null) && !e.tags?.length && e.status && e.status !== "trash" && (i["filter[tax_query][0][taxonomy]"] = "blockfolder", i["filter[tax_query][0][operator]"] = "NOT EXISTS"), e.tags?.length > 0 && e.status !== "trash") {
2805
+ if (t.notEmbed || (a._embed = ""), t.projectId && (a._embed = "author", a._fields = "id,title,blocktags,blockfolder,group,modified,date,type,acf.lock,acf.project.ID,acf.type,author,acf.is_template,acf.global_block,acf.html,_embedded", i["filter[meta_key]"] = "project", i["filter[meta_value]"] = t.projectId), t.fields && (a._fields = t.fields), t.page && (i.page = t.page), t.order && (i.order = t.order), t.orderby && (i.orderby = t.orderby), t.folderTag && t.folderTag !== "all" ? (i["filter[tax_query][relation]"] = "AND", i["filter[tax_query][0][taxonomy]"] = "blockfolder", i["filter[tax_query][0][field]"] = "id", i["filter[tax_query][0][terms]"] = t.folderTag, i["filter[tax_query][0][include_children]"] = "0") : t.hasOwnProperty("folderTag") && (t.folderTag !== "all" || typeof t.folderTag == "object" && t.folderTag === null) && !t.tags?.length && t.status && t.status !== "trash" && (i["filter[tax_query][0][taxonomy]"] = "blockfolder", i["filter[tax_query][0][operator]"] = "NOT EXISTS"), t.tags?.length > 0 && t.status !== "trash") {
2603
2806
  i["filter[tax_query][relation]"] = "AND";
2604
- for (let o = 0, c = e.tags.length; o < c; o++) {
2605
- const f = e.tags[o];
2807
+ for (let o = 0, c = t.tags.length; o < c; o++) {
2808
+ const f = t.tags[o];
2606
2809
  i[`filter[tax_query][${o + 1}][taxonomy]`] = "blocktags", i[`filter[tax_query][${o + 1}][field]`] = "id", i[`filter[tax_query][${o + 1}][terms]`] = f;
2607
2810
  }
2608
2811
  }
2609
- return e.type && (i["filter[meta_query][2][key]"] = "type", i["filter[meta_query][2][value]"] = e.type), e.name && (i.search = e.name), e.pageSize && (i.per_page = e.pageSize), e.status === "trash" && (a.status = "trash"), r.wp.eblock_list(i, { extraQuery: a }).then(C(M));
2812
+ return t.type && (i["filter[meta_query][2][key]"] = "type", i["filter[meta_query][2][value]"] = t.type), t.name && (i.search = t.name), t.pageSize && (i.per_page = t.pageSize), t.status === "trash" && (a.status = "trash"), r.wp.eblock_list(i, { extraQuery: a }).then(x(M));
2610
2813
  },
2611
- providesTags: (e) => e ? [...e.map(({ id: n }) => ({
2814
+ providesTags: (t) => t ? [...t.map(({ id: n }) => ({
2612
2815
  type: "Blocks",
2613
2816
  id: n
2614
2817
  })), {
@@ -2620,25 +2823,25 @@ var sr = "Edit selected element", Ze = "Build", vt = "desktop", dr = "mobile", S
2620
2823
  }],
2621
2824
  keepUnusedDataFor: 0
2622
2825
  }),
2623
- getBlocksSchema: t.query({ queryFn(e, n) {
2826
+ getBlocksSchema: e.query({ queryFn(t, n) {
2624
2827
  return _(n).wp.eblock_list(void 0, {
2625
2828
  method: "OPTIONS",
2626
2829
  extraQuery: { _fields: "schema.properties.acf" }
2627
2830
  });
2628
2831
  } }),
2629
- getParentEmailBlocks: t.query({
2630
- queryFn(e, n) {
2832
+ getParentEmailBlocks: e.query({
2833
+ queryFn(t, n) {
2631
2834
  const r = _(n), i = { "filter[meta_query][0][compare]": "LIKE" }, a = {};
2632
- if (e.notEmbed || (a._embed = ""), e.emailId && (i["filter[meta_query][0][key]"] = "related_email", i["filter[meta_query][0][value]"] = e.emailId), e.fields && (a._fields = e.fields), e.page && (i.page = e.page), e.tags?.length > 0) {
2835
+ if (t.notEmbed || (a._embed = ""), t.emailId && (i["filter[meta_query][0][key]"] = "related_email", i["filter[meta_query][0][value]"] = t.emailId), t.fields && (a._fields = t.fields), t.page && (i.page = t.page), t.tags?.length > 0) {
2633
2836
  i["filter[tax_query][relation]"] = "AND";
2634
- for (let o = 0, c = e.tags.length; o < c; o++) {
2635
- const f = e.tags[o];
2837
+ for (let o = 0, c = t.tags.length; o < c; o++) {
2838
+ const f = t.tags[o];
2636
2839
  i[`filter[tax_query][${o}][taxonomy]`] = "blocktags", i[`filter[tax_query][${o}][field]`] = "id", i[`filter[tax_query][${o}][terms]`] = f;
2637
2840
  }
2638
2841
  }
2639
- return e.type && (i["filter[meta_query][2][key]"] = "type", i["filter[meta_query][2][value]"] = e.type), e.name && (i.search = e.name), e.pageSize && (i.per_page = e.pageSize), r.wp.eblock_list(i, { extraQuery: a }).then(C(M));
2842
+ return t.type && (i["filter[meta_query][2][key]"] = "type", i["filter[meta_query][2][value]"] = t.type), t.name && (i.search = t.name), t.pageSize && (i.per_page = t.pageSize), r.wp.eblock_list(i, { extraQuery: a }).then(x(M));
2640
2843
  },
2641
- providesTags: (e) => e ? [...e.map(({ id: n }) => ({
2844
+ providesTags: (t) => t ? [...t.map(({ id: n }) => ({
2642
2845
  type: "ParentsBlocks",
2643
2846
  id: n
2644
2847
  })), {
@@ -2650,24 +2853,24 @@ var sr = "Edit selected element", Ze = "Build", vt = "desktop", dr = "mobile", S
2650
2853
  }],
2651
2854
  keepUnusedDataFor: 0
2652
2855
  }),
2653
- getTemplateBlocks: t.query({
2654
- queryFn: (e, n) => {
2856
+ getTemplateBlocks: e.query({
2857
+ queryFn: (t, n) => {
2655
2858
  const r = _(n), i = {
2656
2859
  "filter[meta_query][1][key]": "is_template",
2657
2860
  "filter[meta_query][1][value]": "1",
2658
2861
  orderby: "modified",
2659
2862
  order: "desc"
2660
2863
  }, a = {};
2661
- if (e.notEmbed || (a._embed = ""), e.fields && (a._fields = e.fields), e.page && (i.page = e.page), e.tags?.length > 0) {
2864
+ if (t.notEmbed || (a._embed = ""), t.fields && (a._fields = t.fields), t.page && (i.page = t.page), t.tags?.length > 0) {
2662
2865
  i["filter[tax_query][relation]"] = "AND";
2663
- for (let o = 0, c = e.tags.length; o < c; o++) {
2664
- const f = e.tags[o];
2866
+ for (let o = 0, c = t.tags.length; o < c; o++) {
2867
+ const f = t.tags[o];
2665
2868
  i[`filter[tax_query][${o}][taxonomy]`] = "blocktags", i[`filter[tax_query][${o}][field]`] = "id", i[`filter[tax_query][${o}][terms]`] = f;
2666
2869
  }
2667
2870
  }
2668
- return e.type && (i["filter[meta_query][2][key]"] = "type", i["filter[meta_query][2][value]"] = e.type), e.name && (i.search = e.name), e.pageSize && (i.per_page = e.pageSize), r.wp.eblock_list(i, { extraQuery: a }).then(C(M));
2871
+ return t.type && (i["filter[meta_query][2][key]"] = "type", i["filter[meta_query][2][value]"] = t.type), t.name && (i.search = t.name), t.pageSize && (i.per_page = t.pageSize), r.wp.eblock_list(i, { extraQuery: a }).then(x(M));
2669
2872
  },
2670
- providesTags: (e) => e ? [...e.map(({ id: n }) => ({
2873
+ providesTags: (t) => t ? [...t.map(({ id: n }) => ({
2671
2874
  type: "TemplatesBlocks",
2672
2875
  id: n
2673
2876
  })), {
@@ -2679,220 +2882,220 @@ var sr = "Edit selected element", Ze = "Build", vt = "desktop", dr = "mobile", S
2679
2882
  }],
2680
2883
  keepUnusedDataFor: 0
2681
2884
  }),
2682
- getBlock: t.query({
2683
- queryFn(e, n) {
2684
- return _(n).wp.eblock_detail({ id: T(e) }, { extraQuery: { _embed: "" } }).then(S(M));
2885
+ getBlock: e.query({
2886
+ queryFn(t, n) {
2887
+ return _(n).wp.eblock_detail({ id: I(t) }, { extraQuery: { _embed: "" } }).then(S(M));
2685
2888
  },
2686
- providesTags: (e, n, r) => [{
2889
+ providesTags: (t, n, r) => [{
2687
2890
  type: "Block",
2688
2891
  id: r
2689
2892
  }],
2690
2893
  keepUnusedDataFor: 0
2691
2894
  }),
2692
- getBlockHistory: t.query({
2693
- queryFn({ blockId: e, page: n = 1 }, r) {
2895
+ getBlockHistory: e.query({
2896
+ queryFn({ blockId: t, page: n = 1 }, r) {
2694
2897
  return _(r).wp.eblock_revisions_list({
2695
- parent: e,
2898
+ parent: t,
2696
2899
  per_page: 20,
2697
2900
  page: n
2698
- }, { extraQuery: { _fields: "author,slug,date,modified,title,acf.html,acf.common_styles,id" } }).then((i) => oe(i, (a, o) => ({
2901
+ }, { extraQuery: { _fields: "author,slug,date,modified,title,acf.html,acf.common_styles,id" } }).then((i) => ce(i, (a, o) => ({
2699
2902
  data: a.filter((c) => c.acf.html).map((c) => ({
2700
2903
  ...c,
2701
2904
  acf: {
2702
2905
  ...c.acf,
2703
2906
  html: c.acf.html
2704
2907
  }
2705
- })).map(Ye),
2908
+ })).map(ut),
2706
2909
  totalPages: +o.response.headers.get("X-WP-TotalPages"),
2707
2910
  args: {
2708
- blockId: e,
2911
+ blockId: t,
2709
2912
  page: n
2710
2913
  }
2711
2914
  })));
2712
2915
  },
2713
2916
  keepUnusedDataFor: 0
2714
2917
  }),
2715
- addBlock: t.mutation({
2716
- queryFn(e, n) {
2918
+ addBlock: e.mutation({
2919
+ queryFn(t, n) {
2717
2920
  return _(n).wp.eblock_create({
2718
- ...Je(e),
2921
+ ...st(t),
2719
2922
  status: "publish"
2720
- }, { type: k.Json }).then(S(M));
2923
+ }, { type: C.Json }).then(S(M));
2721
2924
  },
2722
2925
  invalidatesTags: [{
2723
2926
  type: "Blocks",
2724
2927
  id: "LIST"
2725
2928
  }]
2726
2929
  }),
2727
- editBlock: t.mutation({ queryFn: Te((e) => ({ blockId: n, source: r, ...i }, a) => {
2728
- const o = _(e), c = Q(Je(i));
2930
+ editBlock: e.mutation({ queryFn: Ce((t) => ({ blockId: n, source: r, ...i }, a) => {
2931
+ const o = _(t), c = Y(st(i));
2729
2932
  return o.wp.eblock_partial_update({ id: n }, c, {
2730
- type: k.Json,
2933
+ type: C.Json,
2731
2934
  extraQuery: { _embed: "wp:term" }
2732
2935
  }).then(S(M));
2733
2936
  }) }),
2734
- deleteBlock: t.mutation({
2735
- queryFn(e, n) {
2937
+ deleteBlock: e.mutation({
2938
+ queryFn(t, n) {
2736
2939
  const r = _(n);
2737
2940
  let i, a;
2738
- return typeof e == "object" ? (i = e.id, a = e.force) : (i = e, a = !1), r.wp.eblock_delete({ id: i }, { force: a }).then(Ne(M));
2941
+ return typeof t == "object" ? (i = t.id, a = t.force) : (i = t, a = !1), r.wp.eblock_delete({ id: i }, { force: a }).then(qe(M));
2739
2942
  },
2740
- invalidatesTags: (e, n, r) => [{
2943
+ invalidatesTags: (t, n, r) => [{
2741
2944
  type: "Blocks",
2742
2945
  id: r
2743
2946
  }]
2744
2947
  }),
2745
- addTag: t.mutation({ queryFn(e, n) {
2746
- return _(n).wp.blocktags_create({ ...e }, { type: k.Json });
2948
+ addTag: e.mutation({ queryFn(t, n) {
2949
+ return _(n).wp.blocktags_create({ ...t }, { type: C.Json });
2747
2950
  } }),
2748
- getDeletableTag: t.query({ queryFn([e, n], r) {
2951
+ getDeletableTag: e.query({ queryFn([t, n], r) {
2749
2952
  return _(r).wp.eblock_list({
2750
2953
  status: ["private"],
2751
2954
  "filter[meta_key]": "project",
2752
- "filter[meta_value]": e,
2955
+ "filter[meta_value]": t,
2753
2956
  blocktags: [n]
2754
- }, { extraQuery: { "_fields[]": "blocktags" } }).then(C(M));
2957
+ }, { extraQuery: { "_fields[]": "blocktags" } }).then(x(M));
2755
2958
  } }),
2756
- autoSaveBlock: t.mutation({ queryFn({ blockId: e, body: n }, r) {
2757
- const i = _(r), a = ar(n);
2758
- return i.wp.eblock_autosaves_create({ id: e }, a, { type: k.FormData }).then(S(Ye));
2959
+ autoSaveBlock: e.mutation({ queryFn({ blockId: t, body: n }, r) {
2960
+ const i = _(r), a = $r(n);
2961
+ return i.wp.eblock_autosaves_create({ id: t }, a, { type: C.FormData }).then(S(ut));
2759
2962
  } })
2760
2963
  })
2761
- }), { useGetBlocksQuery: ci, useGetBlockQuery: fi, useLazyGetBlockQuery: mi, useGetBlockHistoryQuery: pi, useLazyGetBlockHistoryQuery: _i, useGetBlocksSchemaQuery: Ei, useGetParentEmailBlocksQuery: gi, useAddBlockMutation: bi, useEditBlockMutation: hi, useAddTagMutation: yi, useAutoSaveBlockMutation: vi, useGetTemplateBlocksQuery: Si } = St, et = window.localStorage?.getItem(B.em_code_mode_settings), Ee = et && JSON.parse(et), Ie = {
2964
+ }), { useGetBlocksQuery: Zi, useGetBlockQuery: ea, useLazyGetBlockQuery: ta, useGetBlockHistoryQuery: na, useLazyGetBlockHistoryQuery: ra, useGetBlocksSchemaQuery: ia, useGetParentEmailBlocksQuery: aa, useAddBlockMutation: oa, useEditBlockMutation: la, useAddTagMutation: sa, useAutoSaveBlockMutation: ua, useGetTemplateBlocksQuery: da } = Ut, ct = window.localStorage?.getItem(B.em_code_mode_settings), ye = ct && JSON.parse(ct), xe = {
2762
2965
  activeModal: "",
2763
- lastActiveSettingsTab: Ze,
2764
- activeSettingsTab: Ze,
2966
+ lastActiveSettingsTab: dt,
2967
+ activeSettingsTab: dt,
2765
2968
  isPanelHistoryCollapsed: !0,
2766
2969
  monacoHeight: 0,
2767
- isCodeMode: Ee?.isCodeMode || re.isPlugin && Ee?.isCodeMode === void 0,
2768
- codeModeDirection: Ee?.codeModeDirection || "left",
2970
+ isCodeMode: ye?.isCodeMode || le.isPlugin && ye?.isCodeMode === void 0,
2971
+ codeModeDirection: ye?.codeModeDirection || "left",
2769
2972
  isHeaderCodeMenuOpen: {
2770
2973
  current: !1,
2771
2974
  switched: !1
2772
2975
  },
2773
2976
  emailWidth: "100%",
2774
- emailViewType: vt,
2977
+ emailViewType: qt,
2775
2978
  mobileViewActive: {
2776
2979
  shutdown: !0,
2777
2980
  styles: !0
2778
2981
  },
2779
2982
  emailMaxWidthSize: 425,
2780
- propertiesPanelKey: sr,
2983
+ propertiesPanelKey: Kr,
2781
2984
  parentBlocks: [],
2782
2985
  isGlobalLoading: !1
2783
2986
  };
2784
2987
  localStorage.getItem(B.em_code_mode_settings) || window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
2785
- codeModeDirection: Ie.codeModeDirection,
2786
- isCodeMode: Ie.isCodeMode
2988
+ codeModeDirection: xe.codeModeDirection,
2989
+ isCodeMode: xe.isCodeMode
2787
2990
  }));
2788
- var { openModal: Ai, closeModal: Ti, setActiveSettingsTab: Ii, resetToLastActiveSettingsTab: wi, switchIsPanelHistoryCollapsed: Pi, setEmailWidth: ki, switchCodeMode: Ci, switchCodeModeDirection: xi, setMobileViewActive: Mi, setEmailViewType: Di, setCodeMode: fr, setEmailMaxWidthSize: Oi, setPropertiesPanelKey: Ri, resetParentBlocks: Ni, setIsGlobalLoading: Bi, setHeaderCodeMenuOpen: Li } = ae({
2991
+ var { openModal: ca, closeModal: fa, setActiveSettingsTab: ma, resetToLastActiveSettingsTab: pa, switchIsPanelHistoryCollapsed: _a, setEmailWidth: Ea, switchCodeMode: ga, switchCodeModeDirection: ha, setMobileViewActive: ba, setEmailViewType: ya, setCodeMode: ei, setEmailMaxWidthSize: va, setPropertiesPanelKey: Sa, resetParentBlocks: Aa, setIsGlobalLoading: Ta, setHeaderCodeMenuOpen: Ia } = de({
2789
2992
  name: "emailPageSlice",
2790
- initialState: Ie,
2993
+ initialState: xe,
2791
2994
  reducers: {
2792
- openModal: (t, e) => {
2793
- t.activeModal = e.payload;
2995
+ openModal: (e, t) => {
2996
+ e.activeModal = t.payload;
2794
2997
  },
2795
- closeModal: (t) => {
2796
- t.activeModal = "";
2998
+ closeModal: (e) => {
2999
+ e.activeModal = "";
2797
3000
  },
2798
- setActiveSettingsTab: (t, e) => {
2799
- t.lastActiveSettingsTab = t.activeSettingsTab, t.activeSettingsTab = e.payload, e.payload !== "History" && (t.isPanelHistoryCollapsed = !0);
3001
+ setActiveSettingsTab: (e, t) => {
3002
+ e.lastActiveSettingsTab = e.activeSettingsTab, e.activeSettingsTab = t.payload, t.payload !== "History" && (e.isPanelHistoryCollapsed = !0);
2800
3003
  },
2801
- resetToLastActiveSettingsTab: (t) => {
2802
- t.lastActiveSettingsTab === "Properties" ? t.activeSettingsTab = "Build" : t.activeSettingsTab = t.lastActiveSettingsTab, t.lastActiveSettingsTab !== "History" && (t.isPanelHistoryCollapsed = !0);
3004
+ resetToLastActiveSettingsTab: (e) => {
3005
+ e.lastActiveSettingsTab === "Properties" ? e.activeSettingsTab = "Build" : e.activeSettingsTab = e.lastActiveSettingsTab, e.lastActiveSettingsTab !== "History" && (e.isPanelHistoryCollapsed = !0);
2803
3006
  },
2804
- switchIsPanelHistoryCollapsed: (t, e) => {
2805
- t.isPanelHistoryCollapsed = e.payload || !t.isPanelHistoryCollapsed;
3007
+ switchIsPanelHistoryCollapsed: (e, t) => {
3008
+ e.isPanelHistoryCollapsed = t.payload || !e.isPanelHistoryCollapsed;
2806
3009
  },
2807
- setEmailWidth: (t, { payload: e }) => {
2808
- t.emailWidth = e, t.emailViewType = e > t.emailMaxWidthSize || e === "100%" ? vt : dr, window.localStorage.setItem(B.em_default_sizes, JSON.stringify(e));
3010
+ setEmailWidth: (e, { payload: t }) => {
3011
+ e.emailWidth = t, e.emailViewType = t > e.emailMaxWidthSize || t === "100%" ? qt : Jr, window.localStorage.setItem(B.em_default_sizes, JSON.stringify(t));
2809
3012
  },
2810
- setEmailMaxWidthSize: (t, { payload: e }) => {
2811
- t.emailMaxWidthSize = e;
3013
+ setEmailMaxWidthSize: (e, { payload: t }) => {
3014
+ e.emailMaxWidthSize = t;
2812
3015
  },
2813
- setEmailViewType: (t, e) => {
2814
- t.emailViewType = e.payload;
3016
+ setEmailViewType: (e, t) => {
3017
+ e.emailViewType = t.payload;
2815
3018
  },
2816
- switchCodeMode: (t) => {
2817
- const e = !t.isCodeMode;
2818
- t.isCodeMode = e, window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
2819
- codeModeDirection: t.codeModeDirection,
2820
- isCodeMode: e
3019
+ switchCodeMode: (e) => {
3020
+ const t = !e.isCodeMode;
3021
+ e.isCodeMode = t, window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
3022
+ codeModeDirection: e.codeModeDirection,
3023
+ isCodeMode: t
2821
3024
  }));
2822
3025
  },
2823
- setCodeMode: (t, e) => {
2824
- const n = e.payload;
2825
- t.isCodeMode !== n && (t.isCodeMode = n, window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
2826
- codeModeDirection: t.codeModeDirection,
3026
+ setCodeMode: (e, t) => {
3027
+ const n = t.payload;
3028
+ e.isCodeMode !== n && (e.isCodeMode = n, window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
3029
+ codeModeDirection: e.codeModeDirection,
2827
3030
  isCodeMode: n
2828
3031
  })));
2829
3032
  },
2830
- switchCodeModeDirection: (t, e) => {
2831
- t.codeModeDirection = e.payload, window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
2832
- isCodeMode: t.isCodeMode,
2833
- codeModeDirection: e.payload
3033
+ switchCodeModeDirection: (e, t) => {
3034
+ e.codeModeDirection = t.payload, window.localStorage.setItem(B.em_code_mode_settings, JSON.stringify({
3035
+ isCodeMode: e.isCodeMode,
3036
+ codeModeDirection: t.payload
2834
3037
  }));
2835
3038
  },
2836
- setMobileViewActive: (t, e) => {
2837
- t.mobileViewActive = e.payload;
3039
+ setMobileViewActive: (e, t) => {
3040
+ e.mobileViewActive = t.payload;
2838
3041
  },
2839
- setPropertiesPanelKey: (t, e) => {
2840
- t.propertiesPanelKey = e.payload;
3042
+ setPropertiesPanelKey: (e, t) => {
3043
+ e.propertiesPanelKey = t.payload;
2841
3044
  },
2842
- resetParentBlocks: (t) => {
2843
- t.parentBlocks = [];
3045
+ resetParentBlocks: (e) => {
3046
+ e.parentBlocks = [];
2844
3047
  },
2845
- setParentBlocks: (t, e) => {
2846
- t.parentBlocks = e.payload;
3048
+ setParentBlocks: (e, t) => {
3049
+ e.parentBlocks = t.payload;
2847
3050
  },
2848
- setIsGlobalLoading: (t, e) => {
2849
- t.isGlobalLoading = e.payload;
3051
+ setIsGlobalLoading: (e, t) => {
3052
+ e.isGlobalLoading = t.payload;
2850
3053
  },
2851
- setHeaderCodeMenuOpen: (t, e) => {
2852
- t.isHeaderCodeMenuOpen.current && !e.payload ? t.isHeaderCodeMenuOpen.switched = !0 : t.isHeaderCodeMenuOpen.switched = !1, t.isHeaderCodeMenuOpen.current = e.payload;
3054
+ setHeaderCodeMenuOpen: (e, t) => {
3055
+ e.isHeaderCodeMenuOpen.current && !t.payload ? e.isHeaderCodeMenuOpen.switched = !0 : e.isHeaderCodeMenuOpen.switched = !1, e.isHeaderCodeMenuOpen.current = t.payload;
2853
3056
  }
2854
3057
  },
2855
- extraReducers: (t) => {
2856
- t.addMatcher(St.endpoints.getParentEmailBlocks.matchFulfilled, (e, n) => {
2857
- e.parentBlocks = n.payload;
3058
+ extraReducers: (e) => {
3059
+ e.addMatcher(Ut.endpoints.getParentEmailBlocks.matchFulfilled, (t, n) => {
3060
+ t.parentBlocks = n.payload;
2858
3061
  });
2859
3062
  }
2860
- }).actions, mr = [
3063
+ }).actions, ti = [
2861
3064
  "is_paying",
2862
3065
  "is_paying_user",
2863
3066
  "paying",
2864
3067
  "paying_user"
2865
3068
  ];
2866
- function ge(t) {
2867
- if (!t || typeof t != "object") return !1;
2868
- const e = t;
2869
- for (const n of mr) {
2870
- const r = e[n];
3069
+ function ve(e) {
3070
+ if (!e || typeof e != "object") return !1;
3071
+ const t = e;
3072
+ for (const n of ti) {
3073
+ const r = t[n];
2871
3074
  if (r === !0 || r === 1 || r === "1" || typeof r == "string" && r.trim().toLowerCase() === "true") return !0;
2872
3075
  }
2873
3076
  return !1;
2874
3077
  }
2875
- function Y(t) {
2876
- if (t === void 0) return;
2877
- if (t === null || t === "") return null;
2878
- const e = Number(t);
2879
- return Number.isFinite(e) ? e : null;
3078
+ function te(e) {
3079
+ if (e === void 0) return;
3080
+ if (e === null || e === "") return null;
3081
+ const t = Number(e);
3082
+ return Number.isFinite(t) ? t : null;
2880
3083
  }
2881
- function pr(t) {
2882
- if (!t) return !1;
2883
- const e = t, n = e.trial_enabled ?? e.trial ?? e.is_get_trial;
3084
+ function ni(e) {
3085
+ if (!e) return !1;
3086
+ const t = e, n = t.trial_enabled ?? t.trial ?? t.is_get_trial;
2884
3087
  return n === !0 || n === 1 || n === "1" || typeof n == "string" && n.toLowerCase() === "true";
2885
3088
  }
2886
- function be(t) {
2887
- const e = t.acf ?? {}, { autosaves: n, hide_mergetags: r, theme: i, newsletter_consent: a, code_editor: o, counters: c, subscription: f, subscription_end: m, recurring_payments: p, subscription_id: s, promocode: l, subscription_amount: d, enterprise_users_limit: u, enterprise_price: E, enterprise_12_price: g, privacy_policy_agreement: b, last_used_project: I, email_confirmation: N, email_builder_config: j } = e, { id: le, acf: Le, ...q } = t, Dt = pr(e), Fe = c ?? {}, Ot = ge(e) || ge(q) || ge(t.meta);
3089
+ function Se(e) {
3090
+ const t = e.acf ?? {}, { autosaves: n, hide_mergetags: r, theme: i, newsletter_consent: a, code_editor: o, counters: c, subscription: f, subscription_end: m, recurring_payments: p, subscription_id: s, promocode: l, subscription_amount: u, enterprise_users_limit: d, enterprise_price: E, enterprise_12_price: g, privacy_policy_agreement: h, last_used_project: w, email_confirmation: L, email_builder_config: U } = t, { id: fe, acf: Ve, ...G } = e, Jt = ni(t), He = c ?? {}, Yt = ve(t) || ve(G) || ve(e.meta);
2888
3091
  return {
2889
- ...q,
2890
- id: y(le),
2891
- username: q.username || "",
2892
- email: q.email || "",
2893
- password: q.password || "",
2894
- trial_enabled: Dt,
2895
- is_paying: Ot,
3092
+ ...G,
3093
+ id: y(fe),
3094
+ username: G.username || "",
3095
+ email: G.email || "",
3096
+ password: G.password || "",
3097
+ trial_enabled: Jt,
3098
+ is_paying: Yt,
2896
3099
  autosaves: n,
2897
3100
  hide_mergetags: r,
2898
3101
  theme: i,
@@ -2901,30 +3104,30 @@ function be(t) {
2901
3104
  ...o,
2902
3105
  font_size: Number(o.font_size)
2903
3106
  } : void 0,
2904
- counters: Object.keys(Fe).reduce((je, qe) => (je[qe] = Number(Fe[qe]), je), {}),
3107
+ counters: Object.keys(He).reduce((We, $e) => (We[$e] = Number(He[$e]), We), {}),
2905
3108
  subscription: f,
2906
3109
  subscription_end: m,
2907
3110
  recurring_payments: p,
2908
3111
  subscription_id: s,
2909
3112
  promocode: l,
2910
- subscription_amount: Y(d),
2911
- enterprise_users_limit: Y(u),
2912
- enterprise_price: Y(E),
2913
- enterprise_12_price: Y(g),
2914
- privacy_policy_agreement: b,
2915
- last_used_project: I,
2916
- email_confirmation: N,
2917
- email_builder_config: j
3113
+ subscription_amount: te(u),
3114
+ enterprise_users_limit: te(d),
3115
+ enterprise_price: te(E),
3116
+ enterprise_12_price: te(g),
3117
+ privacy_policy_agreement: h,
3118
+ last_used_project: w,
3119
+ email_confirmation: L,
3120
+ email_builder_config: U
2918
3121
  };
2919
3122
  }
2920
- function _r({ autosaves: t, theme: e, newsletter_consent: n, code_editor: r, counters: i, subscription: a, subscription_end: o, recurring_payments: c, subscription_id: f, promocode: m, subscription_amount: p, enterprise_users_limit: s, enterprise_price: l, enterprise_12_price: d, privacy_policy_agreement: u, locale: E, last_used_project: g, email_confirmation: b, email_builder_config: I, trial_enabled: N, is_paying: j, id: le, ...Le }) {
3123
+ function ri({ autosaves: e, theme: t, newsletter_consent: n, code_editor: r, counters: i, subscription: a, subscription_end: o, recurring_payments: c, subscription_id: f, promocode: m, subscription_amount: p, enterprise_users_limit: s, enterprise_price: l, enterprise_12_price: u, privacy_policy_agreement: d, locale: E, last_used_project: g, email_confirmation: h, email_builder_config: w, trial_enabled: L, is_paying: U, id: fe, ...Ve }) {
2921
3124
  return {
2922
- ...Le,
2923
- id: T(le),
3125
+ ...Ve,
3126
+ id: I(fe),
2924
3127
  locale: E,
2925
3128
  acf: {
2926
- autosaves: t,
2927
- theme: e,
3129
+ autosaves: e,
3130
+ theme: t,
2928
3131
  newsletter_consent: n,
2929
3132
  code_editor: r ? {
2930
3133
  ...r,
@@ -2939,210 +3142,210 @@ function _r({ autosaves: t, theme: e, newsletter_consent: n, code_editor: r, cou
2939
3142
  subscription_amount: p,
2940
3143
  enterprise_users_limit: s,
2941
3144
  enterprise_price: l,
2942
- enterprise_12_price: d,
2943
- privacy_policy_agreement: u,
3145
+ enterprise_12_price: u,
3146
+ privacy_policy_agreement: d,
2944
3147
  last_used_project: g,
2945
- email_confirmation: b,
2946
- email_builder_config: I,
2947
- ...N !== void 0 ? { trial_enabled: N } : {},
2948
- ...j !== void 0 ? { is_paying: j } : {}
3148
+ email_confirmation: h,
3149
+ email_builder_config: w,
3150
+ ...L !== void 0 ? { trial_enabled: L } : {},
3151
+ ...U !== void 0 ? { is_paying: U } : {}
2949
3152
  }
2950
3153
  };
2951
3154
  }
2952
- function Er({ title: t, acf: { limits: e, price: n }, ...r }) {
3155
+ function ii({ title: e, acf: { limits: t, price: n }, ...r }) {
2953
3156
  return {
2954
3157
  ...r,
2955
- title: R(t) || "",
2956
- limits: e,
3158
+ title: F(e) || "",
3159
+ limits: t,
2957
3160
  price: n
2958
3161
  };
2959
3162
  }
2960
- var At = W({
3163
+ var Gt = K({
2961
3164
  reducerPath: "authorizationApi",
2962
- baseQuery: K({
3165
+ baseQuery: Z({
2963
3166
  baseUrl: "https://app.emailmaker.ru/api/wp-json/wp/v2/",
2964
- prepareHeaders: (t) => {
2965
- const e = Ut.get(or.em_token);
2966
- return e && !t.has("authorization") && t.set("authorization", `Bearer ${e}`), t;
3167
+ prepareHeaders: (e) => {
3168
+ const t = ln.get(Xr.em_token);
3169
+ return t && !e.has("authorization") && e.set("authorization", `Bearer ${t}`), e;
2967
3170
  }
2968
3171
  }),
2969
- endpoints: (t) => ({
2970
- getMailConfirmation: t.query({ queryFn(e, n) {
2971
- return _(n).wp.confirmation_list({ ...e });
3172
+ endpoints: (e) => ({
3173
+ getMailConfirmation: e.query({ queryFn(t, n) {
3174
+ return _(n).wp.confirmation_list({ ...t });
2972
3175
  } }),
2973
- getSchema: t.query({ queryFn(e, n) {
3176
+ getSchema: e.query({ queryFn(t, n) {
2974
3177
  return _(n).wp.users_me_list(void 0, {
2975
3178
  method: "OPTIONS",
2976
3179
  extraQuery: { _fields: "schema" }
2977
3180
  });
2978
3181
  } }),
2979
- getMe: t.query({
3182
+ getMe: e.query({
2980
3183
  query: () => {
2981
- const e = "https://app.emailmaker.ru/api/v2".replace(/\/+$/, ""), n = typeof window < "u" ? window.location.origin : "";
3184
+ const t = "https://app.emailmaker.ru/api/v2".replace(/\/+$/, ""), n = typeof window < "u" ? window.location.origin : "";
2982
3185
  return {
2983
- url: `${e.startsWith("http") ? e : `${n}${e}`}/auth/user`,
3186
+ url: `${t.startsWith("http") ? t : `${n}${t}`}/auth/user`,
2984
3187
  method: "GET"
2985
3188
  };
2986
3189
  },
2987
- transformResponse: (e) => be(Array.isArray(e) ? e[0] : e)
3190
+ transformResponse: (t) => Se(Array.isArray(t) ? t[0] : t)
2988
3191
  }),
2989
- getUser: t.query({ queryFn(e, n) {
2990
- return _(n).wp.users_detail({ id: e }).then(S(be));
3192
+ getUser: e.query({ queryFn(t, n) {
3193
+ return _(n).wp.users_detail({ id: t }).then(S(Se));
2991
3194
  } }),
2992
- editMe: t.mutation({ queryFn(e, n) {
2993
- const r = _(n), i = Q(_r(e), !0);
2994
- return r.wp.users_me_create(i, { type: k.Json }).then(S(be));
3195
+ editMe: e.mutation({ queryFn(t, n) {
3196
+ const r = _(n), i = Y(ri(t), !0);
3197
+ return r.wp.users_me_create(i, { type: C.Json }).then(S(Se));
2995
3198
  } }),
2996
- getSubscriptions: t.query({ queryFn(e, n) {
2997
- return _(n).wp.subscription_list(void 0).then(C(Er));
3199
+ getSubscriptions: e.query({ queryFn(t, n) {
3200
+ return _(n).wp.subscription_list(void 0).then(x(ii));
2998
3201
  } }),
2999
- activateTrial: t.mutation({ query: (e) => ({
3202
+ activateTrial: e.mutation({ query: (t) => ({
3000
3203
  url: `${"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g, "")}/wp-json/subscription/v2/activate_trial`,
3001
3204
  method: "GET",
3002
3205
  headers: {
3003
- Authorization: `Bearer ${e}`,
3206
+ Authorization: `Bearer ${t}`,
3004
3207
  "Content-Type": "application/json"
3005
3208
  }
3006
3209
  }) })
3007
3210
  })
3008
- }), { useGetMeQuery: Fi, useLazyGetMeQuery: ji, useEditMeMutation: qi, useLazyGetSchemaQuery: Ui, useGetSubscriptionsQuery: Gi, useLazyGetMailConfirmationQuery: zi, useActivateTrialMutation: Vi } = At, Tt = "configSlice", tt = yt("pro");
3009
- function Be(t) {
3010
- return t.user.mode || t.serverSide.mode || localStorage.getItem("configSwither") || "pro";
3211
+ }), { useGetMeQuery: wa, useLazyGetMeQuery: Pa, useEditMeMutation: ka, useLazyGetSchemaQuery: Ca, useGetSubscriptionsQuery: xa, useLazyGetMailConfirmationQuery: Oa, useActivateTrialMutation: Ma } = Gt, zt = "configSlice", ft = jt("pro");
3212
+ function ze(e) {
3213
+ return e.user.mode || e.serverSide.mode || localStorage.getItem("configSwither") || "pro";
3011
3214
  }
3012
- function It(t) {
3013
- return yt(Be(t))?.config || {};
3215
+ function Vt(e) {
3216
+ return jt(ze(e))?.config || {};
3014
3217
  }
3015
- function wt(t) {
3016
- const e = Be(t);
3017
- return t.serverSide.advancedConfigs?.[e] || {};
3218
+ function Ht(e) {
3219
+ const t = ze(e);
3220
+ return e.serverSide.advancedConfigs?.[t] || {};
3018
3221
  }
3019
- function Pt(t) {
3020
- const e = Be(t), n = t?.user?.advancedConfigs?.[e], r = n !== void 0 ? n : t?.user?.advancedConfigs?.pro;
3222
+ function Wt(e) {
3223
+ const t = ze(e), n = e?.user?.advancedConfigs?.[t], r = n !== void 0 ? n : e?.user?.advancedConfigs?.pro;
3021
3224
  return {
3022
- ...t?.advancedConfigs?.[e] || {},
3225
+ ...e?.advancedConfigs?.[t] || {},
3023
3226
  ...r || {}
3024
3227
  };
3025
3228
  }
3026
- function he(t) {
3027
- const e = It(t), n = wt(t);
3229
+ function Ae(e) {
3230
+ const t = Vt(e), n = Ht(e);
3028
3231
  return [
3029
- Pt(t),
3030
- t.user,
3232
+ Wt(e),
3233
+ e.user,
3031
3234
  n,
3032
- t.serverSide,
3033
- e,
3034
- t.base
3235
+ e.serverSide,
3236
+ t,
3237
+ e.base
3035
3238
  ];
3036
3239
  }
3037
- function gr(t) {
3038
- let e;
3039
- for (const n of t) n?.fileManager && (e = {
3040
- ...e || {},
3240
+ function ai(e) {
3241
+ let t;
3242
+ for (const n of e) n?.fileManager && (t = {
3243
+ ...t || {},
3041
3244
  ...n.fileManager
3042
3245
  });
3043
- return e;
3246
+ return t;
3044
3247
  }
3045
- function br(t) {
3046
- return on(t.map((e) => e?.resourceProxy));
3248
+ function oi(e) {
3249
+ return vr(e.map((t) => t?.resourceProxy));
3047
3250
  }
3048
- function hr(t) {
3049
- return cn(t.map((e) => e?.resourceProxyPolicy));
3251
+ function li(e) {
3252
+ return wr(e.map((t) => t?.resourceProxyPolicy));
3050
3253
  }
3051
- function yr(t) {
3052
- return ln(t.map((e) => e?.backendProxy));
3254
+ function si(e) {
3255
+ return Sr(e.map((t) => t?.backendProxy));
3053
3256
  }
3054
- function vr(t) {
3055
- return Oe(t.map((e) => e?.backendProxyPolicy || {}).filter(Boolean));
3257
+ function ui(e) {
3258
+ return Ue(e.map((t) => t?.backendProxyPolicy || {}).filter(Boolean));
3056
3259
  }
3057
- function Z(t) {
3058
- const e = It(t), n = wt(t), r = Pt(t), i = [
3059
- t.base,
3060
- e,
3061
- t.serverSide,
3260
+ function ne(e) {
3261
+ const t = Vt(e), n = Ht(e), r = Wt(e), i = [
3262
+ e.base,
3263
+ t,
3264
+ e.serverSide,
3062
3265
  n,
3063
- t.user,
3266
+ e.user,
3064
3267
  r
3065
- ], a = Oe(i), o = gr(i);
3268
+ ], a = Ue(i), o = ai(i);
3066
3269
  o !== void 0 && (a.fileManager = o);
3067
- const c = br(i);
3270
+ const c = oi(i);
3068
3271
  c !== void 0 && (a.resourceProxy = c);
3069
- const f = hr(i);
3272
+ const f = li(i);
3070
3273
  f && Object.keys(f).length > 0 && (a.resourceProxyPolicy = f);
3071
- const m = yr(i);
3274
+ const m = si(i);
3072
3275
  m !== void 0 && (a.backendProxy = m);
3073
- const p = vr(i);
3276
+ const p = ui(i);
3074
3277
  return p && Object.keys(p).length > 0 && (a.backendProxyPolicy = p), a;
3075
3278
  }
3076
- jt("config/changeConfigModeWithCodeCheck", async (t, { dispatch: e, getState: n }) => {
3077
- e(Ar(t)), e(At.endpoints.editMe.initiate({ email_builder_config: t })), await new Promise((a) => setTimeout(a, 0));
3279
+ an("config/changeConfigModeWithCodeCheck", async (e, { dispatch: t, getState: n }) => {
3280
+ t(ci(e)), t(Gt.endpoints.editMe.initiate({ email_builder_config: e })), await new Promise((a) => setTimeout(a, 0));
3078
3281
  const r = n(), i = r.emailPageSlice?.isCodeMode;
3079
- return r.configSlice?.config?.codeEnabled === !1 && i && e(fr(!1)), t;
3282
+ return r.configSlice?.config?.codeEnabled === !1 && i && t(ei(!1)), e;
3080
3283
  });
3081
- var Sr = ae({
3082
- name: Tt,
3284
+ var di = de({
3285
+ name: zt,
3083
3286
  initialState: () => {
3084
- const t = {
3085
- ...tt,
3287
+ const e = {
3288
+ ...ft,
3086
3289
  config: {
3087
- ...tt.config,
3290
+ ...ft.config,
3088
3291
  mergeTags: void 0
3089
3292
  }
3090
3293
  };
3091
3294
  return {
3092
- base: t.config,
3295
+ base: e.config,
3093
3296
  serverSide: {},
3094
3297
  user: {},
3095
3298
  advancedConfigs: {},
3096
- config: t.config,
3097
- page: t.page,
3098
- project: t.project,
3299
+ config: e.config,
3300
+ page: e.page,
3301
+ project: e.project,
3099
3302
  pluginDefaultCommonStyles: void 0,
3100
3303
  headless: !1
3101
3304
  };
3102
3305
  },
3103
3306
  reducers: {
3104
- setPage: (t, e) => {
3105
- t.page = e.payload;
3307
+ setPage: (e, t) => {
3308
+ e.page = t.payload;
3106
3309
  },
3107
- setAllConfigs: (t, { payload: e }) => {
3108
- t.user = e.user, t.serverSide = e.serverSide, t.advancedConfigs = {
3109
- ...e.advancedConfigs || {},
3110
- ...e.user?.advancedConfigs || {}
3111
- }, t.config = Z(t);
3310
+ setAllConfigs: (e, { payload: t }) => {
3311
+ e.user = t.user, e.serverSide = t.serverSide, e.advancedConfigs = {
3312
+ ...t.advancedConfigs || {},
3313
+ ...t.user?.advancedConfigs || {}
3314
+ }, e.config = ne(e);
3112
3315
  },
3113
- changeConfigMode: (t, e) => {
3114
- t.user.mode = e.payload, t.config = Z(t);
3316
+ changeConfigMode: (e, t) => {
3317
+ e.user.mode = t.payload, e.config = ne(e);
3115
3318
  },
3116
- setInitialMergeTags: (t, e) => {
3117
- t.base.mergeTags = e.payload, t.config.mergeTags = fe(he(t), "mergeTags");
3319
+ setInitialMergeTags: (e, t) => {
3320
+ e.base.mergeTags = t.payload, e.config.mergeTags = ge(Ae(e), "mergeTags");
3118
3321
  },
3119
- setMergeTags: (t, e) => {
3120
- t.user.mergeTags = e.payload, t.config.mergeTags = fe(he(t), "mergeTags");
3322
+ setMergeTags: (e, t) => {
3323
+ e.user.mergeTags = t.payload, e.config.mergeTags = ge(Ae(e), "mergeTags");
3121
3324
  },
3122
- setUserConfig: (t, { payload: e }) => {
3123
- t.user = e, t.config = Z(t);
3325
+ setUserConfig: (e, { payload: t }) => {
3326
+ e.user = t, e.config = ne(e);
3124
3327
  },
3125
- updateUserConfig: (t, { payload: e }) => {
3126
- t.user = {
3127
- ...t.user,
3128
- ...e
3129
- }, t.config = Z(t);
3328
+ updateUserConfig: (e, { payload: t }) => {
3329
+ e.user = {
3330
+ ...e.user,
3331
+ ...t
3332
+ }, e.config = ne(e);
3130
3333
  },
3131
- setProject: (t, e) => {
3132
- t.project = e.payload;
3334
+ setProject: (e, t) => {
3335
+ e.project = t.payload;
3133
3336
  },
3134
- setActiveNextButton: (t, e) => {
3135
- t.user.activeNextButton = e.payload, t.config.activeNextButton = fe(he(t), "activeNextButton") !== void 0;
3337
+ setActiveNextButton: (e, t) => {
3338
+ e.user.activeNextButton = t.payload, e.config.activeNextButton = ge(Ae(e), "activeNextButton") !== void 0;
3136
3339
  },
3137
- setPluginDefaultCommonStyles: (t, e) => {
3138
- e.payload === void 0 ? delete t.pluginDefaultCommonStyles : t.pluginDefaultCommonStyles = e.payload;
3340
+ setPluginDefaultCommonStyles: (e, t) => {
3341
+ t.payload === void 0 ? delete e.pluginDefaultCommonStyles : e.pluginDefaultCommonStyles = t.payload;
3139
3342
  },
3140
- setHeadless: (t, e) => {
3141
- t.headless = e.payload;
3343
+ setHeadless: (e, t) => {
3344
+ e.headless = t.payload;
3142
3345
  }
3143
3346
  },
3144
- extraReducers: (t) => {}
3145
- }), nt = (t) => t[Tt].config, { setPage: Xi, setAllConfigs: $i, updateUserConfig: Wi, setUserConfig: Qi, setProject: Ki, setMergeTags: Ji, changeConfigMode: Ar, setInitialMergeTags: Yi, setActiveNextButton: Zi, setPluginDefaultCommonStyles: ea, setHeadless: ta } = Sr.actions, X = W({
3347
+ extraReducers: (e) => {}
3348
+ }), mt = (e) => e[zt].config, { setPage: Ra, setAllConfigs: Na, updateUserConfig: Fa, setUserConfig: La, setProject: Ba, setMergeTags: ja, changeConfigMode: ci, setInitialMergeTags: qa, setActiveNextButton: Ua, setPluginDefaultCommonStyles: Ga, setHeadless: za } = di.actions, X = K({
3146
3349
  reducerPath: "emailsApi",
3147
3350
  tagTypes: [
3148
3351
  "Emails",
@@ -3150,26 +3353,26 @@ var Sr = ae({
3150
3353
  "EmailAutosaves",
3151
3354
  "TemplateEmail"
3152
3355
  ],
3153
- baseQuery: K({ baseUrl: "https://app.emailmaker.ru/api/wp-json/wp/v2/" }),
3154
- endpoints: (t) => ({
3155
- getEmails: t.query({
3156
- queryFn(e, n) {
3356
+ baseQuery: Z({ baseUrl: "https://app.emailmaker.ru/api/wp-json/wp/v2/" }),
3357
+ endpoints: (e) => ({
3358
+ getEmails: e.query({
3359
+ queryFn(t, n) {
3157
3360
  const r = _(n), i = {
3158
3361
  order: "desc",
3159
3362
  orderby: "modified"
3160
3363
  }, a = {};
3161
- if (e.notEmbed || (a._embed = ""), e.projectId && (a._embed = "author", a._fields = "id,title,meta,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template,_embedded", i["filter[meta_key]"] = "project", i["filter[meta_value]"] = e.projectId), e.fields && (a._fields = e.fields), e.page && (i.page = e.page), e.order && (i.order = e.order), e.orderby && (i.orderby = e.orderby), e.folderTag && e.folderTag !== "all" ? (i["filter[tax_query][relation]"] = "AND", i["filter[tax_query][0][taxonomy]"] = "folder", i["filter[tax_query][0][field]"] = "id", i["filter[tax_query][0][terms]"] = e.folderTag, i["filter[tax_query][0][include_children]"] = "0") : (e.folderTag !== "all" || typeof e.folderTag == "object" && e.folderTag === null) && !e.tags?.length && e.status && e.status !== "trash" && (i["filter[tax_query][0][taxonomy]"] = "folder", i["filter[tax_query][0][operator]"] = "NOT EXISTS"), e.tags?.length > 0 && e.status !== "trash") {
3364
+ if (t.notEmbed || (a._embed = ""), t.projectId && (a._embed = "author", a._fields = "id,title,meta,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template,_embedded", i["filter[meta_key]"] = "project", i["filter[meta_value]"] = t.projectId), t.fields && (a._fields = t.fields), t.page && (i.page = t.page), t.order && (i.order = t.order), t.orderby && (i.orderby = t.orderby), t.folderTag && t.folderTag !== "all" ? (i["filter[tax_query][relation]"] = "AND", i["filter[tax_query][0][taxonomy]"] = "folder", i["filter[tax_query][0][field]"] = "id", i["filter[tax_query][0][terms]"] = t.folderTag, i["filter[tax_query][0][include_children]"] = "0") : (t.folderTag !== "all" || typeof t.folderTag == "object" && t.folderTag === null) && !t.tags?.length && t.status && t.status !== "trash" && (i["filter[tax_query][0][taxonomy]"] = "folder", i["filter[tax_query][0][operator]"] = "NOT EXISTS"), t.tags?.length > 0 && t.status !== "trash") {
3162
3365
  i["filter[tax_query][relation]"] = "AND";
3163
- for (let o = 0, c = e.tags.length; o < c; o++) {
3164
- const f = e.tags[o];
3366
+ for (let o = 0, c = t.tags.length; o < c; o++) {
3367
+ const f = t.tags[o];
3165
3368
  i[`filter[tax_query][${o + 1}][taxonomy]`] = "emailtags", i[`filter[tax_query][${o + 1}][field]`] = "id", i[`filter[tax_query][${o + 1}][terms]`] = f;
3166
3369
  }
3167
3370
  }
3168
- return e.name && (i.search = e.name), e.pageSize && (i.per_page = e.pageSize), e.status === "trash" && (a.status = "trash"), r.wp.email_list(i, { extraQuery: a }).then((o) => C(x)(o));
3371
+ return t.name && (i.search = t.name), t.pageSize && (i.per_page = t.pageSize), t.status === "trash" && (a.status = "trash"), r.wp.email_list(i, { extraQuery: a }).then((o) => x(O)(o));
3169
3372
  },
3170
- providesTags: (e, n, r, { response: i }) => {
3373
+ providesTags: (t, n, r, { response: i }) => {
3171
3374
  const a = i?.headers.get("X-WP-Total") || 0;
3172
- return e ? [...e.map(({ id: o }) => ({
3375
+ return t ? [...t.map(({ id: o }) => ({
3173
3376
  type: "Emails",
3174
3377
  id: `${r.folderTag || r.tags?.[0] || r.projectId}_${r.page}_${r.status}_${a}`
3175
3378
  })), {
@@ -3182,8 +3385,8 @@ var Sr = ae({
3182
3385
  },
3183
3386
  keepUnusedDataFor: 0
3184
3387
  }),
3185
- getTemplateEmails: t.query({
3186
- queryFn(e, n) {
3388
+ getTemplateEmails: e.query({
3389
+ queryFn(t, n) {
3187
3390
  const r = _(n), i = {
3188
3391
  "filter[meta_query][1][key]": "is_template",
3189
3392
  "filter[meta_query][1][value]": "1",
@@ -3194,36 +3397,36 @@ var Sr = ae({
3194
3397
  _embed: "author,wp:term",
3195
3398
  _fields: "_embedded,id,title,meta,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,acf.is_template"
3196
3399
  };
3197
- if (e.emailId && (i["filter[meta_query][0][key]"] = "parent_email", i["filter[meta_query][0][value]"] = e.emailId), e.fields && (a._fields = e.fields), e.group?.length > 0 || e.projectGroup?.length > 0) {
3198
- const o = [...e.group || [], ...e.projectGroup || []].reduce((f, { key: m, parentId: p }) => (f[p] || (f[p] = []), f[p].push(String(m)), f), {}), c = Object.values(o).map((f) => f.sort());
3400
+ if (t.emailId && (i["filter[meta_query][0][key]"] = "parent_email", i["filter[meta_query][0][value]"] = t.emailId), t.fields && (a._fields = t.fields), t.group?.length > 0 || t.projectGroup?.length > 0) {
3401
+ const o = [...t.group || [], ...t.projectGroup || []].reduce((f, { key: m, parentId: p }) => (f[p] || (f[p] = []), f[p].push(String(m)), f), {}), c = Object.values(o).map((f) => f.sort());
3199
3402
  i["filter[tax_query][relation]"] = "AND", c.forEach((f, m) => {
3200
3403
  i[`filter[tax_query][${m}][relation]`] = "OR", f.forEach((p, s) => {
3201
3404
  i[`filter[tax_query][${m}][${s}][taxonomy]`] = "group", i[`filter[tax_query][${m}][${s}][field]`] = "id", i[`filter[tax_query][${m}][${s}][terms]`] = p;
3202
3405
  });
3203
3406
  });
3204
3407
  }
3205
- if (e.tags?.length > 0) {
3408
+ if (t.tags?.length > 0) {
3206
3409
  i["filter[tax_query][relation]"] = "AND";
3207
- for (let o = 0, c = e.tags.length; o < c; o++) {
3208
- const f = e.tags[o];
3410
+ for (let o = 0, c = t.tags.length; o < c; o++) {
3411
+ const f = t.tags[o];
3209
3412
  i[`filter[tax_query][${o}][taxonomy]`] = "emailtags", i[`filter[tax_query][${o}][field]`] = "id", i[`filter[tax_query][${o}][terms]`] = f;
3210
3413
  }
3211
3414
  }
3212
- if (e.type && (i["filter[meta_query][2][key]"] = "type", i["filter[meta_query][2][value]"] = e.type), e.name && (i.search = e.name), e.pageSize && (i.per_page = e.pageSize), e.page) {
3213
- i.page = e.page;
3415
+ if (t.type && (i["filter[meta_query][2][key]"] = "type", i["filter[meta_query][2][value]"] = t.type), t.name && (i.search = t.name), t.pageSize && (i.per_page = t.pageSize), t.page) {
3416
+ i.page = t.page;
3214
3417
  const { groupsTemplateProjectTotal: o, groupsTemplateProjectTotalPages: c } = n.getState()?.projectSlice;
3215
- if (!e.projectGroup?.length && !e.group?.length && c < e.page && e.groupType === lr.ALL && o && c && !e.projectId) {
3216
- const f = 24 - o % 24 + (e.page - (c + 1)) * 24;
3418
+ if (!t.projectGroup?.length && !t.group?.length && c < t.page && t.groupType === Qr.ALL && o && c && !t.projectId) {
3419
+ const f = 24 - o % 24 + (t.page - (c + 1)) * 24;
3217
3420
  f && (i.page = 1, i.offset = f);
3218
3421
  }
3219
3422
  }
3220
- return e.projectId && (i["filter[meta_key]"] = "project", i["filter[meta_value]"] = e.projectId), r.wp.email_list(i, { extraQuery: a }).then(C(x));
3423
+ return t.projectId && (i["filter[meta_key]"] = "project", i["filter[meta_value]"] = t.projectId), r.wp.email_list(i, { extraQuery: a }).then(x(O));
3221
3424
  },
3222
3425
  keepUnusedDataFor: 0
3223
3426
  }),
3224
- getEmail: t.query({
3225
- queryFn(e, n) {
3226
- return _(n).wp.email_detail({ id: T(e) }, { extraQuery: {
3427
+ getEmail: e.query({
3428
+ queryFn(t, n) {
3429
+ return _(n).wp.email_detail({ id: I(t) }, { extraQuery: {
3227
3430
  _embed: "wp:term",
3228
3431
  _fields: `_embedded,id,author,title,meta,emailtags,folder,group,modified,date,type,parent,date_gmt
3229
3432
  acf.description,
@@ -3237,17 +3440,17 @@ var Sr = ae({
3237
3440
  acf.subject,
3238
3441
  acf.utm_parameters
3239
3442
  `
3240
- } }).then(S(x));
3443
+ } }).then(S(O));
3241
3444
  },
3242
- providesTags: (e, n, r) => [{
3445
+ providesTags: (t, n, r) => [{
3243
3446
  type: "Email",
3244
3447
  id: r
3245
3448
  }],
3246
3449
  keepUnusedDataFor: 0
3247
3450
  }),
3248
- getTemplateEmail: t.query({
3249
- queryFn(e, n) {
3250
- return _(n).wp.email_detail({ id: T(e) }, { extraQuery: {
3451
+ getTemplateEmail: e.query({
3452
+ queryFn(t, n) {
3453
+ return _(n).wp.email_detail({ id: I(t) }, { extraQuery: {
3251
3454
  _embed: "wp:term",
3252
3455
  _fields: `_embedded,id,author,title,meta,emailtags,folder,group,modified,date,type,parent,date_gmt
3253
3456
  acf.description,
@@ -3261,36 +3464,36 @@ var Sr = ae({
3261
3464
  acf.subject,
3262
3465
  acf.utm_parameters
3263
3466
  `
3264
- } }).then(S(x));
3467
+ } }).then(S(O));
3265
3468
  },
3266
- providesTags: (e, n, r) => [{
3469
+ providesTags: (t, n, r) => [{
3267
3470
  type: "TemplateEmail",
3268
3471
  id: r
3269
3472
  }],
3270
3473
  keepUnusedDataFor: 0
3271
3474
  }),
3272
- getEmailHistory: t.query({
3273
- queryFn({ emailId: e, page: n = 1 }, r) {
3475
+ getEmailHistory: e.query({
3476
+ queryFn({ emailId: t, page: n = 1 }, r) {
3274
3477
  return _(r).wp.email_revisions_list({
3275
- parent: e,
3478
+ parent: t,
3276
3479
  per_page: 20,
3277
3480
  page: n
3278
- }, { extraQuery: { _fields: "author,slug,date,modified,title,meta,acf.html,acf.common_styles,id,parent,date_gmt" } }).then((i) => oe(i, (a, o) => ({
3481
+ }, { extraQuery: { _fields: "author,slug,date,modified,title,meta,acf.html,acf.common_styles,id,parent,date_gmt" } }).then((i) => ce(i, (a, o) => ({
3279
3482
  data: a.filter((c) => c.acf.html).map((c) => ({
3280
3483
  ...c,
3281
3484
  acf: {
3282
3485
  ...c.acf,
3283
3486
  html: c.acf.html
3284
3487
  }
3285
- })).map(We),
3488
+ })).map(nt),
3286
3489
  totalPages: +o.response.headers.get("X-WP-TotalPages"),
3287
3490
  args: {
3288
- emailId: e,
3491
+ emailId: t,
3289
3492
  page: n
3290
3493
  }
3291
3494
  })));
3292
3495
  },
3293
- providesTags: (e) => e ? [...e.data.map(({ id: n }) => ({
3496
+ providesTags: (t) => t ? [...t.data.map(({ id: n }) => ({
3294
3497
  type: "EmailAutosaves",
3295
3498
  id: n
3296
3499
  })), {
@@ -3301,65 +3504,65 @@ var Sr = ae({
3301
3504
  id: "LIST"
3302
3505
  }],
3303
3506
  keepUnusedDataFor: 0,
3304
- async onQueryStarted({ emailId: e }, { queryFulfilled: n, dispatch: r, getState: i }) {
3507
+ async onQueryStarted({ emailId: t }, { queryFulfilled: n, dispatch: r, getState: i }) {
3305
3508
  try {
3306
- const { data: a } = await n, o = i(), c = nt(o).revisionService === !0, f = o.emailSlice?.email?.html ?? null;
3307
- z.onHistoryFetched(e, a.data, r, () => r(X.endpoints.getEmailHistory.initiate({ emailId: e }, { forceRefetch: !0 })), c, f);
3509
+ const { data: a } = await n, o = i(), c = mt(o).revisionService === !0, f = o.emailSlice?.email?.html ?? null;
3510
+ H.onHistoryFetched(t, a.data, r, () => r(X.endpoints.getEmailHistory.initiate({ emailId: t }, { forceRefetch: !0 })), c, f);
3308
3511
  } catch {
3309
- z.onHistoryFetchError(e, r);
3512
+ H.onHistoryFetchError(t, r);
3310
3513
  }
3311
3514
  }
3312
3515
  }),
3313
- addEmail: t.mutation({
3314
- queryFn: Te((e) => ({ source: n, ...r }) => _(e).wp.email_create({
3516
+ addEmail: e.mutation({
3517
+ queryFn: Ce((t) => ({ source: n, ...r }) => _(t).wp.email_create({
3315
3518
  status: "publish",
3316
- ...$e(r)
3317
- }, { type: k.Json }).then(S(x))),
3519
+ ...tt(r)
3520
+ }, { type: C.Json }).then(S(O))),
3318
3521
  invalidatesTags: [{
3319
3522
  type: "Emails",
3320
3523
  id: "LIST"
3321
3524
  }]
3322
3525
  }),
3323
- editEmail: t.mutation({ queryFn: Te((e) => ({ emailId: n, source: r, ...i }) => {
3324
- const a = _(e), o = Q($e(i));
3526
+ editEmail: e.mutation({ queryFn: Ce((t) => ({ emailId: n, source: r, ...i }) => {
3527
+ const a = _(t), o = Y(tt(i));
3325
3528
  return a.wp.email_partial_update({ id: n }, o, {
3326
- type: k.Json,
3529
+ type: C.Json,
3327
3530
  extraQuery: {
3328
3531
  _embed: "wp:term",
3329
3532
  _fields: "_embedded,id,author,title,meta,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"
3330
3533
  }
3331
- }).then(S(x));
3534
+ }).then(S(O));
3332
3535
  }) }),
3333
- deleteEmail: t.mutation({
3334
- queryFn(e, n) {
3536
+ deleteEmail: e.mutation({
3537
+ queryFn(t, n) {
3335
3538
  const r = _(n);
3336
3539
  let i, a;
3337
- return typeof e == "object" ? (i = e.id, a = e.force) : (i = e, a = !1), r.wp.email_delete({ id: i }, { force: a }).then(Ne(x));
3540
+ return typeof t == "object" ? (i = t.id, a = t.force) : (i = t, a = !1), r.wp.email_delete({ id: i }, { force: a }).then(qe(O));
3338
3541
  },
3339
- invalidatesTags: (e, n, r) => [{
3542
+ invalidatesTags: (t, n, r) => [{
3340
3543
  type: "Emails",
3341
3544
  id: r
3342
3545
  }]
3343
3546
  }),
3344
- addTag: t.mutation({ queryFn(e, n) {
3345
- return _(n).wp.emailtags_create({ ...e }, { type: k.Json });
3547
+ addTag: e.mutation({ queryFn(t, n) {
3548
+ return _(n).wp.emailtags_create({ ...t }, { type: C.Json });
3346
3549
  } }),
3347
- getDeletableTag: t.query({ queryFn([e, n], r) {
3550
+ getDeletableTag: e.query({ queryFn([t, n], r) {
3348
3551
  return _(r).wp.email_list({
3349
3552
  status: ["private"],
3350
3553
  "filter[meta_key]": "project",
3351
- "filter[meta_value]": e,
3554
+ "filter[meta_value]": t,
3352
3555
  emailtags: [n]
3353
- }, { extraQuery: { "_fields[]": "emailtags" } }).then(C(x));
3556
+ }, { extraQuery: { "_fields[]": "emailtags" } }).then(x(O));
3354
3557
  } }),
3355
- autoSaveEmail: t.mutation({
3356
- queryFn({ emailId: e, body: n }, r) {
3357
- const i = _(r), a = Sn(n);
3358
- return i.wp.email_autosaves_create({ id: e }, a, { type: k.FormData }).then(S(We));
3558
+ autoSaveEmail: e.mutation({
3559
+ queryFn({ emailId: t, body: n }, r) {
3560
+ const i = _(r), a = er(n);
3561
+ return i.wp.email_autosaves_create({ id: t }, a, { type: C.FormData }).then(S(nt));
3359
3562
  },
3360
- async onQueryStarted({ emailId: e, body: n }, { queryFulfilled: r, getState: i }) {
3361
- const a = nt(i()).revisionService === !0;
3362
- a && z.onAutoSaveStarted(e, {
3563
+ async onQueryStarted({ emailId: t, body: n }, { queryFulfilled: r, getState: i }) {
3564
+ const a = mt(i()).revisionService === !0;
3565
+ a && H.onAutoSaveStarted(t, {
3363
3566
  sentAt: Date.now(),
3364
3567
  html: n.html ?? "",
3365
3568
  common_styles: n.common_styles ?? "",
@@ -3367,19 +3570,19 @@ var Sr = ae({
3367
3570
  preheader: n.preheader
3368
3571
  });
3369
3572
  try {
3370
- await r, a && z.onAutoSaveCompleted(e);
3573
+ await r, a && H.onAutoSaveCompleted(t);
3371
3574
  } catch {
3372
- a && z.onAutoSaveCompleted(e);
3575
+ a && H.onAutoSaveCompleted(t);
3373
3576
  }
3374
3577
  }
3375
3578
  })
3376
3579
  })
3377
- }), { useGetEmailsQuery: na, useGetTemplateEmailsQuery: ra, useGetEmailQuery: ia, useLazyGetEmailQuery: aa, useGetEmailHistoryQuery: oa, useLazyGetEmailHistoryQuery: la, useAddEmailMutation: sa, useEditEmailMutation: da, useDeleteEmailMutation: ua, useGetDeletableTagQuery: ca, useAddTagMutation: fa, useAutoSaveEmailMutation: ma } = X;
3378
- function L({ title: t, acf: e, ...n }) {
3379
- const { members: r, projects_test_emails: i, ftp_settings: a, emails: o, blocks: c, webhook: f, inbox_email: m, integrations: p } = e, s = A(r) ? r : void 0;
3580
+ }), { useGetEmailsQuery: Va, useGetTemplateEmailsQuery: Ha, useGetEmailQuery: Wa, useLazyGetEmailQuery: $a, useGetEmailHistoryQuery: Xa, useLazyGetEmailHistoryQuery: Qa, useAddEmailMutation: Ka, useEditEmailMutation: Ja, useDeleteEmailMutation: Ya, useGetDeletableTagQuery: Za, useAddTagMutation: eo, useAutoSaveEmailMutation: to } = X;
3581
+ function j({ title: e, acf: t, ...n }) {
3582
+ const { members: r, projects_test_emails: i, ftp_settings: a, emails: o, blocks: c, webhook: f, inbox_email: m, integrations: p } = t, s = A(r) ? r : void 0;
3380
3583
  return {
3381
3584
  ...n,
3382
- title: R(t) || "",
3585
+ title: F(e) || "",
3383
3586
  members: s ? {
3384
3587
  admins: s.admins && s.admins.map((l) => ({
3385
3588
  ...l,
@@ -3411,19 +3614,19 @@ function L({ title: t, acf: e, ...n }) {
3411
3614
  blocks: c
3412
3615
  };
3413
3616
  }
3414
- function rt({ title: t, members: e, projects_test_emails: n, inbox_email: r, ftp_settings: i, webhook: a, integrations: o, emails: c, blocks: f, ...m }) {
3415
- const p = (u) => Array.isArray(u) ? u : u ? [u] : [], s = (u) => ({ ID: T(u.ID || u) }), l = (u) => p(u).map(s), d = e && {
3416
- admins: l(e.admins),
3417
- users: l(e.users),
3418
- viewers: l(e.viewers),
3419
- invited_users: l(e.invited_users),
3420
- owner: e.owner && s(e.owner)
3617
+ function pt({ title: e, members: t, projects_test_emails: n, inbox_email: r, ftp_settings: i, webhook: a, integrations: o, emails: c, blocks: f, ...m }) {
3618
+ const p = (d) => Array.isArray(d) ? d : d ? [d] : [], s = (d) => ({ ID: I(d.ID || d) }), l = (d) => p(d).map(s), u = t && {
3619
+ admins: l(t.admins),
3620
+ users: l(t.users),
3621
+ viewers: l(t.viewers),
3622
+ invited_users: l(t.invited_users),
3623
+ owner: t.owner && s(t.owner)
3421
3624
  };
3422
3625
  return {
3423
3626
  ...m,
3424
- title: t,
3627
+ title: e,
3425
3628
  acf: {
3426
- members: d,
3629
+ members: u,
3427
3630
  webhook: a,
3428
3631
  projects_test_emails: n,
3429
3632
  inbox_email: r,
@@ -3434,105 +3637,105 @@ function rt({ title: t, members: e, projects_test_emails: n, inbox_email: r, ftp
3434
3637
  }
3435
3638
  };
3436
3639
  }
3437
- var w = "Projects", ee = "LIST";
3438
- function Tr(t) {
3439
- if (Array.isArray(t)) return t;
3440
- if (t != null && typeof t == "object") {
3441
- const e = t.projects;
3442
- if (Array.isArray(e)) return e;
3640
+ var P = "Projects", re = "LIST";
3641
+ function fi(e) {
3642
+ if (Array.isArray(e)) return e;
3643
+ if (e != null && typeof e == "object") {
3644
+ const t = e.projects;
3645
+ if (Array.isArray(t)) return t;
3443
3646
  }
3444
3647
  return [];
3445
3648
  }
3446
- function Ir(t) {
3447
- if (typeof t == "number" && Number.isFinite(t) && t >= 0) return Math.trunc(t);
3448
- if (typeof t == "string" && t.trim() !== "") {
3449
- const e = parseInt(t, 10);
3450
- if (Number.isFinite(e) && e >= 0) return e;
3649
+ function mi(e) {
3650
+ if (typeof e == "number" && Number.isFinite(e) && e >= 0) return Math.trunc(e);
3651
+ if (typeof e == "string" && e.trim() !== "") {
3652
+ const t = parseInt(e, 10);
3653
+ if (Number.isFinite(t) && t >= 0) return t;
3451
3654
  }
3452
3655
  }
3453
- function wr(t) {
3454
- if (t == null || typeof t != "object" || Array.isArray(t)) return { title: "" };
3455
- const e = t, n = Ir(e.emails_count);
3656
+ function pi(e) {
3657
+ if (e == null || typeof e != "object" || Array.isArray(e)) return { title: "" };
3658
+ const t = e, n = mi(t.emails_count);
3456
3659
  return {
3457
- id: e.id,
3458
- title: typeof e.title == "string" ? e.title : "",
3660
+ id: t.id,
3661
+ title: typeof t.title == "string" ? t.title : "",
3459
3662
  ...n != null ? { emails: n } : {}
3460
3663
  };
3461
3664
  }
3462
- var kt = W({
3665
+ var $t = K({
3463
3666
  reducerPath: "projectsApi",
3464
- tagTypes: [w, "project"],
3465
- baseQuery: K({ baseUrl: "https://app.emailmaker.ru/api/wp-json/wp/v2/" }),
3466
- endpoints: (t) => ({
3467
- getProjects: t.query({
3468
- queryFn(e = { page: 1 }, n) {
3667
+ tagTypes: [P, "project"],
3668
+ baseQuery: Z({ baseUrl: "https://app.emailmaker.ru/api/wp-json/wp/v2/" }),
3669
+ endpoints: (e) => ({
3670
+ getProjects: e.query({
3671
+ queryFn(t = { page: 1 }, n) {
3469
3672
  const r = _(n), i = { status: ["private"] };
3470
- return e.page && (i.page = e.page), e.order && (i.order = e.order), e.orderby && (i.orderby = e.orderby), e.search && (i.search = e.search), e.after && (i.after = e.after), e.before && (i.before = e.before), e.per_page != null && (i.per_page = e.per_page), r.wp.project_list(i).then((a) => {
3471
- const o = C(L)(a);
3673
+ return t.page && (i.page = t.page), t.order && (i.order = t.order), t.orderby && (i.orderby = t.orderby), t.search && (i.search = t.search), t.after && (i.after = t.after), t.before && (i.before = t.before), t.per_page != null && (i.per_page = t.per_page), r.wp.project_list(i).then((a) => {
3674
+ const o = x(j)(a);
3472
3675
  if (o.error) return { error: o.error };
3473
- const c = a.headers?.get?.("X-WP-Total"), f = a.headers?.get?.("X-WP-TotalPages"), m = c != null && c !== "" ? parseInt(String(c), 10) : NaN, p = f != null && f !== "" ? parseInt(String(f), 10) : NaN, s = Math.max(1, e.per_page ?? 12), l = Number.isFinite(p) ? p : Number.isFinite(m) ? Math.max(1, Math.ceil(m / s)) : NaN, d = o.data.length, u = Math.max(1, e.page ?? 1), E = s;
3474
- let g = m, b = l;
3475
- return Number.isFinite(g) ? Number.isFinite(b) || (b = Math.max(1, Math.ceil(g / E))) : u === 1 ? d === 0 ? (g = 0, b = 1) : d < E ? (g = d, b = 1) : (g = d + 1, b = 2) : d === 0 ? (g = Math.max(0, (u - 1) * E), b = Math.max(1, u - 1)) : d < E ? (g = (u - 1) * E + d, b = u) : (g = u * E + 1, b = u + 1), {
3676
+ const c = a.headers?.get?.("X-WP-Total"), f = a.headers?.get?.("X-WP-TotalPages"), m = c != null && c !== "" ? parseInt(String(c), 10) : NaN, p = f != null && f !== "" ? parseInt(String(f), 10) : NaN, s = Math.max(1, t.per_page ?? 12), l = Number.isFinite(p) ? p : Number.isFinite(m) ? Math.max(1, Math.ceil(m / s)) : NaN, u = o.data.length, d = Math.max(1, t.page ?? 1), E = s;
3677
+ let g = m, h = l;
3678
+ return Number.isFinite(g) ? Number.isFinite(h) || (h = Math.max(1, Math.ceil(g / E))) : d === 1 ? u === 0 ? (g = 0, h = 1) : u < E ? (g = u, h = 1) : (g = u + 1, h = 2) : u === 0 ? (g = Math.max(0, (d - 1) * E), h = Math.max(1, d - 1)) : u < E ? (g = (d - 1) * E + u, h = d) : (g = d * E + 1, h = d + 1), {
3476
3679
  data: o.data,
3477
3680
  meta: { projectsListPagination: {
3478
3681
  total: g,
3479
- totalPages: b
3682
+ totalPages: h
3480
3683
  } }
3481
3684
  };
3482
3685
  });
3483
3686
  },
3484
- providesTags: (e) => e ? [...e.map(({ id: n }) => ({
3485
- type: w,
3687
+ providesTags: (t) => t ? [...t.map(({ id: n }) => ({
3688
+ type: P,
3486
3689
  id: n
3487
3690
  })), {
3488
- type: w,
3489
- id: ee
3691
+ type: P,
3692
+ id: re
3490
3693
  }] : [{
3491
- type: w,
3492
- id: ee
3694
+ type: P,
3695
+ id: re
3493
3696
  }]
3494
3697
  }),
3495
- getProject: t.query({
3496
- queryFn(e, n) {
3497
- return _(n).wp.project_detail({ id: e }, { extraQuery: { _embed: "wp:term" } }).then(S(L));
3698
+ getProject: e.query({
3699
+ queryFn(t, n) {
3700
+ return _(n).wp.project_detail({ id: t }, { extraQuery: { _embed: "wp:term" } }).then(S(j));
3498
3701
  },
3499
- providesTags: (e, n, r) => [{
3702
+ providesTags: (t, n, r) => [{
3500
3703
  type: "project",
3501
3704
  id: r
3502
3705
  }]
3503
3706
  }),
3504
- addProject: t.mutation({
3505
- queryFn(e, n) {
3707
+ addProject: e.mutation({
3708
+ queryFn(t, n) {
3506
3709
  return _(n).wp.project_create({
3507
3710
  status: "private",
3508
- ...rt(e)
3509
- }, { type: k.Json }).then(S(L));
3711
+ ...pt(t)
3712
+ }, { type: C.Json }).then(S(j));
3510
3713
  },
3511
3714
  invalidatesTags: [{
3512
- type: w,
3513
- id: ee
3715
+ type: P,
3716
+ id: re
3514
3717
  }]
3515
3718
  }),
3516
- editProject: t.mutation({
3517
- queryFn({ projectId: e, ...n }, r) {
3518
- const i = _(r), a = Q(rt(n), !0);
3519
- return i.wp.project_partial_update({ id: e }, a, { type: k.Json }).then(S(L));
3719
+ editProject: e.mutation({
3720
+ queryFn({ projectId: t, ...n }, r) {
3721
+ const i = _(r), a = Y(pt(n), !0);
3722
+ return i.wp.project_partial_update({ id: t }, a, { type: C.Json }).then(S(j));
3520
3723
  },
3521
- invalidatesTags: (e, n, { projectId: r }) => [{
3522
- type: w,
3724
+ invalidatesTags: (t, n, { projectId: r }) => [{
3725
+ type: P,
3523
3726
  id: r
3524
3727
  }, {
3525
3728
  type: "project",
3526
3729
  id: r
3527
3730
  }]
3528
3731
  }),
3529
- deleteProject: t.mutation({
3530
- queryFn(e, n) {
3531
- return _(n).wp.project_delete({ id: e }, {}).then(Ne(L));
3732
+ deleteProject: e.mutation({
3733
+ queryFn(t, n) {
3734
+ return _(n).wp.project_delete({ id: t }, {}).then(qe(j));
3532
3735
  },
3533
- invalidatesTags: (e, n, r) => [
3736
+ invalidatesTags: (t, n, r) => [
3534
3737
  {
3535
- type: w,
3738
+ type: P,
3536
3739
  id: r
3537
3740
  },
3538
3741
  {
@@ -3540,18 +3743,18 @@ var kt = W({
3540
3743
  id: r
3541
3744
  },
3542
3745
  {
3543
- type: w,
3544
- id: ee
3746
+ type: P,
3747
+ id: re
3545
3748
  }
3546
3749
  ]
3547
3750
  }),
3548
- getFrequentProjects: t.query({
3549
- async queryFn(e, n) {
3550
- const r = typeof e == "number" && e > 0 ? e : 5, i = _(n);
3751
+ getFrequentProjects: e.query({
3752
+ async queryFn(t, n) {
3753
+ const r = typeof t == "number" && t > 0 ? t : 5, i = _(n);
3551
3754
  try {
3552
3755
  const a = await i.projects.top_used_list({ limit: r });
3553
3756
  if (!a.ok || a.error) throw a.error ?? /* @__PURE__ */ new Error("top-used request failed");
3554
- const o = Tr(a.data), c = C(wr)({
3757
+ const o = fi(a.data), c = x(pi)({
3555
3758
  data: o,
3556
3759
  error: a.error,
3557
3760
  meta: a.meta
@@ -3564,101 +3767,101 @@ var kt = W({
3564
3767
  orderby: "modified",
3565
3768
  status: ["private"]
3566
3769
  });
3567
- return C(L)({
3770
+ return x(j)({
3568
3771
  data: a.data,
3569
3772
  error: a.error,
3570
3773
  meta: a.meta
3571
3774
  });
3572
3775
  }
3573
3776
  },
3574
- providesTags: (e) => e && e.length > 0 ? [...e.map(({ id: n }) => ({
3575
- type: w,
3777
+ providesTags: (t) => t && t.length > 0 ? [...t.map(({ id: n }) => ({
3778
+ type: P,
3576
3779
  id: n
3577
3780
  })), {
3578
- type: w,
3781
+ type: P,
3579
3782
  id: "FREQUENT"
3580
3783
  }] : [{
3581
- type: w,
3784
+ type: P,
3582
3785
  id: "FREQUENT"
3583
3786
  }]
3584
3787
  })
3585
3788
  })
3586
- }), { useGetProjectsQuery: pa, useGetProjectQuery: _a, useAddProjectMutation: Ea, useEditProjectMutation: ga, useGetFrequentProjectsQuery: ba } = kt, Pr = "Taxonomies", D = () => window.location.toString().includes("/blocks") ? "block" : "", kr = () => window.location.toString().includes("/blocks") ? "block" : "email", Ct = W({
3789
+ }), { useGetProjectsQuery: no, useGetProjectQuery: ro, useAddProjectMutation: io, useEditProjectMutation: ao, useGetFrequentProjectsQuery: oo } = $t, _i = "Taxonomies", D = () => window.location.toString().includes("/blocks") ? "block" : "", Ei = () => window.location.toString().includes("/blocks") ? "block" : "email", Xt = K({
3587
3790
  reducerPath: "taxonomiesApi",
3588
3791
  tagTypes: [
3589
- Pr,
3792
+ _i,
3590
3793
  "folder",
3591
3794
  "block_folder",
3592
3795
  "Group"
3593
3796
  ],
3594
- baseQuery: K({ baseUrl: "https://app.emailmaker.ru/api/wp-json/wp/v2/" }),
3595
- endpoints: (t) => ({
3596
- addFolder: t.mutation({ queryFn(e, n) {
3597
- return _(n).wp[D() + "folder_create"](e).then((r) => r);
3797
+ baseQuery: Z({ baseUrl: "https://app.emailmaker.ru/api/wp-json/wp/v2/" }),
3798
+ endpoints: (e) => ({
3799
+ addFolder: e.mutation({ queryFn(t, n) {
3800
+ return _(n).wp[D() + "folder_create"](t).then((r) => r);
3598
3801
  } }),
3599
- editFolder: t.mutation({ queryFn({ id: e, data: n }, r) {
3600
- return _(r).wp[D() + "folder_partial_update"]({ id: e }, n).then((i) => i);
3802
+ editFolder: e.mutation({ queryFn({ id: t, data: n }, r) {
3803
+ return _(r).wp[D() + "folder_partial_update"]({ id: t }, n).then((i) => i);
3601
3804
  } }),
3602
- deleteFolder: t.mutation({ queryFn(e, n) {
3603
- return _(n).wp[D() + "folder_delete"]({ id: e }, { force: !0 }).then((r) => r);
3805
+ deleteFolder: e.mutation({ queryFn(t, n) {
3806
+ return _(n).wp[D() + "folder_delete"]({ id: t }, { force: !0 }).then((r) => r);
3604
3807
  } }),
3605
- getFolders: t.query({
3606
- queryFn(e, n) {
3808
+ getFolders: e.query({
3809
+ queryFn(t, n) {
3607
3810
  return _(n).wp[D() + "folder_list"]({
3608
3811
  per_page: 100,
3609
- ...e
3812
+ ...t
3610
3813
  }).then((r) => r);
3611
3814
  },
3612
- providesTags: (e, n, r) => [{
3815
+ providesTags: (t, n, r) => [{
3613
3816
  type: "folder",
3614
3817
  id: r
3615
3818
  }]
3616
3819
  }),
3617
- addGroup: t.mutation({ queryFn(e, n) {
3618
- return _(n).wp[D() + "group_create"](e).then((r) => r);
3820
+ addGroup: e.mutation({ queryFn(t, n) {
3821
+ return _(n).wp[D() + "group_create"](t).then((r) => r);
3619
3822
  } }),
3620
- editGroup: t.mutation({ queryFn({ id: e, data: n }, r) {
3621
- return _(r).wp[D() + "group_partial_update"]({ id: e }, n).then((i) => i);
3823
+ editGroup: e.mutation({ queryFn({ id: t, data: n }, r) {
3824
+ return _(r).wp[D() + "group_partial_update"]({ id: t }, n).then((i) => i);
3622
3825
  } }),
3623
- getGroups: t.query({
3624
- queryFn(e, n) {
3826
+ getGroups: e.query({
3827
+ queryFn(t, n) {
3625
3828
  return _(n).wp[D() + "group_list"]({
3626
3829
  per_page: 100,
3627
- ...e
3830
+ ...t
3628
3831
  }).then((r) => r);
3629
3832
  },
3630
- providesTags: (e, n, r) => [{
3833
+ providesTags: (t, n, r) => [{
3631
3834
  type: "Group",
3632
3835
  id: r
3633
3836
  }]
3634
3837
  }),
3635
- deleteGroup: t.mutation({ queryFn(e, n) {
3636
- return _(n).wp[D() + "group_delete"]({ id: e }, { force: !0 }).then((r) => r);
3838
+ deleteGroup: e.mutation({ queryFn(t, n) {
3839
+ return _(n).wp[D() + "group_delete"]({ id: t }, { force: !0 }).then((r) => r);
3637
3840
  } }),
3638
- addEmailsTag: t.mutation({ queryFn(e, n) {
3639
- return _(n).wp.emailtags_create(e).then((r) => r);
3841
+ addEmailsTag: e.mutation({ queryFn(t, n) {
3842
+ return _(n).wp.emailtags_create(t).then((r) => r);
3640
3843
  } }),
3641
- editEmailsTag: t.mutation({ queryFn({ id: e, ...n }, r) {
3642
- return _(r).wp.emailtags_partial_update(e, n).then((i) => i);
3844
+ editEmailsTag: e.mutation({ queryFn({ id: t, ...n }, r) {
3845
+ return _(r).wp.emailtags_partial_update(t, n).then((i) => i);
3643
3846
  } }),
3644
- deleteEmailsTag: t.mutation({ queryFn(e, n) {
3645
- return _(n).wp.emailtags_delete(e, { force: !0 }).then((r) => r);
3847
+ deleteEmailsTag: e.mutation({ queryFn(t, n) {
3848
+ return _(n).wp.emailtags_delete(t, { force: !0 }).then((r) => r);
3646
3849
  } }),
3647
- getTags: t.query({ queryFn(e, n) {
3648
- return _(n).wp[kr() + "tags_list"]({
3850
+ getTags: e.query({ queryFn(t, n) {
3851
+ return _(n).wp[Ei() + "tags_list"]({
3649
3852
  per_page: 100,
3650
- ...e
3853
+ ...t
3651
3854
  }).then((r) => r);
3652
3855
  } })
3653
3856
  })
3654
- }), { useGetFoldersQuery: ha, useGetGroupsQuery: ya, useLazyGetGroupsQuery: va, useDeleteGroupMutation: Sa, useEditGroupMutation: Aa, useAddGroupMutation: Ta, useGetTagsQuery: Ia, useLazyGetFoldersQuery: wa, useAddFolderMutation: Pa, useEditFolderMutation: ka } = Ct;
3655
- function Cr(t) {
3656
- return t != null && Object.prototype.hasOwnProperty.call(t, "meta");
3857
+ }), { useGetFoldersQuery: lo, useGetGroupsQuery: so, useLazyGetGroupsQuery: uo, useDeleteGroupMutation: co, useEditGroupMutation: fo, useAddGroupMutation: mo, useGetTagsQuery: po, useLazyGetFoldersQuery: _o, useAddFolderMutation: Eo, useEditFolderMutation: go } = Xt;
3858
+ function gi(e) {
3859
+ return e != null && Object.prototype.hasOwnProperty.call(e, "meta");
3657
3860
  }
3658
- function ye(t, e) {
3659
- return Cr(t) ? t.meta : e;
3861
+ function Te(e, t) {
3862
+ return gi(e) ? e.meta : t;
3660
3863
  }
3661
- var V = {
3864
+ var W = {
3662
3865
  appliedShowToken: 0,
3663
3866
  invalidateEmailId: null,
3664
3867
  editorThemeColor: "light",
@@ -3723,97 +3926,97 @@ var V = {
3723
3926
  projectGroups: [],
3724
3927
  isNeedUpdateAppearance: !1,
3725
3928
  isNeedUpdateContentAppearance: !1
3726
- }, { setEditorThemeColor: Ca, setEmailSettings: xa, setElementSettings: Ma, setEmailSettingsDisable: Da, setSearchFilters: Oa, updateSearchFilters: Ra, setEmailSubject: Na, setEmailPreheader: Ba, setEmailHTML: La, resetEmailSlice: Fa, setEmailTitle: ja, setEmailFromHistory: qa, setEmailMeta: Ua, setIsInited: Ga, setEmailIsAmp: za, setProblemsList: Va, setActiveProblemRange: Ha, setEmailGroups: Xa, setIsNeedUpdateAppearance: $a, setIsNeedUpdateContentAppearance: Wa } = ae({
3929
+ }, { setEditorThemeColor: ho, setEmailSettings: bo, setElementSettings: yo, setEmailSettingsDisable: vo, setSearchFilters: So, updateSearchFilters: Ao, setEmailSubject: To, setEmailPreheader: Io, setEmailHTML: wo, resetEmailSlice: Po, setEmailTitle: ko, setEmailFromHistory: Co, setEmailMeta: xo, setIsInited: Oo, setEmailIsAmp: Mo, setProblemsList: Do, setActiveProblemRange: Ro, setEmailGroups: No, setIsNeedUpdateAppearance: Fo, setIsNeedUpdateContentAppearance: Lo } = de({
3727
3930
  name: "emailSlice",
3728
- initialState: V,
3931
+ initialState: W,
3729
3932
  reducers: {
3730
- setEditorThemeColor: (t, e) => {
3731
- t.editorThemeColor = e.payload;
3933
+ setEditorThemeColor: (e, t) => {
3934
+ e.editorThemeColor = t.payload;
3732
3935
  },
3733
- setEmailFromHistory: (t, { payload: e }) => {
3734
- if (!e) return;
3735
- const n = t.email, r = e?.preheader === void 0, i = e?.subject === void 0, a = ye(e, n.meta);
3736
- t.email = {
3936
+ setEmailFromHistory: (e, { payload: t }) => {
3937
+ if (!t) return;
3938
+ const n = e.email, r = t?.preheader === void 0, i = t?.subject === void 0, a = Te(t, n.meta);
3939
+ e.email = {
3737
3940
  ...n,
3738
- html: e?.html,
3739
- preheader: r ? n.preheader : e?.preheader,
3740
- subject: i ? n.subject : e?.subject,
3741
- common_styles: typeof e?.common_styles == "string" && e?.common_styles.startsWith("{") ? e?.common_styles : n.common_styles || "{}",
3941
+ html: t?.html,
3942
+ preheader: r ? n.preheader : t?.preheader,
3943
+ subject: i ? n.subject : t?.subject,
3944
+ common_styles: typeof t?.common_styles == "string" && t?.common_styles.startsWith("{") ? t?.common_styles : n.common_styles || "{}",
3742
3945
  ...a !== void 0 ? { meta: a } : {}
3743
- }, t.isNeedUpdateAppearance = !0, t.isNeedUpdateContentAppearance = !0;
3946
+ }, e.isNeedUpdateAppearance = !0, e.isNeedUpdateContentAppearance = !0;
3744
3947
  },
3745
- setEmailSettings: (t, { payload: e }) => {
3746
- Object.assign(t, {
3747
- ...t,
3748
- settings: { ...e },
3948
+ setEmailSettings: (e, { payload: t }) => {
3949
+ Object.assign(e, {
3950
+ ...e,
3951
+ settings: { ...t },
3749
3952
  isSettingsDisabled: !1
3750
3953
  });
3751
3954
  },
3752
- setEmailSettingsDisable: (t, e) => {
3753
- t.isSettingsDisabled = e.payload;
3955
+ setEmailSettingsDisable: (e, t) => {
3956
+ e.isSettingsDisabled = t.payload;
3754
3957
  },
3755
- setElementSettings: (t, { payload: e }) => {
3756
- t.elementSettings = e;
3958
+ setElementSettings: (e, { payload: t }) => {
3959
+ e.elementSettings = t;
3757
3960
  },
3758
- setSearchFilters: (t, e) => {
3759
- t.searchFilters = e.payload;
3961
+ setSearchFilters: (e, t) => {
3962
+ e.searchFilters = t.payload;
3760
3963
  },
3761
- updateSearchFilters: (t, e) => {
3762
- t.searchFilters = {
3763
- ...t.searchFilters,
3764
- ...e.payload
3964
+ updateSearchFilters: (e, t) => {
3965
+ e.searchFilters = {
3966
+ ...e.searchFilters,
3967
+ ...t.payload
3765
3968
  };
3766
3969
  },
3767
- setEmailHTML: (t, e) => {
3768
- t.email.html = e.payload;
3970
+ setEmailHTML: (e, t) => {
3971
+ e.email.html = t.payload;
3769
3972
  },
3770
- setEmailSubject: (t, e) => {
3771
- (t.email.title === t.email.subject || !t.email.subject && !t.email.title) && (t.email.title = e.payload), t.email.subject = e.payload;
3973
+ setEmailSubject: (e, t) => {
3974
+ (e.email.title === e.email.subject || !e.email.subject && !e.email.title) && (e.email.title = t.payload), e.email.subject = t.payload;
3772
3975
  },
3773
- setEmailPreheader: (t, e) => {
3774
- t.email.preheader = e.payload;
3976
+ setEmailPreheader: (e, t) => {
3977
+ e.email.preheader = t.payload;
3775
3978
  },
3776
- resetEmailSlice: (t) => {
3777
- const e = t.emailAutosaveTimestamps;
3979
+ resetEmailSlice: (e) => {
3980
+ const t = e.emailAutosaveTimestamps;
3778
3981
  return {
3779
- ...V,
3780
- emailAutosaveTimestamps: e
3982
+ ...W,
3983
+ emailAutosaveTimestamps: t
3781
3984
  };
3782
3985
  },
3783
- setEmailTitle: (t, e) => {
3784
- t.email.title = e.payload;
3986
+ setEmailTitle: (e, t) => {
3987
+ e.email.title = t.payload;
3785
3988
  },
3786
- setEmailMeta: (t, e) => {
3787
- if (e.payload === void 0) {
3788
- delete t.email.meta;
3989
+ setEmailMeta: (e, t) => {
3990
+ if (t.payload === void 0) {
3991
+ delete e.email.meta;
3789
3992
  return;
3790
3993
  }
3791
- t.email.meta = {
3792
- ...t.email.meta ?? {},
3793
- ...e.payload
3994
+ e.email.meta = {
3995
+ ...e.email.meta ?? {},
3996
+ ...t.payload
3794
3997
  };
3795
3998
  },
3796
- setIsInited: (t, e) => {
3797
- t.email.is_inited = e.payload;
3999
+ setIsInited: (e, t) => {
4000
+ e.email.is_inited = t.payload;
3798
4001
  },
3799
- setEmailIsAmp: (t, e) => {
3800
- t.email.isAmp = e.payload;
4002
+ setEmailIsAmp: (e, t) => {
4003
+ e.email.isAmp = t.payload;
3801
4004
  },
3802
- setProblemsList: (t, e) => {
3803
- t.problemsList = e.payload;
4005
+ setProblemsList: (e, t) => {
4006
+ e.problemsList = t.payload;
3804
4007
  },
3805
- setActiveProblemRange: (t, e) => {
3806
- t.activeProblemRange = e.payload;
4008
+ setActiveProblemRange: (e, t) => {
4009
+ e.activeProblemRange = t.payload;
3807
4010
  },
3808
- setIsNeedUpdateContentAppearance: (t, e) => {
3809
- t.isNeedUpdateContentAppearance = e.payload;
4011
+ setIsNeedUpdateContentAppearance: (e, t) => {
4012
+ e.isNeedUpdateContentAppearance = t.payload;
3810
4013
  },
3811
- setIsNeedUpdateAppearance: (t, e) => {
3812
- t.isNeedUpdateAppearance = e.payload;
4014
+ setIsNeedUpdateAppearance: (e, t) => {
4015
+ e.isNeedUpdateAppearance = t.payload;
3813
4016
  },
3814
- setEmailGroups: (t, { payload: e }) => {
3815
- const n = Object.keys(e)[0], r = t.emailGroups, i = t.parentGroupOfProject, a = t.projectGroups, o = {};
3816
- i && a.length && (e[n]?.forEach((c) => {
4017
+ setEmailGroups: (e, { payload: t }) => {
4018
+ const n = Object.keys(t)[0], r = e.emailGroups, i = e.parentGroupOfProject, a = e.projectGroups, o = {};
4019
+ i && a.length && (t[n]?.forEach((c) => {
3817
4020
  const f = a.find((p) => p.id === +n), m = f?.children.find((p) => p.id === +c);
3818
4021
  m ? (o.hasOwnProperty(f.id) || (o[f.id] = []), o[f.id].push({
3819
4022
  label: m.name,
@@ -3822,60 +4025,60 @@ var V = {
3822
4025
  label: c,
3823
4026
  value: null
3824
4027
  }));
3825
- }), e[n].length === 0 && (o[n] = [])), t.emailGroups = {
4028
+ }), t[n].length === 0 && (o[n] = [])), e.emailGroups = {
3826
4029
  ...r,
3827
4030
  ...o
3828
4031
  };
3829
4032
  }
3830
4033
  },
3831
- extraReducers: (t) => {
3832
- t.addMatcher((e) => e.type === "emailsApi/queries/queryResultPatched", (e, n) => {
4034
+ extraReducers: (e) => {
4035
+ e.addMatcher((t) => t.type === "emailsApi/queries/queryResultPatched", (t, n) => {
3833
4036
  const r = n.payload.queryCacheKey.match(/\("([0-9]+)"\)/), i = n.payload?.patches[0];
3834
- i?.path?.[0] && (e.email[i?.path[0]] = i.value), r?.[1] && (e.invalidateEmailId = r[1]), e.emailIsEdit = !0;
3835
- }), t.addMatcher((e) => e.type === "emailsApi/invalidateTags", (e, n) => {
3836
- if (n.payload[0].id === +e.invalidateEmailId) return V;
3837
- }), t.addMatcher(X.endpoints.editEmail.matchFulfilled, (e, { payload: n }) => {
3838
- e.invalidateEmailId = null;
3839
- const r = ye(n, e.email.meta);
3840
- e.email = {
3841
- ...e.email,
4037
+ i?.path?.[0] && (t.email[i?.path[0]] = i.value), r?.[1] && (t.invalidateEmailId = r[1]), t.emailIsEdit = !0;
4038
+ }), e.addMatcher((t) => t.type === "emailsApi/invalidateTags", (t, n) => {
4039
+ if (n.payload[0].id === +t.invalidateEmailId) return W;
4040
+ }), e.addMatcher(X.endpoints.editEmail.matchFulfilled, (t, { payload: n }) => {
4041
+ t.invalidateEmailId = null;
4042
+ const r = Te(n, t.email.meta);
4043
+ t.email = {
4044
+ ...t.email,
3842
4045
  ...n,
3843
- renderGuid: e.email.renderGuid,
4046
+ renderGuid: t.email.renderGuid,
3844
4047
  ...r !== void 0 ? { meta: r } : {}
3845
4048
  };
3846
- }), t.addMatcher(X.endpoints.autoSaveEmail.matchFulfilled, (e, n) => {
3847
- e.email.id?.toString() === n.payload.parent?.toString() && (e.email.html = n.payload.html, n.payload.modified && (e.email.modified = n.payload.modified, e.emailAutosaveTimestamps[n.payload.parent] = n.payload.modified));
3848
- }), t.addMatcher(X.endpoints.getEmail.matchFulfilled, (e, { payload: n }) => {
3849
- const r = e.email, i = ye(n, n.id === r?.id ? r.meta : void 0), a = r?.id != null && r.id === n.id, o = n.showToken, c = n.showId, f = re.isPlugin && c != null && c !== "";
3850
- if (re.isPlugin && !f && o === void 0 && a && e.appliedShowToken > 0) {
3851
- n.id, e.appliedShowToken, r?.id, r?.showId;
4049
+ }), e.addMatcher(X.endpoints.autoSaveEmail.matchFulfilled, (t, n) => {
4050
+ t.email.id?.toString() === n.payload.parent?.toString() && (t.email.html = n.payload.html, n.payload.modified && (t.email.modified = n.payload.modified, t.emailAutosaveTimestamps[n.payload.parent] = n.payload.modified));
4051
+ }), e.addMatcher(X.endpoints.getEmail.matchFulfilled, (t, { payload: n }) => {
4052
+ const r = t.email, i = Te(n, n.id === r?.id ? r.meta : void 0), a = r?.id != null && r.id === n.id, o = n.showToken, c = n.showId, f = le.isPlugin && c != null && c !== "";
4053
+ if (le.isPlugin && !f && o === void 0 && a && t.appliedShowToken > 0) {
4054
+ n.id, t.appliedShowToken, r?.id, r?.showId;
3852
4055
  return;
3853
4056
  }
3854
4057
  if (!f) {
3855
- if (o !== void 0 && o < e.appliedShowToken) {
3856
- n.id, e.appliedShowToken, r?.id;
4058
+ if (o !== void 0 && o < t.appliedShowToken) {
4059
+ n.id, t.appliedShowToken, r?.id;
3857
4060
  return;
3858
4061
  }
3859
4062
  const g = r?.renderGuid != null && r.renderGuid === n.renderGuid;
3860
- if (re.isPlugin && o === void 0 && e.appliedShowToken > 0 && n.id !== r?.id && !g) {
3861
- n.id, e.appliedShowToken, r?.id;
4063
+ if (le.isPlugin && o === void 0 && t.appliedShowToken > 0 && n.id !== r?.id && !g) {
4064
+ n.id, t.appliedShowToken, r?.id;
3862
4065
  return;
3863
4066
  }
3864
4067
  }
3865
- const m = f || o !== void 0 && o !== e.appliedShowToken, p = a && n.modified !== void 0 && r.modified === n.modified, s = a && r.is_inited === !0 && p && !m && !!r.html?.trim(), l = a && r.renderGuid ? r.renderGuid : n.renderGuid ?? lt(), { showToken: d, showId: u, ...E } = n;
3866
- e.email = {
3867
- ...V.email,
4068
+ const m = f || o !== void 0 && o !== t.appliedShowToken, p = a && n.modified !== void 0 && r.modified === n.modified, s = a && r.is_inited === !0 && p && !m && !!r.html?.trim(), l = a && r.renderGuid ? r.renderGuid : n.renderGuid ?? ht(), { showToken: u, showId: d, ...E } = n;
4069
+ t.email = {
4070
+ ...W.email,
3868
4071
  ...E,
3869
4072
  ...c ? { showId: c } : {},
3870
4073
  renderGuid: l,
3871
4074
  ...s ? { html: r.html } : {},
3872
- is_inited: n.is_inited || (a ? r?.is_inited : V.email.is_inited),
4075
+ is_inited: n.is_inited || (a ? r?.is_inited : W.email.is_inited),
3873
4076
  common_styles: typeof n?.common_styles == "string" && n?.common_styles.startsWith("{") ? n?.common_styles : "{}",
3874
4077
  ...i !== void 0 ? { meta: i } : {}
3875
- }, o !== void 0 ? e.appliedShowToken = o : (!a || r.is_inited !== !0 || !p) && (e.appliedShowToken += 1), n.id, e.appliedShowToken, r?.id, e.emailIsEdit = !1;
3876
- }), t.addMatcher(Ct.endpoints.getGroups.matchFulfilled, (e, { meta: n, payload: r }) => {
3877
- const i = e.email.group, a = n.arg.originalArgs.parent, o = r;
3878
- a && (e.parentGroupOfProject = a, e.projectGroups = o);
4078
+ }, o !== void 0 ? t.appliedShowToken = o : (!a || r.is_inited !== !0 || !p) && (t.appliedShowToken += 1), n.id, t.appliedShowToken, r?.id, t.emailIsEdit = !1;
4079
+ }), e.addMatcher(Xt.endpoints.getGroups.matchFulfilled, (t, { meta: n, payload: r }) => {
4080
+ const i = t.email.group, a = n.arg.originalArgs.parent, o = r;
4081
+ a && (t.parentGroupOfProject = a, t.projectGroups = o);
3879
4082
  const c = {};
3880
4083
  a && i.length && o.length && i?.forEach((f) => {
3881
4084
  o?.forEach((m) => {
@@ -3885,103 +4088,103 @@ var V = {
3885
4088
  value: p.id
3886
4089
  }));
3887
4090
  });
3888
- }), e.emailGroups = c;
3889
- }), t.addMatcher(kt.endpoints.getProject.matchFulfilled, (e, { meta: n, payload: r }) => {
3890
- e.parentGroupOfProject = r.group?.[0] || null;
4091
+ }), t.emailGroups = c;
4092
+ }), e.addMatcher($t.endpoints.getProject.matchFulfilled, (t, { meta: n, payload: r }) => {
4093
+ t.parentGroupOfProject = r.group?.[0] || null;
3891
4094
  });
3892
4095
  }
3893
4096
  }).actions;
3894
- var xt = "Editor mount element was removed from the document. Call instance.destroy() on host unmount.";
3895
- function Dr() {
3896
- return ke(xt);
4097
+ var Qt = "Editor mount element was removed from the document. Call instance.destroy() on host unmount.";
4098
+ function yi() {
4099
+ return De(Qt);
3897
4100
  }
3898
- function Or(t) {
3899
- return !(t instanceof DOMException) || t.name !== "AbortError" ? !1 : t.message === xt;
4101
+ function vi(e) {
4102
+ return !(e instanceof DOMException) || e.name !== "AbortError" ? !1 : e.message === Qt;
3900
4103
  }
3901
- function Rr(t, e, n) {
4104
+ function Si(e, t, n) {
3902
4105
  if (typeof document > "u") return;
3903
4106
  let r = !1, i;
3904
4107
  const a = () => {
3905
4108
  r = !0, i?.disconnect(), i = void 0;
3906
4109
  }, o = () => {
3907
- r || (a(), e());
4110
+ r || (a(), t());
3908
4111
  };
3909
- if (n.addDispose(a), !t.isConnected) {
4112
+ if (n.addDispose(a), !e.isConnected) {
3910
4113
  queueMicrotask(o);
3911
4114
  return;
3912
4115
  }
3913
4116
  i = new MutationObserver(() => {
3914
- t.isConnected || o();
4117
+ e.isConnected || o();
3915
4118
  });
3916
- let c = t.parentNode;
4119
+ let c = e.parentNode;
3917
4120
  for (; c;) i.observe(c, { childList: !0 }), c = c.parentNode;
3918
4121
  }
3919
- function Nr(t) {
3920
- const { hostElementOption: e, resolvedElement: n, externalSignal: r, disposable: i } = t;
3921
- if (e === void 0 || !(n instanceof Element)) return r;
4122
+ function Ai(e) {
4123
+ const { hostElementOption: t, resolvedElement: n, externalSignal: r, disposable: i } = e;
4124
+ if (t === void 0 || !(n instanceof Element)) return r;
3922
4125
  const a = new AbortController();
3923
- return Rr(n, () => {
3924
- n.id, a.abort(Dr());
3925
- }, i), gt(r, a.signal);
3926
- }
3927
- var Mt = "Superseded by newer init() on the same mount element";
3928
- function it() {
3929
- return ke(Mt);
3930
- }
3931
- function Br(t) {
3932
- return !(t instanceof DOMException) || t.name !== "AbortError" ? !1 : t.message === Mt;
3933
- }
3934
- var te = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new WeakMap();
3935
- function Lr(t) {
3936
- if (t instanceof Element) {
3937
- const e = t.id?.trim();
3938
- if (e) return `#${e}`;
4126
+ return Si(n, () => {
4127
+ n.id, a.abort(yi());
4128
+ }, i), Mt(r, a.signal);
4129
+ }
4130
+ var Kt = "Superseded by newer init() on the same mount element";
4131
+ function _t() {
4132
+ return De(Kt);
4133
+ }
4134
+ function Ti(e) {
4135
+ return !(e instanceof DOMException) || e.name !== "AbortError" ? !1 : e.message === Kt;
4136
+ }
4137
+ var ie = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new WeakMap();
4138
+ function Ii(e) {
4139
+ if (e instanceof Element) {
4140
+ const t = e.id?.trim();
4141
+ if (t) return `#${t}`;
3939
4142
  }
3940
4143
  }
3941
- function Fr(t) {
3942
- if (!(t instanceof Element)) return { release: () => {} };
3943
- const e = Lr(t);
3944
- ne.get(t)?.abort(it()), e && te.get(e)?.abort(it());
4144
+ function wi(e) {
4145
+ if (!(e instanceof Element)) return { release: () => {} };
4146
+ const t = Ii(e);
4147
+ ae.get(e)?.abort(_t()), t && ie.get(t)?.abort(_t());
3945
4148
  const n = new AbortController();
3946
- return ne.set(t, n), e && te.set(e, n), {
4149
+ return ae.set(e, n), t && ie.set(t, n), {
3947
4150
  signal: n.signal,
3948
4151
  release: () => {
3949
- ne.get(t) === n && ne.delete(t), e && te.get(e) === n && te.delete(e);
4152
+ ae.get(e) === n && ae.delete(e), t && ie.get(t) === n && ie.delete(t);
3950
4153
  }
3951
4154
  };
3952
4155
  }
3953
- function jr(t, e) {
4156
+ function Pi(e, t) {
3954
4157
  return {
3955
- ...t,
3956
- element: e
4158
+ ...e,
4159
+ element: t
3957
4160
  };
3958
4161
  }
3959
- function we() {
4162
+ function Oe() {
3960
4163
  return () => {};
3961
4164
  }
3962
- function qr(t) {
3963
- const e = t.element;
3964
- return !e || typeof e == "string" || typeof document > "u" ? we() : (Jt(e, t.config?.styles, e), () => {
3965
- Yt(e);
4165
+ function ki(e) {
4166
+ const t = e.element;
4167
+ return !t || typeof t == "string" || typeof document > "u" ? Oe() : (gn(t, e.config?.styles, t), () => {
4168
+ hn(t);
3966
4169
  });
3967
4170
  }
3968
- function Ur(t) {
3969
- if (!ct() || t.initialSpinner === !1 || typeof document > "u") return {
3970
- options: t,
3971
- cleanup: we()
4171
+ function Ci(e) {
4172
+ if (!At() || e.initialSpinner === !1 || typeof document > "u") return {
4173
+ options: e,
4174
+ cleanup: Oe()
3972
4175
  };
3973
- const e = t.element;
3974
- if (!e || typeof e == "string") return {
3975
- options: t,
3976
- cleanup: we()
4176
+ const t = e.element;
4177
+ if (!t || typeof t == "string") return {
4178
+ options: e,
4179
+ cleanup: Oe()
3977
4180
  };
3978
- e.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((i) => {
4181
+ t.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((i) => {
3979
4182
  i.remove();
3980
4183
  });
3981
- const n = tn(e, "data-emailmaker"), r = t.handleChunkLoaded;
4184
+ const n = vn(t, "data-emailmaker"), r = e.handleChunkLoaded;
3982
4185
  return {
3983
4186
  options: {
3984
- ...t,
4187
+ ...e,
3985
4188
  handleChunkLoaded: () => {
3986
4189
  n(), r?.();
3987
4190
  }
@@ -3989,91 +4192,91 @@ function Ur(t) {
3989
4192
  cleanup: n
3990
4193
  };
3991
4194
  }
3992
- function Gr(t) {
3993
- return t?.length ? t.some((e) => Array.isArray(e) ? !1 : !!(e && typeof e == "object" && "url" in e)) : !1;
4195
+ function xi(e) {
4196
+ return e?.length ? e.some((t) => Array.isArray(t) ? !1 : !!(t && typeof t == "object" && "url" in t)) : !1;
3994
4197
  }
3995
- function at(t) {
3996
- return t instanceof DOMException && t.name === "AbortError";
4198
+ function Et(e) {
4199
+ return e instanceof DOMException && e.name === "AbortError";
3997
4200
  }
3998
- function ot(t) {
4201
+ function gt(e) {
3999
4202
  try {
4000
- t.destroy();
4203
+ e.destroy();
4001
4204
  } catch {}
4002
4205
  }
4003
- function ve(t, ...e) {
4004
- const n = O.get(t);
4005
- e.some((r) => r !== void 0 && r === n) && O.delete(t);
4206
+ function Ie(e, ...t) {
4207
+ const n = R.get(e);
4208
+ t.some((r) => r !== void 0 && r === n) && R.delete(e);
4006
4209
  }
4007
- var Qa = "1.1.43";
4008
- async function Ka(t) {
4009
- await ut(typeof window.__emailmaker__ < "u" ? window.__emailmaker__ : void 0);
4210
+ var Bo = "1.1.45-alpha.1";
4211
+ async function jo(e) {
4212
+ await St(typeof window.__emailmaker__ < "u" ? window.__emailmaker__ : void 0);
4010
4213
  }
4011
- async function Ja(t) {
4012
- return zr(t);
4214
+ async function qo(e) {
4215
+ return Oi(e);
4013
4216
  }
4014
- async function zr(t) {
4015
- P(t.signal);
4016
- const e = new Rt();
4217
+ async function Oi(e) {
4218
+ k(e.signal);
4219
+ const t = new Zt();
4017
4220
  let n;
4018
4221
  try {
4019
- const r = await Ft(t.element, e, t.signal), i = Nr({
4020
- hostElementOption: t.element,
4222
+ const r = await rn(e.element, t, e.signal), i = Ai({
4223
+ hostElementOption: e.element,
4021
4224
  resolvedElement: r,
4022
- externalSignal: t.signal,
4023
- disposable: e
4024
- }), a = Fr(r);
4225
+ externalSignal: e.signal,
4226
+ disposable: t
4227
+ }), a = wi(r);
4025
4228
  n = a.release;
4026
- const o = gt(i, a.signal);
4027
- return await Lt(Vr(t, r, o), o);
4229
+ const o = Mt(i, a.signal);
4230
+ return await nn(Mi(e, r, o), o);
4028
4231
  } finally {
4029
- n?.(), e.dispose();
4232
+ n?.(), t.dispose();
4030
4233
  }
4031
4234
  }
4032
- async function Vr(t, e, n) {
4033
- P(n);
4034
- const r = gn(hn(jr(t, e))), i = n != null ? {
4235
+ async function Mi(e, t, n) {
4236
+ k(n), Xn();
4237
+ const r = Wn(Jn(Pi(e, t))), i = n != null ? {
4035
4238
  ...r,
4036
4239
  signal: n
4037
4240
  } : r;
4038
- if (e) {
4039
- const m = O.get(e);
4241
+ if (t) {
4242
+ const m = R.get(t);
4040
4243
  if (m) {
4041
4244
  let p;
4042
4245
  try {
4043
- p = await m, P(n);
4246
+ p = await m, k(n);
4044
4247
  } catch (s) {
4045
- if (P(n), ve(e, m), at(s)) throw s;
4248
+ if (k(n), Ie(t, m), Et(s)) throw s;
4046
4249
  p = void 0;
4047
4250
  }
4048
- if (p) if (p.getElement() === e) try {
4251
+ if (p) if (p.getElement() === t) try {
4049
4252
  return await p.reset(i);
4050
4253
  } catch (s) {
4051
- if (P(n), Br(s) || Or(s) || at(s) && n?.aborted) throw s;
4052
- ve(e, m, p), ot(p);
4254
+ if (k(n), Ti(s) || vi(s) || Et(s) && n?.aborted) throw s;
4255
+ Ie(t, m, p), gt(p);
4053
4256
  }
4054
- else ve(e, m, p), ot(p);
4257
+ else Ie(t, m, p), gt(p);
4055
4258
  }
4056
4259
  }
4057
- P(n);
4058
- const a = qr(r), o = Ur(r), c = n != null ? {
4260
+ k(n);
4261
+ const a = ki(r), o = Ci(r), c = n != null ? {
4059
4262
  ...o.options,
4060
4263
  signal: n
4061
4264
  } : o.options;
4062
4265
  let f;
4063
4266
  try {
4064
- await dt(), P(n);
4267
+ await vt(), k(n);
4065
4268
  const m = typeof window.__emailmaker__ < "u" ? window.__emailmaker__ : void 0;
4066
- Gr(c.plugins) ? (await De(m), P(n)) : $t(m), P(n), f = Me().then((s) => s.init(c)), e && O.set(e, f);
4269
+ xi(c.plugins) ? (await Le(m), k(n)) : mn(m), k(n), f = Fe().then((s) => s.init(c)), t && R.set(t, f);
4067
4270
  const p = await f;
4068
- if (n?.aborted && (p.destroy(), P(n)), e) if (O.get(e) === f) O.set(e, p);
4069
- else throw p.destroy(), P(n), ke(n?.reason);
4271
+ if (n?.aborted && (p.destroy(), k(n)), t) if (R.get(t) === f) R.set(t, p);
4272
+ else throw p.destroy(), k(n), De(n?.reason);
4070
4273
  return p;
4071
4274
  } catch (m) {
4072
- throw a(), o.cleanup(), e && f && O.get(e) === f && O.delete(e), m;
4275
+ throw a(), o.cleanup(), t && f && R.get(t) === f && R.delete(t), m;
4073
4276
  }
4074
4277
  }
4075
- async function Ya(t) {
4076
- return (await Me()).parseAMP(t);
4278
+ async function Uo(e) {
4279
+ return (await Fe()).parseAMP(e);
4077
4280
  }
4078
- typeof window < "u" && Wt(typeof window.__emailmaker__ < "u" ? window.__emailmaker__ : void 0);
4079
- export { xt as ELEMENT_DETACHED_ABORT_MESSAGE, Mt as SUPERSEDED_INIT_ABORT_MESSAGE, $r as errors, Wr as helpers, Ja as init, Or as isElementDetachedError, Br as isSupersededInitError, Ya as parseAMP, Xr as pluginRegistry, Ka as preload, Qa as version };
4281
+ typeof window < "u" && pn(typeof window.__emailmaker__ < "u" ? window.__emailmaker__ : void 0);
4282
+ export { Qt as ELEMENT_DETACHED_ABORT_MESSAGE, Kt as SUPERSEDED_INIT_ABORT_MESSAGE, Ni as errors, Fi as helpers, qo as init, vi as isElementDetachedError, Ti as isSupersededInitError, Uo as parseAMP, Ri as pluginRegistry, jo as preload, Bo as version };