@emailmaker/emailmaker 1.3.4 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/README.md +20 -0
- package/emailmaker-core.091c986b.js +874 -0
- package/emailmaker-esm.js +53 -39
- package/{emailmaker-po.87ebe001.js → emailmaker-po.091c986b.js} +1 -1
- package/emailmaker.d.ts +95 -5
- package/emailmaker.js +54 -40
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/css/sandbox-dark.css +2 -9
- package/iframe/css/sandbox-light.css +2 -9
- package/iframe/css/sandbox.css +13 -23
- package/iframe/{iframe-eblock.87ebe001.html → iframe-eblock.091c986b.html} +2 -2
- package/iframe/{iframe.87ebe001.html → iframe.091c986b.html} +2 -2
- package/iframe/js/elMarkupHelper.DoIAMao4.js +279 -0
- package/iframe/js/{iframe-eblock.body.87ebe001.js → iframe-eblock.body.091c986b.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.091c986b.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/166a67bd.js +1 -0
- package/static/core/1a65ef0f.js +1 -0
- package/static/core/{4cdd6e6c.js → 1c67ab93.js} +1 -1
- package/static/core/{27599903.js → 1d004581.js} +1 -1
- package/static/core/{79e13595.js → 220d7d31.js} +1 -1
- package/static/core/{afb0d556.js → 2da7d310.js} +2 -2
- package/static/core/322d3e9f.js +1 -0
- package/static/core/{d8175c7f.js → 34756b09.js} +1 -1
- package/static/core/36f3f772.js +1 -0
- package/static/core/3b9931cd.js +1 -0
- package/static/core/{312fb954.js → 3bff2ae6.js} +1 -1
- package/static/core/{5afad425.js → 454350da.js} +1 -1
- package/static/core/{4797d4f7.js → 4852c0de.js} +6 -6
- package/static/core/{75a2537a.js → 5272f5b2.js} +1 -1
- package/static/core/{76163cc7.js → 5f176d0a.js} +1 -1
- package/static/core/674e22a5.js +1 -0
- package/static/core/{27986c36.js → 6ce85877.js} +1 -1
- package/static/core/7b8fbc31.js +1 -0
- package/static/core/{5ebf9f1e.js → 867b1e0a.js} +1 -1
- package/static/core/89b1052c.js +1 -0
- package/static/core/{81c0d133.js → 8b8c93f4.js} +1 -1
- package/static/core/8e97c82c.js +163 -0
- package/static/core/8eea6488.js +1 -0
- package/static/core/9a4cfb0a.js +1 -0
- package/static/core/{81a16991.js → 9d388494.js} +1 -1
- package/static/core/{2269bf04.js → 9e1370a6.js} +1 -1
- package/static/core/{9a7e933e.js → a59d579e.js} +1 -1
- package/static/core/{87c47034.js → a6abc393.js} +2 -2
- package/static/core/aa33047a.js +1 -0
- package/static/core/abde5a43.js +2 -0
- package/static/core/{d833a29f.js → b69579c4.js} +1 -1
- package/static/core/{489390a3.js → bcc4db3e.js} +1 -1
- package/static/core/{78916fed.js → c0b0ceff.js} +3 -3
- package/static/core/c5edcfc7.js +1 -0
- package/static/core/{122c5ed9.js → c9d5118c.js} +1 -1
- package/static/core/{81cc5690.js → caf9f1a6.js} +1 -1
- package/static/core/{7601732d.js → d241119a.js} +1 -1
- package/static/core/d4c10a7e.js +10 -0
- package/static/core/d517188a.js +1 -0
- package/static/core/db92581b.js +19 -0
- package/static/core/{a15ab3fe.js → de0d3c9a.js} +1 -1
- package/static/core/{8cebeef2.js → e995a70d.js} +1 -1
- package/static/core/ee26ef3d.js +1 -0
- package/static/core/f399000c.js +1 -0
- package/static/core/{67cc6cb2.js → f875f388.js} +1 -1
- package/static/esm/{9610f2de.js → 95cbf920.js} +1 -1
- package/static/umd-runtime/{runtime.BHEKxbjr.js → runtime.CV4WRxRc.js} +1 -1
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.87ebe001.js +0 -859
- package/iframe/js/elMarkupHelper.CO37NCd9.js +0 -278
- package/iframe/js/iframe.body.87ebe001.js +0 -129
- package/static/core/32e15918.js +0 -1
- package/static/core/b8941eda.js +0 -28
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
__emailmaker__.define("js/elMarkupHelper.DoIAMao4.js",["require","exports","module"],function(id,H,ene){var kg=Object.defineProperty,Sr=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ie=(e,t)=>{let n={};for(var r in e)kg(n,r,{get:e[r],enumerable:!0});return t||kg(n,Symbol.toStringTag,{value:"Module"}),n};function Xi(e){"@babel/helpers - typeof";return Xi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xi(e)}function tL(e,t){if(Xi(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nL(e){var t=tL(e,"string");return Xi(t)=="symbol"?t:t+""}function k(e,t,n){return(t=nL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Lg;Lg=Symbol.toStringTag;var sd=class{constructor(){k(this,"_valuesMap",new Map),k(this,Lg,"Storage")}getItem(e){const t=String(e);return this._valuesMap.has(e)?String(this._valuesMap.get(t)):null}setItem(e,t){this._valuesMap.set(String(e),String(t))}removeItem(e){this._valuesMap.delete(e)}clear(){this._valuesMap.clear()}key(e){if(arguments.length===0)throw new TypeError("Failed to execute 'key' on 'Storage': 1 argument required, but only 0 present.");return Array.from(this._valuesMap.keys())[e]}get length(){return this._valuesMap.size}};function Ng(){const e=new sd;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&sd.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(sd.prototype.hasOwnProperty(n)){const r=e[n];if(typeof r=="function"){const o=r;return(...i)=>o.apply(e,i)}return r}return e.getItem(n)}}})}function xg(){const e=Ng(),t=Ng();Object.defineProperty(window,"localStorage",{configurable:!0,enumerable:!0,get:()=>e}),Object.defineProperty(window,"sessionStorage",{configurable:!0,enumerable:!0,get:()=>t});let n=Object.create(null);Object.defineProperty(document,"cookie",{enumerable:!1,configurable:!0,get(){const r=[];for(var o in n)r.push(o+"="+n[o]);return r.join(";")},set(r){const o=r.indexOf("=");var i=r.substr(0,o),s=r.substring(o+1);return n[i]=s,i+"="+s}}),Object.defineProperty(document,"clearCookies",{enumerable:!1,configurable:!0,value:()=>n=Object.create(null)})}xg();var Og=Symbol.for("emailmaker.commandInputPause");function Rg(){const e=window,t=e[Og];if(t)return t;const n=new Set;return e[Og]=n,window.addEventListener("input",r=>n.forEach(o=>o(r)),!0),n}function rL(){Rg()}function oL(e){const t=Rg();return t.add(e),()=>{t.delete(e)}}rL();var Mg=class{constructor(e){k(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},Ct=(function(e){return e[e.StartCommentTag=0]="StartCommentTag",e[e.Comment=1]="Comment",e[e.EndCommentTag=2]="EndCommentTag",e[e.StartTagOpen=3]="StartTagOpen",e[e.StartTagClose=4]="StartTagClose",e[e.StartTagSelfClose=5]="StartTagSelfClose",e[e.StartTag=6]="StartTag",e[e.EndTagOpen=7]="EndTagOpen",e[e.EndTagClose=8]="EndTagClose",e[e.EndTag=9]="EndTag",e[e.DelimiterAssign=10]="DelimiterAssign",e[e.AttributeName=11]="AttributeName",e[e.AttributeValue=12]="AttributeValue",e[e.StartDoctypeTag=13]="StartDoctypeTag",e[e.Doctype=14]="Doctype",e[e.EndDoctypeTag=15]="EndDoctypeTag",e[e.Content=16]="Content",e[e.Whitespace=17]="Whitespace",e[e.Unknown=18]="Unknown",e[e.Script=19]="Script",e[e.Styles=20]="Styles",e[e.EOS=21]="EOS",e[e.BogusComment=22]="BogusComment",e[e.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e})({}),iL=class{constructor(e,t){k(this,"source",void 0),k(this,"len",void 0),k(this,"position",void 0),this.source=e,this.len=e.length,this.position=t}eos(){return this.len<=this.position}getSource(){return this.source}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}goToEnd(){this.position=this.source.length}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)?(this.position++,!0):!1}advanceIfChars(e){let t;if(this.position+e.length>this.source.length)return!1;for(t=0;t<e.length;t++)if(this.source.charCodeAt(this.position+t)!==e[t])return!1;return this.advance(t),!0}advanceIfRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index+t[0].length,t[0]):""}advanceUntilRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index,t[0]):(this.goToEnd(),"")}advanceUntilChar(e){for(;this.position<this.source.length;){if(this.source.charCodeAt(this.position)===e)return!0;this.advance(1)}return!1}advanceUntilChars(e){for(;this.position+e.length<=this.source.length;){let t=0;for(;t<e.length&&this.source.charCodeAt(this.position+t)===e[t];t++);if(t===e.length)return!0;this.advance(1)}return this.goToEnd(),!1}skipWhitespace(){return this.advanceWhileChar(e=>e===uL||e===dL||e===aL||e===cL||e===lL)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},ad=33,Ro=45,Ki=60,tn=62,Yi=47,sL=61,Pg=34,Ig=39,aL=10,lL=13,cL=12,uL=32,dL=9,Dg=63,fL=65,mL=90,hL=97,pL=122;function Bg(e){return e>=hL&&e<=pL||e>=fL&&e<=mL}function Hg(e){return Bg(e)||e===Yi||e===ad||e===Dg}var Va="(?=[\\s/>])",gL=new RegExp(`<!--|-->|<\\/?script${Va}\\s*\\/?>?`,"i"),bL=new RegExp(`<\\/style${Va}`,"i"),yL={"text/x-handlebars-template":!0,"text/html":!0};function vL(e,t=0,n=0,r=!1){const o=new iL(e,t);let i=n,s=0,a=18,l,c,u=!1,d,f,h;function m(){return o.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function p(){const E=o.pos();for(;!o.eos();){const T=o.nextChar();if(T===tn)return!0;if(T===Ki)break;if(T===Pg||T===Ig){if(!o.advanceUntilChar(T))break;o.advance(1)}}return o.goBackTo(E),!1}function v(){for(;o.advanceUntilChar(Ki)&&!Hg(o.peekChar(1));)o.advance(1)}function w(E){return o.advanceUntilChar(tn)&&o.advance(1),A(E,22)}function _(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function A(E,T,y){return a=T,s=E,l=y,T}function b(){const E=o.pos(),T=i,y=g();return y!==21&&E===o.pos()&&!(r&&(y===4||y===8))?(o.advance(1),A(E,18)):y}function g(){const E=o.pos();if(o.eos())return A(E,21);let T;switch(i){case 6:return o.advanceIfChars([Ro,Ro,tn])?(i=0,A(E,2)):(o.advanceUntilChars([Ro,Ro,tn]),A(E,1));case 3:return o.advanceIfChar(tn)?(i=0,A(E,15)):(o.advanceUntilChar(tn),A(E,14));case 0:return o.peekChar()===Ki&&Hg(o.peekChar(1))?(o.advance(1),o.peekChar()===ad?o.advanceIfChars([ad,Ro,Ro])?(i=6,A(E,0)):o.advanceIfRegExp(/^!doctype/i)?(i=3,A(E,13)):w(E):o.peekChar()===Dg?w(E):o.advanceIfChar(Yi)?Bg(o.peekChar())?(i=2,A(E,7)):w(E):(i=1,A(E,3))):(v(),A(E,16));case 2:return m().length>0?(i=5,u=!1,A(E,9)):o.skipWhitespace()?A(E,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(tn),E<o.pos()?A(E,18,"End tag name expected."):g());case 5:if(o.skipWhitespace())return u=!0,A(E,17);if(o.advanceIfChar(tn))return i=0,A(E,8);if(r&&o.peekChar()===Ki)return i=0,A(E,8,"Closing bracket missing.");if((u||o.peekChar()===Yi)&&p())return i=0,A(E,8);T="Closing bracket expected.";break;case 1:return d=m(),h=void 0,f=void 0,d.length>0?(c=!1,i=4,A(E,6)):o.skipWhitespace()?A(E,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(tn),E<o.pos()?A(E,18,"Start tag name expected."):g());case 4:return o.skipWhitespace()?(c=!0,A(E,17)):c&&(f=_(),f.length>0)?(i=9,c=!1,A(E,11)):o.advanceIfChars([Yi,tn])?(i=0,A(E,5)):o.advanceIfChar(tn)?(d==="script"?h&&yL[h]?i=0:i=7:d==="style"?i=8:i=0,A(E,4)):r&&o.peekChar()===Ki?(i=0,A(E,4,"Closing bracket missing.")):(o.advance(1),A(E,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,A(E,17)):o.advanceIfChar(sL)?(i=10,A(E,10)):(i=4,g());case 10:if(o.skipWhitespace())return A(E,17);let y=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(y.length>0)return o.peekChar()===tn&&o.peekChar(-1)===Yi&&(o.goBack(1),y=y.substr(0,y.length-1)),f==="type"&&(h=y),i=4,c=!1,A(E,12);const S=o.peekChar();return S===Ig||S===Pg?(o.advance(1),o.advanceUntilChar(S)&&o.advance(1),f==="type"&&(h=o.getSource().substring(E+1,o.pos()-1)),i=4,c=!1,A(E,12)):(i=4,c=!1,g());case 7:let C=1;for(;!o.eos();){const L=o.advanceIfRegExp(gL);if(L.length===0)return o.goToEnd(),A(E,19);if(L==="<!--")C===1&&(C=2);else if(L==="-->")C=1;else if(L[1]!=="/")C===2&&(C=3);else if(C===3)C=2;else{o.goBack(L.length);break}}return i=0,E<o.pos()?A(E,19):g();case 8:return o.advanceUntilRegExp(bL),i=0,E<o.pos()?A(E,20):g()}return o.advance(1),i=0,A(E,18,T)}return{scan:b,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>o.pos()-s,getTokenEnd:()=>o.pos(),getTokenText:()=>o.getSource().substring(s,o.pos()),getScannerState:()=>i,getTokenError:()=>l}}function EL(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function SL(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function wL(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function _L(e,t){const n=`<!--${e.content}-->`;return e.start=t,e.startTagEnd=t+4,e.end=t+n.length,e.endTagStart=e.end-3,n}var ld=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function CL(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var Fg=Object.create(null);function TL(e,t){const n=Fg[e]||(Fg[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[CL(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function cd(e,t){if(e.start===e.end||t)return"";switch(e.type){case I.ELEMENT:return dd(e,t);case I.ROOT:return[...e.children].map(n=>cd(n,t)).join("");case I.DOCTYPE:return EL(e,t);case I.COMMENT:return wL(e,t);default:return e.content||""}}function ud(){return{exact:new WeakMap,collapsed:new WeakMap}}function Jn(e,t=!1,n){if(e.start===e.end&&e.type!==I.ROOT)return"";const r=n&&(t?n.collapsed:n.exact),o=r?.get(e);if(o!==void 0)return o;const i=()=>e.children.map(a=>Jn(a,t,n)).join("");let s;switch(e.type){case I.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case I.ROOT:s=i();break;case I.COMMENT:s=`<!--${e.content??""}-->`;break;case I.DOCTYPE:s=`<!${e.content??""}>`;break;default:{const a=e.content??"";s=t?a.replace(/\s+/g," ").trim():a}}return r?.set(e,s),s}function Ga(e,t=0){if(e.start===e.end)return"";switch(e.type){case I.ELEMENT:return kL(e,t);case I.ROOT:return Wg(e,t);case I.DOCTYPE:return SL(e,t);case I.COMMENT:return _L(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function $g(e){const t=e.tag?.toLowerCase();let n="";if(t){const r=e.attributes;if(r){const o=Object.keys(r);for(const i of o){const s=r[i]===null?"":r[i];typeof s=="string"&&(n+=s===""&&i!=="em"&&!TL(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function AL(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=cd(r);return n}function Wg(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=Ga(r,t+n.length);return n}function qg(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=$g(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function zg(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function dd(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=qg(e,t);if(ld.has(r))return o;{const i=zg(e,t);return`${o}${n?AL(e,t):""}${i}`}}function kL(e,t){const n=e.tag?.toLowerCase()||"div",r=qg(e);if(e.start=t,e.startTagEnd=t+r.length,ld.has(n)){e.endTagStart=e.startTagEnd,e.end=e.startTagEnd;const o=i=>{for(const s of i.children)s.start=s.startTagEnd=s.endTagStart=s.end=i.end,o(s)};return o(e),r}else{const o=Wg(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=zg(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function fd(e,t){let n=0,r=e.length;if(r===0)return 0;for(;n<r;){const o=Math.floor((n+r)/2);t(e[o])?r=o:n=o+1}return n}var I=(function(e){return e[e.HTML=0]="HTML",e[e.ELEMENT=1]="ELEMENT",e[e.ROOT=2]="ROOT",e[e.COMMENT=3]="COMMENT",e[e.DOCTYPE=4]="DOCTYPE",e[e.ADVANCED=5]="ADVANCED",e})({}),Xa=e=>e.type===0?e.start-1:e.start,LL=e=>e.type===0?e.end+1:e.end,Tt=class Yk{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,n,r,o){k(this,"start",void 0),k(this,"end",void 0),k(this,"children",void 0),k(this,"parent",void 0),k(this,"content",void 0),k(this,"type",1),k(this,"tag",void 0),k(this,"closed",!1),k(this,"startTagEnd",void 0),k(this,"endTagStart",void 0),k(this,"attributes",void 0),k(this,"createdBy",void 0),k(this,"isDirty",void 0),this.start=t,this.end=n,this.children=r,this.parent=o}isSameTag(t){return this.tag===void 0?t===void 0:t!==void 0&&this.tag.length===t.length&&this.tag.toLowerCase()===t}get firstChild(){return this.children[0]}get lastChild(){return this.children.length?this.children[this.children.length-1]:void 0}findNodeBefore(t){const n=fd(this.children,r=>t<=Xa(r))-1;if(n>=0){const r=this.children[n];if(t>Xa(r)){if(t<r.end)return r.findNodeBefore(t);const o=r.lastChild;return o&&o.end===r.end?r.findNodeBefore(t):r}}return this}findNodeAt(t){const n=fd(this.children,r=>t<=Xa(r))-1;if(n>=0){const r=this.children[n];if(t>=Xa(r)&&t<=LL(r))return r.findNodeAt(t)}return this}find(t){if(t(this))return this;for(const n of this.children){const r=n.find(t);if(r)return r}}closest(t){let n=this;do if(t(n))return n;while(n=n.parent)}parents(){return this.parent?[this.parent,...this.parent.parents()]:[]}closestFromRoot(t,n=!0){const r=n?[this,...this.parents()]:this.parents();for(let o=r.length-1;o>=0;o--){const i=r[o];if(t(i))return i}}contains(t){return!!t.closest(n=>n===this)}clone(t=this.parent,n=this.start,r=!0){const o=this.start-n,i=new Yk(n,this.end-o,[],t);return i.children=r?this.children.map(s=>s.clone(i,s.start-o)):[],i.attributes={...this.attributes},i.closed=this.closed,i.content=this.content,i.startTagEnd=this.startTagEnd,i.endTagStart=this.endTagStart,i.tag=this.tag,i.type=this.type,i}};function NL(e){if(typeof e=="string"){const t=e.startsWith("'")||e.startsWith('"')?1:0,n=e.endsWith("'")||e.endsWith('"')?e.length-1:e.length;return e.substring(t,n)}return e}var Ug=class{constructor(e,t){k(this,"text",void 0),k(this,"type",void 0),k(this,"node",void 0),k(this,"replaces",void 0),this.text=e,this.type=t}get hasNode(){return!!this.node}addReplace(e){this.replaces?.push(e)}start(e,t,n){if(!this.node){const r=this.node=new Tt(e,this.text.length,[],n);r.type=this.type,r.startTagEnd=t,this.replaces=[]}}finish(e,t){const n=this.replaces,r=this.node,o=e+(t||0);if(n){for(const i of n){const s=i.parent;if(!s)throw new Error("parent not defined");const a=s.children.indexOf(i);s.children.splice(a,1)}this.replaces=void 0}if(r){const i=r.parent;if(!i)throw new Error("parent not defined");i.children.push(r),r.closed=t!==void 0,r.endTagStart=e,r.end=o,r.content=this.text.substring(r.startTagEnd,e),this.node=void 0}}},jg=class{constructor(e){k(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=vL(e,void 0,void 0,!0),r=new Tt(0,e.length,[],void 0);r.type=I.ROOT;let o=r,i=-1,s,a=null,l=n.scan();const c=()=>{if(!o.tag){const p=o.parent.children,v=p[p.length-2],w=e.substring(o.start,o.end);v?.type===I.HTML?(v.content=(v.content||"")+w,v.end=o.end,p.splice(p.length-1,1)):(o.type=I.HTML,o.content=w,o.children=[]),o.type=I.HTML}o=o.parent},u=new Ug(e,I.COMMENT),d=new Ug(e,I.DOCTYPE),f=p=>{o.children.push(p)},h=(p,v)=>{const w=new Tt(p,v,[],o);w.type=I.HTML,w.content=e.substring(p,v),f(w)};for(;l!==Ct.EOS;){switch(l){case Ct.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case Ct.EndDoctypeTag:{const A=o.lastChild,b=d.node;if(!b)throw new Error("");const g=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(g!==b.start){const E=e.substring(g,b.start);if(E){const T=new Tt(g,b.start,[],o);T.type=I.HTML,T.content=E,f(T)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case Ct.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case Ct.EndCommentTag:{const A=o.lastChild,b=u.node;if(!b)throw new Error("");const g=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(g!==b.start){const E=e.substring(g,b.start);if(E){const T=new Tt(g,b.start,[],o);T.type=I.HTML,T.content=E,f(T)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case Ct.StartTagOpen:const p=o.lastChild,v=new Tt(n.getTokenOffset(),e.length,[],o),w=p?p.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(w!==v.start){const A=e.substring(w,v.start);if(A){const b=new Tt(w,v.start,[],o);b.type=I.HTML,b.content=A,f(b)}}f(v),o=v;break;case Ct.BogusComment:{const A=o.lastChild?.end??o.startTagEnd??o.start;A<n.getTokenOffset()&&h(A,n.getTokenOffset()),h(n.getTokenOffset(),n.getTokenEnd());break}case Ct.StartTag:o.tag=n.getTokenText();break;case Ct.StartTagClose:o.parent&&(o.end=n.getTokenEnd(),n.getTokenLength()?(o.startTagEnd=n.getTokenEnd(),o.tag&&this.dataManager.isVoidElement(o.tag)&&(o.closed=!0,c())):c());break;case Ct.StartTagSelfClose:o.parent&&(o.closed=!0,o.end=n.getTokenEnd(),o.startTagEnd=n.getTokenEnd(),c());break;case Ct.EndTagOpen:i=n.getTokenOffset(),s=void 0;break;case Ct.EndTag:s=n.getTokenText().toLowerCase();break;case Ct.EndTagClose:let _=o;for(;!_.isSameTag(s)&&_.parent;)_=_.parent;if(_.parent){const A=o.lastChild,b=A?A.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(b!==i){const g=e.substring(b,i);if(g){const E=new Tt(b,i,[],o);E.type=I.HTML,E.content=g,f(E)}}for(;o!==_;)o.end=i,o.closed=!1,c();o.closed=!0,o.endTagStart=i,o.end=n.getTokenEnd(),c()}break;case Ct.AttributeName:{a=n.getTokenText();let A=o.attributes;A||(o.attributes=A={}),A[a]=null;break}case Ct.AttributeValue:{const A=n.getTokenText(),b=o.attributes;b&&a&&(b[a]=NL(A),a=null);break}}l=n.scan()}for(;o.parent;)o.end=e.length,o.closed=!1,c();u.hasNode,u.finish(e.length);const m=r.lastChild?.end||0;if(m<e.length){const p=e.substring(m);if(p){const v=new Tt(m,e.length,[],r);v.type=I.HTML,v.content=p,f(v)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},tne=new jg(new Mg(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),xL=new Mg(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),OL=new jg(xL);function hn(e){return OL.parse(e)}var md=Symbol("bogusCommentSource");function wr(e){if(e){const t=document.createElement("div");t.insertAdjacentHTML("afterbegin",e);const n=t.firstChild??document.createTextNode("");return n.nodeType===Node.COMMENT_NODE&&RL(n,e),n}else return document.createTextNode("")}function RL(e,t){const n={source:t,data:e.data};Object.defineProperty(e,md,{value:n,configurable:!0})}function Zi(e){const t=e[md];return t&&t.data===e.data?t:void 0}function Ka(e){return Zi(e)?.source}function Vg(e,t){if(e.nodeType===Node.COMMENT_NODE){t.push(e);return}(e.nodeName==="TEMPLATE"?e.content:e).childNodes.forEach(n=>Vg(n,t))}function Ya(...e){const t=[];return e.forEach(n=>Vg(n,t)),t}function ML(e,t){return e.data===t.data&&(e.parent===void 0||t.parent===void 0||e.parent===t.parent)}function Gg(e,t){Zi(e)||Object.defineProperty(e,md,{value:t,configurable:!0})}function PL(e){const t=new Map,n=new Set;for(const{data:r,mark:o}of e){const i=t.get(r);!o||i&&i.source!==o.source?n.add(r):i||t.set(r,o)}return n.forEach(r=>t.delete(r)),t}function IL(e,t,n){if(!t.length||!e.some(o=>o.mark))return;const r=[];for(let o=0;o+t.length<=e.length;o++)n.every((i,s)=>ML(e[o+s],i))&&r.push(o);if(!r.length){const o=PL(e);t.forEach(i=>{const s=o.get(i.data);s&&Gg(i,s)});return}t.forEach((o,i)=>{const s=r.map(l=>e[l+i].mark),[a]=s;a&&s.every(l=>l?.source===a.source)&&Gg(o,a)})}function Xg(e,t){const n=e.parentNode,r=n&&n.nodeType===Node.ELEMENT_NODE&&!t.includes(n);return{data:e.data,mark:Zi(e),parent:r?n.nodeName.toLowerCase():void 0}}function Kg(e,t,n){const r=Ya(...t),o=n?[...t,n]:t;IL(e,r,r.map(i=>Xg(i,o)))}function nn(e,t){Kg(Ya(e).map(n=>Xg(n,[e])),[t],null)}var DL=/<[!?]|<\/[^a-zA-Z]/,BL=/^<[!?/]/;function HL(e){const t=[],n=r=>{const o=r.parent?.tag?.toLowerCase();if(r.type===I.COMMENT)t.push({data:r.content??"",mark:void 0,parent:o});else if(r.type===I.HTML&&r.content&&BL.test(r.content)){const i=wr(r.content);i.nodeType===Node.COMMENT_NODE&&t.push({data:i.data,mark:Zi(i),parent:o})}r.children.forEach(n)};try{hn(e).roots.forEach(n)}catch{return[]}return t}function Yg(e,t,n=null){DL.test(t)&&Kg(HL(t),e,n)}function hd(e,t){Yg([e],t)}var Qi="",FL=4,Zg=0;function $L(){return Zg+=1,`${Math.random().toString(36).slice(2)}${Zg.toString(36)}`}function WL(e,t,n){if(e.split(`${Qi}${t}:`).length-1!==n.length)return;const r=e.split(new RegExp(`<!--${Qi}${t}:(\\d+)${Qi}-->`)),o=r.filter((i,s)=>s%2===1).map(Number);if(!(o.length!==n.length||new Set(o).size!==n.length||o.some(i=>i>=n.length)))return r.map((i,s)=>s%2?n[Number(i)]:i).join("")}function Za(e,t,n){const r=Ya(e),o=r.map(l=>Zi(l)?.source);if(o.every(l=>l===void 0))return t?e.outerHTML:e.innerHTML;const i=n?e:e.cloneNode(!0),s=n?r:Ya(i),a=r.map(l=>l.data);for(let l=0;l<FL;l++){const c=$L(),u=[];s.forEach((f,h)=>{const m=o[h];m!==void 0&&(f.data=`${Qi}${c}:${u.length}${Qi}`,u.push(m))});const d=WL(t?i.outerHTML:i.innerHTML,c,u);if(d!==void 0)return d}return s.forEach((l,c)=>{l.data=a[c]}),t?i.outerHTML:i.innerHTML}function _r(e){return Za(e,!0,!1)}function Ke(e){return Za(e,!1,!1)}function Qg(e){return Za(e,!0,!0)}function qL(e){return Za(e,!1,!0)}function ke(e,t){e.innerHTML=t,hd(e,t)}function jt(e,t){ke(e,Ke(t))}function pd(e){Ji(e,Ke(e))}function Ji(e,t){const n=e.parentNode,r=e.previousSibling,o=e.nextSibling;if(e.outerHTML=t,!n)return;const i=[];for(let s=r?r.nextSibling:n.firstChild;s&&s!==o;s=s.nextSibling)i.push(s);Yg(i,t,n)}var Jg=new Set(["text/x-handlebars-template","text/html"]);function Qa(e,t){if(e.type!==I.HTML||!t)return!1;const n=t.tag?.toLowerCase(),r=t.attributes?.type;return n==="style"||n==="script"&&!Jg.has(typeof r=="string"?r:"")}var zL={amp:"&",lt:"<",gt:">",nbsp:String.fromCodePoint(160),quot:'"'};function gd(e){return e.replaceAll(/&(amp|lt|gt|nbsp|quot);/g,(t,n)=>zL[n])}var eb=Symbol("rawTextSource");function bd(e){const t=document.createTextNode(gd(e));return tb(t,e),t}function tb(e,t){Object.defineProperty(e,eb,{value:t,configurable:!0})}function UL(e,t){e.data=gd(t),tb(e,t)}function nb(e){const t=e[eb];return t!==void 0&&gd(t)===e.textContent?t:void 0}var Mo,Jr;function rb(e){const t=Mo;return Mo=e,()=>{Mo===e&&(Mo=t)}}function jL(e){const t=Jr;return Jr=e,()=>{Jr===e&&(Jr=t)}}function ob(e,t,n){return Mo?Mo(e,t,n):n}function VL(){return Jr!==void 0}function ib(e,t,n){return Jr?Jr(e,t,n):n}var yd;function GL(){return yd||(yd=document.implementation.createHTMLDocument("")),yd}function XL(e,t){let n;switch(t?.toLowerCase()){case"tr":n=e.createElement("table");break;case"td":n=e.createElement("tr");break;case"head":case"body":n=e.createElement("html");break;case"documenttype":case"html":{const r=e.implementation.createHTMLDocument();for(const o of[...r.childNodes])o.remove();return r}default:n=e.createElement("div")}return n}var KL=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),YL=new Set(["script","style","xmp"]);function ZL(e,t){return!(t&&YL.has(t.toLowerCase())||KL.has(e.toLowerCase()))}var QL=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},JL=new Set(["head","body"]);function sb(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=GL(),s=JL.has(r)?XL(i,r):i.createElement("template");if(s instanceof Document)return;s.innerHTML=o;const a=(s.tagName==="TEMPLATE"?s.content:s).querySelector(r);if(!a)throw new Error("targetElement is not defined");const l=a.getAttributeNode(t);l&&e.setAttributeNode(l.cloneNode())}function er(e,t,n){try{ZL(t,e.tagName)&&!QL(n)?e.setAttribute(t,n):sb(e,t,n)}catch{sb(e,t,n)}}function ab(){return wr("<script><\/script>")}var eN="text/x-em-dormant",es=Symbol("dormantScriptType");function vd(e){e[es]=e.getAttribute("type"),e.setAttribute("type",eN)}function Ja(e){return es in e}function tN(e){const t=[...e].filter(n=>!Ja(n));return t.forEach(vd),t}function nN(e,t){return Ja(e)?(e[es]=t,!0):!1}function lb(e){const t=new Set;for(const n of e){const r="querySelectorAll"in n?n.querySelectorAll("script"):[];for(const o of[n,...r])Ja(o)&&t.add(o)}return[...t]}function cb(e){if(!Ja(e))return;const t=e[es];delete e[es],typeof t=="string"?e.setAttribute("type",t):e.removeAttribute("type")}var rN=["application/ecmascript","application/javascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript"];function oN(e){const t=e.getAttribute("type"),n=e.getAttribute("language");return t===""||t===null&&!n?"text/javascript":(t===null?`text/${n}`:t.trim()).toLowerCase()}function ub(e){const t=oN(e);return rN.includes(t)?"classic":t==="module"||t==="importmap"||t==="speculationrules"?t:void 0}function iN(e){return ub(e)==="classic"}function sN(e){const t=e.getAttribute("for"),n=e.getAttribute("event");return t===null||n===null?!0:t.trim().toLowerCase()==="window"&&["onload","onload()"].includes(n.trim().toLowerCase())}function aN(e){const t=ub(e);return!t||t==="speculationrules"||el(e)?!1:t!=="classic"||!e.hasAttribute("nomodule")&&sN(e)}function lN(e){return e.hasAttribute("src")&&!["async","defer","nomodule"].some(t=>e.hasAttribute(t))&&iN(e)}function el(e){for(let t=e.parentElement;t;t=t.parentElement)if(t.localName==="template"&&t.namespaceURI==="http://www.w3.org/1999/xhtml")return!0;return!1}function db(e,t){const n=e.parentNode;!n||!e.isConnected||(e.hasAttribute("src")&&!e.hasAttribute("async")&&(e.async=!1),t.run(e,()=>n.insertBefore(e,e.nextSibling)))}function fb(e,t){[...t.attributes].forEach(r=>t.removeAttributeNode(r)),[...e.attributes].forEach(r=>t.setAttributeNode(r.cloneNode()));const n=Object.getOwnPropertyDescriptor(e,"$$tagName");n&&!Object.getOwnPropertyDescriptor(t,"$$tagName")&&Object.defineProperty(t,"$$tagName",n)}function mb(e,t,n){e.replaceWith(t),t.append(...e.childNodes),n.substitute?.(e,t)}function hb(e,t){const n=ab();return fb(e,n),t.quiet(()=>mb(e,n,t)),n}function cN(e,t,n){const r=hb(t,n),o=()=>{e.removeEventListener("load",o),e.removeEventListener("error",o),r.isConnected&&(n.quiet(()=>{fb(r,t),vd(t),mb(r,t,n),cb(t)}),db(t,n))};e.addEventListener("load",o),e.addEventListener("error",o)}function pb(e,t){e.forEach(cb);const n=e.filter(el),r=e.filter(i=>i.isConnected&&!el(i));if(!r.length&&!n.length)return;r.sort((i,s)=>i.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t.awake?.(),n.forEach(i=>hb(i,t));let o;for(const i of r)o&&!i.hasAttribute("src")?cN(o,i,t):(db(i,t),o=lN(i)?i:o)}function eo(e,t=!0,n=!1){const r=e.content;switch(e.type){case I.ROOT:{const o=document.implementation.createHTMLDocument();for(const i of[...o.childNodes])o.removeChild(i);if(t)for(const i of e.children)o.appendChild(eo(i,!0,n));return o}case I.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case I.COMMENT:return document.createComment(r||"");case I.ELEMENT:if(e.tag){const o=e.tag.toLowerCase()==="script",i=n===!0&&o?ab():document.createElement(e.tag);if(Object.defineProperty(i,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const s of e.attributeNames){const a=e.attributes[s];try{const l=ob(i,s,typeof a=="string"?a:"");l!==null&&er(i,s,l)}catch{}}if(n==="dormant"&&o&&vd(i),t){const s=e.tag.toLowerCase()==="template"?!0:n;for(const a of e.children)i.appendChild(Qa(a,e)?bd(a.content||""):eo(a,!0,s))}return i}return document.createTextNode("<");case I.HTML:return wr(r||"");default:throw new Error("unsupported node")}}function Le(e,t=!1){return hn(e).roots.map(n=>eo(n,!0,t))}function tl(e,t,n){switch(t){case"afterend":e.after(...n);break;case"afterbegin":e.prepend(...n);break;case"beforeend":e.append(...n);break;case"beforebegin":e.before(...n)}}function gb(e,t){e.replaceChildren(...Le(t,!0))}function tr(e,t,n){tl(e,t,Le(n,!0))}var bb=Symbol.for("emailmaker.documentWriteGuard"),ts=Symbol.for("emailmaker.documentWriteSink");function uN(e,t=document){const n=t,r=n[ts];return n[ts]=e,()=>{n[ts]===e&&(n[ts]=r)}}function nne(e){}function Ed(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0})}function dN(e,t,n){for(let r=e.writerOf.get(t);r;r=e.writerOf.get(r))if(r===n)return!0;return!1}function fN(e,t){let n=t;for(;n.nextSibling&&dN(e,n.nextSibling,t);)n=n.nextSibling;return n}function yb(e,t,n){if(!n.length)return;n.forEach(i=>e.writerOf.set(i,t));const r=()=>{for(const i of n){const s=t.parentNode;if(!s)return;s.insertBefore(i,fN(e,t).nextSibling)}},o=e.doc[ts];o?o(n,r,t):r()}function vb(e,t){return!!e&&e.type===I.ELEMENT&&!e.closed&&e.end===t}function mN(e,t){let n="";for(let r=e;vb(r,t);r=r.lastChild)n=`</${r.tag}>${n}`;return n}function hN(e){const t=hn(e).roots,n=t[t.length-1],r=vb(n,e.length);return{nodes:(r?t.slice(0,-1):t).map(o=>eo(o)),rest:r?e.slice(n.start):""}}function pN(e){const t=[...e.pending];e.pending.clear();for(const[n,r]of t){const o=hn(r).roots,i=r+mN(o[o.length-1],r.length);yb(e,n,hn(i).roots.map(s=>eo(s)))}}function Eb(e,t,n){const r=e.doc.currentScript;if(!r?.parentNode){return}const{nodes:o,rest:i}=hN((e.pending.get(r)??"")+n);i?(e.pending.size||queueMicrotask(()=>pN(e)),e.pending.set(r,i)):e.pending.delete(r),yb(e,r,o)}function gN(e=document){const t=e;if(t[bb])return;t[bb]=!0;const n={doc:t,writerOf:new WeakMap,pending:new Map};Ed(e,"write",(...r)=>Eb(n,"write",r.join(""))),Ed(e,"writeln",(...r)=>Eb(n,"writeln",`${r.join("")}
|
|
2
|
+
`)),Ed(e,"open",(...r)=>r.length>=3?e.defaultView?.open(r[0],r[1],r[2])??null:e)}gN();function bN(e){return e}var yN=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),k(this,"cycle",void 0),this.cycle=e}};function vN(e){const t=new Map;for(const n of e)for(const r of n.provides??[]){const o=t.get(r)??[];o.push(n),t.set(r,o)}return t}function EN(e,t){const n=[];for(const r of e.awaits?.services??[])for(const o of t.get(r)??[])o!==e&&n.push(o);return n}function SN(e){const t=vN(e),n=[],r=new Set,o=[],i=new Set,s=a=>{if(!r.has(a)){if(i.has(a)){const l=o.indexOf(a);throw new yN([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of EN(a,t))s(l);o.pop(),i.delete(a),r.add(a),n.push(a)}};for(const a of e)s(a);return n}var Ee=class Zk{constructor(t=[]){k(this,"_inner",void 0),k(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof Zk&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(t){this.addDisposable({dispose:t})}removeDisposable(t){const n=this._inner.indexOf(t);n>=0&&this._inner.splice(n,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const t of[...this._inner])t.dispose()}}};function Sd(e){return`service_container_${e}`}var ns=new Set,wd;function wN(){if(!wd)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,Sb.prototype.getInstanceAsync),e.stack}function _d(e){ns.delete(e)&&wd?.end(e)}var Sb=class Ag extends Ee{_runCallbacks(t){[...this._injectCallbacks].forEach(n=>n(t))}constructor(t=null){super(),k(this,"_parent",void 0),k(this,"_injectCallbacks",[]),k(this,"_injections",Object.create(null)),k(this,"onInject",n=>(this._injectCallbacks.push(n),{dispose:()=>{const r=this._injectCallbacks.indexOf(n);r>=0&&this._injectCallbacks.splice(r,1)}})),this._parent=t,t&&this.addDisposable(t.onInject(n=>this._runCallbacks(n)))}inject(t,n){this._injections[t]=()=>n,this._runCallbacks(t)}injectFactory(t,n,r){const o=this._injections[t];let i=typeof o=="function"?o():o;const s=this._injections[t]=()=>(i=n(this,i),i);r&&s(),this._runCallbacks(t)}_find(t,n=!0){return this._injections[t]||n&&this._parent?._find(t)}_onInject(t,n,r=new Ee){return r.addDisposable(this.onInject(o=>{t===o&&!r.isDisposed()&&(r.dispose(),n(this.getInstance(o)))})),this._parent&&r.addDisposable(this._parent._onInject(t,n,r)),this.addDisposable(r),r}getInstance(t,n=!0){const r=this._find(t,n);if(typeof r=="function")return r()}getOrCreateInstance(t,n){const r=this._find(t);if(typeof r=="function")return r();const o=n(this);return this.inject(t,o),o}getInstanceAsync(t){const n=this._find(t);if(typeof n=="function")return Promise.resolve(n());const r=wN();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};ns.add(s),wd?.start(s),this._onInject(t,()=>{_d(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(ns))n.container===this&&(_d(n),n.reject(t))}pendingWaits(){return[...ns].filter(t=>t.container===this)}addService(t,n){const r=Sd(t);this.injectFactory(r,(i,s=[])=>s.indexOf(n)<0?[...s,n]:s);const o=new Ee;return o.addDispose(()=>{this.injectFactory(r,(i,s=[])=>s.filter(a=>a!==n))}),o}addServiceFactory(t,n,r){const o=Sd(t);let i;this.injectFactory(o,(a,l=[])=>(i=n(a,i),i===void 0?l:l.indexOf(i)<0?[...l,i]:l),r);const s=new Ee;return s.addDispose(()=>{this.injectFactory(o,(a,l=[])=>i===void 0?l:l.filter(c=>c!==i))}),s}getServices(t){const n=Sd(t);return[...this.getInstance(n,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new Ag(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const n=this._parent?.getOrCreateIsolatedContainer(t);return new Ag(n)})}remove(t){const n=this._injections;delete n[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(ns))t.container===this&&_d(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function Cd(e){return e.startsWith("__")?e:`__${e}__`}function _N(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=Cd(e),n=globalThis;return n[t]??(n[t]={})}function CN(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function TN(e){if(e)return Cd(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return Cd(t)}function Td(e){const t=TN(e),n=_N(t);if(CN(n.container))return n.container;const r=new Sb(null);return n.container=r,r}function AN(){let e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n==="x"?r:r&3|8).toString(16)})}function kN(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():AN()}function se(e=kN()){return e}function wb(){return"iframe".trim()||"unknown"}function LN(e){if(typeof globalThis>"u")return;const t=wb(),n=globalThis[e]??{};globalThis[e]=n;const r=n.__diagnostics??(n.__diagnostics={}),o=r.diModuleEval??(r.diModuleEval={evalCount:0,records:[]});o.records.push({buildSource:t,timestamp:Date.now(),stack:new Error().stack}),o.evalCount+=1}function NN(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function xN(e,t){if(LN(t),typeof globalThis>"u")return e;const n=wb(),r=globalThis,o=r[t]=r[t]||{},i=o.__diagnostics=o.__diagnostics||{},s=i.dependencyResolver=i.dependencyResolver||{entries:[]},a={container:e,source:"packages/runtime-core/di/index.ts",buildSource:n,timestamp:Date.now(),stack:new Error().stack};return s.entries.push(a),e}var nl;function ON(){if(nl)return nl;const e=NN();return nl=xN(Td(e),e),nl}var rne=new Proxy({},{get(e,t,n){const r=ON(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),RN=new Function("url","return import(url)");function MN(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function Ad(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function _b(e){return e.type==="umd"||e.resolve==="registry"}var PN="If the plugin is built on globals, enable the compatibility layer: the `compatGlobals` option of the bundler plugin or `import '<package>/compat-globals'` before creating the editor.";function IN(e){const t=Array.isArray(e)?e[0]:e;return Ad(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function DN(e,t){const n=IN(e),r=Ad(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&_b(r)&&!/compat/iu.test(o)?` ${PN}`:"",s=new Error(`Plugin "${n}" was skipped: it failed to load. ${o}${i}`);return s.cause=t,{name:n,url:r?.url,error:s}}function BN(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function one(e){return e}var HN=class{constructor(e,t,n={}){k(this,"_context",void 0),k(this,"_pluginRegistry",void 0),k(this,"_options",void 0),k(this,"_map",new Map),k(this,"_optionsMap",new Map),k(this,"_readyMap",new Map),k(this,"_resolveMap",new Map),k(this,"_initializingPlugins",new Map),k(this,"_creatingPlugins",new Set),k(this,"_initializedPlugins",new Set),k(this,"_creationOrder",[]),k(this,"_lifecycleListeners",new Set),k(this,"_activated",!1),this._context=e,this._pluginRegistry=t,this._options=n}activate(){return this._activated=!0,this._startPluginsBatch(Array.from(this._map.values()))}activateSync(){this._activated=!0,this._startPluginsBatch(Array.from(this._map.values()))}onLifecycle(e){return this._lifecycleListeners.add(e),{dispose:()=>this._lifecycleListeners.delete(e)}}_emitLifecycle(e){for(const t of Array.from(this._lifecycleListeners))try{t(e)}catch{}}async _resolveEntry(e){if(typeof e=="string"||typeof e=="symbol"){const t=await this._pluginRegistry.getAsync(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered.`);return{ctor:t}}if(typeof e=="function")return e.length===0?{ctor:await e()}:{ctor:e};if(Array.isArray(e)){const[t,n]=e;if(typeof t=="function")return{ctor:t,options:n};const r=await this._pluginRegistry.getAsync(t);if(!r)throw new Error(`Plugin "${String(t)}" not registered.`);return{ctor:r,options:n}}if(Ad(e))return this._resolveDescriptor(e);throw new Error(`Unknown plugin entry format: ${JSON.stringify(e)}`)}async _resolveDescriptor(e){const t=e.resolve??(e.type==="umd"?"window":"module");if(_b(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await RN(e.url);if(t==="module")return{ctor:n.default??n};if(t==="registry"&&e.name){const r=await this._pluginRegistry.getAsync(e.name);if(!r)throw new Error(`Plugin "${e.name}" not found in registry after ESM load`);return{ctor:r}}}if(e.type==="umd"){if(await this._loadScript(e.url),t==="window"&&e.name){const n=globalThis[e.name];if(!n)throw new Error(`Plugin "${e.name}" not found on window after script load`);return{ctor:n}}if(t==="registry"&&e.name){const n=await this._pluginRegistry.getAsync(e.name);if(!n)throw new Error(`Plugin "${e.name}" not found in registry after script load`);return{ctor:n}}}throw new Error(`Cannot resolve descriptor: type=${e.type}, resolve=${t}, name=${e.name??"none"}`)}_loadScript(e){return new Promise((t,n)=>{if(typeof document>"u"){n(new Error("Cannot load UMD script in non-browser environment"));return}const r=document.createElement("script");r.src=e,this._options.explainScriptFailure?.();let o;const i=a=>{o||(a.filename===r.src?o=this._scriptExecutionError(e,a.error??a.message):BN(a)&&(o=this._scriptExecutionError(e,this._options.explainScriptFailure?.()??a.message)))},s=()=>window.removeEventListener("error",i);window.addEventListener("error",i),r.onload=()=>{if(s(),o){n(o);return}t()},r.onerror=()=>{s(),n(new Error(`Failed to load script: ${e}`))},document.head.appendChild(r)})}_scriptExecutionError(e,t){const n=t instanceof Error?t.message:String(t),r=new Error(`Plugin script "${e}" threw while executing: ${n}`);return r.cause=t,r}initSync(e){const t=[];for(const n of e){const r=this._createOrSkip(n,void 0);r&&t.push(r)}this._activated=!0,this._startPluginsBatch(t)}async init(e){const t=[],n=new Set;for(const r of e){const o=await this._resolveOrSkip(r);if(!o)continue;const i=this._createOrSkip(o.ctor,o.options);i&&!n.has(i)&&(n.add(i),t.push(i))}this._activated=!0,await this._startPluginsBatch(t)}async setPlugins(e){const t=new Set,n=[];for(const s of e){const a=await this._resolveOrSkip(s);a&&(t.add(a.ctor),n.push(a))}const r=[];this._map.forEach((s,a)=>{t.has(a)||r.push({key:a,plugin:s})});for(let s=r.length-1;s>=0;s--){const{key:a,plugin:l}=r[s];await this._initializingPlugins.get(l),await this._disposePlugin(l,l.constructor.name),this._map.delete(a),this._optionsMap.delete(a),this._readyMap.delete(l),this._resolveMap.delete(l),this._initializingPlugins.delete(l),this._initializedPlugins.delete(l);const c=this._creationOrder.indexOf(l);c>=0&&this._creationOrder.splice(c,1)}const o=[],i=new Set;for(const{ctor:s,options:a}of n){const l=this._createOrSkip(s,a);l&&!i.has(l)&&(i.add(l),o.push(l))}this._activated&&await this._startPluginsBatch(o)}isReady(e){return this._initializedPlugins.has(e)}ready(e){return this._initializingPlugins.get(e)??this._readyMap.get(e)??Promise.resolve()}async waitFor(e,t){if(this._pluginRegistry.has(e))return this.useByKeyAsync(e);const{timeout:n}=t??{};return await new Promise((r,o)=>{let i,s=!1;const a=()=>{s||(s=!0,i&&clearTimeout(i),this._pluginRegistry.off(e,a),r())};this._pluginRegistry.on(e,a),n!==void 0&&n>0&&(i=setTimeout(()=>{s||(s=!0,this._pluginRegistry.off(e,a),o(new Error(`waitFor("${String(e)}") timed out after ${n}ms`)))},n))}),this.useByKeyAsync(e)}useByKey(e){const t=this._pluginRegistry.get(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered or not loaded yet. Use useByKeyAsync() for async plugins.`);const n=this._getOrCreate(t);return this._activated&&this._startPluginsBatch([n]),n}async useByKeyAsync(e){const t=await this._pluginRegistry.getAsync(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered.`);const n=this._getOrCreate(t);return this._activated&&await this._startPluginsBatch([n]),n}useByCtor(e,t){const n=this._getOrCreate(e,t);return this._activated&&this._startPluginsBatch([n]),n}use(e){return typeof e=="function"?this.useByCtor(e):this.useByKey(e)}async useAsync(e){const{ctor:t,options:n}=await this._resolveEntry(e),r=this._getOrCreate(t,n);return this._activated&&await this._startPluginsBatch([r]),r}_getOrCreate(e,t){const n=e;if(!this._map.has(n)){t!==void 0&&this._optionsMap.set(n,t);const r=this._optionsMap.get(n),o=this._createPluginInstance(e,r),i=o.constructor.name;this._emitLifecycle({type:"created",plugin:o,name:i}),o.required?.(),this._map.set(n,o),this._creationOrder.push(o),this._setupReadyPromise(o)}return this._map.get(n)}async _resolveOrSkip(e){try{return await this._resolveEntry(e)}catch(t){const n=DN(e,t);try{this._options.reportLoadFailure?.(n)}catch{}return}}_createOrSkip(e,t){try{return this._getOrCreate(e,t)}catch(n){const r=e.name||"anonymous plugin";this._emitLifecycle({type:"create:error",ctor:e,name:r,error:n});return}}_createPluginInstance(e,t){const n=e;if(this._creatingPlugins.has(n))throw new Error(`Cyclic dependency for plugin ${e.name}`);this._creatingPlugins.add(n);const r=this._options.openEarlyWindow?.();try{return MN(e)?new e(this._context,t):e(this._context,t)||{}}finally{r?.(),this._creatingPlugins.delete(n)}}_setupReadyPromise(e){const t=new Promise(n=>{this._resolveMap.set(e,n)});this._readyMap.set(e,t)}async _startPluginsBatch(e){const t=Array.from(new Set(e)),n=new Set,r=[];for(const o of t){if(this._initializedPlugins.has(o))continue;const i=this._initializingPlugins.get(o);if(i){n.add(i);continue}r.push(o)}if(r.length>0){const o=this._runBatchLifecycle(r);for(const i of r)this._initializingPlugins.set(i,o);n.add(o),o.finally(()=>{for(const i of r)this._initializingPlugins.get(i)===o&&this._initializingPlugins.delete(i)})}await Promise.all(n)}async _runBatchLifecycle(e){const t=[];for(const n of e){const r=n.constructor.name;this._emitLifecycle({type:"init:start",plugin:n,name:r});const o=this._options.openEarlyWindow?.();try{await this._callSync(n,r,"init"),this._emitLifecycle({type:"init:success",plugin:n,name:r}),t.push(n)}catch(i){this._emitLifecycle({type:"init:error",plugin:n,name:r,error:i})}finally{o?.()}}for(const n of t){const r=n.constructor.name;this._emitLifecycle({type:"afterInit:start",plugin:n,name:r});try{await this._callSync(n,r,"afterInit"),this._emitLifecycle({type:"afterInit:success",plugin:n,name:r})}catch(o){this._emitLifecycle({type:"afterInit:error",plugin:n,name:r,error:o})}}for(const n of e)this._initializedPlugins.add(n),this._resolveMap.get(n)?.(),this._resolveMap.delete(n)}_callSync(e,t,n){this._emitLifecycle({type:`${n}:enter`,plugin:e,name:t});try{return e[n]?.()}finally{this._emitLifecycle({type:`${n}:leave`,plugin:e,name:t})}}async _disposePlugin(e,t){this._emitLifecycle({type:"dispose:start",plugin:e,name:t});try{await e.dispose?.(),this._emitLifecycle({type:"dispose:success",plugin:e,name:t})}catch(n){this._emitLifecycle({type:"dispose:error",plugin:e,name:t,error:n})}}async dispose(){for(let e=this._creationOrder.length-1;e>=0;e--){const t=this._creationOrder[e];await this._initializingPlugins.get(t),await this._disposePlugin(t,t.constructor.name)}this._map.clear(),this._optionsMap.clear(),this._readyMap.clear(),this._resolveMap.clear(),this._initializingPlugins.clear(),this._initializedPlugins.clear(),this._creationOrder.length=0,this._lifecycleListeners.clear()}getStatus(){return Array.from(this._map.values()).map(e=>({name:e.constructor.name,initialized:this._initializedPlugins.has(e)}))}},Cb=class{constructor(){k(this,"_plugins",new Map),k(this,"_listeners",new Map)}_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){const n=this._plugins.get(e);if(n?.overrides)for(const r of n.overrides)t=r(t)||t;return t}_notifyListeners(e,t){const n=this._listeners.get(e);if(!n||n.length===0)return;for(const o of n)try{o.callback(t)}catch{}const r=n.filter(o=>!o.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){const t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){const t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){const n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){const n=Promise.resolve(t.factory()).then(o=>(t.ctor=o,t.loading=void 0,this._notifyListeners(e,o),o));t.loading=n;const r=await n;return this._applyOverrides(e,r)}return new Promise(n=>{this.on(e,r=>n(this._applyOverrides(e,r)))})}add(e,t){const n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(const t of Object.keys(e)){const n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){const n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){const t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){const n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{const r=n.overrides.indexOf(t);r>=0&&n.overrides.splice(r,1)}}}on(e,t){const n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));const o={callback:t,once:!1};return r.push(o),{dispose:()=>this._removeListener(e,t)}}once(e,t){const n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));const o={callback:t,once:!0};return r.push(o),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){const n=this._listeners.get(e);if(n){const r=n.findIndex(o=>o.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){const e=this;return{add(t,n){e.add(t,n)}}}},FN=class{constructor(e){k(this,"resolveRegistry",void 0),this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},X=se("SandboxHtmlDocument"),ot=se("SandboxRemoteDocument"),rs=se("SandboxTextDocument"),pn=se("SandboxDocumentMapping"),Te=se("SandboxSyncCommit"),os=se("SandboxLayoutProfile"),Tb=se("SandboxState"),Ne=se("SandboxSelectionLock"),Ye=se("SandboxEditLock"),Po=se("SandboxAttributePipeline"),kd=se("SandboxAmpService"),Ld=se("SandboxImageReload"),rl=se("SandboxImageCache"),it=se("SandboxFocus"),Nd=se("SandboxLocalization"),Ie=se("SandboxElementSettings"),Io=se("SandboxElementRefs"),yt=se("SandboxSetCursor"),Ab=se("SandboxStyleRoot"),kb=se("SandboxVmlWidthResolver"),ol=se("SandboxPrepareHtml"),is=se("SandboxSurfaceName"),Do=se("SandboxDocumentSync"),Bo=se("SandboxMapObj"),Ho=se("SandboxActiveElementFingerprint"),il=se("SandboxToggleTextStyle"),gn=se("SandboxWrapEditor"),Cr=se("SandboxInsertServices"),ss=se("SandboxInitPreview"),xd=se("SandboxInsertPolicy"),Fo=se("SandboxTableSelections"),Lb=se("SandboxNarrowTableTextAtom"),Nb=se("SandboxSettingsExtras"),xb=se("SandboxViewportHandlers"),Ob=se("SandboxOperations"),$o=se("SandboxApplyElementSettings"),Tr=se("SandboxOperationEnvironment"),Wo=se("SandboxHostFacts"),$N="__sandbox__",Mt=Td($N);function WN(e){return e}function qN(e,t=Mt){t.inject(is,e.name),t.inject(os,e.profile);for(const n of SN(e.units))n.setup(t);return t}function bn(e,t){e.remove?.(t)}function O(e,t){const n=e.getInstance(t);if(n===void 0)throw new Error(`[sandbox] служба «${String(t)}» не зарегистрирована: её фича не подключена или ещё не зарегистрирована`);return n}var Rb=class extends Ee{constructor(e={}){super(),k(this,"_options",void 0),k(this,"_listeners",[]),k(this,"on",this._addListener.bind(this)),k(this,"event",this._addListener.bind(this)),k(this,"once",(t,n=0,r)=>{const o=this._addListener((...i)=>(o?.dispose(),r?t.call(r,...i):t(...i)),n);return o}),k(this,"un",t=>{const n=this._listeners.findIndex(([r])=>r===t);n>=0&&(this._listeners.splice(n,1),this._listeners.length===0&&this._options.onLastListenerRemove&&this._options.onLastListenerRemove())}),this._options=e}getListeners(e){return this._listeners.flatMap(([t])=>typeof t=="function"?t:t.getListeners(e))}hasListeners(){for(const[e]of this._listeners){if(typeof e=="function")return!0;const t=e;if(typeof t.hasListeners=="function"){if(t.hasListeners())return!0;continue}return!0}return!1}_addListener(e,t=0,n){if(this.isDisposed())return{dispose:()=>{}};const r=this._listeners,o=this._options;n&&typeof e=="function"&&(e=e.bind(n));const i=r.findIndex(([,a])=>a<t),s=[e,t];return r.splice(i>=0?i:r.length,0,s),r.length===1&&o.onFirstListenerAdd&&o.onFirstListenerAdd(),{dispose:()=>{const a=r.indexOf(s);a>=0&&(r.splice(a,1),!r.length&&o.onLastListenerRemove&&o.onLastListenerRemove())}}}dispose(){this._listeners.splice(0,this._listeners.length),this._options.onLastListenerRemove&&this._options.onLastListenerRemove(),super.dispose()}},zN=class extends Rb{execute(e,t){for(const n of t)try{n(...e)}catch{}}fire(...e){if(!this.isDisposed()){const t=this.execute(e,this.getListeners(e));return t===void 0?void 0:t}}},ge=class extends zN{execute([e],t){for(const n of t)try{n(e)}catch{}}},UN=class extends Rb{fire(e){if(this.isDisposed())return;let t=!1,n=!1;const r={value:e,preventDefault(){t=!0},stopPropagation(){n=!0}},o=this.getListeners([r]);for(const i of o){if(n)break;try{i(r)}catch{}}return t?!1:void 0}};function jN(e,t,n){let r;const o=new ge({onFirstListenerAdd(){r=o.addDisposable(new Ee),r.addDisposable(e(i=>{t(i)!==!1&&o.fire(i)}))},onLastListenerRemove(){r?.dispose(),r=void 0}});return n?.addDisposable(o),o.event}function VN(e,t=window){return{peer:e,send(n){e.postMessage(n,"*")},subscribe(n){const r=o=>{n({data:o.data,source:o.source,ports:o.ports})};return t.addEventListener("message",r),{dispose:()=>t.removeEventListener("message",r)}},close(){}}}function GN(e){let t=!1;return{peer:e,send(n){e.postMessage(n)},subscribe(n){const r=o=>{n({data:o.data,source:e})};return e.addEventListener("message",r),t||(t=!0,e.start()),{dispose:()=>e.removeEventListener("message",r)}},close(){e.close()}}}function ine(e){return e}function XN(e){return e&&typeof e=="object"}function Mb(e,t){return e&&typeof e=="object"&&e.operationId===t}var Mn="INIT_MESSAGE",KN="em:port-ready",YN="em:window-drained",Od="";function Pb(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var ZN=class extends Ee{constructor(...e){super(...e),k(this,"_listeners",Object.create(null)),k(this,"addListenerAsync",(t,n,r=0,o)=>{const i=this._listeners[t]||(this._listeners[t]=[]);o&&typeof n=="function"&&(n=n.bind(o));const s=i.findIndex(([l,c])=>r<=c),a=[n,r];return this.isDisposed()||i.splice(s>=0?s:i.length,0,a),{dispose(){const l=i.indexOf(a);l>=0&&i.splice(l,1)}}}),k(this,"fireAsync",(t,n)=>{if(!this.isDisposed()){const r=this._listeners[t]||(this._listeners[t]=[]);let o;for(let i=0;i<r.length;i++){const s=r[i][0],a=o;o=l=>s(l,a)}if(o)return o(n)}}),k(this,"addListener",(t,n,r=0)=>this.addListenerAsync(t,(o,i)=>{try{n(o)}catch{}return i&&i(o)},r))}},QN=class extends Ee{constructor(e,t){super(),k(this,"_singleton",void 0),k(this,"_target",void 0),k(this,"_transport",void 0),k(this,"_transportSubscription",void 0),k(this,"_ports",new Map),k(this,"_drained",new WeakSet),k(this,"_portSendHeld",new WeakSet),k(this,"_inited",!1),k(this,"_emitter",this.addDisposable(new ZN)),k(this,"_handshaken",new WeakSet),k(this,"_greeted",new WeakSet),k(this,"_outgoingFilter",void 0),k(this,"_outgoingObservers",new Set),k(this,"_offTargetListeners",new Map),k(this,"_onTransportMessage",n=>{const r=n,o=r.data,i=r.source,s=o?.port===!0?r.ports?.[0]:void 0,a=!this._isPortSource(r.source);if(a&&i&&o?.operationId==="em:window-drained"){this._ports.has(i)&&this._drained.add(i);return}if(a&&i&&this._drained.has(i))return;if(i&&i!==this._target&&this._greeted.has(i)&&Mb(o,Mn)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:Mn,data:{}}),s&&this.usePort(s,!0,i);return}const l=r.source===this.target||this._isCurrentPort(r.source);if(l||this._notifyOffTarget(o?.operationId,r.source),XN(o)&&l||this._singleton&&Mb(o,Mn)){if(s&&l){const f=this._target;Promise.resolve().then(()=>this.usePort(s,!0,f))}const c=this._emitter.fireAsync(o.operationId||Od,o.operationId===void 0?r:o.data),u=o.result,d=o.error;u&&d&&Promise.resolve(c).then(f=>this._sendMessage(u,f),f=>this._sendMessage(d,f))}}),this._singleton=t,this._transport=VN({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(Mn,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(Mn))}),e&&this.setTarget(e)}setTarget(e){if(this._target!==e){if(this._target=e,!e){this._inited=!1;return}if(this._handshaken.has(e)){this._inited=!0,this._emitter.fireAsync(Mn,void 0);return}this._inited=!1,this._postMessage(e,{operationId:Mn,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:Mn,data:{},port:!0},[t])}observeOutgoing(e){return this._outgoingObservers.add(e),{dispose:()=>{this._outgoingObservers.delete(e)}}}_notifyOutgoing(e,t){for(const n of Array.from(this._outgoingObservers))try{n(e,t)}catch{}}addOffTargetListener(e,t){let n=this._offTargetListeners.get(e);return n||(n=new Set,this._offTargetListeners.set(e,n)),n.add(t),{dispose:()=>{n.delete(t)}}}_notifyOffTarget(e,t){const n=typeof e=="string"?this._offTargetListeners.get(e):void 0,r=n?.size?this._knownPeer(t):void 0;if(!(!n||!r))for(const o of Array.from(n))try{o(r)}catch{}}_knownPeer(e){for(const[n,r]of this._ports)if(r.transport.peer===e)return n;const t=e;return typeof e=="object"&&e!==null&&(this._handshaken.has(t)||this._greeted.has(t))?t:void 0}setOutgoingFilter(e){return this._outgoingFilter=e,()=>{this._outgoingFilter===e&&(this._outgoingFilter=void 0)}}sendNow(e){const t=this._target;return!this._inited||!t?!1:(this._postMessage(t,e),!0)}greet(e){this._handshaken.has(e)||this._greeted.has(e)||this._target===e||(this._greeted.add(e),this._postMessage(e,{operationId:Mn,data:{}}))}forget(e){this._handshaken.delete(e),this._greeted.delete(e),this._closePort(e),this._drained.delete(e),this._target===e&&(this._inited=!1)}usePort(e,t=!1,n=this._target){if(!n||this._ports.has(n))return;const r=GN(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:KN,data:{}}),this.drainWindow(n))}holdPort(e=this._target){!e||!this._ports.has(e)||(this._portSendHeld.add(e),this._drained.delete(e))}resumePort(e=this._target){e&&this._portSendHeld.delete(e)}useWindow(e=this._target){e&&(this._closePort(e),this._drained.delete(e))}get usesPort(){return this._target!==void 0&&this._ports.has(this._target)&&!this._portSendHeld.has(this._target)}hasPort(e,t){const n=this._ports.get(e);return n!==void 0&&(t===void 0||n.transport.peer===t)}_closePort(e){const t=this._ports.get(e);t&&(t.subscription.dispose(),t.transport.close(),this._ports.delete(e),this._portSendHeld.delete(e))}drainWindow(e){this._ports.has(e)&&e.postMessage({operationId:YN,data:{}},"*")}isWindowDrained(e){return this._drained.has(e)}_isPortSource(e){for(const t of this._ports.values())if(t.transport.peer===e)return!0;return!1}_isCurrentPort(e){return this._target!==void 0&&this._ports.get(this._target)?.transport.peer===e}getTarget(){return this._target}get target(){return this._target}_postMessage(e,t,n){let r=t;this._outgoingFilter&&!n?.length&&(r="data"in t?{...t,data:this._outgoingFilter(t.data)}:this._outgoingFilter(t));try{const o=this._ports.get(e);if(o&&!this._portSendHeld.has(e)){o.transport.send(r);return}if(n?.length){e.postMessage(r,"*",n);return}e.postMessage(r,"*")}catch(o){if(o?.name==="DataCloneError"){const i=typeof r?.data=="object"&&r?.data!==null?r.data:void 0}throw o}}_sendMessage(e,t,n=!0){if(!n&&!this.isInited())return;e&&this._notifyOutgoing(e,t);const r=this.addDisposable(this.onInit(o=>{const i=e?{operationId:e,data:t}:t;try{this._postMessage(o,{...i})}finally{r.dispose()}}))}send(e,t,n){return typeof e=="string"?this._sendMessage(e,t,n):this._sendMessage(Od,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=Pb(),o=Pb();return new Promise((i,s)=>{const a=this.addDisposable(new Ee);a.addDisposable(this.onInit(l=>{try{this._postMessage(l,{operationId:e,data:t,result:r,error:o})}catch(c){a.dispose(),s(c);return}a.addDisposable(this._onMessage(r,c=>{i(c),a.dispose()})),a.addDisposable(this._onMessage(o,c=>{s(c),a.dispose()}))}))})}_onMessage(e,t,n=0){return this._emitter.addListener(e,t,n)}addListener(e,t,n){return t?this._onMessage(e,t,n):this._onMessage(Od,e)}addListenerAsyncPipe(e,t,n=0){return this._emitter.addListenerAsync(e,t,n)}addListenerAsync(e,t,n=0){return this._emitter.addListenerAsync(e,async(r,o)=>{const i=await t(r);return o?o(r):i},n)}isInited(){return this._inited}get inited(){return this._inited}onInit(e,t=!0,n=0){const r=this.addDisposable(new Ee);return this._inited&&this._target?t&&Promise.resolve().then(()=>{!this._inited||!this._target?r.addDisposable(this.onInit(e,t,n)):e(this._target)}):r.addDisposable(this._onMessage(Mn,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}};function Ib(e,t){if(e===t)return;let n=0;const r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;let o=e.length,i=t.length;for(;o>n&&i>n&&e[o-1]===t[i-1];)o--,i--;return{start:n,fromEnd:o,toEnd:i}}function Db(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return{length:e.length,hash:t>>>0}}var JN=/<\/?[a-zA-Z][a-zA-Z0-9:_.-]*(?:\s[^<>]*)?\/?>/g;function e2(e){return e.replace(JN,t=>/^<br\b/i.test(t)?" ":"")}var t2={theme:"canvas_fact_theme",flags:"canvas_fact_flags",commonStyles:"canvas_fact_common_styles",lockEditor:"canvas_fact_lock_editor",codeMode:"canvas_fact_code_mode",appName:"canvas_fact_app_name",previewPage:"canvas_fact_preview_page",viewport:"canvas_fact_viewport"},to=8e3,n2=2e3,r2=15e3,Rd=3e3,o2="fonts.googleapis.com",i2=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},s2=e=>{const t=i2(String(e??""));return t?t.hostname===o2&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},ue={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_IMAGE_RESET:"sandbox_image_reset",SANDBOX_NATIVE_IMAGE_DROP_CLEAR:"sandbox_native-image-drop-clear",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",_APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",SANDBOX_EBLOCK_SET_EM_BLOCK_ID:"sandbox_eblock_set_em_block_id",SANDBOX_EBLOCK_CLEAR_EM_BLOCK_ID:"sandbox_eblock_clear_em_block_id",SANDBOX_GLOBAL_BLOCK_REPLACE:"sandbox_global_block_replace",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_NATIVE_IMAGE_DROP:"application_native-image-drop",APPLICATION_SUBJECT_UPDATE:"application_subject_update",APPLICATION_PREHEADER_UPDATE:"application_preheader_update",APPLICATION_DOMPARSER_ERROR:"application_domparser_error",APPLICATION_SYNC_DRIFT:"application_sync_drift",APPLICATION_UPDATE_ENTITY:"application_update_entity",APPLICATION_IFRAME_DRAG_EVENT:"application_iframe_drag_event",APPLICATION_HAS_AMP:"application_has_amp",APPLICATION_CANVAS_IMAGE_GET:"application_canvas_image_get",APPLICATION_PREVIEW_ALERT_SHOW:"application_preview_alert_show",APPLICATION_ATOM_INSERTED:"application_atom_inserted",APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW:"application_template_not_em_alert_show",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",SANDBOX_FLOATBLOCK_COPY:"sandbox_floatBlock_copy",SANDBOX_FLOATBLOCK_SWAP:"sandbox_floatBlock_swap",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:"SANDBOX_READY",SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:"sandbox_subject_update",SANDBOX_PREHEADER_UPDATE:"sandbox_preheader_update",SANDBOX_DRAG_EVENT:"sandbox_drag_event",SANDBOX_WHEEL:"sandbox_wheel",SANDBOX_TRANSLATIONS:"sandbox_send_translations",SANDBOX_SET_THEME_VARIABLES:"sandbox_send_theme_variables",SANDBOX_SET_PROJECT_FONTS:"sandbox_set_project_fonts",SANDBOX_CANVAS_IMAGE_CACHE_SETUP:"sandbox_canvas_image_cache_setup",SANDBOX_SET_ENTITY:"sandbox_set_entity",SANDBOX_INIT_START:"sandbox_init_start",SANDBOX_INITED:"sandbox_inited",SANDBOX_UPDATE_ENTITY:"sandbox_update_entity",RELOAD:"reload",SANDBOX_ADD_EXTENSIONS:"sandbox_add_extensions",SANDBOX_REMOVE_EXTENSIONS:"sandbox_remove_extensions",SANDBOX_ADD_SCRIPT:"sandbox_add_script",SANDBOX_IS_EMAIL_EMPTY:"sandbox_is_email_empty",SANDBOX_SWITCH_THEME:"sandbox_switch_theme",SANDBOX_CANVAS_HEALTH:"sandbox_canvas_health",SANDBOX_CANVAS_SYNCED:"sandbox_canvas_synced",SANDBOX_ELEMENT_OPERATION:"sandbox_element_operation"},a2=e=>({REORDER_ATOM:e("Reorder element"),CLONE_ATOM:e("Clone element"),REMOVE_ATOM:e("Remove element"),EDIT_ATOM:e("Edit element"),CHANGE_IMAGE:e("Change image"),CHANGE_IMAGE_EDIT:e("Edit"),CHANGE_IMAGE_STOCK:e("Stock"),CHANGE_IMAGE_CHANGETO:e("Upload"),CHANGE_IMAGE_GIF:e("GIF"),CHANGE_IMAGE_AI:e("Generate"),REORDER_BLOCK:e("Reorder block"),REORDER_BLOCK_UP:e("Move up"),REORDER_BLOCK_DOWN:e("Move down"),EDIT_BLOCK:e("Edit block"),CLONE_BLOCK:e("Clone block"),MERGE_BLOCK:e("Merge with the chosen block"),UNMERGE_BLOCK:e("Split blocks"),COPY_BLOCK_TO_CLIPBOARD:e("Copy block to clipboard"),PASTE_BLOCK_FROM_CLIPBOARD:e("Paste block from clipboard"),REMOVE_BLOCK:e("Remove block"),SAVE_TO_BLOCKS:e("Save to Blocks"),UPDATE_GLOBAL_BLOCK_IN_TEMPLATES:e("Push block update to all templates"),ADD_BLOCK:e("Add block"),ADD_EMPTY_BLOCK:e("Add an empty block"),ADD_SAVED_BLOCK:e("Add a saved block"),ADD_COMMON_BLOCK:e("Add a common block"),ADD_TEMPLATE_BLOCK:e("Add a template block"),ADD_SEARCH_BLOCK:e("Search a block"),REORDER_GROUP:e("Reorder group"),EDIT_GROUP:e("Edit group"),CLONE_GROUP:e("Clone group"),REMOVE_GROUP:e("Remove group"),ADD_GROUP:e("Add group"),LINK:e("link"),TABLE_COLUMN:e("cell"),TABLE:e("table"),FLOAT_BLOCK:e("column"),CONTAINER:e("container"),PICTURE:e("picture"),CAROUSEL:e("carousel"),ACCORDION:e("accordion"),SOCIAL:e("Social media"),VERTICAL_INDENT:e("indent"),TEXT:e("text"),BUTTON:e("button"),VAR:e("variable"),STRUCTURE:e("block"),EMAIL:e("email"),GROUP:e("group"),TYPOGRAF:e("Typograf"),COUNTDOWN:e("countdown"),ELEMENT:e("element"),VIDEO:e("video"),ELEMENT_PATH_LINK:e("Link"),ELEMENT_PATH_BLOCK:e("Block"),ELEMENT_PATH_ATOM:e("Element"),ELEMENT_PATH_TD:e("Cell"),ELEMENT_PATH_TABLE:e("Table"),ELEMENT_PATH_FLOATBLOCK:e("Column"),ELEMENT_PATH_TEXT:e("Text"),ELEMENT_PATH_DIV:e("Container"),ELEMENT_PATH_GROUP:e("Group"),ELEMENT_PATH_EMAIL:e("Email"),ELEMENT_PATH_IMG:e("Picture"),ELEMENT_PATH_VINDENT:e("Indent"),ELEMENT_PATH_BUTTON:e("Button"),ELEMENT_PATH_CAROUSEL:e("Carousel"),ELEMENT_PATH_ACCORDION:e("Accordion"),ELEMENT_PATH_SOCIAL:e("Social media"),ELEMENT_PATH_SECTION:e("Section"),TINYMCE_CHANGECASE:e("Case Change"),TINYMCE_UPPERCASE:e("Uppercase"),TINYMCE_LOWERCASE:e("Lowercase"),PASTE_HERE:e("Drop here"),INSERT_COLUMN_BEFORE_TABLE:e("Insert column before"),INSERT_COLUMN_AFTER_TABLE:e("Insert column after"),INSERT_ROW_BEFORE_TABLE:e("Insert row before"),INSERT_ROW_AFTER_TABLE:e("Insert row after"),MERGE_RIGHT_CELL_TABLE:e("Merge right cell"),MERGE_LEFT_CELL_TABLE:e("Merge left cell"),MERGE_TOP_CELL_TABLE:e("Merge top cell"),MERGE_BOTTOM_CELL_TABLE:e("Merge bottom cell"),SPLIT_CELL_TABLE:e("Split cell"),REMOVE_COLUMN_TABLE:e("Remove column"),REMOVE_ROW_TABLE:e("Remove row"),TABLE_MENU_COLUMNS:e("Columns"),TABLE_MENU_ROWS:e("Rows"),DROP_BLOCK_HINT:e("Click or drag a block")}),z=new QN(window.parent,!0),sl,as,Bb=Math.random().toString(36).slice(2,8),l2=0,al;function Hb(e,t){const n=sl;sl=e;try{return t()}finally{sl=n}}function ll(e,t){const n=as;as=e;try{return t()}finally{as=n}}function c2(){return as}function u2(){try{return sl?.()}catch{return}}function d2(){return al||(al=`${Bb}:${++l2}`,Promise.resolve().then(()=>{al=void 0})),al}function st(e,t){const n=u2();return z.send(ue.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:as??"other",batch:d2(),instance:Bb}),t}function Md(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(Md(e,o)===!1)return!1;return!0}function Fb(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function f2(e,t){return Fb(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(Md(e,o[i])===!1)return!1}},t)}function nr(e,t,n){Md(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(Fb(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),f2(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var m2=e=>e.type===I.HTML?e.start-1:e.start,h2=e=>e.type===I.HTML?e.end+1:e.end;function p2(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(m2(o)>=n||h2(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function g2(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function $b(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n>0)return t[n-1]}}function Ar(e){let t=e;do t=b2(t);while(t&&t.type===I.HTML&&!t.content);return t}function b2(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n<0)return st("parent and child not sync",e);if(n<t.length-1)return t[n+1]||null}return null}var no=class{constructor(e,t,n,r){k(this,"originalStart",void 0),k(this,"originalLength",void 0),k(this,"modifiedStart",void 0),k(this,"modifiedLength",void 0),this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}};function Wb(e,t){return(t<<5)-t+e|0}function y2(e,t){t=Wb(149417,t);for(let n=0,r=e.length;n<r;n++)t=Wb(e.charCodeAt(n),t);return t}var qb=class{constructor(e){k(this,"source",void 0),this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=e.charCodeAt(n);return t}};function zb(e,t,n){return new v2(new qb(e),new qb(t)).ComputeDiff(n).changes}var qo=class{static Assert(e,t){if(!e)throw new Error(t)}},zo=class{static Copy(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[t+i]}static Copy2(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[t+i]}},Ub=class{constructor(){k(this,"m_changes",void 0),k(this,"m_originalStart",void 0),k(this,"m_modifiedStart",void 0),k(this,"m_originalCount",void 0),k(this,"m_modifiedCount",void 0),this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new no(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}},v2=class Gi{constructor(t,n,r=null){k(this,"ContinueProcessingPredicate",void 0),k(this,"_originalSequence",void 0),k(this,"_modifiedSequence",void 0),k(this,"_hasStrings",void 0),k(this,"_originalStringElements",void 0),k(this,"_originalElementsOrHash",void 0),k(this,"_modifiedStringElements",void 0),k(this,"_modifiedElementsOrHash",void 0),k(this,"m_forwardHistory",void 0),k(this,"m_reverseHistory",void 0),this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,i,s]=Gi._getElements(t),[a,l,c]=Gi._getElements(n);this._hasStrings=s&&c,this._originalStringElements=o,this._originalElementsOrHash=i,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(t){return t.length>0&&typeof t[0]=="string"}static _getElements(t){const n=t.getElements();if(Gi._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=y2(n[o],0);return[n,r,!0]}return n instanceof Int32Array?[[],n,!1]:[[],new Int32Array(n),!1]}ElementsAreEqual(t,n){return this._originalElementsOrHash[t]!==this._modifiedElementsOrHash[n]?!1:this._hasStrings?this._originalStringElements[t]===this._modifiedStringElements[n]:!0}ElementsAreStrictEqual(t,n){return this.ElementsAreEqual(t,n)?Gi._getStrictElement(this._originalSequence,t)===Gi._getStrictElement(this._modifiedSequence,n):!1}static _getStrictElement(t,n){return typeof t.getStrictElement=="function"?t.getStrictElement(n):null}OriginalElementsAreEqual(t,n){return this._originalElementsOrHash[t]!==this._originalElementsOrHash[n]?!1:this._hasStrings?this._originalStringElements[t]===this._originalStringElements[n]:!0}ModifiedElementsAreEqual(t,n){return this._modifiedElementsOrHash[t]!==this._modifiedElementsOrHash[n]?!1:this._hasStrings?this._modifiedStringElements[t]===this._modifiedStringElements[n]:!0}ComputeDiff(t){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,t)}_ComputeDiff(t,n,r,o,i){const s=[!1];let a=this.ComputeDiffRecursive(t,n,r,o,s);return i&&(a=this.PrettifyChanges(a)),{quitEarly:s[0],changes:a}}ComputeDiffRecursive(t,n,r,o,i){for(i[0]=!1;t<=n&&r<=o&&this.ElementsAreEqual(t,r);)t++,r++;for(;n>=t&&o>=r&&this.ElementsAreEqual(n,o);)n--,o--;if(t>n||r>o){let c;return r<=o?(qo.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new no(t,0,r,o-r+1)]):t<=n?(qo.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new no(t,n-t+1,r,0)]):(qo.Assert(t===n+1,"originalStart should only be one more than originalEnd"),qo.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[]),c}const s=[0],a=[0],l=this.ComputeRecursionPoint(t,n,r,o,s,a,i);return s[0],a[0],l!==null?l:[new no(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,f,h,m,p,v,w,_){let A=null,b=null,g=new Ub,E=n,T=r,y=h[0]-v[0]-o,S=-1073741824,C=this.m_forwardHistory.length-1;do{const L=y+t;L===E||L<T&&c[L-1]<c[L+1]?(d=c[L+1],m=d-y-o,d<S&&g.MarkNextChange(),S=d,g.AddModifiedElement(d+1,m),y=L+1-t):(d=c[L-1]+1,m=d-y-o,d<S&&g.MarkNextChange(),S=d-1,g.AddOriginalElement(d,m+1),y=L-1-t),C>=0&&(c=this.m_forwardHistory[C],t=c[0],E=1,T=c.length-1)}while(--C>=-1);if(A=g.getReverseChanges(),_[0]){let L=h[0]+1,x=v[0]+1;if(A!==null&&A.length>0){const N=A[A.length-1];L=Math.max(L,N.getOriginalEnd()),x=Math.max(x,N.getModifiedEnd())}b=[new no(L,f-L+1,x,p-x+1)]}else{g=new Ub,E=s,T=a,y=h[0]-v[0]-l,S=1073741824,C=w?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const L=y+i;L===E||L<T&&u[L-1]>=u[L+1]?(d=u[L+1]-1,m=d-y-l,d>S&&g.MarkNextChange(),S=d+1,g.AddOriginalElement(d+1,m+1),y=L+1-i):(d=u[L-1],m=d-y-l,d>S&&g.MarkNextChange(),S=d,g.AddModifiedElement(d+1,m+1),y=L-1-i),C>=0&&(u=this.m_reverseHistory[C],i=u[0],E=1,T=u.length-1)}while(--C>=-1);b=g.getChanges()}return this.ConcatenateChanges(A,b)}ComputeRecursionPoint(t,n,r,o,i,s,a){let l=0,c=0,u=0,d=0,f=0,h=0;t--,r--,i[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const m=n-t+(o-r),p=m+1,v=new Int32Array(p),w=new Int32Array(p),_=o-r,A=n-t,b=t-r,g=n-o,E=(A-_)%2===0;v[_]=t,w[A]=n,a[0]=!1;for(let T=1;T<=m/2+1;T++){let y=0,S=0;if(T>100)return null;u=this.ClipDiagonalBound(_-T,T,_,p),d=this.ClipDiagonalBound(_+T,T,_,p);for(let L=u;L<=d;L+=2){L===u||L<d&&v[L-1]<v[L+1]?l=v[L+1]:l=v[L-1]+1,c=l-(L-_)-b;const x=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(v[L]=l,l+c>y+S&&(y=l,S=c),!E&&Math.abs(L-A)<=T-1&&l>=w[L])return i[0]=l,s[0]=c,x<=w[L]&&T<=1448?this.WALKTRACE(_,u,d,b,A,f,h,g,v,w,l,n,i,c,o,s,E,a):null}const C=(y-t+(S-r)-T)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(y,C))return a[0]=!0,i[0]=y,s[0]=S,C>0&&T<=1448?this.WALKTRACE(_,u,d,b,A,f,h,g,v,w,l,n,i,c,o,s,E,a):(t++,r++,[new no(t,n-t+1,r,o-r+1)]);f=this.ClipDiagonalBound(A-T,T,A,p),h=this.ClipDiagonalBound(A+T,T,A,p);for(let L=f;L<=h;L+=2){L===f||L<h&&w[L-1]>=w[L+1]?l=w[L+1]-1:l=w[L-1],c=l-(L-A)-g;const x=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(w[L]=l,E&&Math.abs(L-_)<=T&&l<=v[L])return i[0]=l,s[0]=c,x>=v[L]&&T<=1448?this.WALKTRACE(_,u,d,b,A,f,h,g,v,w,l,n,i,c,o,s,E,a):null}if(T<=1447){let L=new Int32Array(d-u+2);L[0]=_-u+1,zo.Copy2(v,u,L,1,d-u+1),this.m_forwardHistory.push(L),L=new Int32Array(h-f+2),L[0]=A-f+1,zo.Copy2(w,f,L,1,h-f+1),this.m_reverseHistory.push(L)}}return this.WALKTRACE(_,u,d,b,A,f,h,g,v,w,l,n,i,c,o,s,E,a)}PrettifyChanges(t){for(let n=0;n<t.length;n++){const r=t[n],o=n<t.length-1?t[n+1].originalStart:this._originalElementsOrHash.length,i=n<t.length-1?t[n+1].modifiedStart:this._modifiedElementsOrHash.length,s=r.originalLength>0,a=r.modifiedLength>0;for(;r.originalStart+r.originalLength<o&&r.modifiedStart+r.modifiedLength<i&&(!s||this.OriginalElementsAreEqual(r.originalStart,r.originalStart+r.originalLength))&&(!a||this.ModifiedElementsAreEqual(r.modifiedStart,r.modifiedStart+r.modifiedLength));){const c=this.ElementsAreStrictEqual(r.originalStart,r.modifiedStart);if(this.ElementsAreStrictEqual(r.originalStart+r.originalLength,r.modifiedStart+r.modifiedLength)&&!c)break;r.originalStart++,r.modifiedStart++}const l=[null];if(n<t.length-1&&this.ChangesOverlap(t[n],t[n+1],l)){t[n]=l[0],t.splice(n+1,1),n--;continue}}for(let n=t.length-1;n>=0;n--){const r=t[n];let o=0,i=0;if(n>0){const d=t[n-1];o=d.originalStart+d.originalLength,i=d.modifiedStart+d.modifiedLength}const s=r.originalLength>0,a=r.modifiedLength>0;let l=0,c=this._boundaryScore(r.originalStart,r.originalLength,r.modifiedStart,r.modifiedLength);for(let d=1;;d++){const f=r.originalStart-d,h=r.modifiedStart-d;if(f<o||h<i||s&&!this.OriginalElementsAreEqual(f,f+r.originalLength)||a&&!this.ModifiedElementsAreEqual(h,h+r.modifiedLength))break;const m=(f===o&&h===i?5:0)+this._boundaryScore(f,r.originalLength,h,r.modifiedLength);m>c&&(c=m,l=d)}r.originalStart-=l,r.modifiedStart-=l;const u=[null];if(n>0&&this.ChangesOverlap(t[n-1],t[n],u)){t[n-1]=u[0],t.splice(n,1),n++;continue}}if(this._hasStrings)for(let n=1,r=t.length;n<r;n++){const o=t[n-1],i=t[n],s=i.originalStart-o.originalStart-o.originalLength,a=o.originalStart,l=i.originalStart+i.originalLength,c=l-a,u=o.modifiedStart,d=i.modifiedStart+i.modifiedLength,f=d-u;if(s<5&&c<20&&f<20){const h=this._findBetterContiguousSequence(a,c,u,f,s);if(h){const[m,p]=h;(m!==o.originalStart+o.originalLength||p!==o.modifiedStart+o.modifiedLength)&&(o.originalLength=m-o.originalStart,o.modifiedLength=p-o.modifiedStart,i.originalStart=m+s,i.modifiedStart=p+s,i.originalLength=l-i.originalStart,i.modifiedLength=d-i.modifiedStart)}}}return t}_findBetterContiguousSequence(t,n,r,o,i){if(n<i||o<i)return null;const s=t+n-i+1,a=r+o-i+1;let l=0,c=0,u=0;for(let d=t;d<s;d++)for(let f=r;f<a;f++){const h=this._contiguousSequenceScore(d,f,i);h>0&&h>l&&(l=h,c=d,u=f)}return l>0?[c,u]:null}_contiguousSequenceScore(t,n,r){let o=0;for(let i=0;i<r;i++){if(!this.ElementsAreEqual(t+i,n+i))return 0;o+=this._originalStringElements[t+i].length}return o}_OriginalIsBoundary(t){return t<=0||t>=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[t])}_OriginalRegionIsBoundary(t,n){if(this._OriginalIsBoundary(t)||this._OriginalIsBoundary(t-1))return!0;if(n>0){const r=t+n;if(this._OriginalIsBoundary(r-1)||this._OriginalIsBoundary(r))return!0}return!1}_ModifiedIsBoundary(t){return t<=0||t>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[t])}_ModifiedRegionIsBoundary(t,n){if(this._ModifiedIsBoundary(t)||this._ModifiedIsBoundary(t-1))return!0;if(n>0){const r=t+n;if(this._ModifiedIsBoundary(r-1)||this._ModifiedIsBoundary(r))return!0}return!1}_boundaryScore(t,n,r,o){return(this._OriginalRegionIsBoundary(t,n)?1:0)+(this._ModifiedRegionIsBoundary(r,o)?1:0)}ConcatenateChanges(t,n){const r=[];if(t.length===0||n.length===0)return n.length>0?n:t;if(this.ChangesOverlap(t[t.length-1],n[0],r)){const o=new Array(t.length+n.length-1);return zo.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],zo.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return zo.Copy(t,0,o,0,t.length),zo.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(qo.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),qo.Assert(t.modifiedStart<=n.modifiedStart,"Left change is not less than or equal to right change"),t.originalStart+t.originalLength>=n.originalStart||t.modifiedStart+t.modifiedLength>=n.modifiedStart){const o=t.originalStart;let i=t.originalLength;const s=t.modifiedStart;let a=t.modifiedLength;return t.originalStart+t.originalLength>=n.originalStart&&(i=n.originalStart+n.originalLength-t.originalStart),t.modifiedStart+t.modifiedLength>=n.modifiedStart&&(a=n.modifiedStart+n.modifiedLength-t.modifiedStart),r[0]=new no(o,i,s,a),!0}else return r[0]=null,!1}ClipDiagonalBound(t,n,r,o){if(t>=0&&t<o)return t;const i=r,s=o-r-1,a=n%2===0;return t<0?a===(i%2===0)?0:1:a===(s%2===0)?o-1:o-2}};function cl(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var Vt=class{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,r){k(this,"oldPosition",void 0),k(this,"oldText",void 0),k(this,"newPosition",void 0),k(this,"newText",void 0),this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${cl(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${cl(this.oldText)}")`:`(replace@${this.oldPosition} "${cl(this.oldText)}" with "${cl(this.newText)}")`}};function At(e,t){return e===null||e.length===0?t:new E2(e,t).compress()}var E2=class Er{constructor(t,n){k(this,"_prevEdits",void 0),k(this,"_currEdits",void 0),k(this,"_result",void 0),k(this,"_resultLen",void 0),k(this,"_prevLen",void 0),k(this,"_prevDeltaOffset",void 0),k(this,"_currLen",void 0),k(this,"_currDeltaOffset",void 0),this._prevEdits=t,this._currEdits=n,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let t=0,n=0,r=this._getPrev(t),o=this._getCurr(n);for(;t<this._prevLen||n<this._currLen;){if(r===null){if(o===null)break;this._acceptCurr(o),o=this._getCurr(++n);continue}if(o===null){this._acceptPrev(r),r=this._getPrev(++t);continue}if(o.oldEnd<=r.newPosition){this._acceptCurr(o),o=this._getCurr(++n);continue}if(r.newEnd<=o.oldPosition){this._acceptPrev(r),r=this._getPrev(++t);continue}if(o.oldPosition<r.newPosition){const[l,c]=Er._splitCurr(o,r.newPosition-o.oldPosition);this._acceptCurr(l),o=c;continue}if(r.newPosition<o.oldPosition){const[l,c]=Er._splitPrev(r,o.oldPosition-r.newPosition);this._acceptPrev(l),r=c;continue}let s,a;if(o.oldEnd===r.newEnd)s=r,a=o,r=this._getPrev(++t),o=this._getCurr(++n);else if(o.oldEnd<r.newEnd){const[l,c]=Er._splitPrev(r,o.oldLength);s=l,a=o,r=c,o=this._getCurr(++n)}else{const[l,c]=Er._splitCurr(o,r.newLength);s=r,a=l,r=this._getPrev(++t),o=c}this._result[this._resultLen++]=new Vt(s.oldPosition,s.oldText,a.newPosition,a.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=a.newLength-a.oldLength}const i=Er._merge(this._result);return Er._removeNoOps(i)}_acceptCurr(t){this._result[this._resultLen++]=Er._rebaseCurr(this._prevDeltaOffset,t),this._currDeltaOffset+=t.newLength-t.oldLength}_getCurr(t){return t<this._currLen?this._currEdits[t]:null}_acceptPrev(t){this._result[this._resultLen++]=Er._rebasePrev(this._currDeltaOffset,t),this._prevDeltaOffset+=t.newLength-t.oldLength}_getPrev(t){return t<this._prevLen?this._prevEdits[t]:null}static _rebaseCurr(t,n){return new Vt(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new Vt(n.oldPosition,n.oldText,n.newPosition+t,n.newText)}static _splitPrev(t,n){const r=t.newText.substr(0,n),o=t.newText.substr(n);return[new Vt(t.oldPosition,t.oldText,t.newPosition,r),new Vt(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new Vt(t.oldPosition,r,t.newPosition,t.newText),new Vt(t.oldPosition+n,o,t.newEnd,"")]}static _merge(t){if(t.length===0)return t;const n=[];let r=0,o=t[0];for(let i=1;i<t.length;i++){const s=t[i];o.oldEnd===s.oldPosition?o=new Vt(o.oldPosition,o.oldText+s.oldText,o.newPosition,o.newText+s.newText):(n[r++]=o,o=s)}return n[r++]=o,n}static _removeNoOps(t){if(t.length===0)return t;const n=[];let r=0;for(let o=0;o<t.length;o++){const i=t[o];i.oldText!==i.newText&&(n[r++]=i)}return n}};function jb(e){return new Vt(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Pn(e){return e.map(jb)}function S2(e,t){let n=e;for(let r=t.length-1;r>=0;r-=1){const o=t[r];n=n.slice(0,o.oldPosition)+o.newText+n.slice(o.oldEnd)}return n}function w2(e,t,n){let r=0;const o=e.start===e.end;for(const i of t){const s=i.newLength-i.oldLength;if(i.oldLength===0){const a=i.oldPosition;if(o&&a===e.start)r+=n==="after"?s:0;else{if(e.start<a&&a<e.end)return null;a<=e.start&&(r+=s)}continue}if(o){if(e.start>=i.oldEnd)r+=s;else if(e.start>i.oldPosition)return null;continue}if(e.start>=i.oldEnd)r+=s;else if(e.end>i.oldPosition)return null}return{start:e.start+r,end:e.end+r}}function ul(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=w2({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new Vt(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function Vb(e,t,n=0){const r=e.range;return new Vt(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function Uo(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),Vb({text:r,range:{start:o,end:i}},t,s)})}function _2(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function ro(e){return e.map(t=>_2(t))}function C2(e,t=ls(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var sne=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function T2(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function ls(e){return{start:0,end:e.getLength()}}function A2(e,t,n){return`${e.substring(0,n.start)}${t}${e.substring(n.end)}`}function cs(e,t){const n=[e];for(let r=t.length-1;r>=0;r--){const{text:o,range:i}=t[r],s=n[0];n.splice(0,1,s.substring(0,i.start),o,s.substring(i.end))}return n.join("")}function k2(e,t){return t=dl(t).sort(({range:n},{range:r})=>n.start-r.start),cs(e,t)}function us(e,t){return e>=t.start&&e<=t.end}function dl(e,t){e=[...e];let n=e.length;if(n<=1)return e;e=e.sort(({range:r},{range:o})=>r.start-o.start);for(let r=0;r<n;r++){let o=e[r],i=e[r].range;for(let s=r+1;s<n;s++){const a=e[s];let l=e[s].range,c;if(us(i.start,l)&&us(i.start,l))c=l;else if(us(l.start,i))us(l.end,i)?c=i:c={start:i.start,end:l.end};else if(us(l.end,i))c={start:l.start,end:i.end};else continue;const u=o.text;let d=l.start-i.start+u.length,f=l.end-i.start+u.length;const h=A2(u,a.text,{start:d,end:f});e[r]=o={range:i=c,text:h},e.splice(s--,1),n--}}return e}function L2(e,t){if(e.length<=1)return e[0]||null;e=dl(e);const n=e.reduce((r,{range:o})=>({start:Math.min(r.start,o.start),end:Math.max(r.end,o.end)}),{start:Number.MAX_VALUE,end:Number.MIN_VALUE});return{text:cs(t.substring(n.start,n.end),e.map(({range:r,text:o})=>({text:o,range:{start:r.start-n.start,end:r.end-n.start}}))),range:n}}function N2(e,t){const n=Pn(e),r=L2(ro(n),t);if(r){const o=Vb(r,t);return jb(o)}return null}function x2(e,{range:t,text:n}){const r=e.getText(t);return zb(r,n,!0).map(o=>({range:{start:t.start+o.originalStart,end:t.start+o.originalStart+o.originalLength},text:n.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)}))}function Gb({oldText:e,newText:t,oldPosition:n,newPosition:r}){return zb(e,t,!0).map(o=>new Vt(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var O2=class{constructor(e,t){k(this,"index",void 0),k(this,"values",void 0),k(this,"type","insert"),this.index=e,this.values=t}},R2=class{constructor(e,t){k(this,"index",void 0),k(this,"howMany",void 0),k(this,"type","remove"),this.index=e,this.howMany=t}},M2=class{constructor(e,t,n){k(this,"from",void 0),k(this,"to",void 0),k(this,"howMany",void 0),k(this,"type","move"),this.from=e,this.to=t,this.howMany=n}};function P2(e,t){return e===t}function I2(e,t,n=P2){for(var r=e.length,o=t.length,i=[],s=Object.create(null),a=Object.create(null),l=0;l<r;l++)for(var c=e[l],u=0;u<o;u++)if(!a[u]&&n(c,t[u])){var d=l,f=u,h=0;do s[l++]=a[u++]=!0,h++;while(l<r&&u<o&&n(e[l],t[u])&&!a[u]);i.push(new M2(d,f,h)),l--;break}var m=[];for(l=0;l<r;){if(s[l]){l++;continue}for(var p=l,h=0;l<r&&!s[l++];)h++;m.push(new R2(p,h))}for(var v=[],u=0;u<o;){if(a[u]){u++;continue}for(var p=u,h=0;u<o&&!a[u++];)h++;var w=t.slice(p,p+h);v.push(new O2(p,w))}var _=v.length,A=m.length,b=i.length,g,E,T=0;for(g=0;g<A;g++){var y=m[g];for(y.index-=T,T+=y.howMany,E=0;E<b;E++){var S=i[E];S.from>=y.index&&(S.from-=y.howMany)}}for(g=_;g--;){var C=v[g],h=C.values.length;for(E=b;E--;){var S=i[E];S.to>=C.index&&(S.to-=h)}}for(g=b;g-- >1;){var S=i[g];if(S.to!==S.from)for(E=g;E--;){var L=i[E];L.to>=S.to&&(L.to-=S.howMany),L.to>=S.from&&(L.to+=S.howMany)}}var x=[];for(g=0;g<b;g++){var S=i[g];if(S.to!==S.from)for(x.push(S),E=g+1;E<b;E++){var N=i[E];N.from>=S.from&&(N.from-=S.howMany),N.from>=S.to&&(N.from+=S.howMany)}}return[...m,...x,...v]}var Xb=class{constructor(){k(this,"_byKey",new Map),k(this,"_byValue",new Map)}set(e,t){this._byKey.set(e,t),this._byValue.set(t,e)}getByKey(e){return this._byKey.get(e)}getByValue(e){return this._byValue.get(e)}delete(e){const t=this._byKey.has(e);if(t){const n=this._byKey.get(e);this._byKey.delete(e),this._byValue.delete(n)}return t}deleteByValue(e){const t=this._byValue.has(e);if(t){const n=this._byValue.get(e);this._byValue.delete(e),this._byKey.delete(n)}return t}get size(){return this._byKey.size}},ae;(function(e){function t(d,f,h){return{type:"Add",node:f,nextSibling:h,parent:d}}e.add=t;function n(d){return{type:"Remove",node:d}}e.remove=n;function r(d,f,h){return{type:"Attribute",node:d,name:f,value:h}}e.attribute=r;function o(d,f,h){return h?{type:"Update",prev:d,next:f,soft:h}:{type:"Update",prev:d,next:f}}e.update=o;function i(d,f,h,m){return[{type:"Remove",node:d},{type:"Add",node:h,nextSibling:m,parent:f,replaces:d}]}e.recreate=i;function s(d,f,h){return{type:"Move",node:f,nextSibling:h,parent:d}}e.move=s;function a(d,f){return{type:"Set",node:d,data:f}}e.set=a;function l(d,f,h){return{type:"ClassList",node:d,addedClasses:f,removedClasses:h}}e.classList=l;function c(d,f){return{type:"Style",node:d,value:f}}e.style=c;function u(d,f){return{type:"Hidden",node:d,value:f}}e.hidden=u})(ae||(ae={}));function Kb(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var Yb=[],Zb=[];function D2(e){return Kb(Yb,e)}function Pd(e){return e?Yb.some(t=>t(e)):!1}function B2(e){return Kb(Zb,e)}function H2(e){return Zb.some(t=>t(e))}function F2(e,t){const n=e.attributes||{},r=t.attributes||{},o=e.attributeNames,i=t.attributeNames,s=o.length,a=i.length,l=[];let c=0;for(;c<s;c++){const u=o[c];if(u!==i[c]){for(let d=c;d<s;d++){const f=o[d];l.push(ae.attribute(t,f,void 0))}break}else r[u]!==n[u]&&l.push(ae.attribute(t,u,r[u]))}for(;c<a;c++){const u=i[c];l.push(ae.attribute(t,u,r[u]))}return l}function $2(e){let t=[];const n=e.children.filter(o=>o.type!==I.HTML||!!o.content);let r;for(let o=n.length-1;o>=0;o--)t.push(ae.add(e,n[o],r)),r=n[o];return t}function W2(e){return ae.remove(e)}var q2=new Set(["head","body","html"]),z2=e=>e.type===I.ROOT||e.type===I.DOCTYPE||e.type===I.ELEMENT&&e.tag&&q2.has(e.tag.toLowerCase()),U2=/^<[!?/]/;function Id(e){return e.type===I.ELEMENT?String(e.tag):e.type===I.HTML&&U2.test(e.content??"")?"bogus":String(e.type)}function fl(e){const t=new Xb,n=Object.create(null);for(const r of e){const o=Id(r)+(!z2(r)&&r.start===r.end?"_hidden":"");let i="";r.type===I.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function Qb(e){const t=[];let n=0;for(const r of[...e].sort((o,i)=>o.oldPosition-i.oldPosition)){const o=r.newLength-r.oldLength,i=t[t.length-1];i&&r.oldPosition<i.oldEnd?(i.oldEnd=Math.max(i.oldEnd,r.oldEnd),i.delta+=o):t.push({oldPosition:r.oldPosition,oldEnd:r.oldEnd,shift:n,delta:o}),n+=o}return t}function ml(e,t){const n=e[t-1];return t<e.length?e[t].shift:n.shift+n.delta}function Dd(e,t){return(e.type===I.HTML?e.end+1:e.end)<=t.oldPosition}function j2(e,t){return(e.type===I.HTML?e.start-1:e.start)>=t.oldEnd}function Bd(e,t,n){return!!t&&t.start===n&&t.type===e.type&&t.tag===e.tag&&t.attributes?.id===e.attributes?.id&&t.end-t.start===e.end-e.start}function Hd(e,t){return t.type===e.type&&Id(t)===Id(e)&&t.attributes?.id===e.attributes?.id}function ds(e,t,n){return Jn(e,!1,n)===Jn(t,!1,n)}function Fd(e,t,n){let r=t,o=e;for(;r<o;){const i=r+o>>1;n(i)?o=i:r=i+1}return r}function hl(e,t,n=0){return Fd(t.length,n,r=>!j2(e,t[r]))}function $d(e,t){const n=hl(e,t);return t.slice(n,ty(e,t,n))}function Jb(e,t){const n=hl(e,t);return n<t.length&&!Dd(e,t[n])?void 0:e.start+ml(t,n)}function pl(e){return e.type===I.ELEMENT?e.attributes?.id:void 0}function ey(e){const t=new Set,n=new Set;for(const r of e){const o=pl(r);o&&(t.has(o)?n:t).add(o)}return n}function V2(e,t,n){const r=new Set([...ey(t),...ey(n)]),o=new Map;e.forEach((s,a)=>{for(let l=s.prevFrom;l<s.prevTo;l++){const c=pl(t[l]);c&&o.set(c,{node:t[l],gap:a})}});const i=new Map;return e.forEach((s,a)=>{for(let l=s.nextFrom;l<s.nextTo;l++){const c=pl(n[l]),u=c?o.get(c):void 0;c&&u&&u.gap!==a&&!r.has(c)&&Hd(u.node,n[l])&&i.set(c,u.node)}}),i}function G2(e,t,n){const r=[];let o={prevFrom:0,prevTo:0,nextFrom:0,nextTo:0},i=0,s=0,a=0;const l=(c,u,d)=>{(c>o.prevFrom||u>o.nextFrom)&&r.push({...o,prevTo:c,nextTo:u,edits:n.slice(i,d)})};for(let c=0;c<e.length;c++){const u=e[c];if(s=hl(u,n,s),s<n.length&&!Dd(u,n[s]))continue;const d=u.start+ml(n,s),f=Fd(t.length,a,h=>t[h].start>=d);Bd(u,t[f],d)&&(a=f,l(c,a,s),o={prevFrom:c+1,prevTo:c+1,nextFrom:a+1,nextTo:a+1},i=s,a++)}return l(e.length,t.length,n.length),r}function ty(e,t,n){return Fd(t.length,n,r=>Dd(e,t[r]))}function ny(e,t,n,r,o,i,s){const a=hl(e,o),l=ty(e,o,a),c=(p,v=()=>!0)=>p?.find(w=>w>=n&&w<r&&Hd(e,t[w])&&v(t[w]))??-1,u=e.start+ml(o,a),d=e.end+ml(o,l),f=a===o.length||e.start<o[a].oldPosition,h=f?c(s.byStart.get(u)):-1,m=l>a&&e.end>o[l-1].oldEnd?c(s.byEnd.get(d),p=>!(f&&K2(e,p,u))):-1;return h>=0&&m>=0&&h!==m?ds(e,t[h],i)||ds(e,t[m],i)?ds(e,t[h],i)?h:m:oy(e,t[m],o)>oy(e,t[h],o)?m:h:h>=0?h:m}function ry(e,t,n){const r=e.get(t);r?r.push(n):e.set(t,[n])}function X2(e,t,n){const r={byStart:new Map,byEnd:new Map};for(let o=t;o<n;o++)ry(r.byStart,e[o].start,o),ry(r.byEnd,e[o].end,o);return r}function K2(e,t,n){for(let r=t.lastChild;r&&r.end===t.end;r=r.lastChild)if(r.start===n&&Hd(e,r))return!0;return!1}function oy(e,t,n){const r=new Map(t.children.map(o=>[o.start,o]));return e.children.filter(o=>{const i=Jb(o,n);return i!==void 0&&Bd(o,r.get(i),i)}).length}function iy(e,t){return $d(e,t).reduce((n,r)=>n-Math.max(0,Math.min(e.end,r.oldEnd)-Math.max(e.start,r.oldPosition)),e.end-e.start)}function Y2(e,t,n,r,o,i){const s=ds(e,t,i),a=ds(n,r,i);return s!==a?a:iy(n,o)>iy(e,o)}function Z2(e,t,n,r){const o=n.edits??[],i=[],s=[];let{prevFrom:a,prevTo:l,nextFrom:c,nextTo:u}=n;const d=X2(t,c,u);for(;o.length&&a<l&&c<u;){const f=ny(e[l-1],t,c,u,o,r,d);if(l-1===a){f>=0&&s.unshift([a,f]);break}const h=ny(e[a],t,c,u,o,r,d);let m=h>=0,p=f>=0;if(m&&p&&h>=f&&(p=Y2(e[a],t[h],e[l-1],t[f],o,r),m=!p),!m&&!p)break;m&&(i.push([a,h]),a++,c=h+1),p&&(s.unshift([l-1,f]),l--,u=f)}return[...i,...s]}function Q2(e,t){const n=[];let r=e.prevFrom,o=e.nextFrom;for(const[i,s]of[...t,[e.prevTo,e.nextTo]])(i>r||s>o)&&n.push({prevFrom:r,prevTo:i,nextFrom:o,nextTo:s,edits:e.edits}),r=i+1,o=s+1;return n}function J2(e,t,n,r,o){const i=o?.length?Jb(e,o):void 0;return(i===void 0?void 0:t.children.find(s=>Bd(e,s,i)))??r.getByKey(n.getByValue(e)??"")}function fs(e,t){for(const n of t)e.push(n)}function sy(e,t,n,r,o,i,s,a,l=new Map){const c=[],u=r.prevFrom,d=t.slice(u,r.prevTo),f=n.slice(r.nextFrom,r.nextTo),[h,m]=o??[fl(d),fl(f)],p=I2(d,f,(w,_)=>h.getByValue(w)===m.getByValue(_)),v=w=>{const _=pl(w);return _?l.get(_):void 0};for(const w of p)switch(w.type){case"insert":{const _=u+w.index;let A=t[_];for(const b of w.values.reverse()){t.splice(_,0,b),i.add(b);const g=v(b);g?(fs(c,gl(g,b,s,a)),c.push(ae.move(e,b,A))):c.push(ae.add(e,b,A)),A=b}break}case"remove":{const _=t.splice(u+w.index,w.howMany);for(const A of _)v(A)!==A&&c.push(ae.remove(A));break}case"move":{const _=t.splice(u+w.from,w.howMany);let A=t[u+w.to];t.splice(u+w.to,0,..._);for(const b of _.reverse()){const g=m.getByKey(h.getByValue(b)??"");if(!g)return st("error while sync",c);i.add(g),fs(c,gl(b,g,s,a,r.edits&&$d(b,r.edits))),c.push(ae.move(e,g,A)),A=b}break}}return c}function Wd(e,t,n=!1,r=ud(),o){const i=[],s=fl(e.children),a=fl(t.children);for(let p=e.children.length-1;p>=0;p--){const v=e.children[p];if(v.type===I.ELEMENT&&v.start===v.end){const w=s.getByValue(v);if(!a.getByKey(w)){let _=!1;for(let A=p+1;A<e.children.length;A++){const b=e.children[A];if(b){const g=J2(b,t,s,a,o);if(g){const E=g.start,T=v.clone();t.children.splice(t.children.indexOf(g),0,T),nr(T,E-v.start),T.parent=t,a.set(w,T),_=!0;break}}}if(!_){const A=t.endTagStart===void 0?t.end:t.endTagStart,b=v.clone();t.children.push(b),a.set(w,b),nr(b,A-v.start),b.parent=t}}}}const l=e.children.filter(p=>p.type!==I.HTML||!!p.content),c=t.children.filter(p=>p.type!==I.HTML||!!p.content),u=o?.length?G2(l,c,o):null,d=u?V2(u,l,c):new Map,f=new Set;for(const p of u?[...u].reverse():[]){const v=Q2(p,Z2(l,c,p,r)).reverse();for(const w of v)fs(i,sy(t,l,c,w,void 0,f,n,r,d))}const h={prevFrom:0,prevTo:l.length,nextFrom:0,nextTo:c.length,edits:o};u||fs(i,sy(t,l,c,h,[s,a],f,n,r)),c.length!==l.length&&st("error while sync");const m=new Map;for(const p of u??[h])for(let v=p.nextFrom;v<p.nextTo;v++)m.set(v,p.edits);for(let p=c.length-1;p>=0;p--){const v=c[p];if(!f.has(v)){const w=m.get(p);fs(i,gl(l[p],v,n,r,w&&$d(l[p],w)))}}return i}function qd(e){return e.type===I.ELEMENT&&Pd(e.tag)}function gl(e,t,n=!1,r=ud(),o){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(qd(e)&&e.tag===t.tag){if(Jn(e,!1,r)===Jn(t,!1,r))return[ae.update(e,t,n),...Wd(e,t,!0,r)]}else if((e.type===I.ELEMENT||e.type===I.ROOT)&&e.tag===t.tag)return[ae.update(e,t,n),...F2(e,t),...Wd(e,t,n,r,o)];if(e.type===I.HTML||e.type===I.COMMENT)return e.content===t.content?[ae.update(e,t,n)]:[ae.update(e,t,n),ae.set(t,t.content)]}return!e.parent||!t.parent?st("cannot replace document",[]):qd(e)&&e.tag===t.tag?ae.recreate(e,t.parent,t,Ar(t)||void 0):[ae.remove(e),ae.add(t.parent,t,Ar(t)||void 0)]}var rr="FROM_DOM",or="FROM_REMOTE",ex=/<\/.*>/i;function tx(e){return ex.test(e)}var nx=/^<[!?/][^>]*$/,rx=class extends Ee{constructor(e,t){super(),k(this,"_baseDocument",void 0),k(this,"_createRoot",void 0),k(this,"_beforeTextChangeEmitter",this.addDisposable(new ge)),k(this,"_onTextChangeEmitter",this.addDisposable(new ge)),k(this,"_onMutateEmitter",this.addDisposable(new ge)),k(this,"_beforeRefreshEmitter",this.addDisposable(new ge)),k(this,"_onRefreshEmitter",this.addDisposable(new ge)),k(this,"_root",new Tt(0,0,[])),k(this,"_applyingMutation",void 0),k(this,"_insertRun",void 0),k(this,"beforeTextChange",this._beforeTextChangeEmitter.event),k(this,"beforeRefresh",this._beforeRefreshEmitter.event),k(this,"onTextChange",this._onTextChangeEmitter.event),k(this,"onRefresh",this._onRefreshEmitter.event),k(this,"onMutate",this._onMutateEmitter.event),this._baseDocument=e,this._createRoot=t,this._baseDocument.onChanged(this._onTextChange.bind(this));const n=this._root=new Tt(0,0,[]);n.type=I.ROOT}get root(){return this._root}contains(e){return e.root===this.root}isAttached(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t===this.root}get applyingMutation(){return this._applyingMutation}initialize(e,t,n){const r=this._root;this._beforeRefreshEmitter.fire();let{roots:o}=hn(e),i=this._root=this._createRoot?this._createRoot(o,e):new Tt(0,e.length,o);if(i.type=I.ROOT,this._createRoot||o.forEach(s=>s.parent=i),!t){const s=n&&Qb(n);this._onRefreshEmitter.fire(r?Wd(r,i,!1,void 0,s):$2(i))}}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=N2(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),ll("text",()=>this.replaceWithHtml(n,or,t))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&Ar(t)===n)return t;this.remove(t,r)}const o=this.contains(e),i=Ga(t),s=e.children,a=n?s.indexOf(n):s.length;if(a<0)return st("referenced node is not a child of parent node",t);s.splice(a,0,t);const l=n?n.start:e.endTagStart===void 0?e.end:e.endTagStart;return t.parent=e,nr(t,l-t.start,i.length),o&&(r!=="FROM_DOM"&&this._onMutateEmitter.fire([ae.add(e,t,n||void 0)]),r!=="FROM_REMOTE"&&this._baseDocument.applyEdits(r,[{text:i,range:{start:l,end:l}}])),t}_batchInsert(e,t,n){const r=this._insertRun;if(t.parent||!this.contains(e))return!1;const o=n?n.start:e.endTagStart===void 0?e.end:e.endTagStart,i=e.children,s=n?r?.items[0].node===n?r.start:i.indexOf(n):i.length;if(s<0||r&&r.parent!==e)return!1;const a=s-(r?r.start:s);if(r&&(a<0||a>r.items.length))return!1;const l=Ga(t),c=r??(this._insertRun={parent:e,start:s,offset:o,items:[],length:0});return i.splice(s,0,t),t.parent=e,c.items.splice(a,0,{node:t,text:l}),c.length+=l.length,!0}_flushInsertRun(e){const t=this._insertRun;if(!t)return;this._insertRun=void 0;let n=t.offset;for(const{node:r,text:o}of t.items)nr(r,n-r.start),n+=o.length;nr(t.items[t.items.length-1].node,0,t.length),e!=="FROM_REMOTE"&&this._baseDocument.applyEdits(e,[{text:t.items.map(r=>r.text).join(""),range:{start:t.offset,end:t.offset}}])}getContext(e){return e.closest(t=>Pd(t.tag))}replaceWithHtml(e,t,n=[e]){const r=this._baseDocument,o=u=>{const d=this.getContext(u);if(d)return d.isDirty=!0,Promise.resolve().then(()=>{d.isDirty=!1}),!1;if(u.type!==I.HTML){if(!u.closed)return!1}else return!u.content||!tx(u.content)&&!nx.test(u.content);return!0};if(!this._root)return this.initialize(r.getText(),!1,n);let i={start:e.oldPosition,end:e.oldEnd},s=p2(i,this._root);if(!s)return this.initialize(r.getText(),!1,n);let a,l,c;do{const u=T2(e,s);a=this._baseDocument.getText(u),[l,...c]=hn(a).roots}while((!l||c.length||!o(s)||!o(l)||l.end-l.start!==a.length)&&(s=s.parent));if(!s||!s.parent)return this.initialize(r.getText(),!1,n);this.replaceChild(s.parent,{node:l,text:a},s,t,n)}replaceChild(e,t,n,r,o){const{text:i,node:s}=t,a=e.children,l=a.indexOf(n);if(l<0)return st("referenced node is not a child of parent node",s);a.splice(l,1,s);const c=i.length-(n.end-n.start);return s.parent=e,nr(s,n.start-s.start,c),this._baseDocument.getText(s)!==i?(st("Error while sync"),s):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(gl(n,s,!1,void 0,o&&Qb(o))),n.parent=void 0,s)}remove(e,t){const n=this.contains(e),r=e.parent;if(!r)return st("node is not in tree");const o=r.children,i=o.indexOf(e);if(i<0)return st("referenced node is not a child of parent node");const s=e.end-e.start;nr(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([W2(e)]),t!=="FROM_REMOTE"&&this._baseDocument.applyEdits(t,[{text:"",range:{start:e.start,end:e.end}}])),e.parent=void 0}setAttribute(e,t,n,r){const o=this.contains(e),i=e.attributes||(e.attributes=Object.create(null));if(typeof n=="string"?i[t]=n:delete i[t],e.start===e.startTagEnd)return;const s=$g(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=g2(e),c=s.length-a,u=e.start;nr(e,c,c),e.start=u,o&&this._baseDocument.applyEdits(r,[{text:s,range:l}])}setContent(e,t,n){const r=this.contains(e),o=e.start,i=e.end;e.content=t;const s=e.end-e.start;if(!s)return;const a=Ga(e,o),l=a.length-s;nr(e,0,l),r&&this._baseDocument.applyEdits(n,[{text:a,range:{start:o,end:i}}])}replaceWith(e,t,n){const r=e.parent;if(r){let o=Ar(e);this.remove(e,n);for(let i=t.length-1;i>=0;i--){const s=t[i];this.insertBefore(r,s,o,n),o=s}}return t}replaceWithEx(e,t,n){if(typeof t=="string"){const i=hn(t).roots;i.length!==1&&st("Error while replacing with string"),t=i[0]}const r=e.children;this.replaceWith(e,[t],n);let o=null;for(let i=r.length-1;i>=0;i--){let s=r[i];this.insertBefore(t,s,o,n),o=s}return t}setHidden(e,t,n){t?e.parent&&this.remove(e,n):this.replaceWith(e,[...e.children],n)}applyMutations(e){this._baseDocument.beginUpdate();try{for(const t of e){if(this._applyingMutation=t,t.type==="Add"){const n=t.parent||this.root,r=t.nextSibling||null;this._batchInsert(n,t.node,r)||(this._flushInsertRun(rr),this.insertBefore(n,t.node,r,rr));continue}switch(this._flushInsertRun(rr),t.type){case"Remove":this.remove(t.node,rr);break;case"Set":this.setContent(t.node,t.data,rr);break;case"Hidden":this.setHidden(t.node,t.value,rr);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,rr)}}}finally{try{this._flushInsertRun(rr)}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function ox(e,t){return e.replace(new RegExp(`<(?=/${t.tagName}${Va})`,"gi"),"<")}function ay(e,t){return nb(e)??ox(e.textContent??"",t)}function yn(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!Jg.has(e.getAttribute("type")??"")}var ix=4,sx=3,ax=80,ly={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},lx={[I.HTML]:"text",[I.ELEMENT]:"element",[I.ROOT]:"root",[I.COMMENT]:"comment",[I.DOCTYPE]:"doctype",[I.ADVANCED]:"advanced"},cx=new Set(["head","body"]);function zd(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function cy(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,sx);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,ax)}function ux(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return cy(e.tag,zd(t.id),zd(t.class),zd(t.em))}function uy(e){return e instanceof Element?cy(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function Ud(e,t,n){const r=[];let o=e;for(;o&&r.length<ix;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function dx(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&cx.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==I.ROOT?"outside":t??"top"}function jd(e,t,n){const r=t(e);return{path:Ud(e,o=>o.parent,ux),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:Ud(r,o=>o.parentNode,uy)}:{},inMap:!!r,hasParent:!!e.parent,kind:lx[e.type]??String(e.type),root:dx(e)}}function dy(e,t,n){if(!e)return;const r=i=>jd(i,t,n);if(e.type==="Update")return{type:ly.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:ly[e.type]??e.type,node:r(e.node)};return e.type==="Add"||e.type==="Move"?(e.parent&&(o.parent=r(e.parent)),e.nextSibling&&(o.reference=r(e.nextSibling))):e.node.parent&&(o.parent=r(e.node.parent)),o}function Vd(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===I.ROOT}function fx(e,t,n,r){const o=s=>jd(s,a=>r.getByNode(a),Vd),i=Ud(e,s=>s.parentNode,uy);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function mx(e,t){const n=r=>jd(r,o=>t.getByNode(o),Vd);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function hx(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function fy(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var my=Object.create(null);function hy(e,t){const n=my[e]||(my[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[hx(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function In(e){return e.nodeType===Node.ELEMENT_NODE}function py(e){return In(e)?e.tagName==="AMP-IMG"?!0:hy(e.tagName.toLowerCase(),"src"):!1}function Gd(e){return In(e)&&!e.ownerSVGElement}function px(e){return e.tagName==="IMG"}function gx(e){return e.tagName==="FORM"}function bx(e){return e.tagName==="SCRIPT"}function yx(e){return e.tagName==="STYLE"}function Xd(e){return e.nodeType===Node.DOCUMENT_NODE}function gy(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var ms;(function(e){function t(f){return f.constructor.name==="CSSStyleRule"}e.isStyleRule=t;function n(f){return f.constructor.name==="CSSImportRule"}e.isImportRule=n;function r(f){return f.constructor.name==="CSSMediaRule"}e.isMediaRule=r;function o(f){return f.constructor.name==="CSSFontFaceRule"}e.isFontFaceRule=o;function i(f){return f.constructor.name==="CSSPageRule"}e.isPageRule=i;function s(f){return f.constructor.name==="CSSKeyframesRule"}e.isKeyframesRule=s;function a(f){return f.constructor.name==="CSSKeyframeRule"}e.isKeyframeRuleRule=a;function l(f){return f.constructor.name==="CSSNamespaceRule"}e.isNamespaceRule=l;function c(f){return f.constructor.name==="CSSCounterStyleRule"}e.isCounterStyleRule=c;function u(f){return f.constructor.name==="CSSSupportsRule"}e.isSupportsRule=u;function d(f){return f.constructor.name==="CSSFontFeatureValuesRule"}e.isFontFeatureValuesRuleRule=d})(ms||(ms={}));function hs(e){return e.nodeType===Node.COMMENT_NODE}function oo(e){return e.nodeType===Node.TEXT_NODE}function vx(e){return e.tagName==="TABLE"}async function Ex(e,t=5e3){return typeof e.complete<"u"&&!e.complete?new Promise((n,r)=>{setTimeout(n,t),e.onload=()=>n(getComputedStyle(e)),e.onerror=o=>{}}):getComputedStyle(e)}function Pt(e){if(In(e))return by(e);if(Xd(e))return[...e.childNodes].map(r=>Pt(r)).join("");if(gy(e))return fy(e);const t=Ka(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function Sx(e){const t=e.tagName.toLowerCase();let n="";for(const r of e.attributes){const o=r.name,i=r.value;n+=i===""&&o!=="em"&&!hy(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function kt(e){let t="";for(const n of e.childNodes)t+=nb(n)??Pt(n);return t}function by(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=Sx(e);return ld.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:yx(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${kt(e)}</${t}>`}function wx(e){return typeof e=="string"?e:""}function yy(e,t,n){if(n&&e.type===I.DOCTYPE&&n?.type!==I.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=Qa(e,n)?bd(e.content||""):eo(e,!1,"dormant");t.set(e,r);for(const o of e.children){const i=yy(o,t,e);r.appendChild(i)}return r}function jo(e,t,n,r){let o=e,i;for(let s=e.parentNode;s&&s!==t;s=s.parentNode)r?.(s)?i=s.parentNode?{host:s.parentNode,before:s}:void 0:n(s)?i??(i={host:s,before:o}):i=void 0,o=s;return i}function _x(e,t,n=Vd,r=()=>!1,o=()=>!1){let i,s;const a=new Map,l=()=>{const u=dy(i,d=>t.getByNode(d)||a.get(d),n);return u&&{...u,stage:"dom",...s?{cause:s}:{}}},c=u=>{s=u;try{st("Element node not in tree")}finally{s=void 0}};return Hb(l,()=>Cx(e,t,a,u=>i=u,c,r,o))}function Cx(e,t,n,r,o,i,s){const a=[],l=new Map,c=v=>t.getByNode(v)||n.get(v),u=v=>{if(v){const w=v.lastChild;let _=(w?c(w)?.nextSibling:c(v)?.firstChild)||void 0;for(;_&&l.has(_);)_=_.nextSibling||void 0;return _?.parentNode===c(v)?_:void 0}},d=new Map(e.flatMap(v=>v.type==="Update"?[[v.next,v.prev]]:[])),f=new Set(e.flatMap(v=>{if(v.type!=="Move")return[];const w=d.get(v.node);return[t.getByNode(v.node)??(w&&t.getByNode(w))]})),h=(v,w)=>{for(let _=$b(v);_;_=$b(_)){const A=d.get(_),b=c(_)??(A&&c(A));if(b&&!l.has(b)&&!f.has(b)&&w.contains(b)){const g=jo(b,w,i,s);if(g)return g;let E=b;for(;E.parentNode&&E.parentNode!==w;)E=E.parentNode;return{host:w,before:E}}}},m=v=>!!t.getByElement(v)||i(v)||s(v),p=(v,w,_)=>{const A=h(v,_);if(!A)return{host:_,before:u(w)};let b=A.before.nextSibling??void 0;for(;b&&(l.has(b)||f.has(b)||!m(b));)b=b.nextSibling??void 0;return{host:A.host,before:b}};for(const v of e)switch(r(v),v.type){case"Add":{let{node:w,nextSibling:_}=v;const A=w.parent;if(A){const b=yy(w,n,A);if(A.type===I.ROOT)a.push(ae.add(null,b,_&&c(_)));else{const g=c(A);if(g){let E,T=g;for(;_;){const y=n.get(_);if(y){const C=jo(y,g,i,s);E=C?.before??y,T=C?.host??g;break}let S=t.getByNode(_);if(S&&!l.has(S)&&g.contains(S)){E=S;const C=jo(S,g,i,s);if(C){T=C.host,E=C.before;break}for(;S.parentNode!==g&&S.parentNode;)S=S.parentNode,In(S)&&S.replaceWith(...S.childNodes);break}_=Ar(_)||void 0}E||({host:T,before:E}=p(w,A,g)),a.push(ae.add(T,b,E))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:w,nextSibling:_}=v;const A=w.parent,b=c(w);if(A&&b)if(A.type===I.ROOT)a.push(ae.move(null,b,_&&c(_)));else{const g=c(A);if(g){let E,T=g;for(;_;){const y=n.get(_);if(y){const C=jo(y,g,i,s);E=C?.before??y,T=C?.host??g;break}let S=t.getByNode(_);if(S&&!l.has(S)&&g.contains(S)){const C=jo(S,g,i,s);if(C)T=C.host,S=C.before;else for(;S.parentNode!==g&&S.parentNode;)S=S.parentNode;S||st("error while calculating next sibling"),E=S;break}_=Ar(_)||void 0}E||({host:T,before:E}=p(w,A,g)),a.push(ae.move(T,b,E))}else o("parent-not-mapped")}else o(A?"node-not-mapped":"no-parent");break}case"Remove":{const w=v.node,_=c(w);if(w.type===I.HTML&&!w.content)continue;_?(l.set(_,w),a.push(ae.remove(_))):o("node-not-mapped");break}case"Update":{const w=v.prev,_=c(w);_?n.set(v.next,_):v.soft||o("node-not-mapped");break}case"Attribute":{const w=c(v.node);w?a.push(ae.attribute(w,v.name,v.value)):o("node-not-mapped");break}case"Set":{const w=v.node,_=c(w);_?w.type===I.HTML&&Tx(_,String(v.data??""))||gy(_)&&w.type===I.DOCTYPE?a.push(ae.set(_,v.data||"")):e.push(ae.remove(w),ae.add(w.parent||null,w,Ar(w)||void 0)):o("node-not-mapped");break}}return{mutations:a,toAdd:n,toRemove:l,isService:i}}function Tx(e,t){return oo(e)?!t.includes("<")||yn(e.parentNode)||oo(wr(t)):!1}function Ax({mutations:e}){return lb(e.flatMap(t=>t.type==="Add"?[t.node]:[]))}var kx=["src","type"];function Lx({mutations:e}){const t=new Set,n=r=>{r instanceof HTMLScriptElement&&r.isConnected&&!el(r)&&t.add(r)};for(const r of e)r.type==="Add"||r.type==="Move"?(n(r.parent),n(r.node.parentNode)):r.type==="Remove"||r.type==="Set"?n(r.node.parentNode):r.type==="Attribute"&&kx.includes(r.name.toLowerCase())&&n(r.node);return[...t]}function Nx(e,t,n){const r=e.data,o=Math.min(r.length,t.length),i=e.ownerDocument.getSelection(),s=!!i?.isCollapsed&&i.anchorNode===e&&i.anchorOffset===0&&t.length>r.length&&t.endsWith(r);let a=0;for(;!s&&a<o&&r[a]===t[a];)a++;let l=0;for(;l<o-a&&r[r.length-1-l]===t[t.length-1-l];)l++;const c=r.length-a-l,u=t.slice(a,t.length-l),d=!!i?.isCollapsed&&i.anchorNode===e&&i.anchorOffset>=a&&i.anchorOffset<=a+c,f=d&&n.get(e)===i.anchorOffset;e.replaceData(a,c,u),u&&i?.anchorNode!==e&&n.set(e,a),d&&i.collapse(e,f?a:a+u.length)}function vy(e){const t=e.ownerDocument?.getSelection();return t?.anchorNode&&e.contains(t.anchorNode)?t:null}function xx(e,t){const n=e?.ownerDocument;if(!e||!n)return null;if(e.nodeType===Node.TEXT_NODE)return e;const r=n.createTreeWalker(e,NodeFilter.SHOW_TEXT);let o=null;for(let i=r.nextNode();i&&(o=i,!!t);i=r.nextNode());return o}function Ox(e,t,n){const r=vy(t),{anchorNode:o,anchorOffset:i,focusNode:s,focusOffset:a}=r??{};if(e.insertBefore(t,n),!(!r||!o||!s))try{const l=t.contains(o),c=t.contains(s);r.setBaseAndExtent(l?o:r.anchorNode??o,l?i??0:r.anchorOffset,c?s:r.focusNode??s,c?a??0:r.focusOffset)}catch{}}function Rx(e){return!!e&&e.prev!==e.next&&e.prev.at(-1)!==e.next.at(-1)}function Mx(e){return!!e&&e.next.length>e.prev.length&&e.next.endsWith(e.prev)}function Kd(e,t,n,r){let o;for(let i=t?e.previousSibling:e.nextSibling;i;i=t?i.previousSibling:i.nextSibling){if(n?.has(i))continue;const s=xx(i,t),a=s?.parentElement?.closest("a")??s?.parentElement?.closest("em-replace");if(!s&&o)break;if(!s){o=i;continue}if(o&&!(t&&i===s&&Rx(r?.get(s))))break;return a&&i.contains(a)?{beside:a}:{text:s}}return o?{beside:o}:null}function Ey(e,t,n){const r=t.parentNode;r&&e.collapse(r,[...r.childNodes].indexOf(t)+(n?1:0))}function Px(e,t,{removed:n,rewrites:r}){const o=vy(e),i=o&&Kd(e,!0,n,r),s=o&&!i?Kd(e,!1,n,r):null;if(e.parentNode?.removeChild(e),!!o)try{if(i?.text){const a=t.get(i.text)??i.text.length;t.set(i.text,a),o.collapse(i.text,a)}else{if(i)return Ey(o,i.beside,!0),i.beside.nodeName==="BR"?i.beside:void 0;s?.text?o.collapse(s.text,0):s&&Ey(o,s.beside,!1)}}catch{}}function Ix(e){const t=e.ownerDocument?.getSelection(),{anchorNode:n,anchorOffset:r}=t??{};return!!t?.isCollapsed&&n===e.parentNode&&n?.childNodes[(r??0)-1]===e}function Sy(e,t,{removed:n,moved:r,edited:o,rewrites:i}){if(e.nodeType!==Node.ELEMENT_NODE)return{node:e,offset:t};const[s,a]=[e.childNodes[t-1],e.childNodes[t]];return![s,a].some(l=>l&&n.has(l))||s&&r.has(s)?{node:e,offset:t}:s?.nodeType===Node.TEXT_NODE?{node:s,offset:s.length}:(!s||n.has(s))&&a?.nodeType===Node.TEXT_NODE&&!r.has(a)&&(!o.has(a)||Mx(i.get(a)))&&(!n.has(a)||Kd(a,!0,n,i)?.text)?{node:a,offset:0}:{node:e,offset:t}}function Dx(e,t){const n=e?.getSelection(),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=n??{};if(!(!n||!r||!i||!t.removed.size)&&!/^(INPUT|TEXTAREA)$/.test(e?.activeElement?.tagName??""))try{const a=Sy(r,o??0,t),l=Sy(i,s??0,t);(a.node!==r||l.node!==i)&&n.setBaseAndExtent(a.node,a.offset,l.node,l.offset)}catch{}}function wy(e,t,n){if(t?.parentNode===e)return[e,t];const r=t&&n?jo(t,e,n):void 0;return r&&e.contains(r.host)?[r.host,r.before]:[e,null]}function Bx(e){const t=new Map;for(const n of e)n.type==="Set"&&n.node instanceof Text&&!yn(n.node.parentNode)&&t.set(n.node,{prev:n.node.data,next:wr(String(n.data??"")).textContent??""});return t}function Hx({mutations:e,toAdd:t,toRemove:n,isService:r},o,i){const s=f=>new Set(e.flatMap(h=>h.type===f?[h.node]:[])),a=s("Remove"),l={removed:a,moved:s("Move"),edited:s("Set"),rewrites:Bx(e)};Dx([...a].find(f=>f.ownerDocument)?.ownerDocument,l);const c=(f,h,m)=>{if(!f)return st("Element node not in tree");if(!(f instanceof Element))return st("node is not HTMLEement");const p=m===void 0?void 0:ob(f,h,wx(m));if(!(h.toLowerCase()==="type"&&nN(f,p??null)))try{p!=null?er(f,h,p):f.removeAttribute(h)}catch{}},u=new Map;let d;for(const f of e)switch(f.type){case"Add":{const{node:h,nextSibling:m,parent:p}=f;if(p){const[v,w]=wy(p,m,r);v.insertBefore(h,w)}break}case"Move":{const{node:h,nextSibling:m,parent:p}=f;if(p){const[v,w]=wy(p,m,r);Ox(v,h,w)}break}case"Remove":{const{node:h}=f;if(h instanceof Document)for(const m of[...h.childNodes])m.parentNode?.removeChild(m);else d=Px(h,u,l)??d;break}case"Attribute":c(f.node,f.name,f.value);break;case"Set":{const{node:h,data:m}=f;if(h instanceof Comment)h.data=m;else if(h instanceof Text){const p=String(m??"");yn(h.parentNode)?UL(h,p):Nx(h,wr(p).textContent??"",u)}break}}for(const[f,h]of n)o.remove(h);for(const[f,h]of t){const m=o.getByElement(h);m&&o.remove(m),o.set(f,h)}if(i&&d?.isConnected&&Ix(d))try{i(d)}catch{}}var Fx=class{constructor(){k(this,"_byKey",new WeakMap),k(this,"_byValue",new WeakMap)}get(e){return this._byKey.get(e)}getByValue(e){return this._byValue.get(e)?.deref()}set(e,t){this._byKey.set(e,t),this._byValue.set(t,new WeakRef(e))}delete(e){const t=this.get(e);t&&(this._byKey.delete(e),this._byValue.delete(t))}deleteByValue(e){const t=this.getByValue(e);t&&(this._byKey.delete(t),this._byValue.delete(e))}},$x=class{constructor(){k(this,"_map",new Fx)}getByNode(e){return this._map.getByValue(e)}getByElement(e){return this._map.get(e)}set(e,t){this._map.set(t,e)}remove(e,t=!0){const n=this._map.getByValue(e);if(n&&this._map.delete(n),t){const r=e.children;for(let o=0,i=r.length;o<i;o++)this.remove(r[o])}}};function _y(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function Wx(e){let t;for(let n=e;n;n=n.parent)qd(n)&&(t=n);return t}function qx(e){return e.type==="Update"?e.prev:e.node}function zx(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=Wx(o.next);if(!i?.parent||n.has(i))continue;const s=e.find(c=>c.type==="Update"&&c.next===i),a=s?.type==="Update"?t.getByNode(s.prev):void 0;if(s?.type!=="Update"||!a?.isConnected)continue;const l=t.getByNode(o.prev);(!l||!l.isConnected||!a.contains(l))&&n.set(i,s.prev)}if(!n.size)return e;const r=[];for(const o of e){const i=qx(o),s=o.type==="Update"||o.type==="Remove"?t.getByNode(i):void 0;let a=!1;for(const[l,c]of n){const u=t.getByNode(c);if(_y(i,l)||_y(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...ae.recreate(c,l.parent,l,Ar(l)||void 0));break}}a||r.push(o)}return r}var Yd;(function(e){function t(r,o,i=(s,a)=>s===a){const s=r.length;let a=s===o.length;if(a){for(let l=0;l<s;l++)if(!i(r[l],o[l])){a=!1;break}}return a}e.isEqual=t;function n(r,o,i=(s,a)=>s===a){const s=new Set,a=new Set;for(const l of r)for(const c of o)i(l,c)&&(s.add(l),a.add(c));return{added:o.filter(l=>!a.has(l)),removed:r.filter(l=>!s.has(l))}}e.compare=n})(Yd||(Yd={}));var bl=new Set;function kr(e,t){bl.has(e)||(bl.size||Promise.resolve().then(()=>bl.clear()),bl.add(e),z.send(ue.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var Cy=new WeakMap;function Ux(e){const t=[],n=new Set(e);function r(o){if(n.has(o)){const{parentNode:i,nextSibling:s}=o;i&&n.has(i)&&r(i),s&&n.has(s)&&r(s),t.push(o),n.delete(o)}}for(const o of n)r(o);return t}function jx(e){return{added:e,removed:[],reparented:[],reordered:[]}}function Vx(e,t){let n=Cy.get(e);if(!n){let l=function(c){for(const u of c)o.push(u),t(u)?i.push(u):l(u.childNodes)};var r=l;let{added:o,removed:i,reparented:s=[],reordered:a=[]}=e;o=[...o],i=[...i],s&&l(s),a&&l(a),o=Ux(o),n={added:o,removed:i},Cy.set(e,n)}return n}function Ty(e,t){const n={};for(const[r,o]of Object.entries(t))n[r]={value:o,enumerable:!0};return Object.create(e,n)}function Ay(e){return new Set((e??"").split(/\s+/).filter(Boolean))}function Gx(e,t){const n=i=>{for(let s=i;s&&!t.isMapped(s);s=s.parentNode)if(s instanceof Element&&t.isServicePanel(s))return!0;return!1},r=i=>t.isWrapper(i)||n(i),o=[];return{summaries:e.map(i=>{const s=new Set(i.added.filter(r));return o.push(...[...s].filter(a=>!a.parentNode||!s.has(a.parentNode))),Ty(i,{added:i.added.filter(a=>!s.has(a)),reparented:i.reparented?.filter(a=>!n(a)),reordered:i.reordered?.filter(a=>!n(a)),characterDataChanged:i.characterDataChanged?.filter(a=>!n(a)),attributeChanged:Xx(i,t,r)})}),service:o}}function Xx(e,t,n){const r={};for(const[o,i]of Object.entries(e.attributeChanged??{})){if(t.isServiceAttribute(o))continue;const s=i.filter(a=>!n(a)&&!(o==="class"&&Kx(e,a,t)));s.length&&(r[o]=s)}return r}function Kx(e,t,n){const r=Ay(e.getOldAttribute(t,"class")),o=Ay(t.getAttribute("class")),i=[...r,...o].filter(s=>r.has(s)!==o.has(s));return i.length>0&&i.every(s=>n.isServiceClass(s))}var ky=Object.getPrototypeOf(customElements),Yx=Reflect.get(ky,"define"),Zd=new ge,Qd=new ge,Zx=Zd.event,Qx=Qd.event,Jx=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function eO(e){Zd.fire();try{return e()}finally{Qd.fire()}}ky.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){Zd.fire();try{super(...i)}finally{Qd.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of Jx){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return eO(()=>s.call(this,...a))}})}Yx.call(this,e,o,n)};function Ly(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,Ly(s,t,n,i));return i}function Vo(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])Vo(r,t,e)}var ir="___em-internal";function Jd(e,t=!0,n=!1){let r=e.content;switch(e.type){case I.ROOT:{const o=document.implementation.createHTMLDocument();for(const i of[...o.childNodes])o.removeChild(i);if(t)for(const i of e.children)o.appendChild(Jd(i,t,n));return o}case I.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case I.COMMENT:return document.createComment(r||"");case I.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=cd(e),i.firstChild}const o=document.createElement(e.tag);if(e.attributes)for(const i of e.attributeNames){const s=e.attributes[i];try{er(o,i,typeof s=="string"?s:"")}catch{}}if(t)for(const i of e.children)o.appendChild(Qa(i,e)?bd(i.content||""):Jd(i,t,n));return o}return document.createTextNode("<");case I.HTML:return wr(r||"");default:throw new Error("unsupported node")}}function tO(e){return hn(e).roots.map(t=>Jd(t,!0,!0))}function Ny(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function nO(e){let t;switch(e){case"tr":t=document.createElement("table");break;case"td":t=document.createElement("tr");break;case"head":case"body":t=document.createElement("html");break;case"DocumentType":case"html":return Ny();default:t=document.createElement("div")}return t}function rO(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function yl(e){if(e instanceof Element)return by(e);if(e instanceof Document)return[...e.childNodes].map(r=>yl(r)).join("");if(e instanceof DocumentType)return rO(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(r=>yl(r)).join("");const t=Ka(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function xy(e,t=e.parentNode){return yn(t)?ay(e,t):yl(e)}function oO(e,t,n){let r=1;const o=new Xb,i=new Map,s=new Map,a=new Map;let l=!1;const c=Ly(e,h=>{const m=String(r++);let p;if(py(h)||h instanceof Element&&h.hasAttribute("src")){const v=document.createElement(h.tagName);for(const{name:w,value:_}of h.attributes){const A=ib(h,w,_);A!==null&&er(v,w==="src"?"___src":w,A)}p=v}else p=h.cloneNode(),hO(h,p);if(p)p instanceof DocumentType&&(l=!0),a.set(p,m),i.set(h,m);else return document.createDocumentFragment();return p},(h,m)=>h&&m&&h.appendChild(m));let u=l?Ny():document.createDocumentFragment();u.appendChild(c),Vo(u,(h,m)=>{if(m){const p=a.get(h);if(yn(m))return;if(!p)return st("Error while mapping: not found element");h instanceof Element?h.setAttribute(ir,p):m.insertBefore(document.createComment(`${ir}${p}`),h)}});let d=tO(t(u)).filter(h=>!!h),f;if(!d.length)return o;if(u instanceof Document){const h=nO("html");for(const m of d)h.appendChild(m);f=h}else{f=document.createDocumentFragment();for(const h of d)f.appendChild(h)}return Vo(f,(h,m)=>{let p=null;if(h instanceof HTMLHtmlElement)s.set("1",h);else{if(h instanceof Element&&h.hasAttribute(ir)){p=h.getAttribute(ir),p&&s.set(p,h);return}const v=h.previousSibling;if(v instanceof Comment&&(!(h instanceof Comment)||h.data.indexOf(ir)<0)){const w=v.data,_=w.indexOf(ir);_>=0&&(p=w.substring(_+14),p&&s.set(p,h))}}}),Vo(f,h=>{if(h instanceof Element&&h.hasAttribute(ir)){h.removeAttribute(ir);return}h instanceof Comment&&h.data.indexOf(ir)>=0&&h.remove()}),Vo(e,h=>{const m=i.get(h),p=s.get(m);p&&(o.set(h,p),yn(h)&&h.firstChild&&p.firstChild&&o.set(h.firstChild,p.firstChild))}),o}function iO(e){const t=Oy(e.cloneNode()),n=dd(t),r=n.length;return t.startTagEnd=t.startTagEnd===void 0?void 0:n.indexOf(">",Math.max(n.lastIndexOf("'"),n.lastIndexOf('"')))+1,t.endTagStart=t.endTagStart===void 0?void 0:t.endTagStart+(r-t.end),t.end=r,t.type=I.ELEMENT,t}var Go;(function(e){e.HiddenResult=(function(t){return t[t.none=0]="none",t[t.node=1]="node",t[t.children=2]="children",t[t.all=3]="all",t})({})})(Go||(Go={}));function Oy(e){if(oo(e)&&yn(e.parentNode))return Ry(ay(e,e.parentNode));const t=Ka(e);if(t!==void 0)return Ry(t);let n=hn(yl(e.cloneNode())).roots[0];return n||(n=new Tt(0,0,[]),n.type=I.HTML,n.content=""),n}function Ry(e){const t=new Tt(0,e.length,[]);return t.type=I.HTML,t.content=e,t}function My(e,t=Go.HiddenResult.node){if(t&Go.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&Go.HiddenResult.children)for(const n of e.children)My(n,Go.HiddenResult.all)}function sO(e,t=[],n){let r;return e instanceof Element?r=iO(e):r=Oy(e),r.children=t,r.parent=void 0,n&&My(r,n(r)),r}function ef(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=ef(o,t,n),r)return r}function Py(e,t,n,r){kr("tree-node-out-of-place",()=>({mutation:n()}))}function Iy(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(Py("insertBefore",c,()=>fx(e,u,c,t),u),!1);for(;i;){const c=t.getByElement(i)??(n&&i===n.node?n.treeNode:void 0);if(c){if(a){let u=t.getByNode(a);if(u&&i.contains(u)&&l(a,c))return{parentTreeNode:c,nextSiblingTreeNode:a};a=void 0}for(;s;){const u=ef(s,t,r);if(u&&l(u,c))return{parentTreeNode:c,nextSiblingTreeNode:u};s=s.nextSibling}return{parentTreeNode:c}}if(!a)for(;s;){const u=ef(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function aO(e,t){const n=[],r=e.attributeChanged;if(r)for(const o of Object.keys(r)){const i=r[o];for(const s of i){const a=t.getByElement(s);if(a){const l=s.getAttribute(o);n.push(ae.attribute(a,o,typeof l=="string"?l:void 0))}}}return n}function Dy(e,t){return e.type===I.HTML?Ka(t)??`<!--${t.data}-->`:t.data}function lO(e,t){const n=[],r=e.characterDataChanged;if(r)for(const o of r){const i=t.getByElement(o);i&&n.push(ae.set(i,hs(o)?Dy(i,o):xy(o)))}return n}function cO(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function uO(e){if(e.nodeType!==Node.TEXT_NODE)return!1;const t=e.parentElement;if(!t||t.closest(".em-element-list-ul, .em-element-list-ol")&&t.closest(".em-element-list-bullet"))return!1;const n=t.closest('[class*="em-element-"]:not(.em-element-resize-img-container)');return!(!n||[".em-element-list-ul",".em-element-list-ol",".em-element-custom-table"].some(r=>n.matches(r)))}function dO(e,t,n,r){const o=s=>{let a=s.parentNode;if(!a||a===n?.node||t.getByElement(a))return!1;for(;a&&a!==n?.node&&!t.getByElement(a);a=a.parentNode)if(!r(a))return!1;return!0},i=new Set;for(const s of wO(e)){const a=t.getByElement(s),l=a?.parent?.children,c=a&&l?l.indexOf(a):-1;if(!a||!l||c<0||!o(s))continue;const{parentTreeNode:u,nextSiblingTreeNode:d}=Iy(s,t,n)||{};u===a.parent&&d===l[c+1]&&i.add(s)}return i}function fO(e,t,n,r=new Set){const o=[],i=new Set,s=new Map,a=(l,c)=>{const u=s.get(l);return u?u===c:l.parent===c&&c.children.includes(l)};for(const l of e){const{added:c,removed:u}=Vx(l,d=>!!t.getByElement(d));for(const d of u)if(!i.has(d)&&!r.has(d)){const f=t.getByElement(d);if(f){const h=s.get(f)??f.parent;!h||!a(f,h)?Py("remove",f,()=>mx(f,t)):o.push(ae.remove(f)),s.delete(f),i.add(d)}}for(const d of c){if(r.has(d)||uO(d))continue;const f=cO(d);if(f&&!t.getByElement(f))continue;const{parentTreeNode:h,nextSiblingTreeNode:m}=Iy(d,t,n,p=>i.has(p),a)||{};if(h){let p=t.getByElement(d);p||(p=sO(d),t.set(p,d)),o.push(ae.add(h,p,m)),s.set(p,h),i.delete(d)}}o.push(...aO(l,t)),o.push(...lO(l,t))}return o}function mO(e,t,n){const r=[],o=t.attributes,i=n.attributes;for(const s of o){const a=s.name,l=i.getNamedItem(a==="src"?"___src":a);if(l){const c=l.value;c!==s.value&&r.push(ae.attribute(e,a,c))}else r.push(ae.attribute(e,a,void 0))}for(const s of i){const a=s.name==="___src"?"src":s.name;o.getNamedItem(a)||r.push(ae.attribute(e,a,s.value))}return r}function hO(e,t){if(!(!VL()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=ib(e,n,r);o===null?t.removeAttribute(n):o!==r&&er(t,n,o)}}function pO(e,t,n,r=()=>!1){const o=[],i=oO(e,n,t);return Vo(e,s=>{const a=t.getByElement(s);if(!a)return;const l=i.getByKey(s);if(l){if(l instanceof Element){if(!(s instanceof Element))return st("CharacterData mapped to Element");o.push(...mO(a,s,l))}else if(l instanceof CharacterData){if(!(s instanceof CharacterData))return st("Element mapped to CharacterData");const c=yn(s.parentNode)&&(s.parentNode?.nodeName==="SCRIPT"||!r(s));l.data!==s.data&&!c&&o.push(ae.set(a,hs(l)?Dy(a,l):xy(l,s.parentNode)))}else if(l instanceof Document&&!(s instanceof Document))return st("Node mapped to Document")}else{const c=d=>{for(const f of d.childNodes)if(i.getByKey(f)||!c(f))return!1;return!0};let u;return c(s)?(o.push(ae.hidden(a,!0)),u=!1):o.push(ae.hidden(a,!1)),u}}),o}function gO(e,t){let n,r=e;do{if(t.getByElement(r))return n;n=r}while(r=r.parentNode);for(;e.parentNode;)e=e.parentNode}function bO(e){return[...new Set(e)]}function yO(e,t){return bO([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>gO(n,t)||n))}function vO(e,t){let n=[];for(const r of e){const o=yO(r,t),i=s=>{for(let a=0;a<n.length;a++){const l=n[a];if(l.contains(s)||l===s)return;if(s.contains(l)){n.splice(a,1,s);return}}n.push(s)};for(const s of o)i(s)}return n}function EO(e,t,n){const r=vO(e,t),o=SO(e);return r.flatMap(i=>pO(i,t,n,o))}function SO(e){const t=new Set(e.flatMap(n=>[...n.added,...Object.values(n.characterDataChanged||{}).flat()]));return n=>{for(let r=n;r;r=r.parentNode)if(t.has(r))return!0;return!1}}function wO(e){return e.flatMap(t=>[...t.reparented??[],...t.reordered??[]])}function _O(e,t){return Ty(e,{reparented:e.reparented?.filter(n=>!t.has(n)),reordered:e.reordered?.filter(n=>!t.has(n))})}function CO(e,t,n,r,o=()=>!1){const i=dO(e,t,r,o),s=i.size?e.map(a=>_O(a,i)):e;return[...fO(e,t,r,i),...EO(s,t,n)]}function TO(e){const t=[],n=new Map;for(let r=e.length-1;r>=0;r--){const o=e[r];if(o.type==="Attribute"){const{node:i,name:s,value:a}=o;let l=n.get(i);l||n.set(i,l={}),l.hasOwnProperty(s)||(l[s]=a,i.attributes?.[s]!==a&&t.unshift(o))}else t.unshift(o)}return t}var AO=class{constructor(){k(this,"_map",new WeakMap)}getAttribute(e,t){return this._map.get(e)?.[t]}setAttribute(e,t,n){let r=this._map.get(e);r||this._map.set(e,r=Object.create(null)),r[t]=n}removeAttribute(e,t){let n=this._map.get(e);n&&delete n[t]}hasAttribute(e,t){return this._map.has(e)?.hasOwnProperty(t)}getAttributes(e){return this._map.get(e)}has(e){return this._map.has(e)}replaceNode(e,t){const n=this._map.get(e);n&&(this._map.delete(e),this._map.set(t,n))}},By=class{constructor(e=10){k(this,"_max",void 0),k(this,"_cache",new Map),this._max=e}get(e){let t=this._cache.get(e);return t!==void 0&&(this._cache.delete(e),this._cache.set(e,t)),t}put(e,t){this._cache.has(e)?this._cache.delete(e):this._cache.size==this._max&&this._cache.delete(this.first()),this._cache.set(e,t)}first(){return this._cache.keys().next().value}},Hy=new By(1e3);function Xo(e){if(e=e?.trim(),e){let t=Hy.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),Hy.put(e,t)),t}else return new Set}function vl(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var Fy=new By(1e3);function ps(e){e||(e="");let t=Fy.get(e);return t||(t=vl(e),Fy.put(e,t)),t}function kO(e,t,n){const r=e?e.split(" "):[],o=Xo(n),i=Xo(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function LO(e,t,n){const r=vl(e),o=ps(n),i=ps(t);let s=!1;for(const a of o){const l=o.getPropertyValue(a);r.getPropertyValue(a)===l&&i.getPropertyValue(a)!==l&&(s=!0,r.removeProperty(a))}return s?r.cssText:e}function $y(e,t,n,r){return typeof r!="string"?t:e==="class"?kO(t,n,r)||null:e==="style"?LO(t,n,r)||null:n!==t&&t===r?null:t}function NO(e,t){const n=Xo(e),r=Xo(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function xO(e,t){const n=vl(e),r=ps(t);let o=!1;for(const i of r){const s=r.getPropertyValue(i);n.getPropertyValue(i)!==s&&(o=!0,n.setProperty(i,s))}return o?n.cssText:e}function OO(e,t,n){return typeof n!="string"?t:e==="class"?NO(t,n)||null:e==="style"?xO(t,n)||null:t}function RO(e,t,n){if(!t)return t;const r=Xo(e),o=Xo(n),i=t.split(" "),s=i.filter(a=>(a=a.trim(),!r.has(a)||o.has(a)));return s.length!==i.length?s.join(" "):t}function MO(e,t,n){if(!t)return t;const r=ps(e),o=vl(t),i=ps(n);let s=!1;for(const a of o){const l=o.getPropertyValue(a);r.getPropertyValue(a)===l&&i.getPropertyValue(a)!==l&&(s=!0,o.removeProperty(a))}return s?o.cssText:t}function Wy(e){return e.type===I.ELEMENT&&e.start!==e.end}function qy(e){return e.filter(t=>t.type===I.ELEMENT)}function PO(e,t,n){const r=qy(e),o=qy(t),i=[],s=new Set,a=new Set,l=u=>{const d=(h,m)=>{const p=new Map;for(const v of h){const w=m.has(v)?void 0:u(v);w!==void 0&&p.set(w,p.has(w)?null:v)}return p},f=d(r,s);for(const[h,m]of d(o,a)){const p=f.get(h);m&&p&&(i.push([p,m,!0]),s.add(p),a.add(m))}};l(u=>typeof u.attributes?.id=="string"?`${u.tag}#${u.attributes.id}`:void 0),l(u=>Jn(u,!1,n)),l(u=>Jn(u,!0,n));const c=new Set(o.map(u=>u.tag));for(const u of c){const d=m=>m.filter(p=>p.tag===u),f=d(r).filter(m=>!s.has(m)),h=d(o).filter(m=>!a.has(m));if(f.length===h.length&&d(r).length===d(o).length){const m=f.length===1&&!f[0].attributes?.id&&!h[0].attributes?.id;h.forEach((p,v)=>i.push([f[v],p,m]))}}return i}var IO=class{constructor(e,t,n,r){k(this,"element",void 0),k(this,"name",void 0),k(this,"nextValue",void 0),k(this,"prevValue",void 0),this.element=e,this.name=t,this.nextValue=n,this.prevValue=r}},DO=class{constructor(e){k(this,"_nodeMap",void 0),k(this,"_map",new AO),k(this,"_hiddenMutations",[]),k(this,"_restore",[]),this._nodeMap=e}_onHiddenMutate(){try{for(const{name:e,element:t,prevValue:n,nextValue:r}of this._hiddenMutations){const o=this._nodeMap.getByElement(t);if(o)if(e==="class"){const i=RO(n,r,this._map.getAttribute(o,e))||null;i===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,i)}else if(e==="style"){const i=MO(n,r,this._map.getAttribute(o,e))||null;i===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,i)}else r===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,r)}}finally{this._hiddenMutations=[]}}onHiddenMutate(e){const t=this._hiddenMutations;for(const n of e){const r=n.attributeChanged;if(r)for(const o of Object.keys(r)){const i=r[o];for(const s of i)t.push(new IO(s,o,s.getAttribute(o),n.getOldAttribute(s,o)))}}}beforeCommit(e){this._onHiddenMutate();const t=[];for(const n of e){if(n.type==="Attribute"){const{name:r,node:o,value:i}=n,s=$y(r,i,o.attributes?.[r]||null,this._map.getAttribute(o,r));if(s!==i){t.push(ae.attribute(o,r,s));continue}}if(t.push(n),n.type==="Add"){const{node:r}=n,o=r.attributes;if(o)for(const i of Object.keys(o)){const s=o[i],a=this._map.getAttribute(r,i);if(a){const l=$y(i,s,null,a);l!==s&&t.push(ae.attribute(r,i,l))}}}}return t}onRemoteMutate(e){this._onHiddenMutate(),this._restore=[];const t=[];for(const n of e){if(n.type==="Attribute"){const{name:r,node:o,value:i}=n,s=OO(r,i,this._map.getAttribute(o,r));if(s!==i){t.push(ae.attribute(o,r,s));continue}}else n.type==="Update"?this._map.replaceNode(n.prev,n.next):n.type==="Add"&&n.replaces&&this._carryHidden(n.replaces,n.node,!0,ud());t.push(n)}return t}_carryHidden(e,t,n,r){if(e.type!==t.type||e.tag!==t.tag)return;const o=this._map.getAttributes(e);if(n&&!Pd(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))H2(s)||(this._map.setAttribute(t,s,a),i.push([s,e.attributes?.[s]??null]));i.length&&this._restore.push({node:t,carried:i})}if(n&&Jn(e,!1,r)===Jn(t,!1,r)){const i=t.children.filter(Wy);e.children.filter(Wy).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of PO(e.children,t.children,r))this._carryHidden(i,s,a,r)}restoreHidden(){const e=this._restore;this._restore=[];for(const{node:t,carried:n}of e){const r=this._nodeMap.getByNode(t);if(r instanceof Element)for(const[o,i]of n){if((t.attributes?.[o]??null)!==i){this._map.removeAttribute(t,o);continue}const s=this._map.getAttribute(t,o);typeof s=="string"&&r.setAttribute(o,s)}}}},BO=class{constructor(e){k(this,"_isMapped",void 0),k(this,"_foreign",new WeakSet),k(this,"_movedTo",new WeakMap),k(this,"_output",new WeakSet),k(this,"_service",new WeakSet),k(this,"_wrappers",new WeakSet),k(this,"_outer",new WeakSet),k(this,"_hasForeign",!1),k(this,"_hasOutput",!1),this._isMapped=e}observeLost(e){for(const t of e){for(const n of t.added)this.markForeign(n);for(const n of[...t.reparented??[],...t.reordered??[]])!this._foreign.has(n)&&n.parentNode&&this._movedTo.set(n,n.parentNode)}}markForeign(e){this._hasForeign=!0,this._foreign.add(e)}markOutput(e){this.markForeign(e),this._hasOutput=!0,this._output.add(e)}isOutput(e){return this._hasOutput&&this._isInside(e,this._output)}get hasOutput(){return this._hasOutput}isMarked(e){return this._foreign.has(e)}isOffModel(e){return this._hasForeign&&this._isInside(e,this._foreign)}isForeign(e){return this._hasForeign&&this._nearestMark(e)==="foreign"}markService(e){this._service.add(e)}markWrapper(e){this._wrappers.add(e)}isWrapper(e){return this._wrappers.has(e)}forgetService(e){this._service.delete(e)}markOuterWrapper(e){this._outer.add(e)}isOuterWrapper(e){return this._outer.has(e)}isService(e){return this._isInside(e,this._service)}markOf(e){return this._service.has(e)?"service":this._foreign.has(e)?"foreign":void 0}_nearestMark(e){for(let t=e;t&&!this._isMapped(t);t=t.parentNode){const n=this.markOf(t);if(n)return n}}_isInside(e,t){for(let n=e;n;n=n.parentNode){if(this._isMapped(n))return!1;if(t.has(n))return!0}return!1}isPlacedInForeign(e){return this._hasForeign&&this.isForeign(this._isMapped(e)?e.parentNode:e)}movedTo(e){return this._movedTo.get(e)}forget(e){this._movedTo.delete(e)}},zy="foreign-structure-in-commit";function HO(e,t,n){const r=[],o=(s,a)=>{t.isPlacedInForeign(s)&&r.push({kind:t.movedTo(s)?"moved-own-node":a,node:s})},i=s=>{o(s,"moved"),n(s)||s.childNodes.forEach(i)};for(const s of e)s.added.forEach(a=>o(a,"inserted")),[...s.reparented??[],...s.reordered??[]].forEach(i),new Set(Object.values(s.attributeChanged??{}).flat()).forEach(a=>t.isForeign(a)&&r.push({kind:"attribute",node:a})),(s.characterDataChanged??[]).forEach(a=>t.isForeign(a)&&r.push({kind:"text",node:a}));for(const s of e)[...s.added,...s.reparented??[],...s.reordered??[]].forEach(a=>t.forget(a));return r}function El(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var Uy="implicit-tbody-in-canvas";function FO(e,t){const n=new Set;for(const r of e)for(const o of r.added)o instanceof Element&&(o.tagName==="TBODY"?[o]:Array.from(o.querySelectorAll("tbody"))).filter(i=>!t(i)).forEach(i=>n.add(i));return[...n]}function $O(e,t){if(!e.length||t.has("implicit-tbody-in-canvas"))return;const[n]=e,r={kind:"implicit-tbody",kinds:["implicit-tbody"],count:e.length,node:El(n),parent:n.parentNode?El(n.parentNode):void 0};t.add(Uy),kr(Uy,()=>({foreign:r}))}function WO(e,t){if(!e.length)return;const[n]=e,r=[...new Set(e.map(({kind:i})=>i))],o={kind:n.kind,kinds:r,count:e.length,node:El(n.node),parent:n.node.parentNode?El(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add(zy),kr(zy,()=>({foreign:o})))}var tf="unaccounted-node";function jy(e,t,n,r){if(t.isMapped(e))return"own";const o=t.markOf(e)??n;return o==="foreign"||o==="service"?o:!r||t.isCanvasNode(e)?"interface":"unaccounted"}function Vy(e,t){let n,r=!1,o=t.isMapped(e);for(let i=e.parentNode;i;i=i.parentNode)r||(r=t.roots.has(i)),!o&&!n&&(o=t.isMapped(i),n=o?void 0:t.markOf(i));return jy(e,t,n,r||t.roots.has(e))}function Gy(e,t){const n=[],r=[];for(let o=e.lastChild;o;o=o.previousSibling)r.push([o,void 0,!1]);for(let o=r.pop();o;o=r.pop()){const[i,s,a]=o,l=a||t.roots.has(i),c=jy(i,t,s,l);c==="unaccounted"&&s!=="unaccounted"&&n.push(i);const u=c==="own"||c==="interface"?void 0:c;for(let d=i.lastChild;d;d=d.previousSibling)r.push([d,u,l])}return n}function qO(e){const t=new WeakSet,n=(e.ownerDocument??e).createTreeWalker(e,NodeFilter.SHOW_ALL);for(let r=n.nextNode();r;r=n.nextNode())t.add(r);return t}function zO(e,t){const n=new Set;for(const r of e)r.isConnected&&Vy(r,t)==="unaccounted"&&n.add(r);return[...n].filter(r=>!r.parentNode||!n.has(r.parentNode))}function UO(e){const t=e.nodeType===Node.ELEMENT_NODE?e.tagName.toLowerCase():e.nodeName,n=e.parentNode;return n?`${t}:${Array.prototype.indexOf.call(n.childNodes,e)+1}`:t}function Xy(e){const t=[];for(let o=e;o&&o.nodeType!==Node.DOCUMENT_NODE;o=o.parentNode)t.unshift(UO(o));const n=e instanceof Element?e.getAttribute("class"):null,r=e instanceof Element?e.tagName.toLowerCase():e.nodeName;return{path:t.join(" > "),tag:r,...n?{class:n}:{}}}function Ky(e,t){if(!e.length)return;const n={count:e.length,node:Xy(e[0])};t.has(tf)||(t.add(tf),kr(tf,()=>({unaccounted:n})))}var jO=Sr(((e,t)=>{(function(n,r){typeof e=="object"&&typeof t<"u"?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.MutationSummary={}))})(e,(function(n){"use strict";var r=(function(){function b(){this._nodes=[],this._values=[]}return b._isIndex=function(g){return+g===g>>>0},b._nodeId=function(g){var E=g[b._ID_PROP];return E||(E=g[b._ID_PROP]=b._NEXT_ID++),E},b.prototype.set=function(g,E){var T=b._nodeId(g);this._nodes[T]=g,this._values[T]=E},b.prototype.get=function(g){var E=b._nodeId(g);return E!==void 0?this._values[E]:void 0},b.prototype.has=function(g){return b._nodeId(g)in this._nodes},b.prototype.delete=function(g){var E=b._nodeId(g);delete this._nodes[E],this._values[E]=void 0},b.prototype.keys=function(){var g=[];for(var E in this._nodes)b._isIndex(E)&&g.push(this._nodes[E]);return g},b._ID_PROP="__mutation_summary_node_map_id__",b._NEXT_ID=1,b})(),o=(function(){function b(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return b})();n.Movement=void 0,(function(b){b[b.STAYED_OUT=0]="STAYED_OUT",b[b.ENTERED=1]="ENTERED",b[b.STAYED_IN=2]="STAYED_IN",b[b.REPARENTED=3]="REPARENTED",b[b.REORDERED=4]="REORDERED",b[b.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(b,g){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var y in T)Object.prototype.hasOwnProperty.call(T,y)&&(E[y]=T[y])},i(b,g)};function s(b,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");i(b,g);function E(){this.constructor=b}b.prototype=g===null?Object.create(g):(E.prototype=g.prototype,new E)}var a=(function(){function b(g,E,T,y,S,C,L,x){E===void 0&&(E=!1),T===void 0&&(T=!1),y===void 0&&(y=!1),S===void 0&&(S=null),C===void 0&&(C=!1),L===void 0&&(L=null),x===void 0&&(x=null),this.node=g,this.childList=E,this.attributes=T,this.characterData=y,this.oldParentNode=S,this.added=C,this.attributeOldValues=L,this.characterDataOldValue=x,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return b.prototype.getAttributeOldValue=function(g){if(this.attributeOldValues)return this.isCaseInsensitive&&(g=g.toLowerCase()),this.attributeOldValues[g]},b.prototype.getAttributeNamesMutated=function(){var g=[];if(!this.attributeOldValues)return g;for(var E in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(E)&&g.push(E);return g},b.prototype.attributeMutated=function(g,E){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(g in this.attributeOldValues)&&(this.attributeOldValues[g]=E)},b.prototype.characterDataMutated=function(g){this.characterData||(this.characterData=!0,this.characterDataOldValue=g)},b.prototype.removedFromParent=function(g){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=g},b.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},b.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},b})(),l=(function(b){s(g,b);function g(E,T){var y=b.call(this)||this;y.rootNode=E,y.reachableCache=void 0,y.wasReachableCache=void 0,y.anyParentsChanged=!1,y.anyAttributesChanged=!1,y.anyCharacterDataChanged=!1;for(var S=0;S<T.length;S++){var C=T[S];switch(C.type){case"childList":y.anyParentsChanged=!0;for(var L=0;L<C.removedNodes.length;L++){var x=C.removedNodes[L];y.getChange(x).removedFromParent(C.target)}for(var L=0;L<C.addedNodes.length;L++){var x=C.addedNodes[L];y.getChange(x).insertedIntoParent()}break;case"attributes":y.anyAttributesChanged=!0;var N=y.getChange(C.target);N.attributeMutated(C.attributeName,C.oldValue);break;case"characterData":y.anyCharacterDataChanged=!0;var N=y.getChange(C.target);N.characterDataMutated(C.oldValue)}}return y}return g.prototype.getChange=function(E){var T=this.get(E);return T||(T=new a(E),this.set(E,T)),T},g.prototype.getOldParent=function(E){var T=this.get(E);return T?T.getOldParent():E.parentNode},g.prototype.getIsReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.reachableCache=this.reachableCache||new r;var T=this.reachableCache.get(E);return T===void 0&&(T=this.getIsReachable(E.parentNode),this.reachableCache.set(E,T)),T},g.prototype.getWasReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.wasReachableCache=this.wasReachableCache||new r;var T=this.wasReachableCache.get(E);return T===void 0&&(T=this.getWasReachable(this.getOldParent(E)),this.wasReachableCache.set(E,T)),T},g.prototype.reachabilityChange=function(E){return this.getIsReachable(E)?this.getWasReachable(E)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.getWasReachable(E)?n.Movement.EXITED:n.Movement.STAYED_OUT},g})(r),c=(function(){function b(g,E,T,y,S){this.rootNode=g,this.mutations=E,this.selectors=T,this.calcReordered=y,this.calcOldPreviousSibling=S,this.treeChanges=new l(g,E),this.entered=[],this.exited=[],this.stayedIn=new r,this.visited=new r,this.childListChangeMap=void 0,this.characterDataOnly=void 0,this.matchCache=void 0,this.processMutations()}return b.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var g=this.treeChanges.keys(),E=0;E<g.length;E++)this.visitNode(g[E],void 0)},b.prototype.visitNode=function(g,E){if(!this.visited.has(g)){this.visited.set(g,!0);var T=this.treeChanges.get(g),y=E;if((T&&T.childList||y==null)&&(y=this.treeChanges.reachabilityChange(g)),y!==n.Movement.STAYED_OUT){if(this.matchabilityChange(g),y===n.Movement.ENTERED)this.entered.push(g);else if(y===n.Movement.EXITED)this.exited.push(g),this.ensureHasOldPreviousSiblingIfNeeded(g);else if(y===n.Movement.STAYED_IN){var S=n.Movement.STAYED_IN;T&&T.childList&&(T.oldParentNode!==g.parentNode?(S=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(g)):this.calcReordered&&this.wasReordered(g)&&(S=n.Movement.REORDERED)),this.stayedIn.set(g,S)}if(y!==n.Movement.STAYED_IN)for(var C=g.firstChild;C;C=C.nextSibling)this.visitNode(C,y)}}},b.prototype.ensureHasOldPreviousSiblingIfNeeded=function(g){if(this.calcOldPreviousSibling){this.processChildlistChanges();var E=g.parentNode,T=this.treeChanges.get(g);T&&T.oldParentNode&&(E=T.oldParentNode);var y=this.childListChangeMap.get(E);y||(y=new o,this.childListChangeMap.set(E,y)),y.oldPrevious.has(g)||y.oldPrevious.set(g,g.previousSibling)}},b.prototype.getChanged=function(g,E,T){this.selectors=E,this.characterDataOnly=T;for(var y=0;y<this.entered.length;y++){var S=this.entered[y],C=this.matchabilityChange(S);(C===n.Movement.ENTERED||C===n.Movement.STAYED_IN)&&g.added.push(S)}for(var L=this.stayedIn.keys(),y=0;y<L.length;y++){var S=L[y],C=this.matchabilityChange(S);if(C===n.Movement.ENTERED)g.added.push(S);else if(C===n.Movement.EXITED)g.removed.push(S);else if(C===n.Movement.STAYED_IN&&(g.reparented||g.reordered)){var x=this.stayedIn.get(S);g.reparented&&x===n.Movement.REPARENTED?g.reparented.push(S):g.reordered&&x===n.Movement.REORDERED&&g.reordered.push(S)}}for(var y=0;y<this.exited.length;y++){var S=this.exited[y],C=this.matchabilityChange(S);(C===n.Movement.EXITED||C===n.Movement.STAYED_IN)&&g.removed.push(S)}},b.prototype.getOldParentNode=function(g){var E=this.treeChanges.get(g);if(E&&E.childList)return E.oldParentNode?E.oldParentNode:null;var T=this.treeChanges.reachabilityChange(g);if(T===n.Movement.STAYED_OUT||T===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return g.parentNode},b.prototype.getOldPreviousSibling=function(g){var E=g.parentNode,T=this.treeChanges.get(g);T&&T.oldParentNode&&(E=T.oldParentNode);var y=this.childListChangeMap.get(E);if(!y)throw Error("getOldPreviousSibling requested on invalid node.");return y.oldPrevious.get(g)},b.prototype.getOldAttribute=function(g,E){var T=this.treeChanges.get(g);if(!T||!T.attributes)throw Error("getOldAttribute requested on invalid node.");var y=T.getAttributeOldValue(E);if(y===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return y},b.prototype.attributeChangedNodes=function(g){if(!this.treeChanges.anyAttributesChanged)return{};var E,T;if(g){E={},T={};for(var y=0;y<g.length;y++){var S=g[y];E[S]=!0,T[S.toLowerCase()]=S}}for(var C={},L=this.treeChanges.keys(),y=0;y<L.length;y++){var x=L[y],N=this.treeChanges.get(x);if(N.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(x)||n.Movement.STAYED_IN!==this.matchabilityChange(x)))for(var W=x,R=N.getAttributeNamesMutated(),P=0;P<R.length;P++){var S=R[P];E&&!E[S]&&!(N.isCaseInsensitive&&T[S])||N.getAttributeOldValue(S)!==W.getAttribute(S)&&(T&&N.isCaseInsensitive&&(S=T[S]),C[S]=C[S]||[],C[S].push(W))}}return C},b.prototype.getOldCharacterData=function(g){var E=this.treeChanges.get(g);if(!E||!E.characterData)throw Error("getOldCharacterData requested on invalid node.");return E.characterDataOldValue},b.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var g=this.treeChanges.keys(),E=[],T=0;T<g.length;T++){var y=g[T];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(y)){var S=this.treeChanges.get(y);!S.characterData||y.textContent==S.characterDataOldValue||E.push(y)}}return E},b.prototype.computeMatchabilityChange=function(g,E){this.matchCache||(this.matchCache=[]),this.matchCache[g.uid]||(this.matchCache[g.uid]=new r);var T=this.matchCache[g.uid],y=T.get(E);return y===void 0&&(y=g.matchabilityChange(E,this.treeChanges.get(E)),T.set(E,y)),y},b.prototype.matchabilityChange=function(g){var E=this;if(this.characterDataOnly)switch(g.nodeType){case Node.COMMENT_NODE:case Node.TEXT_NODE:return n.Movement.STAYED_IN;default:return n.Movement.STAYED_OUT}if(!this.selectors)return n.Movement.STAYED_IN;if(g.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var T=g,y=this.selectors.map(function(L){return E.computeMatchabilityChange(L,T)}),S=n.Movement.STAYED_OUT,C=0;S!==n.Movement.STAYED_IN&&C<y.length;){switch(y[C]){case n.Movement.STAYED_IN:S=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:S===n.Movement.EXITED?S=n.Movement.STAYED_IN:S=n.Movement.ENTERED;break;case n.Movement.EXITED:S===n.Movement.ENTERED?S=n.Movement.STAYED_IN:S=n.Movement.EXITED}C++}return S},b.prototype.getChildlistChange=function(g){var E=this.childListChangeMap.get(g);return E||(E=new o,this.childListChangeMap.set(g,E)),E},b.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var g=function(y){var S=E.mutations[y];if(S.type!="childList"||E.treeChanges.reachabilityChange(S.target)!==n.Movement.STAYED_IN&&!E.calcOldPreviousSibling)return"continue";for(var C=E.getChildlistChange(S.target),L=S.previousSibling,x=function(R,P){!R||C.oldPrevious.has(R)||C.added.has(R)||C.maybeMoved.has(R)||P&&(C.added.has(P)||C.maybeMoved.has(P))||C.oldPrevious.set(R,P)},N=0;N<S.removedNodes.length;N++){var W=S.removedNodes[N];x(W,L),C.added.has(W)?C.added.delete(W):(C.removed.set(W,!0),C.maybeMoved.delete(W)),L=W}x(S.nextSibling,L);for(var N=0;N<S.addedNodes.length;N++){var W=S.addedNodes[N];C.removed.has(W)?(C.removed.delete(W),C.maybeMoved.set(W,!0)):C.added.set(W,!0)}},E=this,T=0;T<this.mutations.length;T++)g(T)}},b.prototype.wasReordered=function(g){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var E=g.parentNode,T=this.treeChanges.get(g);T&&T.oldParentNode&&(E=T.oldParentNode);var y=this.childListChangeMap.get(E);if(!y)return!1;if(y.moved)return y.moved.get(g);y.moved=new r;var S=new r;function C(R){if(!R||!y.maybeMoved.has(R))return!1;var P=y.moved.get(R);return P!==void 0||(S.has(R)?P=!0:(S.set(R,!0),P=W(R)!==x(R)),S.has(R)?(S.delete(R),y.moved.set(R,P)):P=y.moved.get(R)),P}var L=new r;function x(R){var P=L.get(R);if(P!==void 0)return P;for(P=y.oldPrevious.get(R);P&&(y.removed.has(P)||C(P));)P=x(P);return P===void 0&&(P=R.previousSibling),L.set(R,P),P}var N=new r;function W(R){if(N.has(R))return N.get(R);for(var P=R.previousSibling;P&&(y.added.has(P)||C(P));)P=P.previousSibling;return N.set(R,P),P}return y.maybeMoved.keys().forEach(C),y.moved.get(g)},b})(),u=(function(){function b(g,E){var T=this;if(this.projection=g,this.added=[],this.removed=[],this.reparented=E.all||E.element||E.characterData?[]:void 0,this.reordered=E.all?[]:void 0,g.getChanged(this,E.elementFilter,E.characterData),E.all||E.attribute||E.attributeList){var y=E.attribute?[E.attribute]:E.attributeList,S=g.attributeChangedNodes(y);E.attribute?this.valueChanged=S[E.attribute]||[]:(this.attributeChanged=S,E.attributeList&&E.attributeList.forEach(function(L){T.attributeChanged.hasOwnProperty(L)||(T.attributeChanged[L]=[])}))}if(E.all||E.characterData){var C=g.getCharacterDataChanged();E.characterData?this.valueChanged=C:this.characterDataChanged=C}this.reordered&&(this.getOldPreviousSibling=g.getOldPreviousSibling.bind(g))}return b.prototype.getOldParentNode=function(g){return this.projection.getOldParentNode(g)},b.prototype.getOldAttribute=function(g,E){return this.projection.getOldAttribute(g,E)},b.prototype.getOldCharacterData=function(g){return this.projection.getOldCharacterData(g)},b.prototype.getOldPreviousSibling=function(g){return this.projection.getOldPreviousSibling(g)},b})(),d=(function(){function b(){}return b.prototype.matches=function(g){if(g===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==g;for(var E=g.split(" "),T=0;T<E.length;T++)if(this.attrValue===E[T])return!0;return!1},b.prototype.toString=function(){return this.attrName==="class"&&this.contains?"."+this.attrValue:this.attrName==="id"&&!this.contains?"#"+this.attrValue:this.contains?"["+this.attrName+"~="+f(this.attrValue)+"]":"attrValue"in this?"["+this.attrName+"="+f(this.attrValue)+"]":"["+this.attrName+"]"},b})();function f(b){return'"'+b.replace(/"/,'\\"')+'"'}var h=/[a-zA-Z_]+/,m=/[a-zA-Z0-9_\-]+/,p=(function(){function b(){this.uid=b.nextUid++,this.qualifiers=[]}return Object.defineProperty(b.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),b.prototype.isMatching=function(g){return g[b.matchesSelector](this.selectorString)},b.prototype.wasMatching=function(g,E,T){if(!E||!E.attributes)return T;var y=E.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(y!=="*"&&y!==g.tagName)return!1;for(var S=[],C=!1,L=0;L<this.qualifiers.length;L++){var x=this.qualifiers[L],N=E.getAttributeOldValue(x.attrName);S.push(N),C=C||N!==void 0}if(!C)return T;for(var L=0;L<this.qualifiers.length;L++){var x=this.qualifiers[L],N=S[L];if(N===void 0&&(N=g.getAttribute(x.attrName)),!x.matches(N))return!1}return!0},b.prototype.matchabilityChange=function(g,E){var T=this.isMatching(g);return T?this.wasMatching(g,E,T)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(g,E,T)?n.Movement.EXITED:n.Movement.STAYED_OUT},b.parseSelectors=function(g){var E=[],T,y;function S(){T&&(y&&(T.qualifiers.push(y),y=void 0),E.push(T)),T=new b}function C(){y&&T.qualifiers.push(y),y=new d}for(var L=/\s/,x=void 0,N="Invalid or unsupported selector syntax.",W=1,R=2,P=3,J=4,ne=5,he=6,re=7,Z=8,ve=9,de=10,_e=11,ct=12,ee=13,q=14,oe=W,Wt=0;Wt<g.length;){var U=g[Wt++];switch(oe){case W:if(U.match(h)){S(),T.tagName=U,oe=R;break}if(U=="*"){S(),T.tagName="*",oe=P;break}if(U=="."){S(),C(),T.tagName="*",y.attrName="class",y.contains=!0,oe=J;break}if(U=="#"){S(),C(),T.tagName="*",y.attrName="id",oe=J;break}if(U=="["){S(),C(),T.tagName="*",y.attrName="",oe=he;break}if(U.match(L))break;throw Error(N);case R:if(U.match(m)){T.tagName+=U;break}if(U=="."){C(),y.attrName="class",y.contains=!0,oe=J;break}if(U=="#"){C(),y.attrName="id",oe=J;break}if(U=="["){C(),y.attrName="",oe=he;break}if(U.match(L)){oe=q;break}if(U==","){oe=W;break}throw Error(N);case P:if(U=="."){C(),y.attrName="class",y.contains=!0,oe=J;break}if(U=="#"){C(),y.attrName="id",oe=J;break}if(U=="["){C(),y.attrName="",oe=he;break}if(U.match(L)){oe=q;break}if(U==","){oe=W;break}throw Error(N);case J:if(U.match(h)){y.attrValue=U,oe=ne;break}throw Error(N);case ne:if(U.match(m)){y.attrValue+=U;break}if(U=="."){C(),y.attrName="class",y.contains=!0,oe=J;break}if(U=="#"){C(),y.attrName="id",oe=J;break}if(U=="["){C(),oe=he;break}if(U.match(L)){oe=q;break}if(U==","){oe=W;break}throw Error(N);case he:if(U.match(h)){y.attrName=U,oe=re;break}if(U.match(L))break;throw Error(N);case re:if(U.match(m)){y.attrName+=U;break}if(U.match(L)){oe=Z;break}if(U=="~"){y.contains=!0,oe=ve;break}if(U=="="){y.attrValue="",oe=_e;break}if(U=="]"){oe=P;break}throw Error(N);case Z:if(U=="~"){y.contains=!0,oe=ve;break}if(U=="="){y.attrValue="",oe=_e;break}if(U=="]"){oe=P;break}if(U.match(L))break;throw Error(N);case ve:if(U=="="){y.attrValue="",oe=_e;break}throw Error(N);case de:if(U=="]"){oe=P;break}if(U.match(L))break;throw Error(N);case _e:if(U.match(L))break;if(U=='"'||U=="'"){x=U,oe=ee;break}y.attrValue+=U,oe=ct;break;case ct:if(U.match(L)){oe=de;break}if(U=="]"){oe=P;break}if(U=="'"||U=='"')throw Error(N);y.attrValue+=U;break;case ee:if(U==x){oe=de;break}y.attrValue+=U;break;case q:if(U.match(L))break;if(U==","){oe=W;break}throw Error(N)}}switch(oe){case W:case R:case P:case ne:case q:S();break;default:throw Error(N)}if(!E.length)throw Error(N);return E},b.nextUid=1,b.matchesSelector="matches",b})(),v=(function(){function b(){}return b.createObserverOptions=function(g){var E={childList:!0,subtree:!0},T;function y(S){if(!(E.attributes&&!T)){if(E.attributes=!0,E.attributeOldValue=!0,!S){T=void 0;return}T=T||{},S.forEach(function(C){T[C]=!0,T[C.toLowerCase()]=!0})}}return g.forEach(function(S){if(S.characterData){E.characterData=!0,E.characterDataOldValue=!0;return}if(S.all){y(),E.characterData=!0,E.characterDataOldValue=!0;return}if(S.attribute){y([S.attribute.trim()]);return}var C=b._elementFilterAttributes(S.elementFilter).concat(S.attributeList||[]);C.length&&y(C)}),T&&(E.attributeFilter=Object.keys(T)),E},b.validateOptions=function(g){for(var E in g)if(!(E in b._optionKeys))throw Error("Invalid option: "+E);if(typeof g.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!g.queries||!g.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var T={callback:g.callback,rootNode:g.rootNode||document,observeOwnChanges:!!g.observeOwnChanges,oldPreviousSibling:!!g.oldPreviousSibling,queries:[]},y=0;y<g.queries.length;y++){var S=g.queries[y];if(S.all){if(Object.keys(S).length>1)throw Error("Invalid request option. all has no options.");T.queries.push({all:!0});continue}if("attribute"in S){var C={attribute:b._validateAttribute(S.attribute)};if(C.elementFilter=p.parseSelectors("*["+C.attribute+"]"),Object.keys(S).length>1)throw Error("Invalid request option. attribute has no options.");T.queries.push(C);continue}if("element"in S){var L=Object.keys(S).length,C={element:S.element,elementFilter:p.parseSelectors(S.element)};if(S.hasOwnProperty("elementAttributes")&&(C.attributeList=b._validateElementAttributes(S.elementAttributes),L--),L>1)throw Error("Invalid request option. element only allows elementAttributes option.");T.queries.push(C);continue}if(S.characterData){if(Object.keys(S).length>1)throw Error("Invalid request option. characterData has no options.");T.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return T},b._validateElementAttributes=function(g){if(!g.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var E={},T={},y=g.split(/\s+/),S=0;S<y.length;S++){var C=y[S];if(C){C=b._validateAttribute(C);var L=C.toLowerCase();if(E[L])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");T[C]=!0,E[L]=!0}}return Object.keys(T)},b._elementFilterAttributes=function(g){var E={};return g.forEach(function(T){T.qualifiers.forEach(function(y){E[y.attrName]=!0})}),Object.keys(E)},b._validateAttribute=function(g){if(typeof g!="string"||(g=g.trim(),!g))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!g.match(b._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+g);return g},b._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,b._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},b})(),w=(function(){function b(g){var E=this;this._connected=!1,this._options=v.validateOptions(g),this._observerOptions=v.createObserverOptions(this._options.queries),this._root=this._options.rootNode,this._callback=this._options.callback,this._elementFilter=Array.prototype.concat.apply([],this._options.queries.map(function(T){return T.elementFilter?T.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(T){return T.all}),this._queryValidators=[],b.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(T){return b.createQueryValidator(E._root,T)})),this._observer=new MutationObserver(function(T){E._observerCallback(T)}),this.reconnect()}return b.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},b.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var g=this._createSummaries(this._observer.takeRecords());return this._changesToReport(g)?g:void 0},b.prototype.disconnect=function(){var g=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,g},b.prototype._observerCallback=function(g){this._options.observeOwnChanges||this._observer.disconnect();var E=this._createSummaries(g);this._runQueryValidators(E),this._options.observeOwnChanges&&this._checkpointQueryValidators(),this._changesToReport(E)&&this._callback(E),!this._options.observeOwnChanges&&this._connected&&(this._checkpointQueryValidators(),this._observer.observe(this._root,this._observerOptions))},b.prototype._createSummaries=function(g){if(!g||!g.length)return[];for(var E=new c(this._root,g,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),T=[],y=0;y<this._options.queries.length;y++)T.push(new u(E,this._options.queries[y]));return T},b.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(g){g&&g.recordPreviousState()})},b.prototype._runQueryValidators=function(g){this._queryValidators.forEach(function(E,T){E&&E.validate(g[T])})},b.prototype._changesToReport=function(g){return g.some(function(E){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(T){return E[T]&&E[T].length})||E.attributeChanged&&Object.keys(E.attributeChanged).some(function(T){return!!E.attributeChanged[T].length}))})},b})(),_=(function(){function b(g,E){this.root=g,this.delegate=E,this.idMap={}}return b.prototype.initialize=function(g,E){this.idMap[g]=this.root;for(var T=0;T<E.length;T++)this.deserializeNode(E[T],this.root)},b.prototype.applyChanged=function(g,E,T,y){var S=this;E.forEach(function(C){var L=S.deserializeNode(C);S.deserializeNode(C.parentNode),S.deserializeNode(C.previousSibling),L.parentNode&&L.parentNode.removeChild(L)}),g.forEach(function(C){var L=S.deserializeNode(C);L.parentNode&&L.parentNode.removeChild(L)}),E.forEach(function(C){var L=S.deserializeNode(C),x=S.deserializeNode(C.parentNode),N=S.deserializeNode(C.previousSibling);x.insertBefore(L,N?N.nextSibling:x.firstChild)}),T.forEach(function(C){var L=S.deserializeNode(C);Object.keys(C.attributes).forEach(function(x){var N=C.attributes[x];N===null?L.removeAttribute(x):(!S.delegate||!S.delegate.setAttribute||!S.delegate.setAttribute(L,x,N))&&L.setAttribute(x,N)})}),y.forEach(function(C){var L=S.deserializeNode(C);L.textContent=C.textContent}),g.forEach(function(C){delete S.idMap[C.id]})},b.prototype.deserializeNode=function(g,E){var T=this;if(g===null)return null;var y=this.idMap[g.id];if(y)return y;var S=this.root.ownerDocument;switch(S===null&&(S=this.root),g.nodeType){case Node.COMMENT_NODE:y=S.createComment(g.textContent);break;case Node.TEXT_NODE:y=S.createTextNode(g.textContent);break;case Node.DOCUMENT_TYPE_NODE:y=S.implementation.createDocumentType(g.name,g.publicId,g.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(y=this.delegate.createElement(g.tagName)),y||(y=S.createElement(g.tagName)),Object.keys(g.attributes).forEach(function(L){(!T.delegate||!T.delegate.setAttribute||!T.delegate.setAttribute(y,L,g.attributes[L]))&&y.setAttribute(L,g.attributes[L])});break;default:throw"Unsupported node type: "+g.nodeType}if(this.idMap[g.id]=y,E&&E.appendChild(y),g.childNodes)for(var C=0;C<g.childNodes.length;C++)this.deserializeNode(g.childNodes[C],y);return y},b})(),A=(function(){function b(g,E,T){var y=this;this.target=g,this.mirror=E,this.nextId=1,this.knownNodes=new r;for(var S=this.serializeNode(g).id,C=[],L=g.firstChild;L;L=L.nextSibling)C.push(this.serializeNode(L,!0));this.mirror.initialize(S,C);var x=[{all:!0}];T&&(x=x.concat(T)),this.mutationSummary=new w({rootNode:g,callback:function(N){y.applyChanged(N)},queries:x})}return b.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},b.prototype.rememberNode=function(g){var E=this.nextId++;return this.knownNodes.set(g,E),E},b.prototype.forgetNode=function(g){this.knownNodes.delete(g)},b.prototype.serializeNode=function(g,E){if(g===null)return null;var T=this.knownNodes.get(g);if(T!==void 0)return{id:T};var y={nodeType:g.nodeType,id:this.rememberNode(g)};switch(y.nodeType){case Node.DOCUMENT_TYPE_NODE:var S=g;y.name=S.name,y.publicId=S.publicId,y.systemId=S.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:y.textContent=g.textContent;break;case Node.ELEMENT_NODE:var C=g;y.tagName=C.tagName,y.attributes={};for(var L=0;L<C.attributes.length;L++){var x=C.attributes[L];y.attributes[x.name]=x.value}if(E&&C.childNodes.length){y.childNodes=[];for(var N=C.firstChild;N;N=N.nextSibling)y.childNodes.push(this.serializeNode(N,!0))}}return y},b.prototype.serializeAddedAndMoved=function(g,E,T){var y=this,S=g.concat(E).concat(T),C=new r;S.forEach(function(x){var N=x.parentNode,W=C.get(N);W||(W=new r,C.set(N,W)),W.set(x,!0)});var L=[];return C.keys().forEach(function(x){for(var N=C.get(x),W=N.keys();W.length;){for(var R=W[0];R.previousSibling&&N.has(R.previousSibling);)R=R.previousSibling;for(;R&&N.has(R);){var P=y.serializeNode(R);P.previousSibling=y.serializeNode(R.previousSibling),P.parentNode=y.serializeNode(R.parentNode),L.push(P),N.delete(R),R=R.nextSibling}W=N.keys()}}),L},b.prototype.serializeAttributeChanges=function(g){var E=this,T=new r;return Object.keys(g).forEach(function(y){g[y].forEach(function(S){var C=T.get(S);C||(C=E.serializeNode(S),C.attributes={},T.set(S,C)),C.attributes[y]=S.getAttribute(y)})}),T.keys().map(function(y){return T.get(y)})},b.prototype.applyChanged=function(g){var E=this,T=g[0],y=T.removed.map(function(x){return E.serializeNode(x)}),S=this.serializeAddedAndMoved(T.added,T.reparented,T.reordered),C=this.serializeAttributeChanges(T.attributeChanged),L=T.characterDataChanged.map(function(x){var N=E.serializeNode(x);return N.textContent=x.textContent,N});this.mirror.applyChanged(y,S,C,L),T.removed.forEach(function(x){E.forgetNode(x)})},b})();if(MutationObserver===void 0)throw Error("DOM Mutation Observers are required");n.ChildListChange=o,n.MutationProjection=c,n.MutationSummary=w,n.NodeChange=a,n.NodeMap=r,n.Qualifier=d,n.Selector=p,n.Summary=u,n.TreeChanges=l,n.TreeMirror=_,n.TreeMirrorClient=A,Object.defineProperty(n,"__esModule",{value:!0})}))})),VO=jO(),Ko=0,Yo=new Array(1e3);function GO(){for(let e=0;e<Ko;e+=2){const t=Yo[e],n=Yo[e+1];t(...n),Yo[e]=void 0,Yo[e+1]=void 0}Ko=0}function XO(e,...t){Yo[Ko]=e,Yo[Ko+1]=t,Ko+=2,Ko===2&&YO()}function KO(){let e=0;const t=new MutationObserver(GO),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var YO=KO();function Yy(){XO(()=>{nf.hasListeners()&&(nf.fire(),Yy())})}var nf=new ge({onFirstListenerAdd:Yy}),Sl=nf.once;function ZO(e,t,n){const r=new ge;let o=[];return r.addDisposable(e(i=>{Sl(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var QO=class extends ge{constructor(e={}){super(),k(this,"_mutationSummary",void 0),this._mutationSummary=new VO.MutationSummary({...e,observeOwnChanges:!0,callback:t=>this.fire(t),queries:[{all:!0}]})}dispose(){this._mutationSummary.disconnect(),super.dispose()}trigger(e){if(this.isDisposed())return;const t=this._mutationSummary.takeSummaries();return(e||t?.length)&&this.fire(t||[]),t}},JO=class extends Ee{_nextTickHandler(){Sl(()=>{this.trigger(),this._summaries.length&&(this._innerEmitter.hasListeners()?this._innerEmitter.fire(this._summaries):this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)}constructor(e={}){super(),k(this,"_mutationEmitter",void 0),k(this,"_innerEmitter",this.addDisposable(new ge({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),k(this,"_lostEmitter",this.addDisposable(new ge)),k(this,"_paused",0),k(this,"_stopped",0),k(this,"_foreignCode",0),k(this,"_summaries",[]),k(this,"onMutate",this._innerEmitter.event),k(this,"onLost",this._lostEmitter.event),k(this,"onNativeMutate",void 0),this._mutationEmitter=this.addDisposable(new QO(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(t=>{(!this._stopped||this._foreignCode)&&(this._paused?this._lostEmitter.fire(t):(this._summaries.push(...t),Sl(()=>{this._summaries.length&&!this._innerEmitter.hasListeners()&&(this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)))}))}get isStoped(){return this._paused>0||this._stopped>0}stop(){this._mutationEmitter.trigger(),this._stopped++}start(){this._mutationEmitter.trigger(),this._stopped--}pause(){this._mutationEmitter.trigger(),this._paused++}resume(){this._mutationEmitter.trigger(),this._paused--}pauseForForeignCode(){this.pause(),this._foreignCode++}resumeAfterForeignCode(){this.resume(),this._foreignCode--}unpaused(e){if(!this._paused||this._stopped)return e();this._mutationEmitter.trigger();const t=this._paused;this._paused=0;try{return e()}finally{try{this._mutationEmitter.trigger()}finally{this._paused+=t}}}trigger(){this._mutationEmitter.trigger(!0)}takeRecords(){this._mutationEmitter.trigger()}flush(){if(this._mutationEmitter.trigger(),this._summaries.length&&this._innerEmitter.hasListeners()){const e=this._summaries;this._summaries=[],this._innerEmitter.fire(e)}}},eR=1,Zy=e=>e.nodeType===eR,rf=e=>e?.nodeName==="STYLE";function tR(e){return e.some(t=>t.attributeChanged&&Object.keys(t.attributeChanged).length||t.reparented?.length||t.reordered?.length||t.added?.some(n=>Zy(n)||rf(n.parentNode))||t.removed?.some(n=>Zy(n)||rf(t.getOldParentNode(n)))?!0:!!t.characterDataChanged?.some(n=>rf(n.parentNode)))}var nR=Sl;function rR(e,t){let n=0;for(const r of t){if(r.oldPosition>e)break;const o=r.oldLength>0&&r.newLength>0,i=e===r.oldPosition||e===r.oldEnd;if(o&&i||r.oldPosition<e&&e<r.oldEnd)return;r.oldEnd<=e&&(n=r.newEnd-r.oldEnd)}return e+n}var Qy=/&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]*);/iy;function Jy(e,t){Qy.lastIndex=t;const n=Qy.exec(e);return n?n[0].length:e.startsWith(`\r
|
|
3
|
+
`,t)?2:1}function ev(e){return e.length===1?1:(wr(e).textContent??"").length}function oR(e,t,n){if(n)return Math.min(t,e.length);let r=0,o=0;for(;o<e.length&&r<t;){const i=Jy(e,o);r+=ev(e.slice(o,o+i)),o+=i}return o}function iR(e,t,n){if(n)return Math.min(t,e.length);let r=0;for(let o=0;o<e.length;){const i=Jy(e,o);if(o+i>t)break;r+=ev(e.slice(o,o+i)),o+=i}return r}function gs(e,t){const n=t.nodeMap.getByElement(e);return n&&t.isAttached(n)?n:void 0}var sR='[contenteditable="true"], editor';function tv(e,t,n){const r=e.childNodes;for(let i=t;i<r.length;i++){const s=gs(r[i],n);if(s)return s.start}for(let i=Math.min(t,r.length)-1;i>=0;i--){const s=gs(r[i],n);if(s)return s.end}const o=gs(e,n);return o&&(o.startTagEnd??o.start)}function nv(e,t){if((e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(sR))for(let n=e,r=e.parentNode;r;n=r,r=r.parentNode){const o=tv(r,Array.from(r.childNodes).indexOf(n),t);if(o!==void 0)return o}}function aR({node:e,offset:t},n){if(e.nodeType===Node.TEXT_NODE){const r=gs(e,n);if(r?.type!==I.HTML)return nv(e,n);const o=n.textAt(r.start,r.end);return r.start+oR(o,t,yn(e.parentNode))}return tv(e,t,n)??(gs(e,n)?void 0:nv(e,n))}function of(e,t,n){const r=n.nodeMap.getByNode(e),o=r?.parentNode;if(!(!r||!o))return{node:o,offset:Array.from(o.childNodes).indexOf(r)+(t?1:0)}}function lR(e,t){const n=t.nodeAt(e);if(!n)return;if(n.type===I.HTML){const s=t.nodeMap.getByNode(n);return s?.nodeType!==Node.TEXT_NODE?void 0:{node:s,offset:iR(t.textAt(n.start,n.end),Math.max(0,Math.min(e,n.end)-n.start),yn(s.parentNode))}}if(e<=n.start||e>=n.end)return of(n,e>=n.end&&e>n.start,t);const r=n.children.find(s=>s.start>=e);if(r)return of(r,!1,t);const o=n.children[n.children.length-1];if(o)return of(o,!0,t);const i=t.nodeMap.getByNode(n);return i&&{node:i,offset:0}}var ane=400,rv=3e3,cR=class extends Ee{constructor(e,t=400){super(),k(this,"_waitMs",void 0),k(this,"_actionId",void 0),k(this,"_queue",[]),k(this,"_timer",void 0),k(this,"_guid",void 0),k(this,"_releaseOnReady",!1),k(this,"_releasing",!1),this._waitMs=t,this.addDisposable(e.onHistoryAction(n=>this._wait(n))),this.addDisposable(e.onHistoryActionSent(n=>this._sent(n))),this.addDisposable(e.onHistoryActionAnswered(n=>this._answered(n))),this.addDisposable(e.onEntitySet(n=>this._entitySet(n))),this.addDisposable(e.onReady(()=>this._ready())),this.addDispose(()=>this._drop())}hold(e){return this._actionId===void 0?!1:(this._queue.push(e),!0)}holdBehindQueued(e){return!this._queue.length||this._releasing?!1:(this._queue.push(e),!0)}isWaiting(){return this._actionId!==void 0}hasQueued(){return this._queue.length>0&&!this._releasing}releaseNow(){this._queue.length&&this._release()}_wait(e){this._actionId=e,this._restartTimer(rv)}_sent(e){e===this._actionId&&!this._releaseOnReady&&this._restartTimer(this._waitMs)}_restartTimer(e){clearTimeout(this._timer),this._timer=setTimeout(()=>this._release(),e)}_answered(e){e===this._actionId&&this._release()}_release(){clearTimeout(this._timer),this._actionId=void 0,this._releaseOnReady=!1,this._releasing=!0;try{for(;this._actionId===void 0&&this._queue.length;){const e=this._queue.shift();try{e?.()}catch{}}}finally{this._releasing=!1}}_entitySet(e){const t=e===this._guid;this._guid=e,t?this._actionId!==void 0&&(this._restartTimer(this._waitMs),this._releaseOnReady=!0):this._drop()}_ready(){this._releaseOnReady&&(this._releaseOnReady=!1,this._release())}_drop(){clearTimeout(this._timer),this._actionId=void 0,this._releaseOnReady=!1,this._queue=[]}},ov=2e3,uR=3;function dR(e,t,n){const r=e.data.indexOf(n,Math.max(0,t-n.length));return n.trim().length>=uR&&r>=0&&r<=t}function iv(e,t){if(!e||e.nodeType===Node.TEXT_NODE)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r;for(let o=n.nextNode();o&&(t||!r);o=n.nextNode())r=o;return r}function fR(e,t){if(e.nodeType===Node.TEXT_NODE)return{text:e,offset:t};const n=iv(e.childNodes[t-1],!0),r=n?void 0:iv(e.childNodes[t],!1);return n?{text:n,offset:n.length}:r&&{text:r,offset:0}}var mR=class extends Ee{beginTextUpdate(){this._baseDocument.beginUpdate()}endTextUpdate(){this._baseDocument.endUpdate()}constructor(e,t,n){super(),k(this,"_baseDocument",void 0),k(this,"_remoteDocument",void 0),k(this,"_parsedDocument",void 0),k(this,"_nodeMap",void 0),k(this,"_beforeChangeEmitter",this.addDisposable(new ge)),k(this,"_beforeCommitEmitter",this.addDisposable(new ge)),k(this,"_beforeTextCommitEmitter",this.addDisposable(new ge)),k(this,"_onTextCommitEmitter",this.addDisposable(new ge)),k(this,"_onRefreshEmitter",this.addDisposable(new ge)),k(this,"_documentElement",void 0),k(this,"_docType",void 0),k(this,"_parseFn",void 0),k(this,"_serviceMarkup",void 0),k(this,"_mapHTMLRoots",void 0),k(this,"_roots",void 0),k(this,"_getRootsParent",void 0),k(this,"_mutationCollector",this.addDisposable(new JO)),k(this,"_attributeMapper",void 0),k(this,"_trackedOffsets",new Set),k(this,"_inputHold",void 0),k(this,"_shownEntity",void 0),k(this,"_savedCaret",void 0),k(this,"ownership",void 0),k(this,"holdCaretAfterBreak",void 0),k(this,"_reportedDrifts",new Set),k(this,"_hiddenEmptyTexts",new WeakSet),k(this,"_canvasNodes",qO(document)),k(this,"_accountingTimer",void 0),k(this,"_lastAccounting",0),k(this,"_capture",void 0),k(this,"_openBatches",0),k(this,"_pushUndoStop",!1),k(this,"_locked",!1),k(this,"_beforeCommitPending",!1),k(this,"_closeStep",!1),k(this,"_styleDirty",!0),k(this,"_outputs",new Map),k(this,"_runningScripts",[]),k(this,"scriptRunner",{run:(o,i)=>this.runScript(o,i),quiet:o=>this.renderOnly(o),substitute:(o,i)=>{const s=this._nodeMap.getByElement(o);s&&(this._nodeMap.remove(s,!1),this._nodeMap.set(s,i))}}),k(this,"_commands",[]),k(this,"_pauseOnCommandInput",o=>{const i=this._commands[this._commands.length-1];if(i){i.paused||(i.paused=!0,this._mutationCollector.pause());return}o.isTrusted&&(this._pushUndoStop=!0,this.recordNow())}),k(this,"_treeMutations",[]),k(this,"beforeChange",this._beforeChangeEmitter.event),k(this,"beforeCommit",this._beforeCommitEmitter.event),k(this,"beforeTextCommit",this._beforeTextCommitEmitter.event),k(this,"onTextCommit",this._onTextCommitEmitter.event),k(this,"onChange",jN(ZO(this._mutationCollector.onNativeMutate,o=>o.flat(),this),o=>o.length>0,this)),k(this,"onRefresh",this._onRefreshEmitter.event),this._baseDocument=e,this._remoteDocument=t,this._parseFn=n.prepareHtml,this._serviceMarkup=n.serviceMarkup,this._mapHTMLRoots=n.mapHTMLRoots,this._getRootsParent=n.rootsParent,this._roots=[...document.childNodes];const r=this._parsedDocument=new rx(e,n.createRoot);this._nodeMap=new $x,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new DO(this._nodeMap),this.addDisposable(Zx(()=>this._mutationCollector.pauseForForeignCode())),this.addDisposable(Qx(()=>this._mutationCollector.resumeAfterForeignCode())),this.addDisposable(this._mutationCollector.onNativeMutate(o=>{this._styleDirty||(this._styleDirty=tR(o))})),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new BO(o=>!!this._nodeMap.getByElement(o)),this.addDisposable(this._mutationCollector.onLost(o=>this._bindScriptOutput(o))),this.addDisposable(this._mutationCollector.onLost(o=>this.ownership.observeLost(o))),this.addDispose(oL(this._pauseOnCommandInput)),t.collectCanvasEdits=()=>this.commit(!1),this.addDispose(()=>clearTimeout(this._accountingTimer)),this.addDisposable(t.onEntitySet(o=>this._rememberCaret(o))),this.addDisposable(t.onReady(()=>this._dropForeignCaret())),this._inputHold=this.addDisposable(new cR(t)),this.addDisposable(e.onChanged(({changes:o})=>this._rebaseTracked(o))),this.addDisposable(t.onEntitySet(()=>this._forgetTracked()))}trackOffset(e){const t={offset:e};return this._trackedOffsets.add(t),{current:()=>t.offset,release:()=>this._trackedOffsets.delete(t)}}_rebaseTracked(e){for(const t of this._trackedOffsets)t.offset=t.offset===void 0?void 0:rR(t.offset,e)}_forgetTracked(){for(const e of this._trackedOffsets)e.offset=void 0;this._trackedOffsets.clear()}holdInput(e){return this._inputHold.hold(e)}holdInputBehindQueued(e){return this._inputHold.holdBehindQueued(e)}isHoldingInput(){return this._inputHold.isWaiting()}hasHeldInput(){return this._inputHold.hasQueued()}releaseHeldInput(){this._inputHold.releaseNow()}_rememberCaret(e){const t=e===this._shownEntity;this._shownEntity=e,this._savedCaret=void 0;const n=document.getSelection();if(!t||!n?.isCollapsed||document.activeElement?.closest("input, textarea, select, .monaco-editor"))return;const r=n.anchorNode,o=r?.childNodes,i=r?.nodeType===Node.TEXT_NODE?r:[o?.[n.anchorOffset-1],o?.[n.anchorOffset]].find(s=>s?.nodeType===Node.TEXT_NODE);i&&(this._savedCaret={node:i,text:i.data})}_dropForeignCaret(){const e=this._savedCaret;if(this._savedCaret=void 0,!e||document.activeElement?.closest("input, textarea, select, .monaco-editor"))return;const t=document.getSelection(),n=t?.anchorNode;if(!e.node.isConnected){const l=n?fR(n,t?.anchorOffset??0):void 0;l&&l.text!==e.node&&!dR(l.text,l.offset,e.text)&&t?.removeAllRanges();return}const{text:r}=e,o=e.node.data,i=Math.min(r.length,o.length);let s=0;for(;s<i&&r[s]===o[s];)s++;let a=0;for(;a<i-s&&r[r.length-1-a]===o[o.length-1-a];)a++;s+a<Math.ceil(i/2)&&(n===e.node||n===e.node.parentNode)&&t?.removeAllRanges()}_typedIntoHidden(e){const t=e.flatMap(n=>n.characterDataChanged??[]).filter(n=>this._hiddenEmptyTexts.has(n)&&n.isConnected&&n.data!==""&&!this.isBehindHidden(n));for(const n of t)this._hiddenEmptyTexts.delete(n),this.ownership.forgetService(n);return t.length?[jx(t)]:[]}isBehindHidden(e){for(let t=e.parentNode;t&&!this._nodeMap.getByElement(t);t=t.parentNode)if(!this.ownership.isWrapper(t)&&this.ownership.markOf(t))return!0;return!1}isUntracked(e){return this.ownership.isMarked(e)||this.ownership.isOffModel(e.parentNode)||this.ownership.isService(e)}markUntracked(e){this.ownership.markForeign(e)}_reportSafely(e){try{e()}catch{}}_reportForeignStructure(e){this._reportSafely(()=>{const t=n=>!!this._nodeMap.getByElement(n);WO(HO(e,this.ownership,t),this._reportedDrifts),$O(FO(e,t),this._reportedDrifts)})}_accountingRules(){const e=new Set;for(const t of this._parsedDocument.root.children){const n=this._nodeMap.getByNode(t);n&&e.add(n)}return this._getRootsParent?.()?.childNodes.forEach(t=>e.add(t)),{isMapped:t=>!!this._nodeMap.getByElement(t),markOf:t=>this.ownership.markOf(t),isCanvasNode:t=>this._canvasNodes.has(t),roots:e}}nodeBucket(e){return Vy(e,this._accountingRules())}auditNodes(){return Gy(document,this._accountingRules()).map(Xy)}checkAccounting(){this._reportSafely(()=>Ky(Gy(document,this._accountingRules()),this._reportedDrifts))}_checkCommitted(e){this._reportSafely(()=>{const t=e.flatMap(n=>[...n.added,...n.reparented??[],...n.reordered??[]]);Ky(zO(t,this._accountingRules()),this._reportedDrifts)})}_scheduleAccountingCheck(){if(this._accountingTimer!==void 0||this.isDisposed())return;const e=()=>{this._accountingTimer=void 0,this._lastAccounting=Date.now(),this.isDisposed()||this.checkAccounting()},t=Math.max(0,this._lastAccounting+ov-Date.now());this._accountingTimer=setTimeout(()=>{const n=window.requestIdleCallback;n?n(e,{timeout:ov}):e()},t)}closeUndoStep(){this._closeStep=!0}commit(e=!0,t=!1){this._pushUndoStop||(this._pushUndoStop=e),this._locked||(this._locked=t);const n=this._capture??this._startCapture();return this._runBeforeCommit(),n}takeStyleDirty(){this._mutationCollector.takeRecords();const e=this._styleDirty;return this._styleDirty=!1,e}_runBeforeCommit(){this._beforeCommitPending&&!this.isDisposed()&&(this._beforeCommitPending=!1,this._mutationCollector.unpaused(()=>this._beforeCommitEmitter.fire()))}flushCommit(){this._capture!==void 0&&this._mutationCollector.flush()}recordNow(){this._capture===void 0&&this._startCapture(),this._mutationCollector.flush()}_startCapture(){let e;const t=new Promise(n=>e=n);return this._capture=t,this._openBatches++,this._beforeCommitPending=!0,this._sealOnNextTick(e),t}_letterEdits(e){const t=this._serviceMarkup;if(!t)return e;const n=Gx(e,{...t,isWrapper:r=>this.ownership.isWrapper(r),isMapped:r=>!!this._nodeMap.getByElement(r)});return n.service.forEach(r=>this.ownership.markService(r)),n.summaries}_sealOnNextTick(e){const t=this._mutationCollector.onMutate(n=>{n.length&&(this._reportSafely(()=>this._beforeTextCommitEmitter.fire()),this._dropForeignOutput(n),this._reportForeignStructure(n),this._dropForeignNodes(n),ll("commit",()=>{const r=CO(this._letterEdits([...n,...this._typedIntoHidden(n)]),this._nodeMap,this._parseFn,this._rootsParent(),o=>this.ownership.isWrapper(o));this._commit(r)}),this._reportSafely(()=>this._onTextCommitEmitter.fire()),this._checkCommitted(n),this._dropOrphanedOutput())});nR(()=>{this._beforeCommitPending&&this._reportSafely(()=>this._runBeforeCommit()),this._reportSafely(()=>this._mutationCollector.flush()),this._beforeCommitPending=!1,t.dispose();const{_pushUndoStop:n,_locked:r}=this;this._capture=void 0,this._pushUndoStop=this._locked=!1,this._closeStep&&n&&(this._closeStep=!1,this._remoteDocument.closeStep());const o=()=>{this._openBatches--,e()};if(r&&!this.isDisposed()){this._remoteDocument.saveChangesAsync(n).finally(o);return}try{this.isDisposed()||this._remoteDocument.saveChanges(n)}finally{o()}})}get entityId(){return this._remoteDocument.entityId}whenSent(e=!1){return this._remoteDocument.whenSent(e)}sendAfterCurrentEdits(e){const t=this._pushUndoStop;return this._pushUndoStop=!1,this._remoteDocument.sendAfterCurrentEdits(e,t)}holdsTypedEdits(){return this._remoteDocument.holdsTypedEdits()}hasEditsAfterBoundary(){return this._remoteDocument.hasEditsAfterBoundary()}markHistoryAction(){return this._remoteDocument.markHistoryAction()}noteHistoryActionSent(e){this._remoteDocument.noteHistoryActionSent(e)}_textPoints(){return{nodeMap:this._nodeMap,textAt:(e,t)=>this._baseDocument.getText({start:e,end:t}),nodeAt:e=>this._parsedDocument.getNodeByPosition(e),isAttached:e=>this._parsedDocument.isAttached(e)}}pointToOffset(e){return aR(e,this._textPoints())}offsetToPoint(e){return lR(e,this._textPoints())}renderOnly(e){this._mutationCollector.stop();try{return e()}finally{this._mutationCollector.start()}}applyHidden(e){this._mutationCollector.pause();try{return e()}finally{this._mutationCollector.resume()}}applyForeignOutput(e,t,n){e.forEach(r=>this.ownership.markOutput(r)),this.applyHidden(t),this._keepOutput(n,e)}_keepOutput(e,t){t.length&&this._outputs.set(e,[...this._outputs.get(e)??[],...t])}_isGone(e){return!e.isConnected&&!this.isInLetter(e)}isInLetter(e){const t=this._nodeMap.getByElement(e);return!!t&&this._parsedDocument.isAttached(t)}letterChildren(e){return(this._nodeMap.getByElement(e)?.children??[]).flatMap(t=>{const n=this._nodeMap.getByNode(t);return n?[n]:[]})}runScript(e,t){this._mutationCollector.pauseForForeignCode(),this._runningScripts.push(e);try{t()}finally{try{this._mutationCollector.resumeAfterForeignCode()}finally{this._runningScripts.pop()}}}_scriptOf(){if(this._runningScripts.length)return this._runningScripts[this._runningScripts.length-1]??void 0;const e=document.currentScript;return e&&(this._nodeMap.getByElement(e)||this.ownership.isOutput(e))?e:void 0}_bindScriptOutput(e){const t=this._scriptOf();if(!t)return;const n=new Set(e.flatMap(o=>o.added)),r=[...n].filter(o=>!(o.parentNode&&n.has(o.parentNode))&&!this._nodeMap.getByElement(o)&&!this.ownership.isOutput(o)&&!this.ownership.isService(o)&&!this._runningScripts.includes(o));r.forEach(o=>this.ownership.markOutput(o)),this._keepOutput(t,r)}_dropOrphanedOutput(){let e=[...this._outputs.keys()].filter(t=>this._isGone(t));for(;e.length;){const t=e.flatMap(n=>this._outputs.get(n)??[]);e.forEach(n=>this._outputs.delete(n)),this.applyHidden(()=>t.flatMap(n=>this._unwrapOutput(n))).forEach(n=>this.ownership.forget(n)),e=[...this._outputs.keys()].filter(n=>this._isGone(n))}}_unwrapOutput(e){const t=[],n=r=>r.childNodes.forEach(o=>this.isInLetter(o)?t.push(o):n(o));return n(e),e.parentNode&&e.replaceWith(...t),t}_dropForeignOutput(e){if(this.ownership.hasOutput){const t=n=>!(this.ownership.isMarked(n)&&this.ownership.isOutput(n));for(const n of e)n.added=n.added.filter(t),n.reparented=n.reparented?.filter(t),n.reordered=n.reordered?.filter(t)}}_dropForeignNodes(e){const t=n=>!this.ownership.isMarked(n)||!!this._nodeMap.getByElement(n);for(const n of e)n.added=n.added.filter(t),n.reparented=n.reparented?.filter(t),n.reordered=n.reordered?.filter(t)}applyOwn(e){this._mutationCollector.takeRecords(),this._runningScripts.push(null);try{return this._mutationCollector.unpaused(e)}finally{this._runningScripts.pop()}}applyCommand(e){const t={paused:!1};this._commands.push(t);try{return this._mutationCollector.unpaused(e)}finally{this._commands.pop(),t.paused&&this._mutationCollector.resume()}}_rootsParent(){const e=this._getRootsParent?.();return e?{node:e,treeNode:this._parsedDocument.root}:void 0}getMappedParent(e){for(;e;){const t=this._nodeMap.getByElement(e);if(t){const n=this._parsedDocument.getContext(t);return n?this._nodeMap.getByNode(n):void 0}else e=e.parentNode}}getContext(e){return this.getMappedParent(e)||e}isInExternal(e){return this.getContext(e)!==e}isVisible(e){return!!this._nodeMap.getByElement(e)}getVisibleNode(e){let t=e;do{if(!t||this._nodeMap.getByElement(t))return t;t=t.parentNode||void 0}while(t)}_commit(e){if(e.length){e=this._attributeMapper.beforeCommit(e),e=TO(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;Hb(()=>{const n=dy(t.applyingMutation,r=>this._nodeMap.getByNode(r),r=>t.isAttached(r));return n&&{...n,stage:"tree"}},()=>t.applyMutations(e));for(const n of e)if(n.type==="Hidden"){const r=this._nodeMap.getByNode(n.node);r&&(this.ownership.markService(r),r.nodeType===Node.TEXT_NODE&&r.data===""&&this._hiddenEmptyTexts.add(r)),this._nodeMap.remove(n.node,n.value)}}finally{this._baseDocument.endUpdate()}}}correctNodes(e){const t=new Map;for(const n of e)if(!t.has(n)&&this._parsedDocument.contains(n)&&n.type===I.ELEMENT){const r=dd(n,!1,!1);r!==this._baseDocument.getText({start:n.start,end:n.startTagEnd===void 0?n.start:n.startTagEnd})+this._baseDocument.getText({start:n.endTagStart===void 0?n.end:n.endTagStart,end:n.end})&&t.set(n,r)}try{this._baseDocument.beginUpdate();for(const[n,r]of t)if(r!==this._baseDocument.getText({start:n.start,end:n.end})){const o=this._parsedDocument.replaceWithEx(n,r,rr),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{ll("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,c2()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)ll(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=zx(this._attributeMapper.onRemoteMutate(e),this._nodeMap),this._treeMutations=[],!t){const o=this._parsedDocument.root;for(const i of e)if(i.type==="Add"){if(i.parent===o){t=!0;break}}else if(i.type==="Remove"){if(i.node.parent===o){t=!0;break}}else if(i.type==="Move"&&(i.node.parent===o||i.parent===o)){t=!0;break}}const n=_x(e,this._nodeMap,o=>this._parsedDocument.isAttached(o),o=>this.ownership.markOf(o)==="service",o=>this.ownership.isOuterWrapper(o)),r=Ax(n);this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),r.push(...tN(Lx(n)));try{if(Hx(n,this._nodeMap,this.holdCaretAfterBreak),this._dropOrphanedOutput(),this._attributeMapper.restoreHidden(),t){const o=this._parsedDocument.root?.children;if(o){const i=o.map(a=>this._nodeMap.getByNode(a)).filter(a=>!!a),s=this._roots=this._mapHTMLRoots(i,this);Yd.isEqual(i,s)}}}finally{pb(r,this.scriptRunner)}}finally{this._mutationCollector.start(),this._scheduleAccountingCheck()}}getLinks(e){const t=this._nodeMap.getByElement(e),n=t?[[t,e]]:[];for(const r of e.childNodes)n.push(...this.getLinks(r));return n}setLinks(e){for(const[t,n]of e)this._nodeMap.set(t,n)}_clearLinks(e){for(const[t]of e)this._nodeMap.remove(t)}_removeByLinks(e,t){const n=new Set,r=[];for(const[o,i]of e)o.parent&&!n.has(o.parent)&&(this._parsedDocument.remove(o,t),r.unshift(ae.remove(i))),n.add(o);return r}getInnerHtml(e){let t=this._nodeMap.getByElement(e);return t?this._baseDocument.getText({start:t.startTagEnd===void 0?t.start:t.startTagEnd,end:t.endTagStart===void 0?t.end:t.endTagStart}):""}getOuterHtml(e){let t=this._nodeMap.getByElement(e);return t?this._baseDocument.getText({start:t.start,end:t.end}):""}getRootsHtml(){const e=this._getRootsParent?.();return e?[...e.childNodes].map(t=>this.getOuterHtml(t)).join(""):""}setInnerHtml(e,t){if(e instanceof Element)e.innerHTML=t;else if(e instanceof Comment)e.data=t;else if(e instanceof Document){st("not supported inner html of Document");return}else e instanceof Text&&(e.textContent=t)}getElementByPosition(e){let t=this._parsedDocument.getNodeByPosition(e);if(t){let n;do n=this._nodeMap.getByNode(t);while(!n&&(t=t?.parent));return n}}getRangeByElement(e,t=!1){if(e){let n=null;do n=this._nodeMap.getByElement(e);while(t&&!n&&(e=e.parentElement));if(n)return{start:n.start,end:n.end}}}},lne=1500,cne=2,hR=100,pR=class{constructor(e){k(this,"_options",void 0),k(this,"_watches",new Map),k(this,"_timer",void 0),k(this,"_last",0),k(this,"_tick",()=>{const t=Date.now(),n=Math.min(Math.max(t-this._last,0),200);this._last=t;for(const[r,o]of this._watches){if(!this._options.isAwaiting(r)){this._watches.delete(r);continue}if(o.waited+=n,!(o.waited<1500)){if(o.retries<2){o.retries+=1,o.waited=0,o.resend();continue}t-o.startedAt<15e3||(this._watches.delete(r),this._options.onGiveUp(r,o.retries))}}this._watches.size||this._stop()}),this._options=e}watch(e,t){this._watches.set(e,{startedAt:Date.now(),waited:0,retries:0,resend:t}),this._timer===void 0&&(this._last=Date.now(),this._timer=setInterval(this._tick,hR))}resendNow(e){const t=this._watches.get(e);t&&(t.waited=0,t.resend())}giveUpNow(e){const t=this._watches.get(e);this._watches.delete(e),this._options.onGiveUp(e,t?.retries??0)}dispose(){this._watches.clear(),this._stop()}_stop(){this._timer!==void 0&&(clearInterval(this._timer),this._timer=void 0)}},sf=class{constructor(){k(this,"_changes",null),k(this,"_typedAt",null),k(this,"_selection",null),k(this,"_closesStep",!1)}get(){return this._changes}hasChanges(){return!!this._changes?.length}add(e){this.hasChanges()||(this._selection=null);const t=At(this._changes,e);this._changes=t.length?t:null;const n=Date.now();this._typedAt=this._changes?{from:this._typedAt?.from??n,to:n}:null}clear(){this._changes=null,this._typedAt=null,this._selection=null,this._closesStep=!1}closeStep(){this._closesStep=!0}closesStep(){return this._closesStep}replace(e){this._changes=e.length?e:null,this._selection=null,this._changes||(this._typedAt=null)}typedAt(){return this._typedAt}selection(){return this._selection}noteSelection(e,t){this.hasChanges()&&(this._selection=t?e:this._selection&&{before:this._selection.before,after:e.after})}takeFrom(e){this._changes=e._changes,this._typedAt=e._typedAt,this._selection=e._selection,this._closesStep=e._closesStep,e.clear()}absorb(e){const t=this._typedAt,n=e._typedAt,r=this.hasChanges()?this._selection&&e._selection&&{...this._selection,after:e._selection.after}:e._selection;e._changes&&this.add(e._changes),this._closesStep=e._closesStep,this._selection=this._changes?r:null,this._changes&&(this._typedAt=t&&n?{from:Math.min(t.from,n.from),to:Math.max(t.to,n.to)}:n??t)}correctOffset(e,t){const n=this._changes;if(n){let r=0;for(let o=0,i=n.length;o<i;o++){const s=n[o];if(s.oldPosition<e)r+=s.newLength-s.oldLength;else break}e=e+(t?1:-1)*r}return e}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}},sv=60;function gR(e,t){const n=Ib(e,t);if(!n)return;const r=n.start;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+sv),cached:t.substring(r,r+sv)}}var bR=64,yR=class extends Ee{constructor(...e){super(...e),k(this,"_onApplyEmitter",this.addDisposable(new ge)),k(this,"_onEmptyEmitter",this.addDisposable(new ge)),k(this,"_dispatched",[]),k(this,"_echoed",new Set),k(this,"_revertedAwaiting",new Set),k(this,"onApply",this._onApplyEmitter.event),k(this,"onEmpty",this._onEmptyEmitter.event)}_emit(e){e.length&&this._onApplyEmitter.fire(e),this.hasDispatched()||this._onEmptyEmitter.fire()}hasDispatched(){return!!this._dispatched.length}isInFlight(e){return this._dispatched.some(t=>t.changeId===e)}hasRevertedAwaiting(){return this._revertedAwaiting.size>0}revertedAwaitingIds(){return new Set(this._revertedAwaiting)}awaitingIds(){return[...this._dispatched.flatMap(e=>e.changeId===void 0?[]:[e.changeId]),...this._revertedAwaiting]}isRevertedAwaiting(e){return this._revertedAwaiting.has(e)}forgetReverted(e){for(const t of e)this._revertedAwaiting.delete(t)}wasEchoed(e){return e!==void 0&&this._echoed.has(e)}countDispatched(){return this._dispatched.reduce((e,t)=>e+t.textChanges.length,0)}_remember(e){this._echoed.add(e),this._echoed.size>bR&&this._echoed.delete(this._echoed.values().next().value)}append(e,t){this._dispatched.unshift({changeId:t,textChanges:e})}apply(e,t,n=!1,r=[e]){const o=t===void 0?-1:this._dispatched.findIndex(i=>i.changeId===t);if(t!==void 0&&(this._remember(t),this._revertedAwaiting.delete(t)),o>=0){this._confirmEcho(o,e);return}n&&this._rebaseDispatched(r)||this._applyExternal(e)}_rebaseDispatched(e){const t=[...this._dispatched].reverse().map(r=>({...r}));let n=[];for(const r of e){let o=r;for(const i of t){const s=ul(i.textChanges,o,"after"),a=s&&ul(o,i.textChanges,"before");if(!s||!a)return!1;i.textChanges=s,o=a}n=At(n,o)}return this._dispatched=t.reverse(),this._emit(n),!0}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(At(Pn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=At(t,Pn(n.textChanges)),n.changeId!==void 0&&this._revertedAwaiting.add(n.changeId);this._dispatched=[],this._emit(At(t,e))}clear(){const e=this.hasDispatched();this._dispatched=[],this._revertedAwaiting.clear(),e&&this._onEmptyEmitter.fire()}},vR=class Qk extends Ee{constructor(t=""){super(),k(this,"_text",void 0),this._text=t}getText(t){const n=C2(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new Qk(this._text)}},wl=class Jk extends vR{constructor(t=""){super(t),k(this,"_eventQueue",void 0),k(this,"_lockCounter",0),k(this,"_onChangeEmitter",this.addDisposable(new ge)),k(this,"_onChangedEmitter",this.addDisposable(new ge)),k(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>x2(this,r)),n.length){const r=Uo(n,this);this._eventQueue&&this._eventQueue.push({source:t,changes:r}),this.change(t,n),this._eventQueue||this._onChangedEmitter.fire({source:t,changes:r})}}change(t,n){this._text=k2(this._text,n)}beginUpdate(){this._lockCounter++===0&&(this._eventQueue=[])}endUpdate(t){const n=this._eventQueue;if(--this._lockCounter===0&&n&&(this._eventQueue=void 0,n.length)){t===void 0&&(t=n[0].source);let r=null;for(const{changes:o}of n)r=At(r,o);if(r=r?.filter(o=>o.oldPosition!==o.newPosition||o.newText!==o.oldText),r?.length)return this._onChangedEmitter.fire({source:t,changes:r}),!0}return!1}clone(){return new Jk(this._text)}};function av(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function _l(e){const t=e.indexOf("(");if(t<0)return!0;let n=0,r="",o=!1;for(let i=t;i<e.length;i++){const s=e[i];if(o){o=!1;continue}if(s==="\\"){o=!0;continue}if(r){s===r&&(r="");continue}if(s==='"'||s==="'"){r=s;continue}if(s==="("){n++;continue}if(s===")"&&(n--,n<0))return!1}return n===0}function ER(e){return(t,n,r)=>_l(t)?e(t,n,r):!1}function SR(e){return t=>_l(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function wR(e){return(t,n,r)=>_l(t)?av(t)?e(t,n,r):t:!1}function _R(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return _l(n)?av(n)?e(t):t:!1}}function CR(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function af(e,t){const n=e.length;for(let r=0;r<n;r++){const o=e.charCodeAt(r);if(o===0||t==='"'&&o===34||t==="'"&&o===39||t===""&&(o===32||o===9||o===10||o===13||o===12||o===34||o===39||o===60||o===62||o===61||o===96))return!1}return!0}function TR(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",r=new Uint8Array(e);crypto.getRandomValues(r);let o="";for(let i=0;i<e;i++){const s=r[i]%62;o+=t.charAt(s)}return o}var AR=8,kR=class{constructor(){k(this,"_byKey",Object.create(null)),k(this,"_byValue",Object.create(null))}getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=TR(AR),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},Cl=new kR;function lv(e,t){return t!==void 0&&!af(e,t)?`%|{${Cl.getOrCreateByKey(e)}}|%`:e}function LR(e){const t=Cl.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Ze(e,t,n){return t!==void 0?af(e,t)?e:`%|{${Cl.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function NR(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function ze(e){return e.startsWith("<!--")&&e.endsWith("-->")?NR(e.slice(4,-3)):e}function xR(e){const t=/^(IF|ELSE|ELSIF|ELSEIF|END|FOREACH|WHILE|NEXT|LAST|BREAK|DO|UNLESS|CONTINUE|SET|UNSET|DEFINE|INCLUDE)\b/i,n=/\w+\s*\(/;let r=e;const o=e.match(/\[%\s*([^%]*?)\s*%\]/);o&&(r=o[1]);const i=r.trim();return t.test(i)||n.test(i)}function OR(e,t,n){return t!==void 0?af(e,t)?e:`%|{${Cl.getOrCreateByKey(e)}}|%`:n||CR(e)||xR(e)?`<!--${e}-->`:e}var io=ER(Ze),so=SR(ze),RR=wR(Ze),MR=_R(ze),PR=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",LR),e.escape("@{","}",Ze,!0).unescape("<!--@{","}-->",ze,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",lv,!0),e.escape("{{","}}",lv,!0),e.createSyntax("brace-percent").escape("{%","%}",Ze).unescape("<!--{%","%}-->",ze),e.createSyntax("brace-hash").escape("{#","#}",Ze).unescape("<!--{#","#}-->",ze),e.createSyntax("proscript").escape("[%","%]",OR,!0).unescape("<!--[%","%]-->",ze,!0),e.createSyntax("getresponse").escape("[[IF","]]",Ze).escape("[[if","]]",Ze).escape("[[ELSE]]","",Ze).escape("[[else]]","",Ze).escape("[[ENDIF]]","",Ze).escape("[[endif]]","",Ze).unescape("<!--[[IF","]]-->",ze).unescape("<!--[[if","]]-->",ze).unescape("<!--[[ELSE]]","-->",ze).unescape("<!--[[else]]","-->",ze).unescape("<!--[[ENDIF]]","-->",ze).unescape("<!--[[endif]]","-->",ze),e.createSyntax("expert-sender").escape("<if",">",Ze).escape("</if",">",Ze).escape("<else",">",Ze).escape("</else",">",Ze).escape("<var ",">",Ze,!0).unescape("<!--<if ",">-->",ze).unescape("<!--</if",">-->",ze).unescape("<!--<else ",">-->",ze).unescape("<!--</else",">-->",ze).unescape("<!--<var",">-->",ze,!0),e.createSyntax("velocity").escape("#if",")",io).escape("#elseif",")",io).escape("#else","",Ze).escape("#foreach",")",io).escape("#macro",")",io).escape("#set",")",RR,!0).escape("#parse",")",io).escape("#include",")",io).escape("#evaluate",")",io).escape("#end","",Ze).escape("#break","",Ze).escape("#stop","",Ze).unescape("<!--#macro","-->",so).unescape("<!--#if","-->",so).unescape("<!--#elseif","-->",so).unescape("<!--#else","-->",ze).unescape("<!--#foreach","-->",so).unescape("<!--#parse","-->",so).unescape("<!--#include","-->",so).unescape("<!--#evaluate","-->",so).unescape("<!--#end","-->",ze).unescape("<!--#break","-->",ze).unescape("<!--#stop","-->",ze).unescape("<!--#set","-->",MR,!0),e.createSyntax("mailchimp").escape("*|","|*",Ze).unescape("<!--*|","|*-->",ze)},cv="bare",lf=new Map;function IR(e){for(const t of Object.keys(e)){const n=e[t];n&&lf.set(t,n)}}function DR(e){return e?lf.get(e)??cv:cv}function BR(){lf.clear()}function uv(e,t,n,r){for(let o=t;o<n;o++){const i=e[o];r.insideAttributeValue?r.attributeQuoteChar==='"'||r.attributeQuoteChar==="'"?i===r.attributeQuoteChar&&(r.insideAttributeValue=!1,r.attributeQuoteChar=void 0):r.unquotedAttr&&/[\s>]/.test(i)&&(r.insideAttributeValue=!1,r.attributeQuoteChar=void 0,r.unquotedAttr=!1):i==="<"?r.insideTag=!0:i===">"?r.insideTag=!1:r.insideTag&&(i==='"'||i==="'")?(r.insideAttributeValue=!0,r.attributeQuoteChar=i,r.unquotedAttr=!1):r.insideTag&&/\S/.test(i)&&r.attributeQuoteChar===void 0&&e[o-1]==="="&&!['"',"'","`"].includes(i)&&(r.insideAttributeValue=!0,r.attributeQuoteChar="",r.unquotedAttr=!0)}}function bs(e,t){return e.start<t.end&&t.start<e.end}function dv(e,t,n,r,o=[]){if(n&&(t=t.filter(u=>u.isVariable)),!t.length)return[];const i=t.flatMap(u=>u.match(e).flatMap(d=>!Number.isInteger(d.start)||!Number.isInteger(d.end)||d.start<0||d.end>e.length||d.start>=d.end?[]:[{range:d,mapFn:u.mapFn,overrideBuiltins:u.overrideBuiltins,syntax:u.syntax,isVariable:u.isVariable}])).sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end),s=[],a=o.slice().sort((u,d)=>u.start-d.start),l={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let c=0;for(const{range:u,mapFn:d,overrideBuiltins:f,syntax:h,isVariable:m}of i){if(r?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):uv(e,c,u.start,l),c=u.end,a.some(_=>bs(_,u)))continue;const p=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,v=e.substring(u.start,u.end),w=d(v,p,l.insideTag);w!==!1&&w!==v&&(s.push({range:u,text:w,overrideBuiltins:f,syntax:h,isVariable:m}),a.push(u))}return s.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function HR(e,t){const n=t.reduce((a,{mapFn:l,start:c,end:u,syntax:d,isVariable:f})=>(a[c]||(a[c]=[]),a[c].push({value:u,mapFn:l,syntax:d,isVariable:f}),a),Object.create(null)),r=Object.keys(n).map(a=>a.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&")).join("|"),o=new RegExp(r,"g"),i=[];let s;for(;(s=o.exec(e))!==null;){const a=s[0];i.push({start:s.index,startToken:a,endTokens:n[a]})}return i}function cf(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=HR(e,t),a={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let l=0;for(let c=0;c<s.length;c++){const{start:u,startToken:d,endTokens:f}=s[c];r?(a.insideAttributeValue=!0,a.attributeQuoteChar='"'):uv(e,l,u,a),l=u;const h=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let m=!1;for(const{mapFn:p,value:v,syntax:w,isVariable:_}of f){let A=u+d.length,b=e.indexOf(v,A);for(;b!==-1;){let g=b,E=u+d.length,T=0;for(;g!==-1;){const x=e.indexOf(d,E);if(x!==-1&&x<g)T++,E=x+d.length,g=e.indexOf(v,E);else if(T>0)T--,E=g+v.length,g=e.indexOf(v,E);else break}if(g<0)break;const y=g+v.length,S=e.substring(u,y),C=p(S,h,a.insideTag);if(C===!1){A=b+Math.max(v.length,1),b=e.indexOf(v,A);continue}(o||C!==S)&&i.push({range:{start:u,end:y},text:o?S:C,syntax:w,isVariable:_});const L=s.findIndex(({start:x})=>x>=y);L>c?c=L-1:c=s.length,m=!0;break}if(m)break}}return i}function Tl(e,t){if(!t.length)return e;const n=t.slice().sort((o,i)=>i.range.start-o.range.start);let r=e;for(const{text:o,range:i}of n)r=r.slice(0,i.start)+o+r.slice(i.end);return r}var fv=class{constructor(e=PR){k(this,"_disposables",[]),k(this,"_escapes",[]),k(this,"_unescapes",[]),k(this,"_escapeMatchers",[]),k(this,"_unescapeMatchers",[]);const{_escapes:t,_unescapes:n}=this;e({createSyntax(r){return{...this,syntax:r}},escape(r,o,i,s){return t.push({start:r,end:o,mapFn:i,isVariable:s,syntax:this.syntax||r}),this},unescape(r,o,i,s){return n.push({start:r,end:o,mapFn:i,isVariable:s,syntax:this.syntax||r}),this}})}registerMatcherPair(e){const t=e.syntax||"matcher",n={syntax:t,match:e.escape.match,mapFn:e.escape.mapFn,isVariable:e.escape.isVariable,overrideBuiltins:e.escape.overrideBuiltins},r={syntax:t,match:e.unescape.match,mapFn:e.unescape.mapFn,isVariable:e.unescape.isVariable,overrideBuiltins:e.unescape.overrideBuiltins};this._escapeMatchers.push(n),this._unescapeMatchers.push(r);let o=!1;const i={dispose:()=>{o||(o=!0,this._escapeMatchers=this._escapeMatchers.filter(s=>s!==n),this._unescapeMatchers=this._unescapeMatchers.filter(s=>s!==r))}};return this.addDisposable(i),i}_collectMappings(e,t,n){const r=cf(e,this._escapes,t,n),o=dv(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>bs(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>bs(l.range,c.range)));return[...s,...a].sort((l,c)=>l.range.start-c.range.start||l.range.end-c.range.end)}getMappings(e,t,n){return this._collectMappings(e,t,n)}_collectRevertMappings(e,t){const n=cf(e,this._unescapes,t),r=dv(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>bs(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>bs(a.range,l.range)));return[...i,...s].sort((a,l)=>a.range.start-l.range.start||a.range.end-l.range.end)}getRevertMappings(e,t,n){const r=n?o=>o!==void 0&&n.has(o):o=>DR(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return cf(e,this._escapes,t,n,!0)}getEscapedText(e,t){return Tl(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return Tl(e,this.getRevertMappings(e,t,n))}normalizeToPolicy(e,t){const n=i=>i===void 0?void 0:t[i],r=Object.values(t);let o=e;return r.includes("bare")&&(o=Tl(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=Tl(o,this._collectMappings(o).filter(i=>!i.isVariable&&n(i.syntax)==="html-comment"&&i.text.startsWith("<!--")&&i.text.endsWith("-->")))),o}hasDetectedMappings(e,t,n){return this.getDetectedMappings(e,t,n).length>0}addDisposable(e){this._disposables.push(e)}dispose(){for(const e of this._disposables)e.dispose()}},FR=1e4,mv=3,$R=r2+Rd;function WR(e){return(e??[]).reduce((t,n)=>t+n.oldLength,0)}function qR(e,t){return e.stack.closesStep()?!1:e.undoStop===t.undoStop||e.serviceRemoval+t.serviceRemoval<=200}var zR=class extends wl{constructor(){super(),k(this,"_editStack",new sf),k(this,"_frozenStack",new sf),k(this,"_frozenUndoStop",!0),k(this,"_barrierSends",[]),k(this,"_barrierResolves",[]),k(this,"_queuedBarriers",[]),k(this,"_editLog",[]),k(this,"_entityId",void 0),k(this,"_versionController",this.addDisposable(new yR)),k(this,"_beforeSaveEmitter",this.addDisposable(new UN)),k(this,"_onReadyEmitter",this.addDisposable(new ge)),k(this,"_onEntitySetEmitter",this.addDisposable(new ge)),k(this,"_onPendingSentEmitter",this.addDisposable(new ge)),k(this,"_onHistoryAnswerEmitter",this.addDisposable(new ge)),k(this,"_onHistoryActionEmitter",this.addDisposable(new ge)),k(this,"_onHistoryActionSentEmitter",this.addDisposable(new ge)),k(this,"_onHistoryActionAnsweredEmitter",this.addDisposable(new ge)),k(this,"_canvasEdits",0),k(this,"_nextActionId",1),k(this,"_historyAction",null),k(this,"_cache",new wl),k(this,"beforeSave",this._beforeSaveEmitter.event),k(this,"_reverting",!1),k(this,"_inited",!1),k(this,"_nextChangeId",1),k(this,"_originId",`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`),k(this,"_rev",null),k(this,"_sealed",[]),k(this,"_saveHeld",!1),k(this,"_releasing",!1),k(this,"_applyingRemote",!1),k(this,"collectCanvasEdits",()=>Promise.resolve()),k(this,"_echoLost",!1),k(this,"_reportedText",null),k(this,"_reportId",0),k(this,"_lostChangeIds",new Set),k(this,"_recoveryTimer",void 0),k(this,"_recoveryOverdue",!1),k(this,"_coveredRev",null),k(this,"_awaitingRefill",!1),k(this,"_resyncing",!1),k(this,"_onEchoLostEmitter",this.addDisposable(new ge)),k(this,"_onEchoRecoveredEmitter",this.addDisposable(new ge)),k(this,"_echoWatchdog",this.addDisposable(new pR({isAwaiting:e=>this._versionController.isInFlight(e)||this._versionController.isRevertedAwaiting(e),onGiveUp:(e,t)=>this._onEchoLost(e,t)}))),k(this,"_handleUpdateEntity",e=>{const{edits:t,guid:n,changeId:r,rev:o}=e;if(e.resync&&n===this._entityId){const{reportId:i,textFingerprint:s}=e.resync,a=this._awaitingRefill?null:this._reportedText;return a!==null&&i===this._reportId?this._applyResync(e,s,a):void 0}if(this._versionController.wasEchoed(r)||this._isCovered(e)){e.historyAnswer?.actionId!==void 0&&n===this._entityId&&this._takeHistoryAnswer({actionId:e.historyAnswer.actionId});return}if(n===this._entityId){this._reportSyncDrift("update-entity");const i=this._onRemoteChange(t,r,o);return e.historyAnswer&&this._takeHistoryAnswer(e.historyAnswer),i}}),k(this,"_handleSetEntity",e=>{this._reportSyncDrift("set-entity"),BR(),IR(e.templateDirectivesPolicy??{});const t=e.guid===this._entityId,n=this._unsentLayers().some(r=>r.hasChanges());this._entityId=e.guid,this._onEntitySetEmitter.fire(e.guid),this._historyAction=null,this._editStack.clear(),this._sealed=[],this._releasing=!1,this._clearFrozen(),this._finishBarrier(t&&!this._holdsUnsent()&&!n),this._versionController.clear(),this._saveHeld=!1,this._awaitingRefill=!1,this._clearEchoLost(),this._onPendingSentEmitter.fire(),this._replaceText(e.html),this._rev=e.rev??null,this._coveredRev=this._rev,this._onReadyEmitter.fire()}),k(this,"_onRemoteChange",(e,t,n)=>t===void 0&&this._echoLost&&e.every(r=>!r.length)?this._whenNoneDispatched():new Promise((r,o)=>{const i=this._applyGroupsToCache(e),s=i.reduce((c,u)=>At(c,u),[]);this._rev=n??null;const a=this._versionController.revertedAwaitingIds();this._versionController.apply(s,t,n!==void 0&&!this._echoLost,i);const l=[...this._lostChangeIds].filter(c=>a.has(c)&&this._versionController.isRevertedAwaiting(c)&&this.hasChanges());!this._versionController.hasDispatched()&&!this._awaitingRefill&&!l.length&&(this._versionController.forgetReverted(this._lostChangeIds),this._clearEchoLost(),this._flushPendingSave()),this._whenNoneDispatched().then(r)})),k(this,"onReady",this._onReadyEmitter.event),k(this,"onEntitySet",this._onEntitySetEmitter.event),k(this,"onHistoryAnswer",this._onHistoryAnswerEmitter.event),k(this,"onHistoryAction",this._onHistoryActionEmitter.event),k(this,"onHistoryActionSent",this._onHistoryActionSentEmitter.event),k(this,"onHistoryActionAnswered",this._onHistoryActionAnsweredEmitter.event),this.addDisposable(z.addListenerAsync(ue.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(z.addListenerAsync(ue.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this.addDisposable(z.addListenerAsync(ue.SANDBOX_CANVAS_SYNCED,e=>this.whenSynced(e?.applied))),this._versionController.onApply(this._onApply.bind(this)),this.addDisposable({dispose:()=>clearTimeout(this._recoveryTimer)})}loadState(e){this._entityId=e.entityId;const t=[[{range:ls(this._cache),text:e.text}]];this._onRemoteChange(t)}get entityId(){return this._entityId}saveState(){return{entityId:this._entityId,text:this.getText()}}_onApply(e){const t=this._unsentLayers();if(t.every(i=>!i.hasChanges())){super.applyEdits(or,ro(e));return}let n=e;const r=[];let o=-1;for(const[i,s]of t.entries()){const a=s.get();if(!a){r.push(null);continue}const l=ul(a,n,"after"),c=l&&ul(n,a,"before");if(!l||!c){o=i;break}r.push(l),n=c}if(o>=0){this._dropLayersFrom(o,t,n),t.slice(0,o).forEach((i,s)=>{const a=r[s];a&&i.replace(a)}),this._compactSealed();return}try{this._applyingRemote=!0,super.applyEdits(or,ro(n))}finally{this._applyingRemote=!1}t.forEach((i,s)=>{const a=r[s];a&&i.replace(a)}),this._compactSealed()}_dropLayersFrom(e,t,n){const r=t.slice(e).reduce((a,l)=>At(a,l.get()??[]),[]),o=[],i=[],s=Math.max(e-1,0);this._sealed.splice(Math.max(e-1-this._queuedBarriers.length,0));for(const a of this._queuedBarriers.splice(s))o.push(...a.sends),i.push(...a.resolves);e===0&&(this._frozenStack.clear(),o.unshift(...this._barrierSends.splice(0)),i.unshift(...this._barrierResolves.splice(0))),this._editStack.clear(),this._setSaveHeld(this._saveHeld&&this._sealed.length>0),super.applyEdits(or,ro(At(Pn(r),n))),this._runBarrier(o,i,!1)}_unsentLayers(){return[this._frozenStack,...this._queuedBarriers.map(e=>e.stack),...this._sealed.map(e=>e.stack),this._editStack]}_unsentChanges(){return this._unsentLayers().reduce((e,t)=>At(e,t.get()??[]),[])}_textWithoutUnsent(){return S2(this.getText(),Pn(this._unsentChanges()))}isApplyingRemote(){return this._applyingRemote}_flushPendingSave(){this._versionController.hasRevertedAwaiting()||(this._releaseBarrier(),this._sealed.length&&(this._sendSealed(),this._onPendingSentEmitter.fire()))}_setSaveHeld(e){const t=this._saveHeld&&!e;this._saveHeld=e,t&&this._onPendingSentEmitter.fire()}_isSent(e=!1){return!this._frozenStack.hasChanges()&&(!this._sealed.length||e&&this._saveHeld)}_seal(e){if(this._editStack.hasChanges()){const t=e?0:WR(this._editStack.get()),n=new sf;n.takeFrom(this._editStack),this._sealed.push({stack:n,undoStop:e,serviceRemoval:t})}this._compactSealed()}_compactSealed(){const e=this._sealed.length>0,t=[];for(const n of this._sealed){const r=t[t.length-1];if(n.stack.hasChanges()){if(!r||!qR(r,n)){t.push(n);continue}r.stack.absorb(n.stack),r.undoStop||(r.undoStop=n.undoStop),r.serviceRemoval+=n.serviceRemoval,r.stack.hasChanges()||t.pop()}}this._sealed=t,e&&!t.length&&(this._releasing=!1,this._saveHeld=!1,this._onPendingSentEmitter.fire())}_sendSealed(e=!1,t=!1){if(this._compactSealed(),this._rev!==null&&(this._awaitsEcho()||this._frozenStack.hasChanges()||this._holdsUnsent()))return!0;const n=e||this._sealed.some(o=>o.undoStop);if(!t&&!this._releasing&&this._beforeSaveEmitter.fire(n)===!1)return this._setSaveHeld(this._sealed.length>0),!1;const r=this._entityId;if(!r)return!1;for(;this._sealed.length;){const[o]=this._sealed.splice(0,1),i=o?.stack.get()?.flatMap(s=>Gb(s));if(o&&i?.length&&(this._dispatch(r,i,o.undoStop,o.stack.typedAt(),o.stack.selection(),o.stack.closesStep()),this._rev!==null))break}return this._compactSealed(),this._setSaveHeld(!1),!0}whenSent(e=!1){return this._isSent(e)?Promise.resolve():new Promise(t=>{const n=this._onPendingSentEmitter.event(()=>{this._isSent(e)&&(n.dispose(),t())})})}_countUnsent(){const e=this._unsentLayers().reduce((t,n)=>t+(n.get()?.length??0),0);return this._versionController.countDispatched()+e}_onEchoLost(e,t){if(this._lostChangeIds.add(e),this._echoLost)return;this._echoLost=!0,this._armRecoveryDeadline();const n=this._countUnsent(),r=this._textWithoutUnsent(),o=++this._reportId;this._reportedText=r,kr("echo-timeout",()=>({guid:this._entityId,at:"update-entity",unsent:n,textFingerprint:Db(r),canvasText:r,reportId:o,dropsCovered:!0,originId:this._originId})),this._onEchoLostEmitter.fire()}holdsTypedEdits(){return this._frozenStack.hasChanges()}hasEditsAfterBoundary(){return this._editStack.hasChanges()||this._sealed.length>0}markHistoryAction(){const e=this._nextActionId++;return this._historyAction={id:e,edits:this._canvasEdits,answered:!1},this._onHistoryActionEmitter.fire(e),e}noteHistoryActionSent(e){this._onHistoryActionSentEmitter.fire(e)}noteSelection(e,t){const n=this._sealed.length>0&&this._editStack.selection()===null;this._editStack.noteSelection(e,t||n)}_takeHistoryAnswer({actionId:e,selection:t}){const n=this._historyAction,r=e!==void 0,o=r&&n?.id===e?n:void 0;o&&(o.answered=!0);const i=r?o?.edits===this._canvasEdits:!n||n.answered;t&&i&&!this.hasChanges()&&!this._awaitsEcho()&&!this._holdsUnsent()&&this._onHistoryAnswerEmitter.fire({selection:t,own:r}),o&&this._onHistoryActionAnsweredEmitter.fire(o.id)}_holdsUnsent(){return this._echoLost||this._awaitingRefill}async whenSynced(e){const t=new ge;let n=!1;const r=setTimeout(()=>{n=!0,t.fire()},$R),o=e!==void 0&&e.guid!==this._entityId;try{return e&&!o&&this._settleByReceipt(e),await this.collectCanvasEdits(),o?this._syncState():await this._syncedBefore(t,()=>n)}finally{clearTimeout(r),t.dispose(),this._releasing=!1}}async _syncedBefore(e,t){const n=()=>({synced:!1,unsent:this._countUnsent()});let r=0;if(t())return this._syncState();for(;;){if(this._echoLost){if(!await this._awaitEchoRecovery(e)||t())return n();continue}if(this._saveHeld&&r++<mv&&(this._releasing=!0,this._sendSealed(!0,!0)),await this._awaitAny([this._onEchoLostEmitter.event,e.event],this.whenSent(!this._releasing)),t())return n();if(!this._echoLost&&!(this._sealed.length>0&&!this._saveHeld)){if(this._saveHeld){if(r<mv)continue;return n()}if(!this._versionController.hasDispatched())return{synced:!0,unsent:0};if(await this._awaitAny([this._versionController.onEmpty,this._onEchoLostEmitter.event,e.event]),t())return n()}}}_syncState(){return this._hasUnsynced()?{synced:!1,unsent:this._countUnsent()}:{synced:!0,unsent:0}}_settleByReceipt(e){const t=e.originId===void 0||e.originId===this._originId?e.changeId:0;for(const n of this._versionController.awaitingIds())n<=t?this._echoWatchdog.giveUpNow(n):this._echoWatchdog.resendNow(n)}_hasUnsynced(){return this._holdsUnsent()||this._sealed.length>0||this._frozenStack.hasChanges()||this._versionController.hasDispatched()}_awaitAny(e,t){return new Promise(n=>{const r=()=>{o.forEach(i=>i.dispose()),n()},o=e.map(i=>i(r));t?.then(r)})}_awaitEchoRecovery(e){return new Promise(t=>{const n=setTimeout(()=>i(!1),Rd),r=this._onEchoRecoveredEmitter.event(()=>i(!0)),o=e.event(()=>i(!1)),i=s=>{clearTimeout(n),r.dispose(),o.dispose(),t(s)}})}_armRecoveryDeadline(){clearTimeout(this._recoveryTimer),this._recoveryTimer=setTimeout(()=>{this._recoveryOverdue=!0,this._finishBarrier(!1)},Rd)}_connectionLost(){return this._recoveryOverdue||this._awaitingRefill}_clearEchoLost(){const e=this._echoLost;clearTimeout(this._recoveryTimer),this._recoveryOverdue=!1,this._echoLost=!1,this._reportedText=null,this._lostChangeIds.clear(),e&&this._onEchoRecoveredEmitter.fire()}_isCovered({guid:e,rev:t,changeId:n}){return this._coveredRev===null||t===void 0||e!==this._entityId||t>this._coveredRev?!1:!(n!==void 0&&(this._versionController.isInFlight(n)||this._versionController.isRevertedAwaiting(n)))}_applyResync({edits:e,rev:t},n,r){this._versionController.clear();try{this._resyncing=!0,this._cache.applyEdits(or,[{range:ls(this._cache),text:r}]),this._rev=t??null,this._applyToCache(e),this._versionController.apply(this._changesToCache())}catch{}finally{this._resyncing=!1}const o=Db(this._cache.getText());if(o.length!==n.length||o.hash!==n.hash){this._awaitingRefill=!0,this._finishBarrier(!1),kr("resync-failed",()=>({guid:this._entityId,textFingerprint:o}));return}this._coveredRev=this._rev,this._clearEchoLost(),this._flushPendingSave(),this._onReadyEmitter.fire()}_replaceText(e){this._cache.applyEdits(or,[{range:ls(this._cache),text:e}]),super.applyEdits(or,[{range:ls(this),text:e}])}_reportSyncDrift(e){if(this.hasChanges()||this._versionController.hasDispatched())return;const t=gR(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;kr("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}_changesToCache(){const e=this._textWithoutUnsent(),t=this._cache.getText(),n=Ib(e,t);if(!n)return[];const{start:r,fromEnd:o,toEnd:i}=n;return[new Vt(r,e.slice(r,o),r,t.slice(r,i))]}_applyToCache(e){return this._applyGroupsToCache(e).reduce((t,n)=>At(t,n),[])}_applyGroupsToCache(e){const t=[];for(const n of e){const r=n.reverse();t.push(Uo(r,this._cache)),this._cache.applyEdits(or,r)}return t}_whenNoneDispatched(){return new Promise(e=>{if(!this._versionController.hasDispatched()){this._onReadyEmitter.fire(),e();return}const t=this._versionController.onEmpty(()=>{t.dispose(),e()})})}applyEdits(e,t){if(!this._reverting){const n=Uo(t,this);n.length&&this._canvasEdits++,this._editStack.add(n),super.applyEdits(e,t),this._editLog.push(t)}}correctOffset(e,t){const n=this._unsentLayers();return t?n.reduce((r,o)=>o.correctOffset(r,!0),e):n.reduceRight((r,o)=>o.correctOffset(r),e)}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}_awaitsEcho(){return this._versionController.hasDispatched()||this._versionController.hasRevertedAwaiting()}saveChanges(e=!0,t=!1){return this._reverting?!1:(this._seal(e),this._sendSealed(e,t))}closeStep(){this._editStack.closeStep()}_dispatch(e,t,n,r,o=null,i=!1){const s=this._nextChangeId++;this._versionController.append(t,s);const a={guid:e,pushUndoStop:n,edits:ro(t),changeId:s,originId:this._originId,...this._rev!==null?{baseRev:this._rev}:{},...r?{typedAt:r}:{},...o?{selection:o}:{},...i?{closesStep:i}:{}},l=()=>z.send(ue.APPLICATION_UPDATE_ENTITY,a);l(),this._echoWatchdog.watch(s,()=>{this._versionController.isInFlight(s)&&l()})}async sendAfterCurrentEdits(e,t=!1){if(this._connectionLost()&&this.hasChanges())return!1;this._seal(t);const n=this._frozenStack.hasChanges();if(!n&&!this._sealed.length)return e(),!0;const r=this._rev!==null&&(this._awaitsEcho()||this._holdsUnsent());return!n&&!r&&(this._sendSealed(),!this._sealed.length||this._saveHeld)?(e(),!0):new Promise(o=>this._freezeSealed(e,o))}_freezeSealed(e,t){this._compactSealed();for(const{stack:r,undoStop:o}of this._sealed.splice(0))this._frozenStack.hasChanges()||this._queuedBarriers.length?this._queuedBarriers.push({stack:r,undoStop:o,sends:[],resolves:[]}):(this._frozenStack.takeFrom(r),this._frozenUndoStop=o);this._setSaveHeld(!1);const n=this._queuedBarriers[this._queuedBarriers.length-1];(n?.sends??this._barrierSends).push(e),(n?.resolves??this._barrierResolves).push(t)}_releaseBarrier(){const e=this._frozenStack.get();if(!e)return;const t=this._frozenStack.typedAt(),n=this._frozenStack.selection(),r=this._frozenStack.closesStep();this._frozenStack.clear(),this._entityId&&this._dispatch(this._entityId,e.flatMap(a=>Gb(a)),this._frozenUndoStop,t,n,r);const o=this._barrierSends,i=this._barrierResolves,s=this._queuedBarriers.shift();this._barrierSends=s?.sends??[],this._barrierResolves=s?.resolves??[],s&&(this._frozenStack.takeFrom(s.stack),this._frozenUndoStop=s.undoStop),this._runBarrier(o,i,!0)}_clearFrozen(){this._frozenStack.clear();for(const e of this._queuedBarriers.splice(0))this._barrierSends.push(...e.sends),this._barrierResolves.push(...e.resolves)}_finishBarrier(e){const t=this._barrierSends,n=this._barrierResolves;this._barrierSends=[],this._barrierResolves=[];for(const r of this._queuedBarriers)t.push(...r.sends.splice(0)),n.push(...r.resolves.splice(0));this._runBarrier(t,n,e)}_runBarrier(e,t,n){n&&e.forEach(r=>r()),t.forEach(r=>r(n)),this._onPendingSentEmitter.fire()}saveChangesAsync(e=!0){return new Promise(t=>{if(this.saveChanges(e),this._entityId||!this.hasChanges()||this._saveHeld){t();return}const n=setTimeout(()=>{r.dispose(),this._reportSaveTimeout(),t()},FR),r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})})}_reportSaveTimeout(){kr("save-timeout",()=>({}))}hasChanges(){return this._editStack.hasChanges()||this._frozenStack.hasChanges()||this._sealed.length>0}},UR=class extends fv{constructor(e,t){super(),k(this,"_baseDocument",void 0),k(this,"_mappedDocument",void 0),k(this,"_mappings",[]),k(this,"_cachedMappedDocument",new wl),this._baseDocument=e,this._mappedDocument=t,this._baseDocument.onChanged(this._onBaseChange.bind(this),Number.MAX_SAFE_INTEGER),this._mappedDocument.onChanged(this._onMappedChange.bind(this),Number.MAX_SAFE_INTEGER)}_onBaseChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=this._baseDocument.getText(),r=Uo(this.getMappings(n),this._baseDocument),o=Pn(this._mappings);if(t=At(o,t),t=At(t,r),this._mappings=r,t.length){const i=ro(t);this._mappedDocument.applyEdits(e,dl(i))}}}correctOffset(e,t){const n=t?this._mappings:Pn(this._mappings),r=fd(n,({oldPosition:i})=>i>=e),o=r>0?n[r-1]:void 0;return o&&(o.oldEnd>e?e+=o.newPosition-o.oldPosition:e+=o.newEnd-o.oldEnd),e}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}getMappedReplacementRangeAtPosition(e){const t=Pn(this._mappings).find(({oldPosition:n,oldEnd:r})=>e>=n&&e<r);return t?{start:t.oldPosition,end:t.oldEnd}:null}hasMappedReplacementRangeInRange(e){return Pn(this._mappings).some(({oldPosition:t,oldEnd:n})=>t<e.end&&n>e.start)}isMappedElementInPosition(e){return!!this._mappings.find(t=>t.newPosition<e&&t.newEnd>e)}escape(e,t){const n=this.getMappings(e,!1,t);return cs(e,n)}unescape(e){const t=this.getRevertMappings(e);return cs(e,t)}registerMatcherPair(e){const t=super.registerMatcherPair(e);this.rebuildFromBase();let n=!1;return{dispose:()=>{n||(n=!0,t.dispose(),this.rebuildFromBase())}}}rebuildFromBase(e=or){const t=this._baseDocument.getText(),n=this.getMappings(t),r=cs(t,n);this._mappings=Uo(n,this._baseDocument),this._mappedDocument.getText()!==r&&this._mappedDocument.applyEdits(e,[{range:{start:0,end:this._mappedDocument.getLength()},text:r}])}_onMappedChange({source:e,changes:t}){if(e!=="FROM_REMOTE"){const n=this._mappedDocument.getText(),r=Uo(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=At(o,t),t=At(t,r),this._mappings=Pn(r),t.length){const i=ro(t);this._baseDocument.applyEdits(e,dl(i))}}}},jR="input, textarea, select, .monaco-editor",VR=/^(Arrow(Left|Right|Up|Down)|Home|End|PageUp|PageDown|Tab)$/;function hv(e,t){return e?.node===t?.node&&e?.offset===t?.offset}function GR(e,t){return hv(e?.anchor,t?.anchor)&&hv(e?.focus,t?.focus)}function Al(){const e=document.getSelection();if(!(!e?.rangeCount||!e.anchorNode||!e.focusNode))return{anchor:{node:e.anchorNode,offset:e.anchorOffset},focus:{node:e.focusNode,offset:e.focusOffset}}}var XR=class extends Ee{constructor(e,t,n){super(),k(this,"_htmlDocument",void 0),k(this,"_mapping",void 0),k(this,"_remoteDocument",void 0),k(this,"_mark",void 0),k(this,"_pending",void 0),k(this,"_actionMark",void 0),k(this,"_moved",!1),this._htmlDocument=e,this._mapping=t,this._remoteDocument=n,this._listen(window,"keydown",!0),this._listen(window,"beforeinput",!0),this._listen(document,"selectionchange",!1,()=>{this._moved||(this._moved=!GR(this._mark,this._actionMark))}),this._listen(window,"pointerdown",!0,()=>{this._moved=!0}),this._listen(window,"keydown",!1,r=>{this._moved||(this._moved=!r.defaultPrevented&&VR.test(r.key??""))}),this.addDisposable(e.beforeTextCommit(()=>this._beforeCommit())),this.addDisposable(e.onTextCommit(()=>this._afterCommit())),this.addDisposable(n.onHistoryAnswer(r=>this._restore(r))),this.addDisposable(n.onHistoryAction(()=>{this._actionMark=Al(),this._moved=!1}))}_listen(e,t,n,r){const o=i=>{this._mark=Al(),r?.(i)};e.addEventListener(t,o,n),this.addDispose(()=>e.removeEventListener(t,o,n))}_beforeCommit(){this._pending={before:this._toText(this._mark),opened:!this._remoteDocument.hasEditsAfterBoundary()}}_afterCommit(){const e=this._pending;if(this._pending=void 0,this._mark=Al(),e){const t={before:e.before,after:this._toText(this._mark)};this._remoteDocument.noteSelection(t,e.opened)}}_toText(e){const t=e&&this._htmlDocument.pointToOffset(e.anchor),n=e&&this._htmlDocument.pointToOffset(e.focus);if(t===void 0||n===void 0)return;const[r,o]=[this._mapping.correctOffset(t),this._mapping.correctOffset(n)].sort((i,s)=>i-s);return{start:r,end:o}}_toPoint(e){return this._htmlDocument.offsetToPoint(this._mapping.correctOffset(this._remoteDocument.correctOffset(e,!0),!0))}_restore({selection:e,own:t}){if(t&&this._moved||!t&&!document.hasFocus()||document.activeElement?.closest(jR))return;const n=this._toPoint(e.start),r=e.end===e.start?n:this._toPoint(e.end);!n||!r||(document.getSelection()?.setBaseAndExtent(n.node,n.offset,r.node,r.offset),this._mark=Al())}};function KR(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function ys(e){let t=e.head;if(!t){t=e.createElement("head");const n=KR(e);n.insertBefore(t,n.firstChild)}return t}function YR(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function ZR(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function QR(e){const t=ys(e);if(!e.querySelector("style[amp4email-boilerplate]")){const n=e.createElement("style");n.setAttribute("amp4email-boilerplate",""),n.innerHTML="body{visibility:hidden}",t.prepend(n)}}var pv="amp-custom";function JR(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function gv(e,t,n){for(const r of t)if(ms.isStyleRule(r)){const o=r.selectorText.split(/\+>~/).flatMap(i=>i.trim().split(" "));if(o.length===1&&o[0].trim().startsWith(".em-")){for(const i of r.style)if(r.style.getPropertyPriority(i)==="important"){for(const s of e.querySelectorAll(r.selectorText))if(Gd(s)){const a=s.style;for(const l of[...a])if(l.startsWith(i)){const c=n(l,a.getPropertyValue(l)),u=s.getAttribute("class");s.setAttribute("class",u?`${c} ${u}`:c),a.removeProperty(l)}}}}}else ms.isMediaRule(r)&&gv(e,r.cssRules,n)}function bv(e,t){const n=t.sheet;if(n){const i=new Set;gv(e,n.cssRules,(s,a)=>{const l=JR(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>ms.isStyleRule(d)&&d.selectorText===`.${l}`)&&!i.has(u)&&(i.add(u),t.innerHTML=`
|
|
4
|
+
.${l} { ${s}: ${a} };
|
|
5
|
+
${t.innerHTML}`),l}),i.size&&(t.innerHTML=`
|
|
6
|
+
${[...i].join(`
|
|
7
|
+
`)};
|
|
8
|
+
${t.innerHTML}`)}const r=t.innerHTML,o=r.replace(/!important/g,"");r!==o&&(t.innerHTML=o)}function eM(e){const t=ys(e),n=e.querySelectorAll('link[rel="stylesheet"]'),r=[...e.querySelectorAll("style")].filter(i=>!i.hasAttribute("amp4email-boilerplate"));if(r.length===1){const i=r[0];if(i.parentElement===t&&i.getAttribute(pv)===""){bv(e,i);return}}const o=[];for(const i of r)o.push(i.innerHTML),i.remove();if(o.length){const i=e.createElement("style");i.innerHTML=`
|
|
9
|
+
${o.join("")}
|
|
10
|
+
`,i.setAttribute(pv,""),t.append(i),bv(e,i)}for(const i of n)i.remove()}var uf="<!doctype html>";function tM(e){const t=e.doctype;if(t){if(fy(t)===uf)return;const n=new DOMParser().parseFromString(uf,"text/html").doctype;e.replaceChild(n,t)}else{const n=new DOMParser().parseFromString(uf,"text/html").doctype;e.insertBefore(n,e.firstChild)}}async function yv(e,t={}){const n=document.createElement("amp-img"),r=await Ex(e)||void 0,o=[];try{let i=e;for(;i&&Gd(i);)getComputedStyle(i)?.display==="none"&&(i.style.display="initial",o.push([i,i.style.display])),i=i.parentElement;const s=r?.height?`${parseInt(r.height)}`:"",a=r?.width?`${parseInt(r.width)}`:"",l=ZR(e);let c=!1;if(l){const d=l.getAttribute("width");try{let f=a?`${a}px`:"";d||(l.setAttribute("width","720px"),f=getComputedStyle(e).width||""),l.setAttribute("width",!d||parseInt(d)>320?"320px":"720px"),f!==(getComputedStyle(e).width||"")&&(c=!0)}finally{d&&l.setAttribute("width",d||"")}}const u=e.src||e.srcset.split(",")[0];e.style.width==="100%"&&e.style.removeProperty("width"),e.style.maxWidth==="100%"&&e.style.removeProperty("max-width"),t={...YR(e),alt:e.alt,width:a,height:s,src:u,layout:c?"responsive":"fixed",...t};for(const d of Object.keys(t))er(n,d,t[d])}finally{for(const[i,s]of o)i.style.display=s}return n}async function nM(e,t){const n=[...e.querySelectorAll("img")],r=[];for(const i of n)r.push(yv(i).then(s=>[i,s],()=>[i,void 0]));const o=[...e.querySelectorAll("picture")];for(const i of o){const s=i.querySelector("img");s?r.push(yv(s).then(a=>[i,a],()=>[i,void 0])):r.push([i,void 0])}if(r.length){const i=await Promise.all(r);for(const[s,a]of i)a?s.replaceWith(a):s.remove();t?.()}}function rM(e){const t=e.querySelectorAll("meta");for(const o of t){const i=o.getAttribute("charset");if(i){i!=="utf-8"&&o.setAttribute("charset","utf-8");return}}const n=ys(e),r=e.createElement("meta");r.setAttribute("charset","utf-8"),n.insertBefore(r,n.firstChild)}function oM(e,t,n){const r=n('script:not([type="application/ld+json"])'),o=e.querySelectorAll(r);for(const i of o)!i.getAttribute("src")?.startsWith("https://cdn.ampproject.org/")&&!(i.closest("amp-state")&&i.getAttribute("type")==="application/json")&&i.remove()}var vv="https://cdn.ampproject.org/v0",Ev=`${vv}.js`,iM=`script[src='${Ev}']`;function sM(e,t){return`${vv}/${e.toLowerCase()}-${t}.js`}async function aM(e,t,n){for(const{name:r,versions:o}of t){const i=n.replaceSelectors(r==="amp-mustache"?`script[async][custom-template='${r}']`:`script[async][custom-element='${r}']`);if(!e.querySelector(i)){const s=ys(e),a=n.createElementFn("script"),l=sM(r,o.findLast(c=>c!=="latest")||"v0");a.setAttribute("async",""),a.setAttribute(r==="amp-mustache"?"custom-template":"custom-element",r),a.setAttribute("src",l),s.appendChild(a),s.appendChild(e.createTextNode(`
|
|
11
|
+
`))}}}var une=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),dne=function(e,t){return new URL(e,t).href},fne={},df=function(t,n,r){let o=Promise.resolve();if(0)var s,a;function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})},Sv=void 0;async function kl(){return Sv||(Sv=await df(()=>Promise.resolve().then(()=>id("./rules.CnnzdMsj.js")).then(e=>e.default),void 0,{}.url))}var ff=new Map;async function lM(){if(!ff.size){const e=await kl(),t=e.tags;for(let n=0;n<t.length;n++){const r=t[n],{selector:o,attrs:i,attrLists:s}=r,a=s?.flatMap(l=>e.attrLists.filter(({name:c})=>c===l).flatMap(c=>c.attrs))||[];ff.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return ff}var mf=new Map;async function cM(){if(!mf.size){const e=await kl();for(const t of e.declarations)mf.set(t.name,t)}return mf}var uM="$GLOBAL_ATTRS",hf=new Map;async function dM(){if(!hf.size){const e=(await kl()).attrLists.find(t=>t.name===uM)?.attrs;if(e)for(const t of e)hf.set(t.name,t)}return hf}function fM(e){return In(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function wv(e){return bx(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function _v(e,t,n){if(!t)return;function r(){const i=t.compareDocumentPosition(e);if(!(i&8)){if(i&2)return t.insertBefore(e,t.firstChild),!0;if(i&4)return t.appendChild(e),!0}return!1}function o(){const i=[...e.childNodes];for(let s=i.length-1;s>=0;s--)_v(i[s],t,n)}if(In(e))switch(e.tagName.toLowerCase()){case"body":return;case n("script"):case"style":case"meta":case"title":return;case"head":case"html":o();break;default:r()||o()}else Xd(e)?o():oo(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&oo(e.nextSibling))&&r()}async function mM(e,t){const n=new Set,r=t.commit,o=h=>t.replaceSelectors(h.toLowerCase());if(t.replaceImages&&await nM(e,r),t.injectExtensions){const h=t.replaceSelectors(iM);if(!e.querySelector(h)){const m=t.createElementFn("script");m.setAttribute("src",Ev),m.setAttribute("async",""),ys(e).appendChild(m),r?.()}}t.injectRequiredTags&&(oM(e,t.createElementFn,o),tM(e),QR(e),rM(e),r?.()),t.replaceStylesAndLinks&&(eM(e),r?.());const i=await kl(),s=await lM(),a=new Set(t.removeUnsupportedTags?e.querySelectorAll("*"):[]),l=new Map;for(let[h,m]of s)if(!m.deprecation){h=o(h);let p=[...e.querySelectorAll(h)].filter(v=>!l.has(v));m.unique&&p.length&&(p=[p[0]]),t.injectRequiredTags&&m.required&&!p.length&&(p=[...p,t.createElementFn(m.name)]);for(const v of p){if(t.injectRequiredAttributes&&v.getAttribute("on")&&!v.getAttribute("tabindex")&&v.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let _=!1;for(const A of[...v.classList])A.startsWith("i-amphtml")&&(_=!0,v.classList.remove(A));_&&!v.classList.length&&v.removeAttribute("class")}const w=l.get(v);w&&w.priority>m.priority||l.set(v,m)}}r?.();for(const[h,m]of l){if(t.injectExtensions&&m.requiresExtension)for(const w of m.requiresExtension)n.add(w);const p=m.requiredParent?m.requiredParent==="$ROOT"?e:e.querySelector(m.requiredParent):null;p&&(!h.parentNode||t.moveInvalidTagPosition)?p!==h.parentNode&&(m.name==="HEAD"||In(p)&&p.tagName==="HEAD"?p.insertBefore(h,p.firstChild):p.appendChild(h)):h.parentNode||e.body.appendChild(h),t.removeUnsupportedTags&&a.delete(h),r?.();const v=await dM();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const w=m.attrs,_=t.injectRequiredAttributes?new Set([...w].map(([b,g])=>g).filter(b=>b.required&&b.value)):void 0,A=h.getAttributeNames();for(const b of A){const g=w.get(b)||v.get(b);if(g){if(b==="id"||b==="class"||b==="style"){_?.delete(g);continue}if(t.removeUnsupportedAttributes){const E=h.getAttribute(b);if(g.value&&g.value.indexOf(E)<0){h.removeAttribute(b);continue}if(g.valueRegex&&!new RegExp(g.valueRegex).test(E)){h.removeAttribute(b);continue}if(g.disallowedValueRegex&&new RegExp(g.disallowedValueRegex).test(E)){h.removeAttribute(b);continue}const T=g.valueUrl;if(T){if(E===""){if(!T.allowEmpty){h.removeAttribute(b);continue}}else if(!(E.indexOf("<!--")>0&&E.indexOf("-->")>0)){if(!T.allowRelative)if(E.startsWith("#")||E.startsWith("/")){h.removeAttribute(b);continue}else{const y=T.protocol.length?T.protocol:["https"],S=E.substring(0,E.indexOf(":"));if(S){if(y.indexOf(S)<0){const C=y[0]+E.substring(E.indexOf(":"));if(URL.canParse(C))er(h,b,C);else{h.removeAttribute(b);continue}}else if(!URL.canParse(E)){h.removeAttribute(b);continue}}else{const C=y[0]+E;if(URL.canParse(C))er(h,b,C);else{h.removeAttribute(b);continue}}}}}}_?.delete(g)}else{if(b==="id"||b==="class"||b==="style")continue;t.removeUnsupportedAttributes&&h.removeAttribute(b)}}if(_)for(const b of _)er(h,b.name,b.value[0])}r?.()}t.moveInvalidTagPosition&&(_v(e,e.body,o),r?.());for(const h of a)h.remove();if(r?.(),t.removeUnsupportedStyles){let p=function(b){const g=b.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const E of g){if(!E)continue;const T=b.getPropertyValue(E);b.getPropertyPriority(E)==="important"&&b.setProperty(E,T);const y=m.get(E);y?y.value?y.value.indexOf(T)<0&&b.removeProperty(E):y.valueRegex&&(new RegExp(y.valueRegex).test(T)||b.removeProperty(E)):b.removeProperty(E)}r?.()},v=function(b){return b.constructor.name==="CSSStyleRule"},w=function(b){return b.constructor.name==="CSSMediaRule"},_=function(b){const g=b.cssRules;for(let E=g.length-1;E>=0;E--){const T=g[E];v(T)?T.selectorText.indexOf("[")>=0||T.selectorText.indexOf(":")>=0?b.deleteRule(E):(p(T.style),T.style.cssText||b.deleteRule(E)):w(T)?(_(T),T.cssRules.length||b.deleteRule(E)):b.deleteRule(E)}};var c=p,u=v,d=w,f=_;const h=e.querySelectorAll("*"),m=await cM();for(const b of h)if(Gd(b)){const g=b.getAttribute("style");g&&(p(b.style),b.style.length?b.style.cssText!==g&&b.setAttribute("style",b.style.cssText):b.removeAttribute("style"))}const A=e.querySelector("style[amp-custom]");if(A){const b=A.sheet;b&&(_(b),A.innerHTML=[...b.cssRules].map(g=>g.cssText).join(`
|
|
12
|
+
`)),r?.()}}await aM(e,i.extensions.filter(({name:h})=>n.has(h)),t)}function hM(e,t){return Object.keys(t).reduce((n,r)=>n.replaceAll(r,t[r]),e)}function Cv(e,t={}){const{correct:n=!0,injectExtensions:r=!0,mappedTags:o={}}=t;return mM(e,{replaceImages:n,replaceStylesAndLinks:n,injectRequiredTags:n,injectExtensions:r,formsAsAmpForms:r,injectRequiredAttributes:n,moveInvalidTagPosition:n,removeUnsupportedTags:n,removeUnsupportedAttributes:n,removeUnsupportedStyles:n,createElementFn:i=>e.createElement(o[i.toLowerCase()]||i),replaceSelectors:i=>hM(i.toLowerCase(),o),commit:t.commit})}function pf(){z.send(ue.RELOAD),window.location.reload()}function pM(e){const t=new Ee;let n=[];function r(){n=[...new Set([...n,...document.querySelectorAll("script")])].filter(s=>aN(s)&&e.isInLetter(s));const i=new Set;for(const s of n){const a=(s.src||s.innerHTML).trim();a&&i.add(a)}return i}let o=r();return t.addDisposable(z.addListener(ue.RELOAD,pf)),t.addDisposable(e.onChange(()=>{let i=r();for(const s of o)i.has(s)||pf();o=i})),t}var Ll=[];function gM(e){return Ll.push(e),{dispose:()=>{const t=Ll.indexOf(e);t!==-1&&Ll.splice(t,1)}}}function gf(e){for(const t of Ll){const n=t(e);if(n)return n}return e}function bM(){const e=document.querySelector("[em-edit]");return e?gf(e):null}var Nl=new Set(["img","image","input","video","source","em-replace"]);function Tv(e){const t=e.toLowerCase(),n=Nl.has(t);return Nl.add(t),{dispose:()=>{n||Nl.delete(t)}}}function yM(e){return Nl.has(e.toLowerCase())}var vs=[];function vM(e){return vs.push(e),{dispose:()=>{const t=vs.indexOf(e);t!==-1&&vs.splice(t,1)}}}function Av(e){return vs.some(t=>t.isPathElement?.(e))}function EM(e,t){let n;for(const r of vs){const o=r.caption?.(e,t);o&&(n={...n,...o})}return n}function kv(e){return e.tagName==="TD"&&e===e.closest("amp-accordion")?.querySelector(":scope > section header td")}var SM={isPathElement(e){return e.tagName==="AMP-ACCORDION"||e.tagName==="AMP-CAROUSEL"||kv(e)},caption(e,t){if(e.tagName==="AMP-ACCORDION")return{title:t.ELEMENT_PATH_ACCORDION,className:"em-element-path-item-amp"};if(e.tagName==="AMP-CAROUSEL")return{title:t.ELEMENT_PATH_CAROUSEL,className:"em-element-path-item-amp"};if(kv(e))return{title:t.ELEMENT_PATH_SECTION,className:"em-element-path-item-block"};if(e.tagName==="IMG"&&e.closest("amp-carousel"))return{title:t.ELEMENT_PATH_CAROUSEL}}},wM=class extends Ee{constructor(...e){super(...e),k(this,"hasAmp",!1)}};function _M(e,t,n=""){for(const r of e.classList)if(r.startsWith(`${t}-`))return r.replaceAll(`${t}-`,"");return n}function CM(e,t,n){const r=_M(e,t);r!==n&&(e.classList.remove(`${t}-${r}`),n&&e.classList.add(`${t}-${n}`))}function TM(){const e=new Ee;return e.addDisposable(D2(t=>t.startsWith("amp"))),e.addDisposable(B2(t=>t==="class"||t==="style")),e}function AM(e){const t=o=>wv(o)&&e.getOuterHtml(o)!==""||fM(o)||gx(o),n=o=>{if(t(o))return!0;if(In(o)||Xd(o)){for(const i of o.querySelectorAll("*"))if(t(i))return!0}return!1},r=new wM;return r.addDisposable(gM(o=>o.closest("amp-img"))),r.addDisposable(vM(SM)),r.addDisposable(TM()),r.addDisposable(Tv("amp-img")),r.addDisposable(Tv("amp-anim")),r.addDisposable(e.onChange(o=>{let i=r.hasAmp,s=!1;for(const a of o){if(a.added.some(l=>n(l))){s=!0,i=!0;break}if(a.removed.some(l=>n(l))){i=n(document);break}}r.hasAmp!==i?(r.hasAmp=i,z.send(ue.APPLICATION_HAS_AMP,i),setTimeout(()=>{if(i)Cv(document,{correct:!1});else{const a=[...document.querySelectorAll("script")];for(const l of a)wv(l)&&l.remove();pf()}})):s&&setTimeout(()=>{Cv(document,{correct:!1})})})),r.addDisposable(z.addListener(o=>{if(o.data?.operation==="sandbox_element_settings_set"){const i=document.querySelector("[em-edit]");if(i){const s=o.data?.settings?.ampShow;s!==void 0&&(CM(i,"em-amp-show",s==="amp"?"only":s==="html"?"disabled":void 0),e.commit())}}})),r}function kM(e,t){const n=AM(t);return e.inject(kd,n),{service:n,dispose(){n.dispose(),bn(e,kd)}}}var LM={name:"sandbox.amp",provides:[kd],awaits:{services:[X]},setup(e){const{service:t}=kM(e,O(e,X));e.addService(Nb,()=>({ampService:t}))}};(function(){"use strict";function e(t,n){var r,o=0,i=t.length,s,a="",l,c,u,d,f,h,m,p,v=!0,w=!1,_;r=arguments.length>1?n:{},typeof r.indent>"u"&&(r.indent=" "),typeof r.openbrace=="string"&&(v=r.openbrace==="end-of-line"),typeof r.autosemicolon=="boolean"&&(w=r.autosemicolon);function A(S){return S===" "||S===`
|
|
13
|
+
`||S===" "||S==="\r"||S==="\f"}function b(S){return S==="'"||S==='"'}function g(S){return l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||"-_*.:#[]".indexOf(S)>=0}function E(){for(var S=h;S>0;S-=1)a+=r.indent}function T(){a=_(a),v?a+=" {":(a+=`
|
|
14
|
+
`,E(),a+="{"),c!==`
|
|
15
|
+
`&&(a+=`
|
|
16
|
+
`),h+=1}function y(){var S;h-=1,a=_(a),a.length>0&&w&&(S=a.charAt(a.length-1),S!==";"&&S!=="{"&&(a+=";")),a+=`
|
|
17
|
+
`,E(),a+="}",s.push(a),a=""}for(String.prototype.trimRight?_=function(S){return S.trimRight()}:_=function(S){return S.replace(/\s+$/,"")},f={Start:0,AtRule:1,Block:2,Selector:3,Ruleset:4,Property:5,Separator:6,Expression:7,URL:8},h=0,d=f.Start,p=!1,s=[],t=t.replace(/\r\n/g,`
|
|
18
|
+
`);o<i;){if(l=t.charAt(o),c=t.charAt(o+1),o+=1,b(m)){a+=l,l===m&&(m=null),l==="\\"&&c===m&&(a+=c,o+=1);continue}if(b(l)){a+=l,m=l;continue}if(p){a+=l,l==="*"&&c==="/"&&(p=!1,a+=c,o+=1);continue}if(l==="/"&&c==="*"){p=!0,a+=l,a+=c,o+=1;continue}if(d===f.Start){if(s.length===0&&A(l)&&a.length===0)continue;if(l<=" "||l.charCodeAt(0)>=128){d=f.Start,a+=l;continue}if(g(l)||l==="@"){if(u=_(a),u.length===0)s.length>0&&(a=`
|
|
19
|
+
|
|
20
|
+
`);else if(u.charAt(u.length-1)==="}"||u.charAt(u.length-1)===";")a=u+`
|
|
21
|
+
|
|
22
|
+
`;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);a+=l,d=l==="@"?f.AtRule:f.Selector;continue}}if(d===f.AtRule){if(l===";"){a+=l,d=f.Start;continue}if(l==="{"){u=_(a),T(),d=u==="@font-face"?f.Ruleset:f.Block;continue}a+=l;continue}if(d===f.Block){if(g(l)){if(u=_(a),u.length===0)s.length>0&&(a=`
|
|
23
|
+
|
|
24
|
+
`);else if(u.charAt(u.length-1)==="}")a=u+`
|
|
25
|
+
|
|
26
|
+
`;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);E(),a+=l,d=f.Selector;continue}if(l==="}"){y(),d=f.Start;continue}a+=l;continue}if(d===f.Selector){if(l==="{"){T(),d=f.Ruleset;continue}if(l==="}"){y(),d=f.Start;continue}a+=l;continue}if(d===f.Ruleset){if(l==="}"){y(),d=f.Start,h>0&&(d=f.Block);continue}if(l===`
|
|
27
|
+
`){a=_(a),a+=`
|
|
28
|
+
`;continue}if(!A(l)){a=_(a),a+=`
|
|
29
|
+
`,E(),a+=l,d=f.Property;continue}a+=l;continue}if(d===f.Property){if(l===":"){a=_(a),a+=": ",d=f.Expression,A(c)&&(d=f.Separator);continue}if(l==="}"){y(),d=f.Start,h>0&&(d=f.Block);continue}a+=l;continue}if(d===f.Separator){if(!A(l)){a+=l,d=f.Expression;continue}b(c)&&(d=f.Expression);continue}if(d===f.Expression){if(l==="}"){y(),d=f.Start,h>0&&(d=f.Block);continue}if(l===";"){a=_(a),a+=`;
|
|
30
|
+
`,d=f.Ruleset;continue}if(a+=l,l==="("&&a.charAt(a.length-2)==="l"&&a.charAt(a.length-3)==="r"&&a.charAt(a.length-4)==="u"){d=f.URL;continue}continue}if(d===f.URL&&l===")"&&a.charAt(a.length-1!=="\\")){a+=l,d=f.Expression;continue}a+=l}return a=s.join("")+a,a}window.cssbeautify=e})();function NM(e,t,n){n.state.update({iframeOffsetTop:e.iframeOffsetTop,scrollTop:e.scrollTop,previewHeight:e.previewHeight,applicationMode:e.mode}),typeof t<"u"&&n.state.set("codeMode",e.mode==="code");const r=document.querySelector(".em-element-path");r&&(r.style.top=n.previewHeight-n.iframeOffsetTop-65+n.scrollTop+"px");const o=document.querySelector(".em-editor-wrapper");o&&o.style.display==="none"?n.setBlockGroupControlsPosition():setTimeout(()=>{n.setBlockGroupControlsPosition()},400)}var xM=["transform","transform-origin","overflow-x","height"];function OM(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function Es(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of xM)e.style.removeProperty(r);return n?(e.style.overflowX="visible",e.style.transformOrigin="left top",e.style.transform=n):e.getAttribute("style")||e.removeAttribute("style"),!0}function RM(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(Es(t,1),t.scrollWidth)}function MM(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=OM(RM(e,n),t.innerWidth);return Es(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function PM(e,t){Es(document.documentElement,1);const n=t.globalHolder?.querySelector("table:first-child");if(n&&n.offsetWidth>=e.iframeWidth-2&&t.globalHolder){const r=e.iframeWidth/t.globalHolder.offsetWidth;Es(document.documentElement,r),document.querySelector(".em-narrow-table")&&e.iframeWidth>370&&t.messageService.send({operation:"application_preview_alert_show",settings:{show:r<.9}})}setTimeout(()=>{t.messageService.send({operation:"application_iframe_set_height",settings:{height:document.body.getBoundingClientRect().height}})},300)}function dt(e){const t=O(e,Te);return n=>{t.commit(n)}}function at(){return O(Mt,X)}function IM(){return O(Mt,ot)}function DM(){return O(Mt,pn)}function ft(){return Mt.getInstance(X)!==void 0}function ao(e){O(Mt,Te).commit(e)}function BM(e){if(!ft())return e(),Promise.resolve(!0);const t=at();return t.commit(!1),t.flushCommit(),t.sendAfterCurrentEdits(e)}function HM(){if(!ft())return!1;const e=at();return e.commit(!1),e.flushCommit(),e.hasEditsAfterBoundary()}function FM(){return ft()?at().markHistoryAction():void 0}function $M(e){ft()&&at().noteHistoryActionSent(e)}function bf(e){return ft()&&at().holdInput(e)}function Lv(e){return ft()&&at().holdInputBehindQueued(e)}function Nv(){ft()&&at().closeUndoStep()}function yf(){return ft()&&at().isHoldingInput()}function xv(){return ft()&&at().hasHeldInput()}function Ov(){ft()&&at().releaseHeldInput()}function Rv(){return ft()&&at().holdsTypedEdits()}function Ss(e){return ft()?at().renderOnly(e):e()}function xl(e){return e.nodeType===1&&e.localName==="template"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}function vf(e){return[...e.querySelectorAll?.("template")??[]].filter(xl)}function WM(e){return xl(e)||vf(e).length>0}function rn(e){const t=[...xl(e)?[e]:[],...vf(e)];for(const n of t)if(n.content.firstChild){for(;n.content.firstChild;)n.appendChild(n.content.firstChild);for(const r of n.children)rn(r)}}function Zo(e){const t=[...xl(e)?[e]:[],...vf(e)];for(const n of t)for(;n.firstChild;)n.content.appendChild(n.firstChild)}function Gt(){return ft()?at():void 0}function It(e){const t=Gt();return t?t.applyHidden(e):e()}function Be(e,t,...n){e&&It(()=>t?e.classList.add(...n):e.classList.remove(...n))}function lo(e){const t=document.activeElement;t instanceof HTMLElement&&t!==document.body&&e.contains(t)&&It(()=>t.blur())}function Ef(e){Gt()?.ownership.markService(e)}function Mv(e){Gt()?.ownership.markWrapper(e)}function Pv(e){Gt()?.ownership.markOuterWrapper(e)}function ws(e,t){e.removeAllRanges(),It(()=>e.addRange(t))}function Ol(e){const t=document.implementation.createHTMLDocument("").importNode(e,!0);nn(e,t);const n=new Map([[e,t]]),r=Gt()?.ownership,o=(i,s)=>{const a=[...s.childNodes];i.childNodes.forEach((l,c)=>{const u=a[c];n.set(l,u),o(l,u),r?.isOffModel(l)&&u.replaceWith(...u.childNodes)})};return o(e,t),Zo(t),{copy:t,counterpart:i=>n.get(i)}}function Rl(e){return Qg(Ol(e).copy)}function Ue(e){return qL(Ol(e).copy)}function _s(e){const t=Gt();return t?(t.flushCommit(),t.getOuterHtml(e)):e.outerHTML}function Sf(e){return Iv(e)}function Iv(e){const t=Gt();return!t||t.isInLetter(e)||!t.isUntracked(e)&&!t.ownership.isService(e)}function wf(e){const t=Gt();return t?t.ownership.markOf(e)?"foreign":t.isInLetter(e)?"letter":t.isBehindHidden(e)?"foreign":"new":"letter"}function _f(e,t){const n=[...e.querySelectorAll(t)].filter(Sf);return n[n.length-1]??null}function Dv(e,t){const n=o=>t==="next"?o.nextElementSibling:o.previousElementSibling;let r=n(e);for(;r&&!Sf(r);)r=n(r);return r}function Bv(e,t){return[...e.childNodes].flatMap(n=>t.isInLetter(n)?[n]:Bv(n,t))}function Cf(e){lo(e);const t=Gt();if(!t)return;t.flushCommit();const n=[...e.querySelectorAll("*")].filter(r=>t.ownership.markOf(r)==="service");for(const r of n)e.contains(r)&&r.replaceWith(...Bv(r,t))}function qM(e){const t=[...e.childNodes],n=Gt();if(!n)return t;let r;for(const o of n.letterChildren(e))o.isConnected||t.splice(r?t.indexOf(r)+1:0,0,o),r=o;return t}function zM(){const e=Gt();return e?{...e.scriptRunner,awake:()=>e.recordNow()}:{run:(t,n)=>n(),quiet:t=>t()}}function sr(e,t){const n=Le(e,"dormant"),r=lb(n);try{return t(n)}finally{pb(r,zM())}}function Hv(e,t,n){sr(n,r=>tl(e,t,r))}function Cs(e,t,n){return e==="new"?sr(t,n):n(Le(t,!0))}function ar(e,t,n,r){Cs(e,r,o=>tl(t,n,o))}function pt(e){return function(...t){const n=Gt(),r=()=>Reflect.apply(e,this,t);return n?n.applyOwn(r):r()}}function lr(e,t=!1,n){const r=()=>document.execCommand(e,t,n),o=Gt();return o?o.applyCommand(r):r()}function Fv(e){const t=()=>{Be(document.body,e,"mceNonEditable"),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};ft()?at().applyHidden(t):t()}function UM(){let e=!1,t=!0,n=!0;const r=new Set,o=i=>{t!==i&&(t=i,[...r].forEach(s=>{try{s()}catch{}}))};return{setApp(i){e=i},setIntegrator:o,isAppLocked:()=>e,isIntegratorLocked:()=>t,isTextLocked:()=>e||t,closeEditorInit(){n=!0},openEditorInit(){n=!1},isEditorInitClosed:()=>n,onIntegratorChange(i){const s=()=>i();return r.add(s),()=>r.delete(s)},reset(){e=!1,o(!0),n=!0}}}var Tf=UM();function jM(e){return{dispose:e.onIntegratorChange(()=>Fv(e.isTextLocked()))}}function VM(e,t){return e.beforeChange(({domMutations:n})=>{const r=n.flatMap(o=>o.type==="Add"&&o.node instanceof Element?[o.node]:[]);r.length&&queueMicrotask(()=>{if(!t.isTextLocked())return;const o=r.flatMap(i=>[...i.tagName==="EDITOR"?[i]:[],...Array.from(i.querySelectorAll("editor"))]);e.applyHidden(()=>{for(const i of o)i.isConnected&&i.setAttribute("contenteditable","false")})})})}function Af(e,t){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){const i=e,s=t;return i.length===s.length&&i.every((a,l)=>Af(a,s[l]))}const r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.prototype.hasOwnProperty.call(t,i)&&Af(e[i],t[i]))}function $v(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&Af(o,a)||(o=a,i=!0,r(a))})},select(r){return $v(n,r)}};return n}function Wv(...e){let t=e[0],n=e.length>0;const r=new Set,o={get(){return n?t:void 0},set(i){t=i,n=!0;for(const s of Array.from(r))s(i)},watch(i){return r.add(i),n&&i(t),{dispose:()=>r.delete(i)}},select(i){return $v(o,i)}};return o}var Ml={applicationTheme:"light",applicationMode:"default",previewHeight:0,emailWidth:0,previewPage:!1,globalHolder:null,elementPath:[],iframeOffsetTop:0,scrollTop:0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,elementAIimageEnabled:!0,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,blocksAddPanelEnabled:!0,codeMode:!0,appName:"",isLeftButtonDown:!1,isProgrammaticSelection:!1,activeCell:[],commonStyles:{},loadStylesTimer:!1,_pushUndoStop:!1},Ts=Wv({...Ml});function Dn(){return Ts.get()}var Pl=new ge,Qo=new Map,j={source:Ts,get(e){return Dn()[e]},getState(){return{...Dn()}},getStateRef(){return Dn()},set(e,t){if(Dn()[e]===t)return;Ts.set({...Dn(),[e]:t}),Pl.fire({[e]:t});const n=Qo.get(e);n&&n.forEach(r=>r(t))},update(e){let t=!1;const n={};for(const r of Object.keys(e)){const o=e[r];if(Dn()[r]!==o){Ts.set({...Dn(),[r]:o}),n[r]=o,t=!0;const i=Qo.get(r);i&&i.forEach(s=>s(o))}}t&&Pl.fire(n)},increment(e,t=1){const n=Dn()[e];typeof n=="number"&&j.set(e,n+t)},decrement(e,t=1){const n=Dn()[e];typeof n=="number"&&j.set(e,n-t)},subscribe(e){return Pl.event(e)},subscribeToKey(e,t){Qo.has(e)||Qo.set(e,new Set);const n=Qo.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&Qo.delete(e)}},reset(){Ts.set({...Ml}),Pl.fire(Dn())},resetKey(e){this.set(e,Ml[e])},getInitialState(){return Ml}};function GM(e,t){const n=Wv(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var XM=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled"];function KM(e){const t="091c986b";let n=document.getElementsByTagName("head")[0];!n&&document.documentElement&&(n=document.createElement("head"),document.documentElement.insertBefore(n,document.documentElement.firstChild));const r=`css/sandbox-${e}.css?${t}`,o=e==="light"?"dark":"light",i=document.querySelectorAll(`[href="css/sandbox-${o}.css?${t}"]`);if(!document.querySelector(`[href="${r}"]`)){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("em","css"),s.setAttribute("href",r),n?.appendChild(s)}for(const s of i)s.remove()}var YM={name:"sandbox.hostFacts",provides:[Wo],setup(e){const t=Object.fromEntries(Object.entries(t2).map(([n,r])=>[n,GM(z,r).source]));e.inject(Wo,t)}},ZM={name:"sandbox.hostFactsToState",awaits:{services:[Wo,Te,X,Ye]},setup(e){const t=O(e,Wo),n=dt(e),r=O(e,Ye);t.theme.watch(o=>{j.set("applicationTheme",o),KM(o),n(!1)}),t.commonStyles.watch(o=>{o&&j.set("commonStyles",o)}),t.flags.watch(o=>{for(const i of XM)typeof o[i]<"u"&&j.set(i,o[i])}),jM(r),VM(O(e,X),r),t.lockEditor.watch(o=>r.setIntegrator(o)),t.codeMode.watch(o=>j.set("codeMode",o)),t.appName.watch(o=>j.set("appName",o)),t.previewPage.watch(o=>{j.set("previewPage",o),Be(document.body,!!o,"em-sandbox-preview")})}},QM={name:"sandbox.viewport",awaits:{services:[Wo]},setup(e){O(e,Wo).viewport.watch(t=>NM(t,void 0,{state:j,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:j.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(xb).forEach(n=>n()),messageService:z}))}};function Lr(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function Lt(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function JM(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),Be(document.body,!0,"em-sandbox-discuss");else{const n=t.editLock.isTextLocked()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),Be(document.body,!1,"em-sandbox-discuss","em-sandbox-discuss_set-target")}}function eP(e,t){Be(document.body,!!e.data.value,"em-sandbox-discuss_set-target")}function tP(e,t){const n=e.data.value,r=document.querySelector(`[em-discuss-id="${n}"]`);r&&t.messageService.send({operation:"application_scroll-to",settings:{value:r.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),Be(document.body,!1,"em-sandbox-discuss_set-target"),document.querySelectorAll(".em-discuss-id-new").forEach(o=>{o.removeAttribute("em-discuss-id")}),t.removeAllAttributes("em-edit"),r&&document.querySelectorAll(`[em-discuss-id="${n}"]`).forEach(o=>{o.removeAttribute("em-discuss-id")}),t.commit()}function nP(e,t){Be(document.body,!1,"em-sandbox-discuss_set-target"),document.querySelectorAll(".em-discuss-id-new").forEach(n=>{n.classList.remove("em-discuss-id-new")}),t.removeAllAttributes("em-edit"),t.commit(),setTimeout(()=>{t.messageService.send({operation:"application_discuss_save_target"})},500)}function rP(e,t){const n=e.data.value,r=document.querySelector(`[em-discuss-id="${n}"]`);r?(t.messageService.send({operation:"application_scroll-to",settings:{value:r.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),r.classList.add("em-discuss-target-active"),setTimeout(()=>{r.classList.remove("em-discuss-target-active")},2e3)):t.messageService.send({operation:"application_discuss_no_comment"})}var oP={sandbox_lock_discuss:JM,sandbox_discuss_set_target:eP,sandbox_discuss_remove_target:tP,sandbox_discuss_reset:nP,sandbox_discuss_get_target:rP};function iP(e,t){t.editLock.setApp(!!e.data.data),Fv(t.editLock.isTextLocked())}function sP(e,t){t.setEditorFocus(e.data.data)}function aP(e,t){let n=e.data.data;if(typeof n!="number")return;n=IM().correctOffset(n,!0),n=DM().correctOffset(n,!0);let r=at().getElementByPosition(n);if(r&&!(r instanceof Element)&&(r=r.parentElement),!(r instanceof HTMLElement))return;const o=r.getBoundingClientRect();r.tagName!=="BODY"&&o.height&&o.width&&document.querySelector("[em-edit]")!==r&&t.applicationElementSettingsSet({elem:r});const i=r.getBoundingClientRect(),s=i.top-j.get("previewHeight")/2+i.height/2;t.messageService.send({operation:"application_scroll-to",settings:{value:j.get("applicationMode")==="default"?s+j.get("iframeOffsetTop"):s}})}var lP={sandbox_lock_edit:iP,editor_change_focus:sP,update_position_from_editor:aP};function cP(e,t){document.querySelectorAll("[em-optimise-error]").forEach(n=>{n.removeAttribute("em-optimise-error")}),document.querySelectorAll("img").forEach((n,r)=>{n.setAttribute("em-optimise",`image_${r}`)}),t.commit()}function uP(e,t){document.querySelectorAll("[em-optimise-error]").forEach(n=>{n.removeAttribute("em-optimise-error")}),document.querySelectorAll("a[href]").forEach((n,r)=>{n.setAttribute("em-optimise",`link_${r}`)}),t.commit()}function dP(e,t){const n=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);n&&(e.data.settings.isError&&(n.setAttribute("em-optimise-error","true"),t.commit()),t.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),t.setCursorPosition(n),t.applicationElementSettingsSet({elem:n}))}function fP(e,t){const n=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);n&&(t.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),t.setCursorPosition(n),t.applicationElementSettingsSet({elem:n}),e.data.settings.isError&&n.setAttribute("em-optimise-error","true"),t.commit())}var mP={sandbox_set_attr_to_images:cP,sandbox_set_attr_to_links:uP,sandbox_set_position_to_img:dP,sandbox_set_position_to_link:fP},hP={brightness:100,contrast:100,sepia:0},Il={DARK:"dark",LIGHT:"light"},qv=!1;function pP(e){qv||(e.setFetchMethod(t=>window.fetch(t)),qv=!0)}function gP(){let e=null,t=Il.LIGHT;return{set(n){if(t=n,n===Il.DARK){e??(e=df(()=>Promise.resolve().then(()=>id("./darkreader.CLd5EML2.js")),void 0,{}.url)),e.then(r=>{t===Il.DARK&&(pP(r),r.enable(hP))}).catch(r=>{e=null});return}e?.then(r=>{t===Il.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var Dl=gP();function bP(e,t){t.initPreview(!0)}function yP(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&Dl.set(t)}var vP={init_preview:bP,sandbox_switch_theme:yP};function vn(e,t,n,r){return{name:`sandbox.operations.${e}`,awaits:n,setup(o){const i=r(o),s={};for(const[a,l]of Object.entries(t))l&&(s[a]=c=>l(c,i()));o.addService(Ob,{owner:e,handlers:s})}}}var EP={name:"sandbox.operationEnvironment",provides:[Tr],setup(e){const t={iframeOffsetTop:0,previewHeight:0,elementPath:[]};j.subscribe(n=>{for(const r of["iframeOffsetTop","previewHeight","elementPath"])r in n&&n[r]!==void 0&&Object.assign(t,{[r]:n[r]})}),e.inject(Tr,t)}},SP=vn("discuss",oP,{services:[Te,Tr,Ye]},e=>{const t=dt(e),n=O(e,Tr),r=O(e,Ye);return()=>({commit:t,editLock:r,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:z,removeAllAttributes:Lr})}),wP=vn("editor",lP,{services:[Ie,it,Ye]},e=>{const t=O(e,Ie),n=O(e,it),r=O(e,Ye);return()=>({applicationElementSettingsSet:t,editLock:r,messageService:z,setEditorFocus:o=>n.setEditorFocus(o)})}),_P=vn("images",mP,{services:[Ie,yt,Te,Tr]},e=>{const t=O(e,Ie),n=O(e,yt),r=dt(e),o=O(e,Tr);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:z,setCursorPosition:i=>n(i)})}),CP=vn("preview",vP,{services:[ss]},e=>()=>({initPreview:t=>O(e,ss)(t)})),TP={name:"sandbox.operationsDispatcher",setup(e){z.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(Ob).map(i=>i.handlers[n]).filter(Boolean).pop();if(!r)return;const o=i=>{};try{Promise.resolve(r(t)).catch(o)}catch(i){o(i)}})}},AP=[EP,SP,wP,_P,CP,TP],kP=["em-block-insert","em-block-insert_bottom-document","em-block-insert_top-document","em-block-insert_bottom","em-block-insert_top","em-blockatom-insert","em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top","em-block-insert-empty","em-atom-insert-empty","em-block-insert-body","em-atom-insert-body","em-resize-start","sortable-chosen","sortable-ghost","em-vindent-table","em-vindent_low","em-vindent","em-relative","em-display-block","em-sandbox-discuss_set-target","em-sandbox-discuss","em-element-list-bullet","remove-new-editor-element","em-just-inserted","em-native-img-uploading","em-native-img-drop-target","em-native-img-drop-loading","em-native-file-drag"],LP=["style","class","align","href"],NP=new Set([...kP,"em-element-path_img"]);function xP(e){return e.split(/\s+/).filter(t=>t&&!NP.has(t)).join(" ")}var OP=32;function RP(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function MP(e){const t=[e.tagName];for(const n of LP){const r=e.getAttribute(n),o=n==="class"&&r!==null?xP(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function PP(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<OP&&(t.push(MP(n)),!RP(n));)n=n.parentElement,r++;return t.join("||")}function IP(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:PP(r)});return{remember(r){t=n(r)},forget(){t={...t,text:""}},take:n,differs(r){return t.text!==r.text||t.ancestors!==r.ancestors},accept(r){t=r}}}function DP(e,t){t.onReleased(()=>{Promise.resolve().then(()=>{t.isLocked()||e.remember(document.querySelector("[em-edit]"))})})}var zv=Promise.resolve(),Uv=null;function BP(e,t){const{HTMLDocument:n,documentMapping:r,remoteDocument:o,messageService:i}=t;let s=n.getRangeByElement(e,!0);if(s){const a=r.getMappedReplacementRangeAtPosition(s.start)||r.getMappedReplacementRangeAtPosition(Math.max(s.end-1,s.start));a&&(s=a),s=r.correctRange(s),s=o.correctRange(s);const l={operation:"update_position_from_iframe",data:s};i.send(l)}}function HP(e,t){Uv=e,zv=zv.finally(()=>{Uv===e&&BP(e,t)})}function FP(e,t="unknown"){const n=Mt.getInstance(it);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}function $P(e){const t=e.innerHTML.trim();return[t===" ",t==="<div> </div>",/^<div[^>]*> <\/div>$/.test(t),/^<[^>]*> <\/[^>]*>$/.test(t),t.replace(/<[^>]*>/g,"").trim()===" ",e.textContent?.trim()===" "||e.textContent?.trim().charCodeAt(0)===160].some(n=>n===!0)}function WP(e){window.getSelection();const t=e.startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t instanceof Element?t:null;if(!n||!n.contains(e.commonAncestorContainer))return!1;const r=n.textContent??"",o=e.toString(),i=r.replace(/\s+/g," ").trim(),s=o.replace(/\s+/g," ").trim();return r===o||i===s}var mne="br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object",As="data-em-caret",hne="",cr=e=>e();function Dt(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function co(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function Nr(e){return(e??"").replaceAll("","")}function kf(e){return Nr(e.textContent)}function qP(e){return(e.nodeType===Node.TEXT_NODE||Dt(e))&&Nr(e.textContent)===""}function Lf(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r&&ws(r,n)}function jv(e){if(!e.collapsed)return null;const{startContainer:t,startOffset:n}=e,r=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest("em-replace");if(!co(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),Nr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),Nr(i.toString())===""?{em:r,side:"after"}:null}function Nf(e,t){if(!e.collapsed)return null;const n=jv(e);if(n)return n.side===(t==="backward"?"after":"before")?n.em:null;const{startContainer:r,startOffset:o}=e;let i;if(r.nodeType===Node.TEXT_NODE){const s=r.data;if(Nr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=Dt(a)?a:r;i=t==="backward"?l.previousSibling:l.nextSibling}else{const s=r.childNodes;i=t==="backward"?s[o-1]??null:s[o]??null}for(;i&&qP(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return co(i)?i:null}function Bl(e,t,n=cr){return xf(e,t,n)}function xf(e,t,n=cr){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(Dt(r))o=r;else{const s=document.createElement("span");s.setAttribute(As,""),Ef(s),s.appendChild(document.createTextNode("")),n(()=>t==="after"?e.after(s):e.before(s)),o=s}let i=o.lastChild;if(!i||i.nodeType!==Node.TEXT_NODE){i=document.createTextNode("");const s=i;n(()=>o.appendChild(s))}return Lf(i,i.length),o}var zP="p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote";function Of(e,t=cr,n=e.parentElement?.closest('[contenteditable="true"]')){Vv(e,n)&&xf(e,"after",t)}function Vv(e,t){if(!t)return!1;const n=e.parentElement?.closest(zP),r=n&&t.contains(n)?n:t,o=document.createRange();o.setStartAfter(e),o.setEnd(r,r.childNodes.length);const i=o.cloneContents();return i.querySelectorAll(`[${As}]`).forEach(s=>s.remove()),!/[^ \t\n\r]/.test(i.textContent??"")&&!i.querySelector("br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object")}function Gv(e){const t=Dt(e)&&kf(e)===""?e.previousSibling:null;return t?.nodeName==="BR"&&Vv(t,t.parentElement?.closest('[contenteditable="true"]'))}function Rf(e,t=cr){if(!Gv(e)||!e.parentNode)return null;const n=window.getSelection(),r=!!n?.anchorNode&&e.contains(n.anchorNode),o=document.createElement("br");e.before(o),t(()=>e.remove());const i=o.parentNode;return r&&Lf(i,Array.prototype.indexOf.call(i.childNodes,o)),o}function Xv(){const e=window.getSelection(),t=e?.rangeCount?e.getRangeAt(0):null,n=t?.collapsed?t.startContainer:null,r=Dt(n)?n:n?.parentNode;return Gv(r)?r:null}function UP(e,t=cr,n){return Array.from(e.querySelectorAll(`[${As}]`)).filter(r=>r!==n).map(r=>Rf(r,t)).some(Boolean)}function jP(e,t=cr,n){const r=Array.from(e.querySelectorAll(`[${As}]`)).filter(o=>o!==n&&Nr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function VP(e,t=cr){const n=Nr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),Lf(r,r.length),r}function Kv(e){if(!e.collapsed)return;const{startContainer:t}=e,n=Dt(t)?t:t.parentNode;Dt(n)&&(co(n.previousSibling)?e.setStartAfter(n):e.setStartBefore(n),e.collapse(!0))}function Yv(e){e.querySelectorAll(`[${As}]`).forEach(t=>{const n=Nr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function GP(e,t){const n=Nf(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o&&ws(o,r),n}function XP(e,t){const n=Array.from(e.querySelectorAll("em-replace")).find(i=>co(i)&&t.intersectsNode(i)&&!Zv(t,i));if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o?.removeAllRanges(),o?.addRange(r),n}function Zv(e,t){const n=document.createRange();return n.selectNode(t),e.compareBoundaryPoints(e.START_TO_START,n)<=0&&e.compareBoundaryPoints(e.END_TO_END,n)>=0}function KP(){document.execCommand("delete")}function YP(){const e=window.getSelection()?.getRangeAt(0);e?.deleteContents(),e?.collapse(!0)}function Qv(e,t=cr,n=KP){if(e.collapsed)return!1;const r=e.commonAncestorContainer,o=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;if(!Array.from(o?.querySelectorAll("em-replace")??[]).some(l=>co(l)&&Zv(e,l)))return!1;n();const i=window.getSelection();if(!i?.rangeCount)return!0;const{startContainer:s,startOffset:a}=i.getRangeAt(0);if(s.nodeType===Node.ELEMENT_NODE){const l=s.childNodes[a-1]??null,c=s.childNodes[a]??null;co(l)?Bl(l,"after",t):!l&&co(c)&&Bl(c,"before",t)}return!0}function Jv(){const e=window.getSelection();return e?.rangeCount?Nf(e.getRangeAt(0),"backward"):null}function ZP(e,t=cr){const n=e.isConnected?e:Jv();if(!n)return;const r=n.closest('[contenteditable="true"]');It(()=>r?.focus({preventScroll:!0})),Bl(n,"after",t)}var eE=Symbol("held-input-replay"),tE={insertText:"insertText",insertReplacementText:"insertText",deleteContentBackward:"delete",deleteContentForward:"forwardDelete",insertParagraph:"insertParagraph",insertLineBreak:"insertLineBreak",insertOrderedList:"insertOrderedList",insertUnorderedList:"insertUnorderedList",insertHorizontalRule:"insertHorizontalRule",formatBold:"bold",formatItalic:"italic",formatUnderline:"underline",formatStrikeThrough:"strikeThrough",formatSuperscript:"superscript",formatSubscript:"subscript",formatJustifyLeft:"justifyLeft",formatJustifyCenter:"justifyCenter",formatJustifyRight:"justifyRight",formatJustifyFull:"justifyFull",formatIndent:"indent",formatOutdent:"outdent",formatRemove:"removeFormat"},nE={deleteWordBackward:["backward","word"],deleteWordForward:["forward","word"],deleteSoftLineBackward:["backward","lineboundary"],deleteSoftLineForward:["forward","lineboundary"],deleteHardLineBackward:["backward","paragraphboundary"],deleteHardLineForward:["forward","paragraphboundary"]};function QP(e){return e in tE||e in nE}var JP={Backspace:["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward"],Delete:["deleteContentForward","deleteWordForward","deleteSoftLineForward"]},rE={ArrowLeft:["backward","character","word"],ArrowRight:["forward","character","word"],ArrowUp:["backward","line","paragraphboundary"],ArrowDown:["forward","line","paragraphboundary"],Home:["backward","lineboundary","documentboundary"],End:["forward","lineboundary","documentboundary"]};function Mf(){return/Mac/.test(window.navigator.platform)}function oE(e){return Mf()?e.altKey:e.ctrlKey}function eI(e){const t=e.ctrlKey||e.metaKey;return t&&/^[cxv]$/i.test(e.key)||e.key==="Insert"&&(t||e.shiftKey)}function tI(e){return e.key in rE||(e.ctrlKey||e.metaKey)&&e.key.length===1&&!eI(e)}function Pf(e){return eE in e}function If(e){return e.target?.closest?.('[contenteditable="true"], editor')??void 0}function iE(e){if(e.key.length===1&&!e.metaKey&&(!e.ctrlKey||e.altKey))return"insertText";if(e.key==="Enter"&&!e.ctrlKey&&!e.metaKey&&!e.altKey)return e.shiftKey?"insertLineBreak":"insertParagraph";const t=JP[e.key];if(t)return Mf()&&e.metaKey?t[2]:oE(e)?t[1]:t[0]}function nI(e){const t=rE[e.key];if(!t)return;const n=Mf()&&e.metaKey&&(e.key==="ArrowLeft"||e.key==="ArrowRight")?"lineboundary":oE(e)?t[2]:t[1];document.getSelection()?.modify?.(e.shiftKey?"extend":"move",t[0],n)}function Df(e){return Object.defineProperty(e,eE,{value:!0}),e}function sE(e,t){return e.isConnected&&t<=(e.nodeType===Node.TEXT_NODE?e.length:e.childNodes.length)}function aE(e){if(!sE(e.startContainer,e.startOffset)||!sE(e.endContainer,e.endOffset))return;const t=document.createRange();return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t.toString()}function rI(e,t){return t===void 0||aE(e)!==t?!1:(document.getSelection()?.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),!0)}function oI({inputType:e,data:t}){const n=nE[e];if(n){const o=document.getSelection();o?.isCollapsed&&o.modify?.("extend",n[0],n[1]),lr(n[0]==="backward"?"delete":"forwardDelete");return}const r=tE[e];r&&lr(r,!1,t??void 0)}function lE(e,t){if(t.target&&!rI(t.target,t.targetText))return;const{inputType:n,data:r}=t,o=Df(new window.InputEvent("beforeinput",{inputType:n,data:r,bubbles:!0,cancelable:!0}));e.dispatchEvent(o)&&oI(t)}function iI(e,t){const n=Df(new window.KeyboardEvent("keydown",{...t,bubbles:!0,cancelable:!0}));if(Object.defineProperty(n,"keyCode",{value:t.keyCode}),!e.dispatchEvent(n))return;const r=iE(t);r?lE(e,{inputType:r,data:r==="insertText"?t.key:null}):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()==="a"?lr("selectAll"):nI(t)}var sI='[contenteditable="true"], editor';function Bf(e){return(e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement)?.closest(sI)??void 0}function aI(){const e=document.getSelection();if(!e?.rangeCount||!e.anchorNode||!e.focusNode||!ft())return;const t=at(),n=t.pointToOffset({node:e.anchorNode,offset:e.anchorOffset}),r=t.pointToOffset({node:e.focusNode,offset:e.focusOffset});return n===void 0||r===void 0?void 0:{anchor:t.trackOffset(n),focus:t.trackOffset(r)}}function cE(e){e?.anchor.release(),e?.focus.release()}function uE({node:e}){const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement,n=e.nodeType===Node.TEXT_NODE&&/^\s*$/.test(e.data)&&/\n/.test(e.data);return e.isConnected&&!!Bf(e)&&!n&&!t?.closest("em-replace, [data-em-caret]")}function dE(e){const t=e.current(),n=t===void 0||!ft()?void 0:at().offsetToPoint(t);return n&&uE(n)?n:void 0}function lI(e){const t=e&&dE(e.anchor),n=e&&dE(e.focus);if(!(!t||!n))return document.getSelection()?.setBaseAndExtent(t.node,t.offset,n.node,n.offset),Bf(t.node)}function cI(){const e=document.getSelection(),t=e?.rangeCount?e.anchorNode:null;return t&&uE({node:t})?Bf(t):void 0}function uI(e){const t=lI(e)??cI();return t}function Hl(e,t){const n=aI(),r=e(()=>{ft()&&at().flushCommit();const o=uI(n);cE(n),o&&t(o)});return r||cE(n),r}function Hf(e){e.preventDefault(),e.stopImmediatePropagation()}function dI(e){return/^(Tab|Escape|PageUp|PageDown|F\d{1,2})$/.test(e.key)||e.key==="Enter"&&(e.ctrlKey||e.metaKey)}var fE=e=>{if(!If(e)||Pf(e)||e.isComposing||e.keyCode===229)return;const{key:t,code:n,keyCode:r,shiftKey:o,ctrlKey:i,metaKey:s,altKey:a}=e,l={key:t,code:n,keyCode:r,shiftKey:o,ctrlKey:i,metaKey:s,altKey:a},c=u=>iI(u,l);iE(l)?yf()&&Hl(bf,c)&&Hf(e):tI(l)?xv()&&Hl(Lv,c)&&Hf(e):dI(l)&&xv()&&Ov()},mE=()=>{Ov()},hE=e=>{if(!If(e)||!QP(e.inputType)||e.isComposing||Pf(e)||!yf())return;const t=e.inputType==="insertReplacementText",n=t?e.getTargetRanges?.()[0]:void 0;if(t&&!n)return;const r={inputType:e.inputType,data:t&&e.dataTransfer?.getData("text/plain")||e.data,target:n,targetText:n&&aE(n)};Hl(bf,o=>lE(o,r))&&Hf(e)};function fI(e){return"clipboardData"in e?e.clipboardData:e.dataTransfer}var mI=["text/html","text/plain"];function hI(e,t){const n=Array.from(t.types??[]),r=Object.fromEntries(mI.filter(o=>n.includes(o)).map(o=>[o,t.getData(o)]));return Df({target:e.target,clipboardData:{types:Object.keys(r),files:[],getData:o=>r[o]??""},preventDefault:()=>{},stopPropagation:()=>{}})}function pI(e,t){if(Pf(e)||!yf()||!If(e))return!1;try{const n=fI(e);if(!n||n.files?.length)return!1;const r=hI(e,n);if(!Hl(bf,()=>t(r)))return!1}catch{return e.preventDefault(),!1}return e.preventDefault(),e.stopPropagation(),!0}function gI(){return window.addEventListener("keydown",fE,!0),window.addEventListener("beforeinput",hE,!0),window.addEventListener("pointerdown",mE,!0),{dispose(){window.removeEventListener("keydown",fE,!0),window.removeEventListener("beforeinput",hE,!0),window.removeEventListener("pointerdown",mE,!0)}}}function bI(e,t){const n=t==="sup"?"sub":"sup";e.querySelectorAll(`${t}, ${n}`).forEach(r=>{const o=r.parentNode;if(o){for(;r.firstChild;)o.insertBefore(r.firstChild,r);r.remove()}})}function pE(e,t,n){const r=document.createElement(n);try{if(typeof t=="string")r.textContent=t||e.toString();else if(t instanceof DocumentFragment)r.appendChild(t);else if(t instanceof HTMLElement)for(;t.firstChild;)r.appendChild(t.firstChild);else r.textContent=e.toString();e.deleteContents(),e.insertNode(r)}catch{return null}return r}function yI(e){const t=e.parentNode;if(!t)return document.createTextNode("");if(Array.from(e.childNodes).some(n=>n.nodeType===1)){const n=document.createDocumentFragment(),r=Array.from(e.childNodes);for(;e.firstChild;)n.appendChild(e.firstChild);return t.replaceChild(n,e),r[0]||document.createTextNode("")}else{const n=e.textContent||"",r=document.createTextNode(n);return t.replaceChild(r,e),r}}function vI(e,t,n){if(!e)return!1;const r=e.textContent?.trim()||"";let o="";if(n){const i=t.cloneRange(),s=i;try{s.expand&&s.expand("word"),o=i.toString().trim()}catch{return!1}}else o=t.toString().trim();return r===o}function EI(e,t){const n=e.textContent||"",r=t.toString(),o=t.startOffset,i=t.endOffset,s=document.createTextNode(n.slice(0,o)),a=document.createTextNode(r),l=document.createTextNode(n.slice(i)),c=e.parentNode;return c&&(c.insertBefore(s,e),c.insertBefore(a,e),l.textContent&&c.insertBefore(l,e),e.remove()),t.setStart(a,0),t.setEnd(a,a.length),a}function SI(e,t=[]){const n=[...new Set(["strong","em","b","i","u","sub","sup","strike",...t])].join(", ");e.querySelectorAll(n).forEach(r=>{!r.textContent?.trim()&&(!r.hasChildNodes()||Array.from(r.childNodes).every(o=>o.nodeType===Node.TEXT_NODE&&!o.textContent?.trim()))&&r.remove()})}function gE(e,t=10){const n=e.length;return n===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/n*100>t}var wI={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function ks(e,t){const n=wI[t]||t,r=new RegExp(`<\\/?(${n})>`,"gi");return e.replaceAll(r,"")}var _I=["strong","em","strike","sub","sup","b","i","s","u"];function CI(e,t){if(t)for(const n of _I)t.closest(n)&&e.querySelectorAll(n).forEach(r=>{const o=r.parentNode;if(o){for(;r.firstChild;)o.insertBefore(r.firstChild,r);r.remove()}})}function TI(e,t){t&&t.closest("a")&&e.querySelectorAll("a").forEach(n=>{const r=n.parentNode;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);n.remove()}})}var pne="#1C52DC",gne="#1C52DC",bne="#1C52DC";function AI(e){if(typeof e.isContentEditable=="boolean")return e.isContentEditable;const t=e.closest("[contenteditable]");return!!t&&t.getAttribute("contenteditable")!=="false"}function bE(e,t,n,r){const o=document.createRange();return o.selectNodeContents(e),r?o.setStart(t,n):o.setEnd(t,n),o.toString()!==""||!!o.cloneContents().querySelector("br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object")}function kI(e){const{startContainer:t,startOffset:n}=e,r=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest("a"),o=r?.parentElement;if(!e.collapsed||!r?.textContent||!o||!AI(o))return;const{display:i}=getComputedStyle(r);if(!(i&&i!=="inline")){if(!bE(r,t,n,!0))e.setStartAfter(r);else if(!bE(r,t,n,!1))e.setStartBefore(r);else return;e.collapse(!0)}}var LI="./js/sanitize-html/sanitize-html.js",yE="data-sanitize-html-loader",Fl=null,Ls=null;function vE(){return typeof __emailmaker__<"u"?__emailmaker__:void 0}function NI(e){const t=vE();if(typeof t?.moduleTransport!="function"||t.blobBlocked)return null;try{return t.moduleTransport(e)}catch{return null}}function xI(){const e=vE();e&&(e.blobBlocked=!0)}function OI(){return new URL(LI,document.baseURI||window.location.href).href}function Ff(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function RI(){if(Ff())return Promise.resolve();const e=OI();return document.querySelector(`script[${yE}]`)?Ls??Promise.resolve():(Ls||(Ls=MI(e).catch(t=>{throw Ls=null,t})),Ls)}async function MI(e){const t=NI(e);if(!t)return $l(e);const n=await t.catch(()=>null);if(!n)return $l(e);const r=URL.createObjectURL(n),o=await $l(r).then(()=>!0,()=>!1);URL.revokeObjectURL(r),o||(xI(),await $l(e))}function $l(e){return new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.setAttribute(yE,"true"),r.onload=()=>t(),r.onerror=()=>{r.remove(),n(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(r)})}async function EE(){const e=Ff();return e||(Fl||(Fl=(async()=>{await RI();const t=Ff();if(t)return t;throw new Error("sanitizeHtml not available after script load")})().catch(t=>{throw Fl=null,t})),Fl)}function Wl(e){return e?.nodeType===Node.TEXT_NODE}function PI(e,t,n){if(t?.nodeType===Node.TEXT_NODE)return e.includes(t)?{text:t,offset:n}:null;if(!t||t!==e[0]?.parentNode)return null;const r=t.childNodes[n-1];if(r?.nodeType===Node.TEXT_NODE&&e.includes(r))return{text:r,offset:r.length};const o=t.childNodes[n];return o?.nodeType===Node.TEXT_NODE&&e.includes(o)?{text:o,offset:0}:null}function SE(e,t,n,r){const o=PI(e,n,r);if(!o)return null;let i=o.text,s=0;for(;i!==t&&i.previousSibling?.nodeType===Node.TEXT_NODE;)i=i.previousSibling,s+=i.length;return{head:i,offset:s+o.offset}}function wE(e,t,n,r){return e.node===t&&e.offset>n?{...e,offset:e.offset-r}:e}function $f(e,t,n=()=>"letter"){const r=e?.previousSibling,o=t?.nextSibling,i=Wl(r)&&n(r)==="letter",s=i&&Wl(e),a=Wl(t)&&Wl(o)&&(n(o)==="letter"||i&&n(o)==="new");if(!s&&!a)return;const l=window.getSelection(),c=s?r:e,u=a?o:t;if(!c||!u)return;const d=[];for(let b=c;b;b=b===u?null:b.nextSibling)d.push(b);const f=c.parentNode,h=Array.prototype.indexOf.call(f?.childNodes??[],u),m={node:l?.anchorNode??null,offset:l?.anchorOffset??0},p={node:l?.focusNode??null,offset:l?.focusOffset??0},v=SE(d,c,m.node,m.offset),w=SE(d,c,p.node,p.offset);let _=null,A=0;for(let b=c;b;){const g=b===u?null:b.nextSibling;b.nodeType!==Node.TEXT_NODE?_=null:_?(_.appendData(b.data),b.parentNode?.removeChild(b),A++):_=b,b=g}if(l&&(v||w)){const b=v?{node:v.head,offset:v.offset}:wE(m,f,h,A),g=w?{node:w.head,offset:w.offset}:wE(p,f,h,A);b.node&&g.node&&l.setBaseAndExtent(b.node,b.offset,g.node,g.offset)}}var II=["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],DI={a:["href"],span:["data-font-size","data-bold","data-italic"],strong:["data-italic"],ul:["data-list-type"],ol:["data-list-type","data-list-start"],li:["data-list-item"]};function BI(e){const t=/^\s*(\d+(?:\.\d+)?)(px|pt|em)?\s*$/i.exec(e??"");return t?`${t[1]}${(t[2]||"px").toLowerCase()}`:null}var HI=/<span\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,FI=/\sdata-(?:buffer|metadata)=(?:"[^"]*"|'[^']*')/gi;function $I(e){return e.replace(HI,t=>t.replace(FI,""))}function WI(e){const t=window.clipboardData;return("clipboardData"in e?e.clipboardData:e.dataTransfer)||t}function qI(e){return zI(e.replace(/\r\n?/g,`
|
|
31
|
+
`).replace(/\n$/,"").replace(/&/g,"&").replace(/\n/g,"<br>"))}function zI(e){const t=new DOMParser().parseFromString(`<body>${e}`,"text/html").body;return t.querySelectorAll("script").forEach(n=>n.remove()),t.querySelectorAll("*").forEach(n=>{Array.from(n.attributes).forEach(r=>{/^on/i.test(r.name)&&n.removeAttribute(r.name)})}),t.innerHTML}var xr=new Map,UI=3e3,jI=1e4;function VI(){const e=performance.now();return[...xr.values()].some(t=>t.waiting&&e-t.startedAt<jI)}function GI(){for(const[e,t]of xr)t.waiting&&(t.superseded=!0,xr.delete(e))}function XI(){return xr.size>0}async function KI(){let e;const t=new Promise(r=>{e=setTimeout(()=>{r()},UI)}),n=(async()=>{for(;xr.size;)await Promise.allSettled(xr.keys())})();await Promise.race([n,t]),clearTimeout(e)}function ql(e,t=!1,n,r,o){if(pI(e,a=>{ql(a,t,n,r,o)}))return Promise.resolve();if(VI())return e.preventDefault(),e.stopPropagation(),Promise.resolve();GI();const i={startedAt:performance.now(),waiting:!0,superseded:!1},s=YI(e,t,n,r,o,i);return xr.set(s,i),s.finally(()=>xr.delete(s))}function _E(){const e=window.getSelection();e?.rangeCount&&kI(e.getRangeAt(0))}async function YI(e,t,n,r,o,i){e.preventDefault(),e.stopPropagation();const s=WI(e);if(!s)return;const a=s.getData("text/html"),l=s.getData("text/plain");try{let c=a;if(!c||t)_E(),c=qI(l);else{const d=await EE();if(i.superseded)return;_E();const f=n?.text?.fontSize||16;let h=d($I(c),{allowedTags:II,allowedAttributes:DI,allowedStyles:{},transformTags:{span:function(b,g){let E="",T=!1,y=!1;if(g.style){const S=g.style.toLowerCase();(S.includes("font-weight: bold")||S.includes("font-weight:bold")||S.includes("font-weight: 700")||S.includes("font-weight:700"))&&(T=!0),(S.includes("font-style: italic")||S.includes("font-style:italic"))&&(y=!0),S.includes("text-decoration: underline")||S.includes("text-decoration:underline"),T&&y?(E="strong",g["data-italic"]="true"):T?E="strong":y&&(E="em")}return{tagName:E||"",attribs:g}},h1:function(b,g){return g["data-font-size"]=Math.round(1.5*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h2:function(b,g){return g["data-font-size"]=Math.round(1.25*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h3:function(b,g){return g["data-font-size"]=Math.round(1.125*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h4:function(b,g){return g["data-font-size"]=f.toString(),g["data-bold"]="true",g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h5:function(b,g){return g["data-font-size"]=Math.round(.875*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},ul:function(b,g){return g["data-list-type"]="unordered",delete g.style,delete g["margin-top"],delete g["margin-bottom"],delete g["padding-inline-start"],{tagName:"ul",attribs:g}},ol:function(b,g){return g["data-list-type"]="ordered",g.start&&(g["data-list-start"]=g.start),delete g.style,delete g.start,{tagName:"ol",attribs:g}},li:function(b,g){return g["data-list-item"]="true",delete g.style,delete g.dir,delete g["aria-level"],delete g["list-style-type"],{tagName:"li",attribs:g}},p:function(b,g){return{tagName:"br",attribs:{}}},div:"br",b:function(b,g){if(g.style){const E=g.style.toLowerCase();return E.includes("font-weight: bold")||E.includes("font-weight:bold")||E.includes("font-weight: 700")||E.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(b,g){if(g.style){const E=g.style.toLowerCase();return E.includes("font-style: italic")||E.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(b,g){return{tagName:"strike",attribs:g}}},textFilter:function(b){return b.replace(/\s+/g," ")}});h=h.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const m=document.createElement("div");m.innerHTML=h,(b=>{b.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((g,E)=>{const T=g.getAttribute("data-list-type")==="ordered",y=g.querySelectorAll("li[data-list-item]");let S=1;T&&g.getAttribute("data-list-start")&&(S=parseInt(g.getAttribute("data-list-start"),10)||1);const C=document.createDocumentFragment(),L=g.previousSibling;L&&(L.nodeType===Node.TEXT_NODE&&L.textContent.trim()!==""||L.nodeType===Node.ELEMENT_NODE&&L.tagName!=="BR")&&C.appendChild(document.createElement("br")),y.forEach((x,N)=>{const W=document.createElement("span");W.innerHTML=T?`${S}. `:"• ",C.appendChild(W),(P=>{const J=document.createElement("div");J.innerHTML=P.innerHTML;let ne=J.firstChild;for(;ne&&ne.nodeType===1&&ne.tagName==="BR";)J.removeChild(ne),ne=J.firstChild;if(!J.hasChildNodes()){const he=document.createTextNode("");J.appendChild(he)}for(;J.firstChild;)C.appendChild(J.firstChild)})(x),N<y.length-1&&C.appendChild(document.createElement("br")),S++}),g.parentNode.replaceChild(C,g)}),b.querySelectorAll("[data-list-type], [data-list-item], [data-list-start]").forEach(g=>{g.removeAttribute("data-list-type"),g.removeAttribute("data-list-item"),g.removeAttribute("data-list-start")})})(m),m.firstChild&&m.firstChild.nodeType===Node.ELEMENT_NODE&&m.firstChild.tagName==="BR"&&m.removeChild(m.firstChild),m.querySelectorAll("[data-font-size]").forEach(b=>{const g=BI(b.getAttribute("data-font-size"));let E=g?`font-size: ${g};`:"";b.getAttribute("data-bold")==="true"&&(E+=" font-weight: bold;"),b.getAttribute("data-italic")==="true"&&(E+=" font-style: italic;"),E&&b.setAttribute("style",E.trim()),b.removeAttribute("data-font-size"),b.removeAttribute("data-bold"),b.removeAttribute("data-italic")}),m.querySelectorAll("[data-italic]").forEach(b=>{const g=document.createElement("em");g.innerHTML=b.innerHTML,b.innerHTML="",b.appendChild(g),b.removeAttribute("data-italic")}),m.querySelectorAll("a").forEach(b=>{const g=b.getAttribute("href");if(!g||g.trim()==="")b.replaceWith(...b.childNodes);else{b.setAttribute("target","_blank");const E=n?.links?.color??"#1C52DC",T=n?.links?.underline??!0?"underline":"none";b.setAttribute("style",`color: ${E}; text-decoration: ${T};`)}});const v=m.querySelectorAll("*");let w=0;v.forEach(b=>{b.tagName!=="BR"&&b.tagName!=="SPAN"&&b.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&(b.parentNode.removeChild(b),w++)}),m.querySelectorAll("span").forEach(b=>{b.innerHTML==="• "||/^\d+\. $/.test(b.innerHTML)||b.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&b.children.length===0&&(b.parentNode.removeChild(b),w++)});const _=window.getSelection(),A=_?.anchorNode?.nodeType===Node.ELEMENT_NODE?_.anchorNode:_?.anchorNode?.parentElement||null;CI(m,A),TI(m,A),c=m.innerHTML}const u=window.getSelection();if(u&&u.rangeCount>0){const d=u.getRangeAt(0);Kv(d),d.deleteContents();const f=document.createRange().createContextualFragment(c),h=f.firstChild,m=f.lastChild;d.insertNode(f),m?.nodeType===Node.TEXT_NODE&&d.setEnd(m,m.length),d.collapse(!1),$f(h,m,wf)}}catch{if(i.superseded)return;lr("insertText",!1,l)}i.waiting=!1,r(e),o(),await new Promise(c=>setTimeout(c,0))}var zl=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function CE(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function uo(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function TE(e){return!e||!e.childNodes?!1:Array.from(e.childNodes).every(t=>t.nodeType===Node.TEXT_NODE?(t.textContent?.trim()??"")!=="":t.nodeType===Node.ELEMENT_NODE?TE(t):!1)}function D(e){const t=document.createElement(e.tag||"div");if(t.setAttribute("contentEditable","false"),e.width&&(t.style.width=e.width+"px"),e.height&&(t.style.height=e.height+"px"),e.left&&(t.style.left=e.left+"px"),e.top&&(t.style.top=e.top+"px"),e.className&&(t.className=e.className),e.style&&t.setAttribute("style",e.style),e.HTMLcontent&&(t.innerHTML=e.HTMLcontent),e.title&&t.setAttribute("title",e.title),e["data-id"]&&t.setAttribute("data-id",e["data-id"]),e.targetElement){const n=typeof e.targetElement=="string"?document.querySelector(e.targetElement):e.targetElement;if(n)switch(e.insertType){case"append":n.append(t);break;case"prepend":n.prepend(t);break;case"before":n.before(t);break;case"after":n.after(t);break;case"replaceWith":n.replaceWith(t)}}return t}function ZI(e){try{return JSON.parse(e),!0}catch{return!1}}function AE(e,t,n=2){const r=e.split(""),o=t.split("");if(Math.abs(r.length-o.length)>n)return!1;let i=0;if(r.length===o.length){for(let s=0;s<r.length;s++)if(r[s]!==o[s]&&(i++,i>n))return!1}else{const s=r.length>o.length?r:o,a=r.length>o.length?o:r;let l=0,c=0;for(;l<s.length&&c<a.length;)if(s[l]!==a[c]){if(i++,i>n)return!1;l++}else l++,c++;if(l<s.length&&i++,i>1)return!1}return!0}function Jo(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function QI(e){const t=e.style?.fontWeight;if(typeof t=="number")return t>=600;if(typeof t=="string"){const n=t.toLowerCase();return n.includes("bold")||n.includes("black")||parseInt(n)>=600}return!1}function Ul(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).commonAncestorContainer;return t.nodeType===1?t:t.parentElement}function Wf(e,t=null){const n=e?.innerText;for(;e!==null;){if(e.innerText===n){const r=e.parentElement;if(r===null||r.innerText!==n||r.tagName==="EDITOR"||e.tagName===t?.toUpperCase())return e.tagName===t?.toUpperCase()||!t?e:null}e=e.parentElement}return null}function Ns(e,t=Ul()){e=zl(e)??"";const n=i=>zl(i?.textContent||"")??"",r=Array.from(t?.childNodes||[]).filter(i=>!!i&&i.nodeName!=="BR");let o=null;if(t&&t.nodeType===Node.TEXT_NODE&&n(t).includes(e)&&n(t)===e)return t;for(let i=0;i<r.length;i++){const s=r[i];if(s.nodeType===Node.TEXT_NODE&&n(s).includes(e)&&n(s)===e){o=s.parentNode;break}else if(s.nodeType===Node.ELEMENT_NODE&&(o=Ns(e,s),o))break}return o}function jl(e){const t=Array.from(e),n=t.map(i=>i.clientWidth),r=n.reduce((i,s)=>i+s,0),o=n.map(i=>((i||0)/r*100).toFixed(1));t.forEach((i,s)=>{i.setAttribute("data-percent",o[s])})}function Vl(e){e.elem.nodeName==="#comment"&&e.elem.textContent&&e.elem.textContent.indexOf("mso")>-1?e.elem.textContent=e.elem.textContent.replace(/width=".*"/gi,`width="${e.width}"`):e.elem.previousSibling&&Vl({elem:e.elem.previousSibling,width:e.width})}function JI(e){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let o=0;for(;o<e;)t+=n.charAt(Math.floor(Math.random()*62)),o+=1;return t}var e5=e=>{if(e instanceof Text)return e.textContent||"";if(e instanceof Element){if(e.tagName==="BR")return`
|
|
32
|
+
`;if(e.classList?.contains(".em-element-path"))return"";if(e.classList?.contains("em-code"))return"⃠";if(e.tagName==="EM-REPLACE")return"⃡"}};function kE(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>kE(r,t)).join(""):n}function t5(e,t,n,r){e.setAttribute("style",n?.getAttribute("style")||t.getAttribute("innerStyle")||t.getAttribute("style")||""),e.style.color=r(e.style.color)??"",e.style.backgroundColor=r(e.style.backgroundColor)??"";const o=t.getAttribute("innerClass");o&&(e.className=o);const i=t.getAttribute("innerHref"),s=t.getAttribute("href"),a=n.getAttribute("href");(i!==null||s!==null||a!==null)&&(t.tagName==="A"||n.tagName==="A")&&e.setAttribute("href",i??s??a??"");const l=t.getAttribute("innerTarget");l&&e.setAttribute("target",l);const c=t.getAttribute("innerAlign");c&&e.setAttribute("align",c);const u=n.hasAttribute("em-edit")?n:n.querySelector("[em-edit]");u&&e.setAttribute("em-edit",u.getAttribute("em-edit")||"")}function n5(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function r5(e){let t=!1;return e&&e.childNodes.forEach(n=>{if(n.nodeType===Node.TEXT_NODE&&n.nodeValue?.trim()!==""){const r=n.nodeValue?.trim()||"";/[a-zA-Zа-яА-Я]/.test(r)&&(t=!0)}}),t}function xs(){return bM()}function o5(e,t=!1){if(e.closest("EDITOR")||!e.isConnected)return!0;let n=!1;if(!t)for(const r of Array.from(e.childNodes))if(r.tagName==="EDITOR"){if(n)return!1;n=!0}else return!1;return n}function LE(e,t){if(e instanceof Text){const n=e.textContent,r=n;n!==r&&e.replaceWith(...t(r||""))}else if(e instanceof Element){const n=[...e.childNodes];if(e.tagName==="EDITOR")e.replaceWith(...n);else if(e.tagName==="SPAN"&&e.classList.contains("mce-nbsp-wrap"))return;for(const r of n)LE(r,t)}}function i5(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function V(e){if(s5(e))return a5(e)?e.trim():l5(e)}var NE={RGB:/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)/i,HEX:/^\s*#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})\s*$/i},s5=e=>typeof e=="string"&&e.trim()!=="",a5=e=>NE.HEX.test(e);function l5(e){const t=NE.RGB.exec(e)?.groups;if(!t)return;const n=c5(t);return d5(n)}var c5=e=>({r:qf(e.r),g:qf(e.g),b:qf(e.b),a:u5(e.a)}),qf=e=>parseInt(e||"0",10),u5=e=>parseFloat(e||"1"),d5=e=>`#${zf(e.r)}${zf(e.g)}${zf(e.b)}`,zf=e=>e.toString(16).padStart(2,"0"),f5=0;function mt(e){return e>=48&&e<=57}function Or(e){return mt(e)||e>=65&&e<=70||e>=97&&e<=102}function Uf(e){return e>=65&&e<=90}function m5(e){return e>=97&&e<=122}function h5(e){return Uf(e)||m5(e)}function p5(e){return e>=128}function Gl(e){return h5(e)||p5(e)||e===95}function xE(e){return Gl(e)||mt(e)||e===45}function g5(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Xl(e){return e===10||e===13||e===12}function fo(e){return Xl(e)||e===32||e===9}function Bn(e,t){return!(e!==92||Xl(t)||t===f5)}function Kl(e,t,n){return e===45?Gl(t)||t===45||Bn(t,n):Gl(e)?!0:e===92?Bn(e,t):!1}function jf(e,t,n){return e===43||e===45?mt(t)?2:t===46&&mt(n)?3:0:e===46?mt(t)?2:0:mt(e)?1:0}function OE(e){return e===65279||e===65534?1:0}var Vf=new Array(128),yne=128,vne=130,Ene=131,Sne=132,wne=133;for(let e=0;e<Vf.length;e++)Vf[e]=fo(e)&&130||mt(e)&&131||Gl(e)&&132||g5(e)&&133||e||128;function Gf(e){return e<128?Vf[e]:132}function ei(e,t){return t<e.length?e.charCodeAt(t):0}function Xf(e,t,n){return n===13&&ei(e,t+1)===10?2:1}function ti(e,t,n){let r=e.charCodeAt(t);return Uf(r)&&(r=r|32),r===n}function Os(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let o=t;o<n;o++){const i=r.charCodeAt(o-t);let s=e.charCodeAt(o);if(Uf(s)&&(s=s|32),s!==i)return!1}return!0}function b5(e,t){for(;t>=0&&fo(e.charCodeAt(t));t--);return t+1}function Yl(e,t){for(;t<e.length&&fo(e.charCodeAt(t));t++);return t}function Kf(e,t){for(;t<e.length&&mt(e.charCodeAt(t));t++);return t}function ni(e,t){if(t+=2,Or(ei(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&Or(ei(e,t));t++);const n=ei(e,t);fo(n)&&(t+=Xf(e,t,n))}return t}function Zl(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!xE(n)){if(Bn(n,ei(e,t+1))){t=ni(e,t)-1;continue}break}}return t}function Ql(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),mt(n)&&(t=Kf(e,t+1),n=e.charCodeAt(t)),n===46&&mt(e.charCodeAt(t+1))&&(t+=2,t=Kf(e,t)),ti(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),mt(n)&&(t=Kf(e,t+1+r+1))}return t}function Yf(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}Bn(n,ei(e,t+1))&&(t=ni(e,t))}return t}function RE(e){if(e.length===1&&!Or(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var ME=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token"],y5=16384;function Jl(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,y5)):e}var PE=10,v5=12,IE=13;function DE(e){const t=e.source,n=t.length,r=t.length>0?OE(t.charCodeAt(0)):0,o=Jl(e.lines,n),i=Jl(e.columns,n);let s=e.startLine,a=e.startColumn;for(let l=r;l<n;l++){const c=t.charCodeAt(l);o[l]=s,i[l]=a++,(c===PE||c===IE||c===v5)&&(c===IE&&l+1<n&&t.charCodeAt(l+1)===PE&&(l++,o[l]=s,i[l]=a),s++,a=1)}o[n]=s,i[n]=a,e.lines=o,e.columns=i,e.computed=!0}var E5=class{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(e,t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||DE(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||DE(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}},on=16777215,Rr=24,S5=new Map([[2,22],[21,22],[19,20],[23,24]]),w5=class{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=()=>{}){e=String(e||"");const n=e.length,r=Jl(this.offsetAndType,e.length+1),o=Jl(this.balance,e.length+1);let i=0,s=0,a=0,l=-1;for(this.offsetAndType=null,this.balance=null,t(e,(c,u,d)=>{switch(c){default:o[i]=n;break;case s:{let f=a&on;for(a=o[f],s=a>>Rr,o[i]=f,o[f++]=i;f<i;f++)o[f]===n&&(o[f]=i);break}case 21:case 2:case 19:case 23:o[i]=a,s=S5.get(c),a=s<<Rr|i}r[i++]=c<<Rr|d,l===-1&&(l=u)}),r[i]=0<<Rr|n,o[i]=n,o[n]=n;a!==0;){const c=a&on;a=o[c],o[c]=n}this.source=e,this.firstCharOffset=l===-1?0:l,this.tokenCount=i,this.offsetAndType=r,this.balance=o,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>Rr:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&on:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?Os(this.source,this.offsetAndType[e-1]&on,this.offsetAndType[e]&on,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&on:this.offsetAndType[this.tokenCount]&on:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===9&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&on,t=this.offsetAndType[t],this.tokenType=t>>Rr,this.tokenEnd=t&on):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>Rr,this.tokenEnd=e&on):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(e,t){let n=e,r,o;e:for(;n<this.tokenCount;n++){if(r=this.balance[n],r<e)break e;switch(o=n>0?this.offsetAndType[n-1]&on:this.firstCharOffset,t(this.source.charCodeAt(o))){case 1:break e;case 2:n++;break e;default:this.balance[r]===n&&(n=r)}}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){const r=n,o=this.offsetAndType[t],i=o&on,s=o>>Rr;n=i,e(s,r,i,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((t,n,r,o)=>{e[o]={idx:o,type:ME[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function ec(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=Ql(e,c),Kl(n(c),n(c+1),n(c+2))){u=12,c=Zl(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=Zl(e,c),Os(e,d,c,"url")&&n(c)===40){if(c=Yl(e,c+1),n(c)===34||n(c)===39){u=2,c=d+4;return}s();return}if(n(c)===40){u=2,c++;return}u=1}function i(d){for(d||(d=n(c++)),u=5;c<e.length;c++){const f=e.charCodeAt(c);switch(Gf(f)){case d:c++;return;case 130:if(Xl(f)){c+=Xf(e,c,f),u=6;return}break;case 92:if(c===e.length-1)break;const h=n(c+1);Xl(h)?c+=Xf(e,c+1,h):Bn(f,h)&&(c=ni(e,c)-1)}}}function s(){for(u=7,c=Yl(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(Gf(d)){case 41:c++;return;case 130:if(c=Yl(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=Yf(e,c),u=8;return;case 34:case 39:case 40:case 133:c=Yf(e,c),u=8;return;case 92:if(Bn(d,n(c+1))){c=ni(e,c)-1;break}c=Yf(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=OE(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(Gf(d)){case 130:u=13,c=Yl(e,c+1);break;case 34:i();break;case 35:xE(n(c+1))||Bn(n(c+1),n(c+2))?(u=4,c=Zl(e,c+1)):(u=9,c++);break;case 39:i();break;case 40:u=21,c++;break;case 41:u=22,c++;break;case 43:jf(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:jf(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):Kl(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:jf(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 47:n(c+1)===42?(u=25,c=e.indexOf("*/",c+2),c=c===-1?e.length:c+2):(u=9,c++);break;case 58:u=16,c++;break;case 59:u=17,c++;break;case 60:n(c+1)===33&&n(c+2)===45&&n(c+3)===45?(u=14,c=c+4):(u=9,c++);break;case 64:Kl(n(c+1),n(c+2),n(c+3))?(u=3,c=Zl(e,c+1)):(u=9,c++);break;case 91:u=19,c++;break;case 92:Bn(d,n(c+1))?o():(u=9,c++);break;case 93:u=20,c++;break;case 123:u=23,c++;break;case 125:u=24,c++;break;case 131:r();break;case 132:o();break;default:u=9,c++}t(u,l,l=c)}}var ri=null,je=class Rn{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return Rn.createItem(t)}allocateCursor(t,n){let r;return ri!==null?(r=ri,ri=ri.cursor,r.prev=t,r.next=n,r.cursor=this.cursor):r={prev:t,next:n,cursor:this.cursor},this.cursor=r,r}releaseCursor(){const{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=ri,ri=t}updateCursors(t,n,r,o){let{cursor:i}=this;for(;i!==null;)i.prev===t&&(i.prev=n),i.next===r&&(i.next=o),i=i.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let n=this.head;n!==null;n=n.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let r of t){const o=Rn.createItem(r);n!==null?n.next=o:this.head=o,o.prev=n,n=o}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,n=this){const r=this.allocateCursor(null,this.head);for(;r.next!==null;){const o=r.next;r.next=o.next,t.call(n,o.data,o,this)}this.releaseCursor()}forEachRight(t,n=this){const r=this.allocateCursor(this.tail,null);for(;r.prev!==null;){const o=r.prev;r.prev=o.prev,t.call(n,o.data,o,this)}this.releaseCursor()}reduce(t,n,r=this){let o=this.allocateCursor(null,this.head),i=n,s;for(;o.next!==null;)s=o.next,o.next=s.next,i=t.call(r,i,s.data,s,this);return this.releaseCursor(),i}reduceRight(t,n,r=this){let o=this.allocateCursor(this.tail,null),i=n,s;for(;o.prev!==null;)s=o.prev,o.prev=s.prev,i=t.call(r,i,s.data,s,this);return this.releaseCursor(),i}some(t,n=this){for(let r=this.head;r!==null;r=r.next)if(t.call(n,r.data,r,this))return!0;return!1}map(t,n=this){const r=new Rn;for(let o=this.head;o!==null;o=o.next)r.appendData(t.call(n,o.data,o,this));return r}filter(t,n=this){const r=new Rn;for(let o=this.head;o!==null;o=o.next)t.call(n,o.data,o,this)&&r.appendData(o.data);return r}nextUntil(t,n,r=this){if(t===null)return;const o=this.allocateCursor(null,t);for(;o.next!==null;){const i=o.next;if(o.next=i.next,n.call(r,i.data,i,this))break}this.releaseCursor()}prevUntil(t,n,r=this){if(t===null)return;const o=this.allocateCursor(t,null);for(;o.prev!==null;){const i=o.prev;if(o.prev=i.prev,n.call(r,i.data,i,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const t=new Rn;for(let n of this)t.appendData(n);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(Rn.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(Rn.createItem(t))}insert(t,n=null){if(n!==null)if(this.updateCursors(n.prev,t,n,t),n.prev===null){if(this.head!==n)throw new Error("before doesn't belong to list");this.head=t,n.prev=t,t.next=n,this.updateCursors(null,t)}else n.prev.next=t,t.prev=n.prev,n.prev=t,t.next=n;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,n){return this.insert(Rn.createItem(t),n)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(Rn.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(Rn.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,n){return t.head===null?this:(n!=null?(this.updateCursors(n.prev,t.tail,n,t.head),n.prev!==null?(n.prev.next=t.head,t.head.prev=n.prev):this.head=t.head,n.prev=t.tail,t.tail.next=n):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,n){"head"in n?this.insertList(n,t):this.insert(n,t),this.remove(t)}};function tc(e,t){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
|
|
33
|
+
`)}})}var BE=100,_5=60,C5=" ";function HE({source:e,line:t,column:n},r){function o(u,d){return i.slice(u,d).map((f,h)=>String(u+h+1).padStart(l)+" |"+f).join(`
|
|
34
|
+
`)}const i=e.split(/\r\n?|\n|\f/),s=Math.max(1,t-r)-1,a=Math.min(t+r,i.length+1),l=Math.max(4,String(a).length)+1;let c=0;n+=3*(i[t-1].substr(0,n-1).match(/\t/g)||[]).length,n>BE&&(c=n-_5+3,n=58);for(let u=s;u<=a;u++)u>=0&&u<i.length&&(i[u]=i[u].replace(/\t/g,C5),i[u]=(c>0&&i[u].length>c?"…":"")+i[u].substr(c,98)+(i[u].length>c+BE-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join(`
|
|
35
|
+
`)}function FE(e,t,n,r,o){return Object.assign(tc("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment(i){return HE({source:t,line:r,column:o},isNaN(i)?0:i)},get formattedMessage(){return`Parse error: ${e}
|
|
36
|
+
`+HE({source:t,line:r,column:o},2)}})}function T5(e){const t=this.createList();let n=!1;const r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:n=!0,this.next();continue}let o=e.getNode.call(this,r);if(o===void 0)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,r),n=!1),t.push(o)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}var $E=()=>{},A5=33,k5=35,Zf=59,WE=123,qE=0;function L5(e){return function(){return this[e]()}}function Qf(e){const t=Object.create(null);for(const n in e){const r=e[n],o=r.parse||r;o&&(t[n]=o)}return t}function N5(e){const t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:Qf(e.atrule),pseudo:Qf(e.pseudo),node:Qf(e.node)};for(const n in e.parseContext)switch(typeof e.parseContext[n]){case"function":t.context[n]=e.parseContext[n];break;case"string":t.context[n]=L5(e.parseContext[n])}return{config:t,...t,...t.node}}function x5(e){let t="",n="<unknown>",r=!1,o=$E,i=!1;const s=new E5,a=Object.assign(new w5,N5(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:T5,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===WE?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===WE||c===Zf?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===A5||c===Zf?1:0},consumeUntilSemicolonIncluded(c){return c===Zf?2:0},createList(){return new je},createSingleNodeList(c){return new je().appendData(c)},getFirstListNode(c){return c&&c.first},getLastListNode(c){return c&&c.last},parseWithFallback(c,u){const d=this.tokenIndex;try{return c.call(this)}catch(f){if(i)throw f;const h=u.call(this,d);return i=!0,o(f,h),i=!1,h}},lookupNonWSType(c){let u;do if(u=this.lookupType(c++),u!==13)return u;while(u!==qE);return qE},charCodeAt(c){return c>=0&&c<t.length?t.charCodeAt(c):0},substring(c,u){return t.substring(c,u)},substrToCursor(c){return this.source.substring(c,this.tokenStart)},cmpChar(c,u){return ti(t,c,u)},cmpStr(c,u,d){return Os(t,c,u,d)},consume(c){const u=this.tokenStart;return this.eat(c),this.substrToCursor(u)},consumeFunctionName(){const c=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),c},consumeNumber(c){const u=t.substring(this.tokenStart,Ql(t,this.tokenStart));return this.eat(c),u},eat(c){if(this.tokenType!==c){const u=ME[c].slice(0,-6).replace(/-/g," ").replace(/^./,h=>h.toUpperCase());let d=`${/[[\](){}]/.test(u)?`"${u}"`:u} is expected`,f=this.tokenStart;switch(c){case 1:this.tokenType===2||this.tokenType===7?(f=this.tokenEnd-1,d="Identifier is expected but function found"):d="Identifier is expected";break;case 4:this.isDelim(k5)&&(this.next(),f++,d="Name is expected");break;case 11:this.tokenType===10&&(f=this.tokenEnd,d="Percent sign is expected")}this.error(d,f)}this.next()},eatIdent(c){(this.tokenType!==1||this.lookupValue(0,c)===!1)&&this.error(`Identifier "${c}" is expected`),this.next()},eatDelim(c){this.isDelim(c)||this.error(`Delim "${String.fromCharCode(c)}" is expected`),this.next()},getLocation(c,u){return r?s.getLocationRange(c,u,n):null},getLocationFromList(c){if(r){const u=this.getFirstListNode(c),d=this.getLastListNode(c);return s.getLocationRange(u!==null?u.loc.start.offset-s.startOffset:this.tokenStart,d!==null?d.loc.end.offset-s.startOffset:this.tokenStart,n)}return null},error(c,u){const d=typeof u<"u"&&u<t.length?s.getLocation(u):this.eof?s.getLocation(b5(t,t.length-1)):s.getLocation(this.tokenStart);throw new FE(c||"Unexpected input",t,d.offset,d.line,d.column)}});return Object.assign(function(c,u){t=c,u=u||{},a.setSource(t,ec),s.setSource(t,u.offset,u.line,u.column),n=u.filename||"<unknown>",r=!!u.positions,o=typeof u.onParseError=="function"?u.onParseError:$E,i=!1,a.parseAtrulePrelude="parseAtrulePrelude"in u?!!u.parseAtrulePrelude:!0,a.parseRulePrelude="parseRulePrelude"in u?!!u.parseRulePrelude:!0,a.parseValue="parseValue"in u?!!u.parseValue:!0,a.parseCustomProperty="parseCustomProperty"in u?!!u.parseCustomProperty:!1;const{context:d="default",onComment:f}=u;if(!(d in a.context))throw new Error("Unknown context `"+d+"`");typeof f=="function"&&a.forEachToken((m,p,v)=>{if(m===25){const w=a.getLocation(p,v),_=Os(t,v-2,v,"*/")?t.slice(p+2,v-2):t.slice(p+2,v);f(_,w)}});const h=a.context[d].call(a,u);return a.eof||a.error(),h},{SyntaxError:FE,config:a.config})}var O5=Sr((e=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(n){if(0<=n&&n<t.length)return t[n];throw new TypeError("Must be between 0 and 63: "+n)},e.decode=function(n){var r=65,o=90,i=97,s=122,a=48,l=57,c=43,u=47,d=26,f=52;return r<=n&&n<=o?n-r:i<=n&&n<=s?n-i+d:a<=n&&n<=l?n-a+f:n==c?62:n==u?63:-1}})),R5=Sr((e=>{var t=O5(),n=5,r=1<<n,o=r-1,i=r;function s(l){return l<0?(-l<<1)+1:(l<<1)+0}function a(l){var c=(l&1)===1,u=l>>1;return c?-u:u}e.encode=function(c){var u="",d,f=s(c);do d=f&o,f>>>=n,f>0&&(d|=i),u+=t.encode(d);while(f>0);return u},e.decode=function(c,u,d){var f=c.length,h=0,m=0,p,v;do{if(u>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(v=t.decode(c.charCodeAt(u++)),v===-1)throw new Error("Invalid base64 digit: "+c.charAt(u-1));p=!!(v&i),v&=o,h=h+(v<<m),m+=n}while(p);d.value=a(h),d.rest=u}})),Jf=Sr((e=>{function t(y,S,C){if(S in y)return y[S];if(arguments.length===3)return C;throw new Error('"'+S+'" is a required argument.')}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(y){var S=y.match(n);return S?{scheme:S[1],auth:S[2],host:S[3],port:S[4],path:S[5]}:null}e.urlParse=o;function i(y){var S="";return y.scheme&&(S+=y.scheme+":"),S+="//",y.auth&&(S+=y.auth+"@"),y.host&&(S+=y.host),y.port&&(S+=":"+y.port),y.path&&(S+=y.path),S}e.urlGenerate=i;var s=32;function a(y){var S=[];return function(C){for(var L=0;L<S.length;L++)if(S[L].input===C){var x=S[0];return S[0]=S[L],S[L]=x,S[0].result}var N=y(C);return S.unshift({input:C,result:N}),S.length>s&&S.pop(),N}}var l=a(function(S){var C=S,L=o(S);if(L){if(!L.path)return S;C=L.path}for(var x=e.isAbsolute(C),N=[],W=0,R=0;;)if(W=R,R=C.indexOf("/",W),R===-1){N.push(C.slice(W));break}else for(N.push(C.slice(W,R));R<C.length&&C[R]==="/";)R++;for(var P,J=0,R=N.length-1;R>=0;R--)P=N[R],P==="."?N.splice(R,1):P===".."?J++:J>0&&(P===""?(N.splice(R+1,J),J=0):(N.splice(R,2),J--));return C=N.join("/"),C===""&&(C=x?"/":"."),L?(L.path=C,i(L)):C});e.normalize=l;function c(y,S){y===""&&(y="."),S===""&&(S=".");var C=o(S),L=o(y);if(L&&(y=L.path||"/"),C&&!C.scheme)return L&&(C.scheme=L.scheme),i(C);if(C||S.match(r))return S;if(L&&!L.host&&!L.path)return L.host=S,i(L);var x=S.charAt(0)==="/"?S:l(y.replace(/\/+$/,"")+"/"+S);return L?(L.path=x,i(L)):x}e.join=c,e.isAbsolute=function(y){return y.charAt(0)==="/"||n.test(y)};function u(y,S){y===""&&(y="."),y=y.replace(/\/$/,"");for(var C=0;S.indexOf(y+"/")!==0;){var L=y.lastIndexOf("/");if(L<0||(y=y.slice(0,L),y.match(/^([^\/]+:\/)?\/*$/)))return S;++C}return Array(C+1).join("../")+S.substr(y.length+1)}e.relative=u;var d=(function(){return!("__proto__"in Object.create(null))})();function f(y){return y}function h(y){return p(y)?"$"+y:y}e.toSetString=d?f:h;function m(y){return p(y)?y.slice(1):y}e.fromSetString=d?f:m;function p(y){if(!y)return!1;var S=y.length;if(S<9||y.charCodeAt(S-1)!==95||y.charCodeAt(S-2)!==95||y.charCodeAt(S-3)!==111||y.charCodeAt(S-4)!==116||y.charCodeAt(S-5)!==111||y.charCodeAt(S-6)!==114||y.charCodeAt(S-7)!==112||y.charCodeAt(S-8)!==95||y.charCodeAt(S-9)!==95)return!1;for(var C=S-10;C>=0;C--)if(y.charCodeAt(C)!==36)return!1;return!0}function v(y,S,C){var L=b(y.source,S.source);return L!==0||(L=y.originalLine-S.originalLine,L!==0)||(L=y.originalColumn-S.originalColumn,L!==0||C)||(L=y.generatedColumn-S.generatedColumn,L!==0)||(L=y.generatedLine-S.generatedLine,L!==0)?L:b(y.name,S.name)}e.compareByOriginalPositions=v;function w(y,S,C){var L=y.originalLine-S.originalLine;return L!==0||(L=y.originalColumn-S.originalColumn,L!==0||C)||(L=y.generatedColumn-S.generatedColumn,L!==0)||(L=y.generatedLine-S.generatedLine,L!==0)?L:b(y.name,S.name)}e.compareByOriginalPositionsNoSource=w;function _(y,S,C){var L=y.generatedLine-S.generatedLine;return L!==0||(L=y.generatedColumn-S.generatedColumn,L!==0||C)||(L=b(y.source,S.source),L!==0)||(L=y.originalLine-S.originalLine,L!==0)||(L=y.originalColumn-S.originalColumn,L!==0)?L:b(y.name,S.name)}e.compareByGeneratedPositionsDeflated=_;function A(y,S,C){var L=y.generatedColumn-S.generatedColumn;return L!==0||C||(L=b(y.source,S.source),L!==0)||(L=y.originalLine-S.originalLine,L!==0)||(L=y.originalColumn-S.originalColumn,L!==0)?L:b(y.name,S.name)}e.compareByGeneratedPositionsDeflatedNoLine=A;function b(y,S){return y===S?0:y===null?1:S===null?-1:y>S?1:-1}function g(y,S){var C=y.generatedLine-S.generatedLine;return C!==0||(C=y.generatedColumn-S.generatedColumn,C!==0)||(C=b(y.source,S.source),C!==0)||(C=y.originalLine-S.originalLine,C!==0)||(C=y.originalColumn-S.originalColumn,C!==0)?C:b(y.name,S.name)}e.compareByGeneratedPositionsInflated=g;function E(y){return JSON.parse(y.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=E;function T(y,S,C){if(S=S||"",y&&(y[y.length-1]!=="/"&&S[0]!=="/"&&(y+="/"),S=y+S),C){var L=o(C);if(!L)throw new Error("sourceMapURL could not be parsed");if(L.path){var x=L.path.lastIndexOf("/");x>=0&&(L.path=L.path.substring(0,x+1))}S=c(i(L),S)}return l(S)}e.computeSourceURL=T})),M5=Sr((e=>{var t=Jf(),n=Object.prototype.hasOwnProperty,r=typeof Map<"u";function o(){this._array=[],this._set=r?new Map:Object.create(null)}o.fromArray=function(s,a){for(var l=new o,c=0,u=s.length;c<u;c++)l.add(s[c],a);return l},o.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},o.prototype.add=function(s,a){var l=r?s:t.toSetString(s),c=r?this.has(s):n.call(this._set,l),u=this._array.length;(!c||a)&&this._array.push(s),c||(r?this._set.set(s,u):this._set[l]=u)},o.prototype.has=function(s){if(r)return this._set.has(s);var a=t.toSetString(s);return n.call(this._set,a)},o.prototype.indexOf=function(s){if(r){var a=this._set.get(s);if(a>=0)return a}else{var l=t.toSetString(s);if(n.call(this._set,l))return this._set[l]}throw new Error('"'+s+'" is not in the set.')},o.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)},o.prototype.toArray=function(){return this._array.slice()},e.ArraySet=o})),P5=Sr((e=>{var t=Jf();function n(o,i){var s=o.generatedLine,a=i.generatedLine,l=o.generatedColumn,c=i.generatedColumn;return a>s||a==s&&c>=l||t.compareByGeneratedPositionsInflated(o,i)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(i,s){this._array.forEach(i,s)},r.prototype.add=function(i){n(this._last,i)?(this._last=i,this._array.push(i)):(this._sorted=!1,this._array.push(i))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=r})),I5=Sr((e=>{var t=R5(),n=Jf(),r=M5().ArraySet,o=P5().MappingList;function i(s){s||(s={}),this._file=n.getArg(s,"file",null),this._sourceRoot=n.getArg(s,"sourceRoot",null),this._skipValidation=n.getArg(s,"skipValidation",!1),this._ignoreInvalidMapping=n.getArg(s,"ignoreInvalidMapping",!1),this._sources=new r,this._names=new r,this._mappings=new o,this._sourcesContents=null}i.prototype._version=3,i.fromSourceMap=function(a,l){var c=a.sourceRoot,u=new i(Object.assign(l||{},{file:a.file,sourceRoot:c}));return a.eachMapping(function(d){var f={generated:{line:d.generatedLine,column:d.generatedColumn}};d.source!=null&&(f.source=d.source,c!=null&&(f.source=n.relative(c,f.source)),f.original={line:d.originalLine,column:d.originalColumn},d.name!=null&&(f.name=d.name)),u.addMapping(f)}),a.sources.forEach(function(d){var f=d;c!==null&&(f=n.relative(c,d)),u._sources.has(f)||u._sources.add(f);var h=a.sourceContentFor(d);h!=null&&u.setSourceContent(d,h)}),u},i.prototype.addMapping=function(a){var l=n.getArg(a,"generated"),c=n.getArg(a,"original",null),u=n.getArg(a,"source",null),d=n.getArg(a,"name",null);!this._skipValidation&&this._validateMapping(l,c,u,d)===!1||(u!=null&&(u=String(u),this._sources.has(u)||this._sources.add(u)),d!=null&&(d=String(d),this._names.has(d)||this._names.add(d)),this._mappings.add({generatedLine:l.line,generatedColumn:l.column,originalLine:c!=null&&c.line,originalColumn:c!=null&&c.column,source:u,name:d}))},i.prototype.setSourceContent=function(a,l){var c=a;this._sourceRoot!=null&&(c=n.relative(this._sourceRoot,c)),l!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[n.toSetString(c)]=l):this._sourcesContents&&(delete this._sourcesContents[n.toSetString(c)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},i.prototype.applySourceMap=function(a,l,c){var u=l;if(l==null){if(a.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);u=a.file}var d=this._sourceRoot;d!=null&&(u=n.relative(d,u));var f=new r,h=new r;this._mappings.unsortedForEach(function(m){if(m.source===u&&m.originalLine!=null){var p=a.originalPositionFor({line:m.originalLine,column:m.originalColumn});p.source!=null&&(m.source=p.source,c!=null&&(m.source=n.join(c,m.source)),d!=null&&(m.source=n.relative(d,m.source)),m.originalLine=p.line,m.originalColumn=p.column,p.name!=null&&(m.name=p.name))}var v=m.source;v!=null&&!f.has(v)&&f.add(v);var w=m.name;w!=null&&!h.has(w)&&h.add(w)},this),this._sources=f,this._names=h,a.sources.forEach(function(m){var p=a.sourceContentFor(m);p!=null&&(c!=null&&(m=n.join(c,m)),d!=null&&(m=n.relative(d,m)),this.setSourceContent(m,p))},this)},i.prototype._validateMapping=function(a,l,c,u){if(l&&typeof l.line!="number"&&typeof l.column!="number"){var d="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return!1;throw new Error(d)}if(!(a&&"line"in a&&"column"in a&&a.line>0&&a.column>=0&&!l&&!c&&!u)){if(a&&"line"in a&&"column"in a&&l&&"line"in l&&"column"in l&&a.line>0&&a.column>=0&&l.line>0&&l.column>=0&&c)return;var d="Invalid mapping: "+JSON.stringify({generated:a,source:c,original:l,name:u});if(this._ignoreInvalidMapping)return!1;throw new Error(d)}},i.prototype._serializeMappings=function(){for(var a=0,l=1,c=0,u=0,d=0,f=0,h="",m,p,v,w,_=this._mappings.toArray(),A=0,b=_.length;A<b;A++){if(p=_[A],m="",p.generatedLine!==l)for(a=0;p.generatedLine!==l;)m+=";",l++;else if(A>0){if(!n.compareByGeneratedPositionsInflated(p,_[A-1]))continue;m+=","}m+=t.encode(p.generatedColumn-a),a=p.generatedColumn,p.source!=null&&(w=this._sources.indexOf(p.source),m+=t.encode(w-f),f=w,m+=t.encode(p.originalLine-1-u),u=p.originalLine-1,m+=t.encode(p.originalColumn-c),c=p.originalColumn,p.name!=null&&(v=this._names.indexOf(p.name),m+=t.encode(v-d),d=v)),h+=m}return h},i.prototype._generateSourcesContent=function(a,l){return a.map(function(c){if(!this._sourcesContents)return null;l!=null&&(c=n.relative(l,c));var u=n.toSetString(c);return Object.prototype.hasOwnProperty.call(this._sourcesContents,u)?this._sourcesContents[u]:null},this)},i.prototype.toJSON=function(){var a={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(a.file=this._file),this._sourceRoot!=null&&(a.sourceRoot=this._sourceRoot),this._sourcesContents&&(a.sourcesContent=this._generateSourcesContent(a.sources,a.sourceRoot)),a},i.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=i})),D5=I5(),zE=new Set(["Atrule","Selector","Declaration"]);function B5(e){const t=new D5.SourceMapGenerator,n={line:1,column:0},r={line:0,column:0},o={line:1,column:0},i={generated:o};let s=1,a=0,l=!1;const c=e.node;e.node=function(f){if(f.loc&&f.loc.start&&zE.has(f.type)){const h=f.loc.start.line,m=f.loc.start.column-1;(r.line!==h||r.column!==m)&&(r.line=h,r.column=m,n.line=s,n.column=a,l&&(l=!1,(n.line!==o.line||n.column!==o.column)&&t.addMapping(i)),l=!0,t.addMapping({source:f.loc.source,original:r,generated:n}))}c.call(this,f),l&&zE.has(f.type)&&(o.line=s,o.column=a)};const u=e.emit;e.emit=function(f,h,m){for(let p=0;p<f.length;p++)f.charCodeAt(p)===10?(s++,a=0):a++;u(f,h,m)};const d=e.result;return e.result=function(){return l&&t.addMapping(i),{css:d(),map:t}},e}var UE=ie({safe:()=>GE,spec:()=>W5}),H5=43,F5=45,em=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},jE=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],$5=jE.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function VE(e){const t=new Set(e.map(([n,r])=>em(n)<<16|em(r)));return function(n,r,o){const i=em(r,o),s=o.charCodeAt(0);return(s===F5&&r!==1&&r!==2&&r!==15||s===H5?t.has(n<<16|s<<8):t.has(n<<16|i))&&this.emit(" ",13,!0),i}}var W5=VE(jE),GE=VE($5),q5=92;function z5(e,t){if(typeof t=="function"){let n=null;e.children.forEach(r=>{n!==null&&t.call(this,n),this.node(r),n=r});return}e.children.forEach(this.node,this)}function U5(e){ec(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function j5(e){const t=new Map;for(let n in e.node){const r=e.node[n];typeof(r.generate||r)=="function"&&t.set(n,r.generate||r)}return function(n,r){let o="",i=0,s={node(l){if(t.has(l.type))t.get(l.type).call(a,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:GE,token(l,c){i=this.tokenBefore(i,l,c),this.emit(c,l,!1),l===9&&c.charCodeAt(0)===q5&&this.emit(`
|
|
37
|
+
`,13,!0)},emit(l){o+=l},result(){return o}};r&&(typeof r.decorator=="function"&&(s=r.decorator(s)),r.sourceMap&&(s=B5(s)),r.mode in UE&&(s.tokenBefore=UE[r.mode]));const a={node:l=>s.node(l),children:z5,token:(l,c)=>s.token(l,c),tokenize:U5};return s.node(n),s.result()}}function V5(e){return{fromPlainObject(t){return e(t,{enter(n){n.children&&!(n.children instanceof je)&&(n.children=new je().fromArray(n.children))}}),t},toPlainObject(t){return e(t,{leave(n){n.children&&n.children instanceof je&&(n.children=n.children.toArray())}}),t}}}var{hasOwnProperty:tm}=Object.prototype,Rs=function(){};function XE(e){return typeof e=="function"?e:Rs}function KE(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function G5(e,t){const n=t.structure,r=[];for(const o in n){if(tm.call(n,o)===!1)continue;let i=n[o];const s={name:o,type:!1,nullable:!1};Array.isArray(i)||(i=[i]);for(const a of i)a===null?s.nullable=!0:typeof a=="string"?s.type="node":Array.isArray(a)&&(s.type="list");s.type&&r.push(s)}return r.length?{context:t.walkContext,fields:r}:null}function X5(e){const t={};for(const n in e.node)if(tm.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=G5(n,r)}return t}function YE(e,t){const n=e.fields.slice(),r=e.context,o=typeof r=="string";return t&&n.reverse(),function(i,s,a,l){let c;o&&(c=s[r],s[r]=i);for(const u of n){const d=i[u.name];if(!u.nullable||d){if(u.type==="list"){if(t?d.reduceRight(l,!1):d.reduce(l,!1))return!0}else if(a(d))return!0}}o&&(s[r]=c)}}function ZE({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}}}function K5(e){const t=X5(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const c in t)tm.call(t,c)&&t[c]!==null&&(n[c]=YE(t[c],!1),r[c]=YE(t[c],!0));const s=ZE(n),a=ZE(r),l=function(c,u){function d(w,_,A){const b=f.call(v,w,_,A);return b===o?!0:b===i?!1:!!(m.hasOwnProperty(w.type)&&m[w.type](w,v,d,p)||h.call(v,w,_,A)===o)}let f=Rs,h=Rs,m=n,p=(w,_,A,b)=>w||d(_,A,b);const v={break:o,skip:i,root:c,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof u=="function")f=u;else if(u&&(f=XE(u.enter),h=XE(u.leave),u.reverse&&(m=r),u.visit)){if(s.hasOwnProperty(u.visit))m=u.reverse?a[u.visit]:s[u.visit];else if(!t.hasOwnProperty(u.visit))throw new Error("Bad value `"+u.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");f=KE(f,u.visit),h=KE(h,u.visit)}if(f===Rs&&h===Rs)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");d(c)};return l.break=o,l.skip=i,l.find=function(c,u){let d=null;return l(c,function(f,h,m){if(u.call(this,f,h,m))return d=f,o}),d},l.findLast=function(c,u){let d=null;return l(c,{reverse:!0,enter(f,h,m){if(u.call(this,f,h,m))return d=f,o}}),d},l.findAll=function(c,u){const d=[];return l(c,function(f,h,m){u.call(this,f,h,m)&&d.push(f)}),d},l}function Y5(e){return e}function Z5(e){const{min:t,max:n,comma:r}=e;return t===0&&n===0?r?"#?":"*":t===0&&n===1?"?":t===1&&n===0?r?"#":"+":t===1&&n===1?"":(r?"#":"")+(t===n?"{"+t+"}":"{"+t+","+(n!==0?n:"")+"}")}function Q5(e){if(e.type==="Range")return" ["+(e.min===null?"-∞":e.min)+","+(e.max===null?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}function J5(e,t,n,r){const o=e.combinator===" "||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>nm(s,t,n,r)).join(o);return e.explicit||n?(r||i[0]===","?"[":"[ ")+i+(r?"]":" ]"):i}function nm(e,t,n,r){let o;switch(e.type){case"Group":o=J5(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return nm(e.term,t,n,r)+t(Z5(e),e);case"Type":o="<"+e.name+(e.opts?t(Q5(e.opts),e.opts):"")+">";break;case"Property":o="<'"+e.name+"'>";break;case"Keyword":o=e.name;break;case"AtKeyword":o="@"+e.name;break;case"Function":o=e.name+"(";break;case"String":case"Token":o=e.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(o,e)}function rm(e,t){let n=Y5,r=!1,o=!1;return typeof t=="function"?n=t:t&&(r=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(n=t.decorate)),nm(e,n,r,o)}var QE={offset:0,line:1,column:1};function eD(e,t){const n=e.tokens,r=e.longestMatch,o=r<n.length&&n[r].node||null,i=o!==t?o:null;let s=0,a=0,l=0,c="",u,d;for(let f=0;f<n.length;f++){const h=n[f].value;f===r&&(a=h.length,s=c.length),i!==null&&n[f].node===i&&(f<=r?l++:l=0),c+=h}return r===n.length||l>1?(u=nc(i||t,"end")||Ms(QE,c),d=Ms(u)):(u=nc(i,"start")||Ms(nc(t,"start")||QE,c.slice(0,s)),d=nc(i,"end")||Ms(u,c.substr(s,a))),{css:c,mismatchOffset:s,mismatchLength:a,start:u,end:d}}function nc(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?Ms(n):n:null}function Ms({offset:e,line:t,column:n},r){const o={offset:e,line:t,column:n};if(r){const i=r.split(/\n|\r\n?|\f/);o.offset+=r.length,o.line+=i.length-1,o.column=i.length===1?o.column+r.length:i.pop().length+1}return o}var Ps=function(e,t){const n=tc("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},tD=function(e,t,n,r){const o=tc("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:a,start:l,end:c}=eD(r,n);return o.rawMessage=e,o.syntax=t?rm(t):"<generic>",o.css=i,o.mismatchOffset=s,o.mismatchLength=a,o.message=e+`
|
|
38
|
+
syntax: `+o.syntax+`
|
|
39
|
+
value: `+(i||"<empty string>")+`
|
|
40
|
+
--------`+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,l),o.loc={source:n&&n.loc&&n.loc.source||"<unknown>",start:l,end:c},o},rc=new Map,oi=new Map,oc=45,En=nD,ii=rD;function om(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===oc&&e.charCodeAt(t+1)===oc}function JE(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===oc&&e.charCodeAt(t+1)!==oc){const n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function nD(e){if(rc.has(e))return rc.get(e);const t=e.toLowerCase();let n=rc.get(t);if(n===void 0){const r=om(t,0),o=r?"":JE(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return rc.set(e,n),n}function rD(e){if(oi.has(e))return oi.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");const r=om(t,n.length);if(!r&&(t=t.toLowerCase(),oi.has(t))){const a=oi.get(t);return oi.set(e,a),a}const o=r?"":JE(t,n.length),i=t.substr(0,n.length+o.length),s=Object.freeze({basename:t.substr(i.length),name:t.substr(n.length),hack:n,vendor:o,prefix:i,custom:r});return oi.set(e,s),s}var eS=["initial","inherit","unset","revert","revert-layer"],Is=43,Hn=45,im=110,si=!0,oD=!1;function sm(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Ds(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function Mr(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(o===Is||o===Hn){if(n)return 0;t++}for(;t<e.value.length;t++)if(!mt(e.value.charCodeAt(t)))return 0;return r+1}function am(e,t,n){let r=!1,o=Ds(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(sm(e,Is)||sm(e,Hn)){if(r=!0,o=Ds(n(++o),o,n),e=n(o),e===null||e.type!==10)return 0}else return t;if(!r){const i=e.value.charCodeAt(0);if(i!==Is&&i!==Hn)return 0}return Mr(e,r?0:1,r,o)}function iD(e,t){let n=0;if(!e)return 0;if(e.type===10)return Mr(e,0,oD,n);if(e.type===1&&e.value.charCodeAt(0)===Hn){if(!ti(e.value,1,im))return 0;switch(e.value.length){case 2:return am(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==Hn?0:(n=Ds(t(++n),n,t),e=t(n),Mr(e,0,si,n));default:return e.value.charCodeAt(2)!==Hn?0:Mr(e,3,si,n)}}else if(e.type===1||sm(e,Is)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!ti(e.value,0,im))return 0;switch(e.value.length){case 1:return am(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==Hn?0:(n=Ds(t(++n),n,t),e=t(n),Mr(e,0,si,n));default:return e.value.charCodeAt(1)!==Hn?0:Mr(e,2,si,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===Is||r===Hn?1:0,i=o;for(;i<e.value.length&&mt(e.value.charCodeAt(i));i++);return i===o||!ti(e.value,i,im)?0:i+1===e.value.length?am(t(++n),n,t):e.value.charCodeAt(i+1)!==Hn?0:i+2===e.value.length?(n=Ds(t(++n),n,t),e=t(n),Mr(e,0,si,n)):Mr(e,i+2,si,n)}return 0}var sD=43,tS=45,nS=63,aD=117;function lm(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function lD(e,t){return e.value.charCodeAt(0)===t}function Bs(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(i===tS&&n&&r!==0)return Bs(e,t+r+1,!1),6;if(!Or(i)||++r>6)return 0}return r}function ic(e,t,n){if(!e)return 0;for(;lm(n(t),nS);){if(++e>6)return 0;t++}return t}function cD(e,t){let n=0;if(e===null||e.type!==1||!ti(e.value,0,aD)||(e=t(++n),e===null))return 0;if(lm(e,sD))return e=t(++n),e===null?0:e.type===1?ic(Bs(e,0,!0),++n,t):lm(e,nS)?ic(1,++n,t):0;if(e.type===10){const r=Bs(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!lD(e,tS)||!Bs(e,1,!1)?0:n+1:ic(r,n,t))}return e.type===12?ic(Bs(e,1,!0),++n,t):0}var uD=["calc(","-moz-calc(","-webkit-calc("],cm=new Map([[2,22],[21,22],[19,20],[23,24]]),dD=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],fD=["deg","grad","rad","turn"],mD=["s","ms"],hD=["hz","khz"],pD=["dpi","dpcm","dppx","x"],gD=["fr"],bD=["db"],yD=["st"];function Sn(e,t){return t<e.length?e.charCodeAt(t):0}function rS(e,t){return Os(e,0,e.length,t)}function oS(e,t){for(let n=0;n<t.length;n++)if(rS(e,t[n]))return!0;return!1}function iS(e,t){return t!==e.length-2?!1:Sn(e,t)===92&&mt(Sn(e,t+1))}function sc(e,t,n){if(e&&e.type==="Range"){const r=Number(n!==void 0&&n!==t.length?t.substr(0,n):t);if(isNaN(r)||e.min!==null&&r<e.min&&typeof e.min!="string"||e.max!==null&&r>e.max&&typeof e.max!="string")return!0}return!1}function vD(e,t){let n=0,r=[],o=0;e:do{switch(e.type){case 24:case 22:case 20:if(e.type!==n)break e;if(n=r.pop(),r.length===0){o++;break e}break;case 2:case 21:case 19:case 23:r.push(n),n=cm.get(e.type)}o++}while(e=t(o));return o}function sn(e){return function(t,n,r){return t===null?0:t.type===2&&oS(t.value,uD)?vD(t,n):e(t,n,r)}}function Me(e){return function(t){return t===null||t.type!==e?0:1}}function ED(e){if(e===null||e.type!==1)return 0;const t=e.value.toLowerCase();return oS(t,eS)||rS(t,"default")?0:1}function SD(e){return e===null||e.type!==1||Sn(e.value,0)!==45||Sn(e.value,1)!==45?0:1}function wD(e){if(e===null||e.type!==4)return 0;const t=e.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let n=1;n<t;n++)if(!Or(Sn(e.value,n)))return 0;return 1}function _D(e){return e===null||e.type!==4||!Kl(Sn(e.value,1),Sn(e.value,2),Sn(e.value,3))?0:1}function CD(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==n)break e;n=r.pop();break;case 17:if(n===0)break e;break;case 9:if(n===0&&e.value==="!")break e;break;case 2:case 21:case 19:case 23:r.push(n),n=cm.get(e.type)}o++}while(e=t(o));return o}function TD(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==n)break e;n=r.pop();break;case 2:case 21:case 19:case 23:r.push(n),n=cm.get(e.type)}o++}while(e=t(o));return o}function ur(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;const o=Ql(t.value,0);if(e!==null){const i=t.value.indexOf("\\",o),s=i===-1||!iS(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return sc(r,t.value,o)?0:1}}function AD(e,t,n){return e===null||e.type!==11||sc(n,e.value,e.value.length-1)?0:1}function sS(e){return typeof e!="function"&&(e=function(){return 0}),function(t,n,r){return t!==null&&t.type===10&&Number(t.value)===0?1:e(t,n,r)}}function kD(e,t,n){if(e===null)return 0;const r=Ql(e.value,0);return r!==e.value.length&&!iS(e.value,r)||sc(n,e.value,r)?0:1}function LD(e,t,n){if(e===null||e.type!==10)return 0;let r=Sn(e.value,0)===43||Sn(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!mt(Sn(e.value,r)))return 0;return sc(n,e.value,r)?0:1}var aS={"ident-token":Me(1),"function-token":Me(2),"at-keyword-token":Me(3),"hash-token":Me(4),"string-token":Me(5),"bad-string-token":Me(6),"url-token":Me(7),"bad-url-token":Me(8),"delim-token":Me(9),"number-token":Me(10),"percentage-token":Me(11),"dimension-token":Me(12),"whitespace-token":Me(13),"CDO-token":Me(14),"CDC-token":Me(15),"colon-token":Me(16),"semicolon-token":Me(17),"comma-token":Me(18),"[-token":Me(19),"]-token":Me(20),"(-token":Me(21),")-token":Me(22),"{-token":Me(23),"}-token":Me(24),string:Me(5),ident:Me(1),"custom-ident":ED,"custom-property-name":SD,"hex-color":wD,"id-selector":_D,"an-plus-b":iD,urange:cD,"declaration-value":CD,"any-value":TD,dimension:sn(ur(null)),angle:sn(ur(fD)),decibel:sn(ur(bD)),frequency:sn(ur(hD)),flex:sn(ur(gD)),length:sn(sS(ur(dD))),resolution:sn(ur(pD)),semitones:sn(ur(yD)),time:sn(ur(mD)),percentage:sn(AD),zero:sS(),number:sn(kD),integer:sn(LD)};function ND(e,t,n){return Object.assign(tc("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
|
|
41
|
+
`+t+`
|
|
42
|
+
--`+new Array((n||t.length)+1).join("-")+"^"})}var xD=9,OD=10,RD=12,MD=13,PD=32,ID=class{constructor(e){this.str=e,this.pos=0}charCodeAt(e){return e<this.str.length?this.str.charCodeAt(e):0}charCode(){return this.charCodeAt(this.pos)}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(e){return this.charCodeAt(this.findWsEnd(e))}findWsEnd(e){for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(t!==MD&&t!==OD&&t!==RD&&t!==PD&&t!==xD)break}return e}substringToPos(e){return this.str.substring(this.pos,this.pos=e)}eat(e){this.charCode()!==e&&this.error("Expect `"+String.fromCharCode(e)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(e){throw new ND(e,this.str,this.pos)}},DD=9,BD=10,HD=12,FD=13,$D=32,lS=33,um=35,cS=38,ac=39,uS=40,WD=41,dS=42,dm=43,fm=44,fS=45,mm=60,mS=62,hm=63,qD=64,lc=91,pm=93,cc=123,hS=124,pS=125,gS=8734,Hs=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),bS={" ":1,"&&":2,"||":3,"|":4};function uc(e){return e.substringToPos(e.findWsEnd(e.pos))}function ai(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||Hs[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function dc(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n<48||n>57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function zD(e){const t=e.str.indexOf("'",e.pos+1);return t===-1&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function yS(e){let t=null,n=null;return e.eat(cc),t=dc(e),e.charCode()===fm?(e.pos++,e.charCode()!==pS&&(n=dc(e))):n=t,e.eat(pS),{min:Number(t),max:n?Number(n):0}}function UD(e){let t=null,n=!1;switch(e.charCode()){case dS:e.pos++,t={min:0,max:0};break;case dm:e.pos++,t={min:1,max:0};break;case hm:e.pos++,t={min:0,max:1};break;case um:e.pos++,n=!0,e.charCode()===cc?t=yS(e):e.charCode()===hm?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case cc:t=yS(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function li(e,t){const n=UD(e);return n!==null?(n.term=t,e.charCode()===um&&e.charCodeAt(e.pos-1)===dm?li(e,n):n):t}function gm(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function jD(e){let t;return e.eat(mm),e.eat(ac),t=ai(e),e.eat(ac),e.eat(mS),li(e,{type:"Property",name:t})}function VD(e){let t=null,n=null,r=1;return e.eat(lc),e.charCode()===fS&&(e.peek(),r=-1),r==-1&&e.charCode()===gS?e.peek():(t=r*Number(dc(e)),Hs[e.charCode()]!==0&&(t+=ai(e))),uc(e),e.eat(fm),uc(e),e.charCode()===gS?e.peek():(r=1,e.charCode()===fS&&(e.peek(),r=-1),n=r*Number(dc(e)),Hs[e.charCode()]!==0&&(n+=ai(e))),e.eat(pm),{type:"Range",min:t,max:n}}function GD(e){let t,n=null;return e.eat(mm),t=ai(e),e.charCode()===uS&&e.nextCharCode()===WD&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===lc&&(uc(e),n=VD(e)),e.eat(mS),li(e,{type:"Type",name:t,opts:n})}function XD(e){const t=ai(e);return e.charCode()===uS?(e.pos++,{type:"Function",name:t}):li(e,{type:"Keyword",name:t})}function KD(e,t){function n(o,i){return{type:"Group",terms:o,combinator:i,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort((o,i)=>bS[o]-bS[i]);t.length>0;){r=t.shift();let o=0,i=0;for(;o<e.length;o++){const s=e[o];s.type==="Combinator"&&(s.value===r?(i===-1&&(i=o-1),e.splice(o,1),o--):(i!==-1&&o-i>1&&(e.splice(i,o-i,n(e.slice(i,o),r)),o=i+1),i=-1))}i!==-1&&t.length&&e.splice(i,o-i,n(e.slice(i,o),r))}return r}function vS(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=ZD(e);)r.type!=="Spaces"&&(r.type==="Combinator"?((o===null||o.type==="Combinator")&&(e.pos=i,e.error("Unexpected combinator")),n[r.value]=!0):o!==null&&o.type!=="Combinator"&&(n[" "]=!0,t.push({type:"Combinator",value:" "})),t.push(r),o=r,i=e.pos);return o!==null&&o.type==="Combinator"&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:t,combinator:KD(t,n)||" ",disallowEmpty:!1,explicit:!1}}function YD(e){let t;return e.eat(lc),t=vS(e),e.eat(pm),t.explicit=!0,e.charCode()===lS&&(e.pos++,t.disallowEmpty=!0),t}function ZD(e){let t=e.charCode();if(t<128&&Hs[t]===1)return XD(e);switch(t){case pm:break;case lc:return li(e,YD(e));case mm:return e.nextCharCode()===ac?jD(e):GD(e);case hS:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===hS?2:1))};case cS:return e.pos++,e.eat(cS),{type:"Combinator",value:"&&"};case fm:return e.pos++,{type:"Comma"};case ac:return li(e,{type:"String",value:zD(e)});case $D:case DD:case BD:case FD:case HD:return{type:"Spaces",value:uc(e)};case qD:return t=e.nextCharCode(),t<128&&Hs[t]===1?(e.pos++,{type:"AtKeyword",name:ai(e)}):gm(e);case dS:case dm:case hm:case um:case lS:break;case cc:if(t=e.nextCharCode(),t<48||t>57)return gm(e);break;default:return gm(e)}}function ES(e){const t=new ID(e),n=vS(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var Fs=function(){};function SS(e){return typeof e=="function"?e:Fs}function QD(e,t,n){function r(s){switch(o.call(n,s),s.type){case"Group":s.terms.forEach(r);break;case"Multiplier":r(s.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+s.type)}i.call(n,s)}let o=Fs,i=Fs;if(typeof t=="function"?o=t:t&&(o=SS(t.enter),i=SS(t.leave)),o===Fs&&i===Fs)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var JD={decorator(e){const t=[];let n=null;return{...e,node(r){const o=n;n=r,e.node.call(this,r),n=o},emit(r,o,i){t.push({type:o,value:r,node:i?null:n})},result(){return t}}}};function e3(e){const t=[];return ec(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function t3(e,t){return typeof e=="string"?e3(e):t.generate(e,JD)}var we={type:"Match"},Ae={type:"Mismatch"},bm={type:"DisallowEmpty"},n3=40,r3=41;function vt(e,t,n){return t===we&&n===Ae||e===we&&t===we&&n===we?e:(e.type==="If"&&e.else===Ae&&t===we&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function wS(e){return e.length>2&&e.charCodeAt(e.length-2)===n3&&e.charCodeAt(e.length-1)===r3}function _S(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&wS(e.name)}function ym(e,t,n){switch(e){case" ":{let r=we;for(let o=t.length-1;o>=0;o--){const i=t[o];r=vt(i,r,Ae)}return r}case"|":{let r=Ae,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(_S(s)&&(o===null&&i>0&&_S(t[i-1])&&(o=Object.create(null),r=vt({type:"Enum",map:o},we,r)),o!==null)){const a=(wS(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=vt(s,we,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=Ae;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=ym(e,t.filter(function(a){return a!==i}),!1):s=we,r=vt(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?we:Ae;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=ym(e,t.filter(function(a){return a!==i}),!0):s=we,r=vt(i,s,r)}return r}}}function o3(e){let t=we,n=vm(e.term);if(e.max===0)n=vt(n,bm,Ae),t=vt(n,null,Ae),t.then=vt(we,we,t),e.comma&&(t.then.else=vt({type:"Comma",syntax:e},t,Ae));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==we&&(t=vt({type:"Comma",syntax:e},t,Ae)),t=vt(n,vt(we,we,t),Ae);if(e.min===0)t=vt(we,we,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==we&&(t=vt({type:"Comma",syntax:e},t,Ae)),t=vt(n,t,Ae);return t}function vm(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=ym(e.combinator,e.terms.map(vm),!1);return e.disallowEmpty&&(t=vt(t,bm,Ae)),t}case"Multiplier":return o3(e);case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return e.value.length===3?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function Em(e,t){return typeof e=="string"&&(e=ES(e)),{type:"MatchGraph",match:vm(e),syntax:t||null,source:e}}var{hasOwnProperty:CS}=Object.prototype,i3=0,s3=1,Sm=2,TS=3,AS="Match",a3="Mismatch",l3="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",c3=15e3,u3=0;function d3(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function wm(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=t.charCodeAt(n);let o=e.charCodeAt(n);if(o>=65&&o<=90&&(o=o|32),o!==r)return!1}return!0}function f3(e){return e.type!==9?!1:e.value!=="?"}function kS(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||f3(e)}function LS(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function m3(e,t,n){function r(){do _++,w=_<e.length?e[_]:null;while(w!==null&&(w.type===13||w.type===25))}function o(g){const E=_+g;return E<e.length?e[E]:null}function i(g,E){return{nextState:g,matchStack:b,syntaxStack:d,thenStack:f,tokenIndex:_,prev:E}}function s(g){f={nextState:g,matchStack:b,syntaxStack:d,prev:f}}function a(g){h=i(g,h)}function l(){b={type:s3,syntax:t.syntax,token:w,prev:b},r(),m=null,_>A&&(A=_)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},b={type:Sm,syntax:t.syntax,token:b.token,prev:b}}function u(){b.type===Sm?b=b.prev:b={type:TS,syntax:d.syntax,token:b.token,prev:b},d=d.prev}let d=null,f=null,h=null,m=null,p=0,v=null,w=null,_=-1,A=0,b={type:i3,syntax:null,token:null,prev:null};for(r();v===null&&++p<c3;)switch(t.type){case"Match":if(f===null){if(w!==null&&(_!==e.length-1||w.value!=="\\0"&&w.value!=="\\9")){t=Ae;break}v=AS;break}if(t=f.nextState,t===bm)if(f.matchStack===b){t=Ae;break}else t=we;for(;f.syntaxStack!==d;)u();f=f.prev;break;case"Mismatch":if(m!==null&&m!==!1)(h===null||_>h.tokenIndex)&&(h=m,m=!1);else if(h===null){v=a3;break}t=h.nextState,f=h.thenStack,d=h.syntaxStack,b=h.matchStack,_=h.tokenIndex,w=_<e.length?e[_]:null,h=h.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==Ae&&a(t.else),t.then!==we&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const T=t.syntax.terms;if(t.index===T.length){if(t.mask===0||t.syntax.all){t=Ae;break}t=we;break}if(t.mask===(1<<T.length)-1){t=we;break}for(;t.index<T.length;t.index++){const y=1<<t.index;if((t.mask&y)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|y}),t=T[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(w!==null){let T=w.value.toLowerCase();if(T.indexOf("\\")!==-1&&(T=T.replace(/\\[09].*$/,"")),CS.call(t.map,T)){t=t.map[T];break}}t=Ae;break;case"Generic":{const T=d!==null?d.opts:null,y=_+Math.floor(t.fn(w,o,T));if(!isNaN(y)&&y>_){for(;_<y;)l();t=we}else t=Ae;break}case"Type":case"Property":{const T=t.type==="Type"?"types":"properties",y=CS.call(n,T)?n[T][t.name]:null;if(!y||!y.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(m!==!1&&w!==null&&t.type==="Type"&&(t.name==="custom-ident"&&w.type===1||t.name==="length"&&w.value==="0")){m===null&&(m=i(t,h)),t=Ae;break}c(),t=y.match;break}case"Keyword":{const T=t.name;if(w!==null){let y=w.value;if(y.indexOf("\\")!==-1&&(y=y.replace(/\\[09].*$/,"")),wm(y,T)){l(),t=we;break}}t=Ae;break}case"AtKeyword":case"Function":if(w!==null&&wm(w.value,t.name)){l(),t=we;break}t=Ae;break;case"Token":if(w!==null&&w.value===t.value){l(),t=we;break}t=Ae;break;case"Comma":w!==null&&w.type===18?kS(b.token)?t=Ae:(l(),t=LS(w)?Ae:we):t=kS(b.token)||LS(w)?we:Ae;break;case"String":let g="",E=_;for(;E<e.length&&g.length<t.value.length;E++)g+=e[E].value;if(wm(g,t.value)){for(;_<E;)l();t=we}else t=Ae;break;default:throw new Error("Unknown node type: "+t.type)}switch(u3+=p,v){case null:v=l3,b=null;break;case AS:for(;d!==null;)u();break;default:b=null}return{tokens:e,reason:v,iterations:p,match:b,longestMatch:A}}function NS(e,t,n){const r=m3(e,t,n||{});if(r.match===null)return r;let o=r.match,i=r.match={syntax:t.syntax||null,match:[]};const s=[i];for(o=d3(o).prev;o!==null;){switch(o.type){case Sm:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case TS:s.pop(),i=s[s.length-1];break;default:i.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return r}var h3=ie({getTrace:()=>xS,isKeyword:()=>b3,isProperty:()=>g3,isType:()=>p3});function xS(e){function t(o){return o===null?!1:o.type==="Type"||o.type==="Property"||o.type==="Keyword"}function n(o){if(Array.isArray(o.match)){for(let i=0;i<o.match.length;i++)if(n(o.match[i]))return t(o.syntax)&&r.unshift(o.syntax),!0}else if(o.node===e)return r=t(o.syntax)?[o.syntax]:[],!0;return!1}let r=null;return this.matched!==null&&n(this.matched),r}function p3(e,t){return _m(this,e,n=>n.type==="Type"&&n.name===t)}function g3(e,t){return _m(this,e,n=>n.type==="Property"&&n.name===t)}function b3(e){return _m(this,e,t=>t.type==="Keyword")}function _m(e,t,n){const r=xS.call(e,t);return r===null?!1:r.some(n)}function OS(e){return"node"in e?e.node:OS(e.match[0])}function RS(e){return"node"in e?e.node:RS(e.match[e.match.length-1])}function MS(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=OS(a),c=RS(a);e.syntax.walk(t,function(u,d,f){if(u===l){const h=new je;do{if(h.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:f,nodes:h})}})}Array.isArray(a.match)&&a.match.forEach(i)}const s=[];return n.matched!==null&&i(n.matched),s}var{hasOwnProperty:$s}=Object.prototype;function Cm(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function PS(e){return!!e&&Cm(e.offset)&&Cm(e.line)&&Cm(e.column)}function y3(e,t){return function(r,o){if(!r||r.constructor!==Object)return o(r,"Type of node should be an Object");for(let i in r){let s=!0;if($s.call(r,i)!==!1){if(i==="type")r.type!==e&&o(r,"Wrong node type `"+r.type+"`, expected `"+e+"`");else if(i==="loc"){if(r.loc===null)continue;if(r.loc&&r.loc.constructor===Object)if(typeof r.loc.source!="string")i+=".source";else if(!PS(r.loc.start))i+=".start";else if(!PS(r.loc.end))i+=".end";else continue;s=!1}else if(t.hasOwnProperty(i)){s=!1;for(let a=0;!s&&a<t[i].length;a++){const l=t[i][a];switch(l){case String:s=typeof r[i]=="string";break;case Boolean:s=typeof r[i]=="boolean";break;case null:s=r[i]===null;break;default:typeof l=="string"?s=r[i]&&r[i].type===l:Array.isArray(l)&&(s=r[i]instanceof je)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)$s.call(t,i)&&$s.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function v3(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if($s.call(n,i)===!1)continue;const s=[],a=r[i]=Array.isArray(n[i])?n[i].slice():[n[i]];for(let l=0;l<a.length;l++){const c=a[l];if(c===String||c===Boolean)s.push(c.name);else if(c===null)s.push("null");else if(typeof c=="string")s.push("<"+c+">");else if(Array.isArray(c))s.push("List");else throw new Error("Wrong value `"+c+"` in `"+e+"."+i+"` structure definition")}o[i]=s.join(" | ")}return{docs:o,check:y3(e,r)}}function E3(e){const t={};if(e.node){for(const n in e.node)if($s.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=v3(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var S3=Em(eS.join(" | "));function Tm(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:rm(e[o].syntax,{compact:t}));return r}function w3(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:rm(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&Tm(i.descriptors,t,n)};return r}function _3(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function wn(e,t,n){return{matched:e,iterations:n,error:t,...h3}}function ci(e,t,n,r){const o=t3(n,e.syntax);let i;return _3(o)?wn(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=NS(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=NS(o,t.match,e),!i.match)?wn(null,new tD(i.reason,t.syntax,n,i),i.iterations):wn(i.match,null,i.iterations))}var IS=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=S3,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||E3(e),e){if(e.types)for(const r in e.types)this.addType_(r,e.types[r]);if(e.generic){this.generic=!0;for(const r in aS)this.addType_(r,aS[r])}if(e.atrules)for(const r in e.atrules)this.addAtrule_(r,e.atrules[r]);if(e.properties)for(const r in e.properties)this.addProperty_(r,e.properties[r])}}checkStructure(e){function t(o,i){r.push({node:o,message:i})}const n=this.structure,r=[];return this.syntax.walk(e,function(o){n.hasOwnProperty(o.type)?n[o.type].check(o,t):t(o,"Unknown node type `"+o.type+"`")}),r.length?r:!1}createDescriptor(e,t,n,r=null){const o={type:t,name:n},i={type:t,name:n,parent:r,serializable:typeof e=="string"||e&&typeof e.type=="string",syntax:null,match:null};return typeof e=="function"?i.match=Em(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:ES(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Em(i.syntax,o)}),i.match}})),i}addAtrule_(e,t){t&&(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n),Object.create(null)):null})}addProperty_(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e))}addType_(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e))}checkAtruleName(e){if(!this.getAtrule(e))return new Ps("Unknown at-rule","@"+e)}checkAtrulePrelude(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e);if(!r.prelude&&t)return new SyntaxError("At-rule `@"+e+"` should not contain a prelude");if(r.prelude&&!t&&!ci(this,r.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+e+"` should contain a prelude")}checkAtruleDescriptorName(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e),o=En(t);if(!r.descriptors)return new SyntaxError("At-rule `@"+e+"` has no known descriptors");if(!r.descriptors[o.name]&&!r.descriptors[o.basename])return new Ps("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new Ps("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return wn(null,n);const r=this.getAtrule(e);return r.prelude?ci(this,r.prelude,t||"",!1):wn(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return wn(null,r);const o=this.getAtrule(e),i=En(t);return ci(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?wn(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(ii(e).custom)return wn(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?wn(null,n):ci(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?ci(this,n,t,!1):wn(null,new Ps("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?wn(null,new Ps("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),ci(this,e,t,!1))}findValueFragments(e,t,n,r){return MS(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return MS(this,e.value,this.matchDeclaration(e),t,n)}findAllFragments(e,t,n){const r=[];return this.syntax.walk(e,{visit:"Declaration",enter:o=>{r.push.apply(r,this.findDeclarationValueFragments(o,t,n))}}),r}getAtrule(e,t=!0){const n=En(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null}getAtruleDescriptor(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null}getProperty(e,t=!0){const n=ii(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(e){return hasOwnProperty.call(this.types,e)?this.types[e]:null}validate(){function e(r,o,i,s){if(i.has(o))return i.get(o);i.set(o,!1),s.syntax!==null&&QD(s.syntax,function(a){if(a.type!=="Type"&&a.type!=="Property")return;const l=a.type==="Type"?r.types:r.properties,c=a.type==="Type"?t:n;(!hasOwnProperty.call(l,a.name)||e(r,a.name,c,l[a.name]))&&i.set(o,!0)},this)}let t=new Map,n=new Map;for(const r in this.types)e(this,r,t,this.types[r]);for(const r in this.properties)e(this,r,n,this.properties[r]);return t=[...t.keys()].filter(r=>t.get(r)),n=[...n.keys()].filter(r=>n.get(r)),t.length||n.length?{types:t,properties:n}:null}dump(e,t){return{generic:this.generic,types:Tm(this.types,!t,e),properties:Tm(this.properties,!t,e),atrules:w3(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:ui}=Object.prototype,C3={generic:!0,types:Am,atrules:{prelude:FS,descriptors:FS},properties:Am,parseContext:T3,scope:BS,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function fc(e){return e&&e.constructor===Object}function DS(e){return fc(e)?{...e}:e}function T3(e,t){return Object.assign(e,t)}function BS(e,t){for(const n in t)ui.call(t,n)&&(fc(e[n])?BS(e[n],t[n]):e[n]=DS(t[n]));return e}function HS(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Am(e,t){if(typeof t=="string")return HS(e,t);const n={...e};for(let r in t)ui.call(t,r)&&(n[r]=HS(ui.call(e,r)?e[r]:void 0,t[r]));return n}function FS(e,t){const n=Am(e,t);return!fc(n)||Object.keys(n).length?n:null}function Ws(e,t,n){for(const r in n)if(ui.call(n,r)!==!1){if(n[r]===!0)ui.call(t,r)&&(e[r]=DS(t[r]));else if(n[r]){if(typeof n[r]=="function"){const o=n[r];e[r]=o({},e[r]),e[r]=o(e[r]||{},t[r])}else if(fc(n[r])){const o={};for(let i in e[r])o[i]=Ws({},e[r][i],n[r]);for(let i in t[r])o[i]=Ws(o[i]||{},t[r][i],n[r]);e[r]=o}else if(Array.isArray(n[r])){const o={},i=n[r].reduce(function(s,a){return s[a]=!0,s},{});for(const[s,a]of Object.entries(e[r]||{}))o[s]={},a&&Ws(o[s],a,i);for(const s in t[r])ui.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&Ws(o[s],t[r][s],i));e[r]=o}}}return e}var km=(e,t)=>Ws(e,t,C3);function $S(e){const t=x5(e),n=K5(e),r=j5(e),{fromPlainObject:o,toPlainObject:i}=V5(n),s={lexer:null,createLexer:a=>new IS(a,s,s.lexer.structure),tokenize:ec,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=km({},e);return $S(typeof a=="function"?a(l,Object.assign):km(l,a))}};return s.lexer=new IS({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var A3=e=>$S(km({},e)),k3={generic:!0,types:{"absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<hex-color>|<named-color>|currentcolor|<deprecated-system-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>* [<pseudo-element-selector> <pseudo-class-selector>*]*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<compound-selector> [<combinator>? <compound-selector>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>] )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fit-content()":"fit-content( [<length>|<percentage>] )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value> )]|( <ident> <any-value> )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )","hwb()":"hwb( [<hue>|none] [<percentage>|none] [<percentage>|none] [/ [<alpha-value>|none]]? )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length>|<percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length>|<percentage>|min-content|max-content|auto] , [<length>|<percentage>|<flex>|min-content|max-content|auto] )","name-repeat":"repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( <length> )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","saturate()":"saturate( <number-percentage> )","scale()":"scale( <number> , <number>? )","scale3d()":"scale3d( <number> , <number> , <number> )","scaleX()":"scaleX( <number> )","scaleY()":"scaleY( <number> )","scaleZ()":"scaleZ( <number> )","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","single-animation":"<time>||<easing-function>||<time>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<timeline-name>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timeline-name":"<custom-ident>|<string>","easing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( [<length>|<percentage>] )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-width":"fill-available|min-intrinsic|intrinsic|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content|-webkit-min-content|-webkit-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-webkit-mask-clip-style":"border|border-box|padding|padding-box|content|content-box|text","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","-ms-filter":"<string>",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>","bg-clip":"<box>|border|text","border-radius":"<length-percentage>{1,2}",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )",left:"<length>|auto","mask-image":"<mask-reference>#",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke",ratio:"<number [0,∞]> [/ <number [0,∞]>]?","reversed-counter-name":"reversed( <counter-name> )",right:"<length>|auto","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto","track-group":"'(' [<string>* <track-minmax> <string>*]+ ')' ['[' <positive-integer> ']']?|<track-minmax>","track-list-v0":"[<string>* <track-group> <string>*]+|none","track-minmax":"minmax( <track-breadth> , <track-breadth> )|auto|<track-breadth>|fit-content",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,∞]>","positive-integer":"<integer [0,∞]>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert|revert-layer",animation:"<single-animation>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-timing-function":"<easing-function>#","animation-timeline":"<single-animation-timeline>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto|<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-overflow":"clip|ellipsis|<string>","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end","caret-color":"auto|<color>",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none",color:"<color>","print-color-adjust":"economy|exact","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance|balance-all","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[size||layout||style||paint]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>]+]?","content-visibility":"visible|auto|hidden","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","empty-cells":"show|hide",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css21>||<'font-weight'>||<'font-stretch'>]? <'font-size'> [/ <'line-height'>]? <'font-family'>]|caption|icon|menu|message-box|small-caption|status-bar","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps]","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-weight-absolute>|bolder|lighter","forced-color-adjust":"auto|none",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","hyphenate-character":"auto|<string>",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>","input-security":"auto|none",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","min-inline-size":"<'min-width'>","min-width":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","mix-blend-mode":"<blend-mode>|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|ray( [<angle>&&<size>&&contain?] )|<path()>|<url>|[<basic-shape>||<geometry-box>]","offset-position":"auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-color'>||<'outline-style'>||<'outline-width'>]","outline-color":"<color>|invert","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,∞]>","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky",quotes:"none|auto|[<string> <string>]+",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"[alternate||[over|under]]|inter-character",scale:"none|<number>{1,3}","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"[over|under]&&[right|left]","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|fill|stretch|intrinsic|-moz-max-content|-webkit-max-content|-moz-fit-content|-webkit-fit-content","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+","clip-rule":"nonzero|evenodd",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|none|normal","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<number-zero-one>","stroke-width":"<svg-length>","text-anchor":"start|middle|end","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<string>"}},"scroll-timeline":{prelude:"<timeline-name>",descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},viewport:{prelude:null,descriptors:{height:"<viewport-length>{1,2}","max-height":"<viewport-length>","max-width":"<viewport-length>","max-zoom":"auto|<number>|<percentage>","min-height":"<viewport-length>","min-width":"<viewport-length>","min-zoom":"auto|<number>|<percentage>",orientation:"auto|portrait|landscape","user-zoom":"zoom|fixed","viewport-fit":"auto|contain|cover",width:"<viewport-length>{1,2}",zoom:"auto|<number>|<percentage>"}}}},L3=ie({generate:()=>R3,name:()=>x3,parse:()=>WS,structure:()=>O3}),Fn=43,Xt=45,mc=110,mo=!0,N3=!1;function hc(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===Fn||r===Xt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)mt(this.charCodeAt(n))||this.error("Integer is expected",n)}function di(e){return hc.call(this,0,e)}function Pr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case mc:n="N is expected";break;case Xt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function Lm(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(Fn,e)||this.isDelim(Xt,e)){t=this.isDelim(Fn,e)?Fn:Xt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),di.call(this,mo))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==Fn&&n!==Xt&&this.error("Number sign is expected")),di.call(this,t!==0),t===Xt?"-"+this.consume(10):this.consume(10)}var x3="AnPlusB",O3={a:[String,null],b:[String,null]};function WS(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)di.call(this,N3),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Xt))switch(t="-1",Pr.call(this,1,mc),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Lm.call(this);break;case 3:Pr.call(this,2,Xt),this.next(),this.skipSC(),di.call(this,mo),n="-"+this.consume(10);break;default:Pr.call(this,2,Xt),hc.call(this,3,mo),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Fn)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(Fn)&&(r=1,this.next()),Pr.call(this,0,mc),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Lm.call(this);break;case 2:Pr.call(this,1,Xt),this.next(),this.skipSC(),di.call(this,mo),n="-"+this.consume(10);break;default:Pr.call(this,1,Xt),hc.call(this,2,mo),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===Fn||r===Xt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&mt(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Pr.call(this,i-this.tokenStart,mc),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=Lm.call(this)):(Pr.call(this,i-this.tokenStart+1,Xt),i+2===this.tokenEnd?(this.next(),this.skipSC(),di.call(this,mo),n="-"+this.consume(10)):(hc.call(this,i-this.tokenStart+2,mo),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Fn&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===Fn&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function R3(e){if(e.a){const t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){const n=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}var M3=ie({generate:()=>H3,name:()=>I3,parse:()=>zS,structure:()=>B3,walkContext:()=>D3});function qS(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function P3(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}var I3="Atrule",D3="atrule",B3={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function zS(){const e=this.tokenStart;let t,n,r=null,o=null;switch(this.eat(3),t=this.substrToCursor(e+1),n=t.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?r=this.parseWithFallback(this.AtrulePrelude.bind(this,t),qS):r=qS.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,n)&&typeof this.atrule[n].block=="function"?o=this.atrule[n].block.call(this):o=this.Block(P3.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function H3(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var F3=ie({generate:()=>z3,name:()=>$3,parse:()=>US,structure:()=>q3,walkContext:()=>W3}),$3="AtrulePrelude",W3="atrulePrelude",q3={children:[[]]};function US(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function z3(e){this.children(e)}var U3=ie({generate:()=>Q3,name:()=>Y3,parse:()=>VS,structure:()=>Z3}),j3=36,jS=42,pc=61,V3=94,Nm=124,G3=126;function X3(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(jS)?(t=!0,this.next()):this.isDelim(Nm)||this.eat(1),this.isDelim(Nm)?this.charCodeAt(this.tokenStart+1)!==pc?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function K3(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==pc&&t!==G3&&t!==V3&&t!==j3&&t!==jS&&t!==Nm&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==pc&&(this.isDelim(pc)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var Y3="AttributeSelector",Z3={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function VS(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=X3.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=K3.call(this),this.skipSC(),r=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:o}}function Q3(e){this.token(9,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,"]")}var J3=ie({generate:()=>i4,name:()=>n4,parse:()=>KS,structure:()=>o4,walkContext:()=>r4});function GS(e){return this.Raw(e,null,!0)}function e4(){return this.parseWithFallback(this.Rule,GS)}function XS(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function t4(){if(this.tokenType===17)return XS.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,XS);return this.tokenType===17&&this.next(),e}var n4="Block",r4="block",o4={children:[["Atrule","Rule","Declaration"]]};function KS(e){const t=e?t4:e4,n=this.tokenStart;let r=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule,GS));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function i4(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var s4=ie({generate:()=>c4,name:()=>a4,parse:()=>YS,structure:()=>l4}),a4="Brackets",l4={children:[[]]};function YS(e,t){const n=this.tokenStart;let r=null;return this.eat(19),r=e.call(this,t),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}function c4(e){this.token(9,"["),this.children(e),this.token(9,"]")}var u4=ie({generate:()=>f4,name:()=>"CDC",parse:()=>ZS,structure:()=>d4}),_ne="CDC",d4=[];function ZS(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function f4(){this.token(15,"-->")}var m4=ie({generate:()=>p4,name:()=>"CDO",parse:()=>QS,structure:()=>h4}),Cne="CDO",h4=[];function QS(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function p4(){this.token(14,"<!--")}var g4=ie({generate:()=>E4,name:()=>y4,parse:()=>JS,structure:()=>v4}),b4=46,y4="ClassSelector",v4={name:String};function JS(){return this.eatDelim(b4),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function E4(e){this.token(9,"."),this.token(1,e.name)}var S4=ie({generate:()=>k4,name:()=>T4,parse:()=>t1,structure:()=>A4}),w4=43,e1=47,_4=62,C4=126,T4="Combinator",A4={name:String};function t1(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case _4:case w4:case C4:this.next();break;case e1:this.next(),this.eatIdent("deep"),this.eatDelim(e1);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function k4(e){this.tokenize(e.name)}var L4=ie({generate:()=>M4,name:()=>O4,parse:()=>n1,structure:()=>R4}),N4=42,x4=47,O4="Comment",R4={value:String};function n1(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===N4&&this.charCodeAt(t-1)===x4&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function M4(e){this.token(25,"/*"+e.value+"*/")}var P4=ie({generate:()=>V4,name:()=>z4,parse:()=>i1,structure:()=>j4,walkContext:()=>U4}),r1=33,I4=35,D4=36,B4=38,H4=42,F4=43,o1=47;function $4(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function W4(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function q4(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(r1)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var z4="Declaration",U4="declaration",j4={important:[Boolean,String],property:String,value:["Value","Raw"]};function i1(){const e=this.tokenStart,t=this.tokenIndex,n=G4.call(this),r=om(n),o=r?this.parseCustomProperty:this.parseValue,i=r?W4:$4;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(q4,i):a=i.call(this,this.tokenIndex),r&&a.type==="Value"&&a.children.isEmpty){for(let c=l-this.tokenIndex;c<=0;c++)if(this.lookupType(c)===13){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(r1)&&(s=X4.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:s,property:n,value:a}}function V4(e){this.token(1,e.property),this.token(16,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,e.important===!0?"important":e.important))}function G4(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case H4:case D4:case F4:case I4:case B4:this.next();break;case o1:this.next(),this.isDelim(o1)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function X4(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var K4=ie({generate:()=>J4,name:()=>Z4,parse:()=>s1,structure:()=>Q4});function Y4(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var Z4="DeclarationList",Q4={children:[["Declaration"]]};function s1(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;default:e.push(this.parseWithFallback(this.Declaration,Y4))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function J4(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var e8=ie({generate:()=>r8,name:()=>t8,parse:()=>a1,structure:()=>n8}),t8="Dimension",n8={value:String,unit:String};function a1(){const e=this.tokenStart,t=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function r8(e){this.token(12,e.value+e.unit)}var o8=ie({generate:()=>l8,name:()=>i8,parse:()=>l1,structure:()=>a8,walkContext:()=>s8}),i8="Function",s8="function",a8={name:String,children:[[]]};function l1(e,t){const n=this.tokenStart,r=this.consumeFunctionName(),o=r.toLowerCase();let i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:i}}function l8(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var c8=ie({generate:()=>f8,name:()=>u8,parse:()=>c1,structure:()=>d8,xxx:()=>"XXX"}),Tne="XXX",u8="Hash",d8={value:String};function c1(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function f8(e){this.token(4,"#"+e.value)}var m8=ie({generate:()=>g8,name:()=>h8,parse:()=>u1,structure:()=>p8}),h8="Identifier",p8={name:String};function u1(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function g8(e){this.token(1,e.name)}var b8=ie({generate:()=>E8,name:()=>y8,parse:()=>d1,structure:()=>v8}),y8="IdSelector",v8={name:String};function d1(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function E8(e){this.token(9,"#"+e.name)}var S8=ie({generate:()=>C8,name:()=>w8,parse:()=>f1,structure:()=>_8}),w8="MediaFeature",_8={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function f1(){const e=this.tokenStart;let t,n=null;if(this.eat(21),this.skipSC(),t=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:this.lookupNonWSType(1)===9?n=this.Ratio():n=this.Number();break;case 12:n=this.Dimension();break;case 1:n=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eat(22),{type:"MediaFeature",loc:this.getLocation(e,this.tokenStart),name:t,value:n}}function C8(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var T8=ie({generate:()=>L8,name:()=>A8,parse:()=>m1,structure:()=>k8}),A8="MediaQuery",k8={children:[["Identifier","MediaFeature","WhiteSpace"]]};function m1(){const e=this.createList();let t=null;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t=this.Identifier();break;case 21:t=this.MediaFeature();break;default:break e}e.push(t)}return t===null&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}}function L8(e){this.children(e)}var N8=ie({generate:()=>R8,name:()=>x8,parse:()=>h1,structure:()=>O8}),x8="MediaQueryList",O8={children:[["MediaQuery"]]};function h1(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function R8(e){this.children(e,()=>this.token(18,","))}var M8=ie({generate:()=>I8,name:()=>"Nth",parse:()=>p1,structure:()=>P8}),Ane="Nth",P8={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function p1(){this.skipSC();const e=this.tokenStart;let t=e,n=null,r;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?r=this.Identifier():r=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:r,selector:n}}function I8(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var D8=ie({generate:()=>F8,name:()=>B8,parse:()=>g1,structure:()=>H8}),B8="Number",H8={value:String};function g1(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function F8(e){this.token(10,e.value)}var $8=ie({generate:()=>z8,name:()=>W8,parse:()=>b1,structure:()=>q8}),W8="Operator",q8={value:String};function b1(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function z8(e){this.tokenize(e.value)}var U8=ie({generate:()=>G8,name:()=>j8,parse:()=>y1,structure:()=>V8}),j8="Parentheses",V8={children:[[]]};function y1(e,t){const n=this.tokenStart;let r=null;return this.eat(21),r=e.call(this,t),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}function G8(e){this.token(21,"("),this.children(e),this.token(22,")")}var X8=ie({generate:()=>Z8,name:()=>K8,parse:()=>v1,structure:()=>Y8}),K8="Percentage",Y8={value:String};function v1(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function Z8(e){this.token(11,e.value+"%")}var Q8=ie({generate:()=>nB,name:()=>J8,parse:()=>E1,structure:()=>tB,walkContext:()=>eB}),J8="PseudoClassSelector",eB="function",tB={name:String,children:[["Raw"],null]};function E1(){const e=this.tokenStart;let t=null,n,r;return this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):n=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function nB(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var rB=ie({generate:()=>aB,name:()=>oB,parse:()=>S1,structure:()=>sB,walkContext:()=>iB}),oB="PseudoElementSelector",iB="function",sB={name:String,children:[["Raw"],null]};function S1(){const e=this.tokenStart;let t=null,n,r;return this.eat(16),this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):n=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function aB(e){this.token(16,":"),this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var lB=ie({generate:()=>mB,name:()=>dB,parse:()=>_1,structure:()=>fB}),cB=47,uB=46;function w1(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!mt(n)&&n!==uB&&this.error("Unsigned number is expected",this.tokenStart-e.length+t)}return Number(e)===0&&this.error("Zero number is not allowed",this.tokenStart-e.length),e}var dB="Ratio",fB={left:String,right:String};function _1(){const e=this.tokenStart,t=w1.call(this);let n;return this.skipSC(),this.eatDelim(cB),n=w1.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function mB(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var hB=ie({generate:()=>bB,name:()=>"Raw",parse:()=>C1,structure:()=>gB});function pB(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var kne="Raw",gB={value:String};function C1(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=pB.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function bB(e){this.tokenize(e.value)}var yB=ie({generate:()=>_B,name:()=>EB,parse:()=>A1,structure:()=>wB,walkContext:()=>SB});function T1(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function vB(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var EB="Rule",SB="rule",wB={prelude:["SelectorList","Raw"],block:["Block"]};function A1(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(vB,T1):n=T1.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function _B(e){this.node(e.prelude),this.node(e.block)}var CB=ie({generate:()=>kB,name:()=>TB,parse:()=>k1,structure:()=>AB}),TB="Selector",AB={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function k1(){const e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function kB(e){this.children(e)}var LB=ie({generate:()=>RB,name:()=>NB,parse:()=>L1,structure:()=>OB,walkContext:()=>xB}),NB="SelectorList",xB="selector",OB={children:[["Selector","Raw"]]};function L1(){const e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function RB(e){this.children(e,()=>this.token(18,","))}var xm=92,N1=34,x1=39;function O1(e){const t=e.length,n=e.charCodeAt(0),r=n===N1||n===x1?1:0,o=r===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let i="";for(let s=r;s<=o;s++){let a=e.charCodeAt(s);if(a===xm){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),Bn(xm,a)){const l=s-1,c=ni(e,l);s=c-1,i+=RE(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function Om(e,t){const n=t?"'":'"',r=t?x1:N1;let o="",i=!1;for(let s=0;s<e.length;s++){const a=e.charCodeAt(s);if(a===0){o+="�";continue}if(a<=31||a===127){o+="\\"+a.toString(16),i=!0;continue}a===r||a===xm?(o+="\\"+e.charAt(s),i=!1):(i&&(Or(a)||fo(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var MB=ie({generate:()=>DB,name:()=>PB,parse:()=>R1,structure:()=>IB}),PB="String",IB={value:String};function R1(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:O1(this.consume(5))}}function DB(e){this.token(5,Om(e.value))}var BB=ie({generate:()=>qB,name:()=>FB,parse:()=>P1,structure:()=>WB,walkContext:()=>$B}),HB=33;function M1(e){return this.Raw(e,null,!1)}var FB="StyleSheet",$B="stylesheet",WB={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function P1(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==HB){this.next();continue}n=this.Comment();break;case 14:n=this.CDO();break;case 15:n=this.CDC();break;case 3:n=this.parseWithFallback(this.Atrule,M1);break;default:n=this.parseWithFallback(this.Rule,M1)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function qB(e){this.children(e)}var zB=ie({generate:()=>GB,name:()=>jB,parse:()=>D1,structure:()=>VB}),UB=42,I1=124;function Rm(){this.tokenType!==1&&this.isDelim(UB)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var jB="TypeSelector",VB={name:String};function D1(){const e=this.tokenStart;return this.isDelim(I1)?(this.next(),Rm.call(this)):(Rm.call(this),this.isDelim(I1)&&(this.next(),Rm.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function GB(e){this.tokenize(e.name)}var XB=ie({generate:()=>JB,name:()=>ZB,parse:()=>F1,structure:()=>QB}),B1=43,H1=45,Mm=63;function qs(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===H1&&t&&n!==0)return qs.call(this,e+n+1,!1),-1;Or(o)||this.error(t&&n!==0?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",r),++n>6&&this.error("Too many hex digits",r)}return this.next(),n}function gc(e){let t=0;for(;this.isDelim(Mm);)++t>e&&this.error("Too many question marks"),this.next()}function KB(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===B1?"Plus sign":"Hyphen minus")+" is expected")}function YB(){let e=0;switch(this.tokenType){case 10:if(e=qs.call(this,1,!0),this.isDelim(Mm)){gc.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){KB.call(this,H1),qs.call(this,1,!1);break}break;case 12:e=qs.call(this,1,!0),e>0&&gc.call(this,6-e);break;default:if(this.eatDelim(B1),this.tokenType===1){e=qs.call(this,0,!0),e>0&&gc.call(this,6-e);break}if(this.isDelim(Mm)){this.next(),gc.call(this,5);break}this.error("Hex digit or question mark is expected")}}var ZB="UnicodeRange",QB={value:String};function F1(){const e=this.tokenStart;return this.eatIdent("u"),YB.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function JB(e){this.tokenize(e.value)}var e9=32,Pm=92,t9=34,n9=39,r9=40,$1=41;function o9(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===$1?t-2:t-1,o="";for(;n<r&&fo(e.charCodeAt(n));)n++;for(;n<r&&fo(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===Pm){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),Bn(Pm,s)){const a=i-1,l=ni(e,a);i=l-1,o+=RE(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function W1(e){let t="",n=!1;for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);if(o===0){t+="�";continue}if(o<=31||o===127){t+="\\"+o.toString(16),n=!0;continue}o===e9||o===Pm||o===t9||o===n9||o===r9||o===$1?(t+="\\"+e.charAt(r),n=!1):(n&&Or(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var i9=ie({generate:()=>a9,name:()=>"Url",parse:()=>q1,structure:()=>s9}),Lne="Url",s9={value:String};function q1(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=o9(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=O1(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function a9(e){this.token(7,W1(e.value))}var l9=ie({generate:()=>d9,name:()=>c9,parse:()=>z1,structure:()=>u9}),c9="Value",u9={children:[[]]};function z1(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function d9(e){this.children(e)}var f9=ie({generate:()=>g9,name:()=>h9,parse:()=>U1,structure:()=>p9}),m9=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),h9="WhiteSpace",p9={value:String};function U1(){return this.eat(13),m9}function g9(e){this.token(13,e.value)}var j1=ie({AnPlusB:()=>L3,Atrule:()=>M3,AtrulePrelude:()=>F3,AttributeSelector:()=>U3,Block:()=>J3,Brackets:()=>s4,CDC:()=>u4,CDO:()=>m4,ClassSelector:()=>g4,Combinator:()=>S4,Comment:()=>L4,Declaration:()=>P4,DeclarationList:()=>K4,Dimension:()=>e8,Function:()=>o8,Hash:()=>c8,IdSelector:()=>b8,Identifier:()=>m8,MediaFeature:()=>S8,MediaQuery:()=>T8,MediaQueryList:()=>N8,Nth:()=>M8,Number:()=>D8,Operator:()=>$8,Parentheses:()=>U8,Percentage:()=>X8,PseudoClassSelector:()=>Q8,PseudoElementSelector:()=>rB,Ratio:()=>lB,Raw:()=>hB,Rule:()=>yB,Selector:()=>CB,SelectorList:()=>LB,String:()=>MB,StyleSheet:()=>BB,TypeSelector:()=>zB,UnicodeRange:()=>XB,Url:()=>i9,Value:()=>l9,WhiteSpace:()=>f9}),b9={generic:!0,...k3,node:j1},y9=35,v9=42,V1=43,E9=45,S9=47,w9=117;function G1(e){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,e.recognizer);case 19:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,w9)&&this.cmpChar(this.tokenStart+1,V1)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===S9||t===v9||t===V1||t===E9)return this.Operator();t===y9&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var _9={getNode:G1},C9=35,T9=42,A9=43,k9=47,X1=46,L9=62,N9=124,x9=126;function O9(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function R9(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===X1&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case A9:case L9:case x9:case k9:return this.Combinator();case X1:return this.ClassSelector();case T9:case N9:return this.TypeSelector();case C9:return this.IdSelector()}}}var M9={onWhiteSpace:O9,getNode:R9};function P9(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function I9(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===18){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.tokenIndex,this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type==="Value"&&n.children.isEmpty){for(let r=t-this.tokenIndex;r<=0;r++)if(this.lookupType(r)===13){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(n)}return e}function K1(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var D9={getNode:G1,onWhiteSpace(e,t){K1(e)&&(e.value=" "+e.value),K1(t.last)&&(t.last.value+=" ")},expression:P9,var:I9},B9=ie({AtrulePrelude:()=>_9,Selector:()=>M9,Value:()=>D9}),H9={parse:{prelude:null,block(){return this.Block(!0)}}},F9={parse:{prelude(){const e=this.createList();switch(this.skipSC(),this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}},$9={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},W9={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function q9(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function z9(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):Y1.call(this)}function Y1(){const e=this.createList();let t;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 2:t=this.Function(q9,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(z9,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var U9={parse:{prelude(){const e=Y1.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},j9={"font-face":H9,import:F9,media:$9,page:W9,supports:U9},ho={parse(){return this.createSingleNodeList(this.SelectorList())}},V9={parse(){return this.createSingleNodeList(this.Selector())}},Z1={parse(){return this.createSingleNodeList(this.Identifier())}},bc={parse(){return this.createSingleNodeList(this.Nth())}},G9={dir:Z1,has:ho,lang:Z1,matches:ho,is:ho,"-moz-any":ho,"-webkit-any":ho,where:ho,not:ho,"nth-child":bc,"nth-last-child":bc,"nth-last-of-type":bc,"nth-of-type":bc,slotted:V9},X9=ie({AnPlusB:()=>WS,Atrule:()=>zS,AtrulePrelude:()=>US,AttributeSelector:()=>VS,Block:()=>KS,Brackets:()=>YS,CDC:()=>ZS,CDO:()=>QS,ClassSelector:()=>JS,Combinator:()=>t1,Comment:()=>n1,Declaration:()=>i1,DeclarationList:()=>s1,Dimension:()=>a1,Function:()=>l1,Hash:()=>c1,IdSelector:()=>d1,Identifier:()=>u1,MediaFeature:()=>f1,MediaQuery:()=>m1,MediaQueryList:()=>h1,Nth:()=>p1,Number:()=>g1,Operator:()=>b1,Parentheses:()=>y1,Percentage:()=>v1,PseudoClassSelector:()=>E1,PseudoElementSelector:()=>S1,Ratio:()=>_1,Raw:()=>C1,Rule:()=>A1,Selector:()=>k1,SelectorList:()=>L1,String:()=>R1,StyleSheet:()=>P1,TypeSelector:()=>D1,UnicodeRange:()=>F1,Url:()=>q1,Value:()=>z1,WhiteSpace:()=>U1}),K9={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},scope:B9,atrule:j9,pseudo:G9,node:X9},Y9={node:j1},Z9=A3({...b9,...K9,...Y9});function Im(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof je?r=r.map(Im):r.constructor===Object&&(r=Im(r))),t[n]=r}return t}var{tokenize:Nne,parse:Q9,generate:$n,lexer:Q1,createLexer:xne,walk:Bt,find:One,findLast:Rne,findAll:Mne,toPlainObject:Pne,fromPlainObject:Ine,fork:J9}=Z9,{hasOwnProperty:e6}=Object.prototype;function Dm(e,t){const n=Object.create(null);if(!Array.isArray(e))return null;for(let r of e)t&&(r=r.toLowerCase()),n[r]=!0;return n}function J1(e){if(!e)return null;const t=Dm(e.tags,!0),n=Dm(e.ids),r=Dm(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function t6(e){let t=!1;if(e.scopes&&Array.isArray(e.scopes)){t=Object.create(null);for(let n=0;n<e.scopes.length;n++){const r=e.scopes[n];if(!r||!Array.isArray(r))throw new Error("Wrong usage format");for(const o of r){if(e6.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:J1(e),blacklist:J1(e.blacklist),scopes:t}}function po(e){return!e||!e.children||e.children.isEmpty}function ew(e,t){return e!==null&&e.children===t}function n6(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),po(e.block))){n.remove(t);return}switch(e.name){case"charset":if(po(e.prelude)){n.remove(t);return}if(t.prev){n.remove(t);return}break;case"import":if(this.stylesheet===null||!this.stylesheet.firstAtrulesAllowed){n.remove(t);return}n.prevUntil(t.prev,function(r){if(!(r.type==="Atrule"&&(r.name==="import"||r.name==="charset")))return this.root.firstAtrulesAllowed=!1,n.remove(t),!0},this);break;default:{const r=En(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(po(e.prelude)||po(e.block))&&n.remove(t)}}}function r6(e,t,n){n.remove(t)}function o6(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}ii(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function i6(e,t,n){(ew(this.stylesheet,n)||ew(this.block,n))&&n.remove(t)}var{hasOwnProperty:fi}=Object.prototype,s6=new Set(["keyframes"]);function tw(e,t){return e.children.forEach((n,r,o)=>{let i=!1;Bt(n,function(s){if(this.selector===null||this.selector===e)switch(s.type){case"SelectorList":(this.function===null||this.function.name.toLowerCase()!=="not")&&tw(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!fi.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&fi.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!fi.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&fi.call(t.blacklist.ids,s.name)&&(i=!0);break;case"TypeSelector":s.name.charAt(s.name.length-1)!=="*"&&(t.whitelist!==null&&t.whitelist.tags!==null&&!fi.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&fi.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function a6(e,t,n,r){if(po(e.prelude)||po(e.block)){n.remove(t);return}if(this.atrule&&s6.has(En(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(tw(e.prelude,o),po(e.prelude))){n.remove(t);return}}function l6(e,t,n){if(t.data.name!=="*")return;const r=t.next&&t.next.data.type;(r==="IdSelector"||r==="ClassSelector"||r==="AttributeSelector"||r==="PseudoClassSelector"||r==="PseudoElementSelector")&&n.remove(t)}function c6(e,t,n){n.remove(t)}var nw={Atrule:n6,Comment:r6,Declaration:o6,Raw:i6,Rule:a6,TypeSelector:l6,WhiteSpace:c6};function u6(e,t){Bt(e,{leave(n,r,o){nw.hasOwnProperty(n.type)&&nw[n.type].call(this,n,r,o,t)}})}function d6(e){e.block.children.forEach(t=>{t.prelude.children.forEach(n=>{n.children.forEach((r,o)=>{r.type==="Percentage"&&r.value==="100"?o.data={type:"TypeSelector",loc:r.loc,name:"to"}:r.type==="TypeSelector"&&r.name==="from"&&(o.data={type:"Percentage",loc:r.loc,value:"0"})})})})}function f6(e){En(e.name).basename==="keyframes"&&d6(e)}var m6=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function h6(e){return e===""||e==="-"?!1:!m6.test(e)}function p6(e){const t=e.value;!t||t.type!=="String"||h6(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function g6(e){const t=e.children;t.forEachRight(function(n,r){if(n.type==="Identifier"){if(n.name==="bold")r.data={type:"Number",loc:n.loc,value:"700"};else if(n.name==="normal"){const o=r.prev;o&&o.data.type==="Operator"&&o.data.value==="/"&&this.remove(o),this.remove(r)}}}),t.isEmpty&&t.insert(t.createItem({type:"Identifier",name:"normal"}))}function b6(e){const t=e.children.head.data;if(t.type==="Identifier")switch(t.name){case"normal":e.children.head.data={type:"Number",loc:t.loc,value:"400"};break;case"bold":e.children.head.data={type:"Number",loc:t.loc,value:"700"}}}function y6(e){function t(){r.length||r.unshift({type:"Number",loc:null,value:"0"},{type:"Number",loc:null,value:"0"}),n.push.apply(n,r),r=[]}let n=[],r=[];e.children.forEach(o=>{if(o.type==="Operator"&&o.value===","){t(),n.push(o);return}o.type==="Identifier"&&(o.name==="transparent"||o.name==="none"||o.name==="repeat"||o.name==="scroll")||r.push(o)}),t(),e.children=new je().fromArray(n)}function rw(e){e.children.forEach((t,n,r)=>{t.type==="Identifier"&&t.name.toLowerCase()==="none"&&(r.head===r.tail?n.data={type:"Number",loc:t.loc,value:"0"}:r.remove(n))})}var ow={font:g6,"font-weight":b6,background:y6,border:rw,outline:rw};function v6(e){if(!this.declaration)return;const t=ii(this.declaration.property);ow.hasOwnProperty(t.basename)&&ow[t.basename](e)}var E6=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,S6=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,w6=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function yc(e,t){const n=t&&t.prev!==null&&w6.has(t.prev.data.type)?S6:E6;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function _6(e){e.value=yc(e.value)}var C6=new Set(["calc","min","max","clamp"]),T6=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function A6(e,t){const n=yc(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!T6.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&C6.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var k6=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function L6(e,t){e.value=yc(e.value),e.value==="0"&&this.declaration&&!k6.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},Q1.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function N6(e){e.value=e.value.replace(/\\/g,"/")}var iw={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},sw={8e5:"maroon",800080:"purple",808e3:"olive",808080:"gray","00ffff":"cyan",f0ffff:"azure",f5f5dc:"beige",ffe4c4:"bisque","000000":"black","0000ff":"blue",a52a2a:"brown",ff7f50:"coral",ffd700:"gold","008000":"green","4b0082":"indigo",fffff0:"ivory",f0e68c:"khaki","00ff00":"lime",faf0e6:"linen","000080":"navy",ffa500:"orange",da70d6:"orchid",cd853f:"peru",ffc0cb:"pink",dda0dd:"plum",f00:"red",ff0000:"red",fa8072:"salmon",a0522d:"sienna",c0c0c0:"silver",fffafa:"snow",d2b48c:"tan","008080":"teal",ff6347:"tomato",ee82ee:"violet",f5deb3:"wheat",ffffff:"white",ffff00:"yellow"};function Bm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function aw(e,t,n,r){let o,i,s;if(t===0)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Bm(l,a,e+1/3),i=Bm(l,a,e),s=Bm(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function Hm(e){return e=e.toString(16),e.length===1?"0"+e:e}function Fm(e,t,n){let r=e.head,o=[],i=!1;for(;r!==null;){const{type:s,value:a}=r.data;switch(s){case"Number":case"Percentage":if(i)return;i=!0,o.push({type:s,value:Number(a)});break;case"Operator":if(a===","){if(!i)return;i=!1}else if(i||a!=="+")return;break;default:return}r=r.next}if(o.length===t){if(o.length===4){if(o[3].type!=="Number")return;o[3].type="Alpha"}if(n){if(o[0].type!==o[1].type||o[0].type!==o[2].type)return}else{if(o[0].type!=="Number"||o[1].type!=="Percentage"||o[2].type!=="Percentage")return;o[0].type="Angle"}return o.map(function(s){let a=Math.max(0,s.value);switch(s.type){case"Number":a=Math.min(a,255);break;case"Percentage":if(a=Math.min(a,100)/100,!n)return a;a=255*a;break;case"Angle":return(a%360+360)%360/360;case"Alpha":return Math.min(a,1)}return Math.round(a)})}}function x6(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=Fm(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=aw(...r),e.name="rgba"),r[3]===0){const o=this.function&&this.function.name;if(r[0]===0&&r[1]===0&&r[2]===0||!/^(?:to|from|color-stop)$|gradient$/i.test(o)){t.data={type:"Identifier",loc:e.loc,name:"transparent"};return}}if(r[3]!==1){e.children.forEach((o,i,s)=>{if(o.type==="Operator"){o.value!==","&&s.remove(i);return}i.data={type:"Number",loc:o.loc,value:yc(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||Fm(e.children,3,!1),!r)return;r=aw(...r),n="rgb"}if(n==="rgb"){if(r=r||Fm(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:Hm(r[0])+Hm(r[1])+Hm(r[2])},lw(t.data,t)}}function O6(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(iw.hasOwnProperty(n)&&Q1.matchDeclaration(this.declaration).isType(e,"color")){const r=iw[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function lw(e,t){let n=e.value.toLowerCase();n.length===6&&n[0]===n[1]&&n[2]===n[3]&&n[4]===n[5]&&(n=n[0]+n[2]+n[4]),sw[n]?t.data={type:"Identifier",loc:e.loc,name:sw[n]}:e.value=n}var cw={Atrule:f6,AttributeSelector:p6,Value:v6,Dimension:A6,Percentage:L6,Number:_6,Url:N6,Hash:lw,Identifier:O6,Function:x6};function R6(e){Bt(e,{leave(t,n,r){cw.hasOwnProperty(t.type)&&cw[t.type].call(this,t,n,r)}})}var M6=class{constructor(){this.map=new Map}resolve(e){let t=this.map.get(e);return t===void 0&&(t=this.map.size+1,this.map.set(e,t)),t}};function P6(){const e=new M6;return function(n){const r=$n(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function I6(e){return e.type==="Raw"?Q9(e.value,{context:"selectorList"}):e}function D6(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function uw(e){return I6(e).children.reduce((t,n)=>D6($m(n),t),[0,0,0])}function $m(e){let t=0,n=0,r=0;return e.children.forEach(o=>{switch(o.type){case"IdSelector":t++;break;case"ClassSelector":case"AttributeSelector":n++;break;case"PseudoClassSelector":switch(o.name.toLowerCase()){case"not":case"has":case"is":case"matches":case"-webkit-any":case"-moz-any":{const[i,s,a]=uw(o.children.first);t+=i,n+=s,r+=a;break}case"nth-child":case"nth-last-child":{const i=o.children.first;if(i.type==="Nth"&&i.selector){const[s,a,l]=uw(i.selector);t+=s,n+=a+1,r+=l}else n++;break}case"where":break;case"before":case"after":case"first-line":case"first-letter":r++;break;default:n++}break;case"TypeSelector":o.name.endsWith("*")||r++;break;case"PseudoElementSelector":r++}}),[t,n,r]}var B6=new Set(["first-letter","first-line","after","before"]),H6=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function F6(e,t){const n=new Set;e.prelude.children.forEach(function(r){let o="*",i=0;r.children.forEach(function(s){switch(s.type){case"ClassSelector":if(t&&t.scopes){const a=t.scopes[s.name]||0;if(i!==0&&a!==i)throw new Error("Selector can't has classes from different scopes: "+$n(r));i=a}break;case"PseudoClassSelector":{const a=s.name.toLowerCase();H6.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();B6.has(a)||n.add(`::${a}`);break}case"TypeSelector":o=s.name.toLowerCase();break;case"AttributeSelector":s.flags&&n.add(`[${s.flags.toLowerCase()}]`);break;case"Combinator":o="*"}}),r.compareMarker=$m(r).toString(),r.id=null,r.id=$n(r),i&&(r.compareMarker+=":"+i),o!=="*"&&(r.compareMarker+=","+o)}),e.pseudoSignature=n.size>0?[...n].sort().join(","):!1}function $6(e,t){const n=P6();return Bt(e,{visit:"Rule",enter(r){r.block.children.forEach(n),F6(r,t.usage)}}),Bt(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=$n(r.prelude)),En(r.name).basename==="keyframes"&&(r.block.avoidRulesMerge=!0,r.block.children.forEach(function(o){o.prelude.children.forEach(function(i){i.compareMarker=i.id})}))}}),{declaration:n}}var{hasOwnProperty:dw}=Object.prototype;function fw(e,t,n,r){const o=t.data,i=En(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);dw.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],dw.call(e[i],s)||(e[i][s]=new je),e[i][s].append(n.remove(t))}function W6(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=En(o.name).basename;switch(a){case"keyframes":fw(n,i,s,!0);return;case"media":if(t.forceMediaMerge){fw(n,i,s,!1);return}}r===null&&a!=="charset"&&a!=="import"&&(r=i)}else r===null&&(r=i)});for(const o in n)for(const i in n[o])e.children.insertList(n[o][i],o==="media"?null:r)}function mw(e){return e.type==="Atrule"&&e.name==="media"}function q6(e,t,n){if(!mw(e))return;const r=t.prev&&t.prev.data;!r||!mw(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function z6(e,t){W6(e,t),Bt(e,{visit:"Atrule",reverse:!0,enter:q6})}var{hasOwnProperty:U6}=Object.prototype;function hw(e,t){let n=e.head,r=t.head;for(;n!==null&&r!==null&&n.data.id===r.data.id;)n=n.next,r=r.next;return n===null&&r===null}function pw(e,t){let n=e.head,r=t.head;for(;n!==null&&r!==null&&n.data.id===r.data.id;)n=n.next,r=r.next;return n===null&&r===null}function j6(e,t){const n={eq:[],ne1:[],ne2:[],ne2overrided:[]},r=Object.create(null),o=Object.create(null);for(let i=t.head;i;i=i.next)o[i.data.id]=!0;for(let i=e.head;i;i=i.next){const s=i.data;s.fingerprint&&(r[s.fingerprint]=s.important),o[s.id]?(o[s.id]=!1,n.eq.push(s)):n.ne1.push(s)}for(let i=t.head;i;i=i.next){const s=i.data;o[s.id]&&((!U6.call(r,s.fingerprint)||!r[s.fingerprint]&&s.important)&&n.ne2.push(s),n.ne2overrided.push(s))}return n}function zs(e,t){return t.forEach(n=>{const r=n.id;let o=e.head;for(;o;){const i=o.data.id;if(i===r)return;if(i>r)break;o=o.next}e.insert(e.createItem(n),o)}),e}function gw(e,t){let n=e.head;for(;n!==null;){let r=t.head;for(;r!==null;){if(n.data.compareMarker===r.data.compareMarker)return!0;r=r.next}n=n.next}return!1}function vc(e){switch(e.type){case"Rule":return gw(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some(vc,this);break;case"Declaration":return!1}return!0}function V6(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return vc.call(r,i);const s=i.prelude.children,a=i.block.children;if(e.pseudoSignature===i.pseudoSignature){if(hw(s,r))return a.appendList(o),n.remove(t),!0;if(pw(o,a))return zs(s,r),n.remove(t),!0}return gw(r,s)})}function G6(e){Bt(e,{visit:"Rule",enter:V6})}function X6(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new je;o.insert(r.remove(r.head)),n.insert(n.createItem({type:"Rule",loc:e.loc,prelude:{type:"SelectorList",loc:e.prelude.loc,children:o},block:{type:"Block",loc:e.block.loc,children:e.block.children.copy()},pseudoSignature:e.pseudoSignature}),t)}}function K6(e){Bt(e,{visit:"Rule",reverse:!0,enter:X6})}var bw=1,Y6=2,mi=0,Us=1,Wm=2,Ec=3,yw=["top","right","bottom","left"],Z6={"margin-top":"top","margin-right":"right","margin-bottom":"bottom","margin-left":"left","padding-top":"top","padding-right":"right","padding-bottom":"bottom","padding-left":"left","border-top-color":"top","border-right-color":"right","border-bottom-color":"bottom","border-left-color":"left","border-top-width":"top","border-right-width":"right","border-bottom-width":"bottom","border-left-width":"left","border-top-style":"top","border-right-style":"right","border-bottom-style":"bottom","border-left-style":"left"},vw={margin:"margin","margin-top":"margin","margin-right":"margin","margin-bottom":"margin","margin-left":"margin",padding:"padding","padding-top":"padding","padding-right":"padding","padding-bottom":"padding","padding-left":"padding","border-color":"border-color","border-top-color":"border-color","border-right-color":"border-color","border-bottom-color":"border-color","border-left-color":"border-color","border-width":"border-width","border-top-width":"border-width","border-right-width":"border-width","border-bottom-width":"border-width","border-left-width":"border-width","border-style":"border-style","border-top-style":"border-style","border-right-style":"border-style","border-bottom-style":"border-style","border-left-style":"border-style"},Q6=class{constructor(e){this.name=e,this.loc=null,this.iehack=void 0,this.sides={top:null,right:null,bottom:null,left:null}}getValueSequence(e,t){const n=[];let r="";return e.value.type!=="Value"||e.value.children.some(function(o){let i=!1;switch(o.type){case"Identifier":switch(o.name){case"\\0":case"\\9":r=o.name;return;case"inherit":case"initial":case"unset":case"revert":i=o.name}break;case"Dimension":switch(o.unit){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":i=o.unit}break;case"Hash":case"Number":case"Percentage":break;case"Function":if(o.name==="var")return!0;i=o.name;break;default:return!0}n.push({node:o,special:i,important:e.important})})||n.length>t||typeof this.iehack=="string"&&this.iehack!==r?!1:(this.iehack=r,n)}canOverride(e,t){const n=this.sides[e];return!n||t.important&&!n.important}add(e,t){function n(){const r=this.sides,o=Z6[e];if(o){if(!(o in r))return!1;const i=this.getValueSequence(t,1);if(!i||!i.length)return!1;for(const s in r)if(r[s]!==null&&r[s].special!==i[0].special)return!1;return this.canOverride(o,i[0])&&(r[o]=i[0]),!0}else if(e===this.name){const i=this.getValueSequence(t,4);if(!i||!i.length)return!1;switch(i.length){case 1:i[Us]=i[mi],i[Wm]=i[mi],i[Ec]=i[mi];break;case 2:i[Wm]=i[mi],i[Ec]=i[Us];break;case 3:i[Ec]=i[Us]}for(let s=0;s<4;s++)for(const a in r)if(r[a]!==null&&r[a].special!==i[s].special)return!1;for(let s=0;s<4;s++)this.canOverride(yw[s],i[s])&&(r[yw[s]]=i[s]);return!0}}return n.call(this)?(this.loc||(this.loc=t.loc),!0):!1}isOkToMinimize(){const e=this.sides.top,t=this.sides.right,n=this.sides.bottom,r=this.sides.left;if(e&&t&&n&&r){const o=e.important+t.important+n.important+r.important;return o===0||o===4}return!1}getValue(){const e=new je,t=this.sides,n=[t.top,t.right,t.bottom,t.left],r=[$n(t.top.node),$n(t.right.node),$n(t.bottom.node),$n(t.left.node)];r[Ec]===r[Us]&&(n.pop(),r[Wm]===r[mi]&&(n.pop(),r[Us]===r[mi]&&n.pop()));for(let o=0;o<n.length;o++)e.appendData(n[o].node);return this.iehack&&e.appendData({type:"Identifier",loc:null,name:this.iehack}),{type:"Value",loc:null,children:e}}getDeclaration(){return{type:"Declaration",loc:this.loc,important:this.sides.top.important,property:this.name,value:this.getValue()}}};function J6(e,t,n,r){const o=e.block.children,i=e.prelude.children.first.id;return e.block.children.forEachRight(function(s,a){const l=s.property;if(!vw.hasOwnProperty(l))return;const c=vw[l];let u,d;if((!r||i===r)&&c in t&&(d=Y6,u=t[c]),(!u||!u.add(l,s))&&(d=bw,u=new Q6(c),!u.add(l,s))){r=null;return}t[c]=u,n.push({operation:d,block:o,item:a,shorthand:u}),r=i}),r}function e7(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===bw?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function t7(e,t){const n={},r=[];Bt(e,{visit:"Rule",reverse:!0,enter(o){const i=this.block||this.stylesheet,s=(o.pseudoSignature||"")+"|"+o.prelude.children.first.id;let a,l;n.hasOwnProperty(i.id)?a=n[i.id]:(a={lastShortSelector:null},n[i.id]=a),a.hasOwnProperty(s)?l=a[s]:(l={},a[s]=l),a.lastShortSelector=J6.call(this,o,l,r,a.lastShortSelector)}}),e7(r,t.declaration)}var n7=1,r7=new Set(["src"]),Ew={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},Sw={cursor:["auto","crosshair","default","move","text","wait","help","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","pointer","progress","not-allowed","no-drop","vertical-text","all-scroll","col-resize","row-resize"],overflow:["hidden","visible","scroll","auto"],position:["static","relative","absolute","fixed"]},ww={"border-width":["border"],"border-style":["border"],"border-color":["border"],"border-top":["border"],"border-right":["border"],"border-bottom":["border"],"border-left":["border"],"border-top-width":["border-top","border-width","border"],"border-right-width":["border-right","border-width","border"],"border-bottom-width":["border-bottom","border-width","border"],"border-left-width":["border-left","border-width","border"],"border-top-style":["border-top","border-style","border"],"border-right-style":["border-right","border-style","border"],"border-bottom-style":["border-bottom","border-style","border"],"border-left-style":["border-left","border-style","border"],"border-top-color":["border-top","border-color","border"],"border-right-color":["border-right","border-color","border"],"border-bottom-color":["border-bottom","border-color","border"],"border-left-color":["border-left","border-color","border"],"margin-top":["margin"],"margin-right":["margin"],"margin-bottom":["margin"],"margin-left":["margin"],"padding-top":["padding"],"padding-right":["padding"],"padding-bottom":["padding"],"padding-left":["padding"],"font-style":["font"],"font-variant":["font"],"font-weight":["font"],"font-size":["font"],"font-family":["font"],"list-style-type":["list-style"],"list-style-position":["list-style"],"list-style-image":["list-style"]};function _w(e,t,n){const r=ii(e).basename;if(r==="background")return e+":"+$n(t.value);const o=t.id;let i=n[o];if(!i){switch(t.value.type){case"Value":const s={};let a="",l="",c=!1;t.value.children.forEach(function u(d){switch(d.type){case"Value":case"Brackets":case"Parentheses":d.children.forEach(u);break;case"Raw":c=!0;break;case"Identifier":{const{name:f}=d;a||(a=En(f).vendor),/\\[09]/.test(f)&&(l=RegExp.lastMatch),Sw.hasOwnProperty(r)?Sw[r].indexOf(f)===-1&&(s[f]=!0):Ew.hasOwnProperty(r)&&Ew[r].test(f)&&(s[f]=!0);break}case"Function":{let{name:f}=d;a||(a=En(f).vendor),f==="rect"&&(d.children.some(h=>h.type==="Operator"&&h.value===",")||(f="rect-backward")),s[f+"()"]=!0,d.children.forEach(u);break}case"Dimension":{const{unit:f}=d;switch(/\\[09]/.test(f)&&(l=RegExp.lastMatch),f){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":s[f]=!0}break}}}),i=c?"!"+n7++:"!"+Object.keys(s).sort()+"|"+l+a;break;case"Raw":i="!"+t.value.value;break;default:i=$n(t.value)}n[o]=i}return e+i}function o7(e,t,n){const r=ii(t.property);if(ww.hasOwnProperty(r.basename)){const o=ww[r.basename];for(const i of o){const s=_w(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function i7(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=_w(l,s,o),u=r[c];u&&!r7.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):o7(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function s7(e){const t={},n=Object.create(null);Bt(e,{visit:"Rule",reverse:!0,enter(r,o,i){const s=this.block||this.stylesheet,a=(r.pseudoSignature||"")+"|"+r.prelude.children.first.id;let l,c;t.hasOwnProperty(s.id)?l=t[s.id]:(l={},t[s.id]=l),l.hasOwnProperty(a)?c=l[a]:(c={},l[a]=c),i7.call(this,r,o,i,c,n)}})}function a7(e,t,n){const r=e.prelude.children,o=e.block.children,i=r.first.compareMarker,s={};n.nextUntil(t.next,function(a,l){if(a.type!=="Rule")return vc.call(r,a);if(e.pseudoSignature!==a.pseudoSignature)return!0;const c=a.prelude.children.head,u=a.block.children,d=c.data.compareMarker;if(d in s)return!0;if(r.head===r.tail&&r.first.id===c.data.id){o.appendList(u),n.remove(l);return}if(pw(o,u)){const f=c.data.id;r.some((h,m)=>{const p=h.id;if(f<p)return r.insert(c,m),!0;if(!m.next)return r.insert(c),!0}),n.remove(l);return}if(d===i)return!0;s[d]=!0})}function l7(e){Bt(e,{visit:"Rule",enter:a7})}function qm(e){return e.reduce((t,n)=>t+n.id.length+1,0)-1}function zm(e){let t=0;for(const n of e)t+=n.length;return t+e.length-1}function c7(e,t,n){const r=this.block!==null?this.block.avoidRulesMerge:!1,o=e.prelude.children,i=e.block,s=Object.create(null);let a=!0,l=!0;n.prevUntil(t.prev,function(c,u){const d=c.block,f=c.type;if(f!=="Rule"){const p=vc.call(o,c);return!p&&f==="Atrule"&&d&&Bt(d,{visit:"Rule",enter(v){v.prelude.children.forEach(w=>{s[w.compareMarker]=!0})}}),p}if(e.pseudoSignature!==c.pseudoSignature)return!0;const h=c.prelude.children;if(l=!h.some(p=>p.compareMarker in s),!l&&!a)return!0;if(a&&hw(h,o))return d.children.appendList(i.children),n.remove(t),!0;const m=j6(i.children,d.children);if(m.eq.length){if(!m.ne1.length&&!m.ne2.length)return l&&(zs(o,h),n.remove(u)),!0;if(!r)if(m.ne1.length&&!m.ne2.length){const p=qm(o),v=zm(m.eq);a&&p<v&&(zs(h,o),i.children.fromArray(m.ne1))}else if(!m.ne1.length&&m.ne2.length){const p=qm(h),v=zm(m.eq);l&&p<v&&(zs(o,h),d.children.fromArray(m.ne2))}else{const p={type:"SelectorList",loc:null,children:zs(h.copy(),o)},v=qm(p.children)+2;if(zm(m.eq)>=v){const w=n.createItem({type:"Rule",loc:null,prelude:p,block:{type:"Block",loc:null,children:new je().fromArray(m.eq)},pseudoSignature:e.pseudoSignature});return i.children.fromArray(m.ne1),d.children.fromArray(m.ne2overrided),a?n.insert(w,u):n.insert(w,t),!0}}}a&&(a=!h.some(p=>o.some(v=>v.compareMarker===p.compareMarker))),h.forEach(p=>{s[p.compareMarker]=!0})})}function u7(e){Bt(e,{visit:"Rule",reverse:!0,enter:c7})}function d7(e,t){const n=$6(e,t);t.logger("prepare",e),z6(e,t),t.logger("mergeAtrule",e),G6(e),t.logger("initialMergeRuleset",e),K6(e),t.logger("disjoinRuleset",e),t7(e,n),t.logger("restructShorthand",e),s7(e),t.logger("restructBlock",e),l7(e),t.logger("mergeRuleset",e),u7(e),t.logger("restructRuleset",e)}function f7(e,t){const n=new je;let r=!1,o;return e.nextUntil(e.head,(i,s,a)=>{if(i.type==="Comment"){if(!t||i.value.charAt(0)!=="!"){a.remove(s);return}if(r||o)return!0;a.remove(s),o=i;return}i.type!=="WhiteSpace"&&(r=!0),n.insert(a.remove(s))}),{comment:o,stylesheet:{type:"StyleSheet",loc:null,children:n}}}function m7(e,t,n,r){r.logger(`Compress block #${n}`,null,!0);let o=1;return e.type==="StyleSheet"&&(e.firstAtrulesAllowed=t,e.id=o++),Bt(e,{visit:"Atrule",enter(i){i.block!==null&&(i.block.id=o++)}}),r.logger("init",e),u6(e,r),r.logger("clean",e),R6(e,r),r.logger("replace",e),r.restructuring&&d7(e,r),e}function h7(e){let t="comments"in e?e.comments:"exclamation";return typeof t=="boolean"?t=t?"exclamation":!1:t!=="exclamation"&&t!=="first-exclamation"&&(t=!1),t}function p7(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function g7(e){return new je().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new je().appendData({type:"Selector",loc:null,children:new je().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function b7(e,t){e=e||{type:"StyleSheet",loc:null,children:new je},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:p7(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?t6(t.usage):!1},r=new je;let o=h7(t),i=!0,s,a,l=1,c;t.clone&&(e=Im(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=g7(e);do{if(a=f7(s,!!o),m7(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(je.createItem({type:"Raw",value:`
|
|
43
|
+
`})),r.insert(je.createItem(a.comment)),c.isEmpty||r.insert(je.createItem({type:"Raw",value:`
|
|
44
|
+
`}))),i&&!c.isEmpty){const u=c.last;(u.type!=="Atrule"||u.name!=="import"&&u.name!=="charset")&&(i=!1)}o!=="exclamation"&&(o=!1),r.appendList(c)}while(!s.isEmpty);return{ast:e}}var y7=ie({compress:()=>b7,find:()=>C7,findAll:()=>A7,findLast:()=>T7,fromPlainObject:()=>k7,generate:()=>w7,lexer:()=>v7,parse:()=>S7,specificity:()=>$m,toPlainObject:()=>L7,tokenize:()=>E7,walk:()=>_7});function Cw(e){const t=Om(e,!0),n=Om(e);return t.length<n.length?t:n}var{lexer:v7,tokenize:E7,parse:S7,generate:w7,walk:_7,find:C7,findLast:T7,findAll:A7,fromPlainObject:k7,toPlainObject:L7}=J9({node:{String:{generate(e){this.token(5,Cw(e.value))}},Url:{generate(e){const t=W1(e.value),n=Cw(e.value);this.token(7,t.length<=n.length+5?t:"url("+n+")")}}}}),{parse:N7,generate:Um,compress:x7}=y7;function hi(e,t,n,r){return t.debug,r}function O7(e){let t;return function(r,o){let i=r;if(o&&(i=`[${((Date.now()-t)/1e3).toFixed(3)}s] ${i}`),e>1&&o){let s=Um(o);e===2&&s.length>256&&(s=s.substr(0,256)+"..."),i+=`
|
|
45
|
+
${s}
|
|
46
|
+
`}t=Date.now()}}function R7(e){return e={...e},typeof e.logger!="function"&&e.debug&&(e.logger=O7(e.debug)),e}function Tw(e,t,n){Array.isArray(n)||(n=[n]),n.forEach(r=>r(e,t))}function M7(e,t,n){n=n||{};const r=n.filename||"<unknown>";let o;const i=hi("parsing",n,Date.now(),N7(t,{context:e,filename:r,positions:!!n.sourceMap}));n.beforeCompress&&hi("beforeCompress",n,Date.now(),Tw(i,n,n.beforeCompress));const s=hi("compress",n,Date.now(),x7(i,R7(n)));return n.afterCompress&&hi("afterCompress",n,Date.now(),Tw(s,n,n.afterCompress)),n.sourceMap?o=hi("generate(sourceMap: true)",n,Date.now(),(()=>{const a=Um(s.ast,{sourceMap:!0});return a.map._file=r,a.map.setSourceContent(r,t),a})()):o=hi("generate",n,Date.now(),{css:Um(s.ast),map:null}),o}function go(e,t){return M7("stylesheet",e,t)}var Aw={restructure:!0,forceMediaMerge:!0};function kw(e,t=[...e.querySelectorAll("style")],n={forceMediaMerge:!1}){if(!cssbeautify)return!1;let r=!1;if((!e.isConnected||e.ownerDocument===null)&&!(e instanceof Document)){const s=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null);if(e instanceof HTMLHtmlElement)s.replaceChild(e,s.documentElement);else if(e instanceof HTMLBodyElement||e instanceof HTMLHeadElement)s.documentElement.appendChild(e);else{const a=s.createElement("body");s.documentElement.appendChild(a),a.appendChild(e)}}const o=!!e.querySelector('[class*="noresp-em"]'),i=new Map;for(const s of t){if(n.forceMediaMerge&&s.innerHTML){const a=`
|
|
47
|
+
`+cssbeautify(go(s.innerHTML,Aw).css,{indent:" ",autosemicolon:!0})+`
|
|
48
|
+
`;s.innerHTML!==a&&(s.textContent=a,r=!0)}if(s.sheet&&Lw(e,s.sheet,o,i)){let a=I7(s.sheet);a=go(a,Aw).css,a=`
|
|
49
|
+
`+cssbeautify(a,{indent:" ",autosemicolon:!0})+`
|
|
50
|
+
`,s.innerHTML!==a&&(s.textContent=a,r=!0)}}return r}function Lw(e,t,n,r,o=new Set){let i=!1,s;try{s=t.cssRules}catch{return!1}for(let a=s.length-1;a>=0;a--){const l=s[a];if(l instanceof CSSStyleRule){let c=l.selectorText;n&&c.includes(".em-")&&(c=`${c}, ${c.replace(/\.em-/g,".noresp-em-")}`),P7(e,c,r)||(t.deleteRule(a),i=!0)}else if(l instanceof CSSGroupingRule)i=Lw(e,l,n,r,o)||i,l.cssRules.length||(t.deleteRule(a),i=!0);else if(l instanceof CSSFontFaceRule){const c=l.cssText;o.has(c)?(t.deleteRule(a),i=!0):o.add(c)}}return i}function P7(e,t,n){if(n.has(t))return n.get(t);let r=!1;try{r=!!e.querySelector(t)}catch{r=!0}return n.set(t,r),r}function I7(e){return Array.from(e.cssRules,t=>t.cssText).join(`
|
|
51
|
+
`)}var Nw=/device-width/i,D7="not all",pi=new Map,jm=!1;function B7(e){return"media"in e&&"cssRules"in e}function xw(e,t){for(const n of Array.from(e))B7(n)&&t(n),"cssRules"in n&&xw(n.cssRules,t)}function H7(e){try{return e.cssRules}catch{return}}function F7(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!Nw.test(n));return t.length?t.join(", "):D7}function Vm(e){pi.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||pi.delete(n)});for(const t of Array.from(e.styleSheets)){const n=H7(t);n&&xw(n,r=>{const o=r.media.mediaText;pi.has(r)||!Nw.test(o)||(pi.set(r,o),r.media.mediaText=F7(o))})}}function Ow(){pi.forEach((e,t)=>{t.media.mediaText=e}),pi.clear()}function $7(e){if(!jm)return e();Ow();try{return e()}finally{Vm(document)}}function W7(e){return e.some(t=>{const n=t.target;return n.nodeName==="STYLE"||n.parentNode?.nodeName==="STYLE"?!0:Array.from(t.addedNodes).some(r=>r.nodeName==="STYLE"||r instanceof Element&&!!r.querySelector("style"))})}function q7(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;jm=!0,Vm(t);const n=new MutationObserver(r=>{W7(r)&&Vm(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),Ow(),jm=!1}}function js(e){return se(e)}var Dne=se("extensions.atomsHandlers"),Bne=js("HANDLE_ATOM_INSERT"),Hne=se("HeadlessMode"),Fne=se("extensions.sandboxExtensions"),z7="SANDBOX_EXTENSION_SCRIPT_STATUS",$ne=se("MESSAGE_SERVICE"),Wne=js("SETTINGS_PANEL_EVENT"),qne=js("MODAL_SHOW_EVENT"),zne=js("MODAL_CLOSE_EVENT"),Une=js("MODAL_UPDATE_EVENT");function jne(e){return e}var Rw="SandboxApp",Gm="IframePluginRegistry",U7="__sandbox__";function Mw(){return Td(U7)}function j7(e=Mw()){return e.getOrCreateInstance(Gm,()=>new Cb)}var Xm=new FN(()=>j7()),Vs=class eL{constructor(){k(this,"container",Mw()),k(this,"pluginCollection",new HN(this,Xm)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new eL)}static registerPlugin(t,n){Xm.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&Xm.add(r,o)}}static use(t){return this.instance.pluginCollection.use(t)}static initFeatures(t){this.instance.initFeatures(t)}static onLifecycle(t){return this.instance.onLifecycle(t)}use(t){return typeof t=="function"?this.pluginCollection.useByCtor(t):this.pluginCollection.useByKey(t)}initFeatures(t){this.pluginCollection.initSync(t)}onLifecycle(t){return this.pluginCollection.onLifecycle(t)}dispose(){this.pluginCollection.dispose()}};k(Vs,"_instance",void 0);var Gs="data-extension";function Xs(e,t,n,r){z.send(z7,{key:e,phase:t,status:n,error:r})}function V7(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(Gs)||void 0}function Pw(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function Km(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,Xs(e.key,"ready","success"))}function Iw(e,t){return[...document.querySelectorAll(`${e}[${Gs}]`)].find(n=>n.getAttribute(Gs)===t)}function G7({type:e,attributes:t,key:n,innerHTML:r}){const o=document.createElement(e);if(t)for(const[i,s]of Object.entries(t))s!=null&&o.setAttribute(i,String(s));return o.setAttribute(Gs,n),r&&(o.innerHTML=r),e==="script"?t.type||o.setAttribute("type","text/javascript"):e==="style"&&(t.type||o.setAttribute("type","text/css")),o}function X7(e,t={}){const n=new Ee,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=u=>{let d=i.get(u);return d||(d=Pw(u),i.set(u,d)),d},l=u=>{if(u.type==="created"){const h=V7();if(!h)return;const m=a(h);m.hasSyncPlugins=!0,m.pendingPlugins.add(u.plugin),s.set(u.plugin,h);return}if(u.type==="create:error")return;const d=s.get(u.plugin);if(!d)return;const f=i.get(d);if(f){if(u.type==="afterInit:success"){f.pendingPlugins.delete(u.plugin),Km(f);return}(u.type==="init:error"||u.type==="afterInit:error")&&(f.pendingPlugins.delete(u.plugin),f.readyFailed=!0,Xs(d,"ready","error",`Sandbox plugin "${u.name}" failed during ${u.type==="init:error"?"init":"afterInit"}.`))}};n.addDisposable(Vs.onLifecycle(l)),n.addDisposable(z.addListener(ue.SANDBOX_ADD_EXTENSIONS,u=>{for(const d of u){if(t.surface&&d.surfaces&&!d.surfaces.includes(t.surface))continue;let f=r.get(d.key);f&&f.remove(),d.type==="script"&&i.set(d.key,Pw(d.key));const h=d.parent&&document.querySelector(d.parent)||document.head;if(f=G7(d),e.ownership.markService(f),d.type==="script"){const m=f;m.src&&(m.onload=()=>{const p=a(d.key);p.loadedNotified=!0,Xs(d.key,"load","success"),Km(p)},m.onerror=()=>Xs(d.key,"load","error",`Failed to load sandbox script: ${m.src}`))}if(h.appendChild(f),d.type==="script"&&!f.src){const m=a(d.key);m.loadedNotified=!0,Xs(d.key,"load","success"),Km(m)}r.set(d.key,f),o.set(d.key,d)}})),n.addDisposable(z.addListener(ue.SANDBOX_REMOVE_EXTENSIONS,u=>{for(const d of u){const f=Iw(o.get(d)?.type,d);f&&f.remove(),r.delete(d),o.delete(d)}})),n.addDisposable(e.onChange(()=>{e.applyHidden(()=>c())}));function c(){for(const[u,d]of r){const f=o.get(u);if(!f)continue;const h=Iw(f.type,u);let m=f.parent?[...document.querySelectorAll(f.parent)]:[];m.length||(m=[document.head]),h?h!==d?r.set(u,h):m.some(p=>h.parentNode===p)||m[0]?.appendChild(h):m[0]?.appendChild(d)}}return n}function K7(e){e.querySelectorAll(`[${Gs}]`).forEach(t=>t.remove())}var bo="remove-basic-cell",Y7="remove-basic-row",yo="em-active-table-cell",Z7="em-temporary-class",Ir="em-temporary-active-cell-background-color",Dr="temporary-cell-class",Sc=[bo,Y7,yo,Z7,Dr,Ir],Q7=["contenteditable","em-edit","em-state","em-hover"],Dw=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;"> </div>`,Ks="em-table-menu",Ys="em_version";function wc(e){if(!e||!e.includes("em_version"))return e;try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.has("em_version")?(n.searchParams.delete(Ys),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function J7(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(Ys,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${Ys}=${Date.now()}`}}var eH=/^(chrome-extension|moz-extension|safari-extension):\/\//i,tH=/local\.adguard\.org/i,nH=/^bis_/i,rH=new Set(["data-bis-config"]),gi=/<script\b(?=[^>]*(?:\bbis_use(?:=|\s)|\bdata-bis-config(?:=|\s)|\bdata-dynamic-id(?:=|\s)|local\.adguard\.org|(?:chrome-extension|moz-extension|safari-extension):\/\/))[^>]*>[\s\S]*?<\/script>/gi,oH=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,_c=/<style\b[^>]*>[\s\S]*?<\/style>/gi,Bw=/display:\s*none\s*!important/gi,Hw="data-darkreader-",iH=/<(script|style)\b[\s\S]*?<\/\1\s*>|<[a-z][^\s<>]*(?:"[^"]*"|'[^']*'|[^<>"'])*?\sdata-darkreader-(?:"[^"]*"|'[^']*'|[^<>"'])*>/gi,sH=/\sdata-darkreader-[a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+))?/gi,aH=[".socialshare,",".advertisment,",".adHolder,",".adsbygoogle-noablate","#ab_adblock","#popmechanic-snippet","filter_ads_by_classname","clever-core-ads","--gn-ov-ad-height","pub_728x90.text-ad.textAd","html-load.com/player","content-loader.com/player",".adblock","#advblock","body { overflow: visible!important; }"],Fw=new Set(["em","data-theme-varibalse","data-em-localization"]);function lH(e){return Bw.lastIndex=0,(e.match(Bw)||[]).length}function Ym(e){const t=e.trim(),n=lH(t);if(n===0)return!1;if(t.includes(".advertisment,")&&t.includes(".adHolder,")&&(t.includes(".socialshare,")||n>=3||t.length>2e3))return!0;const r=aH.filter(o=>t.includes(o)).length;return r>=1&&(n>=3||t.length>2e3)||n>=5&&r>=1?!0:n>=20&&/\b(?:\.ad(?:s|vert|vertisment|Holder|banner|box|Container|Wrapper)?[,{]|#ad[-_]|ins\.adsbygoogle)/i.test(t)}function cH(e){if(Fw.has("em")&&e.getAttribute("em")==="styles")return!1;for(const t of Fw)if(e.hasAttribute(t))return!1;return Ym(e.textContent||"")}function uH(e){return eH.test(e.src)||tH.test(e.src)?!0:e.hasAttribute("bis_use")||e.hasAttribute("data-bis-config")}function $w(e){let t=!1;for(const n of[...e.attributes])(nH.test(n.name)||rH.has(n.name))&&(e.removeAttribute(n.name),t=!0);return t}function dH(e){_c.lastIndex=0;for(const t of e.matchAll(_c))if(Ym(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function fH(e){let t=!1;return _c.lastIndex=0,{html:e.replace(_c,n=>Ym(n.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):n),found:t}}function Ww(e){let t=!1;return e instanceof Element&&$w(e)&&(t=!0),e.querySelectorAll("script").forEach(n=>{uH(n)&&(n.remove(),t=!0)}),e.querySelectorAll("style").forEach(n=>{n.tagName==="STYLE"&&cH(n)&&(n.remove(),t=!0)}),e.querySelectorAll("*").forEach(n=>{$w(n)&&(t=!0)}),t}function mH(e){return gi.lastIndex=0,gi.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||dH(e)}function hH(e){return e.toLowerCase().startsWith(Hw)}function pH(e){return e.toLowerCase().includes(Hw)?e.replace(iH,(t,n)=>n?t:t.replace(sH,"")):e}function gH(e){const t=pH(e);if(!mH(t))return{html:t,found:!1};let n=!1,r=t;gi.lastIndex=0,gi.test(r)&&(gi.lastIndex=0,r=r.replace(gi,""),n=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(r)||/\sdata-bis-config\s*=/.test(r))&&(r=r.replace(oH,""),n=!0);const o=fH(r);return r=o.html,n=n||o.found,{html:r,found:n}}var bH=class extends Ee{constructor(...e){super(...e),k(this,"_transforms",[]),k(this,"_byAttribute",new Map)}register(e){this._transforms.push(e);for(const t of e.attributes){const n=t.toLowerCase(),r=this._byAttribute.get(n);r?r.push(e):this._byAttribute.set(n,[e])}return{dispose:()=>this._remove(e)}}_remove(e){const t=this._transforms.indexOf(e);if(t!==-1){this._transforms.splice(t,1);for(const n of e.attributes){const r=n.toLowerCase(),o=this._byAttribute.get(r);if(!o)continue;const i=o.indexOf(e);i!==-1&&o.splice(i,1),o.length||this._byAttribute.delete(r)}}}get isEmpty(){return this._transforms.length===0}handles(e){return this._byAttribute.has(e.toLowerCase())}get attributes(){return[...this._byAttribute.keys()]}render(e,t){return this._run("render",e,t)}serialize(e,t){return this._run("serialize",e,t)}_run(e,t,n){const r=this._byAttribute.get(n.attribute.toLowerCase());if(!r?.length)return t;const o=e==="render"?r:[...r].reverse();let i=t;for(const s of o){if(i===null)break;const a=e==="render"?s.render?.(i,n):s.serialize?.(i,n);a!==void 0&&(i=a)}return i}dispose(){this._transforms.length=0,this._byAttribute.clear(),super.dispose()}};function Zm(){return Mt.getInstance(Po)}var Cc=new WeakMap;function yH(e,t,n){const r=Cc.get(e);r?r.set(t.toLowerCase(),n):Cc.set(e,new Map([[t.toLowerCase(),n]]))}function vH(e,t){const n=Cc.get(e);n?.size&&Cc.set(t,new Map(n))}function qw(e,t,n){const r=e.tagName.toLowerCase();for(const o of t.attributes){if(!e.hasAttribute(o))continue;const i=e.getAttribute(o)??"",s=t.serialize(i,{element:e,tag:r,attribute:o,stage:n});s===null?e.removeAttribute(o):s!==i&&e.setAttribute(o,s)}}function Tc(e,t={}){const n=t.pipeline??Zm(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),nn(e,o),n&&!n.isEmpty&&zw(e,o)),!n||n.isEmpty)return o;o instanceof Element&&qw(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)qw(s,n,r);return o}function EH(e,t={}){const n=t.pipeline??Zm(),r=WM(e);if((!n||n.isEmpty)&&!r)return _r(e);const o=Tc(e,{...t,pipeline:n,clone:!0});return Zo(o),Qg(o)}function zw(e,t){vH(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)zw(n[o],r[o])}function Ht(e,t,n,r={}){const o=Qm(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function Qm(e,t,n,r={}){const o=r.pipeline??Zm();if(!o||!o.handles(t))return n;const i=e?.tagName.toLowerCase()??"",s=o.render(n,{element:e,tag:i,attribute:t,stage:r.stage??"build"});if(s!==n){const a=r.owner??e;a&&yH(a,t,n)}return s}function SH(e){const t=new bH,n=rb((o,i,s)=>t.isEmpty?s:Qm(o,i,s,{pipeline:t})),r=jL((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(Po,t),{pipeline:t,dispose(){r(),n(),t.dispose(),bn(e,Po)}}}function wH(e){return wc(e)}function Uw(e){const t=(n,r)=>{const o=n.getAttribute(r);if(!o)return;const i=wH(o);i!==o&&n.setAttribute(r,i)};e.querySelectorAll("[src]").forEach(n=>t(n,"src")),e.querySelectorAll("[___src]").forEach(n=>t(n,"___src"))}var jw=[".em-code",':not(editor)[contenteditable="false"]','.em-vindent[class*="em-vindent-padding"]',"#gtx-anchor",'[data-mce-bogus="1"]','style[data-theme-varibalse="true"]','style[data-em-localization="true"]',".em-element-img-change-group",".em-element-resize-img",".em-element-editor",".em-element-vindent-bg",".em-element-gap",".em-element-gap-marker",".em-element-gap-bg",".em-gap",".em-powered-logo",".em-element-vindent-value"],_H=["contenteditable","em-edit","em-state","em-hover"],CH=["[data-mce-caret=before]","span.em-element-resize-img-container","div.em-element-img-change-group","div.em-element-block-add","meta[http-equiv=Content-Security-Policy]","[class*=mce-]","script[em=initial]",".em-editor-wrapper",".em-element-resize-height",".em-element-vindent-remove",".em-element-vindent",".em-element-vindent-value","div.iframe-resizer-inner"],TH=new Set(["normal","400"]),AH=new Set(["normal"]),kH=new Set(["baseline","unset","initial",""]),Vw=new Set(["none",""]),LH=["b","strong","em","i","u","s","strike","sup","sub"],NH="___em-internal",Gw=["em-block-insert-empty","em-atom-insert-empty","em-block-insert-body","em-atom-insert-body","em-resize-start","sortable-chosen","sortable-ghost","em-vindent-table","em-vindent_low","em-vindent","em-relative","em-display-block","em-sandbox-discuss_set-target","em-sandbox-discuss","em-native-img-uploading","em-native-img-drop-target","em-native-img-drop-loading","em-native-file-drag"],xH=["em-block-insert","em-block-insert_bottom-document","em-block-insert_top-document","em-block-insert_bottom","em-block-insert_top","em-blockatom-insert","em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],OH=[...jw,...CH].filter(e=>/\.em-(element-|gap|vindent)/.test(e)&&e!=="span.em-element-resize-img-container").join(", "),RH=_H.filter(e=>!jw.some(t=>t.includes(`[${e}`))),MH=[...Gw,...xH],PH={isServiceAttribute:e=>RH.includes(e)||hH(e),isServiceClass:e=>MH.includes(e),isServicePanel:e=>e.matches(OH)||e.hasAttribute("data-em-caret")};function Xw(e){Sc.forEach(t=>{e.querySelectorAll(`.${t}`).forEach(n=>n.classList.remove(t))})}function Ac(e){e.querySelectorAll(".em-block-insert").forEach(n=>{n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-block-insert_bottom").forEach(n=>{n.classList.remove("em-block-insert_bottom")}),e.querySelectorAll(".em-block-insert_top").forEach(n=>{n.classList.remove("em-block-insert_top")}),e.querySelectorAll(".em-blockatom-insert").forEach(n=>{n.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-atom-insert").forEach(n=>{n.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),Gw.forEach(n=>{e.querySelectorAll(`.${n}`).forEach(r=>r.classList.remove(n))}),e.querySelectorAll(".em-powered-logo").forEach(n=>n.remove());for(const n of e.querySelectorAll("[class='']"))n.removeAttribute("class");const t=e instanceof Document?e.documentElement:e;t&&(Lt(t,"[data-mce-caret=before]",!0),Lt(t,"span.em-element-resize-img-container"),Lt(t,"div.em-element-img-change-group",!0),Lt(t,"div.em-element-block-add",!0),Lt(t,"meta[http-equiv=Content-Security-Policy]",!0),Lt(t,"[class*=mce-]"),Lt(t,"script[em=initial]",!0),Lt(t,".em-editor-wrapper",!0),Lt(t,".em-element-resize-height",!0),Lt(t,".em-element-vindent-remove",!0),Lt(t,".em-element-vindent",!0),Lt(t,".em-element-vindent-value",!0),Lt(t,"div.iframe-resizer-inner"))}function IH(e){e.querySelectorAll("tbody").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll(".em-code").forEach(t=>t.remove()),e.querySelectorAll(':not(editor)[contenteditable="false"]').forEach(t=>t.remove()),e.querySelectorAll('.em-vindent[class*="em-vindent-padding"]').forEach(t=>t.remove()),e.querySelectorAll(".em-code").forEach(t=>t.remove()),e.querySelectorAll("[contenteditable]").forEach(t=>t.removeAttribute("contenteditable")),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")),e.querySelectorAll("[em-state]").forEach(t=>t.removeAttribute("em-state")),e.querySelectorAll("[em-hover]").forEach(t=>t.removeAttribute("em-hover")),e.querySelectorAll("#gtx-anchor").forEach(t=>t.remove()),e.querySelectorAll('[data-mce-bogus="1"]').forEach(t=>t.remove()),e.querySelectorAll("strike").forEach(t=>t.removeAttribute("style")),e.querySelectorAll("u").forEach(t=>t.removeAttribute("style")),e.querySelectorAll('style[data-theme-varibalse="true"]').forEach(t=>t.remove()),e.querySelectorAll('style[data-em-localization="true"]').forEach(t=>t.remove()),e.querySelectorAll(".em-element-img-change-group").forEach(t=>t.remove()),e.querySelectorAll(".em-element-resize-img").forEach(t=>t.remove()),e.querySelectorAll(".em-element-editor").forEach(t=>t.remove()),e.querySelectorAll(".em-element-vindent-bg").forEach(t=>t.remove()),e.querySelectorAll(".em-element-vindent-value").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap-marker").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap-bg").forEach(t=>t.remove()),e.querySelectorAll(".em-gap").forEach(t=>t.remove()),e.querySelectorAll(".em-just-inserted").forEach(t=>t.classList.remove("em-just-inserted")),e.querySelectorAll(".em-native-img-uploading").forEach(t=>t.classList.remove("em-native-img-uploading")),e.querySelectorAll(".em-native-img-drop-target").forEach(t=>t.classList.remove("em-native-img-drop-target")),e.querySelectorAll(".em-native-img-upload-spin-overlay").forEach(t=>t.remove()),e.querySelectorAll(".em-element-list-bullet").forEach(t=>t.classList.remove("em-element-list-bullet")),e.querySelectorAll(".remove-new-editor-element").forEach(t=>t.classList.remove("remove-new-editor-element")),Xw(e),Ac(e),Yv(e),Lt(e,"editor",!1),Yw(e),Uw(e),Ww(e)}function Zs(e){return(e??"").trim().toLowerCase()}function DH(e){const t=Zs(e.style.fontWeight);t&&TH.has(t)&&e.style.removeProperty("font-weight");const n=Zs(e.style.fontStyle);n&&AH.has(n)&&e.style.removeProperty("font-style");const r=Zs(e.style.verticalAlign);r&&kH.has(r)&&e.style.removeProperty("vertical-align");const o=Zs(e.style.textDecorationLine);o&&Vw.has(o)&&e.style.removeProperty("text-decoration-line");const i=Zs(e.style.textDecoration);i&&Vw.has(i)&&e.style.removeProperty("text-decoration");const s=e.getAttribute("style");s!==null&&s.trim()===""&&e.removeAttribute("style")}function BH(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Kw(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==NH)return!1;return!0}function Yw(e){const t=Array.from(e.querySelectorAll("span"));for(let n=t.length-1;n>=0;n-=1){const r=t[n];DH(r),Kw(r)&&BH(r)}for(const n of LH){const r=Array.from(e.querySelectorAll(n));for(let o=r.length-1;o>=0;o-=1){const i=r[o];i.childNodes.length===0&&Kw(i)&&i.remove()}}}function HH(e){const t=[],n=zH(e);return e=WH(e,t,n),e=e.replaceAll(/<script[^>]*\bdata-amd-module-id\s*=[^>]*>[\s\S]*?<\/script>/gi,""),e=e.replaceAll(/<script[^>]*\/iframe\/js\/[^>]*>[\s\S]*?<\/script>/gi,""),e=e.replaceAll(/<style\b[^>]*ad-right-container[^>]*>[\s\S]*?<\/style>/gi,""),e=Dl.clear(e),e=Jm(e),t.length===0?e:jH(e,t,n)}var Zw=`(<(script|style)\\b[^>]*>)([\\s\\S]*?)(?=<\\/\\2${Va})`,FH=new RegExp(Zw,"gi"),$H=new RegExp(`<!--[\\s\\S]*?-->|${Zw}`,"gi");function WH(e,t,n){const r=(o,i,s,a)=>!a||!UH(s,i)?i+a:(t.push(s.toLowerCase()==="style"?qH(a):a),`${i}${n}${t.length-1}${Jw}`);return e.replaceAll($H,(o,i,s,a)=>i===void 0?o.replaceAll(FH,r):r(o,i,s??"",a??""))}function qH(e){const t=Jm(Dl.clear(`>${e}`));return t.startsWith(">")?t.slice(1):Jm(Dl.clear(e))}var Qw="",Jw="";function zH(e){let t=Qw;for(;e.includes(t);)t+=Qw;return t}function UH(e,t){const n=document.createElement(e),r=/\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(t);return r&&n.setAttribute("type",r[1]??r[2]??r[3]),yn(n)}function jH(e,t,n){return e.replaceAll(new RegExp(`${n}(\\d+)${Jw}`,"g"),(r,o)=>t[Number(o)]??r)}function Jm(e){e=e.replaceAll(/\uFEFF/gmu,""),e=e.replaceAll(/<link[^>]*?em="css.*?>/gis,""),e=e.replaceAll(/draggable="false"|draggable="true"/gi,""),e=e.replaceAll(/ style="\s*"/gi,""),e=e.replaceAll(/<tbody.*?>/gi,"").replaceAll(/<\/tbody>/gi,""),e=e.replaceAll(/&nbsp;/gi," ").replaceAll(/&zwnj;/gi,"‌"),e=e.replaceAll(/style="transform: translateZ\(0px\);"/gi,""),e=e.replaceAll(/ +>/gi,">"),e=e.replaceAll(/&/gi,"&"),e=e.replaceAll(/"/gi,""),e=e.replaceAll(/^\s*$(?:\r\n?|\n)/gm,""),e=e.replaceAll(/ em-floatblock-width=".*?"/gi,""),e=e.replaceAll(/<div[^>]*?class="jfk-bubble.*?jfk-bubble-arrowimplafter".*?><\/div><\/div><\/div>/gis,""),e=e.replaceAll(/<span[^>]*?style="text-decoration: underline;"[^>]*?>(<a[^>]*?href.*?a>)<\/span>/gis,"$1"),e=e.replaceAll(/ rel="noopener"/gi,""),e=e.replaceAll(/ em-insert-ignore/gi,""),e=e.replaceAll(/ class="\s*"/gi,""),e=e.replaceAll(/<!--<em-root-text>(.*?)-->/gis,"$1"),e=e.replaceAll(/class="em-block.*?"/gi,""),e=e.replaceAll(/data-percent="[^"]*"/g,""),e=e.replaceAll(/em-optimise="[^"]*"/g,""),e=e.replaceAll(/em-optimise-error="[^"]*"/g,"");const t=e.match(/((rgb)\(\d{1,3}(,\s?\d{1,3}){2}\))/gi);return t&&t.forEach(n=>{const r=V(n);r&&(e=e.replaceAll(n,r))}),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function e_(e){switch(e.toLowerCase()){case"tr":return document.createElement("table");case"td":return document.createElement("tr");case"head":case"body":return document.createElement("html");default:return document.createElement("div")}}function VH(e,t){if(t.some(l=>l.nodeName==="HTML")){for(const l of t)e.appendChild(l);return}const n=t.find(l=>l.nodeType===Node.DOCUMENT_TYPE_NODE),r=t.find(l=>l.nodeName==="HEAD"),o=t.find(l=>l.nodeName==="BODY");n&&e.appendChild(n);const i=e.createElement("html"),s=r??e.createElement("head"),a=o??e.createElement("body");i.append(s,a);for(const l of t)l===n||l===r||l===o||l.nodeName==="HTML"||l.nodeName==="HEAD"||l.nodeName==="BODY"||a.appendChild(l);e.appendChild(i)}function t_(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return $7(()=>kw(document,e,{forceMediaMerge:!0}))}function GH(e){let t=!1;return e.beforeCommit(()=>{try{!t&&e.takeStyleDirty()&&(t=!0,t_(),e.takeStyleDirty())}finally{t=!1}})}function kc(e){let t=e.html??"";const n=e.node,r=e.isBlock??!1,o=e.isPartial??!1;if(r||o){let i,s="div";if(n){if(s=n.tagName??"div",s==="DOCTYPE"||s==="html")return kc({node:n});i=e_(s);const a=n.cloneNode(!0);nn(n,a),i.appendChild(a)}else{const a=t.trim(),l=a.match(/<\!?([a-zA-Z]{1,})[^>]*>/i);if(s=l?l[1]:"div",s==="DOCTYPE"||s==="html")return kc({html:t});i=e_(s);const c=Le(a);i.replaceChildren(...c)}Tc(i,{stage:"apply"}),IH(i),t=kt(i),s.toLowerCase()==="head"&&(t=t.replace("<body></body>","")),s.toLowerCase()==="body"&&(t=t.replace("<head></head>",""))}else{const i=document.implementation.createHTMLDocument();for(const s of[...i.childNodes])s.remove();if(t)VH(i,Le(t));else if(n){const s=n.cloneNode(!0);nn(n,s),i.appendChild(s)}i.documentElement&&(i.querySelectorAll("tbody").forEach(s=>s.replaceWith(...Array.from(s.childNodes))),i.querySelectorAll(".em-code").forEach(s=>s.remove()),i.querySelectorAll(':not(editor)[contenteditable="false"]').forEach(s=>s.remove()),i.querySelectorAll(".em-code").forEach(s=>s.remove()),i.querySelectorAll("[contenteditable]").forEach(s=>s.removeAttribute("contenteditable")),i.querySelectorAll("[em-edit]").forEach(s=>s.removeAttribute("em-edit")),i.querySelectorAll("[em-state]").forEach(s=>s.removeAttribute("em-state")),i.querySelectorAll("[em-hover]").forEach(s=>s.removeAttribute("em-hover")),i.querySelectorAll(".em-just-inserted").forEach(s=>s.classList.remove("em-just-inserted")),i.querySelectorAll(".em-native-img-uploading").forEach(s=>s.classList.remove("em-native-img-uploading")),i.querySelectorAll(".em-native-img-drop-target").forEach(s=>s.classList.remove("em-native-img-drop-target")),i.querySelectorAll(".em-native-img-upload-spin-overlay").forEach(s=>s.remove()),i.body?.classList.remove("em-native-img-drop-loading"),i.body?.classList.remove("em-native-file-drag"),i.querySelectorAll("#gtx-anchor").forEach(s=>s.remove()),i.documentElement.removeAttribute("style"),i.querySelectorAll('style[data-theme-varibalse="true"]').forEach(s=>s.remove()),i.querySelectorAll('style[data-em-localization="true"]').forEach(s=>s.remove()),K7(i),Xw(i),Ac(i),Yv(i),i.documentElement&&Lt(i.documentElement,"editor",!1),i.querySelectorAll("ya-tr-span").forEach(s=>{s.parentNode&&(Array.from(s.childNodes).forEach(a=>s.parentNode.insertBefore(a,s)),s.remove())}),Yw(i)),Tc(i,{stage:"apply"}),Uw(i),Ww(i),t=Pt(i)}return gH(HH(t)).html}function eh(e,t){const{target:n}=e;setTimeout(()=>{const r=n?.querySelector("a");if(!r)return;const o=r.closest("div, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");o&&(o.childNodes.forEach(i=>{if(i.nodeType===Node.COMMENT_NODE&&i.nodeValue?.includes("[if mso]")){const s=r.innerHTML.length*11+40;i.nodeValue=i.nodeValue.replace(/(<center[^>]*>)(.*?)(<\/center>)/s,(a,l,c,u)=>l+r.innerHTML+u).replace(/(width:)(\d+)(px)/,(a,l,c,u)=>`${l}${s}${u}`)}}),t(!1))},0)}var n_="__emOwnEditor";function XH(e){e[n_]=!0,Mv(e)}function r_(e){const t=[e.closest("editor"),...Array.from(e.querySelectorAll("editor"))],n=e.ownerDocument.activeElement;let r=!1;for(const o of t)o&&!o[n_]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var KH=["deleteContentBackward","deleteContentForward","deleteByCut"],YH={deleteContentBackward:"backward",deleteContentForward:"forward"};function ZH(e){const{element:t,getVisibleText:n,setCursorToElement:r,hasOnlyTextNodesDeep:o,isRangeCoveringAllVisibleText:i,isEditorContentOnlyNbsp:s,commit:a,pasteFragment:l}=e,c=w=>Dt(w)?kf(w):e.mapFn(w);function u(w){return!n(w,c).trim()&&!w.querySelector(o_)}const d=w=>n(w,c).trim();function f(w,_){const A=document.createRange();A.selectNodeContents(_);const b=w.cloneRange();return b.compareBoundaryPoints(b.START_TO_START,A)<0&&b.setStart(A.startContainer,A.startOffset),b.compareBoundaryPoints(b.END_TO_END,A)>0&&b.setEnd(A.endContainer,A.endOffset),th(n(b.cloneContents(),c).trim(),d(_))}function h(w){w.insertAdjacentHTML("beforebegin"," "),w.removeAttribute("em-edit"),w.remove()}function m(w,_){if(!_.collapsed)return!1;const A=document.createRange();return A.setStart(_.endContainer,_.endOffset),A.setEnd(w,w.childNodes.length),!n(A.cloneContents(),c).trim()}function p(w,_=nh(w,d)){const[A,...b]=_,g=A??w;if(!A&&JH(w)){const y=document.createTextNode(" ");w.replaceChildren(y),r(y);return}const E=document.createElement(A&&A.tagName!=="EDITOR"?A.tagName:"div"),T=document.createTextNode(" ");if(A&&g.tagName===E.tagName)for(const{name:y,value:S}of Array.from(g.attributes))E.setAttribute(y,S);t5(E,A?w:oF(w),g,iF),E.getAttribute("style")||E.removeAttribute("style"),b.filter(y=>y.tagName!=="TBODY").reduce((y,S)=>y.appendChild(rF(S)),E).append(T),w.tagName==="A"||w.parentNode&&w.parentNode.tagName==="A"?w.replaceChildren(T):w.replaceChildren(E),r(T)}function v(w,_){if(_.collapsed)return!1;const A=nh(w,d);return Qv(_,void 0,YP)?(u(w)&&p(w,A),t.setAttribute("em-edit","active"),a(!0),!0):!1}return function(_){const A=_.target,b=window.getSelection();if(!b||b.rangeCount===0)return;if(_.inputType==="insertFromPaste"&&l&&!_.defaultPrevented){l(_);return}const g=YH[_.inputType];if(g&&GP(b.getRangeAt(0),g)){_.preventDefault();return}if(KH.includes(_.inputType)&&v(A,b.getRangeAt(0))){_.preventDefault();return}const E=n(A,c).trim(),T=n(b.getRangeAt(0)?.cloneContents(),c).trim(),y=b.getRangeAt(0),S=y.startContainer,C=(S.nodeType===Node.TEXT_NODE?S.parentNode:S).closest("sup, sub");if((_.inputType==="deleteContentBackward"||_.inputType==="deleteByCut")&&!b?.isCollapsed&&T){if(C&&f(y,C)&&h(C),th(T,E)&&!A.querySelector(Qs)){_.preventDefault(),p(A),t.setAttribute("em-edit","active"),a(!0);return}t.setAttribute("em-edit","active"),a(!0)}if(_.inputType==="deleteContentBackward"&&b?.isCollapsed&&!T){S.length===1&&(C&&d(C).length===1&&h(C),t.setAttribute("em-edit","active"),a(!0));const L=()=>{d_(_)&&a(!0)};if(S.nodeType!==Node.TEXT_NODE&&!i(y))return L();const x=y.startOffset;if(x===0&&!i(y))return L();const N=S.parentNode;if(!N)return L();const W=Array.prototype.indexOf.call(N.childNodes,S);if(N.childNodes[W-1]?.nodeType===Node.COMMENT_NODE){_.preventDefault(),S.deleteData(x-1,1);const R=document.createRange();R.setStart(S,x-1),R.collapse(!0),b.removeAllRanges(),b.addRange(R),a(!0);return}A&&s(A)&&(_.preventDefault(),_.stopImmediatePropagation())}if(_.inputType==="insertText"&&!b?.isCollapsed){_.preventDefault();let L=_.data||"";const x=b.anchorNode;i(y)&&(x.tagName==="A"||x?.parentNode&&x.parentNode.tagName==="A")&&(L=" "+_.data),y.deleteContents();const N=document.createTextNode(L||" ");y.insertNode(N),y.setStartAfter(N),y.collapse(!0),b.removeAllRanges(),b.addRange(y),$f(N,N,wf),a(!0);return}if(QH.test(_.inputType)){const L=aF(_,b.getRangeAt(0));if(!L||(_.preventDefault(),XP(A,L))||(b.removeAllRanges(),b.addRange(L),v(A,L)))return;const x=nh(A,d);u_("delete"),u(A)&&p(A,x),a();return}if(_.inputType==="deleteContentForward"&&!A.querySelector(Qs)&&(b.isCollapsed?E.length<2&&!m(A,y):th(T,E))){_.preventDefault(),p(A),a(!0);return}if(_.inputType==="deleteContentForward"&&b.isCollapsed&&s(A)&&!A.querySelector(Qs)){_.preventDefault(),_.stopImmediatePropagation();return}if(_.inputType.includes("deleteContent")&&(E.length<2||E===T)&&o(A)&&!A.querySelector(Qs)&&!(_.inputType==="deleteContentForward"&&m(A,y))){_.preventDefault(),p(A),a(!0);return}if(_.inputType==="insertText"&&_.data&&i_(b,_.data)){_.preventDefault(),_.stopImmediatePropagation(),a(!0);return}if(_.inputType==="deleteContentBackward"&&!b.isCollapsed&&!T&&A&&s(A)&&(_.preventDefault(),_.stopImmediatePropagation()),d_(_)){a(!0);return}a()}}var Qs="em-replace, img, picture, video, audio, svg, canvas, iframe, object, hr, input, button",o_=`${Qs}, table`,QH=/^delete(Word|SoftLine|HardLine)/;function i_(e,t){const n=e.anchorNode,r=n;if(r?.tagName==="A"&&!r.textContent?.trim().length){r.insertAdjacentText("beforeend",t);const o=document.createRange();return o.selectNodeContents(r),o.collapse(!1),e.removeAllRanges(),e.addRange(o),!0}if(n?.parentNode?.tagName==="A"||r?.tagName==="A"){const o=e.getRangeAt(0),i=document.createTextNode(t);return o.insertNode(i),o.setStartAfter(i),o.collapse(!0),e.removeAllRanges(),e.addRange(o),$f(i,i,wf),!0}return!1}function th(e,t){return e.replace(/\s+/g," ")===t.replace(/\s+/g," ")}function JH(e){return[s_(e,"previousSibling"),s_(e,"nextSibling")].some(t=>t?.nodeType===Node.TEXT_NODE?!0:t instanceof HTMLElement&&/^(EM-REPLACE|A|IMG|SUB|SUP|SPAN|B|STRONG|I|EM|U|S|FONT)$/.test(t.tagName))}function s_(e,t){let n=e[t];for(;n?.nodeType===Node.TEXT_NODE&&!n.textContent?.trim();)n=n[t];return n}var eF=/^(AREA|BASE|BR|COL|EMBED|HR|IMG|INPUT|LINK|META|SOURCE|TRACK|WBR)$/,a_=/^(SPAN|B|STRONG|I|EM|U|S|STRIKE|FONT|SMALL|BIG|MARK)$/,tF={TABLE:["THEAD","TBODY","TFOOT","TR"],THEAD:["TR"],TBODY:["TR"],TFOOT:["TR"],TR:["TD","TH"]};function nh(e,t){const n=t(e),r=[];for(let o=l_(e,n,t);o;o=nF(o,n,t))r.push(o);return r}function l_(e,t,n){const r=c_(e,n);if(!(!r||eF.test(r.tagName)||r.tagName!=="TABLE"&&r.matches(o_)))return!(r.tagName==="A"||a_.test(r.tagName))||n(r)===t?r:void 0}function nF(e,t,n){const r=tF[e.tagName];if(r)return Array.from(e.children).find(i=>r.includes(i.tagName));if(e.tagName==="TD"||e.tagName==="TH")return l_(e,t,n);const o=c_(e,n);return o&&a_.test(o.tagName)&&n(o)===t?o:void 0}function c_(e,t){for(const n of Array.from(e.childNodes))if(!(Dt(n)&&!t(n))){if(n.nodeType===Node.ELEMENT_NODE)return n;if(t(n))return}}function rF(e){const t=e.cloneNode(!1);return t.removeAttribute("em-edit"),t}function oF(e){const t=e.cloneNode(!1);return t.removeAttribute("innerStyle"),t.removeAttribute("innerClass"),t}var iF=e=>V(e)??e;function sF(e){const[t]=e.getTargetRanges();if(!t||t.collapsed)return;const n=document.createRange();return n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset),n}function aF(e,t){const n=Nf(t,e.inputType.endsWith("Backward")?"backward":"forward");if(!n)return sF(e);const r=document.createRange();return r.selectNode(n),r}var lF={deleteContentBackward:"delete",deleteContentForward:"forwardDelete",deleteByCut:"delete",deleteContent:"delete",insertText:"insertText",insertReplacementText:"insertText",formatBold:"bold",formatItalic:"italic",formatUnderline:"underline",formatStrikeThrough:"strikeThrough",formatSuperscript:"superscript",formatSubscript:"subscript",formatJustifyLeft:"justifyLeft",formatJustifyCenter:"justifyCenter",formatJustifyRight:"justifyRight",formatJustifyFull:"justifyFull",formatRemove:"removeFormat"},cF=["insertText"],rh=!1;function u_(e,t){rh=!0;try{lr(e,!1,t)}finally{rh=!1}}function uF(e){const t=e.dataTransfer?.getData("text/plain")||e.data||void 0,n=e.getTargetRanges?.()[0],r=window.getSelection();if(!t||!n||!r)return;const o=document.createRange();return o.setStart(n.startContainer,n.startOffset),o.setEnd(n.endContainer,n.endOffset),r.removeAllRanges(),r.addRange(o),t}function d_(e){const t=lF[e.inputType];if(!t||e.defaultPrevented||e.isComposing||rh)return!1;const n=e.inputType==="insertReplacementText"?uF(e):e.data??void 0;return cF.includes(t)&&!n?!1:(e.preventDefault(),u_(t,n),!0)}function dF(e){return function(n,r){if(!n||(n.querySelectorAll("editor")?.forEach(s=>{s.onclick=null,s.onkeyup=null,s.onmousedown=null}),Ac(n),document.querySelectorAll(":not(.em-element-path) .em-element-path").forEach(s=>s.remove()),r_(n),o5(n,r)))return;LE(n,Le);const o=document.createElement("editor");if(XH(o),o.classList.add("em-text"),o.setAttribute("contenteditable","true"),r)n.before(o),o.replaceChildren(n),Pv(o);else{const s=[...n.childNodes];n.appendChild(o),o.replaceChildren(...s)}const i=o.parentElement;if(i&&!i.style.fontFamily&&!i.style.fontSize&&o.firstElementChild){const s=o.firstElementChild,a=s.getAttribute("style"),l=s.getAttribute("class"),c=s.getAttribute("href"),u=s.getAttribute("target"),d=s.getAttribute("align");a&&o.setAttribute("innerStyle",a),l&&o.setAttribute("innerClass",l),c!==null&&o.setAttribute("innerHref",c),u&&o.setAttribute("innerTarget",u),d&&o.setAttribute("innerAlign",d)}o.addEventListener("input",pt(()=>e.commit(!0)),!0),o.addEventListener("beforeinput",ZH({element:n,getVisibleText:kE,mapFn:e5,setCursorToElement:n5,hasOnlyTextNodesDeep:TE,isRangeCoveringAllVisibleText:WP,isEditorContentOnlyNbsp:$P,commit:e.commit,pasteFragment:s=>{const a=l=>eh({target:l.target},c=>e.commit(c));ql(s,!1,j.get("commonStyles"),a,e.commit)}}))}}function fF({commit:e,htmlDocument:t,documentMapping:n}){const r=dF({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||FP(()=>r(i,s),"editor")}}}var f_=e=>t=>t.some(n=>e(n).some(mF)),mF=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),hF=f_(({removed:e})=>e),pF=f_(({added:e})=>e),gF=e=>t=>{hF(t)&&!pF(t)&&setTimeout(()=>{if(typeof document<"u"&&document.querySelector("[em-edit]"))return;const n=typeof document<"u"?document.querySelector('table[em-type="social"]'):null;if(n?.isConnected){Lr("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},bF=200;function yF(e){let t=!1;return()=>{if(t)return;t=!0;let n;const r=()=>{t&&(t=!1,clearTimeout(n),e())};n=setTimeout(r,bF),window.requestAnimationFrame(()=>setTimeout(r,0))}}var Ve={drag:"em-icon-drag",moveUp:"em-icon-move-up",moveDown:"em-icon-move-down",merge:"em-icon-merge",unmerge:"em-icon-unmerge",add:"em-icon-add"},xe="em-icon";function vF(e,t,n){return(t=_F(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dr.apply(null,arguments)}function m_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m_(Object(n),!0).forEach(function(r){vF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EF(e,t){if(e==null)return{};var n,r,o=SF(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function SF(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function wF(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _F(e){var t=wF(e,"string");return typeof t=="symbol"?t:t+""}function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}var CF="1.15.7";function fr(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var mr=fr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Js=fr(/Edge/i),h_=fr(/firefox/i),ea=fr(/safari/i)&&!fr(/chrome/i)&&!fr(/android/i),ih=fr(/iP(ad|od|hone)/i),p_=fr(/chrome/i)&&fr(/android/i),g_={capture:!1,passive:!1};function be(e,t,n){e.addEventListener(t,n,!mr&&g_)}function pe(e,t,n){e.removeEventListener(t,n,!mr&&g_)}function Lc(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function b_(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function _n(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Lc(e,t):Lc(e,t))||r&&e===n)return e;if(e===n)break}while(e=b_(e))}return null}var y_=/\s+/g;function Kt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(y_," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(y_," "))}function te(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=n+(typeof n=="string"?"":"px")}}function bi(e,t){var n="";if(typeof e=="string")n=e;else do{var r=te(e,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function v_(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,i=r.length;if(n)for(;o<i;o++)n(r[o],o);return r}return[]}function qn(){var e=document.scrollingElement;return e||document.documentElement}function et(e,t,n,r,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==qn()?(i=e.getBoundingClientRect(),s=i.top,a=i.left,l=i.bottom,c=i.right,u=i.height,d=i.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!mr))do if(o&&o.getBoundingClientRect&&(te(o,"transform")!=="none"||n&&te(o,"position")!=="static")){var f=o.getBoundingClientRect();s-=f.top+parseInt(te(o,"border-top-width")),a-=f.left+parseInt(te(o,"border-left-width")),l=s+i.height,c=a+i.width;break}while(o=o.parentNode);if(r&&e!==window){var h=bi(o||e),m=h&&h.a,p=h&&h.d;h&&(s/=p,a/=m,d/=m,u/=p,l=s+u,c=a+d)}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function E_(e,t,n){for(var r=Br(e,!0),o=et(e)[t];r;){var i=et(r)[n],s=void 0;if(n==="top"||n==="left"?s=o>=i:s=o<=i,!s)return r;if(r===qn())break;r=Br(r,!1)}return!1}function yi(e,t,n,r){for(var o=0,i=0,s=e.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==K.ghost&&(r||s[i]!==K.dragged)&&_n(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function sh(e,t){for(var n=e.lastElementChild;n&&(n===K.ghost||te(n,"display")==="none"||t&&!Lc(n,t));)n=n.previousElementSibling;return n||null}function an(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==K.clone&&(!t||Lc(e,t))&&n++;return n}function S_(e){var t=0,n=0,r=qn();if(e)do{var o=bi(e),i=o.a,s=o.d;t+=e.scrollLeft*i,n+=e.scrollTop*s}while(e!==r&&(e=e.parentNode));return[t,n]}function TF(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function Br(e,t){if(!e||!e.getBoundingClientRect)return qn();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=te(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return qn();if(r||t)return n;r=!0}}while(n=n.parentNode);return qn()}function AF(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function ah(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var ta;function w_(e,t){return function(){if(!ta){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),ta=setTimeout(function(){ta=void 0},t)}}}function kF(){clearTimeout(ta),ta=void 0}function __(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function C_(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function T_(e,t,n){var r={};return Array.from(e.children).forEach(function(o){var i,s,a,l;if(!(!_n(o,t.draggable,e,!1)||o.animated||o===n)){var c=et(o);r.left=Math.min((i=r.left)!==null&&i!==void 0?i:1/0,c.left),r.top=Math.min((s=r.top)!==null&&s!==void 0?s:1/0,c.top),r.right=Math.max((a=r.right)!==null&&a!==void 0?a:-1/0,c.right),r.bottom=Math.max((l=r.bottom)!==null&&l!==void 0?l:-1/0,c.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var Ft="Sortable"+new Date().getTime();function LF(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(r){if(!(te(r,"display")==="none"||r===K.ghost)){e.push({target:r,rect:et(r)});var o=Wn({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=bi(r,!0);i&&(o.top-=i.f,o.left-=i.e)}r.fromRect=o}})},addAnimationState:function(r){e.push(r)},removeAnimationState:function(r){e.splice(TF(e,{target:r}),1)},animateAll:function(r){var o=this;if(!this.options.animation){clearTimeout(t),typeof r=="function"&&r();return}var i=!1,s=0;e.forEach(function(a){var l=0,c=a.target,u=c.fromRect,d=et(c),f=c.prevFromRect,h=c.prevToRect,m=a.rect,p=bi(c,!0);p&&(d.top-=p.f,d.left-=p.e),c.toRect=d,c.thisAnimationDuration&&ah(f,d)&&!ah(u,d)&&(m.top-d.top)/(m.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=xF(m,f,h,o.options)),ah(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=o.options.animation),o.animate(c,m,d,l)),l&&(i=!0,s=Math.max(s,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),i?t=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),e=[]},animate:function(r,o,i,s){if(s){te(r,"transition",""),te(r,"transform","");var a=bi(this.el),l=a&&a.a,c=a&&a.d,u=(o.left-i.left)/(l||1),d=(o.top-i.top)/(c||1);r.animatingX=!!u,r.animatingY=!!d,te(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=NF(r),te(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),te(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){te(r,"transition",""),te(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function NF(e){return e.offsetWidth}function xF(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}var vi=[],lh={initializeByDefault:!0},na={mount:function(t){for(var n in lh)lh.hasOwnProperty(n)&&!(n in t)&&(t[n]=lh[n]);vi.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),vi.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";vi.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](Wn({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](Wn({sortable:n},r)))})},initializePlugins:function(t,n,r,o){vi.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,n,t.options);c.sortable=t,c.options=t.options,t[l]=c,dr(r,c.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var s=this.modifyOption(t,i,t.options[i]);typeof s<"u"&&(t.options[i]=s)}},getEventProperties:function(t,n){var r={};return vi.forEach(function(o){typeof o.eventProperties=="function"&&dr(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return vi.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function OF(e){var t=e.sortable,n=e.rootEl,r=e.name,o=e.targetEl,i=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,h=e.putSortable,m=e.extraEventProperties;if(t=t||n&&n[Ft],!!t){var p,v=t.options,w="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!mr&&!Js?p=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(p=document.createEvent("Event"),p.initEvent(r,!0,!0)),p.to=s||n,p.from=a||n,p.item=o||n,p.clone=i,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=f,p.pullMode=h?h.lastPutMode:void 0;var _=Wn(Wn({},m),na.getEventProperties(r,t));for(var A in _)p[A]=_[A];n&&n.dispatchEvent(p),v[w]&&v[w].call(t,p)}}var RF=["evt"],$t=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=EF(r,RF);na.pluginEvent.bind(K)(t,n,Wn({dragEl:B,parentEl:Ge,ghostEl:le,rootEl:He,nextEl:vo,lastDownEl:Nc,cloneEl:$e,cloneHidden:Hr,dragStarted:oa,putSortable:gt,activeSortable:K.active,originalEvent:o,oldIndex:Ei,oldDraggableIndex:ra,newIndex:Yt,newDraggableIndex:Fr,hideGhostForTarget:R_,unhideGhostForTarget:M_,cloneNowHidden:function(){Hr=!0},cloneNowShown:function(){Hr=!1},dispatchSortableEvent:function(a){Nt({sortable:n,name:a,originalEvent:o})}},i))};function Nt(e){OF(Wn({putSortable:gt,cloneEl:$e,targetEl:B,rootEl:He,oldIndex:Ei,oldDraggableIndex:ra,newIndex:Yt,newDraggableIndex:Fr},e))}var B,Ge,le,He,vo,Nc,$e,Hr,Ei,Yt,ra,Fr,xc,gt,Si=!1,Oc=!1,Rc=[],Eo,Cn,ch,uh,A_,k_,oa,wi,ia,sa=!1,Mc=!1,Pc,Et,dh=[],fh=!1,Ic=[],Dc=typeof document<"u",Bc=ih,L_=Js||mr?"cssFloat":"float",MF=Dc&&!p_&&!ih&&"draggable"in document.createElement("div"),N_=(function(){if(Dc){if(mr)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),x_=function(t,n){var r=te(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=yi(t,0,n),s=yi(t,1,n),a=i&&te(i),l=s&&te(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+et(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+et(s).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=o&&r[L_]==="none"||s&&r[L_]==="none"&&c+u>o)?"vertical":"horizontal"},PF=function(t,n,r){var o=r?t.left:t.top,i=r?t.right:t.bottom,s=r?t.width:t.height,a=r?n.left:n.top,l=r?n.right:n.bottom,c=r?n.width:n.height;return o===a||i===l||o+s/2===a+c/2},IF=function(t,n){var r;return Rc.some(function(o){var i=o[Ft].options.emptyInsertThreshold;if(!(!i||sh(o))){var s=et(o),a=t>=s.left-i&&t<=s.right+i,l=n>=s.top-i&&n<=s.bottom+i;if(a&&l)return r=o}}),r},O_=function(t){function n(i,s){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(i==null&&(s||d))return!0;if(i==null||i===!1)return!1;if(s&&i==="clone")return i;if(typeof i=="function")return n(i(a,l,c,u),s)(a,l,c,u);var f=(s?a:l).options.group.name;return i===!0||typeof i=="string"&&i===f||i.join&&i.indexOf(f)>-1}}var r={},o=t.group;(!o||oh(o)!="object")&&(o={name:o}),r.name=o.name,r.checkPull=n(o.pull,!0),r.checkPut=n(o.put),r.revertClone=o.revertClone,t.group=r},R_=function(){!N_&&le&&te(le,"display","none")},M_=function(){!N_&&le&&te(le,"display","")};Dc&&!p_&&document.addEventListener("click",function(e){if(Oc)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Oc=!1,!1},!0);var So=function(t){if(B){t=t.touches?t.touches[0]:t;var n=IF(t.clientX,t.clientY);if(n){var r={};for(var o in t)t.hasOwnProperty(o)&&(r[o]=t[o]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[Ft]._onDragOver(r)}}},DF=function(t){B&&B.parentNode[Ft]._isOutsideThisEl(t.target)};function K(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=dr({},t),e[Ft]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return x_(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:K.supportPointer!==!1&&"PointerEvent"in window&&(!ea||ih),emptyInsertThreshold:5};na.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);O_(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:MF,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?be(e,"pointerdown",this._onTapStart):(be(e,"mousedown",this._onTapStart),be(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(be(e,"dragover",this),be(e,"dragenter",this)),Rc.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),dr(this,LF())}K.prototype={constructor:K,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(wi=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,B):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,r=this.el,o=this.options,i=o.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=o.filter;if(UF(r),!B&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&ea&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=_n(l,o.draggable,r,!1),!(l&&l.animated)&&Nc!==l)){if(Ei=an(l),ra=an(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){Nt({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),$t("filter",n,{evt:t}),i&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=_n(c,d.trim(),r,!1),d)return Nt({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),$t("filter",n,{evt:t}),!0}),u)){i&&t.preventDefault();return}o.handle&&!_n(c,o.handle,r,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,r){var o=this,i=o.el,s=o.options,a=i.ownerDocument,l;if(r&&!B&&r.parentNode===i){var c=et(r);if(He=i,B=r,Ge=B.parentNode,vo=B.nextSibling,Nc=r,xc=s.group,K.dragged=B,Eo={target:B,clientX:(n||t).clientX,clientY:(n||t).clientY},A_=Eo.clientX-c.left,k_=Eo.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,B.style["will-change"]="all",l=function(){if($t("delayEnded",o,{evt:t}),K.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!h_&&o.nativeDraggable&&(B.draggable=!0),o._triggerDragStart(t,n),Nt({sortable:o,name:"choose",originalEvent:t}),Kt(B,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){v_(B,u.trim(),mh)}),be(a,"dragover",So),be(a,"mousemove",So),be(a,"touchmove",So),s.supportPointer?(be(a,"pointerup",o._onDrop),!this.nativeDraggable&&be(a,"pointercancel",o._onDrop)):(be(a,"mouseup",o._onDrop),be(a,"touchend",o._onDrop),be(a,"touchcancel",o._onDrop)),h_&&this.nativeDraggable&&(this.options.touchStartThreshold=4,B.draggable=!0),$t("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Js||mr))){if(K.eventCanceled){this._onDrop();return}s.supportPointer?(be(a,"pointerup",o._disableDelayedDrag),be(a,"pointercancel",o._disableDelayedDrag)):(be(a,"mouseup",o._disableDelayedDrag),be(a,"touchend",o._disableDelayedDrag),be(a,"touchcancel",o._disableDelayedDrag)),be(a,"mousemove",o._delayedDragTouchMoveHandler),be(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&be(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){B&&mh(B),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;pe(t,"mouseup",this._disableDelayedDrag),pe(t,"touchend",this._disableDelayedDrag),pe(t,"touchcancel",this._disableDelayedDrag),pe(t,"pointerup",this._disableDelayedDrag),pe(t,"pointercancel",this._disableDelayedDrag),pe(t,"mousemove",this._delayedDragTouchMoveHandler),pe(t,"touchmove",this._delayedDragTouchMoveHandler),pe(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?be(document,"pointermove",this._onTouchMove):n?be(document,"touchmove",this._onTouchMove):be(document,"mousemove",this._onTouchMove):(be(B,"dragend",this),be(He,"dragstart",this._onDragStart));try{document.selection?Fc(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Si=!1,He&&B){$t("dragStarted",this,{evt:n}),this.nativeDraggable&&be(document,"dragover",DF);var r=this.options;!t&&Kt(B,r.dragClass,!1),Kt(B,r.ghostClass,!0),K.active=this,t&&this._appendGhost(),Nt({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Cn){this._lastX=Cn.clientX,this._lastY=Cn.clientY,R_();for(var t=document.elementFromPoint(Cn.clientX,Cn.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Cn.clientX,Cn.clientY),t!==n);)n=t;if(B.parentNode[Ft]._isOutsideThisEl(t),n)do{if(n[Ft]){var r=void 0;if(r=n[Ft]._onDragOver({clientX:Cn.clientX,clientY:Cn.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=b_(n));M_()}},_onTouchMove:function(t){if(Eo){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=le&&bi(le,!0),a=le&&s&&s.a,l=le&&s&&s.d,c=Bc&&Et&&S_(Et),u=(i.clientX-Eo.clientX+o.x)/(a||1)+(c?c[0]-dh[0]:0)/(a||1),d=(i.clientY-Eo.clientY+o.y)/(l||1)+(c?c[1]-dh[1]:0)/(l||1);if(!K.active&&!Si){if(r&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<r)return;this._onDragStart(t,!0)}if(le){s?(s.e+=u-(ch||0),s.f+=d-(uh||0)):s={a:1,b:0,c:0,d:1,e:u,f:d};var f="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");te(le,"webkitTransform",f),te(le,"mozTransform",f),te(le,"msTransform",f),te(le,"transform",f),ch=u,uh=d,Cn=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!le){var t=this.options.fallbackOnBody?document.body:He,n=et(B,!0,Bc,!0,t),r=this.options;if(Bc){for(Et=t;te(Et,"position")==="static"&&te(Et,"transform")==="none"&&Et!==document;)Et=Et.parentNode;Et!==document.body&&Et!==document.documentElement?(Et===document&&(Et=qn()),n.top+=Et.scrollTop,n.left+=Et.scrollLeft):Et=qn(),dh=S_(Et)}le=B.cloneNode(!0),Kt(le,r.ghostClass,!1),Kt(le,r.fallbackClass,!0),Kt(le,r.dragClass,!0),te(le,"transition",""),te(le,"transform",""),te(le,"box-sizing","border-box"),te(le,"margin",0),te(le,"top",n.top),te(le,"left",n.left),te(le,"width",n.width),te(le,"height",n.height),te(le,"opacity","0.8"),te(le,"position",Bc?"absolute":"fixed"),te(le,"zIndex","100000"),te(le,"pointerEvents","none"),K.ghost=le,t.appendChild(le),te(le,"transform-origin",A_/parseInt(le.style.width)*100+"% "+k_/parseInt(le.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if($t("dragStart",this,{evt:t}),K.eventCanceled){this._onDrop();return}$t("setupClone",this),K.eventCanceled||($e=C_(B),$e.removeAttribute("id"),$e.draggable=!1,$e.style["will-change"]="",this._hideClone(),Kt($e,this.options.chosenClass,!1),K.clone=$e),r.cloneId=Fc(function(){$t("clone",r),!K.eventCanceled&&(r.options.removeCloneOnHide||He.insertBefore($e,B),r._hideClone(),Nt({sortable:r,name:"clone"}))}),!n&&Kt(B,i.dragClass,!0),n?(Oc=!0,r._loopId=setInterval(r._emulateDragOver,50)):(pe(document,"mouseup",r._onDrop),pe(document,"touchend",r._onDrop),pe(document,"touchcancel",r._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(r,o,B)),be(document,"drop",r),te(B,"transform","translateZ(0)")),Si=!0,r._dragStartId=Fc(r._dragStarted.bind(r,n,t)),be(document,"selectstart",r),oa=!0,window.getSelection().removeAllRanges(),ea&&te(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,r=t.target,o,i,s,a=this.options,l=a.group,c=K.active,u=xc===l,d=a.sort,f=gt||c,h,m=this,p=!1;if(fh)return;function v(ne,he){$t(ne,m,Wn({evt:t,isOwner:u,axis:h?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:f,target:r,completed:_,onMove:function(Z,ve){return Hc(He,n,B,o,Z,et(Z),t,ve)},changed:A},he))}function w(){v("dragOverAnimationCapture"),m.captureAnimationState(),m!==f&&f.captureAnimationState()}function _(ne){return v("dragOverCompleted",{insertion:ne}),ne&&(u?c._hideClone():c._showClone(m),m!==f&&(Kt(B,gt?gt.options.ghostClass:c.options.ghostClass,!1),Kt(B,a.ghostClass,!0)),gt!==m&&m!==K.active?gt=m:m===K.active&>&&(gt=null),f===m&&(m._ignoreWhileAnimating=r),m.animateAll(function(){v("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(r===B&&!B.animated||r===n&&!r.animated)&&(wi=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(B.parentNode[Ft]._isOutsideThisEl(t.target),!ne&&So(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function A(){Yt=an(B),Fr=an(B,a.draggable),Nt({sortable:m,name:"change",toEl:n,newIndex:Yt,newDraggableIndex:Fr,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=_n(r,a.draggable,n,!0),v("dragOver"),K.eventCanceled)return p;if(B.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||m._ignoreWhileAnimating===r)return _(!1);if(Oc=!1,c&&!a.disabled&&(u?d||(s=Ge!==He):gt===this||(this.lastPutMode=xc.checkPull(this,c,B,t))&&l.checkPut(this,c,B,t))){if(h=this._getDirection(t,r)==="vertical",o=et(B),v("dragOverValid"),K.eventCanceled)return p;if(s)return Ge=He,w(),this._hideClone(),v("revert"),K.eventCanceled||(vo?He.insertBefore(B,vo):He.appendChild(B)),_(!0);var b=sh(n,a.draggable);if(!b||$F(t,h,this)&&!b.animated){if(b===B)return _(!1);if(b&&n===t.target&&(r=b),r&&(i=et(r)),Hc(He,n,B,o,r,i,t,!!r)!==!1)return w(),b&&b.nextSibling?n.insertBefore(B,b.nextSibling):n.appendChild(B),Ge=n,A(),_(!0)}else if(b&&FF(t,h,this)){var g=yi(n,0,a,!0);if(g===B)return _(!1);if(r=g,i=et(r),Hc(He,n,B,o,r,i,t,!1)!==!1)return w(),n.insertBefore(B,g),Ge=n,A(),_(!0)}else if(r.parentNode===n){i=et(r);var E=0,T,y=B.parentNode!==n,S=!PF(B.animated&&B.toRect||o,r.animated&&r.toRect||i,h),C=h?"top":"left",L=E_(r,"top","top")||E_(B,"top","top"),x=L?L.scrollTop:void 0;wi!==r&&(T=i[C],sa=!1,Mc=!S&&a.invertSwap||y),E=WF(t,r,i,h,S?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Mc,wi===r);var N;if(E!==0){var W=an(B);do W-=E,N=Ge.children[W];while(N&&(te(N,"display")==="none"||N===le))}if(E===0||N===r)return _(!1);wi=r,ia=E;var R=r.nextElementSibling,P=!1;P=E===1;var J=Hc(He,n,B,o,r,i,t,P);if(J!==!1)return(J===1||J===-1)&&(P=J===1),fh=!0,setTimeout(HF,30),w(),P&&!R?n.appendChild(B):r.parentNode.insertBefore(B,P?R:r),L&&__(L,0,x-L.scrollTop),Ge=B.parentNode,T!==void 0&&!Mc&&(Pc=Math.abs(T-et(r)[C])),A(),_(!0)}if(n.contains(B))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){pe(document,"mousemove",this._onTouchMove),pe(document,"touchmove",this._onTouchMove),pe(document,"pointermove",this._onTouchMove),pe(document,"dragover",So),pe(document,"mousemove",So),pe(document,"touchmove",So)},_offUpEvents:function(){var t=this.el.ownerDocument;pe(t,"mouseup",this._onDrop),pe(t,"touchend",this._onDrop),pe(t,"pointerup",this._onDrop),pe(t,"pointercancel",this._onDrop),pe(t,"touchcancel",this._onDrop),pe(document,"selectstart",this)},_onDrop:function(t){var n=this.el,r=this.options;if(Yt=an(B),Fr=an(B,r.draggable),$t("drop",this,{evt:t}),Ge=B&&B.parentNode,Yt=an(B),Fr=an(B,r.draggable),K.eventCanceled){this._nulling();return}Si=!1,Mc=!1,sa=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),hh(this.cloneId),hh(this._dragStartId),this.nativeDraggable&&(pe(document,"drop",this),pe(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ea&&te(document.body,"user-select",""),te(B,"transform",""),t&&(oa&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),le&&le.parentNode&&le.parentNode.removeChild(le),(He===Ge||gt&>.lastPutMode!=="clone")&&$e&&$e.parentNode&&$e.parentNode.removeChild($e),B&&(this.nativeDraggable&&pe(B,"dragend",this),mh(B),B.style["will-change"]="",oa&&!Si&&Kt(B,gt?gt.options.ghostClass:this.options.ghostClass,!1),Kt(B,this.options.chosenClass,!1),Nt({sortable:this,name:"unchoose",toEl:Ge,newIndex:null,newDraggableIndex:null,originalEvent:t}),He!==Ge?(Yt>=0&&(Nt({rootEl:Ge,name:"add",toEl:Ge,fromEl:He,originalEvent:t}),Nt({sortable:this,name:"remove",toEl:Ge,originalEvent:t}),Nt({rootEl:Ge,name:"sort",toEl:Ge,fromEl:He,originalEvent:t}),Nt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),gt&>.save()):Yt!==Ei&&Yt>=0&&(Nt({sortable:this,name:"update",toEl:Ge,originalEvent:t}),Nt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),K.active&&((Yt==null||Yt===-1)&&(Yt=Ei,Fr=ra),Nt({sortable:this,name:"end",toEl:Ge,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){$t("nulling",this),He=B=Ge=le=vo=$e=Nc=Hr=Eo=Cn=oa=Yt=Fr=Ei=ra=wi=ia=gt=xc=K.dragged=K.ghost=K.clone=K.active=null;var t=this.el;Ic.forEach(function(n){t.contains(n)&&(n.checked=!0)}),Ic.length=ch=uh=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":B&&(this._onDragOver(t),BF(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t=[],n,r=this.el.children,o=0,i=r.length,s=this.options;o<i;o++)n=r[o],_n(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||zF(n));return t},sort:function(t,n){var r={},o=this.el;this.toArray().forEach(function(i,s){var a=o.children[s];_n(a,this.options.draggable,o,!1)&&(r[i]=a)},this),n&&this.captureAnimationState(),t.forEach(function(i){r[i]&&(o.removeChild(r[i]),o.appendChild(r[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return _n(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var r=this.options;if(n===void 0)return r[t];var o=na.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&O_(r)},destroy:function(){$t("destroy",this);var t=this.el;t[Ft]=null,pe(t,"mousedown",this._onTapStart),pe(t,"touchstart",this._onTapStart),pe(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(pe(t,"dragover",this),pe(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Rc.splice(Rc.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Hr){if($t("hideClone",this),K.eventCanceled)return;te($e,"display","none"),this.options.removeCloneOnHide&&$e.parentNode&&$e.parentNode.removeChild($e),Hr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Hr){if($t("showClone",this),K.eventCanceled)return;B.parentNode==He&&!this.options.group.revertClone?He.insertBefore($e,B):vo?He.insertBefore($e,vo):He.appendChild($e),this.options.group.revertClone&&this.animate(B,$e),te($e,"display",""),Hr=!1}}};function BF(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Hc(e,t,n,r,o,i,s,a){var l,c=e[Ft],u=c.options.onMove,d;return window.CustomEvent&&!mr&&!Js?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=o||t,l.relatedRect=i||et(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(d=u.call(c,l,s)),d}function mh(e){e.draggable=!1}function HF(){fh=!1}function FF(e,t,n){var r=et(yi(n.el,0,n.options,!0)),o=T_(n.el,n.options,le),i=10;return t?e.clientX<o.left-i||e.clientY<r.top&&e.clientX<r.right:e.clientY<o.top-i||e.clientY<r.bottom&&e.clientX<r.left}function $F(e,t,n){var r=et(sh(n.el,n.options.draggable)),o=T_(n.el,n.options,le),i=10;return t?e.clientX>o.right+i||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>o.bottom+i||e.clientX>r.right&&e.clientY>r.top}function WF(e,t,n,r,o,i,s,a){var l=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!s){if(a&&Pc<c*o){if(!sa&&(ia===1?l>u+c*i/2:l<d-c*i/2)&&(sa=!0),sa)f=!0;else if(ia===1?l<u+Pc:l>d-Pc)return-ia}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return qF(t)}return f=f||s,f&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function qF(e){return an(B)<an(e)?1:-1}function zF(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function UF(e){Ic.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&Ic.push(r)}}function Fc(e){return setTimeout(e,0)}function hh(e){return clearTimeout(e)}Dc&&be(document,"touchmove",function(e){(K.active||Si)&&e.cancelable&&e.preventDefault()}),K.utils={on:be,off:pe,css:te,find:v_,is:function(t,n){return!!_n(t,n,t,!1)},extend:AF,throttle:w_,closest:_n,toggleClass:Kt,clone:C_,index:an,nextTick:Fc,cancelNextTick:hh,detectDirection:x_,getChild:yi,expando:Ft},K.get=function(e){return e[Ft]},K.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(K.utils=Wn(Wn({},K.utils),r.utils)),na.mount(r)})},K.create=function(e,t){return new K(e,t)},K.version=CF;var tt=[],aa,ph,gh=!1,bh,yh,$c,la;function jF(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var r=n.originalEvent;this.sortable.nativeDraggable?be(document,"dragover",this._handleAutoScroll):this.options.supportPointer?be(document,"pointermove",this._handleFallbackAutoScroll):r.touches?be(document,"touchmove",this._handleFallbackAutoScroll):be(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?pe(document,"dragover",this._handleAutoScroll):(pe(document,"pointermove",this._handleFallbackAutoScroll),pe(document,"touchmove",this._handleFallbackAutoScroll),pe(document,"mousemove",this._handleFallbackAutoScroll)),P_(),Wc(),kF()},nulling:function(){$c=ph=aa=gh=la=bh=yh=null,tt.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,r){var o=this,i=(n.touches?n.touches[0]:n).clientX,s=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(i,s);if($c=n,r||this.options.forceAutoScrollFallback||Js||mr||ea){vh(n,this.options,a,r);var l=Br(a,!0);gh&&(!la||i!==bh||s!==yh)&&(la&&P_(),la=setInterval(function(){var c=Br(document.elementFromPoint(i,s),!0);c!==l&&(l=c,Wc()),vh(n,o.options,c,r)},10),bh=i,yh=s)}else{if(!this.options.bubbleScroll||Br(a,!0)===qn()){Wc();return}vh(n,this.options,Br(a,!1),!1)}}},dr(e,{pluginName:"scroll",initializeByDefault:!0})}function Wc(){tt.forEach(function(e){clearInterval(e.pid)}),tt=[]}function P_(){clearInterval(la)}var vh=w_(function(e,t,n,r){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,a=t.scrollSpeed,l=qn(),c=!1,u;ph!==n&&(ph=n,Wc(),aa=t.scroll,u=t.scrollFn,aa===!0&&(aa=Br(n,!0)));var d=0,f=aa;do{var h=f,m=et(h),p=m.top,v=m.bottom,w=m.left,_=m.right,A=m.width,b=m.height,g=void 0,E=void 0,T=h.scrollWidth,y=h.scrollHeight,S=te(h),C=h.scrollLeft,L=h.scrollTop;h===l?(g=A<T&&(S.overflowX==="auto"||S.overflowX==="scroll"||S.overflowX==="visible"),E=b<y&&(S.overflowY==="auto"||S.overflowY==="scroll"||S.overflowY==="visible")):(g=A<T&&(S.overflowX==="auto"||S.overflowX==="scroll"),E=b<y&&(S.overflowY==="auto"||S.overflowY==="scroll"));var x=g&&(Math.abs(_-o)<=s&&C+A<T)-(Math.abs(w-o)<=s&&!!C),N=E&&(Math.abs(v-i)<=s&&L+b<y)-(Math.abs(p-i)<=s&&!!L);if(!tt[d])for(var W=0;W<=d;W++)tt[W]||(tt[W]={});(tt[d].vx!=x||tt[d].vy!=N||tt[d].el!==h)&&(tt[d].el=h,tt[d].vx=x,tt[d].vy=N,clearInterval(tt[d].pid),(x!=0||N!=0)&&(c=!0,tt[d].pid=setInterval(function(){r&&this.layer===0&&K.active._onTouchMove($c);var R=tt[this.layer].vy?tt[this.layer].vy*a:0,P=tt[this.layer].vx?tt[this.layer].vx*a:0;typeof u=="function"&&u.call(K.dragged.parentNode[Ft],P,R,e,$c,tt[this.layer].el)!=="continue"||__(tt[this.layer].el,P,R)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==l&&(f=Br(f,!1)));gh=c}},30),I_=function(t){var n=t.originalEvent,r=t.putSortable,o=t.dragEl,i=t.activeSortable,s=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var c=r||i;a();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(s("spill"),this.onSpill({dragEl:o,putSortable:r}))}};function Eh(){}Eh.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,r=t.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var o=yi(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),r&&r.animateAll()},drop:I_},dr(Eh,{pluginName:"revertOnSpill"});function Sh(){}Sh.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:I_},dr(Sh,{pluginName:"removeOnSpill"}),K.mount(new jF),K.mount(Sh,Eh);var D_=100,B_=Symbol("EMULATED_DRAG_EVENT");function VF(e,t){return e[B_]===t}var H_=class{constructor(){k(this,"_target",null),k(this,"_interval",0),k(this,"_x",0),k(this,"_y",0)}_fireDragEvent(e,t,n,r,o){const i=new DragEvent(t,{dataTransfer:o,clientX:n,clientY:r,bubbles:!0,cancelable:!0});return i[B_]=this,It(()=>e.dispatchEvent(i)),!i.defaultPrevented}start(e,t,n){const r=document.elementFromPoint(e,t);return r&&!this._target&&this._fireDragEvent(r,"dragstart",e,t,n)?(this._target=r,this._x=e,this._y=t,this._interval=setInterval(()=>{this._fireDragEvent(r,"drag",this._x,this._y,n)},D_),!0):!1}enter(e,t,n){const r=document.elementFromPoint(e,t);r&&r!==this._target&&(this._fireDragEvent(r,"dragenter",e,t,n),this._target=r,this._interval||(this._interval=setInterval(()=>{this._fireDragEvent(r,"drag",this._x,this._y,n)},D_)))}over(e,t,n){this._x=e,this._y=t;const r=document.elementFromPoint(e,t);r&&(r!==this._target&&this._fireDragEvent(r,"dragenter",e,t,n),this._fireDragEvent(r,"dragover",e,t,n)),this._target&&r!==this._target&&this._fireDragEvent(this._target,"dragleave",e,t,n),this._target=r}leave(e,t,n){this._target&&(this._fireDragEvent(this._target,"dragleave",e,t,n),this._target=null),this._target=null}drop(e,t,n){this._target&&(this._fireDragEvent(this._target,"drop",e,t,n),this._target=null),this._target=null,clearInterval(this._interval)}end(e,t,n){this._target&&this._fireDragEvent(this._target,"dragend",e,t,n),this._target=null,clearInterval(this._interval)}};function qc(e){document.querySelector(".noresp-em-narrow-table")&&e.querySelectorAll("img, amp-img").forEach(t=>{const n=t;n.style.removeProperty("width"),n.style.removeProperty("max-width")})}function ca(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function wh(e){const t=document.createElement("div");t.replaceChildren(...Le(e.atomHTML));const n=t.querySelector("img");if(!n)return kt(t);let r=0;return e.targetAtom.classList.contains("em-block-insert-empty")?r=600:e.targetAtom.classList.contains("em-mob-wrap")||e.targetAtom.classList.contains("noresp-em-mob-wrap")?r=ca(e.targetAtom):r=e.targetAtom.parentNode?ca(e.targetAtom.parentNode):ca(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?qc(t):n.style.maxWidth=r+"px",kt(t)}function F_(e,t,n){const r=e.querySelectorAll("img"),o=r.length===1?r[0]:null,i=o?.getAttribute("width")??"";if(!o||o.classList.contains("em-countdown")||!i||i.endsWith("%"))return!1;const s=parseFloat(i),a=o.style.display;o.style.display="none";const l=ca(n);o.style.display=a;const c=s>=ca(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?qc(e):o.style.maxWidth=c+"px",!0)}function $_(e,t){const n=e.atomHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Le(e.atomHTML));const r=n.querySelector("img");if(!r)return!1;const o=new Image;return o.onload=function(){const i=Math.round(this.width/2);r.setAttribute("width",String(i)),document.querySelector(".noresp-em-narrow-table")?qc(n):(r.style.maxWidth=i+"px",r.style.width="100%"),tr(e.targetElem,e.targetPlace,`
|
|
52
|
+
`+kt(n)+`
|
|
53
|
+
`),t()},o.src=r.getAttribute("src")||"",!1}function _h(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...Le(e.blockHTML));const n=t.querySelector("img.em-countdown");if(!n)return kt(t);const r=n.getAttribute("em-cd-settings")||"",o=e.project==="useblocks"?"https://cdt3.useblocks.io/rndt?":"https://cdt3.emcdn.ru/rndt?",i=new URL(o+r),s=new Date;return i.searchParams.set("time",new Date(+s+432e6).toISOString()),Ht(n,"src",i.href),n.setAttribute("em-cd-settings",i.search.substring(1)),kt(t)}function zc(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...Le(e.blockHTML)),document.querySelector(".noresp-em-narrow-table")?t.querySelectorAll('[class^="em-mob-"], [class*=" em-mob-"]').forEach(n=>{n.className=n.className.split(" ").map(r=>r.startsWith("em-mob-")?"noresp-"+r:r).join(" ")}):t.querySelectorAll('[class^="noresp-"], [class*=" noresp-"]').forEach(n=>{n.className=n.className.split(" ").map(r=>r.startsWith("noresp-")?r.substring(7):r).join(" ")}),qc(t),kt(t)}function GF(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var XF=class{constructor(){k(this,"_items",new Map)}gc(){for(const[e,t]of[...this._items])e.isConnected||(this._items.delete(e),t.destroy())}get(e){return this._items.get(e)}create(e,t){const n=K.create(e,t);return this._items.set(e,n),n}entries(){return[...this._items]}},$r=new XF,KF=Number.MAX_VALUE,YF=0;function W_(e){return typeof e=="object"?e.name:e}var ZF=class{constructor(){k(this,"emulator",new H_),k(this,"x",0),k(this,"y",0),k(this,"_tracked",!1),k(this,"handleMouseMove",e=>{this.x=e.clientX,this.y=e.clientY,this.emulator.over(this.x,this.y)})}track(){this._tracked||(this._tracked=!0,window.addEventListener("mousedown",e=>{this.x=e.clientX,this.y=e.clientY}),window.addEventListener("mouseup",()=>this.emulator.end(this.x,this.y)))}},ln=new ZF,q_=K.prototype,QF=pt(q_._onDragOver);function JF(e){$r.gc(),ln.track(),q_._onDragOver=QF;const t=document.querySelectorAll("[em=group]");K.prototype._emulateDragOver=function(){};let n;const r=()=>{e.commit(!0)};function o(a,l){let c;function u(m,p){let v=null,w=Number.MAX_VALUE;const _=W_(K.active?.options.group);for(const[A,b]of $r.entries())if(W_(b.options.group)===_&&(!a||c&&a(A,c)!==!1)){for(const g of A.children)if(!g.classList.contains("sortable-drag")){const E=g.getBoundingClientRect(),T=m<E.left?E.left-m:m>E.right?m-E.right:0,y=p<E.top?E.top-p:p>E.bottom?p-E.bottom:0;if(T<KF||y<YF){const S=Math.sqrt(T*T+y*y);S<w?(v=[b,g],w=S):S===w&&v[1].contains(g)&&(v=[b,g])}}}return v}function d(m){const p="TouchEvent"in window&&m instanceof TouchEvent?m.touches[0]:m,v=u(p.clientX,p.clientY);if(v){const[A,b]=v,g=b.getBoundingClientRect();var w={clientX:g.left+g.width/2,clientY:p.clientY};for(var _ in m)m.hasOwnProperty(_)&&(w[_]=m[_]);w.target=b,w.rootEl=b.parentNode,w.preventDefault=void 0,w.stopPropagation=void 0,A._onDragOver(w)}}return{onStart:m=>{c=m.item,K.ghost&&Ef(K.ghost),GF(K.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),ln.emulator.start(ln.x,ln.y)?(window.addEventListener("mousemove",ln.handleMouseMove),n&&(n.dispose(),n=void 0)):m.preventDefault()},onEnd:m=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d);let p=!1;m.from===m.to?ln.emulator.end(ln.x,ln.y):(p=!!l?.(m),ln.emulator.drop(ln.x,ln.y)),window.removeEventListener("mousemove",ln.handleMouseMove),e.endTextUpdate(),m.from===m.to&&m.oldIndex!==m.newIndex&&e.commit(!0),p&&e.commit(!0),n&&(n.dispose(),n=void 0),c=void 0}}}if(t.length)for(const a of t){const l=a.parentElement;l&&!$r.get(l)&&$r.create(l,{forceFallback:!0,group:"groups-sorting",handle:`.of-group .${Ve.drag}`,...o(),onMove:r})}const i=[...document.querySelectorAll("[em=block]")],s=[...document.querySelectorAll("[em=atom]")].map(a=>a.parentElement);for(const a of i){const l=a.querySelectorAll("td");for(const c of l)!c.innerHTML&&!c.hasAttribute("height")&&[...c.parentElement?.children||[]].indexOf(c)%2===0&&s.push(c)}if(s.length){const a=new Set;for(const l of s)l&&!a.has(l)&&(a.add(l),$r.get(l)||$r.create(l,{forceFallback:!0,group:"atoms-sorting",handle:`.of-atom .${Ve.drag}`,...o((c,u)=>{if(u.tagName==="TR"){if(c.tagName!=="TABLE"&&c.tagName!=="TBODY")return!1}else if(u.tagName==="TD"){if(c.tagName!=="TR")return!1}else if(u.tagName==="TABLE"){const d=e.getContext(c);if(d&&In(d)&&d.tagName==="AMP-ACCORDION"&&c.tagName==="DIV"&&[...d.querySelectorAll("section > div")].indexOf(c)>=0||e.isInExternal(c)&&c.tagName==="DIV")return!0;if(c.tagName!=="TD")return!1}},c=>F_(c.item,c.from,c.to)),onMove:r,onSort:function(){l.innerHTML.trim()===""&&(l.innerHTML="")}}))}if(i.length){const a=new Set;for(const l of i){const c=l.parentElement;c&&!a.has(c)&&(a.add(c),$r.get(c)||$r.create(c,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${Ve.drag}`,...o(),onMove:r}))}}}var e$=class{constructor(){k(this,"_nodes",[])}add(e){const t=this._nodes,n=new Set;for(const r of t){if(r.contains(e))return;e.contains(r)&&n.add(r)}for(const r of n){const o=t.indexOf(r);o>=0&&t.splice(o,1)}t.push(e)}remove(e){const t=new Set;for(const n of this._nodes)(e===n||e.contains(n))&&t.add(n);for(const n of t){const r=this._nodes.indexOf(n);r>=0&&this._nodes.splice(r,1)}}get nodes(){return[...this._nodes]}clear(){this._nodes.splice(0,this._nodes.length)}},Ch={get textDocument(){return O(Mt,rs)},commit:ao};function t$(){const e=j.get("applicationTheme")||"light";let t=!1;try{Ch.textDocument.beginUpdate();const n=[...document.querySelectorAll('[em="css"]')].map(s=>s.getAttribute("href"));let r=document.getElementsByTagName("head")[0];if(!r)if(document.documentElement)r=document.createElement("head"),document.documentElement.insertBefore(r,document.documentElement.firstChild),t=!0;else return;const o="css/sandbox.css?091c986b";if(n.indexOf(o)<0){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("em","css"),s.setAttribute("href",o),r.appendChild(s),t=!0}const i=`css/sandbox-${e}.css?091c986b`;if(n.indexOf(i)<0){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("em","css"),s.setAttribute("href",i),r.appendChild(s),t=!0}}finally{Ch.textDocument.endUpdate()}t&&Ch.commit(!1)}var Uc=".em-prevent-action";function n$(e){const{fingerprint:t,applicationElementSettingsSet:n}=e,r=document.querySelector("[em-edit]"),o=t.take(r);if(t.differs(o)){if(document.body?.classList.contains("em-sandbox-discuss")){t.accept(o);return}if(r){r.closest(".em-prevent-action")||(t.accept(o),n({elem:r}));return}setTimeout(()=>{const i=document.querySelector("[em-edit]"),s=t.take(i);i?t.differs(s)&&(t.accept(s),i.closest(".em-prevent-action")||n({elem:i})):(t.accept(s),n({elem:null}))},0)}}function r$(e){const t=document.body;if(!t)return;const n=e.isAppLocked()||e.isIntegratorLocked();(e.isAppLocked()!==t.classList.contains("mceNonEditable")||e.isIntegratorLocked())&&Be(t,!!n,"mceNonEditable"),Be(t,!!j.get("previewPage"),"em-sandbox-preview")}function o$(e){const{htmlDocument:t,commit:n,focusController:r}=e,o=yF(()=>JF(t));t.onChange(a=>{a.some(l=>l.added.length||l.characterDataChanged||l.reordered?.length||l.reparented?.length)&&o()}),t.onChange(()=>{t$()}),t.onRefresh(()=>e.initPreview()),t.onChange(a=>{a.some(l=>l.removed.some(c=>c instanceof HTMLHeadElement||c instanceof HTMLLinkElement&&c.hasAttribute("em")))&&document.querySelector(".em-editor-wrapper")?.remove()});const i=new e$;let s;t.onChange(a=>{for(const l of a)for(const c of l.added)i.add(c.parentElement??c);s||(s=setTimeout(()=>{r.whenEditorLostFocus(()=>{i.clear(),n(!1)}),s=void 0},1e3))}),t.onChange(gF(e.applicationElementSettingsSet)),t.onChange(()=>{e.selectionLock.isLocked()||(n$(e),r$(e.editLock))})}function i$(e,t,n){if(!(e instanceof Element)||!e.closest(".em-prevent-action"))return;const r=document.querySelector(".em-editor-wrapper");if(!document.querySelector("[em-edit]")&&!r)return;const o=n.acquire();try{document.querySelectorAll("[em-edit]").forEach(i=>i.removeAttribute("em-edit")),r&&(r.style.display="none"),It(()=>document.querySelectorAll("editor").forEach(i=>i.blur())),t.forget()}finally{o.releaseLater()}}function s$(e,t){const n=pt(r=>i$(r.target,e,t));return window.addEventListener("mousedown",n,!0),window.addEventListener("click",n,!0),{dispose(){window.removeEventListener("mousedown",n,!0),window.removeEventListener("click",n,!0)}}}var a$={name:"sandbox.fingerprint",provides:[Ho],awaits:{services:[X,Ne]},setup(e){const t=O(e,X),n=O(e,Ne),r=IP(o=>t.getOuterHtml(o));DP(r,n),s$(r,n),e.inject(Ho,r)}},l$={name:"sandbox.setCursor",provides:[yt],awaits:{services:[X,pn,ot]},setup(e){const t={HTMLDocument:O(e,X),documentMapping:O(e,pn),remoteDocument:O(e,ot),messageService:z};e.inject(yt,n=>HP(n,t))}},c$={name:"sandbox.wrapEditor",provides:[gn],awaits:{services:[X,pn,Te]},setup:e=>e.inject(gn,fF({commit:dt(e),htmlDocument:O(e,X),documentMapping:O(e,pn)}))};function u$(e){const{container:t}=e;Vs.registerAll({MessageService:()=>z,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(X),SyncServiceInternals:()=>t.getInstance(ot),TextDocument:()=>t.getInstance(rs),Mapping:()=>t.getInstance(pn),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&Vs.initFeatures(e.features)}var d$=e=>e,f$=e=>`table:empty::before {
|
|
54
|
+
/*content: 'Paste block here';*/
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
table:is(:empty, :has(> tbody:only-child:empty))::after {
|
|
58
|
+
content: '${e.DROP_BLOCK_HINT}' !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[em="block"].empty-structure td:not([height]):not([width]):empty::before {
|
|
62
|
+
/*content: 'Paste atom here';*/
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.em-block-insert:after {
|
|
66
|
+
content: '${e.PASTE_HERE}' !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.em-atom-insert:after,
|
|
70
|
+
.em-blockatom-insert:after {
|
|
71
|
+
content: '${e.PASTE_HERE}' !important;
|
|
72
|
+
}`,m$=class extends Ee{constructor(e){super(),k(this,"htmlDocument",void 0),k(this,"_localized",{...a2(d$)}),k(this,"_styles",""),k(this,"_onChangeLocaleEmitter",new ge),k(this,"_onDomChanged",()=>{if(!document.querySelector('[data-em-localization="true"]')&&this._styles){const t=document.querySelector("head")||document.querySelector("body");if(t){const n=document.createElement("style");n.innerHTML=this._styles,n.dataset.emLocalization="true",t.insertBefore(n,t.firstChild)}}}),k(this,"onChangeLocale",this._onChangeLocaleEmitter.event),this.htmlDocument=e,this.addDisposable(e.onChange(this._onDomChanged))}get localized(){return this._localized}setTranslations({name:e,data:t}){this._localized=t;const n=document.createElement("style");n.dataset.emLocalization="true";const r=f$(t);if(r&&this._styles!==r){this._styles=r,n.innerHTML=r;const o=document.querySelector('[data-em-localization="true"]');if(o)o.replaceWith(n);else{const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(n,i.firstChild)}this.htmlDocument.commit(!1)}this._onChangeLocaleEmitter.fire({name:e,data:t})}};function h$(e){const t=new m$(e),n=r=>{t.setTranslations(r)};return t.addDisposable(z.addListener(ue.SANDBOX_TRANSLATIONS,n)),t}function p$(e,t,n){const r=new Ee;let o=[];return r.addDisposable(e.beforeChange(({treeMutations:i})=>{t.isEditorInFocus&&o.push(...i)})),r.addDisposable(t.editorLostFocus(()=>{if(o.length){const i=[];for(const s of o){const a=s.type;let l=null;a==="Add"?l=s.node:a==="Update"&&(l=s.next),l?.closed===!1&&i.push(l)}i.length&&(e.correctNodes(i),n.saveChanges(!1)),o=[]}})),r}function g$(e){const t=new Ee,n=r=>{VF(r,e)||z.send(ue.APPLICATION_IFRAME_DRAG_EVENT,{type:r.type,clientX:r.clientX,clientY:r.clientY,value:r.dataTransfer?.getData("Text")||""})};return window.addEventListener("dragstart",n),window.addEventListener("dragover",n),window.addEventListener("drag",n),window.addEventListener("dragleave",n),window.addEventListener("dragend",n),window.addEventListener("drop",n),window.addEventListener("dragenter",n),t.addDispose(()=>{window.removeEventListener("dragstart",n),window.removeEventListener("dragover",n),window.removeEventListener("drag",n),window.removeEventListener("dragleave",n),window.removeEventListener("dragend",n),window.removeEventListener("drop",n),window.removeEventListener("dragenter",n)}),t}function b$(){const e=new H_,t=r=>{const o=new DataTransfer;switch(o.setData("Text",r.value),r.type){case"dragenter":e.enter(r.clientX,r.clientY,o);break;case"dragover":e.over(r.clientX,r.clientY,o);break;case"dragleave":e.leave(r.clientX,r.clientY,o);break;case"dragend":e.end(r.clientX,r.clientY,o);break;case"drop":e.drop(r.clientX,r.clientY,o)}},n=new Ee;return n.addDisposable(z.addListener(ue.SANDBOX_DRAG_EVENT,t)),n.addDisposable(g$(e)),n}function y$(){return NodeFilter.FILTER_ACCEPT}function v$(e){if(e instanceof Comment)return[e];const t=[];if(e){const n=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,y$);let r;for(;r=n.nextNode();)t.push(r)}return t}var E$=new fv,S$=new Set;function z_(e){return e?E$.getUnescapedText(e,!0,S$)!==e:!1}function U_(e){return e.nodeValue?z_(e.nodeValue):!1}function w$(e){const t=e.previousSibling;if(t instanceof HTMLSpanElement&&t.classList.contains("em-code")&&t.classList.contains("em-code_var"))return t}function ua(e){const t=e?.nextSibling;if(t instanceof Comment&&U_(t))return t}function j_(e,t){if(t.ownerDocument){const n=t.ownerDocument.createRange();try{n.selectNode(t)}catch{n.selectNodeContents(t)}const r=e.compareBoundaryPoints(Range.START_TO_START,n)===1,o=e.compareBoundaryPoints(Range.END_TO_END,n)===-1;if(r&&!o)return 0;if(!r&&o)return 1;if(r&&o)return 2}return 3}function _$(){let e=!1;document.addEventListener("keydown",n=>{n.key.toLowerCase()==="arrowleft"&&(e||(e=!0,setTimeout(()=>{e=!1},50)))});const t=()=>{const n=window.getSelection();if(n?.rangeCount){const r=n.getRangeAt(0),o=document.querySelectorAll(".em-code");for(const i of o){const s=i.nextSibling;if(s instanceof Comment){if(j_(r,i)===0&&j_(r,s)===1){e?(r.setStartBefore(i),r.setEndBefore(i)):(r.setStartAfter(s),r.setEndAfter(s));return}n.containsNode(s)&&!n.containsNode(i)&&r.setStartAfter(s)}}}};return document.addEventListener("selectionchange",t),{dispose(){document.removeEventListener("selectionchange",t)}}}var C$=e=>{if(!e)return;(!e.firstChild||e.firstChild.nodeType!==Node.TEXT_NODE)&&(e.textContent="",e.appendChild(document.createTextNode(" ")));const t=e.firstChild;t.textContent===""&&(t.textContent=" ");const n=window.getSelection();if(!n)return;const r=document.createRange();r.setStart(t,1),r.collapse(!0),n.removeAllRanges();const o=e.closest('[contenteditable="true"]');It(()=>{n.addRange(r),o?.focus()})},V_=e=>{const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=null,r;for(;r=t.nextNode();)n=r;return n},T$=(e,t)=>{const n=e.startContainer,r=e.startOffset,o=V_(t);if(!o)return!1;const i=o.textContent?.length??0;return n===o&&r===i},A$=(e,t)=>{try{const n=window.getSelection();if(!n)return!1;const r=document.createRange();return r.setStart(e,t),r.collapse(!0),n.removeAllRanges(),n.addRange(r),!0}catch{return!1}};function k$(e,t,n){const{startContainer:r}=e;if(!e.collapsed||!t.isForeign(r))return null;let o=r;for(;o.parentNode&&t.isForeign(o.parentNode);)o=o.parentNode;if(!o.parentElement?.closest('[contenteditable="true"]'))return null;if(n==="ArrowLeft"||n==="ArrowRight")return{node:o,side:n==="ArrowLeft"?"before":"after"};const i=document.createRange();return i.selectNodeContents(o),i.setEnd(e.startContainer,e.startOffset),{node:o,side:i.toString()===""?"before":"after"}}function G_(e){const t=e.startContainer;return Dt(t)?t:Dt(t.parentNode)?t.parentNode:null}function L$(e){const t=e.previousSibling;if(t?.nodeType===Node.ELEMENT_NODE&&t.tagName==="EM-REPLACE")return{em:t,side:"after"};const n=e.nextSibling;return n?.nodeType===Node.ELEMENT_NODE&&n.tagName==="EM-REPLACE"?{em:n,side:"before"}:null}function N$(e){return document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode()}function x$({em:e,side:t}){const n=t==="after"?V_(e):N$(e);if(!n)return;const r=document.createRange();r.setStart(n,t==="after"?Math.max(n.length-1,0):Math.min(1,n.length)),r.collapse(!0);const o=window.getSelection();o&&ws(o,r)}function O$(e){const t=_=>e.renderOnly(_);let n=null,r=null,o=!1;const i=_=>!!n&&n.em===_.em&&n.side===_.side&&r===(_.side==="after"?"ArrowLeft":"ArrowRight"),s=_=>{UP(document,t,_)&&e.commit(!1),jP(document,t,_)},a=()=>{const _=window.getSelection();if(o||!_?.rangeCount)return;const A=_.getRangeAt(0),b=e.ownership?k$(A,e.ownership,r):null;if(b){n=null;const T=xf(b.node,b.side,t);s(T);return}const g=jv(A);if(g&&i(g)){n=null,x$(g),s();return}if(g){const T=Bl(g.em,g.side,t);n=g,s(T);return}const E=A.collapsed?G_(A):null;n=E?L$(E):null,s(E)},l=()=>{const _=window.getSelection(),A=_?.rangeCount?G_(_.getRangeAt(0)):null;return!!A&&e.applyOwn(()=>VP(A,t))!==null},c=_=>{!_.isComposing&&l()&&e.commit(!0)},u=()=>{o=!0},d=()=>{o=!1,l(),e.commit(!0)},f=_=>{r=_.key},h=_=>{const A=window.getSelection();A?.rangeCount&&_?.closest?.('[contenteditable="true"]')&&Qv(A.getRangeAt(0),t)},m=_=>{_.key?.length===1&&!_.ctrlKey&&!_.metaKey&&!_.altKey&&h(_.target)},p=_=>{_.inputType==="insertCompositionText"&&h(_.target)},v=()=>{r=null},w=_=>Of(_,t);return e.holdCaretAfterBreak=w,document.addEventListener("selectionchange",a),document.addEventListener("input",c),document.addEventListener("compositionstart",u,!0),document.addEventListener("compositionend",d,!0),document.addEventListener("keydown",f,!0),document.addEventListener("pointerdown",v,!0),window.addEventListener("keydown",m,!0),window.addEventListener("beforeinput",p,!0),{dispose(){e.holdCaretAfterBreak===w&&(e.holdCaretAfterBreak=void 0),document.removeEventListener("selectionchange",a),document.removeEventListener("input",c),document.removeEventListener("compositionstart",u,!0),document.removeEventListener("compositionend",d,!0),document.removeEventListener("keydown",f,!0),document.removeEventListener("pointerdown",v,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("beforeinput",p,!0)}}}function Th(){return j.get("commonStyles")}var jc={Thin:"100","Thin Italic":"100i",ExtraLight:"200","ExtraLight Italic":"200i",Light:"300","Light Italic":"300i",Regular:"400","Regular Italic":"400i",Medium:"500","Medium Italic":"500i",SemiBold:"600","SemiBold Italic":"600i",Bold:"700","Bold Italic":"700i",ExtraBold:"800","ExtraBold Italic":"800i",Black:"900","Black Italic":"900i"},R$={"Sans Serif":"sans-serif",Serif:"serif"},X_=":scope > td, :scope > tr > td, :scope > tbody > tr > td";function _i(e){return e.querySelector(X_)}function da(e){return Array.from(e.querySelectorAll(X_))}function Ah(e){const t=e.closest('[em="block"]');return t?_i(t)??t.querySelector("td"):null}function K_(e){const t=e.closest('[em="block"]');return!!t&&(e===t||da(t).includes(e))}var M$=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Wr=(e,t)=>{M$()},qr=new Map;function P$(e){return qr.get(e.toLowerCase())?.[0]}function kh(e){return qr.get(e.toLowerCase())??[]}function I$(){return qr.size>0}function Y_(){return[...qr.values()].map(e=>e[0])}function D$(e){qr=new Map;for(const t of e??[]){const n=t.family.toLowerCase();qr.set(n,[...qr.get(n)??[],t])}return qr}var B$=e=>{const t=D$(e);Wr("iframe: project fonts map received",{count:t.size,families:[...t.keys()],entries:e})};function H$(){const e=new Ee;return e.addDisposable(z.addListener(ue.SANDBOX_SET_PROJECT_FONTS,B$)),e}var F$={"sans-serif":"Helvetica, Arial, sans-serif",serif:'"Times New Roman", Times, serif'};function Z_(e){return e.category==="serif"?"serif":"sans-serif"}function Vc(e,t){const n=P$(t);return n?(e.style.fontFamily=F$[Z_(n)],!0):!1}var $$=/(?:\/\*\s*em-project-font-[^*]*\*\/\s*)?@font-face\s*\{([^}]*)\}\s*/g,W$=/url\(\s*(['"]?)(.*?)\1\s*\)/,q$=e=>e.trim().replace(/^(['"])(.*)\1$/,"$2");function Lh(e){return Array.from(e.matchAll($$),t=>{const n=new Map(t[1].split(";").map(r=>r.split(":")).filter(r=>r.length>1).map(([r,...o])=>[r.trim().toLowerCase(),o.join(":").trim()]));return{start:t.index??0,end:(t.index??0)+t[0].length,family:q$(n.get("font-family")??""),src:W$.exec(n.get("src")??"")?.[2]??"",weight:n.get("font-weight")||"400",style:n.get("font-style")||"normal"}})}function Q_(e){return[e.family.toLowerCase(),e.src,e.weight,e.style].join("|")}function J_(e,t){return[...t].sort((n,r)=>r.start-n.start).reduce((n,r)=>n.slice(0,r.start)+n.slice(r.end),e)}function Nh(){return Mt.getInstance(Ab)?.()??document.head}function xh(){return Nh().querySelector('style[em="styles"]')??document.querySelector('style[em="styles"]')}function We(){if(!xh()){const e=document.createElement("style");e.setAttribute("em","styles"),Nh().append(e)}}function z$(){const e=Nh(),t=()=>{const r=xh(),o=Array.from(e.querySelectorAll("style"));return r&&!o.includes(r)?[...o,r]:o};if(!t().length){const r=document.createElement("style"),o=document.querySelector('[em="block"]');if(o){const i=o.offsetWidth;r.innerHTML=`@media only screen and (max-device-width: ${i}px), only screen and (max-width: ${i}px) {}`}e.appendChild(r)}let n=null;for(const r of t()){const o=r.innerHTML.match(/@media.*?max((.|\n|\r)*?){/);if(o){n=o[0];break}}return n===null&&(n="@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {"),n}function Gc(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function eC(e){const t=e.elem.getAttribute("class");if(t){const n=t.split(" ");for(const r of n)r.indexOf("em-mob-padding_"+e.position)>-1&&e.elem.classList.remove(r)}}function Oh(e,t){if(!e)return;const{minify:n,cssbeautify:r,HTMLDocument:o}=t;let i=document.head.querySelector('style[em="styles"]'),s="";i?s=o.getInnerHtml(i):(i=document.createElement("style"),i.setAttribute("em","styles"),i=document.head.insertAdjacentElement("beforeend",i));const a=document.createElement("div");a.insertAdjacentHTML("afterbegin",typeof e=="string"?e:e.join(`
|
|
73
|
+
`));let l=n(s+`
|
|
74
|
+
`+[...a.querySelectorAll("style")].map(c=>c.innerHTML).join(`
|
|
75
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;l=r(l,{indent:" ",autosemicolon:!0}),i.textContent=`
|
|
76
|
+
`+l+`
|
|
77
|
+
`}function Rh(e){const t=e.flatMap(n=>n instanceof Element?[...n.querySelectorAll('style[em="styles"]')]:[]);return t.forEach(n=>n.remove()),[...e,...t]}function Ci(e){return(e||"").replace(/\s/g,"")}function Xc(e,t){return`em-font-${Ci(e)}-${Ci(t)}`}function tC(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Mh(e){return Xc(e[2]||"",e[3]||"")}var Ph="em-font-custom";function U$(e){return e[1]==="Project Fonts"}function Ih(e,t){U$(t)&&e.classList.add(Ph)}function fa(e,t){const n=[...e.classList].filter(r=>r.startsWith(t));n.length>0&&e.classList.remove(...n)}function Dh(e,t){t.forEach(n=>e.style.removeProperty(n))}function nC(e,t,n){t.backgroundColor!==void 0&&(t.backgroundColor===""?(e.removeAttribute("bgcolor"),e.style.removeProperty("background-color"),document.body.style.removeProperty("background-color"),n&&(n.style.color="transparent")):(document.body.style.backgroundColor=t.backgroundColor,e.setAttribute("bgcolor",t.backgroundColor),e.style.backgroundColor=t.backgroundColor,n&&(n.style.color=t.backgroundColor),e.closest(".full-wrap")&&e.closest("body")?.setAttribute("bgcolor",t.backgroundColor))),t.backgroundImage&&(t.backgroundColor===""?(e.style.removeProperty("background-image"),e.removeAttribute("background")):(e.style.removeProperty("background-image"),e.style.backgroundImage=t.backgroundImage[0].type+"("+t.backgroundImage[0].value+")",Ht(e,"background",t.backgroundImage[0].value))),t.backgroundPositionX&&(t.backgroundPositionX==="none"?e.style.removeProperty("background-position-x"):e.style.backgroundPositionX=t.backgroundPositionX!=="initial"?t.backgroundPositionX:""),t.backgroundPositionY&&(t.backgroundPositionY==="none"?e.style.removeProperty("background-position-y"):e.style.backgroundPositionY=t.backgroundPositionY!=="initial"?t.backgroundPositionY:""),t.backgroundRepeat&&(t.backgroundRepeat==="none"?e.style.removeProperty("background-repeat"):e.style.backgroundRepeat=t.backgroundRepeat),t.backgroundSize!==void 0&&(t.backgroundSize===""?e.style.removeProperty("background-size"):e.style.backgroundSize=t.backgroundSize)}function Kc(e){const t={all:{width:null,style:null,color:null},top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}};if(parseInt(e.style.border)||parseInt(e.style.borderTop)||parseInt(e.style.borderRight)||parseInt(e.style.borderBottom)||parseInt(e.style.borderLeft)||parseInt(e.style.borderTopWidth)||parseInt(e.style.borderRightWidth)||parseInt(e.style.borderBottomWidth)||parseInt(e.style.borderLeftWidth)||e.style.borderStyle||e.style.borderTopStyle||e.style.borderRightStyle||e.style.borderBottomStyle||e.style.borderLeftStyle||e.style.borderColor||e.style.borderTopColor||e.style.borderRightColor||e.style.borderBottomColor||e.style.borderLeftColor)if(e.style.border){const n=e.style.border.split(" "),r=parseInt(n[0]),o=n[1]||null,i=V(n[2]+n[3]+n[4])||null;t.all={width:r,style:o,color:i},t.top={width:r,style:o,color:i},t.right={width:r,style:o,color:i},t.bottom={width:r,style:o,color:i},t.left={width:r,style:o,color:i}}else if((e.style.borderWidth||e.style.borderStyle||e.style.borderColor)&&e.style.borderWidth.indexOf(" ")===-1&&e.style.borderStyle.indexOf(" ")===-1&&(!e.style.borderColor||(V(e.style.borderColor)||"").indexOf(" ")===-1))e.style.borderWidth&&e.style.borderWidth.indexOf(" ")===-1&&(t.all.width=parseInt(e.style.borderWidth)),e.style.borderStyle&&(t.all.style=e.style.borderStyle),e.style.borderColor&&(t.all.color=V(e.style.borderColor)||null);else{if(e.style.borderTop){const n=e.style.borderTop.split(" ");t.top.width=parseInt(n[0]),t.top.style=n[1]||null,t.top.color=V(n[2]+n[3]+n[4])||null}else e.style.borderTopWidth&&(t.top.width=parseInt(e.style.borderTopWidth)),e.style.borderTopStyle&&(t.top.style=e.style.borderTopStyle),e.style.borderTopColor&&(t.top.color=V(e.style.borderTopColor)||null);if(e.style.borderRight){const n=e.style.borderRight.split(" ");t.right.width=parseInt(n[0]),t.right.style=n[1]||null,t.right.color=V(n[2]+n[3]+n[4])||null}else e.style.borderRightWidth&&(t.right.width=parseInt(e.style.borderRightWidth)),e.style.borderRightStyle&&(t.right.style=e.style.borderRightStyle),e.style.borderRightColor&&(t.right.color=V(e.style.borderRightColor)||null);if(e.style.borderBottom){const n=e.style.borderBottom.split(" ");t.bottom.width=parseInt(n[0]),t.bottom.style=n[1]||null,t.bottom.color=V(n[2]+n[3]+n[4])||null}else e.style.borderBottomWidth&&(t.bottom.width=parseInt(e.style.borderBottomWidth)),e.style.borderBottomStyle&&(t.bottom.style=e.style.borderBottomStyle),e.style.borderBottomColor&&(t.bottom.color=V(e.style.borderBottomColor)||null);if(e.style.borderLeft){const n=e.style.borderLeft.split(" ");t.left.width=parseInt(n[0]),t.left.style=n[1]||null,t.left.color=V(n[2]+n[3]+n[4])||null}else e.style.borderLeftWidth&&(t.left.width=parseInt(e.style.borderLeftWidth)),e.style.borderLeftStyle&&(t.left.style=e.style.borderLeftStyle),e.style.borderLeftColor&&(t.left.color=V(e.style.borderLeftColor)||null)}return t}function Ti(e){const t={all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null};return(e.style.borderRadius||e.style.borderTopLeftRadius||e.style.borderTopRightRadius||e.style.borderBottomRightRadius||e.style.borderBottomLeftRadius)&&(!e.style.borderRadius||e.style.borderRadius.indexOf(" ")>-1?t.all=null:t.all=parseFloat(e.style.borderRadius),t.topLeft=e.style.borderTopLeftRadius?parseFloat(e.style.borderTopLeftRadius):null,t.topRight=e.style.borderTopRightRadius?parseFloat(e.style.borderTopRightRadius):null,t.bottomRight=e.style.borderBottomRightRadius?parseFloat(e.style.borderBottomRightRadius):null,t.bottomLeft=e.style.borderBottomLeftRadius?parseFloat(e.style.borderBottomLeftRadius):null),t}function ma(e){let t=null;if(e.style.boxShadow){const n=e.style.boxShadow.match(/[^\s\(]+(\(.+\))?/g);n&&(t={hOffset:n[1]?parseFloat(n[1]):null,vOffset:n[2]?parseFloat(n[2]):null,blurRadius:n[3]&&n[3]!=="inset"?parseFloat(n[3]):null,spreadRadius:n[4]&&n[4]!=="inset"?parseFloat(n[4]):null,color:n[0]&&V(n[0])||"",inset:n[3]==="inset"||n[4]==="inset"||n[5]==="inset"})}return t}function Fe(e){return e==null||e===""}function Bh(e){const{elem:t,settings:n}=e,{border:r}=n;r&&(r.all?!Fe(r.all.width)&&(r.all.style||r.all.color)?(t.style.borderWidth=r.all.width+"px",r.all.style&&(t.style.borderStyle=r.all.style),r.all.color&&(t.style.borderColor=r.all.color)):t.style.removeProperty("border"):(r.top&&(!Fe(r.top.width)&&(r.top.style||r.top.color)?(t.style.borderTopWidth=r.top.width+"px",r.top.style&&(t.style.borderTopStyle=r.top.style),r.top.color&&(t.style.borderTopColor=r.top.color)):t.style.removeProperty("border-top")),r.right&&(!Fe(r.right.width)&&(r.right.style||r.right.color)?(t.style.borderRightWidth=r.right.width+"px",r.right.style&&(t.style.borderRightStyle=r.right.style),r.right.color&&(t.style.borderRightColor=r.right.color)):t.style.removeProperty("border-right")),r.bottom&&(!Fe(r.bottom.width)&&(r.bottom.style||r.bottom.color)?(t.style.borderBottomWidth=r.bottom.width+"px",r.bottom.style&&(t.style.borderBottomStyle=r.bottom.style),r.bottom.color&&(t.style.borderBottomColor=r.bottom.color)):t.style.removeProperty("border-bottom")),r.left&&(!Fe(r.left.width)&&(r.left.style||r.left.color)?(t.style.borderLeftWidth=r.left.width+"px",r.left.style&&(t.style.borderLeftStyle=r.left.style),r.left.color&&(t.style.borderLeftColor=r.left.color)):t.style.removeProperty("border-left"))))}function rC(e){const{elem:t,settings:n}=e,{boxShadow:r}=n;if(r)if(!Fe(r.hOffset)&&!Fe(r.vOffset)){let o="";o=r.inset?"inset ":"",o+=r.hOffset+"px ",o+=r.vOffset+"px ",o+=Fe(r.blurRadius)?"":r.blurRadius+"px ",o+=Fe(r.spreadRadius)?"":r.spreadRadius+"px ",o+=r.color?r.color:"",t.style.boxShadow=o}else t.style.removeProperty("box-shadow")}function Ai(e){const{elem:t,settings:n}=e,{borderRadius:r}=n;r&&(r.all?t.style.borderRadius=r.all+"px":(Fe(r.topLeft)?t.style.removeProperty("border-top-left-radius"):t.style.borderTopLeftRadius=r.topLeft+"px",Fe(r.topRight)?t.style.removeProperty("border-top-right-radius"):t.style.borderTopRightRadius=r.topRight+"px",Fe(r.bottomRight)?t.style.removeProperty("border-bottom-right-radius"):t.style.borderBottomRightRadius=r.bottomRight+"px",Fe(r.bottomLeft)?t.style.removeProperty("border-bottom-left-radius"):t.style.borderBottomLeftRadius=r.bottomLeft+"px"))}function oC(e){let t="";if(e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")){const n=e.nodeValue.replace(/^\[if mso\]>/i,"").replace(/<!\[endif\]$/i,"").trim();t+=n}return e.childNodes.forEach(n=>{t+=oC(n)}),t}function iC(e,t,n={value:0}){e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")&&(n.value===0?e.nodeValue=`[if mso]>${t}<![endif]`:e.nodeValue="",n.value++),e.childNodes.forEach(r=>iC(r,t,n))}function j$(e){return e?e.backgroundImage!==void 0||e.backgroundColor!==void 0||e.backgroundSize!==void 0||e.backgroundRepeat!==void 0||e.width!==void 0||e.height!==void 0:!1}var sC=/\[if[^\]]*mso[^\]]*\]/i,aC="[if gte mso 9]></v:textbox></v:rect><![endif]";function V$(e){const t=e.style.backgroundImage;if(t&&t!=="none"){const n=t.match(/url\(["']?([^"')]+)["']?\)/i);if(n)return n[1]}return e.getAttribute("background")||e.getAttribute("data-bg-image")||""}function G$(e){return(e.style.backgroundRepeat||"").trim().toLowerCase().startsWith("repeat")?"tile":"frame"}function X$(e){const t=Math.round(e.getBoundingClientRect().width);if(t)return t;const n=(e.getAttribute("width")||"").trim();return n&&!n.includes("%")&&parseInt(n,10)||0}function K$(e){const t=X$(e),n=Mt.getInstance(kb);return n?n(e,t):t}function Y$(e,t,n,r){const o=t?` color="${t}"`:"";return`[if gte mso 9]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="${r?`width:${r}px;`:"mso-width-percent:1000;"}"><v:fill type="${n}" src="${e}"${o} /><v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0"><![endif]`}function lC(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function ha(e){if(!lC(e))return!1;const t=e.nodeValue||"";return sC.test(t)&&/src\s*=/i.test(t)&&/v:(fill|image|rect)/i.test(t)}function Hh(e){if(!lC(e))return!1;const t=e.nodeValue||"";return sC.test(t)&&/<\/v:(rect|image|textbox)>/i.test(t)&&!/src\s*=/i.test(t)}function Fh(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function cC(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function uC(e){for(const t of Array.from(e.childNodes))(ha(t)||Hh(t))&&e.removeChild(t)}function pa(e,t="inside"){return t==="around"?ha(Fh(e)):Array.from(e.childNodes).some(n=>ha(n))}function dC(e,t="inside"){if(t==="around"){const n=e.parentNode;if(!n)return;const r=Fh(e),o=cC(e);ha(r)&&n.removeChild(r),Hh(o)&&n.removeChild(o);return}uC(e)}function fC(e,t="inside"){const n=V$(e);if(!n){dC(e,t);return}const r=Y$(n,(e.style.backgroundColor||e.getAttribute("bgcolor")||"").trim(),G$(e),K$(e)),o=e.ownerDocument;if(o){if(t==="around"){const i=e.parentNode;if(!i)return;const s=Fh(e);ha(s)&&i.removeChild(s);const a=cC(e);Hh(a)&&i.removeChild(a),i.insertBefore(o.createComment(r),e),i.insertBefore(o.createComment(aC),e.nextSibling);return}uC(e),e.insertBefore(o.createComment(r),e.firstChild),e.appendChild(o.createComment(aC))}}function ga(e,t,n="inside"){t?.outlookBackground===!0?fC(e,n):t?.outlookBackground===!1?dC(e,n):pa(e,n)&&j$(t)&&fC(e,n)}var $h=/v:roundrect/i,Wh=/\[if\s*!\s*mso\]/i,mC=/^\s*(?:<!)?\[endif\]\s*$/i,qh=["background-color","border-radius","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","box-shadow"],Z$=[...qh,"padding","padding-top","padding-right","padding-bottom","padding-left","color","font-family","font-size","font-weight","font-style","text-align","line-height","letter-spacing","width"];function ki(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function zh(e){const t=[],n=r=>{r.childNodes.forEach(o=>{ki(o)&&$h.test(o.nodeValue||"")&&t.push(o),n(o)})};return n(e),t}function hC(e,t){const n=zr(e);if(!n)return!1;const r=n.nodeValue||"";if(!/<center\b[^>]*>[\s\S]*?<\/center>/i.test(r))return!1;const o=gC((t||"").replace(/\s+/g," ").trim());return n.nodeValue=r.replace(/(<center\b[^>]*>)[\s\S]*?(<\/center>)/i,(i,s,a)=>`${s}${o}${a}`),!0}function zr(e){for(const t of Array.from(e.childNodes)){if(ki(t)&&$h.test(t.nodeValue||""))return t;const n=zr(t);if(n)return n}return null}function pC(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function Q$(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function zn(e){const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0}function J$(e,t){const n=(e.textContent||"").replace(/\s+/g," ").trim();if(n)return n;for(const r of t){const o=(r.nodeValue||"").match(/<center[^>]*>([\s\S]*?)<\/center>/i);if(o)return o[1].replace(/\s+/g," ").trim()}return""}function gC(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function eW(e,t){const n=e.getAttribute("bgcolor");n&&(t.style.backgroundColor||(t.style.backgroundColor=n),e.removeAttribute("bgcolor"));for(const r of qh){const o=e.style.getPropertyValue(r);o&&(t.style.setProperty(r,o,e.style.getPropertyPriority(r)),e.style.removeProperty(r))}t.style.display||(t.style.display="block")}function tW(e,t){const n=t.getAttribute("bgcolor");n&&(!e.style.backgroundColor&&!e.getAttribute("bgcolor")&&(e.style.backgroundColor=n),t.removeAttribute("bgcolor"));for(const r of qh){const o=t.style.getPropertyValue(r);o&&(e.style.getPropertyValue(r)||e.style.setProperty(r,o,t.style.getPropertyPriority(r)),t.style.removeProperty(r))}}function nW(e){const t=e.style.display;return t!=="inline-block"&&t!=="block"?!1:!!(e.style.backgroundColor||e.style.borderRadius)}function Uh(e){if(!e)return null;for(const t of Array.from(e.querySelectorAll("[style]")))if(nW(t))return t;return null}function jh(e){return e?!!Uh(e)||!!zr(e):!1}function rW(e,t){for(const n of Z$){const r=e.style.getPropertyValue(n);r&&!t.style.getPropertyValue(n)&&t.style.setProperty(n,r,e.style.getPropertyPriority(n))}t.style.display||(t.style.display="block")}function oW(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function bC(e,t){const n=Uh(t);return n?(rW(n,t),oW(n),zh(t).forEach(r=>r.parentNode?.removeChild(r)),Vh(t),!0):!1}function iW(e){for(const t of e){const n=t.nodeValue||"";if(!$h.test(n))continue;const r=/<v:roundrect[^>]*\bstyle="([^"]*)"/i.exec(n),o=r?r[1]:"",i=/width:\s*(\d+)\s*px/i.exec(o),s=/height:\s*(\d+)\s*px/i.exec(o),a=/arcsize="(\d+)%?"/i.exec(n);return{width:i?zn(i[1]):0,height:s?zn(s[1]):0,arcsize:a?zn(a[1]):0}}return{width:0,height:0,arcsize:0}}function sW(e){const t=e.style;let n=t.borderWidth||t.borderTopWidth||"",r=t.borderStyle||t.borderTopStyle||"",o=t.borderColor||t.borderTopColor||"";if((!n||!r)&&t.border){const a=t.border.trim().split(/\s+/);n||(n=a[0]||""),r||(r=a[1]||""),o||(o=a.slice(2).join(" ")||"")}if(!r||r==="none")return null;const i=parseFloat(n);if(!Number.isFinite(i)||i<=0)return null;const s=r==="dashed"?"dash":r==="dotted"?"dot":"";return{color:V(o)||o||"#000000",weight:`${i}px`,dash:s}}var aW=new Set(["bold","bolder","600","700","800","900"]);function lW(e){const t={bold:!1,italic:!1,underline:!1,strikethrough:!1};e.querySelector("b, strong")&&(t.bold=!0),e.querySelector("i, em")&&(t.italic=!0),e.querySelector("u")&&(t.underline=!0),e.querySelector("s, strike")&&(t.strikethrough=!0);const n=[e,...Array.from(e.querySelectorAll("*"))];for(const r of n){const o=r.style;if(!o)continue;const i=(o.fontWeight||"").toLowerCase();i&&aW.has(i)&&(t.bold=!0),o.fontStyle==="italic"&&(t.italic=!0);const s=o.textDecoration||o.textDecorationLine||"";s.includes("underline")&&(t.underline=!0),s.includes("line-through")&&(t.strikethrough=!0)}return t}function cW(e){const t=[e.height?`height:${e.height}px`:"","v-text-anchor:middle",e.width?`width:${e.width}px`:""].filter(Boolean),n=[e.underline?"underline":"",e.strikethrough?"line-through":""].filter(Boolean).join(" "),r=[e.color?`color:${e.color}`:"",e.fontFamily?`font-family:${e.fontFamily}`:"",e.fontSize?`font-size:${e.fontSize}`:"",e.bold?"font-weight:bold":"",e.italic?"font-style:italic":"",n?`text-decoration:${n}`:""].filter(Boolean),o=!!e.strokeColor&&!!e.strokeWeight,i=o?`stroke="t" strokecolor="${e.strokeColor}" strokeweight="${e.strokeWeight}"`:'stroke="f"',s=o&&e.strokeDash?`<v:stroke dashstyle="${e.strokeDash}"/>`:"",a=u=>u.replace(/"/g,"'"),l=a(`${t.join(";")};`),c=a(`${r.join(";")}${r.length?";":""}`);return`[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${a(e.href)}" style="${l}" arcsize="${e.arcsize}%" ${i} fillcolor="${e.fillcolor||"none"}"><w:anchorlock/>`+s+`<center style="${c}">${gC(e.label)}</center></v:roundrect><![endif]`}function Vh(e){const t=[],n=r=>{r.childNodes.forEach(o=>{if(ki(o)){const i=o.nodeValue||"";(Wh.test(i)||mC.test(i))&&t.push(o)}n(o)})};n(e),t.forEach(r=>r.parentNode?.removeChild(r))}function uW(e){const t=e.closest("td");if(!t)return;const n=e.closest("a")||t.querySelector("a");n&&bC(t,n),zh(t).forEach(r=>r.parentNode?.removeChild(r)),Vh(t),n&&tW(t,n)}function dW(e){const t=e.ownerDocument;if(!t)return;const n=e.parentNode;if(!n)return;const r=pC(e);ki(r)&&Wh.test(r.nodeValue||"")||n.insertBefore(t.createComment("[if !mso]><!"),e);const o=Q$(e);ki(o)&&mC.test(o.nodeValue||"")||n.insertBefore(t.createComment("<![endif]"),e.nextSibling)}function fW(e,t){return e?.backgroundColor!==void 0?e.backgroundColor===""?"none":e.backgroundColor:t.style.backgroundColor||t.getAttribute("bgcolor")||"none"}function mW(e,t){if(t?.width?.value&&t.width.dim==="px")return zn(t.width.value);const n=e?.getAttribute("width")||"";return n&&!n.includes("%")?zn(n):0}function hW(e,t){if(t?.height?.value&&t.height.dim==="px")return zn(t.height.value);const n=e.getAttribute("height")||"";return n&&!n.includes("%")?zn(n):zn(e.style.height)}function pW(e,t){return e?.borderRadius&&e.borderRadius.all!=null?zn(e.borderRadius.all):zn(t.style.borderRadius)}function gW(e,t,n){const r=[t,n].filter(i=>i>0);if(!r.length||e<=0)return 0;const o=Math.min(...r);return Math.max(0,Math.min(100,Math.round(e/o*100)))}function Gh(e,t){const n=e.closest("td");if(!n)return;const r=e.closest("a")||n.querySelector("a");if(!r)return;const o=zh(n),i=J$(r,o),s=iW(o);bC(n,r),eW(n,r),o.forEach(w=>w.parentNode?.removeChild(w)),Vh(n);const a=mW(n.closest("table"),t)||s.width,l=hW(n,t)||s.height,c=pW(t,r),u=lW(r),d=sW(r),f=gW(c,a,l)||s.arcsize,h={href:t?.href!==void 0?t.href:r.getAttribute("href")||"",fillcolor:fW(t,r),width:a,height:l,arcsize:f,label:i,color:r.style.color||"",fontFamily:r.style.fontFamily||"",fontSize:r.style.fontSize||"",bold:u.bold,italic:u.italic,underline:u.underline,strikethrough:u.strikethrough,strokeColor:d?.color||"",strokeWeight:d?.weight||"",strokeDash:d?.dash||""};dW(r);const m=n.ownerDocument;if(!m)return;const p=pC(r),v=m.createComment(cW(h));ki(p)&&Wh.test(p.nodeValue||"")&&p.parentNode?p.parentNode.insertBefore(v,p):n.insertBefore(v,n.firstChild)}function Yc(e,t){return e.replace(/(^|[;\s])color:\s*[^;]*;?/i,`$1color: ${t};`)}function Un(e){return typeof e=="number"&&Number.isFinite(e)}function bW(e){return!e||typeof e!="object"?!1:Un(e.all)||Un(e.top)||Un(e.right)||Un(e.bottom)||Un(e.left)}function yW(e,t){const n=Un(t.all)?t.all:void 0,r=Un(t.top)?t.top:n,o=Un(t.right)?t.right:n,i=Un(t.bottom)?t.bottom:n,s=Un(t.left)?t.left:n;r!==void 0&&(e.style.paddingTop=`${r}px`),o!==void 0&&(e.style.paddingRight=`${o}px`),i!==void 0&&(e.style.paddingBottom=`${i}px`),s!==void 0&&(e.style.paddingLeft=`${s}px`)}function yC(e,t){return Array.from(document.querySelectorAll("link[em-class]")).some(n=>n.getAttribute("em-class")===e&&(t===void 0||n.getAttribute("href")===t))}function vC(e){const t=document.querySelector("title");if(t){t.insertAdjacentElement("afterend",e);return}document.head.appendChild(e)}function EC(e){return e.stylesheet??s2(e.source_url)}function vW(e){return`/* ${`em-project-font-${Ci(e.family)}-${e.weight}-${e.style}`} */
|
|
78
|
+
@font-face{font-family:${JSON.stringify(e.family)};src:url(${JSON.stringify(e.source_url)});font-weight:${e.weight};font-style:${e.style};font-display:swap;}`}var EW=e=>Q_({family:e.family,src:e.source_url,weight:e.weight,style:e.style});function SW(e,t){if(yC(t,e))return;const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.setAttribute("em-class",t),vC(n)}function ba(e,t){const n=e.fontFamilyArray[1],r=e.fontFamilyArray[2],o=e.fontFamilyArray[3],i=Xc(r,o);if(n==="Project Fonts"){const d=kh(r),f=d[0];if(Wr("iframe: addFontFamilyClass Project Fonts",{fontFamilyArray:e.fontFamilyArray,emClass:i,entryFound:!!f,faces:d}),f){We();const h=document.querySelector('style[em="styles"]'),m=[...new Set(d.filter(EC).map(p=>p.source_url))];if(m.forEach(p=>SW(p,i)),h){const p=new Set(Lh(h.textContent??"").map(Q_)),v=d.filter(b=>!EC(b)).filter(b=>!p.has(EW(b))).map(vW).join(`
|
|
79
|
+
`),w=v!=="";w&&h.insertAdjacentHTML("afterbegin",`${v}
|
|
80
|
+
`);const _=`.${tC(i)} {`,A=!h.textContent?.includes(_);if(A){const b=jc[o],g=(b||f.weight).replace(/i$/g,""),E=b?b.endsWith("i"):f.style!=="normal";let T=`font-family: ${JSON.stringify(f.family)}, ${Z_(f)}!important;`;T+=` font-weight: ${g}!important;`,E&&(T+=" font-style: italic!important;"),h.insertAdjacentHTML("beforeend",`
|
|
81
|
+
${_} ${T} }`)}Wr("iframe: project font attached",{emClass:i,stylesheetUrls:m,faceInserted:w,classInserted:A})}else Wr("iframe: style[em=styles] not found — @font-face not injected");setTimeout(()=>{wo({elem:document.documentElement},t),Ur(t),t&&t(!1)},0);return}Wr("iframe: Project Fonts entry missing in map — skip Google Fonts fallback",{fontFamily:r,mapSize:document.querySelectorAll('style[em="styles"]').length}),setTimeout(()=>{wo({elem:document.documentElement},t),Ur(t)},0);return}if(!yC(i)){const d=document.createElement("link");d.setAttribute("rel","stylesheet");const f=jc[o]||"400",h=f.indexOf("i")>-1,m=f.replaceAll("i","");d.setAttribute("href",`https://fonts.googleapis.com/css2?family=${r}:ital,wght@${h?"1":"0"},${m}&display=swap`),d.setAttribute("em-class",i),vC(d)}We();const s=jc[o]||"400",a=s.replaceAll("i",""),l=s.indexOf("i")>-1;let c=`font-family: '${r}', ${R$[n]||"sans-serif"}!important;`;c+=` font-weight: ${a}!important;`,l&&(c+=" font-style: italic!important;");const u=document.querySelector('style[em="styles"]');u&&u.insertAdjacentHTML("beforeend",`
|
|
82
|
+
.${tC(i)} { ${c} }`),setTimeout(()=>{wo({elem:document.documentElement},t),Ur(t)},0)}function wW(e){const t=Ci(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function Ur(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=Lh(n).filter(o=>kh(o.family).length>0&&!wW(o.family));!t||r.length===0||(t.textContent=J_(n,r),Wr("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function wo(e,t){let n=!1;e.elem.querySelectorAll("link[em-class]").forEach(r=>{const o=r.getAttribute("em-class");o&&!document.querySelector("."+o)&&(n=!0,r.remove())}),n&&t&&t(!1)}function Xh(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],wo({elem:document.documentElement},n),Ur(n)):t[0]==="Google Fonts"&&(t[1]==="Sans Serif"?e.style.fontFamily="Helvetica, Arial, sans-serif":t[1]==="Serif"?e.style.fontFamily='"Times New Roman", Times, serif':t[1]==="Project Fonts"&&Vc(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(Xc(t[2],t[3])),ba({fontFamilyArray:t},n))}function SC(e,t){if(t){const n=e.querySelector("b");n?n.replaceWith(...n.childNodes):e.querySelector("strong")||(e.innerHTML="<strong>"+e.innerHTML+"</strong>")}else{const n=e.querySelector("strong"),r=e.querySelector("b");n?n.replaceWith(...n.childNodes):r&&r.replaceWith(...r.childNodes)}if(e.style.fontWeight){const n=e.getAttribute("style")?.replace(/(\s+)?font-weight:(\s+)?(bold|[0-9]*)(;)?/,"")||"";e.setAttribute("style",n)}}function wC(e,t){if(t){const n=e.querySelector("i");n?n.replaceWith(...n.childNodes):e.querySelector("em")||(e.innerHTML="<em>"+e.innerHTML+"</em>")}else{const n=e.querySelector("em"),r=e.querySelector("i");n?n.replaceWith(...n.childNodes):r&&r.replaceWith(...r.childNodes)}if(e.style.fontStyle){const n=e.getAttribute("style")?.replace(/(\s+)?font-style:(\s+)?.*?;/,"")||"";e.setAttribute("style",n)}}function _C(e,t){let n;t>0?n=e.style.letterSpacing?e.getAttribute("style").replace(/letter-spacing:(\s+)?.*?px/,`letter-spacing: ${t}px`):e.getAttribute("style")+` letter-spacing: ${t}px;`:n=e.getAttribute("style")?.replace(/(\s+)?letter-spacing:(\s+)?.*?px(;)?/,"")||"",e.setAttribute("style",n)}function ya(e,t){e&&e.tagName==="TABLE"&&(e.classList.contains("em-vindent-table")||e.querySelector("td")?.innerHTML==="")&&e.querySelector("td")?.setAttribute("height",String(t))}function CC(e,t){const n=Th(),r=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");return r.replaceChildren(...Le(e.html)),r.querySelectorAll('[em="atom"] div[style*="font-family"]').forEach(o=>{const i=o;if(!i.style.display&&parseFloat(i.style.fontSize)<=20){const s=n.text?.fontFamily||[],a=Yc((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.text?.fontSize||16}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${n.text?.lineHeight||24}px`),n.text?.color||"#000000");i.setAttribute("style",a),Xh(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":ya(i.nextElementSibling??i.closest("table")?.nextElementSibling,n.text?.paddingBottom||0)}else if(!i.style.display&&parseFloat(i.style.fontSize)>20){const s=n.headings?.fontFamily||[],a=Yc((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.headings?.fontSize||24}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${n.headings?.lineHeight||32}px`),n.headings?.color||"#000000");i.setAttribute("style",a),Xh(i,s,t),_C(i,n.headings?.letterSpacing||0),SC(i,n.headings?.bold||!1),wC(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":ya(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":ya(i.nextElementSibling,n.headings?.paddingBottom||0)}}),r.querySelectorAll('[em="atom"] a[style*="color"]').forEach(o=>{const i=o;if(i.style.display){if(i.style.display==="block"){const s=n.buttons?.fontFamily||[],a=Yc((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),Xh(i,s,t);const l=i.closest("td"),c=!!l&&!!zr(l)&&!zr(i),u=c?i:l,d=n.buttons?.backgroundColor||"#1677FF";u&&(u.style.backgroundColor=d,u.tagName==="TD"&&u.setAttribute("bgcolor",d)),l&&l.setAttribute("align",n.buttons?.textAlign||"center"),_C(i,n.buttons?.letterSpacing||0),SC(i,n.buttons?.bold||!1),wC(i,n.buttons?.italic||!1);const f=i.closest('[em="atom"] > tr > td'),h=i.closest("table");f?.style.paddingTop?f.style.paddingTop=(n.buttons?.marginTop||0)+"px":h?.previousElementSibling&&ya(h.previousElementSibling,n.buttons?.marginTop||0),f?.style.paddingBottom?f.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":h?.nextElementSibling&&ya(h.nextElementSibling,n.buttons?.marginBottom||0);const m=n.buttons?.padding||{};m.all&&(i.style.padding=m.all+"px"),m.top&&(i.style.paddingTop=m.top+"px"),m.right&&(i.style.paddingRight=m.right+"px"),m.bottom&&(i.style.paddingBottom=m.bottom+"px"),m.left&&(i.style.paddingLeft=m.left+"px"),u&&(n.buttons?.border&&Bh({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&Ai({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&Gh(i,{backgroundColor:d})}}else{const s=Yc(i.getAttribute("style"),n.links?.color||"#0000FF");i.setAttribute("style",s);let a;n.links?.underline?a=i.style.textDecoration?i.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: underline;"):i.getAttribute("style")+" text-decoration: underline;":a=i.style.textDecoration?i.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: none;"):i.getAttribute("style")+" text-decoration: none;",i.setAttribute("style",a)}}),r.querySelector('[em="block"]')&&n.block?.backgroundColor&&r.querySelectorAll('[em="block"]').forEach(o=>{da(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?kt(r):kt(r.querySelector("tbody")||r)}function Kh(e){const t=Th(),n=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Le(e.html)),n.querySelector('[em="block"]')&&t.block?.backgroundColor&&n.querySelectorAll('[em="block"]').forEach(o=>{da(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return bW(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(da).forEach(o=>{yW(o,r)}),n.tagName==="DIV"?kt(n):kt(n.querySelector("tbody")||n)}var _W=e=>{for(const t of Object.keys(jc))if(Ci(t)===e)return t;return e};function CW(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(kh(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=Lh(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=J_(n,o),Wr("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function TW(e){if(!I$())return;const t=document.head.innerHTML,n=new Set;for(const r of Y_()){CW(r.family);const o=`em-font-${Ci(r.family)}-`;document.querySelectorAll(`[class*="${o}"]`).forEach(i=>{[...i.classList].forEach(s=>{if(!s.startsWith(o)||n.has(s))return;n.add(s);const a=s.slice(o.length),l=_W(a);ba({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&Wr("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:Y_().map(r=>r.family)}),Ur(),e&&document.head.innerHTML!==t&&e(!1)}function AW(e,t){const n=new Ee,r=()=>{requestAnimationFrame(()=>{TW(t)})};return n.addDisposable(z.addListener(ue.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function TC(){z.send({operation:"sandbox_resized"})}function kW(e,t){const n=new Ee,r=0;let o=0;n.addDisposable(t.beforeSave(()=>{o&&(clearTimeout(o),o=0)}));function i(){o||(o=setTimeout(()=>{TC(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(In(c))return px(c)?c:[...c.querySelectorAll("img")]})}).filter(l=>!!l).map(l=>l.complete?Promise.resolve():new Promise((c,u)=>{l.addEventListener("load",c),l.addEventListener("error",c)}));a.length&&Promise.all(a).then(i)})),window.addEventListener("resize",i),n.addDispose(()=>window.removeEventListener("resize",i)),n}function LW(e=document,t=window){let n=e.body;const r=new MutationObserver(()=>{if(o(),e.body===n)return;n=e.body;const i=t.parentIFrame;i?.autoResize&&(i.autoResize(!1),n&&(i.autoResize(!0),i.size?.()))});function o(){r.disconnect(),r.observe(e,{childList:!0}),e.documentElement&&r.observe(e.documentElement,{childList:!0})}return o(),{dispose:()=>r.disconnect()}}var NW=/^(?:ant|vscode|monaco|docs)-/;function xW(e){return NW.test(e)}function OW(){const e="em".trim();if(!/^[a-z][a-z0-9]*$/i.test(e))throw new Error(`[cssVars] REACT_APP_CSS_VAR_PREFIX="${e}" is not a valid CSS identifier fragment.`);return e}var RW=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function MW(){return RW}var PW=new Set;function IW(e,t,n=PW){return e.startsWith(`${t}-`)?!1:!xW(e)&&!n.has(e)}function DW(e,t){return`--${t}-${e}`}function BW(e){const t=OW();return IW(e,t,MW())?DW(e,t):`--${e}`}function HW(e){const t=new Ee;let n="";const r=o=>{document.querySelectorAll("style[em-variables]").forEach(a=>a.remove());const i=document.createElement("style");i.dataset.themeVaribalse="true";const s=Object.entries(o).map(([a,l])=>` ${BW(a)}: ${String(l)};
|
|
83
|
+
`).join("");if(s&&n!==s){n=s,i.innerHTML=`:root {
|
|
84
|
+
${s}}`;const a=document.querySelector('[data-theme-varibalse="true"]');if(a)a.replaceWith(i);else{const l=document.querySelector("head")||document.querySelector("body");l?.insertBefore(i,l.firstChild)}e.commit(!1)}};return t.addDisposable(e.onChange(()=>{if(!document.querySelector('[data-theme-varibalse="true"]')&&n){const o=document.createElement("style");o.dataset.themeVaribalse="true",o.innerHTML=`:root {
|
|
85
|
+
${n}}`;const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(o,i.firstChild),e.commit(!1)}})),t.addDisposable(z.addListener(ue.SANDBOX_SET_THEME_VARIABLES,r)),t}var AC=4e3;function FW(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:AC});return}window.setTimeout(e,AC)}function $W(e){const t=e.onDocumentShown(()=>{t.dispose(),FW(()=>{EE().catch(()=>{})})})}var WW={name:"sandbox.crossDomainDrag",setup:()=>b$()},qW={name:"sandbox.themeVariables",awaits:{services:[X]},setup:e=>HW(O(e,X))},zW={name:"sandbox.projectFonts",awaits:{services:[ot,Te]},setup(e){H$();const t=dt(e);AW(O(e,ot),n=>t(n))}},UW={name:"sandbox.pasteSanitizerPrewarm",awaits:{services:[Do]},setup:e=>$W(O(e,Do))},jW={name:"sandbox.variableSelection",setup:()=>_$()},VW={name:"sandbox.emReplaceCaret",awaits:{services:[X]},setup:e=>O$(O(e,X))},GW={name:"sandbox.resizeWatch",awaits:{services:[X,ot]},setup(e){kW(O(e,X),O(e,ot)),LW()}},XW={name:"sandbox.reset",awaits:{services:[X]},setup:e=>pM(O(e,X))},KW={name:"sandbox.correct",awaits:{services:[X,it,ot]},setup:e=>p$(O(e,X),O(e,it).controller,O(e,ot))},YW={name:"sandbox.extensionScripts",awaits:{services:[X,is]},setup:e=>X7(O(e,X),{surface:O(e,is)})},ZW={name:"sandbox.localization",provides:[Nd],awaits:{services:[X]},setup:e=>e.inject(Nd,h$(O(e,X)))};function QW(e=[]){return{name:"sandbox.extensions",awaits:{services:[it,is,X]},setup:t=>u$({container:t,focusController:O(t,it).controller,surface:O(t,is),features:[...e]})}}function JW(e){const t=n=>function r(o,i=10){if(!eq(o)||i<0)return o;if(typeof o=="string")return n(o);if(o instanceof Array)return o.map(a=>r(a,i-1));const s=Object.entries(o).map(([a,l])=>[a,r(l,i-1)]);return Object.fromEntries(s)};return{escape:t(n=>e.escape(n,!0)),unescape:t(n=>e.unescape(n))}}function eq(e){return typeof e=="string"||typeof e=="object"&&e!==null&&!(e instanceof Element)}function kC(e){return/^(data|blob):/i.test(e.trimStart())}function LC(e,t){const n=/^(\s*)([\s\S]*?)(\s*)$/.exec(e);return!n||!n[2]?e:`${n[1]}${t(n[2])}${n[3]}`}function tq(e,t){try{let n="",r=0,o=0;for(;o<e.length;){for(;o<e.length&&/[\s,]/.test(e[o]);)o+=1;if(o>=e.length)break;const i=o;for(;o<e.length&&!/\s/.test(e[o]);)o+=1;let s=o;for(;s>i&&e[s-1]===",";)s-=1;if(n+=e.slice(r,i)+t(e.slice(i,s)),r=s,s!==o)continue;let a=0;for(;o<e.length&&(e[o]!==","||a>0);)e[o]==="("?a+=1:e[o]===")"&&(a=Math.max(0,a-1)),o+=1}return n+e.slice(r)}catch{return e}}function nq(e,t){return e.replaceAll(/url\((\s*['"]?)([^'")]+)(['"]?\s*)\)/gi,(n,r,o,i)=>`url(${r}${LC(o,t)}${i})`)}function Yh(e,t,n){const r=e.toLowerCase();return r==="srcset"?tq(t,n):r==="style"?nq(t,n):LC(t,n)}var rq=["src","___src","background","poster","srcset","style"];function Zc(e){return kC(e)?e:wc(e)}function oq(){const e=new Map,t=n=>{if(kC(n))return n;const r=Zc(n),o=e.get(r);return o?J7(r).replace(new RegExp(`${Ys}=\\d+`),`${Ys}=${o}`):n};return{transform:{name:"em-version",attributes:rq,render:(n,r)=>n&&Yh(r.attribute,n,t),serialize:(n,r)=>n&&Yh(r.attribute,n,Zc)},requestReload(n){e.set(Zc(n.trim()),String(Date.now()))},isPending(n){return e.has(Zc(n.trim()))},clear(){e.clear()}}}var NC=["src","background","poster","srcset","style"];function Zh(e,t=document){const n=NC.map(o=>`[${o}]`).join(","),r=[...t.querySelectorAll(n)];for(const o of r){const i=o.tagName.toLowerCase();for(const s of NC){const a=o.getAttribute(s);if(!a)continue;const l=e.serialize(a,{element:o,tag:i,attribute:s,stage:"apply"})??a,c=Qm(o,s,l,{pipeline:e,stage:"apply"});c===null?a!==l&&o.removeAttribute(s):c!==a&&o.setAttribute(s,c)}}}function iq(e,t){const{pipeline:n,htmlDocument:r}=t,o=oq(),i=n.register(o.transform),s={reload(a){a&&(o.requestReload(a),r.renderOnly(()=>Zh(n)))},clear(){o.clear()}};return e.inject(Ld,s),{reload:s,dispose(){i.dispose(),o.clear(),bn(e,Ld)}}}var sq=["https://emcdn.ru/843/20220715_113006_18.png","https://cdn.useblocks.io/843/230110_18_kXn4Evf.png"],aq="/static/media/",lq="empty-image";function cq(e){return e.replace(/[.-][A-Za-z0-9_-]{7,20}$/,"")}function xC(e){let t;try{t=new URL(e,document.baseURI).pathname}catch{return null}return t.includes(aq)?t:null}function uq(e){return!!e&&xC(e)!==null}function dq(e){if(!e)return!1;if(sq.includes(e))return!0;const t=xC(e);return t===null?!1:cq(t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]+$/,""))===lq}var fq=1e4;function mq(e=fq){const t=new Map,n=new Map,r=(o,i)=>{URL.revokeObjectURL(i.blobUrl),t.delete(o)};return{acquire(o,i){const s=t.get(o);if(s)return s.revokeTimer&&(clearTimeout(s.revokeTimer),s.revokeTimer=void 0),s.refs+=1,s.blobUrl;const a=URL.createObjectURL(i);return t.set(o,{blobUrl:a,refs:1}),n.set(a,o),a},release(o){const i=t.get(o);i&&(i.refs-=1,!(i.refs>0||i.revokeTimer)&&(i.revokeTimer=setTimeout(()=>r(o,i),e)))},peek(o){return t.get(o)?.blobUrl},sourceOf(o){return n.get(o)},forget(o){const i=t.get(o);i&&(i.revokeTimer&&clearTimeout(i.revokeTimer),r(o,i))},get size(){return t.size},dispose(){for(const[o,i]of Array.from(t))i.revokeTimer&&clearTimeout(i.revokeTimer),r(o,i);n.clear()}}}var hq=3e3,pq=["src","___src","background","poster","srcset","style"],Qh=e=>e.startsWith("blob:"),Qc="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%220%22%20height%3D%220%22%2F%3E#em-wait=";function gq(e){const t=encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return`${Qc}${t}`}var bq=new RegExp(String.raw`blob:[^\s"'()<>]+|`+Qc.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+String.raw`[^\s"'()<>]*`,"g");function OC(e){if(e.startsWith(Qc))try{return decodeURIComponent(e.slice(130))}catch{return}}function yq(e){const t=e.attribute.toLowerCase();if(t==="background"||t==="style"||t==="poster")return!0;const n=(e.element?.tagName??e.tag??"").toLowerCase();return n===""?!1:yM(n)}function vq(e){try{return new URL(e,document.baseURI).hostname}catch{return}}function Eq(e){const t=e.store??mq(),n=e.answerTimeoutMs??hq,r=new Map,o=new Set;let i={enabled:!1,sourceHosts:[]},s=!1,a=!1;const l={hits:0,misses:0,refused:0,failed:0},c=m=>{const p=vq(m);return p?p===window.location.hostname||i.sourceHosts.includes(p):!1},u=(m,p=!1)=>{if(r.has(m)||!p&&(o.has(m)||t.peek(m)))return;const v=z.sendAsync(ue.APPLICATION_CANVAS_IMAGE_GET,p?{url:m,fresh:p}:{url:m}).then(_=>{const A=_;if(A&&"blob"in A){t.acquire(m,A.blob),l.hits+=1;return}o.add(m),l.refused+=1}).catch(()=>{o.add(m),l.failed+=1}),w=Promise.race([v,new Promise(_=>{setTimeout(()=>{r.has(m)&&(s=!0,o.add(m),l.failed+=1),_()},n)})]).then(()=>{r.delete(m),e.refresh()});r.set(m,w)},d=m=>{const p=OC(m);if(p!==void 0)return d(p);if(!m||a||Qh(m)||m.startsWith("data:")||uq(m))return m;const v=t.peek(m);return v||(s||!i.enabled||o.has(m)||!c(m)?m:(l.misses+=1,u(m),gq(m)))},f=m=>Qh(m)?t.sourceOf(m)??m:OC(m)??m,h=(m,p,v)=>Yh(p.attribute,m,v);return{configure(m){i={enabled:m.enabled,sourceHosts:[...m.sourceHosts??[]]}},transform:{name:"image-cache",attributes:pq,render:(m,p)=>m&&yq(p)?h(m,p,d):m,serialize:(m,p)=>m&&h(m,p,f)},forget(m){t.forget(m),o.delete(m),!a&&u(m,!0)},fail(m){const p=t.sourceOf(m);return p===void 0||t.peek(p)!==m?!1:(o.add(p),t.forget(p),l.failed+=1,!0)},block(){a=!0},restoreUrls(m){return Jh(m,f)},stats(){return{...l,blobs:t.size}},dispose(){t.dispose(),r.clear(),o.clear()}}}function Sq(e,t,n){let r=!1;const o=s=>{const a=s;r||!String(a.blockedURI??"").startsWith("blob")||a.effectiveDirective!=="img-src"||(r=!0,t.block(),n())},i=s=>{const a=s.target,l=a?.currentSrc||a?.src||"";Qh(l)&&t.fail(l)&&n()};return e.addEventListener("securitypolicyviolation",o),e.addEventListener("error",i,!0),{dispose:()=>{e.removeEventListener("securitypolicyviolation",o),e.removeEventListener("error",i,!0)}}}function wq(e,t){return!e.includes("blob:")&&!e.includes(Qc)?e:e.replace(bq,n=>t(n))}function Jh(e,t){if(typeof e=="string")return wq(e,t);if(Array.isArray(e)){let n=!1;const r=e.map(o=>{const i=Jh(o,t);return n||(n=i!==o),i});return n?r:e}if(e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype){let n=!1;const r={};for(const[o,i]of Object.entries(e)){const s=Jh(i,t);n||(n=s!==i),r[o]=s}return n?r:e}return e}function _q(e,t){const{pipeline:n,htmlDocument:r}=t,o=()=>r.renderOnly(()=>Zh(n)),i=Eq({refresh:o}),s=Sq(document,i,o),a=n.register(i.transform),l=z.addListener(ue.SANDBOX_CANVAS_IMAGE_CACHE_SETUP,u=>{i.configure(u),r.renderOnly(()=>Zh(n))}),c=z.setOutgoingFilter(u=>i.restoreUrls(u));return e.inject(rl,i),{cache:i,dispose(){s.dispose(),c(),l.dispose(),a.dispose(),i.dispose(),bn(e,rl)}}}function Cq(e,t){const n=new zR,r=new wl,o=new UR(n,r),i=new mR(r,n,{prepareHtml:t.prepareHtml,serviceMarkup:PH,mapHTMLRoots:e.mapHTMLRoots,...e.createRoot?{createRoot:e.createRoot}:{},...e.rootsParent?{rootsParent:e.rootsParent}:{}});i.addDisposable(new XR(i,o,n));const s=e.beforeCommit,a=s?i.beforeCommit(()=>s(i)):void 0,l=uN((c,u,d)=>i.applyForeignOutput(c,u,d));return{htmlDocument:i,remoteDocument:n,textDocument:r,documentMapping:o,onDocumentShown:c=>n.onReady(()=>c()),onDocumentReplaced:c=>n.onEntitySet(u=>c(u)),commit:c=>i.commit(c),commitLockedAsync:async c=>{const u=t.lock?.acquire();try{await i.commit(c,!0)}finally{u?.release()}},dispose(){a?.dispose(),l(),i.dispose(),n.dispose(),r.dispose()}}}function Tq(e,t){const n=Cq(t,{prepareHtml:O(e,ol),lock:e.getInstance(Ne)}),r={commit:i=>n.commit(i),commitLockedAsync:i=>n.commitLockedAsync(i)},o=gI();return e.inject(os,t),e.inject(ot,n.remoteDocument),e.inject(rs,n.textDocument),e.inject(pn,n.documentMapping),e.inject(X,n.htmlDocument),e.inject(Te,r),{...n,dispose(){o.dispose(),n.dispose(),bn(e,os),bn(e,ot),bn(e,rs),bn(e,pn),bn(e,X),bn(e,Te)}}}function Aq(){const e=new Set,t=new Set;let n=0;const r=()=>{t.forEach(i=>{try{i()}catch{}})},o=()=>{e.size===0&&n===0&&r()};return{acquire(){const i={suspended:!1};e.add(i);const s=()=>{e.delete(i)&&o()};return{release:s,releaseLater(){Promise.resolve().then(s)}}},isLocked(){for(const i of e)if(!i.suspended)return!0;return!1},lift(i){let s;for(const a of e)a.suspended||(s=a);if(!s)return i();s.suspended=!0,n+=1;try{return i()}finally{s.suspended=!1,n-=1,o()}},onReleased(i){const s=()=>i();return t.add(s),()=>t.delete(s)}}}var kq=Aq();function Lq(e){e.inject(Tb,j),e.inject(Ne,kq),e.inject(Ye,Tf)}var Nq=2e3;function xq(){return Math.random().toString(36).slice(2,10)}function Oq(e){const t=`${e.session??xq()}.`;let n=new Map,r=new WeakMap,o=e.entityId(),i=0;const s=()=>{n=new Map,r=new WeakMap},a=()=>{for(const[d,f]of n)f.deref()||n.delete(d)},l=d=>d.isConnected&&e.isInLetter(d),c=d=>{const f=new Set;for(const h of d)for(let m=h;m&&!f.has(m);m=m.parentNode)f.add(m);for(const[h,m]of n){const p=m.deref();(!p||f.has(p))&&(n.delete(h),p&&r.delete(p))}},u=[e.onEntitySet(d=>{d!==o&&(o=d,s())}),e.onHostChange?.(c)];return{issue(d){if(!l(d))return;const f=r.get(d);if(f&&n.get(f)?.deref()===d)return f;n.size>=Nq&&a(),i+=1;const h=`${t}${i.toString(36)}`;return n.set(h,new WeakRef(d)),r.set(d,h),h},sync(){e.flush()},resolve(d){if(typeof d!="string"||!d.startsWith(t))return;e.flush();const f=n.get(d)?.deref();return f&&l(f)?f:void 0},dispose(){u.forEach(d=>d?.dispose()),s()}}}function Rq(e){return e.flatMap(t=>{switch(t.type){case"Update":return[];case"Add":case"Move":return t.parent?[t.parent]:[];default:return"node"in t?[t.node]:[]}})}function Mq(e,t){return Oq({isInLetter:n=>e.isInLetter(n),flush:()=>e.flushCommit(),entityId:()=>e.entityId,onEntitySet:n=>t.onEntitySet(n),onHostChange:n=>e.beforeChange(({domMutations:r})=>n(Rq(r)))})}var Pq=class extends Ee{get isEditorInFocus(){return!!this._isEditorInFocus}constructor(e){super(),k(this,"_isEditorInFocus",!1),k(this,"_context",new Map),k(this,"_editorLostFocusEmitter",this.addDisposable(new ge)),k(this,"_summaries",[]),k(this,"_onChange",t=>{this._isEditorInFocus&&this._summaries.push(...t)}),k(this,"editorLostFocus",this._editorLostFocusEmitter.event),this.addDisposable(e.onChange(this._onChange))}setFocus(e){this._isEditorInFocus!==e&&(this._isEditorInFocus=e,e||(this._editorLostFocusEmitter.fire(this._summaries),this._summaries=[],this._context.clear()))}whenEditorLostFocusAsync(e){return new Promise(t=>this.whenEditorLostFocus(t,e))}whenEditorLostFocus(e,t){if(this._isEditorInFocus){const n=this._editorLostFocusEmitter.once(e);if(t!==void 0){const r=this._context.get(t);r&&r.dispose(),this._context.set(t,n)}}else e([])}};function Iq(e,t){const{htmlDocument:n,remoteDocument:r}=t,o=new Pq(n);let i;const s=r.beforeSave(c=>{o.isEditorInFocus&&(i=i||c.value,c.preventDefault())}),a=()=>{typeof i=="boolean"&&(r.saveChanges(i),i=void 0)},l={controller:o,setEditorFocus(c){o.isEditorInFocus!==c&&(c&&a(),o.setFocus(c),c||a())},dispose(){s.dispose(),o.dispose(),bn(e,it)}};return e.inject(it,l),l}var Dq={name:"sandbox.state",provides:[Tb,Ne,Ye],setup:Lq},Bq={name:"sandbox.attributePipeline",provides:[Po],setup:SH},Hq={name:"sandbox.documentSync",provides:[X,ot,rs,pn,Te,Do],awaits:{services:[os,ol,Ne]},setup:e=>e.inject(Do,Tq(e,O(e,os)))},Fq={name:"sandbox.images",provides:[rl,Ld],awaits:{services:[Po,X,Do]},setup(e){const t=O(e,Po),n=O(e,X);_q(e,{pipeline:t,htmlDocument:n});const r=iq(e,{pipeline:t,htmlDocument:n}).reload;O(e,Do).onDocumentReplaced(()=>r.clear()),z.addListener(ue.SANDBOX_IMAGE_RESET,({url:o})=>{o&&(e.getInstance(rl)?.forget(o),r.reload(o))})}},$q={name:"sandbox.mapObj",provides:[Bo],awaits:{services:[pn]},setup:e=>e.inject(Bo,JW(O(e,pn)))},Wq={name:"sandbox.elementRefs",provides:[Io],awaits:{services:[X,ot]},setup:e=>e.inject(Io,Mq(O(e,X),O(e,ot)))},qq={name:"sandbox.focus",provides:[it],awaits:{services:[X,ot]},setup:e=>Iq(e,{htmlDocument:O(e,X),remoteDocument:O(e,ot)})},zq={name:"sandbox.app",provides:[Rw,Gm],setup(e){e.getOrCreateInstance(Gm,()=>new Cb),e.injectFactory(Rw,()=>Vs.instance)}},Uq=[zq,Dq,Bq,Hq,Fq,YM,ZM,QM,$q,Wq,qq,WW,qW,zW,jW,VW,GW,XW,KW,YW,ZW,UW,a$,l$,c$,...AP],ep=null,tp=0,jq=6e5;function Vq(e){ep=e,tp=e?Date.now():0}function RC(){const e=ep,t=tp;return ep=null,tp=0,!e||!t||Date.now()-t>jq||!e.isConnected||!e.matches('[em="block"]')?null:e}function Gq(e,t){const n=t.getOuterHtml(e),r=document.implementation.createHTMLDocument("").body,o=r.ownerDocument.createElement(e.tagName==="TR"?"table":"div");document.querySelectorAll("style").forEach(a=>{const l=t.getOuterHtml(a);l&&o.insertAdjacentHTML("beforeend",l)}),o.insertAdjacentHTML("beforeend",`
|
|
86
|
+
`);const i=Le(n)[0];if(!i)return null;i.querySelectorAll("style").forEach(a=>{a.remove()}),i.classList.remove("em-structure"),i.querySelectorAll(".em-structure").forEach(a=>a.classList.remove("em-structure")),o.appendChild(i),e.querySelectorAll('[class*="em-font-"]').forEach(a=>{const l=[...a.classList].find(c=>c.startsWith("em-font-")&&c!=="em-font-custom");if(l){const c=`link[em-class="${l}"]`;!o.querySelector(c)&&document.querySelector(c)&&(o.insertAdjacentHTML("afterbegin",`
|
|
87
|
+
`),o.prepend(document.querySelector(c).cloneNode(!0)))}}),r.append(o),kw(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=Pt(r);return e.tagName==="TR"?s=s.replaceAll(/<body(.|\n|\r)*?><table>/gi,"").replaceAll(/<\/table><\/body>/gi,""):s=s.replaceAll(/<body(.|\n|\r)*?><div>/gi,"").replaceAll(/<\/div><\/body>/gi,""),s=s.replaceAll(/html {((.|\n|\r)*?)}/gi,"").replaceAll(/<style[^>]*>\s*<\/style>/gi,""),s}function Xq(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=Gq(o,n);if(!i)return;Vq(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:kc({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function Jc(e){const t=document.querySelector(".em-element-editor:not(.of-atom)");if(!t)return;const n=(t.closest('[em="block"]')||t.closest('[em="group"]'))?.getBoundingClientRect().top||0;if(e.scrollTop>n+55){const r=e.scrollTop-n;t.style.top=r+8+"px"}else t.style.removeProperty("top")}function eu(e){const t=document.querySelector(".em-element-editor");if(!t)return;const n=t.getBoundingClientRect(),r=document.querySelector(".em-element-editor-widget");r&&(n.top<0?r.classList.add("sticky"):r.classList.remove("sticky"),n.top+t.offsetHeight-10-r.offsetHeight<0&&r.classList.remove("sticky"),e(!1))}var Qe=()=>zl(window.getSelection()?.toString())??"",Kq=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],Yq={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},Zq=/^#[\da-f]{6}$/i,MC=()=>[...new Set(Kq.flatMap(Qq).map(V).filter(e=>Zq.test(e)).map(e=>e.toUpperCase()))];function Qq({type:e,name:t}){const n=Yq[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}function PC(e){return e.filter(t=>!Sc.includes(t))}function Jq(e){return Sc.some(t=>e.classList.contains(t))?(e.classList.remove(...Sc),e.classList.length||e.removeAttribute("class"),!0):!1}function ez(e){return Array.from(e.rows).flatMap(t=>[t,...Array.from(t.cells)]).map(Jq).includes(!0)}function tz(e){const t=[];let n="",r=0,o=0;for(let i=0;i<e.length;i++){const s=e[i];n?s==="\\"?i++:s===n&&(n=""):s==='"'||s==="'"?n=s:s==="("?r++:s===")"?r=Math.max(0,r-1):s===";"&&r===0&&(t.push(e.slice(o,i)),o=i+1)}return t.push(e.slice(o)),t}function IC(e){return tz(e??"").flatMap(t=>{const n=t.indexOf(":"),r=t.slice(0,Math.max(n,0)).trim();return r?[{name:r,value:t.slice(n+1).trim()}]:[]})}var jr=["top","right","bottom","left"],DC=["width","style","color"];function np(e,t){return e===t?jr:jr.filter(n=>e===`${t}-${n}`)}function nz(e,t){const n=e.toLowerCase();if(t==="padding")return np(n,"padding");const[r,o,i,...s]=n.split("-");return r!=="border"||s.length?[]:o===void 0||i===void 0&&DC.includes(o)?jr:i===void 0||DC.includes(i)?jr.filter(a=>a===o):[]}function tu(e,t,n){const r=[];let o=-1,i=0;for(const a of e){const l="managed"in a?[]:nz(a.name,t);if("managed"in a?a.managed===t:l.length>0&&l.every(c=>n.includes(c))){o=o<0?r.length:o;continue}r.push(a),i=l.some(c=>n.includes(c))?r.length:i}const s=Math.max(o<0?r.length:o,i);return[...r.slice(0,s),{managed:t},...r.slice(s)]}var rz=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"];function oz(e){return!!e.closest("editor.em-text")}function iz(e){e.querySelectorAll(rz.join(",")).forEach(t=>{oz(t)||t.remove()})}function sz(e){e.querySelectorAll("editor").forEach(t=>{const n=Array.from(t.childNodes);if(t.parentNode!==e||t.querySelector("div")){t.replaceWith(...n);return}const r=t.ownerDocument.createElement("div");r.append(...n),t.replaceWith(r)})}var az=".em-element-resize-img, .em-element-img-change-group";function lz(e){e.querySelectorAll(az).forEach(t=>t.remove()),e.querySelectorAll("span.em-element-resize-img-container").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function cz(e){const t=e.cloneNode(!0);return nn(e,t),Zo(t),iz(t),lz(t),sz(t),Ke(t)}function nu(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function uz(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=nu(t[0]),r=t[1],o=t.slice(2).join(" ");if(n!==void 0&&["none","solid","dashed","dotted","double"].includes(r))return{width:n,style:r,color:o}}function dz(e,t,n){const r=t.split(/\s+/).map(nu),o=np(e,"padding"),i=e==="padding"?4:1;if(!o.length||r.length>i||r.some(f=>f===void 0))return!1;const[s,a=s,l=s,c=a]=r,u={top:s,right:a,bottom:l,left:c},d={...n.padding};return o.forEach(f=>d[f]=u[f]),n.padding=d,!0}function fz(e,t,n){const r=uz(t);if(!r)return!1;const o={...n.borders};return np(e,"border").forEach(i=>o[i]={...r}),n.borders=o,!0}function Vr(e,t,n){return n===void 0||n===""?!1:(e[t]=n,!0)}var mz={"font-family":{family:"font-family",consume:(e,t,n)=>Vr(n,"fontFamily",t)},"font-size":{family:"font-size",consume:(e,t,n)=>Vr(n,"fontSize",nu(t))},"line-height":{family:"line-height",consume:(e,t,n)=>Vr(n,"lineHeight",nu(t))},color:{family:"color",consume:(e,t,n)=>Vr(n,"color",BC(t))},"background-color":{family:"background-color",consume:(e,t,n)=>Vr(n,"backgroundColor",BC(t))},"text-align":{family:"text-align",consume:(e,t,n)=>Vr(n,"textAlign",hz(t))},"vertical-align":{family:"vertical-align",consume:(e,t,n)=>Vr(n,"verticalAlign",pz(t))},"border-radius":{family:"border-radius",consume:(e,t,n)=>Vr(n,"borderRadius",gz(t))},...Object.fromEntries(["padding",...jr.map(e=>`padding-${e}`)].map(e=>[e,{family:"padding",consume:dz}])),...Object.fromEntries(["border",...jr.map(e=>`border-${e}`)].map(e=>[e,{family:"border",consume:fz}]))};function BC(e){if(e)return e.trim()}function hz(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].find(n=>n===t)}function pz(e){if(!e)return;const t=e.trim().toLowerCase();return["top","middle","bottom"].find(n=>n===t)}function gz(e){if(!e)return;const t=e.trim().replace(/\s+/g," ");if(t&&/^(\d+(\.\d+)?\s*(px|em|rem|%|pt)\s*){1,4}$/i.test(t))return t}function bz(e){const t={},n=[],r=new Set;for(const o of IC(e.getAttribute("style"))){const i=o.name.toLowerCase(),s=mz[i];s?.consume(i,o.value,t)?r.has(s.family)||(r.add(s.family),n.push({managed:s.family})):n.push(o)}return{style:Object.keys(t).length?t:void 0,styleEntries:n}}function yz(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function vz(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}var Ez=["rowspan","colspan","class","style"];function ru(e){return Array.from(e.attributes).filter(t=>!Q7.includes(t.name)).map(t=>({name:t.name,value:t.value}))}function Sz(e,t,n){return ru(e).filter(({name:r})=>!Ez.includes(r)&&!(r==="align"&&t)&&!(r==="valign"&&n))}function wz(e){return ru(e).flatMap(t=>{if(t.name!=="class")return[t];const n=t.value.split(/\s+/).filter(Boolean),r=PC(n);return r.length===n.length?[t]:r.length?[{name:"class",value:r.join(" ")}]:[]})}function HC(e){const t=e.parentElement?.tagName;return t==="THEAD"?"thead":t==="TFOOT"?"tfoot":"tbody"}function _z(e){const t=[];for(let n=0;n<e.length;){let r=n+1;for(;r<e.length&&e[r].parentElement===e[n].parentElement;)r++;t.push(...Array(r-n).fill(r)),n=r}return t}function Cz(e,t){const n=yz(e),r=vz(e);return{...t,contentHtml:cz(e),classList:Array.from(e.classList),tag:e.tagName==="TH"?"th":"td",attrs:Sz(e,n,r),...bz(e),align:n,valign:r}}function Tz(e,t){for(let o=t.row;o<t.row+t.rowspan;o++)for(let i=t.col;i<t.col+t.colspan;i++){var n,r;(n=e[o])[r=i]??(n[r]=t.id)}}function Az(e){const t=_z(e),n=e.map(()=>[]),r=[];e.forEach((i,s)=>{let a=0;for(const l of Array.from(i.cells)){for(;n[s][a];)a++;const c=t[s]-s,u=l.rowSpan===0?c:Math.min(Math.max(1,l.rowSpan||1),c),d=Math.max(1,l.colSpan||1),f=Cz(l,{id:`cell-${r.length}`,row:s,col:a,rowspan:u,colspan:d});r.push(f),Tz(n,f),a+=d}});const o=Math.max(0,...n.map(i=>i.length));return{cells:r,cols:o,grid:n.map(i=>Array.from({length:o},(s,a)=>i[a]??null))}}function kz(e,t){const n={};for(const r of t){const o=HC(r);o!=="tbody"&&r.parentElement&&!n[o]&&(n[o]=ru(r.parentElement))}return{attrs:ru(e),...Object.keys(n).length?{sectionAttrs:n}:{}}}function rp(e,t){const n=Number(/^cell-(\d+)$/.exec(t)?.[1]??NaN);return Array.from(e.rows).flatMap(r=>Array.from(r.cells))[n]}function va(e,t){const n=Array.from(e.rows).flatMap(r=>Array.from(r.cells)).indexOf(t);return n<0?void 0:`cell-${n}`}function Li(e){const t=Array.from(e.rows),n=t.map(r=>({section:HC(r),attrs:wz(r)}));return{rows:t.length,...Az(t),rowsMeta:n,meta:kz(e,t)}}function FC(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}var ou=["top","right","bottom","left"];function Lz(e){if(!e)return[];const t=ou.map(n=>e[n]);return t[0]!==void 0&&t.every(n=>n===t[0])?[`padding: ${t[0]}px`]:ou.flatMap(n=>e[n]===void 0?[]:[`padding-${n}: ${e[n]}px`])}function $C(e){return`${e.width}px ${e.style} ${e.color}`}function Nz(e,t){return!!e&&e.width===t.width&&e.style===t.style&&e.color===t.color}function xz(e){if(!e)return[];const{top:t}=e;return t&&ou.every(n=>Nz(e[n],t))?[`border: ${$C(t)}`]:ou.flatMap(n=>{const r=e[n];return r?[`border-${n}: ${$C(r)}`]:[]})}function Oz(e){const t=new Map;if(!e)return t;const n=[["font-family",e.fontFamily?[`font-family: ${e.fontFamily}`]:[]],["font-size",e.fontSize===void 0?[]:[`font-size: ${e.fontSize}px`]],["line-height",e.lineHeight===void 0?[]:[`line-height: ${e.lineHeight}px`]],["color",e.color?[`color: ${e.color}`]:[]],["background-color",e.backgroundColor?[`background-color: ${e.backgroundColor}`]:[]],["text-align",e.textAlign?[`text-align: ${e.textAlign}`]:[]],["vertical-align",e.verticalAlign?[`vertical-align: ${e.verticalAlign}`]:[]],["border-radius",e.borderRadius?[`border-radius: ${e.borderRadius}`]:[]],["padding",Lz(e.padding)],["border",xz(e.borders)]];for(const[r,o]of n)o.length&&t.set(r,o);return t}function Rz(e){const t=Oz(e.style),n=[];for(const r of e.styleEntries)"managed"in r?(n.push(...t.get(r.managed)??[]),t.delete(r.managed)):n.push(`${r.name}: ${r.value}`);return t.forEach(r=>n.push(...r)),n.join("; ")}function iu(e){return e.map(({name:t,value:n})=>` ${FC(t)}="${FC(n)}"`).join("")}function Mz(e){const t=[["rowspan",e.rowspan>1?String(e.rowspan):void 0],["colspan",e.colspan>1?String(e.colspan):void 0],["align",e.align],["valign",e.valign],["class",e.classList.filter(Boolean).join(" ")||void 0],["style",Rz(e)||void 0]].flatMap(([n,r])=>r===void 0?[]:[{name:n,value:r}]);return`<${e.tag}${iu([...t,...e.attrs])}>${e.contentHtml}</${e.tag}>`}function Pz(e,t,n){const r=e.grid[t].flatMap((o,i)=>{const s=o?n.get(o):void 0;return s&&s.row===t&&s.col===i?[Mz(s)]:[]});return`<tr${iu(e.rowsMeta[t]?.attrs??[])}>${r.join("")}</tr>`}function Iz(e,t){let n="";for(let r=0;r<t.length;){const o=e.rowsMeta[r]?.section??"tbody";let i=r+1;for(;i<t.length&&(e.rowsMeta[i]?.section??"tbody")===o;)i++;const s=t.slice(r,i).join("");n+=o==="tbody"?s:`<${o}${iu(e.meta?.sectionAttrs?.[o]??[])}>${s}</${o}>`,r=i}return n}function WC(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const t=new Map(e.cells.map(r=>[r.id,r])),n=e.grid.map((r,o)=>Pz(e,o,t));return`<table${iu(e.meta?.attrs??[])}>${Iz(e,n)}</table>`}function bt(e){return{rejected:e}}function op(e){return"rejected"in e}function hr(e,t){return e.cells.find(n=>n.id===t)}function Ni(e,t,n){const r=e.grid[t]?.[n];return r?hr(e,r):void 0}function ip(e){let t=-1;for(const n of e.cells){const r=/^cell-(\d+)$/.exec(n.id);t=r?Math.max(t,Number(r[1])):t}return()=>`cell-${++t}`}function Dz(e){return ip(e)()}function Bz(e,t,n){if(!(n.rowspan>=1&&n.colspan>=1&&n.row>=0&&n.col>=0&&n.row+n.rowspan<=e.length&&n.col+n.colspan<=t))return!1;for(let r=n.row;r<n.row+n.rowspan;r++)for(let o=n.col;o<n.col+n.colspan;o++){if(e[r][o]!==null)return!1;e[r][o]=n.id}return!0}function xi(e){const t=Array.from({length:e.rows},()=>Array(e.cols).fill(null)),n=new Set;for(const r of e.cells){if(n.has(r.id)||!Bz(t,e.cols,r))return bt("invalid-layout");n.add(r.id)}return e.rowsMeta.length!==e.rows?bt("invalid-layout"):{...e,grid:t}}function pr(e){return JSON.parse(JSON.stringify(e))}function Hz(e,t){return new DOMParser().parseFromString(e,"text/html").body.firstChild?.nodeType===Node.ELEMENT_NODE?Wz(e,t):" "}function Fz(e){const t=pr(e);return t.contentHtml=Hz(e.contentHtml," "),t.classList=PC(t.classList),t.attrs=t.attrs.filter(n=>n.name!=="id"),t}function $z(e){return{...e,contentHtml:Dw,classList:[""],tag:"td",attrs:[],styleEntries:[],align:"center",valign:"top",style:{}}}function su(e,t){return e?{...Fz(e),...t}:$z(t)}function qC(e){if(e.nodeType===Node.TEXT_NODE){const t=e.textContent||"";return!t||/^\s*$/.test(t.replace(/\u00A0/g,"X"))}return e.nodeType!==Node.ELEMENT_NODE?!0:Array.from(e.childNodes).every(t=>qC(t))}function Wz(e,t){if(typeof e!="string"||typeof t!="string")return e;const n=new DOMParser().parseFromString(e,"text/html").body.firstChild;if(!n)return e;let r=!1;function o(s){if(s.nodeType===Node.TEXT_NODE&&s.textContent?.trim()){r?s.textContent="":(s.textContent=t,r=!0);return}for(const a of Array.from(s.childNodes))o(a)}function i(s,a=!1){if(s.nodeType!==Node.ELEMENT_NODE)return;const l=Array.from(s.childNodes);for(const c of l)i(c);!a&&qC(s)&&s.parentNode?.removeChild(s)}return o(n),i(n,!0),n.outerHTML||e}function qz(e){return e?{section:e.section,attrs:e.attrs.filter(t=>t.name!=="id")}:{section:"tbody",attrs:[]}}function zC(e,t,n){const r=pr(e),o=new Set;for(const s of r.cells)if(s.row<t&&t<s.row+s.rowspan){s.rowspan+=1;for(let a=s.col;a<s.col+s.colspan;a++)o.add(a)}else s.row>=t&&(s.row+=1);const i=ip(e);for(let s=0;s<r.cols;s++)o.has(s)||r.cells.push(su(Ni(e,n,s),{id:i(),row:t,col:s,rowspan:1,colspan:1}));return r.rowsMeta.splice(t,0,qz(e.rowsMeta[n])),r.rows+=1,xi(r)}function UC(e,t,n){const r=hr(e,t);if(!r)return bt("no-cell");const o=r.row+r.rowspan-1;return n==="above"?zC(e,r.row,r.row):zC(e,o+1,o)}function zz(e,t){const n=hr(e,t);if(!n)return bt("no-cell");if(e.rows<=1)return bt("last-line");const r=n.row,o=pr(e);o.cells=o.cells.filter(i=>i.row!==r||i.rowspan>1);for(const i of o.cells)i.row>r?i.row-=1:r<i.row+i.rowspan&&(i.rowspan-=1);return o.rowsMeta.splice(r,1),o.rows-=1,xi(o)}function jC(e,t,n){const r=pr(e),o=new Set;for(const s of r.cells)if(s.col<t&&t<s.col+s.colspan){s.colspan+=1;for(let a=s.row;a<s.row+s.rowspan;a++)o.add(a)}else s.col>=t&&(s.col+=1);const i=ip(e);for(let s=0;s<r.rows;s++)o.has(s)||r.cells.push(su(Ni(e,s,n),{id:i(),row:s,col:t,rowspan:1,colspan:1}));return r.cols+=1,xi(r)}function VC(e,t,n){const r=hr(e,t);if(!r)return bt("no-cell");const o=r.col+r.colspan-1;return n==="left"?jC(e,r.col,r.col):jC(e,o+1,o)}function Uz(e,t){const n=hr(e,t);if(!n)return bt("no-cell");if(e.cols<=1)return bt("last-line");const r=n.col,o=pr(e);o.cells=o.cells.filter(i=>i.col!==r||i.colspan>1);for(const i of o.cells)i.col>r?i.col-=1:r<i.col+i.colspan&&(i.colspan-=1);return o.cols-=1,xi(o)}var jz="img, table, hr, svg, video, iframe, picture";function GC(e){const t=document.createElement("div");return ke(t,e),t}function XC(e){const t=Array.from(e.childNodes).filter(r=>r.nodeType!==Node.TEXT_NODE||(r.textContent??"").trim()!==""),[n]=t;return t.length===1&&n instanceof Element&&n.tagName==="DIV"?n:null}function Vz(e){return(e.textContent??"").replace(/ /g," ").trim()===""&&!e.querySelector(jz)}function Gz(e){const t=GC(e);if(Vz(t))return"";const n=XC(t);return n?Ke(n):e.trim()}function Xz(e,t){const n=t.map(o=>Gz(o.contentHtml)).filter(o=>o!=="").join("<br>").replace(/ $/,""),r=n===""?" ":n;for(const o of[e,...t]){const i=GC(o.contentHtml),s=XC(i);if(s)return ke(s,r),Ke(i)}return n===""?Dw:n}function Kz(e){const t=Math.min(...e.map(r=>r.row)),n=Math.min(...e.map(r=>r.col));return{row:t,col:n,rows:Math.max(...e.map(r=>r.row+r.rowspan))-t,cols:Math.max(...e.map(r=>r.col+r.colspan))-n}}function Yz(e,t,n){for(let r=t.row;r<t.row+t.rows;r++)for(let o=t.col;o<t.col+t.cols;o++){const i=e.grid[r]?.[o];if(!i||!n.has(i))return!1}return!0}function sp(e,t,n){const r=new Set([t,...n]),o=e.cells.filter(c=>r.has(c.id));if(o.length!==r.size)return bt("no-cell");if(r.size<2)return bt("nothing-to-merge");const i=Kz(o);if(!Yz(e,i,r))return bt("not-rectangular");const s=pr(e),a=hr(s,t),l=[...o].sort((c,u)=>c.row-u.row||c.col-u.col);return a.contentHtml=Xz(a,l),Object.assign(a,{row:i.row,col:i.col,rowspan:i.rows,colspan:i.cols}),s.cells=s.cells.filter(c=>c===a||!r.has(c.id)),xi(s)}function Zz(e,t,n){switch(t){case"left":return{row:e.row,col:e.col-n,rows:e.rowspan,cols:n};case"right":return{row:e.row,col:e.col+e.colspan,rows:e.rowspan,cols:n};case"top":return{row:e.row-n,col:e.col,rows:n,cols:e.colspan};default:return{row:e.row+e.rowspan,col:e.col,rows:n,cols:e.colspan}}}function Qz(e,t){if(t.row<0||t.col<0||t.row+t.rows>e.rows||t.col+t.cols>e.cols)return null;const n=[];for(let r=t.row;r<t.row+t.rows;r++)for(let o=t.col;o<t.col+t.cols;o++)n.push(Ni(e,r,o)?.id??"");return n}function Jz(e,t,n,r=1){const o=hr(e,t);if(!o)return bt("no-cell");if(r<1)return bt("nothing-to-merge");const i=Qz(e,Zz(o,n,r));return i?i.includes("")?bt("not-rectangular"):sp(e,t,i):bt("out-of-table")}function KC(e,t,n,r=1){const o=hr(e,t),i=n==="cols"?o?.colspan:o?.rowspan;if(!o||i===void 0)return bt("no-cell");if(r<1||r>=i)return bt("nothing-to-split");const s=pr(e),a=hr(s,t),l={id:Dz(e),row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return n==="cols"?(a.colspan-=r,s.cells.push(su(a,{...l,col:a.col+a.colspan,colspan:r}))):(a.rowspan-=r,s.cells.push(su(a,{...l,row:a.row+a.rowspan,rowspan:r}))),xi(s)}function eU(e,t){return e.row===t.row?t.col>e.col?"right":"left":e.col===t.col?t.row>e.row?"bottom":"top":null}function au(e,t){return Array.from({length:Math.max(0,t-e+1)},(n,r)=>e+r)}function tU(e,t,n){switch(n){case"right":return au(e.col+e.colspan,t.col+t.colspan-1).map(r=>({row:e.row,col:r}));case"left":return au(t.col,e.col-1).map(r=>({row:e.row,col:r}));case"bottom":return au(e.row+e.rowspan,t.row+t.rowspan-1).map(r=>({row:r,col:e.col}));default:return au(t.row,e.row-1).map(r=>({row:r,col:e.col}))}}function nU(e,t,n){const r=Ni(e,t.row,t.col),o=Ni(e,n.row,n.col),i=r&&o&&r.id!==o.id?eU(r,o):null;if(!r||!o||!i)return null;const s=[...new Set(tU(r,o,i).map(a=>Ni(e,a.row,a.col)?.id??""))];return s.includes("")||op(sp(e,r.id,s))?null:{direction:i,cellIds:s}}function rU(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function oU(e,t,n){const r={...e,cells:e.cells.map(o=>({...o,classList:[...o.classList]}))};for(const o of r.cells)t.includes(o.id)&&(o.classList.includes(n)||o.classList.push(n));return r}function lu(e,t){return Array.from({length:t},(n,r)=>e+r)}function iU(e,t){switch(t){case"top":return lu(e.col,e.colspan).map(n=>[e.row-1,n]);case"bottom":return lu(e.col,e.colspan).map(n=>[e.row+e.rowspan,n]);case"left":return lu(e.row,e.rowspan).map(n=>[n,e.col-1]);default:return lu(e.row,e.rowspan).map(n=>[n,e.col+e.colspan])}}function YC(e,t){const n=new Set(t),r=e.cells.filter(s=>n.has(s.id)),o=([s,a])=>n.has(e.grid[s]?.[a]??""),i={};for(const s of r){const a=[];for(const l of jr){const c=iU(s,l),u=c.filter(d=>!o(d)).length;if(u>0&&u<c.length)return Object.fromEntries(r.map(d=>[d.id,[...jr]]));u>0&&a.push(l)}i[s.id]=a}return i}function sU(e,t,n,r){const o={width:1,style:"solid",color:"#b9b1b1"},i={...e,cells:e.cells.map(s=>{const a={...s};return a.style&&(a.style={...a.style},a.style.borders&&(a.style.borders={...a.style.borders})),a})};for(const s of i.cells)if(t.includes(s.id)){s.style||(s.style={}),s.style.borders||(s.style.borders={});for(const a of n){const l=s.style.borders[a];l?s.style.borders[a]={...l,...r}:s.style.borders[a]={...o,...r}}s.styleEntries=tu(s.styleEntries,"border",n)}return i}function aU(e,t,n){const r=pr(e);for(const o of r.cells){if(!t.includes(o.id))continue;const i=o.style?.borders;n.forEach(s=>delete i?.[s]),o.style&&i&&!Object.keys(i).length&&delete o.style.borders,o.styleEntries=tu(o.styleEntries,"border",n)}return r}function lU(e,t){return YC(e,t)}function cU(e){const t=pr(e);return t.cells.forEach(n=>{const r=n.style?.borders;if(!r)return;const o={top:n.row===0,bottom:n.row+n.rowspan===t.rows,left:n.col===0,right:n.col+n.colspan===t.cols};Object.keys(o).filter(i=>o[i]).forEach(i=>delete r[i])}),t}function uU(e,t,n,r){const o={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3},i={...e,cells:e.cells.map(s=>{const a={...s};return a.style&&(a.style={...a.style}),a})};for(const s of i.cells)if(t.includes(s.id)){s.style||(s.style={});const a=(s.style.borderRadius||"0px 0px 0px 0px").split(" ").map(l=>parseInt(l.replace("px",""),10));for(const l of n){const c=o[l];c!==void 0&&(a[c]=r)}a.every(l=>l===0)?delete s.style.borderRadius:s.style.borderRadius=a.map(l=>`${l}px`).join(" ")}return i}var dU=[["topLeft","top","left"],["topRight","top","right"],["bottomLeft","bottom","left"],["bottomRight","bottom","right"]];function fU(e,t){const n={};for(const[r,o]of Object.entries(YC(e,t))){const i=dU.filter(([,s,a])=>o.includes(s)&&o.includes(a)).map(([s])=>s);i.length&&(n[r]=i)}return n}var mU={paddingLeftRight:["left","right"],paddingTopBottom:["top","bottom"],paddingLeft:["left"],paddingTop:["top"],paddingRight:["right"],paddingBottom:["bottom"]};function hU(e,t){if(!t.settings)return e;const n=Object.keys(t.settings);if(n.length===0)return e;const r=n[0],o=mU[r];if(!o)return e;const i=t.settings[r];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach(s=>{s.style||(s.style={}),s.style.padding||(s.style.padding={top:0,right:0,bottom:0,left:0});const a=s.style.padding;o.forEach(l=>a[l]=i),s.styleEntries=tu(s.styleEntries,"padding",o),s.style.padding.top===0&&s.style.padding.right===0&&s.style.padding.bottom===0&&s.style.padding.left===0&&delete s.style.padding,Object.keys(s.style).length===0&&delete s.style}),e}function pU(e,t,n,r){const o={...e,cells:e.cells.map(i=>{const s={...i};return s.style&&(s.style={...s.style},s.style.padding&&(s.style.padding={...s.style.padding})),s})};for(const i of o.cells)if(t.includes(i.id)){i.style||(i.style={}),i.style.padding||(i.style.padding={top:0,right:0,bottom:0,left:0});for(const s of n){const a=s;i.style.padding[a]=r}i.styleEntries=tu(i.styleEntries,"padding",n),["top","right","bottom","left"].forEach(s=>{i.style?.padding&&i.style.padding[s]===0&&delete i.style.padding[s]}),i.style.padding&&Object.keys(i.style.padding).length===0&&delete i.style.padding}return o}function gU(e,t,n){const r={...e,cells:e.cells.map(o=>({...o,style:o.style?{...o.style}:void 0}))};for(const o of r.cells)t.includes(o.id)&&(o.style||(o.style={}),o.style.backgroundColor=n);return r}var cu="none",ZC="b64_",bU=/^(\d+(?:_\d+)?)(px|perc)$/;function yU(e){if(e===cu)return cu;let t="";return new TextEncoder().encode(wc(e)).forEach(n=>{t+=String.fromCharCode(n)}),ZC+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function vU(e){if(e===cu)return cu;if(!e.startsWith(ZC))return e.replace(/em-doubledots/gi,":").replace(/em-dot/gi,".").replace(/em-slash/gi,"/");try{const t=atob(e.slice(4).replace(/-/g,"+").replace(/_/g,"/")),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{return""}}function EU(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function QC(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function JC(e){const t=e.match(bU);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function SU(){return xh()}function De(e,t){const n=SU();n&&n.insertAdjacentHTML("beforeend",`
|
|
88
|
+
${z$()}
|
|
89
|
+
.${e} { ${t} }
|
|
90
|
+
}
|
|
91
|
+
`)}function ye(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function e0(e){const t=e.settings.mobileWidth;if(t.value!=null){let n="";if(t.dim?n=t.classNamePrefix+t.value+(t.dim==="%"?"perc":"px"):n=t.classNamePrefix+t.value,ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),t.dim)De(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`);else{const r=t.value!=="auto"?t.value:"none";De(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${r} !important;`)}}else ye(e.elem,t.classNamePrefix)}function wU(e){const t=e.settings.mobileContentWidth;if(t.value!=null){let n="";t.dim?n=t.classNamePrefix+t.value+(t.dim==="%"?"perc":"px"):n=t.classNamePrefix+t.value,ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),t.dim?De(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`):De(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${t.value}${t.dim} !important;`)}else ye(e.elem,t.classNamePrefix)}function Oi(e){const t=e.settings.mobileHeight;if(t.value!=null){let n="";t.dim?n=t.classNamePrefix+t.value+(t.dim==="%"?"perc":"px"):n=t.classNamePrefix+t.value,ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),t.dim?De(n,`height: ${t.value}${t.dim} !important;`):De(n,`height: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function _U(e){const t=["all","top","right","bottom","left"],n={all:"em-mob-border_all-",top:"em-mob-border_top-",right:"em-mob-border_right-",bottom:"em-mob-border_bottom-",left:"em-mob-border_left-"},r=Object.values(n);e.elem.classList.forEach(i=>{r.some(s=>i.includes(s))&&e.elem.classList.remove(i)});const o=e.settings.mobileBorder;t.forEach(i=>{const s=o[i];if(s&&(parseInt(String(s.width))||s.style||s.color)){let a=(s.classNamePrefix||n[i])+(s.width!=null?s.width+"px":"")+(s.style?"_"+s.style:"")+(s.color?"_"+s.color.substring(1):"");e.elem.classList.add(a),We();let l="";i==="all"?l=(s.width!=null?`border-width: ${s.width}px !important; `:"")+(s.style?`border-style: ${s.style} !important; `:"")+(s.color?`border-color: ${s.color} !important; `:""):l=(s.width!=null?`border-${i}-width: ${s.width}px !important; `:"")+(s.style?`border-${i}-style: ${s.style} !important; `:"")+(s.color?`border-${i}-color: ${s.color} !important; `:""),De(a,l)}})}function CU(e){const t=e.settings.mobileBorderRadius;if(!t)return;const n=["all","topLeft","topRight","bottomRight","bottomLeft"].find(s=>s in t);if(!n)return;const r=t.classNamePrefix||`em-mob-border_radius_${n}-`,o=t[n],i=typeof o=="object"&&o!==null&&"value"in o?o.value:o;if(n==="all"&&i==null){Array.from(e.elem.classList).forEach(s=>{s.startsWith("em-mob-border_radius_")&&e.elem.classList.remove(s)});return}if(i!=null){const s=r+i;e.elem.classList.forEach(a=>{a.indexOf(r)>-1&&e.elem.classList.remove(a)}),n==="all"&&Array.from(e.elem.classList).forEach(a=>{a.startsWith("em-mob-border_radius_")&&e.elem.classList.remove(a)}),e.elem.classList.add(s),We(),De(s,`${{all:"border-radius",topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"}[n]||"border-radius"}: ${i}px !important;`),n!=="all"&&["em-mob-border_radius_topLeft","em-mob-border_radius_topRight","em-mob-border_radius_bottomLeft","em-mob-border_radius_bottomRight"].every(a=>Array.from(e.elem.classList).some(l=>l.startsWith(a)))&&ye(e.elem,"em-mob-border_radius_all-")}else e.elem.classList.forEach(s=>{s.indexOf(r)>-1&&e.elem.classList.remove(s)})}function TU(e){const t=e.settings.mobileBoxShadow,n=t.classNamePrefix||"em-mob-box_shadow-";if(t.hOffset!=null||t.vOffset!=null||t.blurRadius!=null||t.spreadRadius!=null){const r=t.hOffset!=null?`${t.hOffset}px`:"0px",o=t.vOffset!=null?`${t.vOffset}px`:"0px",i=t.blurRadius!=null?`${t.blurRadius}px`:"0px",s=t.spreadRadius!=null?`${t.spreadRadius}px`:"0px",a=t.color||"#000000",l=t.inset?" inset":"",c=n+(t.hOffset!=null?t.hOffset+"px":"0px")+"_"+(t.vOffset!=null?t.vOffset+"px":"0px")+"_"+(t.blurRadius!=null?t.blurRadius+"px":"0px")+"_"+(t.spreadRadius!=null?t.spreadRadius+"px":"0px")+"_"+(t.color?t.color.substring(1):"000000")+(t.inset?"_inset":"");ye(e.elem,n),e.elem.classList.add(c),We(),De(c,`box-shadow:${l} ${r} ${o} ${i} ${s} ${a} !important;`)}else if(t.value){const r=(t.classNamePrefix||"em-mob-boxshadow_")+t.value.replace(/\s/g,"_").replace(/\(/g,"").replace(/\)/g,"").replace(/,/g,"-");ye(e.elem,t.classNamePrefix||"em-mob-boxshadow_"),e.elem.classList.add(r),We(),De(r,`box-shadow: ${t.value} !important;`)}else ye(e.elem,n)}function t0(e){const t=e.fieldName??"mobileAlign",n=e.settings[t];if(n.value){const r=n.classNamePrefix+n.value;ye(e.elem,n.classNamePrefix),e.elem.classList.add(r),We(),De(r,`text-align: ${n.value} !important;`)}else ye(e.elem,n.classNamePrefix)}function AU(e){const t=e.settings.mobileAlign;if(t.value){const n=t.classNamePrefix+t.value;ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We();let r="";t.value==="left"||t.value==="right"?r=`float: ${t.value}`:r="margin: 0 auto",De(n,`${r} !important;`)}else ye(e.elem,t.classNamePrefix)}function n0(e){const t=e.settings.mobileVerticalAlign;if(t.value){const n=t.classNamePrefix+t.value;ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`vertical-align: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function kU(e){const t=e.settings.mobileDirection;if(t.value){const n=t.classNamePrefix+t.value;ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`direction: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function LU(e){const t=e.settings.mobileBackgroundColor;if(t.value){const n=t.value!=="none"?String(t.value).substring(1):"none",r=t.classNamePrefix+n;ye(e.elem,t.classNamePrefix),e.elem.classList.add(r),We(),De(r,`background-color: ${t.value!=="none"?t.value:"transparent"} !important;`)}else ye(e.elem,t.classNamePrefix)}function NU(e){const t=e.settings.mobileBackgroundImage[0];if(t.value){const n=String(t.value),r=t.classNamePrefix+yU(n);ye(e.elem,t.classNamePrefix),e.elem.classList.add(r),We(),De(r,`background-image: ${n!=="none"?EU(wc(n)):"none"} !important;`)}else ye(e.elem,t.classNamePrefix)}function xU(e){const t=e.settings.mobileBackgroundPositionX;if(t.value){const n=t.classNamePrefix+QC(String(t.value));ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`background-position-x: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function OU(e){const t=e.settings.mobileBackgroundPositionY;if(t.value){const n=t.classNamePrefix+QC(String(t.value));ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`background-position-y: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function RU(e){const t=e.settings.mobileBackgroundRepeat;if(t.value&&t.value!=="none"){const n=t.classNamePrefix+t.value;ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`background-repeat: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function MU(e){const t=e.settings.mobileBackgroundSize;if(t.value){const n=t.classNamePrefix+t.value;ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`background-size: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function Ea(e){const t=e.settings.mobilePadding;We(),["top","right","bottom","left"].forEach(n=>{const r=t[n];if(r!=null){eC({elem:e.elem,position:n});const o=t.classNamePrefix+n+"-"+r;e.elem.classList.add(o),De(o,`padding-${n}: ${r}px !important;`)}else r===null&&eC({elem:e.elem,position:n})})}function r0(e){const t=e.settings.mobileFontSize;if(t.value!=null){const n=t.classNamePrefix+t.value+"px";ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`font-size: ${t.value}px !important;`)}else ye(e.elem,t.classNamePrefix)}function o0(e){const t=e.settings.mobileLineHeight;if(t&&t.value!==null){const n=t.classNamePrefix+t.value+"px";ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`line-height: ${t.value}px !important;`)}else t&&ye(e.elem,t.classNamePrefix)}function i0(e){const t=e.settings.show,n=()=>{e.elem.style.removeProperty("display"),e.elem.tagName==="IMG"&&(e.elem.style.display="block"),e.elem.previousSibling&&e.elem.previousSibling.textContent?.indexOf("mso")!==-1&&e.elem.previousSibling.remove(),e.elem.nextSibling&&e.elem.nextSibling.textContent?.indexOf("endif")!==-1&&e.elem.nextSibling.remove()};if(t!=="all"){const r="em-show-"+e.elem.tagName?.toLowerCase()+"-"+t;if(e.elem.classList.forEach(o=>{o.indexOf("em-show-")>-1&&e.elem.classList.remove(o)}),e.elem.classList.add(r),We(),t==="mobile"){e.elem.style.display="none",(!e.elem.previousSibling||e.elem.previousSibling.textContent?.indexOf("mso")===-1)&&(e.elem.insertAdjacentHTML("beforebegin","<!--[if !mso]><!-->"),e.elem.insertAdjacentHTML("afterend","<!--<![endif]-->"));let o="block";e.elem.tagName==="TD"?o="table-cell":e.elem.tagName==="IMG"?o="block":e.elem.tagName==="TABLE"&&(o="table"),De(r,`display: ${o} !important;`)}t==="desktop"&&(n(),De(r,"display: none !important;"))}else n(),e.elem.classList.forEach(r=>{r.indexOf("em-show-")>-1&&e.elem.classList.remove(r)})}function PU(e){const t=e.settings.isContrastBlock,n=Th();if(t){e.elem.closest('[em="block"]')?.classList.add("em-contrast-block");const r=n.block?.contrastBackgroundColor||"#1C52DC";e.elem.setAttribute("bgcolor",r),e.elem.style.backgroundColor=r;const o=e.elem.querySelectorAll('div[style*="font-family"]');o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)<=20&&(s.style.color=n.text?.contrastColor||"#FFFFFF")}),o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)>20&&(s.style.color=n.headings?.contrastColor||"#FFFFFF")}),e.elem.querySelectorAll('a[style*="color"]').forEach(i=>{const s=i;s.style.display||(s.style.color=n.links?.contrastColor||"#FFFFFF")}),e.elem.querySelectorAll('a[style*="font-family"]').forEach(i=>{const s=i;if(s.style.display&&s.style.display==="block"){s.style.color=n.buttons?.contrastColor||"#1C52DC";const a=s.closest("td");if(a){const l=n.buttons?.contrastBackgroundColor||"#FFFFFF";a.setAttribute("bgcolor",l),a.style.backgroundColor=l}}})}else{e.elem.closest('[em="block"]')?.classList.remove("em-contrast-block");const r=n.block?.backgroundColor||"#FFFFFF";e.elem.setAttribute("bgcolor",r),e.elem.style.backgroundColor=r;const o=e.elem.querySelectorAll('div[style*="font-family"]');o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)<=20&&(s.style.color=n.text?.color||"")}),o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)>20&&(s.style.color=n.headings?.color||"")}),e.elem.querySelectorAll('a[style*="color"]').forEach(i=>{const s=i;s.style.display||(s.style.color=n.links?.color||"")}),e.elem.querySelectorAll('a[style*="font-family"]').forEach(i=>{const s=i;if(s.style.display&&s.style.display==="block"){s.style.color=n.buttons?.color||"";const a=s.closest("td");if(a){const l=n.buttons?.backgroundColor||"";a.setAttribute("bgcolor",l),a.style.backgroundColor=l}}})}}function IU(){return{mobileWidth:null,mobileWidthDim:"px",mobileHeight:null,mobileHeightDim:"px",mobileBorder:{all:{width:null,style:null,color:null},top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},mobileBoxShadow:{hOffset:null,vOffset:null,blurRadius:null,spreadRadius:null,color:null,inset:null},mobileAlign:{value:""},mobileTextAlign:{value:""},mobileVerticalAlign:{value:""},mobileDirection:{value:""},mobileBackgroundColor:{value:""},mobileBackgroundImage:[{type:"url",value:""}],mobileBackgroundPositionX:{value:""},mobileBackgroundPositionY:{value:""},mobileBackgroundRepeat:{value:"none"},mobileBackgroundSize:{value:""},mobilePadding:{all:null,bottom:null,left:null,right:null,top:null},show:"all",mobileFontSize:null,mobileFontSizeDim:"px"}}function qe(e,t=!1){const n=IU();return e.elem?.classList?.forEach(r=>{if(r.indexOf("em-mob-width-")>-1&&(r.substring(r.length-2)==="px"?(n.mobileWidthDim="px",n.mobileWidth=parseFloat(r.substring(13,r.length-2))):r.substring(r.length-4)==="perc"?(n.mobileWidthDim="%",n.mobileWidth=parseFloat(r.substring(13,r.length-4))):r.substring(r.length-4)==="auto"&&(n.mobileWidthDim="px",n.mobileWidth="auto")),r.indexOf("em-mob-height-")>-1&&(r.substring(r.length-2)==="px"?(n.mobileHeightDim="px",n.mobileHeight=parseFloat(r.substring(14,r.length-2))):r.substring(r.length-4)==="perc"?(n.mobileHeightDim="%",n.mobileHeight=parseFloat(r.substring(14,r.length-4))):r.substring(r.length-4)==="auto"&&(n.mobileHeightDim="px",n.mobileHeight="auto")),r.indexOf("em-mob-border")>-1){if(r.substring(14,17)==="all"){const o=r.substring(18).split("_");n.mobileBorder.all.width=parseFloat(o[0]),n.mobileBorder.all.style=o[1],n.mobileBorder.all.color=o[2]?"#"+o[2]:""}if(r.substring(14,17)==="top"){const o=r.substring(18).split("_");n.mobileBorder.top.width=parseFloat(o[0]),n.mobileBorder.top.style=o[1],n.mobileBorder.top.color=o[2]?"#"+o[2]:""}if(r.substring(14,19)==="right"){const o=r.substring(20).split("_");n.mobileBorder.right.width=parseFloat(o[0]),n.mobileBorder.right.style=o[1],n.mobileBorder.right.color=o[2]?"#"+o[2]:""}if(r.substring(14,20)==="bottom"){const o=r.substring(21).split("_");n.mobileBorder.bottom.width=parseFloat(o[0]),n.mobileBorder.bottom.style=o[1],n.mobileBorder.bottom.color=o[2]?"#"+o[2]:""}if(r.substring(14,18)==="left"){const o=r.substring(19).split("_");n.mobileBorder.left.width=parseFloat(o[0]),n.mobileBorder.left.style=o[1],n.mobileBorder.left.color=o[2]?"#"+o[2]:""}}if(r.indexOf("em-mob-border_radius")>-1&&(r.substring(21,28)==="topLeft"&&(n.mobileBorderRadius.topLeft=parseFloat(r.substring(29))),r.substring(21,29)==="topRight"&&(n.mobileBorderRadius.topRight=parseFloat(r.substring(30))),r.substring(21,32)==="bottomRight"&&(n.mobileBorderRadius.bottomRight=parseFloat(r.substring(33))),r.substring(21,31)==="bottomLeft"&&(n.mobileBorderRadius.bottomLeft=parseFloat(r.substring(32))),r.substring(21,24)==="all"&&(n.mobileBorderRadius.all=parseFloat(r.substring(25)))),r.indexOf("em-mob-box_shadow")>-1){const o=r.substring(18).split("_");n.mobileBoxShadow.hOffset=parseFloat(o[0]),n.mobileBoxShadow.vOffset=parseFloat(o[1]),n.mobileBoxShadow.blurRadius=parseFloat(o[2]),n.mobileBoxShadow.spreadRadius=parseFloat(o[3]),n.mobileBoxShadow.color=o[4]?"#"+o[4]:"",n.mobileBoxShadow.inset=!!o[5]}r.indexOf("em-mob-text_align")>-1&&(n.mobileAlign.value=r.substring(18)),r.indexOf("em-mob-table_align")>-1&&(n.mobileAlign.value=r.substring(19)),r.indexOf("em-mob-vertical_align")>-1&&(n.mobileVerticalAlign.value=r.substring(22)),r.indexOf("em-mob-direction")>-1&&(n.mobileDirection.value=r.substring(17)),r.indexOf("em-mob-background_color")>-1&&(n.mobileBackgroundColor.value=r.substring(24)!=="none"?"#"+r.substring(24):"none"),r.indexOf("em-mob-background_image")>-1&&(n.mobileBackgroundImage[0].value=vU(r.substring(24))),r.indexOf("em-mob-background_position_x")>-1&&(n.mobileBackgroundPositionX.value=JC(r.substring(29))),r.indexOf("em-mob-background_position_y")>-1&&(n.mobileBackgroundPositionY.value=JC(r.substring(29))),r.indexOf("em-mob-background_repeat")>-1&&(n.mobileBackgroundRepeat.value=r.substring(25)),r.indexOf("em-mob-background_size")>-1&&(n.mobileBackgroundSize.value=r.substring(23)),r.indexOf("em-mob-padding")>-1&&(r.substring(15,18)==="all"&&(n.mobilePadding.all=parseFloat(r.substring(19))),r.substring(15,18)==="top"&&(n.mobilePadding.top=parseFloat(r.substring(19))),r.substring(15,20)==="right"&&(n.mobilePadding.right=parseFloat(r.substring(21))),r.substring(15,21)==="bottom"&&(n.mobilePadding.bottom=parseFloat(r.substring(22))),r.substring(15,19)==="left"&&(n.mobilePadding.left=parseFloat(r.substring(20)))),r.indexOf("em-show")>-1&&(r.substring(r.length-6)==="mobile"?n.show="mobile":r.substring(r.length-7)==="desktop"&&(n.show="desktop")),t&&(r==="em-amp-show-only"?n.ampShow="amp":r==="em-amp-show-disabled"&&(n.ampShow="html")),r.indexOf("em-mob-font_size")>-1&&(n.mobileFontSizeDim="px",n.mobileFontSize=r.substring(17,r.length-2)),r.indexOf("em-mob-line_height")>-1&&(n.mobileLineHeight=r.substring(19,r.length-2))}),n}function DU(e){const t={all:null,top:null,right:null,bottom:null,left:null},n={all:null,top:null,right:null,bottom:null,left:null},r=qe({elem:e}),o=r.mobileWidth,i=r.mobileHeight;(e.style.padding||e.style.paddingTop||e.style.paddingRight||e.style.paddingBottom||e.style.paddingLeft)&&(!e.style.padding||e.style.padding.indexOf(" ")>-1?t.all=null:!e.style.padding&&e.style.paddingTop&&e.style.paddingRight&&e.style.paddingBottom&&e.style.paddingLeft&&e.style.paddingTop===e.style.paddingRight&&e.style.paddingRight===e.style.paddingBottom&&e.style.paddingBottom===e.style.paddingLeft?t.all=parseFloat(e.style.paddingTop):t.all=parseFloat(e.style.padding),t.top=e.style.paddingTop?parseFloat(e.style.paddingTop):null,t.right=e.style.paddingRight?parseFloat(e.style.paddingRight):null,t.bottom=e.style.paddingBottom?parseFloat(e.style.paddingBottom):null,t.left=e.style.paddingLeft?parseFloat(e.style.paddingLeft):null),(r.mobilePadding.all!==null||r.mobilePadding.top!==null||r.mobilePadding.right!==null||r.mobilePadding.bottom!==null||r.mobilePadding.left!==null)&&(r.mobilePadding.all?!r.mobilePadding.all&&r.mobilePadding.top&&r.mobilePadding.right&&r.mobilePadding.bottom&&r.mobilePadding.left&&r.mobilePadding.top===r.mobilePadding.right&&r.mobilePadding.right===r.mobilePadding.bottom&&r.mobilePadding.bottom===r.mobilePadding.left?n.all=parseFloat(String(r.mobilePadding.top)):n.all=r.mobilePadding.all!==null?parseFloat(String(r.mobilePadding.all)):null:n.all=null,n.top=r.mobilePadding.top!==null?parseFloat(String(r.mobilePadding.top)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.right=r.mobilePadding.right!==null?parseFloat(String(r.mobilePadding.right)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.bottom=r.mobilePadding.bottom!==null?parseFloat(String(r.mobilePadding.bottom)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.left=r.mobilePadding.left!==null?parseFloat(String(r.mobilePadding.left)):r.mobilePadding.all===null?null:r.mobilePadding.all);let s=e.getAttribute("align")??"";e.parentElement?.getAttribute("em")!=="group"&&e.querySelector('[em="atom"]')&&e.querySelectorAll('[em="atom"] > tr > td').forEach(c=>{c.getAttribute("align")!==s&&(s="")});const a={padding:t,borderRadius:Ti(e),backgroundColor:e.style.backgroundColor?V(e.style.backgroundColor):e.getAttribute("bgcolor")||"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:e.style.backgroundPositionX&&e.style.backgroundPositionX!=="initial"?e.style.backgroundPositionX:"",backgroundPositionY:e.style.backgroundPositionY&&e.style.backgroundPositionY!=="initial"?e.style.backgroundPositionY:"",backgroundRepeat:e.style.backgroundRepeat||"repeat",backgroundSize:e.style.backgroundSize||"auto",height:{value:e.getAttribute("height")&&e.getAttribute("height")!=="auto"?parseFloat(e.getAttribute("height")):null,dim:e.getAttribute("height")&&e.getAttribute("height")!=="auto"&&e.getAttribute("height").indexOf("%")>-1?"%":"px"},align:s,valign:e.getAttribute("valign")??"",border:Kc(e),boxShadow:ma(e),mobileWidth:{value:o!==null?o:null,dim:r.mobileWidthDim},mobileHeight:{value:i!==null?i:null,dim:r.mobileHeightDim},mobileBorder:r.mobileBorder,mobileBorderRadius:r.mobileBorderRadius,mobileBoxShadow:r.mobileBoxShadow,mobileAlign:r.mobileAlign,mobileVerticalAlign:r.mobileVerticalAlign,mobileDirection:r.mobileDirection,mobileBackgroundColor:r.mobileBackgroundColor,mobileBackgroundImage:r.mobileBackgroundImage,mobileBackgroundPositionX:r.mobileBackgroundPositionX,mobileBackgroundPositionY:r.mobileBackgroundPositionY,mobileBackgroundRepeat:r.mobileBackgroundRepeat,mobileBackgroundSize:r.mobileBackgroundSize,mobilePadding:n,show:r.show,exportAsPicture:e.getAttribute("em-operation")==="exportAsPicture",outlookBackground:pa(e,"inside")},l=e.closest("table");if(l&&l.getAttribute("em")==="atom"){const c=l.getAttribute("width");a.width={value:c&&c!=="auto"?parseFloat(c):null,dim:c&&c!=="auto"&&c.indexOf("%")>-1?"%":"px"}}else{const c=e.getAttribute("width");a.width={value:c&&c!=="auto"?parseFloat(c):null,dim:c&&c!=="auto"&&c.indexOf("%")>-1?"%":"px"}}if(e.style.backgroundImage){const c=e.style.backgroundImage;a.backgroundImage=[{type:"url",value:c?c.substring(5,c.length-2):""}]}else e.getAttribute("background")&&(a.backgroundImage=[{type:"url",value:e.getAttribute("background")||""}]);return a}function BU(e){let t=[],n=null,r=null,o="",i,s=!1;if(e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap")){const a=e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap");if(i=!0,a.parentElement.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1)a.parentElement.querySelectorAll(":scope > .em-mob-wrap:nth-child(odd), :scope > .noresp-em-mob-wrap:nth-child(odd)").forEach(l=>{t.push({width:parseFloat(l.getAttribute("width")||"0"),current:l===a});const c=a.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");c?.nextElementSibling&&(n=parseFloat(c.nextElementSibling.getAttribute("width")||"0"),r=qe({elem:c.nextElementSibling}).mobileHeight||0),(l.classList.contains("em-mob-wrap-cancel")||l.classList.contains("noresp-em-mob-wrap-cancel"))&&(i=!1)});else{const l=a.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");t=[{width:parseFloat(l?.getAttribute("width")||"0"),current:!0}],n=0}o=a.parentElement.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.getAttribute("valign")||"",(e.elem.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap").parentElement.closest("td"))?.getAttribute("dir")==="rtl"&&(s=!0)}else{const a=e.elem.closest('div[style*="inline-block"]');if(a&&a.parentElement.querySelectorAll('div[style*="inline-block"]').length>1)a.parentElement.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const c=l;if(!c.style.fontFamily){const u=l.firstElementChild;t.push({width:parseFloat(u?.getAttribute("width")||"0"),current:l===a});const d=u?.getAttribute("width"),f=parseFloat(c.style.width);n=f-(!d||d.indexOf("%")>-1?f:parseFloat(d))}});else{const l=a?.parentElement?.querySelector('div[style*="inline-block"]');t=[{width:parseFloat(l?.firstElementChild?.getAttribute("width")||"0"),current:!0}],n=0}o=a?.parentElement?.querySelector('div[style*="inline-block"]')?.style.verticalAlign||"",(e.elem.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.elem.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(s=!0)}return{items:t,gap:n,gapMobile:r,valign:o,wrap:i,dirRevers:s}}var HU='table[em-type="social"]';function FU(e){return e.closest(HU)}function $U(e,t){return t.contains(e)?!!(e.tagName==="IMG"||e.tagName==="TD"&&(e.hasAttribute("em-platform")||e.hasAttribute("data-em-platform"))||e.tagName==="A"&&e.querySelector(":scope > img")):!1}function Ri(e){const t=FU(e);if(t&&e!==t&&$U(e,t))return t;const n=e.parentNode;if(!n)return!1;const r=n.tagName,o=n.style,i=n.parentNode;return r==="TD"||r==="TABLE"&&i?.style.display!=="inline-block"&&!e.closest(".em-narrow-table")&&n.getAttribute("em")!=="atom"||r==="DIV"&&(o.display==="inline-block"||o.display==="table-cell")&&o.verticalAlign||(r==="DIV"||r==="TABLE")&&WU(o)?n:Ri(n)}function WU(e){return!!(e.width||e.minWidth||e.maxWidth||e.height||e.background||e.backgroundColor||e.backgroundPositionX||e.backgroundPositionY||e.backgroundImage||e.backgroundRepeat||e.backgroundSize||e.padding||e.paddingTop||e.paddingRight||e.paddingBottom||e.paddingLeft||e.border||e.borderBottom||e.borderBottomWidth||e.borderBottomStyle||e.borderBottomColor||e.borderLeft||e.borderLeftWidth||e.borderLeftStyle||e.borderLeftColor||e.borderTop||e.borderTopWidth||e.borderTopStyle||e.borderTopColor||e.borderRight||e.borderRightWidth||e.borderRightStyle||e.borderRightColor||e.borderRadius||e.borderTopLeftRadius||e.borderTopRightRadius||e.borderBottomLeftRadius||e.borderBottomRightRadius||e.boxShadow||e.textAlign||e.align||e.verticalAlign)}function Mi(){return Mt.getInstance(Nd)?.localized??{}}var s0=[];function qU(){return s0}function a0(e){const t=Mi();let n="",r="";switch(e.tagName){case"A":e.style.display==="block"?(n=t.ELEMENT_PATH_BUTTON,r="em-element-path-item-button"):(n=t.ELEMENT_PATH_LINK,r="em-element-path-item-link");break;case"IMG":e.closest('table[em-type="social"]')?n=t.ELEMENT_PATH_SOCIAL:n=t.ELEMENT_PATH_IMG,r="em-element-path-item-image";break;case"TD":e.parentElement?.getAttribute("em")==="block"?(n=t.ELEMENT_PATH_BLOCK,r="em-element-path-item-block"):e.parentElement?.getAttribute("em")==="atom"||e.closest("table")?.getAttribute("em")==="atom"?(n=t.ELEMENT_PATH_ATOM,r="em-element-path-item-atom"):e.parentElement?.getAttribute("em")==="group"?(n=t.ELEMENT_PATH_GROUP,r="em-element-path-item-group"):e.classList.contains("em-vindent")?(n=t.ELEMENT_PATH_VINDENT,r="em-element-path-item-vindent"):e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap")?(n=t.ELEMENT_PATH_FLOATBLOCK,r="em-element-path-item-column"):(n=t.ELEMENT_PATH_TD,r="em-element-path-item-block");break;case"TABLE":e.getAttribute("em")==="block"?(n=t.ELEMENT_PATH_BLOCK,r="em-element-path-item-block"):e.getAttribute("em")==="atom"&&e.getAttribute("em-type")==="social"?(n=t.ELEMENT_PATH_SOCIAL,r="em-element-path-item-atom"):e.getAttribute("em")==="atom"?(n=t.ELEMENT_PATH_ATOM,r="em-element-path-item-atom"):e.getAttribute("em")==="group"?(n=t.ELEMENT_PATH_GROUP,r="em-element-path-item-group"):e.parentElement?.tagName==="BODY"?(n=t.ELEMENT_PATH_EMAIL,r="em-element-path-item-email"):(n=t.ELEMENT_PATH_TABLE,r="em-element-path-item-table");break;case"SPAN":case"B":case"I":case"EM":case"STRONG":case"P":case"H1":case"H2":case"H3":case"H4":case"H5":case"DIV":case"STRIKE":case"S":case"U":e.style.display==="inline-block"?(n=t.ELEMENT_PATH_FLOATBLOCK,r="em-element-path-item-column"):e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight&&e.style.color?(n=t.ELEMENT_PATH_TEXT,r="em-element-path-item-text"):e.getAttribute("em")==="block"?(n=t.ELEMENT_PATH_BLOCK,r="em-element-path-item-block"):e.getAttribute("em")==="atom"?(n=t.ELEMENT_PATH_ATOM,r="em-element-path-item-atom"):e.getAttribute("em")==="group"?(n=t.ELEMENT_PATH_GROUP,r="em-element-path-item-group"):e.classList.contains("em-vindent")?(n=t.ELEMENT_PATH_VINDENT,r="em-element-path-item-vindent"):(n=t.ELEMENT_PATH_DIV,r="em-element-path-item-block")}const o=EM(e,t);return o?.title&&(n=o.title),o?.className&&(r=o.className),e.className&&e.className.indexOf&&e.className.indexOf("em-mob-")>-1&&(r+=" em-element-path-item-mob"),{elem:e,title:n,className:r}}var zU=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function UU(e){return Array.from(e.classList).some(t=>t.startsWith("em-element-"))}function jU(e){if(e.tagName!=="TD")return!1;const t=Array.from(e.getElementsByTagName("a")),n=t[0];if(t.length!==1||n.style.display!=="block")return!1;for(let r=n.parentElement;r&&r!==e;r=r.parentElement)if(zU.has(r.tagName))return!1;return Array.from(e.children).every(r=>r===n||r.contains(n)||UU(r))}var l0='.em-narrow-table, [em="block-contaner"]';function VU(e){const t=e.style;return jU(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(l0)||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(l0)&&e.getAttribute("em")!=="atom"&&e.parentElement?.tagName!=="BODY"||e.tagName==="DIV"&&(t.display==="inline-block"||t.display==="table-cell")&&t.verticalAlign||(e.tagName==="DIV"||e.tagName==="TABLE"||e.tagName==="TD")&&!e.classList.contains("em-narrow-table")&&!e.classList.contains("noresp-em-narrow-table")&&(t.width||t.minWidth||t.maxWidth||t.background||t.backgroundColor||t.backgroundPositionX||t.backgroundPositionY||t.backgroundImage||t.backgroundRepeat||t.backgroundSize||t.height||t.padding||t.paddingTop||t.paddingRight||t.paddingBottom||t.paddingLeft||t.border||t.borderBottom||t.borderBottomWidth||t.borderBottomStyle||t.borderBottomColor||t.borderLeft||t.borderLeftWidth||t.borderLeftStyle||t.borderLeftColor||t.borderTop||t.borderTopWidth||t.borderTopStyle||t.borderTopColor||t.borderRight||t.borderRightWidth||t.borderRightStyle||t.borderRightColor||t.borderRadius||t.borderTopLeftRadius||t.borderTopRightRadius||t.borderBottomLeftRadius||t.borderBottomRightRadius||t.boxShadow||t.textAlign||t.align||t.verticalAlign)||e.tagName!=="EDITOR"&&t.fontFamily&&t.fontSize&&t.lineHeight&&t.color||e.tagName==="TD"&&e.closest("table")?.getAttribute("em")==="atom"||e.tagName==="TD"&&e.closest("tr")?.getAttribute("em")==="block"||e.tagName==="TD"&&(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))||Av(e))}function GU(e){let t=[];const n=e.style;(e.tagName==="IMG"||e.tagName==="TD"||e.tagName==="TABLE"||e.tagName!=="EDITOR"&&n.fontFamily&&n.fontSize&&n.lineHeight&&n.color||e.tagName==="DIV"&&n.height&&n.lineHeight||Av(e))&&t.push(a0(e));let r=e;for(;r?.parentElement&&r.parentElement.tagName!=="BODY";)r=r.parentElement,VU(r)&&t.push(a0(r));return t=t.filter(o=>!(o.elem?.tagName==="TABLE"&&o.elem.parentElement?.tagName==="BODY")),t=t.reverse(),s0=t.map(o=>({...o})),t.map(o=>({title:o.title,className:o.className}))}function c0(e){const t=Mi(),n=e.parentNode;if(!n)return;if(n.tagName==="A")return t.LINK;if(n.tagName==="TD")return t.TABLE_COLUMN;const r=n.parentNode;if(n.tagName==="TABLE"&&!(r?.tagName==="DIV"&&r.style.display==="inline-block"))return t.TABLE;if(n.tagName==="DIV"&&(n.style.display==="inline-block"||n.style.display==="table-cell")&&n.style.verticalAlign)return t.FLOAT_BLOCK;if(n.tagName==="DIV"){const o=n.style;if(o.width||o.minWidth||o.maxWidth||o.background||o.backgroundColor||o.backgroundPositionX||o.backgroundPositionY||o.backgroundImage||o.backgroundRepeat||o.backgroundSize||o.height||o.padding||o.paddingTop||o.paddingRight||o.paddingBottom||o.paddingLeft||o.border||o.borderBottom||o.borderBottomWidth||o.borderBottomStyle||o.borderBottomColor||o.borderLeft||o.borderLeftWidth||o.borderLeftStyle||o.borderLeftColor||o.borderTop||o.borderTopWidth||o.borderTopStyle||o.borderTopColor||o.borderRight||o.borderRightWidth||o.borderRightStyle||o.borderRightColor||o.borderRadius||o.borderTopLeftRadius||o.borderTopRightRadius||o.borderBottomLeftRadius||o.borderBottomRightRadius||o.boxShadow||o.textAlign||o.align||o.verticalAlign)return t.CONTAINER}return c0(n)}function XU(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-accordion");r.setAttribute("em-edit","active");const o=n.HTMLDocument.getOuterHtml(r),i=n.parseFromString(o)[0].querySelectorAll("section"),s=Array.from(i).map(a=>({expanded:a.hasAttribute("expanded")}));return{type:"accordion",caption:t.ACCORDION,animate:r.hasAttribute("animate"),expandSingleSection:r.hasAttribute("expand-single-section"),sections:s}}function u0(e){return e.tagName==="AMP-ACCORDION"}var d0="em-mob-text_align-",KU=":scope > tr > td, :scope > tbody > tr > td",YU='div[style*="font-family"][style*="font-size"]';function ap(e){return e.querySelector(KU)}function lp(e){return e.querySelector(YU)}function ZU(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!0;return!1}function f0(e){const t=e.closest('table[em="atom"]');if(!t||ZU(e,t))return null;const n=ap(t);return n?{atomTd:n,textDiv:lp(n)}:null}function Sa(e){const t=e.closest("div, p, td");if(!t)return null;if(t.style.textAlign)return t;const n=f0(e);return n?n.textDiv?.hasAttribute("align")?n.textDiv:n.atomTd:t}function m0(e){const t=Sa(e);return t&&(t.style.textAlign||t.getAttribute("align"))||"left"}function QU(e){const t=Sa(e);if(!t)return"";for(const n of t.classList)if(n.startsWith("em-mob-text_align-"))return n.slice(18);return""}function cp(e){return{value:QU(e)}}function JU(e,t,n=d0){const r=f0(e);if(r)for(const o of[r.atomTd,r.textDiv])o&&o!==t&&Gc(o,n)}function ej(e){const t=ap(e);if(!t)return null;const n=lp(t);return n?.hasAttribute("align")?n:t}function tj(e,t){e.querySelectorAll('[em="atom"]').forEach(n=>{const r=ej(n);r&&t(r,n)})}function nj(e,t,n=d0){const r=ap(e),o=r?lp(r):null;for(const i of[r,o])i&&i!==t&&Gc(i,n)}function uu(e){if(!e)return null;const t=(e.closest('[style*="line-height"]')||e.querySelector('[style*="line-height"]'))?.style.lineHeight?.trim();if(!t||t.toLowerCase()==="normal")return null;if(t.includes("px")){const i=parseFloat(t);return Number.isFinite(i)?i:null}const n=e.closest('[style*="font-size"]')?.style.fontSize||getComputedStyle(e).fontSize,r=parseFloat(n);if(!Number.isFinite(r)||r<=0)return null;if(t.includes("%")){const i=parseFloat(t);return Number.isFinite(i)?r*(i/100):null}const o=parseFloat(t);return Number.isFinite(o)?r*o:null}function wa(e){if(!e)return[];const t=[],n=e.style.fontFamily||getComputedStyle(e).fontFamily,r=[...(e.closest('[style*="font-family"]')||e).classList].filter(s=>s.startsWith("em-font-")),o=r.includes(Ph),i=r.filter(s=>s!==Ph);if(i.length>0){t.push("Google Fonts"),t.push(o?"Project Fonts":n.includes("sans-serif")?"Sans Serif":"Serif");const s=i[0].slice(8),a=s.lastIndexOf("-");a>0?t.push(s.slice(0,a),s.slice(a+1)):s&&t.push(s)}else n&&t.push("Safe Fonts",n.replaceAll('"',"'"));return t}function Je(e,t,n){if(!e||e.tagName==="DIV")return!1;const r=window.getSelection();let o=null;if(r&&r.rangeCount>0){const a=r.getRangeAt(0).commonAncestorContainer;o=a.nodeType===1?a:a.parentElement}const i=a=>{if(!a)return!1;const l=a.tagName.toLowerCase();return l===t||l===n},s=e.closest(t)||(n?e.closest(n):null);return i(e)||!!o&&i(o)||!!s}function du(e){if(!e)return!1;const t=e.style.fontWeight||getComputedStyle(e).fontWeight;return t==="bold"||t==="700"||parseInt(t,10)>=700}function Gr(e,t="background-color"){if(!e)return"";let n=e;for(;n;){const r=n.style.getPropertyValue(t);if(r&&r!=="transparent"&&r!=="inherit")return r;n=n.parentElement}return""}function rj(e){const t=e.style.backgroundImage,n=e.getAttribute("background");if(t&&t!=="none"){const r=t.match(/url\(['"]?(.*?)['"]?\)/);if(r)return[{type:"url",value:r[1]}]}return n?[{type:"url",value:n}]:[{type:"url",value:""}]}function oj(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).commonAncestorContainer;return t.nodeType===1?t:t.parentElement}function _a(e){return!!e.closest(".em-show-td-mobile")||!!e.closest(".em-show-table-mobile")||!!e.closest(".em-show-div-mobile")||e.classList.contains("em-show-img-mobile")||!!e.closest(".desktop_hide")}function h0(){const e=window.getSelection();if(!e||e.rangeCount===0)return!1;let t=e.anchorNode,n=e.focusNode;t?.nodeType===3&&(t=t.parentNode),n?.nodeType===3&&(n=n.parentNode);const r=t?.closest?.("a"),o=n?.closest?.("a");return!!(r?.getAttribute("href")||o?.getAttribute("href"))}function up(e){if(!e)return!1;for(const t of Array.from(e.childNodes))if(t.nodeType===Node.COMMENT_NODE&&t.nodeValue?.includes("[if mso]")&&t.nodeValue.includes("v:roundrect")||t.nodeType===Node.ELEMENT_NODE&&up(t))return!0;return!1}function p0(e,t){if(!e)return{value:null,dim:"px"};const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function g0(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function ij(e){const t={all:null,top:null,right:null,bottom:null,left:null};return!e.style.padding&&!e.style.paddingTop&&!e.style.paddingRight&&!e.style.paddingBottom&&!e.style.paddingLeft||(!e.style.padding||e.style.padding.includes(" ")?t.all=null:!e.style.padding&&e.style.paddingTop&&e.style.paddingRight&&e.style.paddingBottom&&e.style.paddingLeft&&e.style.paddingTop===e.style.paddingRight&&e.style.paddingRight===e.style.paddingBottom&&e.style.paddingBottom===e.style.paddingLeft?t.all=parseFloat(e.style.paddingTop):t.all=parseFloat(e.style.padding)||null,t.top=e.style.paddingTop?parseFloat(e.style.paddingTop):null,t.right=e.style.paddingRight?parseFloat(e.style.paddingRight):null,t.bottom=e.style.paddingBottom?parseFloat(e.style.paddingBottom):null,t.left=e.style.paddingLeft?parseFloat(e.style.paddingLeft):null),t}function sj(e){const t={all:null,top:null,right:null,bottom:null,left:null};if(!e.all&&!e.top&&!e.right&&!e.bottom&&!e.left)return t;e.all?!e.all&&e.top&&e.right&&e.bottom&&e.left&&e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?t.all=parseFloat(e.top):t.all=parseFloat(e.all)||null:t.all=null;const n=e.all||null;return t.top=e.top!=null?parseFloat(e.top):n,t.right=e.right!=null?parseFloat(e.right):n,t.bottom=e.bottom!=null?parseFloat(e.bottom):n,t.left=e.left!=null?parseFloat(e.left):n,t}function aj(e){if(e.style.backgroundImage){const t=e.style.backgroundImage;return[{type:"url",value:t.substring(5,t.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function lj(e,t){const n=e.elem.closest("a")||e.elem,r=e.elem.closest("td"),o=Uh(n),i=up(r)&&!up(n)||!!o,s=o??(i?n:r),a=e.elem.closest("table"),l=a?.closest("td")?.closest("table")?.closest("td"),c=a?.closest("div, p, td"),u=c?.style.textAlign||c?.getAttribute("align")||"left",d=qe({elem:e.elem}),f=qe({elem:r}),h=l?qe({elem:l}):null,m=qe({elem:a}),p=e.elem.closest("a"),v={type:"button",caption:t.BUTTON,fontFamily:wa(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:uu(e.elem),lineHeightDim:"px",textStrong:Je(e.elem,"strong","b")||du(e.elem),textItalic:Je(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(p?.style?.fontStyle==="italic"||e.elem.style?.fontStyle==="italic"),textStrikethrough:Je(e.elem,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1)||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("line-through"),textUnderline:Je(e.elem,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("underline"),textColor:V(Gr(e.elem,"color"))||V(getComputedStyle(e.elem).color)||"",textBackgroundColor:V(Gr(e.elem,"background-color"))||"",padding:ij(o??n),borderRadius:Ti(s),backgroundColor:s.style.backgroundColor?V(s.style.backgroundColor):s.getAttribute("bgcolor")||"",backgroundImage:aj(r),backgroundPositionX:r.style.backgroundPositionX!=="initial"?r.style.backgroundPositionX:"",backgroundPositionY:r.style.backgroundPositionY!=="initial"?r.style.backgroundPositionY:"",backgroundRepeat:r.style.backgroundRepeat||"repeat",backgroundSize:r.style.backgroundSize||"auto",width:p0(a,"width"),height:p0(r,"height"),align:u,valign:r.getAttribute("valign")??"",textAlign:r.getAttribute("align")??"",border:Kc(s),boxShadow:ma(s),href:n.getAttribute("href")??"",outlookRounding:i,outlookBackground:pa(r,"inside"),mobileWidth:{value:g0(m.mobileWidth),dim:m.mobileWidthDim??"px"},mobileHeight:{value:g0(f.mobileHeight),dim:f.mobileHeightDim??"px"},mobileBorder:f.mobileBorder,mobileBorderRadius:f.mobileBorderRadius,mobileBoxShadow:f.mobileBoxShadow,mobileAlign:m.mobileAlign,mobileFontSize:{value:d.mobileFontSize,dim:d.mobileFontSizeDim||"px"},mobileTextAlign:cp(e.elem),mobileVerticalAlign:h?.mobileVerticalAlign,mobileBackgroundColor:f.mobileBackgroundColor,mobileBackgroundImage:f.mobileBackgroundImage,mobileBackgroundPositionX:f.mobileBackgroundPositionX,mobileBackgroundPositionY:f.mobileBackgroundPositionY,mobileBackgroundRepeat:f.mobileBackgroundRepeat,mobileBackgroundSize:f.mobileBackgroundSize,mobilePadding:sj(d.mobilePadding),mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},show:m.show,exportAsPicture:a?.getAttribute("em-operation")==="exportAsPicture"};return _a(e.elem)&&(v.showOnMobile=!0),v}function b0(e){if(jh(e.closest("a")))return!0;const t=e.getAttribute("style");if(!t||!t.includes("display"))return!1;const n=e.style.display;return!(n!=="block"&&n!=="inline-block"||t.includes("mso-style-priority"))}function cj(e,t){return t?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function uj(e){const t=e.closest("a"),n=e.closest('a[style*="display"]');if(jh(t))return!0;if(t&&n){const r=n.style.display;if(r==="block"||r==="inline-block")return!0}if(e.tagName==="A"){const r=e.getAttribute("style");if(r&&r.includes("display")&&e.closest("td[height]"))return!0}return!1}function y0(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function v0(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function E0(e){return{src:e.getAttribute("src")??"",width:y0(e,"width"),height:y0(e,"height"),alt:e.getAttribute("alt")??"",title:e.getAttribute("title")??"",link:e.closest("a")?.getAttribute("href")??null,imgReplacer:e.closest("em-replace")?.getAttribute("src")??""}}function dj(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-carousel");r.setAttribute("em-edit","active");const o=r.querySelectorAll("amp-img"),i=fj(o),s=Array.from(o).map((u,d)=>{const f=qe({elem:u}),h=E0(u);return{src:h.src,width:h.width,height:h.height,alt:h.alt,title:h.title,link:h.link,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:h.imgReplacer,mobileWidth:{value:v0(f.mobileWidth),dim:f.mobileWidthDim??"px"},mobileHeight:{value:v0(f.mobileHeight),dim:f.mobileHeightDim??"px"},mobileBorderRadius:f.mobileBorderRadius,slideIndex:d}}),a=qe({elem:r}),l={type:"carousel",caption:t.CAROUSEL,carouselImages:s,borderRadius:Ti(r),mobileBorderRadius:a.mobileBorderRadius,loop:r.hasAttribute("loop"),autoplay:r.hasAttribute("autoplay"),link:i},c=r.closest("td");return c&&(l.maxWidth=Math.round(c.getBoundingClientRect().width)),l}function fj(e){const t=Array.from(e,n=>n.closest("a")?.getAttribute("href"));return t.length>0&&t.every(n=>n&&n===t[0])?t[0]??null:null}function dp(e){return!!e.closest("amp-carousel")}function jn(e){return typeof e=="string"?e:typeof e=="number"?String(e):""}function St(e){return typeof e=="number"?Number.isFinite(e)?e:null:typeof e!="string"||!/^\s*-?\d+(\.\d+)?(px)?\s*$/.test(e)?null:parseFloat(e)}var fu=["top","right","bottom","left"],mu={borderAll:"all",borderTop:"top",borderRight:"right",borderBottom:"bottom",borderLeft:"left"},hu={width:1,style:"solid",color:"#b9b1b1"},S0={width:null,style:null,color:null};function pu(e,t){if(t==="all"){const r=fu.map(i=>pu(e,i)),[o]=r;return r.every(i=>JSON.stringify(i)===JSON.stringify(o))?o:S0}const n=e.style.getPropertyValue(`border-${t}-style`);return!n||n==="none"?S0:{width:St(e.style.getPropertyValue(`border-${t}-width`)),style:n,color:V(e.style.getPropertyValue(`border-${t}-color`))||null}}function fp(e){return e.style===""||"width"in e&&Fe(e.width)&&!e.style&&!e.color}function w0(e){return e==="all"?"border":`border-${e}`}function gu(e){const t=w0(e),n=[t,`${t}-width`,`${t}-style`,`${t}-color`];return e==="all"?[...n,...fu.flatMap(gu)]:n}function _0(e,t,n){Dh(e,gu(t)),e.style.setProperty(w0(t),`${n.width}px ${n.style} ${n.color}`)}function mj(e){const t=pu(e,"all");if(t.style===null)return;Dh(e,gu("all"));const n={width:t.width??0,style:t.style,color:t.color??hu.color};fu.forEach(r=>_0(e,r,n))}function C0(e,t,n){if(t!=="all"&&mj(e),fp(n)){Dh(e,gu(t));return}const r=pu(e,t==="all"?"top":t);_0(e,t,{width:St(n.width)??r.width??hu.width,style:n.style||r.style||hu.style,color:n.color||r.color||hu.color})}var mp=/^border(-(top|right|bottom|left))?(-(width|style|color))?$/i;function hj(e,t){const n=e.style.getPropertyValue(`border-${t}-style`);if(!n||n==="none")return null;const r=e.style.getPropertyValue(`border-${t}-color`);return[e.style.getPropertyValue(`border-${t}-width`),n,V(r)||r].filter(Boolean).join(" ")}function pj(e){const t=IC(e.getAttribute("style")),n=t.findIndex(({name:a})=>mp.test(a));if(n<0||t.some(({name:a,value:l})=>mp.test(a)&&/!important/i.test(l)))return;const r=fu.map(a=>[a,hj(e,a)]),[,o]=r[0],i=o&&r.every(([,a])=>a===o)?[`border: ${o}`]:r.flatMap(([a,l])=>l?[`border-${a}: ${l}`]:[]),s=t.filter(({name:a})=>!mp.test(a)).map(({name:a,value:l})=>`${a}: ${l}`);s.splice(n,0,...i),e.setAttribute("style",s.length?`${s.join("; ")};`:"")}function gj(e){const t=St(e.getAttribute("border"));return t?{width:t,style:"solid",color:V(e.getAttribute("bordercolor")??"")||null}:null}function T0(e){const t=gj(e),n=Object.keys(mu),r=Object.fromEntries(n.map(i=>[i,t??pu(e,mu[i])])),o=n.find(i=>r[i].style!==null)??"borderAll";return{...r,position:o}}function A0(e){return!!e.closest(".em-element-custom-table")}function k0(e){const{paddingTop:t,paddingRight:n,paddingBottom:r,paddingLeft:o}=e.style;return{paddingLeftRight:o===n?o:"",paddingTopBottom:t===r?t:"",paddingLeft:o,paddingRight:n,paddingTop:t,paddingBottom:r}}function bj(e){return{backgroundColor:V(e.style.backgroundColor||e.getAttribute("bgcolor")||"")||"",backgroundImage:rj(e),backgroundPositionX:e.style.backgroundPositionX||"center",backgroundPositionY:e.style.backgroundPositionY||"center",backgroundRepeat:e.style.backgroundRepeat||"repeat",backgroundSize:e.style.backgroundSize||"cover"}}function yj(e){const{position:t,...n}=T0(e),r=ma(e);return{...n,borderPosition:t,borderRadius:Ti(e),boxShadow:{color:r?.color??null,hOffset:r?.hOffset??null,vOffset:r?.vOffset??null,blurRadius:r?.blurRadius??null,spreadRadius:r?.spreadRadius??null,inset:r?.inset??null}}}function vj(e){return{mobileBoxShadow:e.mobileBoxShadow,mobileBackgroundColor:e.mobileBackgroundColor,mobileBackgroundImage:e.mobileBackgroundImage,mobileBackgroundPositionX:e.mobileBackgroundPositionX,mobileBackgroundPositionY:e.mobileBackgroundPositionY,mobileBackgroundRepeat:e.mobileBackgroundRepeat,mobileBackgroundSize:e.mobileBackgroundSize,mobileWidth:{value:e.mobileWidth!=null?e.mobileWidth:null,dim:e.mobileWidthDim},mobileHeight:{value:e.mobileHeight!=null?e.mobileHeight:null,dim:"px"},mobileBorderRadius:e.mobileBorderRadius,mobileBorder:e.mobileBorder}}function Ej(e){const{position:t,borderAll:n,borderTop:r,borderRight:o,borderBottom:i,borderLeft:s}=T0(e),a=Object.fromEntries(Object.entries(k0(e)).map(([l,c])=>[`cell_${l}`,c]));return{cell_borderPosition:`cell_${t}`,cellBackgroundColor:e.getAttribute("style")?.includes("background-color:")?V(e.style.backgroundColor):"",cell_borderAll:n,cell_borderTop:r,cell_borderRight:o,cell_borderBottom:i,cell_borderLeft:s,...a}}function Sj(e){const t=e.closest("a");return{linkHref:t?.getAttribute("href")?.trim()??"",textLink:!!t,linkTarget:t?.getAttribute("target")??""}}function wj(e){const t=e?.closest('div[style*="font-size"]');return e?.style?.fontSize?parseInt(e.style.fontSize,10):t?.style?.fontSize?parseInt(t.style.fontSize,10):null}function _j(e,t){const n=t.requestElemWithStyle;return{fontFamily:t.getFontFamilyFromElement(n?.closest('[style*="font-family"]')||e),fontSize:wj(n),textStrikethrough:t.textHasStyle(e,"s","strike")||n?.style.textDecoration.includes("line-through"),textUnderline:t.textHasStyle(e,"u")||n.style.textDecoration.includes("underline")||!n.style.textDecoration&&e.tagName==="A",lineHeight:t.getLineHeghtInPixels(n),textStrong:t.textHasStyle(e,"strong","b")||t.isElementHasBold(n),textItalic:t.textHasStyle(e,"i","em")||!n.closest('[style*="font-style: normal"]')&&n?.style?.fontStyle==="italic",textAlign:e.style?.textAlign||e.getAttribute("align")||e.closest("[align]")?.getAttribute("align")||"",textColor:V(e.closest('[style*="color"]')?.style.color)||V(getComputedStyle(e).color),textBackgroundColor:V(e.closest('[style*="background-color"]')?.style.backgroundColor)||V(getComputedStyle(e).backgroundColor),textValign:e.style?.verticalAlign||e.getAttribute("valign")||e.closest("[valign]")?.getAttribute("valign")||""}}function Cj(e,t,n){const r=e.elem,o=r.closest("td, th")??r,i=o.closest("table"),s=qe({elem:i}),a={direction:r.getAttribute("dir")??"none",show:s.show,outlookBackground:pa(r.closest(".em-element-custom-table")??r,"around"),customTable:{tableKey:n.tableKey(i),...k0(o),...bj(i),...yj(i),...vj(s),...Ej(o),...Sj(r),..._j(r,n)}};return r.getAttribute("new")&&(r.removeAttribute("new"),a.customTable.isNewLink=!0,r.setAttribute("em-edit","active")),{type:"customTable",caption:t.ELEMENT,settings:a}}function Tj(){const e=new WeakMap;let t=0;return n=>{let r=e.get(n);return r||(t+=1,r=`table-${t}`,e.set(n,r)),r}}function bu(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function Aj(e,t,n){const r=e.elem;return{type:"div",caption:t.CONTAINER,...n.getElementTdDiv(r),width:bu(r.style.width),maxWidth:bu(r.style.maxWidth),minWidth:bu(r.style.minWidth),height:bu(r.style.height),valign:r.style.verticalAlign??"",align:r.style.textAlign??"",direction:r.getAttribute("dir")??"none"}}function L0(e,t){const n=e==null?null:typeof e=="number"?e:Number(e);return{value:n==null||Number.isNaN(n)?null:n,dim:t==="%"?"%":"px"}}function kj(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function N0(e,t,n){return e?{fontFamily:wa(e.closest('[style*="font-family"]')||e),textStrong:Je(e,"strong","b")||du(e)||!!t?.querySelector("strong")||!!t?.querySelector("bold")||e.querySelector("span")?.style?.fontWeight?.includes("bold"),textItalic:!e.closest('[style*="font-style: normal"]')&&e.style?.fontStyle==="italic"||!!e.querySelector("em")||!!e.querySelector("i")||e.querySelector("span")?.style?.fontStyle?.includes("italic"),fontSize:parseFloat(e.closest('[style*="font-size"]')?.style.fontSize)||0,lineHeight:n.getLineHeghtInPixels(e),textColor:V(e.closest('[style*="color"]')?.style.color)||"",textBackgroundColor:V(e.closest('[style*="background-color"]')?.style.backgroundColor)||"",textStrikethrough:Lj(e),textUnderline:Nj(e)}:{}}function Lj(e){return e.style?.textDecorationLine?.includes("line-through")||e.querySelector("em")?.style?.textDecorationLine?.includes("line-through")||e.querySelector("span")?.style?.textDecorationLine?.includes("line-through")||e.style?.textDecoration?.includes("line-through")||e.querySelector("em")?.style?.textDecoration?.includes("line-through")||e.querySelector("span")?.style?.textDecoration?.includes("line-through")||!!e.querySelector("strike")}function Nj(e){return e.style?.textDecorationLine?.includes("underline")||e.querySelector("em")?.style?.textDecorationLine?.includes("underline")||e.querySelector("span")?.style?.textDecorationLine?.includes("underline")||e.style?.textDecoration?.includes("underline")||e.querySelector("em")?.style?.textDecoration?.includes("underline")||e.querySelector("span")?.style?.textDecoration?.includes("underline")||!!e.querySelector("underline")||!!e.querySelector("u")}function xj(e,t,n){const r=e.elem.querySelector(".em-element-list-ul")||e.elem.querySelector(".em-element-list-ol")||null,o=r?e.elem.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'):null,i=qe({elem:e.elem}),s=e.elem.querySelector("td"),a=n.getElementTdDiv(s),l=r?N0(o,r,n):{};return{type:"td",caption:t.ELEMENT,...a,mobileWidth:L0(i.mobileWidth,i.mobileWidthDim),direction:s?.getAttribute("dir")??"none",elementName:r?"List":"",...l}}function Oj(e,t,n){const r=e.elem.closest("table")?.closest("td"),o=e.elem.closest("table");if(!r&&!o)return{settings:null,editTargetTd:null,shouldResetProgrammaticSelection:!0};const i=r?.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'),s=!!(r?.querySelector(".em-element-list-ul")||r?.querySelector(".em-element-list-ol")),a=qe({elem:r}),l=r?.querySelector("td"),c=n.getElementTdDiv(l),u=i?N0(i,o,n):{};return{settings:{type:"td",caption:t.ELEMENT,...c,mobileWidth:L0(a.mobileWidth,a.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:s?"List":"",...u},editTargetTd:l,shouldResetProgrammaticSelection:!0}}function x0(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function Rj(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function O0(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function Mj(e){const t=e.firstElementChild;if(!t)return 0;const n=t.getAttribute("width");return e.style.maxWidth?parseFloat(e.style.maxWidth)-parseFloat(n||"0"):e.style.width?n&&n.includes("0%")?0:parseFloat(e.style.width)-parseFloat(n||"0"):0}function Pj(e,t){const n=e.elem,r=qe({elem:n}),o=n.firstElementChild,i=o?qe({elem:o}):null,s=x0(r.mobileWidth),a=i?x0(i.mobileWidth):null;return{type:"floatBlock",caption:t.FLOAT_BLOCK,width:Rj(o?.getAttribute("width")),gap:{value:Mj(n),dim:"px"},maxWidth:O0(n.style.maxWidth),minWidth:O0(n.style.minWidth),valign:n.style.verticalAlign??"",mobileWidth:{value:s,dim:r.mobileWidthDim??"px"},mobileContentWidth:{value:a,dim:i?.mobileWidthDim??"px"},mobileVerticalAlign:r.mobileVerticalAlign,show:r.show}}function R0(e){if(e.tagName!=="DIV")return!1;const t=e.style.display,n=t==="inline-block"||t==="table-cell",r=!!e.style.verticalAlign;return n&&r}function hp(e){return e.getAttribute("src")}function Ij(e,t){const n=gf(e.elem),r=hp(n),o=qe({elem:n}),i=n.closest("td"),s=i?qe({elem:i}):null;let a="img",l=t.PICTURE;e.elem.classList.contains("em-countdown")?(a="countdown",l=t.COUNTDOWN):e.elem.classList.contains("em-video")&&(a="video",l=t.VIDEO);const c=d=>d===null||d==="auto"?null:typeof d=="number"?d:null,u={type:a,caption:l,src:r??"",width:M0(n,"width"),height:M0(n,"height"),alt:n.getAttribute("alt")??"",title:n.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:n.style?.verticalAlign??"undefined",border:Kc(n),borderRadius:Ti(n),boxShadow:ma(n),mobileWidth:{value:c(o.mobileWidth),dim:o.mobileWidthDim??"px"},mobileHeight:{value:c(o.mobileHeight),dim:o.mobileHeightDim??"px"},mobileBorder:o.mobileBorder,mobileBorderRadius:o.mobileBorderRadius,mobileBoxShadow:o.mobileBoxShadow,mobileAlign:s?.mobileAlign,mobileVerticalAlign:o.mobileVerticalAlign,show:o.show,link:n.closest("a")?.getAttribute("href")??null,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:n.closest("em-replace")?.getAttribute("src")??""};if(a==="countdown"&&(u.countdown=e.elem.getAttribute("em-cd-settings")??void 0),a==="video"){const d=e.elem.getAttribute("em-video-settings");if(d)try{u.video=JSON.parse(d.replaceAll("'",'"'))}catch{u.video={}}}return _a(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function M0(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function P0(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}function Dj(e){return e.classList.contains("em-countdown")}function Bj(e){return e.classList.contains("em-video")}function Ca(e){const t=String(e??"").trim();return t?V(t)??t:""}var pp={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function Hj(e){if(!e)return null;const t=e.getAttribute("width")?.trim();if(t){const i=parseInt(t,10);if(!Number.isNaN(i)&&i>0)return i}const n=e.getAttribute("style")??"",r=/(?:^|;)\s*width:\s*(\d+)px/i.exec(n);if(r){const i=parseInt(r[1],10);if(!Number.isNaN(i)&&i>0)return i}const o=e.style?.width?.trim()??"";if(o){const i=parseInt(o,10);if(!Number.isNaN(i)&&i>0)return i}return e.offsetWidth>0?Math.round(e.offsetWidth):null}function Fj(e,t){if(e.length===0)return t;let n=null;for(const r of e){const o=r.iconWidth;if(o==null||Number.isNaN(o)||o<=0)return t;if(n===null)n=o;else if(o!==n)return t}return n??t}function gp(e){return e.closest('table[em-type="social"]')}function $j(e){const t=e.ownerDocument;return t?Array.from(t.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function I0(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r instanceof HTMLElement)return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r instanceof HTMLElement)return r}return null}function Pi(e){if(!e||!(e instanceof HTMLElement))return"";const t=e.style?.backgroundColor?.trim()??"";return!t||t==="transparent"||t==="rgba(0, 0, 0, 0)"?"":t}function Vn(e,t){return e.hasAttribute(t)||e.hasAttribute(`data-${t}`)}function bp(e,t){return e?e.getAttribute(t)??e.getAttribute(`data-${t}`):null}function Wj(e){if(!(e instanceof HTMLElement))return null;const t=e.getAttribute("width")?.trim(),n=e.style.width?.trim(),r=t||n;if(!r)return null;const o=/^(\d+)/.exec(r);if(!o)return null;const i=parseInt(o[1],10);return Number.isNaN(i)||i<0?null:i}function qj(e,t){for(let n=1;n<e.length-1;n+=1){const r=e[n-1],o=e[n],i=e[n+1];if(r instanceof HTMLElement&&i instanceof HTMLElement&&Vn(r,"em-platform")&&Vn(i,"em-platform")&&o instanceof HTMLElement&&!Vn(o,"em-platform")){const s=Wj(o);if(s!=null){t.gap=s;return}}}}function D0(e){const t=String(e??""),n=/(?:^|;)\s*border-radius:\s*(\d+)px/i.exec(t);if(!n)return null;const r=parseInt(n[1],10);return Number.isNaN(r)||r<0?null:r}function zj(e,t){const n=I0(e)?.getAttribute("align")?.trim().toLowerCase();(n==="left"||n==="right"||n==="center")&&(t.align=n)}function Uj(e,t){for(const n of e){if(!(n instanceof HTMLElement)||!Vn(n,"em-platform"))continue;const r=D0(n.getAttribute("style"));if(r!=null){t.borderRadius=r;return}const o=D0(n.querySelector("img")?.getAttribute("style")??null);if(o!=null){t.borderRadius=o;return}}}function jj(e,t){for(const n of e){if(!(n instanceof HTMLElement))continue;const r=n.querySelector("br"),o=r?.nextElementSibling?.tagName==="SPAN"?r.nextElementSibling:null;if(o&&o.textContent?.trim()){t.showLabel=!0;return}}t.showLabel=!1}function Vj(e,t,n){const r=e.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),o=e.querySelector("td[em-tray-cell-bg], td[data-em-tray-cell-bg]"),i=Pi(r),s=Pi(o instanceof HTMLElement?o:null),a=Pi(e.querySelector("[em-social-tray], [data-em-social-tray]")),l=Pi(t),c=Pi(e),u=i||s||a||l||c;u&&(n.bgEnabled=!0,n.bgColor=u)}function Gj(e){const t=I0(e);if(!(t instanceof HTMLElement))return"";const n=Pi(t);return n||(t.getAttribute("bgcolor")?.trim()??"")}function yp(e){if(!e)return null;const t=e.style.border?.trim()??"",n=/^(\d+)px\s+solid\s+(.+)$/i.exec(t);if(!n)return null;const r=parseInt(n[1],10),o=n[2].trim();return Number.isNaN(r)||r<=0||!o?null:{w:r,color:o}}function Xj(e,t){const n=yp(e);n&&(t.borderWidth=n.w,t.borderColor=n.color)}function Kj(e){const t=e.closest("td[em-platform], td[data-em-platform]");if(t)return!!gp(t);const n=e.closest("td"),r=n?.previousElementSibling,o=n?.nextElementSibling;return!!(n&&!Vn(n,"em-platform")&&r instanceof HTMLElement&&o instanceof HTMLElement&&Vn(r,"em-platform")&&Vn(o,"em-platform")&&gp(n))}function Yj(e,t){const n=gp(e.elem);if(!n)return{type:"social",caption:t.SOCIAL??"Social media",...pp,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const r={...pp};zj(n,r),Xj(n,r);const o=n.querySelector('table[role="presentation"]')||n.querySelector("table");Vj(n,o,r);const i=o?.querySelector("tr"),s=i?Array.from(i.querySelectorAll(":scope > td")):[],a=s.filter(m=>m instanceof HTMLElement&&Vn(m,"em-platform")),l=a.length>0?a:s.filter(m=>m.querySelector("img"));qj(s,r),Uj(l,r),jj(l,r);let c=typeof r.buttonBorderWidth=="number"&&!Number.isNaN(r.buttonBorderWidth)?r.buttonBorderWidth:0;const u=n.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),d=u instanceof HTMLElement?yp(u):null;if(d)c=d.w;else for(const m of l){if(!(m instanceof HTMLElement))continue;const p=yp(m);if(p){c=p.w;break}}let f=l.map(m=>{if(!(m instanceof HTMLElement))return{platform:"unknown",customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:"",itemBorderColor:""};const p=m,v=bp(p,"em-platform")||"unknown",w=Vn(p,"em-custom-icon"),_=p.querySelector("a"),A=p.querySelector("img"),b=_?.getAttribute("href")??"",g=_?.getAttribute("title")??A?.getAttribute("title")??"",E=A?.getAttribute("alt")??"",T=A?.getAttribute("src")??"",y=Hj(A instanceof HTMLImageElement?A:null),S=A?.getAttribute("height")?.trim(),C=S?parseInt(S,10):NaN,L=!Number.isNaN(C)&&C>0,x=bp(p,"em-button-bg")?.trim()??"",N=!w&&Vn(p,"em-tray-cell-bg");let W="",R="";if(!w&&(W=x,!W&&!N&&p.style?.backgroundColor&&(W=p.style.backgroundColor.trim()),R=bp(p,"em-item-border-color")?.trim()??"",!R)){const P=p.style.border?.trim()??"",J=/^(\d+)px\s+solid\s+(.+)$/i.exec(P);J?.[2]&&(R=J[2].trim())}return{platform:v,customIcon:w,href:b,alt:E,title:g,iconSrc:T,iconWidth:y,iconHeight:L?C:y,buttonBgColor:W,itemBorderColor:R}});if(d&&f.length>0&&f.every(m=>m.customIcon||!String(m.itemBorderColor??"").trim())){const m=d.color;f=f.map(p=>p.customIcon?p:{...p,itemBorderColor:m})}const h=Fj(f,pp.iconSize);return{type:"social",caption:t.SOCIAL??"Social media",align:r.align,iconSize:h,borderRadius:r.borderRadius,gap:r.gap,bgEnabled:r.bgEnabled,bgColor:Ca(r.bgColor),borderWidth:r.borderWidth,borderColor:Ca(r.borderColor),buttonBorderColor:"",buttonBorderWidth:c,showLabel:r.showLabel,hostCellBgForIconLuminance:Ca(Gj(n)),blockIndex:$j(n),items:f.map(m=>({...m,buttonBgColor:Ca(m.buttonBgColor),itemBorderColor:Ca(m.itemBorderColor)}))}}function B0(e){return e.tagName==="TBODY"&&Array.from(e.childNodes).every(H0)}function Zj(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function H0(e){return e.nodeType===Node.COMMENT_NODE}function cn(e){if(e.tagName!=="TABLE")return!1;const t=Array.from(e.childNodes).filter(r=>!H0(r));if(t.length===0)return!0;const n=t.filter(r=>!Zj(r));return n.length===1&&n[0]instanceof Element&&B0(n[0])}function vp(e=document){for(const t of Array.from(e.querySelectorAll("table")))if(cn(t))return t;return null}function Ep(){const e=_f(document,'[em="group"]');return _f(e||document,'[em="block"]')}function gr(e){const t=e.children.length===1?e.children[0]:null;return t&&B0(t)?t:e}function Qj(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function F0(e,t){const n=e.style[t];return n?{value:parseFloat(n),dim:n.includes("%")?"%":"px"}:{value:null,dim:"px"}}function Jj(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function eV(e){if(e.style.backgroundImage){const t=e.style.backgroundImage;return[{type:"url",value:t.substring(5,t.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function tV(e,t){const n=e.elem;if(cn(n))return{type:"emptyTable",caption:t.TABLE};n.setAttribute("em-edit","active");const r=qe({elem:n}),o={type:"table",caption:t.TABLE,backgroundColor:n.style.backgroundColor?V(n.style.backgroundColor):"",backgroundImage:eV(n),backgroundPositionX:n.style.backgroundPositionX!=="initial"?n.style.backgroundPositionX:"",backgroundPositionY:n.style.backgroundPositionY!=="initial"?n.style.backgroundPositionY:"",backgroundRepeat:n.style.backgroundRepeat||"repeat",backgroundSize:n.style.backgroundSize||"auto",width:Qj(n,"width"),maxWidth:F0(n,"maxWidth"),minWidth:F0(n,"minWidth"),align:n.getAttribute("align")??"",border:Kc(n),boxShadow:ma(n),borderRadius:Ti(n),mobileWidth:{value:Jj(r.mobileWidth),dim:r.mobileWidthDim??"px"},mobileBorder:r.mobileBorder,mobileBorderRadius:r.mobileBorderRadius,mobileBoxShadow:r.mobileBoxShadow,show:r.show,mobileAlign:r.mobileAlign,mobileBackgroundColor:r.mobileBackgroundColor,mobileBackgroundImage:r.mobileBackgroundImage,mobileBackgroundPositionX:r.mobileBackgroundPositionX,mobileBackgroundPositionY:r.mobileBackgroundPositionY,mobileBackgroundRepeat:r.mobileBackgroundRepeat,mobileBackgroundSize:r.mobileBackgroundSize,exportAsPicture:n.getAttribute("em-operation")==="exportAsPicture",outlookBackground:pa(n,"around")};return _a(n)&&(o.showOnMobile=!0),o}function nV(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function rV(e){if(e.tagName!=="TD")return e.closest("table")?.parentElement?.tagName==="BODY";if(e.classList.contains("em-vindent")||e.innerHTML===""||e.closest("table")?.getAttribute("em")==="atom"||e.firstChild?.tagName==="EDITOR")return!1;const t=!!e.querySelector('div[style*="inline-block"]'),n=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return!!(!t&&!n||t&&e.parentElement?.getAttribute("em")!=="block"&&!e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap"))}function oV(e){if(e.tagName!=="TD"||e.classList.contains("em-vindent")||e.innerHTML===""||e.firstChild?.tagName==="EDITOR"||!(e.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.parentElement?.getAttribute("em")==="block"))return!1;const t=!!e.querySelector('div[style*="inline-block"]'),n=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return t||n}function iV(e){if(e.tagName==="TD"){if(e.innerHTML!==""||e.getAttribute("height"))return!1;const t=!e.getAttribute("width")||e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"),n=!!e.closest('[em="block"].empty-structure')||!!e.closest(".em-structure");return t&&n}return e.tagName==="DIV"?!!e.closest("amp-accordion")&&!e.innerHTML:!1}function sV(e){if(e.tagName!=="TD")return!1;const t=!!e.firstChild&&e.firstChild.tagName==="EDITOR";return t&&e.closest("table")?.getAttribute("em")==="atom"?!0:!(t||e.classList.contains("em-vindent"))}function aV(e){const t={items:[],gap:null,gapMobile:null,valign:"",wrap:void 0,dirRevers:!1},n=".em-mob-wrap, .noresp-em-mob-wrap",r=e.querySelector(n),o=e.querySelectorAll(n).length;if(r&&e.querySelectorAll(".em-mob-wrap:first-child, .noresp-em-mob-wrap:first-child").length===1)t.wrap=!0,e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(i=>{if(t.items.push({width:parseFloat(i.getAttribute("width")||"0"),current:!1}),o>1){const s=r.nextElementSibling;t.gap=parseFloat(s?.getAttribute("width")||"0");const a=qe({elem:s});t.gapMobile=a.mobileHeight||0}else t.gap=0;(i.classList.contains("em-mob-wrap-cancel")||i.classList.contains("noresp-em-mob-wrap-cancel"))&&(t.wrap=!1)}),t.valign=r.getAttribute("valign")||"",(r?document.querySelector('[em-edit="active"]'):e.closest(n)?.parentElement?.closest("td"))?.getAttribute("dir")==="rtl"&&(t.dirRevers=!0);else if(e.querySelector('div[style*="inline-block"]')){const i=e.querySelectorAll('div[style*="inline-block"]');if(i.length>1)i.forEach(a=>{const l=a,c=l.firstElementChild;t.items.push({width:parseFloat(c?.getAttribute("width")||"0"),current:!1});const u=c?.getAttribute("width"),d=parseFloat(l.style.width);!u||u.includes("%")?t.gap=d-d:t.gap=d-parseFloat(u)});else{const a=e.querySelector('div[style*="inline-block"]');t.items=[{width:parseFloat(a.firstElementChild?.getAttribute("width")||"0"),current:!0}],t.gap=0}const s=e.querySelector('div[style*="inline-block"]');t.valign=s?.style.verticalAlign||"",(s?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(t.dirRevers=!0)}return t}function lV(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};let i="td",s=t.TABLE_COLUMN;return(r.classList.contains("em-mob-wrap")||r.classList.contains("noresp-em-mob-wrap"))&&(i="column"),r.parentElement?.getAttribute("em")==="group"?(s=t.ELEMENT_PATH_GROUP??t.GROUP,i="group"):r.closest("table")?.parentElement?.tagName==="BODY"?(s=t.GROUP,i="group"):r.classList.contains("em-mob-wrap")?s=t.FLOAT_BLOCK:r.parentElement?.getAttribute("em")==="block"&&(s=t.STRUCTURE),{type:i,caption:s,settings:o}}function cV(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};return o.floatBlocks=aV(r),o.isContrastBlock=!!r.closest(".em-contrast-block"),{type:"structure",caption:t.STRUCTURE,settings:o}}function uV(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};let i=t.TABLE_COLUMN,s="td";return r.parentElement?.getAttribute("em")==="group"?(i=t.ELEMENT_PATH_GROUP??t.GROUP,s="group"):r.closest("table")?.getAttribute("em")==="atom"?i=t.ELEMENT:r.parentElement?.getAttribute("em")==="block"&&(i=t.STRUCTURE),{type:s,caption:i,settings:o}}function dV(e){if(e.nodeType!==Node.ELEMENT_NODE)return[e];const t=e;return t.querySelectorAll("tbody").forEach(n=>n.replaceWith(...Array.from(n.childNodes))),t.tagName==="TBODY"?Array.from(t.childNodes):[t]}function $0(e){return Le(e,!0).flatMap(dV)}function Ii(e,t){e.replaceChildren(...$0(t))}function fV(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function Ta(e,t){const n=$0(t),r=n.filter(s=>!fV(s)),[o]=r,i=r.length===1&&o.nodeType===Node.ELEMENT_NODE&&o.tagName==="TABLE";e.replaceChildren(...i?Array.from(o.childNodes):n)}function mV(e,t,n){const r=document.createElement("div");return ke(r,e),r.querySelectorAll("tr").forEach(o=>{const i=o.querySelectorAll("td");if(i.length>1){const s=i[1],a=(s.getAttribute("style")||"").split(";").filter(u=>u.trim()!==""),l={};a.forEach(u=>{const[d,f]=u.split(":").map(h=>h.trim());l[d]=f}),l[t]=`${n}px`;const c=Object.entries(l).map(([u,d])=>`${u}: ${d}`).join("; ");s.setAttribute("style",c)}}),Ke(r)}function hV(e,t){const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");i&&(i.innerHTML=t)}}),Ke(n)}function pV(e,t){const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("color"))){const l=a.map(c=>c.startsWith("color")?`color: ${t};`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} color: ${t};`:`color: ${t};`)}}}),Ke(n)}function gV(e,t){const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("font-size"))){const l=a.map(c=>c.startsWith("font-size")?`font-size: ${t}px;`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} font-size: ${t}px;`:`font-size: ${t}px;`)}}}),Ke(n)}function bV(e,t){if(typeof t!="boolean")throw new Error("Invalid isBold value: must be a boolean");const n=t?"bold":"normal",r=document.createElement("div");return ke(r,e),r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-weight"))){const c=l.map(u=>u.startsWith("font-weight")?`font-weight: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-weight: ${n};`:`font-weight: ${n};`)}}}),Ke(r)}function yV(e,t){if(typeof t!="boolean")throw new Error("Invalid isItalic value: must be a boolean");const n=t?"italic":"normal",r=document.createElement("div");return ke(r,e),r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-style"))){const c=l.map(u=>u.startsWith("font-style")?`font-style: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-style: ${n};`:`font-style: ${n};`)}}}),Ke(r)}function vV(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldUnderline value: must be a boolean");const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("line-through")?u="underline line-through":u="underline":l.includes("line-through")?u="line-through":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),Ke(n)}function EV(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldStrikethrough value: must be a boolean");const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("underline")?u="underline line-through":u="line-through":l.includes("underline")?u="underline":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),Ke(n)}function SV(e){return!e||!(e instanceof Node)?null:document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:t=>t.nodeValue?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode()}function wV(e){if(!e||!(e instanceof Node))return null;const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:o=>o.nodeValue?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let n=null,r;for(;r=t.nextNode();)n=r;return n}function _V(e){if(!e||!(e instanceof HTMLElement))return"inside";const t=window.getSelection();if(!t||t.rangeCount===0)return"inside";const n=t.getRangeAt(0);if(!n.collapsed)return"inside";let{startContainer:r,startOffset:o}=n;if(r===e)return o===0?"start":o===e.childNodes.length?"end":"inside";const i=SV(e),s=wV(e);let a=r;return a&&a.nodeType===Node.ELEMENT_NODE&&(a=a.childNodes[0]),i&&a===i&&o===0?"start":s&&r===s&&(o===s?.nodeValue?.length||o===s?.nodeValue?.trim().length)?"end":"inside"}function W0(e){const t=e.cloneNode(!0);nn(e,t);const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let r;for(;r=n.nextNode();)r.nodeValue="";return t}function Sp(e){let t="";for(const n of e.attributes)t+=` ${n.name}="${n.value}"`;return t}function CV(e,t){const n=e.closest(`table.${t}`);if(!n)return null;const r=n.querySelector("tbody"),o=Ke(r??n).trim(),i=e.closest("tr");if(!i)return{rowHtml:o,firstCellText:"",secondCellText:"",firstCellHtmlNoText:"",secondCellHtmlNoText:"",secondCellWrapperHtml:"",secondCellInnerDivHtml:"",wrappedSecondCellHtml:"",secondCellInnerDivWrapperHtml:"",secondCellTextHTML:""};const s=i.querySelectorAll("td"),a=s[0]||null,l=s[1]||null,c=a?a.textContent.trim():"",u=l?l.textContent.trim():"",d=l?Ke(l).trim():"",f=a?_r(W0(a)):"",h=l?_r(W0(l)):"",m=l?`<td${Sp(l)}></td>`:"",p=l?l.querySelector("div"):null;return{rowHtml:o,firstCellText:c,secondCellText:u,firstCellHtmlNoText:f,secondCellHtmlNoText:h,secondCellWrapperHtml:m,secondCellInnerDivHtml:p?_r(p):"",wrappedSecondCellHtml:l&&p?`<td${Sp(l)}>${_r(p)}</td>`:"",secondCellInnerDivWrapperHtml:p?`<div${Sp(p)}></div>`:"",secondCellTextHTML:d}}function q0(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function z0(e,t){const n=document.createElement("template");ke(n,e);const r=n.content.firstElementChild;if(!r||r.tagName.toLowerCase()!=="td")return e;const o=r.querySelector("div");return o?o.textContent=q0(t)||" ":r.insertAdjacentText("afterbegin",q0(t)),_r(r)}function Di(e){const t=document.createElement("template");return ke(t,e),t.content.querySelectorAll("editor").forEach(n=>{n.replaceWith(...Array.from(n.childNodes))}),t.content.querySelectorAll('[em-edit="active"]').forEach(n=>{n.removeAttribute("em-edit")}),Ke(t)}function U0(e){e.removeAttribute("id"),e.querySelectorAll("[id]").forEach(t=>t.removeAttribute("id"))}function TV(e,t,n,r=!0){const o=document.createElement("template");ke(o,e.trim());const i=o.content.querySelector(`div.${n}`);if(i){const s=i.closest("tr");if(s){const a=r?"beforebegin":"afterend";s.insertAdjacentHTML(a,t)}}return Ke(o)}function AV(e){let t=1;return e.map(n=>{if(n.cellOneText&&/^\d+\.$/.test(n.cellOneText.trim())){const o={...n,cellOneText:`${t}.`};return t++,o}if(!n.cellOneText||/^\s*$/.test(n.cellOneText))return{...n};const r={...n,cellOneText:`${t}.`};return t++,r})}function kV(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function LV(e){if(!Array.isArray(e)||e.length===0)return e;const t=" ",n=e.map(o=>{if(!o.cellOneText)return o;let i=o.cellOneText.trim();return i.endsWith(t)||(i+=t),{...o,cellOneText:i}}),r=Math.max(...n.map(o=>o.cellOneText?o.cellOneText.length:0));return n.map(o=>{if(!o.cellOneText)return o;let i=o.cellOneText;for(;i.length<r;)i+=t;return{...o,cellOneText:i}})}function wp(e){const t=Array.from(e.querySelectorAll("tr")).map(r=>r.querySelectorAll("td")).filter(r=>r.length>=2).map(r=>r[0].querySelector("div")),n=LV(kV(AV(t.map(r=>({cellOneText:r?.textContent?.trim()??"",cellTwoText:""})))));t.forEach((r,o)=>{const i=n[o].cellOneText;r&&r.textContent!==i&&(r.textContent=i)})}function NV(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function xV(e,t,n){const r=[];let o=t;for(;o!==e;){const c=o.parentNode;if(!c)return null;r.unshift(Array.from(c.childNodes).indexOf(o)),o=c}const i=document.createRange();i.selectNodeContents(t),i.setStart(n.startContainer,n.startOffset);const s=i.extractContents(),a=e.cloneNode(!0);nn(e,a);const l=r.reduce((c,u)=>c.childNodes[u],a);return l.replaceChildren(s),[t,l].forEach(c=>{(c.textContent??"").trim()||(c.textContent=" ")}),{row:a,content:l}}function OV(e,t,n,r){const o=new DOMParser().parseFromString(e,"text/html");hd(o,e);const i=o.querySelector(`div.${t}`);if(!i)return e;const s=i.closest("tr");if(!s)return e;const a=r==="ArrowUp"?s.previousElementSibling:s.nextElementSibling;if(a&&a.tagName==="TR"){const c=a.querySelectorAll("td")[1]||null;if(c){const u=c.querySelector("div");u&&u.classList.add(n)}}else i.classList.add(n);const l=o.querySelector("table");return l?_r(l):e}function RV(e,t,n,r){const o=e.closest(`table.${t}`)||e.closest(`table.${n}`);o&&o.querySelectorAll("tr").forEach(i=>{const s=i.querySelector("td:nth-child(2)");if(!s)return;const a=Array.from(s.querySelectorAll("div, strong")).filter(l=>!l.closest("template"));if(a.length===0){const l=document.createElement("div");l.innerHTML=" ",s.appendChild(l)}else a.forEach(l=>{let c=Ue(l).trim();!c||c.replace(r,"")===""?l.innerHTML=" ":(c=c.replace(r,""),c.endsWith(" ")||(c+=" "),c=c.replace(/ +$/," "),Ii(l,c))})})}function MV(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,n=new DOMParser().parseFromString(t,"text/html");hd(n,t);const r=n.querySelector("div");r&&(r.classList.add("remove-new-editor-element"),r.innerHTML.trim()?r.insertAdjacentHTML("beforeend"," "):r.innerHTML=" ");const o=n.querySelector("td");return o?_r(o):""}function PV(e,t){const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelectorAll("td");if(o.length>1){const i=o[1],s=(i.getAttribute("class")||"").split(" ").map(l=>l.trim()).filter(l=>l!=="");s.includes(t)||s.push(t);const a=s.join(" ");i.setAttribute("class",a)}}),Ke(n)}var _p="em-element-list-ol",Cp="em-element-list-ul",IV="em-element-list-bullet",DV=`.${_p}, .${Cp}`,BV=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],HV="div, p, td, h1, h2, h3, h4, h5, h6",Gn={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"},Aa=null;function Tp(e){const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0);if(e.contains(n.startContainer))return{container:n.startContainer,offset:n.startOffset}}return Aa&&Aa.container.isConnected&&e.contains(Aa.container)?Aa:null}function FV(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;return n.forEach((i,s)=>{i.nodeType===Node.ELEMENT_NODE&&i.tagName==="BR"?(r.length>0&&t.push({html:yu(r),nodes:[...r],startIndex:o,endIndex:s-1}),r=[],o=s+1):r.push(i)}),r.length>0&&t.push({html:yu(r),nodes:[...r],startIndex:o,endIndex:n.length-1}),t}function $V(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;const i=a=>{r.length>0&&(t.push({html:yu(r),nodes:[...r],startIndex:o,endIndex:a-1}),r=[])},s=a=>a.nodeType===Node.ELEMENT_NODE&&(a.tagName==="UL"||a.tagName==="OL");return n.forEach((a,l)=>{a.nodeType===Node.ELEMENT_NODE&&a.tagName==="BR"?(i(l),o=l+1):s(a)?(i(l),t.push({html:yu([a]),nodes:[a],startIndex:l,endIndex:l}),o=l+1):r.push(a)}),i(n.length),t}function yu(e){const t=document.createElement("div");return e.forEach(n=>{const r=n.cloneNode(!0);nn(n,r),t.appendChild(r)}),Zo(t),Ke(t)}function Ap(e,t){const n=Tp(t);if(!n)return 0;const r=n.container;if(!t.contains(r))return 0;for(let o=0;o<e.length;o++)for(const i of e[o].nodes)if(i===r||i.contains(r))return o;if(r===t){const o=n.offset;for(let i=0;i<e.length;i++)if(o>=e[i].startIndex&&o<=e[i].endIndex)return i;for(let i=0;i<e.length;i++)if(o===e[i].startIndex)return i;for(let i=0;i<e.length;i++)if(e[i].startIndex>=o)return i;if(e.length>0)return e.length-1}return 0}function j0(e,t,n,r){if(!n.contains(t))return r;for(let o=0;o<e.length;o++)for(const i of e[o].nodes)if(i===t||i.contains(t))return o;return r}function WV(e,t){const n=window.getSelection();if(!n||n.rangeCount===0){const a=Ap(e,t);return{start:a,end:a}}const r=n.getRangeAt(0);if(r.collapsed){const a=Ap(e,t);return{start:a,end:a}}const o=Ap(e,t),i=j0(e,r.startContainer,t,o),s=j0(e,r.endContainer,t,o);return{start:Math.min(i,s),end:Math.max(i,s)}}function V0(e){const t=Array.from(e.childNodes).filter(r=>r.nodeType!==Node.TEXT_NODE||(r.textContent??"").trim()!==""),n=t.length===1?t[0]:null;return n?.nodeName==="EDITOR"?n:e}function qV(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function G0(e){return e.nodeType===Node.TEXT_NODE&&/^[\t\n\f\r ]*$/.test(e.data)}function X0(e,t){const n=K0(t);if(n.length===0){e.append(" ");return}e.append(...n),qV(e)}function K0(e){let t=0,n=e.length-1;for(;t<=n&&G0(e[t]);)t++;for(;n>=t&&G0(e[n]);)n--;return e.slice(t,n+1)}var zV=["color","background-color","font-family","font-size","font-weight","font-style","text-decoration"];function UV(e){const t=K0(Array.from(e.childNodes)),n=document.createElement("span");return zV.forEach(r=>{const o=e.style.getPropertyValue(r);o&&n.style.setProperty(r,o,e.style.getPropertyPriority(r))}),e.className&&(n.className=e.className),!n.hasAttribute("style")&&!n.hasAttribute("class")?t:(n.append(...t),[n])}function vu(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const{startContainer:n,startOffset:r,endContainer:o,endOffset:i}=t.getRangeAt(0),s=a=>a.nodeType===Node.TEXT_NODE&&e.contains(a);return s(n)&&s(o)?{startContainer:n,startOffset:r,endContainer:o,endOffset:i}:null}function Eu(e,t){const n=window.getSelection();if(!t||!n||!e.contains(t.startContainer)||!e.contains(t.endContainer))return!1;const r=document.createRange();return r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),n.removeAllRanges(),n.addRange(r),!0}function Y0(e,t,n){const r=vu(e),o=document.createElement(n);Array.from(t.attributes).forEach(s=>{o.setAttribute(s.name,s.value)}),Array.from(o.style).filter(s=>s.startsWith("margin")||s.startsWith("padding")).forEach(s=>o.style.removeProperty(s));const i=o.style.cssText;o.setAttribute("style",i?`${Gn.LIST} ${i}`:Gn.LIST),o.append(...Array.from(t.childNodes)),t.replaceWith(o),Eu(e,r)}function jV(e){return e.querySelector("br")!==null}function VV(e){const t=Tp(e);if(!t)return null;const n=t.container.nodeType===Node.ELEMENT_NODE?t.container:t.container.parentElement;if(!n)return null;const r=n.closest("ol, ul");return r&&e.contains(r)?r:null}function GV(e){const t=Tp(e);if(!t)return;const{container:n,offset:r}=t;if(n!==e)return;const o=Array.from(e.childNodes),i=r>0?o[r-1]:null,s=r<o.length?o[r]:null,a=p=>p!==null&&p.nodeType===Node.ELEMENT_NODE&&p.tagName==="BR",l=p=>p!==null&&p.nodeType===Node.TEXT_NODE&&p.data.trim()==="",c=a(i),u=a(s),d=l(s),f=r>=o.length;if(!(c&&u||c&&f||r===0&&u||c&&d))return;let h;d?(h=s,h.data=" "):(h=document.createTextNode(" "),s?e.insertBefore(h,s):e.appendChild(h));const m=window.getSelection();if(m){const p=document.createRange();p.setStart(h,0),p.collapse(!0),m.removeAllRanges(),m.addRange(p)}Aa={container:h,offset:0}}function XV(e,t){const n=V0(e),r=t?"ol":"ul";if(n.querySelector("ol, ul")){const o=VV(n);if(o){o.tagName.toLowerCase()!==r&&Y0(n,o,r);return}const i=n.querySelector(":scope > ol, :scope > ul"),s=Array.from(n.childNodes).some(a=>a.nodeType===Node.ELEMENT_NODE&&a.tagName==="BR");if(i&&!s){i.tagName.toLowerCase()!==r&&Y0(n,i,r);return}}jV(n)||n.querySelector(":scope > ol, :scope > ul")?(GV(n),KV(n,r)):Z0(n,r)}function Z0(e,t){const n=vu(e),r=document.createElement(t);r.setAttribute("style",Gn.LIST);const o=document.createElement("li");o.setAttribute("style",Gn.LIST_ITEM),X0(o,Array.from(e.childNodes)),r.appendChild(o),e.replaceChildren(r),Eu(e,n)||Q0(o)}function KV(e,t){const n=$V(e);if(n.length===0){Z0(e,t);return}const{start:r,end:o}=WV(n,e),i=vu(e),s=document.createElement(t);s.setAttribute("style",Gn.LIST);let a=null;for(let h=r;h<=o;h++){const m=document.createElement("li");m.setAttribute("style",Gn.LIST_ITEM),X0(m,n[h].nodes),s.appendChild(m),a=m}const l=document.createDocumentFragment(),c=h=>h.forEach((m,p)=>{p>0&&l.appendChild(document.createElement("br")),l.append(...m.nodes)}),u=h=>h.map(m=>m.html).join("<br>").trim()!=="",d=n.slice(0,r);u(d)&&(c(d),l.appendChild(document.createElement("br"))),l.appendChild(s);const f=n.slice(o+1);u(f)&&(l.appendChild(document.createElement("br")),c(f)),e.replaceChildren(l),!Eu(e,i)&&a&&Q0(a)}function Q0(e){try{const t=window.getSelection();if(t){const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}catch{}}function YV(e,t){let n=0;const r=Array.from(e.childNodes);for(const o of r){if(o===t)return n;o.nodeType===Node.ELEMENT_NODE&&o.tagName==="BR"&&n++}return n}function ZV(e,t){const n=FV(e);if(t<0||t>=n.length)return;const r=n[t];if(r.nodes.length!==0)try{const o=window.getSelection();if(!o)return;const i=r.nodes[0],s=document.createRange();if(i.nodeType===Node.TEXT_NODE)s.setStart(i,0),s.collapse(!0);else if(i.nodeType===Node.ELEMENT_NODE)s.selectNodeContents(i),s.collapse(!0);else return;o.removeAllRanges(),o.addRange(s)}catch{}}function QV(e){const t=V0(e),n=t.querySelector("ol, ul");if(!n)return;const r=vu(t),o=YV(t,n),i=document.createDocumentFragment();n.querySelectorAll(":scope > li").forEach(s=>{const a=Ue(s).trim();!a||a===" "||(i.hasChildNodes()&&i.appendChild(document.createElement("br")),i.append(...UV(s)))}),n.replaceWith(i.hasChildNodes()?i:" "),Eu(t,r)||ZV(t,o)}function Su(e){if(!e)return!1;const t=e.closest("ul, ol");return t?!t.closest(DV):!1}function JV(e,t,n){const r=oj()||e.elem,o=r.tagName==="EDITOR"&&r.firstChild?.nodeType===1?r.firstChild:r,i=e.elem.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')||e.elem,s=o.style.fontFamily||o.style.fontSize||o.style.lineHeight||o.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')?o:i,a=e.elem.closest('[style*="line-height"]')||s.querySelector('[style*="line-height"]')||s,l=r.closest('[class*="em-mob-font_size"], [style*="font-size"]')||r,c=r.closest('[class*="em-mob-line_height"]')||r.closest('[style*="line-height"]')||r,u=qe({elem:l}),d=qe({elem:c}),f=J0(e.elem,n),h=Je(o,"strong","b"),m=s!==o?Je(s,"strong","b"):!1,p=e.elem&&o&&e.elem.isConnected&&(o===e.elem||o.contains(e.elem))?Je(e.elem,"strong","b"):!1,v=h||m||p,w=du(s),_=v||w,A={type:"text",caption:t.TEXT,fontFamily:wa(s.closest('[style*="font-family"]')||e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||parseFloat(getComputedStyle(e.elem).fontSize),fontSizeDim:"px",lineHeight:uu(a),lineHeightDim:"px",textAlign:m0(e.elem),textStrong:_,textItalic:Je(e.elem,"i","em")||!s.closest('[style*="font-style: normal"]')&&s.style?.fontStyle==="italic",textStrikethrough:Je(e.elem,"s","strike")||(s.style?.textDecoration?.includes("line-through")??!1),textUnderline:Je(e.elem,"u")||(s.style?.textDecoration?.includes("underline")??!1)||!s.style?.textDecoration&&(e.elem.tagName==="A"&&e.elem.hasAttribute("href")||h0()),textColor:Su(r)&&V(Gr(r,"color"))||V(e.elem.closest('[style*="color"]')?.style.color)||V(getComputedStyle(e.elem).color)||"",textBackgroundColor:rG(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},mobileTextAlign:cp(e.elem),linkHref:(()=>{const b=s.closest("a");if(!b)return;const g=b.getAttribute("href");if(g!==null)return g})(),textAnchor:(()=>{const b=s.closest("a");if(b&&!b.hasAttribute("href"))return b.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const b=s.closest("a");return b?!!b.hasAttribute("href"):Je(e.elem,"a")||h0()})(),textReplacer:n.variableElement(e.elem),list:f,standardList:eT(e.elem),textSuperscript:Je(e.elem,"sup"),textSubscript:Je(e.elem,"sub")};return _a(r)&&(A.showOnMobile=!0),A}function J0(e,t){const{isElementList:n,isElementListOL:r,isElementListUL:o,requestElemBullet:i}=t;if(!n)return{isList:!1,listType:"UL"};const s=e.closest("td");return{isList:!0,listType:r?"OL":"UL",bulletsColor:n&&i?V(i.closest('[style*="color"]')?.style.color):"",betweenParagraphs:n&&parseInt(s?.style?.paddingBottom,10)||0,betweenRowCell:n&&parseInt(s?.style?.paddingLeft,10)||0,bulletFontSize:n&&i&&parseInt(i.style.fontSize,10)||0,bulletFontBold:n?i?.style.fontWeight==="bold":!1,bulletFontItalic:n?i?.style.fontStyle==="italic":!1,bulletFontFamily:r&&i?wa(i):"",bulletFontUnderline:n?i?.style.textDecoration?.includes("underline")??!1:!1,bulletFontStrikethrough:n?i?.style.textDecoration?.includes("line-through")??!1:!1,bulletType:o&&i?i.innerHTML.replace(/\s| /g,""):""}}function eT(e){return Su(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function kp(e){if(!e)return!1;const t=e.trim().toLowerCase();return t!=="transparent"&&t!=="inherit"}var eG=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function tG(e){let t=e;for(;t&&eG.has(t.tagName);){const n=t.style.backgroundColor;if(kp(n))return n;t=t.parentElement}return""}function nG(e,t,n){let r=e;for(;r;){const o=r.style.getPropertyValue(t);if(kp(o))return o;if(n&&r===n)break;r=r.parentElement}return""}function rG(e){const t=tG(e);if(kp(t))return V(t)||"";if(e.closest(".em-element-custom-table"))return V(Gr(e,"background-color"))||"";const n=e.closest("div");return V(nG(e,"background-color",n))||""}function tT(e){return e.tagName==="DIV"?!!(e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight):e.tagName==="TD"?e.firstChild?.tagName==="EDITOR"||e.firstElementChild?.tagName==="EDITOR":!1}function oG(e,t,n){const{findElementWithSelectedText:r,selectedText:o,variableElement:i,requestElemBullet:s,isElementList:a,isElementListOL:l,isElementListUL:c}=n,u=r(o,e.elem)||e.elem,d=e.elem.closest('[class*="em-mob-font_size"]')||e.elem.closest('[style*="font-size"]')||e.elem,f=e.elem.closest('[class*="em-mob-line_height"]')||e.elem.closest('[style*="line-height"]')||e.elem,h=qe({elem:d}),m=qe({elem:f}),p=J0(e.elem,n),v={type:"text",caption:t.TEXT,linkHref:(()=>{const w=e.elem.getAttribute("href");if(w!==null)return w})(),textAnchor:(()=>{if(!e.elem.hasAttribute("href"))return e.elem.getAttribute("name")?.trim()||void 0})(),textLink:!!e.elem.hasAttribute("href"),target:e.elem.getAttribute("target")??"",fontFamily:wa(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:uu(e.elem),lineHeightDim:"px",textAlign:m0(e.elem),textStrong:Je(u,"strong","b")||du(u),textItalic:Je(u,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem.style?.fontStyle==="italic",textStrikethrough:Je(u,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1),textUnderline:Je(u,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"&&e.elem.hasAttribute("href"),textColor:V(e.elem.tagName==="A"?Gr(e.elem.querySelector('[style*="color"]'),"color"):Gr(e.elem,"color"))||V(getComputedStyle(e.elem).color)||"",textBackgroundColor:V(e.elem.tagName==="A"?Gr(e.elem.querySelector('[style*="background-color"]'),"background-color"):Gr(e.elem,"background-color"))||"",mobileFontSize:{value:h.mobileFontSize,dim:h.mobileFontSizeDim||"px"},mobileLineHeight:{value:m.mobileLineHeight,dim:"px"},mobileTextAlign:cp(e.elem),textReplacer:i(e.elem),list:p,standardList:eT(e.elem),textSuperscript:Je(e.elem,"sup"),textSubscript:Je(e.elem,"sub")};return _a(e.elem)&&(v.showOnMobile=!0),v}function nT(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function iG(e,t){const n=e.elem,r=qe({elem:n}),o=nT(r.mobileHeight);return{type:"vindent",caption:t.VERTICAL_INDENT,height:{value:parseFloat(n.getAttribute("height")||"0"),dim:"px"},mobileHeight:{value:o,dim:r.mobileHeightDim??"px"}}}function sG(e,t){const n=e.elem,r=qe({elem:n}),o=nT(r.mobileHeight);return{type:"vindent",caption:t.VERTICAL_INDENT,height:{value:parseFloat(n.style.height||"0"),dim:"px"},mobileHeight:{value:o,dim:r.mobileHeightDim??"px"}}}function rT(e){if(e.tagName!=="TD")return!1;if(e.classList.contains("em-vindent"))return!0;const t=e.closest("table");return e.innerHTML===""&&t?.getAttribute("width")==="100%"}function oT(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function aG(e,t){return e.elem.tagName==="TD"?iG(e,t):sG(e,t)}var iT={START_POSITION:"remove-start-element-position",NEW_EDITOR:"remove-new-editor-element",ACTIVE_ELEMENT:"remove-active-element"},sT={TRIM_SPACES:/^(\s| )+|(\s| )+$/g,LT:/</g,GT:/>/g,EMPTY_TEXT:/^(?:\s| )*$/};function aT(e,t){if(!e)return!1;const n=e.closest("tr");return n?n.closest("table")?.classList.contains(t)??!1:!1}function wu(e){const t=aT(e,_p),n=aT(e,Cp),r=t||n;let o=null;return e&&r&&(o=e.closest("table.em-element-list-ol")||e.closest("table.em-element-list-ul")),{classNameOl:_p,classNameUl:Cp,classNameBullet:IV,isListOL:t,isListUL:n,isList:r,listType:t?"ol":n?"ul":null,tableElement:o}}function lG(e){if(!e)return null;const t=e.closest("tr");return t?t.querySelector("td:first-child div:first-child"):null}function cG(e){return e?e.querySelector(".em-element-list-ol")||e.querySelector(".em-element-list-ul"):null}function uG(e=Object.values(iT)){e.forEach(t=>{document.querySelectorAll(`.${t}`).forEach(n=>{n.classList.remove(t)})})}function dG(e){for(const t of e.classList)if(t.startsWith("em-element-"))return!1;return!0}function lT(e,t){for(const n of e.childNodes){if(n.nodeType===Node.TEXT_NODE&&n.textContent?.trim()!==""){t.push(e);break}n.nodeType===Node.ELEMENT_NODE&&lT(n,t)}}function fG(e,t,n){const r=e.getAttribute("style")||"",o={};r.split(";").forEach(function(s){if(s.trim()){const a=s.split(":");a.length>=2&&(o[a[0].trim()]=a[1].trim())}}),o[t]=n;const i=Object.keys(o).map(function(s){return o[s]?s+": "+o[s]:null}).filter(Boolean).join("; ");e.setAttribute("style",i)}function mG(e,t){let n=[];const r=t||e,o=e?.style.fontFamily||getComputedStyle(r).fontFamily,i=[...(e?.closest('[style*="font-family"]')||e).classList].filter(s=>s.startsWith("em-font-"));if(i.length>0){n=["Google Fonts"],n[1]=o.indexOf("sans-serif")>-1?"Sans Serif":"Serif";const s=i[0].match(/em-font-(.*?)-/);if(s){n[2]=s[1];const a=new RegExp(`${n[2]}-(.*)`),l=i[0].match(a);l&&(n[3]=l[1])}}else o&&(n=["Safe Fonts",o.replaceAll('"',"'")]);return n}function hG(e){if(!e)return null;try{return e.rangeCount>0?e.getRangeAt(0):null}catch{return null}}var pG="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub";function gG(e,t=pG){if(!e)return null;const n=t.split(", ").map(o=>o.trim().toLowerCase());let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentNode;for(;r&&r.nodeType===Node.ELEMENT_NODE;){const o=r;if(n.includes(o.tagName.toLowerCase())&&o.style.fontSize)return o;r=r.parentNode}return null}function bG(e,t){const{elem:n,message:r,activateSection:o}=e;if(n.closest("table")?.parentElement?.tagName!=="BODY"){r.settings.parent=t.getElementParentCaption(n);let a=n;if(n.tagName==="IMG"){const l=n.closest('div[em="atom"]'),c=n.closest(".em-element-resize-img-container");a=l||c}else n.closest("editor")?a=n.parentElement:n.tagName==="TD"&&n.classList.contains("em-vindent")?a=n.closest(".em-vindent-table"):n.tagName==="TD"&&n.parentElement?.getAttribute("em")==="block"&&(a=n.parentElement);r.settings.nextElem=!!a?.nextElementSibling&&(!a.nextElementSibling.getAttribute("contenteditable")||a.nextElementSibling.getAttribute("contenteditable")!=="false"),r.settings.prevElem=!!a?.previousElementSibling&&(!a.previousElementSibling.getAttribute("contenteditable")||a.previousElementSibling.getAttribute("contenteditable")!=="false")}else r.settings.parent=void 0;(n.closest('div[style*="inline-block"]')||n.closest(".em-mob-wrap, .noresp-em-mob-wrap"))&&(r.settings.floatBlocks=t.getStructureColumns({elem:n})),o&&(r.settings.activateSection=o),n.classList.contains("em-mob-wrap")||n.classList.contains("noresp-em-mob-wrap")||n.parentElement?.hasAttribute("em")&&n.parentElement.getAttribute("em")==="group"&&document.querySelectorAll('[em="group"]').length===1?r.settings.deletable=!1:r.settings.deletable=!0,r.settings.usedColors=t.getUsedColors(),r.settings.path=t.getElementPath(n);const i=t.getCurrentElementPath();r.type==="button"&&(r.settings.commonStyles=t.commonStyles);const s=n?.classList;return t.ampService.hasAmp&&s&&(s.contains("em-amp-show-only")?r.settings.ampShow="amp":s.contains("em-amp-show-disabled")?r.settings.ampShow="html":r.settings.ampShow="all"),r.settings=t.mapObj.unescape(r.settings),{message:r,elementPath:i}}function yG(e,t,n,r){let o=!1,i=!1;if(t.shouldResetProgrammaticSelection&&(i=!0,!t.settings||Object.keys(t.settings).length===0))return o=!0,{shouldReturn:o,isProgrammaticSelectionReset:i};if(t.removeEmEdit){if(r.removeAllAttributes("em-edit"),t.setEmEditOnTd){for(const s of e.querySelectorAll("[contenteditable]"))s.removeAttribute("contenteditable");e.querySelector("td")?.setAttribute("em-edit","active")}if(t.editTargetTd){const s=e.closest("table")?.closest("td");if(s)for(const a of s.querySelectorAll("[contenteditable]"))a.removeAttribute("contenteditable");t.editTargetTd.setAttribute("em-edit","active")}}return t.isNewLink&&(e.removeAttribute("new"),n.settings.isNewLink=!0,e.setAttribute("em-edit","active")),{shouldReturn:o,isProgrammaticSelectionReset:i}}function vG(e,t,n,r){if(!document.body.classList.contains("mceNonEditable")&&!(!t&&n)){if(r.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){gf(e).setAttribute("em-edit","active");const o=e.closest("table");if(o){for(const a of o.querySelectorAll('[contenteditable="true"]'))a.tagName!=="EDITOR"&&a.removeAttribute("contenteditable");const i=o.querySelector("editor"),s=i?.firstChild;i?.childNodes.length===1&&s?.nodeType===1&&s?.tagName==="A"&&s?.childNodes.length===1&&s?.firstChild?.nodeType===3?s.setAttribute("contenteditable","true"):i?.setAttribute("contenteditable","true")}}[...e.parentElement?.querySelectorAll("strike, s")||[]].forEach(o=>o.style.textDecoration="line-through"),[...e.parentElement?.getElementsByTagName("u")||[]].forEach(o=>o.style.textDecoration="underline")}}function EG(e,t){const n=t.getSelectedText(),r=window.getSelection(),o=t.getRangeFromSelection(r);let i=null,s=null,a=null;function l(c){let u=c;u.nodeType===Node.TEXT_NODE&&(u=u.parentNode);const d=u?.closest("em-replace");return e?d?.textContent||null:d?.getAttribute("text")||null}return o&&(n?(s=l(o.startContainer),a=l(o.endContainer),s?.length&&a?.length&&s!==a&&(s=a=null)):i=l(o.commonAncestorContainer)),n?s||a:i}function SG(e,t){let n=t.getVariableByIcon(e)||!t.htmlDocument.getMappedParent(e)?e:t.htmlDocument.getVisibleNode(e);if(n.closest("a")&&t.findOutermostParentWithText(n,"a")&&n.tagName!=="IMG"&&n.tagName!=="AMP-IMG"&&(n=t.findOutermostParentWithText(n,"a")),n?.closest(".em-vindent")){const r=n.closest('div[style*="height"][style*="line-height"]');r?n=r:n=n.closest("td")}return n.tagName==="DIV"&&n.closest("amp-accordion")&&setTimeout(()=>{t.sendResizeEvent()},350),(n?.closest(".em-element-resize-img")||n?.closest(".em-element-img-change-group")||n?.closest(".em-element-resize-img-container"))&&(n=n.closest(".em-element-resize-img-container").querySelector("img")),(n.tagName==="TD"&&n.classList.contains("em-mob-wrap")&&(n.cellIndex+1)%2===0||n.closest(".em-gap"))&&(n=Ah(n)??n),n}function wG(e,t){const{elem:n,isCellCustomTable:r,listContext:o,requestElemBullet:i,variableElement:s}=e,{isListOL:a,isListUL:l,isList:c}=o;return{Locale:t.Locale,isProgrammaticSelection:t.isProgrammaticSelection,isCellCustomTable:r,extractorContext:{variableElement:s,requestElemBullet:i,isElementListOL:a,isElementListUL:l,isElementList:c},customTableContext:{tableKey:t.tableKey,parseTableElementToModel:t.parseTableElementToModel,getFontFamilyFromElement:t.getFontFamilyFromElement,textHasStyle:t.textHasStyle,isElementHasBold:t.isElementHasBold,getLineHeghtInPixels:t.getLineHeghtInPixels,activeCell:t.activeCell,CLASS_FOR_BASIC_CELL:t.CLASS_FOR_BASIC_CELL,requestElemWithStyle:t.requestElemWithStyle},elementContext:{getElementTdDiv:t.getElementTdDiv,getLineHeghtInPixels:t.getLineHeghtInPixels},linkTextContext:{variableElement:s,requestElemBullet:i,isElementListOL:a,isElementListUL:l,isElementList:c,findElementWithSelectedText:t.findElementWithSelectedText,selectedText:t.getSelectedText()},_isCarouselElement:t._isCarouselElement,_isAccordionElement:t._isAccordionElement,_isSocialBlockElement:t._isSocialBlockElement,_isImageElement:t._isImageElement,_isLinkElement:t._isLinkElement,_isButtonElement:t._isButtonElement,_isTableElement:t._isTableElement,_isCustomTableElement:t._isCustomTableElement,_isAtomElement:t._isAtomElement,_isTdColumnGroup:t._isTdColumnGroup,_isTdStructure:t._isTdStructure,_isEmptyTd:t._isEmptyTd,_isTdCell:t._isTdCell,_isVindentTd:t._isVindentTd,_isVindentDiv:t._isVindentDiv,_isFloatBlockElement:t._isFloatBlockElement,_isDivTextElement:t._isDivTextElement,_isInlineButtonElement:t._isInlineButtonElement,_extractTextSettings:t._extractTextSettings,_extractCarouselSettings:t._extractCarouselSettings,_extractAccordionSettings:t._extractAccordionSettings,_extractSocialSettings:t._extractSocialSettings,_extractImgSettings:t._extractImgSettings,_extractButtonSettings:t._extractButtonSettings,_extractLinkTextSettings:t._extractLinkTextSettings,_extractTableSettings:t._extractTableSettings,_extractCustomTableSettings:t._extractCustomTableSettings,_extractAtomElementSettings:t._extractAtomElementSettings,_extractProgrammaticElementSettings:t._extractProgrammaticElementSettings,_extractTdColumnGroupSettings:t._extractTdColumnGroupSettings,_extractTdStructureSettings:t._extractTdStructureSettings,_extractTdCellSettings:t._extractTdCellSettings,_extractVindentSettings:t._extractVindentSettings,_extractFloatBlockSettings:t._extractFloatBlockSettings,_extractDivContainerSettings:t._extractDivContainerSettings,_clearActiveEditElements:t._clearActiveEditElements,HTMLDocument:t.HTMLDocument,parseFromString:t.parseFromString,getParentElementOfSelection:t.getParentElementOfSelection}}function _G(e){return["EM-REPLACE","EDITOR","B","STRONG","U","S","STRIKE","SPAN","FONT","I","EM","P","A","H1","H2","H3","H4","H5","H6","SUP","SUB"].includes(e)}function CG(e,t,n){const{Locale:r,isProgrammaticSelection:o,isCellCustomTable:i}=n;if(!t&&!e.closest("a")&&!o&&!i){let s=e;e.querySelector("editor")&&(s=n.getParentElementOfSelection());const a=n._extractTextSettings({elem:s},r,n.extractorContext);return{type:a.type,caption:a.caption,settings:a}}if(n._isCarouselElement(e)){const s=n._extractCarouselSettings({elem:e},r,{clearActiveEditElements:n._clearActiveEditElements});return{type:s.type,caption:s.caption,settings:s}}if(n._isAccordionElement(e)){const s=n._extractAccordionSettings({elem:e},r,{clearActiveEditElements:n._clearActiveEditElements,HTMLDocument:n.HTMLDocument,parseFromString:n.parseFromString});return{type:s.type,caption:s.caption,settings:s}}if(n._isSocialBlockElement(e)){const s=n._extractSocialSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isImageElement(e)){const s=n._extractImgSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isLinkElement(e,i)){if(n._isButtonElement(e)){const l=n._extractButtonSettings({elem:e},r),c={type:l.type,caption:l.caption,settings:l};return e.getAttribute("new")&&(c.isNewLink=!0),c}const s=n._extractLinkTextSettings({elem:e},r,n.linkTextContext),a={type:s.type,caption:s.caption,settings:s};return e.getAttribute("new")&&(a.isNewLink=!0),a}if(n._isTableElement(e)){const s=n._extractTableSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s.type!=="emptyTable"?s:{}}}if(e.tagName==="LI"&&Su(e)){const s=n._extractTextSettings({elem:e},r,n.extractorContext);return{type:s.type,caption:s.caption,settings:s}}if(n._isCustomTableElement(e)){const s=n._extractCustomTableSettings({elem:e},r,n.customTableContext);return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isAtomElement(e)){const s=n._extractAtomElementSettings({elem:e},r,n.elementContext);return{type:s.type,caption:s.caption,settings:s,removeEmEdit:!0,setEmEditOnTd:!0}}if(o){const s=n._extractProgrammaticElementSettings({elem:e},r,n.elementContext);return s.settings?{type:s.settings.type,caption:s.settings.caption,settings:s.settings,removeEmEdit:!0,editTargetTd:s.editTargetTd,shouldResetProgrammaticSelection:s.shouldResetProgrammaticSelection}:{type:null,settings:{},shouldResetProgrammaticSelection:!0}}if(n._isTdColumnGroup(e)){const s=n._extractTdColumnGroupSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isTdStructure(e)){const s=n._extractTdStructureSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isEmptyTd(e))return{type:"emptyTd",settings:{}};if(n._isTdCell(e)){const s=n._extractTdCellSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isVindentTd(e)){const s=n._extractVindentSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isVindentDiv(e)){const s=n._extractVindentSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isFloatBlockElement(e)){const s=n._extractFloatBlockSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isDivTextElement(e)){const s=n._extractTextSettings({elem:e},r,n.extractorContext);return{type:s.type,caption:s.caption,settings:s}}if(e.tagName==="DIV"||e.tagName==="TD"&&e.firstChild?.tagName==="EDITOR"){const s=n._extractDivContainerSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s}}if(_G(e.tagName)&&(e.tagName!=="EM-REPLACE"||!e.closest("a"))){if(n._isInlineButtonElement(e)){const s=n._extractButtonSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(!o){const s=n._extractTextSettings({elem:e},r,n.extractorContext);return{type:s.type,caption:s.caption,settings:s}}}return{type:null,settings:{}}}var TG={_isCarouselElement:dp,_isAccordionElement:u0,_isSocialBlockElement:Kj,_isImageElement:P0,_isLinkElement:cj,_isButtonElement:b0,_isTableElement:nV,_isCustomTableElement:A0,_isAtomElement:kj,_isTdColumnGroup:rV,_isTdStructure:oV,_isEmptyTd:iV,_isTdCell:sV,_isVindentTd:rT,_isVindentDiv:oT,_isFloatBlockElement:R0,_isDivTextElement:tT,_isInlineButtonElement:uj,_extractTextSettings:JV,_extractCarouselSettings:dj,_extractAccordionSettings:XU,_extractSocialSettings:Yj,_extractImgSettings:Ij,_extractButtonSettings:lj,_extractLinkTextSettings:oG,_extractTableSettings:tV,_extractCustomTableSettings:Cj,_extractAtomElementSettings:xj,_extractProgrammaticElementSettings:Oj,_extractTdColumnGroupSettings:lV,_extractTdStructureSettings:cV,_extractTdCellSettings:uV,_extractVindentSettings:aG,_extractFloatBlockSettings:Pj,_extractDivContainerSettings:Aj,_clearActiveEditElements:i5};function AG(e){const t=e.programmaticSelection??{get:()=>!!j.get("isProgrammaticSelection"),reset:()=>j.set("isProgrammaticSelection",!1)},n=Tj(),r=()=>{const i={operation:"application_element_settings_set",settings:e.getMapObj().unescape({parent:void 0,nextElem:!1,prevElem:!1}),type:null};z.send(i)},o=i=>{if(e.selectionLock.isLocked())return;const s=i.elem??document.querySelector("[em-edit]"),a=e.selectionLock.acquire();try{if(Lr("em-edit"),!s){setTimeout(()=>{const b=document.querySelector("[em-edit]");b?.isConnected?o({elem:b}):r()},0);return}if(s.closest(".em-prevent-action"))return;const l=SG(s,{getVariableByIcon:ua,htmlDocument:e.htmlDocument,findOutermostParentWithText:Wf,sendResizeEvent:TC}),c=l.tagName==="EDITOR"&&l.firstChild?.nodeType===1?l.firstChild:l,u=wu(l),d=window.getSelection()?.isCollapsed??!0;vG(l,d,!!l.querySelector("editor"),{removeAllAttributes:Lr});const f={...TG,HTMLDocument:e.htmlDocument,parseFromString:Le,getParentElementOfSelection:Ul,getSelectedText:Qe,findElementWithSelectedText:Ns,parseTableElementToModel:Li,tableKey:n,isElementHasBold:QI,Locale:Mi(),isProgrammaticSelection:t.get(),getElementTdDiv:DU,getLineHeghtInPixels:uu,getFontFamilyFromElement:b=>mG(b,c),textHasStyle:Je,activeCell:j.get("activeCell"),CLASS_FOR_BASIC_CELL:bo,requestElemWithStyle:c},h=wG({elem:l,isCellCustomTable:!!l.closest(".em-element-custom-table"),listContext:{isListOL:u.isListOL,isListUL:u.isListUL,isList:u.isList},requestElemBullet:u.isList?lG(l):null,variableElement:(b,g=!1)=>EG(g,{getSelectedText:Qe,getRangeFromSelection:hG})},f),m=CG(l,d,h),p={operation:"application_element_settings_set",type:m.type,caption:m.caption,settings:m.settings},v=yG(l,m,p,{removeAllAttributes:Lr});if(v.isProgrammaticSelectionReset&&t.reset(),v.shouldReturn)return;const w=bG({elem:l,message:p,activateSection:i.activateSection},{getElementParentCaption:c0,getStructureColumns:BU,getUsedColors:MC,getElementPath:GU,getCurrentElementPath:qU,mapObj:e.getMapObj(),commonStyles:j.get("commonStyles"),...e.enrichExtras()});j.update({elementPath:w.elementPath});const _=e.elementRefOf?.(l),A=_===void 0?w.message:{...w.message,elementRef:_};return e.fingerprint.remember(l),z.send(A),A}finally{Promise.resolve().then(()=>{try{e.fingerprint.remember(document.querySelector("[em-edit]"))}finally{a.release()}})}};return o}function cT(){return j.get("emailWidth")}function kG(e){const t=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let n=0;n<t.length;n++){const r=t[n];if(r.classList.contains("em-insert-ignore"))continue;const o=r.getAttribute("width");if(o!=null&&o!=="")return!0}return!1}function Lp(e){const t=document.createElement("table");return t.replaceChildren(...Le(e,!0)),t}function Np(e){const t=[...e.children].filter(r=>r.tagName==="TR");if(t.length)return t.map(r=>Pt(r)).join(`
|
|
92
|
+
`);const n=e.querySelector("tr");return n?Pt(n):kt(e)}function xp(e,t){const n=cT(),r=Lp(e.blockHTML);let o=660;if(e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){o=0;const s=r.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(document.body.clientWidth>(n||s))o=e.targetBlock.clientWidth;else{const a=e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(a&&a.parentElement){a.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(d=>{o+=parseFloat(d.getAttribute("width")||"0")});const l=a.parentElement.closest("td"),c=parseFloat(l?.style.paddingLeft||"0")||0,u=parseFloat(l?.style.paddingRight||"0")||0;o+=c,o+=u}}}else if(e.targetBlock.closest(".container-td"))o=parseInt(String(e.targetBlock.offsetWidth));else{const s=e.targetBlock.querySelector('table[style*="max-width"]'),a=e.targetBlock.querySelector('div[style*="max-width"]'),l=e.targetBlock.querySelector('.row-content[style*="width"]');s?o=parseInt(String(s.offsetWidth)):a?o=parseInt(String(a.offsetWidth)):l?o=parseInt(String(l.offsetWidth)):o=e.targetBlock.style.maxWidth?parseFloat(e.targetBlock.style.maxWidth):e.targetBlock.getBoundingClientRect().width}let i=r.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(r.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){i=0;const s=r.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(s&&s.parentElement){s.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(u=>{i+=parseFloat(u.getAttribute("width")||"0")});const a=s.parentElement.closest("td"),l=parseFloat(a?.style.paddingLeft||"0")||0,c=parseFloat(a?.style.paddingRight||"0")||0;i+=l,i+=c}}if(r.querySelector('div[style*="inline-block"]')){if(o<660&&r.querySelector('div[style*="inline-block"]'))if(r.querySelectorAll('div[style*="inline-block"]').length>1)r.querySelectorAll('div[style*="inline-block"]').forEach(s=>{const a=s,l=parseFloat(a.style.width),c=l/i,u=s.firstElementChild;if(!u)return;const d=l-parseFloat(u.getAttribute("width")||"0"),f=parseFloat(String(o*c));a.style.width=f+"px",u.setAttribute("width",String(f-d)),Vl({elem:a,width:f})});else{const s=r.querySelector('div[style*="inline-block"]');s.style.maxWidth=o+"px",Vl({elem:s,width:o}),s.firstElementChild&&(s.firstElementChild.setAttribute("width",String(Math.round(o*.91))),s.firstElementChild.style.maxWidth=Math.round(o*.91)+"px")}}else if(r.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){const s=[];r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(function(a){const l=CE(a);l&&s.indexOf(l)===-1&&s.push(l)}),s.forEach(a=>{const l=a.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(!l||!l.parentElement)return;const c=l.parentElement.closest("td"),u=parseFloat(c?.style.paddingLeft||"0")||0,d=parseFloat(c?.style.paddingRight||"0")||0;if(a.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1){if(!kG(a))return;const f=a.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),h=f?parseFloat(f.getAttribute("width")||"0"):0,m=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").length;let p=0,v=0;a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(A=>{if(A.getAttribute("width")&&!A.classList.contains("em-insert-ignore")){const b=parseFloat(A.getAttribute("width"))/i,g=Math.round(parseFloat(String(o*b))-h/(m*2));A.setAttribute("width",String(g)),p+=g}});const w=o-(u+d+h*(m-1)+p);a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(A=>{if(A.getAttribute("width")&&!A.classList.contains("em-insert-ignore")){const b=parseFloat(A.getAttribute("width"))+Math.round(w/m);v+=b,A.setAttribute("width",String(b)),A.querySelector("img")&&A.querySelectorAll("img").forEach(g=>{parseFloat(g.getAttribute("width")||"0")>parseFloat(A.getAttribute("width"))+Math.round(w/m)&&(g.setAttribute("width",A.getAttribute("width")),g.style.maxWidth=A.getAttribute("width")+"px")})}}),v=v+h*(m-1)+u+d;const _=o-v;if(_!==0&&p>0){const A=a.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(A&&!A.classList.contains("em-insert-ignore")){const b=parseFloat(A.getAttribute("width")||"0");A.setAttribute("width",String(b+_))}else{const b=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let g=b.length-1;g>=0;g--){const E=b[g];if(E.classList.contains("em-insert-ignore"))continue;const T=parseFloat(E.getAttribute("width")||"0");E.setAttribute("width",String(T+_));break}}}}else if(l.getAttribute("width")&&!l.classList.contains("em-insert-ignore")){const f=Math.round(o-u-d);l.setAttribute("width",String(f))}})}return Np(r)}function Op(e){const t=Lp(e),n=!!document.querySelector(".noresp-em-narrow-table");return t.querySelectorAll(".em-mob-wrap[width], .noresp-em-mob-wrap[width]").forEach(r=>{const o=parseFloat(r.getAttribute("width")||"0");o&&r.querySelectorAll('[em="atom"] img:not(.em-countdown)').forEach(i=>{parseFloat(i.getAttribute("width")||"0")<=o||(i.setAttribute("width",String(o)),n||(i.style.maxWidth=o+"px"))})}),Np(t)}function Rp(e,t){const n=cT(),r=Lp(e.blockHTML);let o=660;const i=e.targetBlock.tagName==="TR"?document.createElement("table"):document.createElement("div");if(i.style.width=n+"px",i.style.height="1000px",i.style.borderCollapse="collapse",i.setAttribute("cellpadding","0"),i.setAttribute("cellspacing","0"),i.style.position="absolute",i.style.top="-9999px",i.style.left="-9999px",document.body.appendChild(i),i.innerHTML=t.getOuterHtml(e.targetBlock),n)o=n;else{const a=i.querySelector('table[style*="max-width"]'),l=i.querySelector('div[style*="max-width"]'),c=i.querySelector('.row-content[style*="width"]');if(a)o=parseInt(String(a.offsetWidth));else if(l)o=parseInt(String(l.offsetWidth));else if(c)o=parseInt(String(c.offsetWidth));else{const u=i.querySelector(e.targetBlock.tagName);o=u?.style.maxWidth?parseFloat(u.style.maxWidth):u?.getBoundingClientRect().width||660}}document.body.removeChild(i);const s=r.querySelector("table:first-child");return s?.style.maxWidth&&(s.style.maxWidth=o+"px",Vl({elem:s,width:o})),Np(r)}function _u(e){const t=e.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap");if(!t.length)return;const n=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),r=Array.from(n).filter(u=>!u.classList.contains("em-insert-ignore")&&u.getAttribute("width")!=null&&u.getAttribute("width")!=="");if(r.length===0)return;const o=e.parentElement?.getBoundingClientRect().width||0;let i=0,s=0;t.forEach(u=>{i+=parseFloat(u.getAttribute("width")||"0")});let a=e.querySelector(".em-mob-wrap");for(;a&&a!==e.parentElement?.parentElement;){const u=window.getComputedStyle(a),d=parseFloat(u.paddingLeft)||0,f=parseFloat(u.paddingRight)||0;(d>0||f>0)&&(s+=d+f),a=a.parentElement}const l=o-(i+s),c=r.length;r.forEach(u=>{const d=parseFloat(u.getAttribute("width")||"0")+Math.ceil(l/c);u.setAttribute("width",String(d))})}function uT(e,t){const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let r=0,o=null;for(;n.nextNode();){o=n.currentNode;const i=(o.textContent||"").length;if(r+i>=t){const s=t-r;return{node:o,offset:s}}r+=i}if(o){const i=o.textContent?.length||0;return{node:o,offset:i}}return null}function LG(e,t,n,r){try{if(!n||n.nodeType!==Node.TEXT_NODE)return!1;const o=n.textContent?n.textContent.length:0,i=Math.min(Math.max(0,r),o);return e.setStart(n,i),e.collapse(!0),t.removeAllRanges(),t.addRange(e),!0}catch{return!1}}function NG(e,t,n){const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let o=0;for(;r.nextNode();){const i=r.currentNode;if(i===t)return o+n;o+=i.textContent?.length||0}return-1}function dT(e){return Array.from(e.rows).flatMap(t=>Array.from(t.cells))}function fT(e,t,n){const r=e.findIndex(i=>i.contains(t));if(r<0||t.nodeType!==Node.TEXT_NODE)return null;const o=NG(e[r],t,n);return o<0?null:{cell:r,offset:o}}function xG(e){const t=window.getSelection();if(!t?.rangeCount)return null;const n=t.getRangeAt(0),r=dT(e),o=fT(r,n.startContainer,n.startOffset),i=fT(r,n.endContainer,n.endOffset),s=!!n.startContainer.parentElement?.closest("editor");return o&&i?{start:o,end:i,inEditor:s}:null}function OG(e,t,n){const r=dT(e),o=r[t.start.cell]?.querySelector(":scope > div");t.inEditor&&o&&n&&n(o,!0);const i=({cell:u,offset:d})=>r[u]?uT(r[u],d):null,s=i(t.start),a=i(t.end),l=window.getSelection();if(!s||!a||!l)return;const c=document.createRange();c.setStart(s.node,s.offset),c.setEnd(a.node,a.offset),l.removeAllRanges(),l.addRange(c)}function Xr(e,t){return t===void 0?{rejected:e}:{rejected:e,key:t}}function RG(e){return"rejected"in e}function Cu(e){return{status:"rejected",reason:e.rejected,...e.key===void 0?{}:{key:e.key}}}function MG(e,t){Array.from(e.attributes).forEach(n=>e.removeAttribute(n.name)),Array.from(t.attributes).forEach(n=>e.setAttribute(n.name,n.value)),e.replaceChildren(...Array.from(t.childNodes))}function mT(e,t,n){if(t.isEditLocked())return Cu(Xr("locked"));const r=e.outerHTML,o=e.cloneNode(!0),i=n.movesCells?null:xG(e),s=()=>{i&&OG(e,i,t.wrapEditor)},a=()=>{MG(e,o),s()};try{const l=n.edit(e);return RG(l)?(e.outerHTML!==r&&a(),Cu(l)):(Ta(e,t.tableModelToHtml(l)),s(),n.afterWrite?.(e),{status:"applied"})}catch(l){throw a(),l}}var hT=["top","right","bottom","left"],pT={cell_borderAll:"all",cell_borderTop:"top",cell_borderRight:"right",cell_borderBottom:"bottom",cell_borderLeft:"left"},Mp={paddingTop:["top"],paddingRight:["right"],paddingBottom:["bottom"],paddingLeft:["left"],paddingLeftRight:["left","right"],paddingTopBottom:["top","bottom"]},PG={top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"},gT=e=>t=>[[e,St(t)??0]];function bT(e){const t=e??{};return hT.map(n=>[PG[n],St(t.all??t[n])??0])}function yT(e){const t=St(e.width);return{...t===null?{}:{width:t},...Fe(e.style)?{}:{style:e.style},...Fe(e.color)?{}:{color:jn(e.color)}}}function IG(e){return fp(e)||e.width===0||e.color===""}function DG(e){return(t,n,{ids:r,ctx:o})=>{const i=n??{},s=o.getExternalBorders(t,r),a=pT[e];let l=t;if(a==="all"){const u=IG(i);for(const d of Object.keys(s))l=u?o.clearCellBorders(l,[d],hT):o.updateCellBordersByIds(l,[d],s[d],yT(i)),l=o.addClassToCellsByIds(l,[d],Ir);return o.addClassToCellsByIds(l,Object.keys(s),Dr)}const c=Object.keys(s).filter(u=>s[u].includes(a));return l=fp(i)?o.clearCellBorders(l,c,[a]):o.updateCellBordersByIds(l,c,[a],yT(i)),o.addClassToCellsByIds(l,r,Dr)}}var BG=(e,t,{ids:n,ctx:r})=>{const o=r.getExternalCorners(e,n);let i=e;for(const s of Object.keys(o))i=r.updateCellBorderRadiusByIds(i,[s],o[s],St(t)??0),i=r.addClassToCellsByIds(i,[s],Dr);return i};function vT(e){return(t,n,{ids:r,ctx:o})=>{let i=o.addClassToCellsByIds(t,r,Ir);for(const[s,a]of e(n))i=o.updateCellPaddingByIds(i,r,Mp[s],a);return o.addClassToCellsByIds(i,r,Dr)}}function ET(e){return(t,n,{ctx:r})=>e(n).reduce((o,[i,s])=>r.updateTablePadding(o,{settings:{[i]:s}}),t)}var ST={...Object.fromEntries(Object.keys(Mp).map(e=>[e,ET(gT(e))])),...Object.fromEntries(Object.keys(Mp).map(e=>[`cell_${e}`,vT(gT(e))])),padding:ET(bT),cell_padding:vT(bT),...Object.fromEntries(Object.keys(pT).map(e=>[e,DG(e)])),cellBackgroundColor:(e,t,{ids:n,ctx:r})=>r.addClassToCellsByIds(r.updateTableCellBackgroundByIds(e,n,jn(t)),n,Dr),cell_borderPosition:(e,t,{ids:n,ctx:r})=>r.addClassToCellsByIds(e,n,Ir),cell_borderRadiusAll:BG},HG=["all","topLeft","topRight","bottomRight","bottomLeft"];function Kr(e){return(t,n,{settings:r,ctx:o})=>o[e]({settings:r,elem:t})}function wT(e,t){return(n,r,{ctx:o})=>{const i=r??{},s={...i,value:Fe(i.value)?null:i.value};o[t]({settings:{[e]:s},elem:n})}}var FG=(e,t,{ctx:n})=>{const r=t??{};if(Fe(r.hOffset)&&Fe(r.vOffset)||r.color===""){fa(e,r.classNamePrefix||"em-mob-box_shadow-");return}n.setElementMobileBoxShadow({settings:{mobileBoxShadow:r},elem:e})},$G=(e,t,{ctx:n})=>{const r=t??{},o=HG.find(i=>i in r);if(o){if(St(r[o])){n.setElementMobileBorderRadius({settings:{mobileBorderRadius:r},elem:e});return}fa(e,o==="all"?"em-mob-border_radius_":r.classNamePrefix||`em-mob-border_radius_${o}-`)}},WG={mobileWidth:wT("mobileWidth","setElementMobileWidth"),mobileHeight:wT("mobileHeight","setElementMobileHeight"),show:Kr("setElementShow"),mobileBackgroundColor:Kr("setElementMobileBackgroundColor"),mobileBackgroundImage:Kr("setElementMobileBackgroundImage"),mobileBackgroundPositionX:Kr("setElementMobileBackgroundPositionX"),mobileBackgroundPositionY:Kr("setElementMobileBackgroundPositionY"),mobileBackgroundRepeat:Kr("setElementMobileBackgroundRepeat"),mobileBackgroundSize:Kr("setElementMobileBackgroundSize"),mobileBorder:Kr("setElementMobileBorder"),mobileBoxShadow:FG,mobileBorderRadius:$G},Tu={topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"},qG={"background-size":"cover","background-repeat":"no-repeat","background-position":"center"};function Pp(e){const t=St(e.getAttribute("border"));t&&C0(e,"all",{width:t,style:"solid",color:e.getAttribute("bordercolor")||null}),["border","bordercolor","border-collapse"].forEach(n=>e.removeAttribute(n))}function _T(e){["border-radius",...Object.values(Tu)].some(t=>!/^(0px\s*)*$/.test(e.style.getPropertyValue(t)))||e.style.boxShadow?e.style.borderCollapse="separate":e.style.borderCollapse==="separate"&&e.style.removeProperty("border-collapse")}function zG(e){return(t,n)=>{Pp(t),C0(t,mu[e],n??{}),t.style.borderCollapse||(t.style.borderCollapse="collapse")}}var UG=(e,t)=>{const n=t??{};Pp(e);const r=St(n.all);r?Ai({elem:e,settings:{borderRadius:{all:r}}}):("all"in n&&e.style.removeProperty("border-radius"),Object.keys(Tu).forEach(o=>{const i=St(n[o]);i?e.style.setProperty(Tu[o],`${i}px`):("all"in n||o in n)&&e.style.removeProperty(Tu[o])})),_T(e)},jG=(e,t)=>{const n=t??{};Pp(e);const r=!Fe(n.color)&&!Fe(n.hOffset)&&!Fe(n.vOffset)?{hOffset:St(n.hOffset),vOffset:St(n.vOffset),blurRadius:St(n.blurRadius),spreadRadius:St(n.spreadRadius),color:jn(n.color),inset:!!n.inset}:{hOffset:null,vOffset:null};rC({elem:e,settings:{boxShadow:r}}),_T(e)},VG=(e,t)=>{if(Fe(t)){e.removeAttribute("bgcolor"),e.style.removeProperty("background-color");return}e.setAttribute("bgcolor",jn(t)),e.style.backgroundColor&&(e.style.backgroundColor=jn(t))},GG=(e,t)=>{const n=t?.[0]?.value;if(Fe(n)){e.removeAttribute("data-bg-image"),e.style.removeProperty("background-image");return}e.setAttribute("data-bg-image",jn(n)),e.style.setProperty("background-image",`url('${n}')`),Object.entries(qG).forEach(([r,o])=>{(r==="background-position"?e.style.backgroundPositionX:e.style.getPropertyValue(r))||e.style.setProperty(r,o)})};function CT(e){return(t,n)=>{const r=St(n);nC(t,{[e]:r===null?void 0:`${r}px`})}}var XG={...Object.fromEntries(Object.keys(mu).map(e=>[e,zG(e)])),borderRadius:UG,boxShadow:jG,backgroundColor:VG,backgroundImage:GG,backgroundPositionX:CT("backgroundPositionX"),backgroundPositionY:CT("backgroundPositionY"),backgroundSize:(e,t)=>{e.style.backgroundSize=jn(t)},backgroundRepeat:(e,t)=>{e.style.backgroundRepeat=jn(t)}},KG=["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"];function YG(e){return e?.querySelector(":scope > div, :scope > editor > div")??null}function ZG(e){const t=window.getSelection(),n=t&&t.rangeCount?t.getRangeAt(0):null;if(!n||n.collapsed||!e.contains(n.startContainer)||!e.contains(n.endContainer))return null;const{startContainer:r,startOffset:o,endContainer:i,endOffset:s}=n;return{startContainer:r,startOffset:o,endContainer:i,endOffset:s}}function TT(e,t){const n=document.createRange();return t&&e.contains(t.startContainer)&&e.contains(t.endContainer)?(n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n.selectNodeContents(e),n}function AT(e){const t=window.getSelection()?.anchorNode,n=(t instanceof Element?t:t?.parentElement)?.closest("a");if(n&&e.contains(n))return n;if(e.tagName==="A")return e;const r=e.querySelectorAll("a");return e.querySelector("a[em-edit]")??(r.length===1?r[0]:null)}function kT(e,{settings:t,activeElement:n}){"textAlign"in t&&(t.textAlign?e.setAttribute("align",jn(t.textAlign)):n.style?.textAlign?n.style.removeProperty("text-align"):e.removeAttribute("align")),t.valign?e.closest("td")?.setAttribute("valign",jn(t.valign)):t.valign===""&&e.closest("td")?.removeAttribute("valign")}function LT(e,t,n,r){const{settings:o,ctx:i}=n;i.wrapEditor(e,!0),i.textStyleProperties.some(s=>s in o)&&(i.addNewRange(t?TT(e,t):r()),i.toggleTextStyle(e,{settings:o}))}function QG(e,t){const n=ZG(e),r="linkHref"in t.settings?AT(e):null;if("linkHref"in t.settings&&!r)return Xr("invalid-value","linkHref");LT(e,n,t,()=>TT(e,null)),r&&typeof t.settings.linkHref=="string"&&r.setAttribute("href",t.settings.linkHref),kT(e,t)}function JG(e,t){for(const n of e){LT(n,null,t,()=>{const o=document.createRange();return o.selectNode(n),o});const r="linkHref"in t.settings?AT(n):null;r&&typeof t.settings.linkHref=="string"&&r.setAttribute("href",t.settings.linkHref),kT(n,t)}}function eX(e,t,n){if(!t.length)return;const r=e.querySelector(`td.${yo}, td.${Ir}, td.${bo}`),o=(t.length===1&&r?[r]:t.map(i=>rp(e,i))).map(YG).filter(i=>!!i);if(t.length===1&&o.length===1)return QG(o[0],n);JG(o,n)}var tX=["borderPosition","mobileBorderPosition","outlookBackground","exportAsPicture"],NT={...XG,...WG};function nX(e){if(!e||typeof e!="object"||!Object.keys(e).length)return Xr("empty");const t={live:[],cells:[],text:!1,forCells:!1};for(const[n,r]of Object.entries(e))if(NT[n])t.live.push([NT[n],r]);else if(ST[n])t.cells.push([ST[n],r]),t.forCells||(t.forCells=n.startsWith("cell"));else if(KG.includes(n))t.text=!0,t.forCells=!0;else if(!tX.includes(n))return Xr("unknown-setting",n);return t}function xT(){return document.querySelector(`.${bo}, .${Ir}, .${yo}`)}function rX(e){const t=e.activeElement??xT(),n=t?.closest(".em-element-custom-table");return t&&n?{table:n,activeElement:t}:null}function oX(e){const t=e.tagName==="TD"?e.querySelector("div"):e.tagName==="TR"?e.querySelector("editor div"):null;return t?.setAttribute("em-edit","active"),t??e}function iX(e,t){if(!e.querySelector(".remove-basic-cell"))return t.activeCell??[];document.querySelectorAll(`.${Ir}`).forEach(r=>{r.classList.remove(Ir)});const n=t.getCellsWithClasses(t.parseTableElementToModel(e),[bo,yo]);return t.state.set("activeCell",n),n}function sX(e,t,n,r){const o=nX(t);if("rejected"in o)return o;const i=iX(e,r);if(o.forCells&&!i.length)return Xr("no-cell");const s=oX(n.activeElement);o.live.forEach(([c,u])=>c(e,u,{settings:t,ctx:r})),pj(e);const a=o.text?eX(e,i,{settings:t,activeElement:s,ctx:r}):void 0;if(a)return a;let l=o.cells.reduce((c,[u,d])=>u(c,d,{ids:i,ctx:r}),r.parseTableElementToModel(e));return(/border-collapse:/.test(e.getAttribute("style")??"")||e.className.includes("em-mob-border_"))&&(l=r.removeOuterBorders(l)),l}function aX(e,t){[bo,yo].forEach(r=>{document.querySelectorAll(`.${r}`).forEach(o=>o.classList.remove(r))});const n=e.querySelectorAll(`.${Dr}`);n[0]?.setAttribute("em-edit",""),n.forEach(r=>r.classList.remove(Dr)),ga(e,t,"around")}function lX(e,t){const n=rX(t);return n?mT(n.table,t,{edit:r=>sX(r,e,n,t),afterWrite:r=>aX(r,e)}):Cu(Xr("no-table"))}var cX=new Set(["alt","title","link"]);function uX(e,t,n){const r=Object.keys(n.settings??{});return n.type==="img"&&r.length>0&&r.every(o=>cX.has(o))&&e.parentNode===t.parent}function dX(e){let t=e?.parentElement??null;for(;t&&!t.tagName.startsWith("AMP-");)t=t.parentElement;const n=e?.tagName??"",r=t&&e?Array.from(t.getElementsByTagName(n)).indexOf(e):-1;return{root:t,tag:n,index:r,parent:e?.parentNode??null}}function fX(e,t,n,r,o){const i=o.getMappedParent(e);if(!i?.isConnected||uX(e,n,r))return null;const s=i.tagName.startsWith("AMP-"),a=s&&i===n.root&&n.index>=0,l=s?Array.from(i.querySelectorAll("section"),f=>f.hasAttribute("expanded")):[],c=sr(o.getOuterHtml(i),([f])=>(i.parentNode?.replaceChild(f,i),f));let u=c;const d=a?c.getElementsByTagName(n.tag)[n.index]??null:null;return d?u=d:t?.tagName==="A"&&c.tagName!=="A"&&(u=c.querySelector("a")??c),u.setAttribute("em-edit","active"),{active:u,afterCommit:()=>{o.applyHidden(()=>c.querySelectorAll("section").forEach((f,h)=>{l[h]&&f.setAttribute("expanded","")}))}}}function mX(e,t){const{activeElement:n}=t;let r=!1;if(!e)return r;const o=n.closest("a"),i=n.closest("td"),s=i?zr(i):null,a=o?zr(o):null,l=!!s&&!a,c=jh(o),u=e.outlookRounding===!0||e.outlookRounding!==!1&&(l||c)?o:i;if(e.exportAsPicture?n.closest("table")?.setAttribute("em-operation","exportAsPicture"):n?.closest("table")?.getAttribute("em-operation")==="exportAsPicture"&&n.closest("table")?.removeAttribute("em-operation"),e.href!==void 0&&n.closest("a")?.setAttribute("href",e.href),e.align){const m=n.closest("td")?.closest("table")?.closest("div, p, td");m&&(m.style.textAlign?m.style.textAlign=e.align:m.setAttribute("align",e.align))}else if(e.align===""){const m=n.closest("td")?.closest("table")?.closest("div, p, td");m&&(m.style.textAlign?m.style.removeProperty("text-align"):m.removeAttribute("align"))}if(e.textAlign){const m=n.closest("td");m&&(m.style.textAlign?m.style.textAlign=e.textAlign:m.setAttribute("align",e.textAlign))}else if(e.textAlign===""){const m=n.closest("td");m&&(m.style.textAlign?m.style.removeProperty("text-align"):m.removeAttribute("align"))}if(e.valign?n.closest("td")?.closest("table")?.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&n.closest("td")?.closest("table")?.closest("td")?.removeAttribute("valign"),e.width){const m=n.closest("table");m&&(e.width.value?(m.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),m.style.width=e.width.value+e.width.dim):(m.removeAttribute("width"),m.style.removeProperty("width")))}if(e.height){const m=n.closest("td"),p=n.closest("a");if(e.height.value){if(m&&(m.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),m.style.height=e.height.value+e.height.dim),p){const v=e.height.value+e.height.dim;p.style.height=v,p.style.lineHeight=v,p.firstElementChild&&(p.firstElementChild.style.lineHeight=v);const w=p.closest("editor")||p.querySelector("editor");w&&(w.style.height=v,w.style.lineHeight=v)}}else if(m&&(m.removeAttribute("height"),m.style.removeProperty("height")),p){p.style.removeProperty("height"),p.style.removeProperty("line-height");const v=p.closest("editor")||p.querySelector("editor");v&&(v.style.removeProperty("height"),v.style.removeProperty("line-height"))}}if(e.border&&u&&t.setElementBorder({settings:e,elem:u}),e.boxShadow&&u&&t.setElementBoxShadow({settings:e,elem:u}),e.backgroundColor!==void 0&&u&&(e.backgroundColor===""?(u.removeAttribute("bgcolor"),u.style.removeProperty("background-color")):(u.tagName==="TD"&&u.setAttribute("bgcolor",e.backgroundColor),u.style.backgroundColor=e.backgroundColor)),e.backgroundImage){const m=n.closest("td");m&&(e.backgroundImage[0].value===""?(m.style.removeProperty("background-image"),m.removeAttribute("background")):(m.style.removeProperty("background-image"),Ht(m,"background",pX(e))))}if(e.backgroundPositionX!==void 0){const m=n.closest("td");m&&(e.backgroundPositionX===""?m.style.removeProperty("background-position-x"):m.style.backgroundPositionX=e.backgroundPositionX)}if(e.backgroundPositionY!==void 0){const m=n.closest("td");m&&(e.backgroundPositionY===""?m.style.removeProperty("background-position-y"):m.style.backgroundPositionY=e.backgroundPositionY)}if(e.backgroundRepeat){const m=n.closest("td");m&&(e.backgroundRepeat==="none"?m.style.removeProperty("background-repeat"):m.style.backgroundRepeat=e.backgroundRepeat)}if(e.backgroundSize!==void 0){const m=n.closest("td");m&&(e.backgroundSize===""?m.style.removeProperty("background-size"):m.style.backgroundSize=e.backgroundSize)}if(e.padding){const m=n.closest("a");m&&(e.padding.all!==void 0?(m.style.paddingTop=e.padding.all+"px",m.style.paddingRight=e.padding.all+"px",m.style.paddingBottom=e.padding.all+"px",m.style.paddingLeft=e.padding.all+"px"):(e.padding.top!==void 0&&(m.style.paddingTop=e.padding.top+"px"),e.padding.right!==void 0&&(m.style.paddingRight=e.padding.right+"px"),e.padding.bottom!==void 0&&(m.style.paddingBottom=e.padding.bottom+"px"),e.padding.left!==void 0&&(m.style.paddingLeft=e.padding.left+"px")))}if(e.borderRadius&&u&&t.setElementBorderRadius({settings:e,elem:u}),e.mobileWidth){const m=n.closest("table");m&&t.setElementMobileWidth({settings:e,elem:m}),r=!0}if(e.mobileHeight){const m=n.closest("td");m&&t.setElementMobileHeight({settings:e,elem:m}),t.setElementMobileLineHeight({settings:e,elem:n}),r=!0}if(e.mobileBorder){const m=n.closest("td");m&&t.setElementMobileBorder({settings:e,elem:m}),r=!0}if(e.mobileBorderRadius){const m=n.closest("td");m&&t.setElementMobileBorderRadius({settings:e,elem:m}),r=!0}if(e.mobileBoxShadow){const m=n.closest("td");m&&t.setElementMobileBoxShadow({settings:e,elem:m}),r=!0}if(e.mobileTextAlign){const m=Sa(n);m&&t.setElementMobileAlign({settings:e,elem:m,fieldName:"mobileTextAlign"}),r=!0}if(e.mobileAlign){const m=n.closest("td")?.closest("table");m&&t.setElementMobileTableAlign({settings:e,elem:m}),r=!0}if(e.mobileVerticalAlign){const m=n.closest("td");m&&t.setElementMobileVerticalAlign({settings:e,elem:m}),r=!0}if(e.mobileBackgroundColor){const m=n.closest("td");m&&t.setElementMobileBackgroundColor({settings:e,elem:m}),r=!0}if(e.mobileBackgroundImage){const m=n.closest("td");m&&t.setElementMobileBackgroundImage({settings:e,elem:m}),r=!0}if(e.mobileBackgroundPositionX){const m=n.closest("td");m&&t.setElementMobileBackgroundPositionX({settings:e,elem:m}),r=!0}if(e.mobileBackgroundPositionY){const m=n.closest("td");m&&t.setElementMobileBackgroundPositionY({settings:e,elem:m}),r=!0}if(e.mobileBackgroundRepeat){const m=n.closest("td");m&&t.setElementMobileBackgroundRepeat({settings:e,elem:m}),r=!0}const d=e;if(d.mobileBackgroundSize){const m=n.closest("td");m&&t.setElementMobileBackgroundSize?.({settings:d,elem:m}),r=!0}if(e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show){const m=n.closest("table");m&&t.setElementShow({settings:e,elem:m}),r=!0}const f=n.closest("a");if(f&&e.textColor!==void 0){const m=String(e.textColor||"");f.style.color=m,f.querySelectorAll('span[style*="color"], font[color]').forEach(p=>{p.style.removeProperty("color"),p.removeAttribute("color")})}if(f&&e.textBackgroundColor!==void 0){const m=String(e.textBackgroundColor||"");f.style.backgroundColor=m,f.querySelectorAll('span[style*="background-color"]').forEach(p=>{p.style.removeProperty("background-color")})}const h=["textColor","textBackgroundColor"];if(t.textStyleProperties.filter(m=>!h.includes(m)&&e.hasOwnProperty(m)).length>0)try{t.toggleTextStyle(n,{type:"button",settings:e})}catch{}return e.mobileFontSize&&(t.setElementMobileFontSize({settings:e,elem:n}),r=!0),e.textReplacer!==void 0&&hX(e.textReplacer,n,t.compareStrings),e.outlookRounding===!0?Gh(n,e):e.outlookRounding===!1?uW(n):(s||c)&&Gh(n,e),i&&ga(i,e,"inside"),r}function hX(e,t,n){if(e){const r=window.getSelection();if(!r||r.rangeCount===0)return;const o=r.getRangeAt(0),i=e.replace(/~~.*$/,""),s=o?.commonAncestorContainer,a=s?.nodeType===1?s:s.parentElement;let l=a?.closest("em-replace");const c=!!(/~~/.test(e)&&l);if(c&&a){const u=e.replace(/~~.*$/,"");a.setAttribute("text",u),a.innerHTML=u}if(!l&&r.rangeCount>0&&!o.collapsed){const u=document.querySelectorAll("em-replace");if(l=Array.prototype.find.call(u,d=>d.textContent?.trim()===r.toString().trim()&&r.toString().trim()!==""),!l){const d=document.querySelector('[em-edit="active"]');d?.textContent===o.toString()&&o.selectNodeContents(d);const f=e.replace(/~~.*$/,""),h=document.createElement("em-replace");h.setAttribute("text",f),o.surroundContents(h)}}if(!l&&r.rangeCount>0&&o.collapsed){let u=document.querySelector("em-replace");if(u){const d=document.querySelectorAll("em-replace"),f=/~$/;l=Array.prototype.find.call(d,h=>{const m=e,p=h.textContent||"";return m.length===1&&f.test(p)?!0:n(p,m)}),l&&(l.setAttribute("text",e),l.textContent=e),l||(u=document.createElement("em-replace"),u.setAttribute("text",i),o.insertNode(u),u.innerHTML=i,o.collapse())}else u=document.createElement("em-replace"),u.setAttribute("text",i),o.insertNode(u),u.innerHTML=i,o.collapse()}l&&!c&&(l.getAttribute("text")===l.innerHTML&&(l.innerHTML=e),l.setAttribute("text",e))}else if(e===""){const r=t?.closest("em-replace")||t?.querySelector("em-replace");if(r){const o=r.parentNode,i=r.firstChild,s=r.lastChild;if(r.getAttribute("text")!==r.innerHTML&&o)for(;r.firstChild;)o.insertBefore(r.firstChild,r);const a=document.createRange(),l=window.getSelection();i&&s&&l&&(a.setStartBefore(i),a.setEndAfter(s),l.removeAllRanges(),l.addRange(a)),r.remove()}}}function pX(e){return e.backgroundImage?.[0]?.value??""}function gX(e,t){const n=t.activeElement;let r=!1;if(!e)return r;e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align?n.style.textAlign?n.style.textAlign=e.align:n.setAttribute("align",e.align):e.align===""&&(n.style.textAlign?n.style.removeProperty("text-align"):n.removeAttribute("align")),e.valign?n.style.verticalAlign=e.valign:e.valign===""&&n.style.removeProperty("vertical-align"),e.width&&(e.width.value?n.style.width=e.width.value+e.width.dim:n.style.removeProperty("width")),e.minWidth&&(e.minWidth.value?n.style.minWidth=e.minWidth.value+e.minWidth.dim:n.style.removeProperty("min-width")),e.maxWidth&&(e.maxWidth.value?n.style.maxWidth=e.maxWidth.value+e.maxWidth.dim:n.style.removeProperty("max-width")),e.height&&(e.height.value?n.style.height=e.height.value+e.height.dim:n.style.removeProperty("height")),e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?n.style.removeProperty("background-color"):n.style.backgroundColor=e.backgroundColor),e.backgroundImage&&(e.backgroundImage[0].value===""?n.style.removeProperty("background-image"):n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")"),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?n.style.removeProperty("background-position-x"):n.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?n.style.removeProperty("background-position-y"):n.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?n.style.removeProperty("background-repeat"):n.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?n.style.removeProperty("background-size"):n.style.backgroundSize=e.backgroundSize),e.padding&&(e.padding.all!==void 0?(n.style.paddingTop=e.padding.all+"px",n.style.paddingRight=e.padding.all+"px",n.style.paddingBottom=e.padding.all+"px",n.style.paddingLeft=e.padding.all+"px"):(e.padding.top&&(n.style.paddingTop=e.padding.top+"px"),e.padding.right&&(n.style.paddingRight=e.padding.right+"px"),e.padding.bottom&&(n.style.paddingBottom=e.padding.bottom+"px"),e.padding.left&&(n.style.paddingLeft=e.padding.left+"px"))),e.borderRadius&&t.setElementBorderRadius({settings:e,elem:n}),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:n}),r=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:n}),r=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:n}),r=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:n}),r=!0),e.mobileAlign&&(t.setElementMobileAlign({settings:e,elem:n}),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.mobileDirection&&(t.setElementMobileDirection({settings:e,elem:n}),r=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:n}),r=!0),e.mobileBackgroundImage&&(t.setElementMobileBackgroundImage({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY({settings:e,elem:n}),r=!0),e.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat({settings:e,elem:n}),r=!0);const o=e;return o.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:o,elem:n}),r=!0),e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),ga(n,e,"inside"),r}function Ip(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Ip({elem:e.elem.previousSibling,width:e.width})}function bX(e,t){const n=t.activeElement;let r=!1;if(!e)return r;e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align?n.setAttribute("align",e.align):e.align===""&&n.removeAttribute("align"),e.width&&(e.width.value?(n.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),n.style.width=e.width.value+e.width.dim,e.width.dim==="px"&&Ip({elem:n,width:e.width.value})):(n.removeAttribute("width"),n.style.removeProperty("width"))),e.maxWidth&&(e.maxWidth.value?(n.style.maxWidth=e.maxWidth.value+e.maxWidth.dim,Ip({elem:n,width:e.maxWidth.value})):n.style.removeProperty("max-width")),e.minWidth&&(e.minWidth.value?n.style.minWidth=e.minWidth.value+e.minWidth.dim:n.style.removeProperty("min-width")),e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(n.removeAttribute("bgcolor"),n.style.removeProperty("background-color")):(n.setAttribute("bgcolor",e.backgroundColor),n.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(n.style.removeProperty("background-image"),n.removeAttribute("background")):(n.style.removeProperty("background-image"),n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",Ht(n,"background",yX(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?n.style.removeProperty("background-position-x"):n.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?n.style.removeProperty("background-position-y"):n.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?n.style.removeProperty("background-repeat"):n.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?n.style.removeProperty("background-size"):n.style.backgroundSize=e.backgroundSize),e.borderRadius&&t.setElementBorderRadius({settings:e,elem:n}),e.mobileAlign&&(t.setElementMobileTableAlign({settings:e,elem:n}),r=!0),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:n}),r=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:n}),r=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:n}),r=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:n}),r=!0),e.mobileBackgroundImage&&(t.setElementMobileBackgroundImage({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY({settings:e,elem:n}),r=!0),e.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat({settings:e,elem:n}),r=!0);const o=e;return o.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:o,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),ga(n,e,"around"),r}function yX(e){return e.backgroundImage?.[0]?.value??""}function ka(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}function vX(e,t){const n=t.activeElement;let r=!1;if(!e)return r;if(typeof e.linkHref=="string"){const i=document.querySelector("[em-edit]"),s=i?.tagName==="A"?i:i?.closest("a")??n.querySelector("a");s&&(s.setAttribute("href",e.linkHref),ka(e.linkHref)&&s.removeAttribute("target"))}if(e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align){n.style.textAlign?n.style.textAlign=e.align:n.setAttribute("align",e.align);const i=n.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(s=>{s.querySelector(":scope > tr > td")?.setAttribute("align",e.align);const a=s.querySelector('div[style*="font-family"][style*="font-size"]');a?.hasAttribute("align")&&a.setAttribute("align",e.align)})}else if(e.align===""){n.style.textAlign?n.style.removeProperty("text-align"):n.removeAttribute("align");const i=n.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(a=>{a.querySelector(":scope > tr > td")?.removeAttribute("align")});const s=n.closest("table");if(s?.getAttribute("em")==="atom"){const a=s.querySelector('div[style*="font-family"][style*="font-size"]');a?.hasAttribute("align")&&a.removeAttribute("align")}}if(e.valign?(n.setAttribute("valign",e.valign),n.querySelectorAll('div[style*="display"]').forEach(i=>i.style.verticalAlign=e.valign)):e.valign===""&&n.removeAttribute("valign"),e.width){const i=n.closest("table");i?.getAttribute("em")==="atom"?e.width.value?i.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):i.removeAttribute("width"):e.width.value?n.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):n.removeAttribute("width")}if(e.height)if(e.height.value){n.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),n.style.height=e.height.value+e.height.dim;const i=n.firstElementChild;i?.tagName==="A"&&i.style.display==="block"&&(i.style.height=e.height.value+e.height.dim,i.style.lineHeight=e.height.value+e.height.dim)}else n.removeAttribute("height"),n.style.removeProperty("height");if(e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(n.removeAttribute("bgcolor"),n.style.removeProperty("background-color")):(n.setAttribute("bgcolor",e.backgroundColor),n.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(n.style.removeProperty("background-image"),n.removeAttribute("background")):(n.style.removeProperty("background-image"),n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",Ht(n,"background",wX(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?n.style.removeProperty("background-position-x"):n.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?n.style.removeProperty("background-position-y"):n.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?n.style.removeProperty("background-repeat"):n.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?n.style.removeProperty("background-size"):n.style.backgroundSize=e.backgroundSize),e.direction&&e.direction!=="none"?(n.setAttribute("dir",e.direction),e.direction==="rtl"&&n.querySelectorAll("td").forEach(i=>{for(let s=i.firstChild;s;s=s.nextSibling)if(s.nodeType===3){s.parentNode?.setAttribute("dir","ltr");break}})):(e.direction===""||e.direction==="none")&&(n.removeAttribute("dir"),n.querySelectorAll("[dir]").forEach(i=>i.removeAttribute("dir"))),e.padding){if(e.padding.all!==void 0)n.style.paddingTop=e.padding.all+"px",n.style.paddingRight=e.padding.all+"px",n.style.paddingBottom=e.padding.all+"px",n.style.paddingLeft=e.padding.all+"px",n.querySelectorAll(".em-vindent").forEach(l=>l.remove());else{if(e.padding.top!==void 0){n.style.paddingTop=e.padding.top+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingTop")&&l.remove()}if(e.padding.right!==void 0){n.style.paddingRight=e.padding.right+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingRight")&&l.remove()}if(e.padding.bottom!==void 0){n.style.paddingBottom=e.padding.bottom+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingBottom")&&l.remove()}if(e.padding.left!==void 0){n.style.paddingLeft=e.padding.left+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingLeft")&&l.remove()}}const i=n.querySelector(".em-mob-wrap"),s=n.parentElement?.getAttribute("em")==="block",a=e.padding.left!==void 0||e.padding.right!==void 0;i&&s&&a&&n.querySelectorAll(":scope > table").forEach(l=>t.setStructureBlocksWidth(l))}if(e.borderRadius&&t.setElementBorderRadius({settings:e,elem:n}),t.textStyleProperties.some(i=>e.hasOwnProperty(i))&&!t.isElementListContainer)try{t.toggleTextStyle(n,{settings:e})}catch{}if(t.isElementListContainer&&t.requestType!=="structure"&&t.requestType!=="column"&&t.textStyleProperties.some(i=>e.hasOwnProperty(i))&&SX(e,t),e.mobileWidth){const i=n.closest("table"),s=i?.getAttribute("em")==="atom";t.setElementMobileWidth({settings:e,elem:s?i:n}),r=!0}e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:n}),r=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:n}),r=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:n}),r=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:n}),r=!0),e.mobileAlign&&(EX(e,n,t),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.mobileDirection&&(t.setElementMobileDirection({settings:e,elem:n}),r=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:n}),r=!0),e.mobileBackgroundImage&&(t.setElementMobileBackgroundImage({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY({settings:e,elem:n}),r=!0),e.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat({settings:e,elem:n}),r=!0);const o=e;return o.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:o,elem:n}),r=!0),e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),"isContrastBlock"in e&&t.setContrastBlock({settings:e,elem:n}),ga(n,e,"inside"),r}function EX(e,t,n){n.setElementMobileAlign({settings:e,elem:t});const r=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";tj(t,(s,a)=>{nj(a,s,r),n.setElementMobileAlign({settings:e,elem:s})});function o(s){const a=s.querySelectorAll("table"),l=s.querySelector("table");a.length===1&&(l?.hasAttribute("width")&&l?.getAttribute("width")!=="100%"||!l?.hasAttribute("width"))&&n.setElementMobileTableAlign({elem:l,settings:{mobileAlign:{classNamePrefix:"em-mob-table_align-",value:e.mobileAlign.value}}})}const i=t.closest("table");i?.getAttribute("em")==="atom"?o(i):t.querySelectorAll('[em="atom"]').forEach(s=>o(s))}function SX(e,t){const n=t.activeElement,r=t.removeEditorTags(Rl(t.isElementListContainer)),o=t.addClassToSecondCell(r,"em-list-temp-class");Ii(n,n.tagName==="TR"?`<td em-edit="active">${o}</td>`:o);const i=window.getSelection();if(!i||i.rangeCount===0)return;let s=i.getRangeAt(0);const a=n.querySelectorAll(".em-list-temp-class");if(a.length>0){t.isProgrammaticSelection.value=!0;for(let l=0;l<a.length;l++){const c=a[l].querySelector("div");if(!c)continue;t.wrapEditor(c,!0),s=i.getRangeAt(0),s.selectNode(c),t.addNewRange(s);const u=c.innerHTML!==" "||c.innerHTML===" "&&(e.fontSize||e.textColor||e.lineHeight);if(t.textStyleProperties.some(d=>e.hasOwnProperty(d))&&u)try{t.toggleTextStyle(c,{settings:e})}catch{}}n.querySelectorAll(".em-list-temp-class").forEach(l=>l.classList.remove("em-list-temp-class")),n.removeAttribute("em-edit"),n.setAttribute("em-edit","active"),setTimeout(()=>{t.isProgrammaticSelection.value=!1},100),s=i.getRangeAt(0),s.selectNode(n),t.addNewRange(s)}}function wX(e){return e.backgroundImage?.[0]?.value??""}function Dp(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Dp({elem:e.elem.previousSibling,width:e.width})}function OT(e,t){let n=e.previousSibling;for(;n&&!(n.nodeName==="#comment"&&n.textContent?.includes("mso"));)n=n.previousSibling;const r=n?.textContent??"",o=r.lastIndexOf("<td");if(!n||o===-1)return;const i=r.slice(o),s=/\svalign="[^"]*"/i.test(i)?i.replace(/valign="[^"]*"/i,`valign="${t}"`):i.replace("<td",`<td valign="${t}"`);n.textContent=r.slice(0,o)+s}function _X(e,t){const n=t.activeElement;let r=!1;if(!e)return r;if(e.width){const o=e.gap?.value??0;if(e.width.value!==void 0&&e.width.value!==null)if(n.style.maxWidth)if(e.width.dim==="px"){const i=parseFloat(e.width.value+o),s=Math.round(parseFloat(e.width.value)/i*100);n.style.maxWidth=i+e.width.dim,Dp({elem:n,width:i}),n.firstElementChild?.tagName==="TABLE"&&(n.firstElementChild.setAttribute("width",e.width.value),n.firstElementChild.style.width=s+"%",n.firstElementChild.style.maxWidth=e.width.value+"px")}else n.style.width=parseFloat(e.width.value)+e.width.dim;else e.width.dim==="px"?(n.style.width=parseFloat(e.width.value+o)+e.width.dim,Dp({elem:n,width:parseFloat(e.width.value+o)}),n.firstElementChild?.tagName==="TABLE"&&n.firstElementChild.setAttribute("width",e.width.value)):n.style.width=parseFloat(e.width.value)+e.width.dim;else n.style.removeProperty("width")}if(e.gap&&!e.width){const o=parseFloat(e.gap.value??0);n.style.maxWidth?n.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const s=i,a=parseFloat(s.style.maxWidth),l=Math.round((a-o)/a*100);s.firstElementChild?.tagName==="TABLE"&&(s.firstElementChild.setAttribute("width",String(a-o)),s.firstElementChild.style.width=l+"%",s.firstElementChild.style.maxWidth=a-o+"px")}):n.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const s=i;s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",String(parseFloat(s.style.width)-o))})}return e.valign&&(n.style.verticalAlign=e.valign,OT(n,n.style.verticalAlign)),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileContentWidth&&(t.setElementMobileContentWidth({settings:e,elem:n.firstElementChild}),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),r}function Bp(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Bp({elem:e.elem.previousSibling,width:e.width})}function Au(e){return!!(e.querySelector(".em-mob-wrap")||e.closest(".em-mob-wrap")||e.querySelector(".noresp-em-mob-wrap")||e.closest(".noresp-em-mob-wrap"))}function ku(e){return e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement||null}function Hp(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function CX(e,t){const n=t.activeElement;if(Au(n)){const r=ku(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((o,i)=>{o.setAttribute("width",e.items[i])}),t.setPercentsForColumns(r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"))}else{const r=Hp(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach((o,i)=>{const s=o;s.style.width=e.items[i]+e.gap+"px",Bp({elem:s.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",e.items[i])})}}function TX(e,t){const n=t.activeElement;if(!Au(n))return;const r=n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement:n.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement;if(!r)return;const o=r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),i=o.length,s=e.items.length,a=e.gap;i>=s?o.forEach((l,c)=>{if(c<s)l.setAttribute("width",e.items[c]);else{const u=l.previousElementSibling;(u?.classList.contains("em-mob-wrap")||u?.classList.contains("noresp-em-mob-wrap"))&&u?.remove(),l.remove()}}):(o.forEach((l,c)=>{l.setAttribute("width",e.items[c])}),e.items.forEach((l,c)=>{let u="";r.querySelector(".em-mob-wrap")?u=`<td width="${a}" class="em-mob-wrap"></td>
|
|
93
|
+
<td width="${l}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:r.querySelector(".noresp-em-mob-wrap")&&(u=`<td width="${a}" class="noresp-em-mob-wrap"></td>
|
|
94
|
+
<td width="${l}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`),c>=i&&u&&tr(r,"beforeend",u)}))}function AX(e,t){const n=t.activeElement;if(Au(n)){const r=ku(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(o=>{o.setAttribute("valign",e.valign)})}else{const r=Hp(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach(o=>{o.style.verticalAlign=e.valign,OT(o,o.style.verticalAlign)})}}function kX(e,t){const n=t.activeElement;if(Au(n)){const r=ku(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((o,i)=>{o.setAttribute("width",e.items[i])}),t.setPercentsForColumns(r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)")),r.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(o=>{o.setAttribute("width",e.gap)})}else{const r=Hp(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach((o,i)=>{const s=o;s.style.width=e.items[i]+e.gap+"px",Bp({elem:s.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",e.items[i])})}}function LX(e,t){const n=t.activeElement;let r=!1;const o=ku(n);return o&&o.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(i=>{t.setElementMobileHeight({settings:e,elem:i}),r=!0}),r}var Fp="amp-img";function NX(e){const t=E0(e);return{src:t.src,alt:t.alt,title:t.title,width:t.width.value,height:t.height.value,link:t.link,imgReplacer:t.imgReplacer}}function RT(e){return e==null||e===""?null:Number(e)}function xX(e){return{src:e.src??"",alt:e.alt??"",title:e.title??"",width:RT(e.width?.value),height:RT(e.height?.value),link:e.link||null,imgReplacer:e.imgReplacer??""}}function $p(e,t,n){const r=e.closest(n);return r&&r!==t&&t.contains(r)?r:null}function OX(e,t){let n=e;for(;n.parentElement&&n.parentElement!==t;)n=n.parentElement;if(n.parentElement===t&&n.querySelectorAll(Fp).length<=1)return n;let r=e;for(;r.parentElement&&r.parentElement!==t&&(r.parentElement.tagName==="A"||r.parentElement.tagName==="EM-REPLACE");)r=r.parentElement;return r}function MT(e){e.replaceWith(...Array.from(e.childNodes))}function PT(e,t){e.parentNode?.insertBefore(t,e),t.appendChild(e)}function RX(e,t,n,r){if(r.src!==n.src&&Ht(e,"src",r.src),r.alt!==n.alt&&e.setAttribute("alt",r.alt),r.title!==n.title&&e.setAttribute("title",r.title),r.width!==n.width&&e.setAttribute("width",String(r.width??"")),r.height!==n.height&&e.setAttribute("height",String(r.height??"")),r.imgReplacer!==n.imgReplacer){const o=$p(e,t,"em-replace");if(!r.imgReplacer)o&&MT(o);else if(o)Ht(o,"src",r.imgReplacer);else{const i=document.createElement("em-replace");Ht(i,"src",r.imgReplacer),PT(e,i)}}if(r.link!==n.link){const o=$p(e,t,"a");if(!r.link)o&&MT(o);else if(o)o.setAttribute("href",r.link);else{const i=document.createElement("a");i.setAttribute("href",r.link),PT($p(e,t,"em-replace")??e,i)}}}function MX(e){const t=document.createElement(Fp);Ht(t,"src",e.src),t.setAttribute("alt",e.alt),t.setAttribute("title",e.title),t.setAttribute("width",String(e.width.value)),t.setAttribute("height",String(e.height.value)),t.setAttribute("layout","responsive");let n=t;if(e.imgReplacer){const r=document.createElement("em-replace");Ht(r,"src",e.imgReplacer),r.appendChild(t),n=r}if(e.link){const r=document.createElement("a");r.setAttribute("href",e.link),r.appendChild(n),n=r}return n}function PX(e){return e.some(t=>t.slideIndex!==void 0)?e.map(t=>t.slideIndex):e.map((t,n)=>n)}function IX(e,t){const n=Array.from(e.querySelectorAll(Fp)),r=new Set,o=[];PX(t).forEach((i,s)=>{const a=i===void 0?void 0:n[i];if(!a||r.has(a)){o.push(t[s]);return}r.add(a),RX(a,e,NX(a),xX(t[s]))}),n.filter(i=>!r.has(i)).forEach(i=>OX(i,e).remove()),o.forEach(i=>e.appendChild(MX(i)))}function DX(e,t){const n=e,r=t.activeElement.closest("amp-carousel");r&&IT(r,t,o=>BX(o,n,t))}function IT(e,t,n){sr(t.HTMLDocument.getOuterHtml(e),([r])=>{r instanceof Element&&(n(r),r.setAttribute("em-edit","active"),e.replaceWith(r))}),t.commit(!0)}function BX(e,t,n){typeof t.loop=="boolean"&&(t.loop?e.setAttribute("loop",""):e.removeAttribute("loop")),typeof t.autoplay=="boolean"&&(t.autoplay?e.setAttribute("autoplay",""):e.removeAttribute("autoplay")),Array.isArray(t.carouselImages)&&IX(e,t.carouselImages),"borderRadius"in t&&n.setElementBorderRadius({settings:{borderRadius:t.borderRadius},elem:e})}function HX(e,t){const n=e,r=t.activeElement.closest("amp-accordion");r&&IT(r,t,o=>FX(o,n))}function FX(e,t){t.animate?e.setAttribute("animate",""):e.removeAttribute("animate"),t.expandSingleSection?e.setAttribute("expand-single-section",""):e.removeAttribute("expand-single-section"),e.querySelectorAll("section").forEach((n,r)=>{t.sections[r]?.expanded?n.setAttribute("expanded",""):n.removeAttribute("expanded")})}var Xn={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function $X(e){return e.closest('table[em-type="social"]')}function DT(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r instanceof HTMLElement)return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r instanceof HTMLElement)return r}return null}function WX(e,t,n){const r=DT(e),o=DT(t);if(!(!r||!o)){for(const{name:i,value:s}of Array.from(r.attributes))i.toLowerCase()!=="align"&&o.setAttribute(i,s);o.setAttribute("align",n)}}function Kn(e){return String(e??"").replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function qX(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function zX(){const e=[typeof document<"u"?document.baseURI:"",typeof window<"u"?window.location?.href:""];for(const t of e)if(t)try{const n=new URL(t);if(n.protocol==="http:"||n.protocol==="https:")return n.href}catch{}return""}function UX(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=zX();if(!n)return t;try{return new URL(t,n).href}catch{return t}}function jX(e){return e>0?`<td width="${e}"> </td>`:""}function VX(e,t){const n=$X(t.activeElement);if(!n)return null;const r=Array.isArray(e.items)?e.items:[],o=e.align==="left"||e.align==="right"||e.align==="center"?e.align:Xn.align,i=typeof e.iconSize=="number"?e.iconSize:Xn.iconSize,s=typeof e.borderRadius=="number"?e.borderRadius:Xn.borderRadius,a=typeof e.gap=="number"?e.gap:Xn.gap,l=typeof e.bgEnabled=="boolean"?e.bgEnabled:Xn.bgEnabled,c=typeof e.bgColor=="string"?e.bgColor:Xn.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:Xn.borderWidth,d=typeof e.borderColor=="string"?e.borderColor:Xn.borderColor;let f=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:Xn.buttonBorderWidth;f=Math.max(0,Math.min(24,Math.round(f)));const h=typeof e.showLabel=="boolean"?e.showLabel:Xn.showLabel,m=[];u>0&&d&&m.push(`border:${u}px solid ${Kn(d)}`);const p=m.length?` style="${m.join(";")}"`:"",v=!!(l&&String(c).trim()),w=Math.max(0,Math.round(Number(a)||0)),_=r.length>1,A=`<table border="0" cellspacing="0" cellpadding="0">
|
|
95
|
+
<tr>${r.map(E=>{const T=Kn(E.platform||"unknown"),y=!!E.customIcon,S=Kn(E.href||""),C=String(E.title??"").trim(),L=C?` title="${Kn(C)}"`:"",x=Kn(E.alt||""),N=Kn(UX(E.iconSrc||"")),W=E.iconWidth!=null&&!Number.isNaN(Number(E.iconWidth))?Number(E.iconWidth):i,R=E.iconHeight!=null&&!Number.isNaN(Number(E.iconHeight))?Number(E.iconHeight):i,P=y?"":typeof E.buttonBgColor=="string"?E.buttonBgColor.trim():"",J=!y&&v&&!P?String(c).trim():"",ne=y?"":P||J,he=!y&&!!J,re=y?"":typeof E.itemBorderColor=="string"?E.itemBorderColor.trim():"",Z=!y&&!!(P||re&&f>0||he);let ve=`<a href="${S}" target="_blank"${L} draggable="false"><img src="${N}" width="${W}" height="${R}" border="0" alt="${x}" draggable="false" style="display:block;${!y&&!Z&&s>0?`border-radius:${s}px;`:""}" /></a>`;if(h&&(E.title||E.alt)){const oe=qX(String(E.title||E.alt||""));ve+=`<br/><span style="display:block;font-size:11px;line-height:1.2;margin-top:4px;max-width:96px;word-break:break-word;">${oe}</span>`}const de=[];ne&&de.push(`background-color:${Kn(ne)}`),re&&f>0&&de.push(`border:${f}px solid ${Kn(re)}`),Z&&s>0&&de.push(`border-radius:${s}px`);const _e=he?' em-tray-cell-bg="1"':"",ct=y?' em-custom-icon="1"':"",ee=ne&&/^#[0-9A-Fa-f]{3,8}$/.test(ne)?` bgcolor="${Kn(ne)}"`:"",q=_?' draggable="true"':"";return`<td em-platform="${T}"${ct}${_e}${ee}${de.length?` style="${de.join(";")}"`:""}${q}>${ve}</td>`}).filter(Boolean).reduce((E,T,y)=>(y>0&&E.push(jX(w)),E.push(T),E),[]).join("")}
|
|
96
|
+
</tr>
|
|
97
|
+
</table>`,b=`<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"${p}><tr><td align="${Kn(o)}">
|
|
98
|
+
${A}
|
|
99
|
+
</td></tr></table>`,g=Le(b,!0)[0];return g?(g instanceof HTMLTableElement&&WX(n,g,o),g.setAttribute("em-edit","active"),n.replaceWith(g),t.commit(!0),g):null}function GX(e,t){if(typeof e.textSuperscript!="boolean"&&typeof e.textSubscript!="boolean")return;const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0),o=r.commonAncestorContainer;if(o?.tagName==="TABLE")return;const i=o.nodeType===1?o:o.parentElement;if(!i)return;function s(a,l){const c=i.closest(a),u=a==="sup"?"sub":"sup",d=i.closest(u);if(l){let f=!0;if(c&&t.isRangeMatching(c,r,r.collapsed))f=!1;else if(d)if(t.isRangeMatching(d,r,r.collapsed)){const h=t.unwrapTag(d);r.selectNodeContents(h)}else{const h=t.splitWrapper(d,r);r.selectNodeContents(h),setTimeout(()=>n.removeAllRanges(),100)}else if(c){const h=t.splitWrapper(c,r);r.selectNodeContents(h)}if(f)if(r.collapsed){const h=r.cloneRange();try{r.expand("word");const m=r.toString().trim();if(m){const p=t.wrapInTag(r,m,a),v=document.createRange();v.selectNodeContents(p),n.removeAllRanges(),n.addRange(v),t.cleanEmptyTags(p.parentNode)}else r.setStart(h.startContainer,h.startOffset),r.setEnd(h.endContainer,h.endOffset)}catch{r.setStart(h.startContainer,h.startOffset),r.setEnd(h.endContainer,h.endOffset)}}else{const h=r.cloneContents(),m=document.createElement("div");m.appendChild(h),nn(r.commonAncestorContainer,m),t.unwrapNestedTags(m,a);const p=t.wrapInTag(r,m,a),v=document.createRange();v.selectNodeContents(p),n.removeAllRanges(),n.addRange(v),t.cleanEmptyTags(p.parentNode)}}else if(r.collapsed)if(c){const f=c.parentNode,h=t.unwrapTag(c),m=document.createRange();m.selectNodeContents(h),n.removeAllRanges(),n.addRange(m),t.cleanEmptyTags(f),c.parentNode||setTimeout(()=>n.removeAllRanges(),0)}else{const f=r.startContainer.parentElement?.closest(a);if(f){const h=t.unwrapTag(f),m=document.createRange();m.selectNodeContents(h),n.removeAllRanges(),n.addRange(m),t.cleanEmptyTags(f.parentNode)}}else{let f=[];const h=r.cloneContents(),m=document.createElement("div");if(m.appendChild(h),nn(r.commonAncestorContainer,m),f=Array.from(m.querySelectorAll(a)),c){const w=Array.from(c.childNodes).some(b=>b.nodeType===1),_=t.unwrapTag(c),A=document.createRange();if(_.isConnected)A.selectNodeContents(_),n.removeAllRanges(),n.addRange(A);else{const b=c.parentNode;b&&(A.selectNodeContents(b),n.removeAllRanges(),n.addRange(A))}w&&t.applicationElementSettingsSet({elem:document.querySelector("[em-edit]")}),t.commit();return}else{const w=r.commonAncestorContainer.parentElement?.closest(a)||r.startContainer.parentElement?.closest(a);w&&f.push(w)}f.length>0&&f.forEach(w=>{w.parentNode&&t.unwrapTag(w)});const p=m.cloneNode(!0);nn(m,p);const v=p.querySelector('[em-edit="active"]');if(v){r.deleteContents(),r.insertNode(v);const w=document.createRange();w.selectNodeContents(v),n.removeAllRanges(),n.addRange(w),t.cleanEmptyTags(v.parentNode)}}t.commit()}typeof e.textSuperscript=="boolean"&&s("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&s("sub",e.textSubscript)}function XX(e,t){if(e!==void 0){if(e===""){KX(t.activeElement);return}YX(e,t)}}function KX(e){const t=e?.closest("em-replace")||e?.querySelector("em-replace");if(!t)return;const n=t.parentNode,r=t.firstChild,o=t.lastChild;if(t.getAttribute("text")!==t.innerHTML)for(;t.firstChild;)n?.insertBefore(t.firstChild,t);const i=document.createRange(),s=window.getSelection();r&&o&&s&&(i.setStartBefore(r),i.setEndAfter(o),s.removeAllRanges(),s.addRange(i)),t.remove()}function YX(e,t){const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0),o=e.replace(/~~.*$/,""),i=r.commonAncestorContainer,s=i.nodeType===1?i:i.parentElement;let a=s?.closest("em-replace");const l=/~~/.test(e)&&a;if(l){const c=e.replace(/~~.*$/,"");s?.setAttribute("text",c),s&&(s.innerHTML=c)}if(!a&&n.rangeCount>0&&!r.collapsed){const c=document.querySelectorAll("em-replace");if(a=Array.prototype.find.call(c,u=>u.textContent?.trim()===n.toString().trim()&&n.toString().trim()!==""),!a){const u=document.querySelector('[em-edit="active"]');u?.textContent===r.toString()&&r.selectNodeContents(u);const d=e.replace(/~~.*$/,""),f=document.createElement("em-replace");f.setAttribute("text",d),r.surroundContents(f)}}if(!a&&n.rangeCount>0&&r.collapsed){let c=document.querySelector("em-replace");if(c){const u=document.querySelectorAll("em-replace"),d=/~$/;a=Array.prototype.find.call(u,f=>{const h=e,m=f.textContent||"";return h.length===1&&d.test(m)?!0:t.compareStrings(m,h)}),a&&(a.setAttribute("text",e),a.textContent=e),a||(c=document.createElement("em-replace"),c.setAttribute("text",o),r.insertNode(c),c.innerHTML=o,r.collapse(!1))}else c=document.createElement("em-replace"),c.setAttribute("text",o),r.insertNode(c),c.innerHTML=o,r.collapse(!1)}a&&!l&&(a.getAttribute("text")===a.innerHTML&&(a.innerHTML=e),a.setAttribute("text",e))}function ZX(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function BT(e){const t=e.commonAncestorContainer,n=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest?.("a[name]");if(!n)return null;try{const r=document.createRange();return r.selectNodeContents(n),e.compareBoundaryPoints(Range.START_TO_START,r)>=0&&e.compareBoundaryPoints(Range.END_TO_END,r)<=0?n:null}catch{return null}}function QX(e,t){if(!e||!t)return;const n=document.createRange(),r=window.getSelection();if(r)try{if(!e.isConnected||!t.isConnected)return;n.setStartBefore(e),n.setEndAfter(t),r.removeAllRanges(),r.addRange(n)}catch{}}function JX(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function eK(e,t){const n=window.getSelection(),r=n?.rangeCount?n.getRangeAt(0):null;if(e===void 0||!e.trim()){let i=null;if(r&&!r.collapsed&&(i=BT(r)),i||(i=t.activeElement?.closest?.("a[name]")),i){const s=i.firstChild,a=i.lastChild;JX(i),t.commit(),QX(s,a)}return}const o=ZX(e);if(o&&!(!n||!r||r.collapsed))try{const i=BT(r);if(i){i.setAttribute("name",o),t.commit();return}const s=document.createElement("a");s.setAttribute("name",o);const a=r.extractContents();s.appendChild(a),r.insertNode(s);const l=document.createRange();l.selectNodeContents(s),n.removeAllRanges(),n.addRange(l),t.commit()}catch{}}var Pe=e=>zl(e?.innerText);function tK(e,t){return e.hasOwnProperty("textStrong")?{name:"textStrong",tags:["b","strong","a","[style*=font-weight]"],value:e.textStrong,command:"bold"}:e.hasOwnProperty("textItalic")?{name:"textItalic",tags:["em","i","[style*=font-style]","a"],value:e.textItalic,command:"italic"}:e.hasOwnProperty("textStrikethrough")?{name:"textStrikethrough",tags:["s","strike","u","[style*=text-decoration]","a"],value:e.textStrikethrough,command:"strikethrough"}:e.hasOwnProperty("textUnderline")?{name:"textUnderline",tags:["u","strike","[style*=text-decoration]","span","a"],value:e.textUnderline,command:"underline"}:e.hasOwnProperty("textColor")?{name:"textColor",tags:["a","[style*='color']","span"],value:t(e.textColor)||"",command:"foreColor"}:e.hasOwnProperty("textBackgroundColor")?{name:"textBackgroundColor",tags:["a","[style*='background-color']","[style*='color']","span"],value:t(e.textBackgroundColor)||"",command:"hilitecolor"}:e.hasOwnProperty("fontFamily")?{name:"fontFamily",tags:["[style*='font-family']","span","a"],value:e.fontFamily?.[e.fontFamily.length-1],command:"fontName"}:e.hasOwnProperty("textLink")?{name:"textLink",tags:["a","[href]","div","p","td"],value:e.textLink||"",command:"createLink"}:e.hasOwnProperty("fontSize")?{name:"fontSize",tags:["a","[style*='font-size']","span","div"],value:parseFloat(e.fontSize),command:"fontSize"}:e.hasOwnProperty("lineHeight")?{name:"lineHeight",tags:["div","[style*='line-height']","p","td"],value:parseFloat(e.lineHeight),command:null}:{}}function nK(e,t){if(!e?.rangeCount)return;const n=e.getRangeAt(0),r=n.commonAncestorContainer;let o=n.startOffset,i=n.endOffset;const s=r.data;if(!s)return;for(;o>0&&!/\s/.test(s[o-1]);)o--;for(;i<s.length&&!/\s/.test(s[i]);)i++;const a=document.createRange();a.setStart(r,o),a.setEnd(r,i),t(a)}var rK=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,oK=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,Wp=e=>e.toString(16).padStart(2,"0");function iK(e){const t=oK.exec(e)?.groups;if(!t)return;const n=Number.parseInt(t.r,10),r=Number.parseInt(t.g,10),o=Number.parseInt(t.b,10);if(![n,r,o].some(i=>!Number.isFinite(i)||i<0||i>255))return`#${Wp(n)}${Wp(r)}${Wp(o)}`}function HT(e){return e.split("").map(t=>`${t}${t}`).join("")}function Yn(e,t){if(!e)return;const n=e.trim();if(!n)return;if(rK.test(n)){const o=n.slice(1);return o.length===3?`#${HT(o).toLowerCase()}`:o.length===4?`#${HT(o.slice(0,3)).toLowerCase()}`:o.length===8?`#${o.slice(0,6).toLowerCase()}`:`#${o.toLowerCase()}`}const r=iK(n);if(r)return r;if(t){const o=t(n);if(o&&o!==n)return Yn(o)}}function sK(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function qp(e,t,n){const r=t.parentElement;let o=e.parentElement;for(;o&&o!==r;){const i=Yn(o.style.color,n);if(i)return i;o=o.parentElement}}function aK(e,t){Array.from(e.querySelectorAll("span")).reverse().forEach(n=>{if(!n.style.color)return;const r=Yn(n.style.color,t);if(!r)return;const o=qp(n,e,t);!o||o!==r||(n.style.removeProperty("color"),n.getAttribute("style")||n.removeAttribute("style"),n.attributes.length===0&&sK(n))})}function lK(e){const t=e.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?e.commonAncestorContainer:e.commonAncestorContainer.parentElement;if(!t)return[];if(e.commonAncestorContainer.nodeType===Node.TEXT_NODE){const o=e.commonAncestorContainer;return o.data.trim()?[o]:[]}const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null),r=[];for(;n.nextNode();){const o=n.currentNode;!o.data.trim()||!e.intersectsNode(o)||r.push(o)}return r}function cK(e,t,n){const r=Yn(t,n);if(!r)return!1;const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const i=o.getRangeAt(0);if(i.collapsed||!i.toString().trim())return!1;const s=lK(i);if(!s.length||s.every(c=>{const u=c.parentElement;return u?Yn(u.style.color,n)===r?!0:qp(u,e,n)===r:!1}))return!1;const a=document.createElement("span");a.style.color=t;try{i.surroundContents(a)}catch{a.appendChild(i.extractContents()),i.insertNode(a)}const l=document.createRange();return l.selectNodeContents(a),o.removeAllRanges(),o.addRange(l),!0}function uK(e,t,n){const r=Array.from(e.querySelectorAll('a[style*="color"]'));e.tagName==="A"&&e.style.color&&r.unshift(e),r.forEach(o=>{const i=Yn(o.style.color,t);if(!i)return;const s=qp(o,e,t)||(n?Yn(n,t):void 0);s&&Array.from(o.querySelectorAll("span")).forEach(a=>{if(!a.style.color)return;const l=Yn(a.style.color,t);l&&l!==i&&l===s&&(a.style.color=o.style.color)})})}function dK(e){if(e.currentSettings.name!=="lineHeight")return!1;const t=e.parentElement.closest('[style*="line-height"]')||e.parentElement.closest("div, p, td");if(e.parentElement?.querySelector('[em-edit="active"]')){const n=[];e.checkForTextNodes(e.parentNode,n),n.forEach(r=>{const o=r.closest('[style*="line-height"]')||r.closest("div, p, td");o&&(o.style.lineHeight=e.currentSettings.value+"px")})}else if(e.isElementList){const n=!!e.parentElement.querySelector("div"),r=n?e.parentElement.closest("tr")?.querySelector(`.${e.classNameBullet}`):null;if(r&&(r.style.lineHeight=e.currentSettings.value+"px"),n){const o=e.parentElement.querySelector("div");o&&(o.style.lineHeight=e.currentSettings.value+"px")}else e.parentElement.style.lineHeight=e.currentSettings.value+"px"}else t&&(t.style.lineHeight=e.currentSettings.value+"px");return e.commit(),!0}function fK(e){if(e.currentSettings.name!=="fontFamily")return!1;let t=(e.findElementWithSelectedText(e.selectedText)||e.getParentElementOfSelection())?.closest('[style*="font-family"]')||e.parentWrapper;const n=!!e.parentElement?.querySelector('[em-edit="active"]');if(!n&&(!e.range?.collapsed||e.getSelectedText()))if(e.getInnerText(e.parentWrapper)===e.selectedText)t=e.parentWrapper;else if(e.getInnerText(e.parentElement)===e.selectedText)t=e.parentElement;else{const o=document.createElement("span");e.range.commonAncestorContainer.nodeType===3?e.range.surroundContents(o):(o.appendChild(e.range.extractContents()),e.range.insertNode(o)),t=o,e.range.deleteContents(),e.range.insertNode(t),e.range.selectNode(t),e.addNewRange(e.range)}e.fontFamilyArray?e.fontFamilyArray[0]==="Safe Fonts"?(t.style.fontFamily=e.fontFamilyArray[1],e.removeClassesByPrefix(t,"em-font"),e.clearLinkTags({elem:document.documentElement})):e.fontFamilyArray[0]==="Google Fonts"&&(e.fontFamilyArray[1]==="Sans Serif"?t.style.fontFamily="Helvetica, Arial, sans-serif":e.fontFamilyArray[1]==="Serif"?t.style.fontFamily='"Times New Roman", Times, serif':e.fontFamilyArray[1]==="Project Fonts"&&Vc(t,e.fontFamilyArray[2]),e.removeClassesByPrefix(t,"em-font"),t.classList.add(e.createFontClassName(e.fontFamilyArray)),Ih(t,e.fontFamilyArray),e.addFontFamilyClass({fontFamilyArray:e.fontFamilyArray})):t.style.removeProperty("font-family");let r;return n?(r=e.parentElement.querySelectorAll('[style*="font-family"]'),r.forEach(o=>o.style.fontFamily=t.style.fontFamily)):(r=t.querySelectorAll('[style*="font-family"]'),r.forEach(o=>o.style.fontFamily="")),e.cleanEmptySpans(e.selectedText),e.refreshElementSettings(t,e.selectedText),e.range.selectNode(t),e.addNewRange(e.range),e.commit(),!0}function mK(e){if(e.currentSettings.command==="bold"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const t=[];e.checkForTextNodes(e.parentNode,t),t.filter(n=>e.checkForWorkClass(n)).forEach(n=>{const r=n.parentElement??n;ke(n,e.removeFormattingTags(Ue(n),"bold")),rn(n),n.tagName!=="STRONG"?e.currentSettings.value&&ke(n,"<strong>"+Ue(n)+"</strong>"):e.currentSettings.value||Ji(n,Ue(n)),rn(r)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");if(jt(n,t),t.parentNode?.replaceChild(n,t),e.getInnerText(n)===e.selectedText){const r=n.closest("span");r?.textContent===n.innerText&&!r.getAttribute("style")&&r.childNodes[0]?.nodeType===3&&r.parentNode?.replaceChild(n,r),e.refreshElementSettings(n,e.selectedText),e.range.selectNode(n),e.addNewRange(e.range)}});else if(Array.from(e.parentWrapper?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");jt(n,t),t.parentNode?.replaceChild(n,t)}),e.getInnerText(e.parentWrapper)===e.selectedText){const t=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);t&&(e.range.selectNode(t),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function hK(e){if(e.currentSettings.command==="italic"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const t=[];e.checkForTextNodes(e.parentNode,t),t.filter(n=>e.checkForWorkClass(n)).forEach(n=>{const r=n.parentElement??n;ke(n,e.removeFormattingTags(Ue(n),"italic")),rn(n),n.tagName!=="EM"?e.currentSettings.value&&ke(n,"<em>"+Ue(n)+"</em>"):e.currentSettings.value||Ji(n,Ue(n)),rn(r)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");if(jt(n,t),t.parentNode?.replaceChild(n,t),e.getInnerText(n)===e.selectedText){const r=n.closest("span");r?.textContent===n.innerText&&!r.getAttribute("style")&&r.childNodes[0]?.nodeType===3&&r.parentNode?.replaceChild(n,r),e.refreshElementSettings(n,e.selectedText),e.range.selectNode(n),e.addNewRange(e.range)}});else if(Array.from(e.parentElement?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");jt(n,t),t.parentNode?.replaceChild(n,t)}),e.getInnerText(e.parentWrapper)===e.selectedText){const t=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);t&&(e.range.selectNode(t),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function pK(e){if(e.currentSettings.name!=="fontSize")return;const{mutableState:t}=e;if(e.getInnerText(t.parentWrapper)!==e.selectedText){let i=!1;const s=e.findParentWithFontSizeAndTag(e.activeElement||t.parentNode)||t.parentWrapper;s&&s.style.fontSize.length&&(i=s.style.fontSize,s.style.fontSize=""),lr("fontSize",!1,"1"),i&&s&&(s.style.fontSize=i);const a=window.getSelection()?.getRangeAt(0).commonAncestorContainer;t.parentElement=t.parentNode.querySelector('[size="1"]')||(a?.nodeType===1?a:a?.parentElement),t.parentElement&&(t.parentElement.style.fontSize=e.currentSettings.value+"px")}let n=null;if(t.parentElement?.tagName==="FONT"){const i=document.createElement("span");jt(i,t.parentElement),t.parentElement.getAttribute("size")?(i.style.fontSize=e.currentSettings.value+"px",i.removeAttribute("size")):Array.from(t.parentElement.attributes).forEach(s=>i.setAttribute(s.name,s.value)),t.parentElement.parentNode?.replaceChild(i,t.parentElement),e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range)}if((e.activeElement.tagName==="A"||e.activeElement.closest("a"))&&(t.parentWrapper=e.activeElement.closest("a")),e.getInnerText(t.parentWrapper)===e.selectedText){if(Array.from(t.parentWrapper?.getElementsByTagName("span")||[]).forEach(s=>s.style.fontSize=""),!t.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&t.parentWrapper&&e.isProgrammaticSelection){const s=t.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);s&&(s.style.fontSize=e.currentSettings.value+"px")}t.parentWrapper&&(t.parentWrapper.style.fontSize=e.currentSettings.value+"px");const i=t.parentWrapper?.firstChild;i?.nodeType===1&&i.tagName==="SPAN"&&i.innerText===e.selectedText&&(i.style.fontSize="")}else t.parentWrapper?.style.hasOwnProperty("font-size")&&(n=t.parentWrapper.style.fontSize,n&&t.parentWrapper.style.removeProperty("font-size"));n&&t.parentWrapper&&(t.parentWrapper.style.fontSize=n);const r=Array.from(t.parentNode?.querySelectorAll("font")||[]).reverse(),o=[];e.isEditorTagOutside?e.currentSettings.value||(t.selection=window.getSelection(),t.range=t.selection.getRangeAt(0),t.parentNode=t.selection.anchorNode?.nodeType===1?t.selection.anchorNode:t.selection.anchorNode?.parentElement,t.parentNode&&t.parentNode.style.removeProperty(e.currentStyle),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(t.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.style.fontSize=e.currentSettings.value+"px",i.querySelectorAll('[style*="font-size"]').forEach(s=>{s.tagName!=="A"?s.style.removeProperty("font-size"):s.style.fontSize=e.currentSettings.value+"px"})})),e.isEditorTagOutside&&r.forEach(i=>{const s=document.createElement("span");jt(s,i);const a=e.currentSettings.value+"px",l=i.children?.length===1&&i.firstChild?.nodeType===1?i.firstChild:null,c=[];if(e.checkForTextNodes(i,c),c.forEach(u=>{if(u.tagName==="FONT"){const d=document.createElement("span");jt(d,u),u.getAttribute("size")?d.style.fontSize=e.getInnerText(u)===e.selectedText?a:"":Array.from(u.attributes).forEach(f=>d.setAttribute(f.name,f.value)),u.parentNode?.replaceChild(d,u)}}),l)i.parentNode?.replaceChild(l,i);else if(i.getAttribute("size")&&i.parentNode){const u=document.createElement("span");jt(u,i),u.style.fontSize=a,i.parentNode.replaceChild(u,i)}if(!c.length&&i.tagName==="FONT"){const u=document.createElement("span");jt(u,i),i.parentNode?.replaceChild(u,i)}}),Array.from(document.getElementsByTagName("span")).reverse().forEach(i=>{e.getInnerText(i)===e.selectedText&&i.closest('[em-edit="active"]')&&(e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range))}),e.cleanEmptySpans(e.selectedText)}function gK(e){if(e.currentSettings.command!=="strikethrough")return;const{mutableState:t}=e;let n=e.getSelectedText(),r=null;if(!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{const s=i.parentElement??i;ke(i,e.removeFormattingTags(Ue(i),"strike")),rn(i),i.tagName!=="STRIKE"?e.currentSettings.value&&ke(i,"<strike>"+Ue(i)+"</strike>"):e.currentSettings.value||Ji(i,Ue(i)),rn(s)})}if(e.currentSettings.value===!0){let o=n;Array.from(document?.getElementsByTagName("strike")||[]).reverse().forEach(i=>{if(e.getInnerText(i)===o&&(e.getInnerText(i.parentNode)===o&&i.parentNode.tagName==="U"&&pd(i.parentNode),r=e.findElementWithSelectedText(o),r)){const s=e.findOutermostParentWithText(r,"A");s&&(s.style.textDecoration="none"),e.refreshElementSettings(r,o),t.range.selectNode(r),e.addNewRange(t.range)}})}else{let o=n;if(e.cleanEmptySpans(o),e.getInnerText(t.parentWrapper)===o){const i=window.getSelection();if(r=e.findElementWithSelectedText(o,e.activeElement),r&&(t.range.selectNode(r),e.addNewRange(t.range),t.range.cloneContents())){const s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||t.range.commonAncestorContainer;s&&e.request.type!=="button"&&e.refreshElementSettings(s,o)}if(i&&i.rangeCount>0&&e.isElementList&&!r){const s=i.getRangeAt(0);let a=s.commonAncestorContainer;a.nodeType!==Node.ELEMENT_NODE&&(a=a.parentNode),a.querySelectorAll("strike").forEach(l=>{pd(l)}),a.style.textDecoration="none",a.querySelectorAll('span[style*="text-decoration"]').forEach(l=>{l.style.textDecoration=""}),e.refreshElementSettings(a,o),s.selectNodeContents(a),i.removeAllRanges(),i.addRange(s),e.addNewRange(s)}}}if(e.request.type==="button"||e.activeElement.tagName==="A"){e.request.type!=="button"&&e.activeElement.tagName==="A"&&(t.parentWrapper=e.activeElement);let o=n;if(e.getInnerText(t.parentWrapper)===o&&t.parentWrapper)t.parentWrapper.style.textDecoration=e.currentSettings.value?"line-through":"none",Array.from(t.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),ke(t.parentWrapper,e.removeFormattingTags(Ue(t.parentWrapper),"strikeUnderline")),rn(t.parentWrapper),e.refreshElementSettings(t.parentWrapper,o),t.range.selectNode(t.parentWrapper),e.addNewRange(t.range);else{const i=t.selection.getRangeAt(0),s=document.createElement("span");s.style.textDecoration=e.currentSettings.value?"line-through":"none",e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN"?(e.activeElement.style.textDecoration=e.activeElement.style.textDecoration==="line-through"?"none":"line-through",Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(a=>a.style.textDecoration=""),e.refreshElementSettings(e.activeElement,o)):(s.appendChild(i.extractContents()),Array.from(s.querySelectorAll('span[style*="text-decoration"]')).forEach(a=>a.style.textDecoration=""),i.insertNode(s),r=s,e.refreshElementSettings(s,o),e.addNewRange(i))}}if(t.range.cloneContents()){if(t.range=t.selection.getRangeAt(0),r&&e.getInnerText(r)===n)t.range.selectNode(r),e.addNewRange(t.range);else{const o=t.range.commonAncestorContainer,i=o.nodeType===1?o:o.parentElement,s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||i;s&&e.getInnerText(s)===n&&(t.range.selectNode(s),e.addNewRange(t.range))}r&&e.refreshElementSettings(r,n)}}function bK(e){if(e.currentSettings.command!=="underline")return;const{mutableState:t}=e,n=o=>{const i=o.parentNode;if(i){for(;o.firstChild;)i.insertBefore(o.firstChild,o);i.removeChild(o)}},r=o=>{o.querySelectorAll("u").forEach(i=>{n(i)}),o.querySelectorAll('span[style*="text-decoration"], span[style*="text-decoration-line"]').forEach(i=>{i.style.removeProperty("text-decoration"),i.style.removeProperty("text-decoration-line"),i.getAttribute("style")||i.removeAttribute("style"),i.attributes.length===0&&n(i)})};if(!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{const s=i.parentElement??i;ke(i,e.removeFormattingTags(Ue(i),"underline")),rn(i),i.tagName!=="U"?e.currentSettings.value&&ke(i,"<u>"+Ue(i)+"</u>"):e.currentSettings.value||Ji(i,Ue(i)),rn(s)})}if(e.currentSettings.value){const o=Array.from(e.findOutermostParentWithText(e.parentElement)?.getElementsByTagName("u")||[]).reverse();o.push(...Array.from(e.findOutermostParentWithText(e.parentElement)?.querySelectorAll("a,span[style*=text-decoration]")||[]).reverse()),o.filter(i=>e.getInnerText(i)===e.selectedText).forEach(i=>{if(e.selectedText&&e.getInnerText(i)===e.selectedText){i.style.textDecoration="underline";const s=i.firstChild;s?.tagName==="STRIKE"&&e.getInnerText(s)===e.selectedText&&[...s.attributes].forEach(a=>{i.setAttribute(a.name,a.value),s.removeAttribute(a.name)}),e.cleanStrikesInElement(i,e.getParentElementOfSelection())}}),e.cleanEmptySpans(e.selectedText),e.getInnerText(e.parentElement)===e.selectedText&&e.cleanStrikesInElement(e.parentElement,e.getParentElementOfSelection())}else{const o=e.findElementWithSelectedText(e.selectedText,e.activeElement);if(!o&&e.isElementList){let i=null;const s=window.getSelection();if(s&&s.rangeCount>0){let l=s.getRangeAt(0).commonAncestorContainer;for(l.nodeType!==Node.ELEMENT_NODE&&(l=l.parentNode);l&&l!==e.activeElement&&!["DIV"].includes(l.tagName);)l=l.parentNode;l&&l.contains(e.activeElement)&&(i=l)}const a=i?e.findOutermostParentWithText(i,"A"):null;a&&(a.style.textDecoration="none"),e.getInnerText(t.parentWrapper)===e.selectedText&&i&&(e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range))}else{const i=e.findOutermostParentWithText(o,"A");i&&(i.style.textDecoration="none"),e.getInnerText(t.parentWrapper)===e.selectedText&&o&&(e.refreshElementSettings(o,e.selectedText),t.range.selectNode(o),e.addNewRange(t.range))}}if(e.request.type==="button"||e.activeElement.tagName==="A")if(e.request.type!=="button"&&e.activeElement.tagName==="A"&&(t.parentWrapper=e.activeElement),e.getInnerText(t.parentWrapper)===e.selectedText&&t.parentWrapper)t.parentWrapper.style.textDecoration=e.currentSettings.value?"underline solid":"none",Array.from(t.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(o=>o.style.textDecoration=""),e.cleanStrikesInElement(t.parentWrapper,e.getParentElementOfSelection());else{const o=t.selection.getRangeAt(0);if(e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN")e.currentSettings.value?e.activeElement.style.textDecoration="underline":(e.activeElement.style.removeProperty("text-decoration"),e.activeElement.style.removeProperty("text-decoration-line")),Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),e.activeElement.getAttribute("style")||e.activeElement.removeAttribute("style"),e.refreshElementSettings(e.activeElement,e.selectedText);else if(e.activeElement.tagName!=="A")if(e.currentSettings.value){const i=document.createElement("span");i.style.textDecoration="underline",i.appendChild(o.extractContents()),Array.from(i.querySelectorAll('span[style*="text-decoration"]')).forEach(s=>s.style.textDecoration=""),e.refreshElementSettings(i,e.selectedText),o.insertNode(i),e.addNewRange(o)}else{const i=o.extractContents(),s=document.createElement("span");s.appendChild(i),r(s);const a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);o.insertNode(a),e.addNewRange(o)}}}function yK(e){if(!e.isColorChange)return;const{mutableState:t}=e;let n=[];if(e.tempColor&&t.parentWrapper&&(t.parentWrapper.style[e.stylePropretyName]=e.tempColor,!t.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&t.parentWrapper&&e.isProgrammaticSelection)){const s=t.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);s&&(s.style[e.stylePropretyName]=e.tempColor)}if(e.outerContextColor&&e.outerContextElement&&(e.outerContextElement.style.color=e.outerContextColor),e.getInnerText(t.parentWrapper)===e.selectedText&&t.parentWrapper){const s=e.rgbToHex(e.currentSettings.value?.toString())||"";if(e.currentStyle==="color"){const a=(e.parentElement||t.parentNode).closest("a");e.request.type==="button"||a?a&&(a.style.color=s,a.querySelectorAll('span[style*="color"]').forEach(l=>l.style.color="")):(t.parentWrapper.style.color=s,e.canselExecCommand&&(e.setCustomColor(t.parentWrapper,e.stylePropretyName,e.currentSettings.value),t.range.selectNode(t.parentWrapper),e.addNewRange(t.range)),t.parentWrapper.querySelectorAll(":not(a)").forEach(l=>{l.style.color&&e.getInnerText(l)===e.selectedText&&(l.style.color="")}))}else if(!e.canselExecCommand){const a=document.createElement("span");a.style[e.stylePropretyName]=s;const l=t.parentWrapper.firstChild;if(l?.nodeType===1&&l.tagName==="SPAN"&&e.getInnerText(l)===e.selectedText)l.style[e.stylePropretyName]=s;else{for(;t.parentWrapper.firstChild;)a.appendChild(t.parentWrapper.firstChild);t.parentWrapper.appendChild(a)}}t.parentWrapper.querySelectorAll(`span[style*="${e.stylePropretyName}"]`).forEach(a=>{a.innerText!==t.parentWrapper.innerText&&a.style.removeProperty(e.stylePropretyName)})}e.isEditorTagOutside?!e.currentSettings.value&&t.selection.isCollapsed&&(t.parentNode=t.selection.anchorNode?.nodeType===1?t.selection.anchorNode:t.selection.anchorNode?.parentElement,t.parentNode&&t.parentNode.style.removeProperty(e.stylePropretyName),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(t.parentNode,n),n.forEach(s=>{s.classList&&s.classList.contains(e.classNameBullet)||e.checkForWorkClass(s)&&(s.style[e.stylePropretyName]=e.currentSettings.value,s.querySelectorAll(`[style*="${e.stylePropretyName}"]`).forEach(a=>{a.tagName!=="A"?a.style.removeProperty(e.currentStyle):a.style[e.stylePropretyName]=e.currentSettings.value}))}));const r=Array.from(t.parentNode?.querySelectorAll("font")||[]).reverse();e.isEditorTagOutside&&r.forEach(s=>{const a=document.createElement("span");jt(a,s);const l=s.getAttribute(e.currentStyle),c=e.rgbToHex(l||"").toString(),u=s.children.length===1&&s.firstChild?.nodeType===1?s.firstChild:null;let d=[];if(e.checkForTextNodes(s,d),d.forEach(f=>{if(f.tagName==="FONT"){const h=document.createElement("span");jt(h,f),h.style[e.stylePropretyName]=c,f.parentNode?.replaceChild(h,f),e.refreshElementSettings(h,e.selectedText),t.range.selectNode(h),e.addNewRange(t.range)}else f.style[e.stylePropretyName]=c}),u)s.parentNode?.replaceChild(u,s);else if(s.getAttribute(e.currentStyle)&&s.parentNode){const f=document.createElement("span");jt(f,s),f.style[e.stylePropretyName]=c;const h=s.closest("a");h&&h.innerText===s.innerHTML&&(h.style[e.stylePropretyName]=c),s.parentNode.replaceChild(f,s)}});const o=Array.from(t.parentWrapper?.getElementsByTagName("span")||[]).reverse();e.isEditorTagOutside&&o.forEach(s=>{s.style[e.stylePropretyName]=e.rgbToHex(s.style[e.stylePropretyName]),e.getInnerText(s)===e.selectedText&&e.canselExecCommand&&(e.setCustomColor(s,e.stylePropretyName,e.currentSettings.value),t.range.selectNode(s),e.addNewRange(t.range))});const i=t.parentWrapper||t.parentNode;e.currentStyle==="color"&&i&&(uK(i,e.rgbToHex,e.outerContextColor||e.tempColor),aK(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function vK(e){const t=e.parentElement;if(!t)return!1;let n=e,r=t;for(;r;){const o=r.tagName;if(o==="TD"||o==="TH")return r.childElementCount!==1||r.firstElementChild!==n?!1:!Array.from(r.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!=="");if(o==="SPAN"||o==="EDITOR"){if(r.childElementCount!==1||r.firstElementChild!==n||Array.from(r.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!==""))return!1;n=r,r=r.parentElement;continue}return!1}return!1}function FT(e,t){const n=e.style.color?.trim();if(!n)return null;const r=Yn(n),o=Yn(t??"");return!r||r===o?null:n}function EK(e){if(e.currentSettings.name!=="textLink")return;const{mutableState:t}=e;let n=t.parentNode.closest('a[href=" "]')||t.parentNode.querySelector('a[href=" "]')||e.parentElement?.querySelector('a[href=" "]')||null;if(e.isEditorTagOutside||(n=e.findOutermostParentWithText(e.activeElement,"a")),e.currentSettings.value){const r=e.findOutermostParentWithText(e.activeElement,"a")||e.findOutermostParentWithText(t.parentNode,"a")||e.findOutermostParentWithText(t.parentWrapper,"a");if(!(n||r))return;const o=e.commonStyles?.links?.underline===void 0||e.commonStyles?.links?.underline?"underline":"none";n||(n=r);const i=e.findOutermostParentWithText(n);if(i&&i!==n&&i!==t.parentWrapper&&["b","strong","a","em","i","s","strike","u","br","span"].includes(i?.tagName.toLowerCase())){const s=n.cloneNode(!1),a=Ue(n),l=n?.parentNode;l&&(ke(l,a),rn(l)),s.appendChild(i.cloneNode(!0)),i.parentNode&&i.parentNode.replaceChild(s,i),n=s,t.range.selectNode(n),e.addNewRange(t.range)}if(n){n.setAttribute("target","_blank"),n.setAttribute("href","");const s=e.commonStyles?.links?.color||n.closest('[style*="color"]')?.style?.color||"";n.setAttribute("style",`color: ${s}; text-decoration: ${o};`),n.setAttribute("new","true"),e.refreshElementSettings(n,e.selectedText)}}else if(n=t.parentNode.closest("a")||t.parentNode.querySelector('a[em-edit="active"]')||e.findOutermostParentWithText(e.activeElement,"a"),n)if(n.style.fontFamily||n.style.fontSize){const r=vK(n)?"div":"span",o=document.createElement(r);if(jt(o,n),Array.from(n.attributes).forEach(s=>{s.name!=="href"&&s.name!=="target"&&s.name!=="color"&&o.setAttribute(s.name,s.value)}),!o.style.lineHeight){const s=n.closest('[style*="line-height"]');s?.style.lineHeight&&(o.style.lineHeight=s.style.lineHeight)}o.style.textDecoration="";const i=FT(n,e.commonStyles?.links?.color);if(i?o.style.color=i:o.style.color="",n.parentNode?.replaceChild(o,n),r==="div"){let s=o.parentElement;for(;s&&s.tagName!=="TD"&&s.tagName!=="TH";){const a=s.parentElement;if(!a)break;a.replaceChild(o,s),s=o.parentElement}}e.cleanEmptySpansWithParent(e.selectedText,o),e.refreshElementSettings(o,e.selectedText),t.range.selectNodeContents(o),e.addNewRange(t.range)}else{const r=FT(n,e.commonStyles?.links?.color);if(r){const o=document.createElement("span");for(o.style.color=r;n.firstChild;)o.appendChild(n.firstChild);n.parentNode?.replaceChild(o,n),t.range=document.createRange(),t.range.selectNodeContents(o)}else{const o=Array.from(n.childNodes);o.forEach(i=>{n.parentNode?.insertBefore(i,n)}),n.parentNode?.removeChild(n),t.range=document.createRange(),t.range.setStartBefore(o[0]),t.range.setEndAfter(o[o.length-1])}if(e.addNewRange(t.range),t.range.cloneContents()){t.range=t.selection.getRangeAt(0);const o=t.range.commonAncestorContainer,i=o.nodeType===1?o:o.parentElement,s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||i;s&&e.refreshElementSettings(s,e.selectedText)}}}var zp='[class*="em-mob-font_size"]',SK=`${zp}, [style*="font-size"]`,wK="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub",_K=new Set(["SPAN","STRONG","B","EM","I","U","S","STRIKE","FONT","SUP","SUB","A"]);function CK(e,t,n){const{classNamePrefix:r,value:o}=t.mobileFontSize,i=o!=null?`${r}${o}px`:null,s=e.closest(wK)||e;s.querySelectorAll(".em-element-path").forEach(d=>d.remove());const a=TK(s,i!==null);if(!a||Pe(s)===Qe()){n({settings:t,elem:s.closest("editor")?s:s.closest(SK)||s}),Up(s,r,i);return}const l=AK(s,a);if(i===null){(l?[l]:Array.from(s.querySelectorAll(zp)).filter(d=>a.intersectsNode(d))).forEach(d=>{Up(d,r,null),$T(d,r)});return}const c=l||pE(a,a.extractContents(),"span");if(!c)return;kK(c),n({settings:t,elem:c}),Up(c,r,i);const u=document.createRange();u.selectNodeContents(c),Jo(u)}function TK(e,t){const n=window.getSelection();if(!n?.rangeCount)return null;const r=n.getRangeAt(0);if(!e.contains(r.commonAncestorContainer))return null;if(!r.collapsed)return r;if(!t){const i=(r.startContainer.nodeType===Node.ELEMENT_NODE?r.startContainer:r.startContainer.parentElement)?.closest(zp);if(!i||i===e||!e.contains(i))return null;const s=document.createRange();return s.selectNodeContents(i),Jo(s),s}nK(n,Jo);const o=n.rangeCount?n.getRangeAt(0):null;return o&&!o.collapsed?o:null}function AK(e,t){const n=Qe(),r=t.commonAncestorContainer;let o=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement,i=null;for(;o&&o!==e&&o.tagName!=="EDITOR"&&e.contains(o)&&Pe(o)===n;)i=o,o=o.parentElement;return i}function Up(e,t,n){e.querySelectorAll("*").forEach(r=>{n&&r.style.fontSize?(Gc(r,t),r.classList.add(n)):r.getAttribute("class")?.includes(t)&&$T(r,t)})}function $T(e,t){Gc(e,t),e.classList.length||e.removeAttribute("class");const n=e.parentNode;if(!(e.tagName!=="SPAN"||e.attributes.length||!n)){for(;e.firstChild;)n.insertBefore(e.firstChild,e);e.remove()}}function kK(e){[e.previousSibling,e.nextSibling].forEach(t=>{if(!t||t.textContent!=="")return;if(t.nodeType===Node.TEXT_NODE){t.remove();return}const n=t,r=n.tagName==="A"&&(n.hasAttribute("name")||n.hasAttribute("id"));_K.has(n.tagName)&&!r&&!n.querySelector("img, br, hr, table, video, iframe")&&n.remove()})}function LK(e,t){let n=!1;const{activeElement:r}=t;if(typeof e.linkHref=="string"&&xK(e.linkHref,t),t.textStyleProperties.some(o=>e.hasOwnProperty(o)))try{t.toggleTextStyle(r,{settings:e})}catch{}if(e.mobileFontSize&&(CK(r,e,t.setElementMobileFontSize),n=!0),e.mobileLineHeight){const o=r.closest('[class*="em-mob-line_height"]')||r.closest('[style*="line-height"]');t.setElementMobileLineHeight({settings:e,elem:o}),n=!0}return e.textAlign!==void 0&&OK(e.textAlign,r),e.mobileTextAlign&&(RK(e,r,t),n=!0),(typeof e.textSuperscript=="boolean"||typeof e.textSubscript=="boolean")&&t.handleTextScriptSettings(e,{unwrapNestedTags:t.unwrapNestedTags,wrapInTag:t.wrapInTag,unwrapTag:t.unwrapTag,isRangeMatching:t.isRangeMatching,splitWrapper:t.splitWrapper,cleanEmptyTags:t.cleanEmptyTags,applicationElementSettingsSet:t.applicationElementSettingsSet,commit:t.commit}),e.textAnchor!==void 0&&t.handleTextAnchor(e.textAnchor,{activeElement:r,commit:t.commit}),e.textReplacer!==void 0&&t.handleTextReplacer(e.textReplacer,{activeElement:r,compareStrings:t.compareStrings}),(e.hasOwnProperty("listUL")||e.hasOwnProperty("listOL"))&&NK(e,r),t.isElementList&&PK(e,t),n}function NK(e,t){const n=BV.includes(t.tagName)?t:t.closest(HV);if(!n)return;const r=e.listOL!==void 0;(r?e.listOL:e.listUL)?XV(n,r):QV(n)}function xK(e,t){let n=document.querySelector("[em-edit]");if(!n)return;let r=n.tagName==="A"?n:n.closest("a"),o=n.closest(".alignment")||n.closest(".button_block")||n.closest("td");if(o||(o=n.closest("div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, a, sup, sub"),o||(o=document.querySelector("td")?.closest("div, p, td")||null)),!r&&o&&(r=o.querySelector("a")),r&&(r.setAttribute("href",e),ka(e)&&r.removeAttribute("target")),o){const i=t.collectVMLContent(o);if(i){const s=document.createElement("div");s.innerHTML=i;const a=s.querySelector("v\\:roundrect"),l=s.querySelector("a");(a||l)&&(a&&a.setAttribute("href",e),l&&l.setAttribute("href",e),t.updateVMLComments(o,s.innerHTML))}}}function OK(e,t){const n=Sa(t);n&&(e?n.style.textAlign?n.style.textAlign=e:n.setAttribute("align",e):n.style.textAlign?n.style.removeProperty("text-align"):n.removeAttribute("align"))}function RK(e,t,n){const r=Sa(t);if(!r)return;const o=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";JU(t,r,o),n.setElementMobileAlign({settings:e,elem:r,fieldName:"mobileTextAlign"})}function MK(e,t){const n=c=>c in e,{SpacingBetweenParagraphs:r,SpacingBetweenBulletsAndText:o,BulletType:i}=e,{ColorBullets:s,BulletsSize:a,BulletsFontFamily:l=null}=e;return[!!r&&(c=>t.updateTableStyle(c,"padding-bottom",r)),!!o&&(c=>t.updateTableStyle(c,"padding-left",o)),!!i&&(c=>t.changeBullets(c,i)),!!s&&(c=>t.changeBulletsColor(c,s)),!!a&&(c=>t.changeBulletsSize(c,a)),n("BulletTextItalic")&&(c=>t.changeBulletsItalic(c,!!e.BulletTextItalic)),n("BulletTextStrong")&&(c=>t.changeBulletsWeight(c,!!e.BulletTextStrong)),n("BulletTextStrikethrough")&&(c=>t.changeBulletsStrikethrough(c,!!e.BulletTextStrikethrough)),n("BulletTextUnderline")&&(c=>t.changeBulletsUnderline(c,!!e.BulletTextUnderline)),n("BulletsFontFamily")&&t.isElementListOL&&(c=>IK(l,c,t))].filter(c=>!!c)}function PK(e,t){const{activeElement:n,classNameOl:r,classNameUl:o}=t,i=n.closest(`table.${r}`)||n.closest(`table.${o}`);if(!i)return;const s=MK(e,t);if(s.length){const l=t.removeEditorTags(Rl(i));Ta(i,s.reduce((c,u)=>u(c),l))}let a=t.findElementWithSelectedText(n.textContent||"",i);a===null&&(a=i),a.hasAttribute("em-edit")||a.setAttribute("em-edit","active"),t.commit()}function IK(e,t,n){const r=document.createElement("div");ke(r,t);const o=r.querySelector("table.em-element-list-ol");return o?(o.querySelectorAll("tr").forEach(i=>{const s=i.querySelector("td:first-child > div");s&&(e?e[0]==="Safe Fonts"?(s.style.fontFamily=e[1],n.removeClassesByPrefix(s,"em-font"),n.clearLinkTags({elem:document.documentElement})):e[0]==="Google Fonts"&&(e[1]==="Sans Serif"?s.style.fontFamily="Helvetica, Arial, sans-serif":e[1]==="Serif"?s.style.fontFamily='"Times New Roman", Times, serif':e[1]==="Project Fonts"&&Vc(s,e[2]),n.removeClassesByPrefix(s,"em-font"),s.classList.add(n.createFontClassName(e)),Ih(s,e),n.addFontFamilyClass({fontFamilyArray:e})):s.style.removeProperty("font-family"))}),Ke(r)):t}var Lu=null;function WT(e){Lu=e}function qT(){return Lu}function br(){Lu=null}function DK(){return Lu?.kind==="atom"}function jp(e,t,n,r){Cs(e,t,o=>{const i=document.createElement("table");i.replaceChildren(...o),[...i.querySelectorAll(":scope > tr")].reverse().forEach(s=>n.insertAdjacentElement(r,s))})}function zT(e,t){e.replaceChildren(...t),e.querySelectorAll('tr[em="block"]').forEach(n=>n.removeAttribute("em"))}function Vp(e,t,n,r,o){Cs(e,n,i=>{zT(t,i),r.insertAdjacentElement(o,t)})}var BK=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],HK=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],FK=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function UT(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...BK)})}function $K(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...HK)})}function Nu(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...FK)})}function Gp(e,t){const n=e.getBoundingClientRect();return t>n.top+n.height/2?"bottom":"top"}function jT(e,t){const n=e.getBoundingClientRect(),r=document.body.getBoundingClientRect();return t==="bottom"?n.bottom>r.height-21:n.top<2}function Xp(e,t,n){const r=n==="atom"?"em-atom-insert":"em-block-insert",o=n==="blockatom"?"em-blockatom-insert":r;if(e.classList.add(o),t==="bottom"){e.classList.remove(`${r}_top`,`${r}_top-document`);const i=jT(e,"bottom")?`${r}_bottom-document`:`${r}_bottom`;e.classList.add(i)}else{e.classList.remove(`${r}_bottom`,`${r}_bottom-document`);const i=jT(e,"top")?`${r}_top-document`:`${r}_top`;e.classList.add(i)}}function xu(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function VT(e){if(!e?.length)return null;for(let t=0;t<e.length;t++){const n=e.item(t);if(n?.type.startsWith("image/"))return n}return null}function WK(e){if(!e?.items?.length)return null;for(let t=0;t<e.items.length;t++){const n=e.items[t];if(n.kind!=="file")continue;const r=n.getAsFile();if(r&&r.type.startsWith("image/"))return r}return null}function qK(e){const t=VT(e.dataTransfer?.files??null);return t||WK(e.dataTransfer??null)}function Kp(e){const t=document.body?.parentElement??document.body;if(!t)return null;const n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return null;const r=n.closest(".em-element-resize-img-container");if(r){const i=r.querySelector("img");if(i&&t.contains(i))return i}const o=n.closest("img");return!o||!t.contains(o)?null:o}function La(e){const t=e.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}function Yp(e){if(!La(e))return!1;const t=e.dataTransfer;if(!t)return!1;if(t.files?.length)return!!VT(t.files);const n=t.items;if(!n?.length)return!0;for(let r=0;r<n.length;r++){const o=n[r];if(o.kind!=="file")continue;const i=o.type||"";if(i.startsWith("image/")||i==="")return!0}return!1}var GT="em-native-img-drop-target",Zp="em-native-img-uploading",zK="em-native-img-drop-loading",Ou="em-native-file-drag",Na=null,_o=null;function XT(){_o&&(window.removeEventListener("scroll",_o.reposition,!0),window.removeEventListener("resize",_o.reposition),_o.resizeObserver?.disconnect(),_o.overlay.remove(),_o=null)}function UK(e){XT();const t=document.createElement("div");t.className="em-native-img-upload-spin-overlay",t.setAttribute("aria-hidden","true");const n=document.createElement("div");n.className="em-native-img-upload-spin",t.appendChild(n),document.body.appendChild(t);const r=()=>{const i=e.getBoundingClientRect();t.style.left=`${Math.round(i.left)}px`,t.style.top=`${Math.round(i.top)}px`,t.style.width=`${Math.max(Math.round(i.width),1)}px`,t.style.height=`${Math.max(Math.round(i.height),1)}px`};r(),window.addEventListener("scroll",r,!0),window.addEventListener("resize",r);let o=null;typeof ResizeObserver<"u"&&(o=new ResizeObserver(()=>r()),o.observe(e)),_o={overlay:t,reposition:r,resizeObserver:o}}function Qp(){Na&&(Na.classList.remove(GT),Na=null)}function Co(){Be(document.body,!1,Ou),Qp()}function jK(e){if(!La(e)){Co();return}if(!Yp(e)){Co();return}Be(document.body,!0,Ou);const t=Kp(e);if(!t){Qp();return}Na!==t&&(Qp(),Na=t,t.classList.add(GT))}function KT(){XT(),Be(document.body,!1,zK,Ou),document.querySelectorAll(`.${Zp}`).forEach(e=>{e.classList.remove(Zp)})}function VK(e,t){if(t.lockEditor||!La(e))return!1;const n=qK(e);if(!n)return!1;const r=Kp(e);return r?(t.applicationElementSettingsSet({elem:r}),Co(),r.classList.add(Zp),UK(r),t.messageService.send({operation:ue.APPLICATION_NATIVE_IMAGE_DROP,file:n}),!0):!1}function GK(e,t){if(t.lockEditor)return;document.body.classList.contains("em-block-insert-body")||t.messageService.send({operation:"application_scroll-block-show"});const n=e.target;n.getAttribute("em")==="atom"&&(Be(document.body,!0,"em-atom-insert-body-inside"),t.commit(!1),t.mutableState.atomReplaced=n)}function XK(e,t){t.lockEditor||(Co(),e.preventDefault(),t.messageService.send({operation:"application_scroll-block-hide"}))}function KK(e,t){if(e.preventDefault(),t.lockEditor){Co();return}La(e)?(Yp(e)&&Kp(e)&&(e.dataTransfer.dropEffect="copy"),jK(e)):Co();const n=e.target;if(document.body.classList.contains("em-block-insert-body")){const r=cn(n)?null:n.closest('[em="block"]');if(r){t.mutableState.targetBlock=r;const o=xu(r);o&&Xp(o,Gp(o,e.pageY),"block")}else UT()}else if(document.body.classList.contains("em-atom-insert-body")){const r=n.closest('[em="atom"]');if(r&&r.innerHTML.trim())t.mutableState.targetBlock=r,Xp(r,Gp(r,e.pageY),"atom"),Nu();else if(n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML)Nu();else{const o=n.closest('[em="block"]');if(o){t.mutableState.targetBlock=o;const i=xu(o);i&&(Xp(i,Gp(i,e.pageY),"blockatom"),$K())}}}}function YK(e,t){if(t.lockEditor)return;La(e)&&Yp(e)&&Be(document.body,!0,Ou);const n=e.target;if(document.body.classList.contains("em-block-insert-body")){document.querySelectorAll(".em-block-insert-empty").forEach(o=>{o.classList.remove("em-block-insert-empty")});const r=n.closest('[em="block"]');cn(n)?(n.classList.add("em-block-insert-empty"),UT()):r&&(t.mutableState.targetBlock=r)}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside")){document.querySelectorAll(".em-atom-insert-empty").forEach(i=>{i.classList.remove("em-atom-insert-empty")});const r=n.closest('[em="atom"]');r&&r.innerHTML.trim()?(t.mutableState.targetBlock=r,document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")&&(t.requireEvenEmptyCell===!1||n.parentElement&&[...n.parentElement.children].indexOf(n)%2===0)||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML?(n.classList.add("em-atom-insert-empty"),document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):document.querySelectorAll(".em-atom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert-empty")});const o=n.closest('[em="block"]');cn(n)?(n.classList.add("em-block-insert-empty"),Nu()):o?t.mutableState.targetBlock=o:Nu()}}var ZK=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function QK(e){return e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight}function JK(e,t){if(t.lockEditor)return;const n=e.target;if(document.body.classList.contains("em-block-insert-body")){if(QK(e)){document.querySelectorAll(".em-block-insert").forEach(i=>i.classList.remove(...ZK)),t.mutableState.newTargetblock=null,t.mutableState.targetBlock=null;return}const r=e.relatedTarget,o=n.closest('[em="block"]');if(r&&o&&o.contains(r))return;t.mutableState.newTargetblock=n.closest('[em="block"]'),t.mutableState.newTargetblock&&(n.closest('[em="block"]')&&(t.mutableState.newTargetblock!==t.mutableState.targetBlock||t.mutableState.newTargetblock.closest('[em="group"]')!==t.mutableState.targetBlock?.closest('[em="group"]'))?t.mutableState.newTargetblock.tagName==="DIV"?t.mutableState.newTargetblock.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):t.mutableState.newTargetblock.querySelectorAll(".em-block-insert").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}else if(document.body.classList.contains("em-atom-insert-body")){const r=e.relatedTarget,o=n.closest('[em="atom"]');if(r&&o&&o.contains(r))return;const i=n.closest('[em="block"]');if(r&&i&&i.contains(r))return;t.mutableState.newTargetblock=n.closest('[em="atom"]'),t.mutableState.newTargetblock&&(n.getAttribute("em")==="atom"&&t.mutableState.newTargetblock!==t.mutableState.targetBlock?t.mutableState.newTargetblock.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"):document.querySelectorAll(".em-atom-insert-empty").forEach(a=>{a.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}));const s=n.closest('[em="block"]');s&&(n.closest('[em="block"]')&&(s!==t.mutableState.targetBlock||s.closest('[em="group"]')!==t.mutableState.targetBlock?.closest('[em="group"]'))?s.tagName==="DIV"?s.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):s.querySelectorAll(".em-blockatom-insert").forEach(a=>{a.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(a=>{a.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}}function eY(e,t,n){if(!e)return;let r=document.head.querySelector('style[em="styles"]'),o="";r?o=n.HTMLDocument.getInnerHtml(r):(r=document.createElement("style"),r.setAttribute("em","styles"),r=document.head.insertAdjacentElement("beforeend",r));const i=document.createElement("div");t&&(e=e.replace(/(max-device-width:|max-width:)\d+px/g,a=>a.replace(/\d+/,String(t)))),i.insertAdjacentHTML("afterbegin",e);let s=n.minify(o+`
|
|
100
|
+
`+[...i.querySelectorAll("style")].map(a=>a.innerHTML).join(`
|
|
101
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;s=n.cssbeautify(s,{indent:" ",autosemicolon:!0}),r&&(r.textContent=`
|
|
102
|
+
`+s+`
|
|
103
|
+
`)}function tY(e){for(const t of e.reverse())document.head?.prepend(t),document.head?.insertAdjacentHTML("afterbegin",`
|
|
104
|
+
`)}function nY(e){return e.classList.contains("em-block-insert_bottom-document")||e.classList.contains("em-block-insert_bottom")?"afterend":e.classList.contains("em-block-insert_top-document")||e.classList.contains("em-block-insert_top")?"beforebegin":"afterend"}function YT(){br(),Co(),Be(document.body,!1,"em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),Be(document.body,!1,"em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>{e.classList.remove("em-atom-insert-empty")}),document.querySelectorAll(".sortable-chosen.sortable-ghost").forEach(e=>{e.classList.remove("sortable-chosen","sortable-ghost")})}function ZT(e,t,n){const r=e.target;if(!(n.isTableElement(r)&&cn(r)||(r.tagName==="BODY"?Ep():r.closest('[em="block"]'))))return;const o=Rh(n.parseFromString(t.settings.blockHTML||""));let i=o.filter(l=>l.tagName&&l.tagName!=="LINK"&&l.tagName!=="STYLE").map(l=>n.getOuterHtml(l)).join("");const s=o.filter(l=>l.tagName==="STYLE").map(l=>n.getOuterHtml(l)).join(""),a=o.filter(l=>l.tagName==="LINK"&&l.getAttribute("em-class")).filter(l=>!document.head?.querySelector(`link[em-class="${l.getAttribute("em-class")}"]`));if(eY(s,n.emailWidth,{minify:n.minify,cssbeautify:n.cssbeautify,HTMLDocument:n.HTMLDocument}),tY(a),t.settings.type!=="project"&&(i=n.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=n.uptimeCountdown({blockHTML:i})),n.isTableElement(r)&&cn(r))r.getAttribute("em")==="block"&&r.removeAttribute("em"),(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:r}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:r,project:t.settings.project})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),i.substring(0,3)==="<tr"?ar("new",gr(r),"beforeend",`
|
|
105
|
+
`+i+`
|
|
106
|
+
`):ar("new",gr(r),"beforeend",`
|
|
107
|
+
<tr><td align="center">
|
|
108
|
+
`+i+`
|
|
109
|
+
</td></tr>
|
|
110
|
+
`),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),br());else if(r.tagName==="BODY"){const l=Ep();if(!l)return;const c="afterend";(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:l}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:l,project:t.settings.project})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),jp("new",`
|
|
111
|
+
`+i+`
|
|
112
|
+
`,l,c),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),br())}else{const l=r.closest('[em="block"]');if(l){const c=xu(l),u=c?nY(c):"afterend";if((i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:l}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:l,project:t.settings.project})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),l.tagName==="TR")i.substring(0,3)==="<tr"?jp("new",`
|
|
113
|
+
`+i+`
|
|
114
|
+
`,l,u):jp("new",`
|
|
115
|
+
<tr em="block"><td align="center">
|
|
116
|
+
`+i+`
|
|
117
|
+
</td></tr>
|
|
118
|
+
`,l,u);else if(i.substring(0,3)==="<tr")if(l.tagName==="TABLE"){const d=document.createElement("table");d.setAttribute("cellspacing","0"),d.setAttribute("cellpadding","0"),d.setAttribute("align","center"),d.setAttribute("border","0"),d.setAttribute("em","block"),d.setAttribute("width",l.hasAttribute("width")?l.getAttribute("width"):String(l.getBoundingClientRect().width)),d.classList.add("em-mob-width-100perc"),Vp("new",d,`
|
|
119
|
+
`+i+`
|
|
120
|
+
`,l,u)}else{const d=document.createElement("div");d.setAttribute("align","center"),d.setAttribute("em","block"),Vp("new",d,`<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
121
|
+
`+i+`
|
|
122
|
+
</table>`,l,u)}else ar("new",l,u,`
|
|
123
|
+
`+i+`
|
|
124
|
+
`);l.querySelectorAll(".em-block-insert").forEach(d=>{d.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),br())}}}var Jp="em-live-atom";function Ru(e,t){return t?`<${Jp}></${Jp}>`:e}function rY(e,t){const[n,...r]=document.querySelectorAll(Jp);if(r.forEach(i=>i.remove()),!n||e.contains(n)){n?.remove();return}const o=e.parentElement;Cf(e),n.replaceWith(e),o&&e.parentElement&&t(e,o,e.parentElement)}function QT(e,t=e){return e==='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'?`
|
|
125
|
+
<tr em="block" class="em-structure">
|
|
126
|
+
<td align="center">
|
|
127
|
+
${t}
|
|
128
|
+
</td>
|
|
129
|
+
</tr>`:`
|
|
130
|
+
<style>
|
|
131
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
132
|
+
.em-mob-wrap {
|
|
133
|
+
display: block!important;
|
|
134
|
+
}
|
|
135
|
+
.em-mob-width-100perc {
|
|
136
|
+
width: 100%!important;
|
|
137
|
+
max-width: 100%!important;
|
|
138
|
+
}
|
|
139
|
+
.em-mob-padding_right-20 {
|
|
140
|
+
padding-right: 20px!important;
|
|
141
|
+
}
|
|
142
|
+
.em-mob-padding_left-20 {
|
|
143
|
+
padding-left: 20px!important;
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
146
|
+
<tr em="block" class="em-structure">
|
|
147
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
148
|
+
<table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
149
|
+
<tr>
|
|
150
|
+
<td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
|
|
151
|
+
${t}
|
|
152
|
+
</td>
|
|
153
|
+
</tr>
|
|
154
|
+
</table>
|
|
155
|
+
</td>
|
|
156
|
+
</tr>`}function oY(e,t,n,r,o,i,s){t.match(/em="atom"><tr><td>\s*<img/gi)&&!t.match(/class="em-countdown"/gi)&&(t=o.setImageWidth({atomHTML:t,targetAtom:e})),t.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:e,targetPlace:"beforeend",atomHTML:t}):ar(i,e,"beforeend",`
|
|
157
|
+
`+Ru(t,s)+`
|
|
158
|
+
`),n!=null&&!s&&(e.closest(".empty-structure")||e.closest(".em-structure"))&&n.remove(),r.settings?.name&&(o.messageService.send("application_atom_inserted",r.settings.name),br())}function iY(e,t,n,r,o,i,s){const a=e.target,l=!!document.querySelector(".em-blockatom-insert"),c=l?a.closest('[em="block"]'):a,u=l?document.querySelector(".em-blockatom-insert"):document.querySelector(".em-block-insert-empty");t.match(/em="atom"><tr><td>\s*<img/gi)&&(t=r.setImageWidth({atomHTML:t,targetAtom:u}));let d=QT(t,Ru(t,s));t!=='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'&&o(d.match(/<style((.|\n|\r)*?)<\/style>/g)),n.settings?.type!=="project"&&(d=r.commonStylesApplyToBlock({html:d}));let f=null;c.tagName==="TABLE"||c.tagName==="TR"?f=c.querySelector("[data-template-content]")??c.querySelector("td"):f=c,(d.indexOf("empty-structure")>-1||d.indexOf("em-structure")>-1)&&(d=r.setFloatBlocksWidth({blockHTML:d,targetBlock:c,project:n.settings?.project}),d=r.fitImagesToColumns(d));let h="beforeend";l&&f&&(f.classList.contains("em-block-insert_bottom-document")||f.classList.contains("em-block-insert_bottom")?h="afterend":(f.classList.contains("em-block-insert_top-document")||f.classList.contains("em-block-insert_top"))&&(h="beforebegin"));const m=!!t.match(/class="em-countdown"/gi),p=d.substring(0,3)==="<tr";if(c.tagName==="TR")if(p)if(m)r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:d});else{const v=document.createElement("tr");v.setAttribute("em","block"),v.classList.add("em-structure"),Cs(i,`
|
|
159
|
+
`+d+`
|
|
160
|
+
`,w=>{v.replaceChildren(...w.flatMap(_=>_ instanceof Element&&_.tagName==="TR"?Array.from(_.childNodes):[_])),c.insertAdjacentElement(h,v)})}else if(m)r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:`<tr em="block"><td align="center">
|
|
161
|
+
`+d+`
|
|
162
|
+
</td></tr>`});else{const v=document.createElement("tr");v.setAttribute("em","block"),Cs(i,`
|
|
163
|
+
<td align="center">
|
|
164
|
+
`+d+`
|
|
165
|
+
</td>
|
|
166
|
+
`,w=>{v.replaceChildren(...w),c.insertAdjacentElement(h,v)})}else if(p)if(c.tagName==="TABLE")if(cn(a))m?r.insertCountdown({targetElem:h==="beforeend"?gr(c):c,targetPlace:h,atomHTML:d}):ar(i,h==="beforeend"?gr(c):c,h,d);else{const v=document.createElement("table");v.setAttribute("cellspacing","0"),v.setAttribute("cellpadding","0"),v.setAttribute("align","center"),v.setAttribute("border","0"),v.setAttribute("em","block"),v.setAttribute("width",c.hasAttribute("width")?c.getAttribute("width"):String(c.getBoundingClientRect().width)),v.classList.add("em-mob-width-100perc"),m?(zT(v,Le(`
|
|
167
|
+
`+d+`
|
|
168
|
+
`,!0)),r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:r.getOuterHtml(v)})):Vp(i,v,`
|
|
169
|
+
`+d+`
|
|
170
|
+
`,c,h)}else m?r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:`<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
171
|
+
`+d+`
|
|
172
|
+
</table></div>`}):ar(i,c,h,`
|
|
173
|
+
<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
174
|
+
`+d+`
|
|
175
|
+
</table></div>
|
|
176
|
+
`);else m?r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:d}):ar(i,c,h,`
|
|
177
|
+
`+d+`
|
|
178
|
+
`);document.querySelectorAll(".em-blockatom-insert").forEach(v=>{v.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),n.settings?.name&&(r.messageService.send("application_atom_inserted",n.settings.name),br())}function sY(e,t,n,r,o){const i=document.querySelector(".em-atom-insert");if(e.match(/em="atom"><tr><td>\s*<img/gi)&&i&&(e=n.setImageWidth({atomHTML:e,targetAtom:i})),!i)return;let s="afterend";i.classList.contains("em-atom-insert_bottom-document")||i.classList.contains("em-atom-insert_bottom")?s="afterend":(i.classList.contains("em-atom-insert_top-document")||i.classList.contains("em-atom-insert_top"))&&(s="beforebegin");const a=!!e.match(/class="em-countdown"/gi);if(i.tagName==="TR"){const l=document.createElement("div");gb(l,e);const c=l.querySelector('[em="atom"]');c&&c.removeAttribute("em");let u=0;const d=i.querySelector("[colspan]");d?u=d.getAttribute("colspan")||0:u=i.childElementCount,o?.removeAttribute("em");const f=o?Ru(e,o):kt(l),h=`
|
|
179
|
+
<tr em="atom"><td colspan="`+u+`">
|
|
180
|
+
`+f+`
|
|
181
|
+
</td></tr>
|
|
182
|
+
`;a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:h}):ar(r,i,s,h)}else a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:e}):ar(r,i,s,`
|
|
183
|
+
`+Ru(e,o)+`
|
|
184
|
+
`);i.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"),t.settings?.name&&(n.messageService.send("application_atom_inserted",t.settings.name),br())}function JT(e,t){const n=t.mutableState.atomReplaced,r=e.dataTransfer?.getData("Text")||"",o=r&&t.isJsonString(r)?"new":"moved",i=o==="new"?JSON.parse(r):{settings:{atomHTML:n?_s(n):""}},s=o==="moved"?i.settings.atomHTML:"",a=n&&s&&!s.match(/class="em-countdown"/gi)?n:null;try{aY(e,t,o,i,a)}finally{a&&rY(a,t.fitMovedImage)}}function aY(e,t,n,r,o){const i=t.mutableState.atomReplaced,s=e.target,a=m=>t._setDocumentStyles(m,{minify:t.minify,cssbeautify:t.cssbeautify,HTMLDocument:t.HTMLDocument});if(!r.settings?.atomHTML)return;const l=s.closest('[em="block"]')&&s.tagName==="TD"&&!s.innerHTML&&!s.hasAttribute("height")&&(s.classList.contains("em-atom-insert-empty")||DK()),c=s.tagName==="DIV"&&s.closest("amp-accordion")&&!s.innerHTML,u=l||c,d=!!document.querySelector(".em-blockatom-insert")||cn(s),f=s.closest('[em="atom"]');if(!u&&!d&&!f)return;let h=r.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();if(o||a(r.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g)),h=t.commonStylesApply({html:h}),u){oY(s,h,i,r,t,n,o);return}if(d){iY(e,h,r,t,a,n,o);return}sY(h,r,t,n,o)}var lY=/^[\t\n\f\r ]*$/;function cY(e,t){const n=[...e.childNodes],r=n.every(o=>o===t||o.nodeType===Node.TEXT_NODE&&lY.test(o.textContent??""));e.replaceWith(...r?[t]:n)}function uY(e,t){let n=!1;const{activeElement:r}=t;if(e.link!==void 0){const o=t.getActiveEditElement();if(!o)return n;if(e.link!==""){const i=o.closest("a");if(i)i.setAttribute("href",e.link);else{const s=document.createElement("a");s.setAttribute("href",e.link),s.setAttribute("target","_blank"),o.parentNode?.insertBefore(s,o),s.appendChild(o),t.setCursorPosition(s)}}else{const i=o.closest("a");i&&(cY(i,o),t.setCursorPosition(o))}}if(e.src!==void 0&&py(r)&&Ht(r,"src",e.src??""),e.src!==void 0&&KT(),e.alt!==void 0&&r.setAttribute("alt",e.alt),e.title?r.setAttribute("title",e.title):e.title===""&&r.removeAttribute("title"),e.border&&t.setElementBorder({settings:e,elem:r}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:r}),e.align&&e.align!=="undefined"?r.closest("div, p, td")?.setAttribute("align",e.align):e.align===""&&r.closest("div, p, td")?.removeAttribute("align"),e.valign?r.style.verticalAlign=e.valign:e.valign===""&&r.style.removeProperty("vertical-align"),e.width&&(e.width.value!==void 0&&e.width.value!==null?(r.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),r.style.width="100%",r.style.maxWidth=e.width.value+e.width.dim):(r.setAttribute("width","0"),r.style.width="100%",r.style.maxWidth="0")),e.height&&(e.height.value!==void 0&&e.height.value!==null?(r.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),r.style.height=e.height.value+e.height.dim):(r.removeAttribute("height"),r.style.removeProperty("height"))),e.borderRadius&&t.setElementBorderRadius({settings:e,elem:r}),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:r}),n=!0),e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:r}),n=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:r}),n=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:r}),n=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:r}),n=!0),e.mobileAlign){const o=r.closest("div, p, td");o&&t.setElementMobileAlign({settings:e,elem:o}),n=!0,e.mobileAlign.value?r.style.display="inline-block":r.style.display="block"}if(e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:r}),n=!0),e.show&&(t.setElementShow({settings:e,elem:r}),n=!0),e.countdown){const o=new Image;o.onload=function(){r.setAttribute("width",String(Math.round(this.width/2))),r.style.maxWidth=Math.round(this.width/2)+"px"};const i=e.countdown?.link??"";o.src=i,Ht(r,"src",i),r.setAttribute("em-cd-settings",e.countdown.params)}if(e.video&&r.setAttribute("em-video-settings",JSON.stringify(e.video)),e.imgReplacer){const o=e.imgReplacer??"",i=r.closest("em-replace");if(i)Ht(i,"src",o);else{const s=document.createElement("em-replace");Ht(s,"src",o),r.parentNode?.insertBefore(s,r),s.appendChild(r)}}else if(e.imgReplacer===""){const o=r.closest("em-replace");o&&(o.parentNode?.insertBefore(r,o),o.remove())}return n}function dY(e,t){const{activeElement:n,textStyleProperties:r,toggleTextStyle:o}=t;if(e.href!==void 0&&(n.setAttribute("href",e.href),ka(e.href)&&n.removeAttribute("target")),e.target&&!(e.href&&ka(e.href))&&n.setAttribute("target",e.target),r.some(i=>e.hasOwnProperty(i)))try{o(n,{settings:e})}catch{}}function fY(e,t){const{activeElement:n,setElementMobileHeight:r}=t;let o=!1;if(e.height)if(n.tagName==="DIV"){const i=e.height.value+e.height.dim;n.style.height=i,n.style.lineHeight=i,n.style.fontSize=e.height.value>10?parseInt(e.height.value)-2+e.height.dim:"8px"}else n.tagName==="TD"&&n.setAttribute("height",String(e.height.value));return e.mobileHeight&&(r({settings:e,elem:n}),o=!0),o}function mY(e,t){const{activeElement:n,isVariableText:r}=t,o=n.nextSibling?.nodeType===8?n.nextSibling:null;if(!o||!e.value)return;let i=e.value;i.startsWith("<!--")&&(i=i.substring(4)),i.endsWith("-->")&&(i=i.substring(0,i.length-3)),r(`<!--${i}-->`)?o.nodeValue=i:o.replaceWith(i)}function hY(e){const t=e.settings.textReplacer;return typeof t=="string"&&t.includes("~~")}var xa=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];function pY(e){const t=u=>{e.commit(u)},n={addFontFamilyClass:u=>ba(u,t),clearLinkTags:u=>{wo(u,t),Ur(t)}},r={setElementMobileWidth:e0,setElementMobileHeight:Oi,setElementMobileBorder:_U,setElementMobileBorderRadius:CU,setElementMobileBoxShadow:TU,setElementMobileAlign:t0,setElementMobileTableAlign:AU,setElementMobileVerticalAlign:n0,setElementMobileDirection:kU,setElementMobileBackgroundColor:LU,setElementMobileBackgroundImage:NU,setElementMobileBackgroundPositionX:xU,setElementMobileBackgroundPositionY:OU,setElementMobileBackgroundRepeat:RU,setElementMobileBackgroundSize:MU,setElementMobilePadding:Ea,setElementMobileFontSize:r0,setElementMobileLineHeight:o0,setElementShow:i0},o={parseTableElementToModel:Li,tableModelToHtml:WC,updateTablePadding:hU,getCellsWithClasses:rU,clearCellBorders:aU,updateTableCellBackgroundByIds:gU,addClassToCellsByIds:oU,getExternalBorders:lU,updateCellBordersByIds:sU,getExternalCorners:fU,updateCellBorderRadiusByIds:uU,updateCellPaddingByIds:pU,removeOuterBorders:cU},i=e.editLock??Tf,s=u=>({activeElement:u,activeCell:j.get("activeCell"),state:j,...o,wrapEditor:e.wrapEditor,addNewRange:Jo,toggleTextStyle:e.toggleTextStyle,textStyleProperties:xa,isEditLocked:()=>i.isTextLocked(),...r}),a=(u,d)=>{const f=()=>{const m=d??xT();m&&e.selectionLock.lift(()=>e.applicationElementSettingsSet({elem:m}))};let h;try{h=lX(u,s(d))}catch(m){throw f(),m}if(h.status==="applied")return!0;if(h.reason!=="empty"&&f(),h.reason!=="locked")throw new Error(`customTable: refused "${h.key??""}" (${h.reason})`);return!1},l=(u,d)=>{const{settings:f}=u,h=wu(d),m={setElementBorder:Bh,setElementBoxShadow:rC,setElementBorderRadius:Ai},p={activeElement:d,setPercentsForColumns:jl,setElementMobileHeight:Oi};switch(u.type){case"img":case"countdown":case"video":uY(f,{activeElement:d,getActiveEditElement:xs,setCursorPosition:e.setCursorPosition,...m,...r});break;case"a":dY(f,{activeElement:d,textStyleProperties:xa,toggleTextStyle:e.toggleTextStyle});break;case"table":bX(f,{activeElement:d,...m,...r});break;case"td":case"structure":case"group":case"column":vX(f,{activeElement:d,requestType:u.type,textStyleProperties:xa,isElementListContainer:cG(d),isProgrammaticSelection:e.programmaticSelection,...m,...r,setContrastBlock:PU,setStructureBlocksWidth:_u,toggleTextStyle:e.toggleTextStyle,removeEditorTags:Di,addClassToSecondCell:PV,wrapEditor:e.wrapEditor,addNewRange:Jo});break;case"button":mX(f,{activeElement:d,textStyleProperties:xa,...m,...r,toggleTextStyle:e.toggleTextStyle,compareStrings:AE});break;case"div":gX(f,{activeElement:d,...m,...r});break;case"vindent":fY(f,{activeElement:d,setElementMobileHeight:Oi});break;case"var":mY(f,{activeElement:d,isVariableText:z_});break;case"floatBlock":_X(f,{activeElement:d,setElementMobileWidth:e0,setElementMobileContentWidth:wU,setElementMobileVerticalAlign:n0,setElementShow:i0});break;case"text":LK(f,{activeElement:d,textStyleProperties:xa,toggleTextStyle:e.toggleTextStyle,collectVMLContent:oC,updateVMLComments:iC,removeClassesByPrefix:fa,createFontClassName:Mh,...n,handleTextScriptSettings:GX,handleTextReplacer:XX,handleTextAnchor:eK,unwrapNestedTags:bI,wrapInTag:pE,unwrapTag:yI,isRangeMatching:vI,splitWrapper:EI,cleanEmptyTags:SI,applicationElementSettingsSet:e.applicationElementSettingsSet,compareStrings:AE,setElementMobileFontSize:r0,setElementMobileLineHeight:o0,setElementMobileAlign:t0,updateTableStyle:mV,changeBullets:hV,changeBulletsColor:pV,changeBulletsSize:gV,changeBulletsItalic:yV,changeBulletsWeight:bV,changeBulletsStrikethrough:EV,changeBulletsUnderline:vV,findElementWithSelectedText:Ns,removeEditorTags:Di,isElementList:h.isList,isElementListOL:h.isListOL,classNameOl:h.classNameOl,classNameUl:h.classNameUl,commit:t});break;case"floatBlocksWidths":CX(f,p);break;case"floatBlocksPreset":TX(f,p);break;case"floatBlocksValign":AX(f,p);break;case"floatBlocksGap":kX(f,p);break;case"floatBlocksGapMobile":LX(f,p);break;case"carousel":DX(f,{activeElement:d,HTMLDocument:e.htmlDocument,setElementBorderRadius:Ai,commit:t});break;case"accordion":HX(f,{activeElement:d,HTMLDocument:e.htmlDocument,setElementBorderRadius:Ai,commit:t});break;case"social":{const v=VX(f,{activeElement:d,commit:t});if(v)return v;break}case"customTable":return a(f,d)?d:null}return d},c=(u,d,f,h)=>{const m=e.selectionLock.acquire(),p=u;let v=u;e.commitLockedAsync().finally(()=>{let w;try{w=fX(v,p,d,f,{getMappedParent:_=>e.htmlDocument.getMappedParent(_)??void 0,getOuterHtml:_=>e.htmlDocument.getOuterHtml(_),applyHidden:_=>e.htmlDocument.applyHidden(_)})}catch(_){throw m.release(),_}if(!w){m.release(),e.setCursorPosition(v),h?.();return}v=w.active,e.commitLockedAsync().finally(()=>{try{w.afterCommit()}finally{m.release()}e.setCursorPosition(v),h?.()})})};return u=>{const d=e.selectionLock.acquire();try{const f=u.data;f.settings=e.getMapObj().escape(f.settings);const h=xs();if(!h){f.type==="customTable"&&a(f.settings,null)&&e.commitLockedAsync();return}e.beforeApply?.(f,h);const m=dX(h),p=l(f,h);if(!p)return;e.afterApply?.(f,p);const v=hY(f)?Jv():null;try{t_()}catch{}c(p,m,f,v?()=>ZP(v,w=>e.htmlDocument.renderOnly(w)):void 0)}catch{}finally{d.releaseLater()}}}var gY=rv,bY=3,eg=Promise.resolve(),tg={waiting:0},ng=0;function eA(){return ft()?at().entityId:void 0}async function yY(e,t){let n=!1,r=!1;const o=()=>{n||(n=!0,e())},i=(async()=>{t&&await KI(),r=!0,await BM(o)})();let s;const a=new Promise(l=>{s=setTimeout(()=>{r&&Rv()||(Rv()?n=!0:o(),l())},gY)});try{await Promise.race([i,a])}catch{o()}finally{clearTimeout(s)}}function tA(e,t){Lv(()=>nA(e,t))||nA(e,t)}function nA(e,t){const n=ng>0||XI();if(!n&&HM()&&(tg={waiting:0}),tg.waiting>=bY)return;const r=tg;r.waiting++;const o=eA(),i=FM(),s=async()=>{try{await yY(()=>{eA()===o&&(e.send({operation:ue.APPLICATION_ACTION,action:t,...i!==void 0?{actionId:i}:{}}),i!==void 0&&$M(i))},n)}finally{r.waiting--,n&&ng--}};n?(ng++,eg=eg.then(s,s)):eg=s()}function rA(e,t){return!!e&&Array.from(e.querySelectorAll('[em="atom"]')).some(n=>n!==t)}function Mu(e){e.nodeName==="#comment"&&e.textContent?.indexOf("mso")!==-1?e.remove():e.previousSibling&&Mu(e.previousSibling)}function Oa(e){if(!e)return;if(e.parentElement?.tagName==="SECTION"||e.classList.contains("em-narrow-table")&&Array.from(e.childNodes).every(n=>n.nodeType===Node.TEXT_NODE)){e.innerHTML="";return}e.querySelectorAll(".em-element-editor").forEach(n=>n.remove()),e.querySelectorAll(".em-element-path").forEach(n=>n.remove()),e.querySelectorAll(".em-element-block-add").forEach(n=>n.remove()),e.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(n=>n.remove());const t=e.parentElement;if(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))e.innerHTML.trim()===""&&(e.parentElement.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.innerHTML="":(e.remove(),Oa(t)));else if(e.innerHTML.trim()==="")Mu(e),e.remove(),Oa(t);else if(t&&!t.querySelector('div[style*="display"]')){for(const n of Array.from(e.childNodes))n.nodeName==="#text"&&n.textContent?.trim()===""?(Mu(n),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(Mu(n),n.remove());e.innerHTML.trim()===""&&Oa(e)}}function oA(e,t){const n=e;if(!n||n.closest("editor")||n.firstElementChild?.tagName==="EDITOR")return!1;const r=t.getElementParent(n);let o=n.parentNode;if(r&&t.setCursorPosition(r),n.classList.contains("em-code")){const i=t.getVariableByIcon(n);i&&(i.parentNode?.removeChild(i),n.remove())}else if(n.tagName==="TD"&&n.innerHTML===""&&n.hasAttribute("height")){const i=n.closest("table");if(i){const s=i.previousSibling;s&&s?.textContent?.trim()===""&&s.remove(),i.remove()}}else if(n.closest(".em-element-resize-img-container"))o=n.closest(".em-element-resize-img-container").parentNode,n.closest(".em-element-resize-img-container").remove();else if(n.closest('[em="atom"]')){const i=n.closest('[em="atom"]');o=i.parentNode;const s=n.closest(".em-mob-wrap, .noresp-em-mob-wrap");n.tagName==="TD"&&!n.previousElementSibling&&!n.nextElementSibling?i.remove():n.remove(),n.tagName!=="TD"&&!rA(s,i)&&s?.textContent?.trim()===""&&(s.textContent="")}else{n.remove();const i=n.previousSibling;i&&i?.textContent?.trim()===""&&i.remove()}return Oa(o),t.commit(),z.send({operation:"application_element_settings_close"}),!0}function vY(e,t){if(t)return e.keyCode===90?e.shiftKey?"redo":"undo":e.keyCode===89&&!e.shiftKey?"redo":void 0}var EY={historyUndo:"undo",historyRedo:"redo"};function SY(e,t){const n=EY[e.inputType];return!n||!e.target?.closest?.("editor")?!1:(e.preventDefault(),e.stopPropagation(),tA(t.messageService,n),!0)}function wY(e,t,n,r){if(!((window.navigator.platform.match("Mac")?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&!t&&n!=="start"&&!e.ctrlKey&&!e.metaKey))return!1;const o=e.target,i=o.tagName==="EDITOR"?o:o.closest("editor");if(i){if(i.querySelectorAll(".em-code")?.length){const u=pt(()=>{const d=r.getAllComments(o);for(const f of d)r.isVariableComment(f)&&(r.getVariableIcon(f)||f.remove());i.removeEventListener("input",u)});i.addEventListener("input",u)}return!0}const s=document.querySelector("[em-edit]");if(!s||s.closest("editor"))return!1;const a=r.getElementParent(s);let l=s.parentNode;const c=s.closest("editor");if(r.setCursorPosition(a),s.classList.contains("em-mob-wrap")){r.removeElementEditors();const u=s.closest("tr");if(u&&[...u.cells].every(d=>!d.textContent?.trim())){const d=s.closest("table");l=d?.parentNode||null,d?.remove()}}else if(s.classList.contains("em-code")){const u=r.getVariableByIcon(s);u&&(u.parentNode?.removeChild(u),s.remove())}else if(s.tagName==="TD"&&s.innerHTML===""&&s.hasAttribute("height")){const u=s.closest("table");if(u){const d=u.previousSibling;d&&d.textContent?.trim()===""&&d.remove(),u.remove()}}else if(s.closest(".em-element-resize-img-container")){const u=s.closest(".em-element-resize-img-container");l=u.parentNode;const d=s.closest("td")?.querySelector("editor");d&&d.innerHTML===""&&d.remove(),u.remove()}else if(s.closest('[em="atom"]')){const u=s.closest('[em="atom"]');l=u.parentNode;const d=s.closest(".em-mob-wrap, .noresp-em-mob-wrap");s.tagName==="TD"&&s.previousElementSibling===null&&s.nextElementSibling===null?u.remove():s.remove(),s.tagName!=="TD"&&d&&!rA(d,u)&&d.textContent?.trim()===""&&(d.textContent="")}else if(s.parentElement?.tagName==="TR"&&s.parentElement.getAttribute("em")==="group"&&document.querySelectorAll('[em="group"]').length===1)s.querySelector(".em-narrow-table")?.replaceChildren();else{s.remove();const u=s.previousSibling;u&&u.textContent?.trim()===""&&u.remove()}return c&&c.remove(),l&&r.removeEmptyParents(l),r.commit(),r.messageService.send({operation:"application_element_settings_close"}),!0}function _Y(e,t){if(!(e.keyCode===39||e.key==="ArrowRight"))return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0),o=r.startContainer,i=o.nodeType===Node.TEXT_NODE?o.parentElement:o;if(i?.closest("em-replace"))return!1;const s=Dt(i)?i.parentElement:i,a=["strong","em","u","b","i","span","a","sub","sup","strike"];let l=null;for(const h of a){const m=s?.closest(h);if(m){l=m;break}}if(!l||!t.isCaretAtEndOfStandardElement(r,l))return!1;e.preventDefault();const c=l.nextSibling;if(c&&c.nodeType===Node.TEXT_NODE&&(c.textContent?.length||0)>0){const h=c.textContent||"";return h[0]===" "||h[0]===" "?(t.setCursorPositionSimple(c,1),!0):(c.textContent=" "+h,t.setCursorPositionSimple(c,1),t.commit(),!0)}const u=l.parentNode;if(!u)return!0;if(c&&c.nodeType===Node.ELEMENT_NODE&&c.tagName==="SPAN"&&c.textContent===" ")return t.setCursorInsideSpan(c),!0;const d=document.createElement("span"),f=document.createTextNode(" ");return d.appendChild(f),c?u.insertBefore(d,c):u.appendChild(d),t.setCursorInsideSpan(d),!0}function iA(e,t){Of(e,Ss,t)}function CY(e,t){if(e.key!=="Backspace"&&e.keyCode!==8||e.ctrlKey||e.metaKey||e.altKey)return!1;const n=window.getSelection(),r=n?.rangeCount?n.getRangeAt(0):null,o=r?.collapsed?r.startContainer:null,i=Dt(o)?o:Dt(o?.parentNode)?o.parentNode:null,s=i?.previousSibling,a=s?.parentNode;if(!n||!i||kf(i)||s?.nodeName!=="BR"||!a)return!1;e.preventDefault(),e.stopImmediatePropagation(),Ss(()=>i.remove());const l=s.previousSibling,c=Array.prototype.indexOf.call(a.childNodes,s);return a.removeChild(s),l?.nodeType===Node.TEXT_NODE?n.collapse(l,l.length):n.collapse(a,c),l?.nodeName==="BR"&&Of(l,Ss),t.commit(!0),!0}var TY=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"];function AY(e,t){return!TY.includes(e.key)||Rf(Xv(),Ss)===null||t.commit(!1),!1}function kY(e,t,n,r,o){if(!(e.keyCode===13&&!n||(e.key==="Enter"||e.keyCode===13)&&e.shiftKey&&n&&r))return!1;if(e.preventDefault(),e.stopImmediatePropagation(),!t)return!0;const i=window.getSelection(),s=i&&i.rangeCount>0?i.getRangeAt(0):null;if(!s)return!0;Nv();const a=i.anchorNode,l=a?.parentNode,c=l?.tagName==="A";s.collapsed||s.deleteContents(),Kv(s);const u=document.createElement("br");if(a?.nextSibling===null&&c&&a.nodeType===Node.TEXT_NODE){if(i.anchorOffset===0)return l.parentNode.insertBefore(u,l),o.commit(),!0;if(i.anchorOffset===(a.textContent?.length||0))return l.after(u),s.setStartAfter(u),s.setEndAfter(u),iA(u,t),o.commit(),!0}if(n){const d=t.querySelector('div[em-edit="active"]');if(!(d&&d.contains(s.startContainer))&&d){const f=d.lastChild;f&&s.setStart(f,f.textContent?.length||0)}}return s.insertNode(u),s.setStartAfter(u),s.setEndAfter(u),i.removeAllRanges(),i.addRange(s),iA(u,t),o.commit(),!0}function LY(e){const t=e.target,n=t?.closest?.("a")||t?.querySelector?.("a");if(!n)return!1;const r=n.closest("td")||n.parentElement;return r?hC(r,n.textContent||""):!1}function NY(e){const t=pt(r=>{const o=r.target,i=o?.closest?.("a")||o?.querySelector?.("a"),s=i?.closest("td")||i?.parentElement;!i||!s||!zr(s)||e(!1).then(()=>{const a=!!i.closest("editor")||!!i.querySelector("editor")||!!s.querySelector("editor");s.isConnected&&i.isConnected&&a&&hC(s,i.textContent||"")&&e(!1)})}),n=pt(r=>{LY(r)&&e(!1)});return document.addEventListener("input",t,!1),document.addEventListener("focusout",n,!1),{dispose(){document.removeEventListener("input",t,!1),document.removeEventListener("focusout",n,!1)}}}var xY=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function OY(e){const{commit:t,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:o,getParentElementOfSelection:i,findOutermostParentWithText:s,clearLinkTags:a,addFontFamilyClass:l,getIsProgrammaticSelection:c,getCommonStyles:u}=e,d=o,f=i,h=s;function m(y,S,C){const L=!!y&&!!S&&S.tagName==="DIV"&&y.tagName==="EDITOR"&&y.parentElement===S&&S.childElementCount===1&&S.firstElementChild===y&&!Array.from(S.childNodes).some(P=>P!==y&&P.nodeType===Node.TEXT_NODE&&!!P.textContent?.trim()),x=!!y&&y.childElementCount===0&&Array.from(y.childNodes).some(P=>P.nodeType===Node.TEXT_NODE&&!!P.textContent?.trim()),N=!!y&&Pe(y).trim()===C.trim();if(!L||!x||!N||!y.hasAttribute("em-edit")||!S.parentNode)return;const W=S.parentNode,R=y.getAttribute("em-edit")||"active";for(;y.firstChild;)S.appendChild(y.firstChild);y.remove(),y.removeAttribute("em-edit"),S.setAttribute("em-edit",R),W.replaceChild(y,S),y.appendChild(S)}function p(y,S){try{return S.intersectsNode(y)}catch{const C=document.createRange();return C.selectNodeContents(y),S.compareBoundaryPoints(Range.END_TO_START,C)<0&&S.compareBoundaryPoints(Range.START_TO_END,C)>0}}function v(y){const S=y?.links||{},C=S.underline,L=S.color,x=typeof C=="boolean"?C?"underline":"none":"underline";return{color:typeof L=="string"&&L.trim()?L.trim():"inherit",textDecoration:x}}function w(y,S){if(!y||!S)return null;const C=S,L=Array.from(C.querySelectorAll("a"));C.tagName==="A"&&L.unshift(C);const x=typeof window<"u"&&window.Range?window.Range.START_TO_START:0,N=typeof window<"u"&&window.Range?window.Range.END_TO_END:2;for(const W of L){const R=document.createRange();R.selectNodeContents(W);const P=R.compareBoundaryPoints(x,y)<=0,J=R.compareBoundaryPoints(N,y)>=0;if(P&&J)return W}return null}function _(y,S,C){const L=Array.from(S?.getElementsByTagName("span")||[]).reverse();let x=!1;Pe(S)===y&&L.length&&(x=!0),L.forEach(N=>{const W=N.getAttribute("style"),R=!!W&&W.trim().length>0;let P=Array.from(N.attributes).filter(ne=>ne.name!=="style");if(!R&&P.length===1&&P[0].name==="em-edit"&&N.parentElement&&!N.parentElement.hasAttribute("em-edit")){const ne=N.getAttribute("em-edit")||"active";N.parentElement.setAttribute("em-edit",ne),N.removeAttribute("em-edit"),P=Array.from(N.attributes).filter(he=>he.name!=="style")}const J=P.length>0;if(!R&&!J){const ne=Pe(N);if(N.childNodes.length===1&&N.childNodes[0].nodeType===3){const he=N.childNodes[0];N.parentNode?.replaceChild(he,N),C.isEditorTagOutside&&Pe(S)!==y&&he.parentNode&&(C.range?.selectNode(he),n(C.range))}else{const he=Array.from(N.childNodes);he.forEach(re=>{N.parentNode?.insertBefore(re,N)}),y===ne&&(C.range=document.createRange(),C.range.setStartBefore(he[0]),C.range.setEndAfter(he[he.length-1]),n(C.range)),N.parentNode?.removeChild(N)}}}),x&&(r(S,y),C.range.selectNode(S),n(C.range))}function A(y,S){if(y?.rangeCount>0){const C=y.getRangeAt(0),L=C.commonAncestorContainer;let x=C.startOffset,N=C.endOffset;for(;L.data&&x>0&&!/\s/.test(L.data[x-1]);)x--;for(;L.data&&N<L.length&&!/\s/.test(L.data[N]);)N++;S.setStart(L,x),S.setEnd(L,N),n(S)}}function b(y,S,C){ke(y,Ue(y).replaceAll(/<\/?strike[^>]*>/gi,"")),rn(y),y.parentNode&&(C.selectNode(y),n(C),r(y,S))}let g=!1;function E(){document.execCommand("styleWithCSS",!1,"true"),g=!0}function T(y,S){const C=tK(S.settings,V),L=S.settings.textColor??S.settings.textBackgroundColor;if(typeof L=="string"&&L.trim()!==""&&!V(L))return!1;const x=wu(y),{classNameOl:N,classNameUl:W,classNameBullet:R,isListOL:P,isListUL:J,isList:ne}=x;ne&&x.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach($=>{const rt=$.querySelector(":scope > div")||$.querySelector(":scope > editor div");rt&&rt.classList.add(`${R}`)}),y?.querySelectorAll(".em-element-path").forEach($=>$.remove()),Rf(Xv(),Ss);const he=Object.keys(S.settings)[0];let re=window.getSelection();if(!re||re.rangeCount===0){if(!y||!y.isConnected)return;const $=document.createRange();if($.selectNodeContents(y),re=window.getSelection(),!re)return;re.removeAllRanges(),re.addRange($)}let Z=re.getRangeAt(0);const ve=Z.commonAncestorContainer;let de=ve.nodeType===1?ve:ve.parentElement,_e=re.anchorNode?.nodeType===1?re.anchorNode:re.anchorNode?.parentElement,ct=!1,ee=Qe();if(y||(y=re.anchorNode?.childNodes.length===1&&re.anchorNode.firstChild?.nodeType===1?re.anchorNode.firstChild:de,y.tagName==="EDITOR"&&(y=y.parentElement)),C.name==="textLink"&&C.value===""){const $=de?.closest?.("a, [href]")||null;$&&(Z.selectNode($),n(Z),y=$)}if(C.name==="textUnderline"&&!C.value){let $=de.closest(["u","strike","[style*=text-decoration]","span","a"].find(rt=>de?.closest(rt))||"u");!$&&y?.tagName==="A"&&($=y),$?.tagName==="A"&&($.style.textDecoration="none",r($,ee),Z.selectNode($),n(Z),y=$,ct=!0)}let q=S.type==="button"?(y||_e)?.closest("a"):(y||_e)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const oe=S.settings.fontFamily;let Wt=null;const U=Array.from(q?.classList||[]).some($=>($.startsWith("em-font-")&&(Wt=$),$.startsWith("em-font-")&&$.includes(C.name==="textItalic"?"Italic":"Bold")));U&&(C.name==="textItalic"||C.name==="textStrong")&&Wt&&q?.classList.remove(Wt);const un={range:Z,isEditorTagOutside:!1},wt=($=Qe(),rt=q)=>{_($,rt,un)},dn=dG,Zt=lT,kn=($,rt)=>{b($,ee,un.range)};let Qt,ut;he==="textColor"?Qt=ut="color":he==="textBackgroundColor"&&(Qt="backgroundColor",ut="background-color");const Ot=S.settings.hasOwnProperty("textColor")||S.settings.hasOwnProperty("textBackgroundColor"),_t=!!de?.closest("editor")||Pe(de)===ee||Pe(de.querySelector("editor"))===ee;un.isEditorTagOutside=_t,S.settings.hasOwnProperty("textColor")&&C.value&&E();const td=fG,Zn=c(),qa=u();if(dK({parentElement:de,parentNode:_e,parentWrapper:q,currentSettings:C,isElementList:ne,classNameBullet:R,isEditorTagOutside:_t,selectedText:ee,range:Z,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V})||fK({parentElement:de,parentNode:_e,parentWrapper:q,currentSettings:C,isElementList:ne,classNameBullet:R,isEditorTagOutside:_t,selectedText:ee,range:Z,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,fontFamilyArray:oe,removeClassesByPrefix:fa,createFontClassName:Mh,clearLinkTags:a,addFontFamilyClass:l,cleanEmptySpans:wt}))return!1;const Oo=de.closest(C.tags.find($=>de?.closest($))||"span");(Z?.collapsed||!Qe())&&(C.value?C.value&&_t&&(S.type==="button"||y.tagName==="A"&&Oo?Z.selectNodeContents(Oo):A(re,Z)):Oo&&Z.selectNodeContents(Oo)),(S.type==="button"||y.tagName==="A"||y?.closest("a"))&&Qe()&&Qe()!==Pe(y)&&Oo&&(S.settings.hasOwnProperty("textLink")||S.settings.hasOwnProperty("textUnderline"))&&(Z.selectNode(Oo),n(Z),S.settings.hasOwnProperty("textUnderline")&&y.tagName==="A"&&(y.style.textDecoration=C.value?"underline":"none",ct=!0)),re=window.getSelection(),Z=re.getRangeAt(0),un.range=Z,ee=Qe(),Array.from(q?.querySelectorAll("span,div")||[]).reverse().forEach($=>{$.getAttribute("style")===""&&$.removeAttribute("style"),$.hasAttribute("contenteditable")&&$.removeAttribute("contenteditable"),$.hasAttribute("em-edit")&&$.removeAttribute("em-edit"),$.hasAttribute("em-relative")&&$.removeAttribute("em-relative"),$.hasAttribute("class")&&($.classList.remove("em-relative"),$.classList.length===0&&$.removeAttribute("class"))});let ce=null;Ot&&ut&&q?.style?.getPropertyValue?.(ut)?.trim()&&(Pe(q)===ee&&(q.style[Qt]=V(C.value?.toString())||"",ct=!0),Qt==="color"&&(de===q||y?.closest('[style*="color"]')===q)&&(ce=V(q.style[ut]),q.style.removeProperty(ut),!q?.hasAttribute("em-edit")&&ne&&q&&Zn&&q.closest("tr")?.querySelector(`.${R}`)?.style.removeProperty(ut)));let fn=null,nd=null;if(Ot&&Qt==="color"&&["A","LI"].includes(q?.tagName)){let $=q.parentElement;for(;$&&!["BODY","HTML","TD","TH"].includes($.tagName);){const rt=$.style.getPropertyValue("color")?.trim();if(rt){fn=V(rt)||rt,nd=$,$.style.removeProperty("color");break}$=$.parentElement}}ut&&!(C.value.length===7||C.value.length===4)&&(ct=!0),_t&&(!C.value&&C.name!=="fontSize"&&C.name!=="textLink"||C.value)&&(!(C.name==="textUnderline"||C.name==="textStrikethrough")||S.type!=="button")&&!ct&&(C.name!=="fontSize"&&!Ot&&Pe(q)===ee?lr(C.command,!1,Ot?C.value:C.name==="textLink"?" ":void 0):Pe(q)!==ee&&(S.settings.hasOwnProperty("textColor")&&E(),lr(C.command,!1,Ot?String(C.value):C.name==="textLink"?" ":void 0),S.settings.hasOwnProperty("textColor")&&C.value&&cK(q||de,String(C.value),V))),ee=Qe();{const $={parentElement:de,parentNode:_e,parentWrapper:q,selection:re,range:Z};pK({parentElement:de,parentNode:_e,parentWrapper:q,currentSettings:C,isElementList:ne,classNameBullet:R,isEditorTagOutside:_t,selectedText:ee,range:Z,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:y,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt,mutableState:$,currentStyle:Qt,isProgrammaticSelection:Zn,findParentWithFontSizeAndTag:gG}),de=$.parentElement,_e=$.parentNode,q=$.parentWrapper,re=$.selection,Z=$.range,un.range=Z}mK({parentElement:de,parentNode:_e,parentWrapper:q,currentSettings:C,isElementList:ne,classNameBullet:R,isEditorTagOutside:_t,selectedText:ee,range:Z,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:y,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt}),hK({parentElement:de,parentNode:_e,parentWrapper:q,currentSettings:C,isElementList:ne,classNameBullet:R,isEditorTagOutside:_t,selectedText:ee,range:Z,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:y,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt});const za={parentWrapper:q,range:Z,selection:re};gK({parentElement:de,parentNode:_e,parentWrapper:q,currentSettings:C,isElementList:ne,classNameBullet:R,isEditorTagOutside:_t,selectedText:ee,range:Z,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:y,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt,request:S,findOutermostParentWithText:h,mutableState:za}),q=za.parentWrapper,Z=za.range,un.range=Z;const Vi={parentWrapper:q,range:Z,selection:re};if(bK({parentElement:de,parentNode:_e,parentWrapper:q,currentSettings:C,isElementList:ne,classNameBullet:R,isEditorTagOutside:_t,selectedText:ee,range:Z,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:y,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt,request:S,findOutermostParentWithText:h,cleanStrikesInElement:kn,mutableState:Vi}),q=Vi.parentWrapper,C.value===!1&&q){const $=window.getSelection(),rt=$&&$.rangeCount>0?$.getRangeAt(0):Z,Ln={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[C.name];let Nn=!1;Ln&&Ln.forEach(Se=>{Array.from(q.getElementsByTagName(Se)).reverse().forEach(Rt=>{if(!p(Rt,rt))return;const Qn=Pe(Rt);if(!Qn||Qn.trim().length===0)return;const ht=Rt.parentElement;Rt.hasAttribute("em-edit")&&ht&&!ht.hasAttribute("em-edit")&&ht.setAttribute("em-edit",Rt.getAttribute("em-edit")||"active"),pd(Rt),Nn=!0,m(ht,q,ee)})}),Nn&&setTimeout(()=>{const Se=document.querySelector("[em-edit]")||d(ee)||(q?.isConnected?q:null);Se&&r(Se,ee)},0)}if(C.value===!0&&q&&_t){const $={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},rt={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},Ln=$[C.name],Nn=rt[C.name];if(Ln&&Nn&&ee&&ee.trim().length>0){const Se=q,Rt=Nn.some(Qr=>Se.getElementsByTagName(Qr).length>0),Qn=(Se.style?.textDecoration||"").toLowerCase(),ht=(Se.style?.textDecorationLine||"").toLowerCase(),xn=Qn.includes("underline")||ht.includes("underline"),qt=Qn.includes("line-through")||ht.includes("line-through"),vr=C.name==="textUnderline"&&xn||C.name==="textStrikethrough"&&qt,od=Pe(Se)===ee;if(!Rt&&!vr&&od){const Qr=document.createElement(Ln);for(;Se.firstChild;)Qr.appendChild(Se.firstChild);Se.appendChild(Qr);try{const On=document.createRange();On.selectNodeContents(Qr),n(On),Z=On,un.range=On}catch{}setTimeout(()=>{const On=document.querySelector("[em-edit]")||d(ee)||(Se.isConnected?Se:null);On&&r(On,ee)},0)}}}const nt={parentWrapper:q,parentNode:_e,range:Z,selection:re};yK({parentElement:de,parentNode:_e,parentWrapper:q,currentSettings:C,isElementList:ne,classNameBullet:R,isEditorTagOutside:_t,selectedText:ee,range:Z,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,isColorChange:Ot,tempColor:ce,outerContextColor:fn,outerContextElement:nd,stylePropretyName:ut,currentStyle:Qt,canselExecCommand:ct,isProgrammaticSelection:Zn,request:S,setCustomColor:td,checkForWorkClass:dn,cleanEmptySpans:wt,mutableState:nt}),q=nt.parentWrapper,_e=nt.parentNode;const Zr={parentWrapper:q,parentNode:_e,range:Z,selection:re};if(EK({parentElement:de,parentNode:_e,parentWrapper:q,currentSettings:C,isElementList:ne,classNameBullet:R,isEditorTagOutside:_t,selectedText:ee,range:Z,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,findOutermostParentWithText:h,activeElement:y,commonStyles:qa,cleanEmptySpansWithParent:wt,mutableState:Zr}),Z=Zr.range,C.name==="textLink"&&C.value===!0&&_t&&q&&ee?.trim().length>0){const $=Zr.range||Z,rt=ee.trim(),Ln=[...q?Array.from(q.querySelectorAll("a")):[],...q?.parentElement?Array.from(q.parentElement.querySelectorAll("a")):[]],Nn=Ln.find(Se=>Pe(Se)?.trim()===rt)||Ln[0]||null;if(!(w($,q)||w($,q.parentElement)||Nn)&&$&&!$.collapsed){const Se=document.createElement("a"),{color:Rt,textDecoration:Qn}=v(qa);Se.setAttribute("target","_blank"),Se.setAttribute("href",""),Se.setAttribute("new","true"),Se.setAttribute("style",`color: ${Rt}; text-decoration: ${Qn};`);let ht=!1;const xn=q.querySelector("editor");if(xn&&Pe(xn)===ee&&xn.querySelector("a")===null){for(;xn.firstChild;)Se.appendChild(xn.firstChild);xn.appendChild(Se),ht=!0}try{if(!ht){const qt=$.extractContents();qt.childNodes.length>0&&(Se.appendChild(qt),$.insertNode(Se),ht=!0)}}catch{ht=!1}if(!ht&&Pe(q)===ee){for(;q.firstChild;)Se.appendChild(q.firstChild);q.appendChild(Se),ht=!0}if(ht){try{const qt=document.createRange();qt.selectNodeContents(Se),n(qt),Z=qt,Zr.range=qt,un.range=qt}catch{}r(Se,ee)}}}const rd=C.name==="textUnderline"&&!C.value;if((!Ot&&ct||rd)&&wt(ee),xY.has(C.name)){const $=Zr.parentWrapper||q||d(ee)||f();$&&wt(ee,$)}ne&&de.querySelectorAll(`tr td:first-child > div.${R}, tr td:first-child > editor div.${R}`).forEach($=>{$.classList.remove(`${R}`)});const Ua=d(ee);Ua?.hasAttribute("em-edit")||Ua?.setAttribute("em-edit","active"),t()}return function(S,C){try{return T(S,C)}finally{g&&(g=!1,document.execCommand("styleWithCSS",!1,"false"))}}}function sA(e){return e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),sr(_s(e),([t])=>(t&&e.after(t),t))}function aA(e,t){const n=sA(e);t.commit(),n&&t.setCursorPosition(n)}function lA(e,t){sA(e),t.commit()}function cA(e,t){aA(e,t)}function uA(e,t){if(!e.previousElementSibling)return!1;const n=e.previousElementSibling;return n.before(e),t.commit(),z.send({operation:"application_scroll-to",settings:{value:t.scrollTop-n.getBoundingClientRect().height}}),!0}function dA(e,t){if(!e.nextElementSibling)return!1;const n=e.nextElementSibling;return n.after(e),t.commit(),z.send({operation:"application_scroll-to",settings:{value:t.scrollTop+n.getBoundingClientRect().height}}),!0}function fA(e){e.innerHTML="",e.getAttribute("em")==="block"&&e.removeAttribute("em")}function mA(e,t){const n=e.closest("table");e.querySelector("[em-edit]")&&z.send({operation:"application_element_settings_close"});const r=e.closest('[em="group"]');r&&n&&r.querySelectorAll('[em="block"]').length===1?fA(n):e.remove(),t.commit(),n&&t.setCursorPosition(n)}function hA(e,t){return Cf(e),qM(t)}function RY(e,t){const n=document.querySelector('[em-edit="active"]')?.closest('[em="block"]');if(!n)return;const r=[...n.parentElement.children].indexOf(n),o=_i(n),i=parseFloat(o?.style.paddingTop??"")||0,s=parseFloat(o?.style.paddingBottom??"")||0;if(e.tagName==="TR"||e.tagName==="TABLE"){const a=hA(e,e.querySelector("td")),l=[...e.parentNode.children].indexOf(e),c=_i(e),u=parseFloat(c?.style.paddingTop??"")||0,d=parseFloat(c?.style.paddingBottom??"")||0,f=parseFloat(c?.style.borderTopLeftRadius??"")||0,h=parseFloat(c?.style.borderTopRightRadius??"")||0,m=parseFloat(c?.style.borderBottomLeftRadius??"")||0,p=parseFloat(c?.style.borderBottomRightRadius??"")||0,v=n.querySelector("td");r>l?(tr(v,"afterbegin",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${i+d}"></td></tr></table>`),v.prepend(...a),o&&(o.style.paddingTop=u+"px",o.style.borderTopLeftRadius=f+"px",o.style.borderTopRightRadius=h+"px",o.querySelector(":scope > .em-vindent-paddingTop")?.remove())):(tr(v,"beforeend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${s+u}"></td></tr></table>`),v.append(...a),o&&(o.style.paddingBottom=d+"px",o.style.borderBottomLeftRadius=m+"px",o.style.borderBottomRightRadius=p+"px",o.querySelector(":scope > .em-vindent-paddingBottom")?.remove()))}else if(e.tagName==="DIV"){const a=hA(e,e),l=Array.prototype.indexOf.call(e.parentElement.children,e);tl(n,r>l?"afterbegin":"beforeend",a)}e.remove(),document.querySelector(".em-element-editor-widget-merge")?.remove(),t.commit(),t.setCursorPosition(n)}function MY(e,t){const n=_i(e),r=parseFloat(n?.style.paddingTop)||0,o=parseFloat(n?.style.paddingBottom)||0,i=parseFloat(n?.style.borderTopLeftRadius)||0,s=parseFloat(n?.style.borderTopRightRadius)||0,a=parseFloat(n?.style.borderBottomLeftRadius)||0,l=parseFloat(n?.style.borderBottomRightRadius)||0,c=_s(e);if(!c)return;Cf(e);const u=[...n?.querySelectorAll(':scope > table:not([em="atom"])')??[]].filter(Sf).map(f=>({table:f,next:Dv(f,"next"),prev:Dv(f,"previous")})),d=u.length;u.forEach(({table:f,next:h,prev:m},p)=>{const[v]=Le(c,!0),w=_i(v);if(w.style.paddingTop="0",w.style.paddingBottom="0",w.style.borderRadius="0",w.replaceChildren(f),p===0?(w.style.paddingTop=r+"px",w.style.borderTopLeftRadius=i+"px",w.style.borderTopRightRadius=s+"px"):p===d-1&&(w.style.paddingBottom=o+"px",w.style.borderBottomLeftRadius=a+"px",w.style.borderBottomRightRadius=l+"px"),h?.getAttribute("em")==="atom"&&h.querySelector("td")?.hasAttribute("height")){const _=parseFloat(h.querySelector("td").getAttribute("height"))/2;w.style.paddingBottom=_+"px"}if(m?.getAttribute("em")==="atom"&&m.querySelector("td")?.hasAttribute("height")){const _=parseFloat(m.querySelector("td").getAttribute("height"))/2;w.style.paddingTop=_+"px"}e.insertAdjacentElement("beforebegin",v)}),e.remove(),t.commit()}function PY(e,t){return e.previousElementSibling?(e.previousElementSibling.before(e),t.commit(),!0):!1}function IY(e,t){return e.nextElementSibling?(e.nextElementSibling.after(e),t.commit(),!0):!1}function DY(e,t){const n=document.querySelector('[em="group"]')?.cloneNode(!0);if(!n)return;const r=n.querySelector("table");r&&fA(r),e.after(n),t.commit(),z.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+n.getBoundingClientRect().height+(t.iframeOffsetTop||0)}})}function BY(e,t){aA(e,t)}function HY(e,t){e.querySelector("[em-edit]")&&z.send({operation:"application_element_settings_close"}),e.remove(),t.commit()}function FY(e){return e.classList.contains("add-empty-block")?"empty":e.classList.contains("add-saved-block")?"project":e.classList.contains("add-common-block")?"common":e.classList.contains("add-template-block")?"template":e.classList.contains("add-search-block")?"search":""}function $Y(e){const t=e.closest("i");return t?t.classList.contains("add-empty-block")||t.classList.contains("add-saved-block")||t.classList.contains("add-common-block")||t.classList.contains("add-template-block")||t.classList.contains("add-search-block"):!1}function WY(e,t,n){const r=t.closest("i");if(!r)return;n.removeAllAttributes("em-edit");const o=t.closest('[em="block"]');if(!o)return;o.tagName==="TR"?o.querySelector("TD")?.setAttribute("em-edit","active"):o.setAttribute("em-edit","active");const i={operation:"application_element_settings_set",type:"emptyTable",tab:FY(r)},s=n.selectionLock.acquire();try{z.send(i)}finally{n.commitLockedAsync(!1).finally(()=>{s.release()})}}function qY(e,t,n){const r=t.parentNode;r&&(r.style.backgroundColor="rgba(0,255,0,0.3)");let o="";document.head.querySelectorAll("style").forEach(a=>{o+=n.HTMLDocument.getInnerHtml(a)});const i=document.createElement("style");i.setAttribute("em","styles"),i.innerHTML=o;const s=EH(i)+`
|
|
185
|
+
`+n.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(s),setTimeout(()=>{r&&r.style.removeProperty("background-color")},2e3)}function zY(e,t,n){navigator.clipboard.readText().then(r=>{const o=Rh(n.parseFromString(r));let i=o.filter(l=>l.tagName&&l.tagName!=="LINK"&&l.tagName!=="STYLE").map(l=>n.getOuterHtml(l)).join("");const s=o.filter(l=>l.tagName==="STYLE").map(l=>n.getOuterHtml(l)).join(""),a=o.filter(l=>l.tagName==="LINK"&&l.getAttribute("em-class")).filter(l=>!document.head?.querySelector(`link[em-class="${l.getAttribute("em-class")}"]`));if((i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:e}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:e,project:n.appName})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),!sr(i,l=>{const c=UY(e,l);if(!c)return!1;s&&jY(s,n);for(const u of a.reverse())document.head?.prepend(u),document.head?.insertAdjacentHTML("afterbegin",`
|
|
186
|
+
`);return e.removeAttribute("em-state"),e.after(c),!0})){VY(t.parentNode);return}n.commit(),n.setCursorPosition(e)}).catch(()=>{})}function UY(e,t){const n=e.tagName==="TR",r=document.createElement(n?"table":"div");return r.append(...t),r.querySelector('[em="block"]')?(r.querySelector(".em-element-editor")?.remove(),r.querySelector(n?"tr":'[em="block"]')):null}function jY(e,t){let n=document.head.querySelector('style[em="styles"]'),r="";n?r=t.HTMLDocument.getInnerHtml(n):(n=document.createElement("style"),n.setAttribute("em","styles"),n=document.head.insertAdjacentElement("beforeend",n));const o=document.createElement("div");t.emailWidth&&(e=e.replace(/(max-device-width:|max-width:)\d+px/g,s=>s.replace(/\d+/,String(t.emailWidth)))),t.insertAdjacentHTML(o,"afterbegin",e);let i=t.minify(r+`
|
|
187
|
+
`+[...o.querySelectorAll("style")].map(s=>s.innerHTML).join(`
|
|
188
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;i=t.cssbeautify(i,{indent:" ",autosemicolon:!0}),n.textContent=`
|
|
189
|
+
`+i+`
|
|
190
|
+
`}function VY(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function GY(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function XY(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function KY(e){const t=e.getAttribute("em-discuss-id");return t&&z.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function YY(e,t){let n=e;const r=n.getAttribute("em-discuss-id"),o=n.classList.contains("em-discuss-id-new");if(!r||r&&o){if(document.querySelectorAll(".em-discuss-id-new").forEach(i=>{i!==n&&(i.removeAttribute("em-discuss-id"),i.removeAttribute("contenteditable"),i.removeAttribute("em-edit"))}),n.tagName==="EDITOR"&&(n=n.parentElement),n.getAttribute("em-discuss-id"))n.removeAttribute("em-discuss-id"),n.removeAttribute("contenteditable"),n.removeAttribute("em-edit"),z.send({operation:"application_discuss_set_id",settings:{value:""}});else{const i=t.makeId(5);n.setAttribute("em-discuss-id",i),n.setAttribute("em-edit","active"),n.setAttribute("contenteditable","true"),n.classList.add("em-discuss-id-new"),z.send({operation:"application_discuss_set_id",settings:{value:i}})}t.commit()}return{handled:!0,newClickedElement:n}}function ZY(e){return function(n){document.body&&!document.body.classList.contains("mceNonEditable")&&(n.stopPropagation(),n.preventDefault()),e.setEditorFocus(!1);const r=n.target;if(document.documentElement.classList.contains("em-resize-start")||r.classList.contains("em-element-editor-widget")||r.classList.contains("em-element-block-add"))return;let o=r;if(!e.getLockEditor()){const m=o.closest(".em-narrow-table");if(m&&(cn(m)||!m.innerHTML.trim())&&e.insertTextAtomIntoEmptyNarrowTable(m))return}const i=o.closest("a");if(i instanceof HTMLAnchorElement){const m=i.getAttribute("href")||i.href||"";if(ka(m)){const p=m.slice(1),v=document.querySelector(`a[name="${p}"]`);v&&(n.preventDefault(),v.scrollIntoView({behavior:"smooth",block:"start"}))}else i.href&&document.referrer.includes("raw")&&window.open(i.href);n.stopPropagation(),n.preventDefault()}if(o.tagName==="HTML"||o.classList.contains(Ve.drag)||o.classList.contains("em-element-editor"))return;const s=document.body,a=s?.classList.contains("mceNonEditable"),l=s?.classList.contains("em-sandbox-discuss"),c=document.referrer.includes("raw"),u=o.tagName==="A"||o.closest("a")||o.tagName==="IMG";if(a&&!l&&(!c||!u)){e.setCursorPosition(o);return}if(e.isDiscussViewMode()){e.handleDiscussViewClick(o);return}if(e.isDiscussSetTargetMode()){o=e.handleDiscussSetTargetClick(o).newClickedElement;return}o instanceof Element&&o.tagName==="EDITOR"&&(o=o.parentElement);const d=o.closest('[em="atom"]');if(d&&o.closest(".em-element-editor-widget-remove")){e.handleRemoveAtom(d);return}if(d&&o.closest(".em-element-editor-widget-edit")){e.applicationElementSettingsSet({elem:d}),e.setCursorPosition(d);return}if(d&&o.closest(".em-element-editor-widget-clone")){e.handleCloneAtom(d);return}const f=o.closest('[em="block"]');if(f&&o.classList.contains(Ve.moveUp)){e.handleMoveBlockUp(f);return}if(f&&o.classList.contains(Ve.moveDown)){e.handleMoveBlockDown(f);return}if(f&&o.closest(".em-element-editor-widget-edit")){const m=f.querySelector("td");m&&e.applicationElementSettingsSet({elem:m}),e.setCursorPosition(f);return}if(f&&o.closest(".em-element-editor-widget-remove")){e.handleRemoveBlock(f);return}if(f&&o.closest(".em-element-editor-widget-add-block")){e.addBlockToProject(o);return}if(f&&o.closest(".em-element-editor-widget-clone")){e.handleCloneBlock(f);return}if(f&&e.isAddBlockMenuClick(o)){e.handleAddBlockMenu(f,o);return}if(f&&o.closest(".em-element-editor-widget-copy")){e.handleCopyBlock(f,o);return}if(f&&o.closest(".em-element-editor-widget-paste")){e.handlePasteBlock(f,o);return}if(f&&o.classList.contains(Ve.merge)){e.handleMergeBlocks(f);return}if(f&&o.classList.contains(Ve.unmerge)){e.handleUnmergeBlocks(f);return}const h=o.closest('[em="group"]');if(h&&o.classList.contains(Ve.moveUp)){e.handleMoveGroupUp(h);return}if(h&&o.classList.contains(Ve.moveDown)){e.handleMoveGroupDown(h);return}if(h&&o.classList.contains(Ve.add)){e.handleAddGroup(h);return}if(h&&o.closest(".em-element-editor-widget-edit")){e.setCursorPosition(h);const m=h.tagName!=="TR"?h:h.querySelector("td");m&&e.applicationElementSettingsSet({elem:m});return}if(h&&o.closest(".em-element-editor-widget-clone")){e.handleCloneGroup(h);return}if(h&&o.closest(".em-element-editor-widget-remove")&&o.closest(".of-group")){e.handleRemoveGroup(h);return}if(!o.closest(".em-editor-wrapper")&&!o.closest(".em-element-path")&&!o.closest(".em-element-vindent-remove")){const m=window.getSelection();if(m?.isCollapsed)e.setCursorPosition(o);else if(m&&m.rangeCount>0){const v=m.getRangeAt(0).commonAncestorContainer,w=e.findOutermostParentWithText(v);w&&e.setCursorPosition(w);const _=e.getParentElementOfSelection();_&&(o=_)}e.applicationElementSettingsSet({elem:o});const p=document.querySelector(".em-editor-wrapper");p&&(p.style.display="none"),e.setBlockGroupControlsPosition()}o.closest(".em-element-custom-table")&&e.handleCustomTableClick(o)}}function QY(e){const t=pt(r=>{r.target?.closest(".em-element-editor-widget-clone")||(document.querySelectorAll('.em-element-editor-widget-clone[data-open="true"]').forEach(o=>{o.setAttribute("data-open","false");const i=o.querySelector("ul");i&&(i.style.display="none")}),eu(o=>{e.commit(o)}))}),n=()=>{e.messageService.send({operation:"application_focus_in_iframe"})};return document.addEventListener("click",t),document.addEventListener("click",n),{dispose(){document.removeEventListener("click",t),document.removeEventListener("click",n)}}}var JY=`
|
|
191
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
192
|
+
<path d="M2.21128 13.375C1.83241 13.375 1.51172 13.2438 1.24922 12.9813C0.986719 12.7188 0.855469 12.3981 0.855469 12.0192V1.98081C0.855469 1.60194 0.986719 1.28125 1.24922 1.01875C1.51172 0.75625 1.83241 0.625 2.21128 0.625H4.74966C5.12853 0.625 5.44922 0.75625 5.71172 1.01875C5.97422 1.28125 6.10547 1.60194 6.10547 1.98081V12.0192C6.10547 12.3981 5.97422 12.7188 5.71172 12.9813C5.44922 13.2438 5.12853 13.375 4.74966 13.375H2.21128ZM9.24966 13.375C8.87078 13.375 8.55009 13.2438 8.28759 12.9813C8.02509 12.7188 7.89384 12.3981 7.89384 12.0192V1.98081C7.89384 1.60194 8.02509 1.28125 8.28759 1.01875C8.55009 0.75625 8.87078 0.625 9.24966 0.625H11.788C12.1669 0.625 12.4876 0.75625 12.7501 1.01875C13.0126 1.28125 13.1438 1.60194 13.1438 1.98081V12.0192C13.1438 12.3981 13.0126 12.7188 12.7501 12.9813C12.4876 13.2438 12.1669 13.375 11.788 13.375H9.24966ZM12.0188 1.98081C12.0188 1.92306 11.9948 1.87019 11.9467 1.82219C11.8987 1.77406 11.8458 1.75 11.788 1.75H9.24966C9.19191 1.75 9.13903 1.77406 9.09103 1.82219C9.04291 1.87019 9.01884 1.92306 9.01884 1.98081V12.0192C9.01884 12.0769 9.04291 12.1298 9.09103 12.1778C9.13903 12.2259 9.19191 12.25 9.24966 12.25H11.788C11.8458 12.25 11.8987 12.2259 11.9467 12.1778C11.9948 12.1298 12.0188 12.0769 12.0188 12.0192V1.98081Z" fill="#344966"/>
|
|
193
|
+
</svg>
|
|
194
|
+
`,eZ=`
|
|
195
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
196
|
+
<path d="M1.98081 13.1442C1.60194 13.1442 1.28125 13.013 1.01875 12.7505C0.75625 12.488 0.625 12.1673 0.625 11.7884V9.25002C0.625 8.87115 0.75625 8.55046 1.01875 8.28796C1.28125 8.02546 1.60194 7.89421 1.98081 7.89421H12.0192C12.3981 7.89421 12.7188 8.02546 12.9813 8.28796C13.2438 8.55046 13.375 8.87115 13.375 9.25002V11.7884C13.375 12.1673 13.2438 12.488 12.9813 12.7505C12.7188 13.013 12.3981 13.1442 12.0192 13.1442H1.98081ZM1.98081 6.10583C1.60194 6.10583 1.28125 5.97459 1.01875 5.71209C0.75625 5.44958 0.625 5.1289 0.625 4.75002V2.21165C0.625 1.83277 0.75625 1.51208 1.01875 1.24958C1.28125 0.987085 1.60194 0.855835 1.98081 0.855835H12.0192C12.3981 0.855835 12.7188 0.987085 12.9813 1.24958C13.2438 1.51208 13.375 1.83277 13.375 2.21165V4.75002C13.375 5.1289 13.2438 5.44958 12.9813 5.71209C12.7188 5.97459 12.3981 6.10583 12.0192 6.10583H1.98081ZM12.0192 1.98083H1.98081C1.92306 1.98083 1.87019 2.0049 1.82219 2.05302C1.77406 2.10102 1.75 2.1539 1.75 2.21165V4.75002C1.75 4.80777 1.77406 4.86065 1.82219 4.90865C1.87019 4.95677 1.92306 4.98083 1.98081 4.98083H12.0192C12.0769 4.98083 12.1298 4.95677 12.1778 4.90865C12.2259 4.86065 12.25 4.80777 12.25 4.75002V2.21165C12.25 2.1539 12.2259 2.10102 12.1778 2.05302C12.1298 2.0049 12.0769 1.98083 12.0192 1.98083Z" fill="#344966"/>
|
|
197
|
+
</svg>
|
|
198
|
+
`,tZ=`
|
|
199
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(-90deg); display: inline-block;">
|
|
200
|
+
<path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
|
|
201
|
+
</svg>
|
|
202
|
+
`,nZ=`
|
|
203
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(90deg); display: inline-block;">
|
|
204
|
+
<path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
|
|
205
|
+
</svg>
|
|
206
|
+
`,rZ=`
|
|
207
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(-90deg); display: inline-block;">
|
|
208
|
+
<path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
|
|
209
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
210
|
+
<path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
|
|
211
|
+
</svg>
|
|
212
|
+
`,oZ=`
|
|
213
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
|
|
214
|
+
<path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
|
|
215
|
+
</svg>
|
|
216
|
+
`,iZ=`
|
|
217
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(180deg); display: inline-block;">
|
|
218
|
+
<path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
|
|
219
|
+
</svg>
|
|
220
|
+
`,sZ=`
|
|
221
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
|
|
222
|
+
<path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
|
|
223
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
224
|
+
<path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
|
|
225
|
+
</svg>
|
|
226
|
+
`,aZ=`
|
|
227
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
228
|
+
<path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
|
|
229
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
230
|
+
<path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
|
|
231
|
+
</svg>
|
|
232
|
+
`,lZ=`
|
|
233
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(180deg); display: inline-block;">
|
|
234
|
+
<path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
|
|
235
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
236
|
+
<path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
|
|
237
|
+
</svg>
|
|
238
|
+
`,cZ=`
|
|
239
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
240
|
+
<path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
241
|
+
</svg>
|
|
242
|
+
`,uZ=`
|
|
243
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
|
|
244
|
+
<path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
245
|
+
</svg>
|
|
246
|
+
`,pA=`
|
|
247
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
248
|
+
<path d="M7 3H11M3 5H15M13.6667 5L13.1991 12.0129C13.129 13.065 13.0939 13.5911 12.8667 13.99C12.6666 14.3412 12.3648 14.6235 12.0011 14.7998C11.588 15 11.0607 15 10.0062 15H7.9938C6.93927 15 6.41202 15 5.99889 14.7998C5.63517 14.6235 5.33339 14.3412 5.13332 13.99C4.90607 13.5911 4.871 13.065 4.80086 12.0129L4.33333 5" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
249
|
+
</svg>
|
|
250
|
+
`,Pu=e=>(t,{cellId:n,selected:r})=>r.length?sp(t,n,r):Jz(t,n,e),gA={"add-left-column":(e,{cellId:t})=>VC(e,t,"left"),"add-right-column":(e,{cellId:t})=>VC(e,t,"right"),"merge-right-cell":Pu("right"),"merge-left-cell":Pu("left"),"split-vertical-cell":(e,{cellId:t})=>KC(e,t,"cols"),"remove-column":(e,{cellId:t})=>Uz(e,t),"add-top-row":(e,{cellId:t})=>UC(e,t,"above"),"add-bottom-row":(e,{cellId:t})=>UC(e,t,"below"),"merge-top-cell":Pu("top"),"merge-bottom-cell":Pu("bottom"),"split-horizontal-cell":(e,{cellId:t})=>KC(e,t,"rows"),"remove-row":(e,{cellId:t})=>zz(e,t)};function dZ(e,t,n){const r=t.cells.find(i=>i.id===n);if(r)return{row:r.row,col:r.col};const o=e.cells.find(i=>i.id===n);return{row:Math.max(0,Math.min(o?.row??0,t.rows-1)),col:Math.max(0,Math.min(o?.col??0,t.cols-1))}}var fZ=[{group:"columns",icon:JY,localeKey:"TABLE_MENU_COLUMNS"},{group:"rows",icon:eZ,localeKey:"TABLE_MENU_ROWS"}],bA=[{group:"columns",id:"add-left-column",icon:tZ,localeKey:"INSERT_COLUMN_BEFORE_TABLE"},{group:"columns",id:"add-right-column",icon:nZ,localeKey:"INSERT_COLUMN_AFTER_TABLE"},{group:"columns",id:"merge-right-cell",icon:sZ,localeKey:"MERGE_RIGHT_CELL_TABLE"},{group:"columns",id:"merge-left-cell",icon:rZ,localeKey:"MERGE_LEFT_CELL_TABLE"},{group:"columns",id:"split-vertical-cell",icon:uZ,localeKey:"SPLIT_CELL_TABLE"},{group:"columns",id:"remove-column",icon:pA,localeKey:"REMOVE_COLUMN_TABLE"},{group:"rows",id:"add-top-row",icon:oZ,localeKey:"INSERT_ROW_BEFORE_TABLE"},{group:"rows",id:"add-bottom-row",icon:iZ,localeKey:"INSERT_ROW_AFTER_TABLE"},{group:"rows",id:"merge-top-cell",icon:aZ,localeKey:"MERGE_TOP_CELL_TABLE"},{group:"rows",id:"merge-bottom-cell",icon:lZ,localeKey:"MERGE_BOTTOM_CELL_TABLE"},{group:"rows",id:"split-horizontal-cell",icon:cZ,localeKey:"SPLIT_CELL_TABLE"},{group:"rows",id:"remove-row",icon:pA,localeKey:"REMOVE_ROW_TABLE"}],yA={left:"merge-left-cell",right:"merge-right-cell",top:"merge-top-cell",bottom:"merge-bottom-cell"},mZ={row:["add-left-column","add-right-column","remove-column"],col:["add-top-row","add-bottom-row","remove-row"]};function hZ(e){const t=e==="left"||e==="right"?"row":"col";return[...Object.values(yA).filter(n=>n!==yA[e]),...mZ[t]]}function pZ(e,t,n,r){const o=r&&n.length?hZ(r):[],i=r?n:[];return new Set(bA.map(s=>s.id).filter(s=>!o.includes(s)&&!op(gA[s](e,{cellId:t,selected:i}))))}var gZ="width: 48px; height: 28px; display: flex; position: absolute; right: 0; top: -30px; background: #FFDCC7; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); pointer-events: auto; z-index: 1001;",bZ="cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",yZ="display: none; position: absolute; top: -3px; left: 0; width: 24px; background: #FFFFFF; border: 1px solid #ccc; box-shadow: 0 2px 5px rgba(0,0,0,0.2); border-radius: 5px; z-index: 1000; list-style: none; padding: 5px 0; margin: 0; text-align: left;",vZ="padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px",EZ="cursor: pointer; margin: auto; margin-top: 5px";function Iu(e,t){return D({...t,targetElement:e,insertType:"append"})}function Ra(e){It(e)}function SZ(){const e=Mi(),t=D({className:Ks,style:gZ});for(const{group:n,icon:r,localeKey:o}of fZ){const i=Iu(t,{className:`${Ks}-group`,style:bZ,HTMLcontent:r,title:e[o]});i.setAttribute("data-group",n);const s=Iu(i,{tag:"ul",className:`${Ks}-list`,style:yZ});Iu(s,{tag:"li",className:`${Ks}-head`,style:vZ,HTMLcontent:r});for(const a of bA.filter(l=>l.group===n))Iu(s,{tag:"li",className:`${Ks}-item`,style:EZ,HTMLcontent:a.icon,title:e[a.localeKey],"data-id":a.id})}return t}function wZ(e){return e.querySelector(":scope > ul")}function _Z(e,{target:t,selection:n}){const r=n.base(),o=Li(t.table),i=r&&va(t.table,r);if(!i)return!1;const s=n.selected().map(l=>va(t.table,l)).filter(l=>!!l),a=pZ(o,i,s,n.direction());return e.querySelectorAll("[data-id]").forEach(l=>{l.style.display=a.has(l.getAttribute("data-id"))?"block":"none"}),!0}function vA(e,t){e.querySelectorAll(":scope > div > ul").forEach(n=>{n!==t&&(n.style.display="none")})}function CZ(e,t){e.stopPropagation(),e.preventDefault();const n=e.target instanceof Element?e.target:null,r=n?.closest("[data-id]");if(r){t.choose(r.getAttribute("data-id"));return}const o=n?.closest("[data-group]");o&&!n?.closest("ul")&&Ra(()=>t.show(o))}function TZ(e,t){e.addEventListener("click",pt(n=>CZ(n,t))),e.querySelectorAll("[data-group]").forEach(n=>{n.addEventListener("mouseenter",pt(()=>Ra(()=>t.show(n)))),n.addEventListener("mouseleave",pt(()=>Ra(()=>t.hide())))})}function AZ(e){let t=null,n=!1;const r=()=>{const s=t?.root;t=null,s&&Ra(()=>s.remove())},o={show(s){const a=wZ(s);if(!t||!a||e.isEditLocked()||!_Z(a,t)){r();return}vA(t.root,a),a.style.display="block"},hide(){t&&vA(t.root)},choose(s){const a=t;r(),a&&e.run(s,a.target,a.selection)}},i=pt(s=>{const a=t?.target.table;a&&(!a.isConnected||!(s.target instanceof Node)||!a.contains(s.target))&&r()});return document.addEventListener("click",i),{open(s,a){if(r(),n||e.isEditLocked())return;const l=SZ();Ef(l),TZ(l,o),t={root:l,target:s,selection:a},Ra(()=>s.table.append(l))},close:r,destroy(){r(),n=!0,document.removeEventListener("click",i)}}}function kZ(e,t){return t.map(n=>va(e,n)).filter(n=>!!n)}function LZ(e,t){const n=Li(e).grid[t.row]?.[t.col];return n&&rp(e,n)||null}function NZ(e,t,n,r){const o=LZ(t.table,e);o&&(n.start(o),r.reopen({...t,td:o},n),r.applicationElementSettingsSet({elem:o}))}function xZ(e,t,n,r){const o=n.base();if(!o)return Cu(Xr("no-cell"));const i={},s=mT(t.table,{isEditLocked:r.isEditLocked,tableModelToHtml:WC},{movesCells:!0,edit:a=>{const l=Li(a),c=va(a,o);if(!c)return Xr("no-cell");const u=gA[e](l,{cellId:c,selected:kZ(a,n.selected())});return op(u)||(i.focus=dZ(l,u,c)),u}});if(s.status==="rejected"){if(s.reason!=="locked")throw new Error(`tableMenu: refused "${e}" (${s.reason})`);return s}return r.commit(),i.focus&&NZ(i.focus,t,n,r),s}var OZ=".em-element-custom-table";function RZ(e,t){let n=t.closest("td, th");for(;n&&e.contains(n);){if(n.parentElement?.closest("table")===e)return n;n=n.parentElement?.closest("td, th")??null}return null}function MZ(e){return e.closest('[em="block"]')??e}function rg(e){if(!(e instanceof Element)||e.closest(".em-table-menu"))return null;const t=e.closest(OZ),n=t&&RZ(t,e);return t&&n?{table:t,td:n,block:MZ(t)}:null}function PZ(e){const t=AZ({isEditLocked:e.isEditLocked,run:(n,r,o)=>{xZ(n,r,o,{...e,reopen:(i,s)=>t.open(i,s)})}});return n=>{const r=rg(n);if(!r)return!1;const o=e.selections.of(r.table);return o.base()!==r.td&&o.start(r.td),t.open(r,o),!0}}function IZ(){Jc({scrollTop:j.get("scrollTop")})}function DZ(e){const{htmlDocument:t,commit:n}=e,r=()=>({commit:n,setCursorPosition:e.setCursorPosition,scrollTop:j.get("scrollTop"),iframeOffsetTop:j.get("iframeOffsetTop"),applicationElementSettingsSet:e.applicationElementSettingsSet}),o=ZY({getLockEditor:()=>e.editLock.isIntegratorLocked(),setEditorFocus:e.setEditorFocus,setCursorPosition:e.setCursorPosition,getParentElementOfSelection:Ul,findOutermostParentWithText:Wf,setBlockGroupControlsPosition:IZ,applicationElementSettingsSet:e.applicationElementSettingsSet,insertTextAtomIntoEmptyNarrowTable:e.insertTextAtomIntoEmptyNarrowTable??(()=>!1),handleRemoveAtom:i=>oA(i,{getElementParent:s=>Ri(s),setCursorPosition:e.setCursorPosition,getVariableByIcon:ua,commit:n}),handleCloneAtom:i=>lA(i,r()),handleMoveBlockUp:i=>uA(i,r()),handleMoveBlockDown:i=>dA(i,r()),handleRemoveBlock:i=>mA(i,r()),handleCloneBlock:i=>cA(i,r()),handleCopyBlock:(i,s)=>qY(i,s,{HTMLDocument:t}),handlePasteBlock:(i,s)=>zY(i,s,{HTMLDocument:t,parseFromString:Le,getOuterHtml:Pt,minify:go,cssbeautify,insertAdjacentHTML:tr,setBlockMaxWidth:a=>Rp(a,t),setFloatBlocksWidth:a=>xp(a,t),checkBlockAdaptivity:zc,commit:n,setCursorPosition:e.setCursorPosition,emailWidth:j.get("emailWidth"),appName:j.get("appName")}),handleMergeBlocks:i=>RY(i,r()),handleUnmergeBlocks:i=>MY(i,r()),isAddBlockMenuClick:$Y,handleAddBlockMenu:(i,s)=>WY(i,s,{removeAllAttributes:Lr,selectionLock:e.selectionLock,commitLockedAsync:e.commitLockedAsync}),addBlockToProject:i=>Xq(i,{HTMLDocument:t,messageService:e.messageService}),handleMoveGroupUp:i=>PY(i,r()),handleMoveGroupDown:i=>IY(i,r()),handleAddGroup:i=>DY(i,r()),handleCloneGroup:i=>BY(i,r()),handleRemoveGroup:i=>HY(i,r()),isDiscussViewMode:GY,isDiscussSetTargetMode:XY,handleDiscussViewClick:KY,handleDiscussSetTargetClick:i=>YY(i,{makeId:JI,commit:n}),handleCustomTableClick:PZ({selections:e.tableSelections,isEditLocked:()=>e.editLock.isTextLocked(),commit:()=>n(),applicationElementSettingsSet:e.applicationElementSettingsSet})});document.onclick=pt(o),QY({commit:n,messageService:e.messageService})}function EA(e,t){const n=JSON.stringify({settings:t});return{target:e,dataTransfer:{getData:r=>r==="Text"?n:""},preventDefault:()=>{},stopPropagation:()=>{}}}function BZ(e){return!e.closest(".em-element-editor-widget")}function HZ(e,t){if(t.lockEditor||!e.isTrusted)return!1;const n=qT();if(!n)return!1;const r=e.target;if(!(r instanceof HTMLElement)||!BZ(r))return!1;try{if(n.kind==="atom"){const o={settings:{atomHTML:typeof n.settings.atomHTML=="string"?n.settings.atomHTML:n.settings.atomHTML?.html,name:n.settings.name}};if(!o.settings.atomHTML)return!1;JT(EA(r,o.settings),t.atomDropCtx)}else if(n.kind==="block"&&document.body.classList.contains("em-block-insert-body")){const o={settings:{blockHTML:n.settings.blockHTML,type:n.settings.type,name:n.settings.name,project:n.settings.project,blockId:n.settings.blockId}};if(!o.settings.blockHTML)return!1;ZT(EA(r,o.settings),o,t.blockDropCtx)}else return!1;if(!qT())return e.preventDefault(),e.stopPropagation(),YT(),t.commit(),!0}catch{return!1}return!1}var SA="application/x-emailmaker-social-reorder";function og(e){return e.closest('table[em-type="social"]')}function wA(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function _A(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function FZ(e){return Array.from(e.querySelectorAll(":scope > td:not([em-platform]):not([data-em-platform])")).find(t=>{const n=t;return n.getAttribute("width")!=null||n.innerHTML===" "||n.textContent===" "})}function $Z(e,t){const n=FZ(e);e.replaceChildren(),t.forEach((r,o)=>{o>0&&n&&e.appendChild(n.cloneNode(!0)),r.removeAttribute("em-index"),r.removeAttribute("data-em-index"),e.appendChild(r)})}function WZ(e,t){if(t.lockEditor)return;const n=e.target?.closest?.("td[em-platform], td[data-em-platform]");if(!n||n.getAttribute("draggable")!=="true")return;const r=og(n);if(!r)return;const o=wA(r);if(!o)return;const i=_A(o);if(i.length<2)return;const s=i.indexOf(n);if(s<0)return;const a=e.dataTransfer;if(!a)return;const l=String(s);a.setData("text/plain",l),a.setData(SA,l),a.effectAllowed="move"}function qZ(e,t){const n=e.dataTransfer;if(!n||!Array.from(n.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let r=n.getData(SA);r||(r=n.getData("text/plain"));const o=parseInt(r,10);if(Number.isNaN(o))return!1;const i=e.target.closest?.("td[em-platform], td[data-em-platform]");if(!i)return!1;const s=og(i);if(!s)return!1;const a=wA(s);if(!a)return!1;const l=_A(a);if(l.length<2)return!1;const c=l.indexOf(i);if(c<0)return!1;const u=l[o];if(!u||og(u)!==s)return!1;if(o===c)return!0;const d=[...l];return d.splice(o,1),d.splice(c,0,u),$Z(a,d),s.setAttribute("em-edit","active"),t.applicationElementSettingsSet({elem:s}),!0}function zZ(){return{targetBlock:null,newTargetblock:null,atomReplaced:null}}function UZ(e){const t=document.querySelector(".em-just-inserted");if(!t)return;e.applicationElementSettingsSet({elem:t}),t.classList.remove("em-just-inserted"),e.commit();const n=hp(t);setTimeout(()=>e.messageService.send({operation:"application_open-image-ai-popup",src:n}),1e3)}function jZ(e,t,n){if(t.editLock.isIntegratorLocked())return;let r;try{e.preventDefault(),e.stopPropagation();const o=VK(e,{lockEditor:!1,applicationElementSettingsSet:t.applicationElementSettingsSet,messageService:t.messageService})||qZ(e,{applicationElementSettingsSet:t.applicationElementSettingsSet});if(r=t.selectionLock.acquire(),!o){if(document.body.classList.contains("em-block-insert-body"))try{const i=JSON.parse(e.dataTransfer?.getData("Text")||"{}");ZT(e,i,{...t.blockDropContext(),mutableState:n})}catch{}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside"))try{JT(e,{...t.atomDropContext(),mutableState:n})}catch{}}YT(),t.commit()}finally{Promise.resolve().then(()=>{r?.release(),UZ(t)})}}function VZ(e){const{dragState:t}=e,n=(r,o,i)=>document.addEventListener(r,pt(o),i);document.addEventListener("drag",r=>r.preventDefault(),!1),n("dragstart",r=>WZ(r,{lockEditor:e.editLock.isIntegratorLocked()}),!0),n("dragstart",r=>GK(r,{lockEditor:e.editLock.isIntegratorLocked(),commit:o=>{e.commit(o)},messageService:e.messageService,mutableState:t}),!1),n("dragover",r=>KK(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t}),!1),n("dragenter",r=>YK(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t,requireEvenEmptyCell:e.requireEvenEmptyCell}),!1),n("dragleave",r=>JK(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t}),!1),n("drop",r=>jZ(r,e,t),!1),n("dragend",r=>XK(r,{lockEditor:e.editLock.isIntegratorLocked(),messageService:e.messageService}),!1)}function GZ(e){const{htmlDocument:t}=e,n=f=>e.commit(f),r=zZ(),o=e.commonStylesApply??(f=>CC(f,h=>e.commit(h))),i=f=>{$_(f,()=>e.commit())},s=f=>Rp(f,t),a=f=>xp(f,t),l=()=>({messageService:e.messageService,isJsonString:ZI,getOuterHtml:Pt,minify:go,cssbeautify,HTMLDocument:t,_setDocumentStyles:(f,h)=>Oh(f,h),commonStylesApply:o,commonStylesApplyToBlock:Kh,setImageWidth:wh,fitMovedImage:F_,setFloatBlocksWidth:a,fitImagesToColumns:Op,insertCountdown:i}),c=()=>({...l(),lockEditor:e.editLock.isIntegratorLocked(),commit:n,emailWidth:j.get("emailWidth")??null,parseFromString:f=>Le(f),isTableElement:vx,uptimeCountdown:_h,setBlockMaxWidth:s,checkBlockAdaptivity:zc,applicationElementSettingsSet:e.applicationElementSettingsSet});return{insertContext:()=>({selectionLock:e.selectionLock,commit:()=>e.commit(),lockEditor:e.editLock.isIntegratorLocked(),emailWidth:j.get("emailWidth"),iframeOffsetTop:j.get("iframeOffsetTop"),previewHeight:j.get("previewHeight"),parseFromString:f=>Le(f),getOuterHtml:Pt,HTMLDocument:t,minify:go,cssbeautify,insertAdjacentHTML:(f,h,m)=>Hv(f,h,m),messageService:e.messageService,setDocumentStyles:f=>Oh(f,{minify:go,cssbeautify,HTMLDocument:t}),setImageWidth:wh,commonStylesApply:o,commonStylesApplyToBlock:Kh,insertCountdown:i,uptimeCountdown:_h,setBlockMaxWidth:s,setFloatBlocksWidth:a,fitImagesToColumns:Op,checkBlockAdaptivity:zc,setAtomReplaced:f=>{r.atomReplaced=f},assetsRoot:e.assetsRoot}),register:()=>{document.addEventListener("click",pt(f=>{e.editLock.isIntegratorLocked()||HZ(f,{lockEditor:!1,commit:n,atomDropCtx:{...l(),mutableState:r},blockDropCtx:{...c(),mutableState:r}})}),!0),VZ({dragState:r,commit:n,messageService:e.messageService,applicationElementSettingsSet:e.applicationElementSettingsSet,selectionLock:e.selectionLock,editLock:e.editLock,atomDropContext:l,blockDropContext:c,requireEvenEmptyCell:e.requireEvenEmptyCell})}}}function XZ(e){let t=!1;const n=o=>{t=!!o.target?.nodeName},r=o=>{t&&e.handlePasteTextFragment(o,!1,e.getCommonStyles(),e.changeMsoValue,()=>{e.commit()})};return document.addEventListener("contextmenu",n),document.addEventListener("paste",r),{setFromContextMenu(o){t=o},dispose(){document.removeEventListener("contextmenu",n),document.removeEventListener("paste",r)}}}var CA='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 4 L 15 24.0625 L 8.21875 17.28125 L 6.78125 18.71875 L 15.28125 27.21875 L 16 27.90625 L 16.71875 27.21875 L 25.21875 18.71875 L 23.78125 17.28125 L 17 24.0625 L 17 4 Z"/></svg>',TA='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 4.09375 L 15.28125 4.78125 L 6.78125 13.28125 L 8.21875 14.71875 L 15 7.9375 L 15 28 L 17 28 L 17 7.9375 L 23.78125 14.71875 L 25.21875 13.28125 L 16.71875 4.78125 Z"/></svg>',ig='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 12 6 C 10.894531 6 10 6.894531 10 8 C 10 9.105469 10.894531 10 12 10 C 13.105469 10 14 9.105469 14 8 C 14 6.894531 13.105469 6 12 6 Z M 20 6 C 18.894531 6 18 6.894531 18 8 C 18 9.105469 18.894531 10 20 10 C 21.105469 10 22 9.105469 22 8 C 22 6.894531 21.105469 6 20 6 Z M 12 14 C 10.894531 14 10 14.894531 10 16 C 10 17.105469 10.894531 18 12 18 C 13.105469 18 14 17.105469 14 16 C 14 14.894531 13.105469 14 12 14 Z M 20 14 C 18.894531 14 18 14.894531 18 16 C 18 17.105469 18.894531 18 20 18 C 21.105469 18 22 17.105469 22 16 C 22 14.894531 21.105469 14 20 14 Z M 12 22 C 10.894531 22 10 22.894531 10 24 C 10 25.105469 10.894531 26 12 26 C 13.105469 26 14 25.105469 14 24 C 14 22.894531 13.105469 22 12 22 Z M 20 22 C 18.894531 22 18 22.894531 18 24 C 18 25.105469 18.894531 26 20 26 C 21.105469 26 22 25.105469 22 24 C 22 22.894531 21.105469 22 20 22 Z"/></svg>',KZ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 3 C 13.742188 3 12.847656 3.890625 12.40625 5 L 5 5 L 5 28 L 13 28 L 13 30 L 27 30 L 27 14 L 25 14 L 25 5 L 17.59375 5 C 17.152344 3.890625 16.257813 3 15 3 Z M 15 5 C 15.554688 5 16 5.445313 16 6 L 16 7 L 19 7 L 19 9 L 11 9 L 11 7 L 14 7 L 14 6 C 14 5.445313 14.445313 5 15 5 Z M 7 7 L 9 7 L 9 11 L 21 11 L 21 7 L 23 7 L 23 14 L 13 14 L 13 26 L 7 26 Z M 15 16 L 25 16 L 25 28 L 15 28 Z"/></svg>',YZ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 2 C 14.742188 2 13.847656 2.890625 13.40625 4 L 5 4 L 5 29 L 27 29 L 27 4 L 18.59375 4 C 18.152344 2.890625 17.257813 2 16 2 Z M 16 4 C 16.554688 4 17 4.445313 17 5 L 17 6 L 20 6 L 20 8 L 12 8 L 12 6 L 15 6 L 15 5 C 15 4.445313 15.445313 4 16 4 Z M 7 6 L 10 6 L 10 10 L 22 10 L 22 6 L 25 6 L 25 27 L 7 27 Z M 21.28125 13.28125 L 15 19.5625 L 11.71875 16.28125 L 10.28125 17.71875 L 14.28125 21.71875 L 15 22.40625 L 15.71875 21.71875 L 22.71875 14.71875 Z"/></svg>',Du='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 4 4 L 4 24 L 11 24 L 11 22 L 6 22 L 6 6 L 18 6 L 18 7 L 20 7 L 20 4 Z M 12 8 L 12 28 L 28 28 L 28 8 Z M 14 10 L 26 10 L 26 26 L 14 26 Z"/></svg>',ZZ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 9 L 6 9 L 6 23 L 5 23 L 5 27 L 9 27 L 9 26 L 23 26 L 23 27 L 27 27 L 27 23 L 26 23 L 26 9 L 27 9 L 27 5 L 23 5 L 23 6 L 9 6 L 9 5 Z M 9 8 L 23 8 L 23 9 L 24 9 L 24 23 L 23 23 L 23 24 L 9 24 L 9 23 L 8 23 L 8 9 L 9 9 Z M 10 10 L 10 18 L 14 18 L 14 22 L 22 22 L 22 14 L 18 14 L 18 10 Z M 12 12 L 16 12 L 16 16 L 12 16 Z M 18 16 L 20 16 L 20 20 L 16 20 L 16 18 L 18 18 Z"/></svg>',QZ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 9 L 6 9 L 6 19 L 5 19 L 5 23 L 9 23 L 9 22 L 11 22 L 11 24 L 10 24 L 10 28 L 14 28 L 14 27 L 24 27 L 24 28 L 28 28 L 28 24 L 27 24 L 27 14 L 28 14 L 28 10 L 24 10 L 24 11 L 22 11 L 22 9 L 23 9 L 23 5 L 19 5 L 19 6 L 9 6 L 9 5 Z M 9 8 L 19 8 L 19 9 L 20 9 L 20 19 L 19 19 L 19 20 L 9 20 L 9 19 L 8 19 L 8 9 L 9 9 Z M 22 13 L 24 13 L 24 14 L 25 14 L 25 24 L 24 24 L 24 25 L 14 25 L 14 24 L 13 24 L 13 22 L 19 22 L 19 23 L 23 23 L 23 19 L 22 19 Z"/></svg>',Ma='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 23.90625 3.96875 C 22.859375 3.96875 21.8125 4.375 21 5.1875 L 5.1875 21 L 5.125 21.3125 L 4.03125 26.8125 L 3.71875 28.28125 L 5.1875 27.96875 L 10.6875 26.875 L 11 26.8125 L 26.8125 11 C 28.4375 9.375 28.4375 6.8125 26.8125 5.1875 C 26 4.375 24.953125 3.96875 23.90625 3.96875 Z M 23.90625 5.875 C 24.410156 5.875 24.917969 6.105469 25.40625 6.59375 C 26.378906 7.566406 26.378906 8.621094 25.40625 9.59375 L 24.6875 10.28125 L 21.71875 7.3125 L 22.40625 6.59375 C 22.894531 6.105469 23.402344 5.875 23.90625 5.875 Z M 20.3125 8.71875 L 23.28125 11.6875 L 11.1875 23.78125 C 10.53125 22.5 9.5 21.46875 8.21875 20.8125 Z M 6.9375 22.4375 C 8.136719 22.921875 9.078125 23.863281 9.5625 25.0625 L 6.28125 25.71875 Z"/></svg>',AA='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 5 L 15 15 L 5 15 L 5 17 L 15 17 L 15 27 L 17 27 L 17 17 L 27 17 L 27 15 L 17 15 L 17 5 Z"/></svg>',JZ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 27 L 27 27 L 27 9.59375 L 26.71875 9.28125 L 22.71875 5.28125 L 22.40625 5 Z M 7 7 L 10 7 L 10 13 L 22 13 L 22 7.4375 L 25 10.4375 L 25 25 L 23 25 L 23 16 L 9 16 L 9 25 L 7 25 Z M 12 7 L 16 7 L 16 9 L 18 9 L 18 7 L 20 7 L 20 11 L 12 11 Z M 11 18 L 21 18 L 21 25 L 11 25 Z"/></svg>',sg='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 4 C 14.476563 4 13.941406 4.183594 13.5625 4.5625 C 13.183594 4.941406 13 5.476563 13 6 L 13 7 L 7 7 L 7 9 L 8 9 L 8 25 C 8 26.644531 9.355469 28 11 28 L 23 28 C 24.644531 28 26 26.644531 26 25 L 26 9 L 27 9 L 27 7 L 21 7 L 21 6 C 21 5.476563 20.816406 4.941406 20.4375 4.5625 C 20.058594 4.183594 19.523438 4 19 4 Z M 15 6 L 19 6 L 19 7 L 15 7 Z M 10 9 L 24 9 L 24 25 C 24 25.554688 23.554688 26 23 26 L 11 26 C 10.445313 26 10 25.554688 10 25 Z M 12 12 L 12 23 L 14 23 L 14 12 Z M 16 12 L 16 23 L 18 23 L 18 12 Z M 20 12 L 20 23 L 22 23 L 22 12 Z"/></svg>';function Oe(e,t,n=""){const r=`class="${t}" width="1em" height="1em" fill="currentColor" aria-hidden="true"`;return e.replace("<svg",`<svg ${r}${n?` ${n}`:""}`)}var Bu={getLocale:Mi,commit:ao},eQ=".em-prevent-action";function tQ(){return j.get("emailWidth")||475}function nQ(){return j.get("copyPasteEnabled")||!1}function rQ(){return j.get("saveBlockEnabled")||!1}function oQ(){return j.get("blocksAddPanelEnabled")||!1}function iQ(){return j.get("codeMode")||!1}var kA=".em-mob-wrap, .noresp-em-mob-wrap";function LA(e){return Array.from(document.querySelectorAll(e)).find(K_)??null}function Hu(e,t){const n=Bu.getLocale(),r=tQ(),o=nQ(),i=rQ(),s=oQ(),a=iQ();if(t==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const l=D({targetElement:e,insertType:"append",className:"em-element-editor",width:82,height:26});l.classList.add("of-atom"),document.body.getBoundingClientRect().height>70&&e.getBoundingClientRect().top+70>document.body.getBoundingClientRect().height&&l.classList.add("out-of-iframe"),e.getBoundingClientRect().top<25&&l.classList.add("em-top-crossed");const c=D({targetElement:l,insertType:"append",className:"em-element-editor-widget"});D({targetElement:c,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Oe(ig,`${xe} ${Ve.drag}`,'style="transform: rotate(90deg)"'),title:n.REORDER_ATOM}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Oe(Ma,`${xe} em-analytics__atoms-panel-edit`),title:n.EDIT_ATOM}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(Du,`${xe} em-analytics__atoms-panel-clone`),title:n.CLONE_ATOM}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Oe(sg,`${xe} em-analytics__atoms-panel-remove`),title:n.REMOVE_ATOM}),eu(Bu.commit)}if(t==="block"){e.setAttribute("em-state","active");const l=D({targetElement:e,insertType:"append",className:"em-element-editor"});l.classList.add("of-block"),e.getBoundingClientRect().left<35&&e.setAttribute("em-state","active-inside"),(document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height||document.documentElement.clientWidth<r&&e.getBoundingClientRect().top-34<0)&&l.classList.add("out-of-iframe");const c=D({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=D({targetElement:c,insertType:"append",className:"em-element-editor-group"});if(D({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Oe(ig,`${xe} ${Ve.drag}`),title:n.REORDER_BLOCK}),D({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(TA,`${xe} ${Ve.moveUp}`),title:n.REORDER_BLOCK_UP}),D({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(CA,`${xe} ${Ve.moveDown}`),title:n.REORDER_BLOCK_DOWN}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Oe(Ma,`${xe} em-analytics__blocks-panel-edit`),title:n.EDIT_BLOCK}),o){const m=D({targetElement:c,insertType:"append",className:"em-element-editor-group"});D({targetElement:m,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(Du,`${xe} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK}),D({targetElement:m,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:Oe(YZ,`${xe} em-analytics__blocks-panel-copy`),title:n.COPY_BLOCK_TO_CLIPBOARD}),D({targetElement:m,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:Oe(KZ,`${xe} em-analytics__blocks-panel-paste`),title:n.PASTE_BLOCK_FROM_CLIPBOARD})}else D({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(Du,`${xe} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK});if(e.closest(eQ))return;const d=LA('[em-edit="active"]'),f=LA('[em-state^="active"]');if(d&&f&&(d.querySelector(kA)&&f.querySelector(kA)||d.closest(".em-structure")&&f.closest(".em-structure"))&&d!==c.closest('[em-edit="active"]')&&D({targetElement:c,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:Oe(ZZ,`${xe} ${Ve.merge} em-analytics__blocks-panel-merge`),title:n.MERGE_BLOCK}),da(c.closest('[em="block"]')??c).flatMap(m=>Array.from(m.querySelectorAll(":scope > table"))).length>1&&c.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&D({targetElement:c,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:Oe(QZ,`${xe} ${Ve.unmerge} em-analytics__blocks-panel-unmerge`),title:n.UNMERGE_BLOCK}),i&&D({targetElement:c,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:Oe(JZ,`${xe} em-analytics__blocks-panel-save`),title:n.SAVE_TO_BLOCKS}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Oe(sg,`${xe} em-analytics__blocks-panel-remove`),title:n.REMOVE_BLOCK}),s&&!e.querySelector(".em-element-block-add")&&!a){const m=D({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&m.classList.add("out-of-iframe"),D({targetElement:m,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${Oe(AA,`${xe} ${Ve.add}`)} ${n.ADD_BLOCK}`,title:n.ADD_BLOCK}),D({targetElement:m,insertType:"append",className:"add-empty-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="border-outer" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM484 366h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM302 548h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm364 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-182 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm0 182h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8z"></path></svg>',title:n.ADD_EMPTY_BLOCK}),D({targetElement:m,insertType:"append",className:"add-saved-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore-add" width="1em" height="1em" fill="currentColor" aria-hidden="true"><defs><style></style></defs><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"></path></svg>',title:n.ADD_SAVED_BLOCK}),D({targetElement:m,insertType:"append",className:"add-common-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"></path></svg>',title:n.ADD_COMMON_BLOCK}),D({targetElement:m,insertType:"append",className:"add-template-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="build" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"></path></svg>',title:n.ADD_TEMPLATE_BLOCK}),D({targetElement:m,insertType:"append",className:"add-search-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg>',title:n.ADD_SEARCH_BLOCK})}eu(Bu.commit);const h=e.closest('[em="block"]');h&&(h.onmouseleave=function(){Bi(void 0)})}if(t==="group"){e.tagName==="TR"?e.querySelector("td")?.setAttribute("em-state","active"):e.setAttribute("em-state","active");const l=D({targetElement:e,insertType:"append",className:"em-element-editor"});l.classList.add("of-group"),document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height&&l.classList.add("out-of-iframe");const c=D({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=D({targetElement:c,insertType:"append",className:"em-element-editor-group"});D({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Oe(ig,`${xe} ${Ve.drag}`),title:n.REORDER_BLOCK}),D({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(TA,`${xe} ${Ve.moveUp}`),title:n.REORDER_BLOCK_UP}),D({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(CA,`${xe} ${Ve.moveDown}`),title:n.REORDER_BLOCK_DOWN}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:Oe(AA,`${xe} ${Ve.add} em-analytics__groups-panel-add`),title:n.ADD_GROUP}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Oe(Ma,`${xe} em-analytics__groups-panel-edit`),title:n.EDIT_GROUP}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(Du,`${xe} em-analytics__groups-panel-clone`),title:n.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&D({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Oe(sg,`${xe} em-analytics__groups-panel-remove`),title:n.REMOVE_GROUP}),eu(Bu.commit)}}function Bi(e){if(document.documentElement.classList.contains("em-resize-start"))return;const t=j.get("isLeftButtonDown")||!1;e&&e.closest("[em]")?.getAttribute("em")==="atom"?(document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(n=>{n.closest('[em="atom"]')!==e&&!t&&n.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group').forEach(n=>{n.remove()}),document.querySelectorAll('[em="atom"][em-state], [em="atom"] [em-state]').forEach(n=>{n.closest('[em="atom"]')!==e&&n.removeAttribute("em-state")})):e&&e.closest("[em]")?.getAttribute("em")==="block"?(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(n=>{n.closest('[em="block"]')!==e&&!t&&n.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group, [em="atom"] .em-element-editor').forEach(n=>{n.remove()}),document.querySelectorAll("[em-state]").forEach(n=>{(n.closest('[em="block"]')!==e||n.closest('[em="atom"]'))&&n.removeAttribute("em-state")})):(e&&e.closest("[em]")?.getAttribute("em")==="group"||e===void 0)&&(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(n=>{t||n.remove()}),document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(n=>{t||n.remove()}),document.querySelectorAll('[em="group"] .em-element-editor, [em="group"] .em-vindent-paddingTop, [em="group"] .em-vindent-paddingRight, [em="group"] .em-vindent-paddingBottom, [em="group"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(n=>{n.closest('[em="group"]')!==e&&!t&&n.remove()}),document.querySelectorAll("[em-state]").forEach(n=>{(n.closest('[em="group"]')!==e||n.closest('[em="block"]')||n.closest('[em="atom"]'))&&n.removeAttribute("em-state")})),document.querySelectorAll(".em-block-insert").forEach(n=>n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")),document.querySelectorAll(".em-block-insert-empty").forEach(n=>n.classList.remove("em-block-insert-empty")),document.querySelectorAll('[em-hover="true"]').forEach(n=>n.removeAttribute("em-hover"))}function sQ(e,t){if(!e?.isConnected)return;let n;if(n=e.closest('[em="atom"]')){if(Bi(n),n.querySelector(".em-element-editor.of-atom")||Hu(n.tagName==="TR"?n.querySelector("td"):n,"atom"),!n.closest('[em="block"]')?.querySelector(".em-element-editor.of-block")){document.querySelectorAll('[em="block"] > td > .em-element-editor, [em="block"] > td > .em-element-block-add').forEach(o=>{o.remove()}),document.querySelectorAll("[em-state]").forEach(o=>{o.removeAttribute("em-state")});const r=n.closest('[em="block"]');r&&Hu(r.tagName==="TR"?r.querySelector("td"):r,"block"),t.setBlockGroupControlsPosition()}}else(n=e.closest('[em="block"]'))?(Bi(n),n.querySelector(".em-element-editor.of-block")||(Hu(n.tagName==="TR"?n.querySelector("td"):n,"block"),t.setBlockGroupControlsPosition())):(n=e.closest('[em="group"]'))&&(Bi(n),n.querySelector(".em-element-editor.of-group")||(Hu(n.tagName==="TR"?n.querySelector("td"):n,"group"),t.setBlockGroupControlsPosition()));e.closest(".em-element-path")||document.querySelectorAll('[em-hover="true"]').forEach(function(r){r.removeAttribute("em-hover")}),!e.closest(".em-editor-wrapper")&&!e.closest(".em-element-editor")&&!e.closest(".em-vindent")&&!e.closest(".em-gap")&&!e.closest(".em-element-resize-img")&&!e.closest(".em-element-img-change-group")&&!e.closest(".em-element-block-add")&&!e.closest(".em-element-path")&&e.tagName!=="IMG"?e.setAttribute("em-hover","true"):e.tagName==="IMG"&&e.parentElement?.setAttribute("em-hover","true"),t.commit(!1)}var{START_POSITION:Pa,NEW_EDITOR:ag}=iT,{TRIM_SPACES:Ia,EMPTY_TEXT:aQ}=sT;function lQ(e,t){const{activeElem:n,listContext:r,cursorPositionType:o,isTargetCell:i,commit:s,wrapEditor:a,removeTemporaryListClasses:l}=t,{classNameOl:c,classNameUl:u,isList:d}=r;if(!((e.key==="Enter"||e.keyCode===13)&&d&&i&&!e.shiftKey))return!1;if(e.preventDefault(),e.stopImmediatePropagation(),!n)return!0;const f=n.closest(`table.${c}`)||n.closest(`table.${u}`),h=n.closest(`table.${c}`)?c:u;if(!f)return!0;const m=Ol(f).counterpart(n)??n,p=CV(m,h);if(!p)return!0;const{firstCellText:v,firstCellHtmlNoText:w,wrappedSecondCellHtml:_}=p;return o==="start"||o==="end"?cQ(n,f,h,c,u,o,v,w,_,a):o==="inside"&&uQ(n,f,h,c,a),l(),s(),!0}function cQ(e,t,n,r,o,i,s,a,l,c){const u=e.querySelector("div");u&&u.classList.add(Pa);const d=z0(a,s),f=z0(l," "),h=i==="end"?MV(f):f,m=Rl(t),p="<tr>"+d+h+"</tr>",v=Di(m),w=TV(v,p,Pa,i==="start"),_=Di(w);lo(t),Ta(t,_);const A=t.querySelector(`.${Pa}`)?.closest("tr"),b=i==="start"?A?.previousElementSibling:A?.nextElementSibling;b&&U0(b),n===r&&wp(t),RV(t,r,o,Ia);const g=i==="start"?t.querySelector(".remove-start-element-position"):t.querySelector(".remove-new-editor-element");return g&&NA(g,t,c),g}function uQ(e,t,n,r,o){const i=window.getSelection(),s=e.closest("tr"),a=e.querySelector("div");if(!i||i.rangeCount===0||!s||!a)return null;const l=i.getRangeAt(0),c=a.contains(l.startContainer)?xV(s,a,l):null;return c?(U0(c.row),s.after(c.row),lo(t),NV(t),c.content.classList.add(ag),n===r&&wp(t),NA(c.content,t,o,!0),c.content):null}function NA(e,t,n,r=!1){e.textContent&&e.textContent.length>0&&Ii(e,Ue(e).replace(Ia,"")),aQ.test(e.textContent||"")&&(e.textContent=" "),n(e,!0);const o=t.querySelector("editor"),i=o?.querySelector("div");if(i){const s=window.getSelection();if(s&&s.rangeCount>0){const a=s.getRangeAt(0);a.selectNodeContents(i),a.collapse(!0),ws(s,a)}}r&&o&&It(()=>o.focus())}function dQ(e,t){const{activeElem:n,listContext:r,cursorPositionType:o,isTargetCell:i,isEmptyText:s,commit:a,wrapEditor:l,removeTemporaryListClasses:c}=t,{classNameOl:u,classNameUl:d,isList:f}=r,h=(e.keyCode===38||e.key==="ArrowUp")&&o==="start",m=(e.keyCode===40||e.key==="ArrowDown")&&(!s&&o==="end"||s&&o==="start");if(!(h||m)||!f||!i||!n)return!1;e.preventDefault(),e.stopImmediatePropagation();const p=e.key==="ArrowUp"?"ArrowUp":"ArrowDown",v=n.closest(`table.${u}`)||n.closest(`table.${d}`);if(!v)return!0;const w=n.querySelector("div");w&&w.classList.add(Pa);const _=Rl(v),A=Di(_),b=OV(A,Pa,ag,p);lo(v),Ta(v,b);const g=v.querySelector(".remove-new-editor-element");if(g){l(g,!0);const E=v.querySelector("editor"),T=E?.querySelector("div")?.childNodes[0],y=window.getSelection();if(y&&y.rangeCount>0){const S=y.getRangeAt(0);if(T&&T.nodeType===Node.TEXT_NODE){const C=T.textContent||"";S.setStart(T,C.replace(Ia,"").length)}else E&&S.selectNodeContents(E);S.collapse(!0),ws(y,S)}}return c(),a(),!0}function fQ(e,t,n){return(e.keyCode===39||e.key==="ArrowRight")&&(t==="end"||n)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function mQ(e,t){const n=window.navigator.platform.match("Mac"),{activeElem:r,listContext:o,cursorPositionType:i,isTargetCell:s,isEmptyText:a,parentElement:l,commit:c,wrapEditor:u,removeTemporaryListClasses:d,findNodeAtPosition:f}=t,h=(...ve)=>It(()=>t.setCursorSafely(...ve)),{classNameOl:m,classNameUl:p,isList:v}=o;if(!((n?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&v)||!(!s||s&&(i==="start"||a&&i==="inside"||a&&i==="end"))||!r||!l)return!1;e.preventDefault(),e.stopImmediatePropagation();const w=r.closest(`table.${m}`)?m:p,_=l.closest("tr");if(!_)return!0;const A=_.previousElementSibling;if(!A&&!s)return!0;const b=s?r.querySelector("div"):_.querySelector("tr td:nth-child(2)")?.querySelector("div"),g=b?Ue(b):"",E=g?g.split(" ")[0]:"";E.replace(Ia,"");const T=A?.querySelector("tr td:nth-of-type(2)");if(!T)return!0;const y=T.querySelector("div");if(!y)return!0;y.classList.add(ag);const S=Ue(y),C=`${S}${g}`;lo(_.parentNode??_),_.remove();const L=y.closest(`table.${m}`)||y.closest(`table.${p}`);if(!L)return!0;const x=Ue(L),N=Di(x);Ta(L,N),w===m&&wp(L);const W=L.querySelector(".remove-new-editor-element");if(!W)return d(),c(),!0;const R=C.replace(Ia,"");Ii(W,`${R} `),u(W,!0);const P=W.closest("editor");if(!P)return d(),c(),!0;const J=window.getSelection(),ne=document.createRange(),he=P.querySelector("div");if(!he||!J)return d(),c(),!0;const re=P.textContent||"",Z=E?re.indexOf(E):-1;if(Z!==-1&&E){const ve=f(he,Z);if(ve)h(ne,J,ve.node,ve.offset);else{const de=he.childNodes[0];de&&h(ne,J,de,0)}}else{const ve=document.createElement("div");ve.innerHTML=S;const de=(ve.textContent||"").length,_e=f(he,de);if(_e)h(ne,J,_e.node,_e.offset);else{const ct=document.createTreeWalker(he,NodeFilter.SHOW_TEXT,null);let ee=null;for(;ct.nextNode();)ee=ct.currentNode;ee&&h(ne,J,ee,(ee.textContent||"").length)}}return It(()=>P.focus()),d(),c(),!0}function hQ(e,t,n){return(window.navigator.platform.match("Mac")?e.code==="Backspace":e.keyCode===46||e.keyCode===8)?!1:t&&!n?(e.preventDefault(),e.stopPropagation(),!0):!1}function pQ(e){if(!e)return!1;const t=e.closest("li");return Su(t)}function gQ(e){const t=window.getSelection(),n=e.textContent||"",r=n.trim();if(!r||r===" ")return{position:"empty",offset:0,textContent:""};if(!t||t.rangeCount===0)return{position:"middle",offset:0,textContent:n};const o=t.getRangeAt(0);if(!e.contains(o.startContainer))return{position:"middle",offset:0,textContent:n};const i=document.createRange();i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset);const s=i.toString().length;return s===0?{position:"start",offset:0,textContent:n}:s>=r.length?{position:"end",offset:s,textContent:n}:{position:"middle",offset:s,textContent:n}}function bQ(e,t){const n=Array.from(t.querySelectorAll(":scope > li")),r=n.indexOf(e);return r===0?"first":r===n.length-1?"last":"middle"}function yQ(e){const t=window.getSelection();if(!t||t.rangeCount===0)return Ue(e);const n=t.getRangeAt(0),r=document.createRange();return r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset),xA(e,r)}function xA(e,t){const n=document.createElement("div");return n.appendChild(t.cloneContents()),nn(e,n),Zo(n),Ke(n)}function vQ(e){const t=window.getSelection();if(!t||t.rangeCount===0)return"";const n=t.getRangeAt(0),r=document.createRange();return r.selectNodeContents(e),r.setStart(n.endContainer,n.endOffset),xA(e,r)}function Hi(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}function Da(e,t){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),t.setAttribute("em-edit","active"))}function EQ(e,t){const n=document.createElement("br"),r=document.createElement("span");return r.innerHTML=" ",Da(e,r),t.parentNode?.insertBefore(r,t),t.parentNode?.insertBefore(n,r),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),Hi(r),r}function SQ(e,t){const n=Array.from(t.querySelectorAll(":scope > li")),r=n.indexOf(e),o=n.slice(r+1),i=document.createElement(t.tagName.toLowerCase());t.getAttribute("style")&&i.setAttribute("style",t.getAttribute("style")),o.forEach(l=>{i.appendChild(l)});const s=document.createElement("br"),a=document.createElement("span");return a.innerHTML=" ",Da(e,a),i.children.length>0&&t.parentNode?.insertBefore(i,t.nextSibling),t.parentNode?.insertBefore(a,t.nextSibling),t.parentNode?.insertBefore(s,a),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),Hi(a),a}function wQ(e,t){if(!((e.key==="Enter"||e.keyCode===13)&&!e.shiftKey))return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0).startContainer,o=r.nodeType===Node.TEXT_NODE?r.parentElement:r;if(!pQ(o))return!1;const i=o?.closest("li");if(!i)return!1;const s=i.closest("ul, ol");if(!s)return!1;e.preventDefault(),e.stopImmediatePropagation();const a=gQ(i),l=bQ(i,s);switch(a.position){case"empty":_Q(i,s,l,t);break;case"start":CQ(i,s,t);break;case"end":TQ(i,s,t);break;case"middle":AQ(i,s,t)}return t.commit(),!0}function _Q(e,t,n,r){switch(n){case"last":const o=document.createElement("li");o.setAttribute("style",Gn.LIST_ITEM),o.innerHTML=" ",e.after(o),Da(e,o),Hi(o);break;case"first":EQ(e,t);break;case"middle":SQ(e,t)}}function CQ(e,t,n){const r=document.createElement("li");r.setAttribute("style",Gn.LIST_ITEM),r.innerHTML=" ",e.before(r),Hi(e)}function TQ(e,t,n){const r=document.createElement("li");r.setAttribute("style",Gn.LIST_ITEM),r.innerHTML=" ",e.after(r),Da(e,r),Hi(r)}function AQ(e,t,n){const r=yQ(e),o=vQ(e);Ii(e,r||" ");const i=document.createElement("li");i.setAttribute("style",Gn.LIST_ITEM),Ii(i,o||" "),e.after(i),Da(e,i),Hi(i)}function kQ(e){const t=r=>eh({target:r.target},o=>e.commit(o)),n=()=>j.get("commonStyles");return function(o){const i=window.getSelection(),s=(i?.rangeCount?i.getRangeAt(0):null)?.commonAncestorContainer,a=s?.nodeType===1?s:s?.parentElement,l=a?.closest("editor"),c=window.navigator.platform.match("Mac"),u=l?_V(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),f=o.target,h=wu(f),{isList:m}=h,p=d?.textContent===l?.textContent,v=l?sT.EMPTY_TEXT.test(l.textContent||""):!1,w=c?o.metaKey:o.ctrlKey;if(w&&o.keyCode===83){o.preventDefault(),e.messageService.send({operation:"application_action",action:"save_email"});return}const _=vY(o,!!w);if(_){o.preventDefault(),tA(e.messageService,_);return}if(o.altKey&&o.keyCode===88){o.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}if(CY(o,{commit:e.commit}))return;AY(o,{commit:e.commit}),o.key==="Enter"&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&!o.isComposing&&Nv();const A={getElementParent:y=>Ri(y),setCursorPosition:e.setCursorPosition,removeElementEditors:()=>Bi(void 0),getVariableByIcon:ua,removeEmptyParents:Oa,getAllComments:v$,isVariableComment:U_,getVariableIcon:y=>w$(y),commit:e.commit,messageService:e.messageService};if(wY(o,m,u,A))return;if(o.keyCode===27){const y=document.querySelector(".em-editor-wrapper");y?.style&&(y.style.display="none"),Lr("em-edit"),It(()=>document.querySelectorAll("editor").forEach(S=>S.blur())),i?.removeAllRanges(),e.applicationElementSettingsSet({elem:null}),e.messageService.send({operation:"application_close-image-edit-popup"});return}w&&o.keyCode===66&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strong"}));const b=c?o.keyCode===88:o.keyCode===53;if((c?o.metaKey:o.altKey)&&o.shiftKey&&b&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strikethrough"})),w&&o.shiftKey&&o.keyCode===76&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_left"})),w&&o.shiftKey&&o.keyCode===82&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_right"})),w&&o.shiftKey&&o.keyCode===69&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_center"})),w&&o.keyCode===73&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_italic"})),w&&o.keyCode===85&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_underline"})),wQ(o,{commit:e.commit})||kY(o,l,m,p,{commit:e.commit}))return;if(w&&o.keyCode===86){e.setIsPasteFromContextMenu(!1);const y=S=>{ql(S,!1,n(),t,e.commit),document.removeEventListener("paste",y)};document.addEventListener("paste",y)}else t(o);const g={activeElem:l,listContext:h,cursorPositionType:u,isTargetCell:p,isEmptyText:v,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:()=>uG()};if(lQ(o,g)||(fQ(o,u,v),dQ(o,g)))return;const E={...g,parentElement:a,findNodeAtPosition:uT,setCursorSafely:LG};if(mQ(o,E)||hQ(o,m,p))return;const T={setCursorInsideSpan:C$,isCaretAtEndOfStandardElement:T$,setCursorPositionSimple:A$,commit:e.commit};_Y(o,T)&&e.commit()}}function LQ(e,t){if(!(document.body?.classList.contains("mceNonEditable")||t.isIntegratorLocked())&&!(!e.target?.closest?.('[contenteditable="true"]')||!e.key||e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1){e.preventDefault(),e.stopImmediatePropagation();const n=window.getSelection();if(n?.isCollapsed&&n.rangeCount>0&&i_(n,e.key)){ao(!0);return}lr("insertText",!1,e.key)}}function NQ(e){const t=n=>LQ(n,e);return document.addEventListener("keydown",t,!0),{dispose(){document.removeEventListener("keydown",t,!0)}}}function xQ(e){const t=XZ({handlePasteTextFragment:ql,getCommonStyles:()=>j.get("commonStyles"),changeMsoValue:n=>eh({target:n.target},r=>e.commit(r)),commit:e.commit});document.addEventListener("keydown",kQ({...e,setIsPasteFromContextMenu:n=>t.setFromContextMenu(n)}),!1),document.addEventListener("beforeinput",n=>SY(n,e),!0),NQ(e.editLock)}var OQ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z"/></svg>',Fu=4;function RQ(e,t){return e.left<Fu||e.right-e.left>t-8?Fu-e.left:e.right>t-Fu?t-Fu-e.right:0}var Fi=null,lg=null;function cg(e,t){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))return;Fi||(Fi=new CSSStyleSheet),document.adoptedStyleSheets.includes(Fi)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,Fi]),Fi.replaceSync("");const n=e.getBoundingClientRect();if(n.width===0)return;lg=e;const r=Math.round(RQ(n,document.documentElement.clientWidth));r!==0&&Fi.replaceSync(`${t} { margin-left: ${r}px; }`)}function MQ(e,t,n){e.addEventListener("mouseenter",()=>{lg=null,cg(t,n)}),e.addEventListener("mousemove",()=>{lg!==t&&cg(t,n)}),t.addEventListener("mouseenter",()=>cg(t,n))}function To(e,t){return{settings:e,elem:t}}var Xe={applicationElementSettingsSet:e=>O(Mt,Ie)(e),setCursorPosition:e=>O(Mt,yt)(e),commit:ao};function PQ(){return j.get("emailWidth")||475}function $u(){return document.documentElement.clientWidth<=PQ()}function ug(e,t,n,r){const o=e;o.style.cursor=n,o.mousemove=t;const i=()=>{window.getSelection()?.removeAllRanges(),Xe.applicationElementSettingsSet({elem:e});const s=document.querySelector("[em-edit]");s&&Xe.setCursorPosition(s),Be(document.documentElement,!0,"em-resize-start")};o.addEventListener("touchstart",s=>{const a=s.touches[0];if(s.touches.length!==1||!a)return;s.preventDefault(),i();let l={x:a.clientX,y:a.clientY};const c={x:0,y:0},u=document.documentElement,d=h=>{const m=h.touches[0];if(!m)return;h.preventDefault(),c.x+=m.clientX-l.x,c.y+=m.clientY-l.y,l={x:m.clientX,y:m.clientY};const p={x:Math.trunc(c.x),y:Math.trunc(c.y)};p.x===0&&p.y===0||(c.x-=p.x,c.y-=p.y,o.mousemove({movementX:p.x,movementY:p.y}))},f=()=>{u.removeEventListener("touchmove",d),u.removeEventListener("touchend",f),u.removeEventListener("touchcancel",f),o.stopDrag()};u.addEventListener("touchmove",d,{passive:!1}),u.addEventListener("touchend",f),u.addEventListener("touchcancel",f)},{passive:!1}),o.onmousedown=function(){i();try{document.documentElement.addEventListener("mousemove",o.doDrag,!1),document.documentElement.addEventListener("mouseup",o.stopDrag,!1)}catch{}},o.doDrag=function(s){if(s.which!=1){o.stopDrag();return}o.mousemove(s)},o.stopDrag=function(){document.documentElement.removeEventListener("mousemove",o.doDrag,!1),document.documentElement.removeEventListener("mouseup",o.stopDrag,!1),r&&r(),setTimeout(()=>{Be(document.documentElement,!1,"em-resize-start"),Xe.commit(!1)})}}function Ao(e,t,n){ug(e,t,"ns-resize",n)}function Ba(e,t,n){ug(e,t,"ew-resize",n)}function IQ(e,t,n){ug(e,t,"nwse-resize",n)}function ko(e,t){let n=null,r=0;const o=$u();if(e.closest('div[style*="font-size"][style*="line-height"]')){if(n=e.closest('div[style*="height"][style*="line-height"]'),!n)return;r=n.clientHeight+t,o?Oi(To({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):(n.style.height=r+"px",n.style.lineHeight=r+"px")}else if(e.closest(".em-gap")){if(n=e.closest(".em-gap"),!n)return;n.classList.add("em-hover"),r=n.clientHeight+t,n.closest("tr")?.querySelectorAll(".em-gap").forEach(i=>{const s={mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},a=i.closest(".em-mob-wrap, .noresp-em-mob-wrap");Oi(To(s,a)),i.style.height=r+"px";const l=i.querySelector(".em-element-gap-value");l&&(l.innerHTML=r+"px")})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(n=e.closest(".em-vindent-paddingTop"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientHeight+t,n.style.height=r+"px",o&&i?Ea(To({mobilePadding:{top:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingTop=r+"px")}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(n=e.closest(".em-vindent-paddingBottom"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientHeight+t,n.style.height=r+"px",o&&i?Ea(To({mobilePadding:{bottom:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingBottom=r+"px")}else{if(n=e.closest("td"),!n)return;r=n.clientHeight+t,o?Oi(To({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):n.setAttribute("height",String(r))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Xe.commit()}function Lo(e){let t=null;const n=$u();if(e.closest('div[style*="height"][style*="line-height"]')){if(t=e.closest('div[style*="height"][style*="line-height"]'),!t)return;parseInt(t.style.height)<=0?t.remove():Xe.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Xe.applicationElementSettingsSet({elem:Ah(t)})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(t=e.closest(".em-vindent-paddingTop"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-top"):r&&Xe.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(t=e.closest(".em-vindent-paddingBottom"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-bottom"):r&&Xe.applicationElementSettingsSet({elem:r})}else{if(t=e.closest("td"),!t)return;const r=t.getAttribute("height");r&&parseInt(r)<=0?t.closest("table")?.remove():Xe.applicationElementSettingsSet({elem:t})}t&&Xe.commit()}function $i(e,t){let n=null,r=0;const o=$u();if(e.closest(".em-element-resize-img-container")){const i=e.closest(".em-element-resize-img-container")?.querySelector("img");if(!i)return;const s=i.clientWidth+t;i.style.maxWidth=s+"px",i.setAttribute("width",String(s)),Xe.commit()}else if(e.closest(".em-gap")){if(n=e.closest(".em-gap"),!n)return;if(n.classList.add("em-hover"),r=n.clientWidth+t,r>=0){const i=n.clientWidth,s=Array.from(n.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(odd)")||[]).map(u=>u.clientWidth),a=s.reduce((u,d)=>u+d,0),l=a+(s.length-1)*i,c=n.closest("tr");if(!c)return;if(l-3<=c.clientWidth||t<=0){let u=Array.from(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")).filter(v=>v.dataset.percent).map(v=>v.dataset.percent);u.length||(u=s.map(v=>((v||0)/a*100).toFixed(1)),jl(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*r,f=(v,w)=>Math.round(w*parseFloat(v)/100);let h=s.map((v,w)=>f(u[w],d));const m=l-(h.reduce((v,w)=>v+w,0)+(s.length-1)*r);if(m!==0){const v=h.length-Math.abs(m);h=h.map((w,_)=>v<=_?w+(m>0?1:-1):w)}const p=h;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((v,w)=>{Array.from(v.querySelectorAll("table[width]")).filter(_=>!_.getAttribute("width")?.includes("%")).forEach(_=>{+(_.getAttribute("width")||0)<=p[w]&&(_.style.maxWidth=String(p[w]),_.setAttribute("width","100%"))})}),n.style.width=r+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((v,w)=>v.setAttribute("width",String(p[w]))),c.querySelectorAll(".em-gap").forEach(v=>{v.parentElement?.setAttribute("width",String(r)),v.style.width=r+"px";const w=v.querySelector(".em-element-gap-value");w&&(w.innerHTML=r+"px")})}}}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(n=e.closest(".em-vindent-paddingLeft"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientWidth+t,n.style.width=r+"px",o&&i?Ea(To({mobilePadding:{left:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingLeft=r+"px",i.querySelectorAll(":scope > table").forEach(s=>_u(s)))}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(n=e.closest(".em-vindent-paddingRight"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientWidth+t,n.style.width=r+"px",o&&i?Ea(To({mobilePadding:{right:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingRight=r+"px",i.querySelectorAll(":scope > table").forEach(s=>_u(s)))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value, .em-element-gap-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Xe.commit()}function Wi(e){let t=null;const n=$u();if(e.closest(".em-element-resize-img-container")){const r=e.closest(".em-element-resize-img-container")?.querySelector("img");r&&(Xe.applicationElementSettingsSet({elem:r}),Xe.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Xe.applicationElementSettingsSet({elem:Ah(t)});else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(t=e.closest(".em-vindent-paddingLeft"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-left"):r&&Xe.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(t=e.closest(".em-vindent-paddingRight"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-right"):r&&Xe.applicationElementSettingsSet({elem:r})}t&&Xe.commit()}var OA={getLocale:Mi,commit:ao,messageService:z},DQ=".em-prevent-action",RA=new WeakSet;function BQ(){return j.get("emailWidth")||475}function HQ(){return j.get("isLeftButtonDown")||!1}function FQ(){return j.get("editImageControlEnabled")||!1}function MA(){return j.get("imageCenterEditorEnabled")||!1}function $Q(){return j.get("imageCenterStockEnabled")||!1}function WQ(){return j.get("imageCenterGifEnabled")||!1}function qQ(){return j.get("elementAIimageEnabled")||!1}function zQ(e){if(document.body?.classList.contains("em-native-file-drag"))return;const t=OA.getLocale(),n=BQ(),r=HQ(),o=MA(),i=document.documentElement.clientWidth<=(n||475);if(document.body&&!document.body.classList.contains("mceNonEditable")&&!r){if(e.tagName==="TD"&&e.innerHTML===""&&e.getAttribute("height")&&!e.classList.contains("em-vindent")&&!e.closest("editor")){e.classList.add("em-vindent"),e.closest("table")?.classList.add("em-vindent-table"),parseInt(e.getAttribute("height")||"0")<30&&e.classList.add("em-vindent_low");const m=D({targetElement:e,insertType:"append",className:"em-element-resize-height"});D({targetElement:e,insertType:"append",className:"em-element-vindent"}),D({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Ao(m,function(p){ko(m,p.movementY)},function(){Lo(m)})}if(e.closest(DQ))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const m=uo(e,"em-mob-height"),p=m?parseFloat(m.substring(14,m.length-2)):void 0;D({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(p||e.getAttribute("height"))+"px":e.getAttribute("height")+"px"}),!i||!p?parseInt(e.getAttribute("height")||"0")<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):p<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}if(e.tagName==="DIV"&&e.style.height&&e.style.fontSize&&!e.classList.contains("em-vindent")&&!e.closest("editor")&&e.style.height&&e.style.lineHeight&&!e.style.fontFamily){e.classList.add("em-vindent"),parseFloat(e.style.height)<30&&e.classList.add("em-vindent_low");const m=D({targetElement:e,insertType:"append",className:"em-element-resize-height"}),p=D({targetElement:e,insertType:"append",className:"em-element-vindent"});D({targetElement:p,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),D({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Ao(m,function(v){ko(m,v.movementY)},function(){Lo(m)})}if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.style.height&&e.style.fontSize&&!e.querySelector(".em-element-vindent-value")){const m=uo(e,"em-mob-height"),p=m?parseFloat(m.substring(14,m.length-2)):void 0;D({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(p||parseFloat(e.style.height))+"px":parseFloat(e.style.height)+"px"}),!i||!p?parseFloat(e.style.height)<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):p<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}const s=uo(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=uo(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=uo(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,f=uo(e,"em-mob-padding_right"),h=f?parseFloat(f.substring(21)):void 0;if((e.style.padding||e.style.paddingTop||e.style.paddingBottom||e.style.paddingLeft||e.style.paddingRight)&&!e.closest("editor")&&(e.tagName!=="A"||e.style.height)){if(e.style.paddingTop&&!e.querySelector(":scope > .em-vindent-paddingTop")&&!e.querySelector(":scope > editor > .em-vindent-paddingTop")&&(!a||!i)){const m=D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${e.style.paddingTop}`});e.getBoundingClientRect().top<30&&m.classList.add("top-crossed")}e.style.paddingBottom&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&!e.querySelector(":scope > editor > .em-vindent-paddingBottom")&&(!c||!i)&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${e.style.paddingBottom}`}),e.style.paddingLeft&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&!e.querySelector(":scope > editor > .em-vindent-paddingLeft")&&(!d||!i)&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${e.style.paddingLeft}`}),e.style.paddingRight&&!e.querySelector(":scope > .em-vindent-paddingRight")&&!e.querySelector(":scope > editor > .em-vindent-paddingRight")&&(!h||!i)&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${e.style.paddingRight}`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(m=>{if(!m.querySelector(".em-element-resize-height")){const p=m;(parseFloat(p.style.height)<30||parseFloat(p.style.width)<30)&&m.classList.add("em-vindent_low");const v=D({targetElement:p,insertType:"append",className:"em-element-resize-height"});D({targetElement:p,insertType:"append",className:"em-element-vindent-marker"}),D({targetElement:p,insertType:"append",className:"em-element-vindent-bg"});const w=D({targetElement:p,insertType:"append",className:"em-element-vindent"});let _="";p.className.indexOf("paddingTop")>-1?(_=e.style.paddingTop,Ao(v,function(A){ko(v,A.movementY)},function(){Lo(v)})):p.className.indexOf("paddingBottom")>-1?(_=e.style.paddingBottom,Ao(v,function(A){ko(v,A.movementY)},function(){Lo(v)})):p.className.indexOf("paddingLeft")>-1?(_=e.style.paddingLeft,Ba(v,function(A){$i(v,A.movementX)},function(){Wi(v)})):p.className.indexOf("paddingRight")>-1&&(_=e.style.paddingRight,Ba(v,function(A){$i(v,-A.movementX)},function(){Wi(v)})),D({targetElement:w,insertType:"append",className:"em-element-vindent-value",HTMLcontent:_})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&i&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),h&&!e.querySelector(":scope > .em-vindent-paddingRight")&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${h}px`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(m=>{if(!m.querySelector(".em-element-resize-height")){const p=m;(parseFloat(p.style.height)<30||parseFloat(p.style.width)<30)&&m.classList.add("em-vindent_low");const v=D({targetElement:p,insertType:"append",className:"em-element-resize-height"});D({targetElement:p,insertType:"append",className:"em-element-vindent-marker"}),D({targetElement:p,insertType:"append",className:"em-element-vindent-bg"});const w=D({targetElement:p,insertType:"append",className:"em-element-vindent"});let _="";p.className.indexOf("paddingTop")>-1?(_=a,Ao(v,function(A){ko(v,A.movementY)},function(){Lo(v)})):p.className.indexOf("paddingBottom")>-1?(_=c,Ao(v,function(A){ko(v,A.movementY)},function(){Lo(v)})):p.className.indexOf("paddingLeft")>-1?(_=d,Ba(v,function(A){$i(v,A.movementX)},function(){Wi(v)})):p.className.indexOf("paddingRight")>-1&&(_=h,Ba(v,function(A){$i(v,-A.movementX)},function(){Wi(v)})),D({targetElement:w,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(_)})}})),e.closest('[em="block"]')?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length||0)>2&&!e.closest('[em="block"]')?.querySelector(".em-mob-wrap .em-gap, .noresp-em-mob-wrap .em-gap")){const m=uo(e.closest('[em="block"]')?.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),"em-mob-height"),p=m?parseFloat(m.substring(14,m.length-2)):void 0;e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(v=>{D({targetElement:v,insertType:"append",className:"em-gap",style:i?`height: ${p}px;`:`width: ${v.getAttribute("width")}px;`})}),e.closest('[em="block"]')?.querySelectorAll(".em-gap").forEach(v=>{if(!v.querySelector(".em-element-resize-height")){const w=v,_=D({targetElement:w,insertType:"append",className:"em-element-resize-height"});D({targetElement:w,insertType:"append",className:"em-element-gap-marker"}),D({targetElement:w,insertType:"append",className:"em-element-gap-bg"});const A=D({targetElement:w,insertType:"append",className:"em-element-gap"});let b="";i?(b=w.style.height,Ao(_,function(g){ko(_,g.movementY)},function(){Lo(_)})):(b=w.style.width,Ba(_,function(g){$i(_,g.movementX)},function(){Wi(_)})),D({targetElement:A,insertType:"append",className:"em-element-gap-value",HTMLcontent:b})}})}if(e.tagName==="IMG"){const m=e;if(m.closest("td[em-platform], td[data-em-platform]"))return;if(m.closest(".em-element-resize-img-container")||m.closest('div[style*="font-size"][style*="line-height"][style*="font-family"]')||m.closest("editor")||m.classList.contains("em-video")){if(m.closest(".em-element-resize-img-container")){const _=m.closest(".em-element-resize-img-container"),A=_.querySelector(".em-element-img-edit");!m.getAttribute("src")?.includes(".gif")&&o?A||D({targetElement:_.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:Oe(Ma,`${xe}`),title:t.CHANGE_IMAGE_EDIT}):_.querySelector(".em-element-img-edit")?.remove()}return}const p=document.createElement("span");p.classList.add("em-element-resize-img-container"),Mv(p),Pv(p);const v=m.parentElement instanceof HTMLAnchorElement?m.parentElement:m;v.parentElement?.insertBefore(p,v),p.appendChild(v);const w=D({targetElement:p,insertType:"append",tag:"span",className:"em-element-resize-img"});IQ(w,function(_){$i(w,_.movementX)},function(){Wi(w)}),m?.style.maxWidth&&m?.style.display==="block"&&m.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),UQ(m,p)}}}function UQ(e,t){const n=OA;if(!n||t.querySelector(".em-element-img-change-group"))return;const r=n.getLocale(),o=FQ(),i=MA(),s=$Q(),a=WQ(),l=qQ();if(o&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=D({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if(D({targetElement:c,insertType:"append",className:"em-element-img-change",HTMLcontent:'<svg viewBox="0 0 20 20" focusable="false" data-icon="bg-colors" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M3.75 17.5C3.41667 17.5 3.125 17.375 2.875 17.125C2.625 16.875 2.5 16.5833 2.5 16.25V3.75C2.5 3.41667 2.625 3.125 2.875 2.875C3.125 2.625 3.41667 2.5 3.75 2.5H16.25C16.5833 2.5 16.875 2.625 17.125 2.875C17.375 3.125 17.5 3.41667 17.5 3.75V16.25C17.5 16.5833 17.375 16.875 17.125 17.125C16.875 17.375 16.5833 17.5 16.25 17.5H3.75ZM3.75 16.25H16.25V3.75H3.75V16.25ZM4.91667 14.2292H15.1042L12.0417 10.1458L9.29167 13.7083L7.35417 11.0625L4.91667 14.2292Z"></path></svg>',title:r.CHANGE_IMAGE}),!e.getAttribute("src")?.includes(".gif")&&i&&D({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:Oe(Ma,`${xe}`),title:r.CHANGE_IMAGE_EDIT}),s&&D({targetElement:c,insertType:"append",className:"em-element-img-stock",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M4.12726 7.18183H9.6909L7.86364 4.76364L6.44545 6.63637L5.4909 5.49092L4.12726 7.18183ZM0.909082 11.3636C0.659082 11.3636 0.445068 11.2746 0.267041 11.0966C0.0890136 10.9186 0 10.7046 0 10.4546V2.99999H0.909082V10.4546H10.7273V11.3636H0.909082ZM2.72726 9.54546C2.47726 9.54546 2.26325 9.45644 2.08522 9.27842C1.90719 9.10039 1.81818 8.88638 1.81818 8.63638V1.90908C1.81818 1.65908 1.90719 1.44507 2.08522 1.26704C2.26325 1.08901 2.47726 1 2.72726 1H5.81817L6.90908 2.09091H11.0909C11.3409 2.09091 11.5549 2.17992 11.733 2.35795C11.911 2.53598 12 2.74999 12 2.99999V8.63638C12 8.88638 11.911 9.10039 11.733 9.27842C11.5549 9.45644 11.3409 9.54546 11.0909 9.54546H2.72726ZM2.72726 8.63638H11.0909V2.99999H6.53182L5.44091 1.90908H2.72726V8.63638Z"></path></svg>',title:r.CHANGE_IMAGE_STOCK}),D({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:Oe(OQ,`${xe}`),title:r.CHANGE_IMAGE_CHANGETO}),a&&D({targetElement:c,insertType:"append",className:"em-element-img-gif",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><<path d="M5.68571 8.14286V3H6.79999V8.14286H5.68571ZM0.771429 8.14286C0.54 8.14286 0.353571 8.06786 0.212143 7.91786C0.0707142 7.76786 0 7.58571 0 7.37143V3.77143C0 3.55714 0.0707142 3.375 0.212143 3.225C0.353571 3.075 0.54 3 0.771429 3H3.40001C3.63144 3 3.81786 3.075 3.95929 3.225C4.10072 3.375 4.17144 3.55714 4.17144 3.77143V4.11429H1.11429V7.02857H3.05715V5.57143H4.17144V7.37143C4.17144 7.58571 4.10072 7.76786 3.95929 7.91786C3.81786 8.06786 3.63144 8.14286 3.40001 8.14286H0.771429ZM8.25714 8.14286V3H12V4.11429H9.37142V5.25714H11.1V6.37142H9.37142V8.14286H8.25714Z"></path></svg>',title:r.CHANGE_IMAGE_GIF}),l&&D({targetElement:c,insertType:"append",className:"em-element-img-ai",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"></path><path d="M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"></path><path d="M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"></path><path d="M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"></path></svg>',title:r.CHANGE_IMAGE_AI}),n.commit(!1),RA.has(c))return;RA.add(c),MQ(t,c,".em-element-resize-img-container:hover > .em-element-img-change-group:hover"),c.addEventListener("click",function(u){const d=u.target.closest('i[class*="em-element-img"]'),f=e.getAttribute("src");let h="application_open-image-edit-popup";e.classList.contains("em-ai-img")||d?.classList.contains("em-element-img-ai")?h="application_open-image-ai-popup":dq(f)||d?.classList.contains("em-element-img-changeto")?h="application_open-image-upload-popup":d?.classList.contains("em-element-img-gif")?h="application_open-image-gif-popup":d?.classList.contains("em-element-img-stock")&&(h="application_open-image-stock-popup");const m={operation:h,src:f};setTimeout(()=>{n.messageService.send(m)},100)})}}function PA(e){const t=e.ownerDocument.activeElement;return t instanceof HTMLElement&&t!==e.ownerDocument.body&&t.closest('[contenteditable="true"]')!==null&&e.contains(t)}function jQ(e){const t=(n,r)=>{PA(n)||e.wrapEditor(n,r)};return function(r){let o=r.target;const i=e.selectionLock.acquire();try{o=e.getVisibleNode(o);const s=e.isInExternal(o),a=document.body;if(a?.classList.contains("mceNonEditable")&&!a.classList.contains("em-sandbox-discuss")||a?.classList.contains("em-sandbox-discuss")&&!a.classList.contains("em-sandbox-discuss_set-target"))return;if(a?.classList.contains("em-sandbox-discuss_set-target")){document.querySelectorAll('[em-hover="true"]').forEach(f=>{f.removeAttribute("em-hover"),f.removeAttribute("contenteditable")}),o.closest(".em-element-vindent")||(o.setAttribute("em-hover","true"),o.setAttribute("contenteditable","true"));return}if(o.tagName!=="BODY"){const f=o.parentElement;r_(o)&&!o.isConnected&&f&&(o=f)}if(o&&(o?.closest('[em="atom"]')||!s)&&o.getAttribute("contenteditable")!=="false"&&o.parentElement?.getAttribute("contenteditable")!=="false"&&o.tagName!=="BODY"&&o.parentElement?.tagName!=="SECTION"){const f=!o.closest("editor")&&!PA(o),h=!e.getLockEditorInit(),m=o.tagName!=="IMG",p=!(o.childElementCount===1&&o.firstElementChild?.tagName==="IMG"&&(o.textContent?.trim()??"")==="");if(f&&h&&m&&p){let v=o;do if(v=v.closest("div, p, h1, h2, h3, h4, h5")||v.closest("span, b, strong, i, em, s, a, sup, sub"),v)if(!e.isVisible(v))v=v.parentElement;else break;while(v);if(o.tagName==="LI"&&o.style.fontFamily&&o.style.fontSize){const w=o.closest("ul, ol");w&&t(w,!0)}else if(o.tagName==="TD"&&o.style.fontFamily&&o.style.fontSize&&!o.querySelector("editor"))t(o);else if(v&&v.style.fontFamily&&v.style.fontSize&&(o.tagName==="LI"||!o.querySelector("img")))if(o.tagName==="LI"){const w=o.closest("ul, ol");w&&t(w,!0)}else o.querySelector("img")||t(o,!0);else if(v&&v.closest('[style*="font-family"][style*="font-size"]')){const w=v.closest('[style*="font-family"][style*="font-size"]');w&&w.tagName!=="BODY"&&w.tagName!=="TD"&&w.tagName!=="TABLE"?t(w,!1):w?.tagName==="TD"&&!w.querySelector("editor")&&!w.closest(".em-element-custom-table")&&t(w)}else if(v&&v?.tagName==="DIV"&&!v.querySelector("table")){const w=!!v.style.height?.length,_=v.className.includes("em-element-img-change-group"),A=v.querySelector("img")?.parentNode,b=!!v.querySelector("img")&&A&&!e.hasTextNodeInElement(A);!w&&!_&&!b&&t(v,!0)}else for(let w=0;w<o.childNodes.length;w++){const _=o.childNodes[w];if(_.nodeName==="#text"&&(_.textContent?.trim().length??0)>0&&!o.querySelector("table")){const A=o.tagName==="P"?o.parentElement:o;A&&t(A);break}}}}(o?.closest('[em="atom"]')||!s)&&!e.getIsLeftButtonDown()&&e.implementElementsEditors(o),o?.classList.contains("em-element-vindent-bg")&&(o=o.closest(".em-vindent")),o?.closest(".em-gap")?o.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(even) .em-gap").forEach(f=>f.classList.add("em-hover")):e.getIsLeftButtonDown()||document.querySelectorAll(".em-gap").forEach(f=>f.classList.remove("em-hover"));const l=e.getLoadStylesTimer(),c=!!o.style.padding||!!o.style.paddingTop||!!o.style.paddingBottom||!!o.style.paddingLeft||!!o.style.paddingRight,u=o.closest('[em="block"]'),d=!!u?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(u?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length??0)>2;l&&(o.tagName==="TD"&&(o.innerHTML===""||o.querySelector(".em-element-vindent"))&&o.getAttribute("height")||o.tagName==="DIV"&&o.style.height&&o.style.fontSize||o.tagName==="IMG"||c||d)&&e.implementResizableElems(o)}catch{}finally{i.releaseLater()}}}function VQ(e){return function(){e.removeElementEditors(),document.querySelectorAll('[em="group"] .em-element-editor, .em-element-path, .em-element-block-add').forEach(n=>{n.remove(),e.commit(!1)})}}function Wu(e){e.button===0&&j.set("isLeftButtonDown",!1)}function IA(e){e.shiftKey||e.button===2||window.getSelection()?.removeAllRanges(),e.button===0&&j.set("isLeftButtonDown",!0)}function GQ(e){const t=()=>e.openEditorInit();return document.addEventListener("mousedown",IA),document.addEventListener("mouseup",Wu),document.addEventListener("dragend",Wu),window.addEventListener("mousemove",t),{dispose(){document.removeEventListener("mousedown",IA),document.removeEventListener("mouseup",Wu),document.removeEventListener("dragend",Wu),window.removeEventListener("mousemove",t)}}}function XQ(e,t,n){if(e.caretPositionFromPoint){const r=e.caretPositionFromPoint(t,n);if(!r)return null;const o=e.createRange();return o.setStart(r.offsetNode,r.offset),o.collapse(!0),o}return e.caretRangeFromPoint?.(t,n)??null}function KQ(e){return function(n){const r=n.target;if(n.button!==0||n.shiftKey||!(r instanceof HTMLElement)||e.isEditLocked()||document.body?.classList.contains("mceNonEditable")||r.closest("editor")||(e.unlockEditorInit(),e.handleMouseover(n),r.closest("em-replace")))return;const o=(r.isConnected?r:document.elementFromPoint(n.clientX,n.clientY))?.closest("editor");if(!o)return;const i=XQ(document,n.clientX,n.clientY);if(i&&o.contains(i.startContainer)){const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}}}function DA(e,t,n){const r=va(e,n),o=r===void 0?void 0:t.cells.find(i=>i.id===r);return o?{row:o.row,col:o.col}:null}function YQ(){const e=new Map,t=r=>{Be(r,!1,e.get(r)),e.delete(r)},n=(r,o)=>{Be(r,!0,o),e.set(r,o)};return{paint(r){const o=new Set(r);[...e].filter(([i,s])=>s==="em-active-table-cell"&&!o.has(i)).forEach(([i])=>t(i)),r.filter(i=>!e.has(i)).forEach(i=>n(i,yo))},mark:n,highlighted(){return[...e].filter(([,r])=>r===yo).map(([r])=>r)},clear(){[...e.keys()].forEach(t)}}}function ZQ(e,t){const n=YQ();let r=null,o=null,i=null;const s=()=>r&&e.contains(r)&&r.classList.contains("remove-basic-cell")?r:null,a={base:s,direction:()=>s()?i:null,selected:()=>s()?n.highlighted().filter(l=>e.contains(l)):[],start(l){t.activate(a),a.clear(),r=l,n.mark(l,bo)},clear(){r=null,o=null,i=null,n.clear(),ez(e)&&e.isConnected&&t.commit(!0)}};return{selection:a,press(l){a.start(l);const c=Li(e),u=DA(e,c,l);o=u?{model:c,base:u}:null},hover(l){const c=o&&DA(e,o.model,l);if(!o||!c)return;const u=nU(o.model,o.base,c);i=u?.direction??null;const d=(u?.cellIds??[]).map(f=>rp(e,f));n.paint(d.filter(f=>!!f))},release(){o=null}}}function qu(e,t,n,r){const o=pt(r);t.addEventListener(n,o),e.addEventListener("abort",()=>t.removeEventListener(n,o),{once:!0})}function QQ(e,t,n){const r=new AbortController,o=()=>e.isConnected?!1:(r.abort(),t.selection.clear(),n.forget(e,t.selection),!0),i=u=>{const d=rg(u.target);return d?.table===e?d.td:null},s=u=>{const d=u.button===0?i(u):null;d&&t.press(d)},a=u=>{if((u.buttons&1)===0){t.release();return}const d=i(u);d&&t.hover(d)},l=()=>{o()||t.release()},c=u=>{!o()&&u.target instanceof Node&&!e.contains(u.target)&&t.selection.clear()};qu(r.signal,e,"mousedown",s),qu(r.signal,e,"mouseover",a),qu(r.signal,document,"mouseup",l),qu(r.signal,document,"click",c)}function JQ(e){return t=>{const n=rg(t.target);n&&e.of(n.table)}}function eJ(e){const t=new WeakMap;let n=null;const r={commit:e.commit,activate(o){n&&n!==o&&n.clear(),n=o},forget(o,i){t.delete(o),n=n===i?null:n}};return{of(o){const i=t.get(o);if(i)return i;const s=ZQ(o,r);return QQ(o,s,r),t.set(o,s.selection),s.selection}}}var tJ=1e3;function nJ(e){setTimeout(()=>j.set("loadStylesTimer",!0),tJ);const t=jQ({getVisibleNode:n=>e.htmlDocument.getVisibleNode(n),isInExternal:n=>e.htmlDocument.isInExternal(n),isVisible:n=>e.htmlDocument.isVisible(n),selectionLock:e.selectionLock,getLockEditorInit:()=>e.editLock.isEditorInitClosed(),getIsLeftButtonDown:()=>!!j.get("isLeftButtonDown"),getLoadStylesTimer:()=>!!j.get("loadStylesTimer"),hasTextNodeInElement:r5,wrapEditor:e.wrapEditor,implementElementsEditors:n=>sQ(n,{setBlockGroupControlsPosition:()=>Jc({scrollTop:j.get("scrollTop")}),commit:e.commit}),implementResizableElems:n=>zQ(e.htmlDocument.getVisibleNode(n)),commit:e.commit});document.onmouseover=pt(n=>{t(n),e.onHover?.(n.target)}),document.onmouseleave=VQ({removeElementEditors:()=>Bi(void 0),commit:e.commit}),document.addEventListener("mousedown",KQ({isEditLocked:()=>e.editLock.isTextLocked(),unlockEditorInit:()=>e.editLock.openEditorInit(),handleMouseover:t}),!0),document.addEventListener("mousedown",pt(JQ(e.tableSelections)),!0),GQ(e.editLock)}function rJ(e){return t=>O(e,ss)(t)}function oJ(e){return e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement??null}var iJ={name:"sandbox.elementSettings",provides:[Ie],awaits:{services:[X,Bo,Ho,Ne,Io]},setup(e){const t=O(e,Bo),n=O(e,Io);e.inject(Ie,AG({htmlDocument:O(e,X),getMapObj:()=>t,fingerprint:O(e,Ho),selectionLock:O(e,Ne),enrichExtras:()=>e.getServices(Nb).reduce((r,o)=>({...r,...o()}),{}),elementRefOf:r=>n.issue(r)}))}},sJ={name:"sandbox.documentChange",awaits:{services:[X,Ho,Ie,it,Te,ss,Ne,Ye]},setup:e=>o$({htmlDocument:O(e,X),fingerprint:O(e,Ho),initPreview:rJ(e),applicationElementSettingsSet:O(e,Ie),commit:dt(e),focusController:O(e,it).controller,selectionLock:O(e,Ne),editLock:O(e,Ye)})},aJ={name:"sandbox.toggleTextStyle",provides:[il],awaits:{services:[Ie,Te,Ne]},setup(e){const t=O(e,Ie),n=dt(e),r=O(e,Ne),o=(i,s=Qe())=>{let a=oJ(Ns(s,i)||i);if(a?.tagName==="EDITOR"&&(a=a.firstElementChild),!a)return;const l=a;r.lift(()=>t({elem:l}))};e.inject(il,OY({commit:n,addNewRange:Jo,refreshElementSettings:o,findElementWithSelectedText:Ns,getParentElementOfSelection:Ul,findOutermostParentWithText:Wf,clearLinkTags:i=>{wo(i,n),Ur(n)},addFontFamilyClass:i=>ba(i,n),getIsProgrammaticSelection:()=>!!j.get("isProgrammaticSelection"),getCommonStyles:()=>j.get("commonStyles")??{}}))}},lJ={name:"sandbox.insert",provides:[Cr],awaits:{services:[X,Ie,Te,xd,Ne,Ye]},setup:e=>e.inject(Cr,GZ({htmlDocument:O(e,X),commit:dt(e),messageService:z,applicationElementSettingsSet:O(e,Ie),selectionLock:O(e,Ne),editLock:O(e,Ye),...O(e,xd)}))},cJ={name:"sandbox.elementSettingsApply",provides:[$o],awaits:{services:[X,Bo,Te,yt,Ie,il,gn,it,Ne]},setup(e){const t=O(e,Te),n=O(e,Bo),r=O(e,yt),o=O(e,Ie);let i=null;const s=l=>{i??(i=pY({htmlDocument:O(e,X),getMapObj:()=>n,commit:dt(e),commitLockedAsync:c=>t.commitLockedAsync(c),setCursorPosition:r,applicationElementSettingsSet:o,selectionLock:O(e,Ne),toggleTextStyle:O(e,il),wrapEditor:O(e,gn).now,programmaticSelection:{get value(){return!!j.get("isProgrammaticSelection")},set value(c){j.set("isProgrammaticSelection",c)}}})),i(l)},a=O(e,it).controller;e.inject($o,l=>a.whenEditorLostFocus(()=>s(l)))}},uJ={name:"sandbox.tableSelections",provides:[Fo],awaits:{services:[Te]},setup:e=>e.inject(Fo,eJ({commit:dt(e)}))},dJ={name:"sandbox.mouse",awaits:{services:[X,gn,Te,Ne,Ye,Fo]},setup:e=>nJ({htmlDocument:O(e,X),commit:dt(e),selectionLock:O(e,Ne),editLock:O(e,Ye),wrapEditor:O(e,gn).deferred,tableSelections:O(e,Fo)})},fJ={name:"sandbox.click",awaits:{services:[X,Te,yt,it,Ie,gn,Ne,Ye,Fo]},setup(e){const t=O(e,Te),n=O(e,it);DZ({htmlDocument:O(e,X),commit:dt(e),commitLockedAsync:r=>t.commitLockedAsync(r),messageService:z,setCursorPosition:O(e,yt),setEditorFocus:r=>n.setEditorFocus(r),applicationElementSettingsSet:O(e,Ie),selectionLock:O(e,Ne),editLock:O(e,Ye),wrapEditor:O(e,gn).now,tableSelections:O(e,Fo),insertTextAtomIntoEmptyNarrowTable:r=>e.getInstance(Lb)?.(r)??!1})}},mJ={name:"sandbox.keyboard",awaits:{services:[Te,yt,Ie,gn,Ye]},setup:e=>xQ({editLock:O(e,Ye),commit:dt(e),messageService:z,setCursorPosition:O(e,yt),applicationElementSettingsSet:O(e,Ie),wrapEditor:O(e,gn).now})},hJ={name:"sandbox.cssFilterOnCommit",awaits:{services:[X]},setup:e=>GH(O(e,X))},pJ={name:"sandbox.vmlButtonLabelSync",awaits:{services:[Te]},setup(e){const t=O(e,Te);NY(n=>t.commit(n))}},gJ={name:"sandbox.insertListeners",awaits:{services:[Cr]},setup:e=>O(e,Cr).register()};function BA(e,t,n,r=""){sr(t.HTMLDocument.getOuterHtml(e)+r,([o,...i])=>!(o instanceof Element)||!n(o,i)?!1:(o.setAttribute("em-edit","active"),e.replaceWith(o),!0))&&t.commit(!0)}function HA(e,t){const n=t.selectionLock.acquire();try{const r=t.getActiveEditElement();if(!r)return;const o=r.closest("amp-accordion");if(!o)return;const i=o.querySelector("section");if(!i)return;BA(o,t,(a,[l])=>{if(!(l instanceof Element))return!1;const c=l.querySelector(":scope > header td div");if(c){const d=Array.from(c.childNodes).find(f=>f.nodeType===Node.TEXT_NODE);d&&(d.nodeValue=e.section)}const u=l.querySelector(":scope > div");return u&&(u.innerHTML=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">
|
|
251
|
+
<tr>
|
|
252
|
+
<td style="padding: 10px 0;">
|
|
253
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${e.text}</div>
|
|
254
|
+
</td>
|
|
255
|
+
</tr></table>`),a.append(l),!0},t.HTMLDocument.getOuterHtml(i))}catch{}finally{n.releaseLater()}}function FA(e,t){const n=t.selectionLock.acquire();try{const r=t.getActiveEditElement();if(!r)return;const o=r.closest("amp-accordion");if(!o)return;BA(o,t,i=>(i.querySelectorAll("section")[e.index]?.remove(),!0))}catch{}finally{n.releaseLater()}}function $A(e){return{selectionLock:e.selectionLock,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument}}function bJ(e,t){!t.selectionLock||!t.HTMLDocument||!t.getActiveEditElement||HA(e.data.settings,$A(t))}function yJ(e,t){!t.selectionLock||!t.HTMLDocument||!t.getActiveEditElement||FA(e.data.settings,$A(t))}var vJ={sandbox_accordion_add_section:bJ,sandbox_accordion_remove_section:yJ};function EJ(e,t){br(),Be(document.body,!1,"em-block-insert-body","em-atom-insert-body");const n=document.querySelector(".em-block-insert");n&&n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top");const r=document.querySelector(".em-block-insert-empty");r&&r.classList.remove("em-block-insert-empty");const o=document.querySelector(".em-atom-insert");o&&o.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top");const i=document.querySelector(".em-atom-insert-empty");i&&i.classList.remove("em-atom-insert-empty"),document.querySelectorAll(".em-blockatom-insert").forEach(s=>{s.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),t.messageService.send({operation:"application_scroll-block-hide"})}function SJ(e,t){const{htmlDocument:n}=t;t.messageService.send({operation:"application_email_content_get",htmlCode:n.getOuterHtml(document.body)||n.getRootsHtml()})}var wJ={"sandbox_drag-cancel":EJ,sandbox_email_content_get:SJ};function _J(e,t){const n=e.data.settings?.emBlockId;if(n==null||n==="")return;const r=e.data.settings?.emBlockVersion;let o=RC()??null;if(!o){const i=Array.from(document.querySelectorAll('[em="block"]:not([em="block"] [em="block"])')),s=i.filter(a=>a.getAttribute("em-block-id")===String(n));o=s.length===1?s[0]:s.length===0&&i.length===1?i[0]:null}o&&(o.setAttribute("em-block-id",String(n)),r!=null&&r!==""&&o.setAttribute("em-block-version",String(r)),t.commit())}function CJ(e,t){const n=RC();!n||!n.hasAttribute("em-block-id")||(n.removeAttribute("em-block-id"),n.removeAttribute("em-block-version"),t.commit())}var TJ={sandbox_eblock_set_em_block_id:_J,sandbox_eblock_clear_em_block_id:CJ};function WA(e){return e.replace(/\b(\d{1,3}(?:[ \xA0]\d{3})*(?:[.,]\d+)?)\b/g,t=>t.replace(/[ \xA0]/g,"").replace(/\B(?=(\d{3})+(?!\d))/g," ")).replace(/(\d[\d ]*[.,]?\d+)(?:\s| )?(?=(?:руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB))/gi,"$1 ").replace(/(\d[\d ]*[.,]?\d+) (руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB)/gi,"$1 $2")}function qA(e,t){for(const n of e)n.type===I.HTML&&!Qa(n,n.parent)&&(n.content=t(n.content??"")),qA(n.children,t)}function AJ(e,t){const n=hn(e);qA(n.roots,t);const r=document.createDocumentFragment(),o=rb(void 0);try{r.append(...n.roots.map(i=>eo(i,!0,!0)))}finally{o()}return Zo(r),r}var kJ=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><rect width="28" height="28" rx="3" fill="#e5e7eb"/><circle cx="18.5" cy="9.5" r="2.5" fill="#9ca3af"/><path d="M5 21l6-7 4 4.5 3-3 5 5.5z" fill="#9ca3af"/></svg>')}`;function zu(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem.previousSibling&&zu({elem:e.elem.previousSibling})}function Uu(e){if(!e.elem)return!1;if(e.elem.parentElement?.tagName==="SECTION"||e.elem.classList.contains("em-narrow-table")&&Array.from(e.elem.childNodes).every(n=>n.nodeType===Node.TEXT_NODE))return e.elem.innerHTML="",!1;e.elem.querySelector(".em-element-editor")&&e.elem.querySelector(".em-element-editor")?.remove(),e.elem.querySelector(".em-element-path")&&e.elem.querySelectorAll(".em-element-path").forEach(n=>n.remove()),e.elem.querySelector(".em-element-block-add")&&e.elem.querySelectorAll(".em-element-block-add").forEach(n=>n.remove()),e.elem.querySelector(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft")&&e.elem.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(n=>n.remove());const t=e.elem.parentElement;if(e.elem.classList.contains("em-mob-wrap")||e.elem.classList.contains("noresp-em-mob-wrap"))e.elem.innerHTML.trim()===""&&(e.elem.parentElement?.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.elem.innerHTML="":(e.elem.remove(),Uu({elem:t})));else if(e.elem.innerHTML.trim()==="")zu({elem:e.elem}),e.elem.remove(),Uu({elem:t});else if(t&&!t.querySelector('div[style*="display"]')){for(const n of e.elem.childNodes)n.nodeName==="#text"&&n.textContent?.trim()===""?(zu({elem:n}),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(zu({elem:n}),n.remove());e.elem.innerHTML.trim()===""&&Uu({elem:e.elem})}return!0}function LJ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=e.getElementParent(t);let r=t.parentNode;const o=t.closest("editor");if(e.setCursorPosition(n),t.classList.contains("em-code")){const i=e.getVariableByIcon?.(t);i&&(i.parentNode?.removeChild(i),t.remove())}else if(t.tagName==="TD"&&t.innerHTML===""&&t.hasAttribute("height")){const i=t.closest("table");if(i){const s=i.previousSibling;s&&s?.textContent?.trim()===""&&s.remove(),i.remove()}}else if(t.closest(".em-element-resize-img-container"))r=t.closest(".em-element-resize-img-container").parentNode,t.closest("td")?.querySelector("editor")?.innerHTML===""&&t.closest("td")?.querySelector("editor")?.remove(),t.closest(".em-element-resize-img-container")?.remove();else if(t.closest('[em="atom"]')){const i=t.closest(".em-mob-wrap, .noresp-em-mob-wrap"),s=t.closest('[em="atom"]');t.tagName==="TD"&&t.previousElementSibling===null&&t.nextElementSibling===null?(r=s.parentNode,s?.remove()):(r=t.closest("td"),t.remove());const a=!!i&&Array.from(i.querySelectorAll('[em="atom"]')).some(l=>l!==s);t.tagName!=="TD"&&i&&!a&&i.textContent?.trim()===""&&(i.textContent="")}else{t.remove();const i=t.previousSibling;i&&i?.textContent?.trim()===""&&i.remove(),t.remove()}o&&(lo(o),o.remove()),Uu({elem:r}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function zA(e,t){const n=document.querySelector("[em-edit]");if(n)if(e.action==="add_p"){let r=null;if(["DIV","P","TD","EDITOR","B","STRONG","SPAN","I","EM","A"].includes(n.tagName)){if(n.closest("div")?.style.fontFamily?r=n.closest("div"):n.closest("p")?.style.fontFamily?r=n.closest("p"):r=n,r&&t.HTMLDocument){const o=t.HTMLDocument.getOuterHtml(r),i=r.closest("table"),s=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td style="padding-bottom: 10px;">${o}</td></tr></table>`;tr(i?.getAttribute("em")==="atom"?i:r,"afterend",s)}t.commit()}t.setCursorPosition(n)}else if(e.action==="add_img"){if(window.getSelection){const r=document.createElement("img");r.setAttribute("src",kJ),r.setAttribute("width","28"),r.setAttribute("border","0"),r.setAttribute("alt",""),r.style.display="inline-block",r.style.verticalAlign="text-bottom";const o=window.getSelection();if(o?.getRangeAt&&o.rangeCount){const i=o.getRangeAt(0);i.deleteContents(),i.insertNode(r)}else document.querySelector("[em-edit]")?.prepend(r);t.commit()}}else(e.action==="typograf"||e.action==="typograf_all")&&PJ(e,t).catch(r=>{})}var NJ=/^(script|style|noscript|xmp|iframe|noembed|noframes)$/i,UA=/^[ \t\n\r\f]*$/;function jA(e,t,n){const{copy:r,counterpart:o}=Ol(e),i=xJ(e,o),s=c=>{const u=i.get(c);return!!u&&Iv(u)},a=AJ(t(r.innerHTML),n),l=new Map;GA(r,a,l,s)&&i.forEach((c,u)=>l.get(u)?.(c))}function xJ(e,t){const n=new Map,r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ALL);for(let o=r.nextNode();o;o=r.nextNode()){const i=t(o);i&&n.set(i,o)}return n}function VA(e){return[...(e instanceof HTMLTemplateElement?e.content:e).childNodes]}function GA(e,t,n,r){const o=VA(e),i=VA(t);let s=0;for(let a=0;a<o.length;){const l=o[a],c=i[s];if(l.nodeType===Node.TEXT_NODE){const u=RJ(o,a);a+=u.length;const d=c?.nodeType===Node.TEXT_NODE;if(!d&&!u.every(f=>UA.test(f.data))||(s+=d?1:0,!XA(u,d?c.data:"",n,r)))return!1;continue}if(!c||c.nodeType!==l.nodeType||!OJ(l,c,r(l)))return!1;if(a+=1,s+=1,l.nodeType===Node.COMMENT_NODE){if(!XA([l],c.data,n,r))return!1}else if(l.nodeType===Node.ELEMENT_NODE&&(r(l)&&MJ(l,c,n),!NJ.test(l.nodeName)&&!GA(l,c,n,r)))return!1}return s===i.length}function OJ(e,t,n){return t.nodeName===e.nodeName||!n&&t.nodeName.toLowerCase()===e.nodeName.toLowerCase()}function RJ(e,t){const n=[];for(let r=t;r<e.length&&e[r].nodeType===Node.TEXT_NODE;r+=1)n.push(e[r]);return n}function XA(e,t,n,r){if(e.map(i=>i.data).join("")===t)return!0;const o=e.filter(r);return o.length===0?!0:e.some(i=>!r(i)&&!UA.test(i.data))?!1:(o.forEach((i,s)=>n.set(i,a=>a.data=s===0?t:"")),!0)}function MJ(e,t,n){const r=[...t.attributes].filter(i=>e.getAttribute(i.name)!==i.value),o=[...e.attributes].filter(i=>!t.hasAttribute(i.name));r.length===0&&o.length===0||n.set(e,i=>{o.forEach(s=>i.removeAttribute(s.name)),r.forEach(s=>i.setAttribute(s.name,s.value))})}var KA=()=>df(()=>Promise.resolve().then(()=>id("./typograf.all.Mun9CrLC.js")),void 0,{}.url);async function PJ(e,t){const{default:n}=await KA();let r=document.querySelector("[em-edit]")?.closest("div")||document.querySelector("[em-edit]")?.closest("editor")||null;const o=e.action==="typograf"?r?.innerText:document.body.innerText,i=t.hasRussianText?.(o||"")??!1,s=new n({locale:[e.locale==="ru_RU"||i?"ru":"en-US"],htmlEntity:{type:"name",onlyInvisible:!0,list:["nbsp","shy","mdash","ndash","laquo","raquo"]}});s.disableRule("ru/punctuation/*"),s.disableRule("common/punctuation/*"),s.enableRule("common/punctuation/quote"),s.setSetting("common/punctuation/quote","ru",{left:"«",right:"»",removeDuplicateQuotes:!0}),s.setSetting("common/punctuation/quote","en-US",{left:'"',right:'"',removeDuplicateQuotes:!0}),s.disableRule("ru/dash/kakto"),s.disableRule("ru/dash/taki"),s.disableRule("ru/dash/izpod"),s.disableRule("ru/dash/izza"),s.disableRule("ru/dash/ka"),s.disableRule("ru/dash/to"),s.disableRule("ru/dash/koe"),s.disableRule("common/nbsp/nowrap"),s.disableRule("common/nbsp/dpi"),s.disableRule("common/nbsp/afterParagraphMark"),s.enableRule("common/nbsp/afterNumber"),s.disableRule("common/html/quot"),s.disableRule("ru/date/*"),s.disableRule("common/number/mathSigns"),s.disableRule("ru/number/ordinals"),s.disableRule("ru/number/comma"),s.disableRule("ru/symbols/NN"),s.disableRule("common/symbols/cf"),s.disableRule("ru/other/phone-number"),s.addSafeTag('<[^>]+class="preheader"[^>]*>',"</[^>]+>"),s.addSafeTag("<!--","-->");const a=l=>s.execute(l);lo(document.body),e.action==="typograf_all"?jA(document.body,a,WA):r?.parentElement&&(r=r.parentElement,r?.parentElement&&jA(r.parentElement,a,WA)),document.querySelectorAll(".em-element-resize-img").forEach(l=>l.remove()),document.querySelectorAll(".em-element-resize-img-container").forEach(l=>l.replaceWith(...l.childNodes)),document.querySelectorAll(".em-element-img-change-group").forEach(l=>l.remove()),document.querySelectorAll("editor").forEach(l=>l.replaceWith(...l.childNodes)),t.commit()}function YA(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function dg(e){if(!e||e.tagName!=="A")return!1;const t=e.getAttribute("style");if(!t||!t.includes("display"))return!1;const n=e.style.display;return!(n!=="block"&&n!=="inline-block"||t.includes("mso-style-priority"))}function IJ(e,t){const n=e.closest("a");if(dg(n))return n;if(!t)return null;const r=YA(t.anchorNode)?.closest("a")??null;if(dg(r))return r;const o=YA(t.focusNode)?.closest("a")??null;return dg(o)?o:null}function ZA(e){return e.tagName==="IMG"?e.closest('div[em="atom"]')||e.closest(".em-element-resize-img-container")||e:e.closest("editor")?e.closest('[style*="font-family"][style*="font-size"]')||e:e.tagName==="TD"&&e.classList.contains("em-vindent")?e.closest(".em-vindent-table")||e:e.tagName==="TD"&&K_(e)?e.closest('[em="block"]')??e:e}function QA(e){return e?e.classList.contains("em-vindent-table")?e.querySelector("td"):e.classList.contains("em-element-resize-img-container")?e.querySelector("img"):e.getAttribute("em")==="block"&&e.tagName!=="DIV"?_i(e)??e:e:null}function DJ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=window.getSelection();if(IJ(t,n)&&n&&!n.isCollapsed)try{n.collapseToEnd()}catch{}const r=e.getElementParent(t);r instanceof Element&&(e.setCursorPosition(r),e.applicationElementSettingsSet({elem:r}))}function BJ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=QA(ZA(t).previousElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function HJ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=QA(ZA(t).nextElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function FJ(e,t){t.removeAllAttributes("em-edit");const n=document.querySelector(".em-editor-wrapper");n&&(n.style.display="none"),It(()=>document.querySelectorAll("editor").forEach(r=>{r.blur()}))}function $J(e,t){const n=t.elementPath[e.data.index??0];if(n?.elem){const r=n.elem;t.applicationElementSettingsSet({elem:r}),t.setCursorPosition(r)}}function WJ(e,t){t.removeAllAttributes("em-state");const n=t.elementPath[e.data.index??0];n?.elem&&n.elem.setAttribute("em-state","active")}function qJ(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};DJ(n)}function zJ(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};BJ(n)}function UJ(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};HJ(n)}function jJ(e,t){if(!t.getElementParent)return;const n={commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,getVariableByIcon:t.getVariableByIcon};LJ(n)}function VJ(e,t){if(!t.getElementParent)return;const n={action:e.data.action,locale:e.data.locale},r={commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,HTMLDocument:t.HTMLDocument,hasRussianText:t.hasRussianText};zA(n,r)}var GJ={sandbox_element_active_reset:FJ,sandbox_element_active_set:$J,sandbox_element_hover_set:WJ,sandbox_element_parent_get:qJ,sandbox_element_prev_get:zJ,sandbox_element_next_get:UJ,sandbox_element_remove:jJ,sandbox_element_text:VJ},Tn=".em-mob-wrap, .noresp-em-mob-wrap",xt=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",lt='div[style*="inline-block"]';function No(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&No({elem:e.elem.previousSibling,width:e.width})}function JA(e){const t=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[t]&&JA({elem:e.elem[t],removedBlockIndex:e.removedBlockIndex})}function ju(e){return!!e.querySelector(Tn)||!!e.closest(Tn)}function Ha(e){return e.querySelector(Tn)?document.querySelector('[em-edit="active"]'):e.closest(Tn).parentElement}function Vu(e){return e.querySelector(lt)?document.querySelector('[em-edit="active"]'):e.closest(lt).parentElement}function ek(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const r=t.selectionLock.acquire();try{if(ju(n)){const o=Ha(n),i=e.minWidth,s=o.querySelectorAll(xt).length,a=s>1?parseFloat(String(e.gap)):20,l=s>1?parseFloat(String(e.gapMobile||e.gap)):20;let c="";o.querySelector(".em-mob-wrap")?c=`<td width="${a}" class="em-mob-wrap em-mob-height-${l}px"></td>
|
|
256
|
+
<td width="${i}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:o.querySelector(".noresp-em-mob-wrap")&&(c=`<td width="${a}" class="noresp-em-mob-wrap noresp-em-mob-height-${l}px"></td>
|
|
257
|
+
<td width="${i}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`);let u=0,d=0,f=0;o.querySelectorAll(xt).forEach(m=>{parseFloat(m.getAttribute("width")||"0")>i&&f++,u+=parseFloat(m.getAttribute("width")||"0")});const h=(i+a)/f;if(o.querySelectorAll(xt).forEach(m=>{if(parseFloat(m.getAttribute("width")||"0")>i){const p=Math.round(parseFloat(m.getAttribute("width")||"0")-h);m.setAttribute("width",String(p))}}),tr(o.querySelectorAll(xt)[s-1],"afterend",c),o.querySelectorAll(xt).forEach(m=>{d+=parseFloat(m.getAttribute("width")||"0")}),u-d-a!==0){const m=o.querySelector(Tn),p=parseFloat(m.getAttribute("width")||"0")+(u-d-a);m.setAttribute("width",String(p))}t.setPercentsForColumns(o.querySelectorAll(xt)),t.commit()}else{const o=Vu(n),i=e.minWidth,s=o.querySelectorAll(lt).length,a=s>1?parseFloat(String(e.gap)):20,l='<!--[if (gte mso 9)|(IE)]></td><td width="'+(i+a)+`" valign="top"><![endif]-->
|
|
258
|
+
<div style="display: inline-block; width: `+(i+a)+`px; vertical-align: top;" class="em-mob-width-100perc">
|
|
259
|
+
<table width="`+i+`" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
260
|
+
<tr>
|
|
261
|
+
<td align="left"></td>
|
|
262
|
+
</tr>
|
|
263
|
+
</table>
|
|
264
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
265
|
+
</div>`;let c=0,u=0,d=0;if(s===1){const h=n.querySelector(lt)?o.querySelector(lt):n.closest(lt);h.style.removeProperty("max-width"),h.firstElementChild?.style.removeProperty("max-width"),h.firstElementChild?.style.removeProperty("width")}o.querySelectorAll(lt).forEach(h=>{const m=parseFloat(h.firstElementChild?.getAttribute("width")||"0");m>i&&d++,c+=m});const f=(i+a)/d;if(o.querySelectorAll(lt).forEach(h=>{const m=h;if(parseFloat(m.firstElementChild?.getAttribute("width")||"0")>i){const p=Math.round(parseFloat(m.style.width)-f),v=p-a;m.style.width=p+"px",No({elem:m,width:p}),m.firstElementChild?.tagName==="TABLE"&&m.firstElementChild.setAttribute("width",String(v))}}),tr(o.querySelectorAll(lt)[s-1],"afterend",l),o.querySelectorAll(lt).forEach(h=>{u+=parseFloat(h.firstElementChild?.getAttribute("width")||"0")}),c-u-a!==0){const h=o.querySelector(lt),m=parseFloat(h.style.width)+(c-u-a);h.style.width=m+"px",No({elem:h,width:m}),h.firstElementChild?.tagName==="TABLE"&&h.firstElementChild.setAttribute("width",String(m-a))}t.commit()}}catch{}finally{r.releaseLater()}}function tk(e,t){const n=document.querySelector("[em-edit]");if(!n)return;let r=null;const o=t.selectionLock.acquire();try{if(ju(n)){const i=Ha(n);let s=0;const a=parseFloat(String(e.gap));i.querySelectorAll(xt).forEach((u,d)=>{d===e.removedBlockIndex&&(s=parseFloat(u.getAttribute("width")||"0"),u===n.closest(Tn)&&(n.closest(".em-structure > td")?.setAttribute("em-edit","active"),r=n.closest(".em-structure > td")),u.nextElementSibling&&u.previousElementSibling?u.previousElementSibling.remove():u.nextElementSibling&&!u.previousElementSibling?u.nextElementSibling.remove():!u.nextElementSibling&&u.previousElementSibling&&u.previousElementSibling.remove(),u.remove())});const l=i.querySelectorAll(xt).length,c=Math.floor((s+a)/l);if(i.querySelectorAll(xt).forEach(u=>{const d=Math.round(parseFloat(u.getAttribute("width")||"0")+c);u.setAttribute("width",String(d))}),l===1){const u=i.querySelector(Tn),d=u.closest("table").parentElement;u.setAttribute("width",String(d.getBoundingClientRect().width-parseFloat(d.style.paddingLeft||"0")-parseFloat(d.style.paddingRight||"0")))}t.setPercentsForColumns(i.querySelectorAll(xt))}else{const i=Vu(n);let s=0;const a=parseFloat(String(e.gap));i.querySelectorAll(lt).forEach((u,d)=>{d===e.removedBlockIndex&&(s=parseFloat(u.style.width),u===n.closest(lt)&&n.closest(".em-structure > td")?.setAttribute("em-edit","active"),JA({elem:u,removedBlockIndex:e.removedBlockIndex}),u.remove())});const l=i.querySelectorAll(lt).length,c=Math.round(s/l);if(i.querySelectorAll(lt).forEach(u=>{const d=u,f=Math.round(parseFloat(d.style.width)+c),h=f-a;d.style.width=f+"px",No({elem:d,width:f}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(h))}),l===1){const u=i.querySelector(lt);u.style.width="100%",u.style.maxWidth=i.closest("table")?.style.maxWidth||"",No({elem:u,width:i.closest("table")?.style.maxWidth||""}),u.firstElementChild.style.width="91%",u.firstElementChild.style.maxWidth=parseFloat(u.firstElementChild?.getAttribute("width")||"0")+"px"}}}finally{t.commit(),Promise.resolve().then(()=>{o.release(),r&&t.applicationElementSettingsSet&&t.applicationElementSettingsSet({elem:r})})}}function nk(e,t){const n=document.createComment("em-swap");e.replaceWith(n),t.replaceWith(e),n.replaceWith(t)}function XJ(e){e instanceof Element&&(e.querySelectorAll("editor").forEach(t=>{t.replaceWith(...Array.from(t.childNodes))}),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")),e.removeAttribute("em-edit"),e.querySelectorAll("[em-temp]").forEach(t=>t.remove()))}function rk(e,t=""){sr(t+_s(e),n=>{n.forEach(XJ),e.after(...n)})}function KJ(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{copiedBlockIndex:r,widths:o}=e,i=parseFloat(String(e.gap))||0,s=t.selectionLock.acquire();try{if(ju(n)){const a=Ha(n),l=a.querySelectorAll(xt)[r];if(!l)return;const c=l.nextElementSibling||l.previousElementSibling;rk(l,c?_s(c):a.querySelector(".noresp-em-mob-wrap")?`<td width="${i}" class="noresp-em-mob-wrap noresp-em-mob-height-${i}px"></td>`:`<td width="${i}" class="em-mob-wrap em-mob-height-${i}px"></td>`);const u=a.querySelectorAll(xt);u.forEach((d,f)=>{o[f]!=null&&d.setAttribute("width",String(o[f]))}),t.setPercentsForColumns(u),t.commit()}else{const a=Vu(n),l=a.querySelectorAll(lt)[r];if(!l)return;rk(l,'<!--[if (gte mso 9)|(IE)]></td><td width="'+((o[r+1]??o[r]??0)+i)+`" valign="top"><![endif]-->
|
|
266
|
+
`),a.querySelectorAll(lt).forEach((c,u)=>{const d=c,f=o[u];if(f==null)return;const h=f+i;d.style.width=h+"px",No({elem:d,width:h}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(f))}),t.commit()}}catch{}finally{s.releaseLater()}}function ok(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{indexA:r,indexB:o}=e;if(r===o)return;const i=t.selectionLock.acquire();try{if(ju(n)){const s=Ha(n),a=s.querySelectorAll(xt),l=a[r],c=a[o];if(!l||!c)return;nk(l,c),t.setPercentsForColumns(s.querySelectorAll(xt)),t.commit()}else{const s=Vu(n).querySelectorAll(lt),a=s[r],l=s[o];if(!a||!l)return;nk(a,l),[a,l].forEach(c=>{No({elem:c,width:parseFloat(c.style.width)})}),t.commit()}}finally{i.releaseLater()}}function YJ(e,t){const n=t.selectionLock.acquire();try{const r=document.querySelector("[em-edit]");if(!r)return;const o=Ha(r);if(e.wrap)o.querySelectorAll(Tn).forEach((i,s)=>{i.classList.remove("em-mob-wrap-cancel"),s%2===0&&(i.classList.forEach(a=>a.startsWith("em-mob-width-")&&i.classList.remove(a)),i.classList.add("em-mob-width-100perc"))});else{const i=o.querySelectorAll(xt).length,s=Math.round(100/i)-2;o.querySelectorAll(Tn).forEach((l,c)=>{l.classList.add("em-mob-wrap-cancel"),l.classList.remove("em-mob-width-100perc"),c%2===0&&l.classList.add("em-mob-width-"+s+"perc")});const a=t.emailWidth||660;document.querySelector('style[em="styles"]')?.insertAdjacentHTML("beforeend",`
|
|
267
|
+
@media only screen and (max-device-width:${a}px),only screen and (max-width:${a}px) {
|
|
268
|
+
.em-mob-wrap.em-mob-wrap-cancel, .noresp-em-mob-wrap.em-mob-wrap-cancel { display: table-cell !important; }
|
|
269
|
+
.em-mob-width-${s}perc { width: ${s}% !important; }
|
|
270
|
+
}
|
|
271
|
+
`)}t.commit()}catch{}finally{n.releaseLater()}}function ZJ(e,t){const n=t.selectionLock.acquire();try{const r=document.querySelector("[em-edit]");if(!r)return;const o=r.querySelector(Tn)?document.querySelector('[em-edit="active"]'):r.closest(Tn)?.parentElement?.closest("td");if(!o)return;e.dirRevert?(o.setAttribute("dir","rtl"),o.querySelectorAll("td").forEach(i=>{for(let s=i.firstChild;s;s=s.nextSibling)if(s.nodeType===3){s.parentNode?.setAttribute("dir","ltr");break}})):(o.removeAttribute("dir"),o.querySelectorAll("[dir]").forEach(i=>i.removeAttribute("dir"))),t.commit()}catch{}finally{n.releaseLater()}}function qi(e){return{selectionLock:e.selectionLock,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function QJ(e,t){!t.selectionLock||!t.setPercentsForColumns||ek(e.data.settings,qi(t))}function JJ(e,t){!t.selectionLock||!t.setPercentsForColumns||tk(e.data.settings,qi(t))}function eee(e,t){!t.selectionLock||!t.setPercentsForColumns||KJ(e.data.settings,qi(t))}function tee(e,t){!t.selectionLock||!t.setPercentsForColumns||ok(e.data.settings,qi(t))}function nee(e,t){!t.selectionLock||!t.setPercentsForColumns||YJ(e.data.settings,qi(t))}function ree(e,t){!t.selectionLock||!t.setPercentsForColumns||ZJ(e.data.settings,qi(t))}var oee={sandbox_floatBlock_add:QJ,sandbox_floatBlock_remove:JJ,sandbox_floatBlock_copy:eee,sandbox_floatBlock_swap:tee,sandbox_floatblock_wrap:nee,sandbox_floatblock_dir:ree},iee='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',see=['[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width]):empty','[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td[em-edit="active"]:not([height]):not([width]):empty','.em-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td.em-mob-wrap[em-edit="active"]','.em-structure td.noresp-em-mob-wrap[em-edit="active"]'];function ik(){br(),Be(document.body,!1,"em-block-insert-body","em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>e.classList.remove("em-block-insert-empty")),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>e.classList.remove("em-atom-insert-empty"))}function sk(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function ak(){for(const e of see){const t=document.querySelector(e);if(t)return t}return null}function lk(e){const t=e.querySelectorAll('[em="atom"]');return t.length?t[t.length-1]:e}function ck(e){const t=e.querySelectorAll('[em="atom"]');if(t.length)return t[t.length-1];const n=e.querySelector("td.em-mob-wrap")??e.querySelector("td.noresp-em-mob-wrap")??e.querySelector('td[em-edit="active"]:not([height]):not([width])');return n||(e instanceof HTMLElement?xu(e):null)}function aee(e,t,n){const r=e.getAttribute("em")==="atom",o=r?"afterend":"beforeend",i=r?e.parentElement:e;return t.match(/class="em-countdown"/gi)?n.insertCountdown({targetElem:e,targetPlace:o,atomHTML:t}):n.insertAdjacentHTML(e,o,t),lee(i,e,r)}function lee(e,t,n){if(n){const r=t.nextElementSibling;if(r?.getAttribute("em")==="atom")return r}if(e){const r=e.querySelectorAll('[em="atom"]');if(r.length)return r[r.length-1]}return null}function fg(e,t,n){return t.match(/em="atom"><tr><td>\s*<img/gi)&&(t=n.setImageWidth({atomHTML:t,targetAtom:e})),t=n.commonStylesApply({html:t}),aee(e,t,n)}function cee(e,t){if(!e||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')||document.documentElement.scrollHeight+(t.iframeOffsetTop||0)<=(t.previewHeight||0))return;const n=e.getBoundingClientRect();t.messageService.send({operation:"application_scroll-to",settings:{value:n.top+n.height}})}function uee(e,t){const n=vp();if(!n)return null;e.match(/em="atom"><tr><td>\s*<img/gi)&&(e=t.setImageWidth({atomHTML:e,targetAtom:n})),e=t.commonStylesApply({html:e});let r=QT(e);if(e!==iee){const i=r.match(/<style((.|\n|\r)*?)<\/style>/g);t.setDocumentStyles(i)}r=t.commonStylesApplyToBlock({html:r}),(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=t.setFloatBlocksWidth({blockHTML:r,targetBlock:n}),r=t.fitImagesToColumns(r));const o=!!e.match(/class="em-countdown"/gi);return r.substring(0,3)!=="<tr"||!cn(n)?null:(o?t.insertCountdown({targetElem:gr(n),targetPlace:"beforeend",atomHTML:r}):t.insertAdjacentHTML(gr(n),"beforeend",r),n.querySelector('[em="block"]:last-child')??n.lastElementChild)}function uk(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function dk(e,t){e&&t.messageService.send(ue.APPLICATION_ATOM_INSERTED,e),ik()}function fk(e,t){t.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),ik()}function mk(e,t){const n=uk(e.atomHTML),r=n.match(/<style((.|\n|\r)*?)<\/style>/g);return t.setDocumentStyles(r),n.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function dee(e,t){if(!ak()&&!sk()&&!vp())return!1;let n=mk(e,t);if(!n)return!1;let r=null;const o=ak();if(o)r=fg(lk(o),n,t);else{const i=sk();if(i){const s=ck(i);s&&(r=fg(s,n,t))}else r=uee(n,t)}return r?(cee(r,t),!0):!1}function hk(e,t){const n=document.createElement("table");n.setAttribute("cellspacing","0"),n.setAttribute("cellpadding","0"),n.setAttribute("align","center"),n.setAttribute("border","0"),n.setAttribute("em","block"),n.setAttribute("width",e.getAttribute("width")??String(e.getBoundingClientRect().width)),n.classList.add("em-mob-width-100perc"),sr(`
|
|
272
|
+
`+t+`
|
|
273
|
+
`,r=>{n.replaceChildren(...r),n.querySelectorAll('tr[em="block"]').forEach(o=>o.removeAttribute("em")),e.insertAdjacentElement("afterend",n)})}function fee(e,t,n){if(e.tagName==="TR"){t.substring(0,3)==="<tr"?n.insertAdjacentHTML(e,"afterend",t):n.insertAdjacentHTML(e,"afterend",'<tr em="block"><td align="center">'+t+"</td></tr>");return}t.substring(0,3)==="<tr"?hk(e,t):n.insertAdjacentHTML(e,"afterend",t)}function mg(e,t,n){if(!e.blockHTML?.trim())return!1;const r=vp(),o=r?null:document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')?.closest('[em="block"]')??Ep();if(!n&&!r&&!o)return!1;const i=Rh(t.parseFromString(e.blockHTML));let s=i.filter(h=>h.tagName&&h.tagName!=="LINK"&&h.tagName!=="STYLE").map(h=>t.getOuterHtml(h)).join(""),a=i.filter(h=>h.tagName==="STYLE").map(h=>t.getOuterHtml(h)).join("");const l=t.assetsRoot?.()??document.head,c=i.filter(h=>h.tagName==="LINK"&&h.getAttribute("em-class")).filter(h=>!l?.querySelector(`link[em-class="${h.getAttribute("em-class")}"]`));if(a){let h=l?.querySelector('style[em="styles"]'),m="";h?m=t.HTMLDocument.getInnerHtml(h):(h=document.createElement("style"),h.setAttribute("em","styles"),h=l?.insertAdjacentElement("beforeend",h));const p=document.createElement("div");t.emailWidth&&(a=a.replace(/(max-device-width:|max-width:)\d+px/g,w=>w.replace(/\d+/,String(t.emailWidth)))),p.insertAdjacentHTML("afterbegin",a);let v=t.minify(m+`
|
|
274
|
+
`+[...p.querySelectorAll("style")].map(w=>w.innerHTML).join(`
|
|
275
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;v=t.cssbeautify(v,{indent:" ",autosemicolon:!0}),h.textContent=`
|
|
276
|
+
`+v+`
|
|
277
|
+
`}for(const h of c.reverse())l?.prepend(h),l?.insertAdjacentHTML("afterbegin",`
|
|
278
|
+
`);if(e.type!=="project"&&(s=t.commonStylesApplyToBlock({html:s})),s.match(/class="em-countdown"/gi)&&(s=t.uptimeCountdown({blockHTML:s})),n)return(s.indexOf("empty-structure")>-1||s.indexOf("em-structure")>-1)&&(s=t.setBlockMaxWidth({blockHTML:s,targetBlock:n}),s=t.setFloatBlocksWidth({blockHTML:s,targetBlock:n,project:e.project})),s=t.checkBlockAdaptivity({blockHTML:s,blockIsTr:s.substring(0,3)==="<tr"}),fee(n,s,t),!0;let u=null,d=null,f=!1;return r?(u=r,d=u,(s.indexOf("empty-structure")>-1||s.indexOf("em-structure")>-1)&&(s=t.setBlockMaxWidth({blockHTML:s,targetBlock:u}),s=t.setFloatBlocksWidth({blockHTML:s,targetBlock:u,project:e.project})),s=t.checkBlockAdaptivity({blockHTML:s,blockIsTr:s.substring(0,3)==="<tr"}),s.substring(0,3)==="<tr"?t.insertAdjacentHTML(gr(r),"beforeend",s):t.insertAdjacentHTML(gr(r),"beforeend",'<tr><td align="center">'+s+"</td></tr>"),f=!0):o&&(u=o,(s.indexOf("empty-structure")>-1||s.indexOf("em-structure")>-1)&&(s=t.setBlockMaxWidth({blockHTML:s,targetBlock:u}),s=t.setFloatBlocksWidth({blockHTML:s,targetBlock:u,project:e.project})),s=t.checkBlockAdaptivity({blockHTML:s,blockIsTr:s.substring(0,3)==="<tr"}),u?.tagName==="TR"?(s.substring(0,3)==="<tr"?t.insertAdjacentHTML(u,"afterend",s):t.insertAdjacentHTML(u,"afterend",'<tr em="block"><td align="center">'+s+"</td></tr>"),f=!0):u&&(s.substring(0,3)==="<tr"?hk(u,s):t.insertAdjacentHTML(u,"afterend",s),f=!0),d=u?.nextSibling),f&&!document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')&&document.documentElement.scrollHeight+(t.iframeOffsetTop||0)>(t.previewHeight||0)&&d&&t.messageService.send({operation:"application_scroll-to",settings:{value:d.getBoundingClientRect().top+d.getBoundingClientRect().height}}),f}function mee(e,t){if(t.lockEditor||!uk(e.atomHTML).trim())return;const n=t.selectionLock.acquire();try{t.setAtomReplaced?.(null),WT({kind:"atom",settings:e}),e.action!=="insert"&&Be(document.body,!0,"em-atom-insert-body"),e.action==="insert"&&dee(e,t)&&dk(e.name,t),t.commit()}catch{}finally{n.releaseLater()}}function hee(e){return e.replace(/["\\]/g,"\\$&")}function pee(e,t){if(t.lockEditor)return 0;const n=e.emBlockId;if(!n||!e.blockHTML?.trim())return 0;const r=`[em="block"][em-block-id="${hee(String(n))}"]`,o=Array.from(document.querySelectorAll(r));if(!o.length)return 0;let i=0;const s=t.selectionLock.acquire();try{for(const a of o)mg({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},t,a)&&(a.remove(),i+=1);t.commit()}finally{s.releaseLater()}return i}function gee(e,t){if(t.lockEditor||!e.blockHTML?.trim())return;const n=t.selectionLock.acquire();try{WT({kind:"block",settings:e}),Be(document.body,!0,"em-block-insert-body"),e.action==="insert"&&mg(e,t)&&fk(e,t),t.commit()}finally{n.releaseLater()}}function bee(e){const t=[...document.querySelectorAll('[em="block"]')].filter(n=>!e.has(n));return t.filter(n=>!t.some(r=>r!==n&&r.contains(n)))}function yee(e,t,n){if(t.lockEditor||!e.blockHTML?.trim())return null;const r=new Set(document.querySelectorAll('[em="block"]')),o=t.selectionLock.acquire();try{if(!mg({...e,action:"insert"},t,n?.target))return null;const i=bee(r);return n?.place==="before"&&i.length&&n.target.before(...i),fk(e,t),t.commit(),i[0]??null}finally{o.releaseLater()}}function vee(e,t,n){if(t.lockEditor)return null;const r=t.selectionLock.acquire();try{const o=mk(e,t);if(!o)return null;const i=()=>n.target.getAttribute("em")==="block"?ck(n.target):lk(n.target),s=n.place==="inside"?i():n.target,a=s?fg(s,o,t):null;return a&&n.place==="before"&&n.target.before(a),a&&dk(e.name,t),t.commit(),a}finally{r.releaseLater()}}function Eee(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};mee({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function See(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};gee({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function wee(e,t){t.setElementSettings?.(e)}var _ee={"sandbox_atom-insert":Eee,"sandbox_block-insert":See,sandbox_element_settings_set:wee},Cee=vn("elements",GJ,{services:[Ie,yt,Te,Tr]},e=>{const t=O(e,Ie),n=O(e,yt),r=dt(e),o=O(e,Tr);return()=>({HTMLDocument:{getOuterHtml:Pt},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>Ri(i),getVariableByIcon:ua,hasRussianText:gE,messageService:z,removeAllAttributes:Lr,setCursorPosition:i=>n(i)})}),Tee=vn("display",wJ,{services:[X]},e=>{const t=O(e,X);return()=>({messageService:z,htmlDocument:t})}),Aee=vn("floatBlock",oee,{services:[Ie,Te,Ne]},e=>{const t=O(e,Ie),n=dt(e),r=O(e,Ne);let o=600;return j.subscribe(i=>{i.emailWidth!==void 0&&(o=i.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:o,selectionLock:r,setPercentsForColumns:i=>jl(i)})}),kee=vn("accordion",vJ,{services:[Te,Ne]},e=>{const t=dt(e),n=O(e,Ne);return()=>({HTMLDocument:{getOuterHtml:Pt},commit:t,selectionLock:n,getActiveEditElement:xs,parseFromString:r=>Le(r)})}),Lee=vn("eblock",TJ,{services:[Te]},e=>{const t=dt(e);return()=>({commit:t})}),Nee=vn("palette",_ee,{services:[Cr,$o]},e=>{const t=O(e,Cr),n=O(e,$o);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),xee=vn("nativeImageDrop",{[ue.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>KT()},void 0,()=>()=>({})),Oee=[Cee,Tee,Aee,kee,Lee,Nee,xee];function pk(e){const t=e.activeElement;return!!t&&!!t.closest('[contenteditable="true"]')&&e.hasFocus()}function Ree(e){return pk(e)?new Promise(t=>{const n=()=>{setTimeout(()=>{pk(e)||(e.removeEventListener("focusout",n,!0),e.defaultView?.removeEventListener("blur",n),t())},0)};e.addEventListener("focusout",n,!0),e.defaultView?.addEventListener("blur",n)}):Promise.resolve()}function Gu(){let e=null;if(document.querySelector(".preheader"))document.querySelectorAll(".preheader").length>1?document.querySelectorAll(".preheader").forEach(t=>{t.innerHTML.match(/[a-zA-Zа-яА-Я0-9]/gi)&&(e=t)}):e=document.querySelector(".preheader");else if(document.querySelector(".mcnPreviewText"))e=document.querySelector(".mcnPreviewText");else if(document.querySelector(".mail_preheader"))e=document.querySelector(".mail_preheader");else if(document.querySelector(".dvPreheader"))e=document.querySelector(".dvPreheader");else if(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]"))e=document.querySelector("body > div");else for(let t of document.querySelectorAll('[style*="display:none"], [style*="display: none"]'))if(t instanceof HTMLElement&&(parseInt(t.style.opacity)==0||t.style["mso-hide"]=="all"||t.style.overflow=="hidden"||parseInt(t.style.maxHeight)==0||parseInt(t.style.width)==0)&&t.tagName!="IMG"&&t.tagName!="TABLE"&&[...t.childNodes].filter(n=>n.nodeType==Node.TEXT_NODE).length>0){e=t;break}return e&&e.querySelector("div")?e=e.querySelector("div"):e&&e.querySelector("span")&&!e.querySelector("span")?.classList.contains("em-code")&&(e=e.querySelector("span")),e??void 0}function gk(e){return!!e&&!document.querySelector("title")}function hg(){const e=document.querySelector("title")?.textContent?.replaceAll(" "," ").replaceAll("‌","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","")||"";return e2(e).replace(/\s+/g," ").trim()}function Fa(e=Gu()){const t=document.createElement("div");return t.innerHTML=e?.innerHTML||"",t.querySelectorAll(".em-code").forEach(n=>n.remove()),kt(t).trim().replaceAll(/<vk-snippet-end\/>/g,"").replaceAll(/[\u034F\u200C\u2007\uFEFF]+/g,"").replaceAll("&","&").replaceAll("͏","").replaceAll("","").replaceAll(" ","").replaceAll("‌","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","").replace(/(?: |\s)+$/,"").trim()}function pg(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("mso")>=0?e.remove():e.previousSibling&&pg(e.previousSibling)}function gg(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("endif")>=0?e.remove():e.nextSibling&&gg(e.nextSibling)}var Mee="͏‌  ",bk="#f0f1f3",yk='<span style="display:none !important;font-size:0;height:0;line-height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;visibility:hidden;width:0">⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'+new Array(200).fill(" ‌").join("")+"</span>";function Xu(e){return!!e&&e instanceof HTMLElement&&e.tagName==="SPAN"&&e.style&&e.style.display==="none"&&e.style.fontSize==="0px"&&e.style.visibility==="hidden"}function vk(e){const t=e.nextSibling;return t&&hs(t)&&t.data==="<![endif]"?t:null}function Pee(e){const t=vk(e);t&&t.nextSibling&&Xu(t.nextSibling)?t.nextSibling.remove():!t&&e.nextSibling&&Xu(e.nextSibling)&&e.nextSibling.remove();const n=Le(yk);n.length&&(t&&t.parentNode?t.parentNode.insertBefore(n[0],t.nextSibling):e.parentNode&&e.parentNode.insertBefore(n[0],e.nextSibling))}var Ek=e=>{pg(e),gg(e);const t=e.nextElementSibling;t instanceof HTMLElement&&t.style&&t.style.color==="transparent"&&(pg(t),gg(t),t.remove());const n=e instanceof HTMLElement?vk(e):null;for(n&&n.nextSibling&&Xu(n.nextSibling)?n.nextSibling.remove():e.nextSibling&&Xu(e.nextSibling)&&e.nextSibling.remove();e.previousSibling&&oo(e.previousSibling)&&e.previousSibling.data.trim()==="";)e.previousSibling.remove();for(;e.nextSibling&&oo(e.nextSibling)&&e.nextSibling.data.trim()==="";)e.nextSibling.remove();e.remove()};function Iee(e){return!(e.tagName!=="DIV"||V(e.style.color)!==bk||e.style.lineHeight!=="0px"||e.style.fontSize!=="0px"||!e.previousSibling||!hs(e.previousSibling)||e.previousSibling.data!=="[if !mso]><!"||!e.nextSibling||!hs(e.nextSibling)||e.nextSibling.data!=="<![endif]")}function Dee(e,t){let n=Gu(),r="";(e.length||t)&&(e=e.endsWith(" ")?e:e+" ",e=e+"<vk-snippet-end>͏</vk-snippet-end>͏",r=e.padEnd(e.length+5460,Mee));const o=Le(r);if(n&&!Iee(n)&&(Ek(n),n=null),n)o.length?(n.replaceChildren(...o),Pee(n)):Ek(n);else if(o.length){const i=document.createElement("div");i.classList.add("preheader"),i.style.color=bk,i.style.lineHeight=i.style.fontSize="0px",i.replaceChildren(...o),document.body?.prepend(i),i.insertAdjacentHTML("afterend",yk)}}function Bee(e,t){return!!t&&(Fa()||"")!==e}function Hee(e,t){return!!t&&(document.querySelector("title")?.textContent??"")!==e}function Fee(){return document.querySelector("title")?.textContent??void 0}async function Sk(e,t,n,r){const o=n();await e.whenSent(),t()&&n()===o&&r()}function $ee(e,t){let n;const r=new Ee;let o=!1,i="",s=0;const a=u=>{o=!1,n=void 0,i=u.guid,s+=1},l=u=>(o=!0,n=Fa()||"",z.sendAsync(ue.APPLICATION_PREHEADER_UPDATE,{guid:i,value:n})),c=async({guid:u,value:d,force:f,fromAI:h,echo:m,undoStep:p})=>{if(f||await t.whenEditorLostFocusAsync("preheader"),typeof d=="string"&&u===i&&(n!==d||Bee(d,f))){const v=s;n=d,Dee(d),await e.commit(!!h||!!p,!0),(h||m)&&await Sk(e,()=>v===s,()=>Fa(),()=>z.send(ue.APPLICATION_PREHEADER_UPDATE,{guid:i,value:n,forced:!!m&&!h}))}};return r.addDisposable(z.addListenerAsync(ue.SANDBOX_PREHEADER_UPDATE,c)),r.addDisposable(z.addListenerAsync(ue.SANDBOX_INIT_START,a)),r.addDisposable(z.addListenerAsync(ue.SANDBOX_INITED,l)),r.addDisposable(e.onChange(()=>{if(o){const u=Fa()||"";u!==n&&(n=u,z.send(ue.APPLICATION_PREHEADER_UPDATE,{guid:i,value:n}))}})),r}function Wee(e,t){let n;const r=new Ee;let o="",i=!1,s=0;const a=u=>{i=!1,n=void 0,o=u.guid,s+=1},l=u=>{if(!(u?.guid&&o&&u.guid!==o))return i=!0,gk(n)||(n=hg()||""),z.sendAsync(ue.APPLICATION_SUBJECT_UPDATE,{guid:o,value:n})},c=async({guid:u,value:d,force:f,fromAI:h,echo:m,undoStep:p})=>{if(f||await t.whenEditorLostFocusAsync("subject"),typeof d=="string"&&u===o&&(n!==d||Hee(d,f))){const v=s;n=d,document.title=d,await e.commit(!!h||!!p,!0),(h||m)&&await Sk(e,()=>v===s,Fee,()=>z.send(ue.APPLICATION_SUBJECT_UPDATE,{value:d,guid:o,forced:!!m&&!h}))}};return r.addDisposable(z.addListenerAsync(ue.SANDBOX_SUBJECT_UPDATE,c)),r.addDisposable(z.addListenerAsync(ue.SANDBOX_INIT_START,a)),r.addDisposable(z.addListenerAsync(ue.SANDBOX_INITED,l)),r.addDisposable(e.onChange(()=>{if(i){if(gk(n))return;const u=hg()||"";u!==n&&(n=u,z.send(ue.APPLICATION_SUBJECT_UPDATE,{value:u,guid:o}))}})),r}var An=e=>!!e?.closest(Uc),bg=e=>e.matches(".em-prevent-action")||!!e.querySelector(".em-prevent-action");function Ku(){const e=Gu();return e&&!e.closest('[em="atom"]')&&!e.querySelector('[em="atom"], [em="block"]')?e:void 0}function wk(e){const t=Ku();return!!t&&(t.contains(e)||e.contains(t))}function qee(e){const t=new Map,n=Ku();return[...Array.from(e.querySelectorAll(Uc)),...n?[n]:[]].forEach(r=>{const o=e.ownerDocument.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(let i=o.nextNode();i;i=o.nextNode())t.set(i,i.data)}),t}function zee(e){e.forEach((t,n)=>{n.data!==t&&(n.data=t)})}function zi(e){return"ok"in e}var Y=(e,t)=>({ok:!1,code:e,message:t}),Yr=Y("staleElement","The element reference is stale: read element.getTree again and use a fresh reference."),Uee=Y("readOnly","The document is read-only."),Yu=Y("unavailable","The canvas is busy with another edit; try again."),_k=Y("unavailable","The user is editing text right now; try again in a moment."),yr=Y("readOnly","The element is locked by the integrator and cannot be changed."),yg=Y("readOnly","A locked element of the integrator is inside, so this cannot be removed; remove what is around it instead."),vg=Y("readOnly","This is or holds the preheader of the email; change it with document.setHeaders."),jee=80,Vee=["img","countdown","video","button","a","vindent","social","customTable","carousel","accordion","var"];function xo(e){const t=e.closest('[em="block"]');return t&&(t===e||t.querySelector("td")===e)?t:null}function $a(e){return e.querySelector("td")??e}function Gee(e){return e.getAttribute("em-type")==="social"||e.querySelector("td[em-platform], td[data-em-platform]")?"social":A0(e)||e.querySelector(".em-element-custom-table")?"customTable":"td"}function Ck(e){return e.tagName==="TD"&&(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))}function Tk(e){return Ck(e)&&e.matches(":nth-child(even)")}function Zu(e){return e.getAttribute("em")==="block"?"structure":e.getAttribute("em")==="atom"?Gee(e):Tk(e)?null:Ck(e)?"column":R0(e)?"floatBlock":dp(e)&&!(e.parentElement&&dp(e.parentElement))?"carousel":u0(e)?"accordion":P0(e)?Dj(e)?"countdown":Bj(e)||e.closest(".em-video")?"video":"img":e.tagName==="A"?b0(e)?"button":"a":e.tagName==="EM-REPLACE"?"var":rT(e)||oT(e)?"vindent":tT(e)?"text":null}function Xee(e,t,n=jee){const r=[];let o=0;const i=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let a=i.nextNode();a&&o<=n;a=i.nextNode())t(a)&&a.nodeValue&&(r.push(a.nodeValue),o+=a.nodeValue.length);const s=r.join(" ").replace(/\s+/g," ").trim();return s.length>n?`${s.slice(0,n)}…`:s}function Kee(e,t){const n={};if(t==="img"){const r=e.tagName==="IMG"?e:e.querySelector("img");n.src=r?hp(Tc(r,{clone:!0}))??void 0:void 0,n.alt=r?.getAttribute("alt")??""}else if(t==="a"||t==="button")n.href=e.getAttribute("href")??"";else return;return n}function Ak(e,t){let n=t.budget,r=!1,o=!1;const i=(s,a)=>{const l=[];for(const c of Array.from(s.children)){if(o)break;const u=e.isInLetter(c)?Zu(c):null;if(!u){l.push(...i(c,a));continue}const d=e.issue(u==="structure"?$a(c):c);if(!d)continue;if(n<=0){r=o=!0;break}n-=1;const f={element:d,type:u},h=Xee(c,p=>e.isInLetter(p),t.textLimit);h&&(f.text=h);const m=Kee(c,u);if(m&&(f.attrs=m),!Vee.includes(u))if(a<t.depth){const p=i(c,a+1);p.length&&(f.children=p)}else c.querySelector('[em="atom"], img, a, td.em-mob-wrap')&&(r=!0);l.push(f)}return l};return{nodes:i(t.root,1),truncated:r}}var Yee=`em-replace, style, script, ${Uc}`,kk=20,Qu="[\\p{L}\\p{N}\\p{M}]",Eg=new RegExp(`^${Qu}`,"u"),Sg=new RegExp(`${Qu}$`,"u"),Lk="a, abbr, b, big, cite, code, del, dfn, em, em-replace, font, i, ins, kbd, mark, nobr, q, s, samp, small, span, strike, strong, sub, sup, tt, u, var",Vne="ul, ol, table",Nk=["text","button","a"],xk=`ul, ol, table, img, em-replace, ${Uc}`;function wg(e){if(Nk.includes(Zu(e)??""))return e;const t=Array.from(e.querySelectorAll("*")).filter(n=>Nk.includes(Zu(n)??""));return t.length===1?t[0]:null}function Ok(e){let t=e;for(;t.children.length===1&&!t.firstElementChild?.matches("em-replace")&&t.textContent?.trim()&&t.firstElementChild?.textContent?.trim()===t.textContent.trim();)t=t.firstElementChild;return t}function Zee(e){let t=e;for(;t.children.length===1&&!t.textContent?.trim();)t=t.children[0];return t.tagName==="BR"?t:void 0}function Rk(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r\n?/g,`
|
|
279
|
+
`).replace(/\n/g,"<br>")}function Qee(e,t,n){const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=t?"g":"gi";if(!n)return new RegExp(r,o);const i=Eg.test(e),s=Sg.test(e);return new RegExp(`${i?`(?<!${Qu})`:""}${r}${s?`(?!${Qu})`:""}`,`${o}u`)}function Mk(e){let t=e.parentElement;for(;t?.matches(Lk);)t=t.parentElement;return t}function Pk(e,t){const n=Mk(e);if(!n)return"";const r=e.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);r.currentNode=e;const o=()=>t?r.nextNode():r.previousNode();for(let i=o();i;i=o())if(i.nodeType!==Node.TEXT_NODE){if(!i.matches(Lk))return""}else if(i.nodeValue)return Mk(i)===n?i.nodeValue:"";return""}function Jee(e,t,n){const r=n===0&&Eg.test(t),o=n+t.length===e.length&&Sg.test(t);return r&&Sg.test(Pk(e,!1))||o&&Eg.test(Pk(e,!0))}function Ik(e){return e.replace(/\s+/g," ").trim()}function ete(e,t,n,r){const o=e.slice(Math.max(0,t-kk),t),i=e.slice(t+n.length,t+n.length+kk);return{before:Ik(o+n+i),after:Ik(o+r+i)}}function tte(e){const t=wg(e);return t&&Zu(t)==="text"?t:Y("invalidArgs","Typograf runs on a text element or on the whole email.")}function nte(e,{startWait:t,released:n,settle:r,writable:o,edit:i,selectChecked:s,readSelected:a,doneInTime:l,typografLoaded:c}){return{replaceText:async({find:u,replace:d,matchCase:f,wholeWord:h,root:m})=>{if(typeof u!="string"||!u||typeof d!="string")return Y("invalidArgs",'"find" must be a non-empty string and "replace" a string.');const p=t(to),v=await o(p);if(v)return v;if(!await n(p))return Yu;const w=m===void 0?e.root():e.refs.resolve(m);if(!w)return Yr;const _=h!==!1,A=Qee(u,f===!0,_);let b=0;const g=[];return e.applyOwn(()=>{const E=w.ownerDocument.createTreeWalker(w,NodeFilter.SHOW_TEXT),T=Ku(),y=[];for(let S=E.nextNode();S;S=E.nextNode())e.isInLetter(S)&&!S.parentElement?.closest(Yee)&&!T?.contains(S)&&y.push(S);y.forEach(S=>{const C=S.nodeValue??"",L=C.replace(A,(x,N)=>_&&Jee(S,x,N)?x:(b+=1,g.length<5&&g.push(ete(C,N,x,d)),d));L!==C&&(S.nodeValue=L)})}),b===0?{ok:!0,value:{replaced:b}}:(await r(()=>({ok:!0})),{ok:!0,value:{replaced:b,examples:g}})},setProps:async({element:u,props:d})=>{if(!d||typeof d!="object"||Array.isArray(d))return Y("invalidArgs",'"props" must be an object of inspector settings.');const f=t(to),h=await o(f);if(h)return h;const m=await a(u,f,v=>An(v)?yr:v);if(zi(m))return m;if(m.sent.type==="customTable")return Y("invalidArgs","Table cells are edited in the table editor, not by element.setProps.");const p=e.letterText();return e.applySettings(m.sent.type,{...d}),r(()=>({ok:!0,element:e.activeElement()??m.element,unchanged:!e.selectionLock.isLocked()&&e.letterText()===p}))},setText:({element:u,text:d})=>typeof d!="string"?Promise.resolve(Y("invalidArgs",'"text" must be a string.')):i(u,f=>{const h=f&&wg(f);if(!h)return Y("invalidArgs","Text is set on a text, header, button or link element; pass its reference or the reference of its cell.");const m=Ok(h);return An(h)?yr:wk(h)?vg:m.matches(xk)||m.querySelector(xk)?Y("invalidArgs","The element holds a list, a table, a picture, a variable or a locked part that new text would erase; use text.replace."):(gb(m,Rk(d)),{ok:!0,element:h})}),insertVariable:({element:u,variable:d})=>typeof d!="string"||!d.trim()?Promise.resolve(Y("invalidArgs",'"variable" must be a non-empty string.')):i(u,f=>{const h=f&&wg(f);if(!h)return Y("invalidArgs","A variable goes into a text, header, button or link element; pass its reference or the reference of its cell.");const m=Ok(h),p=Zee(m),v=p?.parentElement??m;if(An(v))return yr;if(Ku()?.contains(h))return vg;if(h.matches("ul, ol, table")||h.querySelector("ul, ol, table"))return Y("invalidArgs","The element holds a list or a table; a variable cannot be appended to it.");const w=h.ownerDocument.createElement("em-replace");return w.setAttribute("text",d),w.textContent=d,p?.remove(),v.append(w),{ok:!0,element:h}}),typograf:async({element:u})=>{const d=t(to),f=await o(d);if(f)return f;if(u===void 0){if(!await n(d))return Yu;const p=e.activeElement()?void 0:Array.from(e.root().querySelectorAll('[em="block"]')).find(w=>!An($a(w)));if(!e.activeElement()&&!p)return{ok:!0};const v=p?s($a(p)):void 0;if(v&&zi(v))return v}else{const p=await a(u,d,tte);if(zi(p))return p;if(!p.element.contains(e.activeElement()))return Y("unavailable","The element could not be selected; try again.")}if(!await c(d))return Y("unavailable","Typograf did not finish; try again.");const h=qee(e.root()),m=await l(()=>e.typograf(u===void 0?"typograf_all":"typograf"));return e.applyOwn(()=>zee(h)),m?r(()=>({ok:!0})):Y("unavailable","Typograf did not finish; try again.")}}}function _g(e){return e?.closest("amp-accordion")??null}var rte=".em-mob-wrap, .noresp-em-mob-wrap",ote=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",ite='div[style*="inline-block"]';function ste(e){const t=e.settings?.floatBlocks;return Array.isArray(t?.items)?t:void 0}function ate(e){const t=e.closest('[em="block"]');return t?$a(t):void 0}function Ui(e){return Array.from(e.querySelectorAll(e.querySelector(rte)?ote:ite))}function lte(e){return _g(e)??Y("invalidArgs","Pass an accordion reference.")}var Cg=e=>e.querySelectorAll("section").length;function Dk(e){const t=lte(e);return"ok"in t||!An(t)?t:yr}function cte(e,t){const n=e.querySelector(":scope > header");if(!n)return;const r=n.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_TEXT),o=[];for(let l=r.nextNode();l;l=r.nextNode())o.push(l);const i=l=>{let c=0;for(let u=l.parentElement;u&&u!==n;u=u.parentElement)c+=1;return c},s=o.filter(l=>l.data.trim()),a=s.reduce((l,c)=>!l||i(c)>i(l)?c:l,void 0);a&&(a.data=t,s.filter(l=>l!==a&&l.data===t).forEach(l=>l.data=""))}var ute=n2/2,Bk=5e3;function dte(e){return e.getAttribute("em")==="block"?$a(e):e}function fte(e){const t=p=>{let v=!1;const w=[];return e.later(()=>{v=!0,w.splice(0).forEach(_=>_())},p),{expired:()=>v,onExpire:_=>v?_():void w.push(_)}},n=p=>new Promise(v=>{if(p?.expired()){v(!1);return}if(!e.selectionLock.isLocked()){v(!0);return}let w=!1;const _=b=>{w||(w=!0,A(),v(b))},A=e.selectionLock.onReleased(()=>_(!0));(p??t(ute)).onExpire(()=>_(!1))}),r=p=>{if(!p.ok)return p;const v=p.element?.isConnected?e.refs.issue(dte(p.element)):void 0,w=p.columns?.flatMap(A=>e.refs.issue(A)??[]),_={...v?{element:v}:{},...w?{columns:w}:{},...p.sections===void 0?{}:{sections:p.sections},...p.unchanged?{unchanged:!0}:{}};return{ok:!0,value:Object.keys(_).length?_:void 0}},o=async p=>(await n(),await e.commit(),await e.whenSent(),r(p())),i=(p,v)=>new Promise(w=>{let _=!1;const A=b=>{_||(_=!0,w(b))};v(A),e.later(()=>A(!1),p)}),s=p=>new Promise(v=>{if(p.expired()){v(!1);return}p.onExpire(()=>v(!1)),e.whenEditorLostFocus().then(()=>v(!0))}),a=async p=>await s(p)?e.editLock.isTextLocked()?Uee:void 0:_k,l=async(p,v)=>{const w=t(to),_=await a(w);if(_)return _;if(!await n(w))return Yu;const A=p===void 0?void 0:e.refs.resolve(p);if(p!==void 0&&!A)return Yr;const b=e.applyOwn(()=>v(A));return b.ok?o(()=>b):b},c=p=>{const v=e.select(p);return!v||!v.type?Y("invalidArgs","This element has no settings in the inspector; pick another element from element.getTree."):{element:p,sent:v}},u=async(p,v,w)=>{if(!await s(v))return _k;if(!await n(v))return Yu;const _=e.refs.resolve(p);if(!_)return Yr;const A=w?w(_):_;return"ok"in A?A:c(A)},d=async(p,v,w)=>{const _=t(to),A=await a(_);if(A)return A;const b=await u(p,_,v);if(zi(b))return b;const g=e.applyOwn(()=>w(b));return g.ok?o(()=>g):g};return{startWait:t,released:n,settle:o,writable:a,edit:l,selectChecked:c,readSelected:u,editSelected:d,editRow:async(p,v,w)=>{let _,A,b=[];const g=await d(p,E=>(_=E,b=v.map(T=>e.refs.resolve(T)).filter(T=>T!==void 0),b.length<v.length?Yr:An(E)||b.some(An)?yr:ate(E)??Y("invalidArgs","Pass a row or a column reference.")),E=>{const T=e.activeElement();return!T||!E.element.contains(T)?Y("unavailable","The row could not be selected; try again."):(A=E.element,w({cell:A,origin:_,others:b,floatBlocks:ste(E.sent)}))});return g.ok&&A?.isConnected&&e.select(A),g},doneInTime:p=>i(Bk,v=>{p().then(()=>v(!0),()=>v(!1))}),typografLoaded:p=>i(Bk,v=>{p.onExpire(()=>v(!1)),e.loadTypograf().then(()=>v(!p.expired()),()=>v(!1))})}}var mte=4,hte=8,pte=300,gte=2e3,bte=500,yte=1500,vte=1e4,Hk="agent",Ete=["usedColors","nextElem","prevElem"];function Fk(e,t,n,r){return typeof e=="number"&&Number.isFinite(e)?Math.min(Math.max(Math.round(e),n),r):t}function $k(e){return e.flatMap(({children:t,...n})=>[n,...$k(t??[])])}function Ste(e){return Object.fromEntries(Object.entries(e).filter(([t])=>!Ete.includes(t)))}function wte(e,{settle:t,startWait:n,readSelected:r}){const o=new WeakMap;return{settle:()=>t(()=>({ok:!0})),tree:async({root:i,depth:s})=>{e.refs.sync();const a=i===void 0?e.root():e.refs.resolve(i);return a?{ok:!0,value:Ak({issue:l=>e.refs.issue(l),isInLetter:l=>e.isInLetter(l)},{root:a,depth:Fk(s,mte,1,hte),budget:pte})}:Yr},find:async({root:i})=>{e.refs.sync();const s=i===void 0?e.root():e.refs.resolve(i);if(!s)return Yr;const a=Ak({issue:l=>e.refs.issue(l),isInLetter:l=>e.isInLetter(l)},{root:s,depth:Number.MAX_SAFE_INTEGER,budget:gte,textLimit:bte});return{ok:!0,value:{nodes:$k(a.nodes),truncated:a.truncated}}},get:async({element:i})=>{const s=await r(i,n(to));if(zi(s))return s;const{element:a,sent:l}=s;return{ok:!0,value:{element:l.elementRef??e.refs.issue(a)??i,type:l.type,caption:l.caption,settings:Ste(l.settings??{})}}},select:async({element:i})=>{const s=await r(i,n(to));return zi(s)?s:{ok:!0,value:{element:s.sent.elementRef??e.refs.issue(s.element)??i}}},highlight:async({element:i,durationMs:s})=>{const a=e.refs.resolve(i);if(!a)return Yr;const l=(o.get(a)??0)+1;return o.set(a,l),e.applyHidden(()=>a.setAttribute("em-hover",Hk)),e.later(()=>{o.get(a)===l&&a.getAttribute("em-hover")===Hk&&e.applyHidden(()=>a.removeAttribute("em-hover"))},Fk(s,yte,300,vte)),{ok:!0}}}}function Ju(e){return xo(e)?null:e.closest('[em="atom"]')}function _te(e,{edit:t,editRow:n,editSelected:r}){const o=s=>_g(e.activeElement())===s,i=s=>{const a=_g(e.activeElement());return a&&Cg(a)===s?{ok:!0,element:a,sections:s}:Y("unavailable","The section change did not apply; read the tree again.")};return{delete:({element:s})=>t(s,a=>{const l=a&&xo(a),c=a&&Ju(a);if(An(a))return yr;const u=l??c;if(u&&bg(u))return yg;const d=u??a;if(d&&wk(d))return vg;if(l)e.removeBlock(l);else if(c){if(!e.removeAtom(c))return Y("unavailable","The element is being edited right now; try again.")}else return Y("invalidArgs","Only blocks and elements can be deleted; columns and cells go with their block.");return{ok:!0}}),clone:({element:s})=>t(s,a=>{const l=a&&xo(a),c=a&&Ju(a),u=l??c;return u?An(a)?yr:(l?e.cloneBlock(u):e.cloneAtom(u),{ok:!0,element:u.nextElementSibling}):Y("invalidArgs","Only blocks and elements can be cloned.")}),move:({element:s,direction:a})=>t(s,l=>{const c=l&&xo(l);return c?An(l)?yr:e.moveBlock(c,a)?{ok:!0,element:c}:Y("cannotMove",`The block is already the ${a==="up"?"first":"last"} one.`):Y("invalidArgs",'Only blocks move; pass a block reference (kind "row").')}),insertBlock:({block:s,at:a})=>t(a?.element,l=>{const c=l&&(xo(l)??l.closest('[em="block"]'));if(a&&!c)return Y("invalidArgs",'Blocks are inserted next to a block; pass a block reference (kind "row").');const u=e.insertBlock(s,c&&a?{target:c,place:a.place}:void 0);return u?{ok:!0,element:u}:Y("invalidArgs","The block could not be inserted here.")}),insertAtom:({atom:s,at:a})=>t(a.element,l=>{if(!l)return Yr;if(An(l))return yr;if(a.place==="inside"&&Tk(l))return Y("invalidArgs","This is the gap between columns, not a column; pass a column from element.getTree.");const c=a.place==="inside"?Ju(l)?null:xo(l)??l:Ju(l);if(!c)return Y("invalidArgs",a.place==="inside"?"Elements are inserted inside a row or a column, not inside another element.":'Use "before" or "after" with an element reference, or "inside" with a row or a column.');const u=e.insertAtom(s,{target:c,place:a.place});return u?{ok:!0,element:u}:Y("invalidArgs","The element could not be inserted here.")}),addColumn:({element:s})=>n(s,[],({cell:a,origin:l,floatBlocks:c})=>{const u=Ui(a);if(!xo(l)&&!u.includes(l))return Y("invalidArgs","A column is added to a row; pass a row or a column reference.");if(u.length===0||!c)return Y("invalidArgs","This row has no column layout to add a column to.");if(u.length>=8)return Y("invalidArgs","A row holds at most 8 columns.");if(!c.items.some(f=>f.width>30))return Y("invalidArgs","The columns are too narrow to make room for a new one.");e.addColumn({minWidth:30,gap:c.gap??0,gapMobile:c.gapMobile??0});const d=Ui(a);return d.length===u.length+1?{ok:!0,element:a,columns:d}:Y("unavailable","The column could not be added.")}),removeColumn:({element:s})=>n(s,[],({cell:a,origin:l,floatBlocks:c})=>{const u=Ui(a),d=u.indexOf(l);if(d<0)return Y("invalidArgs","Pass a column reference; a gap between columns is not a column.");if(u.length<2)return Y("invalidArgs","A row keeps at least one column; delete the row instead.");if(typeof c?.gap!="number"||!Number.isFinite(c.gap))return Y("invalidArgs","This row has no column layout to remove a column from.");if(bg(l))return yg;e.removeColumn({removedBlockIndex:d,gap:c.gap});const f=Ui(a);return f.length===u.length-1?{ok:!0,element:a,columns:f}:Y("unavailable","The column could not be removed.")}),swapColumns:({element:s,with:a})=>n(s,[a],({cell:l,origin:c,others:[u]})=>{const d=Ui(l),[f,h]=[d.indexOf(c),d.indexOf(u)];if(f<0||h<0||f===h)return Y("invalidArgs","Pass two different columns of the same row.");e.swapColumns({indexA:f,indexB:h});const m=Ui(l);return m[f]===d[h]?{ok:!0,element:l,columns:m}:Y("unavailable","The columns could not be swapped.")}),addAccordionSection:({element:s,title:a,text:l})=>typeof a!="string"||typeof l!="string"?Promise.resolve(Y("invalidArgs",'"title" and "text" must be strings.')):r(s,Dk,c=>{const u=Cg(c.element);if(!o(c.element))return Y("unavailable","The accordion could not be selected; try again.");if(u===0)return Y("invalidArgs","The accordion has no section to copy.");e.addSection({section:a,text:Rk(l)});const d=i(u+1),f=d.ok?d.element?.querySelector(":scope > section:last-of-type"):void 0;return f&&cte(f,a),d}),removeAccordionSection:({element:s,index:a})=>r(s,Dk,l=>{const c=Cg(l.element);return!Number.isInteger(a)||a<0||a>=c?Y("invalidArgs",`"index" must be a section number from 0 to ${c-1}.`):c<2?Y("invalidArgs","An accordion keeps at least one section; delete the accordion instead."):bg(l.element.querySelectorAll("section")[a])?yg:o(l.element)?(e.removeSection({index:a}),i(c-1)):Y("unavailable","The accordion could not be selected; try again.")})}}function Cte(e){const t=fte(e),n={...wte(e,t),...nte(e,t),..._te(e,t)};return r=>{const o=n[r?.op];return o?o(r):Promise.resolve(Y("invalidArgs",`Unknown element operation "${String(r?.op)}".`))}}var Tte={name:"sandbox.agentElements",awaits:{services:[Io,X,ot,Te,Ne,Ye,it,Ie,$o,yt,Cr]},setup(e){const t=O(e,X),n=O(e,ot),r=O(e,Te),o=O(e,it),i=O(e,Ie),s=O(e,$o),a=O(e,yt),l=O(e,Cr),c=()=>{r.commit()},u=()=>({commit:c,setCursorPosition:a,scrollTop:j.get("scrollTop")}),d=O(e,Ne),f={selectionLock:d,commit:c,setPercentsForColumns:p=>jl(p),applicationElementSettingsSet:i},h={selectionLock:d,commit:p=>{r.commit(p)},getActiveEditElement:xs,HTMLDocument:{getOuterHtml:Pt}},m=Cte({refs:O(e,Io),isInLetter:p=>t.isInLetter(p),applyOwn:p=>t.applyOwn(p),applyHidden:p=>t.applyHidden(p),commit:()=>r.commit(!0),whenSent:()=>t.whenSent(),selectionLock:d,editLock:O(e,Ye),whenEditorLostFocus:async()=>{await o.controller.whenEditorLostFocusAsync("agent"),await Ree(document)},root:()=>document.body,select:p=>{o.setEditorFocus(!1),window.getSelection()?.removeAllRanges();const v=i({elem:p});return a(p),v},applySettings:(p,v)=>s({data:{operation:ue.SANDBOX_ELEMENT_SETTINGS_SET,type:p,settings:v}}),letterText:()=>n.getText(),activeElement:()=>xs(),removeAtom:p=>oA(p,{getElementParent:v=>Ri(v),setCursorPosition:a,getVariableByIcon:ua,commit:c}),removeBlock:p=>mA(p,u()),cloneAtom:p=>lA(p,u()),cloneBlock:p=>cA(p,u()),moveBlock:(p,v)=>v==="up"?uA(p,u()):dA(p,u()),insertBlock:(p,v)=>yee(p,l.insertContext(),v),insertAtom:(p,v)=>vee(p,l.insertContext(),v),addColumn:p=>ek(p,f),removeColumn:p=>tk(p,f),swapColumns:p=>ok(p,f),addSection:p=>HA(p,h),removeSection:p=>FA(p,h),loadTypograf:KA,typograf:p=>new Promise(v=>zA({action:p},{commit:()=>{c(),v()},setCursorPosition:a,getElementParent:w=>Ri(w),messageService:z,HTMLDocument:{getOuterHtml:Pt},hasRussianText:gE})),later:(p,v)=>{setTimeout(p,v)}});z.addListenerAsync(ue.SANDBOX_ELEMENT_OPERATION,m)}},Ate={name:"sandbox.prepareHtml",provides:[ol],setup:e=>e.inject(ol,t=>kc({node:t,isPartial:!0}))},kte={name:"sandbox.blockControlsViewport",setup:e=>e.addService(xb,()=>Jc({scrollTop:j.get("scrollTop")}))},Lte=[Ate,kte,iJ,sJ,aJ,lJ,cJ,...Oee,uJ,dJ,fJ,mJ,hJ,pJ,gJ,Tte],Nte="__emmDiagnostics__",xte="diagnostics";function Ote(){try{const e=new URLSearchParams(window.location.search).get(xte);return e!==null&&e!=="0"}catch{return!1}}function Tg(e){try{window.parent.postMessage({mark:Nte,...e},"*")}catch{}}function Rte(){const e=window.performance.getEntriesByType("resource").map(t=>{const n=t;return{name:n.name,initiatorType:n.initiatorType,startTime:n.startTime,responseEnd:n.responseEnd,transferSize:n.transferSize,decodedBodySize:n.decodedBodySize}});Tg({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function ji(){return window.performance.timeOrigin+window.performance.now()}function Mte(){return Array.from(document.images).every(e=>e.complete)}function Pte(e,t){const r=window.setInterval(()=>{!Mte()||ji()-e()<500||(window.clearInterval(r),Tg({type:"settled",at:Math.max(e(),t)}),Rte())},100)}function Ite(){if(!Ote()||typeof MutationObserver!="function")return;let e=!1,t=ji();new MutationObserver(()=>{t=ji(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=ji();Tg({type:"paint",at:n}),Pte(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=ji()}),document.addEventListener("load",()=>{t=ji()},!0)}var Dte=500,Bte=300,Wa,ed=!1;function Wk(){if(ed)return;ed=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,Wa=!1,ed=!1)},Bte);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),Wa=!0,ed=!1)})}function Hte(){return Wa===!1?(Wk(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{Wa=!1,n()},Dte);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),Wa=!0,n()})})})}var Fte=1;function $te(){Wk();const e=async(t,n)=>{await n?.(t),await Hte()};z.addListenerAsync(ue.SANDBOX_INITED,e,Fte)}var Wte=16,qk=100,qte=.95,zk=.02;function Uk(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*Wte:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function jk(e,t,n){if(n===0)return!1;const r=getComputedStyle(e),o=t==="y"?r.overflowY:r.overflowX;if(o!=="auto"&&o!=="scroll"&&o!=="overlay")return!1;const i=t==="y"?e.scrollTop:Math.abs(e.scrollLeft),s=t==="y"?e.scrollHeight-e.clientHeight:e.scrollWidth-e.clientWidth;return s<=0?!1:(t==="x"&&e.scrollLeft<0?-n:n)>0?i<s-.5:i>.5}function Vk(e,t,n){const r=document.scrollingElement??document.documentElement;for(let o=e instanceof Element?e:null;o;o=o.parentElement){if(o===r||o===document.body)return!1;if(jk(o,"y",n)||jk(o,"x",t))return!0}return!1}function zte(){let e=0,t=0,n=!1;const r=()=>{n=!1;const d=e,f=t;e=0,t=0,!(d===0&&f===0)&&z.send(ue.SANDBOX_WHEEL,{deltaX:d,deltaY:f})},o=(d,f)=>{e+=d,t+=f,n||(n=!0,window.requestAnimationFrame(r))};window.addEventListener("wheel",d=>{d.ctrlKey||Vk(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(Uk(d.deltaX,d.deltaMode),Uk(d.deltaY,d.deltaMode)))},{passive:!1});let i,s=!1,a={x:0,y:0},l;const c=()=>{l!==void 0&&(window.cancelAnimationFrame(l),l=void 0)},u=()=>{let{x:d,y:f}=a,h=performance.now();const m=p=>{const v=p>h?Math.min(p-h,50):16;h=p;const w=Math.pow(qte,v/16);if(d*=w,f*=w,Math.abs(d)<zk&&Math.abs(f)<zk){l=void 0;return}o(d*v,f*v),l=window.requestAnimationFrame(m)};l=window.requestAnimationFrame(m)};window.addEventListener("touchstart",d=>{c(),s=!1,a={x:0,y:0};const f=d.touches.length===1?d.touches[0]:void 0;i=f?{x:f.screenX,y:f.screenY,at:d.timeStamp}:void 0},{passive:!0}),window.addEventListener("touchmove",d=>{const f=d.touches.length===1?d.touches[0]:void 0;if(document.documentElement.classList.contains("em-resize-start")){i=void 0,s=!1;return}if(!f||!i){i=void 0,s=!1;return}const h=i.x-f.screenX,m=i.y-f.screenY,p=d.timeStamp-i.at;if(i={x:f.screenX,y:f.screenY,at:d.timeStamp},!Vk(d.target,h,m)){if(d.cancelable&&d.preventDefault(),s=!0,p>0){const v=Math.min(p/qk,1);a={x:a.x*(1-v)+h/p*v,y:a.y*(1-v)+m/p*v}}o(h,m)}},{passive:!1}),window.addEventListener("touchend",d=>{const f=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&f<qk&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var Ute={name:"sandbox.diagnosticsAgent",setup:()=>Ite()},jte={name:"sandbox.paintGate",setup:()=>$te()},Vte={name:"sandbox.wheelBridge",setup:()=>zte()},Gte={name:"sandbox.deviceWidthMediaGuard",setup:()=>q7()};function Xte(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}function Kte(){return Math.max(document.body?.scrollWidth??0,document.documentElement?.scrollWidth??0)}window.iFrameResizer={heightCalculationMethod:Xte,widthCalculationMethod:Kte};var Yte=Sr(((e,t)=>{(function(n){if(typeof window<"u"){var r=!0,o=10,i="",s=0,a="",l=null,c="",u=!1,d={resize:1,click:1},f=128,h=!0,m=1,p="bodyOffset",v=p,w=!0,_="",A={},b=32,g=null,E=!1,T=!1,y="[iFrameSizer]",S=y.length,C="",L={max:1,min:1,bodyScroll:1,documentElementScroll:1},x="child",N=!0,W=window.parent,R="*",P=0,J=!1,ne=null,he=16,re=1,Z="scroll",ve=Z,de=window,_e=function(){fn("onMessage function not defined")},ct=function(){},ee=function(){},q={height:function(){return fn("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return fn("Custom width calculation function not defined"),document.body.scrollWidth}},oe={},Wt=!1;try{var U=Object.create({},{passive:{get:function(){Wt=!0}}});window.addEventListener("test",td,U),window.removeEventListener("test",td,U)}catch{}var un,wt,dn,Zt,kn,Qt,ut={bodyOffset:function(){return document.body.offsetHeight+Nn("marginTop")+Nn("marginBottom")},offset:function(){return ut.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return q.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,Rt(ut))},min:function(){return Math.min.apply(null,Rt(ut))},grow:function(){return ut.max()},lowestElement:function(){return Math.max(ut.bodyOffset()||ut.documentElementOffset(),Se("bottom",ht()))},taggedElement:function(){return Qn("bottom","data-iframe-height")}},Ot={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return q.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(Ot.bodyScroll(),Ot.documentElementScroll())},max:function(){return Math.max.apply(null,Rt(Ot))},min:function(){return Math.min.apply(null,Rt(Ot))},rightMostElement:function(){return Se("right",ht())},taggedElement:function(){return Qn("right","data-iframe-width")}},_t=(un=xn,kn=null,Qt=0,function(){var M=Date.now(),F=he-(M-(Qt=Qt||M));return wt=this,dn=arguments,F<=0||he<F?(kn&&(clearTimeout(kn),kn=null),Qt=M,Zt=un.apply(wt,dn),kn||(wt=dn=null)):kn=kn||setTimeout(qt,F),Zt});Zn(window,"message",function(M){var F={init:function(){_=M.data,W=M.source,nd(),h=!1,setTimeout(function(){w=!1},f)},reset:function(){w?ce("Page reset ignored by init"):(ce("Page size reset by host page"),Qr("resetPage"))},resize:function(){vr("resizeParent","Parent window requested size check")},moveToAnchor:function(){A.findTarget(Ce())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var Re=Ce();ce("PageInfoFromParent called from parent: "+Re),ee(JSON.parse(Re)),ce(" --")},message:function(){var Re=Ce();ce("onMessage called from parent: "+Re),_e(JSON.parse(Re)),ce(" --")}};function me(){return M.data.split("]")[1].split(":")[0]}function Ce(){return M.data.substr(M.data.indexOf(":")+1)}function G(){return M.data.split(":")[2]in{true:1,false:1}}function Q(){var Re=me();Re in F?F[Re]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||G()||fn("Unexpected message ("+M.data+")")}y===(""+M.data).substr(0,S)&&(h===!1?Q():G()?F.init():ce('Ignored message of type "'+me()+'". Received before initialization.'))}),Zn(window,"readystatechange",Xk),Xk()}function td(){}function Zn(M,F,me,Ce){M.addEventListener(F,me,!!Wt&&(Ce||{}))}function qa(M){return M.charAt(0).toUpperCase()+M.slice(1)}function Oo(M){return y+"["+C+"] "+M}function ce(M){E&&window.console}function fn(M){window.console}function nd(){function M(G){return G==="true"}var F;function me(G){mn(0,0,G.type,G.screenY+":"+G.screenX)}function Ce(G,Q){ce("Add event listener: "+Q),Zn(window.document,G,me)}F=_.substr(S).split(":"),C=F[0],s=n!==F[1]?Number(F[1]):s,u=n!==F[2]?M(F[2]):u,E=n!==F[3]?M(F[3]):E,b=n!==F[4]?Number(F[4]):b,r=n!==F[6]?M(F[6]):r,a=F[7],v=n!==F[8]?F[8]:v,i=F[9],c=F[10],P=n!==F[11]?Number(F[11]):P,A.enable=n!==F[12]&&M(F[12]),x=n!==F[13]?F[13]:x,ve=n!==F[14]?F[14]:ve,T=n!==F[15]?!!F[15]:T,ce("Initialising iFrame ("+window.location.href+")"),(function(){function G(Q,Re){return typeof Q=="function"&&(ce("Setup custom "+Re+"CalcMethod"),q[Re]=Q,Q="custom"),Q}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var Q=window.iFrameResizer;ce("Reading data from page: "+JSON.stringify(Q)),Object.keys(Q).forEach(za,Q),_e="onMessage"in Q?Q.onMessage:_e,ct="onReady"in Q?Q.onReady:ct,R="targetOrigin"in Q?Q.targetOrigin:R,v="heightCalculationMethod"in Q?Q.heightCalculationMethod:v,ve="widthCalculationMethod"in Q?Q.widthCalculationMethod:ve})(),v=G(v,"height"),ve=G(ve,"width")),ce("TargetOrigin for parent set to: "+R)})(),(function(){n===a&&(a=s+"px"),Vi("margin",(function(G,Q){return Q.indexOf("-")!==-1&&(fn("Negative CSS value ignored for "+G),Q=""),Q})("margin",a))})(),Vi("background",i),Vi("padding",c),(F=document.createElement("div")).style.clear="both",F.classList.add("iframe-resizer-inner"),F.style.display="block",F.style.height="0",document.body.appendChild(F),Ua(),$(),document.documentElement.style.height="",document.body.style.height="",ce('HTML & body height set to "auto"'),ce("Enable public methods"),de.parentIFrame={autoResize:function(G){return G===!0&&r===!1?(r=!0,rt()):G===!1&&r===!0&&(r=!1,Zr("remove"),l!==null&&l.disconnect(),clearInterval(g)),mn(0,0,"autoResize",JSON.stringify(r)),r},close:function(){mn(0,0,"close")},getId:function(){return C},getPageInfo:function(G){typeof G=="function"?(ee=G,mn(0,0,"pageInfo")):(ee=function(){},mn(0,0,"pageInfoStop"))},moveToAnchor:function(G){A.findTarget(G)},reset:function(){On("parentIFrame.reset")},scrollTo:function(G,Q){mn(Q,G,"scrollTo")},scrollToOffset:function(G,Q){mn(Q,G,"scrollToOffset")},sendMessage:function(G,Q){mn(0,0,"message",JSON.stringify(G),Q)},setHeightCalculationMethod:function(G){v=G,Ua()},setWidthCalculationMethod:function(G){ve=G,$()},setTargetOrigin:function(G){ce("Set targetOrigin: "+G),R=G},size:function(G,Q){vr("size","parentIFrame.size("+((G||"")+(Q?","+Q:""))+")",G,Q)}},T===!0&&(Ce("mouseenter","Mouse Enter"),Ce("mouseleave","Mouse Leave")),rt(),A=(function(){function G(Ut){var fe=Ut.getBoundingClientRect(),Ut={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(fe.left,10)+parseInt(Ut.x,10),y:parseInt(fe.top,10)+parseInt(Ut.y,10)}}function Q(en){var fe,Ut=en.split("#")[1]||en,en=decodeURIComponent(Ut),Kk=document.getElementById(en)||document.getElementsByName(en)[0];n!==Kk?(fe=G(fe=Kk),ce("Moving to in page link (#"+Ut+") at x: "+fe.x+" y: "+fe.y),mn(fe.y,fe.x,"scrollToOffset")):(ce("In page link (#"+Ut+") not found in iFrame, so sending to parent"),mn(0,0,"inPageLink","#"+Ut))}function Re(){var Jt=window.location.hash,fe=window.location.href;Jt!==""&&Jt!=="#"&&Q(fe)}function zt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Jt){Jt.getAttribute("href")!=="#"&&Zn(Jt,"click",function(fe){fe.preventDefault(),Q(this.getAttribute("href"))})})}function ja(){Array.prototype.forEach&&document.querySelectorAll?(ce("Setting up location.hash handlers"),zt(),Zn(window,"hashchange",Re),setTimeout(Re,f)):fn("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return A.enable?ja():ce("In page linking not enabled"),{findTarget:Q}})(),vr("init","Init message from host page"),ct()}function za(M){var F=M.split("Callback");F.length===2&&(this[F="on"+F[0].charAt(0).toUpperCase()+F[0].slice(1)]=this[M],delete this[M],fn("Deprecated: '"+M+"' has been renamed '"+F+"'. The old method will be removed in the next major version."))}function Vi(M,F){n!==F&&F!==""&&F!=="null"&&ce("Body "+M+' set to "'+(document.body.style[M]=F)+'"')}function nt(M){var F={add:function(me){function Ce(){vr(M.eventName,M.eventType)}oe[me]=Ce,Zn(window,me,Ce,{passive:!0})},remove:function(me){var Ce,G=oe[me];delete oe[me],Ce=window,me=me,G=G,Ce.removeEventListener(me,G,!1)}};M.eventNames&&Array.prototype.map?(M.eventName=M.eventNames[0],M.eventNames.map(F[M.method])):F[M.method](M.eventName),ce(qa(M.method)+" event listener: "+M.eventType)}function Zr(M){nt({method:M,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),nt({method:M,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),nt({method:M,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),nt({method:M,eventType:"Input",eventName:"input"}),nt({method:M,eventType:"Mouse Up",eventName:"mouseup"}),nt({method:M,eventType:"Mouse Down",eventName:"mousedown"}),nt({method:M,eventType:"Orientation Change",eventName:"orientationchange"}),nt({method:M,eventType:"Print",eventNames:["afterprint","beforeprint"]}),nt({method:M,eventType:"Ready State Change",eventName:"readystatechange"}),nt({method:M,eventType:"Touch Start",eventName:"touchstart"}),nt({method:M,eventType:"Touch End",eventName:"touchend"}),nt({method:M,eventType:"Touch Cancel",eventName:"touchcancel"}),nt({method:M,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),nt({method:M,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),nt({method:M,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),x==="child"&&nt({method:M,eventType:"IFrame Resized",eventName:"resize"})}function rd(M,F,me,Ce){return F!==M&&(M in me||(fn(M+" is not a valid option for "+Ce+"CalculationMethod."),M=F),ce(Ce+' calculation method set to "'+M+'"')),M}function Ua(){v=rd(v,p,ut,"height")}function $(){ve=rd(ve,Z,Ot,"width")}function rt(){var M;r===!0?(Zr("add"),M=b<0,window.MutationObserver||window.WebKitMutationObserver?M?Ln():l=(function(){function F(fe){function Ut(en){en.complete===!1&&(ce("Attach listeners to "+en.src),en.addEventListener("load",G,!1),en.addEventListener("error",Q,!1),zt.push(en))}fe.type==="attributes"&&fe.attributeName==="src"?Ut(fe.target):fe.type==="childList"&&Array.prototype.forEach.call(fe.target.querySelectorAll("img"),Ut)}function me(fe){ce("Remove listeners from "+fe.src),fe.removeEventListener("load",G,!1),fe.removeEventListener("error",Q,!1),fe=fe,zt.splice(zt.indexOf(fe),1)}function Ce(fe,Ut,en){me(fe.target),vr(Ut,en+": "+fe.target.src)}function G(fe){Ce(fe,"imageLoad","Image loaded")}function Q(fe){Ce(fe,"imageLoadFailed","Image load failed")}function Re(fe){vr("mutationObserver","mutationObserver: "+fe[0].target+" "+fe[0].type),fe.forEach(F)}var zt=[],ja=window.MutationObserver||window.WebKitMutationObserver,Jt=(function(){var fe=document.querySelector("body");return Jt=new ja(Re),ce("Create body MutationObserver"),Jt.observe(fe,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Jt})();return{disconnect:function(){"disconnect"in Jt&&(ce("Disconnect body MutationObserver"),Jt.disconnect(),zt.forEach(me))}}})():(ce("MutationObserver not supported in this browser!"),Ln())):ce("Auto Resize disabled")}function Ln(){b!==0&&(ce("setInterval: "+b+"ms"),g=setInterval(function(){vr("interval","setInterval: "+b)},Math.abs(b)))}function Nn(M,F){var me=0;return F=F||document.body,me=(me=document.defaultView.getComputedStyle(F,null))!==null?me[M]:0,parseInt(me,o)}function Se(M,F){for(var me,Ce=F.length,G=0,Q=qa(M),Re=Date.now(),zt=0;zt<Ce;zt++)G<(me=F[zt].getBoundingClientRect()[M]+Nn("margin"+Q,F[zt]))&&(G=me);return Re=Date.now()-Re,ce("Parsed "+Ce+" HTML elements"),ce("Element position calculated in "+Re+"ms"),he/2<(Re=Re)&&ce("Event throttle increased to "+(he=2*Re)+"ms"),G}function Rt(M){return[M.bodyOffset(),M.bodyScroll(),M.documentElementOffset(),M.documentElementScroll()]}function Qn(M,F){var me=document.querySelectorAll("["+F+"]");return me.length===0&&(fn("No tagged elements ("+F+") found on page"),document.querySelectorAll("body *")),Se(M,me)}function ht(){return document.querySelectorAll("body *")}function xn(M,F,me,Ce){function G(){M in{init:1,interval:1,size:1}||!(v in L||u&&ve in L)?M in{interval:1}||ce("No change in size detected"):On(F)}var Q,Re;function zt(ja,Jt){return!(Math.abs(ja-Jt)<=P)}Q=n!==me?me:ut[v](),Re=n!==Ce?Ce:Ot[ve](),zt(m,Q)||u&&zt(re,Re)||M==="init"?(od(),mn(m=Q,re=Re,M)):G()}function qt(){Qt=Date.now(),kn=null,Zt=un.apply(wt,dn),kn||(wt=dn=null)}function vr(M,F,me,Ce){J&&M in d?ce("Trigger event cancelled: "+M):(M in{reset:1,resetPage:1,init:1}||ce("Trigger event: "+F),(M==="init"?xn:_t)(M,F,me,Ce))}function od(){J||(J=!0,ce("Trigger event lock on")),clearTimeout(ne),ne=setTimeout(function(){J=!1,ce("Trigger event lock off"),ce("--")},f)}function Qr(M){m=ut[v](),re=Ot[ve](),mn(m,re,M)}function On(M){var F=v;v=p,ce("Reset trigger event: "+M),od(),Qr("reset"),v=F}function mn(M,F,me,Ce,G){var Q;N===!0&&(n===G?G=R:ce("Message targetOrigin: "+G),ce("Sending message to host page ("+(Q=C+":"+(M+":"+F)+":"+me+(n!==Ce?":"+Ce:""))+")"),W.postMessage(y+Q,G))}function Xk(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),Zte=[{name:"Stripo (es-header/content/footer)",detect:()=>!!(document.querySelector(".es-header")||document.querySelector(".es-content")||document.querySelector(".es-footer")),apply:()=>{document.querySelectorAll(".es-header, .es-content, .es-footer").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-header-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-content-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-footer-body > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Stripo (es-wrapper)",detect:()=>!!document.querySelector(".es-wrapper"),apply:()=>{document.querySelectorAll(".es-wrapper > tr > td > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-wrapper > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sandsay",detect:()=>!!(document.querySelector("[data-template-wrapper]")&&document.querySelector("[data-template-content]")),apply:()=>{document.querySelectorAll("[data-template-wrapper] > table[data-block-id]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Beefree",detect:()=>!!(document.querySelector(".nl-container")&&document.querySelector(".row")),apply:()=>{document.querySelectorAll('.row[em="block"]').forEach(e=>{e.removeAttribute("em")}),document.querySelectorAll(".row").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".row-content").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon",detect:()=>!!document.querySelector(".main-container"),apply:()=>{document.querySelectorAll(".main-container > tr > td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon (email-container)",detect:()=>!!document.querySelector(".email-container"),apply:()=>{document.querySelectorAll(".email-container > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Mindbox",detect:()=>!!(document.querySelector(".nl-container")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".nl-container > tr > td > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Unlayer",detect:()=>!!(document.querySelector(".clean-body.u_body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".u-row-container").forEach(e=>{e.setAttribute("em","block")})}},{name:"Postcards",detect:()=>!!(document.querySelector(".pc-email-body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll('.pc-email-container > tr > td > table[role="presentation"]').forEach(e=>{e.setAttribute("em","block")})}},{name:"Topol",detect:()=>!!(document.querySelector(".hide_section_on_mobile")||document.querySelector(".mj-column-per-100")||document.querySelector(".outlook-group-fix")),apply:()=>{document.querySelectorAll("body > div > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sender",detect:()=>!!document.querySelector(".e-c.sect"),apply:()=>{document.querySelectorAll(".e-c.sect").forEach(e=>{e.setAttribute("em","block")})}},{name:"Letteros",detect:()=>!!(!document.querySelector("[mailfit-module]")&&(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]"))),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("body > div > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll('[style*="overflow"]').forEach(e=>{e.style.removeProperty("overflow")})}},{name:"Letteros (letteros-element)",detect:()=>!!document.querySelector("[letteros-element]"),apply:()=>{document.querySelectorAll("[letteros-body]").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[letteros-element]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Ascona",detect:()=>!!(document.querySelector(".mail_preheader")&&document.body.classList.contains("body")),apply:()=>{document.querySelectorAll("#mailsub > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr").forEach(t=>{t.setAttribute("em","block")})})}},{name:"Mailfit",detect:()=>!!document.querySelector("[mailfit-module]"),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[mailfit-module]").forEach(e=>{e.setAttribute("em","block")})}},{name:"CashCowAgency",detect:()=>!!document.querySelector(".container-div"),apply:()=>{document.querySelectorAll("body > center").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".container-td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"MakeMail",detect:()=>!!(document.querySelector(".mail")&&document.querySelector(".container")),apply:()=>{document.querySelectorAll(".container").forEach(e=>{e.setAttribute("em","block")})}},{name:"data-axle.com",detect:()=>!!document.querySelector(".full-width-container-inner"),apply:()=>{document.querySelectorAll(".full-width-container-inner > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Miro",detect:()=>!!document.querySelector(".content__tablet_fullWidth"),apply:()=>{document.querySelectorAll(".content__tablet_fullWidth").forEach(e=>{for(const t of Array.from(e.children))if(t.children.length>1)for(const n of Array.from(t.children))n.setAttribute("em","block");else for(const n of Array.from(t.children))for(const r of Array.from(n.children))for(const o of Array.from(r.children))o.setAttribute("em","block")})}},{name:"WIM (full-wrap)",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll(".full-wrap > tr > td > div > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr, :scope > td > table > tr").forEach(t=>{t.setAttribute("em","block")})})}},{name:"WIM",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&!document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > table > tr > td > table > tr").forEach(t=>{t.setAttribute("em","block")})})}},{name:"Emailify",detect:()=>document.body.classList.contains("emailify"),apply:()=>{document.querySelectorAll("body > div > div > table > tr").forEach(e=>{e.setAttribute("em","block")})}}];function Qte(){document.querySelectorAll('body > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr').forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","block")})}function Jte(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),ao();return}if(e){let n=!1;for(const r of Zte)if(r.detect()){r.apply(),n=!0;break}n||Qte()}Gk(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||z.send({operation:"application_template_not_em_alert_show"}),ao()}function Gk(){const e=document.querySelector("[em=atoms]");if(e){for(const t of Array.from(e.children))t.setAttribute("em","atom");e.removeAttribute("em")}document.documentElement?.style.height&&document.documentElement.style.removeProperty("height"),document.body?.style.height&&document.body.style.removeProperty("height")}Object.defineProperty(H,"CANVAS_CORE_UNITS",{enumerable:!0,get:function(){return Uq}}),Object.defineProperty(H,"EDIT_LOCK_ID",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(H,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return Lte}}),Object.defineProperty(H,"EVENT_TYPES",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(H,"FOCUS_ID",{enumerable:!0,get:function(){return it}}),Object.defineProperty(H,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return X}}),Object.defineProperty(H,"INIT_PREVIEW_ID",{enumerable:!0,get:function(){return ss}}),Object.defineProperty(H,"INSERT_POLICY_ID",{enumerable:!0,get:function(){return xd}}),Object.defineProperty(H,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return Lb}}),Object.defineProperty(H,"Node",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(H,"NodeType",{enumerable:!0,get:function(){return I}}),Object.defineProperty(H,"SELECTION_LOCK_ID",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(H,"SET_CURSOR_ID",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(H,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return Ab}}),Object.defineProperty(H,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(H,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return kb}}),Object.defineProperty(H,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(H,"_defineProperty",{enumerable:!0,get:function(){return k}}),Object.defineProperty(H,"addFontFamilyClass",{enumerable:!0,get:function(){return ba}}),Object.defineProperty(H,"ampUnit",{enumerable:!0,get:function(){return LM}}),Object.defineProperty(H,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return Vc}}),Object.defineProperty(H,"applyRootScale",{enumerable:!0,get:function(){return Es}}),Object.defineProperty(H,"buildEmFontClassName",{enumerable:!0,get:function(){return Xc}}),Object.defineProperty(H,"checkBlockAdaptivity",{enumerable:!0,get:function(){return zc}}),Object.defineProperty(H,"clearLinkTags",{enumerable:!0,get:function(){return wo}}),Object.defineProperty(H,"clearProjectFontFaces",{enumerable:!0,get:function(){return Ur}}),Object.defineProperty(H,"commitOf",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(H,"commonStylesApply",{enumerable:!0,get:function(){return CC}}),Object.defineProperty(H,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return Kh}}),Object.defineProperty(H,"createFontClassName",{enumerable:!0,get:function(){return Mh}}),Object.defineProperty(H,"createIdentifier",{enumerable:!0,get:function(){return se}}),Object.defineProperty(H,"defineSurface",{enumerable:!0,get:function(){return WN}}),Object.defineProperty(H,"defineUnit",{enumerable:!0,get:function(){return bN}}),Object.defineProperty(H,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return Gte}}),Object.defineProperty(H,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return Ute}}),Object.defineProperty(H,"editLock",{enumerable:!0,get:function(){return Tf}}),Object.defineProperty(H,"elMarkupHelper",{enumerable:!0,get:function(){return Jte}}),Object.defineProperty(H,"extensionsUnit",{enumerable:!0,get:function(){return QW}}),Object.defineProperty(H,"findParentTr",{enumerable:!0,get:function(){return CE}}),Object.defineProperty(H,"fitEmailToWidth",{enumerable:!0,get:function(){return MM}}),Object.defineProperty(H,"fitImagesToColumns",{enumerable:!0,get:function(){return Op}}),Object.defineProperty(H,"getOuterHtml",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(H,"getPreheader",{enumerable:!0,get:function(){return Fa}}),Object.defineProperty(H,"getPreheaderElem",{enumerable:!0,get:function(){return Gu}}),Object.defineProperty(H,"getSubject",{enumerable:!0,get:function(){return hg}}),Object.defineProperty(H,"getUsedColors",{enumerable:!0,get:function(){return MC}}),Object.defineProperty(H,"globalBlockReplace",{enumerable:!0,get:function(){return pee}}),Object.defineProperty(H,"iframeSetSize",{enumerable:!0,get:function(){return PM}}),Object.defineProperty(H,"implementPolyfills",{enumerable:!0,get:function(){return xg}}),Object.defineProperty(H,"insertAdjacentHTML",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(H,"insertCountdown",{enumerable:!0,get:function(){return $_}}),Object.defineProperty(H,"insertNewHTML",{enumerable:!0,get:function(){return Hv}}),Object.defineProperty(H,"isEmptyTable",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(H,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return Gk}}),Object.defineProperty(H,"markProjectFontClass",{enumerable:!0,get:function(){return Ih}}),Object.defineProperty(H,"messageService",{enumerable:!0,get:function(){return z}}),Object.defineProperty(H,"minifyStylesheet",{enumerable:!0,get:function(){return go}}),Object.defineProperty(H,"paintGateUnit",{enumerable:!0,get:function(){return jte}}),Object.defineProperty(H,"parseFromString",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(H,"registerPreheaderService",{enumerable:!0,get:function(){return $ee}}),Object.defineProperty(H,"registerSubjectService",{enumerable:!0,get:function(){return Wee}}),Object.defineProperty(H,"removeClassesByPrefix",{enumerable:!0,get:function(){return fa}}),Object.defineProperty(H,"removeHiddenClasses",{enumerable:!0,get:function(){return Ac}}),Object.defineProperty(H,"requireService",{enumerable:!0,get:function(){return O}}),Object.defineProperty(H,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return Yte}}),Object.defineProperty(H,"rgbToHex",{enumerable:!0,get:function(){return V}}),Object.defineProperty(H,"rowsHost",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(H,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return Jc}}),Object.defineProperty(H,"setBlockMaxWidth",{enumerable:!0,get:function(){return Rp}}),Object.defineProperty(H,"setDocumentStyles",{enumerable:!0,get:function(){return Oh}}),Object.defineProperty(H,"setElementBorder",{enumerable:!0,get:function(){return Bh}}),Object.defineProperty(H,"setElementBorderRadius",{enumerable:!0,get:function(){return Ai}}),Object.defineProperty(H,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return nC}}),Object.defineProperty(H,"setFloatBlocksWidth",{enumerable:!0,get:function(){return xp}}),Object.defineProperty(H,"setImageWidth",{enumerable:!0,get:function(){return wh}}),Object.defineProperty(H,"setStructureBlocksWidth",{enumerable:!0,get:function(){return _u}}),Object.defineProperty(H,"startSandbox",{enumerable:!0,get:function(){return qN}}),Object.defineProperty(H,"state",{enumerable:!0,get:function(){return j}}),Object.defineProperty(H,"uptimeCountdown",{enumerable:!0,get:function(){return _h}}),Object.defineProperty(H,"wheelBridgeUnit",{enumerable:!0,get:function(){return Vte}}),Object.defineProperty(H,"withForeignListenersPaused",{enumerable:!0,get:function(){return It}})});
|