@emailmaker/emailmaker 1.1.109 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +54 -1
  2. package/emailmaker-core.fec11667.js +859 -0
  3. package/emailmaker-esm.js +11 -11
  4. package/{emailmaker-po.7b3c64f5.js → emailmaker-po.fec11667.js} +1 -1
  5. package/emailmaker.d.ts +220 -1
  6. package/emailmaker.js +12 -12
  7. package/iframe/.vite/manifest.json +4 -4
  8. package/iframe/{iframe-eblock.7b3c64f5.html → iframe-eblock.fec11667.html} +2 -2
  9. package/iframe/{iframe.7b3c64f5.html → iframe.fec11667.html} +2 -2
  10. package/iframe/js/{elMarkupHelper.BcpgksI_.js → elMarkupHelper.Dv3AYDYP.js} +10 -10
  11. package/iframe/js/{iframe-eblock.body.7b3c64f5.js → iframe-eblock.body.fec11667.js} +1 -1
  12. package/iframe/js/iframe-eblock.js +2 -2
  13. package/iframe/js/{iframe.body.7b3c64f5.js → iframe.body.fec11667.js} +1 -1
  14. package/iframe/js/iframe.js +2 -2
  15. package/package.json +1 -1
  16. package/runtime/react/index.js +1 -1
  17. package/static/core/{6314ae82.js → 29b3ccef.js} +1 -1
  18. package/static/core/{6fb2f217.js → 2e70fae0.js} +3 -3
  19. package/static/core/{87dcdb89.js → 44fac8d4.js} +1 -1
  20. package/static/core/{86b377fd.js → 5c4239d8.js} +1 -1
  21. package/static/core/{8c37b60d.js → 64c27f91.js} +1 -1
  22. package/static/core/{a85c7f02.js → 727a165f.js} +1 -1
  23. package/static/core/{dfcb8d34.js → 790366d3.js} +1 -1
  24. package/static/core/{3bfab25b.js → 7be64bf5.js} +1 -1
  25. package/static/core/{26473b73.js → 7d006e7b.js} +1 -1
  26. package/static/core/{e4b8362a.js → 83d2ca5d.js} +6 -6
  27. package/static/core/{850805d7.js → 8b89090c.js} +1 -1
  28. package/static/core/{874f77d2.js → 8da91a53.js} +1 -1
  29. package/static/core/{e8fa95c8.js → 99c15a5d.js} +1 -1
  30. package/static/core/{efb5b933.js → 9f7e0f94.js} +1 -1
  31. package/static/core/a2c7aeb0.js +1 -0
  32. package/static/core/{1157da89.js → a9235d9e.js} +1 -1
  33. package/static/core/{b35140b6.js → b27aec0b.js} +1 -1
  34. package/static/core/{98ab1508.js → b74171bd.js} +1 -1
  35. package/static/core/{26971a74.js → b7dee12b.js} +1 -1
  36. package/static/core/{5c4304c8.js → bbb87124.js} +1 -1
  37. package/static/core/{756e184f.js → c5713f94.js} +1 -1
  38. package/static/core/{f115f982.js → ccb090eb.js} +1 -1
  39. package/static/core/{213ffad0.js → db685f4e.js} +1 -1
  40. package/static/core/{2e29db3c.js → e15ab856.js} +1 -1
  41. package/static/core/{9ef544f4.js → e7bbe544.js} +1 -1
  42. package/static/core/{cebc7ae2.js → ec5f739e.js} +1 -1
  43. package/static/core/{2f32a31d.js → f2ced98d.js} +2 -2
  44. package/static/core/{ee6c9aa1.js → f54ef492.js} +1 -1
  45. package/static/esm/ae0fe329.js +1 -0
  46. package/static/umd-runtime/runtime.CunK0nEC.js +1 -0
  47. package/vendor/@emailmaker/ui-kit/package.json +1 -1
  48. package/emailmaker-core.7b3c64f5.js +0 -859
  49. package/static/core/e90908e7.js +0 -1
  50. package/static/esm/73c89921.js +0 -1
  51. package/static/umd-runtime/runtime.DaVzSc6X.js +0 -1
@@ -1,4 +1,4 @@
1
- __emailmaker__.define("js/elMarkupHelper.BcpgksI_.js",["require","exports","module"],function(Ql,q,lq){var lf=Object.defineProperty,Yn=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ie=(e,t)=>{let n={};for(var r in e)lf(n,r,{get:e[r],enumerable:!0});return t||lf(n,Symbol.toStringTag,{value:"Module"}),n};function Xo(e){"@babel/helpers - typeof";return Xo=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},Xo(e)}function kS(e,t){if(Xo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LS(e){var t=kS(e,"string");return Xo(t)=="symbol"?t:t+""}function L(e,t,n){return(t=LS(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cf;cf=Symbol.toStringTag;var Jl=class{constructor(){L(this,"_valuesMap",new Map),L(this,cf,"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 uf(){const e=new Jl;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&Jl.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(Jl.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 df(){const e=uf(),t=uf();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)})}df();function NS(e){return e}var xS=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),L(this,"cycle",void 0),this.cycle=e}};function MS(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 RS(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 OS(e){const t=MS(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 xS([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of RS(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 wS{constructor(t=[]){L(this,"_inner",void 0),L(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof wS&&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 ec(e){return`service_container_${e}`}var Yo=new Set,tc;function PS(){if(!tc)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,mf.prototype.getInstanceAsync),e.stack}function nc(e){Yo.delete(e)&&tc?.end(e)}var mf=class af extends Ee{_runCallbacks(t){[...this._injectCallbacks].forEach(n=>n(t))}constructor(t=null){super(),L(this,"_parent",void 0),L(this,"_injectCallbacks",[]),L(this,"_injections",Object.create(null)),L(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=PS();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};Yo.add(s),tc?.start(s),this._onInject(t,()=>{nc(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(Yo))n.container===this&&(nc(n),n.reject(t))}pendingWaits(){return[...Yo].filter(t=>t.container===this)}addService(t,n){const r=ec(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=ec(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=ec(t);return[...this.getInstance(n,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new af(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const n=this._parent?.getOrCreateIsolatedContainer(t);return new af(n)})}remove(t){const n=this._injections;delete n[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(Yo))t.container===this&&nc(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function rc(e){return e.startsWith("__")?e:`__${e}__`}function IS(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=rc(e),n=globalThis;return n[t]??(n[t]={})}function DS(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function BS(e){if(e)return rc(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return rc(t)}function oc(e){const t=BS(e),n=IS(t);if(DS(n.container))return n.container;const r=new mf(null);return n.container=r,r}function HS(){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 FS(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():HS()}function de(e=FS()){return e}function ff(){return"iframe".trim()||"unknown"}function $S(e){if(typeof globalThis>"u")return;const t=ff(),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 WS(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function qS(e,t){if($S(t),typeof globalThis>"u")return e;const n=ff(),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 xs;function zS(){if(xs)return xs;const e=WS();return xs=qS(oc(e),e),xs}var cq=new Proxy({},{get(e,t,n){const r=zS(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),VS=new Function("url","return import(url)");function US(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function ic(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function pf(e){return e.type==="umd"||e.resolve==="registry"}var jS="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 GS(e){const t=Array.isArray(e)?e[0]:e;return ic(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function XS(e,t){const n=GS(e),r=ic(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&pf(r)&&!/compat/iu.test(o)?` ${jS}`:"",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 YS(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function uq(e){return e}var KS=class{constructor(e,t,n={}){L(this,"_context",void 0),L(this,"_pluginRegistry",void 0),L(this,"_options",void 0),L(this,"_map",new Map),L(this,"_optionsMap",new Map),L(this,"_readyMap",new Map),L(this,"_resolveMap",new Map),L(this,"_initializingPlugins",new Map),L(this,"_creatingPlugins",new Set),L(this,"_initializedPlugins",new Set),L(this,"_creationOrder",[]),L(this,"_lifecycleListeners",new Set),L(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(ic(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(pf(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await VS(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):YS(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=XS(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 US(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 n.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 n.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)}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)}))}},ZS=class{constructor(){L(this,"_plugins",new Map),L(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)}}}},QS=class{constructor(e){L(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()}},te=de("SandboxHtmlDocument"),mt=de("SandboxRemoteDocument"),Ko=de("SandboxTextDocument"),Zt=de("SandboxDocumentMapping"),xe=de("SandboxSyncCommit"),Zo=de("SandboxLayoutProfile"),Ms=de("SandboxState"),qr=de("SandboxAttributePipeline"),sc=de("SandboxAmpService"),ac=de("SandboxImageReload"),Rs=de("SandboxImageCache"),at=de("SandboxFocus"),lc=de("SandboxLocalization"),He=de("SandboxElementSettings"),vt=de("SandboxSetCursor"),hf=de("SandboxStyleRoot"),gf=de("SandboxVmlWidthResolver"),Os=de("SandboxPrepareHtml"),Qo=de("SandboxSurfaceName"),Ps=de("SandboxDocumentSync"),zr=de("SandboxMapObj"),Vr=de("SandboxActiveElementFingerprint"),Is=de("SandboxToggleTextStyle"),Qt=de("SandboxWrapEditor"),Ur=de("SandboxInsertServices"),Jo=de("SandboxInitPreview"),cc=de("SandboxInsertPolicy"),bf=de("SandboxNarrowTableTextAtom"),yf=de("SandboxSettingsExtras"),vf=de("SandboxViewportHandlers"),Ef=de("SandboxOperations"),Ds=de("SandboxApplyElementSettings"),Kn=de("SandboxOperationEnvironment"),jr=de("SandboxHostFacts"),JS="__sandbox__",Et=oc(JS);function ew(e){return e}function tw(e,t=Et){t.inject(Qo,e.name),t.inject(Zo,e.profile);for(const n of OS(e.units))n.setup(t);return t}function Jt(e,t){e.remove?.(t)}function D(e,t){const n=e.getInstance(t);if(n===void 0)throw new Error(`[sandbox] служба «${String(t)}» не зарегистрирована: её фича не подключена или ещё не зарегистрирована`);return n}var Sf=class{constructor(e){L(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},St=(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.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e})({}),nw=class{constructor(e,t){L(this,"source",void 0),L(this,"len",void 0),L(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===aw||e===lw||e===ow||e===sw||e===iw)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},wf=33,Gr=45,ei=60,en=62,Bs=47,rw=61,Cf=34,Af=39,ow=10,iw=13,sw=12,aw=32,lw=9,cw={"text/x-handlebars-template":!0,"text/html":!0};function uw(e,t=0,n=0,r=!1){const o=new nw(e,t);let i=n,s=0,a=18,l,c,u=!1,d,m,p;function f(){return o.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function h(){const S=o.pos();for(;!o.eos();){const b=o.nextChar();if(b===en)return!0;if(b===ei)break;if(b===Cf||b===Af){if(!o.advanceUntilChar(b))break;o.advance(1)}}return o.goBackTo(S),!1}function y(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function v(S,b,E){return a=b,s=S,l=E,b}function A(){const S=o.pos(),b=i,E=k();return E!==21&&S===o.pos()&&!(r&&(E===4||E===8))?(o.advance(1),v(S,18)):E}function k(){const S=o.pos();if(o.eos())return v(S,21);let b;switch(i){case 6:return o.advanceIfChars([Gr,Gr,en])?(i=0,v(S,2)):(o.advanceUntilChars([Gr,Gr,en]),v(S,1));case 3:return o.advanceIfChar(en)?(i=0,v(S,15)):(o.advanceUntilChar(en),v(S,14));case 0:if(o.advanceIfChar(ei)){if(!o.eos()&&o.peekChar()===wf){if(o.advanceIfChars([wf,Gr,Gr]))return i=6,v(S,0);if(o.advanceIfRegExp(/^!doctype/i))return i=3,v(S,13)}return o.advanceIfChar(Bs)?(i=2,v(S,7)):(i=1,v(S,3))}return o.advanceUntilChar(ei),v(S,16);case 2:return f().length>0?(i=5,u=!1,v(S,9)):o.skipWhitespace()?v(S,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(en),S<o.pos()?v(S,18,"End tag name expected."):k());case 5:if(o.skipWhitespace())return u=!0,v(S,17);if(o.advanceIfChar(en))return i=0,v(S,8);if(r&&o.peekChar()===ei)return i=0,v(S,8,"Closing bracket missing.");if((u||o.peekChar()===Bs)&&h())return i=0,v(S,8);b="Closing bracket expected.";break;case 1:return d=f(),p=void 0,m=void 0,d.length>0?(c=!1,i=4,v(S,6)):o.skipWhitespace()?v(S,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(en),S<o.pos()?v(S,18,"Start tag name expected."):k());case 4:return o.skipWhitespace()?(c=!0,v(S,17)):c&&(m=y(),m.length>0)?(i=9,c=!1,v(S,11)):o.advanceIfChars([Bs,en])?(i=0,v(S,5)):o.advanceIfChar(en)?(d==="script"?p&&cw[p]?i=0:i=7:d==="style"?i=8:i=0,v(S,4)):r&&o.peekChar()===ei?(i=0,v(S,4,"Closing bracket missing.")):(o.advance(1),v(S,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,v(S,17)):o.advanceIfChar(rw)?(i=10,v(S,10)):(i=4,k());case 10:if(o.skipWhitespace())return v(S,17);let E=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(E.length>0)return o.peekChar()===en&&o.peekChar(-1)===Bs&&(o.goBack(1),E=E.substr(0,E.length-1)),m==="type"&&(p=E),i=4,c=!1,v(S,12);const C=o.peekChar();return C===Af||C===Cf?(o.advance(1),o.advanceUntilChar(C)&&o.advance(1),m==="type"&&(p=o.getSource().substring(S+1,o.pos()-1)),i=4,c=!1,v(S,12)):(i=4,c=!1,k());case 7:let g=1;for(;!o.eos();){const w=o.advanceIfRegExp(/<!--|-->|<\/?script(?=[\s/>])\s*\/?>?/i);if(w.length===0)return o.goToEnd(),v(S,19);if(w==="<!--")g===1&&(g=2);else if(w==="-->")g=1;else if(w[1]!=="/")g===2&&(g=3);else if(g===3)g=2;else{o.goBack(w.length);break}}return i=0,S<o.pos()?v(S,19):k();case 8:return o.advanceUntilRegExp(/<\/style(?=[\s/>])/i),i=0,S<o.pos()?v(S,20):k()}return o.advance(1),i=0,v(S,18,b)}return{scan:A,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>o.pos()-s,getTokenEnd:()=>o.pos(),getTokenText:()=>o.getSource().substring(s,o.pos()),getScannerState:()=>i,getTokenError:()=>l}}function dw(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function mw(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function fw(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function pw(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 uc=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function hw(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var Tf=Object.create(null);function gw(e,t){const n=Tf[e]||(Tf[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[hw(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function dc(e,t){if(e.start===e.end||t)return"";switch(e.type){case $.ELEMENT:return pc(e,t);case $.ROOT:return[...e.children].map(n=>dc(n,t)).join("");case $.DOCTYPE:return dw(e,t);case $.COMMENT:return fw(e,t);default:return e.content||""}}function mc(){return{exact:new WeakMap,collapsed:new WeakMap}}function fr(e,t=!1,n){if(e.start===e.end&&e.type!==$.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=>fr(a,t,n)).join("");let s;switch(e.type){case $.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case $.ROOT:s=i();break;case $.COMMENT:s=`<!--${e.content??""}-->`;break;case $.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 fc(e,t=0){if(e.start===e.end)return"";switch(e.type){case $.ELEMENT:return yw(e,t);case $.ROOT:return kf(e,t);case $.DOCTYPE:return mw(e,t);case $.COMMENT:return pw(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function _f(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"&&!gw(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function bw(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=dc(r);return n}function kf(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=fc(r,t+n.length);return n}function Lf(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=_f(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function Nf(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function pc(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=Lf(e,t);if(uc.has(r))return o;{const i=Nf(e,t);return`${o}${n?bw(e,t):""}${i}`}}function yw(e,t){const n=e.tag?.toLowerCase()||"div",r=Lf(e);if(e.start=t,e.startTagEnd=t+r.length,uc.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=kf(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=Nf(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function hc(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 $=(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})({}),Hs=e=>e.type===0?e.start-1:e.start,vw=e=>e.type===0?e.end+1:e.end,wt=class CS{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,n,r,o){L(this,"start",void 0),L(this,"end",void 0),L(this,"children",void 0),L(this,"parent",void 0),L(this,"content",void 0),L(this,"type",1),L(this,"tag",void 0),L(this,"closed",!1),L(this,"startTagEnd",void 0),L(this,"endTagStart",void 0),L(this,"attributes",void 0),L(this,"createdBy",void 0),L(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=hc(this.children,r=>t<=Hs(r))-1;if(n>=0){const r=this.children[n];if(t>Hs(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=hc(this.children,r=>t<=Hs(r))-1;if(n>=0){const r=this.children[n];if(t>=Hs(r)&&t<=vw(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 CS(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 Ew(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 xf=class{constructor(e,t){L(this,"text",void 0),L(this,"type",void 0),L(this,"node",void 0),L(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 wt(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}}},Mf=class{constructor(e){L(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=uw(e,void 0,void 0,!0),r=new wt(0,e.length,[],void 0);r.type=$.ROOT;let o=r,i=-1,s,a=null,l=n.scan();const c=()=>{if(!o.tag){const f=o.parent.children,h=f[f.length-2],y=e.substring(o.start,o.end);h?.type===$.HTML?(h.content=(h.content||"")+y,h.end=o.end,f.splice(f.length-1,1)):(o.type=$.HTML,o.content=y,o.children=[]),o.type=$.HTML}o=o.parent},u=new xf(e,$.COMMENT),d=new xf(e,$.DOCTYPE),m=f=>{o.children.push(f)};for(;l!==St.EOS;){switch(l){case St.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndDoctypeTag:{const A=o.lastChild,k=d.node;if(!k)throw new Error("");const S=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(S!==k.start){const b=e.substring(S,k.start);if(b){const E=new wt(S,k.start,[],o);E.type=$.HTML,E.content=b,m(E)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndCommentTag:{const A=o.lastChild,k=u.node;if(!k)throw new Error("");const S=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(S!==k.start){const b=e.substring(S,k.start);if(b){const E=new wt(S,k.start,[],o);E.type=$.HTML,E.content=b,m(E)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartTagOpen:const f=o.lastChild,h=new wt(n.getTokenOffset(),e.length,[],o),y=f?f.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(y!==h.start){const A=e.substring(y,h.start);if(A){const k=new wt(y,h.start,[],o);k.type=$.HTML,k.content=A,m(k)}}m(h),o=h;break;case St.StartTag:o.tag=n.getTokenText();break;case St.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 St.StartTagSelfClose:o.parent&&(o.closed=!0,o.end=n.getTokenEnd(),o.startTagEnd=n.getTokenEnd(),c());break;case St.EndTagOpen:i=n.getTokenOffset(),s=void 0;break;case St.EndTag:s=n.getTokenText().toLowerCase();break;case St.EndTagClose:let v=o;for(;!v.isSameTag(s)&&v.parent;)v=v.parent;if(v.parent){const A=o.lastChild,k=A?A.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(k!==i){const S=e.substring(k,i);if(S){const b=new wt(k,i,[],o);b.type=$.HTML,b.content=S,m(b)}}for(;o!==v;)o.end=i,o.closed=!1,c();o.closed=!0,o.endTagStart=i,o.end=n.getTokenEnd(),c()}break;case St.AttributeName:{a=n.getTokenText();let A=o.attributes;A||(o.attributes=A={}),A[a]=null;break}case St.AttributeValue:{const A=n.getTokenText(),k=o.attributes;k&&a&&(k[a]=Ew(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 p=r.lastChild?.end||0;if(p<e.length){const f=e.substring(p);if(f){const h=new wt(p,e.length,[],r);h.type=$.HTML,h.content=f,m(h)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},dq=new Mf(new Sf(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),Sw=new Sf(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),ww=new Mf(Sw);function Xr(e){return ww.parse(e)}var Rf=class extends Ee{constructor(e={}){super(),L(this,"_options",void 0),L(this,"_listeners",[]),L(this,"on",this._addListener.bind(this)),L(this,"event",this._addListener.bind(this)),L(this,"once",(t,n=0,r)=>{const o=this._addListener((...i)=>(o?.dispose(),r?t.call(r,...i):t(...i)),n);return o}),L(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()}},Cw=class extends Rf{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}}},Me=class extends Cw{execute([e],t){for(const n of t)try{n(e)}catch{}}},Aw=class extends Rf{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 Tw(e,t,n){let r;const o=new Me({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 _w(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 kw(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 mq(e){return e}function Lw(e){return e&&typeof e=="object"}function Of(e,t){return e&&typeof e=="object"&&e.operationId===t}var yn="INIT_MESSAGE",Nw="em:port-ready",xw="em:window-drained",gc="";function Pf(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var Mw=class extends Ee{constructor(...e){super(...e),L(this,"_listeners",Object.create(null)),L(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)}}}),L(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)}}),L(this,"addListener",(t,n,r=0)=>this.addListenerAsync(t,(o,i)=>{try{n(o)}catch{}return i&&i(o)},r))}},Rw=class extends Ee{constructor(e,t){super(),L(this,"_singleton",void 0),L(this,"_target",void 0),L(this,"_transport",void 0),L(this,"_transportSubscription",void 0),L(this,"_ports",new Map),L(this,"_drained",new WeakSet),L(this,"_portSendHeld",new WeakSet),L(this,"_inited",!1),L(this,"_emitter",this.addDisposable(new Mw)),L(this,"_handshaken",new WeakSet),L(this,"_greeted",new WeakSet),L(this,"_outgoingFilter",void 0),L(this,"_outgoingObservers",new Set),L(this,"_offTargetListeners",new Map),L(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)&&Of(o,yn)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:yn,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),Lw(o)&&l||this._singleton&&Of(o,yn)){if(s&&l){const m=this._target;Promise.resolve().then(()=>this.usePort(s,!0,m))}const c=this._emitter.fireAsync(o.operationId||gc,o.operationId===void 0?r:o.data),u=o.result,d=o.error;u&&d&&Promise.resolve(c).then(m=>this._sendMessage(u,m),m=>this._sendMessage(d,m))}}),this._singleton=t,this._transport=_w({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(yn,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(yn))}),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(yn,void 0);return}this._inited=!1,this._postMessage(e,{operationId:yn,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:yn,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:yn,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=kw(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:Nw,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:xw,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(gc,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=Pf(),o=Pf();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(gc,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(yn,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}},Ow=/<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s[^<>]*)?\/?>/g;function Pw(e){return e.replace(Ow,t=>/^<br\b/i.test(t)?" ":"")}var Iw={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"},Dw="fonts.googleapis.com",Bw=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},Hw=e=>{const t=Bw(String(e??""));return t?t.hostname===Dw&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},Pe={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_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"},Fw=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"),DROP_BLOCK_HINT:e("Click or drag a block")}),Z=new Rw(window.parent,!0),Fs,ti,If=Math.random().toString(36).slice(2,8),$w=0,$s;function Df(e,t){const n=Fs;Fs=e;try{return t()}finally{Fs=n}}function Ws(e,t){const n=ti;ti=e;try{return t()}finally{ti=n}}function Ww(){return ti}function qw(){try{return Fs?.()}catch{return}}function zw(){return $s||($s=`${If}:${++$w}`,Promise.resolve().then(()=>{$s=void 0})),$s}function nt(e,t){const n=qw();return Z.send(Pe.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:ti??"other",batch:zw(),instance:If}),t}function bc(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(bc(e,o)===!1)return!1;return!0}function Bf(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function Vw(e,t){return Bf(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(bc(e,o[i])===!1)return!1}},t)}function pr(e,t,n){bc(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(Bf(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),Vw(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var Uw=e=>e.type===$.HTML?e.start-1:e.start,jw=e=>e.type===$.HTML?e.end+1:e.end;function Gw(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(Uw(o)>=n||jw(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function Xw(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function Zn(e){let t=e;do t=Yw(t);while(t&&t.type===$.HTML&&!t.content);return t}function Yw(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n<0)return nt("parent and child not sync",e);if(n<t.length-1)return t[n+1]||null}return null}var hr=class{constructor(e,t,n,r){L(this,"originalStart",void 0),L(this,"originalLength",void 0),L(this,"modifiedStart",void 0),L(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 Hf(e,t){return(t<<5)-t+e|0}function Kw(e,t){t=Hf(149417,t);for(let n=0,r=e.length;n<r;n++)t=Hf(e.charCodeAt(n),t);return t}var Ff=class{constructor(e){L(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 $f(e,t,n){return new Zw(new Ff(e),new Ff(t)).ComputeDiff(n).changes}var Yr=class{static Assert(e,t){if(!e)throw new Error(t)}},Kr=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]}},Wf=class{constructor(){L(this,"m_changes",void 0),L(this,"m_originalStart",void 0),L(this,"m_modifiedStart",void 0),L(this,"m_originalCount",void 0),L(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 hr(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}},Zw=class Go{constructor(t,n,r=null){L(this,"ContinueProcessingPredicate",void 0),L(this,"_originalSequence",void 0),L(this,"_modifiedSequence",void 0),L(this,"_hasStrings",void 0),L(this,"_originalStringElements",void 0),L(this,"_originalElementsOrHash",void 0),L(this,"_modifiedStringElements",void 0),L(this,"_modifiedElementsOrHash",void 0),L(this,"m_forwardHistory",void 0),L(this,"m_reverseHistory",void 0),this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,i,s]=Go._getElements(t),[a,l,c]=Go._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(Go._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=Kw(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)?Go._getStrictElement(this._originalSequence,t)===Go._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?(Yr.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new hr(t,0,r,o-r+1)]):t<=n?(Yr.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new hr(t,n-t+1,r,0)]):(Yr.Assert(t===n+1,"originalStart should only be one more than originalEnd"),Yr.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 hr(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,m,p,f,h,y,v,A){let k=null,S=null,b=new Wf,E=n,C=r,g=p[0]-y[0]-o,w=-1073741824,T=this.m_forwardHistory.length-1;do{const _=g+t;_===E||_<C&&c[_-1]<c[_+1]?(d=c[_+1],f=d-g-o,d<w&&b.MarkNextChange(),w=d,b.AddModifiedElement(d+1,f),g=_+1-t):(d=c[_-1]+1,f=d-g-o,d<w&&b.MarkNextChange(),w=d-1,b.AddOriginalElement(d,f+1),g=_-1-t),T>=0&&(c=this.m_forwardHistory[T],t=c[0],E=1,C=c.length-1)}while(--T>=-1);if(k=b.getReverseChanges(),A[0]){let _=p[0]+1,M=y[0]+1;if(k!==null&&k.length>0){const N=k[k.length-1];_=Math.max(_,N.getOriginalEnd()),M=Math.max(M,N.getModifiedEnd())}S=[new hr(_,m-_+1,M,h-M+1)]}else{b=new Wf,E=s,C=a,g=p[0]-y[0]-l,w=1073741824,T=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const _=g+i;_===E||_<C&&u[_-1]>=u[_+1]?(d=u[_+1]-1,f=d-g-l,d>w&&b.MarkNextChange(),w=d+1,b.AddOriginalElement(d+1,f+1),g=_+1-i):(d=u[_-1],f=d-g-l,d>w&&b.MarkNextChange(),w=d,b.AddModifiedElement(d+1,f+1),g=_-1-i),T>=0&&(u=this.m_reverseHistory[T],i=u[0],E=1,C=u.length-1)}while(--T>=-1);S=b.getChanges()}return this.ConcatenateChanges(k,S)}ComputeRecursionPoint(t,n,r,o,i,s,a){let l=0,c=0,u=0,d=0,m=0,p=0;t--,r--,i[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const f=n-t+(o-r),h=f+1,y=new Int32Array(h),v=new Int32Array(h),A=o-r,k=n-t,S=t-r,b=n-o,E=(k-A)%2===0;y[A]=t,v[k]=n,a[0]=!1;for(let C=1;C<=f/2+1;C++){let g=0,w=0;if(C>100)return null;u=this.ClipDiagonalBound(A-C,C,A,h),d=this.ClipDiagonalBound(A+C,C,A,h);for(let _=u;_<=d;_+=2){_===u||_<d&&y[_-1]<y[_+1]?l=y[_+1]:l=y[_-1]+1,c=l-(_-A)-S;const M=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(y[_]=l,l+c>g+w&&(g=l,w=c),!E&&Math.abs(_-k)<=C-1&&l>=v[_])return i[0]=l,s[0]=c,M<=v[_]&&C<=1448?this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,l,n,i,c,o,s,E,a):null}const T=(g-t+(w-r)-C)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(g,T))return a[0]=!0,i[0]=g,s[0]=w,T>0&&C<=1448?this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,l,n,i,c,o,s,E,a):(t++,r++,[new hr(t,n-t+1,r,o-r+1)]);m=this.ClipDiagonalBound(k-C,C,k,h),p=this.ClipDiagonalBound(k+C,C,k,h);for(let _=m;_<=p;_+=2){_===m||_<p&&v[_-1]>=v[_+1]?l=v[_+1]-1:l=v[_-1],c=l-(_-k)-b;const M=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(v[_]=l,E&&Math.abs(_-A)<=C&&l<=y[_])return i[0]=l,s[0]=c,M>=y[_]&&C<=1448?this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,l,n,i,c,o,s,E,a):null}if(C<=1447){let _=new Int32Array(d-u+2);_[0]=A-u+1,Kr.Copy2(y,u,_,1,d-u+1),this.m_forwardHistory.push(_),_=new Int32Array(p-m+2),_[0]=k-m+1,Kr.Copy2(v,m,_,1,p-m+1),this.m_reverseHistory.push(_)}}return this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,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 m=r.originalStart-d,p=r.modifiedStart-d;if(m<o||p<i||s&&!this.OriginalElementsAreEqual(m,m+r.originalLength)||a&&!this.ModifiedElementsAreEqual(p,p+r.modifiedLength))break;const f=(m===o&&p===i?5:0)+this._boundaryScore(m,r.originalLength,p,r.modifiedLength);f>c&&(c=f,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,m=d-u;if(s<5&&c<20&&m<20){const p=this._findBetterContiguousSequence(a,c,u,m,s);if(p){const[f,h]=p;(f!==o.originalStart+o.originalLength||h!==o.modifiedStart+o.modifiedLength)&&(o.originalLength=f-o.originalStart,o.modifiedLength=h-o.modifiedStart,i.originalStart=f+s,i.modifiedStart=h+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 m=r;m<a;m++){const p=this._contiguousSequenceScore(d,m,i);p>0&&p>l&&(l=p,c=d,u=m)}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 Kr.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],Kr.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return Kr.Copy(t,0,o,0,t.length),Kr.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(Yr.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),Yr.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 hr(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 qs(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var zt=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){L(this,"oldPosition",void 0),L(this,"oldText",void 0),L(this,"newPosition",void 0),L(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} "${qs(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${qs(this.oldText)}")`:`(replace@${this.oldPosition} "${qs(this.oldText)}" with "${qs(this.newText)}")`}};function tn(e,t){return e===null||e.length===0?t:new Qw(e,t).compress()}var Qw=class Xn{constructor(t,n){L(this,"_prevEdits",void 0),L(this,"_currEdits",void 0),L(this,"_result",void 0),L(this,"_resultLen",void 0),L(this,"_prevLen",void 0),L(this,"_prevDeltaOffset",void 0),L(this,"_currLen",void 0),L(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]=Xn._splitCurr(o,r.newPosition-o.oldPosition);this._acceptCurr(l),o=c;continue}if(r.newPosition<o.oldPosition){const[l,c]=Xn._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]=Xn._splitPrev(r,o.oldLength);s=l,a=o,r=c,o=this._getCurr(++n)}else{const[l,c]=Xn._splitCurr(o,r.newLength);s=r,a=l,r=this._getPrev(++t),o=c}this._result[this._resultLen++]=new zt(s.oldPosition,s.oldText,a.newPosition,a.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=a.newLength-a.oldLength}const i=Xn._merge(this._result);return Xn._removeNoOps(i)}_acceptCurr(t){this._result[this._resultLen++]=Xn._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++]=Xn._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 zt(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new zt(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 zt(t.oldPosition,t.oldText,t.newPosition,r),new zt(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new zt(t.oldPosition,r,t.newPosition,t.newText),new zt(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 zt(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 qf(e){return new zt(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Bn(e){return e.map(qf)}function Jw(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 zf(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=Jw({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new zt(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function Vf(e,t,n=0){const r=e.range;return new zt(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function Zr(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),Vf({text:r,range:{start:o,end:i}},t,s)})}function e0(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function gr(e){return e.map(t=>e0(t))}function t0(e,t=yc(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var fq=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function n0(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function yc(e){return{start:0,end:e.getLength()}}function r0(e,t,n){return`${e.substring(0,n.start)}${t}${e.substring(n.end)}`}function ni(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 o0(e,t){return t=zs(t).sort(({range:n},{range:r})=>n.start-r.start),ni(e,t)}function ri(e,t){return e>=t.start&&e<=t.end}function zs(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(ri(i.start,l)&&ri(i.start,l))c=l;else if(ri(l.start,i))ri(l.end,i)?c=i:c={start:i.start,end:l.end};else if(ri(l.end,i))c={start:l.start,end:i.end};else continue;const u=o.text;let d=l.start-i.start+u.length,m=l.end-i.start+u.length;const p=r0(u,a.text,{start:d,end:m});e[r]=o={range:i=c,text:p},e.splice(s--,1),n--}}return e}function i0(e,t){if(e.length<=1)return e[0]||null;e=zs(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:ni(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 s0(e,t){const n=Bn(e),r=i0(gr(n),t);if(r){const o=Vf(r,t);return qf(o)}return null}function a0(e,{range:t,text:n}){const r=e.getText(t);return $f(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 l0({oldText:e,newText:t,oldPosition:n,newPosition:r}){return $f(e,t,!0).map(o=>new zt(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var c0=class{constructor(e,t){L(this,"index",void 0),L(this,"values",void 0),L(this,"type","insert"),this.index=e,this.values=t}},u0=class{constructor(e,t){L(this,"index",void 0),L(this,"howMany",void 0),L(this,"type","remove"),this.index=e,this.howMany=t}},d0=class{constructor(e,t,n){L(this,"from",void 0),L(this,"to",void 0),L(this,"howMany",void 0),L(this,"type","move"),this.from=e,this.to=t,this.howMany=n}};function m0(e,t){return e===t}function f0(e,t,n=m0){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,m=u,p=0;do s[l++]=a[u++]=!0,p++;while(l<r&&u<o&&n(e[l],t[u])&&!a[u]);i.push(new d0(d,m,p)),l--;break}var f=[];for(l=0;l<r;){if(s[l]){l++;continue}for(var h=l,p=0;l<r&&!s[l++];)p++;f.push(new u0(h,p))}for(var y=[],u=0;u<o;){if(a[u]){u++;continue}for(var h=u,p=0;u<o&&!a[u++];)p++;var v=t.slice(h,h+p);y.push(new c0(h,v))}var A=y.length,k=f.length,S=i.length,b,E,C=0;for(b=0;b<k;b++){var g=f[b];for(g.index-=C,C+=g.howMany,E=0;E<S;E++){var w=i[E];w.from>=g.index&&(w.from-=g.howMany)}}for(b=A;b--;){var T=y[b],p=T.values.length;for(E=S;E--;){var w=i[E];w.to>=T.index&&(w.to-=p)}}for(b=S;b-- >1;){var w=i[b];if(w.to!==w.from)for(E=b;E--;){var _=i[E];_.to>=w.to&&(_.to-=w.howMany),_.to>=w.from&&(_.to+=w.howMany)}}var M=[];for(b=0;b<S;b++){var w=i[b];if(w.to!==w.from)for(M.push(w),E=b+1;E<S;E++){var N=i[E];N.from>=w.from&&(N.from-=w.howMany),N.from>=w.to&&(N.from+=w.howMany)}}return[...f,...M,...y]}var Uf=class{constructor(){L(this,"_byKey",new Map),L(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}},ue;(function(e){function t(d,m,p){return{type:"Add",node:m,nextSibling:p,parent:d}}e.add=t;function n(d){return{type:"Remove",node:d}}e.remove=n;function r(d,m,p){return{type:"Attribute",node:d,name:m,value:p}}e.attribute=r;function o(d,m,p){return p?{type:"Update",prev:d,next:m,soft:p}:{type:"Update",prev:d,next:m}}e.update=o;function i(d,m,p,f){return[{type:"Remove",node:d},{type:"Add",node:p,nextSibling:f,parent:m,replaces:d}]}e.recreate=i;function s(d,m,p){return{type:"Move",node:m,nextSibling:p,parent:d}}e.move=s;function a(d,m){return{type:"Set",node:d,data:m}}e.set=a;function l(d,m,p){return{type:"ClassList",node:d,addedClasses:m,removedClasses:p}}e.classList=l;function c(d,m){return{type:"Style",node:d,value:m}}e.style=c;function u(d,m){return{type:"Hidden",node:d,value:m}}e.hidden=u})(ue||(ue={}));function jf(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var Gf=[],Xf=[];function p0(e){return jf(Gf,e)}function vc(e){return e?Gf.some(t=>t(e)):!1}function h0(e){return jf(Xf,e)}function g0(e){return Xf.some(t=>t(e))}function b0(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 m=o[d];l.push(ue.attribute(t,m,void 0))}break}else r[u]!==n[u]&&l.push(ue.attribute(t,u,r[u]))}for(;c<a;c++){const u=i[c];l.push(ue.attribute(t,u,r[u]))}return l}function y0(e){let t=[];const n=e.children.filter(o=>o.type!==$.HTML||!!o.content);let r;for(let o=n.length-1;o>=0;o--)t.push(ue.add(e,n[o],r)),r=n[o];return t}function v0(e){return ue.remove(e)}var E0=new Set(["head","body","html"]),S0=e=>e.type===$.ROOT||e.type===$.DOCTYPE||e.type===$.ELEMENT&&e.tag&&E0.has(e.tag.toLowerCase());function Yf(e){const t=new Uf,n=Object.create(null);for(const r of e){const o=String(r.type===$.ELEMENT?r.tag:r.type)+(!S0(r)&&r.start===r.end?"_hidden":"");let i="";r.type===$.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function Ec(e,t,n=!1,r=mc()){let o=[];const i=Yf(e.children),s=Yf(t.children);for(let d=e.children.length-1;d>=0;d--){const m=e.children[d];if(m.type===$.ELEMENT&&m.start===m.end){const p=i.getByValue(m);if(!s.getByKey(p)){let f=!1;for(let h=d+1;d<e.children.length;d++)if(e.children[h]){const y=i.getByValue(m),v=s.getByKey(y);if(v){const A=v.start,k=m.clone();t.children.splice(t.children.indexOf(v),0,k),pr(k,A-m.start),k.parent=t,s.set(p,k),f=!0;break}}if(!f){const h=t.endTagStart===void 0?t.end:t.endTagStart,y=m.clone();t.children.push(y),s.set(p,y),pr(y,h-m.start),y.parent=t}}}}const a=e.children.filter(d=>d.type!==$.HTML||!!d.content),l=t.children.filter(d=>d.type!==$.HTML||!!d.content),c=f0(a,l,(d,m)=>i.getByValue(d)===s.getByValue(m)),u=new Set;for(const d of c)switch(d.type){case"insert":{const m=d.index;let p=a[m];for(const f of d.values.reverse())a.splice(m,0,f),u.add(f),o.push(ue.add(t,f,p)),p=f;break}case"remove":{const m=a.splice(d.index,d.howMany);for(const p of m)o.push(ue.remove(p));break}case"move":{const m=a.splice(d.from,d.howMany);let p=a[d.to];a.splice(d.to,0,...m);for(const f of m.reverse()){const h=i.getByValue(f),y=s.getByKey(h);u.add(y),o=[...o,...wc(f,y,n,r)],o.push(ue.move(t,y,p)),p=f}break}}l.length!==a.length&&nt("error while sync");for(let d=l.length-1;d>=0;d--){const m=l[d];u.has(m)||(o=[...o,...wc(a[d],m,n,r)])}return o}function Sc(e){return e.type===$.ELEMENT&&vc(e.tag)}function wc(e,t,n=!1,r=mc()){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(Sc(e)&&e.tag===t.tag){if(fr(e,!1,r)===fr(t,!1,r))return[ue.update(e,t,n),...Ec(e,t,!0,r)]}else if((e.type===$.ELEMENT||e.type===$.ROOT)&&e.tag===t.tag)return[ue.update(e,t,n),...b0(e,t),...Ec(e,t,n,r)];if(e.type===$.HTML||e.type===$.COMMENT)return e.content===t.content?[ue.update(e,t,n)]:[ue.update(e,t,n),ue.set(t,t.content)]}return!e.parent||!t.parent?nt("cannot replace document",[]):Sc(e)&&e.tag===t.tag?ue.recreate(e,t.parent,t,Zn(t)||void 0):[ue.remove(e),ue.add(t.parent,t,Zn(t)||void 0)]}var Qr="FROM_DOM",Jr="FROM_REMOTE",w0=/<\/.*>/gi,C0=class extends Ee{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_createRoot",void 0),L(this,"_beforeTextChangeEmitter",this.addDisposable(new Me)),L(this,"_onTextChangeEmitter",this.addDisposable(new Me)),L(this,"_onMutateEmitter",this.addDisposable(new Me)),L(this,"_beforeRefreshEmitter",this.addDisposable(new Me)),L(this,"_onRefreshEmitter",this.addDisposable(new Me)),L(this,"_root",new wt(0,0,[])),L(this,"_applyingMutation",void 0),L(this,"beforeTextChange",this._beforeTextChangeEmitter.event),L(this,"beforeRefresh",this._beforeRefreshEmitter.event),L(this,"onTextChange",this._onTextChangeEmitter.event),L(this,"onRefresh",this._onRefreshEmitter.event),L(this,"onMutate",this._onMutateEmitter.event),this._baseDocument=e,this._createRoot=t,this._baseDocument.onChanged(this._onTextChange.bind(this));const n=this._root=new wt(0,0,[]);n.type=$.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){const n=this._root;this._beforeRefreshEmitter.fire();let{roots:r}=Xr(e),o=this._root=this._createRoot?this._createRoot(r,e):new wt(0,e.length,r);o.type=$.ROOT,this._createRoot||r.forEach(i=>i.parent=o),t||this._onRefreshEmitter.fire(n?Ec(n,o):y0(o))}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=s0(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),Ws("text",()=>this.replaceWithHtml(n,Jr))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&Zn(t)===n)return t;this.remove(t,r)}const o=this.contains(e),i=fc(t),s=e.children,a=n?s.indexOf(n):s.length;if(a<0)return nt("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,pr(t,l-t.start,i.length),o&&(r!=="FROM_DOM"&&this._onMutateEmitter.fire([ue.add(e,t,n||void 0)]),r!=="FROM_REMOTE"&&this._baseDocument.applyEdits(r,[{text:i,range:{start:l,end:l}}])),t}getContext(e){return e.closest(t=>vc(t.tag))}replaceWithHtml(e,t){const n=this._baseDocument,r=c=>{const u=this.getContext(c);if(u)return u.isDirty=!0,Promise.resolve().then(()=>{u.isDirty=!1}),!1;if(c.type!==$.HTML){if(!c.closed)return!1}else return!c.content||!w0.test(c.content);return!0};if(!this._root)return this.initialize(n.getText());let o={start:e.oldPosition,end:e.oldEnd},i=Gw(o,this._root);if(!i)return this.initialize(n.getText());let s,a,l;do{const c=n0(e,i);s=this._baseDocument.getText(c),[a,...l]=Xr(s).roots}while((!a||l.length||!r(i)||!r(a)||a.end-a.start!==s.length)&&(i=i.parent));if(!i||!i.parent)return this.initialize(n.getText());this.replaceChild(i.parent,{node:a,text:s},i,t)}replaceChild(e,t,n,r){const{text:o,node:i}=t,s=e.children,a=s.indexOf(n);if(a<0)return nt("referenced node is not a child of parent node",i);s.splice(a,1,i);const l=o.length-(n.end-n.start);return i.parent=e,pr(i,n.start-i.start,l),this._baseDocument.getText(i)!==o?(nt("Error while sync"),i):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(wc(n,i)),n.parent=void 0,i)}remove(e,t){const n=this.contains(e),r=e.parent;if(!r)return nt("node is not in tree");const o=r.children,i=o.indexOf(e);if(i<0)return nt("referenced node is not a child of parent node");const s=e.end-e.start;pr(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([v0(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=_f(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=Xw(e),c=s.length-a,u=e.start;pr(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=fc(e,o),l=a.length-s;pr(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=Zn(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=Xr(t).roots;i.length!==1&&nt("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)switch(this._applyingMutation=t,t.type){case"Add":this.insertBefore(t.parent||this.root,t.node,t.nextSibling||null,Qr);break;case"Remove":this.remove(t.node,Qr);break;case"Set":this.setContent(t.node,t.data,Qr);break;case"Hidden":this.setHidden(t.node,t.value,Qr);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,Qr)}}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function Cc(e){if(e){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",e),t.firstChild||document.createTextNode("")}else return document.createTextNode("")}var eo,br;function A0(e){const t=eo;return eo=e,()=>{eo===e&&(eo=t)}}function T0(e){const t=br;return br=e,()=>{br===e&&(br=t)}}function Kf(e,t,n){return eo?eo(e,t,n):n}function _0(){return br!==void 0}function Zf(e,t,n){return br?br(e,t,n):n}var Ac;function k0(){return Ac||(Ac=document.implementation.createHTMLDocument("")),Ac}function L0(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 N0=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),x0=new Set(["script","style","xmp"]);function M0(e,t){return!(t&&x0.has(t.toLowerCase())||N0.has(e.toLowerCase()))}var R0=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},O0=new Set(["head","body"]);function Qf(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=k0(),s=O0.has(r)?L0(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 Hn(e,t,n){try{M0(t,e.tagName)&&!R0(n)?e.setAttribute(t,n):Qf(e,t,n)}catch{Qf(e,t,n)}}function Vs(e,t=!0){const n=e.content;switch(e.type){case $.ROOT:{const r=document.implementation.createHTMLDocument();for(const o of[...r.childNodes])r.removeChild(o);if(t)for(const o of e.children)r.appendChild(Vs(o));return r}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(n||"");case $.ELEMENT:if(e.tag){const r=document.createElement(e.tag);if(Object.defineProperty(r,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const o of e.attributeNames){const i=e.attributes[o];try{const s=Kf(r,o,typeof i=="string"?i:"");s!==null&&Hn(r,o,s)}catch{}}if(t)for(const o of e.children)r.appendChild(Vs(o));return r}return document.createTextNode("<");case $.HTML:return Cc(n||"");default:throw new Error("unsupported node")}}function Te(e){return Xr(e).roots.map(t=>Vs(t))}function Qn(e,t){e.replaceChildren(...Te(t))}function qe(e,t,n){const r=Te(n);switch(t){case"afterend":e.after(...r);break;case"afterbegin":e.prepend(...r);break;case"beforeend":e.append(...r);break;case"beforebegin":e.before(...r)}}var P0=4,I0=3,D0=80,Jf={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},B0={[$.HTML]:"text",[$.ELEMENT]:"element",[$.ROOT]:"root",[$.COMMENT]:"comment",[$.DOCTYPE]:"doctype",[$.ADVANCED]:"advanced"},H0=new Set(["head","body"]);function Tc(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function ep(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,I0);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,D0)}function F0(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return ep(e.tag,Tc(t.id),Tc(t.class),Tc(t.em))}function tp(e){return e instanceof Element?ep(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function _c(e,t,n){const r=[];let o=e;for(;o&&r.length<P0;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function $0(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&H0.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==$.ROOT?"outside":t??"top"}function kc(e,t,n){const r=t(e);return{path:_c(e,o=>o.parent,F0),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:_c(r,o=>o.parentNode,tp)}:{},inMap:!!r,hasParent:!!e.parent,kind:B0[e.type]??String(e.type),root:$0(e)}}function np(e,t,n){if(!e)return;const r=i=>kc(i,t,n);if(e.type==="Update")return{type:Jf.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:Jf[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 Lc(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===$.ROOT}function W0(e,t,n,r){const o=s=>kc(s,a=>r.getByNode(a),Lc),i=_c(e,s=>s.parentNode,tp);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function q0(e,t){const n=r=>kc(r,o=>t.getByNode(o),Lc);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function z0(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function rp(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var op=Object.create(null);function ip(e,t){const n=op[e]||(op[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[z0(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function vn(e){return e.nodeType===Node.ELEMENT_NODE}function sp(e){return vn(e)?e.tagName==="AMP-IMG"?!0:ip(e.tagName.toLowerCase(),"src"):!1}function Nc(e){return vn(e)&&!e.ownerSVGElement}function V0(e){return e.tagName==="IMG"}function U0(e){return e.tagName==="FORM"}function j0(e){return e.tagName==="SCRIPT"}function G0(e){return e.tagName==="STYLE"}function xc(e){return e.nodeType===Node.DOCUMENT_NODE}function ap(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var oi;(function(e){function t(m){return m.constructor.name==="CSSStyleRule"}e.isStyleRule=t;function n(m){return m.constructor.name==="CSSImportRule"}e.isImportRule=n;function r(m){return m.constructor.name==="CSSMediaRule"}e.isMediaRule=r;function o(m){return m.constructor.name==="CSSFontFaceRule"}e.isFontFaceRule=o;function i(m){return m.constructor.name==="CSSPageRule"}e.isPageRule=i;function s(m){return m.constructor.name==="CSSKeyframesRule"}e.isKeyframesRule=s;function a(m){return m.constructor.name==="CSSKeyframeRule"}e.isKeyframeRuleRule=a;function l(m){return m.constructor.name==="CSSNamespaceRule"}e.isNamespaceRule=l;function c(m){return m.constructor.name==="CSSCounterStyleRule"}e.isCounterStyleRule=c;function u(m){return m.constructor.name==="CSSSupportsRule"}e.isSupportsRule=u;function d(m){return m.constructor.name==="CSSFontFeatureValuesRule"}e.isFontFeatureValuesRuleRule=d})(oi||(oi={}));function Us(e){return e.nodeType===Node.COMMENT_NODE}function ii(e){return e.nodeType===Node.TEXT_NODE}function X0(e){return e.tagName==="TABLE"}async function Y0(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 Vt(e){if(vn(e))return lp(e);if(xc(e))return[...e.childNodes].map(n=>Vt(n)).join("");if(ap(e))return rp(e);const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function K0(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"&&!ip(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function Ct(e){let t="";for(const n of e.childNodes)t+=Vt(n);return t}function lp(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=K0(e);return uc.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:G0(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${Ct(e)}</${t}>`}function Z0(e){return typeof e=="string"?e:""}function cp(e,t,n){if(n&&e.type===$.DOCTYPE&&n?.type!==$.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=Vs(e,!1);t.set(e,r);for(const o of e.children){const i=cp(o,t,e);r.appendChild(i)}return r}function Q0(e,t,n=Lc){let r,o;const i=new Map,s=()=>{const l=np(r,c=>t.getByNode(c)||i.get(c),n);return l&&{...l,stage:"dom",...o?{cause:o}:{}}},a=l=>{o=l;try{nt("Element node not in tree")}finally{o=void 0}};return Df(s,()=>J0(e,t,i,l=>r=l,a))}function J0(e,t,n,r,o){const i=[],s=new Map,a=c=>t.getByNode(c)||n.get(c),l=c=>{if(c){const u=c.lastChild;let d=(u?a(u)?.nextSibling:a(c)?.firstChild)||void 0;for(;d&&s.has(d);)d=d.nextSibling||void 0;return d?.parentNode===a(c)?d:void 0}};for(const c of e)switch(r(c),c.type){case"Add":{let{node:u,nextSibling:d}=c;const m=u.parent;if(m){const p=cp(u,n,m);if(m.type===$.ROOT)i.push(ue.add(null,p,d&&a(d)));else{const f=a(m);if(f){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let v=t.getByNode(d);if(v&&!s.has(v)&&f.contains(v)){for(h=v;v.parentNode!==f&&v.parentNode;)v=v.parentNode,vn(v)&&v.replaceWith(...v.childNodes);break}d=Zn(d)||void 0}h||(h=l(m)),i.push(ue.add(f,p,h))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:u,nextSibling:d}=c;const m=u.parent,p=a(u);if(m&&p)if(m.type===$.ROOT)i.push(ue.move(null,p,d&&a(d)));else{const f=a(m);if(f){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let v=t.getByNode(d);if(v&&!s.has(v)&&f.contains(v)){for(;v.parentNode!==f&&v.parentNode;)v=v.parentNode;v||nt("error while calculating next sibling"),h=v;break}d=Zn(d)||void 0}h||(h=l(m)),i.push(ue.move(f,p,h))}else o("parent-not-mapped")}else o(m?"node-not-mapped":"no-parent");break}case"Remove":{const u=c.node,d=a(u);if(u.type===$.HTML&&!u.content)continue;d?(s.set(d,u),i.push(ue.remove(d))):o("node-not-mapped");break}case"Update":{const u=c.prev,d=a(u);d?n.set(c.next,d):c.soft||o("node-not-mapped");break}case"Attribute":{const u=a(c.node);u?i.push(ue.attribute(u,c.name,c.value)):o("node-not-mapped");break}case"Set":{const u=c.node,d=a(u);d?ii(d)&&u.type===$.HTML||Us(d)&&u.type===$.HTML||ap(d)&&u.type===$.DOCTYPE?i.push(ue.set(d,c.data||"")):e.push(ue.remove(u),ue.add(u.parent||null,u,Zn(u)||void 0)):o("node-not-mapped");break}}return{mutations:i,toAdd:n,toRemove:s}}function eC({mutations:e,toAdd:t,toRemove:n},r){const o=(i,s,a)=>{if(!i)return nt("Element node not in tree");if(!(i instanceof Element))return nt("node is not HTMLEement");const l=a===void 0?void 0:Kf(i,s,Z0(a));try{l!=null?Hn(i,s,l):i.removeAttribute(s)}catch{}};for(const i of e)switch(i.type){case"Add":{const{node:s,nextSibling:a,parent:l}=i;l?.insertBefore(s,a?.parentNode===l&&a||null);break}case"Move":{const{node:s,nextSibling:a,parent:l}=i;l?.insertBefore(s,a?.parentNode===l&&a||null);break}case"Remove":{const{node:s}=i;if(s instanceof Element)s.remove();else if(s instanceof Document)for(const a of[...s.childNodes])a.parentNode?.removeChild(a);else s.parentNode?.removeChild(s);break}case"Attribute":o(i.node,i.name,i.value);break;case"Set":{const{node:s,data:a}=i;s instanceof Comment?s.data=a:s instanceof Text&&(s.textContent=Cc(a).textContent);break}}for(const[i,s]of n)r.remove(s);for(const[i,s]of t){const a=r.getByElement(s);a&&r.remove(a),r.set(i,s)}}var tC=class{constructor(){L(this,"_byKey",new WeakMap),L(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))}},nC=class{constructor(){L(this,"_map",new tC)}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 up(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function rC(e){let t;for(let n=e;n;n=n.parent)Sc(n)&&(t=n);return t}function oC(e){return e.type==="Update"?e.prev:e.node}function iC(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=rC(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=oC(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(up(i,l)||up(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...ue.recreate(c,l.parent,l,Zn(l)||void 0));break}}a||r.push(o)}return r}var Mc;(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})(Mc||(Mc={}));var js=new Set;function Gs(e,t){js.has(e)||(js.size||Promise.resolve().then(()=>js.clear()),js.add(e),Z.send(Pe.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var dp=new WeakMap;function sC(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 aC(e,t){let n=dp.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=sC(o),n={added:o,removed:i},dp.set(e,n)}return n}var lC=new Set(["text/x-handlebars-template","text/html"]);function mp(e){return e.replace(/<(?=[A-Za-z!/?])/g,"&lt;")}function fp(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!lC.has(e.getAttribute("type")??"")}var pp=Object.getPrototypeOf(customElements),cC=Reflect.get(pp,"define"),Rc=new Me,Oc=new Me,uC=Rc.event,dC=Oc.event,mC=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function fC(e){Rc.fire();try{return e()}finally{Oc.fire()}}pp.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){Rc.fire();try{super(...i)}finally{Oc.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of mC){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return fC(()=>s.call(this,...a))}})}cC.call(this,e,o,n)};function hp(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,hp(s,t,n,i));return i}function to(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])to(r,t,e)}var Fn="___em-internal";function Pc(e,t=!0,n=!1){let r=e.content;switch(e.type){case $.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(Pc(i,t,n));return o}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(r||"");case $.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=dc(e),i.firstChild}const o=document.createElement(e.tag);if(e.attributes)for(const i of e.attributeNames){const s=e.attributes[i];try{Hn(o,i,typeof s=="string"?s:"")}catch{}}if(t)for(const i of e.children)o.appendChild(Pc(i,t,n));return o}return document.createTextNode("<");case $.HTML:return Cc(r||"");default:throw new Error("unsupported node")}}function pC(e){return Xr(e).roots.map(t=>Pc(t,!0,!0))}function gp(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function hC(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 gp();default:t=document.createElement("div")}return t}function gC(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function Xs(e){if(e instanceof Element)return lp(e);if(e instanceof Document)return[...e.childNodes].map(n=>Xs(n)).join("");if(e instanceof DocumentType)return gC(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(n=>Xs(n)).join("");const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function bp(e,t=e.parentNode){return fp(t)?mp(e.textContent??""):Xs(e)}function bC(e,t,n){let r=1;const o=new Uf,i=new Map,s=new Map,a=new Map;let l=!1;const c=hp(e,p=>{const f=String(r++);let h;if(sp(p)||p instanceof Element&&p.hasAttribute("src")){const y=document.createElement(p.tagName);for(const{name:v,value:A}of p.attributes){const k=Zf(p,v,A);k!==null&&Hn(y,v==="src"?"___src":v,k)}h=y}else h=p.cloneNode(),LC(p,h);if(h)h instanceof DocumentType&&(l=!0),a.set(h,f),i.set(p,f);else return document.createDocumentFragment();return h},(p,f)=>p&&f&&p.appendChild(f));let u=l?gp():document.createDocumentFragment();u.appendChild(c),to(u,(p,f)=>{if(f){const h=a.get(p);if(f instanceof HTMLScriptElement||f instanceof HTMLStyleElement)return;if(!h)return nt("Error while mapping: not found element");p instanceof Element?p.setAttribute(Fn,h):f.insertBefore(document.createComment(`${Fn}${h}`),p)}});let d=pC(t(u)).filter(p=>!!p),m;if(!d.length)return o;if(u instanceof Document){const p=hC("html");for(const f of d)p.appendChild(f);m=p}else{m=document.createDocumentFragment();for(const p of d)m.appendChild(p)}return to(m,(p,f)=>{let h=null;if(p instanceof HTMLHtmlElement)s.set("1",p);else{if(p instanceof Element&&p.hasAttribute(Fn)){h=p.getAttribute(Fn),h&&s.set(h,p);return}const y=p.previousSibling;if(y instanceof Comment&&(!(p instanceof Comment)||p.data.indexOf(Fn)<0)){const v=y.data,A=v.indexOf(Fn);A>=0&&(h=v.substring(A+14),h&&s.set(h,p))}}}),to(m,p=>{if(p instanceof Element&&p.hasAttribute(Fn)){p.removeAttribute(Fn);return}p instanceof Comment&&p.data.indexOf(Fn)>=0&&p.remove()}),to(e,p=>{const f=i.get(p),h=s.get(f);h&&(o.set(p,h),(p instanceof HTMLScriptElement||p instanceof HTMLStyleElement)&&p.firstChild&&h.firstChild&&o.set(p.firstChild,h.firstChild))}),o}function yC(e){const t=yp(e.cloneNode()),n=pc(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=$.ELEMENT,t}var no;(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})({})})(no||(no={}));function yp(e){if(ii(e)&&fp(e.parentNode))return vC(e.data);let t=Xr(Xs(e.cloneNode())).roots[0];return t||(t=new wt(0,0,[]),t.type=$.HTML,t.content=""),t}function vC(e){const t=mp(e),n=new wt(0,t.length,[]);return n.type=$.HTML,n.content=t,n}function vp(e,t=no.HiddenResult.node){if(t&no.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&no.HiddenResult.children)for(const n of e.children)vp(n,no.HiddenResult.all)}function EC(e,t=[],n){let r;return e instanceof Element?r=yC(e):r=yp(e),r.children=t,r.parent=void 0,n&&vp(r,n(r)),r}function Ic(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=Ic(o,t,n),r)return r}function Ep(e,t,n,r){Gs("tree-node-out-of-place",()=>({mutation:n()}))}function SC(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(Ep("insertBefore",c,()=>W0(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=Ic(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=Ic(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function wC(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(ue.attribute(a,o,typeof l=="string"?l:void 0))}}}return n}function CC(e,t){const n=[],r=e.characterDataChanged;if(r)for(const o of r){const i=t.getByElement(o);i&&n.push(ue.set(i,Us(o)?o.data:bp(o)))}return n}function AC(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function TC(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 _C(e,t,n){const r=[],o=new Set,i=new Map,s=(a,l)=>{const c=i.get(a);return c?c===l:a.parent===l&&l.children.includes(a)};for(const a of e){const{added:l,removed:c}=aC(a,u=>!!t.getByElement(u));for(const u of c)if(!o.has(u)){const d=t.getByElement(u);if(d){const m=i.get(d)??d.parent;!m||!s(d,m)?Ep("remove",d,()=>q0(d,t)):r.push(ue.remove(d)),i.delete(d),o.add(u)}}for(const u of l){if(TC(u))continue;const d=AC(u);if(d&&!t.getByElement(d))continue;const{parentTreeNode:m,nextSiblingTreeNode:p}=SC(u,t,n,f=>o.has(f),s)||{};if(m){let f=t.getByElement(u);f||(f=EC(u),t.set(f,u)),r.push(ue.add(m,f,p)),i.set(f,m),o.delete(u)}}r.push(...wC(a,t)),r.push(...CC(a,t))}return r}function kC(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(ue.attribute(e,a,c))}else r.push(ue.attribute(e,a,void 0))}for(const s of i){const a=s.name==="___src"?"src":s.name;o.getNamedItem(a)||r.push(ue.attribute(e,a,s.value))}return r}function LC(e,t){if(!(!_0()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=Zf(e,n,r);o===null?t.removeAttribute(n):o!==r&&Hn(t,n,o)}}function NC(e,t,n){const r=[],o=bC(e,n,t);return to(e,i=>{const s=t.getByElement(i);if(!s)return;const a=o.getByKey(i);if(a){if(a instanceof Element){if(!(i instanceof Element))return nt("CharacterData mapped to Element");r.push(...kC(s,i,a))}else if(a instanceof CharacterData){if(!(i instanceof CharacterData))return nt("Element mapped to CharacterData");a.data!==i.data&&r.push(ue.set(s,Us(a)?a.data:bp(a,i.parentNode)))}else if(a instanceof Document&&!(i instanceof Document))return nt("Node mapped to Document")}else{const l=u=>{for(const d of u.childNodes)if(o.getByKey(d)||!l(d))return!1;return!0};let c;return l(i)?(r.push(ue.hidden(s,!0)),c=!1):r.push(ue.hidden(s,!1)),c}}),r}function xC(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 MC(e){return[...new Set(e)]}function RC(e,t){return MC([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>xC(n,t)||n))}function OC(e,t){let n=[];for(const r of e){const o=RC(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 PC(e,t,n){return OC(e,t).flatMap(r=>NC(r,t,n))}function IC(e,t,n,r){return[..._C(e,t,r),...PC(e,t,n)]}function DC(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 BC=class{constructor(){L(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))}},Sp=class{constructor(e=10){L(this,"_max",void 0),L(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}},wp=new Sp(1e3);function ro(e){if(e=e?.trim(),e){let t=wp.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),wp.put(e,t)),t}else return new Set}function Ys(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var Cp=new Sp(1e3);function si(e){e||(e="");let t=Cp.get(e);return t||(t=Ys(e),Cp.put(e,t)),t}function HC(e,t,n){const r=e?e.split(" "):[],o=ro(n),i=ro(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function FC(e,t,n){const r=Ys(e),o=si(n),i=si(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 Ap(e,t,n,r){return typeof r!="string"?t:e==="class"?HC(t,n,r)||null:e==="style"?FC(t,n,r)||null:n!==t&&t===r?null:t}function $C(e,t){const n=ro(e),r=ro(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function WC(e,t){const n=Ys(e),r=si(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 qC(e,t,n){return typeof n!="string"?t:e==="class"?$C(t,n)||null:e==="style"?WC(t,n)||null:t}function zC(e,t,n){if(!t)return t;const r=ro(e),o=ro(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 VC(e,t,n){if(!t)return t;const r=si(e),o=Ys(t),i=si(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 Tp(e){return e.type===$.ELEMENT&&e.start!==e.end}function _p(e){return e.filter(t=>t.type===$.ELEMENT)}function UC(e,t,n){const r=_p(e),o=_p(t),i=[],s=new Set,a=new Set,l=u=>{const d=(p,f)=>{const h=new Map;for(const y of p){const v=f.has(y)?void 0:u(y);v!==void 0&&h.set(v,h.has(v)?null:y)}return h},m=d(r,s);for(const[p,f]of d(o,a)){const h=m.get(p);f&&h&&(i.push([h,f,!0]),s.add(h),a.add(f))}};l(u=>typeof u.attributes?.id=="string"?`${u.tag}#${u.attributes.id}`:void 0),l(u=>fr(u,!1,n)),l(u=>fr(u,!0,n));const c=new Set(o.map(u=>u.tag));for(const u of c){const d=f=>f.filter(h=>h.tag===u),m=d(r).filter(f=>!s.has(f)),p=d(o).filter(f=>!a.has(f));if(m.length===p.length&&d(r).length===d(o).length){const f=m.length===1&&!m[0].attributes?.id&&!p[0].attributes?.id;p.forEach((h,y)=>i.push([m[y],h,f]))}}return i}var jC=class{constructor(e,t,n,r){L(this,"element",void 0),L(this,"name",void 0),L(this,"nextValue",void 0),L(this,"prevValue",void 0),this.element=e,this.name=t,this.nextValue=n,this.prevValue=r}},GC=class{constructor(e){L(this,"_nodeMap",void 0),L(this,"_map",new BC),L(this,"_hiddenMutations",[]),L(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=zC(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=VC(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 jC(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=Ap(r,i,o.attributes?.[r]||null,this._map.getAttribute(o,r));if(s!==i){t.push(ue.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=Ap(i,s,null,a);l!==s&&t.push(ue.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=qC(r,i,this._map.getAttribute(o,r));if(s!==i){t.push(ue.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,mc());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&&!vc(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))g0(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&&fr(e,!1,r)===fr(t,!1,r)){const i=t.children.filter(Tp);e.children.filter(Tp).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of UC(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)}}}},XC=class{constructor(e){L(this,"_isMapped",void 0),L(this,"_foreign",new WeakSet),L(this,"_movedTo",new WeakMap),L(this,"_removed",new WeakSet),L(this,"_hasForeign",!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);for(const n of t.removed)this._foreign.has(n)||this._removed.add(n)}}markForeign(e){this._hasForeign=!0,this._foreign.add(e)}isMarked(e){return this._foreign.has(e)}isForeign(e){if(!this._hasForeign)return!1;for(let t=e;t;t=t.parentNode){if(this._isMapped(t))return!1;if(this._foreign.has(t))return!0}return!1}isPlacedInForeign(e){return this._hasForeign&&this.isForeign(this._isMapped(e)?e.parentNode:e)}movedTo(e){return this._movedTo.get(e)}wasRemoved(e){return this._removed.has(e)}forget(e){this._movedTo.delete(e),this._removed.delete(e)}},kp="foreign-structure-in-commit";function YC(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 Ks(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var Lp="implicit-tbody-in-canvas";function KC(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 ZC(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:Ks(n),parent:n.parentNode?Ks(n.parentNode):void 0};t.add(Lp),Gs(Lp,()=>({foreign:r}))}function QC(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:Ks(n.node),parent:n.node.parentNode?Ks(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add(kp),Gs(kp,()=>({foreign:o})))}var JC=Yn(((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 S(){this._nodes=[],this._values=[]}return S._isIndex=function(b){return+b===b>>>0},S._nodeId=function(b){var E=b[S._ID_PROP];return E||(E=b[S._ID_PROP]=S._NEXT_ID++),E},S.prototype.set=function(b,E){var C=S._nodeId(b);this._nodes[C]=b,this._values[C]=E},S.prototype.get=function(b){var E=S._nodeId(b);return E!==void 0?this._values[E]:void 0},S.prototype.has=function(b){return S._nodeId(b)in this._nodes},S.prototype.delete=function(b){var E=S._nodeId(b);delete this._nodes[E],this._values[E]=void 0},S.prototype.keys=function(){var b=[];for(var E in this._nodes)S._isIndex(E)&&b.push(this._nodes[E]);return b},S._ID_PROP="__mutation_summary_node_map_id__",S._NEXT_ID=1,S})(),o=(function(){function S(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return S})();n.Movement=void 0,(function(S){S[S.STAYED_OUT=0]="STAYED_OUT",S[S.ENTERED=1]="ENTERED",S[S.STAYED_IN=2]="STAYED_IN",S[S.REPARENTED=3]="REPARENTED",S[S.REORDERED=4]="REORDERED",S[S.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(S,b){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,C){E.__proto__=C}||function(E,C){for(var g in C)Object.prototype.hasOwnProperty.call(C,g)&&(E[g]=C[g])},i(S,b)};function s(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");i(S,b);function E(){this.constructor=S}S.prototype=b===null?Object.create(b):(E.prototype=b.prototype,new E)}var a=(function(){function S(b,E,C,g,w,T,_,M){E===void 0&&(E=!1),C===void 0&&(C=!1),g===void 0&&(g=!1),w===void 0&&(w=null),T===void 0&&(T=!1),_===void 0&&(_=null),M===void 0&&(M=null),this.node=b,this.childList=E,this.attributes=C,this.characterData=g,this.oldParentNode=w,this.added=T,this.attributeOldValues=_,this.characterDataOldValue=M,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return S.prototype.getAttributeOldValue=function(b){if(this.attributeOldValues)return this.isCaseInsensitive&&(b=b.toLowerCase()),this.attributeOldValues[b]},S.prototype.getAttributeNamesMutated=function(){var b=[];if(!this.attributeOldValues)return b;for(var E in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(E)&&b.push(E);return b},S.prototype.attributeMutated=function(b,E){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(b in this.attributeOldValues)&&(this.attributeOldValues[b]=E)},S.prototype.characterDataMutated=function(b){this.characterData||(this.characterData=!0,this.characterDataOldValue=b)},S.prototype.removedFromParent=function(b){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=b},S.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},S.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},S})(),l=(function(S){s(b,S);function b(E,C){var g=S.call(this)||this;g.rootNode=E,g.reachableCache=void 0,g.wasReachableCache=void 0,g.anyParentsChanged=!1,g.anyAttributesChanged=!1,g.anyCharacterDataChanged=!1;for(var w=0;w<C.length;w++){var T=C[w];switch(T.type){case"childList":g.anyParentsChanged=!0;for(var _=0;_<T.removedNodes.length;_++){var M=T.removedNodes[_];g.getChange(M).removedFromParent(T.target)}for(var _=0;_<T.addedNodes.length;_++){var M=T.addedNodes[_];g.getChange(M).insertedIntoParent()}break;case"attributes":g.anyAttributesChanged=!0;var N=g.getChange(T.target);N.attributeMutated(T.attributeName,T.oldValue);break;case"characterData":g.anyCharacterDataChanged=!0;var N=g.getChange(T.target);N.characterDataMutated(T.oldValue)}}return g}return b.prototype.getChange=function(E){var C=this.get(E);return C||(C=new a(E),this.set(E,C)),C},b.prototype.getOldParent=function(E){var C=this.get(E);return C?C.getOldParent():E.parentNode},b.prototype.getIsReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.reachableCache=this.reachableCache||new r;var C=this.reachableCache.get(E);return C===void 0&&(C=this.getIsReachable(E.parentNode),this.reachableCache.set(E,C)),C},b.prototype.getWasReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.wasReachableCache=this.wasReachableCache||new r;var C=this.wasReachableCache.get(E);return C===void 0&&(C=this.getWasReachable(this.getOldParent(E)),this.wasReachableCache.set(E,C)),C},b.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},b})(r),c=(function(){function S(b,E,C,g,w){this.rootNode=b,this.mutations=E,this.selectors=C,this.calcReordered=g,this.calcOldPreviousSibling=w,this.treeChanges=new l(b,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 S.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var b=this.treeChanges.keys(),E=0;E<b.length;E++)this.visitNode(b[E],void 0)},S.prototype.visitNode=function(b,E){if(!this.visited.has(b)){this.visited.set(b,!0);var C=this.treeChanges.get(b),g=E;if((C&&C.childList||g==null)&&(g=this.treeChanges.reachabilityChange(b)),g!==n.Movement.STAYED_OUT){if(this.matchabilityChange(b),g===n.Movement.ENTERED)this.entered.push(b);else if(g===n.Movement.EXITED)this.exited.push(b),this.ensureHasOldPreviousSiblingIfNeeded(b);else if(g===n.Movement.STAYED_IN){var w=n.Movement.STAYED_IN;C&&C.childList&&(C.oldParentNode!==b.parentNode?(w=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(b)):this.calcReordered&&this.wasReordered(b)&&(w=n.Movement.REORDERED)),this.stayedIn.set(b,w)}if(g!==n.Movement.STAYED_IN)for(var T=b.firstChild;T;T=T.nextSibling)this.visitNode(T,g)}}},S.prototype.ensureHasOldPreviousSiblingIfNeeded=function(b){if(this.calcOldPreviousSibling){this.processChildlistChanges();var E=b.parentNode,C=this.treeChanges.get(b);C&&C.oldParentNode&&(E=C.oldParentNode);var g=this.childListChangeMap.get(E);g||(g=new o,this.childListChangeMap.set(E,g)),g.oldPrevious.has(b)||g.oldPrevious.set(b,b.previousSibling)}},S.prototype.getChanged=function(b,E,C){this.selectors=E,this.characterDataOnly=C;for(var g=0;g<this.entered.length;g++){var w=this.entered[g],T=this.matchabilityChange(w);(T===n.Movement.ENTERED||T===n.Movement.STAYED_IN)&&b.added.push(w)}for(var _=this.stayedIn.keys(),g=0;g<_.length;g++){var w=_[g],T=this.matchabilityChange(w);if(T===n.Movement.ENTERED)b.added.push(w);else if(T===n.Movement.EXITED)b.removed.push(w);else if(T===n.Movement.STAYED_IN&&(b.reparented||b.reordered)){var M=this.stayedIn.get(w);b.reparented&&M===n.Movement.REPARENTED?b.reparented.push(w):b.reordered&&M===n.Movement.REORDERED&&b.reordered.push(w)}}for(var g=0;g<this.exited.length;g++){var w=this.exited[g],T=this.matchabilityChange(w);(T===n.Movement.EXITED||T===n.Movement.STAYED_IN)&&b.removed.push(w)}},S.prototype.getOldParentNode=function(b){var E=this.treeChanges.get(b);if(E&&E.childList)return E.oldParentNode?E.oldParentNode:null;var C=this.treeChanges.reachabilityChange(b);if(C===n.Movement.STAYED_OUT||C===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return b.parentNode},S.prototype.getOldPreviousSibling=function(b){var E=b.parentNode,C=this.treeChanges.get(b);C&&C.oldParentNode&&(E=C.oldParentNode);var g=this.childListChangeMap.get(E);if(!g)throw Error("getOldPreviousSibling requested on invalid node.");return g.oldPrevious.get(b)},S.prototype.getOldAttribute=function(b,E){var C=this.treeChanges.get(b);if(!C||!C.attributes)throw Error("getOldAttribute requested on invalid node.");var g=C.getAttributeOldValue(E);if(g===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return g},S.prototype.attributeChangedNodes=function(b){if(!this.treeChanges.anyAttributesChanged)return{};var E,C;if(b){E={},C={};for(var g=0;g<b.length;g++){var w=b[g];E[w]=!0,C[w.toLowerCase()]=w}}for(var T={},_=this.treeChanges.keys(),g=0;g<_.length;g++){var M=_[g],N=this.treeChanges.get(M);if(N.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(M)||n.Movement.STAYED_IN!==this.matchabilityChange(M)))for(var W=M,P=N.getAttributeNamesMutated(),R=0;R<P.length;R++){var w=P[R];E&&!E[w]&&!(N.isCaseInsensitive&&C[w])||N.getAttributeOldValue(w)!==W.getAttribute(w)&&(C&&N.isCaseInsensitive&&(w=C[w]),T[w]=T[w]||[],T[w].push(W))}}return T},S.prototype.getOldCharacterData=function(b){var E=this.treeChanges.get(b);if(!E||!E.characterData)throw Error("getOldCharacterData requested on invalid node.");return E.characterDataOldValue},S.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var b=this.treeChanges.keys(),E=[],C=0;C<b.length;C++){var g=b[C];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(g)){var w=this.treeChanges.get(g);!w.characterData||g.textContent==w.characterDataOldValue||E.push(g)}}return E},S.prototype.computeMatchabilityChange=function(b,E){this.matchCache||(this.matchCache=[]),this.matchCache[b.uid]||(this.matchCache[b.uid]=new r);var C=this.matchCache[b.uid],g=C.get(E);return g===void 0&&(g=b.matchabilityChange(E,this.treeChanges.get(E)),C.set(E,g)),g},S.prototype.matchabilityChange=function(b){var E=this;if(this.characterDataOnly)switch(b.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(b.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var C=b,g=this.selectors.map(function(_){return E.computeMatchabilityChange(_,C)}),w=n.Movement.STAYED_OUT,T=0;w!==n.Movement.STAYED_IN&&T<g.length;){switch(g[T]){case n.Movement.STAYED_IN:w=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:w===n.Movement.EXITED?w=n.Movement.STAYED_IN:w=n.Movement.ENTERED;break;case n.Movement.EXITED:w===n.Movement.ENTERED?w=n.Movement.STAYED_IN:w=n.Movement.EXITED}T++}return w},S.prototype.getChildlistChange=function(b){var E=this.childListChangeMap.get(b);return E||(E=new o,this.childListChangeMap.set(b,E)),E},S.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var b=function(g){var w=E.mutations[g];if(w.type!="childList"||E.treeChanges.reachabilityChange(w.target)!==n.Movement.STAYED_IN&&!E.calcOldPreviousSibling)return"continue";for(var T=E.getChildlistChange(w.target),_=w.previousSibling,M=function(P,R){!P||T.oldPrevious.has(P)||T.added.has(P)||T.maybeMoved.has(P)||R&&(T.added.has(R)||T.maybeMoved.has(R))||T.oldPrevious.set(P,R)},N=0;N<w.removedNodes.length;N++){var W=w.removedNodes[N];M(W,_),T.added.has(W)?T.added.delete(W):(T.removed.set(W,!0),T.maybeMoved.delete(W)),_=W}M(w.nextSibling,_);for(var N=0;N<w.addedNodes.length;N++){var W=w.addedNodes[N];T.removed.has(W)?(T.removed.delete(W),T.maybeMoved.set(W,!0)):T.added.set(W,!0)}},E=this,C=0;C<this.mutations.length;C++)b(C)}},S.prototype.wasReordered=function(b){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var E=b.parentNode,C=this.treeChanges.get(b);C&&C.oldParentNode&&(E=C.oldParentNode);var g=this.childListChangeMap.get(E);if(!g)return!1;if(g.moved)return g.moved.get(b);g.moved=new r;var w=new r;function T(P){if(!P||!g.maybeMoved.has(P))return!1;var R=g.moved.get(P);return R!==void 0||(w.has(P)?R=!0:(w.set(P,!0),R=W(P)!==M(P)),w.has(P)?(w.delete(P),g.moved.set(P,R)):R=g.moved.get(P)),R}var _=new r;function M(P){var R=_.get(P);if(R!==void 0)return R;for(R=g.oldPrevious.get(P);R&&(g.removed.has(R)||T(R));)R=M(R);return R===void 0&&(R=P.previousSibling),_.set(P,R),R}var N=new r;function W(P){if(N.has(P))return N.get(P);for(var R=P.previousSibling;R&&(g.added.has(R)||T(R));)R=R.previousSibling;return N.set(P,R),R}return g.maybeMoved.keys().forEach(T),g.moved.get(b)},S})(),u=(function(){function S(b,E){var C=this;if(this.projection=b,this.added=[],this.removed=[],this.reparented=E.all||E.element||E.characterData?[]:void 0,this.reordered=E.all?[]:void 0,b.getChanged(this,E.elementFilter,E.characterData),E.all||E.attribute||E.attributeList){var g=E.attribute?[E.attribute]:E.attributeList,w=b.attributeChangedNodes(g);E.attribute?this.valueChanged=w[E.attribute]||[]:(this.attributeChanged=w,E.attributeList&&E.attributeList.forEach(function(_){C.attributeChanged.hasOwnProperty(_)||(C.attributeChanged[_]=[])}))}if(E.all||E.characterData){var T=b.getCharacterDataChanged();E.characterData?this.valueChanged=T:this.characterDataChanged=T}this.reordered&&(this.getOldPreviousSibling=b.getOldPreviousSibling.bind(b))}return S.prototype.getOldParentNode=function(b){return this.projection.getOldParentNode(b)},S.prototype.getOldAttribute=function(b,E){return this.projection.getOldAttribute(b,E)},S.prototype.getOldCharacterData=function(b){return this.projection.getOldCharacterData(b)},S.prototype.getOldPreviousSibling=function(b){return this.projection.getOldPreviousSibling(b)},S})(),d=(function(){function S(){}return S.prototype.matches=function(b){if(b===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==b;for(var E=b.split(" "),C=0;C<E.length;C++)if(this.attrValue===E[C])return!0;return!1},S.prototype.toString=function(){return this.attrName==="class"&&this.contains?"."+this.attrValue:this.attrName==="id"&&!this.contains?"#"+this.attrValue:this.contains?"["+this.attrName+"~="+m(this.attrValue)+"]":"attrValue"in this?"["+this.attrName+"="+m(this.attrValue)+"]":"["+this.attrName+"]"},S})();function m(S){return'"'+S.replace(/"/,'\\"')+'"'}var p=/[a-zA-Z_]+/,f=/[a-zA-Z0-9_\-]+/,h=(function(){function S(){this.uid=S.nextUid++,this.qualifiers=[]}return Object.defineProperty(S.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),S.prototype.isMatching=function(b){return b[S.matchesSelector](this.selectorString)},S.prototype.wasMatching=function(b,E,C){if(!E||!E.attributes)return C;var g=E.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(g!=="*"&&g!==b.tagName)return!1;for(var w=[],T=!1,_=0;_<this.qualifiers.length;_++){var M=this.qualifiers[_],N=E.getAttributeOldValue(M.attrName);w.push(N),T=T||N!==void 0}if(!T)return C;for(var _=0;_<this.qualifiers.length;_++){var M=this.qualifiers[_],N=w[_];if(N===void 0&&(N=b.getAttribute(M.attrName)),!M.matches(N))return!1}return!0},S.prototype.matchabilityChange=function(b,E){var C=this.isMatching(b);return C?this.wasMatching(b,E,C)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(b,E,C)?n.Movement.EXITED:n.Movement.STAYED_OUT},S.parseSelectors=function(b){var E=[],C,g;function w(){C&&(g&&(C.qualifiers.push(g),g=void 0),E.push(C)),C=new S}function T(){g&&C.qualifiers.push(g),g=new d}for(var _=/\s/,M=void 0,N="Invalid or unsupported selector syntax.",W=1,P=2,R=3,Y=4,V=5,G=6,Le=7,ae=8,ne=9,we=10,j=11,z=12,Se=13,Ae=14,Q=W,Lt=0;Lt<b.length;){var U=b[Lt++];switch(Q){case W:if(U.match(p)){w(),C.tagName=U,Q=P;break}if(U=="*"){w(),C.tagName="*",Q=R;break}if(U=="."){w(),T(),C.tagName="*",g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){w(),T(),C.tagName="*",g.attrName="id",Q=Y;break}if(U=="["){w(),T(),C.tagName="*",g.attrName="",Q=G;break}if(U.match(_))break;throw Error(N);case P:if(U.match(f)){C.tagName+=U;break}if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),g.attrName="",Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case R:if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),g.attrName="",Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case Y:if(U.match(p)){g.attrValue=U,Q=V;break}throw Error(N);case V:if(U.match(f)){g.attrValue+=U;break}if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case G:if(U.match(p)){g.attrName=U,Q=Le;break}if(U.match(_))break;throw Error(N);case Le:if(U.match(f)){g.attrName+=U;break}if(U.match(_)){Q=ae;break}if(U=="~"){g.contains=!0,Q=ne;break}if(U=="="){g.attrValue="",Q=j;break}if(U=="]"){Q=R;break}throw Error(N);case ae:if(U=="~"){g.contains=!0,Q=ne;break}if(U=="="){g.attrValue="",Q=j;break}if(U=="]"){Q=R;break}if(U.match(_))break;throw Error(N);case ne:if(U=="="){g.attrValue="",Q=j;break}throw Error(N);case we:if(U=="]"){Q=R;break}if(U.match(_))break;throw Error(N);case j:if(U.match(_))break;if(U=='"'||U=="'"){M=U,Q=Se;break}g.attrValue+=U,Q=z;break;case z:if(U.match(_)){Q=we;break}if(U=="]"){Q=R;break}if(U=="'"||U=='"')throw Error(N);g.attrValue+=U;break;case Se:if(U==M){Q=we;break}g.attrValue+=U;break;case Ae:if(U.match(_))break;if(U==","){Q=W;break}throw Error(N)}}switch(Q){case W:case P:case R:case V:case Ae:w();break;default:throw Error(N)}if(!E.length)throw Error(N);return E},S.nextUid=1,S.matchesSelector="matches",S})(),y=(function(){function S(){}return S.createObserverOptions=function(b){var E={childList:!0,subtree:!0},C;function g(w){if(!(E.attributes&&!C)){if(E.attributes=!0,E.attributeOldValue=!0,!w){C=void 0;return}C=C||{},w.forEach(function(T){C[T]=!0,C[T.toLowerCase()]=!0})}}return b.forEach(function(w){if(w.characterData){E.characterData=!0,E.characterDataOldValue=!0;return}if(w.all){g(),E.characterData=!0,E.characterDataOldValue=!0;return}if(w.attribute){g([w.attribute.trim()]);return}var T=S._elementFilterAttributes(w.elementFilter).concat(w.attributeList||[]);T.length&&g(T)}),C&&(E.attributeFilter=Object.keys(C)),E},S.validateOptions=function(b){for(var E in b)if(!(E in S._optionKeys))throw Error("Invalid option: "+E);if(typeof b.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!b.queries||!b.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var C={callback:b.callback,rootNode:b.rootNode||document,observeOwnChanges:!!b.observeOwnChanges,oldPreviousSibling:!!b.oldPreviousSibling,queries:[]},g=0;g<b.queries.length;g++){var w=b.queries[g];if(w.all){if(Object.keys(w).length>1)throw Error("Invalid request option. all has no options.");C.queries.push({all:!0});continue}if("attribute"in w){var T={attribute:S._validateAttribute(w.attribute)};if(T.elementFilter=h.parseSelectors("*["+T.attribute+"]"),Object.keys(w).length>1)throw Error("Invalid request option. attribute has no options.");C.queries.push(T);continue}if("element"in w){var _=Object.keys(w).length,T={element:w.element,elementFilter:h.parseSelectors(w.element)};if(w.hasOwnProperty("elementAttributes")&&(T.attributeList=S._validateElementAttributes(w.elementAttributes),_--),_>1)throw Error("Invalid request option. element only allows elementAttributes option.");C.queries.push(T);continue}if(w.characterData){if(Object.keys(w).length>1)throw Error("Invalid request option. characterData has no options.");C.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return C},S._validateElementAttributes=function(b){if(!b.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var E={},C={},g=b.split(/\s+/),w=0;w<g.length;w++){var T=g[w];if(T){T=S._validateAttribute(T);var _=T.toLowerCase();if(E[_])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");C[T]=!0,E[_]=!0}}return Object.keys(C)},S._elementFilterAttributes=function(b){var E={};return b.forEach(function(C){C.qualifiers.forEach(function(g){E[g.attrName]=!0})}),Object.keys(E)},S._validateAttribute=function(b){if(typeof b!="string"||(b=b.trim(),!b))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!b.match(S._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+b);return b},S._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,S._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},S})(),v=(function(){function S(b){var E=this;this._connected=!1,this._options=y.validateOptions(b),this._observerOptions=y.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(C){return C.elementFilter?C.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(C){return C.all}),this._queryValidators=[],S.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(C){return S.createQueryValidator(E._root,C)})),this._observer=new MutationObserver(function(C){E._observerCallback(C)}),this.reconnect()}return S.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},S.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var b=this._createSummaries(this._observer.takeRecords());return this._changesToReport(b)?b:void 0},S.prototype.disconnect=function(){var b=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,b},S.prototype._observerCallback=function(b){this._options.observeOwnChanges||this._observer.disconnect();var E=this._createSummaries(b);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))},S.prototype._createSummaries=function(b){if(!b||!b.length)return[];for(var E=new c(this._root,b,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),C=[],g=0;g<this._options.queries.length;g++)C.push(new u(E,this._options.queries[g]));return C},S.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(b){b&&b.recordPreviousState()})},S.prototype._runQueryValidators=function(b){this._queryValidators.forEach(function(E,C){E&&E.validate(b[C])})},S.prototype._changesToReport=function(b){return b.some(function(E){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(C){return E[C]&&E[C].length})||E.attributeChanged&&Object.keys(E.attributeChanged).some(function(C){return!!E.attributeChanged[C].length}))})},S})(),A=(function(){function S(b,E){this.root=b,this.delegate=E,this.idMap={}}return S.prototype.initialize=function(b,E){this.idMap[b]=this.root;for(var C=0;C<E.length;C++)this.deserializeNode(E[C],this.root)},S.prototype.applyChanged=function(b,E,C,g){var w=this;E.forEach(function(T){var _=w.deserializeNode(T);w.deserializeNode(T.parentNode),w.deserializeNode(T.previousSibling),_.parentNode&&_.parentNode.removeChild(_)}),b.forEach(function(T){var _=w.deserializeNode(T);_.parentNode&&_.parentNode.removeChild(_)}),E.forEach(function(T){var _=w.deserializeNode(T),M=w.deserializeNode(T.parentNode),N=w.deserializeNode(T.previousSibling);M.insertBefore(_,N?N.nextSibling:M.firstChild)}),C.forEach(function(T){var _=w.deserializeNode(T);Object.keys(T.attributes).forEach(function(M){var N=T.attributes[M];N===null?_.removeAttribute(M):(!w.delegate||!w.delegate.setAttribute||!w.delegate.setAttribute(_,M,N))&&_.setAttribute(M,N)})}),g.forEach(function(T){var _=w.deserializeNode(T);_.textContent=T.textContent}),b.forEach(function(T){delete w.idMap[T.id]})},S.prototype.deserializeNode=function(b,E){var C=this;if(b===null)return null;var g=this.idMap[b.id];if(g)return g;var w=this.root.ownerDocument;switch(w===null&&(w=this.root),b.nodeType){case Node.COMMENT_NODE:g=w.createComment(b.textContent);break;case Node.TEXT_NODE:g=w.createTextNode(b.textContent);break;case Node.DOCUMENT_TYPE_NODE:g=w.implementation.createDocumentType(b.name,b.publicId,b.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(g=this.delegate.createElement(b.tagName)),g||(g=w.createElement(b.tagName)),Object.keys(b.attributes).forEach(function(_){(!C.delegate||!C.delegate.setAttribute||!C.delegate.setAttribute(g,_,b.attributes[_]))&&g.setAttribute(_,b.attributes[_])});break;default:throw"Unsupported node type: "+b.nodeType}if(this.idMap[b.id]=g,E&&E.appendChild(g),b.childNodes)for(var T=0;T<b.childNodes.length;T++)this.deserializeNode(b.childNodes[T],g);return g},S})(),k=(function(){function S(b,E,C){var g=this;this.target=b,this.mirror=E,this.nextId=1,this.knownNodes=new r;for(var w=this.serializeNode(b).id,T=[],_=b.firstChild;_;_=_.nextSibling)T.push(this.serializeNode(_,!0));this.mirror.initialize(w,T);var M=[{all:!0}];C&&(M=M.concat(C)),this.mutationSummary=new v({rootNode:b,callback:function(N){g.applyChanged(N)},queries:M})}return S.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},S.prototype.rememberNode=function(b){var E=this.nextId++;return this.knownNodes.set(b,E),E},S.prototype.forgetNode=function(b){this.knownNodes.delete(b)},S.prototype.serializeNode=function(b,E){if(b===null)return null;var C=this.knownNodes.get(b);if(C!==void 0)return{id:C};var g={nodeType:b.nodeType,id:this.rememberNode(b)};switch(g.nodeType){case Node.DOCUMENT_TYPE_NODE:var w=b;g.name=w.name,g.publicId=w.publicId,g.systemId=w.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:g.textContent=b.textContent;break;case Node.ELEMENT_NODE:var T=b;g.tagName=T.tagName,g.attributes={};for(var _=0;_<T.attributes.length;_++){var M=T.attributes[_];g.attributes[M.name]=M.value}if(E&&T.childNodes.length){g.childNodes=[];for(var N=T.firstChild;N;N=N.nextSibling)g.childNodes.push(this.serializeNode(N,!0))}}return g},S.prototype.serializeAddedAndMoved=function(b,E,C){var g=this,w=b.concat(E).concat(C),T=new r;w.forEach(function(M){var N=M.parentNode,W=T.get(N);W||(W=new r,T.set(N,W)),W.set(M,!0)});var _=[];return T.keys().forEach(function(M){for(var N=T.get(M),W=N.keys();W.length;){for(var P=W[0];P.previousSibling&&N.has(P.previousSibling);)P=P.previousSibling;for(;P&&N.has(P);){var R=g.serializeNode(P);R.previousSibling=g.serializeNode(P.previousSibling),R.parentNode=g.serializeNode(P.parentNode),_.push(R),N.delete(P),P=P.nextSibling}W=N.keys()}}),_},S.prototype.serializeAttributeChanges=function(b){var E=this,C=new r;return Object.keys(b).forEach(function(g){b[g].forEach(function(w){var T=C.get(w);T||(T=E.serializeNode(w),T.attributes={},C.set(w,T)),T.attributes[g]=w.getAttribute(g)})}),C.keys().map(function(g){return C.get(g)})},S.prototype.applyChanged=function(b){var E=this,C=b[0],g=C.removed.map(function(M){return E.serializeNode(M)}),w=this.serializeAddedAndMoved(C.added,C.reparented,C.reordered),T=this.serializeAttributeChanges(C.attributeChanged),_=C.characterDataChanged.map(function(M){var N=E.serializeNode(M);return N.textContent=M.textContent,N});this.mirror.applyChanged(g,w,T,_),C.removed.forEach(function(M){E.forgetNode(M)})},S})();if(MutationObserver===void 0)throw Error("DOM Mutation Observers are required");n.ChildListChange=o,n.MutationProjection=c,n.MutationSummary=v,n.NodeChange=a,n.NodeMap=r,n.Qualifier=d,n.Selector=h,n.Summary=u,n.TreeChanges=l,n.TreeMirror=A,n.TreeMirrorClient=k,Object.defineProperty(n,"__esModule",{value:!0})}))})),eA=JC(),oo=0,io=new Array(1e3);function tA(){for(let e=0;e<oo;e+=2){const t=io[e],n=io[e+1];t(...n),io[e]=void 0,io[e+1]=void 0}oo=0}function nA(e,...t){io[oo]=e,io[oo+1]=t,oo+=2,oo===2&&oA()}function rA(){let e=0;const t=new MutationObserver(tA),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var oA=rA();function Np(){nA(()=>{Dc.hasListeners()&&(Dc.fire(),Np())})}var Dc=new Me({onFirstListenerAdd:Np}),Zs=Dc.once;function iA(e,t,n){const r=new Me;let o=[];return r.addDisposable(e(i=>{Zs(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var sA=class extends Me{constructor(e={}){super(),L(this,"_mutationSummary",void 0),this._mutationSummary=new eA.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}},aA=class extends Ee{_nextTickHandler(){Zs(()=>{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(),L(this,"_mutationEmitter",void 0),L(this,"_innerEmitter",this.addDisposable(new Me({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),L(this,"_lostEmitter",this.addDisposable(new Me)),L(this,"_paused",0),L(this,"_stopped",0),L(this,"_summaries",[]),L(this,"onMutate",this._innerEmitter.event),L(this,"onLost",this._lostEmitter.event),L(this,"onNativeMutate",void 0),this._mutationEmitter=this.addDisposable(new sA(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(t=>{this._stopped||(this._paused?this._lostEmitter.fire(t):(this._summaries.push(...t),Zs(()=>{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--}trigger(){this._mutationEmitter.trigger(!0)}},lA=Zs,cA=class extends Ee{beginTextUpdate(){this._baseDocument.beginUpdate()}endTextUpdate(){this._baseDocument.endUpdate()}constructor(e,t,n){super(),L(this,"_baseDocument",void 0),L(this,"_remoteDocument",void 0),L(this,"_parsedDocument",void 0),L(this,"_nodeMap",void 0),L(this,"_beforeChangeEmitter",this.addDisposable(new Me)),L(this,"_beforeCommitEmitter",this.addDisposable(new Me)),L(this,"_onRefreshEmitter",this.addDisposable(new Me)),L(this,"_documentElement",void 0),L(this,"_docType",void 0),L(this,"_parseFn",void 0),L(this,"_mapHTMLRoots",void 0),L(this,"_roots",void 0),L(this,"_getRootsParent",void 0),L(this,"_mutationCollector",this.addDisposable(new aA)),L(this,"_attributeMapper",void 0),L(this,"ownership",void 0),L(this,"_reportedDrifts",new Set),L(this,"_commitPromise",void 0),L(this,"_pushUndoStop",!1),L(this,"_locked",!1),L(this,"_treeMutations",[]),L(this,"beforeChange",this._beforeChangeEmitter.event),L(this,"beforeCommit",this._beforeCommitEmitter.event),L(this,"onChange",Tw(iA(this._mutationCollector.onNativeMutate,o=>o.flat(),this),o=>o.length>0,this)),L(this,"onRefresh",this._onRefreshEmitter.event),this._baseDocument=e,this._remoteDocument=t,this._parseFn=n.prepareHtml,this._mapHTMLRoots=n.mapHTMLRoots,this._getRootsParent=n.rootsParent,this._roots=[...document.childNodes];const r=this._parsedDocument=new C0(e,n.createRoot);this._nodeMap=new nC,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new GC(this._nodeMap),this.addDisposable(uC(()=>this._mutationCollector.pause())),this.addDisposable(dC(()=>this._mutationCollector.resume())),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new XC(o=>!!this._nodeMap.getByElement(o)),this.addDisposable(this._mutationCollector.onLost(o=>this.ownership.observeLost(o)))}isUntracked(e){return this.ownership.isMarked(e)}markUntracked(e){this.ownership.markForeign(e)}_reportForeignStructure(e){try{const t=n=>!!this._nodeMap.getByElement(n);QC(YC(e,this.ownership,t),this._reportedDrifts),ZC(KC(e,t),this._reportedDrifts)}catch{}}commit(e=!0,t=!1){if(e&&(this._pushUndoStop=!0),t&&(this._locked=!0),!this._commitPromise){const n=()=>new Promise(r=>{try{this._beforeCommitEmitter.fire()}catch{}const o=this._mutationCollector.onMutate(i=>{i.length&&(this._reportForeignStructure(i),Ws("commit",()=>{const s=IC(i,this._nodeMap,this._parseFn,this._rootsParent());this._commit(s)}))});lA(()=>{const i=()=>{this._pushUndoStop=!1,this._commitPromise=void 0,this._locked=!1,r()};t?this._remoteDocument.saveChangesAsync(this._pushUndoStop).finally(i):(this._remoteDocument.saveChanges(this._pushUndoStop),i()),o.dispose()})});this._commitPromise=n()}return this._commitPromise}whenSent(){return this._remoteDocument.whenSent()}renderOnly(e){this._mutationCollector.stop();try{return e()}finally{this._mutationCollector.start()}}applyHidden(e){this._mutationCollector.pause();try{return e()}finally{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=DC(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;Df(()=>{const n=np(t.applyingMutation,r=>this._nodeMap.getByNode(r),r=>t.isAttached(r));return n&&{...n,stage:"tree"}},()=>t.applyMutations(e));for(const n of e)n.type==="Hidden"&&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===$.ELEMENT){const r=pc(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,Qr),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{Ws("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,Ww()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)Ws(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=iC(this._attributeMapper.onRemoteMutate(e),this._nodeMap),this._treeMutations=[],!t){const r=this._parsedDocument.root;for(const o of e)if(o.type==="Add"){if(o.parent===r){t=!0;break}}else if(o.type==="Remove"){if(o.node.parent===r){t=!0;break}}else if(o.type==="Move"&&(o.node.parent===r||o.parent===r)){t=!0;break}}const n=Q0(e,this._nodeMap,r=>this._parsedDocument.isAttached(r));if(this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),eC(n,this._nodeMap),this._attributeMapper.restoreHidden(),t){const r=this._parsedDocument.root?.children;if(r){const o=r.map(s=>this._nodeMap.getByNode(s)).filter(s=>!!s),i=this._roots=this._mapHTMLRoots(o,this);Mc.isEqual(o,i)}}}finally{this._mutationCollector.start()}}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(ue.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}):""}setInnerHtml(e,t){if(e instanceof Element)e.innerHTML=t;else if(e instanceof Comment)e.data=t;else if(e instanceof Document){nt("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}}}},uA=class{constructor(){L(this,"_changes",null)}get(){return this._changes}hasChanges(){return!!this._changes?.length}add(e){const t=tn(this._changes,e);this._changes=t.length?t:null}clear(){this._changes=null}replace(e){this._changes=e.length?e:null}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)}}},xp=60;function dA(e,t){if(e===t)return;const n=Math.min(e.length,t.length);let r=0;for(;r<n&&e[r]===t[r];)r+=1;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+xp),cached:t.substring(r,r+xp)}}var mA=class extends Ee{constructor(...e){super(...e),L(this,"_onApplyEmitter",this.addDisposable(new Me)),L(this,"_onEmptyEmitter",this.addDisposable(new Me)),L(this,"_dispatched",[]),L(this,"onApply",this._onApplyEmitter.event),L(this,"onEmpty",this._onEmptyEmitter.event)}_emit(e){e.length&&this._onApplyEmitter.fire(e),this.hasDispatched()||this._onEmptyEmitter.fire()}hasDispatched(){return!!this._dispatched.length}append(e,t){this._dispatched.unshift({changeId:t,textChanges:e})}apply(e,t){const n=t===void 0?-1:this._dispatched.findIndex(r=>r.changeId===t);if(n>=0){this._confirmEcho(n,e);return}this._applyExternal(e)}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(tn(Bn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=tn(t,Bn(n.textChanges));this._dispatched=[],this._emit(tn(t,e))}clear(){this._dispatched=[]}},fA=class AS extends Ee{constructor(t=""){super(),L(this,"_text",void 0),this._text=t}getText(t){const n=t0(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new AS(this._text)}},Qs=class TS extends fA{constructor(t=""){super(t),L(this,"_eventQueue",void 0),L(this,"_lockCounter",0),L(this,"_onChangeEmitter",this.addDisposable(new Me)),L(this,"_onChangedEmitter",this.addDisposable(new Me)),L(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>a0(this,r)),n.length){const r=Zr(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=o0(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=tn(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 TS(this._text)}};function Mp(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function Js(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 pA(e){return(t,n,r)=>Js(t)?e(t,n,r):!1}function hA(e){return t=>Js(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function gA(e){return(t,n,r)=>Js(t)?Mp(t)?e(t,n,r):t:!1}function bA(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return Js(n)?Mp(n)?e(t):t:!1}}function yA(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function Bc(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 vA(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 EA=8,SA=class{constructor(){L(this,"_byKey",Object.create(null)),L(this,"_byValue",Object.create(null))}getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=vA(EA),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},ea=new SA;function Rp(e,t){return t!==void 0&&!Bc(e,t)?`%|{${ea.getOrCreateByKey(e)}}|%`:e}function wA(e){const t=ea.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Ye(e,t,n){return t!==void 0?Bc(e,t)?e:`%|{${ea.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function CA(e){return e.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}function ze(e){return e.startsWith("<!--")&&e.endsWith("-->")?CA(e.slice(4,-3)):e}function AA(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 TA(e,t,n){return t!==void 0?Bc(e,t)?e:`%|{${ea.getOrCreateByKey(e)}}|%`:n||yA(e)||AA(e)?`<!--${e}-->`:e}var yr=pA(Ye),vr=hA(ze),_A=gA(Ye),kA=bA(ze),LA=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",wA),e.escape("@{","}",Ye,!0).unescape("<!--@{","}-->",ze,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",Rp,!0),e.escape("{{","}}",Rp,!0),e.createSyntax("brace-percent").escape("{%","%}",Ye).unescape("<!--{%","%}-->",ze),e.createSyntax("brace-hash").escape("{#","#}",Ye).unescape("<!--{#","#}-->",ze),e.createSyntax("proscript").escape("[%","%]",TA,!0).unescape("<!--[%","%]-->",ze,!0),e.createSyntax("getresponse").escape("[[IF","]]",Ye).escape("[[if","]]",Ye).escape("[[ELSE]]","",Ye).escape("[[else]]","",Ye).escape("[[ENDIF]]","",Ye).escape("[[endif]]","",Ye).unescape("<!--[[IF","]]-->",ze).unescape("<!--[[if","]]-->",ze).unescape("<!--[[ELSE]]","-->",ze).unescape("<!--[[else]]","-->",ze).unescape("<!--[[ENDIF]]","-->",ze).unescape("<!--[[endif]]","-->",ze),e.createSyntax("expert-sender").escape("<if",">",Ye).escape("</if",">",Ye).escape("<else",">",Ye).escape("</else",">",Ye).escape("<var ",">",Ye,!0).unescape("<!--<if ",">-->",ze).unescape("<!--</if",">-->",ze).unescape("<!--<else ",">-->",ze).unescape("<!--</else",">-->",ze).unescape("<!--<var",">-->",ze,!0),e.createSyntax("velocity").escape("#if",")",yr).escape("#elseif",")",yr).escape("#else","",Ye).escape("#foreach",")",yr).escape("#macro",")",yr).escape("#set",")",_A,!0).escape("#parse",")",yr).escape("#include",")",yr).escape("#evaluate",")",yr).escape("#end","",Ye).escape("#break","",Ye).escape("#stop","",Ye).unescape("<!--#macro","-->",vr).unescape("<!--#if","-->",vr).unescape("<!--#elseif","-->",vr).unescape("<!--#else","-->",ze).unescape("<!--#foreach","-->",vr).unescape("<!--#parse","-->",vr).unescape("<!--#include","-->",vr).unescape("<!--#evaluate","-->",vr).unescape("<!--#end","-->",ze).unescape("<!--#break","-->",ze).unescape("<!--#stop","-->",ze).unescape("<!--#set","-->",kA,!0),e.createSyntax("mailchimp").escape("*|","|*",Ye).unescape("<!--*|","|*-->",ze)},Op="bare",Hc=new Map;function NA(e){for(const t of Object.keys(e)){const n=e[t];n&&Hc.set(t,n)}}function xA(e){return e?Hc.get(e)??Op:Op}function MA(){Hc.clear()}function Pp(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 ai(e,t){return e.start<t.end&&t.start<e.end}function Ip(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:m,syntax:p,isVariable:f}of i){if(r?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):Pp(e,c,u.start,l),c=u.end,a.some(A=>ai(A,u)))continue;const h=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,y=e.substring(u.start,u.end),v=d(y,h,l.insideTag);v!==!1&&v!==y&&(s.push({range:u,text:v,overrideBuiltins:m,syntax:p,isVariable:f}),a.push(u))}return s.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function RA(e,t){const n=t.reduce((a,{mapFn:l,start:c,end:u,syntax:d,isVariable:m})=>(a[c]||(a[c]=[]),a[c].push({value:u,mapFn:l,syntax:d,isVariable:m}),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 Fc(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=RA(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:m}=s[c];r?(a.insideAttributeValue=!0,a.attributeQuoteChar='"'):Pp(e,l,u,a),l=u;const p=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let f=!1;for(const{mapFn:h,value:y,syntax:v,isVariable:A}of m){let k=u+d.length,S=e.indexOf(y,k);for(;S!==-1;){let b=S,E=u+d.length,C=0;for(;b!==-1;){const M=e.indexOf(d,E);if(M!==-1&&M<b)C++,E=M+d.length,b=e.indexOf(y,E);else if(C>0)C--,E=b+y.length,b=e.indexOf(y,E);else break}if(b<0)break;const g=b+y.length,w=e.substring(u,g),T=h(w,p,a.insideTag);if(T===!1){k=S+Math.max(y.length,1),S=e.indexOf(y,k);continue}(o||T!==w)&&i.push({range:{start:u,end:g},text:o?w:T,syntax:v,isVariable:A});const _=s.findIndex(({start:M})=>M>=g);_>c?c=_-1:c=s.length,f=!0;break}if(f)break}}return i}function ta(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 Dp=class{constructor(e=LA){L(this,"_disposables",[]),L(this,"_escapes",[]),L(this,"_unescapes",[]),L(this,"_escapeMatchers",[]),L(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=Fc(e,this._escapes,t,n),o=Ip(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>ai(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>ai(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=Fc(e,this._unescapes,t),r=Ip(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>ai(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>ai(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=>xA(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return Fc(e,this._escapes,t,n,!0)}getEscapedText(e,t){return ta(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return ta(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=ta(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=ta(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()}},OA=class extends Qs{constructor(){super(),L(this,"_editStack",new uA),L(this,"_editLog",[]),L(this,"_entityId",void 0),L(this,"_versionController",this.addDisposable(new mA)),L(this,"_beforeSaveEmitter",this.addDisposable(new Aw)),L(this,"_onReadyEmitter",this.addDisposable(new Me)),L(this,"_onEntitySetEmitter",this.addDisposable(new Me)),L(this,"_onPendingSentEmitter",this.addDisposable(new Me)),L(this,"_cache",new Qs),L(this,"beforeSave",this._beforeSaveEmitter.event),L(this,"_reverting",!1),L(this,"_inited",!1),L(this,"_nextChangeId",1),L(this,"_rev",null),L(this,"_pendingSave",null),L(this,"_applyingRemote",!1),L(this,"_handleUpdateEntity",({edits:e,guid:t,changeId:n,rev:r})=>{if(t===this._entityId)return this._reportSyncDrift("update-entity"),this._onRemoteChange(e,n,r)}),L(this,"_handleSetEntity",e=>{this._reportSyncDrift("set-entity"),MA(),NA(e.templateDirectivesPolicy??{}),this._entityId=e.guid,this._onEntitySetEmitter.fire(e.guid),this._editStack.clear(),this._versionController.clear(),this._pendingSave=null,this._onPendingSentEmitter.fire();const t=[[{range:yc(this._cache),text:e.html}]];return this._onRemoteChange(t,void 0,e.rev)}),L(this,"_onRemoteChange",(e,t,n)=>new Promise((r,o)=>{const{_cache:i}=this;let s=[];for(const a of e){const l=a.reverse();s=tn(s,Zr(l,i)),i.applyEdits(Jr,l)}this._rev=n??null,this._versionController.apply(s,t),this._versionController.hasDispatched()||this._flushPendingSave(),this._versionController.hasDispatched()?this.addDisposable(this._versionController.onEmpty(()=>{r()})):(this._onReadyEmitter.fire(),r())})),L(this,"onReady",this._onReadyEmitter.event),L(this,"onEntitySet",this._onEntitySetEmitter.event),this.addDisposable(Z.addListenerAsync(Pe.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(Z.addListenerAsync(Pe.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this._versionController.onApply(this._onApply.bind(this))}loadState(e){this._entityId=e.entityId;const t=[[{range:yc(this._cache),text:e.text}]];this._onRemoteChange(t)}saveState(){return{entityId:this._entityId,text:this.getText()}}_onApply(e){const t=this._editStack.get();if(!t){super.applyEdits(Jr,gr(e));return}const n=zf(t,e,"after"),r=n&&zf(e,t,"before");if(!n||!r){this._editStack.clear(),super.applyEdits(Jr,gr(tn(Bn(t),e)));return}try{this._applyingRemote=!0,super.applyEdits(Jr,gr(r))}finally{this._applyingRemote=!1}this._editStack.replace(n)}isApplyingRemote(){return this._applyingRemote}_flushPendingSave(){if(this._pendingSave!==null){const e=this._pendingSave;this._pendingSave=null,this.saveChanges(e),this._onPendingSentEmitter.fire()}}whenSent(){return this._pendingSave===null?Promise.resolve():new Promise(e=>{const t=this._onPendingSentEmitter.event(()=>{t.dispose(),e()})})}_reportSyncDrift(e){if(this._editStack.hasChanges()||this._versionController.hasDispatched())return;const t=dA(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;Gs("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}applyEdits(e,t){if(!this._reverting){const n=Zr(t,this);this._editStack.add(n),super.applyEdits(e,t),this._editLog.push(t)}}correctOffset(e,t){return this._editStack.correctOffset(e,t)}correctRange(e,t){return this._editStack.correctRange(e,t)}saveChanges(e=!0){if(!this._reverting&&this._rev!==null&&this._versionController.hasDispatched())return this._editStack.hasChanges()&&(this._pendingSave=(this._pendingSave??!1)||e),!0;if(!this._reverting&&this._beforeSaveEmitter.fire(e)!==!1&&this._entityId){const t=this._editStack.get()?.flatMap(n=>l0(n));if(t){const n=this._nextChangeId++;this._editStack.clear(),this._versionController.append(t,n),Z.send(Pe.APPLICATION_UPDATE_ENTITY,{guid:this._entityId,pushUndoStop:e,edits:gr(t),changeId:n,...this._rev!==null?{baseRev:this._rev}:{}})}return!0}return!1}saveChangesAsync(e=!0){return new Promise(t=>{const n=setTimeout(()=>nt("error while async saving"),1e4);if(this.saveChanges(e)===!1&&clearTimeout(n),!this.hasChanges()||this._pendingSave!==null)clearTimeout(n),t();else{const r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})}})}hasChanges(){return this._editStack.hasChanges()}},PA=class extends Dp{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_mappedDocument",void 0),L(this,"_mappings",[]),L(this,"_cachedMappedDocument",new Qs),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=Zr(this.getMappings(n),this._baseDocument),o=Bn(this._mappings);if(t=tn(o,t),t=tn(t,r),this._mappings=r,t.length){const i=gr(t);this._mappedDocument.applyEdits(e,zs(i))}}}correctOffset(e,t){const n=t?this._mappings:Bn(this._mappings),r=hc(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=Bn(this._mappings).find(({oldPosition:n,oldEnd:r})=>e>=n&&e<r);return t?{start:t.oldPosition,end:t.oldEnd}:null}hasMappedReplacementRangeInRange(e){return Bn(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 ni(e,n)}unescape(e){const t=this.getRevertMappings(e);return ni(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=Jr){const t=this._baseDocument.getText(),n=this.getMappings(t),r=ni(t,n);this._mappings=Zr(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=Zr(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=tn(o,t),t=tn(t,r),this._mappings=Bn(r),t.length){const i=gr(t);this._baseDocument.applyEdits(e,zs(i))}}}};function IA(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function li(e){let t=e.head;if(!t){t=e.createElement("head");const n=IA(e);n.insertBefore(t,n.firstChild)}return t}function DA(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function BA(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function HA(e){const t=li(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 Bp="amp-custom";function FA(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function Hp(e,t,n){for(const r of t)if(oi.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(Nc(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 oi.isMediaRule(r)&&Hp(e,r.cssRules,n)}function Fp(e,t){const n=t.sheet;if(n){const i=new Set;Hp(e,n.cssRules,(s,a)=>{const l=FA(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>oi.isStyleRule(d)&&d.selectorText===`.${l}`)&&!i.has(u)&&(i.add(u),t.innerHTML=`
1
+ __emailmaker__.define("js/elMarkupHelper.Dv3AYDYP.js",["require","exports","module"],function(Ql,q,cq){var lf=Object.defineProperty,Yn=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ie=(e,t)=>{let n={};for(var r in e)lf(n,r,{get:e[r],enumerable:!0});return t||lf(n,Symbol.toStringTag,{value:"Module"}),n};function Xo(e){"@babel/helpers - typeof";return Xo=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},Xo(e)}function kS(e,t){if(Xo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LS(e){var t=kS(e,"string");return Xo(t)=="symbol"?t:t+""}function L(e,t,n){return(t=LS(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cf;cf=Symbol.toStringTag;var Jl=class{constructor(){L(this,"_valuesMap",new Map),L(this,cf,"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 uf(){const e=new Jl;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&Jl.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(Jl.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 df(){const e=uf(),t=uf();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)})}df();function NS(e){return e}var xS=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),L(this,"cycle",void 0),this.cycle=e}};function MS(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 RS(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 OS(e){const t=MS(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 xS([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of RS(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 wS{constructor(t=[]){L(this,"_inner",void 0),L(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof wS&&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 ec(e){return`service_container_${e}`}var Yo=new Set,tc;function PS(){if(!tc)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,mf.prototype.getInstanceAsync),e.stack}function nc(e){Yo.delete(e)&&tc?.end(e)}var mf=class af extends Ee{_runCallbacks(t){[...this._injectCallbacks].forEach(n=>n(t))}constructor(t=null){super(),L(this,"_parent",void 0),L(this,"_injectCallbacks",[]),L(this,"_injections",Object.create(null)),L(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=PS();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};Yo.add(s),tc?.start(s),this._onInject(t,()=>{nc(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(Yo))n.container===this&&(nc(n),n.reject(t))}pendingWaits(){return[...Yo].filter(t=>t.container===this)}addService(t,n){const r=ec(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=ec(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=ec(t);return[...this.getInstance(n,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new af(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const n=this._parent?.getOrCreateIsolatedContainer(t);return new af(n)})}remove(t){const n=this._injections;delete n[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(Yo))t.container===this&&nc(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function rc(e){return e.startsWith("__")?e:`__${e}__`}function IS(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=rc(e),n=globalThis;return n[t]??(n[t]={})}function DS(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function BS(e){if(e)return rc(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return rc(t)}function oc(e){const t=BS(e),n=IS(t);if(DS(n.container))return n.container;const r=new mf(null);return n.container=r,r}function HS(){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 FS(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():HS()}function de(e=FS()){return e}function ff(){return"iframe".trim()||"unknown"}function $S(e){if(typeof globalThis>"u")return;const t=ff(),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 WS(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function qS(e,t){if($S(t),typeof globalThis>"u")return e;const n=ff(),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 xs;function zS(){if(xs)return xs;const e=WS();return xs=qS(oc(e),e),xs}var uq=new Proxy({},{get(e,t,n){const r=zS(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),VS=new Function("url","return import(url)");function US(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function ic(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function pf(e){return e.type==="umd"||e.resolve==="registry"}var jS="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 GS(e){const t=Array.isArray(e)?e[0]:e;return ic(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function XS(e,t){const n=GS(e),r=ic(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&pf(r)&&!/compat/iu.test(o)?` ${jS}`:"",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 YS(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function dq(e){return e}var KS=class{constructor(e,t,n={}){L(this,"_context",void 0),L(this,"_pluginRegistry",void 0),L(this,"_options",void 0),L(this,"_map",new Map),L(this,"_optionsMap",new Map),L(this,"_readyMap",new Map),L(this,"_resolveMap",new Map),L(this,"_initializingPlugins",new Map),L(this,"_creatingPlugins",new Set),L(this,"_initializedPlugins",new Set),L(this,"_creationOrder",[]),L(this,"_lifecycleListeners",new Set),L(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(ic(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(pf(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await VS(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):YS(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=XS(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 US(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 n.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 n.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)}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)}))}},ZS=class{constructor(){L(this,"_plugins",new Map),L(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)}}}},QS=class{constructor(e){L(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()}},te=de("SandboxHtmlDocument"),mt=de("SandboxRemoteDocument"),Ko=de("SandboxTextDocument"),Zt=de("SandboxDocumentMapping"),xe=de("SandboxSyncCommit"),Zo=de("SandboxLayoutProfile"),Ms=de("SandboxState"),qr=de("SandboxAttributePipeline"),sc=de("SandboxAmpService"),ac=de("SandboxImageReload"),Rs=de("SandboxImageCache"),at=de("SandboxFocus"),lc=de("SandboxLocalization"),He=de("SandboxElementSettings"),vt=de("SandboxSetCursor"),hf=de("SandboxStyleRoot"),gf=de("SandboxVmlWidthResolver"),Os=de("SandboxPrepareHtml"),Qo=de("SandboxSurfaceName"),Ps=de("SandboxDocumentSync"),zr=de("SandboxMapObj"),Vr=de("SandboxActiveElementFingerprint"),Is=de("SandboxToggleTextStyle"),Qt=de("SandboxWrapEditor"),Ur=de("SandboxInsertServices"),Jo=de("SandboxInitPreview"),cc=de("SandboxInsertPolicy"),bf=de("SandboxNarrowTableTextAtom"),yf=de("SandboxSettingsExtras"),vf=de("SandboxViewportHandlers"),Ef=de("SandboxOperations"),Ds=de("SandboxApplyElementSettings"),Kn=de("SandboxOperationEnvironment"),jr=de("SandboxHostFacts"),JS="__sandbox__",Et=oc(JS);function ew(e){return e}function tw(e,t=Et){t.inject(Qo,e.name),t.inject(Zo,e.profile);for(const n of OS(e.units))n.setup(t);return t}function Jt(e,t){e.remove?.(t)}function D(e,t){const n=e.getInstance(t);if(n===void 0)throw new Error(`[sandbox] служба «${String(t)}» не зарегистрирована: её фича не подключена или ещё не зарегистрирована`);return n}var Sf=class{constructor(e){L(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},St=(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.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e})({}),nw=class{constructor(e,t){L(this,"source",void 0),L(this,"len",void 0),L(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===aw||e===lw||e===ow||e===sw||e===iw)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},wf=33,Gr=45,ei=60,en=62,Bs=47,rw=61,Cf=34,Af=39,ow=10,iw=13,sw=12,aw=32,lw=9,cw={"text/x-handlebars-template":!0,"text/html":!0};function uw(e,t=0,n=0,r=!1){const o=new nw(e,t);let i=n,s=0,a=18,l,c,u=!1,d,m,p;function f(){return o.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function h(){const S=o.pos();for(;!o.eos();){const b=o.nextChar();if(b===en)return!0;if(b===ei)break;if(b===Cf||b===Af){if(!o.advanceUntilChar(b))break;o.advance(1)}}return o.goBackTo(S),!1}function y(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function v(S,b,E){return a=b,s=S,l=E,b}function A(){const S=o.pos(),b=i,E=k();return E!==21&&S===o.pos()&&!(r&&(E===4||E===8))?(o.advance(1),v(S,18)):E}function k(){const S=o.pos();if(o.eos())return v(S,21);let b;switch(i){case 6:return o.advanceIfChars([Gr,Gr,en])?(i=0,v(S,2)):(o.advanceUntilChars([Gr,Gr,en]),v(S,1));case 3:return o.advanceIfChar(en)?(i=0,v(S,15)):(o.advanceUntilChar(en),v(S,14));case 0:if(o.advanceIfChar(ei)){if(!o.eos()&&o.peekChar()===wf){if(o.advanceIfChars([wf,Gr,Gr]))return i=6,v(S,0);if(o.advanceIfRegExp(/^!doctype/i))return i=3,v(S,13)}return o.advanceIfChar(Bs)?(i=2,v(S,7)):(i=1,v(S,3))}return o.advanceUntilChar(ei),v(S,16);case 2:return f().length>0?(i=5,u=!1,v(S,9)):o.skipWhitespace()?v(S,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(en),S<o.pos()?v(S,18,"End tag name expected."):k());case 5:if(o.skipWhitespace())return u=!0,v(S,17);if(o.advanceIfChar(en))return i=0,v(S,8);if(r&&o.peekChar()===ei)return i=0,v(S,8,"Closing bracket missing.");if((u||o.peekChar()===Bs)&&h())return i=0,v(S,8);b="Closing bracket expected.";break;case 1:return d=f(),p=void 0,m=void 0,d.length>0?(c=!1,i=4,v(S,6)):o.skipWhitespace()?v(S,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(en),S<o.pos()?v(S,18,"Start tag name expected."):k());case 4:return o.skipWhitespace()?(c=!0,v(S,17)):c&&(m=y(),m.length>0)?(i=9,c=!1,v(S,11)):o.advanceIfChars([Bs,en])?(i=0,v(S,5)):o.advanceIfChar(en)?(d==="script"?p&&cw[p]?i=0:i=7:d==="style"?i=8:i=0,v(S,4)):r&&o.peekChar()===ei?(i=0,v(S,4,"Closing bracket missing.")):(o.advance(1),v(S,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,v(S,17)):o.advanceIfChar(rw)?(i=10,v(S,10)):(i=4,k());case 10:if(o.skipWhitespace())return v(S,17);let E=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(E.length>0)return o.peekChar()===en&&o.peekChar(-1)===Bs&&(o.goBack(1),E=E.substr(0,E.length-1)),m==="type"&&(p=E),i=4,c=!1,v(S,12);const C=o.peekChar();return C===Af||C===Cf?(o.advance(1),o.advanceUntilChar(C)&&o.advance(1),m==="type"&&(p=o.getSource().substring(S+1,o.pos()-1)),i=4,c=!1,v(S,12)):(i=4,c=!1,k());case 7:let g=1;for(;!o.eos();){const w=o.advanceIfRegExp(/<!--|-->|<\/?script(?=[\s/>])\s*\/?>?/i);if(w.length===0)return o.goToEnd(),v(S,19);if(w==="<!--")g===1&&(g=2);else if(w==="-->")g=1;else if(w[1]!=="/")g===2&&(g=3);else if(g===3)g=2;else{o.goBack(w.length);break}}return i=0,S<o.pos()?v(S,19):k();case 8:return o.advanceUntilRegExp(/<\/style(?=[\s/>])/i),i=0,S<o.pos()?v(S,20):k()}return o.advance(1),i=0,v(S,18,b)}return{scan:A,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>o.pos()-s,getTokenEnd:()=>o.pos(),getTokenText:()=>o.getSource().substring(s,o.pos()),getScannerState:()=>i,getTokenError:()=>l}}function dw(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function mw(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function fw(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function pw(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 uc=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function hw(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var Tf=Object.create(null);function gw(e,t){const n=Tf[e]||(Tf[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[hw(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function dc(e,t){if(e.start===e.end||t)return"";switch(e.type){case $.ELEMENT:return pc(e,t);case $.ROOT:return[...e.children].map(n=>dc(n,t)).join("");case $.DOCTYPE:return dw(e,t);case $.COMMENT:return fw(e,t);default:return e.content||""}}function mc(){return{exact:new WeakMap,collapsed:new WeakMap}}function fr(e,t=!1,n){if(e.start===e.end&&e.type!==$.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=>fr(a,t,n)).join("");let s;switch(e.type){case $.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case $.ROOT:s=i();break;case $.COMMENT:s=`<!--${e.content??""}-->`;break;case $.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 fc(e,t=0){if(e.start===e.end)return"";switch(e.type){case $.ELEMENT:return yw(e,t);case $.ROOT:return kf(e,t);case $.DOCTYPE:return mw(e,t);case $.COMMENT:return pw(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function _f(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"&&!gw(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function bw(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=dc(r);return n}function kf(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=fc(r,t+n.length);return n}function Lf(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=_f(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function Nf(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function pc(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=Lf(e,t);if(uc.has(r))return o;{const i=Nf(e,t);return`${o}${n?bw(e,t):""}${i}`}}function yw(e,t){const n=e.tag?.toLowerCase()||"div",r=Lf(e);if(e.start=t,e.startTagEnd=t+r.length,uc.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=kf(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=Nf(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function hc(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 $=(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})({}),Hs=e=>e.type===0?e.start-1:e.start,vw=e=>e.type===0?e.end+1:e.end,wt=class CS{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,n,r,o){L(this,"start",void 0),L(this,"end",void 0),L(this,"children",void 0),L(this,"parent",void 0),L(this,"content",void 0),L(this,"type",1),L(this,"tag",void 0),L(this,"closed",!1),L(this,"startTagEnd",void 0),L(this,"endTagStart",void 0),L(this,"attributes",void 0),L(this,"createdBy",void 0),L(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=hc(this.children,r=>t<=Hs(r))-1;if(n>=0){const r=this.children[n];if(t>Hs(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=hc(this.children,r=>t<=Hs(r))-1;if(n>=0){const r=this.children[n];if(t>=Hs(r)&&t<=vw(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 CS(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 Ew(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 xf=class{constructor(e,t){L(this,"text",void 0),L(this,"type",void 0),L(this,"node",void 0),L(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 wt(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}}},Mf=class{constructor(e){L(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=uw(e,void 0,void 0,!0),r=new wt(0,e.length,[],void 0);r.type=$.ROOT;let o=r,i=-1,s,a=null,l=n.scan();const c=()=>{if(!o.tag){const f=o.parent.children,h=f[f.length-2],y=e.substring(o.start,o.end);h?.type===$.HTML?(h.content=(h.content||"")+y,h.end=o.end,f.splice(f.length-1,1)):(o.type=$.HTML,o.content=y,o.children=[]),o.type=$.HTML}o=o.parent},u=new xf(e,$.COMMENT),d=new xf(e,$.DOCTYPE),m=f=>{o.children.push(f)};for(;l!==St.EOS;){switch(l){case St.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndDoctypeTag:{const A=o.lastChild,k=d.node;if(!k)throw new Error("");const S=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(S!==k.start){const b=e.substring(S,k.start);if(b){const E=new wt(S,k.start,[],o);E.type=$.HTML,E.content=b,m(E)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndCommentTag:{const A=o.lastChild,k=u.node;if(!k)throw new Error("");const S=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(S!==k.start){const b=e.substring(S,k.start);if(b){const E=new wt(S,k.start,[],o);E.type=$.HTML,E.content=b,m(E)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartTagOpen:const f=o.lastChild,h=new wt(n.getTokenOffset(),e.length,[],o),y=f?f.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(y!==h.start){const A=e.substring(y,h.start);if(A){const k=new wt(y,h.start,[],o);k.type=$.HTML,k.content=A,m(k)}}m(h),o=h;break;case St.StartTag:o.tag=n.getTokenText();break;case St.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 St.StartTagSelfClose:o.parent&&(o.closed=!0,o.end=n.getTokenEnd(),o.startTagEnd=n.getTokenEnd(),c());break;case St.EndTagOpen:i=n.getTokenOffset(),s=void 0;break;case St.EndTag:s=n.getTokenText().toLowerCase();break;case St.EndTagClose:let v=o;for(;!v.isSameTag(s)&&v.parent;)v=v.parent;if(v.parent){const A=o.lastChild,k=A?A.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(k!==i){const S=e.substring(k,i);if(S){const b=new wt(k,i,[],o);b.type=$.HTML,b.content=S,m(b)}}for(;o!==v;)o.end=i,o.closed=!1,c();o.closed=!0,o.endTagStart=i,o.end=n.getTokenEnd(),c()}break;case St.AttributeName:{a=n.getTokenText();let A=o.attributes;A||(o.attributes=A={}),A[a]=null;break}case St.AttributeValue:{const A=n.getTokenText(),k=o.attributes;k&&a&&(k[a]=Ew(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 p=r.lastChild?.end||0;if(p<e.length){const f=e.substring(p);if(f){const h=new wt(p,e.length,[],r);h.type=$.HTML,h.content=f,m(h)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},mq=new Mf(new Sf(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),Sw=new Sf(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),ww=new Mf(Sw);function Xr(e){return ww.parse(e)}var Rf=class extends Ee{constructor(e={}){super(),L(this,"_options",void 0),L(this,"_listeners",[]),L(this,"on",this._addListener.bind(this)),L(this,"event",this._addListener.bind(this)),L(this,"once",(t,n=0,r)=>{const o=this._addListener((...i)=>(o?.dispose(),r?t.call(r,...i):t(...i)),n);return o}),L(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()}},Cw=class extends Rf{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}}},Me=class extends Cw{execute([e],t){for(const n of t)try{n(e)}catch{}}},Aw=class extends Rf{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 Tw(e,t,n){let r;const o=new Me({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 _w(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 kw(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 fq(e){return e}function Lw(e){return e&&typeof e=="object"}function Of(e,t){return e&&typeof e=="object"&&e.operationId===t}var yn="INIT_MESSAGE",Nw="em:port-ready",xw="em:window-drained",gc="";function Pf(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var Mw=class extends Ee{constructor(...e){super(...e),L(this,"_listeners",Object.create(null)),L(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)}}}),L(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)}}),L(this,"addListener",(t,n,r=0)=>this.addListenerAsync(t,(o,i)=>{try{n(o)}catch{}return i&&i(o)},r))}},Rw=class extends Ee{constructor(e,t){super(),L(this,"_singleton",void 0),L(this,"_target",void 0),L(this,"_transport",void 0),L(this,"_transportSubscription",void 0),L(this,"_ports",new Map),L(this,"_drained",new WeakSet),L(this,"_portSendHeld",new WeakSet),L(this,"_inited",!1),L(this,"_emitter",this.addDisposable(new Mw)),L(this,"_handshaken",new WeakSet),L(this,"_greeted",new WeakSet),L(this,"_outgoingFilter",void 0),L(this,"_outgoingObservers",new Set),L(this,"_offTargetListeners",new Map),L(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)&&Of(o,yn)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:yn,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),Lw(o)&&l||this._singleton&&Of(o,yn)){if(s&&l){const m=this._target;Promise.resolve().then(()=>this.usePort(s,!0,m))}const c=this._emitter.fireAsync(o.operationId||gc,o.operationId===void 0?r:o.data),u=o.result,d=o.error;u&&d&&Promise.resolve(c).then(m=>this._sendMessage(u,m),m=>this._sendMessage(d,m))}}),this._singleton=t,this._transport=_w({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(yn,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(yn))}),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(yn,void 0);return}this._inited=!1,this._postMessage(e,{operationId:yn,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:yn,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:yn,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=kw(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:Nw,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:xw,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(gc,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=Pf(),o=Pf();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(gc,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(yn,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}},Ow=/<\/?[a-zA-Z][a-zA-Z0-9:_.-]*(?:\s[^<>]*)?\/?>/g;function Pw(e){return e.replace(Ow,t=>/^<br\b/i.test(t)?" ":"")}var Iw={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"},Dw="fonts.googleapis.com",Bw=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},Hw=e=>{const t=Bw(String(e??""));return t?t.hostname===Dw&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},Pe={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_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"},Fw=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"),DROP_BLOCK_HINT:e("Click or drag a block")}),Z=new Rw(window.parent,!0),Fs,ti,If=Math.random().toString(36).slice(2,8),$w=0,$s;function Df(e,t){const n=Fs;Fs=e;try{return t()}finally{Fs=n}}function Ws(e,t){const n=ti;ti=e;try{return t()}finally{ti=n}}function Ww(){return ti}function qw(){try{return Fs?.()}catch{return}}function zw(){return $s||($s=`${If}:${++$w}`,Promise.resolve().then(()=>{$s=void 0})),$s}function nt(e,t){const n=qw();return Z.send(Pe.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:ti??"other",batch:zw(),instance:If}),t}function bc(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(bc(e,o)===!1)return!1;return!0}function Bf(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function Vw(e,t){return Bf(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(bc(e,o[i])===!1)return!1}},t)}function pr(e,t,n){bc(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(Bf(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),Vw(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var Uw=e=>e.type===$.HTML?e.start-1:e.start,jw=e=>e.type===$.HTML?e.end+1:e.end;function Gw(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(Uw(o)>=n||jw(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function Xw(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function Zn(e){let t=e;do t=Yw(t);while(t&&t.type===$.HTML&&!t.content);return t}function Yw(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n<0)return nt("parent and child not sync",e);if(n<t.length-1)return t[n+1]||null}return null}var hr=class{constructor(e,t,n,r){L(this,"originalStart",void 0),L(this,"originalLength",void 0),L(this,"modifiedStart",void 0),L(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 Hf(e,t){return(t<<5)-t+e|0}function Kw(e,t){t=Hf(149417,t);for(let n=0,r=e.length;n<r;n++)t=Hf(e.charCodeAt(n),t);return t}var Ff=class{constructor(e){L(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 $f(e,t,n){return new Zw(new Ff(e),new Ff(t)).ComputeDiff(n).changes}var Yr=class{static Assert(e,t){if(!e)throw new Error(t)}},Kr=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]}},Wf=class{constructor(){L(this,"m_changes",void 0),L(this,"m_originalStart",void 0),L(this,"m_modifiedStart",void 0),L(this,"m_originalCount",void 0),L(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 hr(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}},Zw=class Go{constructor(t,n,r=null){L(this,"ContinueProcessingPredicate",void 0),L(this,"_originalSequence",void 0),L(this,"_modifiedSequence",void 0),L(this,"_hasStrings",void 0),L(this,"_originalStringElements",void 0),L(this,"_originalElementsOrHash",void 0),L(this,"_modifiedStringElements",void 0),L(this,"_modifiedElementsOrHash",void 0),L(this,"m_forwardHistory",void 0),L(this,"m_reverseHistory",void 0),this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,i,s]=Go._getElements(t),[a,l,c]=Go._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(Go._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=Kw(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)?Go._getStrictElement(this._originalSequence,t)===Go._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?(Yr.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new hr(t,0,r,o-r+1)]):t<=n?(Yr.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new hr(t,n-t+1,r,0)]):(Yr.Assert(t===n+1,"originalStart should only be one more than originalEnd"),Yr.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 hr(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,m,p,f,h,y,v,A){let k=null,S=null,b=new Wf,E=n,C=r,g=p[0]-y[0]-o,w=-1073741824,T=this.m_forwardHistory.length-1;do{const _=g+t;_===E||_<C&&c[_-1]<c[_+1]?(d=c[_+1],f=d-g-o,d<w&&b.MarkNextChange(),w=d,b.AddModifiedElement(d+1,f),g=_+1-t):(d=c[_-1]+1,f=d-g-o,d<w&&b.MarkNextChange(),w=d-1,b.AddOriginalElement(d,f+1),g=_-1-t),T>=0&&(c=this.m_forwardHistory[T],t=c[0],E=1,C=c.length-1)}while(--T>=-1);if(k=b.getReverseChanges(),A[0]){let _=p[0]+1,M=y[0]+1;if(k!==null&&k.length>0){const N=k[k.length-1];_=Math.max(_,N.getOriginalEnd()),M=Math.max(M,N.getModifiedEnd())}S=[new hr(_,m-_+1,M,h-M+1)]}else{b=new Wf,E=s,C=a,g=p[0]-y[0]-l,w=1073741824,T=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const _=g+i;_===E||_<C&&u[_-1]>=u[_+1]?(d=u[_+1]-1,f=d-g-l,d>w&&b.MarkNextChange(),w=d+1,b.AddOriginalElement(d+1,f+1),g=_+1-i):(d=u[_-1],f=d-g-l,d>w&&b.MarkNextChange(),w=d,b.AddModifiedElement(d+1,f+1),g=_-1-i),T>=0&&(u=this.m_reverseHistory[T],i=u[0],E=1,C=u.length-1)}while(--T>=-1);S=b.getChanges()}return this.ConcatenateChanges(k,S)}ComputeRecursionPoint(t,n,r,o,i,s,a){let l=0,c=0,u=0,d=0,m=0,p=0;t--,r--,i[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const f=n-t+(o-r),h=f+1,y=new Int32Array(h),v=new Int32Array(h),A=o-r,k=n-t,S=t-r,b=n-o,E=(k-A)%2===0;y[A]=t,v[k]=n,a[0]=!1;for(let C=1;C<=f/2+1;C++){let g=0,w=0;if(C>100)return null;u=this.ClipDiagonalBound(A-C,C,A,h),d=this.ClipDiagonalBound(A+C,C,A,h);for(let _=u;_<=d;_+=2){_===u||_<d&&y[_-1]<y[_+1]?l=y[_+1]:l=y[_-1]+1,c=l-(_-A)-S;const M=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(y[_]=l,l+c>g+w&&(g=l,w=c),!E&&Math.abs(_-k)<=C-1&&l>=v[_])return i[0]=l,s[0]=c,M<=v[_]&&C<=1448?this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,l,n,i,c,o,s,E,a):null}const T=(g-t+(w-r)-C)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(g,T))return a[0]=!0,i[0]=g,s[0]=w,T>0&&C<=1448?this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,l,n,i,c,o,s,E,a):(t++,r++,[new hr(t,n-t+1,r,o-r+1)]);m=this.ClipDiagonalBound(k-C,C,k,h),p=this.ClipDiagonalBound(k+C,C,k,h);for(let _=m;_<=p;_+=2){_===m||_<p&&v[_-1]>=v[_+1]?l=v[_+1]-1:l=v[_-1],c=l-(_-k)-b;const M=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(v[_]=l,E&&Math.abs(_-A)<=C&&l<=y[_])return i[0]=l,s[0]=c,M>=y[_]&&C<=1448?this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,l,n,i,c,o,s,E,a):null}if(C<=1447){let _=new Int32Array(d-u+2);_[0]=A-u+1,Kr.Copy2(y,u,_,1,d-u+1),this.m_forwardHistory.push(_),_=new Int32Array(p-m+2),_[0]=k-m+1,Kr.Copy2(v,m,_,1,p-m+1),this.m_reverseHistory.push(_)}}return this.WALKTRACE(A,u,d,S,k,m,p,b,y,v,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 m=r.originalStart-d,p=r.modifiedStart-d;if(m<o||p<i||s&&!this.OriginalElementsAreEqual(m,m+r.originalLength)||a&&!this.ModifiedElementsAreEqual(p,p+r.modifiedLength))break;const f=(m===o&&p===i?5:0)+this._boundaryScore(m,r.originalLength,p,r.modifiedLength);f>c&&(c=f,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,m=d-u;if(s<5&&c<20&&m<20){const p=this._findBetterContiguousSequence(a,c,u,m,s);if(p){const[f,h]=p;(f!==o.originalStart+o.originalLength||h!==o.modifiedStart+o.modifiedLength)&&(o.originalLength=f-o.originalStart,o.modifiedLength=h-o.modifiedStart,i.originalStart=f+s,i.modifiedStart=h+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 m=r;m<a;m++){const p=this._contiguousSequenceScore(d,m,i);p>0&&p>l&&(l=p,c=d,u=m)}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 Kr.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],Kr.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return Kr.Copy(t,0,o,0,t.length),Kr.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(Yr.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),Yr.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 hr(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 qs(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var zt=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){L(this,"oldPosition",void 0),L(this,"oldText",void 0),L(this,"newPosition",void 0),L(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} "${qs(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${qs(this.oldText)}")`:`(replace@${this.oldPosition} "${qs(this.oldText)}" with "${qs(this.newText)}")`}};function tn(e,t){return e===null||e.length===0?t:new Qw(e,t).compress()}var Qw=class Xn{constructor(t,n){L(this,"_prevEdits",void 0),L(this,"_currEdits",void 0),L(this,"_result",void 0),L(this,"_resultLen",void 0),L(this,"_prevLen",void 0),L(this,"_prevDeltaOffset",void 0),L(this,"_currLen",void 0),L(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]=Xn._splitCurr(o,r.newPosition-o.oldPosition);this._acceptCurr(l),o=c;continue}if(r.newPosition<o.oldPosition){const[l,c]=Xn._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]=Xn._splitPrev(r,o.oldLength);s=l,a=o,r=c,o=this._getCurr(++n)}else{const[l,c]=Xn._splitCurr(o,r.newLength);s=r,a=l,r=this._getPrev(++t),o=c}this._result[this._resultLen++]=new zt(s.oldPosition,s.oldText,a.newPosition,a.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=a.newLength-a.oldLength}const i=Xn._merge(this._result);return Xn._removeNoOps(i)}_acceptCurr(t){this._result[this._resultLen++]=Xn._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++]=Xn._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 zt(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new zt(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 zt(t.oldPosition,t.oldText,t.newPosition,r),new zt(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new zt(t.oldPosition,r,t.newPosition,t.newText),new zt(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 zt(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 qf(e){return new zt(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Bn(e){return e.map(qf)}function Jw(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 zf(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=Jw({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new zt(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function Vf(e,t,n=0){const r=e.range;return new zt(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function Zr(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),Vf({text:r,range:{start:o,end:i}},t,s)})}function e0(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function gr(e){return e.map(t=>e0(t))}function t0(e,t=yc(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var pq=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function n0(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function yc(e){return{start:0,end:e.getLength()}}function r0(e,t,n){return`${e.substring(0,n.start)}${t}${e.substring(n.end)}`}function ni(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 o0(e,t){return t=zs(t).sort(({range:n},{range:r})=>n.start-r.start),ni(e,t)}function ri(e,t){return e>=t.start&&e<=t.end}function zs(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(ri(i.start,l)&&ri(i.start,l))c=l;else if(ri(l.start,i))ri(l.end,i)?c=i:c={start:i.start,end:l.end};else if(ri(l.end,i))c={start:l.start,end:i.end};else continue;const u=o.text;let d=l.start-i.start+u.length,m=l.end-i.start+u.length;const p=r0(u,a.text,{start:d,end:m});e[r]=o={range:i=c,text:p},e.splice(s--,1),n--}}return e}function i0(e,t){if(e.length<=1)return e[0]||null;e=zs(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:ni(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 s0(e,t){const n=Bn(e),r=i0(gr(n),t);if(r){const o=Vf(r,t);return qf(o)}return null}function a0(e,{range:t,text:n}){const r=e.getText(t);return $f(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 l0({oldText:e,newText:t,oldPosition:n,newPosition:r}){return $f(e,t,!0).map(o=>new zt(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var c0=class{constructor(e,t){L(this,"index",void 0),L(this,"values",void 0),L(this,"type","insert"),this.index=e,this.values=t}},u0=class{constructor(e,t){L(this,"index",void 0),L(this,"howMany",void 0),L(this,"type","remove"),this.index=e,this.howMany=t}},d0=class{constructor(e,t,n){L(this,"from",void 0),L(this,"to",void 0),L(this,"howMany",void 0),L(this,"type","move"),this.from=e,this.to=t,this.howMany=n}};function m0(e,t){return e===t}function f0(e,t,n=m0){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,m=u,p=0;do s[l++]=a[u++]=!0,p++;while(l<r&&u<o&&n(e[l],t[u])&&!a[u]);i.push(new d0(d,m,p)),l--;break}var f=[];for(l=0;l<r;){if(s[l]){l++;continue}for(var h=l,p=0;l<r&&!s[l++];)p++;f.push(new u0(h,p))}for(var y=[],u=0;u<o;){if(a[u]){u++;continue}for(var h=u,p=0;u<o&&!a[u++];)p++;var v=t.slice(h,h+p);y.push(new c0(h,v))}var A=y.length,k=f.length,S=i.length,b,E,C=0;for(b=0;b<k;b++){var g=f[b];for(g.index-=C,C+=g.howMany,E=0;E<S;E++){var w=i[E];w.from>=g.index&&(w.from-=g.howMany)}}for(b=A;b--;){var T=y[b],p=T.values.length;for(E=S;E--;){var w=i[E];w.to>=T.index&&(w.to-=p)}}for(b=S;b-- >1;){var w=i[b];if(w.to!==w.from)for(E=b;E--;){var _=i[E];_.to>=w.to&&(_.to-=w.howMany),_.to>=w.from&&(_.to+=w.howMany)}}var M=[];for(b=0;b<S;b++){var w=i[b];if(w.to!==w.from)for(M.push(w),E=b+1;E<S;E++){var N=i[E];N.from>=w.from&&(N.from-=w.howMany),N.from>=w.to&&(N.from+=w.howMany)}}return[...f,...M,...y]}var Uf=class{constructor(){L(this,"_byKey",new Map),L(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}},ue;(function(e){function t(d,m,p){return{type:"Add",node:m,nextSibling:p,parent:d}}e.add=t;function n(d){return{type:"Remove",node:d}}e.remove=n;function r(d,m,p){return{type:"Attribute",node:d,name:m,value:p}}e.attribute=r;function o(d,m,p){return p?{type:"Update",prev:d,next:m,soft:p}:{type:"Update",prev:d,next:m}}e.update=o;function i(d,m,p,f){return[{type:"Remove",node:d},{type:"Add",node:p,nextSibling:f,parent:m,replaces:d}]}e.recreate=i;function s(d,m,p){return{type:"Move",node:m,nextSibling:p,parent:d}}e.move=s;function a(d,m){return{type:"Set",node:d,data:m}}e.set=a;function l(d,m,p){return{type:"ClassList",node:d,addedClasses:m,removedClasses:p}}e.classList=l;function c(d,m){return{type:"Style",node:d,value:m}}e.style=c;function u(d,m){return{type:"Hidden",node:d,value:m}}e.hidden=u})(ue||(ue={}));function jf(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var Gf=[],Xf=[];function p0(e){return jf(Gf,e)}function vc(e){return e?Gf.some(t=>t(e)):!1}function h0(e){return jf(Xf,e)}function g0(e){return Xf.some(t=>t(e))}function b0(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 m=o[d];l.push(ue.attribute(t,m,void 0))}break}else r[u]!==n[u]&&l.push(ue.attribute(t,u,r[u]))}for(;c<a;c++){const u=i[c];l.push(ue.attribute(t,u,r[u]))}return l}function y0(e){let t=[];const n=e.children.filter(o=>o.type!==$.HTML||!!o.content);let r;for(let o=n.length-1;o>=0;o--)t.push(ue.add(e,n[o],r)),r=n[o];return t}function v0(e){return ue.remove(e)}var E0=new Set(["head","body","html"]),S0=e=>e.type===$.ROOT||e.type===$.DOCTYPE||e.type===$.ELEMENT&&e.tag&&E0.has(e.tag.toLowerCase());function Yf(e){const t=new Uf,n=Object.create(null);for(const r of e){const o=String(r.type===$.ELEMENT?r.tag:r.type)+(!S0(r)&&r.start===r.end?"_hidden":"");let i="";r.type===$.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function Ec(e,t,n=!1,r=mc()){let o=[];const i=Yf(e.children),s=Yf(t.children);for(let d=e.children.length-1;d>=0;d--){const m=e.children[d];if(m.type===$.ELEMENT&&m.start===m.end){const p=i.getByValue(m);if(!s.getByKey(p)){let f=!1;for(let h=d+1;d<e.children.length;d++)if(e.children[h]){const y=i.getByValue(m),v=s.getByKey(y);if(v){const A=v.start,k=m.clone();t.children.splice(t.children.indexOf(v),0,k),pr(k,A-m.start),k.parent=t,s.set(p,k),f=!0;break}}if(!f){const h=t.endTagStart===void 0?t.end:t.endTagStart,y=m.clone();t.children.push(y),s.set(p,y),pr(y,h-m.start),y.parent=t}}}}const a=e.children.filter(d=>d.type!==$.HTML||!!d.content),l=t.children.filter(d=>d.type!==$.HTML||!!d.content),c=f0(a,l,(d,m)=>i.getByValue(d)===s.getByValue(m)),u=new Set;for(const d of c)switch(d.type){case"insert":{const m=d.index;let p=a[m];for(const f of d.values.reverse())a.splice(m,0,f),u.add(f),o.push(ue.add(t,f,p)),p=f;break}case"remove":{const m=a.splice(d.index,d.howMany);for(const p of m)o.push(ue.remove(p));break}case"move":{const m=a.splice(d.from,d.howMany);let p=a[d.to];a.splice(d.to,0,...m);for(const f of m.reverse()){const h=i.getByValue(f),y=s.getByKey(h);u.add(y),o=[...o,...wc(f,y,n,r)],o.push(ue.move(t,y,p)),p=f}break}}l.length!==a.length&&nt("error while sync");for(let d=l.length-1;d>=0;d--){const m=l[d];u.has(m)||(o=[...o,...wc(a[d],m,n,r)])}return o}function Sc(e){return e.type===$.ELEMENT&&vc(e.tag)}function wc(e,t,n=!1,r=mc()){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(Sc(e)&&e.tag===t.tag){if(fr(e,!1,r)===fr(t,!1,r))return[ue.update(e,t,n),...Ec(e,t,!0,r)]}else if((e.type===$.ELEMENT||e.type===$.ROOT)&&e.tag===t.tag)return[ue.update(e,t,n),...b0(e,t),...Ec(e,t,n,r)];if(e.type===$.HTML||e.type===$.COMMENT)return e.content===t.content?[ue.update(e,t,n)]:[ue.update(e,t,n),ue.set(t,t.content)]}return!e.parent||!t.parent?nt("cannot replace document",[]):Sc(e)&&e.tag===t.tag?ue.recreate(e,t.parent,t,Zn(t)||void 0):[ue.remove(e),ue.add(t.parent,t,Zn(t)||void 0)]}var Qr="FROM_DOM",Jr="FROM_REMOTE",w0=/<\/.*>/gi,C0=class extends Ee{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_createRoot",void 0),L(this,"_beforeTextChangeEmitter",this.addDisposable(new Me)),L(this,"_onTextChangeEmitter",this.addDisposable(new Me)),L(this,"_onMutateEmitter",this.addDisposable(new Me)),L(this,"_beforeRefreshEmitter",this.addDisposable(new Me)),L(this,"_onRefreshEmitter",this.addDisposable(new Me)),L(this,"_root",new wt(0,0,[])),L(this,"_applyingMutation",void 0),L(this,"beforeTextChange",this._beforeTextChangeEmitter.event),L(this,"beforeRefresh",this._beforeRefreshEmitter.event),L(this,"onTextChange",this._onTextChangeEmitter.event),L(this,"onRefresh",this._onRefreshEmitter.event),L(this,"onMutate",this._onMutateEmitter.event),this._baseDocument=e,this._createRoot=t,this._baseDocument.onChanged(this._onTextChange.bind(this));const n=this._root=new wt(0,0,[]);n.type=$.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){const n=this._root;this._beforeRefreshEmitter.fire();let{roots:r}=Xr(e),o=this._root=this._createRoot?this._createRoot(r,e):new wt(0,e.length,r);o.type=$.ROOT,this._createRoot||r.forEach(i=>i.parent=o),t||this._onRefreshEmitter.fire(n?Ec(n,o):y0(o))}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=s0(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),Ws("text",()=>this.replaceWithHtml(n,Jr))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&Zn(t)===n)return t;this.remove(t,r)}const o=this.contains(e),i=fc(t),s=e.children,a=n?s.indexOf(n):s.length;if(a<0)return nt("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,pr(t,l-t.start,i.length),o&&(r!=="FROM_DOM"&&this._onMutateEmitter.fire([ue.add(e,t,n||void 0)]),r!=="FROM_REMOTE"&&this._baseDocument.applyEdits(r,[{text:i,range:{start:l,end:l}}])),t}getContext(e){return e.closest(t=>vc(t.tag))}replaceWithHtml(e,t){const n=this._baseDocument,r=c=>{const u=this.getContext(c);if(u)return u.isDirty=!0,Promise.resolve().then(()=>{u.isDirty=!1}),!1;if(c.type!==$.HTML){if(!c.closed)return!1}else return!c.content||!w0.test(c.content);return!0};if(!this._root)return this.initialize(n.getText());let o={start:e.oldPosition,end:e.oldEnd},i=Gw(o,this._root);if(!i)return this.initialize(n.getText());let s,a,l;do{const c=n0(e,i);s=this._baseDocument.getText(c),[a,...l]=Xr(s).roots}while((!a||l.length||!r(i)||!r(a)||a.end-a.start!==s.length)&&(i=i.parent));if(!i||!i.parent)return this.initialize(n.getText());this.replaceChild(i.parent,{node:a,text:s},i,t)}replaceChild(e,t,n,r){const{text:o,node:i}=t,s=e.children,a=s.indexOf(n);if(a<0)return nt("referenced node is not a child of parent node",i);s.splice(a,1,i);const l=o.length-(n.end-n.start);return i.parent=e,pr(i,n.start-i.start,l),this._baseDocument.getText(i)!==o?(nt("Error while sync"),i):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(wc(n,i)),n.parent=void 0,i)}remove(e,t){const n=this.contains(e),r=e.parent;if(!r)return nt("node is not in tree");const o=r.children,i=o.indexOf(e);if(i<0)return nt("referenced node is not a child of parent node");const s=e.end-e.start;pr(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([v0(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=_f(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=Xw(e),c=s.length-a,u=e.start;pr(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=fc(e,o),l=a.length-s;pr(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=Zn(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=Xr(t).roots;i.length!==1&&nt("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)switch(this._applyingMutation=t,t.type){case"Add":this.insertBefore(t.parent||this.root,t.node,t.nextSibling||null,Qr);break;case"Remove":this.remove(t.node,Qr);break;case"Set":this.setContent(t.node,t.data,Qr);break;case"Hidden":this.setHidden(t.node,t.value,Qr);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,Qr)}}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function Cc(e){if(e){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",e),t.firstChild||document.createTextNode("")}else return document.createTextNode("")}var eo,br;function A0(e){const t=eo;return eo=e,()=>{eo===e&&(eo=t)}}function T0(e){const t=br;return br=e,()=>{br===e&&(br=t)}}function Kf(e,t,n){return eo?eo(e,t,n):n}function _0(){return br!==void 0}function Zf(e,t,n){return br?br(e,t,n):n}var Ac;function k0(){return Ac||(Ac=document.implementation.createHTMLDocument("")),Ac}function L0(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 N0=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),x0=new Set(["script","style","xmp"]);function M0(e,t){return!(t&&x0.has(t.toLowerCase())||N0.has(e.toLowerCase()))}var R0=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},O0=new Set(["head","body"]);function Qf(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=k0(),s=O0.has(r)?L0(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 Hn(e,t,n){try{M0(t,e.tagName)&&!R0(n)?e.setAttribute(t,n):Qf(e,t,n)}catch{Qf(e,t,n)}}function Vs(e,t=!0){const n=e.content;switch(e.type){case $.ROOT:{const r=document.implementation.createHTMLDocument();for(const o of[...r.childNodes])r.removeChild(o);if(t)for(const o of e.children)r.appendChild(Vs(o));return r}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(n||"");case $.ELEMENT:if(e.tag){const r=document.createElement(e.tag);if(Object.defineProperty(r,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const o of e.attributeNames){const i=e.attributes[o];try{const s=Kf(r,o,typeof i=="string"?i:"");s!==null&&Hn(r,o,s)}catch{}}if(t)for(const o of e.children)r.appendChild(Vs(o));return r}return document.createTextNode("<");case $.HTML:return Cc(n||"");default:throw new Error("unsupported node")}}function Te(e){return Xr(e).roots.map(t=>Vs(t))}function Qn(e,t){e.replaceChildren(...Te(t))}function qe(e,t,n){const r=Te(n);switch(t){case"afterend":e.after(...r);break;case"afterbegin":e.prepend(...r);break;case"beforeend":e.append(...r);break;case"beforebegin":e.before(...r)}}var P0=4,I0=3,D0=80,Jf={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},B0={[$.HTML]:"text",[$.ELEMENT]:"element",[$.ROOT]:"root",[$.COMMENT]:"comment",[$.DOCTYPE]:"doctype",[$.ADVANCED]:"advanced"},H0=new Set(["head","body"]);function Tc(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function ep(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,I0);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,D0)}function F0(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return ep(e.tag,Tc(t.id),Tc(t.class),Tc(t.em))}function tp(e){return e instanceof Element?ep(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function _c(e,t,n){const r=[];let o=e;for(;o&&r.length<P0;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function $0(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&H0.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==$.ROOT?"outside":t??"top"}function kc(e,t,n){const r=t(e);return{path:_c(e,o=>o.parent,F0),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:_c(r,o=>o.parentNode,tp)}:{},inMap:!!r,hasParent:!!e.parent,kind:B0[e.type]??String(e.type),root:$0(e)}}function np(e,t,n){if(!e)return;const r=i=>kc(i,t,n);if(e.type==="Update")return{type:Jf.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:Jf[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 Lc(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===$.ROOT}function W0(e,t,n,r){const o=s=>kc(s,a=>r.getByNode(a),Lc),i=_c(e,s=>s.parentNode,tp);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function q0(e,t){const n=r=>kc(r,o=>t.getByNode(o),Lc);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function z0(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function rp(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var op=Object.create(null);function ip(e,t){const n=op[e]||(op[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[z0(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function vn(e){return e.nodeType===Node.ELEMENT_NODE}function sp(e){return vn(e)?e.tagName==="AMP-IMG"?!0:ip(e.tagName.toLowerCase(),"src"):!1}function Nc(e){return vn(e)&&!e.ownerSVGElement}function V0(e){return e.tagName==="IMG"}function U0(e){return e.tagName==="FORM"}function j0(e){return e.tagName==="SCRIPT"}function G0(e){return e.tagName==="STYLE"}function xc(e){return e.nodeType===Node.DOCUMENT_NODE}function ap(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var oi;(function(e){function t(m){return m.constructor.name==="CSSStyleRule"}e.isStyleRule=t;function n(m){return m.constructor.name==="CSSImportRule"}e.isImportRule=n;function r(m){return m.constructor.name==="CSSMediaRule"}e.isMediaRule=r;function o(m){return m.constructor.name==="CSSFontFaceRule"}e.isFontFaceRule=o;function i(m){return m.constructor.name==="CSSPageRule"}e.isPageRule=i;function s(m){return m.constructor.name==="CSSKeyframesRule"}e.isKeyframesRule=s;function a(m){return m.constructor.name==="CSSKeyframeRule"}e.isKeyframeRuleRule=a;function l(m){return m.constructor.name==="CSSNamespaceRule"}e.isNamespaceRule=l;function c(m){return m.constructor.name==="CSSCounterStyleRule"}e.isCounterStyleRule=c;function u(m){return m.constructor.name==="CSSSupportsRule"}e.isSupportsRule=u;function d(m){return m.constructor.name==="CSSFontFeatureValuesRule"}e.isFontFeatureValuesRuleRule=d})(oi||(oi={}));function Us(e){return e.nodeType===Node.COMMENT_NODE}function ii(e){return e.nodeType===Node.TEXT_NODE}function X0(e){return e.tagName==="TABLE"}async function Y0(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 Vt(e){if(vn(e))return lp(e);if(xc(e))return[...e.childNodes].map(n=>Vt(n)).join("");if(ap(e))return rp(e);const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function K0(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"&&!ip(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function Ct(e){let t="";for(const n of e.childNodes)t+=Vt(n);return t}function lp(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=K0(e);return uc.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:G0(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${Ct(e)}</${t}>`}function Z0(e){return typeof e=="string"?e:""}function cp(e,t,n){if(n&&e.type===$.DOCTYPE&&n?.type!==$.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=Vs(e,!1);t.set(e,r);for(const o of e.children){const i=cp(o,t,e);r.appendChild(i)}return r}function Q0(e,t,n=Lc){let r,o;const i=new Map,s=()=>{const l=np(r,c=>t.getByNode(c)||i.get(c),n);return l&&{...l,stage:"dom",...o?{cause:o}:{}}},a=l=>{o=l;try{nt("Element node not in tree")}finally{o=void 0}};return Df(s,()=>J0(e,t,i,l=>r=l,a))}function J0(e,t,n,r,o){const i=[],s=new Map,a=c=>t.getByNode(c)||n.get(c),l=c=>{if(c){const u=c.lastChild;let d=(u?a(u)?.nextSibling:a(c)?.firstChild)||void 0;for(;d&&s.has(d);)d=d.nextSibling||void 0;return d?.parentNode===a(c)?d:void 0}};for(const c of e)switch(r(c),c.type){case"Add":{let{node:u,nextSibling:d}=c;const m=u.parent;if(m){const p=cp(u,n,m);if(m.type===$.ROOT)i.push(ue.add(null,p,d&&a(d)));else{const f=a(m);if(f){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let v=t.getByNode(d);if(v&&!s.has(v)&&f.contains(v)){for(h=v;v.parentNode!==f&&v.parentNode;)v=v.parentNode,vn(v)&&v.replaceWith(...v.childNodes);break}d=Zn(d)||void 0}h||(h=l(m)),i.push(ue.add(f,p,h))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:u,nextSibling:d}=c;const m=u.parent,p=a(u);if(m&&p)if(m.type===$.ROOT)i.push(ue.move(null,p,d&&a(d)));else{const f=a(m);if(f){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let v=t.getByNode(d);if(v&&!s.has(v)&&f.contains(v)){for(;v.parentNode!==f&&v.parentNode;)v=v.parentNode;v||nt("error while calculating next sibling"),h=v;break}d=Zn(d)||void 0}h||(h=l(m)),i.push(ue.move(f,p,h))}else o("parent-not-mapped")}else o(m?"node-not-mapped":"no-parent");break}case"Remove":{const u=c.node,d=a(u);if(u.type===$.HTML&&!u.content)continue;d?(s.set(d,u),i.push(ue.remove(d))):o("node-not-mapped");break}case"Update":{const u=c.prev,d=a(u);d?n.set(c.next,d):c.soft||o("node-not-mapped");break}case"Attribute":{const u=a(c.node);u?i.push(ue.attribute(u,c.name,c.value)):o("node-not-mapped");break}case"Set":{const u=c.node,d=a(u);d?ii(d)&&u.type===$.HTML||Us(d)&&u.type===$.HTML||ap(d)&&u.type===$.DOCTYPE?i.push(ue.set(d,c.data||"")):e.push(ue.remove(u),ue.add(u.parent||null,u,Zn(u)||void 0)):o("node-not-mapped");break}}return{mutations:i,toAdd:n,toRemove:s}}function eC({mutations:e,toAdd:t,toRemove:n},r){const o=(i,s,a)=>{if(!i)return nt("Element node not in tree");if(!(i instanceof Element))return nt("node is not HTMLEement");const l=a===void 0?void 0:Kf(i,s,Z0(a));try{l!=null?Hn(i,s,l):i.removeAttribute(s)}catch{}};for(const i of e)switch(i.type){case"Add":{const{node:s,nextSibling:a,parent:l}=i;l?.insertBefore(s,a?.parentNode===l&&a||null);break}case"Move":{const{node:s,nextSibling:a,parent:l}=i;l?.insertBefore(s,a?.parentNode===l&&a||null);break}case"Remove":{const{node:s}=i;if(s instanceof Element)s.remove();else if(s instanceof Document)for(const a of[...s.childNodes])a.parentNode?.removeChild(a);else s.parentNode?.removeChild(s);break}case"Attribute":o(i.node,i.name,i.value);break;case"Set":{const{node:s,data:a}=i;s instanceof Comment?s.data=a:s instanceof Text&&(s.textContent=Cc(a).textContent);break}}for(const[i,s]of n)r.remove(s);for(const[i,s]of t){const a=r.getByElement(s);a&&r.remove(a),r.set(i,s)}}var tC=class{constructor(){L(this,"_byKey",new WeakMap),L(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))}},nC=class{constructor(){L(this,"_map",new tC)}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 up(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function rC(e){let t;for(let n=e;n;n=n.parent)Sc(n)&&(t=n);return t}function oC(e){return e.type==="Update"?e.prev:e.node}function iC(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=rC(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=oC(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(up(i,l)||up(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...ue.recreate(c,l.parent,l,Zn(l)||void 0));break}}a||r.push(o)}return r}var Mc;(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})(Mc||(Mc={}));var js=new Set;function Gs(e,t){js.has(e)||(js.size||Promise.resolve().then(()=>js.clear()),js.add(e),Z.send(Pe.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var dp=new WeakMap;function sC(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 aC(e,t){let n=dp.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=sC(o),n={added:o,removed:i},dp.set(e,n)}return n}var lC=new Set(["text/x-handlebars-template","text/html"]);function mp(e){return e.replace(/<(?=[A-Za-z!/?])/g,"&lt;")}function fp(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!lC.has(e.getAttribute("type")??"")}var pp=Object.getPrototypeOf(customElements),cC=Reflect.get(pp,"define"),Rc=new Me,Oc=new Me,uC=Rc.event,dC=Oc.event,mC=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function fC(e){Rc.fire();try{return e()}finally{Oc.fire()}}pp.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){Rc.fire();try{super(...i)}finally{Oc.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of mC){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return fC(()=>s.call(this,...a))}})}cC.call(this,e,o,n)};function hp(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,hp(s,t,n,i));return i}function to(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])to(r,t,e)}var Fn="___em-internal";function Pc(e,t=!0,n=!1){let r=e.content;switch(e.type){case $.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(Pc(i,t,n));return o}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(r||"");case $.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=dc(e),i.firstChild}const o=document.createElement(e.tag);if(e.attributes)for(const i of e.attributeNames){const s=e.attributes[i];try{Hn(o,i,typeof s=="string"?s:"")}catch{}}if(t)for(const i of e.children)o.appendChild(Pc(i,t,n));return o}return document.createTextNode("<");case $.HTML:return Cc(r||"");default:throw new Error("unsupported node")}}function pC(e){return Xr(e).roots.map(t=>Pc(t,!0,!0))}function gp(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function hC(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 gp();default:t=document.createElement("div")}return t}function gC(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function Xs(e){if(e instanceof Element)return lp(e);if(e instanceof Document)return[...e.childNodes].map(n=>Xs(n)).join("");if(e instanceof DocumentType)return gC(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(n=>Xs(n)).join("");const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function bp(e,t=e.parentNode){return fp(t)?mp(e.textContent??""):Xs(e)}function bC(e,t,n){let r=1;const o=new Uf,i=new Map,s=new Map,a=new Map;let l=!1;const c=hp(e,p=>{const f=String(r++);let h;if(sp(p)||p instanceof Element&&p.hasAttribute("src")){const y=document.createElement(p.tagName);for(const{name:v,value:A}of p.attributes){const k=Zf(p,v,A);k!==null&&Hn(y,v==="src"?"___src":v,k)}h=y}else h=p.cloneNode(),LC(p,h);if(h)h instanceof DocumentType&&(l=!0),a.set(h,f),i.set(p,f);else return document.createDocumentFragment();return h},(p,f)=>p&&f&&p.appendChild(f));let u=l?gp():document.createDocumentFragment();u.appendChild(c),to(u,(p,f)=>{if(f){const h=a.get(p);if(f instanceof HTMLScriptElement||f instanceof HTMLStyleElement)return;if(!h)return nt("Error while mapping: not found element");p instanceof Element?p.setAttribute(Fn,h):f.insertBefore(document.createComment(`${Fn}${h}`),p)}});let d=pC(t(u)).filter(p=>!!p),m;if(!d.length)return o;if(u instanceof Document){const p=hC("html");for(const f of d)p.appendChild(f);m=p}else{m=document.createDocumentFragment();for(const p of d)m.appendChild(p)}return to(m,(p,f)=>{let h=null;if(p instanceof HTMLHtmlElement)s.set("1",p);else{if(p instanceof Element&&p.hasAttribute(Fn)){h=p.getAttribute(Fn),h&&s.set(h,p);return}const y=p.previousSibling;if(y instanceof Comment&&(!(p instanceof Comment)||p.data.indexOf(Fn)<0)){const v=y.data,A=v.indexOf(Fn);A>=0&&(h=v.substring(A+14),h&&s.set(h,p))}}}),to(m,p=>{if(p instanceof Element&&p.hasAttribute(Fn)){p.removeAttribute(Fn);return}p instanceof Comment&&p.data.indexOf(Fn)>=0&&p.remove()}),to(e,p=>{const f=i.get(p),h=s.get(f);h&&(o.set(p,h),(p instanceof HTMLScriptElement||p instanceof HTMLStyleElement)&&p.firstChild&&h.firstChild&&o.set(p.firstChild,h.firstChild))}),o}function yC(e){const t=yp(e.cloneNode()),n=pc(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=$.ELEMENT,t}var no;(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})({})})(no||(no={}));function yp(e){if(ii(e)&&fp(e.parentNode))return vC(e.data);let t=Xr(Xs(e.cloneNode())).roots[0];return t||(t=new wt(0,0,[]),t.type=$.HTML,t.content=""),t}function vC(e){const t=mp(e),n=new wt(0,t.length,[]);return n.type=$.HTML,n.content=t,n}function vp(e,t=no.HiddenResult.node){if(t&no.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&no.HiddenResult.children)for(const n of e.children)vp(n,no.HiddenResult.all)}function EC(e,t=[],n){let r;return e instanceof Element?r=yC(e):r=yp(e),r.children=t,r.parent=void 0,n&&vp(r,n(r)),r}function Ic(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=Ic(o,t,n),r)return r}function Ep(e,t,n,r){Gs("tree-node-out-of-place",()=>({mutation:n()}))}function SC(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(Ep("insertBefore",c,()=>W0(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=Ic(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=Ic(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function wC(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(ue.attribute(a,o,typeof l=="string"?l:void 0))}}}return n}function CC(e,t){const n=[],r=e.characterDataChanged;if(r)for(const o of r){const i=t.getByElement(o);i&&n.push(ue.set(i,Us(o)?o.data:bp(o)))}return n}function AC(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function TC(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 _C(e,t,n){const r=[],o=new Set,i=new Map,s=(a,l)=>{const c=i.get(a);return c?c===l:a.parent===l&&l.children.includes(a)};for(const a of e){const{added:l,removed:c}=aC(a,u=>!!t.getByElement(u));for(const u of c)if(!o.has(u)){const d=t.getByElement(u);if(d){const m=i.get(d)??d.parent;!m||!s(d,m)?Ep("remove",d,()=>q0(d,t)):r.push(ue.remove(d)),i.delete(d),o.add(u)}}for(const u of l){if(TC(u))continue;const d=AC(u);if(d&&!t.getByElement(d))continue;const{parentTreeNode:m,nextSiblingTreeNode:p}=SC(u,t,n,f=>o.has(f),s)||{};if(m){let f=t.getByElement(u);f||(f=EC(u),t.set(f,u)),r.push(ue.add(m,f,p)),i.set(f,m),o.delete(u)}}r.push(...wC(a,t)),r.push(...CC(a,t))}return r}function kC(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(ue.attribute(e,a,c))}else r.push(ue.attribute(e,a,void 0))}for(const s of i){const a=s.name==="___src"?"src":s.name;o.getNamedItem(a)||r.push(ue.attribute(e,a,s.value))}return r}function LC(e,t){if(!(!_0()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=Zf(e,n,r);o===null?t.removeAttribute(n):o!==r&&Hn(t,n,o)}}function NC(e,t,n){const r=[],o=bC(e,n,t);return to(e,i=>{const s=t.getByElement(i);if(!s)return;const a=o.getByKey(i);if(a){if(a instanceof Element){if(!(i instanceof Element))return nt("CharacterData mapped to Element");r.push(...kC(s,i,a))}else if(a instanceof CharacterData){if(!(i instanceof CharacterData))return nt("Element mapped to CharacterData");a.data!==i.data&&r.push(ue.set(s,Us(a)?a.data:bp(a,i.parentNode)))}else if(a instanceof Document&&!(i instanceof Document))return nt("Node mapped to Document")}else{const l=u=>{for(const d of u.childNodes)if(o.getByKey(d)||!l(d))return!1;return!0};let c;return l(i)?(r.push(ue.hidden(s,!0)),c=!1):r.push(ue.hidden(s,!1)),c}}),r}function xC(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 MC(e){return[...new Set(e)]}function RC(e,t){return MC([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>xC(n,t)||n))}function OC(e,t){let n=[];for(const r of e){const o=RC(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 PC(e,t,n){return OC(e,t).flatMap(r=>NC(r,t,n))}function IC(e,t,n,r){return[..._C(e,t,r),...PC(e,t,n)]}function DC(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 BC=class{constructor(){L(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))}},Sp=class{constructor(e=10){L(this,"_max",void 0),L(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}},wp=new Sp(1e3);function ro(e){if(e=e?.trim(),e){let t=wp.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),wp.put(e,t)),t}else return new Set}function Ys(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var Cp=new Sp(1e3);function si(e){e||(e="");let t=Cp.get(e);return t||(t=Ys(e),Cp.put(e,t)),t}function HC(e,t,n){const r=e?e.split(" "):[],o=ro(n),i=ro(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function FC(e,t,n){const r=Ys(e),o=si(n),i=si(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 Ap(e,t,n,r){return typeof r!="string"?t:e==="class"?HC(t,n,r)||null:e==="style"?FC(t,n,r)||null:n!==t&&t===r?null:t}function $C(e,t){const n=ro(e),r=ro(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function WC(e,t){const n=Ys(e),r=si(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 qC(e,t,n){return typeof n!="string"?t:e==="class"?$C(t,n)||null:e==="style"?WC(t,n)||null:t}function zC(e,t,n){if(!t)return t;const r=ro(e),o=ro(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 VC(e,t,n){if(!t)return t;const r=si(e),o=Ys(t),i=si(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 Tp(e){return e.type===$.ELEMENT&&e.start!==e.end}function _p(e){return e.filter(t=>t.type===$.ELEMENT)}function UC(e,t,n){const r=_p(e),o=_p(t),i=[],s=new Set,a=new Set,l=u=>{const d=(p,f)=>{const h=new Map;for(const y of p){const v=f.has(y)?void 0:u(y);v!==void 0&&h.set(v,h.has(v)?null:y)}return h},m=d(r,s);for(const[p,f]of d(o,a)){const h=m.get(p);f&&h&&(i.push([h,f,!0]),s.add(h),a.add(f))}};l(u=>typeof u.attributes?.id=="string"?`${u.tag}#${u.attributes.id}`:void 0),l(u=>fr(u,!1,n)),l(u=>fr(u,!0,n));const c=new Set(o.map(u=>u.tag));for(const u of c){const d=f=>f.filter(h=>h.tag===u),m=d(r).filter(f=>!s.has(f)),p=d(o).filter(f=>!a.has(f));if(m.length===p.length&&d(r).length===d(o).length){const f=m.length===1&&!m[0].attributes?.id&&!p[0].attributes?.id;p.forEach((h,y)=>i.push([m[y],h,f]))}}return i}var jC=class{constructor(e,t,n,r){L(this,"element",void 0),L(this,"name",void 0),L(this,"nextValue",void 0),L(this,"prevValue",void 0),this.element=e,this.name=t,this.nextValue=n,this.prevValue=r}},GC=class{constructor(e){L(this,"_nodeMap",void 0),L(this,"_map",new BC),L(this,"_hiddenMutations",[]),L(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=zC(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=VC(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 jC(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=Ap(r,i,o.attributes?.[r]||null,this._map.getAttribute(o,r));if(s!==i){t.push(ue.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=Ap(i,s,null,a);l!==s&&t.push(ue.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=qC(r,i,this._map.getAttribute(o,r));if(s!==i){t.push(ue.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,mc());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&&!vc(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))g0(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&&fr(e,!1,r)===fr(t,!1,r)){const i=t.children.filter(Tp);e.children.filter(Tp).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of UC(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)}}}},XC=class{constructor(e){L(this,"_isMapped",void 0),L(this,"_foreign",new WeakSet),L(this,"_movedTo",new WeakMap),L(this,"_removed",new WeakSet),L(this,"_hasForeign",!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);for(const n of t.removed)this._foreign.has(n)||this._removed.add(n)}}markForeign(e){this._hasForeign=!0,this._foreign.add(e)}isMarked(e){return this._foreign.has(e)}isForeign(e){if(!this._hasForeign)return!1;for(let t=e;t;t=t.parentNode){if(this._isMapped(t))return!1;if(this._foreign.has(t))return!0}return!1}isPlacedInForeign(e){return this._hasForeign&&this.isForeign(this._isMapped(e)?e.parentNode:e)}movedTo(e){return this._movedTo.get(e)}wasRemoved(e){return this._removed.has(e)}forget(e){this._movedTo.delete(e),this._removed.delete(e)}},kp="foreign-structure-in-commit";function YC(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 Ks(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var Lp="implicit-tbody-in-canvas";function KC(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 ZC(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:Ks(n),parent:n.parentNode?Ks(n.parentNode):void 0};t.add(Lp),Gs(Lp,()=>({foreign:r}))}function QC(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:Ks(n.node),parent:n.node.parentNode?Ks(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add(kp),Gs(kp,()=>({foreign:o})))}var JC=Yn(((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 S(){this._nodes=[],this._values=[]}return S._isIndex=function(b){return+b===b>>>0},S._nodeId=function(b){var E=b[S._ID_PROP];return E||(E=b[S._ID_PROP]=S._NEXT_ID++),E},S.prototype.set=function(b,E){var C=S._nodeId(b);this._nodes[C]=b,this._values[C]=E},S.prototype.get=function(b){var E=S._nodeId(b);return E!==void 0?this._values[E]:void 0},S.prototype.has=function(b){return S._nodeId(b)in this._nodes},S.prototype.delete=function(b){var E=S._nodeId(b);delete this._nodes[E],this._values[E]=void 0},S.prototype.keys=function(){var b=[];for(var E in this._nodes)S._isIndex(E)&&b.push(this._nodes[E]);return b},S._ID_PROP="__mutation_summary_node_map_id__",S._NEXT_ID=1,S})(),o=(function(){function S(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return S})();n.Movement=void 0,(function(S){S[S.STAYED_OUT=0]="STAYED_OUT",S[S.ENTERED=1]="ENTERED",S[S.STAYED_IN=2]="STAYED_IN",S[S.REPARENTED=3]="REPARENTED",S[S.REORDERED=4]="REORDERED",S[S.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(S,b){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,C){E.__proto__=C}||function(E,C){for(var g in C)Object.prototype.hasOwnProperty.call(C,g)&&(E[g]=C[g])},i(S,b)};function s(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");i(S,b);function E(){this.constructor=S}S.prototype=b===null?Object.create(b):(E.prototype=b.prototype,new E)}var a=(function(){function S(b,E,C,g,w,T,_,M){E===void 0&&(E=!1),C===void 0&&(C=!1),g===void 0&&(g=!1),w===void 0&&(w=null),T===void 0&&(T=!1),_===void 0&&(_=null),M===void 0&&(M=null),this.node=b,this.childList=E,this.attributes=C,this.characterData=g,this.oldParentNode=w,this.added=T,this.attributeOldValues=_,this.characterDataOldValue=M,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return S.prototype.getAttributeOldValue=function(b){if(this.attributeOldValues)return this.isCaseInsensitive&&(b=b.toLowerCase()),this.attributeOldValues[b]},S.prototype.getAttributeNamesMutated=function(){var b=[];if(!this.attributeOldValues)return b;for(var E in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(E)&&b.push(E);return b},S.prototype.attributeMutated=function(b,E){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(b in this.attributeOldValues)&&(this.attributeOldValues[b]=E)},S.prototype.characterDataMutated=function(b){this.characterData||(this.characterData=!0,this.characterDataOldValue=b)},S.prototype.removedFromParent=function(b){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=b},S.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},S.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},S})(),l=(function(S){s(b,S);function b(E,C){var g=S.call(this)||this;g.rootNode=E,g.reachableCache=void 0,g.wasReachableCache=void 0,g.anyParentsChanged=!1,g.anyAttributesChanged=!1,g.anyCharacterDataChanged=!1;for(var w=0;w<C.length;w++){var T=C[w];switch(T.type){case"childList":g.anyParentsChanged=!0;for(var _=0;_<T.removedNodes.length;_++){var M=T.removedNodes[_];g.getChange(M).removedFromParent(T.target)}for(var _=0;_<T.addedNodes.length;_++){var M=T.addedNodes[_];g.getChange(M).insertedIntoParent()}break;case"attributes":g.anyAttributesChanged=!0;var N=g.getChange(T.target);N.attributeMutated(T.attributeName,T.oldValue);break;case"characterData":g.anyCharacterDataChanged=!0;var N=g.getChange(T.target);N.characterDataMutated(T.oldValue)}}return g}return b.prototype.getChange=function(E){var C=this.get(E);return C||(C=new a(E),this.set(E,C)),C},b.prototype.getOldParent=function(E){var C=this.get(E);return C?C.getOldParent():E.parentNode},b.prototype.getIsReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.reachableCache=this.reachableCache||new r;var C=this.reachableCache.get(E);return C===void 0&&(C=this.getIsReachable(E.parentNode),this.reachableCache.set(E,C)),C},b.prototype.getWasReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.wasReachableCache=this.wasReachableCache||new r;var C=this.wasReachableCache.get(E);return C===void 0&&(C=this.getWasReachable(this.getOldParent(E)),this.wasReachableCache.set(E,C)),C},b.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},b})(r),c=(function(){function S(b,E,C,g,w){this.rootNode=b,this.mutations=E,this.selectors=C,this.calcReordered=g,this.calcOldPreviousSibling=w,this.treeChanges=new l(b,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 S.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var b=this.treeChanges.keys(),E=0;E<b.length;E++)this.visitNode(b[E],void 0)},S.prototype.visitNode=function(b,E){if(!this.visited.has(b)){this.visited.set(b,!0);var C=this.treeChanges.get(b),g=E;if((C&&C.childList||g==null)&&(g=this.treeChanges.reachabilityChange(b)),g!==n.Movement.STAYED_OUT){if(this.matchabilityChange(b),g===n.Movement.ENTERED)this.entered.push(b);else if(g===n.Movement.EXITED)this.exited.push(b),this.ensureHasOldPreviousSiblingIfNeeded(b);else if(g===n.Movement.STAYED_IN){var w=n.Movement.STAYED_IN;C&&C.childList&&(C.oldParentNode!==b.parentNode?(w=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(b)):this.calcReordered&&this.wasReordered(b)&&(w=n.Movement.REORDERED)),this.stayedIn.set(b,w)}if(g!==n.Movement.STAYED_IN)for(var T=b.firstChild;T;T=T.nextSibling)this.visitNode(T,g)}}},S.prototype.ensureHasOldPreviousSiblingIfNeeded=function(b){if(this.calcOldPreviousSibling){this.processChildlistChanges();var E=b.parentNode,C=this.treeChanges.get(b);C&&C.oldParentNode&&(E=C.oldParentNode);var g=this.childListChangeMap.get(E);g||(g=new o,this.childListChangeMap.set(E,g)),g.oldPrevious.has(b)||g.oldPrevious.set(b,b.previousSibling)}},S.prototype.getChanged=function(b,E,C){this.selectors=E,this.characterDataOnly=C;for(var g=0;g<this.entered.length;g++){var w=this.entered[g],T=this.matchabilityChange(w);(T===n.Movement.ENTERED||T===n.Movement.STAYED_IN)&&b.added.push(w)}for(var _=this.stayedIn.keys(),g=0;g<_.length;g++){var w=_[g],T=this.matchabilityChange(w);if(T===n.Movement.ENTERED)b.added.push(w);else if(T===n.Movement.EXITED)b.removed.push(w);else if(T===n.Movement.STAYED_IN&&(b.reparented||b.reordered)){var M=this.stayedIn.get(w);b.reparented&&M===n.Movement.REPARENTED?b.reparented.push(w):b.reordered&&M===n.Movement.REORDERED&&b.reordered.push(w)}}for(var g=0;g<this.exited.length;g++){var w=this.exited[g],T=this.matchabilityChange(w);(T===n.Movement.EXITED||T===n.Movement.STAYED_IN)&&b.removed.push(w)}},S.prototype.getOldParentNode=function(b){var E=this.treeChanges.get(b);if(E&&E.childList)return E.oldParentNode?E.oldParentNode:null;var C=this.treeChanges.reachabilityChange(b);if(C===n.Movement.STAYED_OUT||C===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return b.parentNode},S.prototype.getOldPreviousSibling=function(b){var E=b.parentNode,C=this.treeChanges.get(b);C&&C.oldParentNode&&(E=C.oldParentNode);var g=this.childListChangeMap.get(E);if(!g)throw Error("getOldPreviousSibling requested on invalid node.");return g.oldPrevious.get(b)},S.prototype.getOldAttribute=function(b,E){var C=this.treeChanges.get(b);if(!C||!C.attributes)throw Error("getOldAttribute requested on invalid node.");var g=C.getAttributeOldValue(E);if(g===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return g},S.prototype.attributeChangedNodes=function(b){if(!this.treeChanges.anyAttributesChanged)return{};var E,C;if(b){E={},C={};for(var g=0;g<b.length;g++){var w=b[g];E[w]=!0,C[w.toLowerCase()]=w}}for(var T={},_=this.treeChanges.keys(),g=0;g<_.length;g++){var M=_[g],N=this.treeChanges.get(M);if(N.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(M)||n.Movement.STAYED_IN!==this.matchabilityChange(M)))for(var W=M,P=N.getAttributeNamesMutated(),R=0;R<P.length;R++){var w=P[R];E&&!E[w]&&!(N.isCaseInsensitive&&C[w])||N.getAttributeOldValue(w)!==W.getAttribute(w)&&(C&&N.isCaseInsensitive&&(w=C[w]),T[w]=T[w]||[],T[w].push(W))}}return T},S.prototype.getOldCharacterData=function(b){var E=this.treeChanges.get(b);if(!E||!E.characterData)throw Error("getOldCharacterData requested on invalid node.");return E.characterDataOldValue},S.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var b=this.treeChanges.keys(),E=[],C=0;C<b.length;C++){var g=b[C];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(g)){var w=this.treeChanges.get(g);!w.characterData||g.textContent==w.characterDataOldValue||E.push(g)}}return E},S.prototype.computeMatchabilityChange=function(b,E){this.matchCache||(this.matchCache=[]),this.matchCache[b.uid]||(this.matchCache[b.uid]=new r);var C=this.matchCache[b.uid],g=C.get(E);return g===void 0&&(g=b.matchabilityChange(E,this.treeChanges.get(E)),C.set(E,g)),g},S.prototype.matchabilityChange=function(b){var E=this;if(this.characterDataOnly)switch(b.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(b.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var C=b,g=this.selectors.map(function(_){return E.computeMatchabilityChange(_,C)}),w=n.Movement.STAYED_OUT,T=0;w!==n.Movement.STAYED_IN&&T<g.length;){switch(g[T]){case n.Movement.STAYED_IN:w=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:w===n.Movement.EXITED?w=n.Movement.STAYED_IN:w=n.Movement.ENTERED;break;case n.Movement.EXITED:w===n.Movement.ENTERED?w=n.Movement.STAYED_IN:w=n.Movement.EXITED}T++}return w},S.prototype.getChildlistChange=function(b){var E=this.childListChangeMap.get(b);return E||(E=new o,this.childListChangeMap.set(b,E)),E},S.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var b=function(g){var w=E.mutations[g];if(w.type!="childList"||E.treeChanges.reachabilityChange(w.target)!==n.Movement.STAYED_IN&&!E.calcOldPreviousSibling)return"continue";for(var T=E.getChildlistChange(w.target),_=w.previousSibling,M=function(P,R){!P||T.oldPrevious.has(P)||T.added.has(P)||T.maybeMoved.has(P)||R&&(T.added.has(R)||T.maybeMoved.has(R))||T.oldPrevious.set(P,R)},N=0;N<w.removedNodes.length;N++){var W=w.removedNodes[N];M(W,_),T.added.has(W)?T.added.delete(W):(T.removed.set(W,!0),T.maybeMoved.delete(W)),_=W}M(w.nextSibling,_);for(var N=0;N<w.addedNodes.length;N++){var W=w.addedNodes[N];T.removed.has(W)?(T.removed.delete(W),T.maybeMoved.set(W,!0)):T.added.set(W,!0)}},E=this,C=0;C<this.mutations.length;C++)b(C)}},S.prototype.wasReordered=function(b){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var E=b.parentNode,C=this.treeChanges.get(b);C&&C.oldParentNode&&(E=C.oldParentNode);var g=this.childListChangeMap.get(E);if(!g)return!1;if(g.moved)return g.moved.get(b);g.moved=new r;var w=new r;function T(P){if(!P||!g.maybeMoved.has(P))return!1;var R=g.moved.get(P);return R!==void 0||(w.has(P)?R=!0:(w.set(P,!0),R=W(P)!==M(P)),w.has(P)?(w.delete(P),g.moved.set(P,R)):R=g.moved.get(P)),R}var _=new r;function M(P){var R=_.get(P);if(R!==void 0)return R;for(R=g.oldPrevious.get(P);R&&(g.removed.has(R)||T(R));)R=M(R);return R===void 0&&(R=P.previousSibling),_.set(P,R),R}var N=new r;function W(P){if(N.has(P))return N.get(P);for(var R=P.previousSibling;R&&(g.added.has(R)||T(R));)R=R.previousSibling;return N.set(P,R),R}return g.maybeMoved.keys().forEach(T),g.moved.get(b)},S})(),u=(function(){function S(b,E){var C=this;if(this.projection=b,this.added=[],this.removed=[],this.reparented=E.all||E.element||E.characterData?[]:void 0,this.reordered=E.all?[]:void 0,b.getChanged(this,E.elementFilter,E.characterData),E.all||E.attribute||E.attributeList){var g=E.attribute?[E.attribute]:E.attributeList,w=b.attributeChangedNodes(g);E.attribute?this.valueChanged=w[E.attribute]||[]:(this.attributeChanged=w,E.attributeList&&E.attributeList.forEach(function(_){C.attributeChanged.hasOwnProperty(_)||(C.attributeChanged[_]=[])}))}if(E.all||E.characterData){var T=b.getCharacterDataChanged();E.characterData?this.valueChanged=T:this.characterDataChanged=T}this.reordered&&(this.getOldPreviousSibling=b.getOldPreviousSibling.bind(b))}return S.prototype.getOldParentNode=function(b){return this.projection.getOldParentNode(b)},S.prototype.getOldAttribute=function(b,E){return this.projection.getOldAttribute(b,E)},S.prototype.getOldCharacterData=function(b){return this.projection.getOldCharacterData(b)},S.prototype.getOldPreviousSibling=function(b){return this.projection.getOldPreviousSibling(b)},S})(),d=(function(){function S(){}return S.prototype.matches=function(b){if(b===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==b;for(var E=b.split(" "),C=0;C<E.length;C++)if(this.attrValue===E[C])return!0;return!1},S.prototype.toString=function(){return this.attrName==="class"&&this.contains?"."+this.attrValue:this.attrName==="id"&&!this.contains?"#"+this.attrValue:this.contains?"["+this.attrName+"~="+m(this.attrValue)+"]":"attrValue"in this?"["+this.attrName+"="+m(this.attrValue)+"]":"["+this.attrName+"]"},S})();function m(S){return'"'+S.replace(/"/,'\\"')+'"'}var p=/[a-zA-Z_]+/,f=/[a-zA-Z0-9_\-]+/,h=(function(){function S(){this.uid=S.nextUid++,this.qualifiers=[]}return Object.defineProperty(S.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),S.prototype.isMatching=function(b){return b[S.matchesSelector](this.selectorString)},S.prototype.wasMatching=function(b,E,C){if(!E||!E.attributes)return C;var g=E.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(g!=="*"&&g!==b.tagName)return!1;for(var w=[],T=!1,_=0;_<this.qualifiers.length;_++){var M=this.qualifiers[_],N=E.getAttributeOldValue(M.attrName);w.push(N),T=T||N!==void 0}if(!T)return C;for(var _=0;_<this.qualifiers.length;_++){var M=this.qualifiers[_],N=w[_];if(N===void 0&&(N=b.getAttribute(M.attrName)),!M.matches(N))return!1}return!0},S.prototype.matchabilityChange=function(b,E){var C=this.isMatching(b);return C?this.wasMatching(b,E,C)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(b,E,C)?n.Movement.EXITED:n.Movement.STAYED_OUT},S.parseSelectors=function(b){var E=[],C,g;function w(){C&&(g&&(C.qualifiers.push(g),g=void 0),E.push(C)),C=new S}function T(){g&&C.qualifiers.push(g),g=new d}for(var _=/\s/,M=void 0,N="Invalid or unsupported selector syntax.",W=1,P=2,R=3,Y=4,V=5,G=6,Le=7,ae=8,ne=9,we=10,j=11,z=12,Se=13,Ae=14,Q=W,Lt=0;Lt<b.length;){var U=b[Lt++];switch(Q){case W:if(U.match(p)){w(),C.tagName=U,Q=P;break}if(U=="*"){w(),C.tagName="*",Q=R;break}if(U=="."){w(),T(),C.tagName="*",g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){w(),T(),C.tagName="*",g.attrName="id",Q=Y;break}if(U=="["){w(),T(),C.tagName="*",g.attrName="",Q=G;break}if(U.match(_))break;throw Error(N);case P:if(U.match(f)){C.tagName+=U;break}if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),g.attrName="",Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case R:if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),g.attrName="",Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case Y:if(U.match(p)){g.attrValue=U,Q=V;break}throw Error(N);case V:if(U.match(f)){g.attrValue+=U;break}if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case G:if(U.match(p)){g.attrName=U,Q=Le;break}if(U.match(_))break;throw Error(N);case Le:if(U.match(f)){g.attrName+=U;break}if(U.match(_)){Q=ae;break}if(U=="~"){g.contains=!0,Q=ne;break}if(U=="="){g.attrValue="",Q=j;break}if(U=="]"){Q=R;break}throw Error(N);case ae:if(U=="~"){g.contains=!0,Q=ne;break}if(U=="="){g.attrValue="",Q=j;break}if(U=="]"){Q=R;break}if(U.match(_))break;throw Error(N);case ne:if(U=="="){g.attrValue="",Q=j;break}throw Error(N);case we:if(U=="]"){Q=R;break}if(U.match(_))break;throw Error(N);case j:if(U.match(_))break;if(U=='"'||U=="'"){M=U,Q=Se;break}g.attrValue+=U,Q=z;break;case z:if(U.match(_)){Q=we;break}if(U=="]"){Q=R;break}if(U=="'"||U=='"')throw Error(N);g.attrValue+=U;break;case Se:if(U==M){Q=we;break}g.attrValue+=U;break;case Ae:if(U.match(_))break;if(U==","){Q=W;break}throw Error(N)}}switch(Q){case W:case P:case R:case V:case Ae:w();break;default:throw Error(N)}if(!E.length)throw Error(N);return E},S.nextUid=1,S.matchesSelector="matches",S})(),y=(function(){function S(){}return S.createObserverOptions=function(b){var E={childList:!0,subtree:!0},C;function g(w){if(!(E.attributes&&!C)){if(E.attributes=!0,E.attributeOldValue=!0,!w){C=void 0;return}C=C||{},w.forEach(function(T){C[T]=!0,C[T.toLowerCase()]=!0})}}return b.forEach(function(w){if(w.characterData){E.characterData=!0,E.characterDataOldValue=!0;return}if(w.all){g(),E.characterData=!0,E.characterDataOldValue=!0;return}if(w.attribute){g([w.attribute.trim()]);return}var T=S._elementFilterAttributes(w.elementFilter).concat(w.attributeList||[]);T.length&&g(T)}),C&&(E.attributeFilter=Object.keys(C)),E},S.validateOptions=function(b){for(var E in b)if(!(E in S._optionKeys))throw Error("Invalid option: "+E);if(typeof b.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!b.queries||!b.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var C={callback:b.callback,rootNode:b.rootNode||document,observeOwnChanges:!!b.observeOwnChanges,oldPreviousSibling:!!b.oldPreviousSibling,queries:[]},g=0;g<b.queries.length;g++){var w=b.queries[g];if(w.all){if(Object.keys(w).length>1)throw Error("Invalid request option. all has no options.");C.queries.push({all:!0});continue}if("attribute"in w){var T={attribute:S._validateAttribute(w.attribute)};if(T.elementFilter=h.parseSelectors("*["+T.attribute+"]"),Object.keys(w).length>1)throw Error("Invalid request option. attribute has no options.");C.queries.push(T);continue}if("element"in w){var _=Object.keys(w).length,T={element:w.element,elementFilter:h.parseSelectors(w.element)};if(w.hasOwnProperty("elementAttributes")&&(T.attributeList=S._validateElementAttributes(w.elementAttributes),_--),_>1)throw Error("Invalid request option. element only allows elementAttributes option.");C.queries.push(T);continue}if(w.characterData){if(Object.keys(w).length>1)throw Error("Invalid request option. characterData has no options.");C.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return C},S._validateElementAttributes=function(b){if(!b.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var E={},C={},g=b.split(/\s+/),w=0;w<g.length;w++){var T=g[w];if(T){T=S._validateAttribute(T);var _=T.toLowerCase();if(E[_])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");C[T]=!0,E[_]=!0}}return Object.keys(C)},S._elementFilterAttributes=function(b){var E={};return b.forEach(function(C){C.qualifiers.forEach(function(g){E[g.attrName]=!0})}),Object.keys(E)},S._validateAttribute=function(b){if(typeof b!="string"||(b=b.trim(),!b))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!b.match(S._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+b);return b},S._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,S._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},S})(),v=(function(){function S(b){var E=this;this._connected=!1,this._options=y.validateOptions(b),this._observerOptions=y.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(C){return C.elementFilter?C.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(C){return C.all}),this._queryValidators=[],S.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(C){return S.createQueryValidator(E._root,C)})),this._observer=new MutationObserver(function(C){E._observerCallback(C)}),this.reconnect()}return S.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},S.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var b=this._createSummaries(this._observer.takeRecords());return this._changesToReport(b)?b:void 0},S.prototype.disconnect=function(){var b=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,b},S.prototype._observerCallback=function(b){this._options.observeOwnChanges||this._observer.disconnect();var E=this._createSummaries(b);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))},S.prototype._createSummaries=function(b){if(!b||!b.length)return[];for(var E=new c(this._root,b,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),C=[],g=0;g<this._options.queries.length;g++)C.push(new u(E,this._options.queries[g]));return C},S.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(b){b&&b.recordPreviousState()})},S.prototype._runQueryValidators=function(b){this._queryValidators.forEach(function(E,C){E&&E.validate(b[C])})},S.prototype._changesToReport=function(b){return b.some(function(E){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(C){return E[C]&&E[C].length})||E.attributeChanged&&Object.keys(E.attributeChanged).some(function(C){return!!E.attributeChanged[C].length}))})},S})(),A=(function(){function S(b,E){this.root=b,this.delegate=E,this.idMap={}}return S.prototype.initialize=function(b,E){this.idMap[b]=this.root;for(var C=0;C<E.length;C++)this.deserializeNode(E[C],this.root)},S.prototype.applyChanged=function(b,E,C,g){var w=this;E.forEach(function(T){var _=w.deserializeNode(T);w.deserializeNode(T.parentNode),w.deserializeNode(T.previousSibling),_.parentNode&&_.parentNode.removeChild(_)}),b.forEach(function(T){var _=w.deserializeNode(T);_.parentNode&&_.parentNode.removeChild(_)}),E.forEach(function(T){var _=w.deserializeNode(T),M=w.deserializeNode(T.parentNode),N=w.deserializeNode(T.previousSibling);M.insertBefore(_,N?N.nextSibling:M.firstChild)}),C.forEach(function(T){var _=w.deserializeNode(T);Object.keys(T.attributes).forEach(function(M){var N=T.attributes[M];N===null?_.removeAttribute(M):(!w.delegate||!w.delegate.setAttribute||!w.delegate.setAttribute(_,M,N))&&_.setAttribute(M,N)})}),g.forEach(function(T){var _=w.deserializeNode(T);_.textContent=T.textContent}),b.forEach(function(T){delete w.idMap[T.id]})},S.prototype.deserializeNode=function(b,E){var C=this;if(b===null)return null;var g=this.idMap[b.id];if(g)return g;var w=this.root.ownerDocument;switch(w===null&&(w=this.root),b.nodeType){case Node.COMMENT_NODE:g=w.createComment(b.textContent);break;case Node.TEXT_NODE:g=w.createTextNode(b.textContent);break;case Node.DOCUMENT_TYPE_NODE:g=w.implementation.createDocumentType(b.name,b.publicId,b.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(g=this.delegate.createElement(b.tagName)),g||(g=w.createElement(b.tagName)),Object.keys(b.attributes).forEach(function(_){(!C.delegate||!C.delegate.setAttribute||!C.delegate.setAttribute(g,_,b.attributes[_]))&&g.setAttribute(_,b.attributes[_])});break;default:throw"Unsupported node type: "+b.nodeType}if(this.idMap[b.id]=g,E&&E.appendChild(g),b.childNodes)for(var T=0;T<b.childNodes.length;T++)this.deserializeNode(b.childNodes[T],g);return g},S})(),k=(function(){function S(b,E,C){var g=this;this.target=b,this.mirror=E,this.nextId=1,this.knownNodes=new r;for(var w=this.serializeNode(b).id,T=[],_=b.firstChild;_;_=_.nextSibling)T.push(this.serializeNode(_,!0));this.mirror.initialize(w,T);var M=[{all:!0}];C&&(M=M.concat(C)),this.mutationSummary=new v({rootNode:b,callback:function(N){g.applyChanged(N)},queries:M})}return S.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},S.prototype.rememberNode=function(b){var E=this.nextId++;return this.knownNodes.set(b,E),E},S.prototype.forgetNode=function(b){this.knownNodes.delete(b)},S.prototype.serializeNode=function(b,E){if(b===null)return null;var C=this.knownNodes.get(b);if(C!==void 0)return{id:C};var g={nodeType:b.nodeType,id:this.rememberNode(b)};switch(g.nodeType){case Node.DOCUMENT_TYPE_NODE:var w=b;g.name=w.name,g.publicId=w.publicId,g.systemId=w.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:g.textContent=b.textContent;break;case Node.ELEMENT_NODE:var T=b;g.tagName=T.tagName,g.attributes={};for(var _=0;_<T.attributes.length;_++){var M=T.attributes[_];g.attributes[M.name]=M.value}if(E&&T.childNodes.length){g.childNodes=[];for(var N=T.firstChild;N;N=N.nextSibling)g.childNodes.push(this.serializeNode(N,!0))}}return g},S.prototype.serializeAddedAndMoved=function(b,E,C){var g=this,w=b.concat(E).concat(C),T=new r;w.forEach(function(M){var N=M.parentNode,W=T.get(N);W||(W=new r,T.set(N,W)),W.set(M,!0)});var _=[];return T.keys().forEach(function(M){for(var N=T.get(M),W=N.keys();W.length;){for(var P=W[0];P.previousSibling&&N.has(P.previousSibling);)P=P.previousSibling;for(;P&&N.has(P);){var R=g.serializeNode(P);R.previousSibling=g.serializeNode(P.previousSibling),R.parentNode=g.serializeNode(P.parentNode),_.push(R),N.delete(P),P=P.nextSibling}W=N.keys()}}),_},S.prototype.serializeAttributeChanges=function(b){var E=this,C=new r;return Object.keys(b).forEach(function(g){b[g].forEach(function(w){var T=C.get(w);T||(T=E.serializeNode(w),T.attributes={},C.set(w,T)),T.attributes[g]=w.getAttribute(g)})}),C.keys().map(function(g){return C.get(g)})},S.prototype.applyChanged=function(b){var E=this,C=b[0],g=C.removed.map(function(M){return E.serializeNode(M)}),w=this.serializeAddedAndMoved(C.added,C.reparented,C.reordered),T=this.serializeAttributeChanges(C.attributeChanged),_=C.characterDataChanged.map(function(M){var N=E.serializeNode(M);return N.textContent=M.textContent,N});this.mirror.applyChanged(g,w,T,_),C.removed.forEach(function(M){E.forgetNode(M)})},S})();if(MutationObserver===void 0)throw Error("DOM Mutation Observers are required");n.ChildListChange=o,n.MutationProjection=c,n.MutationSummary=v,n.NodeChange=a,n.NodeMap=r,n.Qualifier=d,n.Selector=h,n.Summary=u,n.TreeChanges=l,n.TreeMirror=A,n.TreeMirrorClient=k,Object.defineProperty(n,"__esModule",{value:!0})}))})),eA=JC(),oo=0,io=new Array(1e3);function tA(){for(let e=0;e<oo;e+=2){const t=io[e],n=io[e+1];t(...n),io[e]=void 0,io[e+1]=void 0}oo=0}function nA(e,...t){io[oo]=e,io[oo+1]=t,oo+=2,oo===2&&oA()}function rA(){let e=0;const t=new MutationObserver(tA),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var oA=rA();function Np(){nA(()=>{Dc.hasListeners()&&(Dc.fire(),Np())})}var Dc=new Me({onFirstListenerAdd:Np}),Zs=Dc.once;function iA(e,t,n){const r=new Me;let o=[];return r.addDisposable(e(i=>{Zs(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var sA=class extends Me{constructor(e={}){super(),L(this,"_mutationSummary",void 0),this._mutationSummary=new eA.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}},aA=class extends Ee{_nextTickHandler(){Zs(()=>{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(),L(this,"_mutationEmitter",void 0),L(this,"_innerEmitter",this.addDisposable(new Me({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),L(this,"_lostEmitter",this.addDisposable(new Me)),L(this,"_paused",0),L(this,"_stopped",0),L(this,"_summaries",[]),L(this,"onMutate",this._innerEmitter.event),L(this,"onLost",this._lostEmitter.event),L(this,"onNativeMutate",void 0),this._mutationEmitter=this.addDisposable(new sA(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(t=>{this._stopped||(this._paused?this._lostEmitter.fire(t):(this._summaries.push(...t),Zs(()=>{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--}trigger(){this._mutationEmitter.trigger(!0)}},lA=Zs,cA=class extends Ee{beginTextUpdate(){this._baseDocument.beginUpdate()}endTextUpdate(){this._baseDocument.endUpdate()}constructor(e,t,n){super(),L(this,"_baseDocument",void 0),L(this,"_remoteDocument",void 0),L(this,"_parsedDocument",void 0),L(this,"_nodeMap",void 0),L(this,"_beforeChangeEmitter",this.addDisposable(new Me)),L(this,"_beforeCommitEmitter",this.addDisposable(new Me)),L(this,"_onRefreshEmitter",this.addDisposable(new Me)),L(this,"_documentElement",void 0),L(this,"_docType",void 0),L(this,"_parseFn",void 0),L(this,"_mapHTMLRoots",void 0),L(this,"_roots",void 0),L(this,"_getRootsParent",void 0),L(this,"_mutationCollector",this.addDisposable(new aA)),L(this,"_attributeMapper",void 0),L(this,"ownership",void 0),L(this,"_reportedDrifts",new Set),L(this,"_commitPromise",void 0),L(this,"_pushUndoStop",!1),L(this,"_locked",!1),L(this,"_treeMutations",[]),L(this,"beforeChange",this._beforeChangeEmitter.event),L(this,"beforeCommit",this._beforeCommitEmitter.event),L(this,"onChange",Tw(iA(this._mutationCollector.onNativeMutate,o=>o.flat(),this),o=>o.length>0,this)),L(this,"onRefresh",this._onRefreshEmitter.event),this._baseDocument=e,this._remoteDocument=t,this._parseFn=n.prepareHtml,this._mapHTMLRoots=n.mapHTMLRoots,this._getRootsParent=n.rootsParent,this._roots=[...document.childNodes];const r=this._parsedDocument=new C0(e,n.createRoot);this._nodeMap=new nC,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new GC(this._nodeMap),this.addDisposable(uC(()=>this._mutationCollector.pause())),this.addDisposable(dC(()=>this._mutationCollector.resume())),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new XC(o=>!!this._nodeMap.getByElement(o)),this.addDisposable(this._mutationCollector.onLost(o=>this.ownership.observeLost(o)))}isUntracked(e){return this.ownership.isMarked(e)}markUntracked(e){this.ownership.markForeign(e)}_reportForeignStructure(e){try{const t=n=>!!this._nodeMap.getByElement(n);QC(YC(e,this.ownership,t),this._reportedDrifts),ZC(KC(e,t),this._reportedDrifts)}catch{}}commit(e=!0,t=!1){if(e&&(this._pushUndoStop=!0),t&&(this._locked=!0),!this._commitPromise){const n=()=>new Promise(r=>{try{this._beforeCommitEmitter.fire()}catch{}const o=this._mutationCollector.onMutate(i=>{i.length&&(this._reportForeignStructure(i),Ws("commit",()=>{const s=IC(i,this._nodeMap,this._parseFn,this._rootsParent());this._commit(s)}))});lA(()=>{const i=()=>{this._pushUndoStop=!1,this._commitPromise=void 0,this._locked=!1,r()};t?this._remoteDocument.saveChangesAsync(this._pushUndoStop).finally(i):(this._remoteDocument.saveChanges(this._pushUndoStop),i()),o.dispose()})});this._commitPromise=n()}return this._commitPromise}whenSent(){return this._remoteDocument.whenSent()}renderOnly(e){this._mutationCollector.stop();try{return e()}finally{this._mutationCollector.start()}}applyHidden(e){this._mutationCollector.pause();try{return e()}finally{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=DC(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;Df(()=>{const n=np(t.applyingMutation,r=>this._nodeMap.getByNode(r),r=>t.isAttached(r));return n&&{...n,stage:"tree"}},()=>t.applyMutations(e));for(const n of e)n.type==="Hidden"&&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===$.ELEMENT){const r=pc(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,Qr),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{Ws("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,Ww()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)Ws(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=iC(this._attributeMapper.onRemoteMutate(e),this._nodeMap),this._treeMutations=[],!t){const r=this._parsedDocument.root;for(const o of e)if(o.type==="Add"){if(o.parent===r){t=!0;break}}else if(o.type==="Remove"){if(o.node.parent===r){t=!0;break}}else if(o.type==="Move"&&(o.node.parent===r||o.parent===r)){t=!0;break}}const n=Q0(e,this._nodeMap,r=>this._parsedDocument.isAttached(r));if(this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),eC(n,this._nodeMap),this._attributeMapper.restoreHidden(),t){const r=this._parsedDocument.root?.children;if(r){const o=r.map(s=>this._nodeMap.getByNode(s)).filter(s=>!!s),i=this._roots=this._mapHTMLRoots(o,this);Mc.isEqual(o,i)}}}finally{this._mutationCollector.start()}}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(ue.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}):""}setInnerHtml(e,t){if(e instanceof Element)e.innerHTML=t;else if(e instanceof Comment)e.data=t;else if(e instanceof Document){nt("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}}}},uA=class{constructor(){L(this,"_changes",null)}get(){return this._changes}hasChanges(){return!!this._changes?.length}add(e){const t=tn(this._changes,e);this._changes=t.length?t:null}clear(){this._changes=null}replace(e){this._changes=e.length?e:null}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)}}},xp=60;function dA(e,t){if(e===t)return;const n=Math.min(e.length,t.length);let r=0;for(;r<n&&e[r]===t[r];)r+=1;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+xp),cached:t.substring(r,r+xp)}}var mA=class extends Ee{constructor(...e){super(...e),L(this,"_onApplyEmitter",this.addDisposable(new Me)),L(this,"_onEmptyEmitter",this.addDisposable(new Me)),L(this,"_dispatched",[]),L(this,"onApply",this._onApplyEmitter.event),L(this,"onEmpty",this._onEmptyEmitter.event)}_emit(e){e.length&&this._onApplyEmitter.fire(e),this.hasDispatched()||this._onEmptyEmitter.fire()}hasDispatched(){return!!this._dispatched.length}append(e,t){this._dispatched.unshift({changeId:t,textChanges:e})}apply(e,t){const n=t===void 0?-1:this._dispatched.findIndex(r=>r.changeId===t);if(n>=0){this._confirmEcho(n,e);return}this._applyExternal(e)}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(tn(Bn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=tn(t,Bn(n.textChanges));this._dispatched=[],this._emit(tn(t,e))}clear(){this._dispatched=[]}},fA=class AS extends Ee{constructor(t=""){super(),L(this,"_text",void 0),this._text=t}getText(t){const n=t0(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new AS(this._text)}},Qs=class TS extends fA{constructor(t=""){super(t),L(this,"_eventQueue",void 0),L(this,"_lockCounter",0),L(this,"_onChangeEmitter",this.addDisposable(new Me)),L(this,"_onChangedEmitter",this.addDisposable(new Me)),L(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>a0(this,r)),n.length){const r=Zr(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=o0(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=tn(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 TS(this._text)}};function Mp(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function Js(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 pA(e){return(t,n,r)=>Js(t)?e(t,n,r):!1}function hA(e){return t=>Js(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function gA(e){return(t,n,r)=>Js(t)?Mp(t)?e(t,n,r):t:!1}function bA(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return Js(n)?Mp(n)?e(t):t:!1}}function yA(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function Bc(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 vA(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 EA=8,SA=class{constructor(){L(this,"_byKey",Object.create(null)),L(this,"_byValue",Object.create(null))}getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=vA(EA),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},ea=new SA;function Rp(e,t){return t!==void 0&&!Bc(e,t)?`%|{${ea.getOrCreateByKey(e)}}|%`:e}function wA(e){const t=ea.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Ye(e,t,n){return t!==void 0?Bc(e,t)?e:`%|{${ea.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function CA(e){return e.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}function ze(e){return e.startsWith("<!--")&&e.endsWith("-->")?CA(e.slice(4,-3)):e}function AA(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 TA(e,t,n){return t!==void 0?Bc(e,t)?e:`%|{${ea.getOrCreateByKey(e)}}|%`:n||yA(e)||AA(e)?`<!--${e}-->`:e}var yr=pA(Ye),vr=hA(ze),_A=gA(Ye),kA=bA(ze),LA=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",wA),e.escape("@{","}",Ye,!0).unescape("<!--@{","}-->",ze,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",Rp,!0),e.escape("{{","}}",Rp,!0),e.createSyntax("brace-percent").escape("{%","%}",Ye).unescape("<!--{%","%}-->",ze),e.createSyntax("brace-hash").escape("{#","#}",Ye).unescape("<!--{#","#}-->",ze),e.createSyntax("proscript").escape("[%","%]",TA,!0).unescape("<!--[%","%]-->",ze,!0),e.createSyntax("getresponse").escape("[[IF","]]",Ye).escape("[[if","]]",Ye).escape("[[ELSE]]","",Ye).escape("[[else]]","",Ye).escape("[[ENDIF]]","",Ye).escape("[[endif]]","",Ye).unescape("<!--[[IF","]]-->",ze).unescape("<!--[[if","]]-->",ze).unescape("<!--[[ELSE]]","-->",ze).unescape("<!--[[else]]","-->",ze).unescape("<!--[[ENDIF]]","-->",ze).unescape("<!--[[endif]]","-->",ze),e.createSyntax("expert-sender").escape("<if",">",Ye).escape("</if",">",Ye).escape("<else",">",Ye).escape("</else",">",Ye).escape("<var ",">",Ye,!0).unescape("<!--<if ",">-->",ze).unescape("<!--</if",">-->",ze).unescape("<!--<else ",">-->",ze).unescape("<!--</else",">-->",ze).unescape("<!--<var",">-->",ze,!0),e.createSyntax("velocity").escape("#if",")",yr).escape("#elseif",")",yr).escape("#else","",Ye).escape("#foreach",")",yr).escape("#macro",")",yr).escape("#set",")",_A,!0).escape("#parse",")",yr).escape("#include",")",yr).escape("#evaluate",")",yr).escape("#end","",Ye).escape("#break","",Ye).escape("#stop","",Ye).unescape("<!--#macro","-->",vr).unescape("<!--#if","-->",vr).unescape("<!--#elseif","-->",vr).unescape("<!--#else","-->",ze).unescape("<!--#foreach","-->",vr).unescape("<!--#parse","-->",vr).unescape("<!--#include","-->",vr).unescape("<!--#evaluate","-->",vr).unescape("<!--#end","-->",ze).unescape("<!--#break","-->",ze).unescape("<!--#stop","-->",ze).unescape("<!--#set","-->",kA,!0),e.createSyntax("mailchimp").escape("*|","|*",Ye).unescape("<!--*|","|*-->",ze)},Op="bare",Hc=new Map;function NA(e){for(const t of Object.keys(e)){const n=e[t];n&&Hc.set(t,n)}}function xA(e){return e?Hc.get(e)??Op:Op}function MA(){Hc.clear()}function Pp(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 ai(e,t){return e.start<t.end&&t.start<e.end}function Ip(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:m,syntax:p,isVariable:f}of i){if(r?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):Pp(e,c,u.start,l),c=u.end,a.some(A=>ai(A,u)))continue;const h=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,y=e.substring(u.start,u.end),v=d(y,h,l.insideTag);v!==!1&&v!==y&&(s.push({range:u,text:v,overrideBuiltins:m,syntax:p,isVariable:f}),a.push(u))}return s.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function RA(e,t){const n=t.reduce((a,{mapFn:l,start:c,end:u,syntax:d,isVariable:m})=>(a[c]||(a[c]=[]),a[c].push({value:u,mapFn:l,syntax:d,isVariable:m}),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 Fc(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=RA(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:m}=s[c];r?(a.insideAttributeValue=!0,a.attributeQuoteChar='"'):Pp(e,l,u,a),l=u;const p=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let f=!1;for(const{mapFn:h,value:y,syntax:v,isVariable:A}of m){let k=u+d.length,S=e.indexOf(y,k);for(;S!==-1;){let b=S,E=u+d.length,C=0;for(;b!==-1;){const M=e.indexOf(d,E);if(M!==-1&&M<b)C++,E=M+d.length,b=e.indexOf(y,E);else if(C>0)C--,E=b+y.length,b=e.indexOf(y,E);else break}if(b<0)break;const g=b+y.length,w=e.substring(u,g),T=h(w,p,a.insideTag);if(T===!1){k=S+Math.max(y.length,1),S=e.indexOf(y,k);continue}(o||T!==w)&&i.push({range:{start:u,end:g},text:o?w:T,syntax:v,isVariable:A});const _=s.findIndex(({start:M})=>M>=g);_>c?c=_-1:c=s.length,f=!0;break}if(f)break}}return i}function ta(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 Dp=class{constructor(e=LA){L(this,"_disposables",[]),L(this,"_escapes",[]),L(this,"_unescapes",[]),L(this,"_escapeMatchers",[]),L(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=Fc(e,this._escapes,t,n),o=Ip(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>ai(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>ai(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=Fc(e,this._unescapes,t),r=Ip(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>ai(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>ai(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=>xA(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return Fc(e,this._escapes,t,n,!0)}getEscapedText(e,t){return ta(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return ta(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=ta(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=ta(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()}},OA=class extends Qs{constructor(){super(),L(this,"_editStack",new uA),L(this,"_editLog",[]),L(this,"_entityId",void 0),L(this,"_versionController",this.addDisposable(new mA)),L(this,"_beforeSaveEmitter",this.addDisposable(new Aw)),L(this,"_onReadyEmitter",this.addDisposable(new Me)),L(this,"_onEntitySetEmitter",this.addDisposable(new Me)),L(this,"_onPendingSentEmitter",this.addDisposable(new Me)),L(this,"_cache",new Qs),L(this,"beforeSave",this._beforeSaveEmitter.event),L(this,"_reverting",!1),L(this,"_inited",!1),L(this,"_nextChangeId",1),L(this,"_rev",null),L(this,"_pendingSave",null),L(this,"_applyingRemote",!1),L(this,"_handleUpdateEntity",({edits:e,guid:t,changeId:n,rev:r})=>{if(t===this._entityId)return this._reportSyncDrift("update-entity"),this._onRemoteChange(e,n,r)}),L(this,"_handleSetEntity",e=>{this._reportSyncDrift("set-entity"),MA(),NA(e.templateDirectivesPolicy??{}),this._entityId=e.guid,this._onEntitySetEmitter.fire(e.guid),this._editStack.clear(),this._versionController.clear(),this._pendingSave=null,this._onPendingSentEmitter.fire();const t=[[{range:yc(this._cache),text:e.html}]];return this._onRemoteChange(t,void 0,e.rev)}),L(this,"_onRemoteChange",(e,t,n)=>new Promise((r,o)=>{const{_cache:i}=this;let s=[];for(const a of e){const l=a.reverse();s=tn(s,Zr(l,i)),i.applyEdits(Jr,l)}this._rev=n??null,this._versionController.apply(s,t),this._versionController.hasDispatched()||this._flushPendingSave(),this._versionController.hasDispatched()?this.addDisposable(this._versionController.onEmpty(()=>{r()})):(this._onReadyEmitter.fire(),r())})),L(this,"onReady",this._onReadyEmitter.event),L(this,"onEntitySet",this._onEntitySetEmitter.event),this.addDisposable(Z.addListenerAsync(Pe.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(Z.addListenerAsync(Pe.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this._versionController.onApply(this._onApply.bind(this))}loadState(e){this._entityId=e.entityId;const t=[[{range:yc(this._cache),text:e.text}]];this._onRemoteChange(t)}saveState(){return{entityId:this._entityId,text:this.getText()}}_onApply(e){const t=this._editStack.get();if(!t){super.applyEdits(Jr,gr(e));return}const n=zf(t,e,"after"),r=n&&zf(e,t,"before");if(!n||!r){this._editStack.clear(),super.applyEdits(Jr,gr(tn(Bn(t),e)));return}try{this._applyingRemote=!0,super.applyEdits(Jr,gr(r))}finally{this._applyingRemote=!1}this._editStack.replace(n)}isApplyingRemote(){return this._applyingRemote}_flushPendingSave(){if(this._pendingSave!==null){const e=this._pendingSave;this._pendingSave=null,this.saveChanges(e),this._onPendingSentEmitter.fire()}}whenSent(){return this._pendingSave===null?Promise.resolve():new Promise(e=>{const t=this._onPendingSentEmitter.event(()=>{t.dispose(),e()})})}_reportSyncDrift(e){if(this._editStack.hasChanges()||this._versionController.hasDispatched())return;const t=dA(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;Gs("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}applyEdits(e,t){if(!this._reverting){const n=Zr(t,this);this._editStack.add(n),super.applyEdits(e,t),this._editLog.push(t)}}correctOffset(e,t){return this._editStack.correctOffset(e,t)}correctRange(e,t){return this._editStack.correctRange(e,t)}saveChanges(e=!0){if(!this._reverting&&this._rev!==null&&this._versionController.hasDispatched())return this._editStack.hasChanges()&&(this._pendingSave=(this._pendingSave??!1)||e),!0;if(!this._reverting&&this._beforeSaveEmitter.fire(e)!==!1&&this._entityId){const t=this._editStack.get()?.flatMap(n=>l0(n));if(t){const n=this._nextChangeId++;this._editStack.clear(),this._versionController.append(t,n),Z.send(Pe.APPLICATION_UPDATE_ENTITY,{guid:this._entityId,pushUndoStop:e,edits:gr(t),changeId:n,...this._rev!==null?{baseRev:this._rev}:{}})}return!0}return!1}saveChangesAsync(e=!0){return new Promise(t=>{const n=setTimeout(()=>nt("error while async saving"),1e4);if(this.saveChanges(e)===!1&&clearTimeout(n),!this.hasChanges()||this._pendingSave!==null)clearTimeout(n),t();else{const r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})}})}hasChanges(){return this._editStack.hasChanges()}},PA=class extends Dp{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_mappedDocument",void 0),L(this,"_mappings",[]),L(this,"_cachedMappedDocument",new Qs),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=Zr(this.getMappings(n),this._baseDocument),o=Bn(this._mappings);if(t=tn(o,t),t=tn(t,r),this._mappings=r,t.length){const i=gr(t);this._mappedDocument.applyEdits(e,zs(i))}}}correctOffset(e,t){const n=t?this._mappings:Bn(this._mappings),r=hc(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=Bn(this._mappings).find(({oldPosition:n,oldEnd:r})=>e>=n&&e<r);return t?{start:t.oldPosition,end:t.oldEnd}:null}hasMappedReplacementRangeInRange(e){return Bn(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 ni(e,n)}unescape(e){const t=this.getRevertMappings(e);return ni(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=Jr){const t=this._baseDocument.getText(),n=this.getMappings(t),r=ni(t,n);this._mappings=Zr(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=Zr(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=tn(o,t),t=tn(t,r),this._mappings=Bn(r),t.length){const i=gr(t);this._baseDocument.applyEdits(e,zs(i))}}}};function IA(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function li(e){let t=e.head;if(!t){t=e.createElement("head");const n=IA(e);n.insertBefore(t,n.firstChild)}return t}function DA(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function BA(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function HA(e){const t=li(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 Bp="amp-custom";function FA(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function Hp(e,t,n){for(const r of t)if(oi.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(Nc(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 oi.isMediaRule(r)&&Hp(e,r.cssRules,n)}function Fp(e,t){const n=t.sheet;if(n){const i=new Set;Hp(e,n.cssRules,(s,a)=>{const l=FA(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>oi.isStyleRule(d)&&d.selectorText===`.${l}`)&&!i.has(u)&&(i.add(u),t.innerHTML=`
2
2
  .${l} { ${s}: ${a} };
3
3
  ${t.innerHTML}`),l}),i.size&&(t.innerHTML=`
4
4
  ${[...i].join(`
@@ -6,7 +6,7 @@ ${[...i].join(`
6
6
  ${t.innerHTML}`)}const r=t.innerHTML,o=r.replace(/!important/g,"");r!==o&&(t.innerHTML=o)}function $A(e){const t=li(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(Bp)===""){Fp(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=`
7
7
  ${o.join("")}
8
8
  `,i.setAttribute(Bp,""),t.append(i),Fp(e,i)}for(const i of n)i.remove()}var $c="<!doctype html>";function WA(e){const t=e.doctype;if(t){if(rp(t)===$c)return;const n=new DOMParser().parseFromString($c,"text/html").doctype;e.replaceChild(n,t)}else{const n=new DOMParser().parseFromString($c,"text/html").doctype;e.insertBefore(n,e.firstChild)}}async function $p(e,t={}){const n=document.createElement("amp-img"),r=await Y0(e)||void 0,o=[];try{let i=e;for(;i&&Nc(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=BA(e);let c=!1;if(l){const d=l.getAttribute("width");try{let m=a?`${a}px`:"";d||(l.setAttribute("width","720px"),m=getComputedStyle(e).width||""),l.setAttribute("width",!d||parseInt(d)>320?"320px":"720px"),m!==(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={...DA(e),alt:e.alt,width:a,height:s,src:u,layout:c?"responsive":"fixed",...t};for(const d of Object.keys(t))Hn(n,d,t[d])}finally{for(const[i,s]of o)i.style.display=s}return n}async function qA(e,t){const n=[...e.querySelectorAll("img")],r=[];for(const i of n)r.push($p(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($p(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 zA(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=li(e),r=e.createElement("meta");r.setAttribute("charset","utf-8"),n.insertBefore(r,n.firstChild)}function VA(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 Wp="https://cdn.ampproject.org/v0",qp=`${Wp}.js`,UA=`script[src='${qp}']`;function jA(e,t){return`${Wp}/${e.toLowerCase()}-${t}.js`}async function GA(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=li(e),a=n.createElementFn("script"),l=jA(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(`
9
- `))}}}var pq=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),hq=function(e,t){return new URL(e,t).href},gq={},Wc=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)})},zp=void 0;async function na(){return zp||(zp=await Wc(()=>Promise.resolve().then(()=>Ql("./rules.CnnzdMsj.js")).then(e=>e.default),void 0,{}.url))}var qc=new Map;async function XA(){if(!qc.size){const e=await na(),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))||[];qc.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return qc}var zc=new Map;async function YA(){if(!zc.size){const e=await na();for(const t of e.declarations)zc.set(t.name,t)}return zc}var KA="$GLOBAL_ATTRS",Vc=new Map;async function ZA(){if(!Vc.size){const e=(await na()).attrLists.find(t=>t.name===KA)?.attrs;if(e)for(const t of e)Vc.set(t.name,t)}return Vc}function QA(e){return vn(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function Vp(e){return j0(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function Up(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--)Up(i[s],t,n)}if(vn(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 xc(e)?o():ii(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&ii(e.nextSibling))&&r()}async function JA(e,t){const n=new Set,r=t.commit,o=p=>t.replaceSelectors(p.toLowerCase());if(t.replaceImages&&await qA(e,r),t.injectExtensions){const p=t.replaceSelectors(UA);if(!e.querySelector(p)){const f=t.createElementFn("script");f.setAttribute("src",qp),f.setAttribute("async",""),li(e).appendChild(f),r?.()}}t.injectRequiredTags&&(VA(e,t.createElementFn,o),WA(e),HA(e),zA(e),r?.()),t.replaceStylesAndLinks&&($A(e),r?.());const i=await na(),s=await XA(),a=new Set(t.removeUnsupportedTags?e.querySelectorAll("*"):[]),l=new Map;for(let[p,f]of s)if(!f.deprecation){p=o(p);let h=[...e.querySelectorAll(p)].filter(y=>!l.has(y));f.unique&&h.length&&(h=[h[0]]),t.injectRequiredTags&&f.required&&!h.length&&(h=[...h,t.createElementFn(f.name)]);for(const y of h){if(t.injectRequiredAttributes&&y.getAttribute("on")&&!y.getAttribute("tabindex")&&y.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let A=!1;for(const k of[...y.classList])k.startsWith("i-amphtml")&&(A=!0,y.classList.remove(k));A&&!y.classList.length&&y.removeAttribute("class")}const v=l.get(y);v&&v.priority>f.priority||l.set(y,f)}}r?.();for(const[p,f]of l){if(t.injectExtensions&&f.requiresExtension)for(const v of f.requiresExtension)n.add(v);const h=f.requiredParent?f.requiredParent==="$ROOT"?e:e.querySelector(f.requiredParent):null;h&&(!p.parentNode||t.moveInvalidTagPosition)?h!==p.parentNode&&(f.name==="HEAD"||vn(h)&&h.tagName==="HEAD"?h.insertBefore(p,h.firstChild):h.appendChild(p)):p.parentNode||e.body.appendChild(p),t.removeUnsupportedTags&&a.delete(p),r?.();const y=await ZA();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const v=f.attrs,A=t.injectRequiredAttributes?new Set([...v].map(([S,b])=>b).filter(S=>S.required&&S.value)):void 0,k=p.getAttributeNames();for(const S of k){const b=v.get(S)||y.get(S);if(b){if(S==="id"||S==="class"||S==="style"){A?.delete(b);continue}if(t.removeUnsupportedAttributes){const E=p.getAttribute(S);if(b.value&&b.value.indexOf(E)<0){p.removeAttribute(S);continue}if(b.valueRegex&&!new RegExp(b.valueRegex).test(E)){p.removeAttribute(S);continue}if(b.disallowedValueRegex&&new RegExp(b.disallowedValueRegex).test(E)){p.removeAttribute(S);continue}const C=b.valueUrl;if(C){if(E===""){if(!C.allowEmpty){p.removeAttribute(S);continue}}else if(!(E.indexOf("<!--")>0&&E.indexOf("-->")>0)){if(!C.allowRelative)if(E.startsWith("#")||E.startsWith("/")){p.removeAttribute(S);continue}else{const g=C.protocol.length?C.protocol:["https"],w=E.substring(0,E.indexOf(":"));if(w){if(g.indexOf(w)<0){const T=g[0]+E.substring(E.indexOf(":"));if(URL.canParse(T))Hn(p,S,T);else{p.removeAttribute(S);continue}}else if(!URL.canParse(E)){p.removeAttribute(S);continue}}else{const T=g[0]+E;if(URL.canParse(T))Hn(p,S,T);else{p.removeAttribute(S);continue}}}}}}A?.delete(b)}else{if(S==="id"||S==="class"||S==="style")continue;t.removeUnsupportedAttributes&&p.removeAttribute(S)}}if(A)for(const S of A)Hn(p,S.name,S.value[0])}r?.()}t.moveInvalidTagPosition&&(Up(e,e.body,o),r?.());for(const p of a)p.remove();if(r?.(),t.removeUnsupportedStyles){let h=function(S){const b=S.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const E of b){if(!E)continue;const C=S.getPropertyValue(E);S.getPropertyPriority(E)==="important"&&S.setProperty(E,C);const g=f.get(E);g?g.value?g.value.indexOf(C)<0&&S.removeProperty(E):g.valueRegex&&(new RegExp(g.valueRegex).test(C)||S.removeProperty(E)):S.removeProperty(E)}r?.()},y=function(S){return S.constructor.name==="CSSStyleRule"},v=function(S){return S.constructor.name==="CSSMediaRule"},A=function(S){const b=S.cssRules;for(let E=b.length-1;E>=0;E--){const C=b[E];y(C)?C.selectorText.indexOf("[")>=0||C.selectorText.indexOf(":")>=0?S.deleteRule(E):(h(C.style),C.style.cssText||S.deleteRule(E)):v(C)?(A(C),C.cssRules.length||S.deleteRule(E)):S.deleteRule(E)}};var c=h,u=y,d=v,m=A;const p=e.querySelectorAll("*"),f=await YA();for(const S of p)if(Nc(S)){const b=S.getAttribute("style");b&&(h(S.style),S.style.length?S.style.cssText!==b&&S.setAttribute("style",S.style.cssText):S.removeAttribute("style"))}const k=e.querySelector("style[amp-custom]");if(k){const S=k.sheet;S&&(A(S),k.innerHTML=[...S.cssRules].map(b=>b.cssText).join(`
9
+ `))}}}var hq=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),gq=function(e,t){return new URL(e,t).href},bq={},Wc=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)})},zp=void 0;async function na(){return zp||(zp=await Wc(()=>Promise.resolve().then(()=>Ql("./rules.CnnzdMsj.js")).then(e=>e.default),void 0,{}.url))}var qc=new Map;async function XA(){if(!qc.size){const e=await na(),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))||[];qc.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return qc}var zc=new Map;async function YA(){if(!zc.size){const e=await na();for(const t of e.declarations)zc.set(t.name,t)}return zc}var KA="$GLOBAL_ATTRS",Vc=new Map;async function ZA(){if(!Vc.size){const e=(await na()).attrLists.find(t=>t.name===KA)?.attrs;if(e)for(const t of e)Vc.set(t.name,t)}return Vc}function QA(e){return vn(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function Vp(e){return j0(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function Up(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--)Up(i[s],t,n)}if(vn(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 xc(e)?o():ii(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&ii(e.nextSibling))&&r()}async function JA(e,t){const n=new Set,r=t.commit,o=p=>t.replaceSelectors(p.toLowerCase());if(t.replaceImages&&await qA(e,r),t.injectExtensions){const p=t.replaceSelectors(UA);if(!e.querySelector(p)){const f=t.createElementFn("script");f.setAttribute("src",qp),f.setAttribute("async",""),li(e).appendChild(f),r?.()}}t.injectRequiredTags&&(VA(e,t.createElementFn,o),WA(e),HA(e),zA(e),r?.()),t.replaceStylesAndLinks&&($A(e),r?.());const i=await na(),s=await XA(),a=new Set(t.removeUnsupportedTags?e.querySelectorAll("*"):[]),l=new Map;for(let[p,f]of s)if(!f.deprecation){p=o(p);let h=[...e.querySelectorAll(p)].filter(y=>!l.has(y));f.unique&&h.length&&(h=[h[0]]),t.injectRequiredTags&&f.required&&!h.length&&(h=[...h,t.createElementFn(f.name)]);for(const y of h){if(t.injectRequiredAttributes&&y.getAttribute("on")&&!y.getAttribute("tabindex")&&y.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let A=!1;for(const k of[...y.classList])k.startsWith("i-amphtml")&&(A=!0,y.classList.remove(k));A&&!y.classList.length&&y.removeAttribute("class")}const v=l.get(y);v&&v.priority>f.priority||l.set(y,f)}}r?.();for(const[p,f]of l){if(t.injectExtensions&&f.requiresExtension)for(const v of f.requiresExtension)n.add(v);const h=f.requiredParent?f.requiredParent==="$ROOT"?e:e.querySelector(f.requiredParent):null;h&&(!p.parentNode||t.moveInvalidTagPosition)?h!==p.parentNode&&(f.name==="HEAD"||vn(h)&&h.tagName==="HEAD"?h.insertBefore(p,h.firstChild):h.appendChild(p)):p.parentNode||e.body.appendChild(p),t.removeUnsupportedTags&&a.delete(p),r?.();const y=await ZA();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const v=f.attrs,A=t.injectRequiredAttributes?new Set([...v].map(([S,b])=>b).filter(S=>S.required&&S.value)):void 0,k=p.getAttributeNames();for(const S of k){const b=v.get(S)||y.get(S);if(b){if(S==="id"||S==="class"||S==="style"){A?.delete(b);continue}if(t.removeUnsupportedAttributes){const E=p.getAttribute(S);if(b.value&&b.value.indexOf(E)<0){p.removeAttribute(S);continue}if(b.valueRegex&&!new RegExp(b.valueRegex).test(E)){p.removeAttribute(S);continue}if(b.disallowedValueRegex&&new RegExp(b.disallowedValueRegex).test(E)){p.removeAttribute(S);continue}const C=b.valueUrl;if(C){if(E===""){if(!C.allowEmpty){p.removeAttribute(S);continue}}else if(!(E.indexOf("<!--")>0&&E.indexOf("-->")>0)){if(!C.allowRelative)if(E.startsWith("#")||E.startsWith("/")){p.removeAttribute(S);continue}else{const g=C.protocol.length?C.protocol:["https"],w=E.substring(0,E.indexOf(":"));if(w){if(g.indexOf(w)<0){const T=g[0]+E.substring(E.indexOf(":"));if(URL.canParse(T))Hn(p,S,T);else{p.removeAttribute(S);continue}}else if(!URL.canParse(E)){p.removeAttribute(S);continue}}else{const T=g[0]+E;if(URL.canParse(T))Hn(p,S,T);else{p.removeAttribute(S);continue}}}}}}A?.delete(b)}else{if(S==="id"||S==="class"||S==="style")continue;t.removeUnsupportedAttributes&&p.removeAttribute(S)}}if(A)for(const S of A)Hn(p,S.name,S.value[0])}r?.()}t.moveInvalidTagPosition&&(Up(e,e.body,o),r?.());for(const p of a)p.remove();if(r?.(),t.removeUnsupportedStyles){let h=function(S){const b=S.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const E of b){if(!E)continue;const C=S.getPropertyValue(E);S.getPropertyPriority(E)==="important"&&S.setProperty(E,C);const g=f.get(E);g?g.value?g.value.indexOf(C)<0&&S.removeProperty(E):g.valueRegex&&(new RegExp(g.valueRegex).test(C)||S.removeProperty(E)):S.removeProperty(E)}r?.()},y=function(S){return S.constructor.name==="CSSStyleRule"},v=function(S){return S.constructor.name==="CSSMediaRule"},A=function(S){const b=S.cssRules;for(let E=b.length-1;E>=0;E--){const C=b[E];y(C)?C.selectorText.indexOf("[")>=0||C.selectorText.indexOf(":")>=0?S.deleteRule(E):(h(C.style),C.style.cssText||S.deleteRule(E)):v(C)?(A(C),C.cssRules.length||S.deleteRule(E)):S.deleteRule(E)}};var c=h,u=y,d=v,m=A;const p=e.querySelectorAll("*"),f=await YA();for(const S of p)if(Nc(S)){const b=S.getAttribute("style");b&&(h(S.style),S.style.length?S.style.cssText!==b&&S.setAttribute("style",S.style.cssText):S.removeAttribute("style"))}const k=e.querySelector("style[amp-custom]");if(k){const S=k.sheet;S&&(A(S),k.innerHTML=[...S.cssRules].map(b=>b.cssText).join(`
10
10
  `)),r?.()}}await GA(e,i.extensions.filter(({name:p})=>n.has(p)),t)}function eT(e,t){return Object.keys(t).reduce((n,r)=>n.replaceAll(r,t[r]),e)}function jp(e,t={}){const{correct:n=!0,injectExtensions:r=!0,mappedTags:o={}}=t;return JA(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=>eT(i.toLowerCase(),o),commit:t.commit})}var tT=/^(chrome-extension|moz-extension|safari-extension):\/\//i,nT=/local\.adguard\.org/i,rT=/^bis_/i,oT=new Set(["data-bis-config"]),so=/<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,iT=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,ra=/<style\b[^>]*>[\s\S]*?<\/style>/gi,Gp=/display:\s*none\s*!important/gi,sT=[".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; }"],Xp=new Set(["em","data-theme-varibalse","data-em-localization"]);function aT(e){return Gp.lastIndex=0,(e.match(Gp)||[]).length}function Uc(e){const t=e.trim(),n=aT(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=sT.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 lT(e){if(Xp.has("em")&&e.getAttribute("em")==="styles")return!1;for(const t of Xp)if(e.hasAttribute(t))return!1;return Uc(e.textContent||"")}function Yp(e){return tT.test(e.src)||nT.test(e.src)?!0:e.hasAttribute("bis_use")||e.hasAttribute("data-bis-config")}function Kp(e){let t=!1;for(const n of[...e.attributes])(rT.test(n.name)||oT.has(n.name))&&(e.removeAttribute(n.name),t=!0);return t}function cT(e){ra.lastIndex=0;for(const t of e.matchAll(ra))if(Uc(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function uT(e){let t=!1;return ra.lastIndex=0,{html:e.replace(ra,n=>Uc(n.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):n),found:t}}function Zp(e){let t=!1;return e instanceof Element&&Kp(e)&&(t=!0),e.querySelectorAll("script").forEach(n=>{Yp(n)&&(n.remove(),t=!0)}),e.querySelectorAll("style").forEach(n=>{n.tagName==="STYLE"&&lT(n)&&(n.remove(),t=!0)}),e.querySelectorAll("*").forEach(n=>{Kp(n)&&(t=!0)}),t}function dT(e){return so.lastIndex=0,so.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||cT(e)}function mT(e){if(!dT(e))return{html:e,found:!1};let t=!1,n=e;so.lastIndex=0,so.test(n)&&(so.lastIndex=0,n=n.replace(so,""),t=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(n)||/\sdata-bis-config\s*=/.test(n))&&(n=n.replace(iT,""),t=!0);const r=uT(n);return n=r.html,t=t||r.found,{html:n,found:t}}function jc(){Z.send(Pe.RELOAD),window.location.reload()}function fT(e){const t=new Ee;function n(){const o=new Set;for(const i of document.querySelectorAll("script"))i instanceof HTMLScriptElement&&Yp(i)||e.getOuterHtml(i)&&(i.src||i.innerHTML).trim()&&o.add((i.src||i.innerHTML).trim());return o}let r=n();return t.addDisposable(Z.addListener(Pe.RELOAD,jc)),t.addDisposable(e.onChange(()=>{let o=n();for(const i of r)o.has(i)||jc();r=o})),t}var oa=[];function pT(e){return oa.push(e),{dispose:()=>{const t=oa.indexOf(e);t!==-1&&oa.splice(t,1)}}}function Gc(e){for(const t of oa){const n=t(e);if(n)return n}return e}function hT(){const e=document.querySelector("[em-edit]");return e?Gc(e):null}var ia=new Set(["img","image","input","video","source","em-replace"]);function Qp(e){const t=e.toLowerCase(),n=ia.has(t);return ia.add(t),{dispose:()=>{n||ia.delete(t)}}}function gT(e){return ia.has(e.toLowerCase())}var ci=[];function bT(e){return ci.push(e),{dispose:()=>{const t=ci.indexOf(e);t!==-1&&ci.splice(t,1)}}}function Jp(e){return ci.some(t=>t.isPathElement?.(e))}function yT(e,t){let n;for(const r of ci){const o=r.caption?.(e,t);o&&(n={...n,...o})}return n}function eh(e){return e.tagName==="TD"&&e===e.closest("amp-accordion")?.querySelector(":scope > section header td")}var vT={isPathElement(e){return e.tagName==="AMP-ACCORDION"||e.tagName==="AMP-CAROUSEL"||eh(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(eh(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}}},ET=class extends Ee{constructor(...e){super(...e),L(this,"hasAmp",!1)}};function ST(e,t,n=""){for(const r of e.classList)if(r.startsWith(`${t}-`))return r.replaceAll(`${t}-`,"");return n}function wT(e,t,n){const r=ST(e,t);r!==n&&(e.classList.remove(`${t}-${r}`),n&&e.classList.add(`${t}-${n}`))}function CT(){const e=new Ee;return e.addDisposable(p0(t=>t.startsWith("amp"))),e.addDisposable(h0(t=>t==="class"||t==="style")),e}function AT(e){const t=o=>Vp(o)&&e.getOuterHtml(o)!==""||QA(o)||U0(o),n=o=>{if(t(o))return!0;if(vn(o)||xc(o)){for(const i of o.querySelectorAll("*"))if(t(i))return!0}return!1},r=new ET;return r.addDisposable(pT(o=>o.closest("amp-img"))),r.addDisposable(bT(vT)),r.addDisposable(CT()),r.addDisposable(Qp("amp-img")),r.addDisposable(Qp("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(Pe.APPLICATION_HAS_AMP,i),setTimeout(()=>{if(i)jp(document,{correct:!1});else{const a=[...document.querySelectorAll("script")];for(const l of a)Vp(l)&&l.remove();jc()}})):s&&setTimeout(()=>{jp(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&&(wT(i,"em-amp-show",s==="amp"?"only":s==="html"?"disabled":void 0),e.commit())}}})),r}function TT(e,t){const n=AT(t);return e.inject(sc,n),{service:n,dispose(){n.dispose(),Jt(e,sc)}}}var _T={name:"sandbox.amp",provides:[sc],awaits:{services:[te]},setup(e){const{service:t}=TT(e,D(e,te));e.addService(yf,()=>({ampService:t}))}};(function(){"use strict";function e(t,n){var r,o=0,i=t.length,s,a="",l,c,u,d,m,p,f,h,y=!0,v=!1,A;r=arguments.length>1?n:{},typeof r.indent>"u"&&(r.indent=" "),typeof r.openbrace=="string"&&(y=r.openbrace==="end-of-line"),typeof r.autosemicolon=="boolean"&&(v=r.autosemicolon);function k(w){return w===" "||w===`
11
11
  `||w===" "||w==="\r"||w==="\f"}function S(w){return w==="'"||w==='"'}function b(w){return l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||"-_*.:#[]".indexOf(w)>=0}function E(){for(var w=p;w>0;w-=1)a+=r.indent}function C(){a=A(a),y?a+=" {":(a+=`
12
12
  `,E(),a+="{"),c!==`
@@ -25,8 +25,8 @@ ${o.join("")}
25
25
  `){a=A(a),a+=`
26
26
  `;continue}if(!k(l)){a=A(a),a+=`
27
27
  `,E(),a+=l,d=m.Property;continue}a+=l;continue}if(d===m.Property){if(l===":"){a=A(a),a+=": ",d=m.Expression,k(c)&&(d=m.Separator);continue}if(l==="}"){g(),d=m.Start,p>0&&(d=m.Block);continue}a+=l;continue}if(d===m.Separator){if(!k(l)){a+=l,d=m.Expression;continue}S(c)&&(d=m.Expression);continue}if(d===m.Expression){if(l==="}"){g(),d=m.Start,p>0&&(d=m.Block);continue}if(l===";"){a=A(a),a+=`;
28
- `,d=m.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=m.URL;continue}continue}if(d===m.URL&&l===")"&&a.charAt(a.length-1!=="\\")){a+=l,d=m.Expression;continue}a+=l}return a=s.join("")+a,a}window.cssbeautify=e})();function kT(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 LT=["transform","transform-origin","overflow-x","height"];function NT(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function ui(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of LT)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 xT(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(ui(t,1),t.scrollWidth)}function MT(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=NT(xT(e,n),t.innerWidth);return ui(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function RT(e,t){ui(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;ui(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 lt(e){const t=D(e,xe);return n=>{t.commit(n)}}function th(){return D(Et,te)}function OT(){return D(Et,mt)}function PT(){return D(Et,Zt)}function IT(){return Et.getInstance(te)!==void 0}function Er(e){D(Et,xe).commit(e)}function Xc(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)=>Xc(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)&&Xc(e[i],t[i]))}function nh(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&Xc(o,a)||(o=a,i=!0,r(a))})},select(r){return nh(n,r)}};return n}function rh(...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 nh(o,i)}};return o}var sa={lockEditorInit:!0,lockEdit:!1,lockEditor:!0,activeElementLocked:0,applicationTheme:"light",applicationMode:"default",previewHeight:0,emailWidth:0,previewPage:!1,globalHolder:null,elementPath:[],activeElementText:"",selectedElem:null,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,isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1,actualTargetCount:0,activeCell:[],commonStyles:{},loadStylesTimer:!1,_pushUndoStop:!1},di=rh({...sa});function Ut(){return di.get()}var aa=new Me,ao=new Map,x={source:di,get(e){return Ut()[e]},getState(){return{...Ut()}},getStateRef(){return Ut()},set(e,t){if(Ut()[e]===t)return;di.set({...Ut(),[e]:t}),aa.fire({[e]:t});const n=ao.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(Ut()[r]!==o){di.set({...Ut(),[r]:o}),n[r]=o,t=!0;const i=ao.get(r);i&&i.forEach(s=>s(o))}}t&&aa.fire(n)},increment(e,t=1){const n=Ut()[e];typeof n=="number"&&x.set(e,n+t)},decrement(e,t=1){const n=Ut()[e];typeof n=="number"&&x.set(e,n-t)},subscribe(e){return aa.event(e)},subscribeToKey(e,t){ao.has(e)||ao.set(e,new Set);const n=ao.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&ao.delete(e)}},reset(){di.set({...sa}),aa.fire(Ut())},resetKey(e){this.set(e,sa[e])},isEditingLocked(){const e=Ut();return e.lockEdit||e.lockEditor||e.lockEditorInit},isActiveElementLocked(){return Ut().activeElementLocked>0},getInitialState(){return sa}};function oh(e){const t=()=>{document.body?.classList.toggle("mceNonEditable",e),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};IT()?th().applyHidden(t):t()}function la(){return x.get("lockEdit")||x.get("lockEditor")}function DT(){return x.subscribe(e=>{"lockEditor"in e&&oh(la())})}function BT(e){return e.beforeChange(({domMutations:t})=>{const n=t.flatMap(r=>r.type==="Add"&&r.node instanceof Element?[r.node]:[]);n.length&&queueMicrotask(()=>{if(!la())return;const r=n.flatMap(o=>[...o.tagName==="EDITOR"?[o]:[],...Array.from(o.querySelectorAll("editor"))]);e.applyHidden(()=>{for(const o of r)o.isConnected&&o.setAttribute("contenteditable","false")})})})}function HT(e,t){const n=rh(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var FT=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled"];function $T(e){const t="7b3c64f5";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 WT={name:"sandbox.hostFacts",provides:[jr],setup(e){const t=Object.fromEntries(Object.entries(Iw).map(([n,r])=>[n,HT(Z,r).source]));e.inject(jr,t)}},qT={name:"sandbox.hostFactsToState",awaits:{services:[jr,xe,te]},setup(e){const t=D(e,jr),n=lt(e);t.theme.watch(r=>{x.set("applicationTheme",r),$T(r),n(!1)}),t.commonStyles.watch(r=>{r&&x.set("commonStyles",r)}),t.flags.watch(r=>{for(const o of FT)typeof r[o]<"u"&&x.set(o,r[o])}),DT(),BT(D(e,te)),t.lockEditor.watch(r=>x.set("lockEditor",r)),t.codeMode.watch(r=>x.set("codeMode",r)),t.appName.watch(r=>x.set("appName",r)),t.previewPage.watch(r=>{x.set("previewPage",r),document.body?.classList.toggle("em-sandbox-preview",r)})}},zT={name:"sandbox.viewport",awaits:{services:[jr]},setup(e){D(e,jr).viewport.watch(t=>kT(t,void 0,{state:x,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:x.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(vf).forEach(n=>n()),messageService:Z}))}};function Jn(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function ft(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function VT(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),document.body.classList.add("em-sandbox-discuss");else{const n=la()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),document.body.classList.remove("em-sandbox-discuss","em-sandbox-discuss_set-target")}}function UT(e,t){e.data.value?document.body.classList.add("em-sandbox-discuss_set-target"):document.body.classList.remove("em-sandbox-discuss_set-target")}function jT(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}}),document.body.classList.remove("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 GT(e,t){document.body.classList.remove("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 XT(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 YT={sandbox_lock_discuss:VT,sandbox_discuss_set_target:UT,sandbox_discuss_remove_target:jT,sandbox_discuss_reset:GT,sandbox_discuss_get_target:XT};function KT(e,t){x.set("lockEdit",!!e.data.data),oh(la())}function ZT(e,t){t.setEditorFocus(e.data.data)}function QT(e,t){let n=e.data.data;if(typeof n!="number")return;n=OT().correctOffset(n,!0),n=PT().correctOffset(n,!0);let r=th().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-x.get("previewHeight")/2+i.height/2;t.messageService.send({operation:"application_scroll-to",settings:{value:x.get("applicationMode")==="default"?s+x.get("iframeOffsetTop"):s}})}var JT={sandbox_lock_edit:KT,editor_change_focus:ZT,update_position_from_editor:QT};function e_(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 t_(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 n_(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 r_(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 o_={sandbox_set_attr_to_images:e_,sandbox_set_attr_to_links:t_,sandbox_set_position_to_img:n_,sandbox_set_position_to_link:r_},i_={brightness:100,contrast:100,sepia:0},ca={DARK:"dark",LIGHT:"light"},ih=!1;function s_(e){ih||(e.setFetchMethod(t=>window.fetch(t)),ih=!0)}function a_(){let e=null,t=ca.LIGHT;return{set(n){if(t=n,n===ca.DARK){e??(e=Wc(()=>Promise.resolve().then(()=>Ql("./darkreader.CLd5EML2.js")),void 0,{}.url)),e.then(r=>{t===ca.DARK&&(s_(r),r.enable(i_))}).catch(r=>{e=null});return}e?.then(r=>{t===ca.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var sh=a_();function l_(e,t){t.initPreview(!0)}function c_(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&sh.set(t)}var u_={init_preview:l_,sandbox_switch_theme:c_},Yc={increment:e=>x.increment(e),decrement:e=>x.decrement(e)};function nn(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(Ef,{owner:e,handlers:s})}}}var d_={name:"sandbox.operationEnvironment",provides:[Kn],setup(e){const t={iframeOffsetTop:0,previewHeight:0,elementPath:[],lockEdit:!1};x.subscribe(n=>{for(const r of["iframeOffsetTop","previewHeight","elementPath","lockEdit"])r in n&&n[r]!==void 0&&Object.assign(t,{[r]:n[r]})}),e.inject(Kn,t)}},m_=nn("discuss",YT,{services:[xe,Kn]},e=>{const t=lt(e),n=D(e,Kn);return()=>({commit:t,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:Z,removeAllAttributes:Jn})}),f_=nn("editor",JT,{services:[He,at]},e=>{const t=D(e,He),n=D(e,at);return()=>({applicationElementSettingsSet:t,messageService:Z,setEditorFocus:r=>n.setEditorFocus(r)})}),p_=nn("images",o_,{services:[He,vt,xe,Kn]},e=>{const t=D(e,He),n=D(e,vt),r=lt(e),o=D(e,Kn);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:Z,setCursorPosition:i=>n(i)})}),h_=nn("preview",u_,{services:[Jo]},e=>()=>({initPreview:t=>D(e,Jo)(t)})),g_={name:"sandbox.operationsDispatcher",setup(e){Z.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(Ef).map(o=>o.handlers[n]).filter(Boolean).pop();if(r)try{r(t)}catch{}})}},b_=[d_,m_,f_,p_,h_,g_],y_=["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"],v_=["style","class","align","href"],E_=new Set([...y_,"em-element-path_img"]);function S_(e){return e.split(/\s+/).filter(t=>t&&!E_.has(t)).join(" ")}var w_=32;function C_(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function A_(e){const t=[e.tagName];for(const n of v_){const r=e.getAttribute(n),o=n==="class"&&r!==null?S_(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function T_(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<w_&&(t.push(A_(n)),!C_(n));)n=n.parentElement,r++;return t.join("||")}function __(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:T_(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 k_(e){let t=x.get("activeElementLocked");x.subscribe(n=>{if(n.activeElementLocked===void 0)return;const r=t>0&&n.activeElementLocked===0;t=n.activeElementLocked,r&&Promise.resolve().then(()=>{x.get("activeElementLocked")===0&&e.remember(document.querySelector("[em-edit]"))})})}var ah=Promise.resolve(),lh=null;function L_(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 N_(e,t){lh=e,ah=ah.finally(()=>{lh===e&&L_(e,t)})}function x_(e,t="unknown"){const n=Et.getInstance(at);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}function M_(e){const t=e.innerHTML.trim();return[t==="&nbsp;",t==="<div>&nbsp;</div>",/^<div[^>]*>&nbsp;<\/div>$/.test(t),/^<[^>]*>&nbsp;<\/[^>]*>$/.test(t),t.replace(/<[^>]*>/g,"").trim()==="&nbsp;",e.textContent?.trim()===" "||e.textContent?.trim().charCodeAt(0)===160].some(n=>n===!0)}function R_(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}function X(e){if(O_(e))return P_(e)?e.trim():I_(e)}var ch={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},O_=e=>typeof e=="string"&&e.trim()!=="",P_=e=>ch.HEX.test(e);function I_(e){const t=ch.RGB.exec(e)?.groups;if(!t)return;const n=D_(t);return H_(n)}var D_=e=>({r:Kc(e.r),g:Kc(e.g),b:Kc(e.b),a:B_(e.a)}),Kc=e=>parseInt(e||"0",10),B_=e=>parseFloat(e||"1"),H_=e=>`#${Zc(e.r)}${Zc(e.g)}${Zc(e.b)}`,Zc=e=>e.toString(16).padStart(2,"0"),ua=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function uh(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function Sr(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function dh(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?dh(t):!1)}function I(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 F_(e){try{return JSON.parse(e),!0}catch{return!1}}function mh(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 lo(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function $_(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 da(){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 Qc(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 mi(e,t=da()){e=ua(e)??"";const n=i=>ua(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=mi(e,s),o))break}return o}function Jc(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 ma(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&&ma({elem:e.elem.previousSibling,width:e.width})}function W_(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 q_=e=>{if(e instanceof Text)return e.textContent||"";if(e instanceof Element){if(e.tagName==="BR")return`
29
- `;if(e.classList?.contains(".em-element-path"))return"";if(e.classList?.contains("em-code"))return"⃠";if(e.tagName==="EM-REPLACE")return"⃡"}};function fh(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>fh(r,t)).join(""):n}function z_(e){const t=e.firstElementChild||e;return t.tagName!=="EDITOR"?t.tagName:"div"}function V_(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 U_(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function j_(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 G_(e){return e.trim().split(" ").slice(0,-1).join(" ")||""}function eu(){return hT()}function X_(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 ph(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)ph(r,t)}}function Y_(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}var tu="data-em-caret",bq="​",fi=e=>e();function co(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function pi(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function wr(e){return(e??"").replaceAll("​","")}function K_(e){return(e.nodeType===Node.TEXT_NODE||co(e))&&wr(e.textContent)===""}function hh(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)}function gh(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(!pi(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),wr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),wr(i.toString())===""?{em:r,side:"after"}:null}function bh(e,t){if(!e.collapsed)return null;const n=gh(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(wr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=co(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&&K_(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return pi(i)?i:null}function fa(e,t,n=fi){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(co(r))o=r;else{const s=document.createElement("span");s.setAttribute(tu,""),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 hh(i,i.length),o}function nu(e,t=fi,n){const r=Array.from(e.querySelectorAll(`[${tu}]`)).filter(o=>o!==n&&wr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function Z_(e,t=fi){const n=wr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),hh(r,r.length),r}function yh(e){e.querySelectorAll(`[${tu}]`).forEach(t=>{const n=wr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function Q_(e,t){const n=bh(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o?.removeAllRanges(),o?.addRange(r),n}function J_(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 ek(){document.execCommand("delete")}function tk(e,t=fi,n=ek){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=>pi(l)&&J_(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;pi(l)?fa(l,"after",t):!l&&pi(c)&&fa(c,"before",t)}return!0}function vh(){const e=window.getSelection();return e?.rangeCount?bh(e.getRangeAt(0),"backward"):null}function nk(e,t=fi){const n=e.isConnected?e:vh();n&&(n.closest('[contenteditable="true"]')?.focus({preventScroll:!0}),fa(n,"after",t))}var rk=0;function it(e){return e>=48&&e<=57}function er(e){return it(e)||e>=65&&e<=70||e>=97&&e<=102}function ru(e){return e>=65&&e<=90}function ok(e){return e>=97&&e<=122}function ik(e){return ru(e)||ok(e)}function sk(e){return e>=128}function pa(e){return ik(e)||sk(e)||e===95}function Eh(e){return pa(e)||it(e)||e===45}function ak(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function ha(e){return e===10||e===13||e===12}function Cr(e){return ha(e)||e===32||e===9}function En(e,t){return!(e!==92||ha(t)||t===rk)}function ga(e,t,n){return e===45?pa(t)||t===45||En(t,n):pa(e)?!0:e===92?En(e,t):!1}function ou(e,t,n){return e===43||e===45?it(t)?2:t===46&&it(n)?3:0:e===46?it(t)?2:0:it(e)?1:0}function Sh(e){return e===65279||e===65534?1:0}var iu=new Array(128),yq=128,vq=130,Eq=131,Sq=132,wq=133;for(let e=0;e<iu.length;e++)iu[e]=Cr(e)&&130||it(e)&&131||pa(e)&&132||ak(e)&&133||e||128;function su(e){return e<128?iu[e]:132}function uo(e,t){return t<e.length?e.charCodeAt(t):0}function au(e,t,n){return n===13&&uo(e,t+1)===10?2:1}function mo(e,t,n){let r=e.charCodeAt(t);return ru(r)&&(r=r|32),r===n}function hi(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(ru(s)&&(s=s|32),s!==i)return!1}return!0}function lk(e,t){for(;t>=0&&Cr(e.charCodeAt(t));t--);return t+1}function ba(e,t){for(;t<e.length&&Cr(e.charCodeAt(t));t++);return t}function lu(e,t){for(;t<e.length&&it(e.charCodeAt(t));t++);return t}function fo(e,t){if(t+=2,er(uo(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&er(uo(e,t));t++);const n=uo(e,t);Cr(n)&&(t+=au(e,t,n))}return t}function ya(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!Eh(n)){if(En(n,uo(e,t+1))){t=fo(e,t)-1;continue}break}}return t}function va(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),it(n)&&(t=lu(e,t+1),n=e.charCodeAt(t)),n===46&&it(e.charCodeAt(t+1))&&(t+=2,t=lu(e,t)),mo(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),it(n)&&(t=lu(e,t+1+r+1))}return t}function cu(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}En(n,uo(e,t+1))&&(t=fo(e,t))}return t}function wh(e){if(e.length===1&&!er(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 Ch=["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"],ck=16384;function Ea(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,ck)):e}var Ah=10,uk=12,Th=13;function _h(e){const t=e.source,n=t.length,r=t.length>0?Sh(t.charCodeAt(0)):0,o=Ea(e.lines,n),i=Ea(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===Ah||c===Th||c===uk)&&(c===Th&&l+1<n&&t.charCodeAt(l+1)===Ah&&(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 dk=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||_h(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||_h(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]}}}},jt=16777215,tr=24,mk=new Map([[2,22],[21,22],[19,20],[23,24]]),fk=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=Ea(this.offsetAndType,e.length+1),o=Ea(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 m=a&jt;for(a=o[m],s=a>>tr,o[i]=m,o[m++]=i;m<i;m++)o[m]===n&&(o[m]=i);break}case 21:case 2:case 19:case 23:o[i]=a,s=mk.get(c),a=s<<tr|i}r[i++]=c<<tr|d,l===-1&&(l=u)}),r[i]=0<<tr|n,o[i]=n,o[n]=n;a!==0;){const c=a&jt;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]>>tr:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&jt:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?hi(this.source,this.offsetAndType[e-1]&jt,this.offsetAndType[e]&jt,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&jt:this.offsetAndType[this.tokenCount]&jt: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]&jt,t=this.offsetAndType[t],this.tokenType=t>>tr,this.tokenEnd=t&jt):(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>>tr,this.tokenEnd=e&jt):(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]&jt: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&jt,s=o>>tr;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:Ch[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function Sa(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=va(e,c),ga(n(c),n(c+1),n(c+2))){u=12,c=ya(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=ya(e,c),hi(e,d,c,"url")&&n(c)===40){if(c=ba(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 m=e.charCodeAt(c);switch(su(m)){case d:c++;return;case 130:if(ha(m)){c+=au(e,c,m),u=6;return}break;case 92:if(c===e.length-1)break;const p=n(c+1);ha(p)?c+=au(e,c+1,p):En(m,p)&&(c=fo(e,c)-1)}}}function s(){for(u=7,c=ba(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(su(d)){case 41:c++;return;case 130:if(c=ba(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=cu(e,c),u=8;return;case 34:case 39:case 40:case 133:c=cu(e,c),u=8;return;case 92:if(En(d,n(c+1))){c=fo(e,c)-1;break}c=cu(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=Sh(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(su(d)){case 130:u=13,c=ba(e,c+1);break;case 34:i();break;case 35:Eh(n(c+1))||En(n(c+1),n(c+2))?(u=4,c=ya(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:ou(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:ou(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):ga(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:ou(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:ga(n(c+1),n(c+2),n(c+3))?(u=3,c=ya(e,c+1)):(u=9,c++);break;case 91:u=19,c++;break;case 92:En(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 po=null,Ve=class bn{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return bn.createItem(t)}allocateCursor(t,n){let r;return po!==null?(r=po,po=po.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=po,po=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=bn.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 bn;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 bn;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 bn;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(bn.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(bn.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(bn.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(bn.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(bn.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 wa(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}
28
+ `,d=m.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=m.URL;continue}continue}if(d===m.URL&&l===")"&&a.charAt(a.length-1!=="\\")){a+=l,d=m.Expression;continue}a+=l}return a=s.join("")+a,a}window.cssbeautify=e})();function kT(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 LT=["transform","transform-origin","overflow-x","height"];function NT(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function ui(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of LT)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 xT(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(ui(t,1),t.scrollWidth)}function MT(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=NT(xT(e,n),t.innerWidth);return ui(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function RT(e,t){ui(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;ui(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 lt(e){const t=D(e,xe);return n=>{t.commit(n)}}function th(){return D(Et,te)}function OT(){return D(Et,mt)}function PT(){return D(Et,Zt)}function IT(){return Et.getInstance(te)!==void 0}function Er(e){D(Et,xe).commit(e)}function Xc(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)=>Xc(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)&&Xc(e[i],t[i]))}function nh(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&Xc(o,a)||(o=a,i=!0,r(a))})},select(r){return nh(n,r)}};return n}function rh(...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 nh(o,i)}};return o}var sa={lockEditorInit:!0,lockEdit:!1,lockEditor:!0,activeElementLocked:0,applicationTheme:"light",applicationMode:"default",previewHeight:0,emailWidth:0,previewPage:!1,globalHolder:null,elementPath:[],activeElementText:"",selectedElem:null,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,isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1,actualTargetCount:0,activeCell:[],commonStyles:{},loadStylesTimer:!1,_pushUndoStop:!1},di=rh({...sa});function Ut(){return di.get()}var aa=new Me,ao=new Map,x={source:di,get(e){return Ut()[e]},getState(){return{...Ut()}},getStateRef(){return Ut()},set(e,t){if(Ut()[e]===t)return;di.set({...Ut(),[e]:t}),aa.fire({[e]:t});const n=ao.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(Ut()[r]!==o){di.set({...Ut(),[r]:o}),n[r]=o,t=!0;const i=ao.get(r);i&&i.forEach(s=>s(o))}}t&&aa.fire(n)},increment(e,t=1){const n=Ut()[e];typeof n=="number"&&x.set(e,n+t)},decrement(e,t=1){const n=Ut()[e];typeof n=="number"&&x.set(e,n-t)},subscribe(e){return aa.event(e)},subscribeToKey(e,t){ao.has(e)||ao.set(e,new Set);const n=ao.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&ao.delete(e)}},reset(){di.set({...sa}),aa.fire(Ut())},resetKey(e){this.set(e,sa[e])},isEditingLocked(){const e=Ut();return e.lockEdit||e.lockEditor||e.lockEditorInit},isActiveElementLocked(){return Ut().activeElementLocked>0},getInitialState(){return sa}};function oh(e){const t=()=>{document.body?.classList.toggle("mceNonEditable",e),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};IT()?th().applyHidden(t):t()}function la(){return x.get("lockEdit")||x.get("lockEditor")}function DT(){return x.subscribe(e=>{"lockEditor"in e&&oh(la())})}function BT(e){return e.beforeChange(({domMutations:t})=>{const n=t.flatMap(r=>r.type==="Add"&&r.node instanceof Element?[r.node]:[]);n.length&&queueMicrotask(()=>{if(!la())return;const r=n.flatMap(o=>[...o.tagName==="EDITOR"?[o]:[],...Array.from(o.querySelectorAll("editor"))]);e.applyHidden(()=>{for(const o of r)o.isConnected&&o.setAttribute("contenteditable","false")})})})}function HT(e,t){const n=rh(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var FT=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled"];function $T(e){const t="fec11667";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 WT={name:"sandbox.hostFacts",provides:[jr],setup(e){const t=Object.fromEntries(Object.entries(Iw).map(([n,r])=>[n,HT(Z,r).source]));e.inject(jr,t)}},qT={name:"sandbox.hostFactsToState",awaits:{services:[jr,xe,te]},setup(e){const t=D(e,jr),n=lt(e);t.theme.watch(r=>{x.set("applicationTheme",r),$T(r),n(!1)}),t.commonStyles.watch(r=>{r&&x.set("commonStyles",r)}),t.flags.watch(r=>{for(const o of FT)typeof r[o]<"u"&&x.set(o,r[o])}),DT(),BT(D(e,te)),t.lockEditor.watch(r=>x.set("lockEditor",r)),t.codeMode.watch(r=>x.set("codeMode",r)),t.appName.watch(r=>x.set("appName",r)),t.previewPage.watch(r=>{x.set("previewPage",r),document.body?.classList.toggle("em-sandbox-preview",r)})}},zT={name:"sandbox.viewport",awaits:{services:[jr]},setup(e){D(e,jr).viewport.watch(t=>kT(t,void 0,{state:x,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:x.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(vf).forEach(n=>n()),messageService:Z}))}};function Jn(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function ft(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function VT(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),document.body.classList.add("em-sandbox-discuss");else{const n=la()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),document.body.classList.remove("em-sandbox-discuss","em-sandbox-discuss_set-target")}}function UT(e,t){e.data.value?document.body.classList.add("em-sandbox-discuss_set-target"):document.body.classList.remove("em-sandbox-discuss_set-target")}function jT(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}}),document.body.classList.remove("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 GT(e,t){document.body.classList.remove("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 XT(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 YT={sandbox_lock_discuss:VT,sandbox_discuss_set_target:UT,sandbox_discuss_remove_target:jT,sandbox_discuss_reset:GT,sandbox_discuss_get_target:XT};function KT(e,t){x.set("lockEdit",!!e.data.data),oh(la())}function ZT(e,t){t.setEditorFocus(e.data.data)}function QT(e,t){let n=e.data.data;if(typeof n!="number")return;n=OT().correctOffset(n,!0),n=PT().correctOffset(n,!0);let r=th().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-x.get("previewHeight")/2+i.height/2;t.messageService.send({operation:"application_scroll-to",settings:{value:x.get("applicationMode")==="default"?s+x.get("iframeOffsetTop"):s}})}var JT={sandbox_lock_edit:KT,editor_change_focus:ZT,update_position_from_editor:QT};function e_(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 t_(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 n_(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 r_(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 o_={sandbox_set_attr_to_images:e_,sandbox_set_attr_to_links:t_,sandbox_set_position_to_img:n_,sandbox_set_position_to_link:r_},i_={brightness:100,contrast:100,sepia:0},ca={DARK:"dark",LIGHT:"light"},ih=!1;function s_(e){ih||(e.setFetchMethod(t=>window.fetch(t)),ih=!0)}function a_(){let e=null,t=ca.LIGHT;return{set(n){if(t=n,n===ca.DARK){e??(e=Wc(()=>Promise.resolve().then(()=>Ql("./darkreader.CLd5EML2.js")),void 0,{}.url)),e.then(r=>{t===ca.DARK&&(s_(r),r.enable(i_))}).catch(r=>{e=null});return}e?.then(r=>{t===ca.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var sh=a_();function l_(e,t){t.initPreview(!0)}function c_(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&sh.set(t)}var u_={init_preview:l_,sandbox_switch_theme:c_},Yc={increment:e=>x.increment(e),decrement:e=>x.decrement(e)};function nn(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(Ef,{owner:e,handlers:s})}}}var d_={name:"sandbox.operationEnvironment",provides:[Kn],setup(e){const t={iframeOffsetTop:0,previewHeight:0,elementPath:[],lockEdit:!1};x.subscribe(n=>{for(const r of["iframeOffsetTop","previewHeight","elementPath","lockEdit"])r in n&&n[r]!==void 0&&Object.assign(t,{[r]:n[r]})}),e.inject(Kn,t)}},m_=nn("discuss",YT,{services:[xe,Kn]},e=>{const t=lt(e),n=D(e,Kn);return()=>({commit:t,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:Z,removeAllAttributes:Jn})}),f_=nn("editor",JT,{services:[He,at]},e=>{const t=D(e,He),n=D(e,at);return()=>({applicationElementSettingsSet:t,messageService:Z,setEditorFocus:r=>n.setEditorFocus(r)})}),p_=nn("images",o_,{services:[He,vt,xe,Kn]},e=>{const t=D(e,He),n=D(e,vt),r=lt(e),o=D(e,Kn);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:Z,setCursorPosition:i=>n(i)})}),h_=nn("preview",u_,{services:[Jo]},e=>()=>({initPreview:t=>D(e,Jo)(t)})),g_={name:"sandbox.operationsDispatcher",setup(e){Z.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(Ef).map(o=>o.handlers[n]).filter(Boolean).pop();if(r)try{r(t)}catch{}})}},b_=[d_,m_,f_,p_,h_,g_],y_=["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"],v_=["style","class","align","href"],E_=new Set([...y_,"em-element-path_img"]);function S_(e){return e.split(/\s+/).filter(t=>t&&!E_.has(t)).join(" ")}var w_=32;function C_(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function A_(e){const t=[e.tagName];for(const n of v_){const r=e.getAttribute(n),o=n==="class"&&r!==null?S_(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function T_(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<w_&&(t.push(A_(n)),!C_(n));)n=n.parentElement,r++;return t.join("||")}function __(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:T_(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 k_(e){let t=x.get("activeElementLocked");x.subscribe(n=>{if(n.activeElementLocked===void 0)return;const r=t>0&&n.activeElementLocked===0;t=n.activeElementLocked,r&&Promise.resolve().then(()=>{x.get("activeElementLocked")===0&&e.remember(document.querySelector("[em-edit]"))})})}var ah=Promise.resolve(),lh=null;function L_(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 N_(e,t){lh=e,ah=ah.finally(()=>{lh===e&&L_(e,t)})}function x_(e,t="unknown"){const n=Et.getInstance(at);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}function M_(e){const t=e.innerHTML.trim();return[t==="&nbsp;",t==="<div>&nbsp;</div>",/^<div[^>]*>&nbsp;<\/div>$/.test(t),/^<[^>]*>&nbsp;<\/[^>]*>$/.test(t),t.replace(/<[^>]*>/g,"").trim()==="&nbsp;",e.textContent?.trim()===" "||e.textContent?.trim().charCodeAt(0)===160].some(n=>n===!0)}function R_(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}function X(e){if(O_(e))return P_(e)?e.trim():I_(e)}var ch={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},O_=e=>typeof e=="string"&&e.trim()!=="",P_=e=>ch.HEX.test(e);function I_(e){const t=ch.RGB.exec(e)?.groups;if(!t)return;const n=D_(t);return H_(n)}var D_=e=>({r:Kc(e.r),g:Kc(e.g),b:Kc(e.b),a:B_(e.a)}),Kc=e=>parseInt(e||"0",10),B_=e=>parseFloat(e||"1"),H_=e=>`#${Zc(e.r)}${Zc(e.g)}${Zc(e.b)}`,Zc=e=>e.toString(16).padStart(2,"0"),ua=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function uh(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function Sr(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function dh(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?dh(t):!1)}function I(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 F_(e){try{return JSON.parse(e),!0}catch{return!1}}function mh(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 lo(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function $_(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 da(){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 Qc(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 mi(e,t=da()){e=ua(e)??"";const n=i=>ua(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=mi(e,s),o))break}return o}function Jc(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 ma(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&&ma({elem:e.elem.previousSibling,width:e.width})}function W_(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 q_=e=>{if(e instanceof Text)return e.textContent||"";if(e instanceof Element){if(e.tagName==="BR")return`
29
+ `;if(e.classList?.contains(".em-element-path"))return"";if(e.classList?.contains("em-code"))return"⃠";if(e.tagName==="EM-REPLACE")return"⃡"}};function fh(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>fh(r,t)).join(""):n}function z_(e){const t=e.firstElementChild||e;return t.tagName!=="EDITOR"?t.tagName:"div"}function V_(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 U_(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function j_(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 G_(e){return e.trim().split(" ").slice(0,-1).join(" ")||""}function eu(){return hT()}function X_(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 ph(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)ph(r,t)}}function Y_(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}var tu="data-em-caret",yq="​",fi=e=>e();function co(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function pi(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function wr(e){return(e??"").replaceAll("​","")}function K_(e){return(e.nodeType===Node.TEXT_NODE||co(e))&&wr(e.textContent)===""}function hh(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)}function gh(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(!pi(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),wr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),wr(i.toString())===""?{em:r,side:"after"}:null}function bh(e,t){if(!e.collapsed)return null;const n=gh(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(wr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=co(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&&K_(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return pi(i)?i:null}function fa(e,t,n=fi){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(co(r))o=r;else{const s=document.createElement("span");s.setAttribute(tu,""),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 hh(i,i.length),o}function nu(e,t=fi,n){const r=Array.from(e.querySelectorAll(`[${tu}]`)).filter(o=>o!==n&&wr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function Z_(e,t=fi){const n=wr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),hh(r,r.length),r}function yh(e){e.querySelectorAll(`[${tu}]`).forEach(t=>{const n=wr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function Q_(e,t){const n=bh(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o?.removeAllRanges(),o?.addRange(r),n}function J_(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 ek(){document.execCommand("delete")}function tk(e,t=fi,n=ek){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=>pi(l)&&J_(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;pi(l)?fa(l,"after",t):!l&&pi(c)&&fa(c,"before",t)}return!0}function vh(){const e=window.getSelection();return e?.rangeCount?bh(e.getRangeAt(0),"backward"):null}function nk(e,t=fi){const n=e.isConnected?e:vh();n&&(n.closest('[contenteditable="true"]')?.focus({preventScroll:!0}),fa(n,"after",t))}var rk=0;function it(e){return e>=48&&e<=57}function er(e){return it(e)||e>=65&&e<=70||e>=97&&e<=102}function ru(e){return e>=65&&e<=90}function ok(e){return e>=97&&e<=122}function ik(e){return ru(e)||ok(e)}function sk(e){return e>=128}function pa(e){return ik(e)||sk(e)||e===95}function Eh(e){return pa(e)||it(e)||e===45}function ak(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function ha(e){return e===10||e===13||e===12}function Cr(e){return ha(e)||e===32||e===9}function En(e,t){return!(e!==92||ha(t)||t===rk)}function ga(e,t,n){return e===45?pa(t)||t===45||En(t,n):pa(e)?!0:e===92?En(e,t):!1}function ou(e,t,n){return e===43||e===45?it(t)?2:t===46&&it(n)?3:0:e===46?it(t)?2:0:it(e)?1:0}function Sh(e){return e===65279||e===65534?1:0}var iu=new Array(128),vq=128,Eq=130,Sq=131,wq=132,Cq=133;for(let e=0;e<iu.length;e++)iu[e]=Cr(e)&&130||it(e)&&131||pa(e)&&132||ak(e)&&133||e||128;function su(e){return e<128?iu[e]:132}function uo(e,t){return t<e.length?e.charCodeAt(t):0}function au(e,t,n){return n===13&&uo(e,t+1)===10?2:1}function mo(e,t,n){let r=e.charCodeAt(t);return ru(r)&&(r=r|32),r===n}function hi(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(ru(s)&&(s=s|32),s!==i)return!1}return!0}function lk(e,t){for(;t>=0&&Cr(e.charCodeAt(t));t--);return t+1}function ba(e,t){for(;t<e.length&&Cr(e.charCodeAt(t));t++);return t}function lu(e,t){for(;t<e.length&&it(e.charCodeAt(t));t++);return t}function fo(e,t){if(t+=2,er(uo(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&er(uo(e,t));t++);const n=uo(e,t);Cr(n)&&(t+=au(e,t,n))}return t}function ya(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!Eh(n)){if(En(n,uo(e,t+1))){t=fo(e,t)-1;continue}break}}return t}function va(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),it(n)&&(t=lu(e,t+1),n=e.charCodeAt(t)),n===46&&it(e.charCodeAt(t+1))&&(t+=2,t=lu(e,t)),mo(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),it(n)&&(t=lu(e,t+1+r+1))}return t}function cu(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}En(n,uo(e,t+1))&&(t=fo(e,t))}return t}function wh(e){if(e.length===1&&!er(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 Ch=["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"],ck=16384;function Ea(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,ck)):e}var Ah=10,uk=12,Th=13;function _h(e){const t=e.source,n=t.length,r=t.length>0?Sh(t.charCodeAt(0)):0,o=Ea(e.lines,n),i=Ea(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===Ah||c===Th||c===uk)&&(c===Th&&l+1<n&&t.charCodeAt(l+1)===Ah&&(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 dk=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||_h(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||_h(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]}}}},jt=16777215,tr=24,mk=new Map([[2,22],[21,22],[19,20],[23,24]]),fk=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=Ea(this.offsetAndType,e.length+1),o=Ea(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 m=a&jt;for(a=o[m],s=a>>tr,o[i]=m,o[m++]=i;m<i;m++)o[m]===n&&(o[m]=i);break}case 21:case 2:case 19:case 23:o[i]=a,s=mk.get(c),a=s<<tr|i}r[i++]=c<<tr|d,l===-1&&(l=u)}),r[i]=0<<tr|n,o[i]=n,o[n]=n;a!==0;){const c=a&jt;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]>>tr:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&jt:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?hi(this.source,this.offsetAndType[e-1]&jt,this.offsetAndType[e]&jt,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&jt:this.offsetAndType[this.tokenCount]&jt: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]&jt,t=this.offsetAndType[t],this.tokenType=t>>tr,this.tokenEnd=t&jt):(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>>tr,this.tokenEnd=e&jt):(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]&jt: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&jt,s=o>>tr;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:Ch[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function Sa(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=va(e,c),ga(n(c),n(c+1),n(c+2))){u=12,c=ya(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=ya(e,c),hi(e,d,c,"url")&&n(c)===40){if(c=ba(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 m=e.charCodeAt(c);switch(su(m)){case d:c++;return;case 130:if(ha(m)){c+=au(e,c,m),u=6;return}break;case 92:if(c===e.length-1)break;const p=n(c+1);ha(p)?c+=au(e,c+1,p):En(m,p)&&(c=fo(e,c)-1)}}}function s(){for(u=7,c=ba(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(su(d)){case 41:c++;return;case 130:if(c=ba(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=cu(e,c),u=8;return;case 34:case 39:case 40:case 133:c=cu(e,c),u=8;return;case 92:if(En(d,n(c+1))){c=fo(e,c)-1;break}c=cu(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=Sh(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(su(d)){case 130:u=13,c=ba(e,c+1);break;case 34:i();break;case 35:Eh(n(c+1))||En(n(c+1),n(c+2))?(u=4,c=ya(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:ou(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:ou(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):ga(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:ou(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:ga(n(c+1),n(c+2),n(c+3))?(u=3,c=ya(e,c+1)):(u=9,c++);break;case 91:u=19,c++;break;case 92:En(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 po=null,Ve=class bn{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return bn.createItem(t)}allocateCursor(t,n){let r;return po!==null?(r=po,po=po.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=po,po=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=bn.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 bn;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 bn;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 bn;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(bn.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(bn.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(bn.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(bn.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(bn.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 wa(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}
30
30
  `)}})}var kh=100,pk=60,hk=" ";function Lh({source:e,line:t,column:n},r){function o(u,d){return i.slice(u,d).map((m,p)=>String(u+p+1).padStart(l)+" |"+m).join(`
31
31
  `)}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>kh&&(c=n-pk+3,n=58);for(let u=s;u<=a;u++)u>=0&&u<i.length&&(i[u]=i[u].replace(/\t/g,hk),i[u]=(c>0&&i[u].length>c?"…":"")+i[u].substr(c,98)+(i[u].length>c+kh-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join(`
32
32
  `)}function Nh(e,t,n,r,o){return Object.assign(wa("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment(i){return Lh({source:t,line:r,column:o},isNaN(i)?0:i)},get formattedMessage(){return`Parse error: ${e}
@@ -36,7 +36,7 @@ ${o.join("")}
36
36
  value: `+(i||"<empty string>")+`
37
37
  --------`+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},Aa=new Map,ho=new Map,Ta=45,rn=Gk,go=Xk;function bu(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Ta&&e.charCodeAt(t+1)===Ta}function zh(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Ta&&e.charCodeAt(t+1)!==Ta){const n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function Gk(e){if(Aa.has(e))return Aa.get(e);const t=e.toLowerCase();let n=Aa.get(t);if(n===void 0){const r=bu(t,0),o=r?"":zh(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return Aa.set(e,n),n}function Xk(e){if(ho.has(e))return ho.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");const r=bu(t,n.length);if(!r&&(t=t.toLowerCase(),ho.has(t))){const a=ho.get(t);return ho.set(e,a),a}const o=r?"":zh(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 ho.set(e,s),s}var Vh=["initial","inherit","unset","revert","revert-layer"],vi=43,Sn=45,yu=110,bo=!0,Yk=!1;function vu(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Ei(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function nr(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(o===vi||o===Sn){if(n)return 0;t++}for(;t<e.value.length;t++)if(!it(e.value.charCodeAt(t)))return 0;return r+1}function Eu(e,t,n){let r=!1,o=Ei(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(vu(e,vi)||vu(e,Sn)){if(r=!0,o=Ei(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!==vi&&i!==Sn)return 0}return nr(e,r?0:1,r,o)}function Kk(e,t){let n=0;if(!e)return 0;if(e.type===10)return nr(e,0,Yk,n);if(e.type===1&&e.value.charCodeAt(0)===Sn){if(!mo(e.value,1,yu))return 0;switch(e.value.length){case 2:return Eu(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==Sn?0:(n=Ei(t(++n),n,t),e=t(n),nr(e,0,bo,n));default:return e.value.charCodeAt(2)!==Sn?0:nr(e,3,bo,n)}}else if(e.type===1||vu(e,vi)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!mo(e.value,0,yu))return 0;switch(e.value.length){case 1:return Eu(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==Sn?0:(n=Ei(t(++n),n,t),e=t(n),nr(e,0,bo,n));default:return e.value.charCodeAt(1)!==Sn?0:nr(e,2,bo,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===vi||r===Sn?1:0,i=o;for(;i<e.value.length&&it(e.value.charCodeAt(i));i++);return i===o||!mo(e.value,i,yu)?0:i+1===e.value.length?Eu(t(++n),n,t):e.value.charCodeAt(i+1)!==Sn?0:i+2===e.value.length?(n=Ei(t(++n),n,t),e=t(n),nr(e,0,bo,n)):nr(e,i+2,bo,n)}return 0}var Zk=43,Uh=45,jh=63,Qk=117;function Su(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Jk(e,t){return e.value.charCodeAt(0)===t}function Si(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(i===Uh&&n&&r!==0)return Si(e,t+r+1,!1),6;if(!er(i)||++r>6)return 0}return r}function _a(e,t,n){if(!e)return 0;for(;Su(n(t),jh);){if(++e>6)return 0;t++}return t}function eL(e,t){let n=0;if(e===null||e.type!==1||!mo(e.value,0,Qk)||(e=t(++n),e===null))return 0;if(Su(e,Zk))return e=t(++n),e===null?0:e.type===1?_a(Si(e,0,!0),++n,t):Su(e,jh)?_a(1,++n,t):0;if(e.type===10){const r=Si(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!Jk(e,Uh)||!Si(e,1,!1)?0:n+1:_a(r,n,t))}return e.type===12?_a(Si(e,1,!0),++n,t):0}var tL=["calc(","-moz-calc(","-webkit-calc("],wu=new Map([[2,22],[21,22],[19,20],[23,24]]),nL=["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"],rL=["deg","grad","rad","turn"],oL=["s","ms"],iL=["hz","khz"],sL=["dpi","dpcm","dppx","x"],aL=["fr"],lL=["db"],cL=["st"];function on(e,t){return t<e.length?e.charCodeAt(t):0}function Gh(e,t){return hi(e,0,e.length,t)}function Xh(e,t){for(let n=0;n<t.length;n++)if(Gh(e,t[n]))return!0;return!1}function Yh(e,t){return t!==e.length-2?!1:on(e,t)===92&&it(on(e,t+1))}function ka(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 uL(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=wu.get(e.type)}o++}while(e=t(o));return o}function Gt(e){return function(t,n,r){return t===null?0:t.type===2&&Xh(t.value,tL)?uL(t,n):e(t,n,r)}}function Re(e){return function(t){return t===null||t.type!==e?0:1}}function dL(e){if(e===null||e.type!==1)return 0;const t=e.value.toLowerCase();return Xh(t,Vh)||Gh(t,"default")?0:1}function mL(e){return e===null||e.type!==1||on(e.value,0)!==45||on(e.value,1)!==45?0:1}function fL(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(!er(on(e.value,n)))return 0;return 1}function pL(e){return e===null||e.type!==4||!ga(on(e.value,1),on(e.value,2),on(e.value,3))?0:1}function hL(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=wu.get(e.type)}o++}while(e=t(o));return o}function gL(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=wu.get(e.type)}o++}while(e=t(o));return o}function $n(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;const o=va(t.value,0);if(e!==null){const i=t.value.indexOf("\\",o),s=i===-1||!Yh(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return ka(r,t.value,o)?0:1}}function bL(e,t,n){return e===null||e.type!==11||ka(n,e.value,e.value.length-1)?0:1}function Kh(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 yL(e,t,n){if(e===null)return 0;const r=va(e.value,0);return r!==e.value.length&&!Yh(e.value,r)||ka(n,e.value,r)?0:1}function vL(e,t,n){if(e===null||e.type!==10)return 0;let r=on(e.value,0)===43||on(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!it(on(e.value,r)))return 0;return ka(n,e.value,r)?0:1}var Zh={"ident-token":Re(1),"function-token":Re(2),"at-keyword-token":Re(3),"hash-token":Re(4),"string-token":Re(5),"bad-string-token":Re(6),"url-token":Re(7),"bad-url-token":Re(8),"delim-token":Re(9),"number-token":Re(10),"percentage-token":Re(11),"dimension-token":Re(12),"whitespace-token":Re(13),"CDO-token":Re(14),"CDC-token":Re(15),"colon-token":Re(16),"semicolon-token":Re(17),"comma-token":Re(18),"[-token":Re(19),"]-token":Re(20),"(-token":Re(21),")-token":Re(22),"{-token":Re(23),"}-token":Re(24),string:Re(5),ident:Re(1),"custom-ident":dL,"custom-property-name":mL,"hex-color":fL,"id-selector":pL,"an-plus-b":Kk,urange:eL,"declaration-value":hL,"any-value":gL,dimension:Gt($n(null)),angle:Gt($n(rL)),decibel:Gt($n(lL)),frequency:Gt($n(iL)),flex:Gt($n(aL)),length:Gt(Kh($n(nL))),resolution:Gt($n(sL)),semitones:Gt($n(cL)),time:Gt($n(oL)),percentage:Gt(bL),zero:Kh(),number:Gt(yL),integer:Gt(vL)};function EL(e,t,n){return Object.assign(wa("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
38
38
  `+t+`
39
- --`+new Array((n||t.length)+1).join("-")+"^"})}var SL=9,wL=10,CL=12,AL=13,TL=32,_L=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!==AL&&t!==wL&&t!==CL&&t!==TL&&t!==SL)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 EL(e,this.str,this.pos)}},kL=9,LL=10,NL=12,xL=13,ML=32,Qh=33,Cu=35,Jh=38,La=39,eg=40,RL=41,tg=42,Au=43,Tu=44,ng=45,_u=60,rg=62,ku=63,OL=64,Na=91,Lu=93,xa=123,og=124,ig=125,sg=8734,wi=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),ag={" ":1,"&&":2,"||":3,"|":4};function Ma(e){return e.substringToPos(e.findWsEnd(e.pos))}function yo(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||wi[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Ra(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 PL(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 lg(e){let t=null,n=null;return e.eat(xa),t=Ra(e),e.charCode()===Tu?(e.pos++,e.charCode()!==ig&&(n=Ra(e))):n=t,e.eat(ig),{min:Number(t),max:n?Number(n):0}}function IL(e){let t=null,n=!1;switch(e.charCode()){case tg:e.pos++,t={min:0,max:0};break;case Au:e.pos++,t={min:1,max:0};break;case ku:e.pos++,t={min:0,max:1};break;case Cu:e.pos++,n=!0,e.charCode()===xa?t=lg(e):e.charCode()===ku?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case xa:t=lg(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function vo(e,t){const n=IL(e);return n!==null?(n.term=t,e.charCode()===Cu&&e.charCodeAt(e.pos-1)===Au?vo(e,n):n):t}function Nu(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function DL(e){let t;return e.eat(_u),e.eat(La),t=yo(e),e.eat(La),e.eat(rg),vo(e,{type:"Property",name:t})}function BL(e){let t=null,n=null,r=1;return e.eat(Na),e.charCode()===ng&&(e.peek(),r=-1),r==-1&&e.charCode()===sg?e.peek():(t=r*Number(Ra(e)),wi[e.charCode()]!==0&&(t+=yo(e))),Ma(e),e.eat(Tu),Ma(e),e.charCode()===sg?e.peek():(r=1,e.charCode()===ng&&(e.peek(),r=-1),n=r*Number(Ra(e)),wi[e.charCode()]!==0&&(n+=yo(e))),e.eat(Lu),{type:"Range",min:t,max:n}}function HL(e){let t,n=null;return e.eat(_u),t=yo(e),e.charCode()===eg&&e.nextCharCode()===RL&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===Na&&(Ma(e),n=BL(e)),e.eat(rg),vo(e,{type:"Type",name:t,opts:n})}function FL(e){const t=yo(e);return e.charCode()===eg?(e.pos++,{type:"Function",name:t}):vo(e,{type:"Keyword",name:t})}function $L(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)=>ag[o]-ag[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 cg(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=qL(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:$L(t,n)||" ",disallowEmpty:!1,explicit:!1}}function WL(e){let t;return e.eat(Na),t=cg(e),e.eat(Lu),t.explicit=!0,e.charCode()===Qh&&(e.pos++,t.disallowEmpty=!0),t}function qL(e){let t=e.charCode();if(t<128&&wi[t]===1)return FL(e);switch(t){case Lu:break;case Na:return vo(e,WL(e));case _u:return e.nextCharCode()===La?DL(e):HL(e);case og:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===og?2:1))};case Jh:return e.pos++,e.eat(Jh),{type:"Combinator",value:"&&"};case Tu:return e.pos++,{type:"Comma"};case La:return vo(e,{type:"String",value:PL(e)});case ML:case kL:case LL:case xL:case NL:return{type:"Spaces",value:Ma(e)};case OL:return t=e.nextCharCode(),t<128&&wi[t]===1?(e.pos++,{type:"AtKeyword",name:yo(e)}):Nu(e);case tg:case Au:case ku:case Cu:case Qh:break;case xa:if(t=e.nextCharCode(),t<48||t>57)return Nu(e);break;default:return Nu(e)}}function ug(e){const t=new _L(e),n=cg(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var Ci=function(){};function dg(e){return typeof e=="function"?e:Ci}function zL(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=Ci,i=Ci;if(typeof t=="function"?o=t:t&&(o=dg(t.enter),i=dg(t.leave)),o===Ci&&i===Ci)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var VL={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 UL(e){const t=[];return Sa(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function jL(e,t){return typeof e=="string"?UL(e):t.generate(e,VL)}var ye={type:"Match"},Ce={type:"Mismatch"},xu={type:"DisallowEmpty"},GL=40,XL=41;function ut(e,t,n){return t===ye&&n===Ce||e===ye&&t===ye&&n===ye?e:(e.type==="If"&&e.else===Ce&&t===ye&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function mg(e){return e.length>2&&e.charCodeAt(e.length-2)===GL&&e.charCodeAt(e.length-1)===XL}function fg(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&mg(e.name)}function Mu(e,t,n){switch(e){case" ":{let r=ye;for(let o=t.length-1;o>=0;o--){const i=t[o];r=ut(i,r,Ce)}return r}case"|":{let r=Ce,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(fg(s)&&(o===null&&i>0&&fg(t[i-1])&&(o=Object.create(null),r=ut({type:"Enum",map:o},ye,r)),o!==null)){const a=(mg(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=ut(s,ye,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=Ce;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Mu(e,t.filter(function(a){return a!==i}),!1):s=ye,r=ut(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?ye:Ce;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Mu(e,t.filter(function(a){return a!==i}),!0):s=ye,r=ut(i,s,r)}return r}}}function YL(e){let t=ye,n=Ru(e.term);if(e.max===0)n=ut(n,xu,Ce),t=ut(n,null,Ce),t.then=ut(ye,ye,t),e.comma&&(t.then.else=ut({type:"Comma",syntax:e},t,Ce));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==ye&&(t=ut({type:"Comma",syntax:e},t,Ce)),t=ut(n,ut(ye,ye,t),Ce);if(e.min===0)t=ut(ye,ye,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==ye&&(t=ut({type:"Comma",syntax:e},t,Ce)),t=ut(n,t,Ce);return t}function Ru(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Mu(e.combinator,e.terms.map(Ru),!1);return e.disallowEmpty&&(t=ut(t,xu,Ce)),t}case"Multiplier":return YL(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 Ou(e,t){return typeof e=="string"&&(e=ug(e)),{type:"MatchGraph",match:Ru(e),syntax:t||null,source:e}}var{hasOwnProperty:pg}=Object.prototype,KL=0,ZL=1,Pu=2,hg=3,gg="Match",QL="Mismatch",JL="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",e2=15e3,t2=0;function n2(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function Iu(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 r2(e){return e.type!==9?!1:e.value!=="?"}function bg(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||r2(e)}function yg(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function o2(e,t,n){function r(){do A++,v=A<e.length?e[A]:null;while(v!==null&&(v.type===13||v.type===25))}function o(b){const E=A+b;return E<e.length?e[E]:null}function i(b,E){return{nextState:b,matchStack:S,syntaxStack:d,thenStack:m,tokenIndex:A,prev:E}}function s(b){m={nextState:b,matchStack:S,syntaxStack:d,prev:m}}function a(b){p=i(b,p)}function l(){S={type:ZL,syntax:t.syntax,token:v,prev:S},r(),f=null,A>k&&(k=A)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},S={type:Pu,syntax:t.syntax,token:S.token,prev:S}}function u(){S.type===Pu?S=S.prev:S={type:hg,syntax:d.syntax,token:S.token,prev:S},d=d.prev}let d=null,m=null,p=null,f=null,h=0,y=null,v=null,A=-1,k=0,S={type:KL,syntax:null,token:null,prev:null};for(r();y===null&&++h<e2;)switch(t.type){case"Match":if(m===null){if(v!==null&&(A!==e.length-1||v.value!=="\\0"&&v.value!=="\\9")){t=Ce;break}y=gg;break}if(t=m.nextState,t===xu)if(m.matchStack===S){t=Ce;break}else t=ye;for(;m.syntaxStack!==d;)u();m=m.prev;break;case"Mismatch":if(f!==null&&f!==!1)(p===null||A>p.tokenIndex)&&(p=f,f=!1);else if(p===null){y=QL;break}t=p.nextState,m=p.thenStack,d=p.syntaxStack,S=p.matchStack,A=p.tokenIndex,v=A<e.length?e[A]:null,p=p.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==Ce&&a(t.else),t.then!==ye&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const C=t.syntax.terms;if(t.index===C.length){if(t.mask===0||t.syntax.all){t=Ce;break}t=ye;break}if(t.mask===(1<<C.length)-1){t=ye;break}for(;t.index<C.length;t.index++){const g=1<<t.index;if((t.mask&g)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|g}),t=C[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(v!==null){let C=v.value.toLowerCase();if(C.indexOf("\\")!==-1&&(C=C.replace(/\\[09].*$/,"")),pg.call(t.map,C)){t=t.map[C];break}}t=Ce;break;case"Generic":{const C=d!==null?d.opts:null,g=A+Math.floor(t.fn(v,o,C));if(!isNaN(g)&&g>A){for(;A<g;)l();t=ye}else t=Ce;break}case"Type":case"Property":{const C=t.type==="Type"?"types":"properties",g=pg.call(n,C)?n[C][t.name]:null;if(!g||!g.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(f!==!1&&v!==null&&t.type==="Type"&&(t.name==="custom-ident"&&v.type===1||t.name==="length"&&v.value==="0")){f===null&&(f=i(t,p)),t=Ce;break}c(),t=g.match;break}case"Keyword":{const C=t.name;if(v!==null){let g=v.value;if(g.indexOf("\\")!==-1&&(g=g.replace(/\\[09].*$/,"")),Iu(g,C)){l(),t=ye;break}}t=Ce;break}case"AtKeyword":case"Function":if(v!==null&&Iu(v.value,t.name)){l(),t=ye;break}t=Ce;break;case"Token":if(v!==null&&v.value===t.value){l(),t=ye;break}t=Ce;break;case"Comma":v!==null&&v.type===18?bg(S.token)?t=Ce:(l(),t=yg(v)?Ce:ye):t=bg(S.token)||yg(v)?ye:Ce;break;case"String":let b="",E=A;for(;E<e.length&&b.length<t.value.length;E++)b+=e[E].value;if(Iu(b,t.value)){for(;A<E;)l();t=ye}else t=Ce;break;default:throw new Error("Unknown node type: "+t.type)}switch(t2+=h,y){case null:y=JL,S=null;break;case gg:for(;d!==null;)u();break;default:S=null}return{tokens:e,reason:y,iterations:h,match:S,longestMatch:k}}function vg(e,t,n){const r=o2(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=n2(o).prev;o!==null;){switch(o.type){case Pu:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case hg: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 i2=ie({getTrace:()=>Eg,isKeyword:()=>l2,isProperty:()=>a2,isType:()=>s2});function Eg(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 s2(e,t){return Du(this,e,n=>n.type==="Type"&&n.name===t)}function a2(e,t){return Du(this,e,n=>n.type==="Property"&&n.name===t)}function l2(e){return Du(this,e,t=>t.type==="Keyword")}function Du(e,t,n){const r=Eg.call(e,t);return r===null?!1:r.some(n)}function Sg(e){return"node"in e?e.node:Sg(e.match[0])}function wg(e){return"node"in e?e.node:wg(e.match[e.match.length-1])}function Cg(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=Sg(a),c=wg(a);e.syntax.walk(t,function(u,d,m){if(u===l){const p=new Ve;do{if(p.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:m,nodes:p})}})}Array.isArray(a.match)&&a.match.forEach(i)}const s=[];return n.matched!==null&&i(n.matched),s}var{hasOwnProperty:Ai}=Object.prototype;function Bu(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function Ag(e){return!!e&&Bu(e.offset)&&Bu(e.line)&&Bu(e.column)}function c2(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(Ai.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(!Ag(r.loc.start))i+=".start";else if(!Ag(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 Ve)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)Ai.call(t,i)&&Ai.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function u2(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if(Ai.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:c2(e,r)}}function d2(e){const t={};if(e.node){for(const n in e.node)if(Ai.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=u2(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var m2=Ou(Vh.join(" | "));function Hu(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:gu(e[o].syntax,{compact:t}));return r}function f2(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:gu(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&Hu(i.descriptors,t,n)};return r}function p2(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function sn(e,t,n){return{matched:e,iterations:n,error:t,...i2}}function Eo(e,t,n,r){const o=jL(n,e.syntax);let i;return p2(o)?sn(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=vg(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=vg(o,t.match,e),!i.match)?sn(null,new jk(i.reason,t.syntax,n,i),i.iterations):sn(i.match,null,i.iterations))}var Tg=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=m2,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||d2(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 Zh)this.addType_(r,Zh[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=Ou(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:ug(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Ou(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 yi("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&&!Eo(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=rn(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 yi("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new yi("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return sn(null,n);const r=this.getAtrule(e);return r.prelude?Eo(this,r.prelude,t||"",!1):sn(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return sn(null,r);const o=this.getAtrule(e),i=rn(t);return Eo(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?sn(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(go(e).custom)return sn(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?sn(null,n):Eo(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?Eo(this,n,t,!1):sn(null,new yi("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?sn(null,new yi("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),Eo(this,e,t,!1))}findValueFragments(e,t,n,r){return Cg(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return Cg(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=rn(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=go(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&&zL(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:Hu(this.types,!t,e),properties:Hu(this.properties,!t,e),atrules:f2(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:So}=Object.prototype,h2={generic:!0,types:Fu,atrules:{prelude:Ng,descriptors:Ng},properties:Fu,parseContext:g2,scope:kg,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Oa(e){return e&&e.constructor===Object}function _g(e){return Oa(e)?{...e}:e}function g2(e,t){return Object.assign(e,t)}function kg(e,t){for(const n in t)So.call(t,n)&&(Oa(e[n])?kg(e[n],t[n]):e[n]=_g(t[n]));return e}function Lg(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Fu(e,t){if(typeof t=="string")return Lg(e,t);const n={...e};for(let r in t)So.call(t,r)&&(n[r]=Lg(So.call(e,r)?e[r]:void 0,t[r]));return n}function Ng(e,t){const n=Fu(e,t);return!Oa(n)||Object.keys(n).length?n:null}function Ti(e,t,n){for(const r in n)if(So.call(n,r)!==!1){if(n[r]===!0)So.call(t,r)&&(e[r]=_g(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(Oa(n[r])){const o={};for(let i in e[r])o[i]=Ti({},e[r][i],n[r]);for(let i in t[r])o[i]=Ti(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&&Ti(o[s],a,i);for(const s in t[r])So.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&Ti(o[s],t[r][s],i));e[r]=o}}}return e}var $u=(e,t)=>Ti(e,t,h2);function xg(e){const t=Sk(e),n=$k(e),r=Dk(e),{fromPlainObject:o,toPlainObject:i}=Bk(n),s={lexer:null,createLexer:a=>new Tg(a,s,s.lexer.structure),tokenize:Sa,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=$u({},e);return xg(typeof a=="function"?a(l,Object.assign):$u(l,a))}};return s.lexer=new Tg({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var b2=e=>xg($u({},e)),y2={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>"}}}},v2=ie({generate:()=>C2,name:()=>S2,parse:()=>Mg,structure:()=>w2}),wn=43,Mt=45,Pa=110,Ar=!0,E2=!1;function Ia(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===wn||r===Mt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)it(this.charCodeAt(n))||this.error("Integer is expected",n)}function wo(e){return Ia.call(this,0,e)}function rr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Pa:n="N is expected";break;case Mt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function Wu(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(wn,e)||this.isDelim(Mt,e)){t=this.isDelim(wn,e)?wn:Mt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),wo.call(this,Ar))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==wn&&n!==Mt&&this.error("Number sign is expected")),wo.call(this,t!==0),t===Mt?"-"+this.consume(10):this.consume(10)}var S2="AnPlusB",w2={a:[String,null],b:[String,null]};function Mg(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)wo.call(this,E2),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Mt))switch(t="-1",rr.call(this,1,Pa),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Wu.call(this);break;case 3:rr.call(this,2,Mt),this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10);break;default:rr.call(this,2,Mt),Ia.call(this,3,Ar),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(wn)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(wn)&&(r=1,this.next()),rr.call(this,0,Pa),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Wu.call(this);break;case 2:rr.call(this,1,Mt),this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10);break;default:rr.call(this,1,Mt),Ia.call(this,2,Ar),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===wn||r===Mt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&it(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),rr.call(this,i-this.tokenStart,Pa),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=Wu.call(this)):(rr.call(this,i-this.tokenStart+1,Mt),i+2===this.tokenEnd?(this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10)):(Ia.call(this,i-this.tokenStart+2,Ar),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===wn&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===wn&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function C2(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 A2=ie({generate:()=>N2,name:()=>_2,parse:()=>Og,structure:()=>L2,walkContext:()=>k2});function Rg(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function T2(){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 _2="Atrule",k2="atrule",L2={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function Og(){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),Rg):r=Rg.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(T2.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function N2(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var x2=ie({generate:()=>P2,name:()=>M2,parse:()=>Pg,structure:()=>O2,walkContext:()=>R2}),M2="AtrulePrelude",R2="atrulePrelude",O2={children:[[]]};function Pg(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 P2(e){this.children(e)}var I2=ie({generate:()=>z2,name:()=>W2,parse:()=>Dg,structure:()=>q2}),D2=36,Ig=42,Da=61,B2=94,qu=124,H2=126;function F2(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(Ig)?(t=!0,this.next()):this.isDelim(qu)||this.eat(1),this.isDelim(qu)?this.charCodeAt(this.tokenStart+1)!==Da?(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 $2(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==Da&&t!==H2&&t!==B2&&t!==D2&&t!==Ig&&t!==qu&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Da&&(this.isDelim(Da)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var W2="AttributeSelector",q2={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Dg(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=F2.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=$2.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 z2(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 V2=ie({generate:()=>K2,name:()=>G2,parse:()=>Fg,structure:()=>Y2,walkContext:()=>X2});function Bg(e){return this.Raw(e,null,!0)}function U2(){return this.parseWithFallback(this.Rule,Bg)}function Hg(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function j2(){if(this.tokenType===17)return Hg.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Hg);return this.tokenType===17&&this.next(),e}var G2="Block",X2="block",Y2={children:[["Atrule","Rule","Declaration"]]};function Fg(e){const t=e?j2:U2,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,Bg));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function K2(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var Z2=ie({generate:()=>eN,name:()=>Q2,parse:()=>$g,structure:()=>J2}),Q2="Brackets",J2={children:[[]]};function $g(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 eN(e){this.token(9,"["),this.children(e),this.token(9,"]")}var tN=ie({generate:()=>rN,name:()=>"CDC",parse:()=>Wg,structure:()=>nN}),Cq="CDC",nN=[];function Wg(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function rN(){this.token(15,"-->")}var oN=ie({generate:()=>sN,name:()=>"CDO",parse:()=>qg,structure:()=>iN}),Aq="CDO",iN=[];function qg(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function sN(){this.token(14,"<!--")}var aN=ie({generate:()=>dN,name:()=>cN,parse:()=>zg,structure:()=>uN}),lN=46,cN="ClassSelector",uN={name:String};function zg(){return this.eatDelim(lN),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function dN(e){this.token(9,"."),this.token(1,e.name)}var mN=ie({generate:()=>yN,name:()=>gN,parse:()=>Ug,structure:()=>bN}),fN=43,Vg=47,pN=62,hN=126,gN="Combinator",bN={name:String};function Ug(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case pN:case fN:case hN:this.next();break;case Vg:this.next(),this.eatIdent("deep"),this.eatDelim(Vg);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function yN(e){this.tokenize(e.name)}var vN=ie({generate:()=>AN,name:()=>wN,parse:()=>jg,structure:()=>CN}),EN=42,SN=47,wN="Comment",CN={value:String};function jg(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===EN&&this.charCodeAt(t-1)===SN&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function AN(e){this.token(25,"/*"+e.value+"*/")}var TN=ie({generate:()=>BN,name:()=>PN,parse:()=>Yg,structure:()=>DN,walkContext:()=>IN}),Gg=33,_N=35,kN=36,LN=38,NN=42,xN=43,Xg=47;function MN(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function RN(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function ON(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(Gg)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var PN="Declaration",IN="declaration",DN={important:[Boolean,String],property:String,value:["Value","Raw"]};function Yg(){const e=this.tokenStart,t=this.tokenIndex,n=HN.call(this),r=bu(n),o=r?this.parseCustomProperty:this.parseValue,i=r?RN:MN;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(ON,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(Gg)&&(s=FN.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 BN(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 HN(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case NN:case kN:case xN:case _N:case LN:this.next();break;case Xg:this.next(),this.isDelim(Xg)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function FN(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var $N=ie({generate:()=>VN,name:()=>qN,parse:()=>Kg,structure:()=>zN});function WN(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var qN="DeclarationList",zN={children:[["Declaration"]]};function Kg(){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,WN))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function VN(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var UN=ie({generate:()=>XN,name:()=>jN,parse:()=>Zg,structure:()=>GN}),jN="Dimension",GN={value:String,unit:String};function Zg(){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 XN(e){this.token(12,e.value+e.unit)}var YN=ie({generate:()=>JN,name:()=>KN,parse:()=>Qg,structure:()=>QN,walkContext:()=>ZN}),KN="Function",ZN="function",QN={name:String,children:[[]]};function Qg(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 JN(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var ex=ie({generate:()=>rx,name:()=>tx,parse:()=>Jg,structure:()=>nx,xxx:()=>"XXX"}),Tq="XXX",tx="Hash",nx={value:String};function Jg(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function rx(e){this.token(4,"#"+e.value)}var ox=ie({generate:()=>ax,name:()=>ix,parse:()=>eb,structure:()=>sx}),ix="Identifier",sx={name:String};function eb(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function ax(e){this.token(1,e.name)}var lx=ie({generate:()=>dx,name:()=>cx,parse:()=>tb,structure:()=>ux}),cx="IdSelector",ux={name:String};function tb(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function dx(e){this.token(9,"#"+e.name)}var mx=ie({generate:()=>hx,name:()=>fx,parse:()=>nb,structure:()=>px}),fx="MediaFeature",px={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function nb(){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 hx(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var gx=ie({generate:()=>vx,name:()=>bx,parse:()=>rb,structure:()=>yx}),bx="MediaQuery",yx={children:[["Identifier","MediaFeature","WhiteSpace"]]};function rb(){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 vx(e){this.children(e)}var Ex=ie({generate:()=>Cx,name:()=>Sx,parse:()=>ob,structure:()=>wx}),Sx="MediaQueryList",wx={children:[["MediaQuery"]]};function ob(){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 Cx(e){this.children(e,()=>this.token(18,","))}var Ax=ie({generate:()=>_x,name:()=>"Nth",parse:()=>ib,structure:()=>Tx}),_q="Nth",Tx={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function ib(){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 _x(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var kx=ie({generate:()=>xx,name:()=>Lx,parse:()=>sb,structure:()=>Nx}),Lx="Number",Nx={value:String};function sb(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function xx(e){this.token(10,e.value)}var Mx=ie({generate:()=>Px,name:()=>Rx,parse:()=>ab,structure:()=>Ox}),Rx="Operator",Ox={value:String};function ab(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Px(e){this.tokenize(e.value)}var Ix=ie({generate:()=>Hx,name:()=>Dx,parse:()=>lb,structure:()=>Bx}),Dx="Parentheses",Bx={children:[[]]};function lb(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 Hx(e){this.token(21,"("),this.children(e),this.token(22,")")}var Fx=ie({generate:()=>qx,name:()=>$x,parse:()=>cb,structure:()=>Wx}),$x="Percentage",Wx={value:String};function cb(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function qx(e){this.token(11,e.value+"%")}var zx=ie({generate:()=>Gx,name:()=>Vx,parse:()=>ub,structure:()=>jx,walkContext:()=>Ux}),Vx="PseudoClassSelector",Ux="function",jx={name:String,children:[["Raw"],null]};function ub(){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 Gx(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var Xx=ie({generate:()=>Qx,name:()=>Yx,parse:()=>db,structure:()=>Zx,walkContext:()=>Kx}),Yx="PseudoElementSelector",Kx="function",Zx={name:String,children:[["Raw"],null]};function db(){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 Qx(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 Jx=ie({generate:()=>oM,name:()=>nM,parse:()=>fb,structure:()=>rM}),eM=47,tM=46;function mb(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!it(n)&&n!==tM&&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 nM="Ratio",rM={left:String,right:String};function fb(){const e=this.tokenStart,t=mb.call(this);let n;return this.skipSC(),this.eatDelim(eM),n=mb.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function oM(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var iM=ie({generate:()=>lM,name:()=>"Raw",parse:()=>pb,structure:()=>aM});function sM(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var kq="Raw",aM={value:String};function pb(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=sM.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function lM(e){this.tokenize(e.value)}var cM=ie({generate:()=>pM,name:()=>dM,parse:()=>gb,structure:()=>fM,walkContext:()=>mM});function hb(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function uM(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var dM="Rule",mM="rule",fM={prelude:["SelectorList","Raw"],block:["Block"]};function gb(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(uM,hb):n=hb.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function pM(e){this.node(e.prelude),this.node(e.block)}var hM=ie({generate:()=>yM,name:()=>gM,parse:()=>bb,structure:()=>bM}),gM="Selector",bM={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function bb(){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 yM(e){this.children(e)}var vM=ie({generate:()=>CM,name:()=>EM,parse:()=>yb,structure:()=>wM,walkContext:()=>SM}),EM="SelectorList",SM="selector",wM={children:[["Selector","Raw"]]};function yb(){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 CM(e){this.children(e,()=>this.token(18,","))}var zu=92,vb=34,Eb=39;function Sb(e){const t=e.length,n=e.charCodeAt(0),r=n===vb||n===Eb?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===zu){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),En(zu,a)){const l=s-1,c=fo(e,l);s=c-1,i+=wh(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function Vu(e,t){const n=t?"'":'"',r=t?Eb:vb;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===zu?(o+="\\"+e.charAt(s),i=!1):(i&&(er(a)||Cr(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var AM=ie({generate:()=>kM,name:()=>TM,parse:()=>wb,structure:()=>_M}),TM="String",_M={value:String};function wb(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Sb(this.consume(5))}}function kM(e){this.token(5,Vu(e.value))}var LM=ie({generate:()=>OM,name:()=>xM,parse:()=>Ab,structure:()=>RM,walkContext:()=>MM}),NM=33;function Cb(e){return this.Raw(e,null,!1)}var xM="StyleSheet",MM="stylesheet",RM={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function Ab(){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)!==NM){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,Cb);break;default:n=this.parseWithFallback(this.Rule,Cb)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function OM(e){this.children(e)}var PM=ie({generate:()=>HM,name:()=>DM,parse:()=>_b,structure:()=>BM}),IM=42,Tb=124;function Uu(){this.tokenType!==1&&this.isDelim(IM)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var DM="TypeSelector",BM={name:String};function _b(){const e=this.tokenStart;return this.isDelim(Tb)?(this.next(),Uu.call(this)):(Uu.call(this),this.isDelim(Tb)&&(this.next(),Uu.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function HM(e){this.tokenize(e.name)}var FM=ie({generate:()=>VM,name:()=>qM,parse:()=>Nb,structure:()=>zM}),kb=43,Lb=45,ju=63;function _i(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===Lb&&t&&n!==0)return _i.call(this,e+n+1,!1),-1;er(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 Ba(e){let t=0;for(;this.isDelim(ju);)++t>e&&this.error("Too many question marks"),this.next()}function $M(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===kb?"Plus sign":"Hyphen minus")+" is expected")}function WM(){let e=0;switch(this.tokenType){case 10:if(e=_i.call(this,1,!0),this.isDelim(ju)){Ba.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){$M.call(this,Lb),_i.call(this,1,!1);break}break;case 12:e=_i.call(this,1,!0),e>0&&Ba.call(this,6-e);break;default:if(this.eatDelim(kb),this.tokenType===1){e=_i.call(this,0,!0),e>0&&Ba.call(this,6-e);break}if(this.isDelim(ju)){this.next(),Ba.call(this,5);break}this.error("Hex digit or question mark is expected")}}var qM="UnicodeRange",zM={value:String};function Nb(){const e=this.tokenStart;return this.eatIdent("u"),WM.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function VM(e){this.tokenize(e.value)}var UM=32,Gu=92,jM=34,GM=39,XM=40,xb=41;function YM(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===xb?t-2:t-1,o="";for(;n<r&&Cr(e.charCodeAt(n));)n++;for(;n<r&&Cr(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===Gu){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),En(Gu,s)){const a=i-1,l=fo(e,a);i=l-1,o+=wh(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function Mb(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===UM||o===Gu||o===jM||o===GM||o===XM||o===xb?(t+="\\"+e.charAt(r),n=!1):(n&&er(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var KM=ie({generate:()=>QM,name:()=>"Url",parse:()=>Rb,structure:()=>ZM}),Lq="Url",ZM={value:String};function Rb(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=YM(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=Sb(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 QM(e){this.token(7,Mb(e.value))}var JM=ie({generate:()=>nR,name:()=>eR,parse:()=>Ob,structure:()=>tR}),eR="Value",tR={children:[[]]};function Ob(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function nR(e){this.children(e)}var rR=ie({generate:()=>aR,name:()=>iR,parse:()=>Pb,structure:()=>sR}),oR=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),iR="WhiteSpace",sR={value:String};function Pb(){return this.eat(13),oR}function aR(e){this.token(13,e.value)}var Ib=ie({AnPlusB:()=>v2,Atrule:()=>A2,AtrulePrelude:()=>x2,AttributeSelector:()=>I2,Block:()=>V2,Brackets:()=>Z2,CDC:()=>tN,CDO:()=>oN,ClassSelector:()=>aN,Combinator:()=>mN,Comment:()=>vN,Declaration:()=>TN,DeclarationList:()=>$N,Dimension:()=>UN,Function:()=>YN,Hash:()=>ex,IdSelector:()=>lx,Identifier:()=>ox,MediaFeature:()=>mx,MediaQuery:()=>gx,MediaQueryList:()=>Ex,Nth:()=>Ax,Number:()=>kx,Operator:()=>Mx,Parentheses:()=>Ix,Percentage:()=>Fx,PseudoClassSelector:()=>zx,PseudoElementSelector:()=>Xx,Ratio:()=>Jx,Raw:()=>iM,Rule:()=>cM,Selector:()=>hM,SelectorList:()=>vM,String:()=>AM,StyleSheet:()=>LM,TypeSelector:()=>PM,UnicodeRange:()=>FM,Url:()=>KM,Value:()=>JM,WhiteSpace:()=>rR}),lR={generic:!0,...y2,node:Ib},cR=35,uR=42,Db=43,dR=45,mR=47,fR=117;function Bb(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,fR)&&this.cmpChar(this.tokenStart+1,Db)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===mR||t===uR||t===Db||t===dR)return this.Operator();t===cR&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var pR={getNode:Bb},hR=35,gR=42,bR=43,yR=47,Hb=46,vR=62,ER=124,SR=126;function wR(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function CR(){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)===Hb&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case bR:case vR:case SR:case yR:return this.Combinator();case Hb:return this.ClassSelector();case gR:case ER:return this.TypeSelector();case hR:return this.IdSelector()}}}var AR={onWhiteSpace:wR,getNode:CR};function TR(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function _R(){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 Fb(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var kR={getNode:Bb,onWhiteSpace(e,t){Fb(e)&&(e.value=" "+e.value),Fb(t.last)&&(t.last.value+=" ")},expression:TR,var:_R},LR=ie({AtrulePrelude:()=>pR,Selector:()=>AR,Value:()=>kR}),NR={parse:{prelude:null,block(){return this.Block(!0)}}},xR={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}},MR={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},RR={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function OR(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function PR(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):$b.call(this)}function $b(){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(OR,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(PR,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var IR={parse:{prelude(){const e=$b.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},DR={"font-face":NR,import:xR,media:MR,page:RR,supports:IR},Tr={parse(){return this.createSingleNodeList(this.SelectorList())}},BR={parse(){return this.createSingleNodeList(this.Selector())}},Wb={parse(){return this.createSingleNodeList(this.Identifier())}},Ha={parse(){return this.createSingleNodeList(this.Nth())}},HR={dir:Wb,has:Tr,lang:Wb,matches:Tr,is:Tr,"-moz-any":Tr,"-webkit-any":Tr,where:Tr,not:Tr,"nth-child":Ha,"nth-last-child":Ha,"nth-last-of-type":Ha,"nth-of-type":Ha,slotted:BR},FR=ie({AnPlusB:()=>Mg,Atrule:()=>Og,AtrulePrelude:()=>Pg,AttributeSelector:()=>Dg,Block:()=>Fg,Brackets:()=>$g,CDC:()=>Wg,CDO:()=>qg,ClassSelector:()=>zg,Combinator:()=>Ug,Comment:()=>jg,Declaration:()=>Yg,DeclarationList:()=>Kg,Dimension:()=>Zg,Function:()=>Qg,Hash:()=>Jg,IdSelector:()=>tb,Identifier:()=>eb,MediaFeature:()=>nb,MediaQuery:()=>rb,MediaQueryList:()=>ob,Nth:()=>ib,Number:()=>sb,Operator:()=>ab,Parentheses:()=>lb,Percentage:()=>cb,PseudoClassSelector:()=>ub,PseudoElementSelector:()=>db,Ratio:()=>fb,Raw:()=>pb,Rule:()=>gb,Selector:()=>bb,SelectorList:()=>yb,String:()=>wb,StyleSheet:()=>Ab,TypeSelector:()=>_b,UnicodeRange:()=>Nb,Url:()=>Rb,Value:()=>Ob,WhiteSpace:()=>Pb}),$R={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:LR,atrule:DR,pseudo:HR,node:FR},WR={node:Ib},qR=b2({...lR,...$R,...WR});function Xu(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof Ve?r=r.map(Xu):r.constructor===Object&&(r=Xu(r))),t[n]=r}return t}var{tokenize:Nq,parse:zR,generate:Cn,lexer:qb,createLexer:xq,walk:At,find:Mq,findLast:Rq,findAll:Oq,toPlainObject:Pq,fromPlainObject:Iq,fork:VR}=qR,{hasOwnProperty:UR}=Object.prototype;function Yu(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 zb(e){if(!e)return null;const t=Yu(e.tags,!0),n=Yu(e.ids),r=Yu(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function jR(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(UR.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:zb(e),blacklist:zb(e.blacklist),scopes:t}}function _r(e){return!e||!e.children||e.children.isEmpty}function Vb(e,t){return e!==null&&e.children===t}function GR(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),_r(e.block))){n.remove(t);return}switch(e.name){case"charset":if(_r(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=rn(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(_r(e.prelude)||_r(e.block))&&n.remove(t)}}}function XR(e,t,n){n.remove(t)}function YR(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}go(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function KR(e,t,n){(Vb(this.stylesheet,n)||Vb(this.block,n))&&n.remove(t)}var{hasOwnProperty:Co}=Object.prototype,ZR=new Set(["keyframes"]);function Ub(e,t){return e.children.forEach((n,r,o)=>{let i=!1;At(n,function(s){if(this.selector===null||this.selector===e)switch(s.type){case"SelectorList":(this.function===null||this.function.name.toLowerCase()!=="not")&&Ub(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!Co.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&Co.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!Co.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&Co.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&&!Co.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&Co.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function QR(e,t,n,r){if(_r(e.prelude)||_r(e.block)){n.remove(t);return}if(this.atrule&&ZR.has(rn(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(Ub(e.prelude,o),_r(e.prelude))){n.remove(t);return}}function JR(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 eO(e,t,n){n.remove(t)}var jb={Atrule:GR,Comment:XR,Declaration:YR,Raw:KR,Rule:QR,TypeSelector:JR,WhiteSpace:eO};function tO(e,t){At(e,{leave(n,r,o){jb.hasOwnProperty(n.type)&&jb[n.type].call(this,n,r,o,t)}})}function nO(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 rO(e){rn(e.name).basename==="keyframes"&&nO(e)}var oO=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function iO(e){return e===""||e==="-"?!1:!oO.test(e)}function sO(e){const t=e.value;!t||t.type!=="String"||iO(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function aO(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 lO(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 cO(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 Ve().fromArray(n)}function Gb(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 Xb={font:aO,"font-weight":lO,background:cO,border:Gb,outline:Gb};function uO(e){if(!this.declaration)return;const t=go(this.declaration.property);Xb.hasOwnProperty(t.basename)&&Xb[t.basename](e)}var dO=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,mO=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,fO=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function Fa(e,t){const n=t&&t.prev!==null&&fO.has(t.prev.data.type)?mO:dO;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function pO(e){e.value=Fa(e.value)}var hO=new Set(["calc","min","max","clamp"]),gO=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function bO(e,t){const n=Fa(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!gO.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&hO.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var yO=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function vO(e,t){e.value=Fa(e.value),e.value==="0"&&this.declaration&&!yO.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},qb.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function EO(e){e.value=e.value.replace(/\\/g,"/")}var Yb={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"},Kb={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 Ku(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 Zb(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=Ku(l,a,e+1/3),i=Ku(l,a,e),s=Ku(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function Zu(e){return e=e.toString(16),e.length===1?"0"+e:e}function Qu(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 SO(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=Qu(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=Zb(...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:Fa(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||Qu(e.children,3,!1),!r)return;r=Zb(...r),n="rgb"}if(n==="rgb"){if(r=r||Qu(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:Zu(r[0])+Zu(r[1])+Zu(r[2])},Qb(t.data,t)}}function wO(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(Yb.hasOwnProperty(n)&&qb.matchDeclaration(this.declaration).isType(e,"color")){const r=Yb[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function Qb(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]),Kb[n]?t.data={type:"Identifier",loc:e.loc,name:Kb[n]}:e.value=n}var Jb={Atrule:rO,AttributeSelector:sO,Value:uO,Dimension:bO,Percentage:vO,Number:pO,Url:EO,Hash:Qb,Identifier:wO,Function:SO};function CO(e){At(e,{leave(t,n,r){Jb.hasOwnProperty(t.type)&&Jb[t.type].call(this,t,n,r)}})}var AO=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 TO(){const e=new AO;return function(n){const r=Cn(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function _O(e){return e.type==="Raw"?zR(e.value,{context:"selectorList"}):e}function kO(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function ey(e){return _O(e).children.reduce((t,n)=>kO(Ju(n),t),[0,0,0])}function Ju(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]=ey(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]=ey(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 LO=new Set(["first-letter","first-line","after","before"]),NO=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function xO(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: "+Cn(r));i=a}break;case"PseudoClassSelector":{const a=s.name.toLowerCase();NO.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();LO.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=Ju(r).toString(),r.id=null,r.id=Cn(r),i&&(r.compareMarker+=":"+i),o!=="*"&&(r.compareMarker+=","+o)}),e.pseudoSignature=n.size>0?[...n].sort().join(","):!1}function MO(e,t){const n=TO();return At(e,{visit:"Rule",enter(r){r.block.children.forEach(n),xO(r,t.usage)}}),At(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=Cn(r.prelude)),rn(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:ty}=Object.prototype;function ny(e,t,n,r){const o=t.data,i=rn(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);ty.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],ty.call(e[i],s)||(e[i][s]=new Ve),e[i][s].append(n.remove(t))}function RO(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=rn(o.name).basename;switch(a){case"keyframes":ny(n,i,s,!0);return;case"media":if(t.forceMediaMerge){ny(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 ry(e){return e.type==="Atrule"&&e.name==="media"}function OO(e,t,n){if(!ry(e))return;const r=t.prev&&t.prev.data;!r||!ry(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function PO(e,t){RO(e,t),At(e,{visit:"Atrule",reverse:!0,enter:OO})}var{hasOwnProperty:IO}=Object.prototype;function oy(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 iy(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 DO(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]&&((!IO.call(r,s.fingerprint)||!r[s.fingerprint]&&s.important)&&n.ne2.push(s),n.ne2overrided.push(s))}return n}function ki(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 sy(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 $a(e){switch(e.type){case"Rule":return sy(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some($a,this);break;case"Declaration":return!1}return!0}function BO(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return $a.call(r,i);const s=i.prelude.children,a=i.block.children;if(e.pseudoSignature===i.pseudoSignature){if(oy(s,r))return a.appendList(o),n.remove(t),!0;if(iy(o,a))return ki(s,r),n.remove(t),!0}return sy(r,s)})}function HO(e){At(e,{visit:"Rule",enter:BO})}function FO(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new Ve;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 $O(e){At(e,{visit:"Rule",reverse:!0,enter:FO})}var ay=1,WO=2,Ao=0,Li=1,ed=2,Wa=3,ly=["top","right","bottom","left"],qO={"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"},cy={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"},zO=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=qO[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[Li]=i[Ao],i[ed]=i[Ao],i[Wa]=i[Ao];break;case 2:i[ed]=i[Ao],i[Wa]=i[Li];break;case 3:i[Wa]=i[Li]}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(ly[s],i[s])&&(r[ly[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 Ve,t=this.sides,n=[t.top,t.right,t.bottom,t.left],r=[Cn(t.top.node),Cn(t.right.node),Cn(t.bottom.node),Cn(t.left.node)];r[Wa]===r[Li]&&(n.pop(),r[ed]===r[Ao]&&(n.pop(),r[Li]===r[Ao]&&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 VO(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(!cy.hasOwnProperty(l))return;const c=cy[l];let u,d;if((!r||i===r)&&c in t&&(d=WO,u=t[c]),(!u||!u.add(l,s))&&(d=ay,u=new zO(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 UO(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===ay?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function jO(e,t){const n={},r=[];At(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=VO.call(this,o,l,r,a.lastShortSelector)}}),UO(r,t.declaration)}var GO=1,XO=new Set(["src"]),uy={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},dy={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"]},my={"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 fy(e,t,n){const r=go(e).basename;if(r==="background")return e+":"+Cn(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:m}=d;a||(a=rn(m).vendor),/\\[09]/.test(m)&&(l=RegExp.lastMatch),dy.hasOwnProperty(r)?dy[r].indexOf(m)===-1&&(s[m]=!0):uy.hasOwnProperty(r)&&uy[r].test(m)&&(s[m]=!0);break}case"Function":{let{name:m}=d;a||(a=rn(m).vendor),m==="rect"&&(d.children.some(p=>p.type==="Operator"&&p.value===",")||(m="rect-backward")),s[m+"()"]=!0,d.children.forEach(u);break}case"Dimension":{const{unit:m}=d;switch(/\\[09]/.test(m)&&(l=RegExp.lastMatch),m){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":s[m]=!0}break}}}),i=c?"!"+GO++:"!"+Object.keys(s).sort()+"|"+l+a;break;case"Raw":i="!"+t.value.value;break;default:i=Cn(t.value)}n[o]=i}return e+i}function YO(e,t,n){const r=go(t.property);if(my.hasOwnProperty(r.basename)){const o=my[r.basename];for(const i of o){const s=fy(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function KO(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=fy(l,s,o),u=r[c];u&&!XO.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):YO(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function ZO(e){const t={},n=Object.create(null);At(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),KO.call(this,r,o,i,c,n)}})}function QO(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 $a.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(iy(o,u)){const m=c.data.id;r.some((p,f)=>{const h=p.id;if(m<h)return r.insert(c,f),!0;if(!f.next)return r.insert(c),!0}),n.remove(l);return}if(d===i)return!0;s[d]=!0})}function JO(e){At(e,{visit:"Rule",enter:QO})}function td(e){return e.reduce((t,n)=>t+n.id.length+1,0)-1}function nd(e){let t=0;for(const n of e)t+=n.length;return t+e.length-1}function e5(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,m=c.type;if(m!=="Rule"){const h=$a.call(o,c);return!h&&m==="Atrule"&&d&&At(d,{visit:"Rule",enter(y){y.prelude.children.forEach(v=>{s[v.compareMarker]=!0})}}),h}if(e.pseudoSignature!==c.pseudoSignature)return!0;const p=c.prelude.children;if(l=!p.some(h=>h.compareMarker in s),!l&&!a)return!0;if(a&&oy(p,o))return d.children.appendList(i.children),n.remove(t),!0;const f=DO(i.children,d.children);if(f.eq.length){if(!f.ne1.length&&!f.ne2.length)return l&&(ki(o,p),n.remove(u)),!0;if(!r)if(f.ne1.length&&!f.ne2.length){const h=td(o),y=nd(f.eq);a&&h<y&&(ki(p,o),i.children.fromArray(f.ne1))}else if(!f.ne1.length&&f.ne2.length){const h=td(p),y=nd(f.eq);l&&h<y&&(ki(o,p),d.children.fromArray(f.ne2))}else{const h={type:"SelectorList",loc:null,children:ki(p.copy(),o)},y=td(h.children)+2;if(nd(f.eq)>=y){const v=n.createItem({type:"Rule",loc:null,prelude:h,block:{type:"Block",loc:null,children:new Ve().fromArray(f.eq)},pseudoSignature:e.pseudoSignature});return i.children.fromArray(f.ne1),d.children.fromArray(f.ne2overrided),a?n.insert(v,u):n.insert(v,t),!0}}}a&&(a=!p.some(h=>o.some(y=>y.compareMarker===h.compareMarker))),p.forEach(h=>{s[h.compareMarker]=!0})})}function t5(e){At(e,{visit:"Rule",reverse:!0,enter:e5})}function n5(e,t){const n=MO(e,t);t.logger("prepare",e),PO(e,t),t.logger("mergeAtrule",e),HO(e),t.logger("initialMergeRuleset",e),$O(e),t.logger("disjoinRuleset",e),jO(e,n),t.logger("restructShorthand",e),ZO(e),t.logger("restructBlock",e),JO(e),t.logger("mergeRuleset",e),t5(e),t.logger("restructRuleset",e)}function r5(e,t){const n=new Ve;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 o5(e,t,n,r){r.logger(`Compress block #${n}`,null,!0);let o=1;return e.type==="StyleSheet"&&(e.firstAtrulesAllowed=t,e.id=o++),At(e,{visit:"Atrule",enter(i){i.block!==null&&(i.block.id=o++)}}),r.logger("init",e),tO(e,r),r.logger("clean",e),CO(e,r),r.logger("replace",e),r.restructuring&&n5(e,r),e}function i5(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 s5(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function a5(e){return new Ve().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new Ve().appendData({type:"Selector",loc:null,children:new Ve().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function l5(e,t){e=e||{type:"StyleSheet",loc:null,children:new Ve},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:s5(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?jR(t.usage):!1},r=new Ve;let o=i5(t),i=!0,s,a,l=1,c;t.clone&&(e=Xu(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=a5(e);do{if(a=r5(s,!!o),o5(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(Ve.createItem({type:"Raw",value:`
39
+ --`+new Array((n||t.length)+1).join("-")+"^"})}var SL=9,wL=10,CL=12,AL=13,TL=32,_L=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!==AL&&t!==wL&&t!==CL&&t!==TL&&t!==SL)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 EL(e,this.str,this.pos)}},kL=9,LL=10,NL=12,xL=13,ML=32,Qh=33,Cu=35,Jh=38,La=39,eg=40,RL=41,tg=42,Au=43,Tu=44,ng=45,_u=60,rg=62,ku=63,OL=64,Na=91,Lu=93,xa=123,og=124,ig=125,sg=8734,wi=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),ag={" ":1,"&&":2,"||":3,"|":4};function Ma(e){return e.substringToPos(e.findWsEnd(e.pos))}function yo(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||wi[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Ra(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 PL(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 lg(e){let t=null,n=null;return e.eat(xa),t=Ra(e),e.charCode()===Tu?(e.pos++,e.charCode()!==ig&&(n=Ra(e))):n=t,e.eat(ig),{min:Number(t),max:n?Number(n):0}}function IL(e){let t=null,n=!1;switch(e.charCode()){case tg:e.pos++,t={min:0,max:0};break;case Au:e.pos++,t={min:1,max:0};break;case ku:e.pos++,t={min:0,max:1};break;case Cu:e.pos++,n=!0,e.charCode()===xa?t=lg(e):e.charCode()===ku?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case xa:t=lg(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function vo(e,t){const n=IL(e);return n!==null?(n.term=t,e.charCode()===Cu&&e.charCodeAt(e.pos-1)===Au?vo(e,n):n):t}function Nu(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function DL(e){let t;return e.eat(_u),e.eat(La),t=yo(e),e.eat(La),e.eat(rg),vo(e,{type:"Property",name:t})}function BL(e){let t=null,n=null,r=1;return e.eat(Na),e.charCode()===ng&&(e.peek(),r=-1),r==-1&&e.charCode()===sg?e.peek():(t=r*Number(Ra(e)),wi[e.charCode()]!==0&&(t+=yo(e))),Ma(e),e.eat(Tu),Ma(e),e.charCode()===sg?e.peek():(r=1,e.charCode()===ng&&(e.peek(),r=-1),n=r*Number(Ra(e)),wi[e.charCode()]!==0&&(n+=yo(e))),e.eat(Lu),{type:"Range",min:t,max:n}}function HL(e){let t,n=null;return e.eat(_u),t=yo(e),e.charCode()===eg&&e.nextCharCode()===RL&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===Na&&(Ma(e),n=BL(e)),e.eat(rg),vo(e,{type:"Type",name:t,opts:n})}function FL(e){const t=yo(e);return e.charCode()===eg?(e.pos++,{type:"Function",name:t}):vo(e,{type:"Keyword",name:t})}function $L(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)=>ag[o]-ag[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 cg(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=qL(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:$L(t,n)||" ",disallowEmpty:!1,explicit:!1}}function WL(e){let t;return e.eat(Na),t=cg(e),e.eat(Lu),t.explicit=!0,e.charCode()===Qh&&(e.pos++,t.disallowEmpty=!0),t}function qL(e){let t=e.charCode();if(t<128&&wi[t]===1)return FL(e);switch(t){case Lu:break;case Na:return vo(e,WL(e));case _u:return e.nextCharCode()===La?DL(e):HL(e);case og:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===og?2:1))};case Jh:return e.pos++,e.eat(Jh),{type:"Combinator",value:"&&"};case Tu:return e.pos++,{type:"Comma"};case La:return vo(e,{type:"String",value:PL(e)});case ML:case kL:case LL:case xL:case NL:return{type:"Spaces",value:Ma(e)};case OL:return t=e.nextCharCode(),t<128&&wi[t]===1?(e.pos++,{type:"AtKeyword",name:yo(e)}):Nu(e);case tg:case Au:case ku:case Cu:case Qh:break;case xa:if(t=e.nextCharCode(),t<48||t>57)return Nu(e);break;default:return Nu(e)}}function ug(e){const t=new _L(e),n=cg(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var Ci=function(){};function dg(e){return typeof e=="function"?e:Ci}function zL(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=Ci,i=Ci;if(typeof t=="function"?o=t:t&&(o=dg(t.enter),i=dg(t.leave)),o===Ci&&i===Ci)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var VL={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 UL(e){const t=[];return Sa(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function jL(e,t){return typeof e=="string"?UL(e):t.generate(e,VL)}var ye={type:"Match"},Ce={type:"Mismatch"},xu={type:"DisallowEmpty"},GL=40,XL=41;function ut(e,t,n){return t===ye&&n===Ce||e===ye&&t===ye&&n===ye?e:(e.type==="If"&&e.else===Ce&&t===ye&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function mg(e){return e.length>2&&e.charCodeAt(e.length-2)===GL&&e.charCodeAt(e.length-1)===XL}function fg(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&mg(e.name)}function Mu(e,t,n){switch(e){case" ":{let r=ye;for(let o=t.length-1;o>=0;o--){const i=t[o];r=ut(i,r,Ce)}return r}case"|":{let r=Ce,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(fg(s)&&(o===null&&i>0&&fg(t[i-1])&&(o=Object.create(null),r=ut({type:"Enum",map:o},ye,r)),o!==null)){const a=(mg(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=ut(s,ye,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=Ce;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Mu(e,t.filter(function(a){return a!==i}),!1):s=ye,r=ut(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?ye:Ce;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Mu(e,t.filter(function(a){return a!==i}),!0):s=ye,r=ut(i,s,r)}return r}}}function YL(e){let t=ye,n=Ru(e.term);if(e.max===0)n=ut(n,xu,Ce),t=ut(n,null,Ce),t.then=ut(ye,ye,t),e.comma&&(t.then.else=ut({type:"Comma",syntax:e},t,Ce));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==ye&&(t=ut({type:"Comma",syntax:e},t,Ce)),t=ut(n,ut(ye,ye,t),Ce);if(e.min===0)t=ut(ye,ye,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==ye&&(t=ut({type:"Comma",syntax:e},t,Ce)),t=ut(n,t,Ce);return t}function Ru(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Mu(e.combinator,e.terms.map(Ru),!1);return e.disallowEmpty&&(t=ut(t,xu,Ce)),t}case"Multiplier":return YL(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 Ou(e,t){return typeof e=="string"&&(e=ug(e)),{type:"MatchGraph",match:Ru(e),syntax:t||null,source:e}}var{hasOwnProperty:pg}=Object.prototype,KL=0,ZL=1,Pu=2,hg=3,gg="Match",QL="Mismatch",JL="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",e2=15e3,t2=0;function n2(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function Iu(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 r2(e){return e.type!==9?!1:e.value!=="?"}function bg(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||r2(e)}function yg(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function o2(e,t,n){function r(){do A++,v=A<e.length?e[A]:null;while(v!==null&&(v.type===13||v.type===25))}function o(b){const E=A+b;return E<e.length?e[E]:null}function i(b,E){return{nextState:b,matchStack:S,syntaxStack:d,thenStack:m,tokenIndex:A,prev:E}}function s(b){m={nextState:b,matchStack:S,syntaxStack:d,prev:m}}function a(b){p=i(b,p)}function l(){S={type:ZL,syntax:t.syntax,token:v,prev:S},r(),f=null,A>k&&(k=A)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},S={type:Pu,syntax:t.syntax,token:S.token,prev:S}}function u(){S.type===Pu?S=S.prev:S={type:hg,syntax:d.syntax,token:S.token,prev:S},d=d.prev}let d=null,m=null,p=null,f=null,h=0,y=null,v=null,A=-1,k=0,S={type:KL,syntax:null,token:null,prev:null};for(r();y===null&&++h<e2;)switch(t.type){case"Match":if(m===null){if(v!==null&&(A!==e.length-1||v.value!=="\\0"&&v.value!=="\\9")){t=Ce;break}y=gg;break}if(t=m.nextState,t===xu)if(m.matchStack===S){t=Ce;break}else t=ye;for(;m.syntaxStack!==d;)u();m=m.prev;break;case"Mismatch":if(f!==null&&f!==!1)(p===null||A>p.tokenIndex)&&(p=f,f=!1);else if(p===null){y=QL;break}t=p.nextState,m=p.thenStack,d=p.syntaxStack,S=p.matchStack,A=p.tokenIndex,v=A<e.length?e[A]:null,p=p.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==Ce&&a(t.else),t.then!==ye&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const C=t.syntax.terms;if(t.index===C.length){if(t.mask===0||t.syntax.all){t=Ce;break}t=ye;break}if(t.mask===(1<<C.length)-1){t=ye;break}for(;t.index<C.length;t.index++){const g=1<<t.index;if((t.mask&g)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|g}),t=C[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(v!==null){let C=v.value.toLowerCase();if(C.indexOf("\\")!==-1&&(C=C.replace(/\\[09].*$/,"")),pg.call(t.map,C)){t=t.map[C];break}}t=Ce;break;case"Generic":{const C=d!==null?d.opts:null,g=A+Math.floor(t.fn(v,o,C));if(!isNaN(g)&&g>A){for(;A<g;)l();t=ye}else t=Ce;break}case"Type":case"Property":{const C=t.type==="Type"?"types":"properties",g=pg.call(n,C)?n[C][t.name]:null;if(!g||!g.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(f!==!1&&v!==null&&t.type==="Type"&&(t.name==="custom-ident"&&v.type===1||t.name==="length"&&v.value==="0")){f===null&&(f=i(t,p)),t=Ce;break}c(),t=g.match;break}case"Keyword":{const C=t.name;if(v!==null){let g=v.value;if(g.indexOf("\\")!==-1&&(g=g.replace(/\\[09].*$/,"")),Iu(g,C)){l(),t=ye;break}}t=Ce;break}case"AtKeyword":case"Function":if(v!==null&&Iu(v.value,t.name)){l(),t=ye;break}t=Ce;break;case"Token":if(v!==null&&v.value===t.value){l(),t=ye;break}t=Ce;break;case"Comma":v!==null&&v.type===18?bg(S.token)?t=Ce:(l(),t=yg(v)?Ce:ye):t=bg(S.token)||yg(v)?ye:Ce;break;case"String":let b="",E=A;for(;E<e.length&&b.length<t.value.length;E++)b+=e[E].value;if(Iu(b,t.value)){for(;A<E;)l();t=ye}else t=Ce;break;default:throw new Error("Unknown node type: "+t.type)}switch(t2+=h,y){case null:y=JL,S=null;break;case gg:for(;d!==null;)u();break;default:S=null}return{tokens:e,reason:y,iterations:h,match:S,longestMatch:k}}function vg(e,t,n){const r=o2(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=n2(o).prev;o!==null;){switch(o.type){case Pu:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case hg: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 i2=ie({getTrace:()=>Eg,isKeyword:()=>l2,isProperty:()=>a2,isType:()=>s2});function Eg(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 s2(e,t){return Du(this,e,n=>n.type==="Type"&&n.name===t)}function a2(e,t){return Du(this,e,n=>n.type==="Property"&&n.name===t)}function l2(e){return Du(this,e,t=>t.type==="Keyword")}function Du(e,t,n){const r=Eg.call(e,t);return r===null?!1:r.some(n)}function Sg(e){return"node"in e?e.node:Sg(e.match[0])}function wg(e){return"node"in e?e.node:wg(e.match[e.match.length-1])}function Cg(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=Sg(a),c=wg(a);e.syntax.walk(t,function(u,d,m){if(u===l){const p=new Ve;do{if(p.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:m,nodes:p})}})}Array.isArray(a.match)&&a.match.forEach(i)}const s=[];return n.matched!==null&&i(n.matched),s}var{hasOwnProperty:Ai}=Object.prototype;function Bu(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function Ag(e){return!!e&&Bu(e.offset)&&Bu(e.line)&&Bu(e.column)}function c2(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(Ai.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(!Ag(r.loc.start))i+=".start";else if(!Ag(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 Ve)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)Ai.call(t,i)&&Ai.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function u2(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if(Ai.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:c2(e,r)}}function d2(e){const t={};if(e.node){for(const n in e.node)if(Ai.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=u2(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var m2=Ou(Vh.join(" | "));function Hu(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:gu(e[o].syntax,{compact:t}));return r}function f2(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:gu(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&Hu(i.descriptors,t,n)};return r}function p2(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function sn(e,t,n){return{matched:e,iterations:n,error:t,...i2}}function Eo(e,t,n,r){const o=jL(n,e.syntax);let i;return p2(o)?sn(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=vg(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=vg(o,t.match,e),!i.match)?sn(null,new jk(i.reason,t.syntax,n,i),i.iterations):sn(i.match,null,i.iterations))}var Tg=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=m2,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||d2(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 Zh)this.addType_(r,Zh[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=Ou(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:ug(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Ou(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 yi("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&&!Eo(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=rn(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 yi("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new yi("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return sn(null,n);const r=this.getAtrule(e);return r.prelude?Eo(this,r.prelude,t||"",!1):sn(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return sn(null,r);const o=this.getAtrule(e),i=rn(t);return Eo(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?sn(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(go(e).custom)return sn(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?sn(null,n):Eo(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?Eo(this,n,t,!1):sn(null,new yi("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?sn(null,new yi("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),Eo(this,e,t,!1))}findValueFragments(e,t,n,r){return Cg(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return Cg(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=rn(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=go(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&&zL(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:Hu(this.types,!t,e),properties:Hu(this.properties,!t,e),atrules:f2(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:So}=Object.prototype,h2={generic:!0,types:Fu,atrules:{prelude:Ng,descriptors:Ng},properties:Fu,parseContext:g2,scope:kg,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Oa(e){return e&&e.constructor===Object}function _g(e){return Oa(e)?{...e}:e}function g2(e,t){return Object.assign(e,t)}function kg(e,t){for(const n in t)So.call(t,n)&&(Oa(e[n])?kg(e[n],t[n]):e[n]=_g(t[n]));return e}function Lg(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Fu(e,t){if(typeof t=="string")return Lg(e,t);const n={...e};for(let r in t)So.call(t,r)&&(n[r]=Lg(So.call(e,r)?e[r]:void 0,t[r]));return n}function Ng(e,t){const n=Fu(e,t);return!Oa(n)||Object.keys(n).length?n:null}function Ti(e,t,n){for(const r in n)if(So.call(n,r)!==!1){if(n[r]===!0)So.call(t,r)&&(e[r]=_g(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(Oa(n[r])){const o={};for(let i in e[r])o[i]=Ti({},e[r][i],n[r]);for(let i in t[r])o[i]=Ti(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&&Ti(o[s],a,i);for(const s in t[r])So.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&Ti(o[s],t[r][s],i));e[r]=o}}}return e}var $u=(e,t)=>Ti(e,t,h2);function xg(e){const t=Sk(e),n=$k(e),r=Dk(e),{fromPlainObject:o,toPlainObject:i}=Bk(n),s={lexer:null,createLexer:a=>new Tg(a,s,s.lexer.structure),tokenize:Sa,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=$u({},e);return xg(typeof a=="function"?a(l,Object.assign):$u(l,a))}};return s.lexer=new Tg({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var b2=e=>xg($u({},e)),y2={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>"}}}},v2=ie({generate:()=>C2,name:()=>S2,parse:()=>Mg,structure:()=>w2}),wn=43,Mt=45,Pa=110,Ar=!0,E2=!1;function Ia(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===wn||r===Mt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)it(this.charCodeAt(n))||this.error("Integer is expected",n)}function wo(e){return Ia.call(this,0,e)}function rr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Pa:n="N is expected";break;case Mt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function Wu(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(wn,e)||this.isDelim(Mt,e)){t=this.isDelim(wn,e)?wn:Mt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),wo.call(this,Ar))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==wn&&n!==Mt&&this.error("Number sign is expected")),wo.call(this,t!==0),t===Mt?"-"+this.consume(10):this.consume(10)}var S2="AnPlusB",w2={a:[String,null],b:[String,null]};function Mg(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)wo.call(this,E2),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Mt))switch(t="-1",rr.call(this,1,Pa),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Wu.call(this);break;case 3:rr.call(this,2,Mt),this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10);break;default:rr.call(this,2,Mt),Ia.call(this,3,Ar),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(wn)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(wn)&&(r=1,this.next()),rr.call(this,0,Pa),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Wu.call(this);break;case 2:rr.call(this,1,Mt),this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10);break;default:rr.call(this,1,Mt),Ia.call(this,2,Ar),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===wn||r===Mt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&it(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),rr.call(this,i-this.tokenStart,Pa),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=Wu.call(this)):(rr.call(this,i-this.tokenStart+1,Mt),i+2===this.tokenEnd?(this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10)):(Ia.call(this,i-this.tokenStart+2,Ar),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===wn&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===wn&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function C2(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 A2=ie({generate:()=>N2,name:()=>_2,parse:()=>Og,structure:()=>L2,walkContext:()=>k2});function Rg(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function T2(){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 _2="Atrule",k2="atrule",L2={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function Og(){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),Rg):r=Rg.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(T2.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function N2(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var x2=ie({generate:()=>P2,name:()=>M2,parse:()=>Pg,structure:()=>O2,walkContext:()=>R2}),M2="AtrulePrelude",R2="atrulePrelude",O2={children:[[]]};function Pg(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 P2(e){this.children(e)}var I2=ie({generate:()=>z2,name:()=>W2,parse:()=>Dg,structure:()=>q2}),D2=36,Ig=42,Da=61,B2=94,qu=124,H2=126;function F2(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(Ig)?(t=!0,this.next()):this.isDelim(qu)||this.eat(1),this.isDelim(qu)?this.charCodeAt(this.tokenStart+1)!==Da?(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 $2(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==Da&&t!==H2&&t!==B2&&t!==D2&&t!==Ig&&t!==qu&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Da&&(this.isDelim(Da)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var W2="AttributeSelector",q2={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Dg(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=F2.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=$2.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 z2(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 V2=ie({generate:()=>K2,name:()=>G2,parse:()=>Fg,structure:()=>Y2,walkContext:()=>X2});function Bg(e){return this.Raw(e,null,!0)}function U2(){return this.parseWithFallback(this.Rule,Bg)}function Hg(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function j2(){if(this.tokenType===17)return Hg.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Hg);return this.tokenType===17&&this.next(),e}var G2="Block",X2="block",Y2={children:[["Atrule","Rule","Declaration"]]};function Fg(e){const t=e?j2:U2,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,Bg));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function K2(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var Z2=ie({generate:()=>eN,name:()=>Q2,parse:()=>$g,structure:()=>J2}),Q2="Brackets",J2={children:[[]]};function $g(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 eN(e){this.token(9,"["),this.children(e),this.token(9,"]")}var tN=ie({generate:()=>rN,name:()=>"CDC",parse:()=>Wg,structure:()=>nN}),Aq="CDC",nN=[];function Wg(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function rN(){this.token(15,"-->")}var oN=ie({generate:()=>sN,name:()=>"CDO",parse:()=>qg,structure:()=>iN}),Tq="CDO",iN=[];function qg(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function sN(){this.token(14,"<!--")}var aN=ie({generate:()=>dN,name:()=>cN,parse:()=>zg,structure:()=>uN}),lN=46,cN="ClassSelector",uN={name:String};function zg(){return this.eatDelim(lN),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function dN(e){this.token(9,"."),this.token(1,e.name)}var mN=ie({generate:()=>yN,name:()=>gN,parse:()=>Ug,structure:()=>bN}),fN=43,Vg=47,pN=62,hN=126,gN="Combinator",bN={name:String};function Ug(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case pN:case fN:case hN:this.next();break;case Vg:this.next(),this.eatIdent("deep"),this.eatDelim(Vg);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function yN(e){this.tokenize(e.name)}var vN=ie({generate:()=>AN,name:()=>wN,parse:()=>jg,structure:()=>CN}),EN=42,SN=47,wN="Comment",CN={value:String};function jg(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===EN&&this.charCodeAt(t-1)===SN&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function AN(e){this.token(25,"/*"+e.value+"*/")}var TN=ie({generate:()=>BN,name:()=>PN,parse:()=>Yg,structure:()=>DN,walkContext:()=>IN}),Gg=33,_N=35,kN=36,LN=38,NN=42,xN=43,Xg=47;function MN(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function RN(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function ON(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(Gg)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var PN="Declaration",IN="declaration",DN={important:[Boolean,String],property:String,value:["Value","Raw"]};function Yg(){const e=this.tokenStart,t=this.tokenIndex,n=HN.call(this),r=bu(n),o=r?this.parseCustomProperty:this.parseValue,i=r?RN:MN;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(ON,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(Gg)&&(s=FN.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 BN(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 HN(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case NN:case kN:case xN:case _N:case LN:this.next();break;case Xg:this.next(),this.isDelim(Xg)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function FN(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var $N=ie({generate:()=>VN,name:()=>qN,parse:()=>Kg,structure:()=>zN});function WN(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var qN="DeclarationList",zN={children:[["Declaration"]]};function Kg(){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,WN))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function VN(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var UN=ie({generate:()=>XN,name:()=>jN,parse:()=>Zg,structure:()=>GN}),jN="Dimension",GN={value:String,unit:String};function Zg(){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 XN(e){this.token(12,e.value+e.unit)}var YN=ie({generate:()=>JN,name:()=>KN,parse:()=>Qg,structure:()=>QN,walkContext:()=>ZN}),KN="Function",ZN="function",QN={name:String,children:[[]]};function Qg(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 JN(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var ex=ie({generate:()=>rx,name:()=>tx,parse:()=>Jg,structure:()=>nx,xxx:()=>"XXX"}),_q="XXX",tx="Hash",nx={value:String};function Jg(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function rx(e){this.token(4,"#"+e.value)}var ox=ie({generate:()=>ax,name:()=>ix,parse:()=>eb,structure:()=>sx}),ix="Identifier",sx={name:String};function eb(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function ax(e){this.token(1,e.name)}var lx=ie({generate:()=>dx,name:()=>cx,parse:()=>tb,structure:()=>ux}),cx="IdSelector",ux={name:String};function tb(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function dx(e){this.token(9,"#"+e.name)}var mx=ie({generate:()=>hx,name:()=>fx,parse:()=>nb,structure:()=>px}),fx="MediaFeature",px={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function nb(){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 hx(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var gx=ie({generate:()=>vx,name:()=>bx,parse:()=>rb,structure:()=>yx}),bx="MediaQuery",yx={children:[["Identifier","MediaFeature","WhiteSpace"]]};function rb(){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 vx(e){this.children(e)}var Ex=ie({generate:()=>Cx,name:()=>Sx,parse:()=>ob,structure:()=>wx}),Sx="MediaQueryList",wx={children:[["MediaQuery"]]};function ob(){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 Cx(e){this.children(e,()=>this.token(18,","))}var Ax=ie({generate:()=>_x,name:()=>"Nth",parse:()=>ib,structure:()=>Tx}),kq="Nth",Tx={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function ib(){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 _x(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var kx=ie({generate:()=>xx,name:()=>Lx,parse:()=>sb,structure:()=>Nx}),Lx="Number",Nx={value:String};function sb(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function xx(e){this.token(10,e.value)}var Mx=ie({generate:()=>Px,name:()=>Rx,parse:()=>ab,structure:()=>Ox}),Rx="Operator",Ox={value:String};function ab(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Px(e){this.tokenize(e.value)}var Ix=ie({generate:()=>Hx,name:()=>Dx,parse:()=>lb,structure:()=>Bx}),Dx="Parentheses",Bx={children:[[]]};function lb(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 Hx(e){this.token(21,"("),this.children(e),this.token(22,")")}var Fx=ie({generate:()=>qx,name:()=>$x,parse:()=>cb,structure:()=>Wx}),$x="Percentage",Wx={value:String};function cb(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function qx(e){this.token(11,e.value+"%")}var zx=ie({generate:()=>Gx,name:()=>Vx,parse:()=>ub,structure:()=>jx,walkContext:()=>Ux}),Vx="PseudoClassSelector",Ux="function",jx={name:String,children:[["Raw"],null]};function ub(){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 Gx(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var Xx=ie({generate:()=>Qx,name:()=>Yx,parse:()=>db,structure:()=>Zx,walkContext:()=>Kx}),Yx="PseudoElementSelector",Kx="function",Zx={name:String,children:[["Raw"],null]};function db(){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 Qx(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 Jx=ie({generate:()=>oM,name:()=>nM,parse:()=>fb,structure:()=>rM}),eM=47,tM=46;function mb(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!it(n)&&n!==tM&&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 nM="Ratio",rM={left:String,right:String};function fb(){const e=this.tokenStart,t=mb.call(this);let n;return this.skipSC(),this.eatDelim(eM),n=mb.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function oM(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var iM=ie({generate:()=>lM,name:()=>"Raw",parse:()=>pb,structure:()=>aM});function sM(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var Lq="Raw",aM={value:String};function pb(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=sM.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function lM(e){this.tokenize(e.value)}var cM=ie({generate:()=>pM,name:()=>dM,parse:()=>gb,structure:()=>fM,walkContext:()=>mM});function hb(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function uM(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var dM="Rule",mM="rule",fM={prelude:["SelectorList","Raw"],block:["Block"]};function gb(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(uM,hb):n=hb.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function pM(e){this.node(e.prelude),this.node(e.block)}var hM=ie({generate:()=>yM,name:()=>gM,parse:()=>bb,structure:()=>bM}),gM="Selector",bM={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function bb(){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 yM(e){this.children(e)}var vM=ie({generate:()=>CM,name:()=>EM,parse:()=>yb,structure:()=>wM,walkContext:()=>SM}),EM="SelectorList",SM="selector",wM={children:[["Selector","Raw"]]};function yb(){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 CM(e){this.children(e,()=>this.token(18,","))}var zu=92,vb=34,Eb=39;function Sb(e){const t=e.length,n=e.charCodeAt(0),r=n===vb||n===Eb?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===zu){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),En(zu,a)){const l=s-1,c=fo(e,l);s=c-1,i+=wh(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function Vu(e,t){const n=t?"'":'"',r=t?Eb:vb;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===zu?(o+="\\"+e.charAt(s),i=!1):(i&&(er(a)||Cr(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var AM=ie({generate:()=>kM,name:()=>TM,parse:()=>wb,structure:()=>_M}),TM="String",_M={value:String};function wb(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Sb(this.consume(5))}}function kM(e){this.token(5,Vu(e.value))}var LM=ie({generate:()=>OM,name:()=>xM,parse:()=>Ab,structure:()=>RM,walkContext:()=>MM}),NM=33;function Cb(e){return this.Raw(e,null,!1)}var xM="StyleSheet",MM="stylesheet",RM={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function Ab(){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)!==NM){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,Cb);break;default:n=this.parseWithFallback(this.Rule,Cb)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function OM(e){this.children(e)}var PM=ie({generate:()=>HM,name:()=>DM,parse:()=>_b,structure:()=>BM}),IM=42,Tb=124;function Uu(){this.tokenType!==1&&this.isDelim(IM)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var DM="TypeSelector",BM={name:String};function _b(){const e=this.tokenStart;return this.isDelim(Tb)?(this.next(),Uu.call(this)):(Uu.call(this),this.isDelim(Tb)&&(this.next(),Uu.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function HM(e){this.tokenize(e.name)}var FM=ie({generate:()=>VM,name:()=>qM,parse:()=>Nb,structure:()=>zM}),kb=43,Lb=45,ju=63;function _i(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===Lb&&t&&n!==0)return _i.call(this,e+n+1,!1),-1;er(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 Ba(e){let t=0;for(;this.isDelim(ju);)++t>e&&this.error("Too many question marks"),this.next()}function $M(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===kb?"Plus sign":"Hyphen minus")+" is expected")}function WM(){let e=0;switch(this.tokenType){case 10:if(e=_i.call(this,1,!0),this.isDelim(ju)){Ba.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){$M.call(this,Lb),_i.call(this,1,!1);break}break;case 12:e=_i.call(this,1,!0),e>0&&Ba.call(this,6-e);break;default:if(this.eatDelim(kb),this.tokenType===1){e=_i.call(this,0,!0),e>0&&Ba.call(this,6-e);break}if(this.isDelim(ju)){this.next(),Ba.call(this,5);break}this.error("Hex digit or question mark is expected")}}var qM="UnicodeRange",zM={value:String};function Nb(){const e=this.tokenStart;return this.eatIdent("u"),WM.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function VM(e){this.tokenize(e.value)}var UM=32,Gu=92,jM=34,GM=39,XM=40,xb=41;function YM(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===xb?t-2:t-1,o="";for(;n<r&&Cr(e.charCodeAt(n));)n++;for(;n<r&&Cr(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===Gu){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),En(Gu,s)){const a=i-1,l=fo(e,a);i=l-1,o+=wh(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function Mb(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===UM||o===Gu||o===jM||o===GM||o===XM||o===xb?(t+="\\"+e.charAt(r),n=!1):(n&&er(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var KM=ie({generate:()=>QM,name:()=>"Url",parse:()=>Rb,structure:()=>ZM}),Nq="Url",ZM={value:String};function Rb(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=YM(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=Sb(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 QM(e){this.token(7,Mb(e.value))}var JM=ie({generate:()=>nR,name:()=>eR,parse:()=>Ob,structure:()=>tR}),eR="Value",tR={children:[[]]};function Ob(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function nR(e){this.children(e)}var rR=ie({generate:()=>aR,name:()=>iR,parse:()=>Pb,structure:()=>sR}),oR=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),iR="WhiteSpace",sR={value:String};function Pb(){return this.eat(13),oR}function aR(e){this.token(13,e.value)}var Ib=ie({AnPlusB:()=>v2,Atrule:()=>A2,AtrulePrelude:()=>x2,AttributeSelector:()=>I2,Block:()=>V2,Brackets:()=>Z2,CDC:()=>tN,CDO:()=>oN,ClassSelector:()=>aN,Combinator:()=>mN,Comment:()=>vN,Declaration:()=>TN,DeclarationList:()=>$N,Dimension:()=>UN,Function:()=>YN,Hash:()=>ex,IdSelector:()=>lx,Identifier:()=>ox,MediaFeature:()=>mx,MediaQuery:()=>gx,MediaQueryList:()=>Ex,Nth:()=>Ax,Number:()=>kx,Operator:()=>Mx,Parentheses:()=>Ix,Percentage:()=>Fx,PseudoClassSelector:()=>zx,PseudoElementSelector:()=>Xx,Ratio:()=>Jx,Raw:()=>iM,Rule:()=>cM,Selector:()=>hM,SelectorList:()=>vM,String:()=>AM,StyleSheet:()=>LM,TypeSelector:()=>PM,UnicodeRange:()=>FM,Url:()=>KM,Value:()=>JM,WhiteSpace:()=>rR}),lR={generic:!0,...y2,node:Ib},cR=35,uR=42,Db=43,dR=45,mR=47,fR=117;function Bb(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,fR)&&this.cmpChar(this.tokenStart+1,Db)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===mR||t===uR||t===Db||t===dR)return this.Operator();t===cR&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var pR={getNode:Bb},hR=35,gR=42,bR=43,yR=47,Hb=46,vR=62,ER=124,SR=126;function wR(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function CR(){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)===Hb&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case bR:case vR:case SR:case yR:return this.Combinator();case Hb:return this.ClassSelector();case gR:case ER:return this.TypeSelector();case hR:return this.IdSelector()}}}var AR={onWhiteSpace:wR,getNode:CR};function TR(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function _R(){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 Fb(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var kR={getNode:Bb,onWhiteSpace(e,t){Fb(e)&&(e.value=" "+e.value),Fb(t.last)&&(t.last.value+=" ")},expression:TR,var:_R},LR=ie({AtrulePrelude:()=>pR,Selector:()=>AR,Value:()=>kR}),NR={parse:{prelude:null,block(){return this.Block(!0)}}},xR={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}},MR={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},RR={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function OR(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function PR(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):$b.call(this)}function $b(){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(OR,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(PR,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var IR={parse:{prelude(){const e=$b.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},DR={"font-face":NR,import:xR,media:MR,page:RR,supports:IR},Tr={parse(){return this.createSingleNodeList(this.SelectorList())}},BR={parse(){return this.createSingleNodeList(this.Selector())}},Wb={parse(){return this.createSingleNodeList(this.Identifier())}},Ha={parse(){return this.createSingleNodeList(this.Nth())}},HR={dir:Wb,has:Tr,lang:Wb,matches:Tr,is:Tr,"-moz-any":Tr,"-webkit-any":Tr,where:Tr,not:Tr,"nth-child":Ha,"nth-last-child":Ha,"nth-last-of-type":Ha,"nth-of-type":Ha,slotted:BR},FR=ie({AnPlusB:()=>Mg,Atrule:()=>Og,AtrulePrelude:()=>Pg,AttributeSelector:()=>Dg,Block:()=>Fg,Brackets:()=>$g,CDC:()=>Wg,CDO:()=>qg,ClassSelector:()=>zg,Combinator:()=>Ug,Comment:()=>jg,Declaration:()=>Yg,DeclarationList:()=>Kg,Dimension:()=>Zg,Function:()=>Qg,Hash:()=>Jg,IdSelector:()=>tb,Identifier:()=>eb,MediaFeature:()=>nb,MediaQuery:()=>rb,MediaQueryList:()=>ob,Nth:()=>ib,Number:()=>sb,Operator:()=>ab,Parentheses:()=>lb,Percentage:()=>cb,PseudoClassSelector:()=>ub,PseudoElementSelector:()=>db,Ratio:()=>fb,Raw:()=>pb,Rule:()=>gb,Selector:()=>bb,SelectorList:()=>yb,String:()=>wb,StyleSheet:()=>Ab,TypeSelector:()=>_b,UnicodeRange:()=>Nb,Url:()=>Rb,Value:()=>Ob,WhiteSpace:()=>Pb}),$R={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:LR,atrule:DR,pseudo:HR,node:FR},WR={node:Ib},qR=b2({...lR,...$R,...WR});function Xu(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof Ve?r=r.map(Xu):r.constructor===Object&&(r=Xu(r))),t[n]=r}return t}var{tokenize:xq,parse:zR,generate:Cn,lexer:qb,createLexer:Mq,walk:At,find:Rq,findLast:Oq,findAll:Pq,toPlainObject:Iq,fromPlainObject:Dq,fork:VR}=qR,{hasOwnProperty:UR}=Object.prototype;function Yu(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 zb(e){if(!e)return null;const t=Yu(e.tags,!0),n=Yu(e.ids),r=Yu(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function jR(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(UR.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:zb(e),blacklist:zb(e.blacklist),scopes:t}}function _r(e){return!e||!e.children||e.children.isEmpty}function Vb(e,t){return e!==null&&e.children===t}function GR(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),_r(e.block))){n.remove(t);return}switch(e.name){case"charset":if(_r(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=rn(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(_r(e.prelude)||_r(e.block))&&n.remove(t)}}}function XR(e,t,n){n.remove(t)}function YR(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}go(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function KR(e,t,n){(Vb(this.stylesheet,n)||Vb(this.block,n))&&n.remove(t)}var{hasOwnProperty:Co}=Object.prototype,ZR=new Set(["keyframes"]);function Ub(e,t){return e.children.forEach((n,r,o)=>{let i=!1;At(n,function(s){if(this.selector===null||this.selector===e)switch(s.type){case"SelectorList":(this.function===null||this.function.name.toLowerCase()!=="not")&&Ub(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!Co.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&Co.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!Co.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&Co.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&&!Co.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&Co.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function QR(e,t,n,r){if(_r(e.prelude)||_r(e.block)){n.remove(t);return}if(this.atrule&&ZR.has(rn(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(Ub(e.prelude,o),_r(e.prelude))){n.remove(t);return}}function JR(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 eO(e,t,n){n.remove(t)}var jb={Atrule:GR,Comment:XR,Declaration:YR,Raw:KR,Rule:QR,TypeSelector:JR,WhiteSpace:eO};function tO(e,t){At(e,{leave(n,r,o){jb.hasOwnProperty(n.type)&&jb[n.type].call(this,n,r,o,t)}})}function nO(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 rO(e){rn(e.name).basename==="keyframes"&&nO(e)}var oO=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function iO(e){return e===""||e==="-"?!1:!oO.test(e)}function sO(e){const t=e.value;!t||t.type!=="String"||iO(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function aO(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 lO(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 cO(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 Ve().fromArray(n)}function Gb(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 Xb={font:aO,"font-weight":lO,background:cO,border:Gb,outline:Gb};function uO(e){if(!this.declaration)return;const t=go(this.declaration.property);Xb.hasOwnProperty(t.basename)&&Xb[t.basename](e)}var dO=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,mO=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,fO=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function Fa(e,t){const n=t&&t.prev!==null&&fO.has(t.prev.data.type)?mO:dO;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function pO(e){e.value=Fa(e.value)}var hO=new Set(["calc","min","max","clamp"]),gO=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function bO(e,t){const n=Fa(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!gO.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&hO.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var yO=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function vO(e,t){e.value=Fa(e.value),e.value==="0"&&this.declaration&&!yO.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},qb.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function EO(e){e.value=e.value.replace(/\\/g,"/")}var Yb={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"},Kb={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 Ku(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 Zb(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=Ku(l,a,e+1/3),i=Ku(l,a,e),s=Ku(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function Zu(e){return e=e.toString(16),e.length===1?"0"+e:e}function Qu(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 SO(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=Qu(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=Zb(...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:Fa(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||Qu(e.children,3,!1),!r)return;r=Zb(...r),n="rgb"}if(n==="rgb"){if(r=r||Qu(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:Zu(r[0])+Zu(r[1])+Zu(r[2])},Qb(t.data,t)}}function wO(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(Yb.hasOwnProperty(n)&&qb.matchDeclaration(this.declaration).isType(e,"color")){const r=Yb[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function Qb(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]),Kb[n]?t.data={type:"Identifier",loc:e.loc,name:Kb[n]}:e.value=n}var Jb={Atrule:rO,AttributeSelector:sO,Value:uO,Dimension:bO,Percentage:vO,Number:pO,Url:EO,Hash:Qb,Identifier:wO,Function:SO};function CO(e){At(e,{leave(t,n,r){Jb.hasOwnProperty(t.type)&&Jb[t.type].call(this,t,n,r)}})}var AO=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 TO(){const e=new AO;return function(n){const r=Cn(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function _O(e){return e.type==="Raw"?zR(e.value,{context:"selectorList"}):e}function kO(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function ey(e){return _O(e).children.reduce((t,n)=>kO(Ju(n),t),[0,0,0])}function Ju(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]=ey(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]=ey(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 LO=new Set(["first-letter","first-line","after","before"]),NO=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function xO(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: "+Cn(r));i=a}break;case"PseudoClassSelector":{const a=s.name.toLowerCase();NO.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();LO.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=Ju(r).toString(),r.id=null,r.id=Cn(r),i&&(r.compareMarker+=":"+i),o!=="*"&&(r.compareMarker+=","+o)}),e.pseudoSignature=n.size>0?[...n].sort().join(","):!1}function MO(e,t){const n=TO();return At(e,{visit:"Rule",enter(r){r.block.children.forEach(n),xO(r,t.usage)}}),At(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=Cn(r.prelude)),rn(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:ty}=Object.prototype;function ny(e,t,n,r){const o=t.data,i=rn(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);ty.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],ty.call(e[i],s)||(e[i][s]=new Ve),e[i][s].append(n.remove(t))}function RO(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=rn(o.name).basename;switch(a){case"keyframes":ny(n,i,s,!0);return;case"media":if(t.forceMediaMerge){ny(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 ry(e){return e.type==="Atrule"&&e.name==="media"}function OO(e,t,n){if(!ry(e))return;const r=t.prev&&t.prev.data;!r||!ry(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function PO(e,t){RO(e,t),At(e,{visit:"Atrule",reverse:!0,enter:OO})}var{hasOwnProperty:IO}=Object.prototype;function oy(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 iy(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 DO(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]&&((!IO.call(r,s.fingerprint)||!r[s.fingerprint]&&s.important)&&n.ne2.push(s),n.ne2overrided.push(s))}return n}function ki(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 sy(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 $a(e){switch(e.type){case"Rule":return sy(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some($a,this);break;case"Declaration":return!1}return!0}function BO(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return $a.call(r,i);const s=i.prelude.children,a=i.block.children;if(e.pseudoSignature===i.pseudoSignature){if(oy(s,r))return a.appendList(o),n.remove(t),!0;if(iy(o,a))return ki(s,r),n.remove(t),!0}return sy(r,s)})}function HO(e){At(e,{visit:"Rule",enter:BO})}function FO(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new Ve;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 $O(e){At(e,{visit:"Rule",reverse:!0,enter:FO})}var ay=1,WO=2,Ao=0,Li=1,ed=2,Wa=3,ly=["top","right","bottom","left"],qO={"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"},cy={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"},zO=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=qO[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[Li]=i[Ao],i[ed]=i[Ao],i[Wa]=i[Ao];break;case 2:i[ed]=i[Ao],i[Wa]=i[Li];break;case 3:i[Wa]=i[Li]}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(ly[s],i[s])&&(r[ly[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 Ve,t=this.sides,n=[t.top,t.right,t.bottom,t.left],r=[Cn(t.top.node),Cn(t.right.node),Cn(t.bottom.node),Cn(t.left.node)];r[Wa]===r[Li]&&(n.pop(),r[ed]===r[Ao]&&(n.pop(),r[Li]===r[Ao]&&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 VO(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(!cy.hasOwnProperty(l))return;const c=cy[l];let u,d;if((!r||i===r)&&c in t&&(d=WO,u=t[c]),(!u||!u.add(l,s))&&(d=ay,u=new zO(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 UO(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===ay?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function jO(e,t){const n={},r=[];At(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=VO.call(this,o,l,r,a.lastShortSelector)}}),UO(r,t.declaration)}var GO=1,XO=new Set(["src"]),uy={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},dy={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"]},my={"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 fy(e,t,n){const r=go(e).basename;if(r==="background")return e+":"+Cn(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:m}=d;a||(a=rn(m).vendor),/\\[09]/.test(m)&&(l=RegExp.lastMatch),dy.hasOwnProperty(r)?dy[r].indexOf(m)===-1&&(s[m]=!0):uy.hasOwnProperty(r)&&uy[r].test(m)&&(s[m]=!0);break}case"Function":{let{name:m}=d;a||(a=rn(m).vendor),m==="rect"&&(d.children.some(p=>p.type==="Operator"&&p.value===",")||(m="rect-backward")),s[m+"()"]=!0,d.children.forEach(u);break}case"Dimension":{const{unit:m}=d;switch(/\\[09]/.test(m)&&(l=RegExp.lastMatch),m){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":s[m]=!0}break}}}),i=c?"!"+GO++:"!"+Object.keys(s).sort()+"|"+l+a;break;case"Raw":i="!"+t.value.value;break;default:i=Cn(t.value)}n[o]=i}return e+i}function YO(e,t,n){const r=go(t.property);if(my.hasOwnProperty(r.basename)){const o=my[r.basename];for(const i of o){const s=fy(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function KO(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=fy(l,s,o),u=r[c];u&&!XO.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):YO(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function ZO(e){const t={},n=Object.create(null);At(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),KO.call(this,r,o,i,c,n)}})}function QO(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 $a.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(iy(o,u)){const m=c.data.id;r.some((p,f)=>{const h=p.id;if(m<h)return r.insert(c,f),!0;if(!f.next)return r.insert(c),!0}),n.remove(l);return}if(d===i)return!0;s[d]=!0})}function JO(e){At(e,{visit:"Rule",enter:QO})}function td(e){return e.reduce((t,n)=>t+n.id.length+1,0)-1}function nd(e){let t=0;for(const n of e)t+=n.length;return t+e.length-1}function e5(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,m=c.type;if(m!=="Rule"){const h=$a.call(o,c);return!h&&m==="Atrule"&&d&&At(d,{visit:"Rule",enter(y){y.prelude.children.forEach(v=>{s[v.compareMarker]=!0})}}),h}if(e.pseudoSignature!==c.pseudoSignature)return!0;const p=c.prelude.children;if(l=!p.some(h=>h.compareMarker in s),!l&&!a)return!0;if(a&&oy(p,o))return d.children.appendList(i.children),n.remove(t),!0;const f=DO(i.children,d.children);if(f.eq.length){if(!f.ne1.length&&!f.ne2.length)return l&&(ki(o,p),n.remove(u)),!0;if(!r)if(f.ne1.length&&!f.ne2.length){const h=td(o),y=nd(f.eq);a&&h<y&&(ki(p,o),i.children.fromArray(f.ne1))}else if(!f.ne1.length&&f.ne2.length){const h=td(p),y=nd(f.eq);l&&h<y&&(ki(o,p),d.children.fromArray(f.ne2))}else{const h={type:"SelectorList",loc:null,children:ki(p.copy(),o)},y=td(h.children)+2;if(nd(f.eq)>=y){const v=n.createItem({type:"Rule",loc:null,prelude:h,block:{type:"Block",loc:null,children:new Ve().fromArray(f.eq)},pseudoSignature:e.pseudoSignature});return i.children.fromArray(f.ne1),d.children.fromArray(f.ne2overrided),a?n.insert(v,u):n.insert(v,t),!0}}}a&&(a=!p.some(h=>o.some(y=>y.compareMarker===h.compareMarker))),p.forEach(h=>{s[h.compareMarker]=!0})})}function t5(e){At(e,{visit:"Rule",reverse:!0,enter:e5})}function n5(e,t){const n=MO(e,t);t.logger("prepare",e),PO(e,t),t.logger("mergeAtrule",e),HO(e),t.logger("initialMergeRuleset",e),$O(e),t.logger("disjoinRuleset",e),jO(e,n),t.logger("restructShorthand",e),ZO(e),t.logger("restructBlock",e),JO(e),t.logger("mergeRuleset",e),t5(e),t.logger("restructRuleset",e)}function r5(e,t){const n=new Ve;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 o5(e,t,n,r){r.logger(`Compress block #${n}`,null,!0);let o=1;return e.type==="StyleSheet"&&(e.firstAtrulesAllowed=t,e.id=o++),At(e,{visit:"Atrule",enter(i){i.block!==null&&(i.block.id=o++)}}),r.logger("init",e),tO(e,r),r.logger("clean",e),CO(e,r),r.logger("replace",e),r.restructuring&&n5(e,r),e}function i5(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 s5(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function a5(e){return new Ve().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new Ve().appendData({type:"Selector",loc:null,children:new Ve().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function l5(e,t){e=e||{type:"StyleSheet",loc:null,children:new Ve},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:s5(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?jR(t.usage):!1},r=new Ve;let o=i5(t),i=!0,s,a,l=1,c;t.clone&&(e=Xu(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=a5(e);do{if(a=r5(s,!!o),o5(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(Ve.createItem({type:"Raw",value:`
40
40
  `})),r.insert(Ve.createItem(a.comment)),c.isEmpty||r.insert(Ve.createItem({type:"Raw",value:`
41
41
  `}))),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 c5=ie({compress:()=>l5,find:()=>h5,findAll:()=>b5,findLast:()=>g5,fromPlainObject:()=>y5,generate:()=>f5,lexer:()=>u5,parse:()=>m5,specificity:()=>Ju,toPlainObject:()=>v5,tokenize:()=>d5,walk:()=>p5});function py(e){const t=Vu(e,!0),n=Vu(e);return t.length<n.length?t:n}var{lexer:u5,tokenize:d5,parse:m5,generate:f5,walk:p5,find:h5,findLast:g5,findAll:b5,fromPlainObject:y5,toPlainObject:v5}=VR({node:{String:{generate(e){this.token(5,py(e.value))}},Url:{generate(e){const t=Mb(e.value),n=py(e.value);this.token(7,t.length<=n.length+5?t:"url("+n+")")}}}}),{parse:E5,generate:rd,compress:S5}=c5;function To(e,t,n,r){return t.debug,r}function w5(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=rd(o);e===2&&s.length>256&&(s=s.substr(0,256)+"..."),i+=`
42
42
  ${s}
@@ -45,9 +45,9 @@ ${o.join("")}
45
45
  `;s.innerHTML!==a&&(s.textContent=a,r=!0)}if(s.sheet&&yy(e,s.sheet,o,i)){let a=_5(s.sheet);a=kr(a,gy).css,a=`
46
46
  `+cssbeautify(a,{indent:" ",autosemicolon:!0})+`
47
47
  `,s.innerHTML!==a&&(s.textContent=a,r=!0)}}return r}function yy(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-")}`),T5(e,c,r)||(t.deleteRule(a),i=!0)}else if(l instanceof CSSGroupingRule)i=yy(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 T5(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 _5(e){return Array.from(e.cssRules,t=>t.cssText).join(`
48
- `)}var vy=/device-width/i,k5="not all",_o=new Map,od=!1;function L5(e){return"media"in e&&"cssRules"in e}function Ey(e,t){for(const n of Array.from(e))L5(n)&&t(n),"cssRules"in n&&Ey(n.cssRules,t)}function N5(e){try{return e.cssRules}catch{return}}function x5(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!vy.test(n));return t.length?t.join(", "):k5}function id(e){_o.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||_o.delete(n)});for(const t of Array.from(e.styleSheets)){const n=N5(t);n&&Ey(n,r=>{const o=r.media.mediaText;_o.has(r)||!vy.test(o)||(_o.set(r,o),r.media.mediaText=x5(o))})}}function Sy(){_o.forEach((e,t)=>{t.media.mediaText=e}),_o.clear()}function M5(e){if(!od)return e();Sy();try{return e()}finally{id(document)}}function R5(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 O5(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;od=!0,id(t);const n=new MutationObserver(r=>{R5(r)&&id(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),Sy(),od=!1}}function Ni(e){return de(e)}var Dq=de("extensions.atomsHandlers"),Bq=Ni("HANDLE_ATOM_INSERT"),Hq=de("HeadlessMode"),Fq=de("extensions.sandboxExtensions"),P5="SANDBOX_EXTENSION_SCRIPT_STATUS",$q=de("MESSAGE_SERVICE"),Wq=Ni("SETTINGS_PANEL_EVENT"),qq=Ni("MODAL_SHOW_EVENT"),zq=Ni("MODAL_CLOSE_EVENT"),Vq=Ni("MODAL_UPDATE_EVENT");function Uq(e){return e}var jq="SandboxApp",I5="IframePluginRegistry",D5="__sandbox__";function wy(){return oc(D5)}function B5(e=wy()){return e.getOrCreateInstance(I5,()=>new ZS)}var sd=new QS(()=>B5()),qa=class _S{constructor(){L(this,"container",wy()),L(this,"pluginCollection",new KS(this,sd)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new _S)}static registerPlugin(t,n){sd.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&sd.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()}};L(qa,"_instance",void 0);var xi="data-extension";function Mi(e,t,n,r){Z.send(P5,{key:e,phase:t,status:n,error:r})}function H5(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(xi)||void 0}function Cy(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function ad(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,Mi(e.key,"ready","success"))}function F5({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(xi,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 $5(e,t={}){const n=new Ee,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=c=>{let u=i.get(c);return u||(u=Cy(c),i.set(c,u)),u},l=c=>{if(c.type==="created"){const m=H5();if(!m)return;const p=a(m);p.hasSyncPlugins=!0,p.pendingPlugins.add(c.plugin),s.set(c.plugin,m);return}if(c.type==="create:error")return;const u=s.get(c.plugin);if(!u)return;const d=i.get(u);if(d){if(c.type==="afterInit:success"){d.pendingPlugins.delete(c.plugin),ad(d);return}(c.type==="init:error"||c.type==="afterInit:error")&&(d.pendingPlugins.delete(c.plugin),d.readyFailed=!0,Mi(u,"ready","error",`Sandbox plugin "${c.name}" failed during ${c.type==="init:error"?"init":"afterInit"}.`))}};return n.addDisposable(qa.onLifecycle(l)),n.addDisposable(Z.addListener(Pe.SANDBOX_ADD_EXTENSIONS,c=>{for(const u of c){if(t.surface&&u.surfaces&&!u.surfaces.includes(t.surface))continue;let d=r.get(u.key);d&&d.remove(),u.type==="script"&&i.set(u.key,Cy(u.key));const m=u.parent&&document.querySelector(u.parent)||document.head;if(d=F5(u),u.type==="script"){const p=d;p.src&&(p.onload=()=>{const f=a(u.key);f.loadedNotified=!0,Mi(u.key,"load","success"),ad(f)},p.onerror=()=>Mi(u.key,"load","error",`Failed to load sandbox script: ${p.src}`))}if(m.appendChild(d),u.type==="script"&&!d.src){const p=a(u.key);p.loadedNotified=!0,Mi(u.key,"load","success"),ad(p)}r.set(u.key,d),o.set(u.key,u)}})),n.addDisposable(Z.addListener(Pe.SANDBOX_REMOVE_EXTENSIONS,c=>{for(const u of c){const d=o.get(u),m=document.querySelector(`${d?.type}[${xi}]`);m&&m.remove(),r.delete(u),o.delete(u)}})),n.addDisposable(e.onChange(()=>{for(const[c,u]of r){const d=o.get(c),m=document.querySelector(`${d?.type}[${xi}]`);let p=d.parent?[...document.querySelectorAll(d.parent)]:[];p.length||(p=[document.head]),m?m!==u?r.set(c,m):p.some(f=>m.parentNode===f)||p[0]?.appendChild(m):p[0]?.appendChild(u)}})),n}function W5(e){e.querySelectorAll(`[${xi}]`).forEach(t=>t.remove())}var se="remove-basic-cell",Ay="remove-basic-row",oe="em-active-table-cell",An="em-temporary-class",Ue="em-temporary-active-cell-background-color",or="temporary-cell-class",Ty="cursor: pointer; margin: auto; margin-top: 5px",_y="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;",Ri="em_version";function za(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(Ri),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function q5(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(Ri,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${Ri}=${Date.now()}`}}var z5=class extends Ee{constructor(...e){super(...e),L(this,"_transforms",[]),L(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 ld(){return Et.getInstance(qr)}var Va=new WeakMap;function V5(e,t,n){const r=Va.get(e);r?r.set(t.toLowerCase(),n):Va.set(e,new Map([[t.toLowerCase(),n]]))}function U5(e,t){const n=Va.get(e);n?.size&&Va.set(t,new Map(n))}function ky(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 cd(e,t={}){const n=t.pipeline??ld(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),n&&!n.isEmpty&&Ly(e,o)),!n||n.isEmpty)return o;o instanceof Element&&ky(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)ky(s,n,r);return o}function Ua(e,t={}){const n=t.pipeline??ld();return!n||n.isEmpty?e.outerHTML:cd(e,{...t,pipeline:n,clone:!0}).outerHTML}function Ly(e,t){U5(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)Ly(n[o],r[o])}function Tt(e,t,n,r={}){const o=ud(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function ud(e,t,n,r={}){const o=r.pipeline??ld();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&&V5(a,t,n)}return s}function j5(e){const t=new z5,n=A0((o,i,s)=>t.isEmpty?s:ud(o,i,s,{pipeline:t})),r=T0((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(qr,t),{pipeline:t,dispose(){r(),n(),t.dispose(),Jt(e,qr)}}}function G5(e){return za(e)}function Ny(e){const t=(n,r)=>{const o=n.getAttribute(r);if(!o)return;const i=G5(o);i!==o&&n.setAttribute(r,i)};e.querySelectorAll("[src]").forEach(n=>t(n,"src")),e.querySelectorAll("[___src]").forEach(n=>t(n,"___src"))}var X5=new Set(["normal","400"]),Y5=new Set(["normal"]),K5=new Set(["baseline","unset","initial",""]),xy=new Set(["none",""]),Z5=["b","strong","em","i","u","s","strike","sup","sub"],Q5="___em-internal";function ja(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")}),["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"].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&&(ft(t,"[data-mce-caret=before]",!0),ft(t,"span.em-element-resize-img-container"),ft(t,"div.em-element-img-change-group",!0),ft(t,"div.em-element-block-add",!0),ft(t,"meta[http-equiv=Content-Security-Policy]",!0),ft(t,"[class*=mce-]"),ft(t,"script[em=initial]",!0),ft(t,".em-editor-wrapper",!0),ft(t,".em-element-resize-height",!0),ft(t,".em-element-vindent-remove",!0),ft(t,".em-element-vindent",!0),ft(t,".em-element-vindent-value",!0),ft(t,"div.iframe-resizer-inner"))}function J5(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")),e.querySelectorAll(`.${Ue}`).forEach(t=>t.classList.remove(Ue)),ja(e),yh(e),ft(e,"editor",!1),Ry(e),Ny(e),Zp(e)}function Oi(e){return(e??"").trim().toLowerCase()}function e3(e){const t=Oi(e.style.fontWeight);t&&X5.has(t)&&e.style.removeProperty("font-weight");const n=Oi(e.style.fontStyle);n&&Y5.has(n)&&e.style.removeProperty("font-style");const r=Oi(e.style.verticalAlign);r&&K5.has(r)&&e.style.removeProperty("vertical-align");const o=Oi(e.style.textDecorationLine);o&&xy.has(o)&&e.style.removeProperty("text-decoration-line");const i=Oi(e.style.textDecoration);i&&xy.has(i)&&e.style.removeProperty("text-decoration");const s=e.getAttribute("style");s!==null&&s.trim()===""&&e.removeAttribute("style")}function t3(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function My(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==Q5)return!1;return!0}function Ry(e){const t=Array.from(e.querySelectorAll("span"));for(let n=t.length-1;n>=0;n-=1){const r=t[n];e3(r),My(r)&&t3(r)}for(const n of Z5){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&&My(i)&&i.remove()}}}function n3(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(/&amp;nbsp;/gi,"&nbsp;").replaceAll(/&amp;zwnj;/gi,"&zwnj;"),e=e.replaceAll(/style="transform: translateZ\(0px\);"/gi,""),e=e.replaceAll(/ +>/gi,">"),e=e.replaceAll(/&amp;/gi,"&"),e=e.replaceAll(/&quot;/gi,""),e=e.replaceAll(/^\s*$(?:\r\n?|\n)/gm,""),e=e.replaceAll(/ em-floatblock-width=".*?"/gi,""),e=e.replaceAll(/<script.*?editor.*?script>/gi,""),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[^>]*?ad-right-container.*?style>/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,""),e=sh.clear(e);const t=e.match(/((rgb)\(\d{1,3}(,\s?\d{1,3}){2}\))/gi);return t&&t.forEach(n=>{const r=X(n);r&&(e=e.replaceAll(n,r))}),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function Oy(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 r3(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 Py(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return M5(()=>by(document,e,{forceMediaMerge:!0}))}function o3(e){let t=!1;return e.beforeCommit(()=>{try{t||(t=!0,Py())}finally{t=!1}})}function ko(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 ko({node:n});i=Oy(s),i.appendChild(n.cloneNode(!0))}else{const a=t.trim(),l=a.match(/<\!?([a-zA-Z]{1,})[^>]*>/i);if(s=l?l[1]:"div",s==="DOCTYPE"||s==="html")return ko({html:t});i=Oy(s);const c=Te(a);i.replaceChildren(...c)}cd(i,{stage:"apply"}),J5(i),t=Ct(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();t?r3(i,Te(t)):n&&i.appendChild(n.cloneNode(!0)),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()),W5(i),ja(i),yh(i),i.documentElement&&ft(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())}),Ry(i)),cd(i,{stage:"apply"}),Ny(i),Zp(i),t=Vt(i)}return mT(n3(t)).html}var Iy="__emOwnEditor";function i3(e){e[Iy]=!0}function Dy(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[Iy]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var s3={deleteContentBackward:"backward",deleteContentForward:"forward"};function a3(e){const{element:t,getVisibleText:n,mapFn:r,getTagNameForContainer:o,applyAttributesToTag:i,setCursorToElement:s,removeLastWord:a,hasOnlyTextNodesDeep:l,isRangeCoveringAllVisibleText:c,isEditorContentOnlyNbsp:u,commit:d}=e;return function(p){const f=p.target,h=window.getSelection();if(!h||h.rangeCount===0)return;const y=s3[p.inputType];if(y&&Q_(h.getRangeAt(0),y)){p.preventDefault();return}const v=n(f,r).trim(),A=n(h.getRangeAt(0)?.cloneContents(),r).trim(),k=h.getRangeAt(0),S=k.startContainer,b=S.nodeType===Node.TEXT_NODE?S.parentNode:S,E=b.closest("sup, sub")||b,C=E.outerHTML,g=E?.tagName?.toLowerCase();if(p.inputType==="deleteContentBackward"&&!h?.isCollapsed&&A){if((g==="sup"||g==="sub")&&C&&(E?.insertAdjacentHTML("beforebegin","&nbsp;"),E?.removeAttribute("em-edit"),E.remove()),c(k)){p.preventDefault();const w=o(f),T=f.firstElementChild||f,_=document.createElement(w);_.innerHTML=" ",i(_,f,T),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=_.innerHTML:f.innerHTML=_.outerHTML;const M=f.firstChild||f;s(M.firstChild||M),t.setAttribute("em-edit","active"),d(!0);return}t.setAttribute("em-edit","active"),d(!0)}if(p.inputType==="deleteContentBackward"&&h?.isCollapsed&&!A){S.length===1&&((g==="sup"||g==="sub")&&C&&(E?.insertAdjacentHTML("beforebegin","&nbsp;"),E?.removeAttribute("em-edit"),E.remove()),t.setAttribute("em-edit","active"),d(!0));const w=()=>{By(p)&&d(!0)};if(S.nodeType!==Node.TEXT_NODE&&!c(k))return w();const T=k.startOffset;if(T===0&&!c(k))return w();const _=S.parentNode;if(!_)return w();const M=Array.prototype.indexOf.call(_.childNodes,S);if(_.childNodes[M-1]?.nodeType===Node.COMMENT_NODE){p.preventDefault(),S.deleteData(T-1,1);const N=document.createRange();N.setStart(S,T-1),N.collapse(!0),h.removeAllRanges(),h.addRange(N),d(!0);return}f&&u(f)&&(p.preventDefault(),p.stopImmediatePropagation())}if(p.inputType==="insertText"&&!h?.isCollapsed){p.preventDefault();let w=p.data||"";const T=h.anchorNode;c(k)&&(T.tagName==="A"||T?.parentNode&&T.parentNode.tagName==="A")&&(w=" "+p.data),k.deleteContents();const _=document.createTextNode(w||" ");k.insertNode(_),k.setStartAfter(_),k.collapse(!0),h.removeAllRanges(),h.addRange(k),d(!0);return}if(p.inputType.includes("deleteSoftLine")||p.inputType.includes("deleteHardLine")||p.inputType.includes("deleteWord")){if(p.preventDefault(),!h||h.rangeCount===0)return;const w=h.getRangeAt(0),T=document.createRange();T.setStart(f,0),T.setEnd(w.startContainer,w.startOffset);const _=T.toString(),M=document.createRange();M.setStart(w.endContainer,w.endOffset),f.lastChild?M.setEndAfter(f.lastChild):M.setEnd(f,f.childNodes.length);const N=M.toString();if(!_)return;let W="";if(p.inputType.includes("deleteWord")){const we=_.trimEnd().split(/\s+/);we.pop(),W=we.length>0?we.join(" ")+" ":""}const P=(W+N).trim(),R=o(f),Y=f.firstElementChild||f,V=document.createElement(R);V.innerHTML=P||" ",i(V,f,Y),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=V.innerHTML:f.innerHTML=V.outerHTML;const G=f.firstChild?.firstChild||f.firstChild||f,Le=(G.textContent||"").length,ae=Math.min(W.length,Le),ne=document.createRange();G.nodeType===Node.TEXT_NODE?ne.setStart(G,ae):G.firstChild&&G.firstChild.nodeType===Node.TEXT_NODE?ne.setStart(G.firstChild,Math.min(ae,(G.firstChild.textContent||"").length)):ne.setStart(G,0),ne.collapse(!0),h.removeAllRanges(),h.addRange(ne),d();return}if(p.inputType.includes("deleteContent")&&(v.length<2||v===A)&&l(f)){p.preventDefault();const w=o(f),T=f.firstElementChild||f,_=document.createElement(w);_.innerHTML=" ",i(_,f,T),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=_.innerHTML:f.innerHTML=_.outerHTML;const M=f.firstChild||f;s(M.firstChild||M),d(!0);return}if(p.inputType==="insertText"&&p.data){const w=h.anchorNode;if(w?.tagName==="A"&&!w.textContent?.trim().length){p.preventDefault(),p.stopImmediatePropagation(),w.insertAdjacentText("beforeend",p.data);const T=document.createRange();T.selectNodeContents(w),T.collapse(!1),h.removeAllRanges(),h.addRange(T),d(!0);return}if(w?.parentNode&&w.parentNode.tagName==="A"||w?.tagName==="A"){p.preventDefault(),p.stopImmediatePropagation();const T=h.getRangeAt(0),_=document.createTextNode(p.data||"");T.insertNode(_),T.setStartAfter(_),T.collapse(!0),h.removeAllRanges(),h.addRange(T),d(!0);return}}if(p.inputType==="deleteContentBackward"&&!h.isCollapsed&&!A&&f&&u(f)&&(p.preventDefault(),p.stopImmediatePropagation()),By(p)){d(!0);return}d()}}var l3={deleteContentBackward:"delete",deleteContentForward:"forwardDelete"},dd=!1;function By(e){const t=l3[e.inputType];if(!t||e.defaultPrevented||dd)return!1;e.preventDefault(),dd=!0;try{document.execCommand(t)}finally{dd=!1}return!0}function c3(e){return function(n,r){if(!n||(n.querySelectorAll("editor")?.forEach(s=>{s.onclick=null,s.onkeyup=null,s.onmousedown=null}),ja(n),document.querySelectorAll(":not(.em-element-path) .em-element-path").forEach(s=>s.remove()),Dy(n),X_(n,r)))return;ph(n,Te);const o=document.createElement("editor");if(i3(o),o.classList.add("em-text"),o.setAttribute("contenteditable","true"),r)n.before(o),o.replaceChildren(n);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",()=>e.commit(!0),!0),o.addEventListener("beforeinput",a3({element:n,getVisibleText:fh,mapFn:q_,getTagNameForContainer:z_,applyAttributesToTag:(s,a,l)=>V_(s,a,l,X),setCursorToElement:U_,removeLastWord:G_,hasOnlyTextNodesDeep:dh,isRangeCoveringAllVisibleText:R_,isEditorContentOnlyNbsp:M_,commit:e.commit}))}}function u3({commit:e,htmlDocument:t,documentMapping:n}){const r=c3({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||x_(()=>r(i,s),"editor")}}}var Hy=e=>t=>t.some(n=>e(n).some(d3)),d3=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),m3=Hy(({removed:e})=>e),f3=Hy(({added:e})=>e),p3=e=>t=>{m3(t)&&!f3(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){Jn("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},je={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"},_e="em-icon";function h3(e,t,n){return(t=v3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wn(){return Wn=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},Wn.apply(null,arguments)}function Fy(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 Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fy(Object(n),!0).forEach(function(r){h3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g3(e,t){if(e==null)return{};var n,r,o=b3(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 b3(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 y3(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 v3(e){var t=y3(e,"string");return typeof t=="symbol"?t:t+""}function md(e){"@babel/helpers - typeof";return md=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},md(e)}var E3="1.15.7";function qn(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var zn=qn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pi=qn(/Edge/i),$y=qn(/firefox/i),Ii=qn(/safari/i)&&!qn(/chrome/i)&&!qn(/android/i),fd=qn(/iP(ad|od|hone)/i),Wy=qn(/chrome/i)&&qn(/android/i),qy={capture:!1,passive:!1};function he(e,t,n){e.addEventListener(t,n,!zn&&qy)}function pe(e,t,n){e.removeEventListener(t,n,!zn&&qy)}function Ga(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 zy(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function an(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ga(e,t):Ga(e,t))||r&&e===n)return e;if(e===n)break}while(e=zy(e))}return null}var Vy=/\s+/g;function Rt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(Vy," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(Vy," "))}function re(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 Lo(e,t){var n="";if(typeof e=="string")n=e;else do{var r=re(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 Uy(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 _n(){var e=document.scrollingElement;return e||document.documentElement}function Qe(e,t,n,r,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==_n()?(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,!zn))do if(o&&o.getBoundingClientRect&&(re(o,"transform")!=="none"||n&&re(o,"position")!=="static")){var m=o.getBoundingClientRect();s-=m.top+parseInt(re(o,"border-top-width")),a-=m.left+parseInt(re(o,"border-left-width")),l=s+i.height,c=a+i.width;break}while(o=o.parentNode);if(r&&e!==window){var p=Lo(o||e),f=p&&p.a,h=p&&p.d;p&&(s/=h,a/=f,d/=f,u/=h,l=s+u,c=a+d)}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function jy(e,t,n){for(var r=ir(e,!0),o=Qe(e)[t];r;){var i=Qe(r)[n],s=void 0;if(n==="top"||n==="left"?s=o>=i:s=o<=i,!s)return r;if(r===_n())break;r=ir(r,!1)}return!1}function No(e,t,n,r){for(var o=0,i=0,s=e.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==ee.ghost&&(r||s[i]!==ee.dragged)&&an(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function pd(e,t){for(var n=e.lastElementChild;n&&(n===ee.ghost||re(n,"display")==="none"||t&&!Ga(n,t));)n=n.previousElementSibling;return n||null}function Xt(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==ee.clone&&(!t||Ga(e,t))&&n++;return n}function Gy(e){var t=0,n=0,r=_n();if(e)do{var o=Lo(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 S3(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 ir(e,t){if(!e||!e.getBoundingClientRect)return _n();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=re(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 _n();if(r||t)return n;r=!0}}while(n=n.parentNode);return _n()}function w3(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function hd(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 Di;function Xy(e,t){return function(){if(!Di){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),Di=setTimeout(function(){Di=void 0},t)}}}function C3(){clearTimeout(Di),Di=void 0}function Yy(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Ky(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 Zy(e,t,n){var r={};return Array.from(e.children).forEach(function(o){var i,s,a,l;if(!(!an(o,t.draggable,e,!1)||o.animated||o===n)){var c=Qe(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 _t="Sortable"+new Date().getTime();function A3(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(r){if(!(re(r,"display")==="none"||r===ee.ghost)){e.push({target:r,rect:Qe(r)});var o=Tn({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=Lo(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(S3(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=Qe(c),m=c.prevFromRect,p=c.prevToRect,f=a.rect,h=Lo(c,!0);h&&(d.top-=h.f,d.left-=h.e),c.toRect=d,c.thisAnimationDuration&&hd(m,d)&&!hd(u,d)&&(f.top-d.top)/(f.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=_3(f,m,p,o.options)),hd(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=o.options.animation),o.animate(c,f,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){re(r,"transition",""),re(r,"transform","");var a=Lo(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,re(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=T3(r),re(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),re(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){re(r,"transition",""),re(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function T3(e){return e.offsetWidth}function _3(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 xo=[],gd={initializeByDefault:!0},Bi={mount:function(t){for(var n in gd)gd.hasOwnProperty(n)&&!(n in t)&&(t[n]=gd[n]);xo.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xo.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";xo.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](Tn({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](Tn({sortable:n},r)))})},initializePlugins:function(t,n,r,o){xo.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,Wn(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 xo.forEach(function(o){typeof o.eventProperties=="function"&&Wn(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return xo.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function k3(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,m=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||n&&n[_t],!!t){var h,y=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!zn&&!Pi?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent(r,!0,!0)),h.to=s||n,h.from=a||n,h.item=o||n,h.clone=i,h.oldIndex=l,h.newIndex=c,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=m,h.pullMode=p?p.lastPutMode:void 0;var A=Tn(Tn({},f),Bi.getEventProperties(r,t));for(var k in A)h[k]=A[k];n&&n.dispatchEvent(h),y[v]&&y[v].call(t,h)}}var L3=["evt"],kt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=g3(r,L3);Bi.pluginEvent.bind(ee)(t,n,Tn({dragEl:B,parentEl:Ge,ghostEl:le,rootEl:De,nextEl:Lr,lastDownEl:Xa,cloneEl:Fe,cloneHidden:sr,dragStarted:Fi,putSortable:ct,activeSortable:ee.active,originalEvent:o,oldIndex:Mo,oldDraggableIndex:Hi,newIndex:Ot,newDraggableIndex:ar,hideGhostForTarget:ov,unhideGhostForTarget:iv,cloneNowHidden:function(){sr=!0},cloneNowShown:function(){sr=!1},dispatchSortableEvent:function(a){pt({sortable:n,name:a,originalEvent:o})}},i))};function pt(e){k3(Tn({putSortable:ct,cloneEl:Fe,targetEl:B,rootEl:De,oldIndex:Mo,oldDraggableIndex:Hi,newIndex:Ot,newDraggableIndex:ar},e))}var B,Ge,le,De,Lr,Xa,Fe,sr,Mo,Ot,Hi,ar,Ya,ct,Ro=!1,Ka=!1,Za=[],Nr,ln,bd,yd,Qy,Jy,Fi,Oo,$i,Wi=!1,Qa=!1,Ja,dt,vd=[],Ed=!1,el=[],tl=typeof document<"u",nl=fd,ev=Pi||zn?"cssFloat":"float",N3=tl&&!Wy&&!fd&&"draggable"in document.createElement("div"),tv=(function(){if(tl){if(zn)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),nv=function(t,n){var r=re(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=No(t,0,n),s=No(t,1,n),a=i&&re(i),l=s&&re(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Qe(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Qe(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[ev]==="none"||s&&r[ev]==="none"&&c+u>o)?"vertical":"horizontal"},x3=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},M3=function(t,n){var r;return Za.some(function(o){var i=o[_t].options.emptyInsertThreshold;if(!(!i||pd(o))){var s=Qe(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},rv=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 m=(s?a:l).options.group.name;return i===!0||typeof i=="string"&&i===m||i.join&&i.indexOf(m)>-1}}var r={},o=t.group;(!o||md(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},ov=function(){!tv&&le&&re(le,"display","none")},iv=function(){!tv&&le&&re(le,"display","")};tl&&!Wy&&document.addEventListener("click",function(e){if(Ka)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ka=!1,!1},!0);var xr=function(t){if(B){t=t.touches?t.touches[0]:t;var n=M3(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[_t]._onDragOver(r)}}},R3=function(t){B&&B.parentNode[_t]._isOutsideThisEl(t.target)};function ee(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=Wn({},t),e[_t]=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 nv(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:ee.supportPointer!==!1&&"PointerEvent"in window&&(!Ii||fd),emptyInsertThreshold:5};Bi.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);rv(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:N3,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?he(e,"pointerdown",this._onTapStart):(he(e,"mousedown",this._onTapStart),he(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(he(e,"dragover",this),he(e,"dragenter",this)),Za.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Wn(this,A3())}ee.prototype={constructor:ee,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Oo=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($3(r),!B&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Ii&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=an(l,o.draggable,r,!1),!(l&&l.animated)&&Xa!==l)){if(Mo=Xt(l),Hi=Xt(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){pt({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),kt("filter",n,{evt:t}),i&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=an(c,d.trim(),r,!1),d)return pt({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),kt("filter",n,{evt:t}),!0}),u)){i&&t.preventDefault();return}o.handle&&!an(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=Qe(r);if(De=i,B=r,Ge=B.parentNode,Lr=B.nextSibling,Xa=r,Ya=s.group,ee.dragged=B,Nr={target:B,clientX:(n||t).clientX,clientY:(n||t).clientY},Qy=Nr.clientX-c.left,Jy=Nr.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,B.style["will-change"]="all",l=function(){if(kt("delayEnded",o,{evt:t}),ee.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!$y&&o.nativeDraggable&&(B.draggable=!0),o._triggerDragStart(t,n),pt({sortable:o,name:"choose",originalEvent:t}),Rt(B,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){Uy(B,u.trim(),Sd)}),he(a,"dragover",xr),he(a,"mousemove",xr),he(a,"touchmove",xr),s.supportPointer?(he(a,"pointerup",o._onDrop),!this.nativeDraggable&&he(a,"pointercancel",o._onDrop)):(he(a,"mouseup",o._onDrop),he(a,"touchend",o._onDrop),he(a,"touchcancel",o._onDrop)),$y&&this.nativeDraggable&&(this.options.touchStartThreshold=4,B.draggable=!0),kt("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pi||zn))){if(ee.eventCanceled){this._onDrop();return}s.supportPointer?(he(a,"pointerup",o._disableDelayedDrag),he(a,"pointercancel",o._disableDelayedDrag)):(he(a,"mouseup",o._disableDelayedDrag),he(a,"touchend",o._disableDelayedDrag),he(a,"touchcancel",o._disableDelayedDrag)),he(a,"mousemove",o._delayedDragTouchMoveHandler),he(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&he(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&&Sd(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?he(document,"pointermove",this._onTouchMove):n?he(document,"touchmove",this._onTouchMove):he(document,"mousemove",this._onTouchMove):(he(B,"dragend",this),he(De,"dragstart",this._onDragStart));try{document.selection?ol(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ro=!1,De&&B){kt("dragStarted",this,{evt:n}),this.nativeDraggable&&he(document,"dragover",R3);var r=this.options;!t&&Rt(B,r.dragClass,!1),Rt(B,r.ghostClass,!0),ee.active=this,t&&this._appendGhost(),pt({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(ln){this._lastX=ln.clientX,this._lastY=ln.clientY,ov();for(var t=document.elementFromPoint(ln.clientX,ln.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ln.clientX,ln.clientY),t!==n);)n=t;if(B.parentNode[_t]._isOutsideThisEl(t),n)do{if(n[_t]){var r=void 0;if(r=n[_t]._onDragOver({clientX:ln.clientX,clientY:ln.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=zy(n));iv()}},_onTouchMove:function(t){if(Nr){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=le&&Lo(le,!0),a=le&&s&&s.a,l=le&&s&&s.d,c=nl&&dt&&Gy(dt),u=(i.clientX-Nr.clientX+o.x)/(a||1)+(c?c[0]-vd[0]:0)/(a||1),d=(i.clientY-Nr.clientY+o.y)/(l||1)+(c?c[1]-vd[1]:0)/(l||1);if(!ee.active&&!Ro){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-(bd||0),s.f+=d-(yd||0)):s={a:1,b:0,c:0,d:1,e:u,f:d};var m="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");re(le,"webkitTransform",m),re(le,"mozTransform",m),re(le,"msTransform",m),re(le,"transform",m),bd=u,yd=d,ln=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!le){var t=this.options.fallbackOnBody?document.body:De,n=Qe(B,!0,nl,!0,t),r=this.options;if(nl){for(dt=t;re(dt,"position")==="static"&&re(dt,"transform")==="none"&&dt!==document;)dt=dt.parentNode;dt!==document.body&&dt!==document.documentElement?(dt===document&&(dt=_n()),n.top+=dt.scrollTop,n.left+=dt.scrollLeft):dt=_n(),vd=Gy(dt)}le=B.cloneNode(!0),Rt(le,r.ghostClass,!1),Rt(le,r.fallbackClass,!0),Rt(le,r.dragClass,!0),re(le,"transition",""),re(le,"transform",""),re(le,"box-sizing","border-box"),re(le,"margin",0),re(le,"top",n.top),re(le,"left",n.left),re(le,"width",n.width),re(le,"height",n.height),re(le,"opacity","0.8"),re(le,"position",nl?"absolute":"fixed"),re(le,"zIndex","100000"),re(le,"pointerEvents","none"),ee.ghost=le,t.appendChild(le),re(le,"transform-origin",Qy/parseInt(le.style.width)*100+"% "+Jy/parseInt(le.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if(kt("dragStart",this,{evt:t}),ee.eventCanceled){this._onDrop();return}kt("setupClone",this),ee.eventCanceled||(Fe=Ky(B),Fe.removeAttribute("id"),Fe.draggable=!1,Fe.style["will-change"]="",this._hideClone(),Rt(Fe,this.options.chosenClass,!1),ee.clone=Fe),r.cloneId=ol(function(){kt("clone",r),!ee.eventCanceled&&(r.options.removeCloneOnHide||De.insertBefore(Fe,B),r._hideClone(),pt({sortable:r,name:"clone"}))}),!n&&Rt(B,i.dragClass,!0),n?(Ka=!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)),he(document,"drop",r),re(B,"transform","translateZ(0)")),Ro=!0,r._dragStartId=ol(r._dragStarted.bind(r,n,t)),he(document,"selectstart",r),Fi=!0,window.getSelection().removeAllRanges(),Ii&&re(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=ee.active,u=Ya===l,d=a.sort,m=ct||c,p,f=this,h=!1;if(Ed)return;function y(V,G){kt(V,f,Tn({evt:t,isOwner:u,axis:p?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:m,target:r,completed:A,onMove:function(ae,ne){return rl(De,n,B,o,ae,Qe(ae),t,ne)},changed:k},G))}function v(){y("dragOverAnimationCapture"),f.captureAnimationState(),f!==m&&m.captureAnimationState()}function A(V){return y("dragOverCompleted",{insertion:V}),V&&(u?c._hideClone():c._showClone(f),f!==m&&(Rt(B,ct?ct.options.ghostClass:c.options.ghostClass,!1),Rt(B,a.ghostClass,!0)),ct!==f&&f!==ee.active?ct=f:f===ee.active&&ct&&(ct=null),m===f&&(f._ignoreWhileAnimating=r),f.animateAll(function(){y("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(r===B&&!B.animated||r===n&&!r.animated)&&(Oo=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(B.parentNode[_t]._isOutsideThisEl(t.target),!V&&xr(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),h=!0}function k(){Ot=Xt(B),ar=Xt(B,a.draggable),pt({sortable:f,name:"change",toEl:n,newIndex:Ot,newDraggableIndex:ar,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=an(r,a.draggable,n,!0),y("dragOver"),ee.eventCanceled)return h;if(B.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||f._ignoreWhileAnimating===r)return A(!1);if(Ka=!1,c&&!a.disabled&&(u?d||(s=Ge!==De):ct===this||(this.lastPutMode=Ya.checkPull(this,c,B,t))&&l.checkPut(this,c,B,t))){if(p=this._getDirection(t,r)==="vertical",o=Qe(B),y("dragOverValid"),ee.eventCanceled)return h;if(s)return Ge=De,v(),this._hideClone(),y("revert"),ee.eventCanceled||(Lr?De.insertBefore(B,Lr):De.appendChild(B)),A(!0);var S=pd(n,a.draggable);if(!S||D3(t,p,this)&&!S.animated){if(S===B)return A(!1);if(S&&n===t.target&&(r=S),r&&(i=Qe(r)),rl(De,n,B,o,r,i,t,!!r)!==!1)return v(),S&&S.nextSibling?n.insertBefore(B,S.nextSibling):n.appendChild(B),Ge=n,k(),A(!0)}else if(S&&I3(t,p,this)){var b=No(n,0,a,!0);if(b===B)return A(!1);if(r=b,i=Qe(r),rl(De,n,B,o,r,i,t,!1)!==!1)return v(),n.insertBefore(B,b),Ge=n,k(),A(!0)}else if(r.parentNode===n){i=Qe(r);var E=0,C,g=B.parentNode!==n,w=!x3(B.animated&&B.toRect||o,r.animated&&r.toRect||i,p),T=p?"top":"left",_=jy(r,"top","top")||jy(B,"top","top"),M=_?_.scrollTop:void 0;Oo!==r&&(C=i[T],Wi=!1,Qa=!w&&a.invertSwap||g),E=B3(t,r,i,p,w?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Qa,Oo===r);var N;if(E!==0){var W=Xt(B);do W-=E,N=Ge.children[W];while(N&&(re(N,"display")==="none"||N===le))}if(E===0||N===r)return A(!1);Oo=r,$i=E;var P=r.nextElementSibling,R=!1;R=E===1;var Y=rl(De,n,B,o,r,i,t,R);if(Y!==!1)return(Y===1||Y===-1)&&(R=Y===1),Ed=!0,setTimeout(P3,30),v(),R&&!P?n.appendChild(B):r.parentNode.insertBefore(B,R?P:r),_&&Yy(_,0,M-_.scrollTop),Ge=B.parentNode,C!==void 0&&!Qa&&(Ja=Math.abs(C-Qe(r)[T])),k(),A(!0)}if(n.contains(B))return A(!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",xr),pe(document,"mousemove",xr),pe(document,"touchmove",xr)},_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(Ot=Xt(B),ar=Xt(B,r.draggable),kt("drop",this,{evt:t}),Ge=B&&B.parentNode,Ot=Xt(B),ar=Xt(B,r.draggable),ee.eventCanceled){this._nulling();return}Ro=!1,Qa=!1,Wi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wd(this.cloneId),wd(this._dragStartId),this.nativeDraggable&&(pe(document,"drop",this),pe(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ii&&re(document.body,"user-select",""),re(B,"transform",""),t&&(Fi&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),le&&le.parentNode&&le.parentNode.removeChild(le),(De===Ge||ct&&ct.lastPutMode!=="clone")&&Fe&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),B&&(this.nativeDraggable&&pe(B,"dragend",this),Sd(B),B.style["will-change"]="",Fi&&!Ro&&Rt(B,ct?ct.options.ghostClass:this.options.ghostClass,!1),Rt(B,this.options.chosenClass,!1),pt({sortable:this,name:"unchoose",toEl:Ge,newIndex:null,newDraggableIndex:null,originalEvent:t}),De!==Ge?(Ot>=0&&(pt({rootEl:Ge,name:"add",toEl:Ge,fromEl:De,originalEvent:t}),pt({sortable:this,name:"remove",toEl:Ge,originalEvent:t}),pt({rootEl:Ge,name:"sort",toEl:Ge,fromEl:De,originalEvent:t}),pt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),ct&&ct.save()):Ot!==Mo&&Ot>=0&&(pt({sortable:this,name:"update",toEl:Ge,originalEvent:t}),pt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),ee.active&&((Ot==null||Ot===-1)&&(Ot=Mo,ar=Hi),pt({sortable:this,name:"end",toEl:Ge,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){kt("nulling",this),De=B=Ge=le=Lr=Fe=Xa=sr=Nr=ln=Fi=Ot=ar=Mo=Hi=Oo=$i=ct=Ya=ee.dragged=ee.ghost=ee.clone=ee.active=null;var t=this.el;el.forEach(function(n){t.contains(n)&&(n.checked=!0)}),el.length=bd=yd=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":B&&(this._onDragOver(t),O3(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],an(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||F3(n));return t},sort:function(t,n){var r={},o=this.el;this.toArray().forEach(function(i,s){var a=o.children[s];an(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 an(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=Bi.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&rv(r)},destroy:function(){kt("destroy",this);var t=this.el;t[_t]=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(),Za.splice(Za.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!sr){if(kt("hideClone",this),ee.eventCanceled)return;re(Fe,"display","none"),this.options.removeCloneOnHide&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),sr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(sr){if(kt("showClone",this),ee.eventCanceled)return;B.parentNode==De&&!this.options.group.revertClone?De.insertBefore(Fe,B):Lr?De.insertBefore(Fe,Lr):De.appendChild(Fe),this.options.group.revertClone&&this.animate(B,Fe),re(Fe,"display",""),sr=!1}}};function O3(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function rl(e,t,n,r,o,i,s,a){var l,c=e[_t],u=c.options.onMove,d;return window.CustomEvent&&!zn&&!Pi?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||Qe(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(d=u.call(c,l,s)),d}function Sd(e){e.draggable=!1}function P3(){Ed=!1}function I3(e,t,n){var r=Qe(No(n.el,0,n.options,!0)),o=Zy(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 D3(e,t,n){var r=Qe(pd(n.el,n.options.draggable)),o=Zy(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 B3(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,m=!1;if(!s){if(a&&Ja<c*o){if(!Wi&&($i===1?l>u+c*i/2:l<d-c*i/2)&&(Wi=!0),Wi)m=!0;else if($i===1?l<u+Ja:l>d-Ja)return-$i}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return H3(t)}return m=m||s,m&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function H3(e){return Xt(B)<Xt(e)?1:-1}function F3(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 $3(e){el.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&el.push(r)}}function ol(e){return setTimeout(e,0)}function wd(e){return clearTimeout(e)}tl&&he(document,"touchmove",function(e){(ee.active||Ro)&&e.cancelable&&e.preventDefault()}),ee.utils={on:he,off:pe,css:re,find:Uy,is:function(t,n){return!!an(t,n,t,!1)},extend:w3,throttle:Xy,closest:an,toggleClass:Rt,clone:Ky,index:Xt,nextTick:ol,cancelNextTick:wd,detectDirection:nv,getChild:No,expando:_t},ee.get=function(e){return e[_t]},ee.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&&(ee.utils=Tn(Tn({},ee.utils),r.utils)),Bi.mount(r)})},ee.create=function(e,t){return new ee(e,t)},ee.version=E3;var Je=[],qi,Cd,Ad=!1,Td,_d,il,zi;function W3(){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?he(document,"dragover",this._handleAutoScroll):this.options.supportPointer?he(document,"pointermove",this._handleFallbackAutoScroll):r.touches?he(document,"touchmove",this._handleFallbackAutoScroll):he(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)),sv(),sl(),C3()},nulling:function(){il=Cd=qi=Ad=zi=Td=_d=null,Je.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(il=n,r||this.options.forceAutoScrollFallback||Pi||zn||Ii){kd(n,this.options,a,r);var l=ir(a,!0);Ad&&(!zi||i!==Td||s!==_d)&&(zi&&sv(),zi=setInterval(function(){var c=ir(document.elementFromPoint(i,s),!0);c!==l&&(l=c,sl()),kd(n,o.options,c,r)},10),Td=i,_d=s)}else{if(!this.options.bubbleScroll||ir(a,!0)===_n()){sl();return}kd(n,this.options,ir(a,!1),!1)}}},Wn(e,{pluginName:"scroll",initializeByDefault:!0})}function sl(){Je.forEach(function(e){clearInterval(e.pid)}),Je=[]}function sv(){clearInterval(zi)}var kd=Xy(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=_n(),c=!1,u;Cd!==n&&(Cd=n,sl(),qi=t.scroll,u=t.scrollFn,qi===!0&&(qi=ir(n,!0)));var d=0,m=qi;do{var p=m,f=Qe(p),h=f.top,y=f.bottom,v=f.left,A=f.right,k=f.width,S=f.height,b=void 0,E=void 0,C=p.scrollWidth,g=p.scrollHeight,w=re(p),T=p.scrollLeft,_=p.scrollTop;p===l?(b=k<C&&(w.overflowX==="auto"||w.overflowX==="scroll"||w.overflowX==="visible"),E=S<g&&(w.overflowY==="auto"||w.overflowY==="scroll"||w.overflowY==="visible")):(b=k<C&&(w.overflowX==="auto"||w.overflowX==="scroll"),E=S<g&&(w.overflowY==="auto"||w.overflowY==="scroll"));var M=b&&(Math.abs(A-o)<=s&&T+k<C)-(Math.abs(v-o)<=s&&!!T),N=E&&(Math.abs(y-i)<=s&&_+S<g)-(Math.abs(h-i)<=s&&!!_);if(!Je[d])for(var W=0;W<=d;W++)Je[W]||(Je[W]={});(Je[d].vx!=M||Je[d].vy!=N||Je[d].el!==p)&&(Je[d].el=p,Je[d].vx=M,Je[d].vy=N,clearInterval(Je[d].pid),(M!=0||N!=0)&&(c=!0,Je[d].pid=setInterval(function(){r&&this.layer===0&&ee.active._onTouchMove(il);var P=Je[this.layer].vy?Je[this.layer].vy*a:0,R=Je[this.layer].vx?Je[this.layer].vx*a:0;typeof u=="function"&&u.call(ee.dragged.parentNode[_t],R,P,e,il,Je[this.layer].el)!=="continue"||Yy(Je[this.layer].el,R,P)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&m!==l&&(m=ir(m,!1)));Ad=c}},30),av=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 Ld(){}Ld.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=No(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:av},Wn(Ld,{pluginName:"revertOnSpill"});function Nd(){}Nd.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:av},Wn(Nd,{pluginName:"removeOnSpill"}),ee.mount(new W3),ee.mount(Nd,Ld);var lv=100,cv=Symbol("EMULATED_DRAG_EVENT");function q3(e,t){return e[cv]===t}var uv=class{constructor(){L(this,"_target",null),L(this,"_interval",0),L(this,"_x",0),L(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[cv]=this,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)},lv),!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)},lv)))}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 al(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 Vi(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function xd(e){const t=document.createElement("div");t.replaceChildren(...Te(e.atomHTML));const n=t.querySelector("img");if(!n)return Ct(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=Vi(e.targetAtom):r=e.targetAtom.parentNode?Vi(e.targetAtom.parentNode):Vi(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?al(t):n.style.maxWidth=r+"px",Ct(t)}function z3(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=Vi(n);o.style.display=a;const c=s>=Vi(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?al(e):o.style.maxWidth=c+"px",!0)}function dv(e,t){const n=e.atomHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Te(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")?al(n):(r.style.maxWidth=i+"px",r.style.width="100%"),qe(e.targetElem,e.targetPlace,`
48
+ `)}var vy=/device-width/i,k5="not all",_o=new Map,od=!1;function L5(e){return"media"in e&&"cssRules"in e}function Ey(e,t){for(const n of Array.from(e))L5(n)&&t(n),"cssRules"in n&&Ey(n.cssRules,t)}function N5(e){try{return e.cssRules}catch{return}}function x5(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!vy.test(n));return t.length?t.join(", "):k5}function id(e){_o.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||_o.delete(n)});for(const t of Array.from(e.styleSheets)){const n=N5(t);n&&Ey(n,r=>{const o=r.media.mediaText;_o.has(r)||!vy.test(o)||(_o.set(r,o),r.media.mediaText=x5(o))})}}function Sy(){_o.forEach((e,t)=>{t.media.mediaText=e}),_o.clear()}function M5(e){if(!od)return e();Sy();try{return e()}finally{id(document)}}function R5(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 O5(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;od=!0,id(t);const n=new MutationObserver(r=>{R5(r)&&id(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),Sy(),od=!1}}function Ni(e){return de(e)}var Bq=de("extensions.atomsHandlers"),Hq=Ni("HANDLE_ATOM_INSERT"),Fq=de("HeadlessMode"),$q=de("extensions.sandboxExtensions"),P5="SANDBOX_EXTENSION_SCRIPT_STATUS",Wq=de("MESSAGE_SERVICE"),qq=Ni("SETTINGS_PANEL_EVENT"),zq=Ni("MODAL_SHOW_EVENT"),Vq=Ni("MODAL_CLOSE_EVENT"),Uq=Ni("MODAL_UPDATE_EVENT");function jq(e){return e}var Gq="SandboxApp",I5="IframePluginRegistry",D5="__sandbox__";function wy(){return oc(D5)}function B5(e=wy()){return e.getOrCreateInstance(I5,()=>new ZS)}var sd=new QS(()=>B5()),qa=class _S{constructor(){L(this,"container",wy()),L(this,"pluginCollection",new KS(this,sd)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new _S)}static registerPlugin(t,n){sd.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&sd.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()}};L(qa,"_instance",void 0);var xi="data-extension";function Mi(e,t,n,r){Z.send(P5,{key:e,phase:t,status:n,error:r})}function H5(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(xi)||void 0}function Cy(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function ad(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,Mi(e.key,"ready","success"))}function F5({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(xi,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 $5(e,t={}){const n=new Ee,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=c=>{let u=i.get(c);return u||(u=Cy(c),i.set(c,u)),u},l=c=>{if(c.type==="created"){const m=H5();if(!m)return;const p=a(m);p.hasSyncPlugins=!0,p.pendingPlugins.add(c.plugin),s.set(c.plugin,m);return}if(c.type==="create:error")return;const u=s.get(c.plugin);if(!u)return;const d=i.get(u);if(d){if(c.type==="afterInit:success"){d.pendingPlugins.delete(c.plugin),ad(d);return}(c.type==="init:error"||c.type==="afterInit:error")&&(d.pendingPlugins.delete(c.plugin),d.readyFailed=!0,Mi(u,"ready","error",`Sandbox plugin "${c.name}" failed during ${c.type==="init:error"?"init":"afterInit"}.`))}};return n.addDisposable(qa.onLifecycle(l)),n.addDisposable(Z.addListener(Pe.SANDBOX_ADD_EXTENSIONS,c=>{for(const u of c){if(t.surface&&u.surfaces&&!u.surfaces.includes(t.surface))continue;let d=r.get(u.key);d&&d.remove(),u.type==="script"&&i.set(u.key,Cy(u.key));const m=u.parent&&document.querySelector(u.parent)||document.head;if(d=F5(u),u.type==="script"){const p=d;p.src&&(p.onload=()=>{const f=a(u.key);f.loadedNotified=!0,Mi(u.key,"load","success"),ad(f)},p.onerror=()=>Mi(u.key,"load","error",`Failed to load sandbox script: ${p.src}`))}if(m.appendChild(d),u.type==="script"&&!d.src){const p=a(u.key);p.loadedNotified=!0,Mi(u.key,"load","success"),ad(p)}r.set(u.key,d),o.set(u.key,u)}})),n.addDisposable(Z.addListener(Pe.SANDBOX_REMOVE_EXTENSIONS,c=>{for(const u of c){const d=o.get(u),m=document.querySelector(`${d?.type}[${xi}]`);m&&m.remove(),r.delete(u),o.delete(u)}})),n.addDisposable(e.onChange(()=>{for(const[c,u]of r){const d=o.get(c),m=document.querySelector(`${d?.type}[${xi}]`);let p=d.parent?[...document.querySelectorAll(d.parent)]:[];p.length||(p=[document.head]),m?m!==u?r.set(c,m):p.some(f=>m.parentNode===f)||p[0]?.appendChild(m):p[0]?.appendChild(u)}})),n}function W5(e){e.querySelectorAll(`[${xi}]`).forEach(t=>t.remove())}var se="remove-basic-cell",Ay="remove-basic-row",oe="em-active-table-cell",An="em-temporary-class",Ue="em-temporary-active-cell-background-color",or="temporary-cell-class",Ty="cursor: pointer; margin: auto; margin-top: 5px",_y="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;",Ri="em_version";function za(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(Ri),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function q5(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(Ri,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${Ri}=${Date.now()}`}}var z5=class extends Ee{constructor(...e){super(...e),L(this,"_transforms",[]),L(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 ld(){return Et.getInstance(qr)}var Va=new WeakMap;function V5(e,t,n){const r=Va.get(e);r?r.set(t.toLowerCase(),n):Va.set(e,new Map([[t.toLowerCase(),n]]))}function U5(e,t){const n=Va.get(e);n?.size&&Va.set(t,new Map(n))}function ky(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 cd(e,t={}){const n=t.pipeline??ld(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),n&&!n.isEmpty&&Ly(e,o)),!n||n.isEmpty)return o;o instanceof Element&&ky(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)ky(s,n,r);return o}function Ua(e,t={}){const n=t.pipeline??ld();return!n||n.isEmpty?e.outerHTML:cd(e,{...t,pipeline:n,clone:!0}).outerHTML}function Ly(e,t){U5(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)Ly(n[o],r[o])}function Tt(e,t,n,r={}){const o=ud(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function ud(e,t,n,r={}){const o=r.pipeline??ld();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&&V5(a,t,n)}return s}function j5(e){const t=new z5,n=A0((o,i,s)=>t.isEmpty?s:ud(o,i,s,{pipeline:t})),r=T0((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(qr,t),{pipeline:t,dispose(){r(),n(),t.dispose(),Jt(e,qr)}}}function G5(e){return za(e)}function Ny(e){const t=(n,r)=>{const o=n.getAttribute(r);if(!o)return;const i=G5(o);i!==o&&n.setAttribute(r,i)};e.querySelectorAll("[src]").forEach(n=>t(n,"src")),e.querySelectorAll("[___src]").forEach(n=>t(n,"___src"))}var X5=new Set(["normal","400"]),Y5=new Set(["normal"]),K5=new Set(["baseline","unset","initial",""]),xy=new Set(["none",""]),Z5=["b","strong","em","i","u","s","strike","sup","sub"],Q5="___em-internal";function ja(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")}),["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"].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&&(ft(t,"[data-mce-caret=before]",!0),ft(t,"span.em-element-resize-img-container"),ft(t,"div.em-element-img-change-group",!0),ft(t,"div.em-element-block-add",!0),ft(t,"meta[http-equiv=Content-Security-Policy]",!0),ft(t,"[class*=mce-]"),ft(t,"script[em=initial]",!0),ft(t,".em-editor-wrapper",!0),ft(t,".em-element-resize-height",!0),ft(t,".em-element-vindent-remove",!0),ft(t,".em-element-vindent",!0),ft(t,".em-element-vindent-value",!0),ft(t,"div.iframe-resizer-inner"))}function J5(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")),e.querySelectorAll(`.${Ue}`).forEach(t=>t.classList.remove(Ue)),ja(e),yh(e),ft(e,"editor",!1),Ry(e),Ny(e),Zp(e)}function Oi(e){return(e??"").trim().toLowerCase()}function e3(e){const t=Oi(e.style.fontWeight);t&&X5.has(t)&&e.style.removeProperty("font-weight");const n=Oi(e.style.fontStyle);n&&Y5.has(n)&&e.style.removeProperty("font-style");const r=Oi(e.style.verticalAlign);r&&K5.has(r)&&e.style.removeProperty("vertical-align");const o=Oi(e.style.textDecorationLine);o&&xy.has(o)&&e.style.removeProperty("text-decoration-line");const i=Oi(e.style.textDecoration);i&&xy.has(i)&&e.style.removeProperty("text-decoration");const s=e.getAttribute("style");s!==null&&s.trim()===""&&e.removeAttribute("style")}function t3(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function My(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==Q5)return!1;return!0}function Ry(e){const t=Array.from(e.querySelectorAll("span"));for(let n=t.length-1;n>=0;n-=1){const r=t[n];e3(r),My(r)&&t3(r)}for(const n of Z5){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&&My(i)&&i.remove()}}}function n3(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(/&amp;nbsp;/gi,"&nbsp;").replaceAll(/&amp;zwnj;/gi,"&zwnj;"),e=e.replaceAll(/style="transform: translateZ\(0px\);"/gi,""),e=e.replaceAll(/ +>/gi,">"),e=e.replaceAll(/&amp;/gi,"&"),e=e.replaceAll(/&quot;/gi,""),e=e.replaceAll(/^\s*$(?:\r\n?|\n)/gm,""),e=e.replaceAll(/ em-floatblock-width=".*?"/gi,""),e=e.replaceAll(/<script.*?editor.*?script>/gi,""),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[^>]*?ad-right-container.*?style>/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,""),e=sh.clear(e);const t=e.match(/((rgb)\(\d{1,3}(,\s?\d{1,3}){2}\))/gi);return t&&t.forEach(n=>{const r=X(n);r&&(e=e.replaceAll(n,r))}),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function Oy(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 r3(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 Py(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return M5(()=>by(document,e,{forceMediaMerge:!0}))}function o3(e){let t=!1;return e.beforeCommit(()=>{try{t||(t=!0,Py())}finally{t=!1}})}function ko(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 ko({node:n});i=Oy(s),i.appendChild(n.cloneNode(!0))}else{const a=t.trim(),l=a.match(/<\!?([a-zA-Z]{1,})[^>]*>/i);if(s=l?l[1]:"div",s==="DOCTYPE"||s==="html")return ko({html:t});i=Oy(s);const c=Te(a);i.replaceChildren(...c)}cd(i,{stage:"apply"}),J5(i),t=Ct(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();t?r3(i,Te(t)):n&&i.appendChild(n.cloneNode(!0)),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()),W5(i),ja(i),yh(i),i.documentElement&&ft(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())}),Ry(i)),cd(i,{stage:"apply"}),Ny(i),Zp(i),t=Vt(i)}return mT(n3(t)).html}var Iy="__emOwnEditor";function i3(e){e[Iy]=!0}function Dy(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[Iy]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var s3={deleteContentBackward:"backward",deleteContentForward:"forward"};function a3(e){const{element:t,getVisibleText:n,mapFn:r,getTagNameForContainer:o,applyAttributesToTag:i,setCursorToElement:s,removeLastWord:a,hasOnlyTextNodesDeep:l,isRangeCoveringAllVisibleText:c,isEditorContentOnlyNbsp:u,commit:d}=e;return function(p){const f=p.target,h=window.getSelection();if(!h||h.rangeCount===0)return;const y=s3[p.inputType];if(y&&Q_(h.getRangeAt(0),y)){p.preventDefault();return}const v=n(f,r).trim(),A=n(h.getRangeAt(0)?.cloneContents(),r).trim(),k=h.getRangeAt(0),S=k.startContainer,b=S.nodeType===Node.TEXT_NODE?S.parentNode:S,E=b.closest("sup, sub")||b,C=E.outerHTML,g=E?.tagName?.toLowerCase();if(p.inputType==="deleteContentBackward"&&!h?.isCollapsed&&A){if((g==="sup"||g==="sub")&&C&&(E?.insertAdjacentHTML("beforebegin","&nbsp;"),E?.removeAttribute("em-edit"),E.remove()),c(k)){p.preventDefault();const w=o(f),T=f.firstElementChild||f,_=document.createElement(w);_.innerHTML=" ",i(_,f,T),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=_.innerHTML:f.innerHTML=_.outerHTML;const M=f.firstChild||f;s(M.firstChild||M),t.setAttribute("em-edit","active"),d(!0);return}t.setAttribute("em-edit","active"),d(!0)}if(p.inputType==="deleteContentBackward"&&h?.isCollapsed&&!A){S.length===1&&((g==="sup"||g==="sub")&&C&&(E?.insertAdjacentHTML("beforebegin","&nbsp;"),E?.removeAttribute("em-edit"),E.remove()),t.setAttribute("em-edit","active"),d(!0));const w=()=>{By(p)&&d(!0)};if(S.nodeType!==Node.TEXT_NODE&&!c(k))return w();const T=k.startOffset;if(T===0&&!c(k))return w();const _=S.parentNode;if(!_)return w();const M=Array.prototype.indexOf.call(_.childNodes,S);if(_.childNodes[M-1]?.nodeType===Node.COMMENT_NODE){p.preventDefault(),S.deleteData(T-1,1);const N=document.createRange();N.setStart(S,T-1),N.collapse(!0),h.removeAllRanges(),h.addRange(N),d(!0);return}f&&u(f)&&(p.preventDefault(),p.stopImmediatePropagation())}if(p.inputType==="insertText"&&!h?.isCollapsed){p.preventDefault();let w=p.data||"";const T=h.anchorNode;c(k)&&(T.tagName==="A"||T?.parentNode&&T.parentNode.tagName==="A")&&(w=" "+p.data),k.deleteContents();const _=document.createTextNode(w||" ");k.insertNode(_),k.setStartAfter(_),k.collapse(!0),h.removeAllRanges(),h.addRange(k),d(!0);return}if(p.inputType.includes("deleteSoftLine")||p.inputType.includes("deleteHardLine")||p.inputType.includes("deleteWord")){if(p.preventDefault(),!h||h.rangeCount===0)return;const w=h.getRangeAt(0),T=document.createRange();T.setStart(f,0),T.setEnd(w.startContainer,w.startOffset);const _=T.toString(),M=document.createRange();M.setStart(w.endContainer,w.endOffset),f.lastChild?M.setEndAfter(f.lastChild):M.setEnd(f,f.childNodes.length);const N=M.toString();if(!_)return;let W="";if(p.inputType.includes("deleteWord")){const we=_.trimEnd().split(/\s+/);we.pop(),W=we.length>0?we.join(" ")+" ":""}const P=(W+N).trim(),R=o(f),Y=f.firstElementChild||f,V=document.createElement(R);V.innerHTML=P||" ",i(V,f,Y),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=V.innerHTML:f.innerHTML=V.outerHTML;const G=f.firstChild?.firstChild||f.firstChild||f,Le=(G.textContent||"").length,ae=Math.min(W.length,Le),ne=document.createRange();G.nodeType===Node.TEXT_NODE?ne.setStart(G,ae):G.firstChild&&G.firstChild.nodeType===Node.TEXT_NODE?ne.setStart(G.firstChild,Math.min(ae,(G.firstChild.textContent||"").length)):ne.setStart(G,0),ne.collapse(!0),h.removeAllRanges(),h.addRange(ne),d();return}if(p.inputType.includes("deleteContent")&&(v.length<2||v===A)&&l(f)){p.preventDefault();const w=o(f),T=f.firstElementChild||f,_=document.createElement(w);_.innerHTML=" ",i(_,f,T),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=_.innerHTML:f.innerHTML=_.outerHTML;const M=f.firstChild||f;s(M.firstChild||M),d(!0);return}if(p.inputType==="insertText"&&p.data){const w=h.anchorNode;if(w?.tagName==="A"&&!w.textContent?.trim().length){p.preventDefault(),p.stopImmediatePropagation(),w.insertAdjacentText("beforeend",p.data);const T=document.createRange();T.selectNodeContents(w),T.collapse(!1),h.removeAllRanges(),h.addRange(T),d(!0);return}if(w?.parentNode&&w.parentNode.tagName==="A"||w?.tagName==="A"){p.preventDefault(),p.stopImmediatePropagation();const T=h.getRangeAt(0),_=document.createTextNode(p.data||"");T.insertNode(_),T.setStartAfter(_),T.collapse(!0),h.removeAllRanges(),h.addRange(T),d(!0);return}}if(p.inputType==="deleteContentBackward"&&!h.isCollapsed&&!A&&f&&u(f)&&(p.preventDefault(),p.stopImmediatePropagation()),By(p)){d(!0);return}d()}}var l3={deleteContentBackward:"delete",deleteContentForward:"forwardDelete"},dd=!1;function By(e){const t=l3[e.inputType];if(!t||e.defaultPrevented||dd)return!1;e.preventDefault(),dd=!0;try{document.execCommand(t)}finally{dd=!1}return!0}function c3(e){return function(n,r){if(!n||(n.querySelectorAll("editor")?.forEach(s=>{s.onclick=null,s.onkeyup=null,s.onmousedown=null}),ja(n),document.querySelectorAll(":not(.em-element-path) .em-element-path").forEach(s=>s.remove()),Dy(n),X_(n,r)))return;ph(n,Te);const o=document.createElement("editor");if(i3(o),o.classList.add("em-text"),o.setAttribute("contenteditable","true"),r)n.before(o),o.replaceChildren(n);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",()=>e.commit(!0),!0),o.addEventListener("beforeinput",a3({element:n,getVisibleText:fh,mapFn:q_,getTagNameForContainer:z_,applyAttributesToTag:(s,a,l)=>V_(s,a,l,X),setCursorToElement:U_,removeLastWord:G_,hasOnlyTextNodesDeep:dh,isRangeCoveringAllVisibleText:R_,isEditorContentOnlyNbsp:M_,commit:e.commit}))}}function u3({commit:e,htmlDocument:t,documentMapping:n}){const r=c3({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||x_(()=>r(i,s),"editor")}}}var Hy=e=>t=>t.some(n=>e(n).some(d3)),d3=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),m3=Hy(({removed:e})=>e),f3=Hy(({added:e})=>e),p3=e=>t=>{m3(t)&&!f3(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){Jn("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},je={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"},_e="em-icon";function h3(e,t,n){return(t=v3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wn(){return Wn=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},Wn.apply(null,arguments)}function Fy(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 Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fy(Object(n),!0).forEach(function(r){h3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g3(e,t){if(e==null)return{};var n,r,o=b3(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 b3(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 y3(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 v3(e){var t=y3(e,"string");return typeof t=="symbol"?t:t+""}function md(e){"@babel/helpers - typeof";return md=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},md(e)}var E3="1.15.7";function qn(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var zn=qn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pi=qn(/Edge/i),$y=qn(/firefox/i),Ii=qn(/safari/i)&&!qn(/chrome/i)&&!qn(/android/i),fd=qn(/iP(ad|od|hone)/i),Wy=qn(/chrome/i)&&qn(/android/i),qy={capture:!1,passive:!1};function he(e,t,n){e.addEventListener(t,n,!zn&&qy)}function pe(e,t,n){e.removeEventListener(t,n,!zn&&qy)}function Ga(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 zy(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function an(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ga(e,t):Ga(e,t))||r&&e===n)return e;if(e===n)break}while(e=zy(e))}return null}var Vy=/\s+/g;function Rt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(Vy," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(Vy," "))}function re(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 Lo(e,t){var n="";if(typeof e=="string")n=e;else do{var r=re(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 Uy(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 _n(){var e=document.scrollingElement;return e||document.documentElement}function Qe(e,t,n,r,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==_n()?(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,!zn))do if(o&&o.getBoundingClientRect&&(re(o,"transform")!=="none"||n&&re(o,"position")!=="static")){var m=o.getBoundingClientRect();s-=m.top+parseInt(re(o,"border-top-width")),a-=m.left+parseInt(re(o,"border-left-width")),l=s+i.height,c=a+i.width;break}while(o=o.parentNode);if(r&&e!==window){var p=Lo(o||e),f=p&&p.a,h=p&&p.d;p&&(s/=h,a/=f,d/=f,u/=h,l=s+u,c=a+d)}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function jy(e,t,n){for(var r=ir(e,!0),o=Qe(e)[t];r;){var i=Qe(r)[n],s=void 0;if(n==="top"||n==="left"?s=o>=i:s=o<=i,!s)return r;if(r===_n())break;r=ir(r,!1)}return!1}function No(e,t,n,r){for(var o=0,i=0,s=e.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==ee.ghost&&(r||s[i]!==ee.dragged)&&an(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function pd(e,t){for(var n=e.lastElementChild;n&&(n===ee.ghost||re(n,"display")==="none"||t&&!Ga(n,t));)n=n.previousElementSibling;return n||null}function Xt(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==ee.clone&&(!t||Ga(e,t))&&n++;return n}function Gy(e){var t=0,n=0,r=_n();if(e)do{var o=Lo(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 S3(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 ir(e,t){if(!e||!e.getBoundingClientRect)return _n();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=re(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 _n();if(r||t)return n;r=!0}}while(n=n.parentNode);return _n()}function w3(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function hd(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 Di;function Xy(e,t){return function(){if(!Di){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),Di=setTimeout(function(){Di=void 0},t)}}}function C3(){clearTimeout(Di),Di=void 0}function Yy(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Ky(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 Zy(e,t,n){var r={};return Array.from(e.children).forEach(function(o){var i,s,a,l;if(!(!an(o,t.draggable,e,!1)||o.animated||o===n)){var c=Qe(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 _t="Sortable"+new Date().getTime();function A3(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(r){if(!(re(r,"display")==="none"||r===ee.ghost)){e.push({target:r,rect:Qe(r)});var o=Tn({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=Lo(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(S3(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=Qe(c),m=c.prevFromRect,p=c.prevToRect,f=a.rect,h=Lo(c,!0);h&&(d.top-=h.f,d.left-=h.e),c.toRect=d,c.thisAnimationDuration&&hd(m,d)&&!hd(u,d)&&(f.top-d.top)/(f.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=_3(f,m,p,o.options)),hd(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=o.options.animation),o.animate(c,f,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){re(r,"transition",""),re(r,"transform","");var a=Lo(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,re(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=T3(r),re(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),re(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){re(r,"transition",""),re(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function T3(e){return e.offsetWidth}function _3(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 xo=[],gd={initializeByDefault:!0},Bi={mount:function(t){for(var n in gd)gd.hasOwnProperty(n)&&!(n in t)&&(t[n]=gd[n]);xo.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xo.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";xo.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](Tn({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](Tn({sortable:n},r)))})},initializePlugins:function(t,n,r,o){xo.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,Wn(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 xo.forEach(function(o){typeof o.eventProperties=="function"&&Wn(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return xo.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function k3(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,m=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||n&&n[_t],!!t){var h,y=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!zn&&!Pi?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent(r,!0,!0)),h.to=s||n,h.from=a||n,h.item=o||n,h.clone=i,h.oldIndex=l,h.newIndex=c,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=m,h.pullMode=p?p.lastPutMode:void 0;var A=Tn(Tn({},f),Bi.getEventProperties(r,t));for(var k in A)h[k]=A[k];n&&n.dispatchEvent(h),y[v]&&y[v].call(t,h)}}var L3=["evt"],kt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=g3(r,L3);Bi.pluginEvent.bind(ee)(t,n,Tn({dragEl:B,parentEl:Ge,ghostEl:le,rootEl:De,nextEl:Lr,lastDownEl:Xa,cloneEl:Fe,cloneHidden:sr,dragStarted:Fi,putSortable:ct,activeSortable:ee.active,originalEvent:o,oldIndex:Mo,oldDraggableIndex:Hi,newIndex:Ot,newDraggableIndex:ar,hideGhostForTarget:ov,unhideGhostForTarget:iv,cloneNowHidden:function(){sr=!0},cloneNowShown:function(){sr=!1},dispatchSortableEvent:function(a){pt({sortable:n,name:a,originalEvent:o})}},i))};function pt(e){k3(Tn({putSortable:ct,cloneEl:Fe,targetEl:B,rootEl:De,oldIndex:Mo,oldDraggableIndex:Hi,newIndex:Ot,newDraggableIndex:ar},e))}var B,Ge,le,De,Lr,Xa,Fe,sr,Mo,Ot,Hi,ar,Ya,ct,Ro=!1,Ka=!1,Za=[],Nr,ln,bd,yd,Qy,Jy,Fi,Oo,$i,Wi=!1,Qa=!1,Ja,dt,vd=[],Ed=!1,el=[],tl=typeof document<"u",nl=fd,ev=Pi||zn?"cssFloat":"float",N3=tl&&!Wy&&!fd&&"draggable"in document.createElement("div"),tv=(function(){if(tl){if(zn)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),nv=function(t,n){var r=re(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=No(t,0,n),s=No(t,1,n),a=i&&re(i),l=s&&re(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Qe(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Qe(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[ev]==="none"||s&&r[ev]==="none"&&c+u>o)?"vertical":"horizontal"},x3=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},M3=function(t,n){var r;return Za.some(function(o){var i=o[_t].options.emptyInsertThreshold;if(!(!i||pd(o))){var s=Qe(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},rv=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 m=(s?a:l).options.group.name;return i===!0||typeof i=="string"&&i===m||i.join&&i.indexOf(m)>-1}}var r={},o=t.group;(!o||md(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},ov=function(){!tv&&le&&re(le,"display","none")},iv=function(){!tv&&le&&re(le,"display","")};tl&&!Wy&&document.addEventListener("click",function(e){if(Ka)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ka=!1,!1},!0);var xr=function(t){if(B){t=t.touches?t.touches[0]:t;var n=M3(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[_t]._onDragOver(r)}}},R3=function(t){B&&B.parentNode[_t]._isOutsideThisEl(t.target)};function ee(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=Wn({},t),e[_t]=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 nv(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:ee.supportPointer!==!1&&"PointerEvent"in window&&(!Ii||fd),emptyInsertThreshold:5};Bi.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);rv(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:N3,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?he(e,"pointerdown",this._onTapStart):(he(e,"mousedown",this._onTapStart),he(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(he(e,"dragover",this),he(e,"dragenter",this)),Za.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Wn(this,A3())}ee.prototype={constructor:ee,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Oo=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($3(r),!B&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Ii&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=an(l,o.draggable,r,!1),!(l&&l.animated)&&Xa!==l)){if(Mo=Xt(l),Hi=Xt(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){pt({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),kt("filter",n,{evt:t}),i&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=an(c,d.trim(),r,!1),d)return pt({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),kt("filter",n,{evt:t}),!0}),u)){i&&t.preventDefault();return}o.handle&&!an(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=Qe(r);if(De=i,B=r,Ge=B.parentNode,Lr=B.nextSibling,Xa=r,Ya=s.group,ee.dragged=B,Nr={target:B,clientX:(n||t).clientX,clientY:(n||t).clientY},Qy=Nr.clientX-c.left,Jy=Nr.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,B.style["will-change"]="all",l=function(){if(kt("delayEnded",o,{evt:t}),ee.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!$y&&o.nativeDraggable&&(B.draggable=!0),o._triggerDragStart(t,n),pt({sortable:o,name:"choose",originalEvent:t}),Rt(B,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){Uy(B,u.trim(),Sd)}),he(a,"dragover",xr),he(a,"mousemove",xr),he(a,"touchmove",xr),s.supportPointer?(he(a,"pointerup",o._onDrop),!this.nativeDraggable&&he(a,"pointercancel",o._onDrop)):(he(a,"mouseup",o._onDrop),he(a,"touchend",o._onDrop),he(a,"touchcancel",o._onDrop)),$y&&this.nativeDraggable&&(this.options.touchStartThreshold=4,B.draggable=!0),kt("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pi||zn))){if(ee.eventCanceled){this._onDrop();return}s.supportPointer?(he(a,"pointerup",o._disableDelayedDrag),he(a,"pointercancel",o._disableDelayedDrag)):(he(a,"mouseup",o._disableDelayedDrag),he(a,"touchend",o._disableDelayedDrag),he(a,"touchcancel",o._disableDelayedDrag)),he(a,"mousemove",o._delayedDragTouchMoveHandler),he(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&he(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&&Sd(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?he(document,"pointermove",this._onTouchMove):n?he(document,"touchmove",this._onTouchMove):he(document,"mousemove",this._onTouchMove):(he(B,"dragend",this),he(De,"dragstart",this._onDragStart));try{document.selection?ol(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ro=!1,De&&B){kt("dragStarted",this,{evt:n}),this.nativeDraggable&&he(document,"dragover",R3);var r=this.options;!t&&Rt(B,r.dragClass,!1),Rt(B,r.ghostClass,!0),ee.active=this,t&&this._appendGhost(),pt({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(ln){this._lastX=ln.clientX,this._lastY=ln.clientY,ov();for(var t=document.elementFromPoint(ln.clientX,ln.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ln.clientX,ln.clientY),t!==n);)n=t;if(B.parentNode[_t]._isOutsideThisEl(t),n)do{if(n[_t]){var r=void 0;if(r=n[_t]._onDragOver({clientX:ln.clientX,clientY:ln.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=zy(n));iv()}},_onTouchMove:function(t){if(Nr){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=le&&Lo(le,!0),a=le&&s&&s.a,l=le&&s&&s.d,c=nl&&dt&&Gy(dt),u=(i.clientX-Nr.clientX+o.x)/(a||1)+(c?c[0]-vd[0]:0)/(a||1),d=(i.clientY-Nr.clientY+o.y)/(l||1)+(c?c[1]-vd[1]:0)/(l||1);if(!ee.active&&!Ro){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-(bd||0),s.f+=d-(yd||0)):s={a:1,b:0,c:0,d:1,e:u,f:d};var m="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");re(le,"webkitTransform",m),re(le,"mozTransform",m),re(le,"msTransform",m),re(le,"transform",m),bd=u,yd=d,ln=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!le){var t=this.options.fallbackOnBody?document.body:De,n=Qe(B,!0,nl,!0,t),r=this.options;if(nl){for(dt=t;re(dt,"position")==="static"&&re(dt,"transform")==="none"&&dt!==document;)dt=dt.parentNode;dt!==document.body&&dt!==document.documentElement?(dt===document&&(dt=_n()),n.top+=dt.scrollTop,n.left+=dt.scrollLeft):dt=_n(),vd=Gy(dt)}le=B.cloneNode(!0),Rt(le,r.ghostClass,!1),Rt(le,r.fallbackClass,!0),Rt(le,r.dragClass,!0),re(le,"transition",""),re(le,"transform",""),re(le,"box-sizing","border-box"),re(le,"margin",0),re(le,"top",n.top),re(le,"left",n.left),re(le,"width",n.width),re(le,"height",n.height),re(le,"opacity","0.8"),re(le,"position",nl?"absolute":"fixed"),re(le,"zIndex","100000"),re(le,"pointerEvents","none"),ee.ghost=le,t.appendChild(le),re(le,"transform-origin",Qy/parseInt(le.style.width)*100+"% "+Jy/parseInt(le.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if(kt("dragStart",this,{evt:t}),ee.eventCanceled){this._onDrop();return}kt("setupClone",this),ee.eventCanceled||(Fe=Ky(B),Fe.removeAttribute("id"),Fe.draggable=!1,Fe.style["will-change"]="",this._hideClone(),Rt(Fe,this.options.chosenClass,!1),ee.clone=Fe),r.cloneId=ol(function(){kt("clone",r),!ee.eventCanceled&&(r.options.removeCloneOnHide||De.insertBefore(Fe,B),r._hideClone(),pt({sortable:r,name:"clone"}))}),!n&&Rt(B,i.dragClass,!0),n?(Ka=!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)),he(document,"drop",r),re(B,"transform","translateZ(0)")),Ro=!0,r._dragStartId=ol(r._dragStarted.bind(r,n,t)),he(document,"selectstart",r),Fi=!0,window.getSelection().removeAllRanges(),Ii&&re(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=ee.active,u=Ya===l,d=a.sort,m=ct||c,p,f=this,h=!1;if(Ed)return;function y(V,G){kt(V,f,Tn({evt:t,isOwner:u,axis:p?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:m,target:r,completed:A,onMove:function(ae,ne){return rl(De,n,B,o,ae,Qe(ae),t,ne)},changed:k},G))}function v(){y("dragOverAnimationCapture"),f.captureAnimationState(),f!==m&&m.captureAnimationState()}function A(V){return y("dragOverCompleted",{insertion:V}),V&&(u?c._hideClone():c._showClone(f),f!==m&&(Rt(B,ct?ct.options.ghostClass:c.options.ghostClass,!1),Rt(B,a.ghostClass,!0)),ct!==f&&f!==ee.active?ct=f:f===ee.active&&ct&&(ct=null),m===f&&(f._ignoreWhileAnimating=r),f.animateAll(function(){y("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(r===B&&!B.animated||r===n&&!r.animated)&&(Oo=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(B.parentNode[_t]._isOutsideThisEl(t.target),!V&&xr(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),h=!0}function k(){Ot=Xt(B),ar=Xt(B,a.draggable),pt({sortable:f,name:"change",toEl:n,newIndex:Ot,newDraggableIndex:ar,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=an(r,a.draggable,n,!0),y("dragOver"),ee.eventCanceled)return h;if(B.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||f._ignoreWhileAnimating===r)return A(!1);if(Ka=!1,c&&!a.disabled&&(u?d||(s=Ge!==De):ct===this||(this.lastPutMode=Ya.checkPull(this,c,B,t))&&l.checkPut(this,c,B,t))){if(p=this._getDirection(t,r)==="vertical",o=Qe(B),y("dragOverValid"),ee.eventCanceled)return h;if(s)return Ge=De,v(),this._hideClone(),y("revert"),ee.eventCanceled||(Lr?De.insertBefore(B,Lr):De.appendChild(B)),A(!0);var S=pd(n,a.draggable);if(!S||D3(t,p,this)&&!S.animated){if(S===B)return A(!1);if(S&&n===t.target&&(r=S),r&&(i=Qe(r)),rl(De,n,B,o,r,i,t,!!r)!==!1)return v(),S&&S.nextSibling?n.insertBefore(B,S.nextSibling):n.appendChild(B),Ge=n,k(),A(!0)}else if(S&&I3(t,p,this)){var b=No(n,0,a,!0);if(b===B)return A(!1);if(r=b,i=Qe(r),rl(De,n,B,o,r,i,t,!1)!==!1)return v(),n.insertBefore(B,b),Ge=n,k(),A(!0)}else if(r.parentNode===n){i=Qe(r);var E=0,C,g=B.parentNode!==n,w=!x3(B.animated&&B.toRect||o,r.animated&&r.toRect||i,p),T=p?"top":"left",_=jy(r,"top","top")||jy(B,"top","top"),M=_?_.scrollTop:void 0;Oo!==r&&(C=i[T],Wi=!1,Qa=!w&&a.invertSwap||g),E=B3(t,r,i,p,w?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Qa,Oo===r);var N;if(E!==0){var W=Xt(B);do W-=E,N=Ge.children[W];while(N&&(re(N,"display")==="none"||N===le))}if(E===0||N===r)return A(!1);Oo=r,$i=E;var P=r.nextElementSibling,R=!1;R=E===1;var Y=rl(De,n,B,o,r,i,t,R);if(Y!==!1)return(Y===1||Y===-1)&&(R=Y===1),Ed=!0,setTimeout(P3,30),v(),R&&!P?n.appendChild(B):r.parentNode.insertBefore(B,R?P:r),_&&Yy(_,0,M-_.scrollTop),Ge=B.parentNode,C!==void 0&&!Qa&&(Ja=Math.abs(C-Qe(r)[T])),k(),A(!0)}if(n.contains(B))return A(!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",xr),pe(document,"mousemove",xr),pe(document,"touchmove",xr)},_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(Ot=Xt(B),ar=Xt(B,r.draggable),kt("drop",this,{evt:t}),Ge=B&&B.parentNode,Ot=Xt(B),ar=Xt(B,r.draggable),ee.eventCanceled){this._nulling();return}Ro=!1,Qa=!1,Wi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wd(this.cloneId),wd(this._dragStartId),this.nativeDraggable&&(pe(document,"drop",this),pe(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ii&&re(document.body,"user-select",""),re(B,"transform",""),t&&(Fi&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),le&&le.parentNode&&le.parentNode.removeChild(le),(De===Ge||ct&&ct.lastPutMode!=="clone")&&Fe&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),B&&(this.nativeDraggable&&pe(B,"dragend",this),Sd(B),B.style["will-change"]="",Fi&&!Ro&&Rt(B,ct?ct.options.ghostClass:this.options.ghostClass,!1),Rt(B,this.options.chosenClass,!1),pt({sortable:this,name:"unchoose",toEl:Ge,newIndex:null,newDraggableIndex:null,originalEvent:t}),De!==Ge?(Ot>=0&&(pt({rootEl:Ge,name:"add",toEl:Ge,fromEl:De,originalEvent:t}),pt({sortable:this,name:"remove",toEl:Ge,originalEvent:t}),pt({rootEl:Ge,name:"sort",toEl:Ge,fromEl:De,originalEvent:t}),pt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),ct&&ct.save()):Ot!==Mo&&Ot>=0&&(pt({sortable:this,name:"update",toEl:Ge,originalEvent:t}),pt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),ee.active&&((Ot==null||Ot===-1)&&(Ot=Mo,ar=Hi),pt({sortable:this,name:"end",toEl:Ge,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){kt("nulling",this),De=B=Ge=le=Lr=Fe=Xa=sr=Nr=ln=Fi=Ot=ar=Mo=Hi=Oo=$i=ct=Ya=ee.dragged=ee.ghost=ee.clone=ee.active=null;var t=this.el;el.forEach(function(n){t.contains(n)&&(n.checked=!0)}),el.length=bd=yd=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":B&&(this._onDragOver(t),O3(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],an(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||F3(n));return t},sort:function(t,n){var r={},o=this.el;this.toArray().forEach(function(i,s){var a=o.children[s];an(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 an(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=Bi.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&rv(r)},destroy:function(){kt("destroy",this);var t=this.el;t[_t]=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(),Za.splice(Za.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!sr){if(kt("hideClone",this),ee.eventCanceled)return;re(Fe,"display","none"),this.options.removeCloneOnHide&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),sr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(sr){if(kt("showClone",this),ee.eventCanceled)return;B.parentNode==De&&!this.options.group.revertClone?De.insertBefore(Fe,B):Lr?De.insertBefore(Fe,Lr):De.appendChild(Fe),this.options.group.revertClone&&this.animate(B,Fe),re(Fe,"display",""),sr=!1}}};function O3(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function rl(e,t,n,r,o,i,s,a){var l,c=e[_t],u=c.options.onMove,d;return window.CustomEvent&&!zn&&!Pi?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||Qe(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(d=u.call(c,l,s)),d}function Sd(e){e.draggable=!1}function P3(){Ed=!1}function I3(e,t,n){var r=Qe(No(n.el,0,n.options,!0)),o=Zy(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 D3(e,t,n){var r=Qe(pd(n.el,n.options.draggable)),o=Zy(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 B3(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,m=!1;if(!s){if(a&&Ja<c*o){if(!Wi&&($i===1?l>u+c*i/2:l<d-c*i/2)&&(Wi=!0),Wi)m=!0;else if($i===1?l<u+Ja:l>d-Ja)return-$i}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return H3(t)}return m=m||s,m&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function H3(e){return Xt(B)<Xt(e)?1:-1}function F3(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 $3(e){el.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&el.push(r)}}function ol(e){return setTimeout(e,0)}function wd(e){return clearTimeout(e)}tl&&he(document,"touchmove",function(e){(ee.active||Ro)&&e.cancelable&&e.preventDefault()}),ee.utils={on:he,off:pe,css:re,find:Uy,is:function(t,n){return!!an(t,n,t,!1)},extend:w3,throttle:Xy,closest:an,toggleClass:Rt,clone:Ky,index:Xt,nextTick:ol,cancelNextTick:wd,detectDirection:nv,getChild:No,expando:_t},ee.get=function(e){return e[_t]},ee.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&&(ee.utils=Tn(Tn({},ee.utils),r.utils)),Bi.mount(r)})},ee.create=function(e,t){return new ee(e,t)},ee.version=E3;var Je=[],qi,Cd,Ad=!1,Td,_d,il,zi;function W3(){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?he(document,"dragover",this._handleAutoScroll):this.options.supportPointer?he(document,"pointermove",this._handleFallbackAutoScroll):r.touches?he(document,"touchmove",this._handleFallbackAutoScroll):he(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)),sv(),sl(),C3()},nulling:function(){il=Cd=qi=Ad=zi=Td=_d=null,Je.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(il=n,r||this.options.forceAutoScrollFallback||Pi||zn||Ii){kd(n,this.options,a,r);var l=ir(a,!0);Ad&&(!zi||i!==Td||s!==_d)&&(zi&&sv(),zi=setInterval(function(){var c=ir(document.elementFromPoint(i,s),!0);c!==l&&(l=c,sl()),kd(n,o.options,c,r)},10),Td=i,_d=s)}else{if(!this.options.bubbleScroll||ir(a,!0)===_n()){sl();return}kd(n,this.options,ir(a,!1),!1)}}},Wn(e,{pluginName:"scroll",initializeByDefault:!0})}function sl(){Je.forEach(function(e){clearInterval(e.pid)}),Je=[]}function sv(){clearInterval(zi)}var kd=Xy(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=_n(),c=!1,u;Cd!==n&&(Cd=n,sl(),qi=t.scroll,u=t.scrollFn,qi===!0&&(qi=ir(n,!0)));var d=0,m=qi;do{var p=m,f=Qe(p),h=f.top,y=f.bottom,v=f.left,A=f.right,k=f.width,S=f.height,b=void 0,E=void 0,C=p.scrollWidth,g=p.scrollHeight,w=re(p),T=p.scrollLeft,_=p.scrollTop;p===l?(b=k<C&&(w.overflowX==="auto"||w.overflowX==="scroll"||w.overflowX==="visible"),E=S<g&&(w.overflowY==="auto"||w.overflowY==="scroll"||w.overflowY==="visible")):(b=k<C&&(w.overflowX==="auto"||w.overflowX==="scroll"),E=S<g&&(w.overflowY==="auto"||w.overflowY==="scroll"));var M=b&&(Math.abs(A-o)<=s&&T+k<C)-(Math.abs(v-o)<=s&&!!T),N=E&&(Math.abs(y-i)<=s&&_+S<g)-(Math.abs(h-i)<=s&&!!_);if(!Je[d])for(var W=0;W<=d;W++)Je[W]||(Je[W]={});(Je[d].vx!=M||Je[d].vy!=N||Je[d].el!==p)&&(Je[d].el=p,Je[d].vx=M,Je[d].vy=N,clearInterval(Je[d].pid),(M!=0||N!=0)&&(c=!0,Je[d].pid=setInterval(function(){r&&this.layer===0&&ee.active._onTouchMove(il);var P=Je[this.layer].vy?Je[this.layer].vy*a:0,R=Je[this.layer].vx?Je[this.layer].vx*a:0;typeof u=="function"&&u.call(ee.dragged.parentNode[_t],R,P,e,il,Je[this.layer].el)!=="continue"||Yy(Je[this.layer].el,R,P)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&m!==l&&(m=ir(m,!1)));Ad=c}},30),av=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 Ld(){}Ld.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=No(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:av},Wn(Ld,{pluginName:"revertOnSpill"});function Nd(){}Nd.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:av},Wn(Nd,{pluginName:"removeOnSpill"}),ee.mount(new W3),ee.mount(Nd,Ld);var lv=100,cv=Symbol("EMULATED_DRAG_EVENT");function q3(e,t){return e[cv]===t}var uv=class{constructor(){L(this,"_target",null),L(this,"_interval",0),L(this,"_x",0),L(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[cv]=this,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)},lv),!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)},lv)))}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 al(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 Vi(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function xd(e){const t=document.createElement("div");t.replaceChildren(...Te(e.atomHTML));const n=t.querySelector("img");if(!n)return Ct(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=Vi(e.targetAtom):r=e.targetAtom.parentNode?Vi(e.targetAtom.parentNode):Vi(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?al(t):n.style.maxWidth=r+"px",Ct(t)}function z3(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=Vi(n);o.style.display=a;const c=s>=Vi(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?al(e):o.style.maxWidth=c+"px",!0)}function dv(e,t){const n=e.atomHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Te(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")?al(n):(r.style.maxWidth=i+"px",r.style.width="100%"),qe(e.targetElem,e.targetPlace,`
49
49
  `+Ct(n)+`
50
- `),t()},o.src=r.getAttribute("src")||"",!1}function Md(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...Te(e.blockHTML));const n=t.querySelector("img.em-countdown");if(!n)return Ct(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()),Tt(n,"src",i.href),n.setAttribute("em-cd-settings",i.search.substring(1)),Ct(t)}function ll(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...Te(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(" ")}),al(t),Ct(t)}function V3(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var U3=class{constructor(){L(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=ee.create(e,t);return this._items.set(e,n),n}entries(){return[...this._items]}},lr=new U3,j3=Number.MAX_VALUE,G3=0;function mv(e){return typeof e=="object"?e.name:e}var X3=class{constructor(){L(this,"emulator",new uv),L(this,"x",0),L(this,"y",0),L(this,"_tracked",!1),L(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)))}},Yt=new X3;function Y3(e){lr.gc(),Yt.track();const t=document.querySelectorAll("[em=group]");ee.prototype._emulateDragOver=function(){};let n;const r=()=>{e.commit(!0)};function o(a,l){let c;function u(f,h){let y=null,v=Number.MAX_VALUE;const A=mv(ee.active?.options.group);for(const[k,S]of lr.entries())if(mv(S.options.group)===A&&(!a||c&&a(k,c)!==!1)){for(const b of k.children)if(!b.classList.contains("sortable-drag")){const E=b.getBoundingClientRect(),C=f<E.left?E.left-f:f>E.right?f-E.right:0,g=h<E.top?E.top-h:h>E.bottom?h-E.bottom:0;if(C<j3||g<G3){const w=Math.sqrt(C*C+g*g);w<v?(y=[S,b],v=w):w===v&&y[1].contains(b)&&(y=[S,b])}}}return y}function d(f){const h="TouchEvent"in window&&f instanceof TouchEvent?f.touches[0]:f,y=u(h.clientX,h.clientY);if(y){const[k,S]=y,b=S.getBoundingClientRect();var v={clientX:b.left+b.width/2,clientY:h.clientY};for(var A in f)f.hasOwnProperty(A)&&(v[A]=f[A]);v.target=S,v.rootEl=S.parentNode,v.preventDefault=void 0,v.stopPropagation=void 0,k._onDragOver(v)}}return{onStart:f=>{c=f.item,V3(ee.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),Yt.emulator.start(Yt.x,Yt.y)?(window.addEventListener("mousemove",Yt.handleMouseMove),n&&(n.dispose(),n=void 0)):f.preventDefault()},onEnd:f=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d);let h=!1;f.from===f.to?Yt.emulator.end(Yt.x,Yt.y):(h=!!l?.(f),Yt.emulator.drop(Yt.x,Yt.y)),window.removeEventListener("mousemove",Yt.handleMouseMove),e.endTextUpdate(),f.from===f.to&&f.oldIndex!==f.newIndex&&e.commit(!0),h&&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&&!lr.get(l)&&lr.create(l,{forceFallback:!0,group:"groups-sorting",handle:`.of-group .${je.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),lr.get(l)||lr.create(l,{forceFallback:!0,group:"atoms-sorting",handle:`.of-atom .${je.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&&vn(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=>z3(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),lr.get(c)||lr.create(c,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${je.drag}`,...o(),onMove:r}))}}}var K3=class{constructor(){L(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)}},Rd={get textDocument(){return D(Et,Ko)},commit:Er};function Z3(){const e=x.get("applicationTheme")||"light";let t=!1;try{Rd.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?7b3c64f5";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?7b3c64f5`;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{Rd.textDocument.endUpdate()}t&&Rd.commit(!1)}var Gq=".em-prevent-action";function Q3(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 J3(){const e=document.body;if(!e)return;const t=x.get("lockEdit")||x.get("lockEditor");(x.get("lockEdit")!==e.classList.contains("mceNonEditable")||x.get("lockEditor"))&&e.classList.toggle("mceNonEditable",!!t),e.classList.toggle("em-sandbox-preview",!!x.get("previewPage"))}function eP(e){const{htmlDocument:t,commit:n,focusController:r}=e;t.onChange(s=>{s.some(a=>a.added.length||a.characterDataChanged||a.reordered?.length||a.reparented?.length)&&Y3(t)}),t.onChange(()=>{Z3()}),t.onRefresh(()=>e.initPreview()),t.onChange(s=>{s.some(a=>a.removed.some(l=>l instanceof HTMLHeadElement||l instanceof HTMLLinkElement&&l.hasAttribute("em")))&&document.querySelector(".em-editor-wrapper")?.remove()});const o=new K3;let i;t.onChange(s=>{for(const a of s)for(const l of a.added)o.add(l.parentElement??l);i||(i=setTimeout(()=>{r.whenEditorLostFocus(()=>{o.clear(),n(!1)}),i=void 0},1e3))}),t.onChange(p3(e.applicationElementSettingsSet)),t.onChange(()=>{x.get("activeElementLocked")>0||(Q3(e),J3())})}function tP(e,t){if(!(e instanceof Element)||!e.closest(".em-prevent-action"))return;const n=document.querySelector(".em-editor-wrapper");if(!(!document.querySelector("[em-edit]")&&!n))try{x.increment("activeElementLocked"),document.querySelectorAll("[em-edit]").forEach(r=>r.removeAttribute("em-edit")),n&&(n.style.display="none"),document.querySelectorAll("editor").forEach(r=>r.blur()),t.forget()}finally{Promise.resolve().then(()=>x.decrement("activeElementLocked"))}}function nP(e){const t=n=>tP(n.target,e);return window.addEventListener("mousedown",t,!0),window.addEventListener("click",t,!0),{dispose(){window.removeEventListener("mousedown",t,!0),window.removeEventListener("click",t,!0)}}}var rP={name:"sandbox.fingerprint",provides:[Vr],awaits:{services:[te]},setup(e){const t=D(e,te),n=__(r=>t.getOuterHtml(r));k_(n),nP(n),e.inject(Vr,n)}},oP={name:"sandbox.setCursor",provides:[vt],awaits:{services:[te,Zt,mt]},setup(e){const t={HTMLDocument:D(e,te),documentMapping:D(e,Zt),remoteDocument:D(e,mt),messageService:Z};e.inject(vt,n=>N_(n,t))}},iP={name:"sandbox.wrapEditor",provides:[Qt],awaits:{services:[te,Zt,xe]},setup:e=>e.inject(Qt,u3({commit:lt(e),htmlDocument:D(e,te),documentMapping:D(e,Zt)}))};function sP(e){const{container:t}=e;qa.registerAll({MessageService:()=>Z,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(te),SyncServiceInternals:()=>t.getInstance(mt),TextDocument:()=>t.getInstance(Ko),Mapping:()=>t.getInstance(Zt),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&qa.initFeatures(e.features)}var aP=e=>e,lP=e=>`table:empty::before {
50
+ `),t()},o.src=r.getAttribute("src")||"",!1}function Md(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...Te(e.blockHTML));const n=t.querySelector("img.em-countdown");if(!n)return Ct(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()),Tt(n,"src",i.href),n.setAttribute("em-cd-settings",i.search.substring(1)),Ct(t)}function ll(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...Te(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(" ")}),al(t),Ct(t)}function V3(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var U3=class{constructor(){L(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=ee.create(e,t);return this._items.set(e,n),n}entries(){return[...this._items]}},lr=new U3,j3=Number.MAX_VALUE,G3=0;function mv(e){return typeof e=="object"?e.name:e}var X3=class{constructor(){L(this,"emulator",new uv),L(this,"x",0),L(this,"y",0),L(this,"_tracked",!1),L(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)))}},Yt=new X3;function Y3(e){lr.gc(),Yt.track();const t=document.querySelectorAll("[em=group]");ee.prototype._emulateDragOver=function(){};let n;const r=()=>{e.commit(!0)};function o(a,l){let c;function u(f,h){let y=null,v=Number.MAX_VALUE;const A=mv(ee.active?.options.group);for(const[k,S]of lr.entries())if(mv(S.options.group)===A&&(!a||c&&a(k,c)!==!1)){for(const b of k.children)if(!b.classList.contains("sortable-drag")){const E=b.getBoundingClientRect(),C=f<E.left?E.left-f:f>E.right?f-E.right:0,g=h<E.top?E.top-h:h>E.bottom?h-E.bottom:0;if(C<j3||g<G3){const w=Math.sqrt(C*C+g*g);w<v?(y=[S,b],v=w):w===v&&y[1].contains(b)&&(y=[S,b])}}}return y}function d(f){const h="TouchEvent"in window&&f instanceof TouchEvent?f.touches[0]:f,y=u(h.clientX,h.clientY);if(y){const[k,S]=y,b=S.getBoundingClientRect();var v={clientX:b.left+b.width/2,clientY:h.clientY};for(var A in f)f.hasOwnProperty(A)&&(v[A]=f[A]);v.target=S,v.rootEl=S.parentNode,v.preventDefault=void 0,v.stopPropagation=void 0,k._onDragOver(v)}}return{onStart:f=>{c=f.item,V3(ee.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),Yt.emulator.start(Yt.x,Yt.y)?(window.addEventListener("mousemove",Yt.handleMouseMove),n&&(n.dispose(),n=void 0)):f.preventDefault()},onEnd:f=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d);let h=!1;f.from===f.to?Yt.emulator.end(Yt.x,Yt.y):(h=!!l?.(f),Yt.emulator.drop(Yt.x,Yt.y)),window.removeEventListener("mousemove",Yt.handleMouseMove),e.endTextUpdate(),f.from===f.to&&f.oldIndex!==f.newIndex&&e.commit(!0),h&&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&&!lr.get(l)&&lr.create(l,{forceFallback:!0,group:"groups-sorting",handle:`.of-group .${je.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),lr.get(l)||lr.create(l,{forceFallback:!0,group:"atoms-sorting",handle:`.of-atom .${je.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&&vn(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=>z3(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),lr.get(c)||lr.create(c,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${je.drag}`,...o(),onMove:r}))}}}var K3=class{constructor(){L(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)}},Rd={get textDocument(){return D(Et,Ko)},commit:Er};function Z3(){const e=x.get("applicationTheme")||"light";let t=!1;try{Rd.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?fec11667";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?fec11667`;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{Rd.textDocument.endUpdate()}t&&Rd.commit(!1)}var Xq=".em-prevent-action";function Q3(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 J3(){const e=document.body;if(!e)return;const t=x.get("lockEdit")||x.get("lockEditor");(x.get("lockEdit")!==e.classList.contains("mceNonEditable")||x.get("lockEditor"))&&e.classList.toggle("mceNonEditable",!!t),e.classList.toggle("em-sandbox-preview",!!x.get("previewPage"))}function eP(e){const{htmlDocument:t,commit:n,focusController:r}=e;t.onChange(s=>{s.some(a=>a.added.length||a.characterDataChanged||a.reordered?.length||a.reparented?.length)&&Y3(t)}),t.onChange(()=>{Z3()}),t.onRefresh(()=>e.initPreview()),t.onChange(s=>{s.some(a=>a.removed.some(l=>l instanceof HTMLHeadElement||l instanceof HTMLLinkElement&&l.hasAttribute("em")))&&document.querySelector(".em-editor-wrapper")?.remove()});const o=new K3;let i;t.onChange(s=>{for(const a of s)for(const l of a.added)o.add(l.parentElement??l);i||(i=setTimeout(()=>{r.whenEditorLostFocus(()=>{o.clear(),n(!1)}),i=void 0},1e3))}),t.onChange(p3(e.applicationElementSettingsSet)),t.onChange(()=>{x.get("activeElementLocked")>0||(Q3(e),J3())})}function tP(e,t){if(!(e instanceof Element)||!e.closest(".em-prevent-action"))return;const n=document.querySelector(".em-editor-wrapper");if(!(!document.querySelector("[em-edit]")&&!n))try{x.increment("activeElementLocked"),document.querySelectorAll("[em-edit]").forEach(r=>r.removeAttribute("em-edit")),n&&(n.style.display="none"),document.querySelectorAll("editor").forEach(r=>r.blur()),t.forget()}finally{Promise.resolve().then(()=>x.decrement("activeElementLocked"))}}function nP(e){const t=n=>tP(n.target,e);return window.addEventListener("mousedown",t,!0),window.addEventListener("click",t,!0),{dispose(){window.removeEventListener("mousedown",t,!0),window.removeEventListener("click",t,!0)}}}var rP={name:"sandbox.fingerprint",provides:[Vr],awaits:{services:[te]},setup(e){const t=D(e,te),n=__(r=>t.getOuterHtml(r));k_(n),nP(n),e.inject(Vr,n)}},oP={name:"sandbox.setCursor",provides:[vt],awaits:{services:[te,Zt,mt]},setup(e){const t={HTMLDocument:D(e,te),documentMapping:D(e,Zt),remoteDocument:D(e,mt),messageService:Z};e.inject(vt,n=>N_(n,t))}},iP={name:"sandbox.wrapEditor",provides:[Qt],awaits:{services:[te,Zt,xe]},setup:e=>e.inject(Qt,u3({commit:lt(e),htmlDocument:D(e,te),documentMapping:D(e,Zt)}))};function sP(e){const{container:t}=e;qa.registerAll({MessageService:()=>Z,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(te),SyncServiceInternals:()=>t.getInstance(mt),TextDocument:()=>t.getInstance(Ko),Mapping:()=>t.getInstance(Zt),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&qa.initFeatures(e.features)}var aP=e=>e,lP=e=>`table:empty::before {
51
51
  /*content: 'Paste block here';*/
52
52
  }
53
53
 
@@ -76,12 +76,12 @@ table:is(:empty, :has(> tbody:only-child:empty))::after {
76
76
  `),v=y!=="";v&&p.insertAdjacentHTML("afterbegin",`${y}
77
77
  `);const A=`.${Tv(i)} {`,k=!p.textContent?.includes(A);if(k){const S=ul[o],b=(S||m.weight).replace(/i$/g,""),E=S?S.endsWith("i"):m.style!=="normal";let C=`font-family: ${JSON.stringify(m.family)}, ${Sv(m)}!important;`;C+=` font-weight: ${b}!important;`,E&&(C+=" font-style: italic!important;"),p.insertAdjacentHTML("beforeend",`
78
78
  ${A} ${C} }`)}cr("iframe: project font attached",{emClass:i,stylesheetUrls:f,faceInserted:v,classInserted:k})}else cr("iframe: style[em=styles] not found — @font-face not injected");setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t),t&&t(!1)},0);return}cr("iframe: Project Fonts entry missing in map — skip Google Fonts fallback",{fontFamily:r,mapSize:document.querySelectorAll('style[em="styles"]').length}),setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t)},0);return}if(!Wv(i)){const d=document.createElement("link");d.setAttribute("rel","stylesheet");const m=ul[o]||"400",p=m.indexOf("i")>-1,f=m.replaceAll("i","");d.setAttribute("href",`https://fonts.googleapis.com/css2?family=${r}:ital,wght@${p?"1":"0"},${f}&display=swap`),d.setAttribute("em-class",i),qv(d)}$e();const s=ul[o]||"400",a=s.replaceAll("i",""),l=s.indexOf("i")>-1;let c=`font-family: '${r}', ${kP[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",`
79
- .${Tv(i)} { ${c} }`),setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t)},0)}function v4(e){const t=Io(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function mr(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=Dd(n).filter(o=>Id(o.family).length>0&&!v4(o.family));!t||r.length===0||(t.textContent=Cv(n,r),cr("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function Mr(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 tm(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],Mr({elem:document.documentElement},n),mr(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"&&dl(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(fl(t[2],t[3])),Qi({fontFamilyArray:t},n))}function Vv(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 Uv(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 jv(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 Ji(e,t){e&&e.tagName==="TABLE"&&(e.classList.contains("em-vindent-table")||e.querySelector("td")?.innerHTML==="")&&e.querySelector("td")?.setAttribute("height",String(t))}function Gv(e,t){const n=Od(),r=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");return r.replaceChildren(...Te(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=hl((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),tm(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":Ji(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=hl((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),tm(i,s,t),jv(i,n.headings?.letterSpacing||0),Vv(i,n.headings?.bold||!1),Uv(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":Ji(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":Ji(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=hl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),tm(i,s,t);const l=i.closest("td"),c=!!l&&!!dr(l)&&!dr(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"),jv(i,n.buttons?.letterSpacing||0),Vv(i,n.buttons?.bold||!1),Uv(i,n.buttons?.italic||!1);const m=i.closest('[em="atom"] > tr > td'),p=i.closest("table");m?.style.paddingTop?m.style.paddingTop=(n.buttons?.marginTop||0)+"px":p?.previousElementSibling&&Ji(p.previousElementSibling,n.buttons?.marginTop||0),m?.style.paddingBottom?m.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":p?.nextElementSibling&&Ji(p.nextElementSibling,n.buttons?.marginBottom||0);const f=n.buttons?.padding||{};f.all&&(i.style.padding=f.all+"px"),f.top&&(i.style.paddingTop=f.top+"px"),f.right&&(i.style.paddingRight=f.right+"px"),f.bottom&&(i.style.paddingBottom=f.bottom+"px"),f.left&&(i.style.paddingLeft=f.left+"px"),u&&(n.buttons?.border&&Vd({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&Xi({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&em(i,{backgroundColor:d})}}else{const s=hl(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=>{Ui(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?Ct(r):Ct(r.querySelector("tbody")||r)}function nm(e){const t=Od(),n=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Te(e.html)),n.querySelector('[em="block"]')&&t.block?.backgroundColor&&n.querySelectorAll('[em="block"]').forEach(o=>{Ui(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return p4(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(Ui).forEach(o=>{h4(o,r)}),n.tagName==="DIV"?Ct(n):Ct(n.querySelector("tbody")||n)}var E4=e=>{for(const t of Object.keys(ul))if(Io(t)===e)return t;return e};function S4(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(Id(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=Dd(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=Cv(n,o),cr("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function w4(e){if(!xP())return;const t=document.head.innerHTML,n=new Set;for(const r of Ev()){S4(r.family);const o=`em-font-${Io(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=E4(a);Qi({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&cr("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:Ev().map(r=>r.family)}),mr(),e&&document.head.innerHTML!==t&&e(!1)}function C4(e,t){const n=new Ee,r=()=>{requestAnimationFrame(()=>{w4(t)})};return n.addDisposable(Z.addListener(Pe.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function Xv(){Z.send({operation:"sandbox_resized"})}function A4(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(()=>{Xv(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(vn(c))return V0(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 T4(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),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 _4=/^(?:ant|vscode|monaco|docs)-/;function k4(e){return _4.test(e)}function L4(){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 N4=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function x4(){return N4}var M4=new Set;function R4(e,t,n=M4){return e.startsWith(`${t}-`)?!1:!k4(e)&&!n.has(e)}function O4(e,t){return`--${t}-${e}`}function P4(e){const t=L4();return R4(e,t,x4())?O4(e,t):`--${e}`}function I4(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])=>` ${P4(a)}: ${String(l)};
79
+ .${Tv(i)} { ${c} }`),setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t)},0)}function v4(e){const t=Io(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function mr(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=Dd(n).filter(o=>Id(o.family).length>0&&!v4(o.family));!t||r.length===0||(t.textContent=Cv(n,r),cr("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function Mr(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 tm(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],Mr({elem:document.documentElement},n),mr(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"&&dl(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(fl(t[2],t[3])),Qi({fontFamilyArray:t},n))}function Vv(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 Uv(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 jv(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 Ji(e,t){e&&e.tagName==="TABLE"&&(e.classList.contains("em-vindent-table")||e.querySelector("td")?.innerHTML==="")&&e.querySelector("td")?.setAttribute("height",String(t))}function Gv(e,t){const n=Od(),r=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");return r.replaceChildren(...Te(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=hl((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),tm(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":Ji(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=hl((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),tm(i,s,t),jv(i,n.headings?.letterSpacing||0),Vv(i,n.headings?.bold||!1),Uv(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":Ji(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":Ji(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=hl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),tm(i,s,t);const l=i.closest("td"),c=!!l&&!!dr(l)&&!dr(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"),jv(i,n.buttons?.letterSpacing||0),Vv(i,n.buttons?.bold||!1),Uv(i,n.buttons?.italic||!1);const m=i.closest('[em="atom"] > tr > td'),p=i.closest("table");m?.style.paddingTop?m.style.paddingTop=(n.buttons?.marginTop||0)+"px":p?.previousElementSibling&&Ji(p.previousElementSibling,n.buttons?.marginTop||0),m?.style.paddingBottom?m.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":p?.nextElementSibling&&Ji(p.nextElementSibling,n.buttons?.marginBottom||0);const f=n.buttons?.padding||{};f.all&&(i.style.padding=f.all+"px"),f.top&&(i.style.paddingTop=f.top+"px"),f.right&&(i.style.paddingRight=f.right+"px"),f.bottom&&(i.style.paddingBottom=f.bottom+"px"),f.left&&(i.style.paddingLeft=f.left+"px"),u&&(n.buttons?.border&&Vd({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&Xi({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&em(i,{backgroundColor:d})}}else{const s=hl(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=>{Ui(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?Ct(r):Ct(r.querySelector("tbody")||r)}function nm(e){const t=Od(),n=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Te(e.html)),n.querySelector('[em="block"]')&&t.block?.backgroundColor&&n.querySelectorAll('[em="block"]').forEach(o=>{Ui(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return p4(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(Ui).forEach(o=>{h4(o,r)}),n.tagName==="DIV"?Ct(n):Ct(n.querySelector("tbody")||n)}var E4=e=>{for(const t of Object.keys(ul))if(Io(t)===e)return t;return e};function S4(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(Id(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=Dd(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=Cv(n,o),cr("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function w4(e){if(!xP())return;const t=document.head.innerHTML,n=new Set;for(const r of Ev()){S4(r.family);const o=`em-font-${Io(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=E4(a);Qi({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&cr("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:Ev().map(r=>r.family)}),mr(),e&&document.head.innerHTML!==t&&e(!1)}function C4(e,t){const n=new Ee,r=()=>{requestAnimationFrame(()=>{w4(t)})};return n.addDisposable(Z.addListener(Pe.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function Xv(){Z.send({operation:"sandbox_resized"})}function A4(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(()=>{Xv(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(vn(c))return V0(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 T4(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 _4=/^(?:ant|vscode|monaco|docs)-/;function k4(e){return _4.test(e)}function L4(){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 N4=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function x4(){return N4}var M4=new Set;function R4(e,t,n=M4){return e.startsWith(`${t}-`)?!1:!k4(e)&&!n.has(e)}function O4(e,t){return`--${t}-${e}`}function P4(e){const t=L4();return R4(e,t,x4())?O4(e,t):`--${e}`}function I4(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])=>` ${P4(a)}: ${String(l)};
80
80
  `).join("");if(s&&n!==s){n=s,i.innerHTML=`:root {
81
81
  ${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 {
82
82
  ${n}}`;const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(o,i.firstChild),e.commit(!1)}})),t.addDisposable(Z.addListener(Pe.SANDBOX_SET_THEME_VARIABLES,r)),t}var D4={name:"sandbox.crossDomainDrag",setup:()=>fP()},B4={name:"sandbox.themeVariables",awaits:{services:[te]},setup:e=>I4(D(e,te))},H4={name:"sandbox.projectFonts",awaits:{services:[mt,xe]},setup(e){OP();const t=lt(e);C4(D(e,mt),n=>t(n))}},F4={name:"sandbox.variableSelection",setup:()=>vP()},$4={name:"sandbox.emReplaceCaret",awaits:{services:[te]},setup:e=>_P(D(e,te))},W4={name:"sandbox.resizeWatch",awaits:{services:[te,mt]},setup(e){A4(D(e,te),D(e,mt)),T4()}},q4={name:"sandbox.reset",awaits:{services:[te]},setup:e=>fT(D(e,te))},z4={name:"sandbox.correct",awaits:{services:[te,at,mt]},setup:e=>dP(D(e,te),D(e,at).controller,D(e,mt))},V4={name:"sandbox.extensionScripts",awaits:{services:[te,Qo]},setup:e=>$5(D(e,te),{surface:D(e,Qo)})},U4={name:"sandbox.localization",provides:[lc],awaits:{services:[te]},setup:e=>e.inject(lc,uP(D(e,te)))};function j4(e=[]){return{name:"sandbox.extensions",awaits:{services:[at,Qo,te]},setup:t=>sP({container:t,focusController:D(t,at).controller,surface:D(t,Qo),features:[...e]})}}function G4(e){const t=n=>function r(o,i=10){if(!X4(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 X4(e){return typeof e=="string"||typeof e=="object"&&e!==null&&!(e instanceof Element)}function Yv(e){return/^(data|blob):/i.test(e.trimStart())}function Kv(e,t){const n=/^(\s*)([\s\S]*?)(\s*)$/.exec(e);return!n||!n[2]?e:`${n[1]}${t(n[2])}${n[3]}`}function Y4(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 K4(e,t){return e.replaceAll(/url\((\s*['"]?)([^'")]+)(['"]?\s*)\)/gi,(n,r,o,i)=>`url(${r}${Kv(o,t)}${i})`)}function rm(e,t,n){const r=e.toLowerCase();return r==="srcset"?Y4(t,n):r==="style"?K4(t,n):Kv(t,n)}var Z4=["src","___src","background","poster","srcset","style"];function gl(e){return Yv(e)?e:za(e)}function Q4(){const e=new Map,t=n=>{if(Yv(n))return n;const r=gl(n),o=e.get(r);return o?q5(r).replace(new RegExp(`${Ri}=\\d+`),`${Ri}=${o}`):n};return{transform:{name:"em-version",attributes:Z4,render:(n,r)=>n&&rm(r.attribute,n,t),serialize:(n,r)=>n&&rm(r.attribute,n,gl)},requestReload(n){e.set(gl(n.trim()),String(Date.now()))},isPending(n){return e.has(gl(n.trim()))},clear(){e.clear()}}}var Zv=["src","background","poster","srcset","style"];function om(e,t=document){const n=Zv.map(o=>`[${o}]`).join(","),r=[...t.querySelectorAll(n)];for(const o of r){const i=o.tagName.toLowerCase();for(const s of Zv){const a=o.getAttribute(s);if(!a)continue;const l=e.serialize(a,{element:o,tag:i,attribute:s,stage:"apply"})??a,c=ud(o,s,l,{pipeline:e,stage:"apply"});c===null?a!==l&&o.removeAttribute(s):c!==a&&o.setAttribute(s,c)}}}function J4(e,t){const{pipeline:n,htmlDocument:r}=t,o=Q4(),i=n.register(o.transform),s={reload(a){a&&(o.requestReload(a),r.renderOnly(()=>om(n)))},clear(){o.clear()}};return e.inject(ac,s),{reload:s,dispose(){i.dispose(),o.clear(),Jt(e,ac)}}}var eI=["https://emcdn.ru/843/20220715_113006_18.png","https://cdn.useblocks.io/843/230110_18_kXn4Evf.png"],tI="/static/media/",nI="empty-image";function rI(e){return e.replace(/[.-][A-Za-z0-9_-]{7,20}$/,"")}function Qv(e){let t;try{t=new URL(e,document.baseURI).pathname}catch{return null}return t.includes(tI)?t:null}function oI(e){return!!e&&Qv(e)!==null}function iI(e){if(!e)return!1;if(eI.includes(e))return!0;const t=Qv(e);return t===null?!1:rI(t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]+$/,""))===nI}var sI=1e4;function aI(e=sI){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 lI=3e3,cI=["src","___src","background","poster","srcset","style"],im=e=>e.startsWith("blob:"),bl="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 uI(e){const t=encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return`${bl}${t}`}var dI=new RegExp(String.raw`blob:[^\s"'()<>]+|`+bl.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+String.raw`[^\s"'()<>]*`,"g");function Jv(e){if(e.startsWith(bl))try{return decodeURIComponent(e.slice(130))}catch{return}}function mI(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:gT(n)}function fI(e){try{return new URL(e,document.baseURI).hostname}catch{return}}function pI(e){const t=e.store??aI(),n=e.answerTimeoutMs??lI,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=f=>{const h=fI(f);return h?h===window.location.hostname||i.sourceHosts.includes(h):!1},u=(f,h=!1)=>{if(r.has(f)||!h&&(o.has(f)||t.peek(f)))return;const y=Z.sendAsync(Pe.APPLICATION_CANVAS_IMAGE_GET,h?{url:f,fresh:h}:{url:f}).then(A=>{const k=A;if(k&&"blob"in k){t.acquire(f,k.blob),l.hits+=1;return}o.add(f),l.refused+=1}).catch(()=>{o.add(f),l.failed+=1}),v=Promise.race([y,new Promise(A=>{setTimeout(()=>{r.has(f)&&(s=!0,o.add(f),l.failed+=1),A()},n)})]).then(()=>{r.delete(f),e.refresh()});r.set(f,v)},d=f=>{const h=Jv(f);if(h!==void 0)return d(h);if(!f||a||im(f)||f.startsWith("data:")||oI(f))return f;const y=t.peek(f);return y||(s||!i.enabled||o.has(f)||!c(f)?f:(l.misses+=1,u(f),uI(f)))},m=f=>im(f)?t.sourceOf(f)??f:Jv(f)??f,p=(f,h,y)=>rm(h.attribute,f,y);return{configure(f){i={enabled:f.enabled,sourceHosts:[...f.sourceHosts??[]]}},transform:{name:"image-cache",attributes:cI,render:(f,h)=>f&&mI(h)?p(f,h,d):f,serialize:(f,h)=>f&&p(f,h,m)},forget(f){t.forget(f),o.delete(f),!a&&u(f,!0)},fail(f){const h=t.sourceOf(f);return h===void 0||t.peek(h)!==f?!1:(o.add(h),t.forget(h),l.failed+=1,!0)},block(){a=!0},restoreUrls(f){return sm(f,m)},stats(){return{...l,blobs:t.size}},dispose(){t.dispose(),r.clear(),o.clear()}}}function hI(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||"";im(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 gI(e,t){return!e.includes("blob:")&&!e.includes(bl)?e:e.replace(dI,n=>t(n))}function sm(e,t){if(typeof e=="string")return gI(e,t);if(Array.isArray(e)){let n=!1;const r=e.map(o=>{const i=sm(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=sm(i,t);n||(n=s!==i),r[o]=s}return n?r:e}return e}function bI(e,t){const{pipeline:n,htmlDocument:r}=t,o=()=>r.renderOnly(()=>om(n)),i=pI({refresh:o}),s=hI(document,i,o),a=n.register(i.transform),l=Z.addListener(Pe.SANDBOX_CANVAS_IMAGE_CACHE_SETUP,u=>{i.configure(u),r.renderOnly(()=>om(n))}),c=Z.setOutgoingFilter(u=>i.restoreUrls(u));return e.inject(Rs,i),{cache:i,dispose(){s.dispose(),c(),l.dispose(),a.dispose(),i.dispose(),Jt(e,Rs)}}}function yI(e,t){const n=new OA,r=new Qs,o=new PA(n,r),i=new cA(r,n,{prepareHtml:t.prepareHtml,mapHTMLRoots:e.mapHTMLRoots,...e.createRoot?{createRoot:e.createRoot}:{},...e.rootsParent?{rootsParent:e.rootsParent}:{}}),s=e.beforeCommit,a=s?i.beforeCommit(()=>s(i)):void 0;return{htmlDocument:i,remoteDocument:n,textDocument:r,documentMapping:o,onDocumentShown:l=>n.onReady(()=>l()),onDocumentReplaced:l=>n.onEntitySet(c=>l(c)),commit:l=>i.commit(l),commitLockedAsync:async l=>{try{t.lock?.increment(),await i.commit(l,!0)}finally{t.lock?.decrement()}},dispose(){a?.dispose(),i.dispose(),n.dispose(),r.dispose()}}}function vI(e,t){const n=e.getInstance(Ms),r=yI(t,{prepareHtml:D(e,Os),lock:n&&{increment:()=>n.increment("activeElementLocked"),decrement:()=>n.decrement("activeElementLocked")}}),o={commit:i=>r.commit(i),commitLockedAsync:i=>r.commitLockedAsync(i)};return e.inject(Zo,t),e.inject(mt,r.remoteDocument),e.inject(Ko,r.textDocument),e.inject(Zt,r.documentMapping),e.inject(te,r.htmlDocument),e.inject(xe,o),{...r,dispose(){r.dispose(),Jt(e,Zo),Jt(e,mt),Jt(e,Ko),Jt(e,Zt),Jt(e,te),Jt(e,xe)}}}function EI(e){e.inject(Ms,x)}var SI=class extends Ee{get isEditorInFocus(){return!!this._isEditorInFocus}constructor(e){super(),L(this,"_isEditorInFocus",!1),L(this,"_context",new Map),L(this,"_editorLostFocusEmitter",this.addDisposable(new Me)),L(this,"_summaries",[]),L(this,"_onChange",t=>{this._isEditorInFocus&&this._summaries.push(...t)}),L(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 wI(e,t){const{htmlDocument:n,remoteDocument:r}=t,o=new SI(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(),Jt(e,at)}};return e.inject(at,l),l}var CI={name:"sandbox.state",provides:[Ms],setup:EI},AI={name:"sandbox.attributePipeline",provides:[qr],setup:j5},TI={name:"sandbox.documentSync",provides:[te,mt,Ko,Zt,xe,Ps],awaits:{services:[Zo,Os,Ms]},setup:e=>e.inject(Ps,vI(e,D(e,Zo)))},_I={name:"sandbox.images",provides:[Rs,ac],awaits:{services:[qr,te,Ps]},setup(e){const t=D(e,qr),n=D(e,te);bI(e,{pipeline:t,htmlDocument:n});const r=J4(e,{pipeline:t,htmlDocument:n}).reload;D(e,Ps).onDocumentReplaced(()=>r.clear()),Z.addListener(Pe.SANDBOX_IMAGE_RESET,({url:o})=>{o&&(e.getInstance(Rs)?.forget(o),r.reload(o))})}},kI={name:"sandbox.mapObj",provides:[zr],awaits:{services:[Zt]},setup:e=>e.inject(zr,G4(D(e,Zt)))},LI={name:"sandbox.focus",provides:[at],awaits:{services:[te,mt]},setup:e=>wI(e,{htmlDocument:D(e,te),remoteDocument:D(e,mt)})},NI=[CI,AI,TI,_I,WT,qT,zT,kI,LI,D4,B4,H4,F4,$4,W4,q4,z4,V4,U4,rP,oP,iP,...b_],am=null,lm=0,xI=6e5;function MI(e){am=e,lm=e?Date.now():0}function RI(){const e=am,t=lm;return am=null,lm=0,!e||!t||Date.now()-t>xI||!e.isConnected||!e.matches('[em="block"]')?null:e}function OI(e,t){const n=t.getOuterHtml(e),r=document.createElement("html").appendChild(document.createElement("body"));let o;e.tagName==="TR"?o=document.createElement("table"):o=document.createElement("div"),document.querySelectorAll("style").forEach(a=>{const l=t.getOuterHtml(a);l&&o.insertAdjacentHTML("beforeend",l)}),o.insertAdjacentHTML("beforeend",`
83
83
  `);const i=Te(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",`
84
- `),o.prepend(document.querySelector(c).cloneNode(!0)))}}),r.append(o),by(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=Vt(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 PI(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=OI(o,n);if(!i)return;MI(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:ko({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function yl(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 vl(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 Ke=()=>ua(window.getSelection()?.toString())??"",II=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],DI={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},BI=/^#[\da-f]{6}$/i,e1=()=>[...new Set(II.flatMap(HI).map(X).filter(e=>BI.test(e)).map(e=>e.toUpperCase()))];function HI({type:e,name:t}){const n=DI[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}var FI=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"],cm=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">&nbsp;</div>`;function $I(e){return!!e.closest("editor.em-text")}function t1(e){e.querySelectorAll(FI.join(",")).forEach(t=>{$I(t)||t.remove()})}function WI(e){const t=e.cloneNode(!0),n=t.querySelector("editor.em-text");if(n){t1(t);const o=n.querySelector("div");if(o)return o.outerHTML;const i=n.getAttribute("innerclass")??"",s=n.getAttribute("innerstyle")??"";return`<div${i?` class="${Nn(i)}"`:""}${s?` style="${Nn(s)}"`:""}>${n.innerHTML}</div>`}t1(t);const r=t.querySelector("div");return r?r.outerHTML:t.innerHTML}function Nn(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function cn(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function es(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=cn(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 qI(e){const t=e.get("padding"),n=e.get("padding-top"),r=e.get("padding-right"),o=e.get("padding-bottom"),i=e.get("padding-left"),s={};if(t){const d=t.trim().split(/\s+/),m=cn(d[0]),p=cn(d[1]??d[0]),f=cn(d[2]??d[0]),h=cn(d[3]??d[1]??d[0]);m!==void 0&&(s.top=m),p!==void 0&&(s.right=p),f!==void 0&&(s.bottom=f),h!==void 0&&(s.left=h)}const a=cn(n??""),l=cn(r??""),c=cn(o??""),u=cn(i??"");return a!==void 0&&(s.top=a),l!==void 0&&(s.right=l),c!==void 0&&(s.bottom=c),u!==void 0&&(s.left=u),Object.keys(s).length?s:void 0}function n1(e){if(e)return e.trim()}function zI(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].includes(t)?t:void 0}function VI(e){if(!e)return;const t=e.trim().toLowerCase();if(t==="top"||t==="text-top")return"top";if(t==="bottom"||t==="text-bottom")return"bottom";if(t==="middle")return"middle"}function UI(e){const t=new Map;return e&&e.split(";").forEach(n=>{const[r,...o]=n.split(":");if(!r||o.length===0)return;const i=r.trim().toLowerCase(),s=o.join(":").trim();i&&t.set(i,s)}),t}function jI(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 GI(e){const t=UI(e.getAttribute("style")),n=t.get("font-family")??void 0,r=cn(t.get("font-size")??""),o=cn(t.get("line-height")??""),i=n1(t.get("color")??void 0),s=n1(t.get("background-color")??void 0),a=zI(t.get("text-align")??void 0),l=VI(t.get("vertical-align")??void 0),c={top:es(t.get("border-top")),right:es(t.get("border-right")),bottom:es(t.get("border-bottom")),left:es(t.get("border-left"))},u=es(t.get("border"));u&&(c.top=c.top??u,c.right=c.right??u,c.bottom=c.bottom??u,c.left=c.left??u);const d=qI(t),m=jI(t.get("border-radius")??void 0),p={};return n&&(p.fontFamily=n),r!==void 0&&(p.fontSize=r),o!==void 0&&(p.lineHeight=o),i&&(p.color=i),s&&(p.backgroundColor=s),a&&(p.textAlign=a),l&&(p.verticalAlign=l),d&&(p.padding=d),m&&(p.borderRadius=m),(c.top||c.right||c.bottom||c.left)&&(p.borders=c),Object.keys(p).length?p:void 0}function XI(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function YI(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}function um(e){if(e==null)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function ts(e){const t=Array.from(e.classList),n={};Array.from(e.attributes).forEach(c=>{const u=c.name.toLowerCase();u!=="class"&&(n[u]=c.value)});const r={width:e.getAttribute("width")??void 0,cellpadding:um(e.getAttribute("cellpadding")),cellspacing:um(e.getAttribute("cellspacing")),border:um(e.getAttribute("border")),classList:t.length?t:void 0,attrs:Object.keys(n).length?n:void 0},o=[],i=[];let s=0;const a=Array.from(e.querySelectorAll(":scope > tr, :scope > tbody > tr, :scope > thead > tr, :scope > tfoot > tr")).filter(c=>c.querySelectorAll("td, th").length!==0);a.forEach(c=>{let u=0;Array.from(c.querySelectorAll("td, th")).forEach(d=>{const m=Math.max(1,d.colSpan||1);u+=m}),u>s&&(s=u)});let l=0;for(const c of a){i[l]||(i[l]=Array(s).fill(null));let u=0;const d=Array.from(c.querySelectorAll("td, th"));for(const m of d){for(;u<s&&i[l][u]!==null&&i[l][u]!==void 0;)u++;if(u>=s)continue;const p=Math.max(1,m.colSpan||1),f=Math.max(1,m.rowSpan||1),h=Math.min(f,a.length-l),y=`cell-${o.length}`,v=Array.from(m.classList),A=WI(m),k=XI(m),S=YI(m),b=GI(m),E={id:y,row:l,col:u,rowspan:h,colspan:p,contentHtml:A,classList:v,align:k,valign:S,style:b};o.push(E);for(let C=0;C<h;C++){const g=l+C;i[g]||(i[g]=Array(s).fill(null));for(let w=0;w<p;w++){const T=u+w;T>=s||i[g][T]!==null&&i[g][T]!==void 0||(i[g][T]=y)}}u+=p}l++}for(let c=0;c<i.length;c++)for(let u=0;u<s;u++)(i[c][u]===null||i[c][u]===void 0)&&(i[c][u]=null);new Set(i.flat().filter(c=>c!==null)),new Set(o.map(c=>c.id));for(const c of o)for(let u=c.row;u<c.row+c.rowspan;u++)for(let d=c.col;d<c.col+c.colspan;d++)i[u]&&(i[u][d],c.id);return{rows:i.length,cols:s,cells:o,grid:i,meta:r}}function r1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o=-1;const i=typeof t=="string"?t.trim():"";if(i){for(const p of r.cells)if(Array.isArray(p.classList)&&p.classList.includes(i)){o=p.row;break}}o===-1&&(r.rows===0?(o=0,n=!0):(o=r.rows-1,n=!1));const s=r.cells.filter(p=>p.row===o).sort((p,f)=>p.col-f.col),a=r.cells.length===0;if(s.length===0)if(a)s.push({id:"cell-0",row:0,col:0,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}}),r.cols=1;else for(let p=0;p<r.cols;p++)s.push({id:`template-${p}`,row:o,col:p,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}});let l=1;for(const p of s)p.rowspan>l&&(l=p.rowspan);let c=n?o:o+l;const u=new Array(r.cols).fill(!1);for(const p of r.cells)if(p.row<c&&p.row+p.rowspan>c)for(let f=p.col;f<p.col+p.colspan;f++)u[f]=!0;for(const p of r.cells)p.row>=c&&(p.row+=1);const d=[];let m=r.cells.length;for(let p=0;p<r.cols;p++){if(u[p])continue;const f=s.find(y=>y.col<=p&&p<y.col+y.colspan)||s[0]||{contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}},h=JSON.parse(JSON.stringify(f));h.id=`cell-${m++}`,h.contentHtml=El(f.contentHtml," "),h.classList=h.classList.filter(y=>y!==i),h.row=c,h.col=p,h.rowspan=1,h.colspan=1,d.push(h)}r.cells.push(...d),r.rows+=1,r.grid.splice(c,0,new Array(r.cols).fill(null));for(let p=0;p<r.rows;p++)for(let f=0;f<r.cols;f++){const h=r.cells.find(y=>y.row<=p&&y.row+y.rowspan>p&&y.col<=f&&y.col+y.colspan>f);r.grid[p][f]=h?h.id:null}for(let p=0;p<r.cols;p++)r.grid[c][p]===null&&u[p];return r}function KI(e){if(!e)return"";const t=[];if(e.fontFamily&&t.push(`font-family: ${e.fontFamily}`),e.fontSize!==void 0&&t.push(`font-size: ${e.fontSize}px`),e.lineHeight!==void 0&&t.push(`line-height: ${e.lineHeight}px`),e.color&&t.push(`color: ${e.color}`),e.backgroundColor&&t.push(`background-color: ${e.backgroundColor}`),e.textAlign&&t.push(`text-align: ${e.textAlign}`),e.verticalAlign&&t.push(`vertical-align: ${e.verticalAlign}`),e.borderRadius&&t.push(`border-radius: ${e.borderRadius}`),e.padding){const n=e.padding;n.top!==void 0&&n.right!==void 0&&n.bottom!==void 0&&n.left!==void 0&&n.top===n.right&&n.right===n.bottom&&n.bottom===n.left?t.push(`padding: ${n.top}px`):(n.top!==void 0&&t.push(`padding-top: ${n.top}px`),n.right!==void 0&&t.push(`padding-right: ${n.right}px`),n.bottom!==void 0&&t.push(`padding-bottom: ${n.bottom}px`),n.left!==void 0&&t.push(`padding-left: ${n.left}px`))}if(e.borders){const n=e.borders;n.border?t.push(`border: ${n.border.width}px ${n.border.style} ${n.border.color}`):(n.top&&t.push(`border-top: ${n.top.width}px ${n.top.style} ${n.top.color}`),n.right&&t.push(`border-right: ${n.right.width}px ${n.right.style} ${n.right.color}`),n.bottom&&t.push(`border-bottom: ${n.bottom.width}px ${n.bottom.style} ${n.bottom.color}`),n.left&&t.push(`border-left: ${n.left.width}px ${n.left.style} ${n.left.color}`))}return t.length?t.join("; "):""}function It(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const t=[];if(e.meta&&(e.meta.width&&t.push(`width="${Nn(e.meta.width)}"`),e.meta.cellpadding!==void 0&&t.push(`cellpadding="${e.meta.cellpadding}"`),e.meta.cellspacing!==void 0&&t.push(`cellspacing="${e.meta.cellspacing}"`),e.meta.border!==void 0&&t.push(`border="${e.meta.border}"`),e.meta.classList?.length&&t.push(`class="${Nn(e.meta.classList.join(" "))}"`),e.meta.attrs))for(const[o,i]of Object.entries(e.meta.attrs))t.push(`${Nn(o)}="${Nn(i)}"`);const n=new Map;for(const o of e.cells)n.set(o.id,o);const r=[];for(let o=0;o<e.rows;o++){const i=[];for(let s=0;s<e.cols;s++){const a=e.grid[o][s];if(!a)continue;const l=n.get(a);if(!l||l.row!==o||l.col!==s)continue;const c=[];l.rowspan>1&&c.push(`rowspan="${l.rowspan}"`),l.colspan>1&&c.push(`colspan="${l.colspan}"`),l.align&&c.push(`align="${Nn(l.align)}"`),l.valign&&c.push(`valign="${Nn(l.valign)}"`),l.classList?.length&&c.push(`class="${Nn(l.classList.join(" "))}"`);const u=KI(l.style);u&&c.push(`style="${Nn(u)}"`),i.push(`<td${c.length?" "+c.join(" "):""}>${l.contentHtml}</td>`)}i.length&&r.push(`<tr>${i.join("")}</tr>`)}return`<table${t.length?" "+t.join(" "):""}>${r.join("")}</table>`}function ZI(e,t){const n=JSON.parse(JSON.stringify(e));let r=-1;const o=typeof t=="string"?t.trim():"";if(o){for(const i of n.cells)if(Array.isArray(i.classList)&&i.classList.includes(o)){r=i.row;break}}if(r===-1||n.rows<=1||n.cells.filter(i=>i.row===r).some(i=>i.rowspan>1))return n;n.cells=n.cells.filter(i=>i.row!==r);for(const i of n.cells)i.row>r&&(i.row-=1);return n.grid.splice(r,1),n.rows-=1,n}function El(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(a){if(a.nodeType===Node.TEXT_NODE&&a.textContent?.trim()){r?a.textContent="":(a.textContent=t,r=!0);return}for(const l of Array.from(a.childNodes))o(l)}function i(a){if(a.nodeType===Node.TEXT_NODE){const l=a.textContent||"";return!l||/^\s*$/.test(l.replace(/\u00A0/g,"X"))}return a.nodeType!==Node.ELEMENT_NODE?!0:Array.from(a.childNodes).every(l=>i(l))}function s(a,l=!1){if(a.nodeType!==Node.ELEMENT_NODE)return;const c=Array.from(a.childNodes);for(const u of c)s(u);!l&&i(a)&&a.parentNode?.removeChild(a)}return o(n),s(n,!0),n.outerHTML||e}function o1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o;const i=typeof t=="string"?t.trim():"";if(i){for(const u of r.cells)if(Array.isArray(u.classList)&&u.classList.includes(i)){o=u;break}}if(!o)return r;const s=o.col;let a=n?s:s+o.colspan;const l=[];let c=r.cells.length;for(let u=0;u<r.rows;u++){const d=JSON.parse(JSON.stringify(o));d.id=`cell-${c++}`,d.contentHtml=El(o.contentHtml," "),d.row=u,d.col=a,d.rowspan=1,d.colspan=1,d.classList=o.classList.filter(m=>m!==i),l.push(d)}for(const u of r.cells)u.col>=a&&(u.col+=1);r.cells.push(...l),r.cols+=1;for(let u=0;u<r.rows;u++)r.grid[u].splice(a,0,null),r.grid[u][a]=l[u].id;return r}function QI(e,t){const n=JSON.parse(JSON.stringify(e));let r;const o=typeof t=="string"?t.trim():"";if(o){for(const s of n.cells)if(Array.isArray(s.classList)&&s.classList.includes(o)){r=s;break}}if(!r)return n;const i=r.col;if(n.cols<=1||n.cells.filter(s=>s.col===i).some(s=>s.colspan>1))return n;n.cells=n.cells.filter(s=>s.col!==i);for(const s of n.cells)s.col>i&&(s.col-=1);for(let s=0;s<n.rows;s++)n.grid[s].splice(i,1);return n.cols-=1,n}function i1(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const A of o.cells)if(Array.isArray(A.classList)&&A.classList.includes(s)){i=A;break}}if(!i)return o;const a=i.row,l=i.col,c=i.colspan,u=i.rowspan,d=[];if(n)for(let A=1;A<=r;A++)d.push(l-A);else for(let A=0;A<r;A++)d.push(l+c+A);for(const A of d)if(A<0||A>=o.cols)return o;const m=[];for(const A of d){const k=o.cells.find(S=>S.row===a&&S.col<=A&&A<S.col+S.colspan);if(!k)return o;m.push(k)}const p=Array.from(new Set(m));for(const A of p)if(A.rowspan!==u)return o;const f=c+p.reduce((A,k)=>A+k.colspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(A=>{const k=new DOMParser().parseFromString(A.contentHtml,"text/html").body.firstChild,S=k?k.innerHTML:"";return S===""||/^\s*(&nbsp;)*\s*$/.test(S)?"":S}).filter(A=>A!=="").join("<br>");(h===""||/^\s*(&nbsp;|<br>)*\s*$/.test(h))&&(h="&nbsp;");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.colspan=f,n&&d.length>0&&(i.col=Math.min(...d)),o.cells=o.cells.filter(A=>!p.includes(A));const v=n&&d.length>0?Math.min(...d):l;for(let A=v;A<v+f;A++)o.grid[a][A]=i.id;return o}function s1(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const A of o.cells)if(Array.isArray(A.classList)&&A.classList.includes(s)){i=A;break}}if(!i)return o;const a=i.row,l=i.col,c=i.rowspan,u=i.colspan,d=[];if(n)for(let A=1;A<=r;A++)d.push(a-A);else for(let A=0;A<r;A++)d.push(a+c+A);for(const A of d)if(A<0||A>=o.rows)return o;const m=[];for(const A of d){const k=o.cells.find(S=>S.col===l&&S.row<=A&&A<S.row+S.rowspan);if(!k)return o;m.push(k)}const p=Array.from(new Set(m));for(const A of p)if(A.colspan!==u)return o;const f=c+p.reduce((A,k)=>A+k.rowspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(A=>{const k=new DOMParser().parseFromString(A.contentHtml,"text/html").body.firstChild,S=k?k.innerHTML:"";return S===""||/^\s*(&nbsp;)*\s*$/.test(S)?"":S}).filter(A=>A!=="").join("<br>");h=h.replace(/&nbsp;$/g,""),(h===""||/^\s*(&nbsp;|<br>)*\s*$/.test(h))&&(h="&nbsp;");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.rowspan=f,n&&d.length>0&&(i.row=Math.min(...d)),o.cells=o.cells.filter(A=>!p.includes(A));const v=n&&d.length>0?Math.min(...d):a;for(let A=v;A<v+f&&A<o.rows;A++)o.grid[A][l]=i.id;return o}function JI(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.colspan<=1||n>=i.colspan)return r;i.colspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row,col:i.col+i.colspan,colspan:n,rowspan:i.rowspan,contentHtml:El(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}return r}function eD(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.rowspan<=1||n>=i.rowspan)return r;i.rowspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row+i.rowspan,col:i.col,rowspan:n,colspan:i.colspan,contentHtml:El(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}for(let a=s.row;a<s.row+s.rowspan;a++)for(let l=s.col;l<s.col+s.colspan;l++)r.grid[a][l];return r}function dm(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return null;const r=e.cells.find(o=>Array.isArray(o.classList)&&o.classList.includes(n));return r?{row:r.row,col:r.col}:null}function a1(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.row;if(o<0||o>=e.rows)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.rowspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.row<=o&&o<i.row+i.rowspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function l1(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.col;if(o<0||o>=e.cols)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.colspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.col<=o&&o<i.col+i.colspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function c1(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(c=>c.classList?.includes(t));if(!o)return r;const i=r.cells.filter(c=>c.classList?.includes(n)&&c.id!==o.id);let s=o.colspan||1;i.forEach(c=>{const u=c.colspan||1;s+=u,c.colspan=1}),o.colspan=s;const a=c=>{const u=c.match(/<div[^>]*>(.*?)<\/div>/);return u?u[1].replace(/&nbsp;/g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((c,u)=>c.col-u.col).map(c=>a(c.contentHtml)).filter(c=>c.length>0)].filter(c=>c.length>0).join("<br>")}</div>`;const l=new Set(i.map(c=>c.id));return r.cells.forEach(c=>{if(c.row===o.row&&c.col>o.col&&!l.has(c.id)){let u=0;i.forEach(d=>{d.row===c.row&&d.col<c.col&&(u+=(d.colspan||1)-1)}),c.col-=u}}),r.grid=r.grid.map((c,u)=>{const d=new Array(r.cols).fill(null);return r.cells.filter(m=>{const p=m.row,f=m.row+(m.rowspan||1)-1;return p<=u&&u<=f&&!l.has(m.id)}).sort((m,p)=>m.col-p.col).forEach(m=>{const p=m.id,f=m.colspan||1,h=m.col;for(let y=0;y<f&&h+y<r.cols;y++)d[h+y]=p}),d}),r}function u1(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(u=>u.classList?.includes(t));if(!o)return r;const i=r.cells.filter(u=>u.classList?.includes(n)&&u.id!==o.id&&u.col===o.col);let s=o.rowspan||1;i.forEach(u=>{const d=u.rowspan||1;s+=d,u.rowspan=1}),o.rowspan=s;const a=u=>{const d=u.match(/<div[^>]*>(.*?)<\/div>/);return d?d[1].replace(/&nbsp;/g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((u,d)=>u.row-d.row).map(u=>a(u.contentHtml)).filter(u=>u.length>0)].filter(u=>u.length>0).join("<br>")}</div>`;const l=i.length>0?Math.min(...i.map(u=>u.row)):o.row;l<o.row&&(o.row=l);const c=new Set(i.map(u=>u.id));return r.cells.forEach(u=>{if(u.col===o.col&&u.id!==o.id&&!c.has(u.id)){let d=0;i.forEach(m=>{m.col===u.col&&m.row<=u.row&&(d+=(m.rowspan||1)-1)}),d>0&&(u.row-=d)}}),r.grid=r.grid.map((u,d)=>{const m=new Array(r.cols).fill(null);return r.cells.filter(p=>{const f=p.row,h=p.row+(p.rowspan||1)-1;return f<=d&&d<=h&&!c.has(p.id)}).sort((p,f)=>p.col-f.col).forEach(p=>{const f=p.col,h=p.colspan||1;for(let y=0;y<h&&f+y<r.cols;y++)m[f+y]=p.id}),m}),r}function Sl(e,t,n,r,o,i=!0){const{cells:s,grid:a}=e;function l(p,f){if(!a[p]||!a[p][f])return null;const h=a[p][f];return s.find(y=>y.id===h)}function c(p,f){const h=l(p,f);return h?{row:h.row,col:h.col,cell:h}:null}const u=c(t,n),d=c(r,o);if(!u||!d||u.cell.id===d.cell.id)return 0;function m(p,f,h,y){let v=0;const A=p<f?1:-1,k=new Set;for(let b=p;b!==f;b+=A){const E=l(y?h:b,y?b:h);E&&!k.has(E.id)&&(k.add(E.id),v++)}const S=l(y?h:f,y?f:h);return S&&!k.has(S.id)&&v++,v}return i?u.row===d.row?m(n,o,t,!0)-1:0:u.col===d.col?m(t,r,n,!1)-1:0}function tD(e,t){if(!t.settings)return e;const n=Object.keys(t.settings);if(n.length===0)return e;const r=["paddingLeftRight","paddingTopBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"],o=n[0];if(!r.includes(o))return e;const i=t.settings[o];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach((s,a)=>{switch(s.id,s.style||(s.style={}),s.style.padding||(s.style.padding={top:0,right:0,bottom:0,left:0}),o){case"paddingLeftRight":s.style.padding.left=i,s.style.padding.right=i;break;case"paddingTopBottom":s.style.padding.top=i,s.style.padding.bottom=i;break;case"paddingLeft":s.style.padding.left=i;break;case"paddingTop":s.style.padding.top=i;break;case"paddingRight":s.style.padding.right=i;break;case"paddingBottom":s.style.padding.bottom=i}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 nD(e,t){const{backgroundPositionX:n,backgroundPositionY:r}=t.settings;if(n===void 0&&r===void 0)return e;const o=e.replace(/\s*;\s*/g,";").replace(/([^;])$/,"$1;").trim().split(";").filter(a=>a.trim());let i=!1;const s=o.map(a=>{const[l,c]=a.split(":").map(u=>u.trim());if(l==="background-position"){i=!0;const u=c.split(/\s+/).filter(p=>p.trim());let d=u[0],m=u[1]||u[0];return n!==void 0&&(d=`${n}px`),r!==void 0&&(m=`${r}px`),`background-position: ${d} ${m}`}return l==="background-position-x"&&n!==void 0?`background-position-x: ${n}px`:l==="background-position-y"&&r!==void 0?`background-position-y: ${r}px`:a});if(!i&&(n!==void 0||r!==void 0)){const a=n!==void 0?`${n}px`:"center",l=r!==void 0?`${r}px`:"center";s.push(`background-position: ${a} ${l}`)}return s.join("; ")}function rD(e){const t={};if(!e)return t;const n=e.split(";").map(r=>r.trim()).filter(r=>r.length>0);for(const r of n){const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim(),s=r.slice(o+1).trim();if(!(!i||!s))switch(i.toLowerCase()){case"background-image":const a=s.match(/url\(['"]?(.+?)['"]?\)/i);a&&a[1]&&(t.backgroundImage=a[1]);break;case"background-size":t.backgroundSize=s;break;case"background-repeat":t.backgroundRepeat=s;break;case"background-position":const l=s.split(/\s+/).filter(c=>c.length>0);l.length>=1&&(t.backgroundPositionX=l[0]),l.length>=2&&(t.backgroundPositionY=l[1])}}return t}function oD(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function iD(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}function sD(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 aD(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}}}return i}function lD(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let m=0;m<d.rowspan;m++)for(let p=0;p<d.colspan;p++){const f=d.row+m,h=d.col+p,y=`${f}-${h}`;r.has(y)||(r.add(y),o.push({row:f,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const m=n.get(d);if(m.rowspan>1||m.colspan>1){const p=a?(f,h)=>f.col-h.col:(f,h)=>f.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],m=d.id,p=n.get(m);let f=m;if(p.rowspan>1||p.colspan>1){const y=l.get(m).findIndex(v=>v.row===d.row&&v.col===d.col);y>0&&(f=`${m}-uni-${y+1}`)}const h=[];a?(h.push("top","bottom"),(u===0||o[u-1].col!==d.col-1)&&h.push("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.push("right")):(h.push("left","right"),(u===0||o[u-1].row!==d.row-1)&&h.push("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.push("bottom")),c[f]=h}return c}function cD(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={});let 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}function uD(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let m=0;m<d.rowspan;m++)for(let p=0;p<d.colspan;p++){const f=d.row+m,h=d.col+p,y=`${f}-${h}`;r.has(y)||(r.add(y),o.push({row:f,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const m=n.get(d);if(m.rowspan>1||m.colspan>1){const p=a?(f,h)=>f.col-h.col:(f,h)=>f.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],m=d.id,p=n.get(m);let f=m;if(p.rowspan>1||p.colspan>1){const v=l.get(m).findIndex(A=>A.row===d.row&&A.col===d.col);v>0&&(f=`${m}-uni-${v+1}`)}const h=new Set;a?(h.add("top"),h.add("bottom"),(u===0||o[u-1].col!==d.col-1)&&h.add("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.add("right")):(h.add("left"),h.add("right"),(u===0||o[u-1].row!==d.row-1)&&h.add("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.add("bottom"));const y=[];h.has("top")&&h.has("left")&&y.push("topLeft"),h.has("top")&&h.has("right")&&y.push("topRight"),h.has("bottom")&&h.has("left")&&y.push("bottomLeft"),h.has("bottom")&&h.has("right")&&y.push("bottomRight"),y.length>0&&(c[f]=y)}return c}function dD(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}["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 mD(e,t){const n=new RegExp(`\\b${t}\\s*:[^;]*(;\\s*)?`,"gi");return e.replace(n,"").trim().replace(/\s*;\s*(?=;|$)/g,"").trim()}function fD(e){const t=e.match(/border-radius:\s*([^;]+)/);if(!t)return{full:null,first:null,firstNumber:null};const n=t[1].trim(),r=n.split(/\s+/)[0],o=parseInt(r),i=n.split(/\s+/)[1],s=parseInt(i),a=n.split(/\s+/)[2],l=parseInt(a),c=n.split(/\s+/)[3];return{full:n,first:r,firstNumber:o,second:i,secondNumber:s,third:a,thirdNumber:l,fourth:c,fourthNumber:parseInt(c)}}function pD(e,t,n){const r=/border-radius:\s*([^;]+)/,o=e.match(r);if(!o)return e+` border-radius: ${d1("0 0 0 0",t,n)};`;const i=d1(o[1].trim(),t,n);return e.replace(r,`border-radius: ${i}`)}function d1(e,t,n){const r=typeof n=="number"&&!isNaN(n)?Math.max(0,n):0;let o=e.split(/\s+/).filter(a=>a.trim()!=="").map(a=>{const l=parseFloat(a);return isNaN(l)?0:Math.max(0,l)}),i;if(o.length===0)i=[0,0,0,0];else if(o.length===1)i=[o[0],o[0],o[0],o[0]];else if(o.length===2)i=[o[0],o[1],o[0],o[1]];else if(o.length===3)i=[o[0],o[1],o[2],o[1]];else{const a=o.slice(0,4);i=[a[0]??0,a[1]??0,a[2]??0,a[3]??0]}const s={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3}[t];return s!==void 0&&(i[s]=r),i.map(a=>a===0?"0":`${a}px`).join(" ")}function hD(e){const t=JSON.parse(JSON.stringify(e)),n=t.rows,r=t.cols;return t.cells.forEach(o=>{const i=o.row===0,s=o.row+o.rowspan===n,a=o.col===0,l=o.col+o.colspan===r;i&&delete o.style.borders.top,s&&delete o.style.borders.bottom,a&&delete o.style.borders.left,l&&delete o.style.borders.right}),t}function gD(e){const t=JSON.parse(JSON.stringify(e));return t.cells.forEach(n=>{if(n.style?.borders?.top&&n.style?.borders?.bottom&&n.style?.borders?.left&&n.style?.borders?.right){const r=n.style.borders.top,o=n.style.borders.bottom,i=n.style.borders.left,s=n.style.borders.right;r?.width===o?.width&&r?.width===i?.width&&r?.width===s?.width&&r?.style===o?.style&&r?.style===i?.style&&r?.style===s?.style&&r?.color===o?.color&&r?.color===i?.color&&r?.color===s?.color&&(n.style.borders={border:{width:r.width,style:r.style,color:r.color}})}}),t}function bD(e,t){return typeof e!="string"&&(e=String(e||"")),typeof t!="string"&&(t=String(t||"")),e.split(" ").filter(n=>n&&!n.startsWith(t)).join(" ").trim()}function yD(e){const t={},n={};return Object.keys(e).forEach(r=>{const o=r.indexOf("-uni-");if(o===-1){const i=r;t[i]=[...e[r]],n[i]=new Set(e[r])}else{const i=r.substring(0,o);n[i]||(n[i]=new Set),e[r].forEach(s=>{n[i].add(s)}),e.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=[...e[i]],e[i].forEach(s=>n[i].add(s)))}}),Object.keys(n).forEach(r=>{const o=r;t[o]||(t[o]=[]),t[o]=Array.from(n[o])}),t}var Xq="#1C52DC",Yq="#1C52DC",Kq="#1C52DC",wl="none",m1="b64_",vD=/^(\d+(?:_\d+)?)(px|perc)$/;function ED(e){if(e===wl)return wl;let t="";return new TextEncoder().encode(za(e)).forEach(n=>{t+=String.fromCharCode(n)}),m1+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function SD(e){if(e===wl)return wl;if(!e.startsWith(m1))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 wD(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function f1(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function p1(e){const t=e.match(vD);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function CD(){return Hd()}function Ie(e,t){const n=CD();n&&n.insertAdjacentHTML("beforeend",`
84
+ `),o.prepend(document.querySelector(c).cloneNode(!0)))}}),r.append(o),by(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=Vt(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 PI(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=OI(o,n);if(!i)return;MI(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:ko({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function yl(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 vl(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 Ke=()=>ua(window.getSelection()?.toString())??"",II=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],DI={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},BI=/^#[\da-f]{6}$/i,e1=()=>[...new Set(II.flatMap(HI).map(X).filter(e=>BI.test(e)).map(e=>e.toUpperCase()))];function HI({type:e,name:t}){const n=DI[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}var FI=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"],cm=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">&nbsp;</div>`;function $I(e){return!!e.closest("editor.em-text")}function t1(e){e.querySelectorAll(FI.join(",")).forEach(t=>{$I(t)||t.remove()})}function WI(e){const t=e.cloneNode(!0),n=t.querySelector("editor.em-text");if(n){t1(t);const o=n.querySelector("div");if(o)return o.outerHTML;const i=n.getAttribute("innerclass")??"",s=n.getAttribute("innerstyle")??"";return`<div${i?` class="${Nn(i)}"`:""}${s?` style="${Nn(s)}"`:""}>${n.innerHTML}</div>`}t1(t);const r=t.querySelector("div");return r?r.outerHTML:t.innerHTML}function Nn(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function cn(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function es(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=cn(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 qI(e){const t=e.get("padding"),n=e.get("padding-top"),r=e.get("padding-right"),o=e.get("padding-bottom"),i=e.get("padding-left"),s={};if(t){const d=t.trim().split(/\s+/),m=cn(d[0]),p=cn(d[1]??d[0]),f=cn(d[2]??d[0]),h=cn(d[3]??d[1]??d[0]);m!==void 0&&(s.top=m),p!==void 0&&(s.right=p),f!==void 0&&(s.bottom=f),h!==void 0&&(s.left=h)}const a=cn(n??""),l=cn(r??""),c=cn(o??""),u=cn(i??"");return a!==void 0&&(s.top=a),l!==void 0&&(s.right=l),c!==void 0&&(s.bottom=c),u!==void 0&&(s.left=u),Object.keys(s).length?s:void 0}function n1(e){if(e)return e.trim()}function zI(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].includes(t)?t:void 0}function VI(e){if(!e)return;const t=e.trim().toLowerCase();if(t==="top"||t==="text-top")return"top";if(t==="bottom"||t==="text-bottom")return"bottom";if(t==="middle")return"middle"}function UI(e){const t=new Map;return e&&e.split(";").forEach(n=>{const[r,...o]=n.split(":");if(!r||o.length===0)return;const i=r.trim().toLowerCase(),s=o.join(":").trim();i&&t.set(i,s)}),t}function jI(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 GI(e){const t=UI(e.getAttribute("style")),n=t.get("font-family")??void 0,r=cn(t.get("font-size")??""),o=cn(t.get("line-height")??""),i=n1(t.get("color")??void 0),s=n1(t.get("background-color")??void 0),a=zI(t.get("text-align")??void 0),l=VI(t.get("vertical-align")??void 0),c={top:es(t.get("border-top")),right:es(t.get("border-right")),bottom:es(t.get("border-bottom")),left:es(t.get("border-left"))},u=es(t.get("border"));u&&(c.top=c.top??u,c.right=c.right??u,c.bottom=c.bottom??u,c.left=c.left??u);const d=qI(t),m=jI(t.get("border-radius")??void 0),p={};return n&&(p.fontFamily=n),r!==void 0&&(p.fontSize=r),o!==void 0&&(p.lineHeight=o),i&&(p.color=i),s&&(p.backgroundColor=s),a&&(p.textAlign=a),l&&(p.verticalAlign=l),d&&(p.padding=d),m&&(p.borderRadius=m),(c.top||c.right||c.bottom||c.left)&&(p.borders=c),Object.keys(p).length?p:void 0}function XI(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function YI(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}function um(e){if(e==null)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function ts(e){const t=Array.from(e.classList),n={};Array.from(e.attributes).forEach(c=>{const u=c.name.toLowerCase();u!=="class"&&(n[u]=c.value)});const r={width:e.getAttribute("width")??void 0,cellpadding:um(e.getAttribute("cellpadding")),cellspacing:um(e.getAttribute("cellspacing")),border:um(e.getAttribute("border")),classList:t.length?t:void 0,attrs:Object.keys(n).length?n:void 0},o=[],i=[];let s=0;const a=Array.from(e.querySelectorAll(":scope > tr, :scope > tbody > tr, :scope > thead > tr, :scope > tfoot > tr")).filter(c=>c.querySelectorAll("td, th").length!==0);a.forEach(c=>{let u=0;Array.from(c.querySelectorAll("td, th")).forEach(d=>{const m=Math.max(1,d.colSpan||1);u+=m}),u>s&&(s=u)});let l=0;for(const c of a){i[l]||(i[l]=Array(s).fill(null));let u=0;const d=Array.from(c.querySelectorAll("td, th"));for(const m of d){for(;u<s&&i[l][u]!==null&&i[l][u]!==void 0;)u++;if(u>=s)continue;const p=Math.max(1,m.colSpan||1),f=Math.max(1,m.rowSpan||1),h=Math.min(f,a.length-l),y=`cell-${o.length}`,v=Array.from(m.classList),A=WI(m),k=XI(m),S=YI(m),b=GI(m),E={id:y,row:l,col:u,rowspan:h,colspan:p,contentHtml:A,classList:v,align:k,valign:S,style:b};o.push(E);for(let C=0;C<h;C++){const g=l+C;i[g]||(i[g]=Array(s).fill(null));for(let w=0;w<p;w++){const T=u+w;T>=s||i[g][T]!==null&&i[g][T]!==void 0||(i[g][T]=y)}}u+=p}l++}for(let c=0;c<i.length;c++)for(let u=0;u<s;u++)(i[c][u]===null||i[c][u]===void 0)&&(i[c][u]=null);new Set(i.flat().filter(c=>c!==null)),new Set(o.map(c=>c.id));for(const c of o)for(let u=c.row;u<c.row+c.rowspan;u++)for(let d=c.col;d<c.col+c.colspan;d++)i[u]&&(i[u][d],c.id);return{rows:i.length,cols:s,cells:o,grid:i,meta:r}}function r1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o=-1;const i=typeof t=="string"?t.trim():"";if(i){for(const p of r.cells)if(Array.isArray(p.classList)&&p.classList.includes(i)){o=p.row;break}}o===-1&&(r.rows===0?(o=0,n=!0):(o=r.rows-1,n=!1));const s=r.cells.filter(p=>p.row===o).sort((p,f)=>p.col-f.col),a=r.cells.length===0;if(s.length===0)if(a)s.push({id:"cell-0",row:0,col:0,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}}),r.cols=1;else for(let p=0;p<r.cols;p++)s.push({id:`template-${p}`,row:o,col:p,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}});let l=1;for(const p of s)p.rowspan>l&&(l=p.rowspan);let c=n?o:o+l;const u=new Array(r.cols).fill(!1);for(const p of r.cells)if(p.row<c&&p.row+p.rowspan>c)for(let f=p.col;f<p.col+p.colspan;f++)u[f]=!0;for(const p of r.cells)p.row>=c&&(p.row+=1);const d=[];let m=r.cells.length;for(let p=0;p<r.cols;p++){if(u[p])continue;const f=s.find(y=>y.col<=p&&p<y.col+y.colspan)||s[0]||{contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}},h=JSON.parse(JSON.stringify(f));h.id=`cell-${m++}`,h.contentHtml=El(f.contentHtml," "),h.classList=h.classList.filter(y=>y!==i),h.row=c,h.col=p,h.rowspan=1,h.colspan=1,d.push(h)}r.cells.push(...d),r.rows+=1,r.grid.splice(c,0,new Array(r.cols).fill(null));for(let p=0;p<r.rows;p++)for(let f=0;f<r.cols;f++){const h=r.cells.find(y=>y.row<=p&&y.row+y.rowspan>p&&y.col<=f&&y.col+y.colspan>f);r.grid[p][f]=h?h.id:null}for(let p=0;p<r.cols;p++)r.grid[c][p]===null&&u[p];return r}function KI(e){if(!e)return"";const t=[];if(e.fontFamily&&t.push(`font-family: ${e.fontFamily}`),e.fontSize!==void 0&&t.push(`font-size: ${e.fontSize}px`),e.lineHeight!==void 0&&t.push(`line-height: ${e.lineHeight}px`),e.color&&t.push(`color: ${e.color}`),e.backgroundColor&&t.push(`background-color: ${e.backgroundColor}`),e.textAlign&&t.push(`text-align: ${e.textAlign}`),e.verticalAlign&&t.push(`vertical-align: ${e.verticalAlign}`),e.borderRadius&&t.push(`border-radius: ${e.borderRadius}`),e.padding){const n=e.padding;n.top!==void 0&&n.right!==void 0&&n.bottom!==void 0&&n.left!==void 0&&n.top===n.right&&n.right===n.bottom&&n.bottom===n.left?t.push(`padding: ${n.top}px`):(n.top!==void 0&&t.push(`padding-top: ${n.top}px`),n.right!==void 0&&t.push(`padding-right: ${n.right}px`),n.bottom!==void 0&&t.push(`padding-bottom: ${n.bottom}px`),n.left!==void 0&&t.push(`padding-left: ${n.left}px`))}if(e.borders){const n=e.borders;n.border?t.push(`border: ${n.border.width}px ${n.border.style} ${n.border.color}`):(n.top&&t.push(`border-top: ${n.top.width}px ${n.top.style} ${n.top.color}`),n.right&&t.push(`border-right: ${n.right.width}px ${n.right.style} ${n.right.color}`),n.bottom&&t.push(`border-bottom: ${n.bottom.width}px ${n.bottom.style} ${n.bottom.color}`),n.left&&t.push(`border-left: ${n.left.width}px ${n.left.style} ${n.left.color}`))}return t.length?t.join("; "):""}function It(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const t=[];if(e.meta&&(e.meta.width&&t.push(`width="${Nn(e.meta.width)}"`),e.meta.cellpadding!==void 0&&t.push(`cellpadding="${e.meta.cellpadding}"`),e.meta.cellspacing!==void 0&&t.push(`cellspacing="${e.meta.cellspacing}"`),e.meta.border!==void 0&&t.push(`border="${e.meta.border}"`),e.meta.classList?.length&&t.push(`class="${Nn(e.meta.classList.join(" "))}"`),e.meta.attrs))for(const[o,i]of Object.entries(e.meta.attrs))t.push(`${Nn(o)}="${Nn(i)}"`);const n=new Map;for(const o of e.cells)n.set(o.id,o);const r=[];for(let o=0;o<e.rows;o++){const i=[];for(let s=0;s<e.cols;s++){const a=e.grid[o][s];if(!a)continue;const l=n.get(a);if(!l||l.row!==o||l.col!==s)continue;const c=[];l.rowspan>1&&c.push(`rowspan="${l.rowspan}"`),l.colspan>1&&c.push(`colspan="${l.colspan}"`),l.align&&c.push(`align="${Nn(l.align)}"`),l.valign&&c.push(`valign="${Nn(l.valign)}"`),l.classList?.length&&c.push(`class="${Nn(l.classList.join(" "))}"`);const u=KI(l.style);u&&c.push(`style="${Nn(u)}"`),i.push(`<td${c.length?" "+c.join(" "):""}>${l.contentHtml}</td>`)}i.length&&r.push(`<tr>${i.join("")}</tr>`)}return`<table${t.length?" "+t.join(" "):""}>${r.join("")}</table>`}function ZI(e,t){const n=JSON.parse(JSON.stringify(e));let r=-1;const o=typeof t=="string"?t.trim():"";if(o){for(const i of n.cells)if(Array.isArray(i.classList)&&i.classList.includes(o)){r=i.row;break}}if(r===-1||n.rows<=1||n.cells.filter(i=>i.row===r).some(i=>i.rowspan>1))return n;n.cells=n.cells.filter(i=>i.row!==r);for(const i of n.cells)i.row>r&&(i.row-=1);return n.grid.splice(r,1),n.rows-=1,n}function El(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(a){if(a.nodeType===Node.TEXT_NODE&&a.textContent?.trim()){r?a.textContent="":(a.textContent=t,r=!0);return}for(const l of Array.from(a.childNodes))o(l)}function i(a){if(a.nodeType===Node.TEXT_NODE){const l=a.textContent||"";return!l||/^\s*$/.test(l.replace(/\u00A0/g,"X"))}return a.nodeType!==Node.ELEMENT_NODE?!0:Array.from(a.childNodes).every(l=>i(l))}function s(a,l=!1){if(a.nodeType!==Node.ELEMENT_NODE)return;const c=Array.from(a.childNodes);for(const u of c)s(u);!l&&i(a)&&a.parentNode?.removeChild(a)}return o(n),s(n,!0),n.outerHTML||e}function o1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o;const i=typeof t=="string"?t.trim():"";if(i){for(const u of r.cells)if(Array.isArray(u.classList)&&u.classList.includes(i)){o=u;break}}if(!o)return r;const s=o.col;let a=n?s:s+o.colspan;const l=[];let c=r.cells.length;for(let u=0;u<r.rows;u++){const d=JSON.parse(JSON.stringify(o));d.id=`cell-${c++}`,d.contentHtml=El(o.contentHtml," "),d.row=u,d.col=a,d.rowspan=1,d.colspan=1,d.classList=o.classList.filter(m=>m!==i),l.push(d)}for(const u of r.cells)u.col>=a&&(u.col+=1);r.cells.push(...l),r.cols+=1;for(let u=0;u<r.rows;u++)r.grid[u].splice(a,0,null),r.grid[u][a]=l[u].id;return r}function QI(e,t){const n=JSON.parse(JSON.stringify(e));let r;const o=typeof t=="string"?t.trim():"";if(o){for(const s of n.cells)if(Array.isArray(s.classList)&&s.classList.includes(o)){r=s;break}}if(!r)return n;const i=r.col;if(n.cols<=1||n.cells.filter(s=>s.col===i).some(s=>s.colspan>1))return n;n.cells=n.cells.filter(s=>s.col!==i);for(const s of n.cells)s.col>i&&(s.col-=1);for(let s=0;s<n.rows;s++)n.grid[s].splice(i,1);return n.cols-=1,n}function i1(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const A of o.cells)if(Array.isArray(A.classList)&&A.classList.includes(s)){i=A;break}}if(!i)return o;const a=i.row,l=i.col,c=i.colspan,u=i.rowspan,d=[];if(n)for(let A=1;A<=r;A++)d.push(l-A);else for(let A=0;A<r;A++)d.push(l+c+A);for(const A of d)if(A<0||A>=o.cols)return o;const m=[];for(const A of d){const k=o.cells.find(S=>S.row===a&&S.col<=A&&A<S.col+S.colspan);if(!k)return o;m.push(k)}const p=Array.from(new Set(m));for(const A of p)if(A.rowspan!==u)return o;const f=c+p.reduce((A,k)=>A+k.colspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(A=>{const k=new DOMParser().parseFromString(A.contentHtml,"text/html").body.firstChild,S=k?k.innerHTML:"";return S===""||/^\s*(&nbsp;)*\s*$/.test(S)?"":S}).filter(A=>A!=="").join("<br>");(h===""||/^\s*(&nbsp;|<br>)*\s*$/.test(h))&&(h="&nbsp;");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.colspan=f,n&&d.length>0&&(i.col=Math.min(...d)),o.cells=o.cells.filter(A=>!p.includes(A));const v=n&&d.length>0?Math.min(...d):l;for(let A=v;A<v+f;A++)o.grid[a][A]=i.id;return o}function s1(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const A of o.cells)if(Array.isArray(A.classList)&&A.classList.includes(s)){i=A;break}}if(!i)return o;const a=i.row,l=i.col,c=i.rowspan,u=i.colspan,d=[];if(n)for(let A=1;A<=r;A++)d.push(a-A);else for(let A=0;A<r;A++)d.push(a+c+A);for(const A of d)if(A<0||A>=o.rows)return o;const m=[];for(const A of d){const k=o.cells.find(S=>S.col===l&&S.row<=A&&A<S.row+S.rowspan);if(!k)return o;m.push(k)}const p=Array.from(new Set(m));for(const A of p)if(A.colspan!==u)return o;const f=c+p.reduce((A,k)=>A+k.rowspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(A=>{const k=new DOMParser().parseFromString(A.contentHtml,"text/html").body.firstChild,S=k?k.innerHTML:"";return S===""||/^\s*(&nbsp;)*\s*$/.test(S)?"":S}).filter(A=>A!=="").join("<br>");h=h.replace(/&nbsp;$/g,""),(h===""||/^\s*(&nbsp;|<br>)*\s*$/.test(h))&&(h="&nbsp;");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.rowspan=f,n&&d.length>0&&(i.row=Math.min(...d)),o.cells=o.cells.filter(A=>!p.includes(A));const v=n&&d.length>0?Math.min(...d):a;for(let A=v;A<v+f&&A<o.rows;A++)o.grid[A][l]=i.id;return o}function JI(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.colspan<=1||n>=i.colspan)return r;i.colspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row,col:i.col+i.colspan,colspan:n,rowspan:i.rowspan,contentHtml:El(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}return r}function eD(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.rowspan<=1||n>=i.rowspan)return r;i.rowspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row+i.rowspan,col:i.col,rowspan:n,colspan:i.colspan,contentHtml:El(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}for(let a=s.row;a<s.row+s.rowspan;a++)for(let l=s.col;l<s.col+s.colspan;l++)r.grid[a][l];return r}function dm(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return null;const r=e.cells.find(o=>Array.isArray(o.classList)&&o.classList.includes(n));return r?{row:r.row,col:r.col}:null}function a1(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.row;if(o<0||o>=e.rows)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.rowspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.row<=o&&o<i.row+i.rowspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function l1(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.col;if(o<0||o>=e.cols)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.colspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.col<=o&&o<i.col+i.colspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function c1(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(c=>c.classList?.includes(t));if(!o)return r;const i=r.cells.filter(c=>c.classList?.includes(n)&&c.id!==o.id);let s=o.colspan||1;i.forEach(c=>{const u=c.colspan||1;s+=u,c.colspan=1}),o.colspan=s;const a=c=>{const u=c.match(/<div[^>]*>(.*?)<\/div>/);return u?u[1].replace(/&nbsp;/g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((c,u)=>c.col-u.col).map(c=>a(c.contentHtml)).filter(c=>c.length>0)].filter(c=>c.length>0).join("<br>")}</div>`;const l=new Set(i.map(c=>c.id));return r.cells.forEach(c=>{if(c.row===o.row&&c.col>o.col&&!l.has(c.id)){let u=0;i.forEach(d=>{d.row===c.row&&d.col<c.col&&(u+=(d.colspan||1)-1)}),c.col-=u}}),r.grid=r.grid.map((c,u)=>{const d=new Array(r.cols).fill(null);return r.cells.filter(m=>{const p=m.row,f=m.row+(m.rowspan||1)-1;return p<=u&&u<=f&&!l.has(m.id)}).sort((m,p)=>m.col-p.col).forEach(m=>{const p=m.id,f=m.colspan||1,h=m.col;for(let y=0;y<f&&h+y<r.cols;y++)d[h+y]=p}),d}),r}function u1(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(u=>u.classList?.includes(t));if(!o)return r;const i=r.cells.filter(u=>u.classList?.includes(n)&&u.id!==o.id&&u.col===o.col);let s=o.rowspan||1;i.forEach(u=>{const d=u.rowspan||1;s+=d,u.rowspan=1}),o.rowspan=s;const a=u=>{const d=u.match(/<div[^>]*>(.*?)<\/div>/);return d?d[1].replace(/&nbsp;/g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((u,d)=>u.row-d.row).map(u=>a(u.contentHtml)).filter(u=>u.length>0)].filter(u=>u.length>0).join("<br>")}</div>`;const l=i.length>0?Math.min(...i.map(u=>u.row)):o.row;l<o.row&&(o.row=l);const c=new Set(i.map(u=>u.id));return r.cells.forEach(u=>{if(u.col===o.col&&u.id!==o.id&&!c.has(u.id)){let d=0;i.forEach(m=>{m.col===u.col&&m.row<=u.row&&(d+=(m.rowspan||1)-1)}),d>0&&(u.row-=d)}}),r.grid=r.grid.map((u,d)=>{const m=new Array(r.cols).fill(null);return r.cells.filter(p=>{const f=p.row,h=p.row+(p.rowspan||1)-1;return f<=d&&d<=h&&!c.has(p.id)}).sort((p,f)=>p.col-f.col).forEach(p=>{const f=p.col,h=p.colspan||1;for(let y=0;y<h&&f+y<r.cols;y++)m[f+y]=p.id}),m}),r}function Sl(e,t,n,r,o,i=!0){const{cells:s,grid:a}=e;function l(p,f){if(!a[p]||!a[p][f])return null;const h=a[p][f];return s.find(y=>y.id===h)}function c(p,f){const h=l(p,f);return h?{row:h.row,col:h.col,cell:h}:null}const u=c(t,n),d=c(r,o);if(!u||!d||u.cell.id===d.cell.id)return 0;function m(p,f,h,y){let v=0;const A=p<f?1:-1,k=new Set;for(let b=p;b!==f;b+=A){const E=l(y?h:b,y?b:h);E&&!k.has(E.id)&&(k.add(E.id),v++)}const S=l(y?h:f,y?f:h);return S&&!k.has(S.id)&&v++,v}return i?u.row===d.row?m(n,o,t,!0)-1:0:u.col===d.col?m(t,r,n,!1)-1:0}function tD(e,t){if(!t.settings)return e;const n=Object.keys(t.settings);if(n.length===0)return e;const r=["paddingLeftRight","paddingTopBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"],o=n[0];if(!r.includes(o))return e;const i=t.settings[o];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach((s,a)=>{switch(s.id,s.style||(s.style={}),s.style.padding||(s.style.padding={top:0,right:0,bottom:0,left:0}),o){case"paddingLeftRight":s.style.padding.left=i,s.style.padding.right=i;break;case"paddingTopBottom":s.style.padding.top=i,s.style.padding.bottom=i;break;case"paddingLeft":s.style.padding.left=i;break;case"paddingTop":s.style.padding.top=i;break;case"paddingRight":s.style.padding.right=i;break;case"paddingBottom":s.style.padding.bottom=i}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 nD(e,t){const{backgroundPositionX:n,backgroundPositionY:r}=t.settings;if(n===void 0&&r===void 0)return e;const o=e.replace(/\s*;\s*/g,";").replace(/([^;])$/,"$1;").trim().split(";").filter(a=>a.trim());let i=!1;const s=o.map(a=>{const[l,c]=a.split(":").map(u=>u.trim());if(l==="background-position"){i=!0;const u=c.split(/\s+/).filter(p=>p.trim());let d=u[0],m=u[1]||u[0];return n!==void 0&&(d=`${n}px`),r!==void 0&&(m=`${r}px`),`background-position: ${d} ${m}`}return l==="background-position-x"&&n!==void 0?`background-position-x: ${n}px`:l==="background-position-y"&&r!==void 0?`background-position-y: ${r}px`:a});if(!i&&(n!==void 0||r!==void 0)){const a=n!==void 0?`${n}px`:"center",l=r!==void 0?`${r}px`:"center";s.push(`background-position: ${a} ${l}`)}return s.join("; ")}function rD(e){const t={};if(!e)return t;const n=e.split(";").map(r=>r.trim()).filter(r=>r.length>0);for(const r of n){const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim(),s=r.slice(o+1).trim();if(!(!i||!s))switch(i.toLowerCase()){case"background-image":const a=s.match(/url\(['"]?(.+?)['"]?\)/i);a&&a[1]&&(t.backgroundImage=a[1]);break;case"background-size":t.backgroundSize=s;break;case"background-repeat":t.backgroundRepeat=s;break;case"background-position":const l=s.split(/\s+/).filter(c=>c.length>0);l.length>=1&&(t.backgroundPositionX=l[0]),l.length>=2&&(t.backgroundPositionY=l[1])}}return t}function oD(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function iD(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}function sD(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 aD(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}}}return i}function lD(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let m=0;m<d.rowspan;m++)for(let p=0;p<d.colspan;p++){const f=d.row+m,h=d.col+p,y=`${f}-${h}`;r.has(y)||(r.add(y),o.push({row:f,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const m=n.get(d);if(m.rowspan>1||m.colspan>1){const p=a?(f,h)=>f.col-h.col:(f,h)=>f.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],m=d.id,p=n.get(m);let f=m;if(p.rowspan>1||p.colspan>1){const y=l.get(m).findIndex(v=>v.row===d.row&&v.col===d.col);y>0&&(f=`${m}-uni-${y+1}`)}const h=[];a?(h.push("top","bottom"),(u===0||o[u-1].col!==d.col-1)&&h.push("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.push("right")):(h.push("left","right"),(u===0||o[u-1].row!==d.row-1)&&h.push("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.push("bottom")),c[f]=h}return c}function cD(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={});let 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}function uD(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let m=0;m<d.rowspan;m++)for(let p=0;p<d.colspan;p++){const f=d.row+m,h=d.col+p,y=`${f}-${h}`;r.has(y)||(r.add(y),o.push({row:f,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const m=n.get(d);if(m.rowspan>1||m.colspan>1){const p=a?(f,h)=>f.col-h.col:(f,h)=>f.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],m=d.id,p=n.get(m);let f=m;if(p.rowspan>1||p.colspan>1){const v=l.get(m).findIndex(A=>A.row===d.row&&A.col===d.col);v>0&&(f=`${m}-uni-${v+1}`)}const h=new Set;a?(h.add("top"),h.add("bottom"),(u===0||o[u-1].col!==d.col-1)&&h.add("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.add("right")):(h.add("left"),h.add("right"),(u===0||o[u-1].row!==d.row-1)&&h.add("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.add("bottom"));const y=[];h.has("top")&&h.has("left")&&y.push("topLeft"),h.has("top")&&h.has("right")&&y.push("topRight"),h.has("bottom")&&h.has("left")&&y.push("bottomLeft"),h.has("bottom")&&h.has("right")&&y.push("bottomRight"),y.length>0&&(c[f]=y)}return c}function dD(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}["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 mD(e,t){const n=new RegExp(`\\b${t}\\s*:[^;]*(;\\s*)?`,"gi");return e.replace(n,"").trim().replace(/\s*;\s*(?=;|$)/g,"").trim()}function fD(e){const t=e.match(/border-radius:\s*([^;]+)/);if(!t)return{full:null,first:null,firstNumber:null};const n=t[1].trim(),r=n.split(/\s+/)[0],o=parseInt(r),i=n.split(/\s+/)[1],s=parseInt(i),a=n.split(/\s+/)[2],l=parseInt(a),c=n.split(/\s+/)[3];return{full:n,first:r,firstNumber:o,second:i,secondNumber:s,third:a,thirdNumber:l,fourth:c,fourthNumber:parseInt(c)}}function pD(e,t,n){const r=/border-radius:\s*([^;]+)/,o=e.match(r);if(!o)return e+` border-radius: ${d1("0 0 0 0",t,n)};`;const i=d1(o[1].trim(),t,n);return e.replace(r,`border-radius: ${i}`)}function d1(e,t,n){const r=typeof n=="number"&&!isNaN(n)?Math.max(0,n):0;let o=e.split(/\s+/).filter(a=>a.trim()!=="").map(a=>{const l=parseFloat(a);return isNaN(l)?0:Math.max(0,l)}),i;if(o.length===0)i=[0,0,0,0];else if(o.length===1)i=[o[0],o[0],o[0],o[0]];else if(o.length===2)i=[o[0],o[1],o[0],o[1]];else if(o.length===3)i=[o[0],o[1],o[2],o[1]];else{const a=o.slice(0,4);i=[a[0]??0,a[1]??0,a[2]??0,a[3]??0]}const s={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3}[t];return s!==void 0&&(i[s]=r),i.map(a=>a===0?"0":`${a}px`).join(" ")}function hD(e){const t=JSON.parse(JSON.stringify(e)),n=t.rows,r=t.cols;return t.cells.forEach(o=>{const i=o.row===0,s=o.row+o.rowspan===n,a=o.col===0,l=o.col+o.colspan===r;i&&delete o.style.borders.top,s&&delete o.style.borders.bottom,a&&delete o.style.borders.left,l&&delete o.style.borders.right}),t}function gD(e){const t=JSON.parse(JSON.stringify(e));return t.cells.forEach(n=>{if(n.style?.borders?.top&&n.style?.borders?.bottom&&n.style?.borders?.left&&n.style?.borders?.right){const r=n.style.borders.top,o=n.style.borders.bottom,i=n.style.borders.left,s=n.style.borders.right;r?.width===o?.width&&r?.width===i?.width&&r?.width===s?.width&&r?.style===o?.style&&r?.style===i?.style&&r?.style===s?.style&&r?.color===o?.color&&r?.color===i?.color&&r?.color===s?.color&&(n.style.borders={border:{width:r.width,style:r.style,color:r.color}})}}),t}function bD(e,t){return typeof e!="string"&&(e=String(e||"")),typeof t!="string"&&(t=String(t||"")),e.split(" ").filter(n=>n&&!n.startsWith(t)).join(" ").trim()}function yD(e){const t={},n={};return Object.keys(e).forEach(r=>{const o=r.indexOf("-uni-");if(o===-1){const i=r;t[i]=[...e[r]],n[i]=new Set(e[r])}else{const i=r.substring(0,o);n[i]||(n[i]=new Set),e[r].forEach(s=>{n[i].add(s)}),e.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=[...e[i]],e[i].forEach(s=>n[i].add(s)))}}),Object.keys(n).forEach(r=>{const o=r;t[o]||(t[o]=[]),t[o]=Array.from(n[o])}),t}var Yq="#1C52DC",Kq="#1C52DC",Zq="#1C52DC",wl="none",m1="b64_",vD=/^(\d+(?:_\d+)?)(px|perc)$/;function ED(e){if(e===wl)return wl;let t="";return new TextEncoder().encode(za(e)).forEach(n=>{t+=String.fromCharCode(n)}),m1+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function SD(e){if(e===wl)return wl;if(!e.startsWith(m1))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 wD(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function f1(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function p1(e){const t=e.match(vD);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function CD(){return Hd()}function Ie(e,t){const n=CD();n&&n.insertAdjacentHTML("beforeend",`
85
85
  ${HP()}
86
86
  .${e} { ${t} }
87
87
  }
@@ -276,4 +276,4 @@ ${HP()}
276
276
  `}for(const m of a.reverse())s?.prepend(m),s?.insertAdjacentHTML("afterbegin",`
277
277
  `);if(e.type!=="project"&&(o=t.commonStylesApplyToBlock({html:o})),o.match(/class="em-countdown"/gi)&&(o=t.uptimeCountdown({blockHTML:o})),n)return(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:n}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:n,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),yW(n,o,t),!0;let l=null,c=null,u=!1;const d=V1();if(d)l=d,c=l,(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:l}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:l,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),o.substring(0,3)==="<tr"?t.insertAdjacentHTML(Vn(d),"beforeend",o):t.insertAdjacentHTML(Vn(d),"beforeend",'<tr><td align="center">'+o+"</td></tr>"),u=!0;else if(document.querySelector('[em="group"]:last-child [em="block"]')||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')){const m=document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]');if(l=m?m.closest('[em="block"]'):document.querySelector('[em="group"]:last-child [em="block"]:last-child'),(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:l}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:l,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),l?.tagName==="TR")o.substring(0,3)==="<tr"?t.insertAdjacentHTML(l,"afterend",o):t.insertAdjacentHTML(l,"afterend",'<tr em="block"><td align="center">'+o+"</td></tr>"),u=!0;else if(l){if(o.substring(0,3)==="<tr"){const p=document.createElement("table");p.setAttribute("cellspacing","0"),p.setAttribute("cellpadding","0"),p.setAttribute("align","center"),p.setAttribute("border","0"),p.setAttribute("em","block"),p.setAttribute("width",l.hasAttribute("width")?l.getAttribute("width"):String(l.getBoundingClientRect().width)),p.classList.add("em-mob-width-100perc"),Qn(p,`
278
278
  `+o+`
279
- `),p.querySelectorAll('tr[em="block"]').forEach(f=>f.removeAttribute("em")),l.insertAdjacentElement("afterend",p)}else t.insertAdjacentHTML(l,"afterend",o);u=!0}c=l?.nextSibling}return u&&!document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')&&document.documentElement.scrollHeight+(t.iframeOffsetTop||0)>(t.previewHeight||0)&&c&&t.messageService.send({operation:"application_scroll-to",settings:{value:c.getBoundingClientRect().top+c.getBoundingClientRect().height}}),u}function vW(e,t){if(!t.lockEditor&&cS(e.atomHTML).trim())try{t.state.increment("activeElementLocked"),t.setAtomReplaced?.(null),gE({kind:"atom",settings:e}),e.action!=="insert"&&document.body.classList.add("em-atom-insert-body"),e.action==="insert"&&bW(e,t)&&pW(e.name,t),t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function EW(e){return e.replace(/["\\]/g,"\\$&")}function SW(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="${EW(String(n))}"]`,o=Array.from(document.querySelectorAll(r));if(!o.length)return 0;let i=0;try{t.state.increment("activeElementLocked");for(const s of o)uS({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},t,s)&&(s.remove(),i+=1);t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}return i}function wW(e,t){if(!t.lockEditor&&e.blockHTML?.trim())try{t.state.increment("activeElementLocked"),gE({kind:"block",settings:e}),document.body.classList.add("em-block-insert-body"),e.action==="insert"&&uS(e,t)&&hW(e,t),t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function CW(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};vW({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function AW(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};wW({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function TW(e,t){t.setElementSettings?.(e)}var _W={"sandbox_atom-insert":CW,"sandbox_block-insert":AW,sandbox_element_settings_set:TW},kW=nn("elements",V$,{services:[He,vt,xe,Kn]},e=>{const t=D(e,He),n=D(e,vt),r=lt(e),o=D(e,Kn);return()=>({HTMLDocument:{getOuterHtml:Vt},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>Cl(i),getVariableByIcon:cl,hasRussianText:AB,messageService:Z,removeAllAttributes:Jn,setCursorPosition:i=>n(i),state:Yc})}),LW=nn("display",T$,void 0,()=>()=>({messageService:Z})),NW=nn("floatBlock",rW,{services:[He,xe]},e=>{const t=D(e,He),n=lt(e);let r=600;return x.subscribe(o=>{o.emailWidth!==void 0&&(r=o.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:r,state:Yc,setPercentsForColumns:o=>Jc(o)})}),xW=nn("accordion",w$,{services:[xe]},e=>{const t=lt(e);return()=>({HTMLDocument:{getOuterHtml:Vt},commit:t,state:Yc,getActiveEditElement:eu,parseFromString:n=>Te(n)})}),MW=nn("eblock",k$,{services:[xe]},e=>{const t=lt(e);return()=>({commit:t})}),RW=nn("palette",_W,{services:[Ur,Ds]},e=>{const t=D(e,Ur),n=D(e,Ds);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),OW=nn("nativeImageDrop",{[Pe.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>CE()},void 0,()=>()=>({})),PW=[kW,LW,NW,xW,MW,RW,OW],IW={name:"sandbox.prepareHtml",provides:[Os],setup:e=>e.inject(Os,t=>ko({node:t,isPartial:!0}))},DW={name:"sandbox.blockControlsViewport",setup:e=>e.addService(vf,()=>yl({scrollTop:x.get("scrollTop")}))},BW=[IW,DW,a$,l$,c$,u$,d$,...PW,m$,f$,p$,h$,g$,b$],HW="__emmDiagnostics__",FW="diagnostics";function $W(){try{const e=new URLSearchParams(window.location.search).get(FW);return e!==null&&e!=="0"}catch{return!1}}function rf(e){try{window.parent.postMessage({mark:HW,...e},"*")}catch{}}function WW(){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}});rf({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function jo(){return window.performance.timeOrigin+window.performance.now()}function qW(){return Array.from(document.images).every(e=>e.complete)}function zW(e,t){const r=window.setInterval(()=>{!qW()||jo()-e()<500||(window.clearInterval(r),rf({type:"settled",at:Math.max(e(),t)}),WW())},100)}function VW(){if(!$W()||typeof MutationObserver!="function")return;let e=!1,t=jo();new MutationObserver(()=>{t=jo(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=jo();rf({type:"paint",at:n}),zW(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=jo()}),document.addEventListener("load",()=>{t=jo()},!0)}var UW=500,jW=300,Cs,Yl=!1;function dS(){if(Yl)return;Yl=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,Cs=!1,Yl=!1)},jW);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),Cs=!0,Yl=!1)})}function GW(){return Cs===!1?(dS(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{Cs=!1,n()},UW);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),Cs=!0,n()})})})}var XW=1;function YW(){dS();const e=async(t,n)=>{await n?.(t),await GW()};Z.addListenerAsync(Pe.SANDBOX_INITED,e,XW)}var KW=16,mS=100,ZW=.95,fS=.02;function pS(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*KW:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function hS(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 gS(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(hS(o,"y",n)||hS(o,"x",t))return!0}return!1}function QW(){let e=0,t=0,n=!1;const r=()=>{n=!1;const d=e,m=t;e=0,t=0,!(d===0&&m===0)&&Z.send(Pe.SANDBOX_WHEEL,{deltaX:d,deltaY:m})},o=(d,m)=>{e+=d,t+=m,n||(n=!0,window.requestAnimationFrame(r))};window.addEventListener("wheel",d=>{d.ctrlKey||gS(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(pS(d.deltaX,d.deltaMode),pS(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:m}=a,p=performance.now();const f=h=>{const y=h>p?Math.min(h-p,50):16;p=h;const v=Math.pow(ZW,y/16);if(d*=v,m*=v,Math.abs(d)<fS&&Math.abs(m)<fS){l=void 0;return}o(d*y,m*y),l=window.requestAnimationFrame(f)};l=window.requestAnimationFrame(f)};window.addEventListener("touchstart",d=>{c(),s=!1,a={x:0,y:0};const m=d.touches.length===1?d.touches[0]:void 0;i=m?{x:m.screenX,y:m.screenY,at:d.timeStamp}:void 0},{passive:!0}),window.addEventListener("touchmove",d=>{const m=d.touches.length===1?d.touches[0]:void 0;if(document.documentElement.classList.contains("em-resize-start")){i=void 0,s=!1;return}if(!m||!i){i=void 0,s=!1;return}const p=i.x-m.screenX,f=i.y-m.screenY,h=d.timeStamp-i.at;if(i={x:m.screenX,y:m.screenY,at:d.timeStamp},!gS(d.target,p,f)){if(d.cancelable&&d.preventDefault(),s=!0,h>0){const y=Math.min(h/mS,1);a={x:a.x*(1-y)+p/h*y,y:a.y*(1-y)+f/h*y}}o(p,f)}},{passive:!1}),window.addEventListener("touchend",d=>{const m=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&m<mS&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var JW={name:"sandbox.diagnosticsAgent",setup:()=>VW()},eq={name:"sandbox.paintGate",setup:()=>YW()},tq={name:"sandbox.wheelBridge",setup:()=>QW()},nq={name:"sandbox.deviceWidthMediaGuard",setup:()=>O5()};function rq(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}window.iFrameResizer={heightCalculationMethod:rq};var oq=Yn(((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},m=128,p=!0,f=1,h="bodyOffset",y=h,v=!0,A="",k={},S=32,b=null,E=!1,C=!1,g="[iFrameSizer]",w=g.length,T="",_={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="child",N=!0,W=window.parent,P="*",R=0,Y=!1,V=null,G=16,Le=1,ae="scroll",ne=ae,we=window,j=function(){Ft("onMessage function not defined")},z=function(){},Se=function(){},Ae={height:function(){return Ft("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return Ft("Custom width calculation function not defined"),document.body.scrollWidth}},Q={},Lt=!1;try{var U=Object.create({},{passive:{get:function(){Lt=!0}}});window.addEventListener("test",Ts,U),window.removeEventListener("test",Ts,U)}catch{}var In,gt,Wr,mn,ot,Bt,Be={bodyOffset:function(){return document.body.offsetHeight+bt("marginTop")+bt("marginBottom")},offset:function(){return Be.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return Ae.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,tt(Be))},min:function(){return Math.min.apply(null,tt(Be))},grow:function(){return Be.max()},lowestElement:function(){return Math.max(Be.bodyOffset()||Be.documentElementOffset(),pn("bottom",yt()))},taggedElement:function(){return hn("bottom","data-iframe-height")}},jn={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return Ae.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(jn.bodyScroll(),jn.documentElementScroll())},max:function(){return Math.max.apply(null,tt(jn))},min:function(){return Math.min.apply(null,tt(jn))},rightMostElement:function(){return pn("right",yt())},taggedElement:function(){return hn("right","data-iframe-width")}},As=(In=Zl,ot=null,Bt=0,function(){var O=Date.now(),H=G-(O-(Bt=Bt||O));return gt=this,Wr=arguments,H<=0||G<H?(ot&&(clearTimeout(ot),ot=null),Bt=O,mn=In.apply(gt,Wr),ot||(gt=Wr=null)):ot=ot||setTimeout(sf,H),mn});Ht(window,"message",function(O){var H={init:function(){A=O.data,W=O.source,Kl(),p=!1,setTimeout(function(){v=!1},m)},reset:function(){v?ce("Page reset ignored by init"):(ce("Page size reset by host page"),yS("resetPage"))},resize:function(){$t("resizeParent","Parent window requested size check")},moveToAnchor:function(){k.findTarget(ve())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var Ne=ve();ce("PageInfoFromParent called from parent: "+Ne),Se(JSON.parse(Ne)),ce(" --")},message:function(){var Ne=ve();ce("onMessage called from parent: "+Ne),j(JSON.parse(Ne)),ce(" --")}};function fe(){return O.data.split("]")[1].split(":")[0]}function ve(){return O.data.substr(O.data.indexOf(":")+1)}function K(){return O.data.split(":")[2]in{true:1,false:1}}function J(){var Ne=fe();Ne in H?H[Ne]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||K()||Ft("Unexpected message ("+O.data+")")}g===(""+O.data).substr(0,w)&&(p===!1?J():K()?H.init():ce('Ignored message of type "'+fe()+'". Received before initialization.'))}),Ht(window,"readystatechange",ES),ES()}function Ts(){}function Ht(O,H,fe,ve){O.addEventListener(H,fe,!!Lt&&(ve||{}))}function _s(O){return O.charAt(0).toUpperCase()+O.slice(1)}function of(O){return g+"["+T+"] "+O}function ce(O){E&&window.console}function Ft(O){window.console}function Kl(){function O(K){return K==="true"}var H;function fe(K){Kt(0,0,K.type,K.screenY+":"+K.screenX)}function ve(K,J){ce("Add event listener: "+J),Ht(window.document,K,fe)}H=A.substr(w).split(":"),T=H[0],s=n!==H[1]?Number(H[1]):s,u=n!==H[2]?O(H[2]):u,E=n!==H[3]?O(H[3]):E,S=n!==H[4]?Number(H[4]):S,r=n!==H[6]?O(H[6]):r,a=H[7],y=n!==H[8]?H[8]:y,i=H[9],c=H[10],R=n!==H[11]?Number(H[11]):R,k.enable=n!==H[12]&&O(H[12]),M=n!==H[13]?H[13]:M,ne=n!==H[14]?H[14]:ne,C=n!==H[15]?!!H[15]:C,ce("Initialising iFrame ("+window.location.href+")"),(function(){function K(J,Ne){return typeof J=="function"&&(ce("Setup custom "+Ne+"CalcMethod"),Ae[Ne]=J,J="custom"),J}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var J=window.iFrameResizer;ce("Reading data from page: "+JSON.stringify(J)),Object.keys(J).forEach(ks,J),j="onMessage"in J?J.onMessage:j,z="onReady"in J?J.onReady:z,P="targetOrigin"in J?J.targetOrigin:P,y="heightCalculationMethod"in J?J.heightCalculationMethod:y,ne="widthCalculationMethod"in J?J.widthCalculationMethod:ne})(),y=K(y,"height"),ne=K(ne,"width")),ce("TargetOrigin for parent set to: "+P)})(),(function(){n===a&&(a=s+"px"),Gn("margin",(function(K,J){return J.indexOf("-")!==-1&&(Ft("Negative CSS value ignored for "+K),J=""),J})("margin",a))})(),Gn("background",i),Gn("padding",c),(H=document.createElement("div")).style.clear="both",H.classList.add("iframe-resizer-inner"),H.style.display="block",H.style.height="0",document.body.appendChild(H),et(),fn(),document.documentElement.style.height="",document.body.style.height="",ce('HTML & body height set to "auto"'),ce("Enable public methods"),we.parentIFrame={autoResize:function(K){return K===!0&&r===!1?(r=!0,Dn()):K===!1&&r===!0&&(r=!1,Ls("remove"),l!==null&&l.disconnect(),clearInterval(b)),Kt(0,0,"autoResize",JSON.stringify(r)),r},close:function(){Kt(0,0,"close")},getId:function(){return T},getPageInfo:function(K){typeof K=="function"?(Se=K,Kt(0,0,"pageInfo")):(Se=function(){},Kt(0,0,"pageInfoStop"))},moveToAnchor:function(K){k.findTarget(K)},reset:function(){vS("parentIFrame.reset")},scrollTo:function(K,J){Kt(J,K,"scrollTo")},scrollToOffset:function(K,J){Kt(J,K,"scrollToOffset")},sendMessage:function(K,J){Kt(0,0,"message",JSON.stringify(K),J)},setHeightCalculationMethod:function(K){y=K,et()},setWidthCalculationMethod:function(K){ne=K,fn()},setTargetOrigin:function(K){ce("Set targetOrigin: "+K),P=K},size:function(K,J){$t("size","parentIFrame.size("+((K||"")+(J?","+J:""))+")",K,J)}},C===!0&&(ve("mouseenter","Mouse Enter"),ve("mouseleave","Mouse Leave")),Dn(),k=(function(){function K(xt){var me=xt.getBoundingClientRect(),xt={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(me.left,10)+parseInt(xt.x,10),y:parseInt(me.top,10)+parseInt(xt.y,10)}}function J(qt){var me,xt=qt.split("#")[1]||qt,qt=decodeURIComponent(xt),SS=document.getElementById(qt)||document.getElementsByName(qt)[0];n!==SS?(me=K(me=SS),ce("Moving to in page link (#"+xt+") at x: "+me.x+" y: "+me.y),Kt(me.y,me.x,"scrollToOffset")):(ce("In page link (#"+xt+") not found in iFrame, so sending to parent"),Kt(0,0,"inPageLink","#"+xt))}function Ne(){var Wt=window.location.hash,me=window.location.href;Wt!==""&&Wt!=="#"&&J(me)}function Nt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Wt){Wt.getAttribute("href")!=="#"&&Ht(Wt,"click",function(me){me.preventDefault(),J(this.getAttribute("href"))})})}function Ns(){Array.prototype.forEach&&document.querySelectorAll?(ce("Setting up location.hash handlers"),Nt(),Ht(window,"hashchange",Ne),setTimeout(Ne,m)):Ft("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return k.enable?Ns():ce("In page linking not enabled"),{findTarget:J}})(),$t("init","Init message from host page"),z()}function ks(O){var H=O.split("Callback");H.length===2&&(this[H="on"+H[0].charAt(0).toUpperCase()+H[0].slice(1)]=this[O],delete this[O],Ft("Deprecated: '"+O+"' has been renamed '"+H+"'. The old method will be removed in the next major version."))}function Gn(O,H){n!==H&&H!==""&&H!=="null"&&ce("Body "+O+' set to "'+(document.body.style[O]=H)+'"')}function st(O){var H={add:function(fe){function ve(){$t(O.eventName,O.eventType)}Q[fe]=ve,Ht(window,fe,ve,{passive:!0})},remove:function(fe){var ve,K=Q[fe];delete Q[fe],ve=window,fe=fe,K=K,ve.removeEventListener(fe,K,!1)}};O.eventNames&&Array.prototype.map?(O.eventName=O.eventNames[0],O.eventNames.map(H[O.method])):H[O.method](O.eventName),ce(_s(O.method)+" event listener: "+O.eventType)}function Ls(O){st({method:O,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),st({method:O,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),st({method:O,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),st({method:O,eventType:"Input",eventName:"input"}),st({method:O,eventType:"Mouse Up",eventName:"mouseup"}),st({method:O,eventType:"Mouse Down",eventName:"mousedown"}),st({method:O,eventType:"Orientation Change",eventName:"orientationchange"}),st({method:O,eventType:"Print",eventNames:["afterprint","beforeprint"]}),st({method:O,eventType:"Ready State Change",eventName:"readystatechange"}),st({method:O,eventType:"Touch Start",eventName:"touchstart"}),st({method:O,eventType:"Touch End",eventName:"touchend"}),st({method:O,eventType:"Touch Cancel",eventName:"touchcancel"}),st({method:O,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),st({method:O,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),st({method:O,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),M==="child"&&st({method:O,eventType:"IFrame Resized",eventName:"resize"})}function F(O,H,fe,ve){return H!==O&&(O in fe||(Ft(O+" is not a valid option for "+ve+"CalculationMethod."),O=H),ce(ve+' calculation method set to "'+O+'"')),O}function et(){y=F(y,h,Be,"height")}function fn(){ne=F(ne,ae,jn,"width")}function Dn(){var O;r===!0?(Ls("add"),O=S<0,window.MutationObserver||window.WebKitMutationObserver?O?be():l=(function(){function H(me){function xt(qt){qt.complete===!1&&(ce("Attach listeners to "+qt.src),qt.addEventListener("load",K,!1),qt.addEventListener("error",J,!1),Nt.push(qt))}me.type==="attributes"&&me.attributeName==="src"?xt(me.target):me.type==="childList"&&Array.prototype.forEach.call(me.target.querySelectorAll("img"),xt)}function fe(me){ce("Remove listeners from "+me.src),me.removeEventListener("load",K,!1),me.removeEventListener("error",J,!1),me=me,Nt.splice(Nt.indexOf(me),1)}function ve(me,xt,qt){fe(me.target),$t(xt,qt+": "+me.target.src)}function K(me){ve(me,"imageLoad","Image loaded")}function J(me){ve(me,"imageLoadFailed","Image load failed")}function Ne(me){$t("mutationObserver","mutationObserver: "+me[0].target+" "+me[0].type),me.forEach(H)}var Nt=[],Ns=window.MutationObserver||window.WebKitMutationObserver,Wt=(function(){var me=document.querySelector("body");return Wt=new Ns(Ne),ce("Create body MutationObserver"),Wt.observe(me,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Wt})();return{disconnect:function(){"disconnect"in Wt&&(ce("Disconnect body MutationObserver"),Wt.disconnect(),Nt.forEach(fe))}}})():(ce("MutationObserver not supported in this browser!"),be())):ce("Auto Resize disabled")}function be(){S!==0&&(ce("setInterval: "+S+"ms"),b=setInterval(function(){$t("interval","setInterval: "+S)},Math.abs(S)))}function bt(O,H){var fe=0;return H=H||document.body,fe=(fe=document.defaultView.getComputedStyle(H,null))!==null?fe[O]:0,parseInt(fe,o)}function pn(O,H){for(var fe,ve=H.length,K=0,J=_s(O),Ne=Date.now(),Nt=0;Nt<ve;Nt++)K<(fe=H[Nt].getBoundingClientRect()[O]+bt("margin"+J,H[Nt]))&&(K=fe);return Ne=Date.now()-Ne,ce("Parsed "+ve+" HTML elements"),ce("Element position calculated in "+Ne+"ms"),G/2<(Ne=Ne)&&ce("Event throttle increased to "+(G=2*Ne)+"ms"),K}function tt(O){return[O.bodyOffset(),O.bodyScroll(),O.documentElementOffset(),O.documentElementScroll()]}function hn(O,H){var fe=document.querySelectorAll("["+H+"]");return fe.length===0&&(Ft("No tagged elements ("+H+") found on page"),document.querySelectorAll("body *")),pn(O,fe)}function yt(){return document.querySelectorAll("body *")}function Zl(O,H,fe,ve){function K(){O in{init:1,interval:1,size:1}||!(y in _||u&&ne in _)?O in{interval:1}||ce("No change in size detected"):vS(H)}var J,Ne;function Nt(Ns,Wt){return!(Math.abs(Ns-Wt)<=R)}J=n!==fe?fe:Be[y](),Ne=n!==ve?ve:jn[ne](),Nt(f,J)||u&&Nt(Le,Ne)||O==="init"?(gn(),Kt(f=J,Le=Ne,O)):K()}function sf(){Bt=Date.now(),ot=null,mn=In.apply(gt,Wr),ot||(gt=Wr=null)}function $t(O,H,fe,ve){Y&&O in d?ce("Trigger event cancelled: "+O):(O in{reset:1,resetPage:1,init:1}||ce("Trigger event: "+H),(O==="init"?Zl:As)(O,H,fe,ve))}function gn(){Y||(Y=!0,ce("Trigger event lock on")),clearTimeout(V),V=setTimeout(function(){Y=!1,ce("Trigger event lock off"),ce("--")},m)}function yS(O){f=Be[y](),Le=jn[ne](),Kt(f,Le,O)}function vS(O){var H=y;y=h,ce("Reset trigger event: "+O),gn(),yS("reset"),y=H}function Kt(O,H,fe,ve,K){var J;N===!0&&(n===K?K=P:ce("Message targetOrigin: "+K),ce("Sending message to host page ("+(J=T+":"+(O+":"+H)+":"+fe+(n!==ve?":"+ve:""))+")"),W.postMessage(g+J,K))}function ES(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),iq=[{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 sq(){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 aq(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),Er();return}if(e){let n=!1;for(const r of iq)if(r.detect()){r.apply(),n=!0;break}n||sq()}bS(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||Z.send({operation:"application_template_not_em_alert_show"}),Er()}function bS(){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(q,"CANVAS_CORE_UNITS",{enumerable:!0,get:function(){return NI}}),Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(q,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return BW}}),Object.defineProperty(q,"EVENT_TYPES",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(q,"FOCUS_ID",{enumerable:!0,get:function(){return at}}),Object.defineProperty(q,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return te}}),Object.defineProperty(q,"INIT_PREVIEW_ID",{enumerable:!0,get:function(){return Jo}}),Object.defineProperty(q,"INSERT_POLICY_ID",{enumerable:!0,get:function(){return cc}}),Object.defineProperty(q,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return bf}}),Object.defineProperty(q,"Node",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(q,"NodeType",{enumerable:!0,get:function(){return $}}),Object.defineProperty(q,"SET_CURSOR_ID",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(q,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return hf}}),Object.defineProperty(q,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(q,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return gf}}),Object.defineProperty(q,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(q,"_defineProperty",{enumerable:!0,get:function(){return L}}),Object.defineProperty(q,"addFontFamilyClass",{enumerable:!0,get:function(){return Qi}}),Object.defineProperty(q,"ampUnit",{enumerable:!0,get:function(){return _T}}),Object.defineProperty(q,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return dl}}),Object.defineProperty(q,"applyRootScale",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(q,"buildEmFontClassName",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(q,"checkBlockAdaptivity",{enumerable:!0,get:function(){return ll}}),Object.defineProperty(q,"clearLinkTags",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(q,"clearProjectFontFaces",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(q,"commitOf",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(q,"commonStylesApply",{enumerable:!0,get:function(){return Gv}}),Object.defineProperty(q,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return nm}}),Object.defineProperty(q,"createFontClassName",{enumerable:!0,get:function(){return $d}}),Object.defineProperty(q,"createIdentifier",{enumerable:!0,get:function(){return de}}),Object.defineProperty(q,"defineSurface",{enumerable:!0,get:function(){return ew}}),Object.defineProperty(q,"defineUnit",{enumerable:!0,get:function(){return NS}}),Object.defineProperty(q,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return nq}}),Object.defineProperty(q,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return JW}}),Object.defineProperty(q,"elMarkupHelper",{enumerable:!0,get:function(){return aq}}),Object.defineProperty(q,"extensionsUnit",{enumerable:!0,get:function(){return j4}}),Object.defineProperty(q,"findParentTr",{enumerable:!0,get:function(){return uh}}),Object.defineProperty(q,"fitEmailToWidth",{enumerable:!0,get:function(){return MT}}),Object.defineProperty(q,"fitImagesToColumns",{enumerable:!0,get:function(){return xm}}),Object.defineProperty(q,"getElementInnerHTML",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(q,"getOuterHtml",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(q,"getUsedColors",{enumerable:!0,get:function(){return e1}}),Object.defineProperty(q,"globalBlockReplace",{enumerable:!0,get:function(){return SW}}),Object.defineProperty(q,"iframeSetSize",{enumerable:!0,get:function(){return RT}}),Object.defineProperty(q,"implementPolyfills",{enumerable:!0,get:function(){return df}}),Object.defineProperty(q,"insertAdjacentHTML",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(q,"insertCountdown",{enumerable:!0,get:function(){return dv}}),Object.defineProperty(q,"isComment",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(q,"isEmptyTable",{enumerable:!0,get:function(){return un}}),Object.defineProperty(q,"isTextNode",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(q,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return bS}}),Object.defineProperty(q,"markProjectFontClass",{enumerable:!0,get:function(){return qd}}),Object.defineProperty(q,"messageService",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(q,"minifyStylesheet",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(q,"paintGateUnit",{enumerable:!0,get:function(){return eq}}),Object.defineProperty(q,"parseFromString",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(q,"removeClassesByPrefix",{enumerable:!0,get:function(){return zd}}),Object.defineProperty(q,"removeHiddenClasses",{enumerable:!0,get:function(){return ja}}),Object.defineProperty(q,"requireService",{enumerable:!0,get:function(){return D}}),Object.defineProperty(q,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return oq}}),Object.defineProperty(q,"rgbToHex",{enumerable:!0,get:function(){return X}}),Object.defineProperty(q,"rowsHost",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(q,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return yl}}),Object.defineProperty(q,"setBlockMaxWidth",{enumerable:!0,get:function(){return Mm}}),Object.defineProperty(q,"setDocumentStyles",{enumerable:!0,get:function(){return Fd}}),Object.defineProperty(q,"setElementBorder",{enumerable:!0,get:function(){return Vd}}),Object.defineProperty(q,"setElementBorderRadius",{enumerable:!0,get:function(){return Xi}}),Object.defineProperty(q,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return $P}}),Object.defineProperty(q,"setFloatBlocksWidth",{enumerable:!0,get:function(){return Nm}}),Object.defineProperty(q,"setImageWidth",{enumerable:!0,get:function(){return xd}}),Object.defineProperty(q,"setStructureBlocksWidth",{enumerable:!0,get:function(){return Nl}}),Object.defineProperty(q,"startSandbox",{enumerable:!0,get:function(){return tw}}),Object.defineProperty(q,"state",{enumerable:!0,get:function(){return x}}),Object.defineProperty(q,"stripSubjectTags",{enumerable:!0,get:function(){return Pw}}),Object.defineProperty(q,"uptimeCountdown",{enumerable:!0,get:function(){return Md}}),Object.defineProperty(q,"wheelBridgeUnit",{enumerable:!0,get:function(){return tq}})});
279
+ `),p.querySelectorAll('tr[em="block"]').forEach(f=>f.removeAttribute("em")),l.insertAdjacentElement("afterend",p)}else t.insertAdjacentHTML(l,"afterend",o);u=!0}c=l?.nextSibling}return u&&!document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')&&document.documentElement.scrollHeight+(t.iframeOffsetTop||0)>(t.previewHeight||0)&&c&&t.messageService.send({operation:"application_scroll-to",settings:{value:c.getBoundingClientRect().top+c.getBoundingClientRect().height}}),u}function vW(e,t){if(!t.lockEditor&&cS(e.atomHTML).trim())try{t.state.increment("activeElementLocked"),t.setAtomReplaced?.(null),gE({kind:"atom",settings:e}),e.action!=="insert"&&document.body.classList.add("em-atom-insert-body"),e.action==="insert"&&bW(e,t)&&pW(e.name,t),t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function EW(e){return e.replace(/["\\]/g,"\\$&")}function SW(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="${EW(String(n))}"]`,o=Array.from(document.querySelectorAll(r));if(!o.length)return 0;let i=0;try{t.state.increment("activeElementLocked");for(const s of o)uS({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},t,s)&&(s.remove(),i+=1);t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}return i}function wW(e,t){if(!t.lockEditor&&e.blockHTML?.trim())try{t.state.increment("activeElementLocked"),gE({kind:"block",settings:e}),document.body.classList.add("em-block-insert-body"),e.action==="insert"&&uS(e,t)&&hW(e,t),t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function CW(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};vW({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function AW(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};wW({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function TW(e,t){t.setElementSettings?.(e)}var _W={"sandbox_atom-insert":CW,"sandbox_block-insert":AW,sandbox_element_settings_set:TW},kW=nn("elements",V$,{services:[He,vt,xe,Kn]},e=>{const t=D(e,He),n=D(e,vt),r=lt(e),o=D(e,Kn);return()=>({HTMLDocument:{getOuterHtml:Vt},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>Cl(i),getVariableByIcon:cl,hasRussianText:AB,messageService:Z,removeAllAttributes:Jn,setCursorPosition:i=>n(i),state:Yc})}),LW=nn("display",T$,void 0,()=>()=>({messageService:Z})),NW=nn("floatBlock",rW,{services:[He,xe]},e=>{const t=D(e,He),n=lt(e);let r=600;return x.subscribe(o=>{o.emailWidth!==void 0&&(r=o.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:r,state:Yc,setPercentsForColumns:o=>Jc(o)})}),xW=nn("accordion",w$,{services:[xe]},e=>{const t=lt(e);return()=>({HTMLDocument:{getOuterHtml:Vt},commit:t,state:Yc,getActiveEditElement:eu,parseFromString:n=>Te(n)})}),MW=nn("eblock",k$,{services:[xe]},e=>{const t=lt(e);return()=>({commit:t})}),RW=nn("palette",_W,{services:[Ur,Ds]},e=>{const t=D(e,Ur),n=D(e,Ds);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),OW=nn("nativeImageDrop",{[Pe.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>CE()},void 0,()=>()=>({})),PW=[kW,LW,NW,xW,MW,RW,OW],IW={name:"sandbox.prepareHtml",provides:[Os],setup:e=>e.inject(Os,t=>ko({node:t,isPartial:!0}))},DW={name:"sandbox.blockControlsViewport",setup:e=>e.addService(vf,()=>yl({scrollTop:x.get("scrollTop")}))},BW=[IW,DW,a$,l$,c$,u$,d$,...PW,m$,f$,p$,h$,g$,b$],HW="__emmDiagnostics__",FW="diagnostics";function $W(){try{const e=new URLSearchParams(window.location.search).get(FW);return e!==null&&e!=="0"}catch{return!1}}function rf(e){try{window.parent.postMessage({mark:HW,...e},"*")}catch{}}function WW(){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}});rf({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function jo(){return window.performance.timeOrigin+window.performance.now()}function qW(){return Array.from(document.images).every(e=>e.complete)}function zW(e,t){const r=window.setInterval(()=>{!qW()||jo()-e()<500||(window.clearInterval(r),rf({type:"settled",at:Math.max(e(),t)}),WW())},100)}function VW(){if(!$W()||typeof MutationObserver!="function")return;let e=!1,t=jo();new MutationObserver(()=>{t=jo(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=jo();rf({type:"paint",at:n}),zW(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=jo()}),document.addEventListener("load",()=>{t=jo()},!0)}var UW=500,jW=300,Cs,Yl=!1;function dS(){if(Yl)return;Yl=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,Cs=!1,Yl=!1)},jW);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),Cs=!0,Yl=!1)})}function GW(){return Cs===!1?(dS(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{Cs=!1,n()},UW);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),Cs=!0,n()})})})}var XW=1;function YW(){dS();const e=async(t,n)=>{await n?.(t),await GW()};Z.addListenerAsync(Pe.SANDBOX_INITED,e,XW)}var KW=16,mS=100,ZW=.95,fS=.02;function pS(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*KW:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function hS(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 gS(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(hS(o,"y",n)||hS(o,"x",t))return!0}return!1}function QW(){let e=0,t=0,n=!1;const r=()=>{n=!1;const d=e,m=t;e=0,t=0,!(d===0&&m===0)&&Z.send(Pe.SANDBOX_WHEEL,{deltaX:d,deltaY:m})},o=(d,m)=>{e+=d,t+=m,n||(n=!0,window.requestAnimationFrame(r))};window.addEventListener("wheel",d=>{d.ctrlKey||gS(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(pS(d.deltaX,d.deltaMode),pS(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:m}=a,p=performance.now();const f=h=>{const y=h>p?Math.min(h-p,50):16;p=h;const v=Math.pow(ZW,y/16);if(d*=v,m*=v,Math.abs(d)<fS&&Math.abs(m)<fS){l=void 0;return}o(d*y,m*y),l=window.requestAnimationFrame(f)};l=window.requestAnimationFrame(f)};window.addEventListener("touchstart",d=>{c(),s=!1,a={x:0,y:0};const m=d.touches.length===1?d.touches[0]:void 0;i=m?{x:m.screenX,y:m.screenY,at:d.timeStamp}:void 0},{passive:!0}),window.addEventListener("touchmove",d=>{const m=d.touches.length===1?d.touches[0]:void 0;if(document.documentElement.classList.contains("em-resize-start")){i=void 0,s=!1;return}if(!m||!i){i=void 0,s=!1;return}const p=i.x-m.screenX,f=i.y-m.screenY,h=d.timeStamp-i.at;if(i={x:m.screenX,y:m.screenY,at:d.timeStamp},!gS(d.target,p,f)){if(d.cancelable&&d.preventDefault(),s=!0,h>0){const y=Math.min(h/mS,1);a={x:a.x*(1-y)+p/h*y,y:a.y*(1-y)+f/h*y}}o(p,f)}},{passive:!1}),window.addEventListener("touchend",d=>{const m=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&m<mS&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var JW={name:"sandbox.diagnosticsAgent",setup:()=>VW()},eq={name:"sandbox.paintGate",setup:()=>YW()},tq={name:"sandbox.wheelBridge",setup:()=>QW()},nq={name:"sandbox.deviceWidthMediaGuard",setup:()=>O5()};function rq(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}function oq(){return Math.max(document.body?.scrollWidth??0,document.documentElement?.scrollWidth??0)}window.iFrameResizer={heightCalculationMethod:rq,widthCalculationMethod:oq};var iq=Yn(((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},m=128,p=!0,f=1,h="bodyOffset",y=h,v=!0,A="",k={},S=32,b=null,E=!1,C=!1,g="[iFrameSizer]",w=g.length,T="",_={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="child",N=!0,W=window.parent,P="*",R=0,Y=!1,V=null,G=16,Le=1,ae="scroll",ne=ae,we=window,j=function(){Ft("onMessage function not defined")},z=function(){},Se=function(){},Ae={height:function(){return Ft("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return Ft("Custom width calculation function not defined"),document.body.scrollWidth}},Q={},Lt=!1;try{var U=Object.create({},{passive:{get:function(){Lt=!0}}});window.addEventListener("test",Ts,U),window.removeEventListener("test",Ts,U)}catch{}var In,gt,Wr,mn,ot,Bt,Be={bodyOffset:function(){return document.body.offsetHeight+bt("marginTop")+bt("marginBottom")},offset:function(){return Be.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return Ae.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,tt(Be))},min:function(){return Math.min.apply(null,tt(Be))},grow:function(){return Be.max()},lowestElement:function(){return Math.max(Be.bodyOffset()||Be.documentElementOffset(),pn("bottom",yt()))},taggedElement:function(){return hn("bottom","data-iframe-height")}},jn={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return Ae.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(jn.bodyScroll(),jn.documentElementScroll())},max:function(){return Math.max.apply(null,tt(jn))},min:function(){return Math.min.apply(null,tt(jn))},rightMostElement:function(){return pn("right",yt())},taggedElement:function(){return hn("right","data-iframe-width")}},As=(In=Zl,ot=null,Bt=0,function(){var O=Date.now(),H=G-(O-(Bt=Bt||O));return gt=this,Wr=arguments,H<=0||G<H?(ot&&(clearTimeout(ot),ot=null),Bt=O,mn=In.apply(gt,Wr),ot||(gt=Wr=null)):ot=ot||setTimeout(sf,H),mn});Ht(window,"message",function(O){var H={init:function(){A=O.data,W=O.source,Kl(),p=!1,setTimeout(function(){v=!1},m)},reset:function(){v?ce("Page reset ignored by init"):(ce("Page size reset by host page"),yS("resetPage"))},resize:function(){$t("resizeParent","Parent window requested size check")},moveToAnchor:function(){k.findTarget(ve())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var Ne=ve();ce("PageInfoFromParent called from parent: "+Ne),Se(JSON.parse(Ne)),ce(" --")},message:function(){var Ne=ve();ce("onMessage called from parent: "+Ne),j(JSON.parse(Ne)),ce(" --")}};function fe(){return O.data.split("]")[1].split(":")[0]}function ve(){return O.data.substr(O.data.indexOf(":")+1)}function K(){return O.data.split(":")[2]in{true:1,false:1}}function J(){var Ne=fe();Ne in H?H[Ne]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||K()||Ft("Unexpected message ("+O.data+")")}g===(""+O.data).substr(0,w)&&(p===!1?J():K()?H.init():ce('Ignored message of type "'+fe()+'". Received before initialization.'))}),Ht(window,"readystatechange",ES),ES()}function Ts(){}function Ht(O,H,fe,ve){O.addEventListener(H,fe,!!Lt&&(ve||{}))}function _s(O){return O.charAt(0).toUpperCase()+O.slice(1)}function of(O){return g+"["+T+"] "+O}function ce(O){E&&window.console}function Ft(O){window.console}function Kl(){function O(K){return K==="true"}var H;function fe(K){Kt(0,0,K.type,K.screenY+":"+K.screenX)}function ve(K,J){ce("Add event listener: "+J),Ht(window.document,K,fe)}H=A.substr(w).split(":"),T=H[0],s=n!==H[1]?Number(H[1]):s,u=n!==H[2]?O(H[2]):u,E=n!==H[3]?O(H[3]):E,S=n!==H[4]?Number(H[4]):S,r=n!==H[6]?O(H[6]):r,a=H[7],y=n!==H[8]?H[8]:y,i=H[9],c=H[10],R=n!==H[11]?Number(H[11]):R,k.enable=n!==H[12]&&O(H[12]),M=n!==H[13]?H[13]:M,ne=n!==H[14]?H[14]:ne,C=n!==H[15]?!!H[15]:C,ce("Initialising iFrame ("+window.location.href+")"),(function(){function K(J,Ne){return typeof J=="function"&&(ce("Setup custom "+Ne+"CalcMethod"),Ae[Ne]=J,J="custom"),J}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var J=window.iFrameResizer;ce("Reading data from page: "+JSON.stringify(J)),Object.keys(J).forEach(ks,J),j="onMessage"in J?J.onMessage:j,z="onReady"in J?J.onReady:z,P="targetOrigin"in J?J.targetOrigin:P,y="heightCalculationMethod"in J?J.heightCalculationMethod:y,ne="widthCalculationMethod"in J?J.widthCalculationMethod:ne})(),y=K(y,"height"),ne=K(ne,"width")),ce("TargetOrigin for parent set to: "+P)})(),(function(){n===a&&(a=s+"px"),Gn("margin",(function(K,J){return J.indexOf("-")!==-1&&(Ft("Negative CSS value ignored for "+K),J=""),J})("margin",a))})(),Gn("background",i),Gn("padding",c),(H=document.createElement("div")).style.clear="both",H.classList.add("iframe-resizer-inner"),H.style.display="block",H.style.height="0",document.body.appendChild(H),et(),fn(),document.documentElement.style.height="",document.body.style.height="",ce('HTML & body height set to "auto"'),ce("Enable public methods"),we.parentIFrame={autoResize:function(K){return K===!0&&r===!1?(r=!0,Dn()):K===!1&&r===!0&&(r=!1,Ls("remove"),l!==null&&l.disconnect(),clearInterval(b)),Kt(0,0,"autoResize",JSON.stringify(r)),r},close:function(){Kt(0,0,"close")},getId:function(){return T},getPageInfo:function(K){typeof K=="function"?(Se=K,Kt(0,0,"pageInfo")):(Se=function(){},Kt(0,0,"pageInfoStop"))},moveToAnchor:function(K){k.findTarget(K)},reset:function(){vS("parentIFrame.reset")},scrollTo:function(K,J){Kt(J,K,"scrollTo")},scrollToOffset:function(K,J){Kt(J,K,"scrollToOffset")},sendMessage:function(K,J){Kt(0,0,"message",JSON.stringify(K),J)},setHeightCalculationMethod:function(K){y=K,et()},setWidthCalculationMethod:function(K){ne=K,fn()},setTargetOrigin:function(K){ce("Set targetOrigin: "+K),P=K},size:function(K,J){$t("size","parentIFrame.size("+((K||"")+(J?","+J:""))+")",K,J)}},C===!0&&(ve("mouseenter","Mouse Enter"),ve("mouseleave","Mouse Leave")),Dn(),k=(function(){function K(xt){var me=xt.getBoundingClientRect(),xt={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(me.left,10)+parseInt(xt.x,10),y:parseInt(me.top,10)+parseInt(xt.y,10)}}function J(qt){var me,xt=qt.split("#")[1]||qt,qt=decodeURIComponent(xt),SS=document.getElementById(qt)||document.getElementsByName(qt)[0];n!==SS?(me=K(me=SS),ce("Moving to in page link (#"+xt+") at x: "+me.x+" y: "+me.y),Kt(me.y,me.x,"scrollToOffset")):(ce("In page link (#"+xt+") not found in iFrame, so sending to parent"),Kt(0,0,"inPageLink","#"+xt))}function Ne(){var Wt=window.location.hash,me=window.location.href;Wt!==""&&Wt!=="#"&&J(me)}function Nt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Wt){Wt.getAttribute("href")!=="#"&&Ht(Wt,"click",function(me){me.preventDefault(),J(this.getAttribute("href"))})})}function Ns(){Array.prototype.forEach&&document.querySelectorAll?(ce("Setting up location.hash handlers"),Nt(),Ht(window,"hashchange",Ne),setTimeout(Ne,m)):Ft("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return k.enable?Ns():ce("In page linking not enabled"),{findTarget:J}})(),$t("init","Init message from host page"),z()}function ks(O){var H=O.split("Callback");H.length===2&&(this[H="on"+H[0].charAt(0).toUpperCase()+H[0].slice(1)]=this[O],delete this[O],Ft("Deprecated: '"+O+"' has been renamed '"+H+"'. The old method will be removed in the next major version."))}function Gn(O,H){n!==H&&H!==""&&H!=="null"&&ce("Body "+O+' set to "'+(document.body.style[O]=H)+'"')}function st(O){var H={add:function(fe){function ve(){$t(O.eventName,O.eventType)}Q[fe]=ve,Ht(window,fe,ve,{passive:!0})},remove:function(fe){var ve,K=Q[fe];delete Q[fe],ve=window,fe=fe,K=K,ve.removeEventListener(fe,K,!1)}};O.eventNames&&Array.prototype.map?(O.eventName=O.eventNames[0],O.eventNames.map(H[O.method])):H[O.method](O.eventName),ce(_s(O.method)+" event listener: "+O.eventType)}function Ls(O){st({method:O,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),st({method:O,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),st({method:O,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),st({method:O,eventType:"Input",eventName:"input"}),st({method:O,eventType:"Mouse Up",eventName:"mouseup"}),st({method:O,eventType:"Mouse Down",eventName:"mousedown"}),st({method:O,eventType:"Orientation Change",eventName:"orientationchange"}),st({method:O,eventType:"Print",eventNames:["afterprint","beforeprint"]}),st({method:O,eventType:"Ready State Change",eventName:"readystatechange"}),st({method:O,eventType:"Touch Start",eventName:"touchstart"}),st({method:O,eventType:"Touch End",eventName:"touchend"}),st({method:O,eventType:"Touch Cancel",eventName:"touchcancel"}),st({method:O,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),st({method:O,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),st({method:O,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),M==="child"&&st({method:O,eventType:"IFrame Resized",eventName:"resize"})}function F(O,H,fe,ve){return H!==O&&(O in fe||(Ft(O+" is not a valid option for "+ve+"CalculationMethod."),O=H),ce(ve+' calculation method set to "'+O+'"')),O}function et(){y=F(y,h,Be,"height")}function fn(){ne=F(ne,ae,jn,"width")}function Dn(){var O;r===!0?(Ls("add"),O=S<0,window.MutationObserver||window.WebKitMutationObserver?O?be():l=(function(){function H(me){function xt(qt){qt.complete===!1&&(ce("Attach listeners to "+qt.src),qt.addEventListener("load",K,!1),qt.addEventListener("error",J,!1),Nt.push(qt))}me.type==="attributes"&&me.attributeName==="src"?xt(me.target):me.type==="childList"&&Array.prototype.forEach.call(me.target.querySelectorAll("img"),xt)}function fe(me){ce("Remove listeners from "+me.src),me.removeEventListener("load",K,!1),me.removeEventListener("error",J,!1),me=me,Nt.splice(Nt.indexOf(me),1)}function ve(me,xt,qt){fe(me.target),$t(xt,qt+": "+me.target.src)}function K(me){ve(me,"imageLoad","Image loaded")}function J(me){ve(me,"imageLoadFailed","Image load failed")}function Ne(me){$t("mutationObserver","mutationObserver: "+me[0].target+" "+me[0].type),me.forEach(H)}var Nt=[],Ns=window.MutationObserver||window.WebKitMutationObserver,Wt=(function(){var me=document.querySelector("body");return Wt=new Ns(Ne),ce("Create body MutationObserver"),Wt.observe(me,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Wt})();return{disconnect:function(){"disconnect"in Wt&&(ce("Disconnect body MutationObserver"),Wt.disconnect(),Nt.forEach(fe))}}})():(ce("MutationObserver not supported in this browser!"),be())):ce("Auto Resize disabled")}function be(){S!==0&&(ce("setInterval: "+S+"ms"),b=setInterval(function(){$t("interval","setInterval: "+S)},Math.abs(S)))}function bt(O,H){var fe=0;return H=H||document.body,fe=(fe=document.defaultView.getComputedStyle(H,null))!==null?fe[O]:0,parseInt(fe,o)}function pn(O,H){for(var fe,ve=H.length,K=0,J=_s(O),Ne=Date.now(),Nt=0;Nt<ve;Nt++)K<(fe=H[Nt].getBoundingClientRect()[O]+bt("margin"+J,H[Nt]))&&(K=fe);return Ne=Date.now()-Ne,ce("Parsed "+ve+" HTML elements"),ce("Element position calculated in "+Ne+"ms"),G/2<(Ne=Ne)&&ce("Event throttle increased to "+(G=2*Ne)+"ms"),K}function tt(O){return[O.bodyOffset(),O.bodyScroll(),O.documentElementOffset(),O.documentElementScroll()]}function hn(O,H){var fe=document.querySelectorAll("["+H+"]");return fe.length===0&&(Ft("No tagged elements ("+H+") found on page"),document.querySelectorAll("body *")),pn(O,fe)}function yt(){return document.querySelectorAll("body *")}function Zl(O,H,fe,ve){function K(){O in{init:1,interval:1,size:1}||!(y in _||u&&ne in _)?O in{interval:1}||ce("No change in size detected"):vS(H)}var J,Ne;function Nt(Ns,Wt){return!(Math.abs(Ns-Wt)<=R)}J=n!==fe?fe:Be[y](),Ne=n!==ve?ve:jn[ne](),Nt(f,J)||u&&Nt(Le,Ne)||O==="init"?(gn(),Kt(f=J,Le=Ne,O)):K()}function sf(){Bt=Date.now(),ot=null,mn=In.apply(gt,Wr),ot||(gt=Wr=null)}function $t(O,H,fe,ve){Y&&O in d?ce("Trigger event cancelled: "+O):(O in{reset:1,resetPage:1,init:1}||ce("Trigger event: "+H),(O==="init"?Zl:As)(O,H,fe,ve))}function gn(){Y||(Y=!0,ce("Trigger event lock on")),clearTimeout(V),V=setTimeout(function(){Y=!1,ce("Trigger event lock off"),ce("--")},m)}function yS(O){f=Be[y](),Le=jn[ne](),Kt(f,Le,O)}function vS(O){var H=y;y=h,ce("Reset trigger event: "+O),gn(),yS("reset"),y=H}function Kt(O,H,fe,ve,K){var J;N===!0&&(n===K?K=P:ce("Message targetOrigin: "+K),ce("Sending message to host page ("+(J=T+":"+(O+":"+H)+":"+fe+(n!==ve?":"+ve:""))+")"),W.postMessage(g+J,K))}function ES(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),sq=[{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 aq(){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 lq(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),Er();return}if(e){let n=!1;for(const r of sq)if(r.detect()){r.apply(),n=!0;break}n||aq()}bS(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||Z.send({operation:"application_template_not_em_alert_show"}),Er()}function bS(){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(q,"CANVAS_CORE_UNITS",{enumerable:!0,get:function(){return NI}}),Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(q,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return BW}}),Object.defineProperty(q,"EVENT_TYPES",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(q,"FOCUS_ID",{enumerable:!0,get:function(){return at}}),Object.defineProperty(q,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return te}}),Object.defineProperty(q,"INIT_PREVIEW_ID",{enumerable:!0,get:function(){return Jo}}),Object.defineProperty(q,"INSERT_POLICY_ID",{enumerable:!0,get:function(){return cc}}),Object.defineProperty(q,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return bf}}),Object.defineProperty(q,"Node",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(q,"NodeType",{enumerable:!0,get:function(){return $}}),Object.defineProperty(q,"SET_CURSOR_ID",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(q,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return hf}}),Object.defineProperty(q,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(q,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return gf}}),Object.defineProperty(q,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(q,"_defineProperty",{enumerable:!0,get:function(){return L}}),Object.defineProperty(q,"addFontFamilyClass",{enumerable:!0,get:function(){return Qi}}),Object.defineProperty(q,"ampUnit",{enumerable:!0,get:function(){return _T}}),Object.defineProperty(q,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return dl}}),Object.defineProperty(q,"applyRootScale",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(q,"buildEmFontClassName",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(q,"checkBlockAdaptivity",{enumerable:!0,get:function(){return ll}}),Object.defineProperty(q,"clearLinkTags",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(q,"clearProjectFontFaces",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(q,"commitOf",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(q,"commonStylesApply",{enumerable:!0,get:function(){return Gv}}),Object.defineProperty(q,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return nm}}),Object.defineProperty(q,"createFontClassName",{enumerable:!0,get:function(){return $d}}),Object.defineProperty(q,"createIdentifier",{enumerable:!0,get:function(){return de}}),Object.defineProperty(q,"defineSurface",{enumerable:!0,get:function(){return ew}}),Object.defineProperty(q,"defineUnit",{enumerable:!0,get:function(){return NS}}),Object.defineProperty(q,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return nq}}),Object.defineProperty(q,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return JW}}),Object.defineProperty(q,"elMarkupHelper",{enumerable:!0,get:function(){return lq}}),Object.defineProperty(q,"extensionsUnit",{enumerable:!0,get:function(){return j4}}),Object.defineProperty(q,"findParentTr",{enumerable:!0,get:function(){return uh}}),Object.defineProperty(q,"fitEmailToWidth",{enumerable:!0,get:function(){return MT}}),Object.defineProperty(q,"fitImagesToColumns",{enumerable:!0,get:function(){return xm}}),Object.defineProperty(q,"getElementInnerHTML",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(q,"getOuterHtml",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(q,"getUsedColors",{enumerable:!0,get:function(){return e1}}),Object.defineProperty(q,"globalBlockReplace",{enumerable:!0,get:function(){return SW}}),Object.defineProperty(q,"iframeSetSize",{enumerable:!0,get:function(){return RT}}),Object.defineProperty(q,"implementPolyfills",{enumerable:!0,get:function(){return df}}),Object.defineProperty(q,"insertAdjacentHTML",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(q,"insertCountdown",{enumerable:!0,get:function(){return dv}}),Object.defineProperty(q,"isComment",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(q,"isEmptyTable",{enumerable:!0,get:function(){return un}}),Object.defineProperty(q,"isTextNode",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(q,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return bS}}),Object.defineProperty(q,"markProjectFontClass",{enumerable:!0,get:function(){return qd}}),Object.defineProperty(q,"messageService",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(q,"minifyStylesheet",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(q,"paintGateUnit",{enumerable:!0,get:function(){return eq}}),Object.defineProperty(q,"parseFromString",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(q,"removeClassesByPrefix",{enumerable:!0,get:function(){return zd}}),Object.defineProperty(q,"removeHiddenClasses",{enumerable:!0,get:function(){return ja}}),Object.defineProperty(q,"requireService",{enumerable:!0,get:function(){return D}}),Object.defineProperty(q,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return iq}}),Object.defineProperty(q,"rgbToHex",{enumerable:!0,get:function(){return X}}),Object.defineProperty(q,"rowsHost",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(q,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return yl}}),Object.defineProperty(q,"setBlockMaxWidth",{enumerable:!0,get:function(){return Mm}}),Object.defineProperty(q,"setDocumentStyles",{enumerable:!0,get:function(){return Fd}}),Object.defineProperty(q,"setElementBorder",{enumerable:!0,get:function(){return Vd}}),Object.defineProperty(q,"setElementBorderRadius",{enumerable:!0,get:function(){return Xi}}),Object.defineProperty(q,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return $P}}),Object.defineProperty(q,"setFloatBlocksWidth",{enumerable:!0,get:function(){return Nm}}),Object.defineProperty(q,"setImageWidth",{enumerable:!0,get:function(){return xd}}),Object.defineProperty(q,"setStructureBlocksWidth",{enumerable:!0,get:function(){return Nl}}),Object.defineProperty(q,"startSandbox",{enumerable:!0,get:function(){return tw}}),Object.defineProperty(q,"state",{enumerable:!0,get:function(){return x}}),Object.defineProperty(q,"stripSubjectTags",{enumerable:!0,get:function(){return Pw}}),Object.defineProperty(q,"uptimeCountdown",{enumerable:!0,get:function(){return Md}}),Object.defineProperty(q,"wheelBridgeUnit",{enumerable:!0,get:function(){return tq}})});