@emailmaker/emailmaker 1.1.4 → 1.1.6

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 (52) hide show
  1. package/README.md +2 -2
  2. package/emailmaker-core.0e62ec4f.js +1 -0
  3. package/emailmaker-esm.js +3 -3
  4. package/emailmaker.d.ts +20 -12
  5. package/emailmaker.js +3 -3
  6. package/iframe/js/amp.BtGt-xkd.js +1 -0
  7. package/iframe/js/iframe-eblock.js +1 -1
  8. package/iframe/js/iframe.js +1 -1
  9. package/iframe/js/rules.CNqvmp_P.js +1 -1
  10. package/iframe/js/sanitize-html.BzjMWt1k.js +1 -0
  11. package/package.json +1 -1
  12. package/static/core/{d5bba58c.js → 18a6d849.js} +1 -1
  13. package/static/core/{fcb5a15a.js → 2395566a.js} +4 -4
  14. package/static/core/{a29e21f4.js → 32c094cc.js} +1 -1
  15. package/static/core/{24946254.js → 33abfdde.js} +2 -2
  16. package/static/core/37da3ac2.js +1 -0
  17. package/static/core/{b810b62b.js → 3ba2a2df.js} +1 -1
  18. package/static/core/{edf6a1bb.js → 5929a1fb.js} +2 -2
  19. package/static/core/5f2e1ad8.js +1 -0
  20. package/static/core/{7a60accf.js → 77e5c7c2.js} +1 -1
  21. package/static/core/8c582ee0.js +1 -0
  22. package/static/core/92011db22.js +1 -0
  23. package/static/core/{e572105f.js → 92ad1565.js} +16 -16
  24. package/static/core/9856c4cd.js +1 -0
  25. package/static/core/992af66a.js +1 -0
  26. package/static/core/{62cd8965.js → aa02cba4.js} +6 -6
  27. package/static/core/{31db2775.js → b2851f05.js} +1 -1
  28. package/static/core/{c4ddaf1d.js → b949d092.js} +2 -2
  29. package/static/core/bbb9f7e92.js +1 -0
  30. package/static/core/{5cdb0560.js → c229993d.js} +7 -7
  31. package/static/core/{b1fd86b4.js → c900a8e5.js} +2 -2
  32. package/static/core/{786ef914.js → cea7a3d0.js} +1 -1
  33. package/static/core/{5be0cf92.js → e46bb831.js} +1 -1
  34. package/static/core/{34b8b5ce.js → e544e2af.js} +44 -44
  35. package/static/core/{d1bf7655.js → f75a0a8d.js} +2 -2
  36. package/static/esm/27964dfe.js +1 -0
  37. package/static/esm/c1e3467e.js +1 -0
  38. package/emailmaker-core.a1df38d3.js +0 -1
  39. package/iframe/js/amp.BiJ6w6WR.js +0 -1
  40. package/iframe/js/sanitize-html.3OUPclIN.js +0 -1
  41. package/static/core/25f8e56b2.js +0 -1
  42. package/static/core/28ca49a6.js +0 -1
  43. package/static/core/39ea46f3.js +0 -1
  44. package/static/core/62164d9a2.js +0 -1
  45. package/static/core/857a130e.js +0 -1
  46. package/static/core/8cc8d689.js +0 -1
  47. package/static/core/94941958.js +0 -1
  48. package/static/core/f96a3228.js +0 -1
  49. package/static/esm/48de0f80.js +0 -1
  50. package/static/esm/53bd1900.js +0 -1
  51. /package/iframe/{iframe-eblock.a1df38d3.html → iframe-eblock.0e62ec4f.html} +0 -0
  52. /package/iframe/{iframe.a1df38d3.html → iframe.0e62ec4f.html} +0 -0
package/README.md CHANGED
@@ -34,7 +34,7 @@ npm install @emailmaker/emailmaker
34
34
  | Сборка | Без штатного плагина Webpack/Vite задайте **`publicPath`** (**`__emailmaker__`**). Бандл крупный (React, Monaco и др.). |
35
35
  | Авторизация | **`getAuthToken`** или **`jwtAuth`**; **`client_secret`** только на сервере. |
36
36
  | Файловый менеджер | **`storageProvider`**, **`config.imageCenterFileManagerView: true`**, при необходимости секция **`config.fileManager`** (**`ExportedApi.FileManagerOptions`**). Контракт **`StorageProvider`** объёмен — сверяйтесь с типами. |
37
- | **`baseUrl`** | Базовый URL API приложения (**`AppInitMixin`**), если бэкенд не стандартный. |
37
+ | **`baseUrl`** | Origin API без суффикса `/wp-json` (напр. `https://api.emailmaker.ru` или `https://app.emailmaker.ru/api`); SDK добавляет `/wp-json` сам. |
38
38
  | **`standaloneKey`** | Режимы с прокси файлов через события (см. код плагина); редкие сценарии. |
39
39
  | **`commonStyles`** | Опционально на **`init` / `reset`**: объект стилей контента (частичный merge с **`COMMON_STYLES`**). Подробности — **`docs/plugin-content-styles.md`**. |
40
40
 
@@ -98,7 +98,7 @@ import * as emailmaker from '@emailmaker/emailmaker';
98
98
  | **`content`** | Обязательно: HTML-строка или объект письма/шаблона. |
99
99
  | **`config`** | Настройки UI редактора (**`ExportedApi.Config`**). |
100
100
  | **`project`** | Идентификатор проекта в вашей системе / в EmailMaker. |
101
- | **`baseUrl`** | Базовый URL API при кастомном бэкенде (**`AppInitMixin.Options`**). |
101
+ | **`baseUrl`** | Origin API без `/wp-json` (см. **`AppInitMixin.Options`**). |
102
102
  | **`storageProvider`** | Реализация **`StorageProvider`** для файлового менеджера. |
103
103
  | **`standaloneKey`** | Редкие режимы прокси файлов (**`instance.handleFileProxy`** / **`handleUrlProxy`**). |
104
104
  | **`commonStyles`** | Объект стилей контента (частичный **merge** с **`COMMON_STYLES`**). См. **`docs/plugin-content-styles.md`**. |
