useblocks 1.3.5 → 1.3.10

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 (72) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +21 -0
  3. package/iframe/.vite/manifest.json +4 -4
  4. package/iframe/css/sandbox.css +12 -0
  5. package/iframe/{iframe-eblock.cc33bf3e.html → iframe-eblock.5455e870.html} +2 -2
  6. package/iframe/{iframe.cc33bf3e.html → iframe.5455e870.html} +2 -2
  7. package/iframe/js/elMarkupHelper.Cv72GdwF.js +279 -0
  8. package/iframe/js/{iframe-eblock.body.cc33bf3e.js → iframe-eblock.body.5455e870.js} +1 -1
  9. package/iframe/js/iframe-eblock.js +2 -2
  10. package/iframe/js/iframe.body.5455e870.js +129 -0
  11. package/iframe/js/iframe.js +2 -2
  12. package/package.json +1 -1
  13. package/runtime/react/index.js +1 -1
  14. package/static/core/{100d863a.js → 19270609.js} +1 -1
  15. package/static/core/233f23fd.js +1 -0
  16. package/static/core/{2a1ca143.js → 2cf7ee08.js} +1 -1
  17. package/static/core/32f12150.js +1 -0
  18. package/static/core/{2a88a7ce.js → 38606c7d.js} +3 -3
  19. package/static/core/{95f608ad.js → 395f9635.js} +1 -1
  20. package/static/core/4030ef2c.js +1 -0
  21. package/static/core/4274a244.js +1 -0
  22. package/static/core/{80391bda.js → 43305d10.js} +1 -1
  23. package/static/core/{c0fa9d67.js → 48def854.js} +1 -1
  24. package/static/core/{3b8edeff.js → 4de0fff7.js} +1 -1
  25. package/static/core/4fec552e.js +1 -0
  26. package/static/core/{d26051be.js → 5a290fb6.js} +1 -1
  27. package/static/core/630febfd.js +1 -0
  28. package/static/core/6539262f.js +1 -0
  29. package/static/core/{b99d703d.js → 710be2de.js} +1 -1
  30. package/static/core/{7d879bb5.js → 7774d8cb.js} +1 -1
  31. package/static/core/{43ebd972.js → 791b9022.js} +1 -1
  32. package/static/core/{7d6f6c29.js → 7a43af5d.js} +1 -1
  33. package/static/core/{d98674b7.js → 7d2c1fd4.js} +1 -1
  34. package/static/core/{87aedddb.js → 7da32d21.js} +1 -1
  35. package/static/core/84c5ed0d.js +1 -0
  36. package/static/core/8606910e.js +1 -0
  37. package/static/core/{875e46a6.js → 91017e83.js} +1 -1
  38. package/static/core/{23b6bc56.js → 97db045b.js} +1 -1
  39. package/static/core/{93382e36.js → 9ccecd4a.js} +1 -1
  40. package/static/core/9f336cc6.js +1 -0
  41. package/static/core/a802b68f.js +1 -0
  42. package/static/core/acf08b55.js +1 -0
  43. package/static/core/{66619f08.js → b1edf5c5.js} +6 -6
  44. package/static/core/bf6643b0.js +1 -0
  45. package/static/core/{2de2e937.js → c24c3d6b.js} +1 -1
  46. package/static/core/{bc6678e8.js → c41fa010.js} +1 -1
  47. package/static/core/{61af94af.js → c8cfd469.js} +2 -2
  48. package/static/core/cbfe265e.js +1 -0
  49. package/static/core/d8d10299.js +19 -0
  50. package/static/core/{f3f60a1a.js → dd82fe37.js} +1 -1
  51. package/static/core/{cb30c7d7.js → e0f9c94e.js} +1 -1
  52. package/static/core/e532cd8d.js +10 -0
  53. package/static/core/{bb91f8dd.js → e7f50492.js} +1 -1
  54. package/static/core/eeba774d.js +163 -0
  55. package/static/core/ef13a2d7.js +1 -0
  56. package/static/core/{70467601.js → f033fd82.js} +1 -1
  57. package/static/core/{ac9606f9.js → f615b5d9.js} +2 -2
  58. package/static/core/fe47306c.js +1 -0
  59. package/static/esm/{3ce60f99.js → b6a1b54a.js} +1 -1
  60. package/static/umd-runtime/runtime.C1l7PfWP.js +1 -0
  61. package/useblocks-core.5455e870.js +875 -0
  62. package/useblocks-esm.js +53 -39
  63. package/{useblocks-po.cc33bf3e.js → useblocks-po.5455e870.js} +1 -1
  64. package/useblocks.d.ts +95 -5
  65. package/useblocks.js +54 -40
  66. package/vendor/useblocks-ui-kit/package.json +1 -1
  67. package/iframe/js/elMarkupHelper.DXAm8_Hg.js +0 -278
  68. package/iframe/js/iframe.body.cc33bf3e.js +0 -129
  69. package/static/core/5d75a7d6.js +0 -1
  70. package/static/core/9a39a2dd.js +0 -28
  71. package/static/umd-runtime/runtime.CpvZ7_Hr.js +0 -1
  72. package/useblocks-core.cc33bf3e.js +0 -859