@@ -0,0 +1 @@
1
+ __emailmaker__.define(`core`,[`require`,`exports`,`module`,`static/core/354bf8a9.js`,`static/core/c229993d.js`,`static/core/c900a8e5.js`,`static/core/aa02cba4.js`,`static/core/77e5c7c2.js`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),e("./static/core/354bf8a9.js");let r=e("./static/core/c229993d.js"),i=e("./static/core/aa02cba4.js"),a=e("./static/core/c900a8e5.js"),o=e("./static/core/77e5c7c2.js");function s(e){return async()=>(await e.app.app_init_create({})).data}function c(e,t,n){e.inject(r._a,void 0);let i;e.injectFactory(r._a,async(e,r)=>i||(i=(async()=>{let e=r?await r:void 0;return t({baseUrl:n.baseUrl,user:n.user,project:n.project,prevApp:e})})(),i),!0)}var l=a.A(e=>{let t,n,i,a,o,l=!1;function u(e){return String(e||``).trim()||void 0}return{setOptions(d){let f=!!e.getInstance(r.wa),p=d.hasOwnProperty(`baseUrl`)?u(d.baseUrl):n,m=p?r.ia(p):void 0;if(d.hasOwnProperty(`baseUrl`)){let n=e.getInstance(r.na);t!==m&&n?.setOptions(m?{baseUrl:m}:{})}let h=i!==d.appInit,g=!r.$i(a,d.user),_=o!==d.project,v=t!==m;if(i=d.appInit,a=d.user,o=d.project,t=m,n=p,f||l&&!h&&!g&&!_&&!v)return;let y=e.getInstance(r.ma);c(e,i||s(y),{baseUrl:n,user:d.user,project:d.project}),l=!0}}}),u=r.Za(),d=r.Za(),f=a.A(e=>({setOptions(t){let n=i.On();e.addService(r.ta,{execute:n.decorate(async n=>{if(!t.jwtAuth)return;let i=e.getInstance(u);if(!e.getInstance(d)){if(!i)try{let n=e.getInstance(r.na)?.getOptions()?.baseUrl||``,a=await fetch(`${n}/jwt-auth/token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t.jwtAuth)});if(!a.ok)throw Error(`JWT auth failed: ${a.status}`);i=(await a.json()).token,e.inject(u,i)}catch{throw e.inject(d,r.hi),Error(r.hi)}i&&n.headers.append(`authorization`,`Bearer ${i}`)}})})}})),p=a.A(e=>{let t,n,a;return{async setOptions(o){let s=a!==o.getAuthToken,c=!r.$i(t,o.user),l=n!==o.project;if(a=o.getAuthToken,t=o.user,n=o.project,!(!e.getInstance(r.wa)||!o.getAuthToken)&&!(!s&&!c&&!l))try{let t=await o.getAuthToken(o.user,o.project);e.inject(r.Ta,Promise.resolve(t||``));let n=i.I(t);if(!n)return;e.inject(r.Ea,n);let a=e.getInstance(r._a),s=a?await a.catch(()=>void 0):void 0;e.inject(r._a,Promise.resolve(i.F(n,s)))}catch{}}}}),m=a.A(e=>{let t=e.getInstance(r.ba),n=new r.Ga,a=i.P(n.event);t.addDispose(()=>{let t=e.getInstance(r.xa);n.fire(t)});let o=t.addDisposable(new i.N(a));return t.addDisposable(n),{setOptions({handleDestroy:e}){o.setListener(e)},instance:{handleDestroy:a,destroy:()=>t.dispose()}}}),h=a.A(e=>{let t=e.getInstance(r.ba),n=i.P(r.Aa(e,r.va)),a=t.addDisposable(new i.N(n));return{setOptions({handleLoad:e}){a.setListener(e)},instance:{handleLoad:n},dispose:()=>t.dispose()}}),g=a.A(e=>{let t=e.getInstance(r.ba),n=t.addDisposable(new r.Wa),a=t.addDisposable(new r.Wa),o=r.ka(e,r.ya),s=i.P(n.event),c=i.P(a.event),l=i.P(o.event),u=t.addDisposable(new i.N(s)),d=t.addDisposable(new i.N(c)),f=t.addDisposable(new i.N(l));return{instance:{handleSetOptions:s,handleOptionsChanged:c,handleConfigChanged:l},async setOptions(e){u.setListener(e.handleSetOptions),d.setListener(e.handleOptionsChanged),f.setListener(e.handleConfigChanged),await n.fire(e),await a.fire(e)},dispose(){}}}),_=1e4;function v(e,t,n,r={}){let i=Object.assign({},e);for(let[e,a]of Object.entries(t))if(a!==void 0)if(n.includes(e)&&typeof a==`object`&&a){let t=i[e],n=r[e]??{};i[e]=Object.assign({},typeof t==`object`&&t?t:n,a)}else i[e]=a;return i}var y={border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},borderRadiusCards:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},padding:{all:null,top:null,right:null,bottom:null,left:null}},b={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:16,fontSizeDim:`px`,lineHeight:21,lineHeightDim:`px`,color:`#5a5a5a`,contrastColor:`#FFFFFF`,textAlign:`left`,paddingBottom:10,paddingBottomDim:`px`},x={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:24,fontSizeDim:`px`,lineHeight:32,lineHeightDim:`px`,color:`#333333`,contrastColor:`#FFFFFF`,textAlign:`left`,paddingTop:20,paddingTopDim:`px`,paddingBottom:20,paddingBottomDim:`px`,letterSpacing:0,letterSpacingDim:`px`,bold:!0,italic:!1},S={color:`#1C52DC`,contrastColor:`#FFFFFF`,underline:!0},C={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:16,fontSizeDim:`px`,letterSpacing:0,letterSpacingDim:`px`,color:`#FFFFFF`,contrastColor:`#1C52DC`,bold:!1,italic:!1,backgroundColor:`#1C52DC`,contrastBackgroundColor:`#FFFFFF`,marginTop:10,marginTopDim:`px`,marginBottom:10,marginBottomDim:`px`,border:y.border,borderRadius:y.borderRadius,textAlign:`center`,padding:y.padding},w={backgroundColor:`#FFFFFF`,contrastBackgroundColor:`#1C52DC`,padding:y.padding},T={contrastBackgroundColor:`#1C52DC`,contrastTextColor:`#FFFFFF`,baseBackgroundColor:`#F8F8F8`,baseTextColor:`#333333`,border:y.border,borderRadius:y.borderRadiusCards};function E(e){return{...b,...e}}function D(e){return{...x,...e,bold:e?.bold??x.bold,italic:e?.italic??x.italic}}function O(e){return{...S,...e,underline:e?.underline??S.underline}}function k(e){return{...C,...e,bold:e?.bold??C.bold,italic:e?.italic??C.italic,border:{...C.border,...e?.border??{}},borderRadius:{...C.borderRadius,...e?.borderRadius??{}},padding:{...C.padding,...e?.padding??{}}}}function A(e){return{...w,...e,padding:{...w.padding,...e?.padding??{}}}}function j(e){return{...T,...e,border:{...T.border,...e?.border??{}},borderRadius:{...T.borderRadius,...e?.borderRadius??{}}}}var M=class{_editor;_layoutSettingsChanged=new r.Ga;_contentStylesChanged=new r.Ga;_messageSubscription;_messageSubscriptionPromise;_prevLayoutSnapshot;_prevContentSnapshot;constructor(e){this._editor=e}onChangeEmailLayoutSettings(e){let t=this._layoutSettingsChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}onChangeEmailContentStyles(e){let t=this._contentStylesChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}_disposeMessageSubscriptionIfUnused(){this._layoutSettingsChanged.hasListeners()||this._contentStylesChanged.hasListeners()||(this._messageSubscription?.dispose(),this._messageSubscription=void 0)}_mapLayoutSettings(e={}){return{backgroundColor:e.backgroundColor||``,backgroundImage:(e.backgroundImage||[]).map(e=>({type:`url`,value:e?.value||``})),backgroundPositionX:e.backgroundPositionX||``,backgroundPositionY:e.backgroundPositionY||``,backgroundRepeat:e.backgroundRepeat||``,backgroundSize:e.backgroundSize||``,backgroundColorContent:e.backgroundColorContent||``,textStrong:e.textStrong||!1,textItalic:e.textItalic||!1,textUnderline:e.textUnderline||!1,width:e.width,responsive:e.responsive}}_parseCommonStyles(e){let t={...r.Zi};try{e&&e!==`{}`&&(t=JSON.parse(e))}catch{}return t}_mapCommonStylesToContentStyles(e){return{text:E(e.text),headings:D(e.headings),links:O(e.links),buttons:k(e.buttons),block:A(e.block),cards:j(e.cards)}}_getCurrentLayoutSettings(e){return this._mapLayoutSettings(o.O(e.getState()))}_getCurrentContentStyles(e){return this._mapCommonStylesToContentStyles(this._parseCommonStyles(o.w(e.getState())?.common_styles))}_getLayoutSnapshot(e){return JSON.stringify(e)}_getContentSnapshot(e){return JSON.stringify(e)}async _ensureMessageSubscription(){if(!this._messageSubscription){if(this._messageSubscriptionPromise)return this._messageSubscriptionPromise;this._messageSubscriptionPromise=(async()=>{let e=await this._editor.container.getInstanceAsync(r.Da);if(this._messageSubscription)return;let t=this._editor.container.getOrCreateInstance(r.Ia,()=>new r.Ha),n=this._getCurrentLayoutSettings(e),i=this._getCurrentContentStyles(e);this._prevLayoutSnapshot=this._getLayoutSnapshot(n),this._prevContentSnapshot=this._getContentSnapshot(i),this._messageSubscription=t.addListener(e=>{let t=e?.data?.operation;if(t===r._i.APPLICATION_EMAIL_SETTINGS_SET){let t=this._mapLayoutSettings(e.data?.settings),n=this._getLayoutSnapshot(t);n!==this._prevLayoutSnapshot&&(this._prevLayoutSnapshot=n,this._layoutSettingsChanged.fire(t));return}if(t!==r._i.APPLICATION_COMMON_STYLES_UPDATE)return;let n=this._mapCommonStylesToContentStyles(e.data?.settings?.commonStyles??{...r.Zi}),i=this._getContentSnapshot(n);i!==this._prevContentSnapshot&&(this._prevContentSnapshot=i,this._contentStylesChanged.fire(n))})})();try{await this._messageSubscriptionPromise}finally{this._messageSubscriptionPromise=void 0}}}async getEmailLayoutSettings(){let e=await this._editor.container.getInstanceAsync(r.Da);return await this._waitForEmailSettingsFromIframe(e),this._getCurrentLayoutSettings(e)}async setEmailLayoutSettings(e){let t=await this._editor.container.getInstanceAsync(r.Da);await this._waitForEmailSettingsFromIframe(t);let n={...o.O(t.getState()),...e};t.dispatch(o.W(n));let i=this._mapLayoutSettings(n);this._prevLayoutSnapshot=this._getLayoutSnapshot(i),this._layoutSettingsChanged.fire(i)}async _waitForEmailSettingsFromIframe(e,t=_){let n=e.getState(),i=o.w(n),a=o.O(n);if(i?.is_inited&&a&&Object.keys(a).length>0&&(a.backgroundColor||a.backgroundImage?.[0]?.value||a.width?.value||a.responsive!==void 0)||i?.is_inited)return;let s=this._editor.container,c=r.Aa(s,r.Oa.ON_EMAIL_INIT_ID);return new Promise(e=>{let n=!1,r,i=()=>{r&&=(clearTimeout(r),void 0)},a=c(()=>{n||(n=!0,i(),a.dispose(),e())});r=setTimeout(()=>{n||(n=!0,a.dispose(),e())},t)})}async getEmailContentStyles(){let e=await this._editor.container.getInstanceAsync(r.Da);return this._getCurrentContentStyles(e)}async setEmailContentStyles(e){let t=await this._editor.container.getInstanceAsync(r.Da),n=o.w(t.getState());if(!n)return;let i=this._parseCommonStyles(n.common_styles);e.text!==void 0&&(i.text={...i.text||{},...e.text}),e.headings!==void 0&&(i.headings={...i.headings||{},...e.headings}),e.links!==void 0&&(i.links={...i.links||{},...e.links}),e.buttons!==void 0&&(i.buttons=v(i.buttons||{},e.buttons,[`border`,`borderRadius`,`padding`],{border:y.border,borderRadius:y.borderRadius,padding:y.padding})),e.block!==void 0&&(i.block=v(i.block||{},e.block,[`padding`],{padding:y.padding})),e.cards!==void 0&&(i.cards=v(i.cards||{},e.cards,[`border`,`borderRadius`],{border:y.border,borderRadius:y.borderRadiusCards})),t.dispatch(o.R({...n,common_styles:JSON.stringify(i)}));let a=this._mapCommonStylesToContentStyles(i);this._prevContentSnapshot=this._getContentSnapshot(a),this._contentStylesChanged.fire(a)}},N={...r.ja,EmailSettingsApi:M};({...r.ja});var P={...N};function F(){i.j.addAll(P)}var I=[m,h,g,f,p,a.E,l];async function L(){return(await Promise.resolve().then(()=>e("./static/core/e544e2af.js"))).default}var R=e=>{let t=null,n=!1;return{instance:{},async setOptions(i){if(!t&&!n){t=(await L())(e);let n=await e.getInstanceAsync(r.xa);Object.assign(n,t.instance||{}),F()}t&&await t.setOptions(i)},dispose(){t?.dispose(),n=!0}}},z=a.k([...I,R]),B=class{_storage=Object.create(null);get(e){let t=this._storage[e];return t&&(!t.expires||t.expires<Date.now())?t.value:``}set(e,t,n){this._storage[e]={value:t,expires:n.expires?n.expires*1e3+Date.now():void 0}}remove(e){delete this._storage[e]}},V=100,H={events:[],container:null,collection:null};function U(e,t){H.container=e,H.collection=t,t.onLifecycle(e=>{H.events.push({...e,timestamp:Date.now()}),H.events.length>V&&(H.events=H.events.slice(-100))}),typeof window<`u`&&(window.__EMAILMAKER_DEVTOOLS__=W())}function W(){return{enabled:!0,plugins(){return H.collection?H.collection.getStatus().map(e=>({...e,hasInit:!0,hasDispose:!0,hasAfterInit:!0})):[]},registry(){if(!H.container)return[];try{return H.container.getInstance(i.M).keys().map(String)}catch{return[]}},events(e=50){return H.events.slice(-e)},clearEvents(){H.events=[]},getPlugin(e){if(H.collection)try{return H.collection.use(e)}catch{return}}}}var G=a.k([z]);async function K(e){let t=new r.to;async function n(){let n=r.Xa.createChild();if(e.standaloneKey){n.inject(r.wa,e.standaloneKey);let i=r.Aa(n,r.Oa.FILE_PROXY_EVENT_ID);t.addDisposable(i(async({url:e})=>(await fetch(e)).blob(),Number.MIN_VALUE))}n.inject(r.ba,t),n.inject(r.pa,new B),r.aa(n);let i=G(n),a={...i.instance,container:n};if(n.inject(r.xa,a),await i.setOptions(e),e.devTools)try{let e=n.getInstance(r.Ca);e&&U(n,e)}catch{}return r.ka(n,r.va).fire(a),a}return n()}async function q(e){let t=new Map;typeof e==`object`&&(e=e.code);let n=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-disabled`))t.remove();e.handleRender(async({contentDocument:e,managedNodeController:t})=>{await i.n(e,{mappedTags:{script:`___script`},commit:()=>t.commit()})})},[800]),r=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-only`))t.remove();await i.t(e.document,{mappedTags:{script:`___script`}})},[800]);return{code:e,html:r,ampHtml:n}}t.init=K,t.parseAMP=q,t.version=`1.1.6`});
package/emailmaker-esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,r as n,t as r}from"./static/esm/53bd1900.js";import{n as i,t as a}from"./static/esm/48de0f80.js";(function(){var e=window.__emailmaker__=window.__emailmaker__||{};__emailmaker__.publicPath||(__emailmaker__.publicPath=(function(){var e=(function(){if(typeof document>`u`)return`./`;var e=document.getElementsByTagName(`script`),t=document.currentScript||e[e.length-1];return t&&t.src?t.src.substring(0,t.src.lastIndexOf(`/`)+1):`./`})();e||=`./`;try{var t=String(e);if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)||t.indexOf(`//`)===0)return t;var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return String(e)}})()),__emailmaker__.assetUrl||(__emailmaker__.assetUrl=function(e){function t(e){try{var t=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return t?new URL(String(e||``),t).href:String(e||``)}catch{return String(e||``)}}var n=String(e||``);if(!n)return``;if(/^(?:data:|blob:)/.test(n))return n;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.indexOf(`//`)===0||n.charAt(0)===`/`)return t(n);var r=n.replace(/^\.\/+/,``).replace(/^\/+/,``),i=`static/media`.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/,``),a=i&&r.indexOf(i+`/`)!==0?i+`/`+r:r,o=__emailmaker__.publicPath||`./`;try{return new URL(a,o).href}catch{return o.slice(-1)!==`/`&&(o+=`/`),t(o+a)}});var t=e.modules=Object.create(null),n=import(`./runtime/index.js`),r=import(`./ui-kit/index.js`);t.React=n.then(function(e){return e.React}),t.ReactDom=n.then(function(e){return e.ReactDom}),t.ReactDomClient=n.then(function(e){return e.ReactDomClient}),t.ReactJsxRuntime=n.then(function(e){return e.ReactJsxRuntime}),t.ReactJsxDevRuntime=n.then(function(e){return e.ReactJsxDevRuntime}),t.PropTypes=n.then(function(e){return e.PropTypes}),t.ReactRouterDom=n.then(function(e){return e.ReactRouterDom}),t.Antd=n.then(function(e){return e.Antd}),t.AntDesignIcons=n.then(function(e){return e.AntDesignIcons}),t.AntDesignCssinjs=n.then(function(e){return e.AntDesignCssinjs}),t.Classnames=n.then(function(e){return e.Classnames}),t.Dayjs=n.then(function(e){return e.Dayjs}),t.Uuid=n.then(function(e){return e.Uuid}),t.UiKit=r.then(function(e){return e.UiKit===void 0?e:e.UiKit});var i=Promise.all([n,r]).then(function(e){var n=e[0]||Object.create(null),r=Object.create(null);for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);var a=e[1]||Object.create(null);for(var o in r.UiKit=a.UiKit===void 0?a:a.UiKit,r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return r}),a=t,o=i;typeof e.define!=`function`&&(Function(`__amdEnv`,`/**
1
+ import{a as e,i as t,n,r,t as i}from"./static/esm/27964dfe.js";import{n as a,t as o}from"./static/esm/c1e3467e.js";(function(){var e=window.__emailmaker__=window.__emailmaker__||{};__emailmaker__.publicPath||(__emailmaker__.publicPath=(function(){var e=(function(){if(typeof document>`u`)return`./`;var e=document.getElementsByTagName(`script`),t=document.currentScript||e[e.length-1];return t&&t.src?t.src.substring(0,t.src.lastIndexOf(`/`)+1):`./`})();e||=`./`;try{var t=String(e);if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)||t.indexOf(`//`)===0)return t;var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return String(e)}})()),__emailmaker__.assetUrl||(__emailmaker__.assetUrl=function(e){function t(e){try{var t=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return t?new URL(String(e||``),t).href:String(e||``)}catch{return String(e||``)}}var n=String(e||``);if(!n)return``;if(/^(?:data:|blob:)/.test(n))return n;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.indexOf(`//`)===0||n.charAt(0)===`/`)return t(n);var r=n.replace(/^\.\/+/,``).replace(/^\/+/,``),i=`static/media`.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/,``),a=i&&r.indexOf(i+`/`)!==0?i+`/`+r:r,o=__emailmaker__.publicPath||`./`;try{return new URL(a,o).href}catch{return o.slice(-1)!==`/`&&(o+=`/`),t(o+a)}});var t=e.modules=Object.create(null),n=import(`./runtime/index.js`),r=import(`./ui-kit/index.js`);t.React=n.then(function(e){return e.React}),t.ReactDom=n.then(function(e){return e.ReactDom}),t.ReactDomClient=n.then(function(e){return e.ReactDomClient}),t.ReactJsxRuntime=n.then(function(e){return e.ReactJsxRuntime}),t.ReactJsxDevRuntime=n.then(function(e){return e.ReactJsxDevRuntime}),t.PropTypes=n.then(function(e){return e.PropTypes}),t.ReactRouterDom=n.then(function(e){return e.ReactRouterDom}),t.Antd=n.then(function(e){return e.Antd}),t.AntDesignIcons=n.then(function(e){return e.AntDesignIcons}),t.AntDesignCssinjs=n.then(function(e){return e.AntDesignCssinjs}),t.Classnames=n.then(function(e){return e.Classnames}),t.Dayjs=n.then(function(e){return e.Dayjs}),t.Uuid=n.then(function(e){return e.Uuid}),t.UiKit=r.then(function(e){return e.UiKit===void 0?e:e.UiKit});var i=Promise.all([n,r]).then(function(e){var n=e[0]||Object.create(null),r=Object.create(null);for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);var a=e[1]||Object.create(null);for(var o in r.UiKit=a.UiKit===void 0?a:a.UiKit,r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return r}),a=t,o=i;typeof e.define!=`function`&&(Function(`__amdEnv`,`/**
2
2
  * Async AMD Loader (IIFE version for injection)
3
3
  *
4
4
  * This file is injected at the beginning of iframe entry points.
@@ -476,7 +476,7 @@ import{i as e,n as t,r as n,t as r}from"./static/esm/53bd1900.js";import{n as i,
476
476
  __amdEnv.require = require;
477
477
  __amdEnv.syncRequire = syncRequire;
478
478
  })();
479
- `)(e),typeof e.require==`function`&&typeof e.require.config==`function`&&e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.a1df38d3.js`}}));var s=typeof e.prefetch==`function`?e.prefetch:void 0;if(e.prefetch=function(){return i.then(function(){if(typeof s==`function`)return s.call(e)})},typeof e.define==`function`){var c=typeof WeakMap<`u`?new WeakMap:null;function t(e){if(!e||typeof e!=`object`&&typeof e!=`function`||e.__esModule)return e;if(c){var t=c.get(e);if(t)return t}var n=Object.create(null);Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});for(var r=Reflect.ownKeys(e),i=0;i<r.length;i++){var a=r[i];if(a!=="__esModule"){var o=Object.getOwnPropertyDescriptor(e,a);o&&Object.defineProperty(n,a,o)}}return Object.prototype.hasOwnProperty.call(n,`default`)||Object.defineProperty(n,"default",{enumerable:!0,value:e,writable:!1}),c&&c.set(e,n),n}e.define(`react`,[],function(){var e=a.React;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.React;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react`,[],function(){var e=a.React;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.React;return t(n)}):t(e)}),e.define(`react-dom`,[],function(){var e=a.ReactDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDom;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-dom`,[],function(){var e=a.ReactDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDom;return t(n)}):t(e)}),e.define(`react-dom/client`,[],function(){var e=a.ReactDomClient;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDomClient;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-dom/client`,[],function(){var e=a.ReactDomClient;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDomClient;return t(n)}):t(e)}),e.define(`react/jsx-runtime`,[],function(){var e=a.ReactJsxRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxRuntime;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react/jsx-runtime`,[],function(){var e=a.ReactJsxRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxRuntime;return t(n)}):t(e)}),e.define(`react/jsx-dev-runtime`,[],function(){var e=a.ReactJsxDevRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxDevRuntime;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react/jsx-dev-runtime`,[],function(){var e=a.ReactJsxDevRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxDevRuntime;return t(n)}):t(e)}),e.define(`prop-types`,[],function(){var e=a.PropTypes;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.PropTypes;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/prop-types`,[],function(){var e=a.PropTypes;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.PropTypes;return t(n)}):t(e)}),e.define(`react-router-dom`,[],function(){var e=a.ReactRouterDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactRouterDom;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-router-dom`,[],function(){var e=a.ReactRouterDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactRouterDom;return t(n)}):t(e)}),e.define(`antd`,[],function(){var e=a.Antd;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Antd;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/antd`,[],function(){var e=a.Antd;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Antd;return t(n)}):t(e)}),e.define(`@ant-design/icons`,[],function(){var e=a.AntDesignIcons;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignIcons;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/@ant-design/icons`,[],function(){var e=a.AntDesignIcons;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignIcons;return t(n)}):t(e)}),e.define(`@ant-design/cssinjs`,[],function(){var e=a.AntDesignCssinjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignCssinjs;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/@ant-design/cssinjs`,[],function(){var e=a.AntDesignCssinjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignCssinjs;return t(n)}):t(e)}),e.define(`classnames`,[],function(){var e=a.Classnames;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Classnames;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/classnames`,[],function(){var e=a.Classnames;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Classnames;return t(n)}):t(e)}),e.define(`dayjs`,[],function(){var e=a.Dayjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Dayjs;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/dayjs`,[],function(){var e=a.Dayjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Dayjs;return t(n)}):t(e)}),e.define(`uuid`,[],function(){var e=a.Uuid;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Uuid;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/uuid`,[],function(){var e=a.Uuid;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Uuid;return t(n)}):t(e)}),e.define(`@emailmaker/ui-kit`,[],function(){var e=a.UiKit;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.UiKit;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/ui-kit`,[],function(){var e=a.UiKit;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.UiKit;return t(n)}):t(e)})}globalThis.__SHARED_RUNTIME_INIT_SENTINEL__=`@shared-runtime:init-complete`})();var o=null,s=`core`;function c(){return typeof window.__emailmaker__?.require==`function`?new Promise((e,t)=>{window.__emailmaker__.require([s],t=>e(t),e=>t(e instanceof Error?e:Error(`[loadEngine] Failed to require core module`)))}):Promise.reject(Error(`[loadEngine] AMD loader is unavailable`))}function l(){return o||=c(),o}var u=null,d=null;async function f(e){typeof e?.prefetch==`function`&&await e.prefetch()}function p(){return u||=l().then(()=>void 0),u}function m(e){return d||=f(e),d}function h(e){return Promise.all([p(),m(e)]).then(()=>void 0)}function g(e){let t=e?.startupPrefetchMode;return t===`eager`||t===`idle`||t===`manual`||t===`off`?t:`eager`}function _(e){Promise.resolve().then(()=>h(e)).catch(()=>{})}function v(e){Promise.resolve().then(()=>m(e)).catch(()=>{})}function y(e){let t=g(e);if(t===`eager`)_(e);else if(t===`idle`){let t=window.requestIdleCallback;typeof t==`function`?t(()=>_(e),{timeout:1500}):setTimeout(()=>_(e),0)}}var b=new WeakMap,x=`data-emailmaker-config-styles`;function S(e){return typeof e==`string`?e.trim():``}function C(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function w(e,t,n){if(!e||typeof document>`u`)return null;let r=S(t),i=b.get(e),a=n||e;if(!r)return i&&(i.remove(),b.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&C(a,i),i;let o=document.createElement(`style`);return o.setAttribute(x,`true`),o.textContent=r,C(a,o),b.set(e,o),o}function T(e){if(!e)return;let t=b.get(e);t&&(t.remove(),b.delete(e))}function E(){return!1}var D=`
479
+ `)(e),typeof e.require==`function`&&typeof e.require.config==`function`&&e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.0e62ec4f.js`}}));var s=typeof e.prefetch==`function`?e.prefetch:void 0;if(e.prefetch=function(){return i.then(function(){if(typeof s==`function`)return s.call(e)})},typeof e.define==`function`){var c=typeof WeakMap<`u`?new WeakMap:null;function t(e){if(!e||typeof e!=`object`&&typeof e!=`function`||e.__esModule)return e;if(c){var t=c.get(e);if(t)return t}var n=Object.create(null);Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});for(var r=Reflect.ownKeys(e),i=0;i<r.length;i++){var a=r[i];if(a!=="__esModule"){var o=Object.getOwnPropertyDescriptor(e,a);o&&Object.defineProperty(n,a,o)}}return Object.prototype.hasOwnProperty.call(n,`default`)||Object.defineProperty(n,"default",{enumerable:!0,value:e,writable:!1}),c&&c.set(e,n),n}e.define(`react`,[],function(){var e=a.React;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.React;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react`,[],function(){var e=a.React;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.React;return t(n)}):t(e)}),e.define(`react-dom`,[],function(){var e=a.ReactDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDom;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-dom`,[],function(){var e=a.ReactDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDom;return t(n)}):t(e)}),e.define(`react-dom/client`,[],function(){var e=a.ReactDomClient;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDomClient;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-dom/client`,[],function(){var e=a.ReactDomClient;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDomClient;return t(n)}):t(e)}),e.define(`react/jsx-runtime`,[],function(){var e=a.ReactJsxRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxRuntime;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react/jsx-runtime`,[],function(){var e=a.ReactJsxRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxRuntime;return t(n)}):t(e)}),e.define(`react/jsx-dev-runtime`,[],function(){var e=a.ReactJsxDevRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxDevRuntime;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react/jsx-dev-runtime`,[],function(){var e=a.ReactJsxDevRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxDevRuntime;return t(n)}):t(e)}),e.define(`prop-types`,[],function(){var e=a.PropTypes;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.PropTypes;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/prop-types`,[],function(){var e=a.PropTypes;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.PropTypes;return t(n)}):t(e)}),e.define(`react-router-dom`,[],function(){var e=a.ReactRouterDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactRouterDom;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-router-dom`,[],function(){var e=a.ReactRouterDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactRouterDom;return t(n)}):t(e)}),e.define(`antd`,[],function(){var e=a.Antd;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Antd;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/antd`,[],function(){var e=a.Antd;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Antd;return t(n)}):t(e)}),e.define(`@ant-design/icons`,[],function(){var e=a.AntDesignIcons;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignIcons;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/@ant-design/icons`,[],function(){var e=a.AntDesignIcons;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignIcons;return t(n)}):t(e)}),e.define(`@ant-design/cssinjs`,[],function(){var e=a.AntDesignCssinjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignCssinjs;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/@ant-design/cssinjs`,[],function(){var e=a.AntDesignCssinjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignCssinjs;return t(n)}):t(e)}),e.define(`classnames`,[],function(){var e=a.Classnames;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Classnames;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/classnames`,[],function(){var e=a.Classnames;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Classnames;return t(n)}):t(e)}),e.define(`dayjs`,[],function(){var e=a.Dayjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Dayjs;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/dayjs`,[],function(){var e=a.Dayjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Dayjs;return t(n)}):t(e)}),e.define(`uuid`,[],function(){var e=a.Uuid;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Uuid;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/uuid`,[],function(){var e=a.Uuid;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Uuid;return t(n)}):t(e)}),e.define(`@emailmaker/ui-kit`,[],function(){var e=a.UiKit;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.UiKit;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/ui-kit`,[],function(){var e=a.UiKit;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.UiKit;return t(n)}):t(e)})}globalThis.__SHARED_RUNTIME_INIT_SENTINEL__=`@shared-runtime:init-complete`})();var s=null,c=`core`;function l(){return typeof window.__emailmaker__?.require==`function`?new Promise((e,t)=>{window.__emailmaker__.require([c],t=>e(t),e=>t(e instanceof Error?e:Error(`[loadEngine] Failed to require core module`)))}):Promise.reject(Error(`[loadEngine] AMD loader is unavailable`))}function u(){return s||=l(),s}var d=null,f=null;async function p(e){typeof e?.prefetch==`function`&&await e.prefetch()}function m(){return d||=u().then(()=>void 0),d}function h(e){return f||=p(e),f}function g(e){return Promise.all([m(),h(e)]).then(()=>void 0)}function _(e){let t=e?.startupPrefetchMode;return t===`eager`||t===`idle`||t===`manual`||t===`off`?t:`eager`}function v(e){Promise.resolve().then(()=>g(e)).catch(()=>{})}function y(e){Promise.resolve().then(()=>h(e)).catch(()=>{})}function b(e){let t=_(e);if(t===`eager`)v(e);else if(t===`idle`){let t=window.requestIdleCallback;typeof t==`function`?t(()=>v(e),{timeout:1500}):setTimeout(()=>v(e),0)}}var x=new WeakMap,S=`data-emailmaker-config-styles`;function C(e){return typeof e==`string`?e.trim():``}function w(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function T(e,t,n){if(!e||typeof document>`u`)return null;let r=C(t),i=x.get(e),a=n||e;if(!r)return i&&(i.remove(),x.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&w(a,i),i;let o=document.createElement(`style`);return o.setAttribute(S,`true`),o.textContent=r,w(a,o),x.set(e,o),o}function E(e){if(!e)return;let t=x.get(e);t&&(t.remove(),x.delete(e))}function D(){return!1}var O=`
480
480
  .blocks-app-initial-spinner-wrapper {
481
481
  width: 100%;
482
482
  height: 100%;
@@ -505,4 +505,4 @@ import{i as e,n as t,r as n,t as r}from"./static/esm/53bd1900.js";import{n as i,
505
505
  100% {
506
506
  transform: rotate(360deg);
507
507
  }
508
- }`;function O(){return()=>{}}function k(e,t){if(!E()||!e||typeof document>`u`)return O();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=D,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}var A=new WeakMap,j=new Map;function M(e){return N(String(e||``).trim()||`https://app.emailmaker.ru/api/`)}function N(e){let t=e;for(;t.endsWith(`/`);)t=t.slice(0,t.length-1);return`${t}/wp-json`}async function P(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function F(e){return async({baseUrl:t})=>{let n=M(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await P(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function I(e){return JSON.stringify({baseUrl:M(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function L(e){return async t=>{let n=I(t),r=j.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw j.delete(n),e});return j.set(n,i),i}}function R(e){if(e.standaloneKey)return e;let t=e.appInit||F(e),n=A.get(t);return n||(n=L(t),A.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var z=new WeakMap;function B(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function V(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=z.get(t);return n||(n=B(t),z.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}function H(e,t){return{...e,element:t}}function U(){return()=>{}}function W(e){let t=e.element;return!t||typeof t==`string`||typeof document>`u`?U():(w(t,e.config?.styles,t),()=>{T(t)})}function G(e){if(!E()||e.initialSpinner===!1||typeof document>`u`)return{options:e,cleanup:U()};let t=e.element;if(!t||typeof t==`string`)return{options:e,cleanup:U()};t.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=k(t,`data-emailmaker`),r=e.handleChunkLoaded;return{options:{...e,handleChunkLoaded:()=>{n(),r?.()}},cleanup:n}}function K(e){return e?.length?e.some(e=>Array.isArray(e)?!1:!!(e&&typeof e==`object`&&`url`in e)):!1}var q=`1.1.4`;async function J(e){await h(window.__emailmaker__===void 0?void 0:window.__emailmaker__)}async function Y(t){let n=new e,r=await i(t.element,n);n.dispose();let o=R(V(H(t,r)));if(r){let e=a.get(r);if(e)try{let t=await e;if(t.getElement()===r)return t.reset(o)}catch{a.get(r)===e&&a.delete(r)}}let s=W(o),c=G(o),u=c.options;await p();let d=window.__emailmaker__===void 0?void 0:window.__emailmaker__;K(u.plugins)?await m(d):v(d);let f=l().then(e=>e.init(u));r&&a.set(r,f);try{let e=await f;return r&&a.set(r,e),e}catch(e){throw s(),c.cleanup(),r&&a.get(r)===f&&a.delete(r),e}}async function X(e){return(await l()).parseAMP(e)}typeof window<`u`&&y(window.__emailmaker__===void 0?void 0:window.__emailmaker__);export{t as errors,r as helpers,Y as init,X as parseAMP,n as pluginRegistry,J as preload,q as version};
508
+ }`;function k(){return()=>{}}function A(e,t){if(!D()||!e||typeof document>`u`)return k();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=O,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}function j(e){for(;e.endsWith(`/`);)e=e.slice(0,e.length-1);return/\/wp-json$/i.test(e)?e:`${e}/wp-json`}j(`https://app.emailmaker.ru/api/`),t(),t(),t(),t();var M;(function(e){let t=`https://racs.emcdn.ru/v3`;function n(e,n){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(n)};return fetch(`${t}?resource=${e}&dataset=${document.location.hostname}`,r)}e.post=n;async function r(e,n=0){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:`{"filter":{},"limit":${n}}`};return await(await fetch(`${t}/get?resource=${e}&dataset=${document.location.hostname}`,r)).json()}e.getAll=r})(M||={});var N=new Map,P=new WeakMap;function F(e){return j(String(e||``).trim()||`https://app.emailmaker.ru/api/`)}async function I(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function L(e){return async({baseUrl:t})=>{let n=F(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await I(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function R(e){return JSON.stringify({baseUrl:F(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function z(e){return async t=>{let n=R(t),r=N.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw N.delete(n),e});return N.set(n,i),i}}function B(e){if(e.standaloneKey)return e;let t=e.appInit||L(e),n=P.get(t);return n||(n=z(t),P.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var V=new WeakMap;function H(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function U(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=V.get(t);return n||(n=H(t),V.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}function W(e,t){return{...e,element:t}}function G(){return()=>{}}function K(e){let t=e.element;return!t||typeof t==`string`||typeof document>`u`?G():(T(t,e.config?.styles,t),()=>{E(t)})}function q(e){if(!D()||e.initialSpinner===!1||typeof document>`u`)return{options:e,cleanup:G()};let t=e.element;if(!t||typeof t==`string`)return{options:e,cleanup:G()};t.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=A(t,`data-emailmaker`),r=e.handleChunkLoaded;return{options:{...e,handleChunkLoaded:()=>{n(),r?.()}},cleanup:n}}function J(e){return e?.length?e.some(e=>Array.isArray(e)?!1:!!(e&&typeof e==`object`&&`url`in e)):!1}var Y=`1.1.6`;async function X(e){await g(window.__emailmaker__===void 0?void 0:window.__emailmaker__)}async function Z(t){let n=new e,r=await a(t.element,n);n.dispose();let i=B(U(W(t,r)));if(r){let e=o.get(r);if(e)try{let t=await e;if(t.getElement()===r)return t.reset(i)}catch{o.get(r)===e&&o.delete(r)}}let s=K(i),c=q(i),l=c.options;await m();let d=window.__emailmaker__===void 0?void 0:window.__emailmaker__;J(l.plugins)?await h(d):y(d);let f=u().then(e=>e.init(l));r&&o.set(r,f);try{let e=await f;return r&&o.set(r,e),e}catch(e){throw s(),c.cleanup(),r&&o.get(r)===f&&o.delete(r),e}}async function Q(e){return(await u()).parseAMP(e)}typeof window<`u`&&b(window.__emailmaker__===void 0?void 0:window.__emailmaker__);export{n as errors,i as helpers,Z as init,Q as parseAMP,r as pluginRegistry,X as preload,Y as version};
package/emailmaker.d.ts CHANGED
@@ -1721,14 +1721,14 @@ export declare namespace ExportedApi {
1721
1721
  };
1722
1722
  }
1723
1723
  export type AppInitCallback = (params: {
1724
- baseUrl?: string;
1724
+ /** API origin from init options (without `/wp-json`); SDK normalizes before HTTP. */baseUrl?: string;
1725
1725
  user?: User;
1726
1726
  project?: string | number;
1727
1727
  prevApp?: AppInitResult;
1728
1728
  }) => MayBePromise<AppInitResult>;
1729
1729
  namespace AppInitMixin {
1730
1730
  interface Options {
1731
- /** base url of the app server */
1731
+ /** API origin (e.g. `https://api.emailmaker.ru` or `https://app.emailmaker.ru/api`), without `/wp-json`. */
1732
1732
  baseUrl?: string;
1733
1733
  /** optional app init callback override */
1734
1734
  appInit?: AppInitCallback;
@@ -1909,16 +1909,6 @@ export declare namespace ExportedApi {
1909
1909
  interface Instance extends Events {
1910
1910
  /**
1911
1911
  * show block or email
1912
- *
1913
- * Промис резолвится, когда письмо **полностью инициализировано**: поднят редактор
1914
- * (`ON_EMAIL_INIT`) и — для сохранённого письма (есть `id`) — применена autosave-recovery
1915
- * из истории ревизий. Поэтому `getEmail()` сразу после `await show()` отдаёт финальный html.
1916
- *
1917
- * Ожидание ограничено таймаутом (~12 c, перекрывает fast-poll `revisionService`). При
1918
- * таймауте `show()` всё равно резолвится с текущим контентом, применение recovery
1919
- * продолжается в фоне и завершается событием `handleEmailChanged` (тихого возврата старого нет).
1920
- *
1921
- * Для нового письма (без `id`) контент синхронный — ждётся только инициализация редактора.
1922
1912
  * @param content entity content
1923
1913
  */
1924
1914
  show(content: Content): Promise<void>;
@@ -2836,12 +2826,30 @@ export declare namespace ExportedApi {
2836
2826
  };
2837
2827
  type ResourceProxyValue = string | ResourceProxyRule | Array<string | ResourceProxyRule>;
2838
2828
  type ResourceProxyConfig = ResourceProxyValue;
2829
+ /**
2830
+ * Hosts that bypass the proxy chain and are fetched directly (requires CORS on the asset host).
2831
+ * Plain array = union with previous layers; `{ replace: true, value }` resets the accumulated list.
2832
+ */
2833
+ type DirectHostsConfig = string[] | {
2834
+ replace?: boolean;
2835
+ value: string[];
2836
+ };
2839
2837
  type ResourceProxyPolicy = {
2840
2838
  recoveryTtlMs?: number;
2841
2839
  proxyBlobFetch?: boolean;
2842
2840
  proxyCdn?: boolean;
2843
2841
  proxyEmFiles?: boolean;
2844
2842
  proxyStockImages?: boolean;
2843
+ /**
2844
+ * When true (hosted default), build-time env proxy rules are merged as the bottom layer of `resourceProxy`.
2845
+ * Standalone default: false.
2846
+ */
2847
+ inheritEnvDefaults?: boolean;
2848
+ /**
2849
+ * When true (default), same-origin URLs skip the proxy chain.
2850
+ */
2851
+ proxySameOrigin?: boolean; /** Hosts fetched directly without proxy (union merge across config layers). */
2852
+ directHosts?: DirectHostsConfig;
2845
2853
  };
2846
2854
  type BackendProxyRequestType = 'generic' | 'emFiles' | 'ai';
2847
2855
  type BackendProxyMatchContext = {
package/emailmaker.js CHANGED
@@ -12,7 +12,7 @@
12
12
  })(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : this, function() {
13
13
  'use strict';
14
14
 
15
- var e=window.__emailmaker__||(window.__emailmaker__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=`./`,s={};function c(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function l(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function u(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(!(!i||i===`.`)){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function d(e){var t=String(e||``).replace(/\\/g,`/`),n=String(o||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function f(e,t){var n=String(e||``);if(!n)return n;if(!(n.indexOf(`./`)===0||n.indexOf(`../`)===0))return d(u(n));var r=u(t||``),i=r?r.split(`/`):[];i.length>0&&i.pop();for(var a=n.split(`/`),o=0;o<a.length;o++){var s=a[o];if(!(!s||s===`.`)){if(s===`..`){i.length>0&&i.pop();continue}i.push(s)}}return d(i.join(`/`))}function p(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function m(e){var t=String(e||``);if(!t||p(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function h(){var t=String(o||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),p(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,m(e.publicPath)).href}catch{}return m(t)}function g(e,t){var n=f(e,t),r=h(),i=Object.prototype.hasOwnProperty.call(s,n)?String(s[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function _(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function v(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=_()):typeof e==`function`?(r=e,n=[],e=_()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}v.amd={async:!0};function y(){return function(){}}function b(e,t){return{id:e,exports:t,uri:g(e)}}function x(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return C(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return C(e,r)}function S(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=f(e,o);if(s in a)throw a[s];if(s in n)return n[s];if(s in r||s in i)throw c(s,Error(`Module is still loading asynchronously`));if(!(s in t))throw c(s,Error(`Module is not available for syncRequire`));return T(s)}function C(e,i){var o=f(e,i);return o in a?Promise.reject(a[o]):o in n?Promise.resolve(n[o]):o in r?r[o]:o in t?(r[o]=w(o),r[o]):(r[o]=D(o).then(function(){if(!(o in t)){var e=c(o,Error(`Module not defined after script load`));throw a[o]=e,e}return w(o)}).catch(function(e){delete r[o];var t=c(o,e);throw a[o]=t,t}),r[o])}function w(e){var i=t[e],o=E(e),s=y(),c=b(e,s);return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?c:C(t,e).catch(function(n){throw l(e,t,n)})})).then(function(t){var a=i.factory.apply(null,t);return a&&typeof a.then==`function`?a.then(function(t){return n[e]=t===void 0?c.exports:t,delete r[e],n[e]}):(n[e]=a===void 0?c.exports:a,delete r[e],n[e])}).catch(function(t){throw delete r[e],a[e]=t,t})}function T(e){var r=t[e],i=E(e),o=y(),s=b(e,o);try{var u=r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return S(t,e)}catch(n){throw l(e,t,n)}}),d=r.factory.apply(null,u);if(d&&typeof d.then==`function`)throw c(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=d===void 0?s.exports:d,n[e]}catch(t){throw a[e]=t,t}}function E(e){var r=function(r,i,a){if(Array.isArray(r))return x(r,i,a,e);var o=f(r,e);return o in n?n[o]:o in t?S(r,e):C(r,e)};return r.resolve=function(t){return f(t,e)},r.toUrl=function(t){return g(t,e)},r.sync=function(t){return S(t,e)},r}function D(e){if(e in i)return i[e];var t=g(e);return document.querySelector(`script[src="`+t+`"]`)?(i[e]=Promise.resolve(),i[e]):(i[e]=new Promise(function(n,r){var a=document.createElement(`script`);a.src=t,a.setAttribute(`data-amd-module-id`,e),a.async=!0,a.onload=function(){n()},a.onerror=function(){delete i[e],r(Error(`Failed to load script: `+t))},document.head.appendChild(a)}),i[e])}x.config=function(e){if(e.baseUrl&&(o=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(s[t]=e.paths[t])},x.modules=t,x.resolved=n,x.errors=a,x.toUrl=g,x.sync=S,e.define=v,e.require=x,e.syncRequire=S})(),e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.a1df38d3.js`}});
15
+ var e=window.__emailmaker__||(window.__emailmaker__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=`./`,s={};function c(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function l(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function u(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(!(!i||i===`.`)){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function d(e){var t=String(e||``).replace(/\\/g,`/`),n=String(o||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function f(e,t){var n=String(e||``);if(!n)return n;if(!(n.indexOf(`./`)===0||n.indexOf(`../`)===0))return d(u(n));var r=u(t||``),i=r?r.split(`/`):[];i.length>0&&i.pop();for(var a=n.split(`/`),o=0;o<a.length;o++){var s=a[o];if(!(!s||s===`.`)){if(s===`..`){i.length>0&&i.pop();continue}i.push(s)}}return d(i.join(`/`))}function p(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function m(e){var t=String(e||``);if(!t||p(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function h(){var t=String(o||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),p(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,m(e.publicPath)).href}catch{}return m(t)}function g(e,t){var n=f(e,t),r=h(),i=Object.prototype.hasOwnProperty.call(s,n)?String(s[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function _(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function v(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=_()):typeof e==`function`?(r=e,n=[],e=_()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}v.amd={async:!0};function y(){return function(){}}function b(e,t){return{id:e,exports:t,uri:g(e)}}function x(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return C(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return C(e,r)}function S(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=f(e,o);if(s in a)throw a[s];if(s in n)return n[s];if(s in r||s in i)throw c(s,Error(`Module is still loading asynchronously`));if(!(s in t))throw c(s,Error(`Module is not available for syncRequire`));return T(s)}function C(e,i){var o=f(e,i);return o in a?Promise.reject(a[o]):o in n?Promise.resolve(n[o]):o in r?r[o]:o in t?(r[o]=w(o),r[o]):(r[o]=D(o).then(function(){if(!(o in t)){var e=c(o,Error(`Module not defined after script load`));throw a[o]=e,e}return w(o)}).catch(function(e){delete r[o];var t=c(o,e);throw a[o]=t,t}),r[o])}function w(e){var i=t[e],o=E(e),s=y(),c=b(e,s);return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?c:C(t,e).catch(function(n){throw l(e,t,n)})})).then(function(t){var a=i.factory.apply(null,t);return a&&typeof a.then==`function`?a.then(function(t){return n[e]=t===void 0?c.exports:t,delete r[e],n[e]}):(n[e]=a===void 0?c.exports:a,delete r[e],n[e])}).catch(function(t){throw delete r[e],a[e]=t,t})}function T(e){var r=t[e],i=E(e),o=y(),s=b(e,o);try{var u=r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return S(t,e)}catch(n){throw l(e,t,n)}}),d=r.factory.apply(null,u);if(d&&typeof d.then==`function`)throw c(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=d===void 0?s.exports:d,n[e]}catch(t){throw a[e]=t,t}}function E(e){var r=function(r,i,a){if(Array.isArray(r))return x(r,i,a,e);var o=f(r,e);return o in n?n[o]:o in t?S(r,e):C(r,e)};return r.resolve=function(t){return f(t,e)},r.toUrl=function(t){return g(t,e)},r.sync=function(t){return S(t,e)},r}function D(e){if(e in i)return i[e];var t=g(e);return document.querySelector(`script[src="`+t+`"]`)?(i[e]=Promise.resolve(),i[e]):(i[e]=new Promise(function(n,r){var a=document.createElement(`script`);a.src=t,a.setAttribute(`data-amd-module-id`,e),a.async=!0,a.onload=function(){n()},a.onerror=function(){delete i[e],r(Error(`Failed to load script: `+t))},document.head.appendChild(a)}),i[e])}x.config=function(e){if(e.baseUrl&&(o=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(s[t]=e.paths[t])},x.modules=t,x.resolved=n,x.errors=a,x.toUrl=g,x.sync=S,e.define=v,e.require=x,e.syncRequire=S})(),e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.0e62ec4f.js`}});
16
16
 
17
17
  // PublicPath (script detection via document.currentScript)
18
18
  if (!__emailmaker__.publicPath) {
@@ -711,7 +711,7 @@ if (typeof ns.define === 'function') {
711
711
  })();
712
712
 
713
713
 
714
- __emailmaker__.define(`emailmaker.js`,[`require`,`exports`,`module`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.defineProperty,i=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},a=class e{_inner;_isDisposed=!1;constructor(e=[]){this._inner=e}addDisposable(t){return this._inner.push(t),t instanceof e&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){let t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(let e of[...this._inner])e.dispose()}}};function o(e){return`service_container_${e}`}var s=class e extends a{_parent;_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(e){this._injectCallbacks.forEach(t=>t(e))}constructor(e=null){super(),this._parent=e,e&&this.addDisposable(e.onInject(e=>this._runCallbacks(e)))}onInject=e=>(this._injectCallbacks.push(e),{dispose:()=>{let t=this._injectCallbacks.indexOf(e);t>=0&&this._injectCallbacks.splice(t,1)}});inject(e,t){this._injections[e]=()=>t,this._runCallbacks(e)}injectFactory(e,t,n){let r=this._injections[e],i=typeof r==`function`?r():r,a=this._injections[e]=()=>(i=t(this,i),i);n&&a(),this._runCallbacks(e)}_find(e,t=!0){return this._injections[e]||t&&this._parent?._find(e)}_onInject(e,t,n=new a){return n.addDisposable(this.onInject(r=>{e===r&&(n.dispose(),t(this.getInstance(r)))})),this._parent&&n.addDisposable(this._parent._onInject(e,t,n)),this.addDisposable(n),n}getInstance(e,t=!0){let n=this._find(e,t);if(typeof n==`function`)return n()}getOrCreateInstance(e,t){let n=this._find(e);if(typeof n==`function`)return n();let r=t(this);return this.inject(e,r),r}getInstanceAsync(e){let t=this._find(e);return typeof t==`function`?Promise.resolve(t()):new Promise(t=>this._onInject(e,()=>t(this.getInstance(e))))}addService(e,t){let n=o(e);this.injectFactory(n,(e,n=[])=>n.indexOf(t)<0?[...n,t]:n);let r=new a;return r.addDispose(()=>{this.injectFactory(n,(e,n=[])=>n.filter(e=>e!==t))}),r}addServiceFactory(e,t,n){let r=o(e),i;this.injectFactory(r,(e,n=[])=>(i=t(e,i),i===void 0?n:n.indexOf(i)<0?[...n,i]:n),n);let s=new a;return s.addDispose(()=>{this.injectFactory(r,(e,t=[])=>i===void 0?t:t.filter(e=>e!==i))}),s}getServices(e){let t=o(e);return[...this.getInstance(t,!1)||[],...this._parent?.getServices(e)||[]]}createChild(){return new e(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{let n=this._parent?.getOrCreateIsolatedContainer(t);return new e(n)})}dispose(){this._injections=Object.create(null)}};function c(e){return e.startsWith(`__`)?e:`__${e}__`}function l(e){if(typeof globalThis>`u`)throw Error(`[di] globalThis is required for namespace container access.`);let t=c(e),n=globalThis;return n[t]??={}}function u(e){return typeof e==`object`&&!!e&&typeof e.inject==`function`&&typeof e.getInstance==`function`}function ee(e){return c(e||`emailmaker`)}function d(e){let t=l(ee(e));if(u(t.container))return t.container;let n=new s(null);return t.container=n,n}function f(e){return d(e)}function p(){return`umd`}function te(e){if(typeof globalThis>`u`)return;let t=p(),n=globalThis[e]??{};globalThis[e]=n;let r=n.__diagnostics??={},i=r.diModuleEval??={evalCount:0,records:[],duplicateWarned:!1};i.records.push({buildSource:t,timestamp:Date.now(),stack:Error().stack}),i.evalCount+=1,!(i.evalCount<=1||i.duplicateWarned)&&(i.duplicateWarned=!0,i.evalCount,i.records)}function ne(){return`__emailmaker__`}function m(e,t){if(te(t),typeof globalThis>`u`)return e;let n=p(),r=globalThis,i=r[t]=r[t]||{},a=i.__diagnostics=i.__diagnostics||{},o=a.dependencyResolver=a.dependencyResolver||{entries:[],warnings:[]},s={container:e,source:`packages/runtime-core/di/index.ts`,buildSource:n,timestamp:Date.now(),stack:Error().stack};if(o.entries.push(s),o.entries.length>1){let e=o.entries[0];if(o.entries.some(t=>t.container!==e.container)&&!o.duplicateWarningShown){o.duplicateWarningShown=!0;let e={message:`[di] Multiple DependencyResolver instances detected on namespace`,namespaceKey:t,buildSource:n,entries:o.entries};o.warnings.push(e)}}return e}var h;function g(){if(h)return h;let e=ne();return h=m(d(e),e),h}new Proxy({},{get(e,t,n){let r=g(),i=Reflect.get(r,t,n);return typeof i==`function`?i.bind(r):i}});var _=class e extends Error{code;httpStatus;details;constructor(t,n,r,i){super(t),this.name=`FileManagerApiError`,this.code=n,this.httpStatus=r,this.details=i;let a=Error.captureStackTrace;a&&a(this,e)}};function v(e,t=`BackendError`){switch(e){case 400:return`ValidationError`;case 401:return`AuthenticationFailed`;case 403:return`AuthorizationFailed`;case 404:return`FileNotFound`;case 413:return`PayloadTooLarge`;case 415:return`UnsupportedMediaType`;case 429:return`RateLimitExceeded`;case 500:return`BackendError`;case 503:return`ServiceUnavailable`;case 504:return`Timeout`;default:return t}}var y=class{_plugins=new Map;_listeners=new Map;_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){let n=this._plugins.get(e);if(n?.overrides)for(let e of n.overrides)t=e(t)||t;return t}_notifyListeners(e,t){let n=this._listeners.get(e);if(!n||n.length===0)return;for(let e of n)try{e.callback(t)}catch{}let r=n.filter(e=>!e.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){let n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){let n=Promise.resolve(t.factory()).then(n=>(t.ctor=n,t.loading=void 0,this._notifyListeners(e,n),n));t.loading=n;let r=await n;return this._applyOverrides(e,r)}return new Promise(t=>{this.on(e,n=>t(this._applyOverrides(e,n)))})}add(e,t){let n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(let t of Object.keys(e)){let n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){let n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){let t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){let n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{let e=n.overrides.indexOf(t);e>=0&&n.overrides.splice(e,1)}}}on(e,t){let n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!1};return r.push(i),{dispose:()=>this._removeListener(e,t)}}once(e,t){let n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!0};return r.push(i),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){let n=this._listeners.get(e);if(n){let r=n.findIndex(e=>e.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){let e=this;return{add(t,n){e.add(t,n)}}}},b=class{resolveRegistry;constructor(e){this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},x=null,S=`core`;function C(){return typeof __emailmaker__?.require==`function`?new Promise((e,t)=>{__emailmaker__.require([S],t=>e(t),e=>t(e instanceof Error?e:Error(`[loadEngine] Failed to require core module`)))}):Promise.reject(Error(`[loadEngine] AMD loader is unavailable`))}function w(){return x||=C(),x}var T=null,E=null;async function re(e){typeof e?.prefetch==`function`&&await e.prefetch()}function D(){return T||=w().then(()=>{}),T}function O(e){return E||=re(e),E}function k(e){return Promise.all([D(),O(e)]).then(()=>{})}function A(e){let t=e?.startupPrefetchMode;return t===`eager`||t===`idle`||t===`manual`||t===`off`?t:`eager`}function j(e){Promise.resolve().then(()=>k(e)).catch(()=>{})}function M(e){Promise.resolve().then(()=>O(e)).catch(()=>{})}function N(e){let t=A(e);if(t===`eager`)j(e);else if(t===`idle`){let t=window.requestIdleCallback;typeof t==`function`?t(()=>j(e),{timeout:1500}):setTimeout(()=>j(e),0)}}var P=`PluginRegistry`;function F(e=f()){return e.getOrCreateInstance(P,()=>new y)}var I=new b(()=>F()),L=new WeakMap,R=`data-emailmaker-config-styles`;function z(e){return typeof e==`string`?e.trim():``}function B(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function V(e,t,n){if(!e||typeof document>`u`)return null;let r=z(t),i=L.get(e),a=n||e;if(!r)return i&&(i.remove(),L.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&B(a,i),i;let o=document.createElement(`style`);return o.setAttribute(R,`true`),o.textContent=r,B(a,o),L.set(e,o),o}function H(e){if(!e)return;let t=L.get(e);t&&(t.remove(),L.delete(e))}function U(e,t){if(typeof e<`u`)if(typeof e==`string`){if(e=document.querySelector(e),e)return e;let n=t.addDisposable(new a);return new Promise((t,r)=>{let i=new MutationObserver(()=>{e=document.querySelector(e),e&&(n.dispose(),t(e))});i.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),n.addDisposable({dispose:()=>i.disconnect()})})}else return e;else return e}var W=new Map;function G(){return!1}var K=`
714
+ __emailmaker__.define(`emailmaker.js`,[`require`,`exports`,`module`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.defineProperty,i=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),a=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},o=class e{_inner;_isDisposed=!1;constructor(e=[]){this._inner=e}addDisposable(t){return this._inner.push(t),t instanceof e&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){let t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(let e of[...this._inner])e.dispose()}}};function s(e){return`service_container_${e}`}var c=class e extends o{_parent;_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(e){this._injectCallbacks.forEach(t=>t(e))}constructor(e=null){super(),this._parent=e,e&&this.addDisposable(e.onInject(e=>this._runCallbacks(e)))}onInject=e=>(this._injectCallbacks.push(e),{dispose:()=>{let t=this._injectCallbacks.indexOf(e);t>=0&&this._injectCallbacks.splice(t,1)}});inject(e,t){this._injections[e]=()=>t,this._runCallbacks(e)}injectFactory(e,t,n){let r=this._injections[e],i=typeof r==`function`?r():r,a=this._injections[e]=()=>(i=t(this,i),i);n&&a(),this._runCallbacks(e)}_find(e,t=!0){return this._injections[e]||t&&this._parent?._find(e)}_onInject(e,t,n=new o){return n.addDisposable(this.onInject(r=>{e===r&&(n.dispose(),t(this.getInstance(r)))})),this._parent&&n.addDisposable(this._parent._onInject(e,t,n)),this.addDisposable(n),n}getInstance(e,t=!0){let n=this._find(e,t);if(typeof n==`function`)return n()}getOrCreateInstance(e,t){let n=this._find(e);if(typeof n==`function`)return n();let r=t(this);return this.inject(e,r),r}getInstanceAsync(e){let t=this._find(e);return typeof t==`function`?Promise.resolve(t()):new Promise(t=>this._onInject(e,()=>t(this.getInstance(e))))}addService(e,t){let n=s(e);this.injectFactory(n,(e,n=[])=>n.indexOf(t)<0?[...n,t]:n);let r=new o;return r.addDispose(()=>{this.injectFactory(n,(e,n=[])=>n.filter(e=>e!==t))}),r}addServiceFactory(e,t,n){let r=s(e),i;this.injectFactory(r,(e,n=[])=>(i=t(e,i),i===void 0?n:n.indexOf(i)<0?[...n,i]:n),n);let a=new o;return a.addDispose(()=>{this.injectFactory(r,(e,t=[])=>i===void 0?t:t.filter(e=>e!==i))}),a}getServices(e){let t=s(e);return[...this.getInstance(t,!1)||[],...this._parent?.getServices(e)||[]]}createChild(){return new e(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{let n=this._parent?.getOrCreateIsolatedContainer(t);return new e(n)})}dispose(){this._injections=Object.create(null)}};function l(e){return e.startsWith(`__`)?e:`__${e}__`}function u(e){if(typeof globalThis>`u`)throw Error(`[di] globalThis is required for namespace container access.`);let t=l(e),n=globalThis;return n[t]??={}}function ee(e){return typeof e==`object`&&!!e&&typeof e.inject==`function`&&typeof e.getInstance==`function`}function te(e){return l(e||`emailmaker`)}function d(e){let t=u(te(e));if(ee(t.container))return t.container;let n=new c(null);return t.container=n,n}function ne(e){return d(e)}function re(){let e=new Date().getTime(),t=typeof performance<`u`&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n===`x`?r:r&3|8).toString(16)})}function ie(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():re()}function f(e=ie()){return e}function p(){return`umd`}function m(e){if(typeof globalThis>`u`)return;let t=p(),n=globalThis[e]??{};globalThis[e]=n;let r=n.__diagnostics??={},i=r.diModuleEval??={evalCount:0,records:[],duplicateWarned:!1};i.records.push({buildSource:t,timestamp:Date.now(),stack:Error().stack}),i.evalCount+=1,!(i.evalCount<=1||i.duplicateWarned)&&(i.duplicateWarned=!0,i.evalCount,i.records)}function h(){return`__emailmaker__`}function g(e,t){if(m(t),typeof globalThis>`u`)return e;let n=p(),r=globalThis,i=r[t]=r[t]||{},a=i.__diagnostics=i.__diagnostics||{},o=a.dependencyResolver=a.dependencyResolver||{entries:[],warnings:[]},s={container:e,source:`packages/runtime-core/di/index.ts`,buildSource:n,timestamp:Date.now(),stack:Error().stack};if(o.entries.push(s),o.entries.length>1){let e=o.entries[0];if(o.entries.some(t=>t.container!==e.container)&&!o.duplicateWarningShown){o.duplicateWarningShown=!0;let e={message:`[di] Multiple DependencyResolver instances detected on namespace`,namespaceKey:t,buildSource:n,entries:o.entries};o.warnings.push(e)}}return e}var _;function v(){if(_)return _;let e=h();return _=g(d(e),e),_}new Proxy({},{get(e,t,n){let r=v(),i=Reflect.get(r,t,n);return typeof i==`function`?i.bind(r):i}});var y=class e extends Error{code;httpStatus;details;constructor(t,n,r,i){super(t),this.name=`FileManagerApiError`,this.code=n,this.httpStatus=r,this.details=i;let a=Error.captureStackTrace;a&&a(this,e)}};function b(e,t=`BackendError`){switch(e){case 400:return`ValidationError`;case 401:return`AuthenticationFailed`;case 403:return`AuthorizationFailed`;case 404:return`FileNotFound`;case 413:return`PayloadTooLarge`;case 415:return`UnsupportedMediaType`;case 429:return`RateLimitExceeded`;case 500:return`BackendError`;case 503:return`ServiceUnavailable`;case 504:return`Timeout`;default:return t}}var ae=class{_plugins=new Map;_listeners=new Map;_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){let n=this._plugins.get(e);if(n?.overrides)for(let e of n.overrides)t=e(t)||t;return t}_notifyListeners(e,t){let n=this._listeners.get(e);if(!n||n.length===0)return;for(let e of n)try{e.callback(t)}catch{}let r=n.filter(e=>!e.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){let n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){let n=Promise.resolve(t.factory()).then(n=>(t.ctor=n,t.loading=void 0,this._notifyListeners(e,n),n));t.loading=n;let r=await n;return this._applyOverrides(e,r)}return new Promise(t=>{this.on(e,n=>t(this._applyOverrides(e,n)))})}add(e,t){let n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(let t of Object.keys(e)){let n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){let n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){let t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){let n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{let e=n.overrides.indexOf(t);e>=0&&n.overrides.splice(e,1)}}}on(e,t){let n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!1};return r.push(i),{dispose:()=>this._removeListener(e,t)}}once(e,t){let n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!0};return r.push(i),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){let n=this._listeners.get(e);if(n){let r=n.findIndex(e=>e.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){let e=this;return{add(t,n){e.add(t,n)}}}},oe=class{resolveRegistry;constructor(e){this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},x=null,se=`core`;function ce(){return typeof __emailmaker__?.require==`function`?new Promise((e,t)=>{__emailmaker__.require([se],t=>e(t),e=>t(e instanceof Error?e:Error(`[loadEngine] Failed to require core module`)))}):Promise.reject(Error(`[loadEngine] AMD loader is unavailable`))}function S(){return x||=ce(),x}var C=null,w=null;async function le(e){typeof e?.prefetch==`function`&&await e.prefetch()}function T(){return C||=S().then(()=>{}),C}function E(e){return w||=le(e),w}function D(e){return Promise.all([T(),E(e)]).then(()=>{})}function O(e){let t=e?.startupPrefetchMode;return t===`eager`||t===`idle`||t===`manual`||t===`off`?t:`eager`}function k(e){Promise.resolve().then(()=>D(e)).catch(()=>{})}function A(e){Promise.resolve().then(()=>E(e)).catch(()=>{})}function j(e){let t=O(e);if(t===`eager`)k(e);else if(t===`idle`){let t=window.requestIdleCallback;typeof t==`function`?t(()=>k(e),{timeout:1500}):setTimeout(()=>k(e),0)}}var M=`PluginRegistry`;function N(e=ne()){return e.getOrCreateInstance(M,()=>new ae)}var P=new oe(()=>N()),F=new WeakMap,I=`data-emailmaker-config-styles`;function L(e){return typeof e==`string`?e.trim():``}function R(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function z(e,t,n){if(!e||typeof document>`u`)return null;let r=L(t),i=F.get(e),a=n||e;if(!r)return i&&(i.remove(),F.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&R(a,i),i;let o=document.createElement(`style`);return o.setAttribute(I,`true`),o.textContent=r,R(a,o),F.set(e,o),o}function B(e){if(!e)return;let t=F.get(e);t&&(t.remove(),F.delete(e))}function V(e,t){if(typeof e<`u`)if(typeof e==`string`){if(e=document.querySelector(e),e)return e;let n=t.addDisposable(new o);return new Promise((t,r)=>{let i=new MutationObserver(()=>{e=document.querySelector(e),e&&(n.dispose(),t(e))});i.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),n.addDisposable({dispose:()=>i.disconnect()})})}else return e;else return e}var H=new Map;function U(){return!1}var W=`
715
715
  .blocks-app-initial-spinner-wrapper {
716
716
  width: 100%;
717
717
  height: 100%;
@@ -740,7 +740,7 @@ __emailmaker__.define(`emailmaker.js`,[`require`,`exports`,`module`],function(e,
740
740
  100% {
741
741
  transform: rotate(360deg);
742
742
  }
743
- }`;function ie(){return()=>{}}function q(e,t){if(!G()||!e||typeof document>`u`)return ie();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=K,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}var J=new WeakMap,Y=new Map;function X(e){return ae(String(e||``).trim()||`https://app.emailmaker.ru/api/`)}function ae(e){let t=e;for(;t.endsWith(`/`);)t=t.slice(0,t.length-1);return`${t}/wp-json`}async function oe(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function se(e){return async({baseUrl:t})=>{let n=X(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await oe(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function ce(e){return JSON.stringify({baseUrl:X(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function le(e){return async t=>{let n=ce(t),r=Y.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw Y.delete(n),e});return Y.set(n,i),i}}function ue(e){if(e.standaloneKey)return e;let t=e.appInit||se(e),n=J.get(t);return n||(n=le(t),J.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var Z=new WeakMap;function de(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function fe(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=Z.get(t);return n||(n=de(t),Z.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}var pe=i({FileManagerApiError:()=>_}),me=i({mapHttpStatusToErrorCode:()=>v});function Q(e,t){return{...e,element:t}}function $(){return()=>{}}function he(e){let t=e.element;return!t||typeof t==`string`||typeof document>`u`?$():(V(t,e.config?.styles,t),()=>{H(t)})}function ge(e){if(!G()||e.initialSpinner===!1||typeof document>`u`)return{options:e,cleanup:$()};let t=e.element;if(!t||typeof t==`string`)return{options:e,cleanup:$()};t.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=q(t,`data-emailmaker`),r=e.handleChunkLoaded;return{options:{...e,handleChunkLoaded:()=>{n(),r?.()}},cleanup:n}}function _e(e){return e?.length?e.some(e=>Array.isArray(e)?!1:!!(e&&typeof e==`object`&&`url`in e)):!1}var ve=`1.1.4`;async function ye(e){await k(typeof __emailmaker__<`u`?__emailmaker__:void 0)}async function be(e){let t=new a,n=await U(e.element,t);t.dispose();let r=ue(fe(Q(e,n)));if(n){let e=W.get(n);if(e)try{let t=await e;if(t.getElement()===n)return t.reset(r)}catch{W.get(n)===e&&W.delete(n)}}let i=he(r),o=ge(r),s=o.options;await D();let c=typeof __emailmaker__<`u`?__emailmaker__:void 0;_e(s.plugins)?await O(c):M(c);let l=w().then(e=>e.init(s));n&&W.set(n,l);try{let e=await l;return n&&W.set(n,e),e}catch(e){throw i(),o.cleanup(),n&&W.get(n)===l&&W.delete(n),e}}async function xe(e){return(await w()).parseAMP(e)}typeof window<`u`&&N(typeof __emailmaker__<`u`?__emailmaker__:void 0),Object.defineProperty(t,"errors",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(t,"helpers",{enumerable:!0,get:function(){return me}}),t.init=be,t.parseAMP=xe,t.pluginRegistry=I,t.preload=ye,t.version=ve});
743
+ }`;function ue(){return()=>{}}function de(e,t){if(!U()||!e||typeof document>`u`)return ue();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=W,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}function G(e){return f(e)}G(`HANDLE_ATOM_INSERT`),G(`SETTINGS_PANEL_EVENT`),G(`MODAL_SHOW_EVENT`),G(`MODAL_CLOSE_EVENT`),G(`MODAL_UPDATE_EVENT`);var fe=i((e=>{var t={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n=Object.assign,r={};function i(e,n,i){this.props=e,this.context=n,this.refs=r,this.updater=i||t}i.prototype.isReactComponent={},i.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function a(){}a.prototype=i.prototype;function o(e,n,i){this.props=e,this.context=n,this.refs=r,this.updater=i||t}var s=o.prototype=new a;s.constructor=o,n(s,i.prototype),s.isPureReactComponent=!0,Array.isArray}));i(((e,t)=>{t.exports=fe()}))();function K(e){return f(e)}var pe;(function(e){e.BEFORE_SAVE_EMAIL=K(),e.ON_SAVEBUTTON_CLICK_ID=K(),e.ON_NEXTBUTTON_CLICK_ID=K(),e.ON_PREVIOUSBUTTON_CLICK_ID=K(),e.ON_MODEL_CHANGE=K(),e.WILL_EMAIL_INIT_ID=K(),e.ON_EMAIL_INIT_ID=K(),e.ON_BLOCK_INIT_ID=K(),e.ON_CONTENT_CHANGED_ID=K(),e.ON_PREHEADER_CHANGED_ID=K(),e.ON_SUBJECT_CHANGED_ID=K(),e.ON_EMAIL_CHANGED_ID=K(),e.ON_BLOCK_CHANGED_ID=K(),e.ON_CHUNKS_LOADED=K(),e.ON_SEND_TESTEMAIL_ID=K(),e.ON_SEND_LIVEPREVIEW_ID=K(),e.ON_SHARE_ID=K(),e.ON_SHOW_PREVIEW_ID=K(),e.ON_EMAIL_CLONE_ID=K(),e.ON_SEND_EMAIL_MODAL_ID=K(),e.ON_NOTIFICATION=K(),e.READ_LOCALE=K(),e.ON_TRANSLATE_ID=K(),e.ON_CODE_VALIDATE_ID=K(),e.UPLOAD_EVENT_ID=K(),e.PROXY_URL_EVENT_ID=K(),e.FILE_PROXY_EVENT_ID=K(),e.ON_LIMIT_ID=K(),e.ON_GLOBAL_BLOCK_PROPAGATE_UPDATE_ID=K(),e.ON_BROWSER_EXTENSION_DETECTED_ID=K()})(pe||={}),K(`APP_LOAD_EVENT`),K(`CONFIG_CHANGED_EVENT`);function q(e){for(;e.endsWith(`/`);)e=e.slice(0,e.length-1);return/\/wp-json$/i.test(e)?e:`${e}/wp-json`}q(`https://app.emailmaker.ru/api/`);var me;(function(e){let t=`https://racs.emcdn.ru/v3`;function n(e,n){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(n)};return fetch(`${t}?resource=${e}&dataset=${document.location.hostname}`,r)}e.post=n;async function r(e,n=0){let r={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:`{"filter":{},"limit":${n}}`};return await(await fetch(`${t}/get?resource=${e}&dataset=${document.location.hostname}`,r)).json()}e.getAll=r})(me||={});var J=new Map,Y=new WeakMap;function X(e){return q(String(e||``).trim()||`https://app.emailmaker.ru/api/`)}async function he(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function ge(e){return async({baseUrl:t})=>{let n=X(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await he(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function _e(e){return JSON.stringify({baseUrl:X(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function ve(e){return async t=>{let n=_e(t),r=J.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw J.delete(n),e});return J.set(n,i),i}}function ye(e){if(e.standaloneKey)return e;let t=e.appInit||ge(e),n=Y.get(t);return n||(n=ve(t),Y.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var Z=new WeakMap;function be(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function xe(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=Z.get(t);return n||(n=be(t),Z.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}var Q=a({FileManagerApiError:()=>y}),Se=a({mapHttpStatusToErrorCode:()=>b});function Ce(e,t){return{...e,element:t}}function $(){return()=>{}}function we(e){let t=e.element;return!t||typeof t==`string`||typeof document>`u`?$():(z(t,e.config?.styles,t),()=>{B(t)})}function Te(e){if(!U()||e.initialSpinner===!1||typeof document>`u`)return{options:e,cleanup:$()};let t=e.element;if(!t||typeof t==`string`)return{options:e,cleanup:$()};t.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=de(t,`data-emailmaker`),r=e.handleChunkLoaded;return{options:{...e,handleChunkLoaded:()=>{n(),r?.()}},cleanup:n}}function Ee(e){return e?.length?e.some(e=>Array.isArray(e)?!1:!!(e&&typeof e==`object`&&`url`in e)):!1}var De=`1.1.6`;async function Oe(e){await D(typeof __emailmaker__<`u`?__emailmaker__:void 0)}async function ke(e){let t=new o,n=await V(e.element,t);t.dispose();let r=ye(xe(Ce(e,n)));if(n){let e=H.get(n);if(e)try{let t=await e;if(t.getElement()===n)return t.reset(r)}catch{H.get(n)===e&&H.delete(n)}}let i=we(r),a=Te(r),s=a.options;await T();let c=typeof __emailmaker__<`u`?__emailmaker__:void 0;Ee(s.plugins)?await E(c):A(c);let l=S().then(e=>e.init(s));n&&H.set(n,l);try{let e=await l;return n&&H.set(n,e),e}catch(e){throw i(),a.cleanup(),n&&H.get(n)===l&&H.delete(n),e}}async function Ae(e){return(await S()).parseAMP(e)}typeof window<`u`&&j(typeof __emailmaker__<`u`?__emailmaker__:void 0),Object.defineProperty(t,"errors",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(t,"helpers",{enumerable:!0,get:function(){return Se}}),t.init=ke,t.parseAMP=Ae,t.pluginRegistry=P,t.preload=Oe,t.version=De});
744
744
 
745
745
  // Возвращаем API из entry модуля
746
746
  return __emailmaker__.syncRequire("emailmaker.js");