@@ -1,4 +1,4 @@
1
- __useblocks__.define("js/iframe-eblock.js",["require","exports","module","js/elMarkupHelper.DXAm8_Hg.js"],function(h,w,M){const t=h("./elMarkupHelper.DXAm8_Hg.js");var R=t.require_iframeResizer_contentWindow_min();function k(o){const s=new Map,e=[],c=[],l=[];for(const n of o)if(n instanceof HTMLLinkElement)n.getAttribute("em-class")?.startsWith("em-font-")&&c.push(n);else if(n instanceof HTMLStyleElement){const r=n.getAttribute("em")||"",d=s.get(r);d?d.push(n):s.set(r,[n])}else if(n instanceof Element)if(n.getAttribute("em")==="block")e.push(n);else{const r=n.querySelector("[em='block']");r&&e.push(r)}else n.textContent===`
1
+ __useblocks__.define("js/iframe-eblock.js",["require","exports","module","js/elMarkupHelper.Cv72GdwF.js"],function(h,w,M){const t=h("./elMarkupHelper.Cv72GdwF.js");var R=t.require_iframeResizer_contentWindow_min();function k(o){const s=new Map,e=[],c=[],l=[];for(const n of o)if(n instanceof HTMLLinkElement)n.getAttribute("em-class")?.startsWith("em-font-")&&c.push(n);else if(n instanceof HTMLStyleElement){const r=n.getAttribute("em")||"",d=s.get(r);d?d.push(n):s.set(r,[n])}else if(n instanceof Element)if(n.getAttribute("em")==="block")e.push(n);else{const r=n.querySelector("[em='block']");r&&e.push(r)}else n.textContent===`
2
2
  `&&l.push(n);const a=[];for(const n of c)a.push(n);for(const[n,r]of s)if(r.length>1){let d=t.minifyStylesheet(r.map(m=>m.innerHTML).join(`
3
3
  `),{restructure:!0,forceMediaMerge:!0}).css;if(d=cssbeautify(d,{indent:" ",autosemicolon:!0}),d){const m=document.createElement("style");m.innerHTML=`
4
4
  ${d}
@@ -1,7 +1,7 @@
1
1
  var e=window.__useblocks__||(window.__useblocks__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=null,s={},c={},l=0;function u(e,t){l+=1;try{return e.factory.apply(null,t)}finally{--l}}var d=`./`,f={},p=60,m=`emailmaker:diagnostics`,h=[],g;function _(){if(g!==void 0)return g;g=!1;try{var e=/[?&]diagnostics(?:=([^&]*))?/.exec(window.location.search||``);if(e)return g=e[1]!==`0`,g;if(typeof window.__DIAGNOSTICS__==`boolean`)return g=!!window.__DIAGNOSTICS__,g;g=window.localStorage.getItem(m)===`1`}catch{g=!1}return g}function v(e,t){if(_()){var n={phase:e,at:performance.timeOrigin+performance.now(),kind:`wait`};t&&(n.parent=String(t)),h.push(n)}}function y(e){if(!e||e.__amdLogged)return e;try{Object.defineProperty(e,"__amdLogged",{value:!0,enumerable:!1})}catch{try{e.__amdLogged=!0}catch{}}try{var t=e&&e.message||`loader error`;console.error(`[AMD] `+(t.indexOf(`[AMD]`)===0?t.slice(6):t),e)}catch{}return e}function b(){try{if(e!==void 0&&e&&e.publicPath)return String(e.publicPath)}catch{}return`(not set)`}function x(){var e=b();return String(e).indexOf(`file:`)===0?` The page appears to be opened as a local file (file://) or publicPath was not configured. Serve the host app over HTTP(S) and set publicPath to the origin that serves editor assets (host bundler plugin or __amdEnv.setPublicPath). Current runtime publicPath=`+e+`.`:` Host bundler publicPath may be misconfigured (Vite/Webpack host plugin). In dev, set publicPath to the absolute origin that serves editor assets (for example http://localhost:3001/<outputFolder>/). Current runtime publicPath=`+e+`.`}function S(e){if(typeof fetch!=`function`)return Promise.resolve(``);function t(e){var t=(e.headers.get(`content-type`)||``).toLowerCase();try{e.body&&typeof e.body.cancel==`function`&&e.body.cancel()}catch{}return t.indexOf(`text/html`)>=0?` The URL returned HTML (Content-Type: text/html), not JavaScript — often a SPA fallback when asset paths are wrong.`:e.ok?``:` HTTP status `+e.status+` — the asset URL may be wrong or blocked by the server.`}return fetch(e,{method:`HEAD`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(function(n){return n.status===405||n.status===501?fetch(e,{method:`GET`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(t):t(n)}).catch(function(){return fetch(e,{method:`GET`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(t).catch(function(){return``})})}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 w(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 T(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 E(e){var t=String(e||``).replace(/\\/g,`/`),n=String(d||`./`).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 D(e){return{then:function(t,n){return e.then(t,n)},catch:function(t){return e.catch(t)},finally:function(t){return e.finally(t)}}}function O(e,t){var n=String(e||``);if(!n)return n;if(n.indexOf(`./`)!==0&&n.indexOf(`../`)!==0)return E(T(n));var r=t||``;if(Object.prototype.hasOwnProperty.call(f,r)){var i=String(f[r]||``);i&&!k(i)&&i.charAt(0)!==`/`&&(r=i)}var a=T(r),o=a?a.split(`/`):[];o.length>0&&o.pop();for(var s=n.split(`/`),c=0;c<s.length;c++){var l=s[c];if(l&&l!==`.`){if(l===`..`){o.length>0&&o.pop();continue}o.push(l)}}return E(o.join(`/`))}function k(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function A(e){var t=String(e||``);if(!t||k(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 j(){var t=String(d||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),k(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,A(e.publicPath)).href}catch{}return A(t)}function M(e,t){var n=O(e,t),r=j(),i=Object.prototype.hasOwnProperty.call(f,n)?String(f[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function N(){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 P(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=N()):typeof e==`function`?(r=e,n=[],e=N()):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})}P.amd={async:!0};function F(e){var t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}P(`vite/preload-helper`,[`exports`],function(e){e.__vitePreload=function(e){return Promise.resolve().then(function(){return e().catch(F)})}});function I(){return function(){}}function L(e,t){return{id:e,exports:t,uri:M(e)}}function R(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return V(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return V(e,r)}function z(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=O(e,o);if(s in a)throw y(a[s]);if(s in n)return n[s];if(s in r||s in i)throw y(C(s,Error(`Module is still loading asynchronously`)));if(!(s in t))throw y(C(s,Error(`Module is not available for syncRequire`)));return U(s)}function B(e,i){if(o&&e in o){var s={},c=[e];for(s[e]=!0;c.length>0;){var l=o[c.shift()];if(l)for(var u=0;u<l.length;u++){var d=l[u];s[d]||(s[d]=!0,c.push(d),!(d in n||d in a||d in r)&&(d in o?d in t||K(d,i).catch(function(){}):d in t&&V(d).catch(function(){})))}}}}function V(e,i){var o=O(e,i);if(o in a)return Promise.reject(y(a[o]));if(o in n)return Promise.resolve(n[o]);if(o in r)return r[o];if(v(`core:module:`+o+`:ask`,i),o in t)r[o]=H(o);else{var s=M(o);r[o]=K(o).then(function(){return v(`core:module:`+o+`:loaded`,i),o in t?H(o):S(s).then(function(e){var t=C(o,Error(`Module not defined after script load from "`+s+`".`+e+x()));throw a[o]=t,y(t)})}).catch(function(e){delete r[o];var t=e&&e.moduleId===o?e:C(o,e);throw a[o]=t,y(t)})}return B(o),r[o]}function H(e){var i=t[e],o=W(e),s=I(),l=L(e,s);c[e]=s;function d(t){return n[e]=t,delete r[e],delete c[e],n[e]}return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?l:V(t,e).catch(function(n){throw w(e,t,n)})})).then(function(t){v(`core:module:`+e+`:deps`);var n=u(i,t);return n&&typeof n.then==`function`?n.then(function(t){return v(`core:module:`+e+`:ready`),d(t===void 0?l.exports:t)}):(v(`core:module:`+e+`:ready`),d(n===void 0?l.exports:n))}).catch(function(t){throw delete r[e],delete c[e],a[e]=t,y(t)})}function U(e){var r=t[e],i=W(e),o=I(),s=L(e,o);try{var c=u(r,r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return z(t,e)}catch(n){throw w(e,t,n)}}));if(c&&typeof c.then==`function`)throw C(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=c===void 0?s.exports:c,n[e]}catch(t){throw a[e]=t,y(t)}}function W(e){var o=function(o,s,u){if(Array.isArray(o))return R(o,s,u,e);var d=O(o,e);if(d in a)throw y(a[d]);return d in n?n[d]:d in c&&l>0?c[d]:d in r||d in i?D(V(o,e)):d in t?z(o,e):D(V(o,e))};return o.resolve=function(t){return O(t,e)},o.toUrl=function(t){return M(t,e)},o.sync=function(t){return z(t,e)},o}function G(t,n){var r=e!==void 0&&e?e.moduleTransport:null;if(typeof r!=`function`||e.blobBlocked)return null;try{var i=r(t,n);return i&&typeof i.then==`function`?i:null}catch{return null}}function K(t,n){if(t in i)return i[t];if(s[t]&&s[t]!==t)return i[t]=K(s[t],n),i[t];var r=M(t);if(document.querySelector(`script[src="`+r+`"]`))return i[t]=Promise.resolve(),i[t];var a=performance.now();function o(e){return J(t,r,!1,n).then(function(n){return q(t,e,a),n})}var c=G(r,t);return c?(i[t]=c.then(function(r){return r?J(t,URL.createObjectURL(r),!0,n).then(function(e){return q(t,`transport`,a),e},function(){return e.blobBlocked=!0,o(`network-after-blob`)}):o(`network-fallback`)},function(){return o(`network-after-transport-error`)}),i[t]):(i[t]=o(`network`),i[t])}function q(t,n,r){_()&&((e.loaderTimings||=[]).push({id:t,via:n,ms:Math.round((performance.now()-r)*10)/10}),typeof e.onLoaderTiming==`function`&&e.onLoaderTiming())}function J(e,t,n,r){return new Promise(function(a,o){var s=!1,c=document.createElement(`script`);c.src=t,c.setAttribute(`data-amd-module-id`,e),c.async=!0,r===`low`&&(c.fetchPriority=`low`);var l=p>0?p*1e3:0,u=null;function d(){u!=null&&(clearTimeout(u),u=null),c.onload=null,c.onerror=null,n&&typeof URL<`u`&&URL.revokeObjectURL&&URL.revokeObjectURL(t)}function f(e){s||(s=!0,d(),e())}l>0&&(u=setTimeout(function(){f(function(){delete i[e],o(y(C(e,Error(`Timed out after `+l+`ms loading script: `+t+`.`+x()))))})},l)),c.onload=function(){f(function(){a()})},c.onerror=function(){f(function(){delete i[e],o(y(C(e,Error(`Failed to load script: `+t+`.`+x()))))})},document.head.appendChild(c)})}R.config=function(e){if(e.baseUrl&&(d=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(f[t]=e.paths[t]);if(e.bundles){for(var n in e.bundles)if(Object.prototype.hasOwnProperty.call(e.bundles,n))for(var r=0;r<e.bundles[n].length;r++)s[e.bundles[n][r]]=n}if(e.graph)for(var i in o||={},e.graph)Object.prototype.hasOwnProperty.call(e.graph,i)&&(o[i]=e.graph[i]);typeof e.waitSeconds==`number`&&e.waitSeconds>=0&&(p=e.waitSeconds)},R.warm=function(e,r){var i=r&&r.priority;return Promise.all((e||[]).map(function(e){var r=O(e);if(r in a)return Promise.reject(a[r]);var o=r in t||r in n?Promise.resolve():K(r,i);return B(r,i),o})).then(function(){})},R.modules=t,R.resolved=n,R.errors=a,R.toUrl=M,R.sync=z,e.define=P,e.require=R,e.syncRequire=z,e.diagnosticsBuffer=h})(),e.require.config({baseUrl:`./`});
2
2
 
3
- __useblocks__.require.config({ paths: {"js/iframe-eblock.js":"js/iframe-eblock.body.cc33bf3e.js"} });
3
+ __useblocks__.require.config({ paths: {"js/iframe-eblock.js":"js/iframe-eblock.body.5455e870.js"} });
4
4
 
5
- __useblocks__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.DXAm8_Hg.js"],"js/iframe.js":["js/elMarkupHelper.DXAm8_Hg.js"],"js/darkreader.CyLMh7_H.js":[],"js/elMarkupHelper.DXAm8_Hg.js":[],"js/rules.CL_BitCE.js":[],"js/typograf.all.CGEpDoct.js":[]}});
5
+ __useblocks__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.Cv72GdwF.js"],"js/iframe.js":["js/elMarkupHelper.Cv72GdwF.js"],"js/darkreader.CyLMh7_H.js":[],"js/elMarkupHelper.Cv72GdwF.js":[],"js/rules.CL_BitCE.js":[],"js/typograf.all.CGEpDoct.js":[]}});
6
6
 
7
7
  __useblocks__.require("js/iframe-eblock.js");
@@ -0,0 +1,129 @@
1
+ __useblocks__.define("js/iframe.js",["require","exports","module","js/elMarkupHelper.Cv72GdwF.js"],function($,Ke,Ze){const s=$("./elMarkupHelper.Cv72GdwF.js");var z="confetti:open-settings",U="confetti:start",j="confetti:stop",G="confetti:complete",Y=class{constructor(e){s._defineProperty(this,"_app",void 0),s._defineProperty(this,"_state","idle"),s._defineProperty(this,"_activeEffects",new Map),s._defineProperty(this,"_onDocumentClick",r=>{const i=r.target;if(!i)return;const n=i.closest(".confetti-placeholder");if(!n)return;const l=n.getAttribute("data-confetti-preset")||void 0;this._app.use("MessageService").send(z,{preset:l})}),this._app=e}init(){const e=this._app.use("MessageService");e.addListener(U,r=>this._handleStart(r.id,r.options)),e.addListener(j,r=>this._handleStop(r.id)),document.addEventListener("click",this._onDocumentClick,!0)}_handleStart(e,r){const i={id:e,options:r,startTime:Date.now()};this._activeEffects.set(e,i),this._state="running",this.onEffectStart(e,r),this.renderConfetti(e,r);const n=r.duration||3e3;setTimeout(()=>{this._completeEffect(e)},n)}_handleStop(e){if(this._state="stopping",e==="all")for(const r of this._activeEffects.keys())this._completeEffect(r,!0);else this._completeEffect(e,!0)}_completeEffect(e,r=!1){this._activeEffects.get(e)&&(this._activeEffects.delete(e),this.clearConfetti(e,r),this.onEffectComplete(e),this._activeEffects.size===0&&(this._state="idle"),this._app.use("MessageService").send(G,{id:e}))}onEffectStart(e,r){}onEffectComplete(e){}getState(){return this._state}isRunning(){return this._state==="running"}dispose(){document.removeEventListener("click",this._onDocumentClick,!0),this._handleStop("all"),this._activeEffects.clear()}},X=class extends Y{constructor(e){super(e),s._defineProperty(this,"_containers",new Map)}renderConfetti(e,r){const i=this._getRenderBounds(),n=document.createElement("div");n.id=`confetti-${e}`,n.setAttribute("data-confetti-overlay","true"),n.style.cssText=`
2
+ position: absolute;
3
+ top: ${i.top}px;
4
+ left: ${i.left}px;
5
+ width: ${i.width}px;
6
+ height: ${i.height}px;
7
+ pointer-events: none;
8
+ z-index: 2147483647;
9
+ overflow: hidden;
10
+ display: block;
11
+ line-height: 0;
12
+ font-size: 0;
13
+ `,n.innerHTML=this._generateStaticSvg(r,i.width,i.height),document.body.appendChild(n),this._containers.set(e,n)}clearConfetti(e,r){const i=this._containers.get(e);i&&(i.remove(),this._containers.delete(e))}_generateStaticSvg(e,r,i){const{particleCount:n=100,angle:l=90,spread:o=45,colors:t=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff"],originX:a=.5,originY:d=.5}=e,c=Math.max(r,320),u=Math.max(i,220),f=Math.max(Math.min(c,u)*.48,140),p=(Math.max(e.duration||3e3,1800)/1e3).toFixed(2),h=a===.5?.22:a,y=d===.5?.62:d,m=c*h,b=u*y,T=[],R=[];for(let M=0;M<n;M++){const W=(l-o/2+Math.random()*o)*(Math.PI/180),I=30+Math.random()*f,Ge=m+Math.cos(W)*I,Ye=b-Math.sin(W)*I,w=Ge-m,B=Ye-b,H=t[Math.floor(Math.random()*t.length)],S=6+Math.random()*10,L=Math.random()*360,D=90+Math.random()*180,C=.78+Math.random()*.22,k=(1.6+Math.random()*1.8).toFixed(2),E=(Math.random()*.35).toFixed(2);if(Math.random()>.5?T.push(`
14
+ <g transform="translate(${m} ${b})">
15
+ <circle cx="0" cy="0" r="${S/2}" fill="${H}" opacity="${C}">
16
+ <animateTransform attributeName="transform" type="translate" values="0 0; ${w*.72} ${B*.72}; ${w} ${B}" dur="${k}s" begin="${E}s" repeatCount="indefinite" />
17
+ <animate attributeName="opacity" values="0; ${C}; ${C}; 0" dur="${k}s" begin="${E}s" repeatCount="indefinite" />
18
+ <animate attributeName="r" values="${Math.max(S*.28,2)}; ${S/2}; ${Math.max(S*.18,1.5)}" dur="${k}s" begin="${E}s" repeatCount="indefinite" />
19
+ </circle>
20
+ </g>
21
+ `):T.push(`
22
+ <g transform="translate(${m} ${b}) rotate(${L})">
23
+ <rect x="${-S/2}" y="${-Math.max(S/4,2)}" width="${S}" height="${Math.max(S/2,4)}" fill="${H}" opacity="${C}" rx="2" ry="2">
24
+ <animateTransform attributeName="transform" type="translate" values="0 0; ${w*.74} ${B*.74}; ${w} ${B}" dur="${k}s" begin="${E}s" repeatCount="indefinite" additive="sum" />
25
+ <animateTransform attributeName="transform" type="rotate" values="${L}; ${L+D}; ${L+D*1.7}" dur="${k}s" begin="${E}s" repeatCount="indefinite" additive="sum" />
26
+ <animate attributeName="opacity" values="0; ${C}; ${C}; 0" dur="${k}s" begin="${E}s" repeatCount="indefinite" />
27
+ </rect>
28
+ </g>
29
+ `),M<Math.max(8,Math.floor(n/6))){const g=10+Math.random()*10,Xe=m+w*(.35+Math.random()*.45),Ve=b+B*(.2+Math.random()*.5),O=(Math.random()*.6).toFixed(2);R.push(`
30
+ <g transform="translate(${Xe} ${Ve})">
31
+ <path
32
+ d="M0 ${-g/2} L${g/6} ${-g/6} L${g/2} 0 L${g/6} ${g/6} L0 ${g/2} L${-g/6} ${g/6} L${-g/2} 0 L${-g/6} ${-g/6} Z"
33
+ fill="rgba(255,255,255,0.9)"
34
+ opacity="0"
35
+ filter="url(#confettiGlow)"
36
+ >
37
+ <animate attributeName="opacity" values="0;0.9;0" dur="1.4s" begin="${O}s" repeatCount="indefinite" />
38
+ <animateTransform attributeName="transform" type="scale" values="0.6;1;0.6" dur="1.4s" begin="${O}s" repeatCount="indefinite" />
39
+ </path>
40
+ </g>
41
+ `)}}return`
42
+ <svg
43
+ xmlns="http://www.w3.org/2000/svg"
44
+ viewBox="0 0 ${c} ${u}"
45
+ width="${c}"
46
+ height="${u}"
47
+ preserveAspectRatio="none"
48
+ style="display:block;width:100%;height:100%;pointer-events:none"
49
+ >
50
+ <defs>
51
+ <filter id="confettiGlow" x="-50%" y="-50%" width="200%" height="200%">
52
+ <feGaussianBlur stdDeviation="2.5" result="blur" />
53
+ <feMerge>
54
+ <feMergeNode in="blur" />
55
+ <feMergeNode in="SourceGraphic" />
56
+ </feMerge>
57
+ </filter>
58
+ <radialGradient id="confettiAura" cx="50%" cy="50%" r="50%">
59
+ <stop offset="0%" stop-color="rgba(255,255,255,0.95)" />
60
+ <stop offset="45%" stop-color="rgba(255,255,255,0.32)" />
61
+ <stop offset="100%" stop-color="rgba(255,255,255,0)" />
62
+ </radialGradient>
63
+ <linearGradient id="confettiTrail" x1="0" y1="0" x2="1" y2="1">
64
+ <stop offset="0%" stop-color="rgba(255,255,255,0.9)" />
65
+ <stop offset="100%" stop-color="rgba(255,255,255,0)" />
66
+ </linearGradient>
67
+ </defs>
68
+ <rect width="100%" height="100%" fill="transparent" />
69
+ <g transform="translate(${m} ${b})">
70
+ <circle cx="0" cy="0" r="18" fill="url(#confettiAura)" opacity="0.7">
71
+ <animate attributeName="r" values="12;34;18" dur="${p}s" repeatCount="indefinite" />
72
+ <animate attributeName="opacity" values="0.75;0.18;0.55" dur="${p}s" repeatCount="indefinite" />
73
+ </circle>
74
+ <circle cx="0" cy="0" r="4" fill="#ffffff" opacity="0.95" filter="url(#confettiGlow)">
75
+ <animate attributeName="r" values="3;7;3" dur="1.6s" repeatCount="indefinite" />
76
+ <animate attributeName="opacity" values="0.7;1;0.55" dur="1.6s" repeatCount="indefinite" />
77
+ </circle>
78
+ <path d="M0 0 L58 -14" stroke="url(#confettiTrail)" stroke-width="5" stroke-linecap="round" opacity="0.65">
79
+ <animate attributeName="opacity" values="0.1;0.7;0.1" dur="1.8s" repeatCount="indefinite" />
80
+ </path>
81
+ </g>
82
+ ${R.join("")}
83
+ ${T.join("")}
84
+ </svg>
85
+ `}_getRenderBounds(){const e=this._getPlaceholderElement();if(e){const n=e.getBoundingClientRect(),l=320,o=220,t=Math.max(document.documentElement.clientWidth,window.innerWidth||0),a=Math.max(document.documentElement.clientHeight,window.innerHeight||0),d=n.right+12,c=n.left-l-12,u=d+l<=t?d:Math.max(8,c);return{top:Math.min(Math.max(8,n.top+n.height/2-o/2),Math.max(8,a-o-8))+window.scrollY,left:u+window.scrollX,width:l,height:o}}const r=this._getRenderRoot();if(!r)return{top:window.scrollY,left:window.scrollX,width:Math.max(window.innerWidth,800),height:Math.max(window.innerHeight,600)};const i=r.getBoundingClientRect();return{top:i.top+window.scrollY,left:i.left+window.scrollX,width:Math.max(Math.ceil(r.scrollWidth||i.width),Math.ceil(i.width),320),height:Math.max(Math.ceil(r.scrollHeight||i.height),Math.ceil(i.height),240)}}_getRenderRoot(){for(const e of['[em="block-contaner"]',".es-wrapper-color",".es-content-body",".es-content","body > table","body > div"]){const r=document.querySelector(e);if(r instanceof HTMLElement)return r}return document.body}_getPlaceholderElement(){const e=document.querySelector(".confetti-placeholder");return e instanceof HTMLElement?e:null}onEffectStart(e,r){}onEffectComplete(e){}dispose(){for(const e of this._containers.values())e.remove();this._containers.clear(),super.dispose()}},V=[X];function K(e){const r=e.find(t=>t instanceof DocumentType),i=document.documentElement;let n=e.find(t=>t instanceof HTMLHtmlElement);if(!n){n=i||document.createElement("html");let t=e.find(d=>d instanceof HTMLHeadElement);if(t&&t.parentNode!==n){const d=document.head;if(d){n.replaceChild(t,d);for(const c of d.childNodes)t.appendChild(c)}else n.insertBefore(t,n.firstChild)}let a=e.find(d=>d instanceof HTMLBodyElement);if(!a){a=document.body||document.createElement("body");const d=e.filter(c=>c!==t&&c!==r).reverse();if(d.length){let c=null;for(const u of d)(u.parentNode!==a||u.nextSibling!==c)&&a.insertBefore(u,c),c=u}}if(a.parentNode!==n){const d=document.body;if(d){n.replaceChild(a,d);for(const c of d.childNodes)a.appendChild(c)}else n.appendChild(a)}}const l=[...n.childNodes];if(!l.find(t=>t instanceof HTMLHeadElement)){const t=e.find(a=>a instanceof HTMLHeadElement)||document.createElement("head");n.insertBefore(t,n.firstChild)}if(!l.find(t=>t instanceof HTMLBodyElement)){const t=e.find(a=>a instanceof HTMLBodyElement)||document.createElement("body");n.appendChild(t)}const o=document.doctype;return o!==r&&(o?r?document.replaceChild(r,o):document.removeChild(o):r&&document.insertBefore(r,document.firstChild)),i!==n&&(i?n?document.replaceChild(n,i):document.removeChild(i):n&&document.appendChild(n)),e}var Z='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',Q={name:"email",mapHTMLRoots:K,createRoot:(e,r)=>{const n=r.length;let l=e.find(c=>c.tag==="html"),o=e.find(c=>c.type===s.NodeType.DOCTYPE);if(!l){e=e.filter(c=>c!==o),l=new s.Node(0,n,e),l.createdBy="createRoot",l.tag="html",l.children=e;for(const c of e)c.parent=l;l.startTagEnd=0,l.endTagStart=n,e=[l]}let t=l.children.find(c=>c.tag==="body"),a=l.children.find(c=>c.tag==="head");if(!t){const c=l.children.filter(u=>u!==a);t=new s.Node(a?a.end:l.startTagEnd||l.start,l.endTagStart||l.end,c,l),t.createdBy="createRoot",t.startTagEnd=t.start,t.endTagStart=t.end;for(const u of c)u.parent=t;t.tag="body",l.children=a?[a,t]:[t]}a||(a=new s.Node(l.startTagEnd||l.start,l.startTagEnd||l.start,[],l),a.createdBy="createRoot",a.startTagEnd=a.start,a.endTagStart=a.start,a.tag="head",l.children.unshift(a)),o||(o=new s.Node(0,0,[]),o.createdBy="createRoot",o.startTagEnd=0,o.endTagStart=0,o.type=s.NodeType.DOCTYPE,o.content=Z,e.unshift(o));const d=new s.Node(0,n,e);d.type=s.NodeType.ROOT;for(const c of e)c.parent=d,c.type===s.NodeType.ELEMENT&&c.tag!=="html"?(c.type=s.NodeType.COMMENT,c.content=r.substring(c.start,c.end),c.children=[]):c.type===s.NodeType.HTML&&(c.type=s.NodeType.COMMENT,c.content=c.content||"");return d}},Qe=s.require_iframeResizer_contentWindow_min();function J(){return s.messageService.addListenerAsync(s.EVENT_TYPES.SANDBOX_IS_EMAIL_EMPTY,e=>{const r=document.querySelector(".em-narrow-table");return r?!(r.querySelectorAll("tr").length>0):!0})}function ee(e){return{blocks:e.querySelectorAll('[em="block"]').length,textLength:(e.body?.textContent??"").replace(/\s+/g," ").trim().length}}function te(){return s.messageService.addListenerAsync(s.EVENT_TYPES.SANDBOX_CANVAS_HEALTH,()=>ee(document))}function oe(e){if(!e)return{backgroundColor:void 0,backgroundImage:void 0,backgroundPositionX:void 0,backgroundPositionY:void 0,backgroundRepeat:void 0,backgroundSize:void 0};const r={};if(e.style.backgroundColor?r.backgroundColor=e.style.backgroundColor:e.getAttribute("bgcolor")&&(r.backgroundColor=e.getAttribute("bgcolor")||void 0),e.style.backgroundImage){const i=e.style.backgroundImage;r.backgroundImage=[{type:"url",value:i?i.substring(5,i.length-2):""}]}else e.getAttribute("background")&&(r.backgroundImage=[{type:"url",value:e.getAttribute("background")||""}]);return r.backgroundPositionX=e.style.backgroundPositionX||void 0,r.backgroundPositionY=e.style.backgroundPositionY||void 0,r.backgroundRepeat=e.style.backgroundRepeat||void 0,r.backgroundSize=e.style.backgroundSize||void 0,r}function re(e){if(e){if(document.querySelector(".es-header")||document.querySelector(".es-content")||document.querySelector(".es-footer")){const r=e.querySelector(".es-content"),i=e.querySelector(".es-content-body");return parseFloat(r?.style.width||"")||parseFloat(i?.style.width||"")||void 0}if(document.querySelector(".nl-container")&&document.querySelector(".row")){const r=document.querySelector(".row-content");return parseFloat(r?.style.width||"")||parseFloat(r?.getAttribute("width")||"")||void 0}if(document.querySelector(".nl-container")&&!document.querySelector(".row")){const r=e.querySelector('[style*="max-width"]');return parseFloat(r?.style.maxWidth||"")||void 0}if(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]")){const r=e.querySelector("table:first-child");if(r?.style.maxWidth)return parseFloat(r.style.maxWidth)||void 0}if(document.querySelector(".container-div")){const r=e.querySelector("div:first-child");if(r?.style.maxWidth)return parseFloat(r.style.maxWidth)||void 0}if(document.querySelector(".email-container")){const r=document.querySelector(".email-container");return parseFloat(r?.getAttribute("width")||"")||void 0}return ie(e)}}function ie(e){const r=e.querySelector("table:first-child");if(!r)return;const i=parseFloat(r.getAttribute("width")||""),n=parseFloat(r.style.maxWidth||"");if(i>700||n>700){const o=e.querySelector('table:first-child [em="block"] > td > table');if(o){const t=o.getAttribute("width");return t&&t.indexOf("%")===-1?parseFloat(t):o.style.maxWidth?parseFloat(o.style.maxWidth):e.querySelector('table:first-child [em="block"]')?.clientWidth||660}return 660}const l=r.getAttribute("width");if(l&&l.indexOf("%")===-1)return parseFloat(l);if(r.style.maxWidth)return parseFloat(r.style.maxWidth)}function ne(e,r){const i={shutdown:void 0,styles:!0};if(!e||!r)return i;const n=e.querySelector("table:first-child");if(!n)return i;const l=n.getAttribute("width"),o=parseFloat(n.style.minWidth||"");return l&&l.indexOf("%")===-1&&o===parseFloat(l)||e.querySelector(".noresp-em-narrow-table")?{shutdown:!1,styles:!1}:{shutdown:!0,styles:!0}}var le=2;function ae(e,r){!e||!r||document.querySelector(".noresp-em-narrow-table, .em-narrow-table")&&(e.getBoundingClientRect().width<=r||document.querySelectorAll("img").forEach(i=>{const n=i.closest("td")?.getBoundingClientRect().width;n&&parseFloat(i.getAttribute("width")||"")>n+le&&n>10&&i.style.display!=="none"&&(i.setAttribute("width",String(Math.ceil(n))),i.style.maxWidth=Math.ceil(n)+"px")}))}function se(e){const r=e.findGlobalHolder();e.setGlobalHolder(r);const i={operation:"application_email_settings_set",settings:{subject:e.getSubject(),preheader:e.getPreheader(),responsive:{shutdown:void 0,styles:!0},structuresMedia:!(document.querySelector('[em="block"] div[style*="display: inline-block"]')&&!document.querySelector('[em="block"] .em-mob-wrap, [em="block"] .noresp-em-mob-wrap')),usedColors:e.getUsedColors(),noBlocks:!1,width:{value:void 0,dim:"px"},backgroundColor:void 0,backgroundImage:void 0,backgroundPositionX:void 0,backgroundPositionY:void 0,backgroundRepeat:void 0,backgroundSize:void 0,backgroundColorContent:void 0}};if(r){const a=oe(r);a.backgroundColor&&a.backgroundColor.startsWith("rgb")&&(a.backgroundColor=e.rgbToHex(a.backgroundColor)),Object.assign(i.settings,a)}e.elMarkupHelper(),document.querySelector('[em="block"]')||(i.settings.noBlocks=!0);const n=re(r),l=e.state.get("emailWidth"),o=e.getEmailWidth(),t=typeof l=="number"&&l>=320?l:typeof o=="number"&&o>=320?o:n;i.settings.width.value=t,r&&(i.settings.responsive=ne(r,t),typeof t=="number"&&e.state.set("emailWidth",t)),e.messageService.send(i),ae(r,e.getEmailWidth())}function de(e,r=!1){e.closeEditorInit(),document.body&&(e.removeHiddenClasses(document),se(e),e.commit(!1))}function A(e,r){r[1]==="Sans Serif"?e.style.fontFamily="Helvetica, Arial, sans-serif":r[1]==="Serif"?e.style.fontFamily='"Times New Roman", Times, serif':r[1]==="Project Fonts"&&s.applyProjectFontInlineFallback(e,r[2])}function ce(e,r){const i=e?.toLowerCase();return i==="#ffffff"&&i!==r?.toLowerCase()}function ue(e,r){const{lockEditor:i,commonStyles:n,globalHolder:l}=r;if(i)return;const o=document.querySelectorAll('div[style*="font-family"]');me(e,o,r),fe(e,o,r),ye(e,r),he(e,r),ve(e,r),Ce(e,r);const t={operation:"application_commonStyles_update",settings:{commonStyles:n}};r.messageService.send(t)}function me(e,r,i){const{commonStyles:n,rgbToHex:l}=i;if(e.textFontFamily!==void 0){let o=[];r.forEach(t=>{const a=t;let d;!a.style.display&&parseFloat(a.style.fontSize)<=20&&(o=e.textFontFamily,o[0]==="Safe Fonts"?(a.style.fontFamily=o[1],(d=[...a.classList].filter(c=>c.startsWith("em-font-"))[0])&&(a.classList.remove(d),n.text.fontFamily?.[2]&&i.clearLinkTags({elem:document.documentElement,fontFamilyClassName:s.buildEmFontClassName(n.text.fontFamily[2],n.text.fontFamily[3])}),i.clearProjectFontFaces())):o[0]==="Google Fonts"&&(A(a,o),i.removeClassesByPrefix(a,"em-font"),a.classList.add(i.createFontClassName(o)),s.markProjectFontClass(a,o)))}),o.length>0&&o[0]==="Google Fonts"&&i.addFontFamilyClass({fontFamilyArray:o}),i.clearProjectFontFaces(),n.text.fontFamily=e.textFontFamily}e.textFontSize!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)<=20&&parseFloat(t.style.fontSize)>14&&(t.style.fontSize=e.textFontSize+"px")}),n.text.fontSize=e.textFontSize),e.textLineHeight!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)<=20&&parseFloat(t.style.fontSize)>14&&(t.style.lineHeight=e.textLineHeight+"px")}),n.text.lineHeight=e.textLineHeight),e.textColor!==void 0&&(r.forEach(o=>{const t=o;!t.closest(".em-contrast-block")&&!t.style.display&&parseFloat(t.style.fontSize)<=20&&!ce(l(t.style.color),l(n.text.color))&&(t.style.color=e.textColor)}),n.text.color=e.textColor),e.textContrastColor!==void 0&&(r.forEach(o=>{const t=o;t.closest(".em-contrast-block")&&!t.style.display&&parseFloat(t.style.fontSize)<=20&&(t.style.color=e.textContrastColor)}),n.text.contrastColor=e.textContrastColor),e.textPaddingBottom!==void 0&&(r.forEach(o=>{const t=o;if(t.closest('[em="atom"]')){if(!t.style.display&&parseFloat(t.style.fontSize)<=20&&t.closest("table")?.getAttribute("em")=="atom"){const a=t.closest('[em="atom"]')?.querySelector(":scope > tr > td, :scope > tbody > tr > td");a&&(a.style.paddingBottom=e.textPaddingBottom+"px",a.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}}else if(t.nextElementSibling){const a=t.nextElementSibling;if(!t.style.display&&parseFloat(t.style.fontSize)<=20&&t.parentElement?.getAttribute("em")=="atom"&&a&&a.tagName=="TABLE"&&(a.classList.contains("em-vindent-table")||a.querySelector("td")?.innerHTML=="")){a.querySelector("td")?.setAttribute("height",e.textPaddingBottom);const d=a.querySelector(".em-element-vindent-value");d&&(d.innerHTML=e.textPaddingBottom+"px",e.textPaddingBottom<30?a.querySelector(".em-vindent")?.classList.add("em-vindent_low"):a.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.text.paddingBottom=e.textPaddingBottom)}function fe(e,r,i){const{commonStyles:n,rgbToHex:l}=i;if(e.headingFontFamily!==void 0){let o=[];r.forEach(t=>{const a=t;let d;!a.style.display&&parseFloat(a.style.fontSize)>20&&l(a.style.color).toLowerCase()!=="#eb3737"&&(o=e.headingFontFamily,o[0]==="Safe Fonts"?(a.style.fontFamily=o[1],(d=[...a.classList].filter(c=>c.startsWith("em-font-"))[0])&&(a.classList.remove(d),n.headings.fontFamily?.[2]&&i.clearLinkTags({elem:document.documentElement,fontFamilyClassName:s.buildEmFontClassName(n.headings.fontFamily[2],n.headings.fontFamily[3])}),i.clearProjectFontFaces())):o[0]==="Google Fonts"&&(A(a,o),i.removeClassesByPrefix(a,"em-font"),a.classList.add(i.createFontClassName(o)),s.markProjectFontClass(a,o)))}),o.length>0&&o[0]==="Google Fonts"&&i.addFontFamilyClass({fontFamilyArray:o}),i.clearProjectFontFaces(),n.headings.fontFamily=e.headingFontFamily}e.headingFontSize!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>=20&&l(t.style.color).toLowerCase()!=="#eb3737"&&parseFloat(t.style.fontSize)<=40&&(t.style.fontSize=e.headingFontSize+"px")}),n.headings.fontSize=e.headingFontSize),e.headingLineHeight!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&parseFloat(t.style.fontSize)<=40&&(t.style.lineHeight=e.headingLineHeight+"px")}),n.headings.lineHeight=e.headingLineHeight),e.headingLetterSpacing!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&(e.headingLetterSpacing>0?t.style.letterSpacing=e.headingLetterSpacing+"px":t.style.removeProperty("letter-spacing"))}),n.headings.letterSpacing=e.headingLetterSpacing),e.headingBold!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&(e.headingBold?t.querySelector("b")?t.querySelector("b").replaceWith(...t.querySelector("b").childNodes):t.querySelector("strong")||(t.innerHTML="<strong>"+t.innerHTML+"</strong>"):t.querySelector("strong")?t.querySelector("strong").replaceWith(...t.querySelector("strong").childNodes):t.querySelector("b")&&t.querySelector("b").replaceWith(...t.querySelector("b").childNodes),t.style.fontWeight&&t.style.removeProperty("font-weight"))}),n.headings.bold=e.headingBold),e.headingItalic!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&(e.headingItalic?t.querySelector("i")?t.querySelector("i").replaceWith(...t.querySelector("i").childNodes):t.querySelector("em")||(t.innerHTML="<em>"+t.innerHTML+"</em>"):t.querySelector("em")?t.querySelector("em").replaceWith(...t.querySelector("em").childNodes):t.querySelector("i")&&t.querySelector("i").replaceWith(...t.querySelector("i").childNodes),t.style.fontStyle&&t.style.removeProperty("font-style"))}),n.headings.italic=e.headingItalic),e.headingColor!==void 0&&(r.forEach(o=>{const t=o;!t.closest(".em-contrast-block")&&!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&(t.style.color=e.headingColor)}),n.headings.color=e.headingColor),e.headingContrastColor!==void 0&&(r.forEach(o=>{const t=o;t.closest(".em-contrast-block")&&!t.style.display&&parseFloat(t.style.fontSize)>20&&(t.style.color=e.headingContrastColor)}),n.headings.contrastColor=e.headingContrastColor),pe(e,r,i),e.blockDarkBackgroundColor!==void 0&&(n.block.darkBackgroundColor=e.blockDarkBackgroundColor)}function pe(e,r,i){const{commonStyles:n,rgbToHex:l}=i;e.headingPaddingTop!==void 0&&(r.forEach(o=>{const t=o;if(t.closest('[em="atom"]')){if(!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&t.closest("table")?.getAttribute("em")=="atom"){const a=t.closest('[em="atom"]')?.querySelector(":scope > tr > td, :scope > tbody > tr > td");a&&(a.style.paddingTop=e.headingPaddingTop+"px",a.querySelector(":scope > .em-vindent-paddingTop")?.remove())}}else if(t.previousElementSibling){const a=t.previousElementSibling;if(!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&t.parentElement?.getAttribute("em")=="atom"&&a&&a.tagName=="TABLE"&&(a.classList.contains("em-vindent-table")||a.querySelector("td")?.innerHTML=="")){a.querySelector("td")?.setAttribute("height",e.headingPaddingTop);const d=a.querySelector(".em-element-vindent-value");d&&(d.innerHTML=e.headingPaddingTop+"px",e.headingPaddingTop<30?a.querySelector(".em-vindent")?.classList.add("em-vindent_low"):a.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.headings.paddingTop=e.headingPaddingTop),e.headingPaddingBottom!==void 0&&(document.querySelectorAll('div[style*="font-family"]').forEach(o=>{const t=o,a=t.closest('[em="atom"]');if(a){const d=a.querySelector(":scope > tr > td, :scope > tbody > tr > td");d?.style.paddingBottom&&!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&t.closest("table")?.getAttribute("em")=="atom"&&(d.style.paddingBottom=e.headingPaddingBottom+"px",d.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}else if(t.nextElementSibling){const d=t.nextElementSibling;if(!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&t.parentElement?.getAttribute("em")=="atom"&&d&&d.tagName=="TABLE"&&(d.classList.contains("em-vindent-table")||d.querySelector("td")?.innerHTML=="")){d.querySelector("td")?.setAttribute("height",e.headingPaddingBottom);const c=d.querySelector(".em-element-vindent-value");c&&(c.innerHTML=e.headingPaddingBottom+"px",e.headingPaddingBottom<30?d.querySelector(".em-vindent")?.classList.add("em-vindent_low"):d.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.headings.paddingBottom=e.headingPaddingBottom)}function ye(e,r){const{commonStyles:i}=r,n=document.querySelectorAll('a[style*="color"]');e.linkColor!==void 0&&(n.forEach(l=>{const o=l;!o.closest(".em-contrast-block")&&!o.style.display&&(o.style.color=e.linkColor)}),i.links.color=e.linkColor),e.linkContrastColor!==void 0&&(n.forEach(l=>{const o=l;o.closest(".em-contrast-block")&&!o.style.display&&(o.style.color=e.linkContrastColor)}),i.links.contrastColor=e.linkContrastColor),e.linkUnderline!==void 0&&(n.forEach(l=>{const o=l;if(!o.style.display){o.style.textDecoration=e.linkUnderline?"underline":"none";const t=o.parentElement;t&&t.tagName=="SPAN"&&t.style.textDecoration=="underline"&&t.replaceWith(...t.childNodes)}}),i.links.underline=e.linkUnderline)}function he(e,r){const{commonStyles:i}=r,n=document.querySelectorAll('a[style*="font-family"]');if(e.buttonsFontFamily!==void 0){let l=[];n.forEach(o=>{const t=o;let a;t.style.display&&t.style.display=="block"&&(l=e.buttonsFontFamily,l[0]==="Safe Fonts"?(t.style.fontFamily=l[1],(a=[...t.classList].filter(d=>d.startsWith("em-font-"))[0])&&(t.classList.remove(a),i.buttons.fontFamily?.[2]&&r.clearLinkTags({elem:document.documentElement,fontFamilyClassName:s.buildEmFontClassName(i.buttons.fontFamily[2],i.buttons.fontFamily[3])}),r.clearProjectFontFaces())):l[0]==="Google Fonts"&&(A(t,l),r.removeClassesByPrefix(t,"em-font"),t.classList.add(r.createFontClassName(l)),s.markProjectFontClass(t,l)))}),l.length>0&&l[0]==="Google Fonts"&&r.addFontFamilyClass({fontFamilyArray:l}),r.clearProjectFontFaces(),i.buttons.fontFamily=e.buttonsFontFamily}e.buttonsFontSize!==void 0&&(n.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&(o.style.fontSize=e.buttonsFontSize+"px")}),i.buttons.fontSize=e.buttonsFontSize),e.buttonsLetterSpacing!==void 0&&(n.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&(e.buttonsLetterSpacing>0?o.style.letterSpacing=e.buttonsLetterSpacing+"px":o.style.removeProperty("letter-spacing"))}),i.buttons.letterSpacing=e.buttonsLetterSpacing),be(e,n,r),ge(e,n,r),Se(e,n,r)}function be(e,r,i){const{commonStyles:n}=i;e.buttonsColor!==void 0&&(r.forEach(l=>{const o=l;!o.closest(".em-contrast-block")&&o.style.display&&o.style.display=="block"&&(o.style.color=e.buttonsColor)}),n.buttons.color=e.buttonsColor),e.buttonsContrastColor!==void 0&&(r.forEach(l=>{const o=l;o.closest(".em-contrast-block")&&o.style.display&&o.style.display=="block"&&(o.style.color=e.buttonsContrastColor)}),n.buttons.contrastColor=e.buttonsContrastColor),e.buttonsBold!==void 0&&(r.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&(e.buttonsBold?o.querySelector("b")?o.querySelector("b").replaceWith(...o.querySelector("b").childNodes):o.querySelector("strong")||(o.innerHTML="<strong>"+o.innerHTML+"</strong>"):o.querySelector("strong")?o.querySelector("strong").replaceWith(...o.querySelector("strong").childNodes):o.querySelector("b")&&o.querySelector("b").replaceWith(...o.querySelector("b").childNodes),o.style.fontWeight&&o.style.removeProperty("font-weight"))}),n.buttons.bold=e.buttonsBold),e.buttonsItalic!==void 0&&(r.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&(e.buttonsItalic?o.querySelector("i")?o.querySelector("i").replaceWith(...o.querySelector("i").childNodes):o.querySelector("em")||(o.innerHTML="<em>"+o.innerHTML+"</em>"):o.querySelector("em")?o.querySelector("em").replaceWith(...o.querySelector("em").childNodes):o.querySelector("i")&&o.querySelector("i").replaceWith(...o.querySelector("i").childNodes),o.style.fontStyle&&o.style.removeProperty("font-style"))}),n.buttons.italic=e.buttonsItalic),e.buttonsBackgroundColor!==void 0&&(r.forEach(l=>{const o=l;if(!o.closest(".em-contrast-block")&&o.style.display&&o.style.display=="block"){const t=o.closest("td");t&&(t.getAttribute("bgcolor")&&(e.buttonsBackgroundColor?t.setAttribute("bgcolor",e.buttonsBackgroundColor):t.removeAttribute("bgcolor")),e.buttonsBackgroundColor?t.style.backgroundColor=e.buttonsBackgroundColor:t.style.removeProperty("background-color"))}}),n.buttons.backgroundColor=e.buttonsBackgroundColor),e.buttonsContrastBackgroundColor!==void 0&&(r.forEach(l=>{const o=l;if(o.closest(".em-contrast-block")&&o.style.display&&o.style.display=="block"){const t=o.closest("td");t&&(t.getAttribute("bgcolor")&&(e.buttonsContrastBackgroundColor?t.setAttribute("bgcolor",e.buttonsContrastBackgroundColor):t.removeAttribute("bgcolor")),e.buttonsContrastBackgroundColor?t.style.backgroundColor=e.buttonsContrastBackgroundColor:t.style.removeProperty("background-color"))}}),n.buttons.contrastBackgroundColor=e.buttonsContrastBackgroundColor),e.buttonsAlign!==void 0&&(r.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&o.closest("td")?.setAttribute("align",e.buttonsAlign)}),n.buttons.textAlign=e.buttonsAlign)}function ge(e,r,i){const{commonStyles:n}=i;e.buttonsMarginTop!==void 0&&(r.forEach(l=>{const o=l,t=o.closest('[em="atom"]');if(t){const a=t.querySelector(":scope > tr > td, :scope > tbody > tr > td");a?.style.paddingTop&&o.style.display&&o.style.display=="block"&&(a.style.paddingTop=e.buttonsMarginTop+"px",a.querySelector(":scope > .em-vindent-paddingTop")?.remove())}else{const a=o.closest("table");if(a?.previousElementSibling){const d=a.previousElementSibling,c=o.closest("div");if(o.style.display&&o.style.display=="block"&&c&&c.getAttribute("em")=="atom"&&d&&d.tagName=="TABLE"&&(d.classList.contains("em-vindent-table")||d.querySelector("td")?.innerHTML=="")){d.querySelector("td")?.setAttribute("height",e.buttonsMarginTop);const u=d.querySelector(".em-element-vindent-value");u&&(u.innerHTML=e.buttonsMarginTop+"px",e.buttonsMarginTop<30?d.querySelector(".em-vindent")?.classList.add("em-vindent_low"):d.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}}),n.buttons.marginTop=e.buttonsMarginTop),e.buttonsMarginBottom!==void 0&&(r.forEach(l=>{const o=l,t=o.closest('[em="atom"]');if(t){const a=t.querySelector(":scope > tr > td, :scope > tbody > tr > td");a?.style.paddingBottom&&o.style.display&&o.style.display=="block"&&(a.style.paddingBottom=e.buttonsMarginBottom+"px",a.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}else{const a=o.closest("table");if(a?.previousElementSibling){const d=a.nextElementSibling,c=o.closest("div");if(o.style.display&&o.style.display=="block"&&c&&c.getAttribute("em")=="atom"&&d&&d.tagName=="TABLE"&&(d.classList.contains("em-vindent-table")||d.querySelector("td")?.innerHTML=="")){d.querySelector("td")?.setAttribute("height",e.buttonsMarginBottom);const u=d.querySelector(".em-element-vindent-value");u&&(u.innerHTML=e.buttonsMarginBottom+"px",e.buttonsMarginBottom<30?d.querySelector(".em-vindent")?.classList.add("em-vindent_low"):d.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}}),n.buttons.marginBottom=e.buttonsMarginBottom)}function Se(e,r,i){const{commonStyles:n,setElementBorder:l,setElementBorderRadius:o}=i;e.buttonsBorder!==void 0&&(r.forEach(t=>{const a=t;if(a.style.display&&a.style.display=="block"){const d=a.closest("td");d&&l({settings:{border:e.buttonsBorder},elem:d})}}),e.buttonsBorder.all!==void 0&&(n.buttons.border.all=e.buttonsBorder.all),e.buttonsBorder.top!==void 0&&(n.buttons.border.top=e.buttonsBorder.top),e.buttonsBorder.right!==void 0&&(n.buttons.border.right=e.buttonsBorder.right),e.buttonsBorder.bottom!==void 0&&(n.buttons.border.bottom=e.buttonsBorder.bottom),e.buttonsBorder.left!==void 0&&(n.buttons.border.left=e.buttonsBorder.left)),e.buttonsBorderRadius!==void 0&&(r.forEach(t=>{const a=t;if(a.style.display&&a.style.display=="block"){const d=a.closest("td");d&&o({settings:{borderRadius:e.buttonsBorderRadius},elem:d})}}),e.buttonsBorderRadius.all!==void 0&&(n.buttons.borderRadius.all=e.buttonsBorderRadius.all),e.buttonsBorderRadius.topLeft!==void 0&&(n.buttons.borderRadius.topLeft=e.buttonsBorderRadius.topLeft),e.buttonsBorderRadius.topRight!==void 0&&(n.buttons.borderRadius.topRight=e.buttonsBorderRadius.topRight),e.buttonsBorderRadius.bottomRight!==void 0&&(n.buttons.borderRadius.bottomRight=e.buttonsBorderRadius.bottomRight),e.buttonsBorderRadius.bottomLeft!==void 0&&(n.buttons.borderRadius.bottomLeft=e.buttonsBorderRadius.bottomLeft)),e.buttonsPadding!==void 0&&(r.forEach(t=>{const a=t;a.style.display&&a.style.display=="block"&&(e.buttonsPadding.all!==void 0?(a.style.paddingTop=e.buttonsPadding.all+"px",a.style.paddingRight=e.buttonsPadding.all+"px",a.style.paddingBottom=e.buttonsPadding.all+"px",a.style.paddingLeft=e.buttonsPadding.all+"px"):((e.buttonsPadding.top!==void 0||e.buttonsPadding.top==0)&&(a.style.paddingTop=e.buttonsPadding.top+"px"),(e.buttonsPadding.right!==void 0||e.buttonsPadding.right==0)&&(a.style.paddingRight=e.buttonsPadding.right+"px"),(e.buttonsPadding.bottom!==void 0||e.buttonsPadding.bottom==0)&&(a.style.paddingBottom=e.buttonsPadding.bottom+"px"),(e.buttonsPadding.left!==void 0||e.buttonsPadding.left==0)&&(a.style.paddingLeft=e.buttonsPadding.left+"px")))}),e.buttonsPadding.all!==void 0&&(n.buttons.padding={all:e.buttonsPadding.all}),e.buttonsPadding.top!==void 0&&(n.buttons.padding={top:e.buttonsPadding.top}),e.buttonsPadding.right!==void 0&&(n.buttons.padding={right:e.buttonsPadding.right}),e.buttonsPadding.bottom!==void 0&&(n.buttons.padding={bottom:e.buttonsPadding.bottom}),e.buttonsPadding.left!==void 0&&(n.buttons.padding={left:e.buttonsPadding.left}))}function ve(e,r){const{commonStyles:i,setElementBorder:n,setElementBorderRadius:l}=r;i.cards||(i.cards={});const o=document.querySelectorAll(".em-contrast-card");e.cardsContrastBackgroundColor!==void 0&&(o.forEach(d=>{const c=d;c.getAttribute("bgcolor")&&(e.cardsContrastBackgroundColor?c.setAttribute("bgcolor",e.cardsContrastBackgroundColor):c.removeAttribute("bgcolor")),e.cardsContrastBackgroundColor?c.style.backgroundColor=e.cardsContrastBackgroundColor:c.style.removeProperty("background-color")}),i.cards.contrastBackgroundColor=e.cardsContrastBackgroundColor),e.cardsContrastTextColor!==void 0&&(o.forEach(d=>{d.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(c=>{c.style.color=e.cardsContrastTextColor})}),i.cards.contrastTextColor=e.cardsContrastTextColor);const t=document.querySelectorAll(".em-card");e.cardsBaseBackgroundColor!==void 0&&(t.forEach(d=>{const c=d;c.getAttribute("bgcolor")&&(e.cardsBaseBackgroundColor?c.setAttribute("bgcolor",e.cardsBaseBackgroundColor):c.removeAttribute("bgcolor")),e.cardsBaseBackgroundColor?c.style.backgroundColor=e.cardsBaseBackgroundColor:c.style.removeProperty("background-color")}),i.cards.baseBackgroundColor=e.cardsBaseBackgroundColor),e.cardsBaseTextColor!==void 0&&(t.forEach(d=>{d.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(c=>{c.style.color=e.cardsBaseTextColor})}),i.cards.baseTextColor=e.cardsBaseTextColor);const a=document.querySelectorAll(".em-card, .em-contrast-card");e.cardsBorderRadius!==void 0&&(i.cards.borderRadius||(i.cards.borderRadius={}),a.forEach(d=>{l({settings:{borderRadius:e.cardsBorderRadius},elem:d})}),e.cardsBorderRadius.all!==void 0&&(i.cards.borderRadius.all=e.cardsBorderRadius.all),e.cardsBorderRadius.topLeft!==void 0&&(i.cards.borderRadius.topLeft=e.cardsBorderRadius.topLeft),e.cardsBorderRadius.topRight!==void 0&&(i.cards.borderRadius.topRight=e.cardsBorderRadius.topRight),e.cardsBorderRadius.bottomRight!==void 0&&(i.cards.borderRadius.bottomRight=e.cardsBorderRadius.bottomRight),e.cardsBorderRadius.bottomLeft!==void 0&&(i.cards.borderRadius.bottomLeft=e.cardsBorderRadius.bottomLeft)),e.cardsBorder!==void 0&&(i.cards.border||(i.cards.border={}),a.forEach(d=>{n({settings:{border:e.cardsBorder},elem:d})}),e.cardsBorder.all&&(i.cards.border.all=e.cardsBorder.all),e.cardsBorder.top&&(i.cards.border.top=e.cardsBorder.top),e.cardsBorder.right&&(i.cards.border.right=e.cardsBorder.right),e.cardsBorder.bottom&&(i.cards.border.bottom=e.cardsBorder.bottom),e.cardsBorder.left&&(i.cards.border.left=e.cardsBorder.left))}function Ce(e,r){const{commonStyles:i,globalHolder:n}=r;if(!n)return;const l=n.classList.contains("full-wrap")?n.querySelector("td"):n;if(!l)return;(e.blockBackgroundColor!==void 0||e.blockBackgroundColor==="")&&F(e.blockBackgroundColor,l,!1,i),(e.blockContrastBackgroundColor!==void 0||e.blockContrastBackgroundColor==="")&&F(e.blockContrastBackgroundColor,l,!0,i);const o=document.querySelectorAll('[em="block"] > td');if(e.blockPadding!==void 0){const t=e.blockPadding;i.block||(i.block={}),i.block.padding||(i.block.padding={});const a=t.left!==void 0||t.right!==void 0;o.forEach(d=>{const c=d;t.top!==void 0&&(c.style.paddingTop=`${t.top}px`),t.right!==void 0&&(c.style.paddingRight=`${t.right}px`),t.bottom!==void 0&&(c.style.paddingBottom=`${t.bottom}px`),t.left!==void 0&&(c.style.paddingLeft=`${t.left}px`)}),["top","right","bottom","left"].forEach(d=>{t[d]!==void 0&&(i.block.padding[d]=t[d])}),a&&o.forEach(d=>{const c=d,u=c.querySelector(".em-mob-wrap"),f=c.parentElement?.getAttribute("em")==="block";u&&f&&c.querySelectorAll(":scope > table").forEach(p=>{r.setStructureBlocksWidth(p)})})}}function F(e,r,i,n){const l=r.querySelector(".em-narrow-table"),o=i?'[em="block"].em-contrast-block > td':'[em="block"]:not(.em-contrast-block) > td',t=i?'[em="block"] > td > table > tr > [bgcolor]':'[em="block"]:not(.em-contrast-block) > td > table > tr > [bgcolor]',a=i?'[em="block"] > td > table > tr > [style*="background-color"]':'[em="block"]:not(.em-contrast-block) > td > table > tr > [style*="background-color"]';l?e===""?r.querySelectorAll(o).forEach(d=>{const c=d;c.removeAttribute("bgcolor"),c.style.removeProperty("background-color")}):r.querySelectorAll(o).forEach(d=>{const c=d;c.setAttribute("bgcolor",e),c.style.backgroundColor=e}):e===""?r.querySelector(t)?r.querySelectorAll(t).forEach(d=>{const c=d;c.removeAttribute("bgcolor"),c.style.removeProperty("background-color")}):r.querySelector(a)&&r.querySelectorAll(a).forEach(d=>{const c=d;c.removeAttribute("bgcolor"),c.style.removeProperty("background-color")}):r.querySelector(t)?r.querySelectorAll(t).forEach(d=>{const c=d;c.style.backgroundColor=e,c.setAttribute("bgcolor",e)}):r.querySelector(a)&&r.querySelectorAll(a).forEach(d=>{const c=d;c.style.backgroundColor=e,c.setAttribute("bgcolor",e)}),i?n.block.contrastBackgroundColor=e:n.block.backgroundColor=e}var ke=320;function _(e){if(e==null||e==="")return null;if(typeof e=="number"&&!Number.isNaN(e))return e;if(typeof e=="object"&&e!==null&&"value"in e){const r=Number(e.value);return Number.isNaN(r)?null:r}return null}function q(){for(const e of document.body.children)if(e.tagName==="DIV"||e.tagName==="CENTER"){const r=e;if(r.style.background||r.style.backgroundColor)return e;for(const i of e.children)if(i.tagName==="DIV"){if(r.style.background||r.style.backgroundColor)return e;for(const n of i.children){const l=n;if(l.getAttribute("width")==="100%"||l.style.width==="100%")return n}}else{const n=i;if(n.getAttribute("width")==="100%"||n.style.width==="100%")return i}}else{const r=e;if(r.getAttribute("width")==="100%"||r.style.width==="100%")return e}return null}function Ee(e,r){const{globalHolder:i,emailWidth:n,state:l,findParentTr:o}=r,t=_(e.width);if(t==null||t<ke||!i)return!1;function a(d){if(d.elem.nodeName==="#comment"&&d.elem.textContent?.indexOf("mso")!==-1)d.elem.textContent=d.elem.textContent.replace(/width=".*"/gi,`width="${d.width}"`);else{const c=d.elem.previousSibling;c&&a({elem:c,width:d.width})}}return i.querySelector(".em-narrow-table")||i.querySelector(".noresp-em-narrow-table")?(Te(i,t,n,a),we(i,e,n,o,a)):Ae(i,t,n,a),n>500&&i.querySelectorAll(`[width="${n}"]`).forEach(d=>{d.setAttribute("width",String(t))}),xe(t),l.set("emailWidth",t),!0}function Te(e,r,i,n){e.querySelectorAll('[style*="width"]').forEach(l=>{const o=l;o.style.verticalAlign||(o.style.width&&parseFloat(o.style.width)===i&&(o.style.width=r+"px"),o.style.maxWidth&&parseFloat(o.style.maxWidth)===i&&(o.style.maxWidth=r+"px"),o.style.minWidth&&parseFloat(o.style.minWidth)===i&&(o.style.minWidth=r+"px"),n({elem:o,width:r}))})}function we(e,r,i,n,l){const o=[];e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(a=>{const d=n(a);d&&!o.includes(d)&&o.push(d)});const t=r.project==="useblocks"?640:660;o.forEach(a=>{const d=a.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(!d)return;const c=d.parentElement?.closest("td"),u=parseFloat(c?.style.paddingLeft||"0")||0,f=parseFloat(c?.style.paddingRight||"0")||0,p=d.closest("table")?.parentElement?.getBoundingClientRect().width||0,h=a.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:t;if(a.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1)Be(a)&&Le(a,p,u,f,h);else if(d.getAttribute("width")&&!d.classList.contains("em-insert-ignore")){const y=Math.round(p-u-f);d.setAttribute("width",String(y))}})}function Be(e){const r=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let i=0;i<r.length;i++){const n=r[i];if(n.classList.contains("em-insert-ignore"))continue;const l=n.getAttribute("width");if(l!=null&&l!=="")return!0}return!1}function Le(e,r,i,n,l){const o=e.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),t=o?parseFloat(o.getAttribute("width")||"0"):0,a=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),d=a.length;let c=0,u=0;a.forEach(h=>{const y=h;if(y.getAttribute("width")&&!y.classList.contains("em-insert-ignore")){const m=parseFloat(y.getAttribute("width")||"0")/l,b=Math.round(r*m-t/(d*2));y.setAttribute("width",String(b)),c+=b}});const f=r-(i+n+t*(d-1)+c);a.forEach(h=>{const y=h;if(y.getAttribute("width")&&!y.classList.contains("em-insert-ignore")){const m=parseFloat(y.getAttribute("width")||"0")+Math.round(f/d);u+=m,y.setAttribute("width",String(m)),y.querySelectorAll("img").forEach(b=>{parseFloat(b.getAttribute("width")||"0")>m&&(b.setAttribute("width",String(m)),b.style.maxWidth=m+"px")})}}),u=u+t*(d-1)+i+n;const p=r-u;if(p!==0&&c>0){const h=e.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(h&&!h.classList.contains("em-insert-ignore")){const y=parseFloat(h.getAttribute("width")||"0");h.setAttribute("width",String(y+p))}else{const y=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let m=y.length-1;m>=0;m--){const b=y[m];if(b.classList.contains("em-insert-ignore"))continue;const T=parseFloat(b.getAttribute("width")||"0");b.setAttribute("width",String(T+p));break}}}}function Ae(e,r,i,n){e.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const o=l;if(!o.getAttribute("em-floatblock-width")){const t=o.parentElement?.getBoundingClientRect().width||1;o.setAttribute("em-floatblock-width",String(o.getBoundingClientRect().width/t))}}),e.querySelectorAll('[style*="width"]').forEach(l=>{const o=l;o.style.verticalAlign||(o.style.width&&parseFloat(o.style.width)===i&&(o.style.width=r+"px"),o.style.maxWidth&&parseFloat(o.style.maxWidth)===i&&(o.style.maxWidth=r+"px"),o.style.minWidth&&parseFloat(o.style.minWidth)===i&&(o.style.minWidth=r+"px"),n({elem:o,width:r}))}),e.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const o=l,t=o.parentElement?.getBoundingClientRect().width||0,a=parseFloat(o.getAttribute("em-floatblock-width")||"0"),d=o.getBoundingClientRect().width-(o.firstElementChild?.getBoundingClientRect().width||0),c=o.getBoundingClientRect().width-d;let u=0;o.style.maxWidth?(o.style.maxWidth=Math.floor(t*a)+"px",u=o.getBoundingClientRect().width-d,o.firstElementChild&&(o.firstElementChild.setAttribute("width",String(Math.round(u))),o.firstElementChild.style.maxWidth=Math.round(u)+"px")):o.style.width&&(o.style.width=Math.floor(t*a)+"px",u=o.getBoundingClientRect().width-d,o.firstElementChild?.setAttribute("width",String(u))),n({elem:o,width:Math.floor(t*a)}),o.removeAttribute("em-floatblock-width"),o.querySelectorAll("img").forEach(f=>{const p=parseFloat(f.getAttribute("width")||"0");(p>=u||p===c)&&(f.setAttribute("width",String(u)),f.style.maxWidth=u+"px")})})}function xe(e){for(const r of document.head.querySelectorAll("style"))if(r.innerHTML.match(/@media.*?max((.|\n|\r)*?){/)){r.innerHTML=r.innerHTML.replace(/max-device-width:\d+px/gi,`max-device-width:${e}px`),r.innerHTML=r.innerHTML.replace(/max-width:\d+px/gi,`max-width:${e}px`);break}}function Me(e,r){e.querySelectorAll("img, amp-img").forEach(i=>{const n=i;if(r){const l=n.getAttribute("width");if(l)if(n.style.width="100%",l.includes("%"))n.style.maxWidth=l;else{const o=parseFloat(l);Number.isNaN(o)||(n.style.maxWidth=`${o}px`)}}else n.style.removeProperty("width"),n.style.removeProperty("max-width")})}function Fe(e,r){if(e.responsive===void 0||!r)return;const i=_(e.width);if(e.responsive.shutdown){const n=r.querySelector(".noresp-em-narrow-table");if(n)n.className=n.className.replace(/noresp-em-narrow/gi,"em-narrow");else{const l=r.querySelector("table:first-child");l&&(l.setAttribute("width","100%"),l.style.width="100%",i!=null&&(l.style.maxWidth=i+"px"),l.style.minWidth="320px")}document.querySelectorAll('[class*="noresp-em-mob"]').forEach(l=>{l.className=l.className.replace(/noresp-em-mob/gi,"em-mob")}),document.documentElement.removeAttribute("style")}else{const n=r.querySelector(".em-narrow-table");if(n)n.className=n.className.replace(/em-narrow/gi,"noresp-em-narrow");else{const l=r.querySelector("table:first-child");l&&i!=null&&(l.setAttribute("width",String(i)),l.style.width=i+"px",l.style.maxWidth=i+"px",l.style.minWidth=i+"px")}document.querySelectorAll('[class*="em-mob"]:not([class*="noresp-em-mob"])').forEach(l=>{l.className=l.className.replace(/em-mob/gi,"noresp-em-mob")})}Me(r,!!e.responsive.shutdown)}function _e(e,r){if(!e||!e.length)return;let i=document.head.querySelector('style[em="styles"]'),n="";i?n=r.getInnerHtml(i):(i=document.createElement("style"),i.setAttribute("em","styles"),i=document.head.insertAdjacentElement("beforeend",i));const l=document.createElement("div");l.insertAdjacentHTML("afterbegin",e.join(`
86
+ `));let o=s.minifyStylesheet(n+`
87
+ `+[...l.querySelectorAll("style")].map(t=>t.innerHTML).join(`
88
+ `),{restructure:!0,forceMediaMerge:!0}).css;o=cssbeautify(o,{indent:" ",autosemicolon:!0}),i&&(i.textContent=`
89
+ `+o+`
90
+ `)}var P=`<style em="styles">
91
+ @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
92
+ .em-mob-width-100perc {
93
+ width: 100%!important;
94
+ max-width: 100%!important;
95
+ }
96
+ }
97
+ </style>
98
+ <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding-bottom: 10px;">
99
+ <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
100
+ </td></tr></table>`,qe=`<style>
101
+ @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
102
+ .em-mob-wrap {
103
+ display: block!important;
104
+ }
105
+ .em-mob-width-100perc {
106
+ width: 100%!important;
107
+ max-width: 100%!important;
108
+ }
109
+ .em-mob-padding_right-20 {
110
+ padding-right: 20px!important;
111
+ }
112
+ .em-mob-padding_left-20 {
113
+ padding-left: 20px!important;
114
+ }
115
+ }
116
+ </style>
117
+ <tr em="block" class="em-structure">
118
+ <td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20" bgcolor="#ffffff">
119
+ <table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
120
+ <tr>
121
+ <td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
122
+ {{ATOM_HTML}}
123
+ </td>
124
+ </tr>
125
+ </table>
126
+ </td>
127
+ </tr>`;function Pe(e,r){if(!(e&&(s.isEmptyTable(e)||!e.innerHTML.trim()))||r.getLockEditor())return!1;const i=P.match(/<style((.|\n|\r)*?)<\/style>/g);r.applyStylesToDocument(i||[]);let n=P.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();n=r.commonStylesApply({html:n});let l=qe.replace("{{ATOM_HTML}}",n);const o=l.match(/<style((.|\n|\r)*?)<\/style>/g);r.applyStylesToDocument(o||[]),l=r.commonStylesApplyToBlock({html:l}),(l.indexOf("empty-structure")>-1||l.indexOf("em-structure")>-1)&&(l=r.setFloatBlocksWidth({blockHTML:l,targetBlock:e,project:r.appName})),s.insertAdjacentHTML(s.rowsHost(e),"beforeend",`
128
+ `+l+`
129
+ `);const t=e.querySelector('[em="block"]:last-child [em="atom"]');if(t){const a=t.querySelector("div");let d=null;a&&(a.innerHTML="",a.appendChild(document.createTextNode("​")),r.wrapEditor(a,!0),a.classList.add("em-just-inserted"),setTimeout(()=>{const c=a.closest("editor")||a,u=c?.querySelector("div")||a,f=u||c||a,p=f.getBoundingClientRect();["mouseover","mousedown","mouseup","click"].forEach(m=>{const b=new MouseEvent(m,{bubbles:!0,cancelable:!0,view:window,clientX:p.left+Math.min(1,Math.max(0,p.width/2)),clientY:p.top+Math.min(1,Math.max(0,p.height/2)),button:0});s.withForeignListenersPaused(()=>f.dispatchEvent(b))});let h=u.firstChild;h||(h=document.createTextNode("​"),u.appendChild(h)),s.withForeignListenersPaused(()=>c?.focus?.());const y=window.getSelection();if(y&&h){const m=document.createRange();m.setStart(h,0),m.collapse(!0),y.removeAllRanges(),s.withForeignListenersPaused(()=>y.addRange(m))}r.setCursorPosition(c||a),r.commit()},0),d=a.closest("editor")||a),a&&r.setCursorPosition(d||a)}return r.messageService.send("application_atom_inserted","text"),r.commit(),!0}function Ne({getGlobalHolder:e,view:r=window}){let i=0;const n=()=>{i=0,s.state.get("previewPage")&&s.fitEmailToWidth(e(),r)},l=()=>{!i&&s.state.get("previewPage")&&(i=r.requestAnimationFrame(n))},o=s.state.subscribeToKey("previewPage",t=>{t?l():s.applyRootScale(r.document.documentElement,1)&&r.parentIFrame?.size?.()});return r.addEventListener("resize",l),l(),{refit:l,dispose:()=>{o(),r.removeEventListener("resize",l),i&&(r.cancelAnimationFrame(i),i=0)}}}var v=s.createIdentifier("SandboxEmailGlobalHolder"),x=s.createIdentifier("SandboxPreviewFit");function Re(){s.setBlockGroupControlsPosition({scrollTop:s.state.get("scrollTop")})}var We=s.defineUnit({name:"sandbox.emailInitialState",setup(){s.editLock.reset(),s.state.update({activeCell:[],globalHolder:null,applicationTheme:"light",iframeOffsetTop:0,scrollTop:0,previewHeight:0,applicationMode:"default",emailWidth:0,elementPath:[],copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,elementAIimageEnabled:!0,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,blocksAddPanelEnabled:!0,codeMode:!0,appName:"",commonStyles:{},isProgrammaticSelection:!1}),s.implementPolyfills()}}),Ie=s.defineUnit({name:"sandbox.emailGlobalHolder",provides:[v],setup(e){let r=null;s.state.subscribe(i=>{"globalHolder"in i&&(r=i.globalHolder??null)}),e.inject(v,{get:()=>r,set:i=>{r=i}})}}),He=s.defineUnit({name:"sandbox.emailPreview",provides:[s.INIT_PREVIEW_ID,x],awaits:{services:[v,s.SYNC_COMMIT_ID,s.EDIT_LOCK_ID]},setup(e){const r=s.requireService(e,v),i=s.commitOf(e),n=s.requireService(e,s.EDIT_LOCK_ID),l=Ne({getGlobalHolder:()=>r.get()});e.inject(x,l),e.inject(s.INIT_PREVIEW_ID,(o=!1)=>{de({state:s.state,getEmailWidth:()=>s.state.get("emailWidth"),closeEditorInit:()=>n.closeEditorInit(),messageService:s.messageService,removeHiddenClasses:s.removeHiddenClasses,findGlobalHolder:q,elMarkupHelper:()=>s.elMarkupHelper(r.get()),rgbToHex:s.rgbToHex,getSubject:s.getSubject,getPreheader:s.getPreheader,getUsedColors:s.getUsedColors,commit:i,setGlobalHolder:t=>r.set(t)},o),l.refit()})}}),De=s.defineUnit({name:"sandbox.emailInsertPolicy",provides:[s.INSERT_POLICY_ID],setup:e=>e.inject(s.INSERT_POLICY_ID,{})});function N(e){const r=s.requireService(e,s.HTML_DOCUMENT_ID),i=s.commitOf(e);return{commit:i,htmlDocument:r,applyStylesToDocument:n=>_e(n,r),setFloatBlocksWidth:n=>s.setFloatBlocksWidth(n,r),setBlockMaxWidth:n=>s.setBlockMaxWidth(n,r),commonStylesApply:n=>s.commonStylesApply(n,i)}}var Oe=s.defineUnit({name:"sandbox.emailNarrowTable",provides:[s.NARROW_TABLE_TEXT_ATOM_ID],awaits:{services:[s.HTML_DOCUMENT_ID,s.SYNC_COMMIT_ID,s.WRAP_EDITOR_ID,s.SET_CURSOR_ID,s.EDIT_LOCK_ID]},setup(e){const r=N(e),i=s.requireService(e,s.EDIT_LOCK_ID),n=s.requireService(e,s.WRAP_EDITOR_ID).now,l=s.requireService(e,s.SET_CURSOR_ID);e.inject(s.NARROW_TABLE_TEXT_ATOM_ID,o=>Pe(o,{getLockEditor:()=>i.isIntegratorLocked(),applyStylesToDocument:r.applyStylesToDocument,commonStylesApply:r.commonStylesApply,commonStylesApplyToBlock:s.commonStylesApplyToBlock,setFloatBlocksWidth:t=>r.setFloatBlocksWidth({...t,targetBlock:t.targetBlock}),appName:s.state.get("appName"),wrapEditor:n,setCursorPosition:l,messageService:s.messageService,commit:()=>r.commit()}))}}),$e=s.defineUnit({name:"sandbox.emailDocumentServices",awaits:{services:[s.HTML_DOCUMENT_ID,s.FOCUS_ID]},setup(e){const r=s.requireService(e,s.HTML_DOCUMENT_ID),{controller:i}=s.requireService(e,s.FOCUS_ID);J(),te(),s.registerPreheaderService(r,i),s.registerSubjectService(r,i)}}),ze=s.defineUnit({name:"sandbox.emailOperations",awaits:{services:[v,s.HTML_DOCUMENT_ID,s.SYNC_COMMIT_ID,s.SELECTION_LOCK_ID,s.EDIT_LOCK_ID]},setup(e){const r=s.requireService(e,v),i=s.requireService(e,s.SYNC_COMMIT_ID),n=s.requireService(e,s.SELECTION_LOCK_ID),l=s.requireService(e,s.EDIT_LOCK_ID),o=N(e),{commit:t,htmlDocument:a}=o,d=()=>({state:s.state,previewHeight:s.state.get("previewHeight"),iframeOffsetTop:s.state.get("iframeOffsetTop"),scrollTop:s.state.get("scrollTop"),globalHolder:r.get(),setBlockGroupControlsPosition:Re,messageService:s.messageService});s.messageService.addListener(function(c){const u=c.data??{};if(u.operation===s.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET){const f=u.settings??{};r.set(q());const p=r.get();if(p){const m=p.classList.contains("full-wrap")?p.querySelector("td"):p;m&&s.setEmailBackgroundSettings(m,f,s.getPreheaderElem())}f.subject!==void 0&&(document.title=f.subject);const h=Ee(f,{globalHolder:p,emailWidth:s.state.get("emailWidth"),state:s.state,findParentTr:s.findParentTr});Fe(f,p),ue(f,{globalHolder:p,commonStyles:s.state.get("commonStyles"),lockEditor:l.isIntegratorLocked(),removeClassesByPrefix:s.removeClassesByPrefix,createFontClassName:s.createFontClassName,addFontFamilyClass:m=>s.addFontFamilyClass(m,t),clearLinkTags:m=>s.clearLinkTags(m,t),clearProjectFontFaces:()=>s.clearProjectFontFaces(m=>t(m)),rgbToHex:s.rgbToHex,setElementBorder:s.setElementBorder,setElementBorderRadius:s.setElementBorderRadius,setStructureBlocksWidth:s.setStructureBlocksWidth,messageService:s.messageService});const y=Object.keys(f).filter(m=>f[m]!==void 0);(h||!(y.length===1&&y[0]==="width"))&&i.commitLockedAsync()}u.operation===s.EVENT_TYPES.SANDBOX_IFRAME_SETSIZE&&(s.state.get("previewPage")?e.getInstance(x)?.refit():s.iframeSetSize(u.settings,d()))}),s.messageService.addListenerAsync(s.EVENT_TYPES.SANDBOX_GLOBAL_BLOCK_REPLACE,c=>{const u=c??{};return s.globalBlockReplace({emBlockId:u.emBlockId,blockHTML:u.blockHTML,type:u.type,project:u.project,name:u.name},{selectionLock:n,commit:t,lockEditor:l.isIntegratorLocked(),emailWidth:s.state.get("emailWidth"),iframeOffsetTop:s.state.get("iframeOffsetTop"),previewHeight:s.state.get("previewHeight"),parseFromString:f=>s.parseFromString(f),getOuterHtml:s.getOuterHtml,HTMLDocument:a,minify:s.minifyStylesheet,cssbeautify,insertAdjacentHTML:(f,p,h)=>s.insertNewHTML(f,p,h),messageService:s.messageService,setDocumentStyles:f=>s.setDocumentStyles(f,{minify:s.minifyStylesheet,cssbeautify,HTMLDocument:a}),setImageWidth:s.setImageWidth,commonStylesApply:o.commonStylesApply,commonStylesApplyToBlock:s.commonStylesApplyToBlock,insertCountdown:f=>s.insertCountdown(f,t),uptimeCountdown:s.uptimeCountdown,setBlockMaxWidth:o.setBlockMaxWidth,setFloatBlocksWidth:o.setFloatBlocksWidth,fitImagesToColumns:s.fitImagesToColumns,checkBlockAdaptivity:s.checkBlockAdaptivity})})}}),Ue=[Ie,He,De,Oe,$e,ze],je=s.defineSurface({name:"email",profile:Q,units:[s.diagnosticsAgentUnit,We,...s.CANVAS_CORE_UNITS,s.ampUnit,...s.EMAIL_LAYOUT_UNITS,...Ue,s.extensionsUnit(V),s.paintGateUnit,s.wheelBridgeUnit,s.deviceWidthMediaGuardUnit]});s.startSandbox(je)});
@@ -1,7 +1,7 @@
1
1
  var e=window.__useblocks__||(window.__useblocks__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=null,s={},c={},l=0;function u(e,t){l+=1;try{return e.factory.apply(null,t)}finally{--l}}var d=`./`,f={},p=60,m=`emailmaker:diagnostics`,h=[],g;function _(){if(g!==void 0)return g;g=!1;try{var e=/[?&]diagnostics(?:=([^&]*))?/.exec(window.location.search||``);if(e)return g=e[1]!==`0`,g;if(typeof window.__DIAGNOSTICS__==`boolean`)return g=!!window.__DIAGNOSTICS__,g;g=window.localStorage.getItem(m)===`1`}catch{g=!1}return g}function v(e,t){if(_()){var n={phase:e,at:performance.timeOrigin+performance.now(),kind:`wait`};t&&(n.parent=String(t)),h.push(n)}}function y(e){if(!e||e.__amdLogged)return e;try{Object.defineProperty(e,"__amdLogged",{value:!0,enumerable:!1})}catch{try{e.__amdLogged=!0}catch{}}try{var t=e&&e.message||`loader error`;console.error(`[AMD] `+(t.indexOf(`[AMD]`)===0?t.slice(6):t),e)}catch{}return e}function b(){try{if(e!==void 0&&e&&e.publicPath)return String(e.publicPath)}catch{}return`(not set)`}function x(){var e=b();return String(e).indexOf(`file:`)===0?` The page appears to be opened as a local file (file://) or publicPath was not configured. Serve the host app over HTTP(S) and set publicPath to the origin that serves editor assets (host bundler plugin or __amdEnv.setPublicPath). Current runtime publicPath=`+e+`.`:` Host bundler publicPath may be misconfigured (Vite/Webpack host plugin). In dev, set publicPath to the absolute origin that serves editor assets (for example http://localhost:3001/<outputFolder>/). Current runtime publicPath=`+e+`.`}function S(e){if(typeof fetch!=`function`)return Promise.resolve(``);function t(e){var t=(e.headers.get(`content-type`)||``).toLowerCase();try{e.body&&typeof e.body.cancel==`function`&&e.body.cancel()}catch{}return t.indexOf(`text/html`)>=0?` The URL returned HTML (Content-Type: text/html), not JavaScript — often a SPA fallback when asset paths are wrong.`:e.ok?``:` HTTP status `+e.status+` — the asset URL may be wrong or blocked by the server.`}return fetch(e,{method:`HEAD`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(function(n){return n.status===405||n.status===501?fetch(e,{method:`GET`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(t):t(n)}).catch(function(){return fetch(e,{method:`GET`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(t).catch(function(){return``})})}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 w(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 T(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 E(e){var t=String(e||``).replace(/\\/g,`/`),n=String(d||`./`).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 D(e){return{then:function(t,n){return e.then(t,n)},catch:function(t){return e.catch(t)},finally:function(t){return e.finally(t)}}}function O(e,t){var n=String(e||``);if(!n)return n;if(n.indexOf(`./`)!==0&&n.indexOf(`../`)!==0)return E(T(n));var r=t||``;if(Object.prototype.hasOwnProperty.call(f,r)){var i=String(f[r]||``);i&&!k(i)&&i.charAt(0)!==`/`&&(r=i)}var a=T(r),o=a?a.split(`/`):[];o.length>0&&o.pop();for(var s=n.split(`/`),c=0;c<s.length;c++){var l=s[c];if(l&&l!==`.`){if(l===`..`){o.length>0&&o.pop();continue}o.push(l)}}return E(o.join(`/`))}function k(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function A(e){var t=String(e||``);if(!t||k(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 j(){var t=String(d||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),k(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,A(e.publicPath)).href}catch{}return A(t)}function M(e,t){var n=O(e,t),r=j(),i=Object.prototype.hasOwnProperty.call(f,n)?String(f[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function N(){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 P(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=N()):typeof e==`function`?(r=e,n=[],e=N()):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})}P.amd={async:!0};function F(e){var t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}P(`vite/preload-helper`,[`exports`],function(e){e.__vitePreload=function(e){return Promise.resolve().then(function(){return e().catch(F)})}});function I(){return function(){}}function L(e,t){return{id:e,exports:t,uri:M(e)}}function R(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return V(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return V(e,r)}function z(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=O(e,o);if(s in a)throw y(a[s]);if(s in n)return n[s];if(s in r||s in i)throw y(C(s,Error(`Module is still loading asynchronously`)));if(!(s in t))throw y(C(s,Error(`Module is not available for syncRequire`)));return U(s)}function B(e,i){if(o&&e in o){var s={},c=[e];for(s[e]=!0;c.length>0;){var l=o[c.shift()];if(l)for(var u=0;u<l.length;u++){var d=l[u];s[d]||(s[d]=!0,c.push(d),!(d in n||d in a||d in r)&&(d in o?d in t||K(d,i).catch(function(){}):d in t&&V(d).catch(function(){})))}}}}function V(e,i){var o=O(e,i);if(o in a)return Promise.reject(y(a[o]));if(o in n)return Promise.resolve(n[o]);if(o in r)return r[o];if(v(`core:module:`+o+`:ask`,i),o in t)r[o]=H(o);else{var s=M(o);r[o]=K(o).then(function(){return v(`core:module:`+o+`:loaded`,i),o in t?H(o):S(s).then(function(e){var t=C(o,Error(`Module not defined after script load from "`+s+`".`+e+x()));throw a[o]=t,y(t)})}).catch(function(e){delete r[o];var t=e&&e.moduleId===o?e:C(o,e);throw a[o]=t,y(t)})}return B(o),r[o]}function H(e){var i=t[e],o=W(e),s=I(),l=L(e,s);c[e]=s;function d(t){return n[e]=t,delete r[e],delete c[e],n[e]}return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?l:V(t,e).catch(function(n){throw w(e,t,n)})})).then(function(t){v(`core:module:`+e+`:deps`);var n=u(i,t);return n&&typeof n.then==`function`?n.then(function(t){return v(`core:module:`+e+`:ready`),d(t===void 0?l.exports:t)}):(v(`core:module:`+e+`:ready`),d(n===void 0?l.exports:n))}).catch(function(t){throw delete r[e],delete c[e],a[e]=t,y(t)})}function U(e){var r=t[e],i=W(e),o=I(),s=L(e,o);try{var c=u(r,r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return z(t,e)}catch(n){throw w(e,t,n)}}));if(c&&typeof c.then==`function`)throw C(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=c===void 0?s.exports:c,n[e]}catch(t){throw a[e]=t,y(t)}}function W(e){var o=function(o,s,u){if(Array.isArray(o))return R(o,s,u,e);var d=O(o,e);if(d in a)throw y(a[d]);return d in n?n[d]:d in c&&l>0?c[d]:d in r||d in i?D(V(o,e)):d in t?z(o,e):D(V(o,e))};return o.resolve=function(t){return O(t,e)},o.toUrl=function(t){return M(t,e)},o.sync=function(t){return z(t,e)},o}function G(t,n){var r=e!==void 0&&e?e.moduleTransport:null;if(typeof r!=`function`||e.blobBlocked)return null;try{var i=r(t,n);return i&&typeof i.then==`function`?i:null}catch{return null}}function K(t,n){if(t in i)return i[t];if(s[t]&&s[t]!==t)return i[t]=K(s[t],n),i[t];var r=M(t);if(document.querySelector(`script[src="`+r+`"]`))return i[t]=Promise.resolve(),i[t];var a=performance.now();function o(e){return J(t,r,!1,n).then(function(n){return q(t,e,a),n})}var c=G(r,t);return c?(i[t]=c.then(function(r){return r?J(t,URL.createObjectURL(r),!0,n).then(function(e){return q(t,`transport`,a),e},function(){return e.blobBlocked=!0,o(`network-after-blob`)}):o(`network-fallback`)},function(){return o(`network-after-transport-error`)}),i[t]):(i[t]=o(`network`),i[t])}function q(t,n,r){_()&&((e.loaderTimings||=[]).push({id:t,via:n,ms:Math.round((performance.now()-r)*10)/10}),typeof e.onLoaderTiming==`function`&&e.onLoaderTiming())}function J(e,t,n,r){return new Promise(function(a,o){var s=!1,c=document.createElement(`script`);c.src=t,c.setAttribute(`data-amd-module-id`,e),c.async=!0,r===`low`&&(c.fetchPriority=`low`);var l=p>0?p*1e3:0,u=null;function d(){u!=null&&(clearTimeout(u),u=null),c.onload=null,c.onerror=null,n&&typeof URL<`u`&&URL.revokeObjectURL&&URL.revokeObjectURL(t)}function f(e){s||(s=!0,d(),e())}l>0&&(u=setTimeout(function(){f(function(){delete i[e],o(y(C(e,Error(`Timed out after `+l+`ms loading script: `+t+`.`+x()))))})},l)),c.onload=function(){f(function(){a()})},c.onerror=function(){f(function(){delete i[e],o(y(C(e,Error(`Failed to load script: `+t+`.`+x()))))})},document.head.appendChild(c)})}R.config=function(e){if(e.baseUrl&&(d=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(f[t]=e.paths[t]);if(e.bundles){for(var n in e.bundles)if(Object.prototype.hasOwnProperty.call(e.bundles,n))for(var r=0;r<e.bundles[n].length;r++)s[e.bundles[n][r]]=n}if(e.graph)for(var i in o||={},e.graph)Object.prototype.hasOwnProperty.call(e.graph,i)&&(o[i]=e.graph[i]);typeof e.waitSeconds==`number`&&e.waitSeconds>=0&&(p=e.waitSeconds)},R.warm=function(e,r){var i=r&&r.priority;return Promise.all((e||[]).map(function(e){var r=O(e);if(r in a)return Promise.reject(a[r]);var o=r in t||r in n?Promise.resolve():K(r,i);return B(r,i),o})).then(function(){})},R.modules=t,R.resolved=n,R.errors=a,R.toUrl=M,R.sync=z,e.define=P,e.require=R,e.syncRequire=z,e.diagnosticsBuffer=h})(),e.require.config({baseUrl:`./`});
2
2
 
3
- __useblocks__.require.config({ paths: {"js/iframe.js":"js/iframe.body.cc33bf3e.js"} });
3
+ __useblocks__.require.config({ paths: {"js/iframe.js":"js/iframe.body.5455e870.js"} });
4
4
 
5
- __useblocks__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.DXAm8_Hg.js"],"js/iframe.js":["js/elMarkupHelper.DXAm8_Hg.js"],"js/darkreader.CyLMh7_H.js":[],"js/elMarkupHelper.DXAm8_Hg.js":[],"js/rules.CL_BitCE.js":[],"js/typograf.all.CGEpDoct.js":[]}});
5
+ __useblocks__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.Cv72GdwF.js"],"js/iframe.js":["js/elMarkupHelper.Cv72GdwF.js"],"js/darkreader.CyLMh7_H.js":[],"js/elMarkupHelper.Cv72GdwF.js":[],"js/rules.CL_BitCE.js":[],"js/typograf.all.CGEpDoct.js":[]}});
6
6
 
7
7
  __useblocks__.require("js/iframe.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "useblocks",
3
- "version": "1.3.5",
3
+ "version": "1.3.10",
4
4
  "private": false,
5
5
  "main": "useblocks.js",
6
6
  "module": "useblocks-esm.js",
@@ -1 +1 @@
1
- import e from"../../vendor/react/index.js";var i=e&&e.default?e.default:e,{Activity:n,Children:o,Component:c,Fragment:m,Profiler:E,PureComponent:v,StrictMode:d,Suspense:R,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:S,__COMPILER_RUNTIME:h,cache:T,cacheSignal:b,cloneElement:g,createContext:N,createElement:_,createRef:A,forwardRef:O,isValidElement:k,lazy:I,memo:D,startTransition:L,unstable_useCacheRefresh:M,use:P,useActionState:U,useCallback:V,useContext:x,useDebugValue:H,useDeferredValue:z,useEffect:F,useEffectEvent:G,useId:W,useImperativeHandle:Y,useInsertionEffect:j,useLayoutEffect:p,useMemo:q,useOptimistic:w,useReducer:B,useRef:J,useState:Q,useSyncExternalStore:X,useTransition:Z,version:$}=e;try{var u=Symbol.for("editor-runtime.react.copies"),t=globalThis[u];t||(t=[],globalThis[u]=t);for(var r=!1,s=0;s<t.length;s++){var a=t[s];a&&a.react===e&&a.package==="useblocks"&&a.version==="1.3.5"&&(r=!0)}r||t.push({package:"useblocks",version:"1.3.5",react:e})}catch{}export{n as Activity,o as Children,c as Component,m as Fragment,E as Profiler,v as PureComponent,d as StrictMode,R as Suspense,S as __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,h as __COMPILER_RUNTIME,T as cache,b as cacheSignal,g as cloneElement,N as createContext,_ as createElement,A as createRef,i as default,O as forwardRef,k as isValidElement,I as lazy,D as memo,L as startTransition,M as unstable_useCacheRefresh,P as use,U as useActionState,V as useCallback,x as useContext,H as useDebugValue,z as useDeferredValue,F as useEffect,G as useEffectEvent,W as useId,Y as useImperativeHandle,j as useInsertionEffect,p as useLayoutEffect,q as useMemo,w as useOptimistic,B as useReducer,J as useRef,Q as useState,X as useSyncExternalStore,Z as useTransition,$ as version};
1
+ import e from"../../vendor/react/index.js";var i=e&&e.default?e.default:e,{Activity:n,Children:o,Component:c,Fragment:m,Profiler:E,PureComponent:v,StrictMode:d,Suspense:R,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:S,__COMPILER_RUNTIME:h,cache:T,cacheSignal:b,cloneElement:g,createContext:N,createElement:_,createRef:A,forwardRef:O,isValidElement:k,lazy:I,memo:D,startTransition:L,unstable_useCacheRefresh:M,use:P,useActionState:U,useCallback:V,useContext:x,useDebugValue:H,useDeferredValue:z,useEffect:F,useEffectEvent:G,useId:W,useImperativeHandle:Y,useInsertionEffect:j,useLayoutEffect:p,useMemo:q,useOptimistic:w,useReducer:B,useRef:J,useState:Q,useSyncExternalStore:X,useTransition:Z,version:$}=e;try{var u=Symbol.for("editor-runtime.react.copies"),t=globalThis[u];t||(t=[],globalThis[u]=t);for(var r=!1,s=0;s<t.length;s++){var a=t[s];a&&a.react===e&&a.package==="useblocks"&&a.version==="1.3.10"&&(r=!0)}r||t.push({package:"useblocks",version:"1.3.10",react:e})}catch{}export{n as Activity,o as Children,c as Component,m as Fragment,E as Profiler,v as PureComponent,d as StrictMode,R as Suspense,S as __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,h as __COMPILER_RUNTIME,T as cache,b as cacheSignal,g as cloneElement,N as createContext,_ as createElement,A as createRef,i as default,O as forwardRef,k as isValidElement,I as lazy,D as memo,L as startTransition,M as unstable_useCacheRefresh,P as use,U as useActionState,V as useCallback,x as useContext,H as useDebugValue,z as useDeferredValue,F as useEffect,G as useEffectEvent,W as useId,Y as useImperativeHandle,j as useInsertionEffect,p as useLayoutEffect,q as useMemo,w as useOptimistic,B as useReducer,J as useRef,Q as useState,X as useSyncExternalStore,Z as useTransition,$ as version};
@@ -1,4 +1,4 @@
1
- __useblocks__.define("static/core/100d863a.js",["require","exports","module","static/core/2ff39ddf.js","static/core/e8499e21.js"],function(me,O,hr){const H=me("./2ff39ddf.js"),N=me("./e8499e21.js");var it=/\n/g;function at(e){const n=[...e.matchAll(it)].map((r=>r.index||0));n.unshift(-1);const t=ee(n,0,n.length);return r=>de(t,r)}function ee(e,n,t){if(t-n==1)return{offset:e[n],index:n+1};const r=Math.ceil((n+t)/2),s=ee(e,n,r),i=ee(e,r,t);return{offset:s.offset,low:s,high:i}}function de(e,n){return(function(t){return Object.prototype.hasOwnProperty.call(t,"index")})(e)?{line:e.index,column:n-e.offset}:de(e.high.offset<n?e.high:e.low,n)}function ge(e,n="",t={}){const r=typeof n!="string"?n:t,s=typeof n=="string"?n:"",i=e.map(ot),a=!!r.lineNumbers;return function(o,c=0){const l=a?at(o):()=>({line:0,column:0});let h=c;const g=[];e:for(;h<o.length;){let y=!1;for(const p of i){p.regex.lastIndex=h;const k=p.regex.exec(o);if(k&&k[0].length>0){if(!p.discard){const v=l(h),B=typeof p.replace=="string"?k[0].replace(new RegExp(p.regex.source,p.regex.flags),p.replace):k[0];g.push({state:s,name:p.name,text:B,offset:h,len:k[0].length,line:v.line,column:v.column})}if(h=p.regex.lastIndex,y=!0,p.push){const v=p.push(o,h);g.push(...v.tokens),h=v.offset}if(p.pop)break e;break}}if(!y)break}return{tokens:g,offset:h,complete:o.length<=h}}}function ot(e,n){return{...e,regex:ct(e,n)}}function ct(e,n){if(e.name.length===0)throw new Error(`Rule #${n} has empty name, which is not allowed.`);if((function(t){return Object.prototype.hasOwnProperty.call(t,"regex")})(e))return(function(t){if(t.global)throw new Error(`Regular expression /${t.source}/${t.flags} contains the global flag, which is not allowed.`);return t.sticky?t:new RegExp(t.source,t.flags+"y")})(e.regex);if((function(t){return Object.prototype.hasOwnProperty.call(t,"str")})(e)){if(e.str.length===0)throw new Error(`Rule #${n} ("${e.name}") has empty "str" property, which is not allowed.`);return new RegExp(ke(e.str),"y")}return new RegExp(ke(e.name),"y")}function ke(e){return e.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g,"\\$&")}function I(e,n){return(t,r)=>{let s=r,i;return r<t.tokens.length?(i=e(t.tokens[r],t,r),i!==void 0&&s++):n?.(t,r),i===void 0?{matched:!1}:{matched:!0,position:s,value:i}}}function te(e,n){return e.matched?{matched:!0,position:e.position,value:n(e.value,e.position)}:e}function U(e,n){return e.matched?n(e):e}function L(e,n){return(t,r)=>te(e(t,r),(s,i)=>n(s,t,r,i))}function q(e,n){return(t,r)=>{const s=e(t,r);return s.matched?s:{matched:!0,position:r,value:n}}}function F(...e){return(n,t)=>{for(const r of e){const s=r(n,t);if(s.matched)return s}return{matched:!1}}}function W(e,n){return(t,r)=>{const s=e(t,r);return s.matched?s:n(t,r)}}function lt(e,n){return(t,r)=>{const s=[];let i=!0;do{const a=e(t,r);a.matched&&n(a.value,s.length+1,t,r,a.position)?(s.push(a.value),r=a.position):i=!1}while(i);return{matched:!0,position:r,value:s}}}function ne(e){return lt(e,()=>!0)}function ut(e){return w(e,ne(e),(n,t)=>[n,...t])}function w(e,n,t){return(r,s)=>U(e(r,s),i=>te(n(r,i.position),(a,o)=>t(i.value,a,r,s,o)))}function ft(e,n){return w(e,n,t=>t)}function Le(e,n){return w(e,n,(t,r)=>r)}function re(e,n,t,r){return(s,i)=>U(e(s,i),a=>U(n(s,a.position),o=>te(t(s,o.position),(c,l)=>r(a.value,o.value,c,s,i,l))))}function we(e,n,t){return re(e,n,t,(r,s)=>s)}function ht(...e){return(n,t)=>{const r=[];let s=t;for(const i of e){const a=i(n,s);if(a.matched)r.push(a.value),s=a.position;else return{matched:!1}}return{matched:!0,position:s,value:r}}}function pt(...e){return mt(ht(...e))}function mt(e){return L(e,n=>n.flatMap(t=>t))}function dt(e,n){return(t,r)=>{let s=!0,i=e,a=r;do{const o=n(i,t,a)(t,a);o.matched?(i=o.value,a=o.position):s=!1}while(s);return{matched:!0,position:a,value:i}}}function gt(e,n,t){return dt(e,r=>L(n,(s,i,a,o)=>t(r,s,i,a,o)))}function xe(e,n,t){return kt(e,r=>gt(r,w(n,t,(s,i)=>[s,i]),(s,[i,a])=>i(s,a)))}function kt(e,n){return(t,r)=>U(e(t,r),s=>n(s.value,t,r,s.position)(t,s.position))}var Lt="(?:[ \\t\\r\\n\\f]*)",ve="(?:\\n|\\r\\n|\\r|\\f)",K="[^\\x00-\\x7F]",M="(?:\\\\[0-9a-f]{1,6}(?:\\r\\n|[ \\n\\r\\t\\f])?)",j="(?:\\\\[^\\n\\r\\f0-9a-f])",wt=`(?:[_a-z]|${K}|${M}|${j})`,ye=`(?:[_a-z0-9-]|${K}|${M}|${j})`,xt=`(?:${ye}+)`,vt=`(?:[-]?${wt}${ye}*)`,yt=`'([^\\n\\r\\f\\\\']|\\\\${ve}|${K}|${M}|${j})*'`,Bt=`"([^\\n\\r\\f\\\\"]|\\\\${ve}|${K}|${M}|${j})*"`,_t=ge([{name:"ws",regex:new RegExp(Lt)},{name:"hash",regex:new RegExp(`#${xt}`,"i")},{name:"ident",regex:new RegExp(vt,"i")},{name:"str1",regex:new RegExp(yt,"i")},{name:"str2",regex:new RegExp(Bt,"i")},{name:"*"},{name:"."},{name:","},{name:"["},{name:"]"},{name:"="},{name:">"},{name:"|"},{name:"+"},{name:"~"},{name:"^"},{name:"$"}]),bt=ge([{name:"unicode",regex:new RegExp(M,"i")},{name:"escape",regex:new RegExp(j,"i")},{name:"any",regex:new RegExp("[\\s\\S]","i")}]);function Be([e,n,t],[r,s,i]){return[e+r,n+s,t+i]}function St(e){return e.reduce(Be,[0,0,0])}var It=I(e=>e.name==="unicode"?String.fromCodePoint(parseInt(e.text.slice(1),16)):void 0),Nt=I(e=>e.name==="escape"?e.text.slice(1):void 0),Wt=I(e=>e.name==="any"?e.text:void 0),Et=L(ne(F(It,Nt,Wt)),e=>e.join(""));function se(e){const n=bt(e);return Et({tokens:n.tokens,options:void 0},0).value}function d(e){return I(n=>n.name===e?!0:void 0)}var ie=I(e=>e.name==="ws"?null:void 0),ae=q(ie,null);function A(e){return we(ae,e,ae)}var D=I(e=>e.name==="ident"?se(e.text):void 0),Tt=I(e=>e.name==="hash"?se(e.text.slice(1)):void 0),Ct=I(e=>e.name.startsWith("str")?se(e.text.slice(1,-1)):void 0),_e=ft(q(D,""),d("|")),oe=W(w(_e,D,(e,n)=>({name:n,namespace:e})),L(D,e=>({name:e,namespace:null}))),At=W(w(_e,d("*"),e=>({type:"universal",namespace:e,specificity:[0,0,0]})),L(d("*"),()=>({type:"universal",namespace:null,specificity:[0,0,0]}))),Pt=L(oe,({name:e,namespace:n})=>({type:"tag",name:e,namespace:n,specificity:[0,0,1]})),$t=w(d("."),D,(e,n)=>({type:"class",name:n,specificity:[0,1,0]})),Rt=L(Tt,e=>({type:"id",name:e,specificity:[1,0,0]})),be=I(e=>{if(e.name==="ident"){if(e.text==="i"||e.text==="I")return"i";if(e.text==="s"||e.text==="S")return"s"}}),Ot=W(w(Ct,q(Le(ae,be),null),(e,n)=>({value:e,modifier:n})),w(D,q(Le(ie,be),null),(e,n)=>({value:e,modifier:n}))),Mt=F(L(d("="),()=>"="),w(d("~"),d("="),()=>"~="),w(d("|"),d("="),()=>"|="),w(d("^"),d("="),()=>"^="),w(d("$"),d("="),()=>"$="),w(d("*"),d("="),()=>"*=")),jt=re(d("["),A(oe),d("]"),(e,{name:n,namespace:t})=>({type:"attrPresence",name:n,namespace:t,specificity:[0,1,0]})),Dt=we(d("["),re(A(oe),Mt,A(Ot),({name:e,namespace:n},t,{value:r,modifier:s})=>({type:"attrValue",name:e,namespace:n,matcher:t,value:r,modifier:s,specificity:[0,1,0]})),d("]")),Vt=W(jt,Dt),Ht=W(At,Pt),Se=F(Rt,$t,Vt),Ie=L(W(pt(Ht,ne(Se)),ut(Se)),e=>({type:"compound",list:e,specificity:St(e.map(n=>n.specificity))})),Ut=F(L(d(">"),()=>">"),L(d("+"),()=>"+"),L(d("~"),()=>"~"),w(d("|"),d("|"),()=>"||")),qt=W(A(Ut),L(ie,()=>" ")),ce=xe(Ie,L(qt,e=>(n,t)=>({type:"compound",list:[...t.list,{type:"combinator",combinator:e,left:n,specificity:n.specificity}],specificity:Be(n.specificity,t.specificity)})),Ie),pr=xe(L(ce,e=>({type:"list",list:[e]})),L(A(d(",")),()=>(e,n)=>({type:"list",list:[...e.list,n]})),ce);function Ft(e,n){if(!(typeof n=="string"||n instanceof String))throw new Error("Expected a selector string. Actual input is not a string!");const t=_t(n);if(!t.complete)throw new Error(`The input "${n}" was only partially tokenized, stopped at offset ${t.offset}!
1
+ __useblocks__.define("static/core/19270609.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js"],function(me,O,hr){const H=me("./2ff39ddf.js"),N=me("./b8eb1c3a.js");var it=/\n/g;function at(e){const n=[...e.matchAll(it)].map((r=>r.index||0));n.unshift(-1);const t=ee(n,0,n.length);return r=>de(t,r)}function ee(e,n,t){if(t-n==1)return{offset:e[n],index:n+1};const r=Math.ceil((n+t)/2),s=ee(e,n,r),i=ee(e,r,t);return{offset:s.offset,low:s,high:i}}function de(e,n){return(function(t){return Object.prototype.hasOwnProperty.call(t,"index")})(e)?{line:e.index,column:n-e.offset}:de(e.high.offset<n?e.high:e.low,n)}function ge(e,n="",t={}){const r=typeof n!="string"?n:t,s=typeof n=="string"?n:"",i=e.map(ot),a=!!r.lineNumbers;return function(o,c=0){const l=a?at(o):()=>({line:0,column:0});let h=c;const g=[];e:for(;h<o.length;){let y=!1;for(const p of i){p.regex.lastIndex=h;const k=p.regex.exec(o);if(k&&k[0].length>0){if(!p.discard){const v=l(h),B=typeof p.replace=="string"?k[0].replace(new RegExp(p.regex.source,p.regex.flags),p.replace):k[0];g.push({state:s,name:p.name,text:B,offset:h,len:k[0].length,line:v.line,column:v.column})}if(h=p.regex.lastIndex,y=!0,p.push){const v=p.push(o,h);g.push(...v.tokens),h=v.offset}if(p.pop)break e;break}}if(!y)break}return{tokens:g,offset:h,complete:o.length<=h}}}function ot(e,n){return{...e,regex:ct(e,n)}}function ct(e,n){if(e.name.length===0)throw new Error(`Rule #${n} has empty name, which is not allowed.`);if((function(t){return Object.prototype.hasOwnProperty.call(t,"regex")})(e))return(function(t){if(t.global)throw new Error(`Regular expression /${t.source}/${t.flags} contains the global flag, which is not allowed.`);return t.sticky?t:new RegExp(t.source,t.flags+"y")})(e.regex);if((function(t){return Object.prototype.hasOwnProperty.call(t,"str")})(e)){if(e.str.length===0)throw new Error(`Rule #${n} ("${e.name}") has empty "str" property, which is not allowed.`);return new RegExp(ke(e.str),"y")}return new RegExp(ke(e.name),"y")}function ke(e){return e.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g,"\\$&")}function I(e,n){return(t,r)=>{let s=r,i;return r<t.tokens.length?(i=e(t.tokens[r],t,r),i!==void 0&&s++):n?.(t,r),i===void 0?{matched:!1}:{matched:!0,position:s,value:i}}}function te(e,n){return e.matched?{matched:!0,position:e.position,value:n(e.value,e.position)}:e}function U(e,n){return e.matched?n(e):e}function L(e,n){return(t,r)=>te(e(t,r),(s,i)=>n(s,t,r,i))}function q(e,n){return(t,r)=>{const s=e(t,r);return s.matched?s:{matched:!0,position:r,value:n}}}function F(...e){return(n,t)=>{for(const r of e){const s=r(n,t);if(s.matched)return s}return{matched:!1}}}function W(e,n){return(t,r)=>{const s=e(t,r);return s.matched?s:n(t,r)}}function lt(e,n){return(t,r)=>{const s=[];let i=!0;do{const a=e(t,r);a.matched&&n(a.value,s.length+1,t,r,a.position)?(s.push(a.value),r=a.position):i=!1}while(i);return{matched:!0,position:r,value:s}}}function ne(e){return lt(e,()=>!0)}function ut(e){return w(e,ne(e),(n,t)=>[n,...t])}function w(e,n,t){return(r,s)=>U(e(r,s),i=>te(n(r,i.position),(a,o)=>t(i.value,a,r,s,o)))}function ft(e,n){return w(e,n,t=>t)}function Le(e,n){return w(e,n,(t,r)=>r)}function re(e,n,t,r){return(s,i)=>U(e(s,i),a=>U(n(s,a.position),o=>te(t(s,o.position),(c,l)=>r(a.value,o.value,c,s,i,l))))}function we(e,n,t){return re(e,n,t,(r,s)=>s)}function ht(...e){return(n,t)=>{const r=[];let s=t;for(const i of e){const a=i(n,s);if(a.matched)r.push(a.value),s=a.position;else return{matched:!1}}return{matched:!0,position:s,value:r}}}function pt(...e){return mt(ht(...e))}function mt(e){return L(e,n=>n.flatMap(t=>t))}function dt(e,n){return(t,r)=>{let s=!0,i=e,a=r;do{const o=n(i,t,a)(t,a);o.matched?(i=o.value,a=o.position):s=!1}while(s);return{matched:!0,position:a,value:i}}}function gt(e,n,t){return dt(e,r=>L(n,(s,i,a,o)=>t(r,s,i,a,o)))}function xe(e,n,t){return kt(e,r=>gt(r,w(n,t,(s,i)=>[s,i]),(s,[i,a])=>i(s,a)))}function kt(e,n){return(t,r)=>U(e(t,r),s=>n(s.value,t,r,s.position)(t,s.position))}var Lt="(?:[ \\t\\r\\n\\f]*)",ve="(?:\\n|\\r\\n|\\r|\\f)",K="[^\\x00-\\x7F]",M="(?:\\\\[0-9a-f]{1,6}(?:\\r\\n|[ \\n\\r\\t\\f])?)",j="(?:\\\\[^\\n\\r\\f0-9a-f])",wt=`(?:[_a-z]|${K}|${M}|${j})`,ye=`(?:[_a-z0-9-]|${K}|${M}|${j})`,xt=`(?:${ye}+)`,vt=`(?:[-]?${wt}${ye}*)`,yt=`'([^\\n\\r\\f\\\\']|\\\\${ve}|${K}|${M}|${j})*'`,Bt=`"([^\\n\\r\\f\\\\"]|\\\\${ve}|${K}|${M}|${j})*"`,_t=ge([{name:"ws",regex:new RegExp(Lt)},{name:"hash",regex:new RegExp(`#${xt}`,"i")},{name:"ident",regex:new RegExp(vt,"i")},{name:"str1",regex:new RegExp(yt,"i")},{name:"str2",regex:new RegExp(Bt,"i")},{name:"*"},{name:"."},{name:","},{name:"["},{name:"]"},{name:"="},{name:">"},{name:"|"},{name:"+"},{name:"~"},{name:"^"},{name:"$"}]),bt=ge([{name:"unicode",regex:new RegExp(M,"i")},{name:"escape",regex:new RegExp(j,"i")},{name:"any",regex:new RegExp("[\\s\\S]","i")}]);function Be([e,n,t],[r,s,i]){return[e+r,n+s,t+i]}function St(e){return e.reduce(Be,[0,0,0])}var It=I(e=>e.name==="unicode"?String.fromCodePoint(parseInt(e.text.slice(1),16)):void 0),Nt=I(e=>e.name==="escape"?e.text.slice(1):void 0),Wt=I(e=>e.name==="any"?e.text:void 0),Et=L(ne(F(It,Nt,Wt)),e=>e.join(""));function se(e){const n=bt(e);return Et({tokens:n.tokens,options:void 0},0).value}function d(e){return I(n=>n.name===e?!0:void 0)}var ie=I(e=>e.name==="ws"?null:void 0),ae=q(ie,null);function A(e){return we(ae,e,ae)}var D=I(e=>e.name==="ident"?se(e.text):void 0),Tt=I(e=>e.name==="hash"?se(e.text.slice(1)):void 0),Ct=I(e=>e.name.startsWith("str")?se(e.text.slice(1,-1)):void 0),_e=ft(q(D,""),d("|")),oe=W(w(_e,D,(e,n)=>({name:n,namespace:e})),L(D,e=>({name:e,namespace:null}))),At=W(w(_e,d("*"),e=>({type:"universal",namespace:e,specificity:[0,0,0]})),L(d("*"),()=>({type:"universal",namespace:null,specificity:[0,0,0]}))),Pt=L(oe,({name:e,namespace:n})=>({type:"tag",name:e,namespace:n,specificity:[0,0,1]})),$t=w(d("."),D,(e,n)=>({type:"class",name:n,specificity:[0,1,0]})),Rt=L(Tt,e=>({type:"id",name:e,specificity:[1,0,0]})),be=I(e=>{if(e.name==="ident"){if(e.text==="i"||e.text==="I")return"i";if(e.text==="s"||e.text==="S")return"s"}}),Ot=W(w(Ct,q(Le(ae,be),null),(e,n)=>({value:e,modifier:n})),w(D,q(Le(ie,be),null),(e,n)=>({value:e,modifier:n}))),Mt=F(L(d("="),()=>"="),w(d("~"),d("="),()=>"~="),w(d("|"),d("="),()=>"|="),w(d("^"),d("="),()=>"^="),w(d("$"),d("="),()=>"$="),w(d("*"),d("="),()=>"*=")),jt=re(d("["),A(oe),d("]"),(e,{name:n,namespace:t})=>({type:"attrPresence",name:n,namespace:t,specificity:[0,1,0]})),Dt=we(d("["),re(A(oe),Mt,A(Ot),({name:e,namespace:n},t,{value:r,modifier:s})=>({type:"attrValue",name:e,namespace:n,matcher:t,value:r,modifier:s,specificity:[0,1,0]})),d("]")),Vt=W(jt,Dt),Ht=W(At,Pt),Se=F(Rt,$t,Vt),Ie=L(W(pt(Ht,ne(Se)),ut(Se)),e=>({type:"compound",list:e,specificity:St(e.map(n=>n.specificity))})),Ut=F(L(d(">"),()=>">"),L(d("+"),()=>"+"),L(d("~"),()=>"~"),w(d("|"),d("|"),()=>"||")),qt=W(A(Ut),L(ie,()=>" ")),ce=xe(Ie,L(qt,e=>(n,t)=>({type:"compound",list:[...t.list,{type:"combinator",combinator:e,left:n,specificity:n.specificity}],specificity:Be(n.specificity,t.specificity)})),Ie),pr=xe(L(ce,e=>({type:"list",list:[e]})),L(A(d(",")),()=>(e,n)=>({type:"list",list:[...e.list,n]})),ce);function Ft(e,n){if(!(typeof n=="string"||n instanceof String))throw new Error("Expected a selector string. Actual input is not a string!");const t=_t(n);if(!t.complete)throw new Error(`The input "${n}" was only partially tokenized, stopped at offset ${t.offset}!
2
2
  `+Ne(n,t.offset));const r=A(e)({tokens:t.tokens,options:void 0},0);if(!r.matched)throw new Error(`No match for "${n}" input!`);if(r.position<t.tokens.length){const s=t.tokens[r.position];throw new Error(`The input "${n}" was only partially parsed, stopped at offset ${s.offset}!
3
3
  `+Ne(n,s.offset,s.len))}return r.value}function Ne(e,n,t=1){return`${e.replace(/(\t)|(\r)|(\n)/g,(r,s,i)=>s?"␉":i?"␍":"␊")}
4
4
  ${"".padEnd(n)}${"^".repeat(t)}`}function Kt(e){return Ft(ce,e)}function b(e){if(!e.type)throw new Error("This is not an AST node.");switch(e.type){case"universal":return z(e.namespace)+"*";case"tag":return z(e.namespace)+P(e.name);case"class":return"."+P(e.name);case"id":return"#"+P(e.name);case"attrPresence":return`[${z(e.namespace)}${P(e.name)}]`;case"attrValue":return`[${z(e.namespace)}${P(e.name)}${e.matcher}"${zt(e.value)}"${e.modifier?e.modifier:""}]`;case"combinator":return b(e.left)+e.combinator;case"compound":return e.list.reduce((n,t)=>t.type==="combinator"?b(t)+n:n+b(t),"");case"list":return e.list.map(b).join(",")}}function z(e){return e||e===""?P(e)+"|":""}function X(e){return`\\${e.codePointAt(0).toString(16)} `}function P(e){return e.replace(/(^[0-9])|(^-[0-9])|(^-$)|([-0-9a-zA-Z_]|[^\x00-\x7F])|(\x00)|([\x01-\x1f]|\x7f)|([\s\S])/g,(n,t,r,s,i,a,o,c)=>t?X(t):r?"-"+X(r.slice(1)):s?"\\-":i||(a?"�":o?X(o):"\\"+c))}function zt(e){return e.replace(/(")|(\\)|(\x00)|([\x01-\x1f]|\x7f)/g,(n,t,r,s,i)=>t?'\\"':r?"\\\\":s?"�":X(i))}function G(e){if(!e.type)throw new Error("This is not an AST node.");switch(e.type){case"compound":e.list.forEach(G),e.list.sort((n,t)=>Te(We(n),We(t)));break;case"combinator":G(e.left);break;case"list":e.list.forEach(G),e.list.sort((n,t)=>b(n)<b(t)?-1:1)}return e}function We(e){switch(e.type){case"universal":return[1];case"tag":return[1];case"id":return[2];case"class":return[3,e.name];case"attrPresence":return[4,b(e)];case"attrValue":return[5,b(e)];case"combinator":return[15,b(e)]}}function Ee(e,n){return Te(e,n)}function Te(e,n){if(!Array.isArray(e)||!Array.isArray(n))throw new Error("Arguments must be arrays.");const t=e.length<n.length?e.length:n.length;for(let r=0;r<t;r++)if(e[r]!==n[r])return e[r]<n[r]?-1:1;return e.length-n.length}var Ce=class{constructor(e){this.branches=$(Xt(e))}build(e){return e(this.branches)}};function Xt(e){const n=e.length,t=new Array(n);for(let r=0;r<n;r++){const[s,i]=e[r],a=Gt(Kt(s));t[r]={ast:a,terminal:{type:"terminal",valueContainer:{index:r,value:i,specificity:a.specificity}}}}return t}function Gt(e){return Ae(e),G(e),e}function Ae(e){const n=[];e.list.forEach(t=>{switch(t.type){case"class":n.push({matcher:"~=",modifier:null,name:"class",namespace:null,specificity:t.specificity,type:"attrValue",value:t.name});break;case"id":n.push({matcher:"=",modifier:null,name:"id",namespace:null,specificity:t.specificity,type:"attrValue",value:t.name});break;case"combinator":Ae(t.left),n.push(t);break;case"universal":break;default:n.push(t)}}),e.list=n}function $(e){const n=[];for(;e.length;){const t=Oe(e,a=>!0,Pe),{matches:r,nonmatches:s,empty:i}=Yt(e,t);e=s,r.length&&n.push(Zt(t,r)),i.length&&n.push(...Jt(i))}return n}function Jt(e){const n=[];for(const t of e){const r=t.terminal;if(r.type==="terminal")n.push(r);else{const{matches:s,rest:i}=rn(r.cont,a=>a.type==="terminal");s.forEach(a=>n.push(a)),i.length&&(r.cont=i,n.push(r))}}return n}function Yt(e,n){const t=[],r=[],s=[];for(const i of e){const a=i.ast.list;a.length?(a.some(o=>Pe(o)===n)?t:r).push(i):s.push(i)}return{matches:t,nonmatches:r,empty:s}}function Pe(e){switch(e.type){case"attrPresence":return`attrPresence ${e.name}`;case"attrValue":return`attrValue ${e.name}`;case"combinator":return`combinator ${e.combinator}`;default:return e.type}}function Zt(e,n){if(e==="tag")return Qt(n);if(e.startsWith("attrValue "))return tn(e.substring(10),n);if(e.startsWith("attrPresence "))return en(e.substring(13),n);if(e==="combinator >")return $e(">",n);if(e==="combinator +")return $e("+",n);throw new Error(`Unsupported selector kind: ${e}`)}function Qt(e){const n=le(e,t=>t.type==="tag",t=>t.name);return{type:"tagName",variants:Object.entries(n).map(([t,r])=>({type:"variant",value:t,cont:$(r.items)}))}}function en(e,n){for(const t of n)Re(t,r=>r.type==="attrPresence"&&r.name===e);return{type:"attrPresence",name:e,cont:$(n)}}function tn(e,n){const t=le(n,s=>s.type==="attrValue"&&s.name===e,s=>`${s.matcher} ${s.modifier||""} ${s.value}`),r=[];for(const s of Object.values(t)){const i=s.oneSimpleSelector,a=nn(i),o=$(s.items);r.push({type:"matcher",matcher:i.matcher,modifier:i.modifier,value:i.value,predicate:a,cont:o})}return{type:"attrValue",name:e,matchers:r}}function nn(e){if(e.modifier==="i"){const n=e.value.toLowerCase();switch(e.matcher){case"=":return t=>n===t.toLowerCase();case"~=":return t=>t.toLowerCase().split(/[ \t]+/).includes(n);case"^=":return t=>t.toLowerCase().startsWith(n);case"$=":return t=>t.toLowerCase().endsWith(n);case"*=":return t=>t.toLowerCase().includes(n);case"|=":return t=>{const r=t.toLowerCase();return n===r||r.startsWith(n)&&r[n.length]==="-"}}}else{const n=e.value;switch(e.matcher){case"=":return t=>n===t;case"~=":return t=>t.split(/[ \t]+/).includes(n);case"^=":return t=>t.startsWith(n);case"$=":return t=>t.endsWith(n);case"*=":return t=>t.includes(n);case"|=":return t=>n===t||t.startsWith(n)&&t[n.length]==="-"}}}function $e(e,n){const t=le(n,s=>s.type==="combinator"&&s.combinator===e,s=>b(s.left)),r=[];for(const s of Object.values(t)){const i=$(s.items),a=s.oneSimpleSelector.left;r.push({ast:a,terminal:{type:"popElement",cont:i}})}return{type:"pushElement",combinator:e,cont:$(r)}}function le(e,n,t){const r={};for(;e.length;){const s=Oe(e,n,t),i=h=>n(h)&&t(h)===s,a=h=>h.ast.list.some(i),{matches:o,rest:c}=sn(e,a);let l=null;for(const h of o){const g=Re(h,i);l||(l=g)}if(l==null)throw new Error("No simple selector is found.");r[s]={oneSimpleSelector:l,items:o},e=c}return r}function Re(e,n){const t=e.ast.list,r=new Array(t.length);let s=-1;for(let a=t.length;a-- >0;)n(t[a])&&(r[a]=!0,s=a);if(s==-1)throw new Error("Couldn't find the required simple selector.");const i=t[s];return e.ast.list=t.filter((a,o)=>!r[o]),i}function Oe(e,n,t){const r={};for(const a of e){const o={};for(const c of a.ast.list.filter(n))o[t(c)]=!0;for(const c of Object.keys(o))r[c]?r[c]++:r[c]=1}let s="",i=0;for(const a of Object.entries(r))a[1]>i&&(s=a[0],i=a[1]);return s}function rn(e,n){const t=[],r=[];for(const s of e)n(s)?t.push(s):r.push(s);return{matches:t,rest:r}}function sn(e,n){const t=[],r=[];for(const s of e)n(s)?t.push(s):r.push(s);return{matches:t,rest:r}}var an=class{constructor(e){this.f=e}pickAll(e){return this.f(e)}pick1(e,n=!1){const t=this.f(e),r=t.length;if(r===0)return null;if(r===1)return t[0].value;const s=n?on:cn;let i=t[0];for(let a=1;a<r;a++){const o=t[a];s(i,o)&&(i=o)}return i.value}};function on(e,n){const t=Ee(n.specificity,e.specificity);return t>0||t===0&&n.index<e.index}function cn(e,n){const t=Ee(n.specificity,e.specificity);return t>0||t===0&&n.index>e.index}function Me(e){return new an(R(e))}function R(e){const n=e.map(ln);return(t,...r)=>n.flatMap(s=>s(t,...r))}function ln(e){switch(e.type){case"terminal":return()=>[e.valueContainer];case"tagName":return un(e);case"attrValue":return hn(e);case"attrPresence":return fn(e);case"pushElement":return pn(e);case"popElement":return mn(e);default:return()=>[]}}function un(e){const n={};for(const t of e.variants)n[t.value.toLowerCase()]=R(t.cont);return(t,...r)=>{const s=t.tagName?.toLowerCase(),i=s&&n[s];return i?i(t,...r):[]}}function fn(e){const n=e.name,t=R(e.cont);return(r,...s)=>r.hasAttribute(n)?t(r,...s):[]}function hn(e){const n=[];for(const r of e.matchers){const s=r.predicate,i=R(r.cont);n.push((a,o,...c)=>s(a)?i(o,...c):[])}const t=e.name;return(r,...s)=>{const i=r.getAttribute(t);return i!==null?n.flatMap(a=>a(i,r,...s)):[]}}function pn(e){const n=R(e.cont),t=e.combinator==="+"?dn:gn;return(r,...s)=>{const i=t(r);return i?n(i,r,...s):[]}}function mn(e){const n=R(e.cont);return(t,r,...s)=>n(r,...s)}function dn(e){let n=e.previousSibling;for(;n&&n.nodeType!==Node.ELEMENT_NODE;)n=n.previousSibling;return n}function gn(e){return e.parentElement}var kn=H.__commonJSMin(((e,n)=>{var t=function(f){return r(f)&&!s(f)};function r(u){return!!u&&typeof u=="object"}function s(u){var f=Object.prototype.toString.call(u);return f==="[object RegExp]"||f==="[object Date]"||a(u)}var i=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function a(u){return u.$$typeof===i}function o(u){return Array.isArray(u)?[]:{}}function c(u,f){return f.clone!==!1&&f.isMergeableObject(u)?B(o(u),u,f):u}function l(u,f,m){return u.concat(f).map(function(_){return c(_,m)})}function h(u,f){if(!f.customMerge)return B;var m=f.customMerge(u);return typeof m=="function"?m:B}function g(u){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(u).filter(function(f){return Object.propertyIsEnumerable.call(u,f)}):[]}function y(u){return Object.keys(u).concat(g(u))}function p(u,f){try{return f in u}catch{return!1}}function k(u,f){return p(u,f)&&!(Object.hasOwnProperty.call(u,f)&&Object.propertyIsEnumerable.call(u,f))}function v(u,f,m){var _={};return m.isMergeableObject(u)&&y(u).forEach(function(x){_[x]=c(u[x],m)}),y(f).forEach(function(x){k(u,x)||(p(u,x)&&m.isMergeableObject(f[x])?_[x]=h(x,m)(u[x],f[x],m):_[x]=c(f[x],m))}),_}function B(u,f,m){m=m||{},m.arrayMerge=m.arrayMerge||l,m.isMergeableObject=m.isMergeableObject||t,m.cloneUnlessOtherwiseSpecified=c;var _=Array.isArray(f);return _!==Array.isArray(u)?c(f,m):_?m.arrayMerge(u,f,m):v(u,f,m)}B.all=function(f,m){if(!Array.isArray(f))throw new Error("first argument should be an array");return f.reduce(function(_,x){return B(_,x,m)},{})};var fr=B;n.exports=fr})),je=H.__toESM(kn());function ue(e,n,t=()=>{}){if(e===void 0){const r=function(...s){return n(r,...s)};return r}return e>=0?function(...r){return n(ue(e-1,n,t),...r)}:t}function De(e,n){let t=0,r=e.length;for(;t<r&&e[t]===n;)++t;for(;r>t&&e[r-1]===n;)--r;return t>0||r<e.length?e.substring(t,r):e}function Ln(e,n){let t=e.length;for(;t>0&&e[t-1]===n;)--t;return t<e.length?e.substring(0,t):e}function wn(e){return e.replace(/[\s\S]/g,n=>"\\u"+n.charCodeAt().toString(16).padStart(4,"0"))}function Ve(e,n){const t=new Map;for(let r=e.length;r-- >0;){const s=e[r],i=n(s);t.set(i,t.has(i)?(0,je.default)(s,t.get(i),{arrayMerge:xn}):s)}return[...t.values()].reverse()}var xn=(e,n,t)=>[...n];function J(e,n){for(const t of n){if(!e)return;e=e[t]}return e}function He(e,n="a",t=26){const r=[];do e-=1,r.push(e%t),e=e/t>>0;while(e>0);const s=n.charCodeAt(0);return r.reverse().map(i=>String.fromCharCode(s+i)).join("")}var fe=["I","X","C","M"],Ue=["V","L","D"];function qe(e){return[...e+""].map(n=>+n).reverse().map((n,t)=>n%5<4?(n<5?"":Ue[t])+fe[t].repeat(n%5):fe[t]+(n<5?Ue[t]:fe[t+1])).reverse().join("")}var Fe=class{constructor(e,n=void 0){this.lines=[],this.nextLineWords=[],this.maxLineLength=n||e.wordwrap||Number.MAX_VALUE,this.nextLineAvailableChars=this.maxLineLength,this.wrapCharacters=J(e,["longWordSplit","wrapCharacters"])||[],this.forceWrapOnLimit=J(e,["longWordSplit","forceWrapOnLimit"])||!1,this.stashedSpace=!1,this.wordBreakOpportunity=!1}pushWord(e,n=!1){this.nextLineAvailableChars<=0&&!n&&this.startNewLine();const t=this.nextLineWords.length===0,r=e.length+(t?0:1);if(r<=this.nextLineAvailableChars||n)this.nextLineWords.push(e),this.nextLineAvailableChars-=r;else{const[s,...i]=this.splitLongWord(e);t||this.startNewLine(),this.nextLineWords.push(s),this.nextLineAvailableChars-=s.length;for(const a of i)this.startNewLine(),this.nextLineWords.push(a),this.nextLineAvailableChars-=a.length}}popWord(){const e=this.nextLineWords.pop();if(e!==void 0){const n=this.nextLineWords.length===0,t=e.length+(n?0:1);this.nextLineAvailableChars+=t}return e}concatWord(e,n=!1){if(this.wordBreakOpportunity&&e.length>this.nextLineAvailableChars)this.pushWord(e,n),this.wordBreakOpportunity=!1;else{const t=this.popWord();this.pushWord(t?t.concat(e):e,n)}}startNewLine(e=1){this.lines.push(this.nextLineWords),e>1&&this.lines.push(...Array.from({length:e-1},()=>[])),this.nextLineWords=[],this.nextLineAvailableChars=this.maxLineLength}isEmpty(){return this.lines.length===0&&this.nextLineWords.length===0}clear(){this.lines.length=0,this.nextLineWords.length=0,this.nextLineAvailableChars=this.maxLineLength}toString(){return[...this.lines,this.nextLineWords].map(e=>e.join(" ")).join(`
@@ -0,0 +1 @@
1
+ __useblocks__.define("static/core/233f23fd.js",["require","exports","module","static/core/b8eb1c3a.js"],function(S,d,V){const s=S("./b8eb1c3a.js");var h=[{fields:["border","mobileBorder"],plan:"block_border"},{fields:["borderRadius"],plan:"block_radius",types:["img","countdown","video","td","structure","group","column","table","button","div","carousel"]},{fields:["mobileBorderRadius","outlookRounding"],plan:"block_radius"},{fields:["boxShadow","mobileBoxShadow"],plan:"block_shadow"},{fields:["show","direction","mobileDirection"],plan:"block_visibility"},{fields:["ampShow"],plan:"export_amp"},{fields:["exportAsPicture","isContrastBlock"],plan:"block_to_image"},{fields:["mobileAlign","mobileBackgroundColor","mobileBackgroundImage","mobileBackgroundPositionX","mobileBackgroundPositionY","mobileBackgroundRepeat","mobileBackgroundSize","mobileBorder","mobileBorderRadius","mobileBoxShadow","mobileContentWidth","mobileDirection","mobileFontSize","mobileHeight","mobileLineHeight","mobilePadding","mobileTextAlign","mobileVerticalAlign","mobileWidth"],plan:"mobile_props"},{fields:["imgReplacer"],plan:"variables"}],A=[{parent:"carouselImages",fields:["imgReplacer"],plan:"variables"}],j=[{parent:"buttons",fields:["border"],plan:"block_border"},{parent:"buttons",fields:["borderRadius"],plan:"block_radius"},{parent:"cards",fields:["border"],plan:"block_border"},{parent:"cards",fields:["borderRadius"],plan:"block_radius"}],g={backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0,backgroundSize:!0,backgroundColorContent:!0,width:!0,responsive:!0},m={text:!0,headings:!0,links:!0,buttons:!0,block:!0,cards:!0},E=/fontfamily$/i,p=/[<>"{};\\]/,w="Safe Fonts",F="Google Fonts",P="Project Fonts";function y(e,t,r){for(const n of t){const i=n.fields.find(o=>o in r),a=i&&s.featureRefusal(e,n.plan,`the "${i}" field`);if(a)return a}}var f=e=>typeof e=="object"&&e!==null;function B(e,t,r){const n=Array.isArray(t)?t:[],i=e.some(a=>f(a)&&a.slideIndex!==void 0);return e.some((a,o)=>{const u=f(a)?a:{},l=n[i?u.slideIndex:o];return(u[r]??"")!==((f(l)?l[r]:void 0)??"")})}async function T(e,t,r){const n=A.filter(o=>Array.isArray(r[o.parent])).flatMap(o=>o.fields.flatMap(u=>{const l=s.featureRefusal(e,o.plan,`the "${o.parent}[].${u}" field`);return l?[{parent:o.parent,field:u,refusal:l}]:[]}));if(n.length===0)return;const i=await s.askCanvasElement(e,{op:"get",element:t});if(i.ok===!1)return i;const a=i.value?.settings??{};return n.find(({parent:o,field:u})=>B(r[o],a[o],u))?.refusal}function N(e,t,r){for(const n of t){const i=r[n.parent],a=f(i)?n.fields.find(u=>u in i):void 0,o=a&&s.featureRefusal(e,n.plan,`the "${n.parent}.${a}" field`);if(o)return o}}function c(e){return f(e)?Object.entries(e).flatMap(([t,r])=>E.test(t)?[r]:c(r)):[]}function C(e){return Array.isArray(e)&&e[0]===F&&e[1]!==P}function b(e,t,r){const n=c(t).filter(C),i=n.length?s.featureRefusal(e,"google_fonts","Google fonts"):void 0;if(!i)return;const a=c(r).map(o=>JSON.stringify(o));return n.every(o=>a.includes(JSON.stringify(o)))?void 0:i}var L=e=>!p.test(e)&&!e.includes("'");function v(e){return!p.test(e)&&e.split(",").every(t=>{const r=t.trim();return!r.includes("'")||/^'[^']*'$/.test(r)})}function $(e){return typeof e=="string"?v(e):Array.isArray(e)&&e.every((t,r)=>typeof t=="string"&&(r===1&&e[0]===w?v(t):L(t)))}function k(e){return c(e).every($)?void 0:s.err("invalidArgs",'A font must be a string or an array of strings; a font name must not hold < > " { } ; or \\, and a single quote only around a whole family name.')}function G(e,t){return t?s.featureRefusal(e,"preheader_editing","the preheader"):void 0}var I=["href","link","linkHref","src","iconSrc"],U=["backgroundImage","mobileBackgroundImage"],D=/--!?>|</;function R(e){return typeof e!="string"||s.isExecutableUrl(e)||D.test(e)}function x(e,t){if(!(!U.includes(e)||!Array.isArray(t)))return t.some(r=>r?.value!==void 0&&r.value!==null&&R(r.value))?`${e}[].value`:void 0}function O(e){if(f(e))for(const[t,r]of Object.entries(e)){if(I.includes(t)&&r!==null&&R(r))return t;const n=x(t,r)??O(r);if(n)return n}}function _(e){const t=O(e);return t?s.err("invalidArgs",`"${t}" must be a string, must not be a javascript:, vbscript: or data:text/html address and must not hold "<" or "-->".`):void 0}function M(e){return Object.fromEntries(Object.entries(e).filter(([t])=>Object.hasOwn(g,t)))}function Y(e){const t=Object.keys(e).find(r=>!Object.hasOwn(g,r));return t?s.err("invalidArgs",`"${t}" is not an email layout setting; take the fields from document.getSettings. Common styles go to document.setContentStyles.`):_(e)}function K(e){const t=Object.keys(m).join(", "),r=Object.entries(e).find(([n,i])=>!Object.hasOwn(m,n)||!f(i)||Array.isArray(i));return r?s.err("invalidArgs",`"${r[0]}" must be a group of common styles, an object; the groups are ${t}.`):void 0}function q(e,t,r){return K(t)??k(t)??N(e,j,t)??b(e,t,r)}async function z(e,t,r){if(!b(e,r,void 0))return;const n=await s.askCanvasElement(e,{op:"get",element:t});return n.ok===!1?n:b(e,r,n.value?.settings)}async function H(e,t,r){const n=h.filter(l=>l.fields.some(J=>J in r)),i=y(e,n.filter(l=>!l.types),r)??await T(e,t,r)??await z(e,t,r),a=n.filter(l=>l.types);if(i||a.length===0)return i;const o=await s.askCanvasElement(e,{op:"get",element:t});if(o.ok===!1)return o;const u=o.value?.type??"";return y(e,a.filter(l=>l.types?.includes(u)),r)}Object.defineProperty(d,"closedFieldRefusal",{enumerable:!0,get:function(){return H}}),Object.defineProperty(d,"contentStylesRefusal",{enumerable:!0,get:function(){return q}}),Object.defineProperty(d,"editableLayoutSettings",{enumerable:!0,get:function(){return M}}),Object.defineProperty(d,"fontNameRefusal",{enumerable:!0,get:function(){return k}}),Object.defineProperty(d,"layoutSettingsRefusal",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(d,"preheaderRefusal",{enumerable:!0,get:function(){return G}}),Object.defineProperty(d,"unsafeUrlRefusal",{enumerable:!0,get:function(){return _}})});
@@ -1,5 +1,5 @@
1
1
  (function(){try{if(typeof document<"u"){var n='.monaco-editor{width:100%;height:100%}.monaco-editor .monaco-hover{border-radius:6px}.monaco-editor .monaco-editor .scroll-decoration{box-shadow:none}.monaco-editor,.monaco-editor *,.monaco-editor .view-lines,.monaco-editor .view-lines *,.monaco-editor .view-lines .view-line,.monaco-editor .view-lines .monaco-mouse-cursor-text,.monaco-editor .view-line,.monaco-editor .monaco-mouse-cursor-text{font-family:var(--monaco-editor-font-family,"Source Code Pro", Consolas, "Courier New", monospace)!important}.monaco-editor .view-line,.monaco-editor .view-line span,.monaco-editor .view-line span.inline-selected-text{font-variant-ligatures:none;font-feature-settings:"liga" 0, "calt" 0;font-kerning:none;white-space:pre;font-family:var(--monaco-monospace-font,var(--monaco-editor-font-family,"Source Code Pro", Consolas, "Courier New", monospace))!important;font-size:var(--monaco-editor-font-size,14px)!important;font-weight:400!important}.monaco-editor .standalone-colorpicker-body{max-width:460px!important}.monaco-editor .standalone-colorpicker-body .colorpicker-body .saturation-wrap{flex:0 auto;max-width:280px}.blocks-app .colorpicker-body .saturation-box,.blocks-app .colorpicker-body .strip{border-radius:4px}.blocks-app .scrollbar.vertical{width:5px!important}.blocks-app .scrollbar.vertical .slider{border-radius:5px!important;width:5px!important}.blocks-app .user-cursor{z-index:10;border-left:2px solid #ff00e1;width:2px;height:20px;position:absolute}.blocks-app .cursor-hover{color:#fff;text-wrap-mode:nowrap;z-index:10000;border-radius:7px 7px 7px 0;margin-left:-2px;padding:0 5px;font-size:12px;position:absolute;top:-17px}.blocks-app .user-selection-decoration{background-color:#8080eb4d}.monaco-editor__spin{z-index:1000;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}',o=window.__useblocks_styles__||(window.__useblocks_styles__={sheets:{},order:[]}),r=n;if(!o.sheets[r]){var t=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(t=new CSSStyleSheet,t.replaceSync(n))}catch{t=null}if(t){if(!o.host||!o.host.isConnected||!o.host.sheet){var e=document.createElement("style");e.setAttribute("data-useblocks","true"),document.head.appendChild(e),o.host=e}for(var s=o.host.sheet,a=0;a<t.cssRules.length;a++)try{s.insertRule(t.cssRules[a].cssText,s.cssRules.length)}catch{}(o.texts||(o.texts=[])).push(n),(o.listeners||[]).forEach(function(i){try{i(n)}catch{}})}else{var e=document.createElement("style");e.setAttribute("data-useblocks","true"),e.appendChild(document.createTextNode(n)),document.head.appendChild(e)}o.sheets[r]=!0,o.order.push(r)}}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- __useblocks__.define("static/core/2a1ca143.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/e8499e21.js","static/core/e47dcbb0.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper"],function(Q,pt,Ic){const oe=Q("./2ff39ddf.js"),Mn=Q("./cf7d1dd7.js"),c=Q("./e8499e21.js"),Ln=Q("./e47dcbb0.js");let k=Q("react"),d=oe.__toESM(k,1);k=oe.__toESM(k);let Ee=Q("react/jsx-runtime"),rr=Q("__delivery__/libs"),An=Q("vite/preload-helper");function or(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function _n(e){if(Array.isArray(e))return e}function Tn(e,t,r){return(t=In(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,n,i,s,a=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(o=i.call(r)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(p){u=!0,n=p}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw n}}return a}}function zn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ __useblocks__.define("static/core/2cf7ee08.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/b8eb1c3a.js","static/core/e47dcbb0.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper"],function(Q,pt,Ic){const oe=Q("./2ff39ddf.js"),Mn=Q("./cf7d1dd7.js"),c=Q("./b8eb1c3a.js"),Ln=Q("./e47dcbb0.js");let k=Q("react"),d=oe.__toESM(k,1);k=oe.__toESM(k);let Ee=Q("react/jsx-runtime"),rr=Q("__delivery__/libs"),An=Q("vite/preload-helper");function or(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function _n(e){if(Array.isArray(e))return e}function Tn(e,t,r){return(t=In(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,n,i,s,a=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(l=(o=i.call(r)).done)&&(a.push(o.value),a.length!==t);l=!0);}catch(p){u=!0,n=p}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw n}}return a}}function zn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,o)}return r}function ir(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nr(Object(r),!0).forEach(function(o){Tn(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nr(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function Rn(e,t){if(e==null)return{};var r,o,n=Nn(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Nn(e,t){if(e==null)return{};var r={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;r[o]=e[o]}return r}function Pn(e,t){return _n(e)||jn(e,t)||qn(e,t)||zn()}function Dn(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function In(e){var t=Dn(e,"string");return typeof t=="symbol"?t:t+""}function qn(e,t){if(e){if(typeof e=="string")return or(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?or(e,t):void 0}}function Un(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,o)}return r}function ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sr(Object(r),!0).forEach(function(o){Un(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sr(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function Wn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(o){return t.reduceRight(function(n,i){return i(n)},o)}}function Oe(e){return function t(){for(var r=this,o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return n.length>=e.length?e.apply(this,n):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(r,[].concat(n,a))}}}function We(e){return{}.toString.call(e).includes("Object")}function Fn(e){return!Object.keys(e).length}function Ce(e){return typeof e=="function"}function Vn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Bn(e,t){return We(t)||ne("changeType"),Object.keys(t).some(function(r){return!Vn(e,r)})&&ne("changeField"),t}function Hn(e){Ce(e)||ne("selectorType")}function Gn(e){Ce(e)||We(e)||ne("handlerType"),We(e)&&Object.values(e).some(function(t){return!Ce(t)})&&ne("handlersType")}function Qn(e){e||ne("initialIsRequired"),We(e)||ne("initialType"),Fn(e)&&ne("initialContent")}function Kn(e,t){throw new Error(e[t]||e.default)}var ne=Oe(Kn)({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),Fe={changes:Bn,selector:Hn,handler:Gn,initial:Qn};function Yn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Fe.initial(e),Fe.handler(t);var r={current:e},o=Oe(Xn)(r,t),n=Oe(Jn)(r),i=Oe(Fe.changes)(e),s=Oe(Zn)(r);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(p){return p};return Fe.selector(u),u(r.current)}function l(u){Wn(o,n,i,s)(u)}return[a,l]}function Zn(e,t){return Ce(t)?t(e.current):t}function Jn(e,t){return e.current=ar(ar({},e.current),t),t}function Xn(e,t,r){return Ce(t)?t(e.current):Object.keys(r).forEach(function(o){var n;return(n=t[o])===null||n===void 0?void 0:n.call(t,e.current[o])}),r}var ei={create:Yn},ti={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function ri(e){return function t(){for(var r=this,o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return n.length>=e.length?e.apply(this,n):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(r,[].concat(n,a))}}}function oi(e){return{}.toString.call(e).includes("Object")}function ni(e){return e||lr("configIsRequired"),oi(e)||lr("configType"),e.urls?{paths:{vs:e.urls.monacoBase}}:e}function qc(){}function ii(e,t){throw new Error(e[t]||e.default)}var si={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
4
4
  You are using deprecated way of configuration.
5
5
 
@@ -0,0 +1 @@
1
+ __useblocks__.define("static/core/32f12150.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/b8eb1c3a.js"],function(d,m,E){const j=d("./2ff39ddf.js"),y=d("./cf7d1dd7.js"),e=d("./b8eb1c3a.js");var R=20;async function h(t){const i=e.peekEmailDocuments(t),o=i?.current()?.get().serverId;if(!i||o==null)return e.err("unavailable","The document has no saved revisions yet.");const s=e.featureRefusal(t,"version_history","revision history");if(s)return s;const n={wpId:e.openDocumentWpId(t,o)};return e.isBlockSessionKey(i.sessionKey())?e.canReadBlockHistory(t)?{port:e.resolveBlockHistoryPort(t),documentId:String(o),context:n}:e.err("unavailable","Revision history is not available for this block."):await e.isEmailHistoryAvailable(t)?{port:e.resolveEmailHistoryPort(t),documentId:String(o),context:n}:e.planRefusal("Revision history is not available on the current plan.")}async function p({port:t,documentId:i,context:o},s){for(let n=1;n<=R;n+=1){const{revisions:r,hasMore:a}=await t.readRevisions(i,n,o),u=r.find(l=>String(l.id)===s);if(u)return u;if(!a)break}return e.err("notFound",`There is no revision "${s}": take an id from history.listRevisions.`)}async function b(t,i){const o=await p(t,i);if(e.isResult(o))return o;const{port:s,documentId:n,context:r}=t,a=o.html?.trim()?o:{...o,...await s.readRevision?.(n,i,r)};return a.html?.trim()?a:e.err("unavailable",`The revision "${i}" has no content to show.`)}function g(t){t.getInstance(y.STORE_ID)?.dispatch?.(e.markAppearanceNeedsUpdate())}function k(t,i){const o=t?e.tryParseISO(t):void 0;return o instanceof Date&&!Number.isNaN(o.getTime())?String(e.formatDate(o,i)):""}function w(t){const i=new WeakMap,o=s=>{const n=i.get(s)??h(t).then(r=>e.isResult(r)?r:p(r,s.revision));return i.set(s,n),n};return{"history.restoreRevision":{precheck:async s=>{if(!e.openDocument(t))return e.noDocument();if(e.isReadOnly(t))return e.readOnlyError();const n=await o(s);return e.isResult(n)?n:void 0},consent:async s=>{const{__:n}=e.agentTranslator(t),r=await o(s).catch(()=>{}),{date:a,modified:u,authorName:l,author:c,subject:f}=e.isResult(r)?{}:r??{},v=l??(typeof c=="string"&&!/^\d+$/.test(c)?c:"");return{title:n("Go back to an earlier version of the email"),...e.detailsOf({label:n("Date"),value:k(a??u,n)},{label:n("Author"),value:v},{label:n("Subject"),value:e.clip(f??"")})}}}}}function _(t){const i=s=>s.aborted?e.cancelledError():e.readOnlyRefusal(t),o=async(s,n)=>{const r=e.openDocument(t);if(!r)return e.noDocument();if(e.isReadOnly(t))return e.readOnlyError();const a=await h(t);if(e.isResult(a))return a;const u=i(n);if(u)return u;const l=await b(a,s);if(e.isResult(l))return l;const c=i(n);return c||(e.openDocument(t)===r?{document:r,loaded:l}:e.err("unavailable","The open document changed while the revision was loading."))};return{"history.restoreRevision":async({revision:s},n)=>{const r=await o(s,n.signal);if(e.isResult(r))return r;const{document:a,loaded:u}=r,l=e.fromRevision(u)?.attributes;l&&e.writeEmailAttributes(a,l),g(t);const c=a.get().version;e.replaceDocumentContent(a,e.peekEmailDocuments(t)?.history(),u.html,{undoable:!0}),a.get().version===c&&a.markUnsaved();const{date:f,modified:v,subject:D}=u;return{revision:s,date:f??v,subject:D,unsaved:!0}}}}m.agentRevisionGates=w,m.agentRevisionHandlers=_});