@emailmaker/emailmaker 1.0.111-dev.1 → 1.0.111-dev.3

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 (83) hide show
  1. package/README.md +1 -1
  2. package/emailmaker-core.e8a446cd.js +1 -0
  3. package/emailmaker-esm.js +30 -1004
  4. package/emailmaker.js +4 -6
  5. package/iframe/js/amp.BFiiFM7T.js +1 -0
  6. package/iframe/js/chunk.oX6nCJbK.js +1 -1
  7. package/iframe/js/iframe-eblock.js +1 -1
  8. package/iframe/js/iframe.js +1 -1
  9. package/iframe/js/rules.BSaCN7eK.js +1 -1
  10. package/iframe/js/sanitize-html.Brggoo7U.js +1 -0
  11. package/monacoeditorwork/css.worker.bundle.js +1 -3
  12. package/monacoeditorwork/editor.worker.bundle.js +1 -3
  13. package/monacoeditorwork/html.worker.bundle.js +4 -6
  14. package/monacoeditorwork/json.worker.bundle.js +3 -5
  15. package/monacoeditorwork/ts.worker.bundle.js +3 -5
  16. package/package.json +1 -1
  17. package/react/index.js +1 -80
  18. package/runtime/@ant-design/pro-layout/index.js +1 -1
  19. package/runtime/antd/index.js +1 -1
  20. package/runtime/app-core/index.js +1 -1
  21. package/runtime/react-dom/client/index.js +1 -1
  22. package/runtime/react-dom/index.js +1 -1
  23. package/runtime/react-router-dom/index.js +1 -1
  24. package/runtime-core/index.js +64 -136
  25. package/static/core/{e2662f37.js → 10c65b49.js} +1 -1
  26. package/static/core/{f3de9e9a2.js → 1a135ad92.js} +6 -6
  27. package/static/core/{c5aeffb2.js → 1ce976fb.js} +2 -2
  28. package/static/core/337e81ef2.js +903 -0
  29. package/static/core/{4c0eea0d.js → 3915ee5d.js} +2 -2
  30. package/static/core/49a8aa01.js +47 -0
  31. package/static/core/4c9c4d012.js +596 -0
  32. package/static/core/{32f4e73e.js → 4f6c7c6b.js} +1 -1
  33. package/static/core/5017c0042.js +40 -0
  34. package/static/core/{7cc94064.js → 5cf42238.js} +1 -1
  35. package/static/core/{b733d3e7.js → 706f8931.js} +52 -54
  36. package/static/core/773c9c0b2.js +6 -0
  37. package/static/core/784d90d82.js +471 -0
  38. package/static/core/{8610aff1.js → 947fe6ad.js} +1 -1
  39. package/static/core/{a158dbe5.js → a73d3dfc.js} +1 -1
  40. package/static/core/ab2357622.js +3 -0
  41. package/static/core/{5859d2b82.js → afcbd8062.js} +1 -1
  42. package/static/core/{58073bbd.js → b2e7fac5.js} +1 -1
  43. package/static/core/{dfecb0b1.js → b7e39056.js} +1 -1
  44. package/static/core/{5aa6ffe0.js → b90a22a7.js} +1 -1
  45. package/static/core/{6aa2fc70.js → cc20a6bf.js} +2 -2
  46. package/static/core/{9476b2c7.js → d4368c3f.js} +1 -1
  47. package/static/core/{e14c4f64.js → d4fcbedb.js} +4 -6
  48. package/static/core/{480c2e5a.js → de29fcef.js} +5 -5
  49. package/static/core/{e45be63a2.js → e2c094522.js} +2 -2
  50. package/static/core/f5199bf32.js +3 -0
  51. package/static/core/f80dab8a.js +1 -0
  52. package/static/core/{3f396ad0.js → fbbf01d2.js} +1 -1
  53. package/static/esm/28a11e05.js +1 -0
  54. package/static/esm/48e604b0.js +1 -0
  55. package/static/esm/b09da19c.js +1 -0
  56. package/static/esm/d111d47f.js +1 -0
  57. package/static/runtime/client-DclOo982.js +1 -0
  58. package/static/runtime/dist-CQOUCSSc.js +2 -0
  59. package/static/runtime/{es-D9451PGN.js → es-B1Gd5vyV.js} +7 -7
  60. package/static/runtime/{es-B_QrCd0w.js → es-B9bjSlFv.js} +5 -5
  61. package/static/runtime/{react-dom-CHJrMg3F.js → react-dom-B_ktM7d0.js} +3 -3
  62. package/static/umd/3a623ceb.js +560 -0
  63. package/emailmaker-core.0e81adc5.js +0 -2
  64. package/iframe/js/amp.kRi8xP5B.js +0 -1
  65. package/iframe/js/sanitize-html.DnGOi7Ve.js +0 -1
  66. package/static/core/167feeb72.js +0 -477
  67. package/static/core/1e55fe352.js +0 -596
  68. package/static/core/293d4deb2.js +0 -3
  69. package/static/core/29b5e247.js +0 -47
  70. package/static/core/36daa25e2.js +0 -6
  71. package/static/core/77a4a5b42.js +0 -40
  72. package/static/core/7c89c88b2.js +0 -916
  73. package/static/core/e1d78bb3.js +0 -1
  74. package/static/core/f5f05aaa2.js +0 -3
  75. package/static/esm/21e5883f.js +0 -31
  76. package/static/esm/3239c2b2.js +0 -17
  77. package/static/esm/339a15a0.js +0 -30
  78. package/static/esm/8bd1b5bb.js +0 -28
  79. package/static/runtime/client-CjhXNXhR.js +0 -1
  80. package/static/runtime/dist-C64-v4Ip.js +0 -2
  81. package/static/umd/73d630dc.js +0 -560
  82. /package/iframe/{iframe-eblock.0e81adc5.html → iframe-eblock.e8a446cd.html} +0 -0
  83. /package/iframe/{iframe.0e81adc5.html → iframe.e8a446cd.html} +0 -0
@@ -0,0 +1,40 @@
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.setAttribute(`data-emailmaker`,`true`),e.appendChild(document.createTextNode(`.monaco-editor{width:100%;height:100%}.monaco-editor .monaco-hover{border-radius:6px}.monaco-editor .monaco-editor .scroll-decoration{box-shadow:none}.monaco-editor,.monaco-editor *,.monaco-editor .view-lines,.monaco-editor .view-lines *,.monaco-editor .view-lines .view-line,.monaco-editor .view-lines .monaco-mouse-cursor-text,.monaco-editor .view-line,.monaco-editor .monaco-mouse-cursor-text{font-family:var(--monaco-editor-font-family,"Source Code Pro", Consolas, "Courier New", monospace)!important}.monaco-editor .view-line,.monaco-editor .view-line span,.monaco-editor .view-line span.inline-selected-text{font-variant-ligatures:none;font-feature-settings:"liga" 0, "calt" 0;font-kerning:none;white-space:pre;font-family:var(--monaco-monospace-font,var(--monaco-editor-font-family,"Source Code Pro", Consolas, "Courier New", monospace))!important;font-size:var(--monaco-editor-font-size,14px)!important;font-weight:400!important}.blocks-app .colorpicker-body .saturation-box,.blocks-app .colorpicker-body .strip{border-radius:4px}.blocks-app .scrollbar.vertical{width:5px!important}.blocks-app .scrollbar.vertical .slider{border-radius:5px!important;width:5px!important}.blocks-app .user-cursor{z-index:10;border-left:2px solid #ff00e1;width:2px;height:20px;position:absolute}.blocks-app .cursor-hover{color:#fff;text-wrap-mode:nowrap;z-index:10000;border-radius:7px 7px 7px 0;margin-left:-2px;padding:0 5px;font-size:12px;position:absolute;top:-17px}.blocks-app .user-selection-decoration{background-color:#8080eb4d}.monaco-editor__spin{z-index:1000;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();__emailmaker__.define(`static/core/5017c0042.js`,[`require`,`exports`,`module`,`static/core/af339f1f.js`,`static/core/b5f36842.js`,`static/core/d4fcbedb.js`,`static/core/706f8931.js`,`static/core/1a135ad92.js`,`static/core/49a8aa01.js`,`static/core/f5199bf32.js`,`static/core/a73d3dfc.js`,`react`,`antd`,`react/jsx-runtime`],function(e,t,n){let r=e(`./af339f1f.js`),i=e(`./49a8aa01.js`),a=e(`./b5f36842.js`),o=e(`./a73d3dfc.js`),s=e(`./d4fcbedb.js`),c=e(`./706f8931.js`),l=e(`./f5199bf32.js`),u=e(`./1a135ad92.js`),d=e(`react`),f=r.u(d,1);d=r.u(d);let p=e(`antd`),m=e(`react/jsx-runtime`);function h(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ee(e){if(Array.isArray(e))return e}function g(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function v(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?y(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b(e,t){if(e==null)return{};var n,r,i=x(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function x(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 S(e,t){return ee(e)||_(e,t)||w(e,t)||v()}function ne(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function C(e){var t=ne(e,`string`);return typeof t==`symbol`?t:t+``}function w(e,t){if(e){if(typeof e==`string`)return h(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?re(Object(n),!0).forEach(function(t){T(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}function ie(e){return function t(){for(var n=this,r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=Array(e),a=0;a<e;a++)r[a]=arguments[a];return t.apply(n,[].concat(i,r))}}}function ae(e){return{}.toString.call(e).includes(`Object`)}function O(e){return!Object.keys(e).length}function k(e){return typeof e==`function`}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function oe(e,t){return ae(t)||j(`changeType`),Object.keys(t).some(function(t){return!A(e,t)})&&j(`changeField`),t}function se(e){k(e)||j(`selectorType`)}function ce(e){k(e)||ae(e)||j(`handlerType`),ae(e)&&Object.values(e).some(function(e){return!k(e)})&&j(`handlersType`)}function le(e){e||j(`initialIsRequired`),ae(e)||j(`initialType`),O(e)&&j(`initialContent`)}function ue(e,t){throw Error(e[t]||e.default)}var j=ie(ue)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),de={changes:oe,selector:se,handler:ce,initial:le};function fe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de.initial(e),de.handler(t);var n={current:e},r=ie(he)(n,t),i=ie(me)(n),a=ie(de.changes)(e),o=ie(pe)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return de.selector(e),e(n.current)}function c(e){D(r,i,a,o)(e)}return[s,c]}function pe(e,t){return k(t)?t(e.current):t}function me(e,t){return e.current=E(E({},e.current),t),t}function he(e,t,n){return k(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var ge={create:fe},_e={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function ve(e){return function t(){for(var n=this,r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=Array(e),a=0;a<e;a++)r[a]=arguments[a];return t.apply(n,[].concat(i,r))}}}function ye(e){return{}.toString.call(e).includes(`Object`)}function be(e){return e||Se(`configIsRequired`),ye(e)||Se(`configType`),e.urls?{paths:{vs:e.urls.monacoBase}}:e}function xe(e,t){throw Error(e[t]||e.default)}var Se=ve(xe)({configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
+ You are using deprecated way of configuration.
4
+
5
+ Instead of using
6
+ monaco.config({ urls: { monacoBase: '...' } })
7
+ use
8
+ monaco.config({ paths: { vs: '...' } })
9
+
10
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
11
+ `}),Ce={config:be},we=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}};function Te(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Te(e[n],t[n]))}),te(te({},e),t)}var Ee={type:`cancelation`,msg:`operation is manually canceled`};function De(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(Ee):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var Oe=[`monaco`],ke=S(ge.create({config:_e,isInitialized:!1,resolve:null,reject:null,monaco:null}),2),Ae=ke[0],je=ke[1];function Me(e){var t=Ce.config(e),n=t.monaco,r=b(t,Oe);je(function(e){return{config:Te(e.config,r),monaco:n}})}function Ne(){var e=Ae(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(je({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),De(Be);if(window.monaco&&window.monaco.editor)return Re(window.monaco),e.resolve(window.monaco),De(Be);we(Pe,Ie)(Le)}return De(Be)}function Pe(e){return document.body.appendChild(e)}function Fe(e){var t=document.createElement(`script`);return e&&(t.src=e),t}function Ie(e){var t=Ae(function(e){return{config:e.config,reject:e.reject}}),n=Fe(`${t.config.paths.vs}/loader.js`);return n.onload=function(){return e()},n.onerror=t.reject,n}function Le(){var e=Ae(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t([`vs/editor/editor.main`],function(t){var n=t.m||t;Re(n),e.resolve(n)},function(t){e.reject(t)})}function Re(e){Ae().monaco||je({monaco:e})}function ze(){return Ae(function(e){return e.monaco})}var Be=new Promise(function(e,t){return je({resolve:e,reject:t})}),Ve={config:Me,init:Ne,__getMonacoInstance:ze},He={wrapper:{display:`flex`,position:`relative`,textAlign:`initial`},fullWidth:{width:`100%`},hide:{display:`none`}},Ue={container:{display:`flex`,height:`100%`,width:`100%`,justifyContent:`center`,alignItems:`center`}};function We({children:e}){return f.default.createElement(`div`,{style:Ue.container},e)}var Ge=We;function Ke({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:a,wrapperProps:o}){return f.default.createElement(`section`,{style:{...He.wrapper,width:e,height:t},...o},!n&&f.default.createElement(Ge,null,r),f.default.createElement(`div`,{ref:i,style:{...He.fullWidth,...!n&&He.hide},className:a}))}var qe=(0,f.memo)(Ke);function Je(e){(0,f.useEffect)(e,[])}var Ye=Je;function Xe(e,t,n=!0){let r=(0,f.useRef)(!0);(0,f.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)}var Ze=Xe;function Qe(){}function $e(e,t,n,r){return et(e,r)||tt(e,t,n,r)}function et(e,t){return e.editor.getModel(nt(e,t))}function tt(e,t,n,r){return e.editor.createModel(t,n,r?nt(e,r):void 0)}function nt(e,t){return e.Uri.parse(t)}function rt({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:l=`light`,loading:u=`Loading...`,options:d={},height:p=`100%`,width:m=`100%`,className:h,wrapperProps:ee={},beforeMount:g=Qe,onMount:_=Qe}){let[v,y]=(0,f.useState)(!1),[te,b]=(0,f.useState)(!0),x=(0,f.useRef)(null),S=(0,f.useRef)(null),ne=(0,f.useRef)(null),C=(0,f.useRef)(_),w=(0,f.useRef)(g),T=(0,f.useRef)(!1);Ye(()=>{let e=Ve.init();return e.then(e=>(S.current=e)&&b(!1)).catch(e=>e?.type!==`cancelation`&&void 0),()=>x.current?D():e.cancel()}),Ze(()=>{if(x.current&&S.current){let t=x.current.getOriginalEditor(),i=$e(S.current,e||``,r||n||`text`,a||``);i!==t.getModel()&&t.setModel(i)}},[a],v),Ze(()=>{if(x.current&&S.current){let e=x.current.getModifiedEditor(),r=$e(S.current,t||``,i||n||`text`,o||``);r!==e.getModel()&&e.setModel(r)}},[o],v),Ze(()=>{let e=x.current.getModifiedEditor();e.getOption(S.current.editor.EditorOption.readOnly)?e.setValue(t||``):t!==e.getValue()&&(e.executeEdits(``,[{range:e.getModel().getFullModelRange(),text:t||``,forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),Ze(()=>{x.current?.getModel()?.original.setValue(e||``)},[e],v),Ze(()=>{let{original:e,modified:t}=x.current.getModel();S.current.editor.setModelLanguage(e,r||n||`text`),S.current.editor.setModelLanguage(t,i||n||`text`)},[n,r,i],v),Ze(()=>{S.current?.editor.setTheme(l)},[l],v),Ze(()=>{x.current?.updateOptions(d)},[d],v);let re=(0,f.useCallback)(()=>{if(!S.current)return;w.current(S.current);let s=$e(S.current,e||``,r||n||`text`,a||``),c=$e(S.current,t||``,i||n||`text`,o||``);x.current?.setModel({original:s,modified:c})},[n,t,i,e,r,a,o]),E=(0,f.useCallback)(()=>{!T.current&&ne.current&&(x.current=S.current.editor.createDiffEditor(ne.current,{automaticLayout:!0,...d}),re(),S.current?.editor.setTheme(l),y(!0),T.current=!0)},[d,l,re]);(0,f.useEffect)(()=>{v&&C.current(x.current,S.current)},[v]),(0,f.useEffect)(()=>{!te&&!v&&E()},[te,v,E]);function D(){let e=x.current?.getModel();s||e?.original?.dispose(),c||e?.modified?.dispose(),x.current?.dispose()}return f.default.createElement(qe,{width:m,height:p,isEditorReady:v,loading:u,_ref:ne,className:h,wrapperProps:ee})}(0,f.memo)(rt);function it(e){let t=(0,f.useRef)();return(0,f.useEffect)(()=>{t.current=e},[e]),t.current}var at=it,ot=new Map;function st({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:a,theme:o=`light`,line:s,loading:c=`Loading...`,options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:p=!1,width:m=`100%`,height:h=`100%`,className:ee,wrapperProps:g={},beforeMount:_=Qe,onMount:v=Qe,onChange:y,onValidate:te=Qe}){let[b,x]=(0,f.useState)(!1),[S,ne]=(0,f.useState)(!0),C=(0,f.useRef)(null),w=(0,f.useRef)(null),T=(0,f.useRef)(null),re=(0,f.useRef)(v),E=(0,f.useRef)(_),D=(0,f.useRef)(),ie=(0,f.useRef)(r),ae=at(a),O=(0,f.useRef)(!1),k=(0,f.useRef)(!1);Ye(()=>{let e=Ve.init();return e.then(e=>(C.current=e)&&ne(!1)).catch(e=>e?.type!==`cancelation`&&void 0),()=>w.current?oe():e.cancel()}),Ze(()=>{let o=$e(C.current,e||r||``,t||i||``,a||n||``);o!==w.current?.getModel()&&(d&&ot.set(ae,w.current?.saveViewState()),w.current?.setModel(o),d&&w.current?.restoreViewState(ot.get(a)))},[a],b),Ze(()=>{w.current?.updateOptions(l)},[l],b),Ze(()=>{!w.current||r===void 0||(w.current.getOption(C.current.editor.EditorOption.readOnly)?w.current.setValue(r):r!==w.current.getValue()&&(k.current=!0,w.current.executeEdits(``,[{range:w.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),w.current.pushUndoStop(),k.current=!1))},[r],b),Ze(()=>{let e=w.current?.getModel();e&&i&&C.current?.editor.setModelLanguage(e,i)},[i],b),Ze(()=>{s!==void 0&&w.current?.revealLine(s)},[s],b),Ze(()=>{C.current?.editor.setTheme(o)},[o],b);let A=(0,f.useCallback)(()=>{if(!(!T.current||!C.current)&&!O.current){E.current(C.current);let c=a||n,f=$e(C.current,r||e||``,t||i||``,c||``);w.current=C.current?.editor.create(T.current,{model:f,automaticLayout:!0,...l},u),d&&w.current.restoreViewState(ot.get(c)),C.current.editor.setTheme(o),s!==void 0&&w.current.revealLine(s),x(!0),O.current=!0}},[e,t,n,r,i,a,l,u,d,o,s]);(0,f.useEffect)(()=>{b&&re.current(w.current,C.current)},[b]),(0,f.useEffect)(()=>{!S&&!b&&A()},[S,b,A]),ie.current=r,(0,f.useEffect)(()=>{b&&y&&(D.current?.dispose(),D.current=w.current?.onDidChangeModelContent(e=>{k.current||y(w.current.getValue(),e)}))},[b,y]),(0,f.useEffect)(()=>{if(b){let e=C.current.editor.onDidChangeMarkers(e=>{let t=w.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=C.current.editor.getModelMarkers({resource:t});te?.(e)}});return()=>{e?.dispose()}}return()=>{}},[b,te]);function oe(){D.current?.dispose(),p?d&&ot.set(a,w.current.saveViewState()):w.current.getModel()?.dispose(),w.current.dispose()}return f.default.createElement(qe,{width:m,height:h,isEditorReady:b,loading:c,_ref:T,className:ee,wrapperProps:g})}var ct=(0,f.memo)(st),lt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class{constructor(){this._listeners={},this._mapCdataTags=this.makeMap(`script,style`),this._arrBlocks=[],this.lastEvent=null}makeMap(e){let t={},n=e.split(`,`);for(let e=0;e<n.length;e++)t[n[e]]=!0;return t}parse(e){let t=this._mapCdataTags,n=/<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g,r=/\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g,i=/\r?\n/g,a,o,s=0,c,l,u=null,d,f=[],p=0,m,h=0,ee=1,g=this._arrBlocks;this.fire(`start`,{pos:0,line:1,col:1});let _=()=>{let e=l.find(e=>e.name===`type`)||{value:``};return t[c]&&e.value.indexOf(`text/ng-template`)===-1},v=(e,t,n,r)=>{let a=n-h+1;for(r===void 0&&(r={}),r.raw=t,r.pos=n,r.line=ee,r.col=a,g.push(r),this.fire(e,r);i.exec(t);)ee++,h=n+i.lastIndex};for(;a=n.exec(e);){if(o=a.index,o>s&&(m=e.substring(s,o),u?f.push(m):v(`text`,m,s)),s=n.lastIndex,(c=a[1])&&(u&&c===u&&(m=f.join(``),v(`cdata`,m,p,{tagName:u,attrs:d}),u=null,d=void 0,f=[]),!u)){v(`tagend`,a[0],o,{tagName:c});continue}if(u)f.push(a[0]);else if(c=a[4]){l=[];let e=a[5],t,n=0;for(;t=r.exec(e);){let e=t[1],r=t[2]?t[2]:t[4]?t[4]:``,i=t[3]?t[3]:t[5]?t[5]:t[6]?t[6]:``;l.push({name:e,value:i,quote:r,index:t.index,raw:t[0]}),n+=t[0].length}n===e.length?(v(`tagstart`,a[0],o,{tagName:c,attrs:l,close:a[6]}),_()&&(u=c,d=l.concat(),f=[],p=s)):v(`text`,a[0],o)}else (a[2]||a[3])&&v(`comment`,a[0],o,{content:a[2]||a[3],long:!!a[2]})}e.length>s&&(m=e.substring(s,e.length),v(`text`,m,s)),this.fire(`end`,{pos:s,line:ee,col:e.length-h+1})}addListener(e,t){let n=this._listeners,r=e.split(/[,\s]/),i;for(let e=0,a=r.length;e<a;e++)i=r[e],n[i]===void 0&&(n[i]=[]),n[i].push(t)}fire(e,t){t===void 0&&(t={}),t.type=e;let n=[],r=this._listeners[e],i=this._listeners.all;r!==void 0&&(n=n.concat(r)),i!==void 0&&(n=n.concat(i));let a=this.lastEvent;a!==null&&(delete a.lastEvent,t.lastEvent=a),this.lastEvent=t;for(let e=0,r=n.length;e<r;e++)n[e].call(this,t)}removeListener(e,t){let n=this._listeners[e];if(n!==void 0){for(let e=0,r=n.length;e<r;e++)if(n[e]===t){n.splice(e,1);break}}}fixPos(e,t){let n=e.raw.substr(0,t).split(/\r?\n/),r=n.length-1,i=e.line,a;return r>0?(i+=r,a=n[r].length+1):a=e.col+t,{line:i,col:a}}getMapAttrs(e){let t={},n;for(let r=0,i=e.length;r<i;r++)n=e[r],t[n.name]=n.value;return t}}})),ut=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class{constructor(e,t,n={}){this.html=e,this.lines=e.split(/\r?\n/);let r=/\r?\n/.exec(e);this.brLen=r===null?0:r[0].length,this.ruleset=t,this.messages=[],this.disabledRulesMap=n}info(e,t,n,r,i){this.report(`info`,e,t,n,r,i)}warn(e,t,n,r,i){this.report(`warning`,e,t,n,r,i)}error(e,t,n,r,i){this.report(`error`,e,t,n,r,i)}report(e,t,n,r,i,a){let o=this.disabledRulesMap[n];if(o&&(o.all===!0||o.rules&&o.rules.has(i.id)))return;let s=this.lines,c=this.brLen,l=``,u=0;for(let e=n-1,t=s.length;e<t&&(l=s[e],u=l.length,r>u&&n<t);e++)n++,r-=u,r!==1&&(r-=c);this.messages.push({type:e,message:t,raw:a,evidence:l,line:n,col:r,rule:{id:i.id,description:i.description,link:`https://htmlhint.com/rules/${i.id}`}})}}})),dt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`alt-require`,description:`The alt attribute of an <img> element must be present and alt attribute of area[href] and input[type=image] must have a value.`,init(e,t){e.addListener(`tagstart`,n=>{let r=n.tagName.toLowerCase(),i=e.getMapAttrs(n.attrs),a=n.col+r.length+1,o;r===`img`&&!(`alt`in i)?t.warn(`An alt attribute must be present on <img> elements.`,n.line,a,this,n.raw):(r===`area`&&`href`in i||r===`input`&&i.type===`image`)&&(!(`alt`in i)||i.alt===``)&&(o=r===`area`?`area[href]`:`input[type=image]`,t.warn(`The alt attribute of ${o} must have a value.`,n.line,a,this,n.raw))})}}})),ft=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=`allowReorder.attributeName.attributeType.autoReverse.baseFrequency.baseProfile.calcMode.clipPath.clipPathUnits.contentScriptType.contentStyleType.diffuseConstant.edgeMode.externalResourcesRequired.filterRes.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.onBlur.onChange.onClick.onFocus.onKeyUp.onLoad.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`);function n(e,t){if(t instanceof RegExp)return t.test(e)?{match:e,pattern:t}:!1;let n=t[0],r=t[t.length-1],i=t[t.length-2],a=n===`/`&&(r===`/`||i===`/`&&r===`i`);return a?a&&r===`i`?new RegExp(t.slice(1,-2),`i`).test(e):new RegExp(t.slice(1,-1)).test(e):e===t}e.default={id:`attr-lowercase`,description:`All attribute names must be in lowercase.`,init(e,r,i){let a=(Array.isArray(i)?i:[]).concat(t);e.addListener(`tagstart`,e=>{let t=e.attrs,i,o=e.col+e.tagName.length+1;for(let s=0,c=t.length;s<c;s++){i=t[s];let c=i.name;!a.find(e=>n(c,e))&&c!==c.toLowerCase()&&r.error(`The attribute name of [ ${c} ] must be in lowercase.`,e.line,o+i.index,this,i.raw)}})}}})),pt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`attr-no-duplication`,description:`Elements cannot have duplicate attributes.`,init(e,t){e.addListener(`tagstart`,e=>{let n=e.attrs,r,i,a=e.col+e.tagName.length+1,o={};for(let s=0,c=n.length;s<c;s++)r=n[s],i=r.name,o[i]===!0&&t.error(`Duplicate of attribute name [ ${r.name} ] was found.`,e.line,a+r.index,this,r.raw),o[i]=!0})}}})),mt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`attr-no-unnecessary-whitespace`,description:`No spaces between attribute names and values.`,init(e,t,n){let r=Array.isArray(n)?n:[];e.addListener(`tagstart`,e=>{let n=e.attrs,i=e.col+e.tagName.length+1;for(let a=0;a<n.length;a++)if(r.indexOf(n[a].name)===-1){let r=/(\s*)=(\s*)/.exec(n[a].raw.trim());r&&(r[1].length!==0||r[2].length!==0)&&t.error(`The attribute '${n[a].name}' must not have spaces between the name and value.`,e.line,i+n[a].index,this,n[a].raw)}})}}})),ht=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`attr-value-no-duplication`,description:`Class attributes should not contain duplicate values. Other attributes can be checked via configuration.`,init(e,t,n){let r=Array.isArray(n)?n:[`class`];e.addListener(`tagstart`,e=>{let n=e.attrs,i,a=e.col+e.tagName.length+1;for(let o=0,s=n.length;o<s;o++){i=n[o];let s=i.name.toLowerCase();if(!r.includes(s)||!i.value||!/\s/.test(i.value))continue;let c=i.value.trim().split(/\s+/),l={};for(let n of c){if(n&&l[n]===!0){t.error(`Duplicate value [ ${n} ] was found in attribute [ ${i.name} ].`,e.line,a+i.index,this,i.raw);break}l[n]=!0}}})}}})),gt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`attr-sorted`,description:`Attribute tags must be in proper order.`,init(e,t){let n={},r=[`class`,`id`,`name`,`src`,`for`,`type`,`rel`,`href`,`value`,`title`,`alt`,`role`];for(let e=0;e<r.length;e++)n[r[e]]=e;e.addListener(`tagstart`,e=>{let r=e.attrs,i=[];for(let e=0;e<r.length;e++)i.push(r[e].name);let a=JSON.stringify(i);i.sort((e,t)=>n[e]===void 0?e.startsWith(`data-`)?t.startsWith(`data-`)?e.localeCompare(t):1:n[t]===void 0?t.startsWith(`data-`)?-1:e.localeCompare(t):1:n[t]===void 0?-1:n[e]-n[t]),a!==JSON.stringify(i)&&t.error(`Inaccurate order ${a} should be in hierarchy ${JSON.stringify(i)} `,e.line,e.col,this,e.raw)})}}})),_t=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`attr-unsafe-chars`,description:`Attribute values cannot contain unsafe chars.`,init(e,t){e.addListener(`tagstart`,e=>{let n=e.attrs,r,i=e.col+e.tagName.length+1,a=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,o;for(let s=0,c=n.length;s<c;s++)if(r=n[s],o=a.exec(r.value),o!==null){let n=escape(o[0]).replace(/%u/,`\\u`).replace(/%/,`\\x`);t.warn(`The value of attribute [ ${r.name} ] cannot contain an unsafe char [ ${n} ].`,e.line,i+r.index,this,r.raw)}})}}})),vt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`attr-value-double-quotes`,description:`Attribute values must be in double quotes.`,init(e,t){e.addListener(`tagstart`,e=>{let n=e.attrs,r,i=e.col+e.tagName.length+1;for(let a=0,o=n.length;a<o;a++)r=n[a],(r.value!==``&&r.quote!==`"`||r.value===``&&r.quote===`'`)&&t.error(`The value of attribute [ ${r.name} ] must be in double quotes.`,e.line,i+r.index,this,r.raw)})}}})),yt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`attr-value-not-empty`,description:`All attributes must have values.`,init(e,t){e.addListener(`tagstart`,e=>{let n=e.attrs,r,i=e.col+e.tagName.length+1;for(let a=0,o=n.length;a<o;a++)r=n[a],r.quote===``&&r.value===``&&t.warn(`The attribute [ ${r.name} ] must have a value.`,e.line,i+r.index,this,r.raw)})}}})),bt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`attr-value-single-quotes`,description:`Attribute values must be in single quotes.`,init(e,t){e.addListener(`tagstart`,e=>{let n=e.attrs,r,i=e.col+e.tagName.length+1;for(let a=0,o=n.length;a<o;a++)r=n[a],(r.value!==``&&r.quote!==`'`||r.value===``&&r.quote===`"`)&&t.error(`The value of attribute [ ${r.name} ] must be in single quotes.`,e.line,i+r.index,this,r.raw)})}}})),xt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`attr-whitespace`,description:`All attributes should be separated by only one space and not have leading/trailing whitespace.`,init(e,t,n){let r=Array.isArray(n)?n:[];e.addListener(`tagstart`,e=>{let n=e.attrs,i,a=e.col+e.tagName.length+1;n.forEach(n=>{i=n;let o=n.name;r.indexOf(o)===-1&&(n.value.trim()!==n.value&&t.error(`The attributes of [ ${o} ] must not have leading or trailing whitespace.`,e.line,a+i.index,this,i.raw),n.value.replace(/ +(?= )/g,``)!==n.value&&t.error(`The attributes of [ ${o} ] must be separated by only one space.`,e.line,a+i.index,this,i.raw))})})}}})),St=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`button-type-require`,description:`The type attribute of a <button> element must be present with a valid value: "button", "submit", or "reset".`,init(e,t){e.addListener(`tagstart`,n=>{let r=n.tagName.toLowerCase();if(r===`button`){let i=e.getMapAttrs(n.attrs),a=n.col+r.length+1;if(i.type===void 0)t.warn(`The type attribute must be present on <button> elements.`,n.line,a,this,n.raw);else{let e=i.type.toLowerCase();e!==`button`&&e!==`submit`&&e!==`reset`&&t.warn(`The type attribute of <button> must have a valid value: "button", "submit", or "reset".`,n.line,a,this,n.raw)}}})}}})),Ct=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`doctype-first`,description:`Doctype must be declared first (comments and whitespace allowed before DOCTYPE).`,init(e,t){let n=!1,r=!1,i=a=>{if(!(a.type===`start`||a.type===`text`&&/^\s*$/.test(a.raw))&&!n){if(a.type===`comment`&&a.long===!1&&/^DOCTYPE\s+/i.test(a.content)){n=!0,r&&t.error(`Doctype must be declared before any non-comment content.`,a.line,a.col,this,a.raw);return}a.type!==`comment`&&(r=!0,t.error(`Doctype must be declared before any non-comment content.`,a.line,a.col,this,a.raw),e.removeListener(`all`,i))}};e.addListener(`all`,i)}}})),wt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`doctype-html5`,description:`Invalid doctype. Use: "<!DOCTYPE html>"`,init(e,t){let n=e=>{e.long===!1&&e.content.toLowerCase()!==`doctype html`&&t.warn(`Invalid doctype. Use: "<!DOCTYPE html>"`,e.line,e.col,this,e.raw)},r=()=>{e.removeListener(`comment`,n),e.removeListener(`tagstart`,r)};e.addListener(`all`,n),e.addListener(`tagstart`,r)}}})),Tt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`empty-tag-not-self-closed`,description:`Empty tags must not use self closed syntax.`,init(e,t){let n=e.makeMap(`area,base,basefont,bgsound,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr`);e.addListener(`tagstart`,e=>{let r=e.tagName.toLowerCase();n[r]!==void 0&&e.close&&t.error(`The empty tag : [ ${r} ] must not use self closed syntax.`,e.line,e.col,this,e.raw)})}}})),Et=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`form-method-require`,description:`The method attribute of a <form> element must be present with a valid value: "get", "post", or "dialog".`,init(e,t){e.addListener(`tagstart`,n=>{let r=n.tagName.toLowerCase();if(r===`form`){let i=e.getMapAttrs(n.attrs),a=n.col+r.length+1;if(i.method===void 0)t.warn(`The method attribute must be present on <form> elements.`,n.line,a,this,n.raw);else{let e=i.method.toLowerCase();e!==`get`&&e!==`post`&&e!==`dialog`&&t.warn(`The method attribute of <form> must have a valid value: "get", "post", or "dialog".`,n.line,a,this,n.raw)}}})}}})),Dt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`frame-title-require`,description:`A <frame> or <iframe> element must have an accessible name.`,init(e,t){e.addListener(`tagstart`,n=>{let r=n.tagName.toLowerCase(),i=e.getMapAttrs(n.attrs),a=n.col+r.length+1;if(r===`frame`||r===`iframe`){let e=i.role;if(e===`presentation`||e===`none`)return;let o=`aria-label`in i&&i[`aria-label`].trim()!==``,s=`aria-labelledby`in i&&i[`aria-labelledby`].trim()!==``,c=`title`in i&&i.title.trim()!==``;!o&&!s&&!c&&t.warn(`A <${r}> element must have an accessible name.`,n.line,a,this,n.raw)}})}}})),Ot=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`h1-require`,description:`<h1> must be present in <body> tag and not be empty.`,init(e,t){let n=0,r=!1,i=null,a=null,o=!1;e.addListener(`tagstart`,e=>{let t=e.tagName.toLowerCase();t===`body`?(n++,n===1&&(r=!1,i=e)):t===`h1`&&n>0&&(r=!0,a=e,o=!0)}),e.addListener(`tagend`,e=>{let s=e.tagName.toLowerCase();s===`h1`&&a?(o&&t.warn(`<h1> tag must not be empty.`,a.line,a.col,this,a.raw),a=null):s===`body`&&(n===1&&!r&&i&&t.warn(`<h1> must be present in <body> tag.`,i.line,i.col,this,i.raw),n--,n<0&&(n=0))}),e.addListener(`text`,e=>{a&&o&&e.raw&&!/^\s*$/.test(e.raw)&&(o=!1)}),e.addListener(`end`,()=>{n>0&&!r&&i&&t.warn(`<h1> must be present in <body> tag.`,i.line,i.col,this,i.raw)})}}})),kt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`head-script-disabled`,description:`The <script> tag cannot be used in a <head> tag.`,init(e,t,n){let r=/^(text\/javascript|application\/javascript)$/i,i=!1,a=a=>{let o=e.getMapAttrs(a.attrs),s=o.type,c=o.defer,l=a.tagName.toLowerCase();if(l===`head`&&(i=!0),i===!0&&l===`script`){let e=s===`module`,i=c!==void 0,l=o.async!==void 0;(!s||r.test(s)===!0||e)&&(n===`allow-non-blocking`?!e&&!i&&!l&&t.warn(`The <script> tag cannot be used in a <head> tag unless it has type="module", defer, or async attribute.`,a.line,a.col,this,a.raw):t.warn(`The <script> tag cannot be used in a <head> tag.`,a.line,a.col,this,a.raw))}},o=t=>{t.tagName.toLowerCase()===`head`&&(e.removeListener(`tagstart`,a),e.removeListener(`tagend`,o))};e.addListener(`tagstart`,a),e.addListener(`tagend`,o)}}})),At=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`href-abs-or-rel`,description:`An href attribute must be either absolute or relative.`,init(e,t,n){let r=n===`abs`?`absolute`:`relative`;e.addListener(`tagstart`,e=>{let n=e.attrs,i,a=e.col+e.tagName.length+1;for(let o=0,s=n.length;o<s;o++)if(i=n[o],i.name===`href`){(r===`absolute`&&/^\w+?:/.test(i.value)===!1||r===`relative`&&/^https?:\/\//.test(i.value)===!0)&&t.warn(`The value of the href attribute [ ${i.value} ] must be ${r}.`,e.line,a+i.index,this,i.raw);break}})}}})),jt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=`((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language>([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?<script>[A-Za-z]{4}))?(-(?<region>[A-Za-z]{2}|[0-9]{3}))?(-(?<variant>[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?<extension>[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?<privateUse>x(-[A-Za-z0-9]{1,8})+))?)|(?<privateUse2>x(-[A-Za-z0-9]{1,8})+))`;e.default={id:`html-lang-require`,description:`The lang attribute of an <html> element must be present and should be valid.`,init(e,n){e.addListener(`tagstart`,r=>{let i=r.tagName.toLowerCase(),a=e.getMapAttrs(r.attrs),o=r.col+i.length+1,s=new RegExp(t,`g`);i===`html`&&(`lang`in a?a.lang?s.test(a.lang)||n.warn(`The lang attribute value of <html> element must be a valid BCP47.`,r.line,o,this,r.raw):n.warn(`The lang attribute of <html> element must have a value.`,r.line,o,this,r.raw):n.warn(`An lang attribute must be present on <html> elements.`,r.line,o,this,r.raw))})}}})),Mt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`id-class-ad-disabled`,description:`The id and class attributes cannot use the ad keyword, it will be blocked by adblock software.`,init(e,t){e.addListener(`tagstart`,e=>{let n=e.attrs,r,i,a=e.col+e.tagName.length+1;for(let o=0,s=n.length;o<s;o++)r=n[o],i=r.name,/^(id|class)$/i.test(i)&&/(^|[-_])ad([-_]|$)/i.test(r.value)&&t.warn(`The value of attribute ${i} cannot use the ad keyword.`,e.line,a+r.index,this,r.raw)})}}})),Nt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`id-class-value`,description:`The id and class attribute values must meet the specified rules.`,init(e,t,n){let r={underline:{regId:/^[a-z\d]+(_[a-z\d]+)*$/,message:`The id and class attribute values must be in lowercase and split by an underscore.`},dash:{regId:/^[a-z\d]+(-[a-z\d]+)*$/,message:`The id and class attribute values must be in lowercase and split by a dash.`},hump:{regId:/^[a-z][a-zA-Z\d]*([A-Z][a-zA-Z\d]*)*$/,message:`The id and class attribute values must meet the camelCase style.`}},i;if(i=typeof n==`string`?r[n]:n,typeof i==`object`&&i.regId){let n=i.regId,r=i.message;n instanceof RegExp||(n=new RegExp(n)),e.addListener(`tagstart`,e=>{let i=e.attrs,a,o=e.col+e.tagName.length+1;for(let s=0,c=i.length;s<c;s++)if(a=i[s],a.name.toLowerCase()===`id`&&n.test(a.value)===!1&&t.warn(r,e.line,o+a.index,this,a.raw),a.name.toLowerCase()===`class`){let i=a.value.split(/\s+/g),s;for(let c=0,l=i.length;c<l;c++)s=i[c],s&&n.test(s)===!1&&t.warn(r,e.line,o+a.index,this,s)}})}}}})),Pt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`id-unique`,description:`The value of id attributes must be unique.`,init(e,t){let n={};e.addListener(`tagstart`,e=>{let r=e.attrs,i,a,o=e.col+e.tagName.length+1;for(let s=0,c=r.length;s<c;s++)if(i=r[s],i.name.toLowerCase()===`id`){a=i.value,a&&(n[a]===void 0?n[a]=1:n[a]++,n[a]>1&&t.error(`The id value [ ${a} ] must be unique.`,e.line,o+i.index,this,i.raw));break}})}}})),Ft=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`inline-script-disabled`,description:`Inline script cannot be used.`,init(e,t){e.addListener(`tagstart`,e=>{let n=e.attrs,r,i=e.col+e.tagName.length+1,a,o=/^on(unload|message|submit|select|scroll|resize|mouseover|mouseout|mousemove|mouseleave|mouseenter|mousedown|load|keyup|keypress|keydown|focus|dblclick|click|change|blur|error)$/i;for(let s=0,c=n.length;s<c;s++)r=n[s],a=r.name.toLowerCase(),(o.test(a)===!0||(a===`src`||a===`href`)&&/^\s*javascript:/i.test(r.value))&&t.warn(`Inline script [ ${r.raw} ] cannot be used.`,e.line,i+r.index,this,r.raw)})}}})),It=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`inline-style-disabled`,description:`Inline style cannot be used.`,init(e,t){e.addListener(`tagstart`,e=>{let n=e.attrs,r,i=e.col+e.tagName.length+1;for(let a=0,o=n.length;a<o;a++)r=n[a],r.name.toLowerCase()===`style`&&t.warn(`Inline style [ ${r.raw} ] cannot be used.`,e.line,i+r.index,this,r.raw)})}}})),Lt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`input-requires-label`,description:`All [ input ] tags must have a corresponding [ label ] tag. `,init(e,t){let n=[],r=[];e.addListener(`tagstart`,t=>{let i=t.tagName.toLowerCase(),a=e.getMapAttrs(t.attrs),o=t.col+i.length+1;i===`input`&&a.type!==`hidden`&&r.push({event:t,col:o,id:a.id}),i===`label`&&`for`in a&&a.for!==``&&n.push({event:t,col:o,forValue:a.for})}),e.addListener(`end`,()=>{r.forEach(e=>{i(e)||t.warn(`No matching [ label ] tag found.`,e.event.line,e.col,this,e.event.raw)})});function i(e){let t=!1;return n.forEach(n=>{e.id&&e.id===n.forValue&&(t=!0)}),t}}}})),Rt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`link-rel-canonical-require`,description:`<link rel="canonical"> with non-blank href must be present in <head> tag.`,init(e,t){let n=!1,r=!1,i=``,a=null;e.addListener(`tagstart`,t=>{let o=t.tagName.toLowerCase();if(o===`head`)n=!0,a=t;else if(o===`link`){let n=e.getMapAttrs(t.attrs);n.rel&&n.rel.toLowerCase()===`canonical`&&(r=!0,i=n.href||``)}}),e.addListener(`end`,()=>{n&&a&&(r?i.trim()===``&&t.error(`<link rel="canonical"> href attribute must not be empty.`,a.line,a.col,this,a.raw):t.error(`<link rel="canonical"> must be present in <head> tag.`,a.line,a.col,this,a.raw))})}}})),zt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`main-require`,description:`<main> must be present in <body> tag.`,init(e,t){let n=0,r=!1,i=null;e.addListener(`tagstart`,e=>{let t=e.tagName.toLowerCase();t===`body`?(n++,n===1&&(r=!1,i=e)):t===`main`&&n>0&&(r=!0)}),e.addListener(`tagend`,e=>{e.tagName.toLowerCase()===`body`&&(n===1&&!r&&i&&t.warn(`<main> must be present in <body> tag.`,i.line,i.col,this,i.raw),n--,n<0&&(n=0))}),e.addListener(`end`,()=>{n>0&&!r&&i&&t.warn(`<main> must be present in <body> tag.`,i.line,i.col,this,i.raw)})}}})),Bt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`meta-charset-require`,description:`<meta charset=""> must be present in <head> tag.`,init(e,t){let n=!1,r=!1,i=``,a=null;e.addListener(`tagstart`,t=>{let o=t.tagName.toLowerCase();if(o===`head`)n=!0,a=t;else if(o===`meta`){let n=e.getMapAttrs(t.attrs);n.charset!==void 0&&(r=!0,i=n.charset||``)}}),e.addListener(`end`,()=>{n&&a&&(r?i.trim()===``&&t.error(`<meta charset=""> value must not be empty.`,a.line,a.col,this,a.raw):t.error(`<meta charset=""> must be present in <head> tag.`,a.line,a.col,this,a.raw))})}}})),Vt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`meta-description-require`,description:`<meta name="description"> with non-blank content must be present in <head> tag.`,init(e,t){let n=!1,r=!1,i=``,a=null;e.addListener(`tagstart`,t=>{let o=t.tagName.toLowerCase();if(o===`head`)n=!0,a=t;else if(o===`meta`){let n=e.getMapAttrs(t.attrs);n.name&&n.name.toLowerCase()===`description`&&(r=!0,i=n.content||``)}}),e.addListener(`end`,()=>{n&&a&&(r?i.trim()===``&&t.error(`<meta name="description"> content attribute must not be empty.`,a.line,a.col,this,a.raw):t.error(`<meta name="description"> must be present in <head> tag.`,a.line,a.col,this,a.raw))})}}})),Ht=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`meta-viewport-require`,description:`<meta name="viewport"> with non-blank content must be present in <head> tag.`,init(e,t){let n=!1,r=!1,i=``,a=null;e.addListener(`tagstart`,t=>{let o=t.tagName.toLowerCase();if(o===`head`)n=!0,a=t;else if(o===`meta`){let n=e.getMapAttrs(t.attrs);n.name&&n.name.toLowerCase()===`viewport`&&(r=!0,i=n.content||``)}}),e.addListener(`end`,()=>{n&&a&&(r?i.trim()===``&&t.error(`<meta name="viewport"> content attribute must not be empty.`,a.line,a.col,this,a.raw):t.error(`<meta name="viewport"> must be present in <head> tag.`,a.line,a.col,this,a.raw))})}}})),Ut=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`script-disabled`,description:`The <script> tag cannot be used.`,init(e,t){e.addListener(`tagstart`,e=>{e.tagName.toLowerCase()===`script`&&t.error(`The <script> tag cannot be used.`,e.line,e.col,this,e.raw)})}}})),Wt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`space-tab-mixed-disabled`,description:`Do not mix tabs and spaces for indentation.`,init(e,t,n){let r=`nomix`,i=null;if(typeof n==`string`){let e=/^([a-z]+)(\d+)?/.exec(n);e&&(r=e[1],i=e[2]&&parseInt(e[2],10))}e.addListener(`text`,n=>{let a=n.raw,o=/(^|\r?\n)([ \t]+)/g,s;for(;s=o.exec(a);){let a=e.fixPos(n,s.index+s[1].length);if(a.col!==1)continue;let o=s[2];r===`space`?i?(/^ +$/.test(o)===!1||o.length%i!==0)&&t.warn(`Please use space for indentation and keep ${i} length.`,a.line,1,this,n.raw):/^ +$/.test(o)===!1&&t.warn(`Please use space for indentation.`,a.line,1,this,n.raw):r===`tab`&&/^\t+$/.test(o)===!1?t.warn(`Please use tab for indentation.`,a.line,1,this,n.raw):/ +\t|\t+ /.test(o)===!0&&t.warn(`Do not mix tabs and spaces for indentation.`,a.line,1,this,n.raw)}})}}})),Gt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`spec-char-escape`,description:`Special characters must be escaped.`,init(e,t){e.addListener(`text`,n=>{let r=n.raw,i=/([<>])/g,a;for(;a=i.exec(r);){let r=e.fixPos(n,a.index);t.error(`Special characters must be escaped : [ ${a[0]} ].`,r.line,r.col,this,n.raw)}})}}})),Kt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`src-not-empty`,description:`The src attribute of an img(script,link) must have a value.`,init(e,t){e.addListener(`tagstart`,e=>{let n=e.tagName,r=e.attrs,i,a=e.col+n.length+1;for(let o=0,s=r.length;o<s;o++)i=r[o],(/^(img|script|embed|bgsound|iframe)$/.test(n)===!0&&i.name===`src`||n===`link`&&i.name===`href`||n===`object`&&i.name===`data`)&&i.value===``&&t.error(`The attribute [ ${i.name} ] of the tag [ ${n} ] must have a value.`,e.line,a+i.index,this,i.raw)})}}})),qt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`style-disabled`,description:`<style> tags cannot be used.`,init(e,t){e.addListener(`tagstart`,e=>{e.tagName.toLowerCase()===`style`&&t.warn(`The <style> tag cannot be used.`,e.line,e.col,this,e.raw)})}}})),Jt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=`applet.acronym.bgsound.dir.frame.frameset.noframes.isindex.keygen.listing.menuitem.nextid.noembed.plaintext.rb.rtc.strike.xmp.basefont.big.blink.center.font.marquee.multicol.nobr.spacer.tt`.split(`.`);e.default={id:`tag-no-obsolete`,description:`Disallows the use of obsolete HTML tags.`,init(e,n,r){e.addListener(`tagstart,tagend`,e=>{let r=e.tagName.toLowerCase();t.includes(r)&&n.error(`The tag [ ${e.tagName} ] is obsolete in HTML5 and should not be used.`,e.line,e.col,this,e.raw)})}}})),Yt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=`animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath`.split(`.`);function n(e,t){if(t instanceof RegExp)return t.test(e)?{match:e,pattern:t}:!1;let n=t[0],r=t[t.length-1],i=t[t.length-2],a=n===`/`&&(r===`/`||i===`/`&&r===`i`);return a?a&&r===`i`?new RegExp(t.slice(1,-2),`i`).test(e):new RegExp(t.slice(1,-1)).test(e):e===t}e.default={id:`tagname-lowercase`,description:`All html element names must be in lowercase.`,init(e,r,i){let a=(Array.isArray(i)?i:[]).concat(t);e.addListener(`tagstart,tagend`,e=>{let t=e.tagName;!a.find(e=>n(t,e))&&t!==t.toLowerCase()&&r.error(`The html element name of [ ${t} ] must be in lowercase.`,e.line,e.col,this,e.raw)})}}})),Xt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`tagname-specialchars`,description:`All special characters must be escaped.`,init(e,t){let n=/[^a-zA-Z0-9\-:_]/;e.addListener(`tagstart,tagend`,e=>{let r=e.tagName;n.test(r)&&t.error(`The html element name of [ ${r} ] contains special character.`,e.line,e.col,this,e.raw)})}}})),Zt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`tag-pair`,description:`Tag must be paired.`,init(e,t){let n=[],r=e.makeMap(`area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr`);e.addListener(`tagstart`,e=>{let t=e.tagName.toLowerCase();r[t]===void 0&&!e.close&&n.push({tagName:t,line:e.line,col:e.col,raw:e.raw})}),e.addListener(`tagend`,e=>{let r=e.tagName.toLowerCase(),i;for(i=n.length-1;i>=0&&n[i].tagName!==r;i--);if(i>=0){let r=[];for(let e=n.length-1;e>i;e--)r.push(`</${n[e].tagName}>`);if(r.length>0){let i=n[n.length-1];t.error(`Tag must be paired, missing: [ ${r.join(``)} ], start tag match failed [ ${i.raw} ] on line ${i.line}.`,i.line||e.line,i.col||e.col,this,e.raw)}n.length=i}else t.error(`Tag must be paired, no start tag: [ ${e.raw} ]`,e.line,e.col,this,e.raw)}),e.addListener(`end`,e=>{let r=[];for(let e=n.length-1;e>=0;e--)r.push(`</${n[e].tagName}>`);if(r.length>0){let i=n[n.length-1];t.error(`Tag must be paired, missing: [ ${r.join(``)} ], open tag match failed [ ${i.raw} ] on line ${i.line}.`,e.line,e.col,this,``)}})}}})),Qt=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t={a:{selfclosing:!1,attrsRequired:[`href`,`title`],redundantAttrs:[`alt`]},div:{selfclosing:!1},main:{selfclosing:!1,redundantAttrs:[`role`]},nav:{selfclosing:!1,redundantAttrs:[`role`]},script:{attrsOptional:[[`async`,`async`],[`defer`,`defer`]]},img:{selfclosing:!0,attrsRequired:[`src`,`alt`,`title`]}};e.default={id:`tags-check`,description:`Checks html tags.`,init(e,n,r){t={...t,...r},e.addListener(`tagstart`,e=>{let r=e.attrs,i=e.col+e.tagName.length+1,a=e.tagName.toLowerCase();if(t[a]){let o=t[a];o.selfclosing===!0&&!e.close?n.warn(`The <${a}> tag must be selfclosing.`,e.line,e.col,this,e.raw):o.selfclosing===!1&&e.close&&n.warn(`The <${a}> tag must not be selfclosing.`,e.line,e.col,this,e.raw),Array.isArray(o.attrsRequired)&&o.attrsRequired.forEach(t=>{if(Array.isArray(t)){let o=t.map(e=>e),s=o.shift(),c=o;r.some(e=>e.name===s)?r.forEach(t=>{t.name===s&&c.indexOf(t.value)===-1&&n.error(`The <${a}> tag must have attr '${s}' with one value of '${c.join(`' or '`)}'.`,e.line,i,this,e.raw)}):n.error(`The <${a}> tag must have attr '${s}'.`,e.line,i,this,e.raw)}else r.some(e=>t.split(`|`).indexOf(e.name)!==-1)||n.error(`The <${a}> tag must have attr '${t}'.`,e.line,i,this,e.raw)}),Array.isArray(o.attrsOptional)&&o.attrsOptional.forEach(t=>{if(Array.isArray(t)){let o=t.map(e=>e),s=o.shift(),c=o;r.some(e=>e.name===s)&&r.forEach(t=>{t.name===s&&c.indexOf(t.value)===-1&&n.error(`The <${a}> tag must have optional attr '${s}' with one value of '${c.join(`' or '`)}'.`,e.line,i,this,e.raw)})}}),Array.isArray(o.redundantAttrs)&&o.redundantAttrs.forEach(t=>{r.some(e=>e.name===t)&&n.error(`The attr '${t}' is redundant for <${a}> and should be omitted.`,e.line,i,this,e.raw)})}})}}})),$t=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`tag-self-close`,description:`Empty tags must be self closed.`,init(e,t){let n=e.makeMap(`area,base,basefont,bgsound,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr`);e.addListener(`tagstart`,e=>{let r=e.tagName.toLowerCase();n[r]!==void 0&&(e.close||t.warn(`The empty tag : [ ${r} ] must be self closed.`,e.line,e.col,this,e.raw))})}}})),en=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={id:`title-require`,description:`<title> must be present in <head> tag.`,init(e,t){let n=!1,r=!1,i=e=>{let t=e.tagName.toLowerCase();t===`head`?n=!0:t===`title`&&n&&(r=!0)},a=n=>{let o=n.tagName.toLowerCase();if(r&&o===`title`){let e=n.lastEvent;(e.type!==`text`||e.type===`text`&&/^\s*$/.test(e.raw)===!0)&&t.error(`<title></title> must not be empty.`,n.line,n.col,this,n.raw)}else o===`head`&&(r===!1&&t.error(`<title> must be present in <head> tag.`,n.line,n.col,this,n.raw),e.removeListener(`tagstart`,i),e.removeListener(`tagend`,a))};e.addListener(`tagstart`,i),e.addListener(`tagend`,a)}}})),tn=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.titleRequire=e.tagSelfClose=e.tagsCheck=e.tagPair=e.tagnameSpecialChars=e.tagnameLowercase=e.tagNoObsolete=e.styleDisabled=e.srcNotEmpty=e.specCharEscape=e.spaceTabMixedDisabled=e.scriptDisabled=e.metaViewportRequire=e.metaDescriptionRequire=e.metaCharsetRequire=e.mainRequire=e.linkRelCanonicalRequire=e.inputRequiresLabel=e.inlineStyleDisabled=e.inlineScriptDisabled=e.idUnique=e.idClassValue=e.idClassAdDisabled=e.htmlLangRequire=e.hrefAbsOrRel=e.headScriptDisabled=e.h1Require=e.frameTitleRequire=e.formMethodRequire=e.emptyTagNotSelfClosed=e.doctypeHTML5=e.doctypeFirst=e.buttonTypeRequire=e.attrWhitespace=e.attrValueSingleQuotes=e.attrValueNotEmpty=e.attrValueDoubleQuotes=e.attrUnsafeChars=e.attrSort=e.attrValueNoDuplication=e.attrNoUnnecessaryWhitespace=e.attrNoDuplication=e.attrLowercase=e.altRequire=void 0;var t=dt();Object.defineProperty(e,`altRequire`,{enumerable:!0,get:function(){return t.default}});var n=ft();Object.defineProperty(e,`attrLowercase`,{enumerable:!0,get:function(){return n.default}});var r=pt();Object.defineProperty(e,`attrNoDuplication`,{enumerable:!0,get:function(){return r.default}});var i=mt();Object.defineProperty(e,`attrNoUnnecessaryWhitespace`,{enumerable:!0,get:function(){return i.default}});var a=ht();Object.defineProperty(e,`attrValueNoDuplication`,{enumerable:!0,get:function(){return a.default}});var o=gt();Object.defineProperty(e,`attrSort`,{enumerable:!0,get:function(){return o.default}});var s=_t();Object.defineProperty(e,`attrUnsafeChars`,{enumerable:!0,get:function(){return s.default}});var c=vt();Object.defineProperty(e,`attrValueDoubleQuotes`,{enumerable:!0,get:function(){return c.default}});var l=yt();Object.defineProperty(e,`attrValueNotEmpty`,{enumerable:!0,get:function(){return l.default}});var u=bt();Object.defineProperty(e,`attrValueSingleQuotes`,{enumerable:!0,get:function(){return u.default}});var d=xt();Object.defineProperty(e,`attrWhitespace`,{enumerable:!0,get:function(){return d.default}});var f=St();Object.defineProperty(e,`buttonTypeRequire`,{enumerable:!0,get:function(){return f.default}});var p=Ct();Object.defineProperty(e,`doctypeFirst`,{enumerable:!0,get:function(){return p.default}});var m=wt();Object.defineProperty(e,`doctypeHTML5`,{enumerable:!0,get:function(){return m.default}});var h=Tt();Object.defineProperty(e,`emptyTagNotSelfClosed`,{enumerable:!0,get:function(){return h.default}});var ee=Et();Object.defineProperty(e,`formMethodRequire`,{enumerable:!0,get:function(){return ee.default}});var g=Dt();Object.defineProperty(e,`frameTitleRequire`,{enumerable:!0,get:function(){return g.default}});var _=Ot();Object.defineProperty(e,`h1Require`,{enumerable:!0,get:function(){return _.default}});var v=kt();Object.defineProperty(e,`headScriptDisabled`,{enumerable:!0,get:function(){return v.default}});var y=At();Object.defineProperty(e,`hrefAbsOrRel`,{enumerable:!0,get:function(){return y.default}});var te=jt();Object.defineProperty(e,`htmlLangRequire`,{enumerable:!0,get:function(){return te.default}});var b=Mt();Object.defineProperty(e,`idClassAdDisabled`,{enumerable:!0,get:function(){return b.default}});var x=Nt();Object.defineProperty(e,`idClassValue`,{enumerable:!0,get:function(){return x.default}});var S=Pt();Object.defineProperty(e,`idUnique`,{enumerable:!0,get:function(){return S.default}});var ne=Ft();Object.defineProperty(e,`inlineScriptDisabled`,{enumerable:!0,get:function(){return ne.default}});var C=It();Object.defineProperty(e,`inlineStyleDisabled`,{enumerable:!0,get:function(){return C.default}});var w=Lt();Object.defineProperty(e,`inputRequiresLabel`,{enumerable:!0,get:function(){return w.default}});var T=Rt();Object.defineProperty(e,`linkRelCanonicalRequire`,{enumerable:!0,get:function(){return T.default}});var re=zt();Object.defineProperty(e,`mainRequire`,{enumerable:!0,get:function(){return re.default}});var E=Bt();Object.defineProperty(e,`metaCharsetRequire`,{enumerable:!0,get:function(){return E.default}});var D=Vt();Object.defineProperty(e,`metaDescriptionRequire`,{enumerable:!0,get:function(){return D.default}});var ie=Ht();Object.defineProperty(e,`metaViewportRequire`,{enumerable:!0,get:function(){return ie.default}});var ae=Ut();Object.defineProperty(e,`scriptDisabled`,{enumerable:!0,get:function(){return ae.default}});var O=Wt();Object.defineProperty(e,`spaceTabMixedDisabled`,{enumerable:!0,get:function(){return O.default}});var k=Gt();Object.defineProperty(e,`specCharEscape`,{enumerable:!0,get:function(){return k.default}});var A=Kt();Object.defineProperty(e,`srcNotEmpty`,{enumerable:!0,get:function(){return A.default}});var oe=qt();Object.defineProperty(e,`styleDisabled`,{enumerable:!0,get:function(){return oe.default}});var se=Jt();Object.defineProperty(e,`tagNoObsolete`,{enumerable:!0,get:function(){return se.default}});var ce=Yt();Object.defineProperty(e,`tagnameLowercase`,{enumerable:!0,get:function(){return ce.default}});var le=Xt();Object.defineProperty(e,`tagnameSpecialChars`,{enumerable:!0,get:function(){return le.default}});var ue=Zt();Object.defineProperty(e,`tagPair`,{enumerable:!0,get:function(){return ue.default}});var j=Qt();Object.defineProperty(e,`tagsCheck`,{enumerable:!0,get:function(){return j.default}});var de=$t();Object.defineProperty(e,`tagSelfClose`,{enumerable:!0,get:function(){return de.default}});var fe=en();Object.defineProperty(e,`titleRequire`,{enumerable:!0,get:function(){return fe.default}})})),nn=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HTMLParser=e.Reporter=e.HTMLRules=e.HTMLHint=void 0;var t=lt();e.HTMLParser=t.default;var n=ut();e.Reporter=n.default;var r=tn();e.HTMLRules=r;var i=class{constructor(){this.rules={},this.defaultRuleset={"tagname-lowercase":!0,"attr-lowercase":!0,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0}}addRule(e){this.rules[e.id]=e}verify(e,r=this.defaultRuleset){Object.keys(r).length===0&&(r=this.defaultRuleset),e=e.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i,(e,t)=>(t.replace(/(?:^|,)\s*([^:,]+)\s*(?:\:\s*([^,\s]+))?/g,(e,t,n)=>(r[t]=n!==void 0&&n.length>0?JSON.parse(n):!0,``)),``));let i=this.parseDisableComments(e),a=new t.default,o=new n.default(e,r,i),s=this.rules,c;for(let e in r)c=s[e],c!==void 0&&r[e]!==!1&&c.init(a,o,r[e]);return a.parse(e),o.messages}parseDisableComments(e){let t={},n=e.split(/\r?\n/),r=/<!--\s*htmlhint-(disable|enable)(?:-next-line)?(?:\s+([^\r\n]+?))?\s*-->/gi,i=[],a;for(;(a=r.exec(e))!==null;){let t=e.substring(0,a.index).split(/\r?\n/).length,n=a[1].toLowerCase(),r=a[0].includes(`-next-line`),o=a[2]?.trim();i.push({line:t,command:n,isNextLine:r,rulesStr:o})}let o=null,s=!1;for(let e=0;e<n.length;e++){let n=e+1,r=i.find(e=>e.line===n);if(r)if(r.command===`disable`)if(r.isNextLine){let e=n+1;if(r.rulesStr){let n=r.rulesStr.split(/\s+/).filter(e=>e.length>0);t[e]||(t[e]={}),t[e].rules||(t[e].rules=new Set),n.forEach(n=>t[e].rules.add(n))}else t[e]||(t[e]={}),t[e].all=!0}else if(r.rulesStr){let e=r.rulesStr.split(/\s+/).filter(e=>e.length>0);o=new Set(e),s=!1}else o=null,s=!0;else r.command===`enable`&&(o=null,s=!1);(o!==null||s)&&(t[n]||(t[n]={}),s&&t[n].all!==!0?t[n].all=!0:o&&(t[n].rules||(t[n].rules=new Set),o.forEach(e=>t[n].rules.add(e))))}return t}format(e,t={}){let n=[],r={white:``,grey:``,red:``,reset:``};t.colors&&(r.white=`\x1B[37m`,r.grey=`\x1B[90m`,r.red=`\x1B[31m`,r.reset=`\x1B[39m`);let i=t.indent||0;return e.forEach(e=>{let t=e.evidence,o=e.line,s=e.col,c=t.length,l=s>41?s-40:1,u=t.length>s+60?s+60:c;s<41&&(u+=40-s+1),t=t.replace(/\t/g,` `).substring(l-1,u),l>1&&(t=`...${t}`,l-=3),u<c&&(t+=`...`),n.push(`${r.white+a(i)}L${o} |${r.grey}${t}${r.reset}`);let d=s-l,f=t.substring(0,d).match(/[^\u0000-\u00ff]/g);f!==null&&(d+=f.length),n.push(`${r.white+a(i)+a(String(o).length+3+d)}^ ${r.red}${e.message} (${e.rule.id})${r.reset}`)}),n}};function a(e,t){return Array(e+1).join(t||` `)}e.HTMLHint=new i,Object.values(r).forEach(t=>{e.HTMLHint.addRule(t)})})),rn=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.capitalize=void 0,e.capitalize=e=>{let t=e.split(` `);for(var n=0;n<t.length;n++)t[n]=t[n].charAt(0).toUpperCase()+t[n].slice(1);return t.join(` `)}})),an=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HTMLMonacoMarks=void 0;var t=nn(),n=rn(),r={"tagname-lowercase":!0,"attr-lowercase":!0,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0};e.HTMLMonacoMarks=class{constructor(e,t=r,n){this.html=e,this.ruleset=t,this.linterResponse=this.lint(),this.model=n}lint(){return t.HTMLHint.verify(this.html,this.ruleset)}getEditorMarks(e){return this.linterResponse.map(t=>({startLineNumber:t.line,startColumn:t.col,endLineNumber:t.line,endColumn:t.evidence===``?this.model===void 0?t.col+1:this.model.getLineLength(t.line):t.col+t.evidence.length,message:t.message,severity:e.MarkerSeverity[(0,n.capitalize)(t.type)]}))}getLinterResponse(){return this.linterResponse}}})),on=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HTMLMonacoLinter=void 0;var t=an();e.HTMLMonacoLinter=class{constructor(e,t,n){this.editor=e,this.monaco=t,this.ruleset=n}lint(){let e=this.editor.getValue();if(this.editor.getModel()?.getLanguageId()===`html`){let n=new t.HTMLMonacoMarks(e,this.ruleset,this.editor.getModel()||void 0).getEditorMarks(this.monaco),r=this.editor.getModel();if(r===null)throw Error(`Your model still does't exist.`);this.monaco.editor.setModelMarkers(r,`owner`,n)}}watch(){this.lint(),this.editor.onDidChangeModelContent(e=>{this.lint()})}}})),sn=r.a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=e.HTMLMonacoMarks=void 0;var t=an();Object.defineProperty(e,`HTMLMonacoMarks`,{enumerable:!0,get:function(){return t.HTMLMonacoMarks}});var n=on();Object.defineProperty(e,`default`,{enumerable:!0,get:function(){return n.HTMLMonacoLinter}})})),cn=r.u(sn());function ln(e,t){let n=s.qi.getEditorContributions().find(t=>t.id===e);if(!n)throw Error(`No contribution ${e}`);n.ctor=t(n)}var un=100,dn=500,fn=!1;function pn(e){return class extends e{_editor;constructor(e,t,n,r){super(e,t,n,r),this._editor=e}_onScrollDisposable=null;updateColorDecorators(e){if(this._onScrollDisposable&&=(this._onScrollDisposable.dispose(),null),e.length>=dn){let t=this._editor,[n,r]=[Number.MAX_VALUE,Number.MIN_VALUE],i=()=>{let[i,a]=t.getVisibleRanges().reduce((e,{startLineNumber:t,endLineNumber:n})=>[Math.min(t,e[0]),Math.max(n,e[1])],[Number.MAX_VALUE,Number.MIN_VALUE]);if(n-i>un||a-r>un){let t=e.filter(({colorInfo:e})=>{let{startLineNumber:t,endLineNumber:n}=e.range;return i-t<un&&n-a<un});super.updateColorDecorators(t)}};this._onScrollDisposable=t.onDidScrollChange(i),i()}else super.updateColorDecorators(e)}dispose(){this._onScrollDisposable?.dispose(),super.dispose()}}}function mn(){fn||(fn=!0,Promise.resolve().then(()=>e(`./f80dab8a.js`)).then(({ColorDetector:e})=>{let t=pn(e);t.ID=e.ID,ln(t.ID,()=>t)}).catch(e=>{}))}function hn(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function gn(e){return e>47&&e<58}function _n(e,t,n){return t||=65,n||=90,e&=-33,e>=t&&e<=n}function vn(e){return gn(e)||yn(e)}function yn(e){return e===95||_n(e)}function bn(e){return e===32||e===9||e===160}function xn(e){return bn(e)||e===10||e===13}function Sn(e){return e===39||e===34}var Cn=class e{constructor(e,t,n){n==null&&typeof e==`string`&&(n=e.length),this.string=e,this.pos=this.start=t||0,this.end=n||0}eof(){return this.pos>=this.end}limit(t,n){return new e(this.string,t,n)}peek(){return this.string.charCodeAt(this.pos)}next(){if(this.pos<this.string.length)return this.string.charCodeAt(this.pos++)}eat(e){let t=this.peek(),n=typeof e==`function`?e(t):t===e;return n&&this.next(),n}eatWhile(e){let t=this.pos;for(;!this.eof()&&this.eat(e););return this.pos!==t}backUp(e){this.pos-=e||1}current(){return this.substring(this.start,this.pos)}substring(e,t){return this.string.slice(e,t)}error(e,t=this.pos){return new wn(`${e} at ${t+1}`,t,this.string)}},wn=class extends Error{constructor(e,t,n){super(e),this.pos=t,this.string=n}};function Tn(e){return{tokens:e,start:0,pos:0,size:e.length}}function En(e){return e.tokens[e.pos]}function Dn(e){return e.tokens[e.pos++]}function On(e,t=e.start,n=e.pos){return e.tokens.slice(t,n)}function kn(e){return e.pos<e.size}function M(e,t){let n=En(e);return n&&t(n)?(e.pos++,!0):!1}function An(e,t,n=En(e)){n&&n.start!=null&&(t+=` at ${n.start}`);let r=Error(t);return r.pos=n&&n.start,r}function jn(e,t={}){let n=Tn(e),r=Mn(n,t);if(kn(n))throw An(n,`Unexpected character`);return r}function Mn(e,t){let n={type:`TokenGroup`,elements:[]},r=n,i,a=[];for(;kn(e)&&(i=Pn(e,t)||Nn(e,t));)if(r.elements.push(i),M(e,or))a.push(r),r=i;else if(M(e,sr))continue;else if(M(e,cr))do a.length&&(r=a.pop());while(M(e,cr));return n}function Nn(e,t){if(M(e,rr)){let n=Mn(e,t);return Wn(Dn(e),`group`,!1)&&(n.repeat=Rn(e)),n}}function Pn(e,t){let n,r={type:`TokenElement`,name:void 0,attributes:void 0,value:void 0,repeat:void 0,selfClose:!1,elements:[]};for(Vn(e,t)&&(r.name=On(e));kn(e);)if(e.start=e.pos,!r.repeat&&!ar(r)&&M(e,Yn))r.repeat=e.tokens[e.pos-1];else if(!r.value&&Hn(e))r.value=Un(e);else if(n=In(e,`id`,t)||In(e,`class`,t)||Fn(e))r.attributes?r.attributes=r.attributes.concat(n):r.attributes=Array.isArray(n)?n.slice():[n];else{!ar(r)&&M(e,lr)&&(r.selfClose=!0,!r.repeat&&M(e,Yn)&&(r.repeat=e.tokens[e.pos-1]));break}return ar(r)?void 0:r}function Fn(e){if(M(e,er)){let t=[],n;for(;kn(e);)if(n=Ln(e))t.push(n);else if(M(e,tr))break;else if(!M(e,qn))throw An(e,`Unexpected "${En(e).type}" token`);return t}}function In(e,t,n){if(Gn(En(e),t)){e.pos++;let r={name:[ir(t)]};return n.jsx&&Hn(e)?(r.value=Un(e),r.expression=!0):r.value=Bn(e)?On(e):void 0,r}}function Ln(e){if(zn(e))return{value:On(e)};if(Bn(e,!0))return{name:On(e),value:M(e,Jn)&&(zn(e)||Bn(e,!0))?On(e):void 0}}function Rn(e){return Yn(En(e))?e.tokens[e.pos++]:void 0}function zn(e){let t=e.pos,n=En(e);if(Kn(n)){for(e.pos++;kn(e);)if(Kn(Dn(e),n.single))return e.start=t,!0;throw An(e,`Unclosed quote`,n)}return!1}function Bn(e,t){let n=e.pos,r={attribute:0,expression:0,group:0};for(;kn(e);){let n=En(e);if(r.expression)Wn(n,`expression`)&&(r[n.context]+=n.open?1:-1);else if(Kn(n)||Gn(n)||qn(n)||Yn(n))break;else if(Wn(n)){if(!t)break;if(n.open)r[n.context]++;else if(r[n.context])r[n.context]--;else break}e.pos++}return n===e.pos?!1:(e.start=n,!0)}function Vn(e,t){let n=e.pos;if(t.jsx&&M(e,Zn))for(;kn(e);){let{pos:t}=e;if(!M(e,$n)||!M(e,Zn)){e.pos=t;break}}for(;kn(e)&&M(e,Qn););return e.pos===n?!1:(e.start=n,!0)}function Hn(e){let t=e.pos;if(M(e,nr)){let n=0;for(;kn(e);){let t=Dn(e);if(Wn(t,`expression`))if(t.open)n++;else if(n)n--;else break}return e.start=t,!0}return!1}function Un(e){let t=e.start,n=e.pos;return Wn(e.tokens[t],`expression`,!0)&&t++,Wn(e.tokens[n-1],`expression`,!1)&&n--,On(e,t,n)}function Wn(e,t,n){return!!(e&&e.type===`Bracket`&&(!t||e.context===t)&&(n==null||e.open===n))}function Gn(e,t){return!!(e&&e.type===`Operator`&&(!t||e.operator===t))}function Kn(e,t){return!!(e&&e.type===`Quote`&&(t==null||e.single===t))}function qn(e){return!!(e&&e.type===`WhiteSpace`)}function Jn(e){return Gn(e,`equal`)}function Yn(e){return!!(e&&e.type===`Repeater`)}function Xn(e){return e.type===`Literal`}function Zn(e){if(Xn(e)){let t=e.value.charCodeAt(0);return t>=65&&t<=90}return!1}function Qn(e){return e.type===`Literal`||e.type===`RepeaterNumber`||e.type===`RepeaterPlaceholder`}function $n(e){return Gn(e,`class`)}function er(e){return Wn(e,`attribute`,!0)}function tr(e){return Wn(e,`attribute`,!1)}function nr(e){return Wn(e,`expression`,!0)}function rr(e){return Wn(e,`group`,!0)}function ir(e){return{type:`Literal`,value:e}}function ar(e){return!e.name&&!e.value&&!e.attributes}function or(e){return Gn(e,`child`)}function sr(e){return Gn(e,`sibling`)}function cr(e){return Gn(e,`climb`)}function lr(e){return Gn(e,`close`)}function ur(e){return e.eat(92)?(e.start=e.pos,e.eof()||e.pos++,!0):!1}function dr(e){let t=new Cn(e),n=[],r={group:0,attribute:0,expression:0,quote:0},i=0,a;for(;!t.eof();)if(i=t.peek(),a=fr(t,r),a)n.push(a),a.type===`Quote`?r.quote=i===r.quote?0:i:a.type===`Bracket`&&(r[a.context]+=a.open?1:-1);else throw t.error(`Unexpected character`);return n}function fr(e,t){return xr(e,t)||yr(e)||br(e)||vr(e)||mr(e)||pr(e,t)||_r(e)||hr(e)||gr(e)}function pr(e,t){let n=e.pos,r=``;for(;!e.eof();){if(ur(e)){r+=e.current();continue}let n=e.peek();if(n===t.quote||n===36||Cr(n,t)||t.expression&&n===125||!t.quote&&!t.expression&&(!t.attribute&&!kr(n)||wr(n,t)||Tr(n,t)||Sn(n)||Er(n)))break;r+=e.string[e.pos++]}if(n!==e.pos)return e.start=n,{type:`Literal`,value:r,start:n,end:e.pos}}function mr(e){let t=e.pos;if(e.eatWhile(xn))return{type:`WhiteSpace`,start:t,end:e.pos,value:e.substring(t,e.pos)}}function hr(e){let t=e.peek();if(Sn(t))return{type:`Quote`,single:t===39,start:e.pos++,end:e.pos}}function gr(e){let t=e.peek(),n=Er(t);if(n)return{type:`Bracket`,open:Or(t),context:n,start:e.pos++,end:e.pos}}function _r(e){let t=Dr(e.peek());if(t)return{type:`Operator`,operator:t,start:e.pos++,end:e.pos}}function vr(e){let t=e.pos;if(e.eat(42)){e.start=e.pos;let n=1,r=!1;return e.eatWhile(gn)?n=Number(e.current()):r=!0,{type:`Repeater`,count:n,value:0,implicit:r,start:t,end:e.pos}}}function yr(e){let t=e.pos;if(e.eat(36)&&e.eat(35))return{type:`RepeaterPlaceholder`,value:void 0,start:t,end:e.pos};e.pos=t}function br(e){let t=e.pos;if(e.eatWhile(36)){let n=e.pos-t,r=!1,i=1,a=0;if(e.eat(64)){for(;e.eat(94);)a++;r=e.eat(45),e.start=e.pos,e.eatWhile(gn)&&(i=Number(e.current()))}return e.start=t,{type:`RepeaterNumber`,size:n,reverse:r,base:i,parent:a,start:t,end:e.pos}}}function xr(e,t){let n=e.pos;if((t.expression||t.attribute)&&e.eat(36)&&e.eat(123)){e.start=e.pos;let t,r=``;if(e.eatWhile(gn)?(t=Number(e.current()),r=e.eat(58)?Sr(e):``):_n(e.peek())&&(r=Sr(e)),e.eat(125))return{type:`Field`,index:t,name:r,start:n,end:e.pos};throw e.error(`Expecting }`)}e.pos=n}function Sr(e){let t=[];for(e.start=e.pos;!e.eof();)if(e.eat(123))t.push(e.pos);else if(e.eat(125)){if(!t.length){e.pos--;break}t.pop()}else e.pos++;if(t.length)throw e.pos=t.pop(),e.error(`Expecting }`);return e.current()}function Cr(e,t){let n=Dr(e);return!n||t.quote||t.expression?!1:!t.attribute||n===`equal`}function wr(e,t){return xn(e)&&!t.expression}function Tr(e,t){return e===42&&!t.attribute&&!t.expression}function Er(e){if(e===40||e===41)return`group`;if(e===91||e===93)return`attribute`;if(e===123||e===125)return`expression`}function Dr(e){return e===62&&`child`||e===43&&`sibling`||e===94&&`climb`||e===46&&`class`||e===35&&`id`||e===47&&`close`||e===61&&`equal`||void 0}function Or(e){return e===123||e===91||e===40}function kr(e){return vn(e)||e===45||e===58||e===33}var Ar={child:`>`,class:`.`,climb:`^`,id:`#`,equal:`=`,close:`/`,sibling:`+`},jr={Literal(e){return e.value},Quote(e){return e.single?`'`:`"`},Bracket(e){return e.context===`attribute`?e.open?`[`:`]`:e.context===`expression`?e.open?`{`:`}`:e.open?`(`:`}`},Operator(e){return Ar[e.operator]},Field(e,t){return e.index==null?e.name?t.getVariable(e.name):``:e.name?`\${${e.index}:${e.name}}`:`\${${e.index}`},RepeaterPlaceholder(e,t){let n;for(let e=t.repeaters.length-1;e>=0;e--)if(t.repeaters[e].implicit){n=t.repeaters[e];break}return t.inserted=!0,t.getText(n&&n.value)},RepeaterNumber(e,t){let n=1,r=t.repeaters.length-1,i=t.repeaters[r];if(i&&(n=e.reverse?e.base+i.count-i.value-1:e.base+i.value,e.parent)){let a=Math.max(0,r-e.parent);if(a!==r){let e=t.repeaters[a];n+=i.count*e.value}}let a=String(n);for(;a.length<e.size;)a=`0`+a;return a},WhiteSpace(e){return e.value}};function Mr(e,t){if(!jr[e.type])throw Error(`Unknown token ${e.type}`);return jr[e.type](e,t)}var Nr=/^((https?:|ftp:|file:)?\/\/|(www|ftp)\.)[^ ]*$/,Pr=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,5}$/;function Fr(e,t={}){let n=!1,r;t.text&&(r=Array.isArray(t.text)?t.text.filter(e=>e.trim()):t.text);let i={type:`Abbreviation`,children:Rr(e,{inserted:!1,repeaters:[],text:t.text,cleanText:r,repeatGuard:t.maxRepeat||1/0,getText(e){n=!0;let i;if(Array.isArray(t.text)){if(e!==void 0&&e>=0&&e<r.length)return r[e];i=e===void 0?t.text.join(`
12
+ `):t.text[e]}else i=t.text??``;return i},getVariable(e){return(t.variables&&t.variables[e])??e}})};if(t.text!=null&&!n){let e=Gr(Wr(i.children));if(e){let n=Array.isArray(t.text)?t.text.join(`
13
+ `):t.text;Kr(e,n),e.name===`a`&&t.href&&qr(e,n)}}return i}function Ir(e,t){let n=[];if(e.repeat){let r=e.repeat,i=Object.assign({},r);i.count=i.implicit&&Array.isArray(t.text)?t.cleanText.length:i.count||1;let a;t.repeaters.push(i);for(let r=0;r<i.count;r++){if(i.value=r,e.repeat=i,a=Hr(e)?Rr(e,t):Lr(e,t),i.implicit&&!t.inserted){let e=Wr(a),n=e&&Gr(e);n&&Kr(n,t.getText(i.value))}if(n=n.concat(a),--t.repeatGuard<=0)break}t.repeaters.pop(),e.repeat=r,i.implicit&&(t.inserted=!0)}else n=n.concat(Hr(e)?Rr(e,t):Lr(e,t));return n}function Lr(e,t){let n=[],r={type:`AbbreviationNode`,name:e.name&&Br(e.name,t),value:e.value&&Vr(e.value,t),attributes:void 0,children:n,repeat:e.repeat&&Object.assign({},e.repeat),selfClosing:e.selfClose},i=[r];for(let r of e.elements)n=n.concat(Ir(r,t));if(e.attributes){r.attributes=[];for(let n of e.attributes)r.attributes.push(zr(n,t))}return!r.name&&!r.attributes&&r.value&&!r.value.some(Ur)?i=i.concat(n):r.children=n,i}function Rr(e,t){let n=[];for(let r of e.elements)n=n.concat(Ir(r,t));return e.repeat&&(n=Jr(n,e.repeat)),n}function zr(e,t){let n=!1,r=!1,i=e.expression?`expression`:`raw`,a,o=e.name&&Br(e.name,t);if(o&&o[0]===`!`&&(n=!0),o&&o[o.length-1]===`.`&&(r=!0),e.value){let n=e.value.slice();if(Kn(n[0])){let e=n.shift();n.length&&Wr(n).type===e.type&&n.pop(),i=e.single?`singleQuote`:`doubleQuote`}else Wn(n[0],`expression`,!0)&&(i=`expression`,n.shift(),Wn(Wr(n),`expression`,!1)&&n.pop());a=Vr(n,t)}return{name:r||n?o.slice(+!!n,r?-1:void 0):o,value:a,boolean:r,implied:n,valueType:i}}function Br(e,t){let n=``;for(let r=0;r<e.length;r++)n+=Mr(e[r],t);return n}function Vr(e,t){let n=[],r=``;for(let i=0,a;i<e.length;i++)a=e[i],Ur(a)?(r&&=(n.push(r),``),n.push(a)):r+=Mr(a,t);return r&&n.push(r),n}function Hr(e){return e.type===`TokenGroup`}function Ur(e){return typeof e==`object`&&e.type===`Field`&&e.index!=null}function Wr(e){return e[e.length-1]}function Gr(e){return e.children.length?Gr(Wr(e.children)):e}function Kr(e,t){e.value?typeof Wr(e.value)==`string`?e.value[e.value.length-1]+=t:e.value.push(t):e.value=[t]}function qr(e,t){let n=``;Nr.test(t)?(n=t,!/\w+:/.test(n)&&!n.startsWith(`//`)&&(n=`http://${n}`)):Pr.test(t)&&(n=`mailto:${t}`);let r=e.attributes?.find(e=>e.name===`href`);r?r.value||=[n]:(e.attributes||=[],e.attributes.push({name:`href`,value:[n],valueType:`doubleQuote`}))}function Jr(e,t){for(let n of e)n.repeat||=Object.assign({},t);return e}function Yr(e,t){try{return Fr(jn(typeof e==`string`?dr(e):e,t),t)}catch(t){throw t instanceof wn&&typeof e==`string`&&(t.message+=`\n${e}\n${`-`.repeat(t.pos)}^`),t}}function Xr(e,t){let n=0,r,i=new Cn(e),a=[];for(;!i.eof();){if(r=Zr(i,n===0&&!t),!r)throw i.error(`Unexpected character`);if(r.type===`Bracket`&&(!n&&r.open&&vi(i,a),n+=r.open?1:-1,n<0))throw i.error(`Unexpected bracket`,r.start);a.push(r),_i(r)&&(r=ci(i))&&a.push(r)}return a}function Zr(e,t){return Qr(e)||ni(e)||ii(e)||ri(e)||si(e)||ci(e)||oi(e)||ei(e,t)}function Qr(e){let t=e.pos;if(e.eat(36)&&e.eat(123)){e.start=e.pos;let n,r=``;if(e.eatWhile(gn)?(n=Number(e.current()),r=e.eat(58)?$r(e):``):_n(e.peek())&&(r=$r(e)),e.eat(125))return{type:`Field`,index:n,name:r,start:t,end:e.pos};throw e.error(`Expecting }`)}e.pos=t}function $r(e){let t=[];for(e.start=e.pos;!e.eof();)if(e.eat(123))t.push(e.pos);else if(e.eat(125)){if(!t.length){e.pos--;break}t.pop()}else e.pos++;if(t.length)throw e.pos=t.pop(),e.error(`Expecting }`);return e.current()}function ei(e,t){let n=e.pos;if(e.eat(ui)?e.eatWhile(n?pi:hi):e.eat(yn)?e.eatWhile(t?hi:pi):(e.eat(46),e.eatWhile(hi)),n!==e.pos)return e.start=n,ti(e,e.start=n)}function ti(e,t=e.start,n=e.pos){return{type:`Literal`,value:e.substring(t,n),start:t,end:n}}function ni(e){let t=e.pos;if(li(e)){e.start=t;let n=e.current();return e.start=e.pos,e.eat(37)||e.eatWhile(yn),{type:`NumberValue`,value:Number(n),rawValue:n,unit:e.current(),start:t,end:e.pos}}}function ri(e){let t=e.peek(),n=e.pos,r=!1;if(Sn(t)){for(e.pos++;!e.eof();)if(e.eat(t)){r=!0;break}else e.pos++;return e.start=n,{type:`StringValue`,value:e.substring(n+1,e.pos-+!!r),quote:t===39?`single`:`double`,start:n,end:e.pos}}}function ii(e){let t=e.pos;if(e.eat(35)){let n=e.pos,r=``,i=``;if(e.eatWhile(fi)?(r=e.substring(n,e.pos),i=ai(e)):e.eat(116)?(r=`0`,i=ai(e)||`0`):i=ai(e),r||i||e.eof()){let{r:n,g:a,b:o,a:s}=gi(r,i);return{type:`ColorValue`,r:n,g:a,b:o,a:s,raw:e.substring(t+1,e.pos),start:t,end:e.pos}}else return ti(e,t)}e.pos=t}function ai(e){let t=e.pos;return e.eat(46)?(e.start=t,e.eatWhile(gn)?e.current():`1`):``}function oi(e){let t=e.pos;if(e.eatWhile(xn))return{type:`WhiteSpace`,start:t,end:e.pos}}function si(e){let t=e.peek();if(mi(t))return{type:`Bracket`,open:t===40,start:e.pos++,end:e.pos}}function ci(e){let t=di(e.peek());if(t)return{type:`Operator`,operator:t,start:e.pos++,end:e.pos}}function li(e){let t=e.pos;e.eat(45);let n=e.pos,r=e.eatWhile(gn),i=e.pos;if(e.eat(46)){let t=e.eatWhile(gn);!r&&!t&&(e.pos=i)}return e.pos===n&&(e.pos=t),e.pos!==t}function ui(e){return e===64||e===36}function di(e){return e===43&&`+`||e===33&&`!`||e===44&&`,`||e===58&&`:`||e===45&&`-`||void 0}function fi(e){return gn(e)||_n(e,65,70)}function pi(e){return vn(e)||e===45}function mi(e){return e===40||e===41}function hi(e){return yn(e)||e===37||e===47}function gi(e,t){let n=`0`,r=`0`,i=`0`,a=Number(t!=null&&t!==``?t:1);if(e===`t`)a=0;else switch(e.length){case 0:break;case 1:n=r=i=e+e;break;case 2:n=r=i=e;break;case 3:n=e[0]+e[0],r=e[1]+e[1],i=e[2]+e[2];break;default:e+=e,n=e.slice(0,2),r=e.slice(2,4),i=e.slice(4,6)}return{r:parseInt(n,16),g:parseInt(r,16),b:parseInt(i,16),a}}function _i(e){return e.type===`ColorValue`||e.type===`NumberValue`&&!e.unit}function vi(e,t){let n=0,r=0;for(;t.length;){let e=yi(t);if(e.type===`Literal`||e.type===`NumberValue`)n=e.start,r||=e.end,t.pop();else break}n!==r&&t.push(ti(e,n,r))}function yi(e){return e[e.length-1]}function bi(e){return{tokens:e,start:0,pos:0,size:e.length}}function xi(e){return e.tokens[e.pos]}function Si(e){return e.pos<e.size}function Ci(e,t){return t(xi(e))?(e.pos++,!0):!1}function wi(e,t,n=xi(e)){n&&n.start!=null&&(t+=` at ${n.start}`);let r=Error(t);return r.pos=n&&n.start,r}function Ti(e,t={}){let n=bi(e),r=[],i;for(;Si(n);)if(i=Ei(n,t))r.push(i);else if(!Ci(n,Fi))throw wi(n,`Unexpected token`);return r}function Ei(e,t){let n,r=!1,i,a=[],o=xi(e),s=!!t.value;for(!s&&ki(o)&&!Vi(e)&&(e.pos++,n=o.value,Ci(e,Bi)),s&&Ci(e,Ni);Si(e);)if(Ci(e,Ri))r=!0;else if(i=Di(e,s))a.push(i);else if(!Ci(e,Li))break;if(n||a.length||r)return{name:n,value:a,important:r}}function Di(e,t){let n=[],r,i;for(;Si(e);)if(r=xi(e),zi(r))e.pos++,ki(r)&&(i=Oi(e))?n.push({type:`FunctionCall`,name:r.value,arguments:i}):n.push(r);else if(Bi(r)||t&&Ni(r))e.pos++;else break;return n.length?{type:`CSSValue`,value:n}:void 0}function Oi(e){let t=e.pos;if(Ci(e,ji)){let n=[],r;for(;Si(e)&&!Ci(e,Mi);)if(r=Di(e,!0))n.push(r);else if(!Ci(e,Ni)&&!Ci(e,Ii))throw wi(e,`Unexpected token`);return e.start=t,n}}function ki(e){return e&&e.type===`Literal`}function Ai(e,t){return e&&e.type===`Bracket`&&(t==null||e.open===t)}function ji(e){return Ai(e,!0)}function Mi(e){return Ai(e,!1)}function Ni(e){return e&&e.type===`WhiteSpace`}function Pi(e,t){return e&&e.type===`Operator`&&(!t||e.operator===t)}function Fi(e){return Pi(e,`+`)}function Ii(e){return Pi(e,`,`)}function Li(e){return Ii(e)}function Ri(e){return Pi(e,`!`)}function zi(e){return e.type===`StringValue`||e.type===`ColorValue`||e.type===`NumberValue`||e.type===`Literal`||e.type===`Field`}function Bi(e){return Pi(e,`:`)||Pi(e,`-`)}function Vi(e){let t=e.tokens[e.pos],n=e.tokens[e.pos+1];return t&&n&&ki(t)&&n.type===`Bracket`}function Hi(e,t){try{return Ti(typeof e==`string`?Xr(e,t&&t.value):e,t)}catch(t){throw t instanceof wn&&typeof e==`string`&&(t.message+=`\n${e}\n${`-`.repeat(t.pos)}^`),t}}function Ui(e,t){if(!e.attributes)return;let n=[],r={};for(let i of e.attributes)if(i.name){let e=i.name;if(e in r){let n=r[e];e===`class`?n.value=Wi(n.value,i.value,` `):Gi(n,i,t)}else n.push(r[e]=Object.assign({},i))}else n.push(i);e.attributes=n}function Wi(e,t,n){if(e&&t){e.length&&n&&Ki(e,n);for(let n of t)Ki(e,n);return e}let r=e||t;return r&&r.slice()}function Gi(e,t,n){return e.name=t.name,n.options[`output.reverseAttributes`]||(e.value=t.value),e.implied||=t.implied,e.boolean||=t.boolean,e.valueType!==`expression`&&(e.valueType=t.valueType),e}function Ki(e,t){let n=e.length-1;typeof e[n]==`string`&&typeof t==`string`?e[n]+=t:e.push(t)}function qi(e,t,n){let r=[e],i=e=>{t(e,r,n),r.push(e),e.children.forEach(i),r.pop()};e.children.forEach(i)}function Ji(e){let t;for(;e.children.length;)t=e,e=e.children[e.children.length-1];return{parent:t,node:e}}function Yi(e){return e.type===`AbbreviationNode`}function Xi(e,t){let n=[],r=t.options[`output.reverseAttributes`],i=e=>{let a=e.name&&t.snippets[e.name];if(!a||n.includes(a))return null;let o=Yr(a,t);n.push(a),Zi(o,i),n.pop();for(let t of o.children){if(e.attributes){let n=t.attributes||[],i=e.attributes||[];t.attributes=r?i.concat(n):n.concat(i)}Qi(e,t)}return o};return Zi(e,i),e}function Zi(e,t,n){let r=[];for(let n of e.children){let e=t(n);if(e){r=r.concat(e.children);let i=Ji(e);Yi(i.node)&&(i.node.children=i.node.children.concat(Zi(n,t)))}else r.push(n),n.children=Zi(n,t)}return e.children=r}function Qi(e,t){e.selfClosing&&(t.selfClosing=!0),e.value!=null&&(t.value=e.value),e.repeat&&(t.repeat=e.repeat)}function $i(e,t=0){return{options:e,value:``,level:t,offset:0,line:0,column:0}}function N(e,t){let n=e.options[`output.text`];ua(e,n(t,e.offset,e.line,e.column))}function P(e,t){let n=la(t);for(let t=0,r=n.length-1;t<=r;t++)N(e,n[t]),t!==r&&ea(e,!0)}function ea(e,t){let n=e.options[`output.baseIndent`],r=e.options[`output.newline`];N(e,r+n),e.line++,e.column=n.length,t&&ta(e,t===!0?e.level:t)}function ta(e,t=e.level){let n=e.options[`output.indent`];N(e,n.repeat(Math.max(t,0)))}function na(e,t,n){let r=e.options[`output.field`];ua(e,r(t,n,e.offset,e.line,e.column))}function ra(e,t){return da(e,t.options[`output.tagCase`])}function ia(e,t){return da(e,t.options[`output.attributeCase`])}function aa(e,t,n){return e.valueType===`expression`?n?`{`:`}`:t.options[`output.attributeQuotes`]===`single`?`'`:`"`}function oa(e,t){return e.boolean||t.options[`output.booleanAttributes`].includes((e.name||``).toLowerCase())}function sa(e){switch(e.options[`output.selfClosingStyle`]){case`xhtml`:return` /`;case`xml`:return`/`;default:return``}}function ca(e,t){return typeof e==`string`?t.options.inlineElements.includes(e.toLowerCase()):e.name?ca(e.name,t):!!(e.value&&!e.attributes)}function la(e){return e.split(/\r\n|\r|\n/g)}function ua(e,t){e.value+=t,e.offset+=t.length,e.column+=t.length}function da(e,t){return t?t===`upper`?e.toUpperCase():e.toLowerCase():e}var fa={p:`span`,ul:`li`,ol:`li`,table:`tr`,tr:`td`,tbody:`tr`,thead:`tr`,tfoot:`tr`,colgroup:`col`,select:`option`,optgroup:`option`,audio:`source`,video:`source`,object:`param`,map:`area`};function pa(e,t,n){!e.name&&e.attributes&&ma(e,t,n)}function ma(e,t,n){let r=ga(t),i=n.context?n.context.name:``,a=ha(r?r.name:i);e.name=fa[a]||(ca(a,n)?`span`:`div`)}function ha(e){return(e||``).toLowerCase()}function ga(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Yi(n))return n}}var _a={ru:{common:[`далеко-далеко`,`за`,`словесными`,`горами`,`в стране`,`гласных`,`и согласных`,`живут`,`рыбные`,`тексты`],words:`вдали.от всех.они.буквенных.домах.на берегу.семантика.большого.языкового.океана.маленький.ручеек.даль.журчит.по всей.обеспечивает.ее.всеми.необходимыми.правилами.эта.парадигматическая.страна.которой.жаренные.предложения.залетают.прямо.рот.даже.всемогущая.пунктуация.не.имеет.власти.над.рыбными.текстами.ведущими.безорфографичный.образ.жизни.однажды.одна.маленькая.строчка.рыбного.текста.имени.lorem.ipsum.решила.выйти.большой.мир.грамматики.великий.оксмокс.предупреждал.о.злых.запятых.диких.знаках.вопроса.коварных.точках.запятой.но.текст.дал.сбить.себя.толку.он.собрал.семь.своих.заглавных.букв.подпоясал.инициал.за.пояс.пустился.дорогу.взобравшись.первую.вершину.курсивных.гор.бросил.последний.взгляд.назад.силуэт.своего.родного.города.буквоград.заголовок.деревни.алфавит.подзаголовок.своего.переулка.грустный.реторический.вопрос.скатился.его.щеке.продолжил.свой.путь.дороге.встретил.рукопись.она.предупредила.моей.все.переписывается.несколько.раз.единственное.что.меня.осталось.это.приставка.возвращайся.ты.лучше.свою.безопасную.страну.послушавшись.рукописи.наш.продолжил.свой.путь.вскоре.ему.повстречался.коварный.составитель.рекламных.текстов.напоивший.языком.речью.заманивший.свое.агентство.которое.использовало.снова.снова.своих.проектах.если.переписали.то.живет.там.до.сих.пор`.split(`.`)},sp:{common:[`mujer`,`uno`,`dolor`,`más`,`de`,`poder`,`mismo`,`si`],words:`ejercicio.preferencia.perspicacia.laboral.paño.suntuoso.molde.namibia.planeador.mirar.demás.oficinista.excepción.odio.consecuencia.casi.auto.chicharra.velo.elixir.ataque.no.odio.temporal.cuórum.dignísimo.facilismo.letra.nihilista.expedición.alma.alveolar.aparte.león.animal.como.paria.belleza.modo.natividad.justo.ataque.séquito.pillo.sed.ex.y.voluminoso.temporalidad.verdades.racional.asunción.incidente.marejada.placenta.amanecer.fuga.previsor.presentación.lejos.necesariamente.sospechoso.adiposidad.quindío.pócima.voluble.débito.sintió.accesorio.falda.sapiencia.volutas.queso.permacultura.laudo.soluciones.entero.pan.litro.tonelada.culpa.libertario.mosca.dictado.reincidente.nascimiento.dolor.escolar.impedimento.mínima.mayores.repugnante.dulce.obcecado.montaña.enigma.total.deletéreo.décima.cábala.fotografía.dolores.molesto.olvido.paciencia.resiliencia.voluntad.molestias.magnífico.distinción.ovni.marejada.cerro.torre.y.abogada.manantial.corporal.agua.crepúsculo.ataque.desierto.laboriosamente.angustia.afortunado.alma.encefalograma.materialidad.cosas.o.renuncia.error.menos.conejo.abadía.analfabeto.remo.fugacidad.oficio.en.almácigo.vos.pan.represión.números.triste.refugiado.trote.inventor.corchea.repelente.magma.recusado.patrón.explícito.paloma.síndrome.inmune.autoinmune.comodidad.ley.vietnamita.demonio.tasmania.repeler.apéndice.arquitecto.columna.yugo.computador.mula.a.propósito.fantasía.alias.rayo.tenedor.deleznable.ventana.cara.anemia.corrupto`.split(`.`)},latin:{common:[`lorem`,`ipsum`,`dolor`,`sit`,`amet`,`consectetur`,`adipisicing`,`elit`],words:`exercitationem.perferendis.perspiciatis.laborum.eveniet.sunt.iure.nam.nobis.eum.cum.officiis.excepturi.odio.consectetur.quasi.aut.quisquam.vel.eligendi.itaque.non.odit.tempore.quaerat.dignissimos.facilis.neque.nihil.expedita.vitae.vero.ipsum.nisi.animi.cumque.pariatur.velit.modi.natus.iusto.eaque.sequi.illo.sed.ex.et.voluptatibus.tempora.veritatis.ratione.assumenda.incidunt.nostrum.placeat.aliquid.fuga.provident.praesentium.rem.necessitatibus.suscipit.adipisci.quidem.possimus.voluptas.debitis.sint.accusantium.unde.sapiente.voluptate.qui.aspernatur.laudantium.soluta.amet.quo.aliquam.saepe.culpa.libero.ipsa.dicta.reiciendis.nesciunt.doloribus.autem.impedit.minima.maiores.repudiandae.ipsam.obcaecati.ullam.enim.totam.delectus.ducimus.quis.voluptates.dolores.molestiae.harum.dolorem.quia.voluptatem.molestias.magni.distinctio.omnis.illum.dolorum.voluptatum.ea.quas.quam.corporis.quae.blanditiis.atque.deserunt.laboriosam.earum.consequuntur.hic.cupiditate.quibusdam.accusamus.ut.rerum.error.minus.eius.ab.ad.nemo.fugit.officia.at.in.id.quos.reprehenderit.numquam.iste.fugiat.sit.inventore.beatae.repellendus.magnam.recusandae.quod.explicabo.doloremque.aperiam.consequatur.asperiores.commodi.optio.dolor.labore.temporibus.repellat.veniam.architecto.est.esse.mollitia.nulla.a.similique.eos.alias.dolore.tenetur.deleniti.porro.facere.maxime.corrupti`.split(`.`)}},va=/^lorem([a-z]*)(\d*)(-\d*)?$/i;function ya(e,t,n){let r;if(e.name&&(r=e.name.match(va))){let i=_a[r[1]]||_a.latin,a=r[2]?Math.max(1,Number(r[2])):30,o=ba(a,r[3]?Math.max(a,Number(r[3].slice(1))):a),s=e.repeat||Da(t);e.name=e.attributes=void 0,e.value=[Ea(i,o,!s||s.value===0)],e.repeat&&t.length>1&&ma(e,t,n)}}function ba(e,t){return Math.floor(Math.random()*(t-e)+e)}function xa(e,t){let n=e.length,r=Math.min(n,t),i=[];for(;i.length<r;){let t=e[ba(0,n)];i.includes(t)||i.push(t)}return i}function Sa(e){return e[ba(0,e.length-1)]}function Ca(e,t){return e.length&&(e=[wa(e[0])].concat(e.slice(1))),e.join(` `)+(t||Sa(`?!...`))}function wa(e){return e[0].toUpperCase()+e.slice(1)}function Ta(e){if(e.length<2)return e;e=e.slice();let t=e.length,n=/,$/,r=0;r=t>3&&t<=6?ba(0,1):t>6&&t<=12?ba(0,2):ba(1,4);for(let i=0,a;i<r;i++)a=ba(0,t-2),n.test(e[a])||(e[a]+=`,`);return e}function Ea(e,t,n){let r=[],i=0,a;for(n&&e.common&&(a=e.common.slice(0,t),i+=a.length,r.push(Ca(Ta(a),`.`)));i<t;)a=xa(e.words,Math.min(ba(2,30),t-i)),i+=a.length,r.push(Ca(Ta(a)));return r.join(` `)}function Da(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`AbbreviationNode`&&n.repeat)return n.repeat}}function Oa(e){e.attributes&&e.attributes.forEach(ka)}function ka(e){e.name===`class`?e.name=`className`:e.name===`for`&&(e.name=`htmlFor`)}function Aa(e){Ma(e.name)&&e.attributes&&(e.children.length||e.value)&&(e.attributes=e.attributes.filter(ja))}function ja(e){return e.name!==`select`}function Ma(e){return e===`xsl:variable`||e===`xsl:with-param`}var Na=/^(-+)([a-z0-9]+[a-z0-9-]*)/i,Pa=/^(_+)([a-z0-9]+[a-z0-9-_]*)/i,Fa=e=>/^[a-z]\-/i.test(e),Ia=e=>/^[a-z]/i.test(e);function La(e,t,n){Ra(e),za(e,t,n)}function Ra(e){let t=Ba(e),n=[];for(let e of t.classNames){let t=e.indexOf(`_`);t>0&&!e.startsWith(`-`)?(n.push(e.slice(0,t)),n.push(e.slice(t))):n.push(e)}n.length&&(t.classNames=n.filter(Ja),t.block=Wa(t.classNames),Ka(e,t.classNames.join(` `)))}function za(e,t,n){let r=Ba(e),i=[],{options:a}=n,o=t.slice(1).concat(e);for(let e of r.classNames){let t=``,r,s=e;(r=e.match(Na))&&(t=Ua(o,r[1].length,n.context)+a[`bem.element`]+r[2],i.push(t),e=e.slice(r[0].length)),(r=e.match(Pa))&&(t||(t=Ua(o,r[1].length),i.push(t)),i.push(`${t}${a[`bem.modifier`]}${r[2]}`),e=e.slice(r[0].length)),e===s&&i.push(s)}let s=i.filter(Ja);s.length&&Ka(e,s.join(` `))}function Ba(e){if(!e._bem){let t=``;if(e.attributes){for(let n of e.attributes)if(n.name===`class`&&n.value){t=qa(n.value);break}}e._bem=Ha(t)}return e._bem}function Va(e){return e._bem||=Ha(e.attributes&&e.attributes.class||``),e._bem}function Ha(e){let t=e?e.split(/\s+/):[];return{classNames:t,block:Wa(t)}}function Ua(e,t=0,n){let r=Math.max(e.length-t,0);do{let t=e[r];if(t){let e=Ba(t);if(e.block)return e.block}}while(0<r--);if(n){let e=Va(n);if(e.block)return e.block}return``}function Wa(e){return Ga(e,Fa)||Ga(e,Ia)||void 0}function Ga(e,t){for(let n of e){if(Na.test(n)||Pa.test(n))break;if(t(n))return n}}function Ka(e,t){for(let n of e.attributes)if(n.name===`class`){n.value=[t];break}}function qa(e){let t=``;for(let n of e)t+=typeof n==`string`?n:n.name;return t}function Ja(e,t,n){return!!e&&n.indexOf(e)===t}function Ya(e,t,n){let r=(e,r,a)=>{let{parent:o,current:s}=n;n.parent=s,n.current=e,t(e,r,a,n,i),n.current=s,n.parent=o},i=(e,t,i)=>{n.ancestors.push(n.current),r(e,t,i),n.ancestors.pop()};e.children.forEach(r)}function Xa(e){return{current:null,parent:void 0,ancestors:[],config:e,field:1,out:$i(e.options)}}var Za=[{type:`Field`,index:0,name:``}];function Qa(e){return e?!e.name&&!e.attributes:!1}function $a(e,t){return e?ca(e,t):!1}function eo(e){return typeof e==`object`&&e.type===`Field`}function to(e,t){let{out:n}=t,r=-1;for(let i of e)typeof i==`string`?P(n,i):(na(n,t.field+i.index,i.name),i.index>r&&(r=i.index));r!==-1&&(t.field+=r+1)}function no(e){let t=[],n=[];for(let r of e)if(typeof r==`string`){let e=r.split(/\r\n?|\n/g);for(n.push(e.shift()||``);e.length;)t.push(n),n=[e.shift()||``]}else n.push(r);return n.length&&t.push(n),t}function ro(e){return!e.implied||e.valueType!==`raw`||!!e.value&&e.value.length>0}function io(e){let t=[],n={pos:0,text:e},r,i=n.pos,a=n.pos;for(;n.pos<n.text.length;)a=n.pos,(r=ao(n))?(i!==n.pos&&t.push(e.slice(i,a)),t.push(r),i=n.pos):n.pos++;return i!==n.pos&&t.push(e.slice(i)),t}function ao(e){if(oo(e)===91){let t=++e.pos,n=t,r=t,i=1;for(;e.pos<e.text.length;){let a=oo(e);if(so(a)){for(n=e.pos;co(oo(e));)e.pos++;r=e.pos}else{if(a===91)i++;else if(a===93&&--i===0)return{before:e.text.slice(t,n),after:e.text.slice(r,e.pos++),name:e.text.slice(n,r)};e.pos++}}}}function oo(e,t=e.pos){return e.text.charCodeAt(t)}function so(e){return e>=65&&e<=90}function co(e){return so(e)||e>47&&e<58||e===95||e===45}function lo(e){let{options:t}=e;return{enabled:t[`comment.enabled`],trigger:t[`comment.trigger`],before:t[`comment.before`]?io(t[`comment.before`]):void 0,after:t[`comment.after`]?io(t[`comment.after`]):void 0}}function uo(e,t){po(e,t)&&t.comment.before&&mo(e,t.comment.before,t)}function fo(e,t){po(e,t)&&t.comment.after&&mo(e,t.comment.after,t)}function po(e,t){let{comment:n}=t;if(!n.enabled||!n.trigger||!e.name||!e.attributes)return!1;for(let t of e.attributes)if(t.name&&n.trigger.includes(t.name))return!0;return!1}function mo(e,t,n){let r={},{out:i}=n;for(let t of e.attributes)t.name&&t.value&&(r[t.name.toUpperCase()]=t.value);for(let e of t)typeof e==`string`?P(i,e):r[e.name]&&(P(i,e.before),to(r[e.name],n),P(i,e.after))}var ho=/^<([\w\-:]+)[\s>]/;function go(e,t){let n=Xa(t);return n.comment=lo(t),Ya(e,_o,n),n.out.value}function _o(e,t,n,r,i){let{out:a,config:o}=r,s=bo(e,t,n,r),c=xo(r);if(a.level+=c,s&&ea(a,!0),e.name){let t=ra(e.name,o);if(uo(e,r),P(a,`<${t}`),e.attributes)for(let t of e.attributes)ro(t)&&vo(t,r);if(e.selfClosing&&!e.children.length&&!e.value)P(a,`${sa(o)}>`);else{if(P(a,`>`),!yo(e,r,i)){if(e.value){let t=e.value.some(So)||Co(e.value,o);t&&ea(r.out,++a.level),to(e.value,r),t&&ea(r.out,--a.level)}if(e.children.forEach(i),!e.value&&!e.children.length){let t=o.options[`output.formatLeafNode`]||o.options[`output.formatForce`].includes(e.name);t&&ea(r.out,++a.level),to(Za,r),t&&ea(r.out,--a.level)}}P(a,`</${t}>`),fo(e,r)}}else !yo(e,r,i)&&e.value&&(to(e.value,r),e.children.forEach(i));if(s&&t===n.length-1&&r.parent){let e=+!Qa(r.parent);ea(a,a.level-e)}a.level-=c}function vo(e,t){let{out:n,config:r}=t;if(e.name){let i=ia(e.name,r),a=aa(e,r,!0),o=aa(e,r),s=e.value;oa(e,r)&&!s?r.options[`output.compactBoolean`]||(s=[i]):s||=Za,P(n,` `+i),s?(P(n,`=`+a),to(s,t),P(n,o)):r.options[`output.selfClosingStyle`]!==`html`&&P(n,`=`+a+o)}}function yo(e,t,n){if(e.value&&e.children.length){let r=e.value.findIndex(eo);if(r!==-1){to(e.value.slice(0,r),t);let i=t.out.line,a=r+1;return e.children.forEach(n),t.out.line!==i&&typeof e.value[a]==`string`&&P(t.out,e.value[a++].trimLeft()),to(e.value.slice(a),t),!0}}return!1}function bo(e,t,n,r){let{config:i,parent:a}=r;if(!i.options[`output.format`]||t===0&&!a||a&&Qa(a)&&n.length===1)return!1;if(Qa(e)&&(Qa(n[t-1])||Qa(n[t+1])||e.value.some(So)||e.value.some(eo)&&e.children.length))return!0;if(ca(e,i)){if(t===0){for(let e=0;e<n.length;e++)if(!ca(n[e],i))return!0}else if(!ca(n[t-1],i))return!0;if(i.options[`output.inlineBreak`]){let e=1,r=t,a=t;for(;$a(n[--r],i);)e++;for(;$a(n[++a],i);)e++;if(e>=i.options[`output.inlineBreak`])return!0}for(let t=0,n=e.children.length;t<n;t++)if(bo(e.children[t],t,e.children,r))return!0;return!1}return!0}function xo(e){let{config:t,parent:n}=e;return!n||Qa(n)||n.name&&t.options[`output.formatSkip`].includes(n.name)?0:1}function So(e){return typeof e==`string`&&/\r|\n/.test(e)}function Co(e,t){if(e.length&&typeof e[0]==`string`){let n=ho.exec(e[0]);if(n?.length&&!t.options.inlineElements.includes(n[1].toLowerCase()))return!0}return!1}function wo(e,t,n){let r=Xa(t);return r.options=n||{},Ya(e,To,r),r.out.value}function To(e,t,n,r,i){let{out:a,options:o}=r,{primary:s,secondary:c}=Eo(e),l=+!!r.parent;a.level+=l,Mo(e,t,n,r)&&ea(a,!0),e.name&&(e.name!==`div`||!s.length)&&P(a,(o.beforeName||``)+e.name+(o.afterName||``)),Do(s,r),Oo(c.filter(ro),r),e.selfClosing&&!e.value&&!e.children.length?r.options.selfClose&&P(a,r.options.selfClose):(ko(e,r),e.children.forEach(i)),a.level-=l}function Eo(e){let t=[],n=[];if(e.attributes)for(let r of e.attributes)Ao(r)?t.push(r):n.push(r);return{primary:t,secondary:n}}function Do(e,t){for(let n of e)n.value&&(n.name===`class`?(P(t.out,`.`),to(n.value.map(e=>typeof e==`string`?e.replace(/\s+/g,`.`):e),t)):(P(t.out,`#`),to(n.value,t)))}function Oo(e,t){if(e.length){let{out:n,config:r,options:i}=t;i.beforeAttribute&&P(n,i.beforeAttribute);for(let a=0;a<e.length;a++){let o=e[a];P(n,ia(o.name||``,r)),oa(o,r)&&!o.value?!r.options[`output.compactBoolean`]&&i.booleanValue&&P(n,`=`+i.booleanValue):(P(n,`=`+aa(o,r,!0)),to(o.value||Za,t),P(n,aa(o,r))),a!==e.length-1&&i.glueAttribute&&P(n,i.glueAttribute)}i.afterAttribute&&P(n,i.afterAttribute)}}function ko(e,t){if(!e.value&&e.children.length)return;let n=e.value||Za,r=no(n),{out:i,options:a}=t;if(r.length===1)(e.name||e.attributes)&&N(i,` `),to(n,t);else{let e=[],n=0;for(let t of r){let r=jo(t);e.push(r),r>n&&(n=r)}i.level++;for(let o=0;o<r.length;o++)ea(i,!0),a.beforeTextLine&&N(i,a.beforeTextLine),to(r[o],t),a.afterTextLine&&(N(i,` `.repeat(n-e[o])),N(i,a.afterTextLine));i.level--}}function Ao(e){return e.name===`class`||e.name===`id`}function jo(e){let t=0;for(let n of e)t+=typeof n==`string`?n.length:n.name.length;return t}function Mo(e,t,n,r){return!r.parent&&t===0?!1:!Qa(e)}function No(e,t){return wo(e,t,{beforeName:`%`,beforeAttribute:`(`,afterAttribute:`)`,glueAttribute:` `,afterTextLine:` |`,booleanValue:`true`,selfClose:`/`})}function Po(e,t){return wo(e,t,{beforeAttribute:` `,glueAttribute:` `,beforeTextLine:`| `,selfClose:`/`})}function Fo(e,t){return wo(e,t,{beforeAttribute:`(`,afterAttribute:`)`,glueAttribute:`, `,beforeTextLine:`| `,selfClose:t.options[`output.selfClosingStyle`]===`xml`?`/`:``})}var Io={html:go,haml:No,slim:Po,pug:Fo};function Lo(e,t){let n;if(typeof e==`string`){let r=t;t.options[`jsx.enabled`]&&(r=Object.assign(Object.assign({},r),{jsx:!0})),t.options[`markup.href`]&&(r=Object.assign(Object.assign({},r),{href:!0})),e=Yr(e,r),n=t.text,t.text=void 0}return e=Xi(e,t),qi(e,zo,t),t.text=n??t.text,e}function Ro(e,t){return(Io[t.syntax]||go)(e,t)}function zo(e,t,n){pa(e,t,n),Ui(e,n),ya(e,t,n),n.syntax===`xsl`&&Aa(e),n.options[`jsx.enabled`]&&Oa(e),n.options[`bem.enabled`]&&La(e,t,n)}var Bo=/^([a-z-]+)(?:\s*:\s*([^\n\r;]+?);*)?$/,Vo={value:!0};function Ho(e,t){let n=t.match(Bo);if(n){let t={},r=n[2]?n[2].split(`|`).map(Go):[];for(let e of r)for(let n of e)qo(n,t);return{type:`Property`,key:e,property:n[1],value:r,keywords:t,dependencies:[]}}return{type:`Raw`,key:e,value:t}}function Uo(e){e=e.slice().sort(Wo);let t=[],n;for(let r of e.filter(Ko)){for(;t.length;){if(n=t[t.length-1],r.property.startsWith(n.property)&&r.property.charCodeAt(n.property.length)===45){n.dependencies.push(r),t.push(r);break}t.pop()}t.length||t.push(r)}return e}function Wo(e,t){return e.key===t.key?0:e.key<t.key?-1:1}function Go(e){return Hi(e.trim(),Vo)[0].value}function Ko(e){return e.type===`Property`}function qo(e,t){for(let n of e.value)if(n.type===`Literal`)t[n.value]=n;else if(n.type===`FunctionCall`)t[n.name]=n;else if(n.type===`Field`){let e=n.name.trim();e&&(t[e]={type:`Literal`,value:e})}}function Jo(e,t,n=!1){if(e=e.toLowerCase(),t=t.toLowerCase(),e===t)return 1;if(!e||!t||e.charCodeAt(0)!==t.charCodeAt(0))return 0;let r=e.length,i=t.length;if(!n&&r>i)return 0;let a=Math.min(r,i),o=Math.max(r,i),s=1,c=1,l=o,u=0,d=0,f=!1,p=!1;for(;s<r;){for(u=e.charCodeAt(s),f=!1,p=!1;c<i;){if(d=t.charCodeAt(c),u===d){f=!0,l+=o-(p?s:c);break}p=d===45,c++}if(!f){if(!n)return 0;break}s++}let m=s/o,h=o-a,ee=Yo(o)-Yo(h);return l*m/ee}function Yo(e){return e*(e+1)/2}function Xo(e,t){return!e.r&&!e.g&&!e.b&&!e.a?`transparent`:e.a===1?Zo(e,t):Qo(e)}function Zo(e,t){let n=t&&es(e.r)&&es(e.g)&&es(e.b)?ts:ns;return`#`+n(e.r)+n(e.g)+n(e.b)}function Qo(e){let t=[e.r,e.g,e.b];return e.a!==1&&t.push($o(e.a,8)),`${t.length===3?`rgb`:`rgba`}(${t.join(`, `)})`}function $o(e,t=4){return e.toFixed(t).replace(/\.?0+$/,``)}function es(e){return!(e%17)}function ts(e){return(e>>4).toString(16)}function ns(e){return rs(e.toString(16),2)}function rs(e,t){for(;e.length<t;)e=`0`+e;return e}function is(e,t){let n=$i(t.options),r=t.options[`output.format`];t.context?.name===`@@section`&&(e=e.filter(e=>e.snippet));for(let i=0;i<e.length;i++)r&&i!==0&&ea(n,!0),as(e[i],n,t);return n.value}function as(e,t,n){let r=n.options[`stylesheet.json`];if(e.name)P(t,(r?ds(e.name):e.name)+n.options[`stylesheet.between`]),e.value.length?os(e,t,n):na(t,0,``),r?N(t,`,`):(ss(e,t,!0),N(t,n.options[`stylesheet.after`]));else{for(let r of e.value)for(let e of r.value)ls(e,t,n);ss(e,t,e.value.length>0)}}function os(e,t,n){let r=n.options[`stylesheet.json`],i=r?us(e):null;if(i&&(!i.unit||i.unit===`px`))N(t,String(i.value));else{let i=fs(n);r&&N(t,i);for(let r=0;r<e.value.length;r++)r!==0&&N(t,`, `),cs(e.value[r],t,n);r&&N(t,i)}}function ss(e,t,n){e.important&&(n&&N(t,` `),N(t,`!important`))}function cs(e,t,n){for(let r=0,i=-1;r<e.value.length;r++){let a=e.value[r];r!==0&&(a.type!==`Field`||a.start!==i)&&N(t,` `),ls(a,t,n),i=a.end}}function ls(e,t,n){if(e.type===`ColorValue`)N(t,Xo(e,n.options[`stylesheet.shortHex`]));else if(e.type===`Literal`)P(t,e.value);else if(e.type===`NumberValue`)P(t,$o(e.value,4)+e.unit);else if(e.type===`StringValue`){let n=e.quote===`double`?`"`:`'`;P(t,n+e.value+n)}else if(e.type===`Field`)na(t,e.index,e.name);else if(e.type===`FunctionCall`){N(t,e.name+`(`);for(let r=0;r<e.arguments.length;r++)r&&N(t,`, `),cs(e.arguments[r],t,n);N(t,`)`)}}function us(e){if(e.value.length===1){let t=e.value[0];if(t.value.length===1&&t.value[0].type===`NumberValue`)return t.value[0]}}function ds(e){return e.replace(/\-(\w)/g,(e,t)=>t.toUpperCase())}function fs(e){return e.options[`stylesheet.jsonDoubleQuotes`]?`"`:`'`}var ps=`lg`;function ms(e,t){let n=t.cache?.stylesheetSnippets||hs(t.snippets);t.cache&&(t.cache.stylesheetSnippets=n),typeof e==`string`&&(e=Hi(e,{value:js(t)}));let r=Ms(n,t);for(let n of e)gs(n,r,t);return e}function hs(e){let t=[];for(let n of Object.keys(e))t.push(Ho(n,e[n]));return Uo(t)}function gs(e,t,n){if(!_s(e,n)){let r=n.options[`stylesheet.fuzzySearchMinScore`];if(js(n)){let i=n.context.name,a=t.find(e=>e.type===`Property`&&e.property===i);ys(e,n,a,r),e.snippet=a}else if(e.name){let i=xs(e.name,t,r,!0);e.snippet=i,i&&(i.type===`Property`?vs(e,i,n):bs(e,i))}}return(e.name||n.context)&&Ts(e,n),e}function _s(e,t){let n=null,r=e.value.length===1?e.value[0]:null;if(r&&r.value.length===1){let e=r.value[0];e.type===`FunctionCall`&&e.name===ps&&(n=e)}return n||e.name===ps?(n=n?Object.assign(Object.assign({},n),{name:`linear-gradient`}):{type:`FunctionCall`,name:`linear-gradient`,arguments:[Es(Os(0,``))]},t.context||(e.name=`background-image`),e.value=[Es(n)],!0):!1}function vs(e,t,n){let r=e.name,i=Cs(r,t.key);if(i){if(e.value.length)return e;let r=ws(i,n,t);if(!r)return e;e.value.push(Es(r))}if(e.name=t.property,e.value.length)ys(e,n,t);else if(t.value.length){let r=t.value[0];e.value=t.value.length===1||r.some(ks)?r:r.map(e=>As(e,n))}return e}function ys(e,t,n,r){for(let i of e.value){let e=[];for(let a of i.value)if(a.type===`Literal`)e.push(ws(a.value,t,n,r)||a);else if(a.type===`FunctionCall`){let i=ws(a.name,t,n,r);i&&i.type===`FunctionCall`?e.push(Object.assign(Object.assign({},i),{arguments:a.arguments.concat(i.arguments.slice(a.arguments.length))})):e.push(a)}else e.push(a);i.value=e}}function bs(e,t){let n=0,r,i=/\$\{(\d+)(:[^}]+)?\}/g,a=e.value[0],o=[];for(;r=i.exec(t.value);)n!==r.index&&o.push(Ds(t.value.slice(n,r.index))),n=r.index+r[0].length,a&&a.value.length?o.push(a.value.shift()):o.push(Os(Number(r[1]),r[2]?r[2].slice(1):``));let s=t.value.slice(n);return s&&o.push(Ds(s)),e.name=void 0,e.value=[Es(...o)],e}function xs(e,t,n=0,r=!1){let i=null,a=0;for(let n of t){let t=Jo(e,Ss(n),r);if(t===1)return n;t&&t>=a&&(a=t,i=n)}return a>=n?i:null}function Ss(e){return typeof e==`string`?e:e.key}function Cs(e,t){for(let n=0,r=0;n<e.length;n++){if(r=t.indexOf(e[n],r),r===-1)return e.slice(n);r++}return``}function ws(e,t,n,r){let i;if(n){if(i=xs(e,Object.keys(n.keywords),r))return n.keywords[i];for(let t of n.dependencies)if(i=xs(e,Object.keys(t.keywords),r))return t.keywords[i]}return(i=xs(e,t.options[`stylesheet.keywords`],r))?Ds(i):null}function Ts(e,t){let n=t.options[`stylesheet.unitAliases`],r=t.options[`stylesheet.unitless`];for(let i of e.value)for(let a of i.value)a.type===`NumberValue`&&(a.unit?a.unit=n[a.unit]||a.unit:a.value!==0&&!r.includes(e.name)&&(a.unit=a.rawValue.includes(`.`)?t.options[`stylesheet.floatUnit`]:t.options[`stylesheet.intUnit`]))}function Es(...e){return{type:`CSSValue`,value:e}}function Ds(e){return{type:`Literal`,value:e}}function Os(e,t){return{type:`Field`,index:e,name:t}}function ks(e){for(let t of e.value)if(t.type===`Field`||t.type===`FunctionCall`&&t.arguments.some(ks))return!0;return!1}function As(e,t,n={index:1}){let r=[];for(let i of e.value)switch(i.type){case`ColorValue`:r.push(Os(n.index++,Xo(i,t.options[`stylesheet.shortHex`])));break;case`Literal`:r.push(Os(n.index++,i.value));break;case`NumberValue`:r.push(Os(n.index++,`${i.value}${i.unit}`));break;case`StringValue`:let e=i.quote===`single`?`'`:`"`;r.push(Os(n.index++,e+i.value+e));break;case`FunctionCall`:r.push(Os(n.index++,i.name),Ds(`(`));for(let e=0,a=i.arguments.length;e<a;e++)r=r.concat(As(i.arguments[e],t,n).value),e!==a-1&&r.push(Ds(`, `));r.push(Ds(`)`));break;default:r.push(i)}return Object.assign(Object.assign({},e),{value:r})}function js(e){return e.context?e.context.name===`@@value`||!e.context.name.startsWith(`@@`):!1}function Ms(e,t){if(t.context){if(t.context.name===`@@section`)return e.filter(e=>e.type===`Raw`);if(t.context.name===`@@property`)return e.filter(e=>e.type===`Property`)}return e}var Ns={a:`a[href]`,"a:blank":"a[href='http://${0}' target='_blank' rel='noopener noreferrer']","a:link":"a[href='http://${0}']","a:mail":"a[href='mailto:${0}']","a:tel":"a[href='tel:+${0}']",abbr:`abbr[title]`,"acr|acronym":`acronym[title]`,base:`base[href]/`,basefont:`basefont/`,br:`br/`,frame:`frame/`,hr:`hr/`,bdo:`bdo[dir]`,"bdo:r":`bdo[dir=rtl]`,"bdo:l":`bdo[dir=ltr]`,col:`col/`,link:`link[rel=stylesheet href]/`,"link:css":"link[href='${1:style}.css']","link:print":"link[href='${1:print}.css' media=print]","link:favicon":"link[rel='shortcut icon' type=image/x-icon href='${1:favicon.ico}']","link:mf|link:manifest":"link[rel='manifest' href='${1:manifest.json}']","link:touch":"link[rel=apple-touch-icon href='${1:favicon.png}']","link:rss":"link[rel=alternate type=application/rss+xml title=RSS href='${1:rss.xml}']","link:atom":"link[rel=alternate type=application/atom+xml title=Atom href='${1:atom.xml}']","link:im|link:import":"link[rel=import href='${1:component}.html']",meta:`meta/`,"meta:utf":`meta[http-equiv=Content-Type content='text/html;charset=UTF-8']`,"meta:vp":"meta[name=viewport content='width=${1:device-width}, initial-scale=${2:1.0}']","meta:compat":"meta[http-equiv=X-UA-Compatible content='${1:IE=7}']","meta:edge":"meta:compat[content='${1:ie=edge}']","meta:redirect":"meta[http-equiv=refresh content='0; url=${1:http://example.com}']","meta:kw":`meta[name=keywords content]`,"meta:desc":`meta[name=description content]`,style:`style`,script:`script`,"script:src":`script[src]`,img:`img[src alt]/`,"img:s|img:srcset":`img[srcset src alt]`,"img:z|img:sizes":`img[sizes srcset src alt]`,picture:`picture`,"src|source":`source/`,"src:sc|source:src":`source[src type]`,"src:s|source:srcset":`source[srcset]`,"src:t|source:type":"source[srcset type='${1:image/}']","src:z|source:sizes":`source[sizes srcset]`,"src:m|source:media":"source[media='(${1:min-width: })' srcset]","src:mt|source:media:type":"source:media[type='${2:image/}']","src:mz|source:media:sizes":`source:media[sizes srcset]`,"src:zt|source:sizes:type":"source[sizes srcset type='${1:image/}']",iframe:`iframe[src frameborder=0]`,embed:`embed[src type]/`,object:`object[data type]`,param:`param[name value]/`,map:`map[name]`,area:`area[shape coords href alt]/`,"area:d":`area[shape=default]`,"area:c":`area[shape=circle]`,"area:r":`area[shape=rect]`,"area:p":`area[shape=poly]`,form:`form[action]`,"form:get":`form[method=get]`,"form:post":`form[method=post]`,label:`label[for]`,input:"input[type=${1:text}]/",inp:"input[name=${1} id=${1}]","input:h|input:hidden":`input[type=hidden name]`,"input:t|input:text":`inp[type=text]`,"input:search":`inp[type=search]`,"input:email":`inp[type=email]`,"input:url":`inp[type=url]`,"input:p|input:password":`inp[type=password]`,"input:datetime":`inp[type=datetime]`,"input:date":`inp[type=date]`,"input:datetime-local":`inp[type=datetime-local]`,"input:month":`inp[type=month]`,"input:week":`inp[type=week]`,"input:time":`inp[type=time]`,"input:tel":`inp[type=tel]`,"input:number":`inp[type=number]`,"input:color":`inp[type=color]`,"input:c|input:checkbox":`inp[type=checkbox]`,"input:r|input:radio":`inp[type=radio]`,"input:range":`inp[type=range]`,"input:f|input:file":`inp[type=file]`,"input:s|input:submit":`input[type=submit value]`,"input:i|input:image":`input[type=image src alt]`,"input:b|input:btn|input:button":`input[type=button value]`,"input:reset":`input:button[type=reset]`,isindex:`isindex/`,select:"select[name=${1} id=${1}]","select:d|select:disabled":`select[disabled.]`,"opt|option":`option[value]`,textarea:"textarea[name=${1} id=${1} cols=${2:30} rows=${3:10}]",marquee:`marquee[behavior direction]`,"menu:c|menu:context":`menu[type=context]`,"menu:t|menu:toolbar":`menu[type=toolbar]`,video:`video[src]`,audio:`audio[src]`,"html:xml":`html[xmlns=http://www.w3.org/1999/xhtml]`,keygen:`keygen/`,command:`command/`,"btn:s|button:s|button:submit":`button[type=submit]`,"btn:r|button:r|button:reset":`button[type=reset]`,"btn:d|button:d|button:disabled":`button[disabled.]`,"fst:d|fset:d|fieldset:d|fieldset:disabled":`fieldset[disabled.]`,bq:`blockquote`,fig:`figure`,figc:`figcaption`,pic:`picture`,ifr:`iframe`,emb:`embed`,obj:`object`,cap:`caption`,colg:`colgroup`,fst:`fieldset`,btn:`button`,optg:`optgroup`,tarea:`textarea`,leg:`legend`,sect:`section`,art:`article`,hdr:`header`,ftr:`footer`,adr:`address`,dlg:`dialog`,str:`strong`,prog:`progress`,mn:`main`,tem:`template`,fset:`fieldset`,datag:`datagrid`,datal:`datalist`,kg:`keygen`,out:`output`,det:`details`,sum:`summary`,cmd:`command`,"ri:d|ri:dpr":`img:s`,"ri:v|ri:viewport":`img:z`,"ri:a|ri:art":`pic>src:m+img`,"ri:t|ri:type":`pic>src:t+img`,"!!!":`{<!DOCTYPE html>}`,doc:"html[lang=${lang}]>(head>meta[charset=${charset}]+meta[http-equiv='X-UA-Compatible'][content='IE=edge']+meta:vp+title{${1:Document}})+body","!|html:5":`!!!+doc`,c:"{<!-- ${0} -->}","cc:ie":"{<!--[if IE]>${0}<![endif]-->}","cc:noie":"{<!--[if !IE]><!-->${0}<!--<![endif]-->}"},Ps={"@f":`@font-face {
14
+ font-family: \${1};
15
+ src: url(\${2});
16
+ }`,"@ff":`@font-face {
17
+ font-family: '\${1:FontName}';
18
+ src: url('\${2:FileName}.eot');
19
+ src: url('\${2:FileName}.eot?#iefix') format('embedded-opentype'),
20
+ url('\${2:FileName}.woff') format('woff'),
21
+ url('\${2:FileName}.ttf') format('truetype'),
22
+ url('\${2:FileName}.svg#\${1:FontName}') format('svg');
23
+ font-style: \${3:normal};
24
+ font-weight: \${4:normal};
25
+ }`,"@i|@import":"@import url(${0});","@kf":`@keyframes \${1:identifier} {
26
+ \${2}
27
+ }`,"@m|@media":`@media \${1:screen} {
28
+ \${0}
29
+ }`,ac:`align-content:start|end|flex-start|flex-end|center|space-between|space-around|stretch|space-evenly`,ai:`align-items:start|end|flex-start|flex-end|center|baseline|stretch`,anim:"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}",animdel:`animation-delay:time`,animdir:`animation-direction:normal|reverse|alternate|alternate-reverse`,animdur:"animation-duration:${1:0}s",animfm:`animation-fill-mode:both|forwards|backwards`,animic:`animation-iteration-count:1|infinite`,animn:`animation-name`,animps:`animation-play-state:running|paused`,animtf:"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})",ap:`appearance:none`,as:`align-self:start|end|auto|flex-start|flex-end|center|baseline|stretch`,b:`bottom`,bd:"border:${1:1px} ${2:solid} ${3:#000}",bdb:"border-bottom:${1:1px} ${2:solid} ${3:#000}",bdbc:"border-bottom-color:${1:#000}",bdbi:"border-bottom-image:url(${0})",bdbk:`border-break:close`,bdbli:"border-bottom-left-image:url(${0})|continue",bdblrs:`border-bottom-left-radius`,bdbri:"border-bottom-right-image:url(${0})|continue",bdbrrs:`border-bottom-right-radius`,bdbs:`border-bottom-style`,bdbw:`border-bottom-width`,bdc:"border-color:${1:#000}",bdci:"border-corner-image:url(${0})|continue",bdcl:`border-collapse:collapse|separate`,bdf:`border-fit:repeat|clip|scale|stretch|overwrite|overflow|space`,bdi:"border-image:url(${0})",bdl:"border-left:${1:1px} ${2:solid} ${3:#000}",bdlc:"border-left-color:${1:#000}",bdlen:`border-length`,bdli:"border-left-image:url(${0})",bdls:`border-left-style`,bdlw:`border-left-width`,bdr:"border-right:${1:1px} ${2:solid} ${3:#000}",bdrc:"border-right-color:${1:#000}",bdri:"border-right-image:url(${0})",bdrs:`border-radius`,bdrst:`border-right-style`,bdrw:`border-right-width`,bds:`border-style:none|hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset`,bdsp:`border-spacing`,bdt:"border-top:${1:1px} ${2:solid} ${3:#000}",bdtc:"border-top-color:${1:#000}",bdti:"border-top-image:url(${0})",bdtli:"border-top-left-image:url(${0})|continue",bdtlrs:`border-top-left-radius`,bdtri:"border-top-right-image:url(${0})|continue",bdtrrs:`border-top-right-radius`,bdts:`border-top-style`,bdtw:`border-top-width`,bdw:`border-width`,bfv:`backface-visibility:hidden|visible`,bg:"background:${1:#000}",bga:`background-attachment:fixed|scroll`,bgbk:`background-break:bounding-box|each-box|continuous`,bgc:"background-color:#${1:fff}",bgcp:`background-clip:padding-box|border-box|content-box|no-clip`,bgi:"background-image:url(${0})",bgo:`background-origin:padding-box|border-box|content-box`,bgp:"background-position:${1:0} ${2:0}",bgpx:`background-position-x`,bgpy:`background-position-y`,bgr:`background-repeat:no-repeat|repeat-x|repeat-y|space|round`,bgsz:`background-size:contain|cover`,bxsh:"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:#000}|none",bxsz:`box-sizing:border-box|content-box|border-box`,c:"color:${1:#000}",cr:"color:rgb(${1:0}, ${2:0}, ${3:0})",cra:"color:rgba(${1:0}, ${2:0}, ${3:0}, ${4:.5})",cl:`clear:both|left|right|none`,cm:"/* ${0} */",cnt:"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters(${0})",coi:`counter-increment`,colm:`columns`,colmc:`column-count`,colmf:`column-fill`,colmg:`column-gap`,colmr:`column-rule`,colmrc:`column-rule-color`,colmrs:`column-rule-style`,colmrw:`column-rule-width`,colms:`column-span`,colmw:`column-width`,cor:`counter-reset`,cp:"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})",cps:`caption-side:top|bottom`,cur:`cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text`,d:`display:block|none|flex|inline-flex|inline|inline-block|grid|inline-grid|subgrid|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group`,ec:`empty-cells:show|hide`,f:"font:${1:1em} ${2:sans-serif}",fd:`font-display:auto|block|swap|fallback|optional`,fef:`font-effect:none|engrave|emboss|outline`,fem:`font-emphasize`,femp:`font-emphasize-position:before|after`,fems:`font-emphasize-style:none|accent|dot|circle|disc`,ff:`font-family:serif|sans-serif|cursive|fantasy|monospace`,fft:`font-family:"Times New Roman", Times, Baskerville, Georgia, serif`,ffa:`font-family:Arial, "Helvetica Neue", Helvetica, sans-serif`,ffv:`font-family:Verdana, Geneva, sans-serif`,fl:`float:left|right|none`,fs:`font-style:italic|normal|oblique`,fsm:`font-smoothing:antialiased|subpixel-antialiased|none`,fst:`font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded`,fv:`font-variant:normal|small-caps`,fvs:`font-variation-settings:normal|inherit|initial|unset`,fw:`font-weight:normal|bold|bolder|lighter`,fx:`flex`,fxb:`flex-basis:fill|max-content|min-content|fit-content|content`,fxd:`flex-direction:row|row-reverse|column|column-reverse`,fxf:`flex-flow`,fxg:`flex-grow`,fxsh:`flex-shrink`,fxw:`flex-wrap:nowrap|wrap|wrap-reverse`,fsz:`font-size`,fsza:`font-size-adjust`,gtc:"grid-template-columns:repeat(${0})|minmax()",gtr:"grid-template-rows:repeat(${0})|minmax()",gta:`grid-template-areas`,gt:`grid-template`,gg:`grid-gap`,gcg:`grid-column-gap`,grg:`grid-row-gap`,gac:`grid-auto-columns:auto|minmax()`,gar:`grid-auto-rows:auto|minmax()`,gaf:`grid-auto-flow:row|column|dense|inherit|initial|unset`,gd:`grid`,gc:`grid-column`,gcs:`grid-column-start`,gce:`grid-column-end`,gr:`grid-row`,grs:`grid-row-start`,gre:`grid-row-end`,ga:`grid-area`,h:`height`,jc:`justify-content:start|end|stretch|flex-start|flex-end|center|space-between|space-around|space-evenly`,ji:`justify-items:start|end|center|stretch`,js:`justify-self:start|end|center|stretch`,l:`left`,lg:"background-image:linear-gradient(${1})",lh:`line-height`,lis:`list-style`,lisi:`list-style-image`,lisp:`list-style-position:inside|outside`,list:`list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman`,lts:`letter-spacing:normal`,m:`margin`,mah:`max-height`,mar:`max-resolution`,maw:`max-width`,mb:`margin-bottom`,mih:`min-height`,mir:`min-resolution`,miw:`min-width`,ml:`margin-left`,mr:`margin-right`,mt:`margin-top`,ol:`outline`,olc:"outline-color:${1:#000}|invert",olo:`outline-offset`,ols:`outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset`,olw:`outline-width|thin|medium|thick`,"op|opa":`opacity`,ord:`order`,ori:`orientation:landscape|portrait`,orp:`orphans`,ov:`overflow:hidden|visible|hidden|scroll|auto`,ovs:`overflow-style:scrollbar|auto|scrollbar|panner|move|marquee`,ovx:`overflow-x:hidden|visible|hidden|scroll|auto`,ovy:`overflow-y:hidden|visible|hidden|scroll|auto`,p:`padding`,pb:`padding-bottom`,pgba:`page-break-after:auto|always|left|right`,pgbb:`page-break-before:auto|always|left|right`,pgbi:`page-break-inside:auto|avoid`,pl:`padding-left`,pos:`position:relative|absolute|relative|fixed|static`,pr:`padding-right`,pt:`padding-top`,q:`quotes`,qen:`quotes:'\\201C' '\\201D' '\\2018' '\\2019'`,qru:`quotes:'\\00AB' '\\00BB' '\\201E' '\\201C'`,r:`right`,rsz:`resize:none|both|horizontal|vertical`,t:`top`,ta:`text-align:left|center|right|justify`,tal:`text-align-last:left|center|right`,tbl:`table-layout:fixed`,td:`text-decoration:none|underline|overline|line-through`,te:`text-emphasis:none|accent|dot|circle|disc|before|after`,th:`text-height:auto|font-size|text-size|max-size`,ti:`text-indent`,tj:`text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan`,to:"text-outline:${1:0} ${2:0} ${3:#000}",tov:`text-overflow:ellipsis|clip`,tr:`text-replace`,trf:"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})",trfo:`transform-origin`,trfs:`transform-style:preserve-3d`,trs:"transition:${1:prop} ${2:time}",trsde:"transition-delay:${1:time}",trsdu:"transition-duration:${1:time}",trsp:"transition-property:${1:prop}",trstf:"transition-timing-function:${1:fn}",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}",tt:`text-transform:uppercase|lowercase|capitalize|none`,tw:`text-wrap:none|normal|unrestricted|suppress`,us:`user-select:none`,v:`visibility:hidden|visible|collapse`,va:`vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub`,w:`width`,whs:`white-space:nowrap|pre|pre-wrap|pre-line|normal`,whsc:`white-space-collapse:normal|keep-all|loose|break-strict|break-all`,wid:`widows`,wm:`writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl`,wob:`word-break:normal|keep-all|break-all`,wos:`word-spacing`,wow:`word-wrap:none|unrestricted|suppress|break-word|normal`,z:`z-index`,zom:`zoom:1`},Fs={"tm|tmatch":`xsl:template[match mode]`,"tn|tname":`xsl:template[name]`,call:`xsl:call-template[name]`,ap:`xsl:apply-templates[select mode]`,api:`xsl:apply-imports`,imp:`xsl:import[href]`,inc:`xsl:include[href]`,ch:`xsl:choose`,"wh|xsl:when":`xsl:when[test]`,ot:`xsl:otherwise`,if:`xsl:if[test]`,par:`xsl:param[name]`,pare:`xsl:param[name select]`,var:`xsl:variable[name]`,vare:`xsl:variable[name select]`,wp:`xsl:with-param[name select]`,key:`xsl:key[name match use]`,elem:`xsl:element[name]`,attr:`xsl:attribute[name]`,attrs:`xsl:attribute-set[name]`,cp:`xsl:copy[select]`,co:`xsl:copy-of[select]`,val:`xsl:value-of[select]`,"for|each":`xsl:for-each[select]`,tex:`xsl:text`,com:`xsl:comment`,msg:`xsl:message[terminate=no]`,fall:`xsl:fallback`,num:`xsl:number[value]`,nam:`namespace-alias[stylesheet-prefix result-prefix]`,pres:`xsl:preserve-space[elements]`,strip:`xsl:strip-space[elements]`,proc:`xsl:processing-instruction[name]`,sort:`xsl:sort[select order]`,choose:`xsl:choose>xsl:when+xsl:otherwise`,xsl:`!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{
30
+ |}`,"!!!":`{<?xml version="1.0" encoding="UTF-8"?>}`},Is={"!!!":`{doctype html}`},Ls={lang:`en`,locale:`en-US`,charset:`UTF-8`,indentation:` `,newline:`
31
+ `},Rs={markup:`html`,stylesheet:`css`},zs={type:`markup`,syntax:`html`,variables:Ls,snippets:{},options:{inlineElements:`a.abbr.acronym.applet.b.basefont.bdo.big.br.button.cite.code.del.dfn.em.font.i.iframe.img.input.ins.kbd.label.map.object.q.s.samp.select.small.span.strike.strong.sub.sup.textarea.tt.u.var`.split(`.`),"output.indent":` `,"output.baseIndent":``,"output.newline":`
32
+ `,"output.tagCase":``,"output.attributeCase":``,"output.attributeQuotes":`double`,"output.format":!0,"output.formatLeafNode":!1,"output.formatSkip":[`html`],"output.formatForce":[`body`],"output.inlineBreak":3,"output.compactBoolean":!1,"output.booleanAttributes":[`contenteditable`,`seamless`,`async`,`autofocus`,`autoplay`,`checked`,`controls`,`defer`,`disabled`,`formnovalidate`,`hidden`,`ismap`,`loop`,`multiple`,`muted`,`novalidate`,`readonly`,`required`,`reversed`,`selected`,`typemustmatch`],"output.reverseAttributes":!1,"output.selfClosingStyle":`html`,"output.field":(e,t)=>t,"output.text":e=>e,"markup.href":!0,"comment.enabled":!1,"comment.trigger":[`id`,`class`],"comment.before":``,"comment.after":`
33
+ <!-- /[#ID][.CLASS] -->`,"bem.enabled":!1,"bem.element":`__`,"bem.modifier":`_`,"jsx.enabled":!1,"stylesheet.keywords":[`auto`,`inherit`,`unset`,`none`],"stylesheet.unitless":[`z-index`,`line-height`,`opacity`,`font-weight`,`zoom`,`flex`,`flex-grow`,`flex-shrink`],"stylesheet.shortHex":!0,"stylesheet.between":`: `,"stylesheet.after":`;`,"stylesheet.intUnit":`px`,"stylesheet.floatUnit":`em`,"stylesheet.unitAliases":{e:`em`,p:`%`,x:`ex`,r:`rem`},"stylesheet.json":!1,"stylesheet.jsonDoubleQuotes":!1,"stylesheet.fuzzySearchMinScore":0}},Bs={markup:{snippets:Vs(Ns)},xhtml:{options:{"output.selfClosingStyle":`xhtml`}},xml:{options:{"output.selfClosingStyle":`xml`}},xsl:{snippets:Vs(Fs),options:{"output.selfClosingStyle":`xml`}},jsx:{options:{"jsx.enabled":!0}},pug:{snippets:Vs(Is)},stylesheet:{snippets:Vs(Ps)},sass:{options:{"stylesheet.after":``}},stylus:{options:{"stylesheet.between":` `,"stylesheet.after":``}}};function Vs(e){let t={};return Object.keys(e).forEach(n=>{for(let r of n.split(`|`))t[r]=e[n]}),t}function Hs(e={},t={}){let n=e.type||`markup`,r=e.syntax||Rs[n];return Object.assign(Object.assign(Object.assign({},zs),e),{type:n,syntax:r,variables:Us(n,r,`variables`,e,t),snippets:Us(n,r,`snippets`,e,t),options:Us(n,r,`options`,e,t)})}function Us(e,t,n,r,i={}){let a=Bs[e],o=i[e],s=Bs[t],c=i[t];return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zs[n]),a&&a[n]),s&&s[n]),o&&o[n]),c&&c[n]),r[n])}function Ws(e,t=0){return{text:e,start:t,pos:e.length}}function Gs(e){return e.pos===e.start}function Ks(e,t=0){return e.text.charCodeAt(e.pos-1+t)}function qs(e){if(!Gs(e))return e.text.charCodeAt(--e.pos)}function F(e,t){if(Gs(e))return!1;let n=typeof t==`function`?t(Ks(e)):t===Ks(e);return n&&e.pos--,!!n}function Js(e,t){let n=e.pos;for(;F(e,t););return e.pos<n}function Ys(e){return e===39||e===34}function Xs(e){let t=e.pos,n=qs(e);if(Ys(n)){for(;!Gs(e);)if(qs(e)===n&&Ks(e)!==92)return!0}return e.pos=t,!1}var Zs={91:93,40:41,123:125};function Qs(e){let t=e.pos;if(!F(e,62))return!1;let n=!1;for(F(e,47);!Gs(e);){if(Js(e,oc),nc(e)){if(F(e,47)){n=F(e,60);break}else if(F(e,60)){n=!0;break}else if(F(e,oc))continue;else if(F(e,61)){if(nc(e))continue;break}else if(tc(e)){n=!0;break}break}if(!$s(e))break}return e.pos=t,n}function $s(e){return ec(e)||tc(e)}function ec(e){let t=e.pos;return Xs(e)&&F(e,61)&&nc(e)?!0:(e.pos=t,!1)}function tc(e){let t=e.pos,n=[];for(;!Gs(e);){let t=Ks(e);if(lc(t))n.push(t);else if(cc(t)){if(n.pop()!==Zs[t])break}else if(!sc(t))break;e.pos--}return t!==e.pos&&F(e,61)&&nc(e)?!0:(e.pos=t,!1)}function nc(e){return Js(e,rc)}function rc(e){return e===58||e===45||ic(e)||ac(e)}function ic(e){return e&=-33,e>=65&&e<=90}function ac(e){return e>47&&e<58}function oc(e){return e===32||e===9}function sc(e){return!isNaN(e)&&e!==61&&!oc(e)&&!Ys(e)}function cc(e){return e===123||e===40||e===91}function lc(e){return e===125||e===41||e===93}var uc=e=>e.charCodeAt(0),dc=`#.*:$-_!@%^+>/`.split(``).map(uc),fc={type:`markup`,lookAhead:!0,prefix:``};function pc(e,t=e.length,n={}){let r=Object.assign(Object.assign({},fc),n);t=Math.min(e.length,Math.max(0,t??e.length)),r.lookAhead&&(t=mc(e,t,r));let i,a=hc(e,t,r.prefix||``);if(a===-1)return;let o=Ws(e,a);o.pos=t;let s=[];for(;!Gs(o);){if(i=Ks(o),s.includes(125)){if(i===125){s.push(i),o.pos--;continue}if(i!==123){o.pos--;continue}}if(bc(i,r.type))s.push(i);else if(yc(i,r.type)){if(s.pop()!==Zs[i])break}else if(s.includes(93)||s.includes(125)){o.pos--;continue}else if(Qs(o)||!vc(i))break;o.pos--}if(!s.length&&o.pos!==t){let r=e.slice(o.pos,t).replace(/^[*+>^]+/,``);return{abbreviation:r,location:t-r.length,start:n.prefix?a-n.prefix.length:t-r.length,end:t}}}function mc(e,t,n){for(Ys(e.charCodeAt(t))&&t++;bc(e.charCodeAt(t),n.type);)t++;return t}function hc(e,t,n){if(!n)return 0;let r=Ws(e),i=n.split(``).map(uc);r.pos=t;let a;for(;!Gs(r);)if(!(gc(r,93,91)||gc(r,125,123))){if(a=r.pos,_c(r,i))return a;r.pos--}return-1}function gc(e,t,n){let r=e.pos;if(F(e,t))for(;!Gs(e);){if(F(e,n))return!0;e.pos--}return e.pos=r,!1}function _c(e,t){let n=e.pos,r=!1;for(let n=t.length-1;n>=0&&!Gs(e)&&F(e,t[n]);n--)r=n===0;return r||(e.pos=n),r}function vc(e){return e>64&&e<91||e>96&&e<123||e>47&&e<58||dc.includes(e)}function yc(e,t){return e===40||t===`markup`&&(e===91||e===123)}function bc(e,t){return e===41||t===`markup`&&(e===93||e===125)}function xc(e,t){let n=Hs(t);return n.type===`stylesheet`?Cc(e,n):Sc(e,n)}function Sc(e,t){return Ro(Lo(e,t),t)}function Cc(e,t){return is(ms(e,t),t)}var wc={properties:`additive-symbols.align-content.align-items.justify-items.justify-self.justify-items.align-self.all.alt.animation.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-timing-function.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.behavior.block-size.border.border-block-end.border-block-start.border-block-end-color.border-block-start-color.border-block-end-style.border-block-start-style.border-block-end-width.border-block-start-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline-end.border-inline-start.border-inline-end-color.border-inline-start-color.border-inline-end-style.border-inline-start-style.border-inline-end-width.border-inline-start-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-decoration-break.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation-filters.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.columns.column-span.column-width.contain.content.counter-increment.counter-reset.cursor.direction.display.empty-cells.enable-background.fallback.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.font.font-family.font-feature-settings.font-kerning.font-language-override.font-size.font-size-adjust.font-stretch.font-style.font-synthesis.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-ligatures.font-variant-numeric.font-variant-position.font-weight.glyph-orientation-horizontal.glyph-orientation-vertical.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-gap.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-gap.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.height.hyphens.image-orientation.image-rendering.ime-mode.inline-size.isolation.justify-content.kerning.left.letter-spacing.lighting-color.line-break.line-height.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block-end.margin-block-start.margin-bottom.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.marker.marker-end.marker-mid.marker-start.mask-type.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.motion.motion-offset.motion-path.motion-rotation.-moz-animation.-moz-animation-delay.-moz-animation-direction.-moz-animation-duration.-moz-animation-iteration-count.-moz-animation-name.-moz-animation-play-state.-moz-animation-timing-function.-moz-appearance.-moz-backface-visibility.-moz-background-clip.-moz-background-inline-policy.-moz-background-origin.-moz-border-bottom-colors.-moz-border-image.-moz-border-left-colors.-moz-border-right-colors.-moz-border-top-colors.-moz-box-align.-moz-box-direction.-moz-box-flex.-moz-box-flexgroup.-moz-box-ordinal-group.-moz-box-orient.-moz-box-pack.-moz-box-sizing.-moz-column-count.-moz-column-gap.-moz-column-rule.-moz-column-rule-color.-moz-column-rule-style.-moz-column-rule-width.-moz-columns.-moz-column-width.-moz-font-feature-settings.-moz-hyphens.-moz-perspective.-moz-perspective-origin.-moz-text-align-last.-moz-text-decoration-color.-moz-text-decoration-line.-moz-text-decoration-style.-moz-text-size-adjust.-moz-transform.-moz-transform-origin.-moz-transition.-moz-transition-delay.-moz-transition-duration.-moz-transition-property.-moz-transition-timing-function.-moz-user-focus.-moz-user-select.-ms-accelerator.-ms-behavior.-ms-block-progression.-ms-content-zoom-chaining.-ms-content-zooming.-ms-content-zoom-limit.-ms-content-zoom-limit-max.-ms-content-zoom-limit-min.-ms-content-zoom-snap.-ms-content-zoom-snap-points.-ms-content-zoom-snap-type.-ms-filter.-ms-flex.-ms-flex-align.-ms-flex-direction.-ms-flex-flow.-ms-flex-item-align.-ms-flex-line-pack.-ms-flex-order.-ms-flex-pack.-ms-flex-wrap.-ms-flow-from.-ms-flow-into.-ms-grid-column.-ms-grid-column-align.-ms-grid-columns.-ms-grid-column-span.-ms-grid-layer.-ms-grid-row.-ms-grid-row-align.-ms-grid-rows.-ms-grid-row-span.-ms-high-contrast-adjust.-ms-hyphenate-limit-chars.-ms-hyphenate-limit-lines.-ms-hyphenate-limit-zone.-ms-hyphens.-ms-ime-mode.-ms-interpolation-mode.-ms-layout-grid.-ms-layout-grid-char.-ms-layout-grid-line.-ms-layout-grid-mode.-ms-layout-grid-type.-ms-line-break.-ms-overflow-style.-ms-perspective.-ms-perspective-origin.-ms-perspective-origin-x.-ms-perspective-origin-y.-ms-progress-appearance.-ms-scrollbar-3dlight-color.-ms-scrollbar-arrow-color.-ms-scrollbar-base-color.-ms-scrollbar-darkshadow-color.-ms-scrollbar-face-color.-ms-scrollbar-highlight-color.-ms-scrollbar-shadow-color.-ms-scrollbar-track-color.-ms-scroll-chaining.-ms-scroll-limit.-ms-scroll-limit-x-max.-ms-scroll-limit-x-min.-ms-scroll-limit-y-max.-ms-scroll-limit-y-min.-ms-scroll-rails.-ms-scroll-snap-points-x.-ms-scroll-snap-points-y.-ms-scroll-snap-type.-ms-scroll-snap-x.-ms-scroll-snap-y.-ms-scroll-translation.-ms-text-align-last.-ms-text-autospace.-ms-text-combine-horizontal.-ms-text-justify.-ms-text-kashida-space.-ms-text-overflow.-ms-text-size-adjust.-ms-text-underline-position.-ms-touch-action.-ms-touch-select.-ms-transform.-ms-transform-origin.-ms-transform-origin-x.-ms-transform-origin-y.-ms-transform-origin-z.-ms-user-select.-ms-word-break.-ms-word-wrap.-ms-wrap-flow.-ms-wrap-margin.-ms-wrap-through.-ms-writing-mode.-ms-zoom.-ms-zoom-animation.nav-down.nav-index.nav-left.nav-right.nav-up.negative.-o-animation.-o-animation-delay.-o-animation-direction.-o-animation-duration.-o-animation-fill-mode.-o-animation-iteration-count.-o-animation-name.-o-animation-play-state.-o-animation-timing-function.object-fit.object-position.-o-border-image.-o-object-fit.-o-object-position.opacity.order.orphans.-o-table-baseline.-o-tab-size.-o-text-overflow.-o-transform.-o-transform-origin.-o-transition.-o-transition-delay.-o-transition-duration.-o-transition-property.-o-transition-timing-function.offset-block-end.offset-block-start.offset-inline-end.offset-inline-start.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-wrap.overflow-x.overflow-y.pad.padding.padding-bottom.padding-block-end.padding-block-start.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page-break-after.page-break-before.page-break-inside.paint-order.perspective.perspective-origin.pointer-events.position.prefix.quotes.range.resize.right.ruby-align.ruby-overhang.ruby-position.ruby-span.scrollbar-3dlight-color.scrollbar-arrow-color.scrollbar-base-color.scrollbar-darkshadow-color.scrollbar-face-color.scrollbar-highlight-color.scrollbar-shadow-color.scrollbar-track-color.scroll-behavior.scroll-snap-coordinate.scroll-snap-destination.scroll-snap-points-x.scroll-snap-points-y.scroll-snap-type.shape-image-threshold.shape-margin.shape-outside.shape-rendering.size.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.suffix.system.symbols.table-layout.tab-size.text-align.text-align-last.text-anchor.text-decoration.text-decoration-color.text-decoration-line.text-decoration-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-transform.text-underline-position.top.touch-action.transform.transform-origin.transform-style.transition.transition-delay.transition-duration.transition-property.transition-timing-function.unicode-bidi.unicode-range.user-select.vertical-align.visibility.-webkit-animation.-webkit-animation-delay.-webkit-animation-direction.-webkit-animation-duration.-webkit-animation-fill-mode.-webkit-animation-iteration-count.-webkit-animation-name.-webkit-animation-play-state.-webkit-animation-timing-function.-webkit-appearance.-webkit-backdrop-filter.-webkit-backface-visibility.-webkit-background-clip.-webkit-background-composite.-webkit-background-origin.-webkit-border-image.-webkit-box-align.-webkit-box-direction.-webkit-box-flex.-webkit-box-flex-group.-webkit-box-ordinal-group.-webkit-box-orient.-webkit-box-pack.-webkit-box-reflect.-webkit-box-sizing.-webkit-break-after.-webkit-break-before.-webkit-break-inside.-webkit-column-break-after.-webkit-column-break-before.-webkit-column-break-inside.-webkit-column-count.-webkit-column-gap.-webkit-column-rule.-webkit-column-rule-color.-webkit-column-rule-style.-webkit-column-rule-width.-webkit-columns.-webkit-column-span.-webkit-column-width.-webkit-filter.-webkit-flow-from.-webkit-flow-into.-webkit-font-feature-settings.-webkit-hyphens.-webkit-line-break.-webkit-margin-bottom-collapse.-webkit-margin-collapse.-webkit-margin-start.-webkit-margin-top-collapse.-webkit-mask-clip.-webkit-mask-image.-webkit-mask-origin.-webkit-mask-repeat.-webkit-mask-size.-webkit-nbsp-mode.-webkit-overflow-scrolling.-webkit-padding-start.-webkit-perspective.-webkit-perspective-origin.-webkit-region-fragment.-webkit-tap-highlight-color.-webkit-text-fill-color.-webkit-text-size-adjust.-webkit-text-stroke.-webkit-text-stroke-color.-webkit-text-stroke-width.-webkit-touch-callout.-webkit-transform.-webkit-transform-origin.-webkit-transform-origin-x.-webkit-transform-origin-y.-webkit-transform-origin-z.-webkit-transform-style.-webkit-transition.-webkit-transition-delay.-webkit-transition-duration.-webkit-transition-property.-webkit-transition-timing-function.-webkit-user-drag.-webkit-user-modify.-webkit-user-select.white-space.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.z-index.zoom`.split(`.`)},Tc={tags:`body.head.html.address.blockquote.dd.div.section.article.aside.header.footer.nav.menu.dl.dt.fieldset.form.frame.frameset.h1.h2.h3.h4.h5.h6.iframe.noframes.object.ol.p.ul.applet.center.dir.hr.pre.a.abbr.acronym.area.b.base.basefont.bdo.big.br.button.caption.cite.code.col.colgroup.del.dfn.em.font.i.img.input.ins.isindex.kbd.label.legend.li.link.map.meta.noscript.optgroup.option.param.q.s.samp.script.select.small.span.strike.strong.style.sub.sup.table.tbody.td.textarea.tfoot.th.thead.title.tr.tt.u.var.canvas.main.figure.plaintext.figcaption.hgroup.details.summary`.split(`.`)},Ec=new Map,Dc,Oc=new Map,kc=/^[a-z,A-Z,!,(,[,#,\.\{]/,Ac=/^[a-z,A-Z,!,(,[,#,\.]/,jc=/^-?[a-z,A-Z,!,@,#]/,Mc=/[a-z,A-Z\.]/,Nc=hn(hn([],Tc.tags,!0),[`lorem`],!1),Pc=`bem`,Fc=`|`,Ic=`t`,Lc=`c`,Rc=3;function zc(e,t,n,r,i){var a=qc(r);if(!a){if(!Ec.has(r)){var o=Yc(r);Ec.set(r,Object.keys(o))}Dc=Ec.get(r)??[]}var s=Zc(e,t,n,{lookAhead:!a,type:Jc(r)});if(s){var c=s.abbreviationRange,l=s.abbreviation,u=s.currentLineTillPosition,d=s.filter;if(!(Vc(u)===l&&u.endsWith(`<${l}`)&&!a)){var f=el(r,d),p=``,m,h=[];if(function(t,n){if(Qc(t,l)){try{p=xc(n,f),a&&`!important`.startsWith(n)&&(p=`!important`)}catch{}!p||$c(t,n,p,f.options)||(m={kind:e.languages.CompletionItemKind.Property,label:l+(d?`|`+d.replace(`,`,`|`):``),documentation:Hc(p),detail:`Emmet abbreviation`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:c,insertText:Wc(Gc(p))},h=[m])}}(r,l),a){if(l.length>4&&wc.properties.some(function(e){return e.startsWith(l)}))return{suggestions:[],incomplete:!0};if(m&&p.length&&(m.range=c,m.insertText=Wc(Gc(p)),m.documentation=Hc(p),m.label=Uc(p),m.filterText=l,h=Bc(e,(Oc.has(r)?Oc.get(r):Oc.get(`css`))??[],l,l,c,f,`Emmet Custom Snippet`,!1),!h.find(function(e){return e.insertText===m?.insertText}))){var ee=RegExp(`.*`+l.split(``).map(function(e){return e===`$`||e===`+`?`\\`+e:e}).join(`.*`)+`.*`,`i`);(/\d/.test(l)||ee.test(m.label))&&h.push(m)}}else{var g=l,_=l.match(/(>|\+)([\w:-]+)$/);if(_&&_.length===3&&(g=_[2]),r!==`xml`){var v=Bc(e,Nc,g,l,c,f,`Emmet Abbreviation`);h=h.concat(v)}if(i.showAbbreviationSuggestions===!0){var y=Bc(e,Dc.filter(function(e){return!Nc.includes(e)}),g,l,c,f,`Emmet Abbreviation`);m&&y.length>0&&g!==l&&(m.sortText=`0`+m.label,y.forEach(function(e){e.filterText=l,e.sortText=`9`+l})),h=h.concat(y)}r===`html`&&h.length>=2&&l.includes(`:`)&&m?.insertText===`<${l}>\${0}</${l}>`&&(h=h.filter(function(e){return e.label!==l}))}return i.showSuggestionsAsSnippets===!0&&h.forEach(function(t){return t.kind=e.languages.CompletionItemKind.Snippet}),h.length?{suggestions:h,incomplete:!0}:void 0}}}function Bc(e,t,n,r,i,a,o,s){if(s===void 0&&(s=!0),!n||!t)return[];var c=[];return t.forEach(function(t){if(!(!t.startsWith(n.toLowerCase())||s&&t===n.toLowerCase())){var l=r+t.substr(n.length),u;try{u=xc(l,a)}catch{}if(u){var d={kind:e.languages.CompletionItemKind.Property,label:n+t.substr(n.length),documentation:Hc(u),detail:o,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:i,insertText:Wc(Gc(u))};c.push(d)}}}),c}function Vc(e){if(e){var t=e.match(/[\w,:,-,\.]*$/);if(t)return t[0]}}function Hc(e){return e.replace(/([^\\])\$\{\d+\}/g,`$1|`).replace(/\$\{\d+:([^\}]+)\}/g,`$1`)}function Uc(e){return e.replace(/([^\\])\$\{\d+\}/g,`$1`).replace(/\$\{\d+:([^\}]+)\}/g,`$1`)}function Wc(e){return e&&e.replace(/([^\\])(\$)([^\{])/g,`$1\\$2$3`)}function Gc(e){if(!e||!e.trim())return e;var t=-1,n=[],r=!1,i=!1,a=0,o=e.length;try{for(;a<o&&!r;)if(!(e[a++]!=`$`||e[a++]!=`{`)){for(var s=-1,c=-1;a<o&&/\d/.test(e[a]);)s=s<0?a:s,c=a+1,a++;if(!(s===-1||c===-1||a>=o||e[a]!=`}`&&e[a]!=`:`)){var l=e.substring(s,c);if(r=l===`0`,r)break;var u=!1;if(e[a++]==`:`)for(;a<o;){if(e[a]==`}`){u=!0;break}a++}Number(l)>Number(t)?(t=Number(l),n=[{numberStart:s,numberEnd:c}],i=!u):Number(l)===t&&n.push({numberStart:s,numberEnd:c})}}}catch{}if(i&&!r)for(var d=0;d<n.length;d++){var f=n[d].numberStart,p=n[d].numberEnd;e=e.substr(0,f)+`0`+e.substr(p)}return e}var Kc=function(e,t){return`\${${e}${t?`:`+t:``}}`};function qc(e){return e===`css`}function Jc(e){return qc(e)?`stylesheet`:`markup`}function Yc(e){var t=Hs({type:Jc(e),syntax:e});return e===`xml`?{}:t.snippets}function Xc(e,t){for(var n,r=0;r<Rc;r++)if(e.endsWith(`${Fc}${Pc}`,t))t-=Pc.length+1,n=n?Pc+`,`+n:Pc;else if(e.endsWith(`${Fc}${Lc}`,t))t-=Lc.length+1,n=n?Lc+`,`+n:Lc;else if(e.endsWith(`${Fc}${Ic}`,t))t-=Ic.length+1,n=n?Ic+`,`+n:Ic;else break;return{pos:t,filter:n}}function Zc(e,t,n,r){var i=t.getLineContent(n.lineNumber),a=i.substr(0,n.column-1),o=Xc(a,n.column-1),s=o.pos,c=o.filter,l=c?c.length+1:0,u=pc(i,s,r);if(u)return{abbreviationRange:new e.Range(n.lineNumber,u.location+1,n.lineNumber,u.location+u.abbreviation.length+l+1),abbreviation:u.abbreviation,currentLineTillPosition:a,filter:c}}function Qc(e,t){if(!t)return!1;if(qc(e)){if(t.includes(`#`)){if(t.startsWith(`#`))return/^#[\d,a-f,A-F]{1,6}$/.test(t);if(Nc.includes(t.substring(0,t.indexOf(`#`))))return!1}return jc.test(t)}return t.startsWith(`!`)?!/[^!]/.test(t):(/\(/.test(t)||/\)/.test(t))&&!/\{[^\}\{]*[\(\)]+[^\}\{]*\}(?:[>\+\*\^]|$)/.test(t)&&!/\(.*\)[>\+\*\^]/.test(t)&&!/\[[^\[\]\(\)]+=".*"\]/.test(t)&&!/[>\+\*\^]\(.*\)/.test(t)?!1:e===`jsx`?Ac.test(t)&&Mc.test(t):kc.test(t)&&Mc.test(t)}function $c(e,t,n,r){if(qc(e)&&r){var i=r[`stylesheet.between`]??`: `,a=r[`stylesheet.after`]??`;`,o=t.indexOf(i[0],Math.max(t.length-i.length,0));return o=o>=0?o:t.length,n===`${t.substring(0,o)}${i}\${0}${a}`||n.replace(/\s/g,``)===t.replace(/\s/g,``)+a}if(e===`xml`&&Nc.some(function(e){return e.startsWith(t.toLowerCase())}))return!0;if(Nc.includes(t.toLowerCase())||Dc.includes(t)||/[-,:]/.test(t)&&!/--|::/.test(t)&&!t.endsWith(`:`)||t===`.`)return!1;var s=t.match(/^([a-z,A-Z,\d]*)\.$/);return s?!(s[1]&&Tc.tags.includes(s[1])):e===`jsx`&&/^([A-Z][A-Za-z0-9]*)+$/.test(t)?!1:n.toLowerCase()===`<${t.toLowerCase()}>\${1}</${t.toLowerCase()}>`}function el(e,t){var n=Jc(e),r=t?t.split(`,`).map(function(e){return e.trim()}):[],i=r.includes(`bem`);return{type:n,options:{"output.formatSkip":[`html`],"output.formatForce":[`body`],"output.field":Kc,"output.inlineBreak":0,"output.compactBoolean":!1,"output.reverseAttributes":!1,"markup.href":!0,"comment.enabled":r.includes(`c`),"comment.trigger":[`id`,`class`],"comment.before":``,"comment.after":`
34
+ <!-- /[#ID][.CLASS] -->`,"bem.enabled":i,"bem.element":`__`,"bem.modifier":`_`,"jsx.enabled":e===`jsx`,"stylesheet.shortHex":!0,"stylesheet.between":e===`stylus`?` `:`: `,"stylesheet.after":e===`sass`||e===`stylus`?``:`;`,"stylesheet.intUnit":`px`,"stylesheet.floatUnit":`em`,"stylesheet.unitAliases":{e:`em`,p:`%`,x:`ex`,r:`rem`},"stylesheet.fuzzySearchMinScore":.3,"output.format":!0,"output.selfClosingStyle":`html`},variables:{},snippets:{},syntax:e,text:void 0,maxRepeat:1e3}}function tl(e,t,n,r){var i=e[t],a=i.type,o=i.language;return n===`html`&&o===`html`?a===``&&(t===0||e[t-1].type===`delimiter.html`)||e[0].type===`text.html.basic`:n===`css`&&o===`css`?a===``?!0:a===`tag.`+r:n===`jsx`?!!t&&[`identifier.js`,`type.identifier.js`,`identifier.ts`,`type.identifier.ts`].includes(a):!1}function nl(e,t,n,r){for(var i=t.column,a=t.lineNumber,o=e._tokenization||e.tokenization._tokenization,s=o._tokenizationStateStore,c=s.tokenizationSupport||o._tokenizationSupport,l=s.getBeginState(a-1).clone(),u=c.tokenize(e.getLineContent(a),!0,l,0),d=u.tokens,f=!1,p=d.length-1;p>=0;p--){var m=d[p];if(i-1>m.offset){if(f=tl(d,p,n,r),!f&&n===`css`&&m.type===`attribute.value.html`){do{if(p--<=0){if(a--==0)break;u=c.tokenize(e.getLineContent(a),!0,l,0),d=u.tokens,p=d.length-1}m=d[p]}while(m.type===`attribute.name.html`);(e.getWordAtPosition({column:m.offset,lineNumber:a})?.word||``)===`style`&&(f=!0)}break}}return f}var rl={html:[`!`,`.`,`}`,`:`,`*`,`$`,`]`,`/`,`>`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],jade:[`!`,`.`,`}`,`:`,`*`,`$`,`]`,`/`,`>`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],slim:[`!`,`.`,`}`,`:`,`*`,`$`,`]`,`/`,`>`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],haml:[`!`,`.`,`}`,`:`,`*`,`$`,`]`,`/`,`>`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],xml:[`.`,`}`,`*`,`$`,`]`,`/`,`>`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],xsl:[`!`,`.`,`}`,`*`,`$`,`/`,`]`,`>`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],css:[`:`,`!`,`-`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],scss:[`:`,`!`,`-`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],sass:[`:`,`!`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],less:[`:`,`!`,`-`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],stylus:[`:`,`!`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],javascript:[`!`,`.`,`}`,`*`,`$`,`]`,`/`,`>`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],typescript:[`!`,`.`,`}`,`*`,`$`,`]`,`/`,`>`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`]},il={handlebars:`html`,php:`html`,twig:`html`},al={showExpandedAbbreviation:`always`,showAbbreviationSuggestions:!0,showSuggestionsAsSnippets:!1};function ol(e,t,n){if(e){var r=t.map(function(t){return e.languages.registerCompletionItemProvider(t,{triggerCharacters:rl[il[t]||t],provideCompletionItems:function(t,r){return nl(t,r,n,n)?zc(e,t,r,n,al):void 0}})});return function(){r.forEach(function(e){return e.dispose()})}}}function sl(e,t){return e===void 0&&(e=window.monaco),t===void 0&&(t=[`html`]),ol(e,t,`html`)}function cl(e,t){return e===void 0&&(e=window.monaco),t===void 0&&(t=[`css`]),ol(e,t,`css`)}var ll=(e,t)=>(dl(),fl(e.user.color,t),e.cursor?[{range:new u.I.Range(e.cursor.lineNumber,e.cursor.column,e.cursor.lineNumber,e.cursor.column),options:{className:`applyColorToThis backgroundPrefix-${e.user.color.slice(1)}`,afterContentClassName:`cursor-hover`,beforeContentClassName:``,style:`--cursor-color: ${e.user.color};`}}]:[]),ul=e=>e.selection?[{range:new u.I.Range(e.selection.startLineNumber,e.selection.startColumn,e.selection.endLineNumber,e.selection.endColumn),options:{className:`user-selection-decoration`}}]:[],dl=()=>{let e=document.styleSheets[0];Array.from(e.cssRules).some(e=>e.cssText.includes(`.applyColorToThis`))||e.insertRule(`.applyColorToThis {
35
+ border-left: 2px solid var(--cursor-color, #000);
36
+ color: var(--cursor-color, #000);
37
+ }`,e.cssRules.length)},fl=(e,t)=>{let n=`backgroundPrefix-${e.slice(1)}`,r=document.styleSheets[0];Array.from(r.cssRules).some(e=>e.cssText.includes(`.${n}`))||r.insertRule(`.${n} { --cursor-color: ${e===t.color?`#000000`:e}; }`,r.cssRules.length)},pl=(e,t,n,r,i)=>{for(let a=0;a<e.length;a++){let o=e[a],s=o.className.split(` `);for(let e of s)if(e.startsWith(t)){let a=`#${e.replace(t,``)}`,s=r.find(e=>e.user.color===a);s&&(n&&a!==i?.color?ml(o,a,s?.user?.name?.first_name?`${s?.user?.name?.first_name} ${s?.user?.name?.last_name}`.replace(/[\n\r]/g,``):s.user.name.email.split(`@`)[0]):o.style.backgroundColor=a)}}},ml=(e,t,n)=>{if(!e.textContent){let r=document.createElement(`div`);r.style.background=t,r.style.color=`#fff`,r.textContent=n,r.className=`cursor-hover`,e.appendChild(r)}},hl=(e,t,n,r,i,a)=>{if(r)return;i(!0);let o=e.flatMap(e=>[...ll(e,a),...ul(e)]);n.current=t.deltaDecorations(n.current,o.map(e=>({range:e.range,options:e.options}))),pl(document.getElementsByClassName(`applyColorToThis`),`backgroundPrefix-`,!0,e,a),i(!1)},gl=(e,t)=>{t.setLocalStateField(`cursor`,e.position)},_l=(e,t)=>{let n=e.selection;t.setLocalStateField(`selection`,{startLineNumber:n.startLineNumber,startColumn:n.startColumn,endLineNumber:n.endLineNumber,endColumn:n.endColumn})},vl=(e,t)=>e.filter(e=>e.user.color!==t.color),yl=()=>{let e=(e,t,n)=>e>100&&t>50&&t<150&&n<100,t=(e,t,n)=>{let r=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},i=r(e),a=r(t),o=r(n);return .2126*i+.7152*a+.0722*o},n=(e,n,r)=>{let i=t(255,255,255),a=t(e,n,r);return(i+.05)/(a+.05)>=4.5},r;do{let t=Math.floor(Math.random()*206+50),i=Math.floor(Math.random()*206+50),a=Math.floor(Math.random()*206+50);t+i+a>=400&&!e(t,i,a)&&n(t,i,a)&&(r=`#${(t<<16|i<<8|a).toString(16).padStart(6,`0`)}`)}while(!r);return r},bl=({CHECK_INTERVAL:e,SLEEP_THRESHOLD:t,provider:n,handleOfflineCollaboration:r,isNewEmailGeneration:i,saveEmailFromEditor:a})=>{let o=Date.now();return setInterval(()=>{let e=Date.now(),r=e-o;r>t&&n&&(a(),window.location.reload(),window.location.reload()),r<t&&!n&&document.visibilityState,o=e},e)};r.i();var xl=()=>new Map,Sl=e=>{let t=xl();return e.forEach((e,n)=>{t.set(n,e)}),t},Cl=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},wl=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1},Tl=()=>new Set,El=e=>e[e.length-1],Dl=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},Ol=Array.from,kl=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},Al=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},jl=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},Ml=Array.isArray,Nl=class{constructor(){this._observers=xl()}on(e,t){return Cl(this._observers,e,Tl).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return Ol((this._observers.get(e)||xl()).values()).forEach(e=>e(...t))}destroy(){this._observers=xl()}},Pl=class{constructor(){this._observers=xl()}on(e,t){Cl(this._observers,e,Tl).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return Ol((this._observers.get(e)||xl()).values()).forEach(e=>e(...t))}destroy(){this._observers=xl()}},Fl=Math.floor,Il=Math.abs,Ll=(e,t)=>e<t?e:t,Rl=(e,t)=>e>t?e:t;Number.isNaN;var zl=Math.pow,Bl=e=>e===0?1/e<0:e<0,Vl=2**53-1,Hl=-(2**53-1),Ul=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&Fl(e)===e);Number.isNaN,Number.parseInt;var Wl=String.fromCharCode;String.fromCodePoint,Wl(65535);var Gl=e=>e.toLowerCase(),Kl=/^\s*/g,ql=e=>e.replace(Kl,``),Jl=/([A-Z])/g,Yl=(e,t)=>ql(e.replace(Jl,e=>`${t}${Gl(e)}`)),Xl=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},Zl=typeof TextEncoder<`u`?new TextEncoder:null,Ql=Zl?e=>Zl.encode(e):Xl,$l=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0});$l&&$l.decode(new Uint8Array).length===1&&($l=null);var eu=(e,t)=>jl(t,()=>e).join(``),tu=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},I=()=>new tu,nu=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},L=e=>{let t=new Uint8Array(nu(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},ru=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Rl(n,t)*2),e.cpos=0)},R=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},iu=R,z=(e,t)=>{for(;t>127;)R(e,128|127&t),t=Fl(t/128);R(e,127&t)},au=(e,t)=>{let n=Bl(t);for(n&&(t=-t),R(e,(t>63?128:0)|(n?64:0)|63&t),t=Fl(t/64);t>0;)R(e,(t>127?128:0)|127&t),t=Fl(t/128)},ou=new Uint8Array(3e4),su=ou.length/3,cu=Zl&&Zl.encodeInto?(e,t)=>{if(t.length<su){let n=Zl.encodeInto(t,ou).written||0;z(e,n);for(let t=0;t<n;t++)R(e,ou[t])}else B(e,Ql(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;z(e,r);for(let t=0;t<r;t++)R(e,n.codePointAt(t))},lu=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=Ll(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Rl(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},B=(e,t)=>{z(e,t.byteLength),lu(e,t)},uu=(e,t)=>{ru(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},du=(e,t)=>uu(e,4).setFloat32(0,t,!1),fu=(e,t)=>uu(e,8).setFloat64(0,t,!1),pu=(e,t)=>uu(e,8).setBigInt64(0,t,!1),mu=new DataView(new ArrayBuffer(4)),hu=e=>(mu.setFloat32(0,e),mu.getFloat32(0)===e),gu=(e,t)=>{switch(typeof t){case`string`:R(e,119),cu(e,t);break;case`number`:Ul(t)&&Il(t)<=2147483647?(R(e,125),au(e,t)):hu(t)?(R(e,124),du(e,t)):(R(e,123),fu(e,t));break;case`bigint`:R(e,122),pu(e,t);break;case`object`:if(t===null)R(e,126);else if(Ml(t)){R(e,117),z(e,t.length);for(let n=0;n<t.length;n++)gu(e,t[n])}else if(t instanceof Uint8Array)R(e,116),B(e,t);else{R(e,118);let n=Object.keys(t);z(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];cu(e,i),gu(e,t[i])}}break;case`boolean`:R(e,t?120:121);break;default:R(e,127)}},_u=class extends tu{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&z(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},vu=e=>{e.count>0&&(au(e.encoder,e.count===1?e.s:-e.s),e.count>1&&z(e.encoder,e.count-2))},yu=class{constructor(){this.encoder=new tu,this.s=0,this.count=0}write(e){this.s===e?this.count++:(vu(this),this.count=1,this.s=e)}toUint8Array(){return vu(this),L(this.encoder)}},bu=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);au(e.encoder,t),e.count>1&&z(e.encoder,e.count-2)}},xu=class{constructor(){this.encoder=new tu,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(bu(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return bu(this),L(this.encoder)}},Su=class{constructor(){this.sarr=[],this.s=``,this.lensE=new yu}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new tu;return this.sarr.push(this.s),this.s=``,cu(e,this.sarr.join(``)),lu(e,this.lensE.toUint8Array()),L(e)}},Cu=e=>Error(e),wu=()=>{throw Cu(`Method unimplemented`)},V=()=>{throw Cu(`Unexpected case`)},Tu=Cu(`Unexpected end of array`),Eu=Cu(`Integer out of Range`),Du=class{constructor(e){this.arr=e,this.pos=0}},Ou=e=>new Du(e),ku=e=>e.pos!==e.arr.length,Au=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},H=e=>Au(e,U(e)),ju=e=>e.arr[e.pos++],U=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>Vl)throw Eu}throw Tu},Mu=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>Vl)throw Eu}throw Tu},Nu=$l?e=>$l.decode(H(e)):e=>{let t=U(e);if(t===0)return``;{let n=String.fromCodePoint(ju(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(ju(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},Pu=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Fu=[e=>void 0,e=>null,Mu,e=>Pu(e,4).getFloat32(0,!1),e=>Pu(e,8).getFloat64(0,!1),e=>Pu(e,8).getBigInt64(0,!1),e=>!1,e=>!0,Nu,e=>{let t=U(e),n={};for(let r=0;r<t;r++){let t=Nu(e);n[t]=Iu(e)}return n},e=>{let t=U(e),n=[];for(let r=0;r<t;r++)n.push(Iu(e));return n},H],Iu=e=>Fu[127-ju(e)](e),Lu=class extends Du{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),ku(this)?this.count=U(this)+1:this.count=-1),this.count--,this.s}},Ru=class extends Du{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Mu(this);let e=Bl(this.s);this.count=1,e&&(this.s=-this.s,this.count=U(this)+2)}return this.count--,this.s}},zu=class extends Du{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=Mu(this),t=e&1;this.diff=Fl(e/2),this.count=1,t&&(this.count=U(this)+2)}return this.s+=this.diff,this.count--,this.s}},Bu=class{constructor(e){this.decoder=new Ru(e),this.str=Nu(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}};crypto.subtle;var Vu=crypto.getRandomValues.bind(crypto),Hu=()=>Vu(new Uint32Array(1))[0],Uu=`10000000-1000-4000-8000-100000000000`,Wu=()=>Uu.replace(/[018]/g,e=>(e^Hu()&15>>e/4).toString(16)),Gu=Date.now,Ku=e=>new Promise(e);Promise.all.bind(Promise),a.n(),r.n();var qu=e=>e===void 0?null:e,Ju=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},Yu=!0;try{typeof localStorage<`u`&&localStorage&&(Ju=localStorage,Yu=!1)}catch{}var Xu=Ju,Zu=e=>Yu||addEventListener(`storage`,e),Qu=e=>Yu||removeEventListener(`storage`,e),$u=Symbol(`Equality`),ed=(e,t)=>e===t||!!e?.[$u]?.(t)||!1,td=e=>typeof e==`object`,nd=Object.assign,rd=Object.keys,id=(e,t)=>{for(let n in e)t(e[n],n)},ad=(e,t)=>{let n=[];for(let r in e)n.push(t(e[r],r));return n},od=e=>rd(e).length,sd=e=>{for(let t in e)return!1;return!0},cd=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},ld=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ud=(e,t)=>e===t||od(e)===od(t)&&cd(e,(e,n)=>(e!==void 0||ld(t,n))&&ed(t[n],e)),dd=Object.freeze,fd=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&fd(e[t])}return dd(e)},pd=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&pd(e,t,n+1)}},md=e=>e,hd=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[$u]!=null)return e[$u](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!hd(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(od(e)!==od(t))return!1;for(let n in e)if(!ld(e,n)||!hd(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!hd(e[n],t[n]))return!1;break;default:return!1}return!0},gd=(e,t)=>t.includes(e),_d=a.t!==void 0&&a.t.release&&/node|io\.js/.test(a.t.release.name)&&Object.prototype.toString.call(a.t===void 0?0:a.t)===`[object process]`,vd=typeof window<`u`&&typeof document<`u`&&!_d;typeof navigator<`u`&&/Mac/.test(navigator.platform);var yd,bd=[],xd=()=>{if(yd===void 0)if(_d){yd=xl();let e=a.t.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&yd.set(t,``),t=r):t===null?bd.push(r):(yd.set(t,r),t=null)}t!==null&&yd.set(t,``)}else typeof location==`object`?(yd=xl(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);yd.set(`--${Yl(t,`-`)}`,n),yd.set(`-${Yl(t,`-`)}`,n)}})):yd=xl();return yd},Sd=e=>xd().has(e),Cd=e=>qu(_d?a.t.env[e.toUpperCase().replaceAll(`-`,`_`)]:Xu.getItem(e)),wd=e=>Sd(`--`+e)||Cd(e)!==null,Td=wd(`production`);_d&&gd(a.t.env.FORCE_COLOR,[`true`,`1`,`2`])||!Sd(`--no-colors`)&&!wd(`no-color`)&&(!_d||a.t.stdout.isTTY)&&(!_d||Sd(`--color`)||Cd(`COLORTERM`)!==null||(Cd(`TERM`)||``).includes(`color`));var Ed=e=>new Uint8Array(e),Dd=(e,t,n)=>new Uint8Array(e,t,n),Od=e=>new Uint8Array(e),kd=e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=Wl(e[n]);return btoa(t)},Ad=e=>r.t.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),jd=e=>{let t=atob(e),n=Ed(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},Md=e=>{let t=r.t.from(e,`base64`);return Dd(t.buffer,t.byteOffset,t.byteLength)},Nd=vd?kd:Ad,Pd=vd?jd:Md,Fd=e=>{let t=Ed(e.byteLength);return t.set(e),t},Id=class{constructor(e,t){this.left=e,this.right=t}},Ld=(e,t)=>new Id(e,t),Rd=e=>e.next()>=.5,zd=(e,t,n)=>Fl(e.next()*(n+1-t)+t),Bd=(e,t,n)=>Fl(e.next()*(n+1-t)+t),Vd=(e,t,n)=>Bd(e,t,n),Hd=e=>Wl(Vd(e,97,122)),Ud=(e,t=0,n=20)=>{let r=Vd(e,t,n),i=``;for(let t=0;t<r;t++)i+=Hd(e);return i},Wd=(e,t)=>t[Vd(e,0,t.length-1)],Gd=Symbol(`0schema`),Kd=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(eu(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
38
+ `)}},qd=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[$u]?ed(e,t):Ml(e)?kl(e,e=>Al(t,t=>qd(e,t))):td(e)?cd(e,(e,n)=>qd(e,t[n])):!1,W=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),qd(t,n)}equals(e){return this.constructor===e.constructor&&hd(this.shape,e.shape)}[Gd](){return!0}[$u](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){wu()}get nullable(){return Tf(this,Bf)}get optional(){return new nf(this)}cast(e){return Wf(e,this),e}expect(e){return Wf(e,this),e}},Jd=class extends W{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},G=(e,t=null)=>new Jd(e,t);G(Jd);var Yd=class extends W{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},K=e=>new Yd(e);G(Yd);var Xd=class extends W{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},Zd=(...e)=>new Xd(e),Qd=G(Xd),$d=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),ef=e=>{if(Ff.check(e))return[$d(e)];if(Qd.check(e))return e.shape.map(e=>e+``);if(Pf.check(e))return[`[+-]?\\d+.?\\d*`];if(If.check(e))return[`.*`];if(Ef.check(e))return e.shape.map(ef).flat(1);V()};G(class extends W{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(ef).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}});var tf=Symbol(`optional`),nf=class extends W{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[tf](){return!0}},rf=G(nf),af=class extends W{check(e,t){return t?.extend(null,`never`,typeof e),!1}};new af,G(af);var of=class e extends W{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):cd(this.shape,(n,r)=>{let i=this._isPartial&&!ld(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},sf=e=>new of(e),cf=G(of),lf=K(e=>e!=null&&(e.constructor===Object||e.constructor==null)),uf=class extends W{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&cd(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},df=(e,t)=>new uf(e,t),ff=G(uf),pf=class extends W{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&cd(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},mf=(...e)=>new pf(e);G(pf);var hf=class extends W{constructor(e){super(),this.shape=e.length===1?e[0]:new wf(e)}check(e,t){let n=Ml(e)&&kl(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},gf=(...e)=>new hf(e),_f=G(hf),vf=K(e=>Ml(e)),yf=class extends W{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},bf=(e,t=null)=>new yf(e,t);G(yf);var xf=bf(W),Sf=G(class extends W{constructor(e){super(),this.len=e.length-1,this.args=mf(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}}),Cf=K(e=>typeof e==`function`);G(class extends W{constructor(e){super(),this.shape=e}check(e,t){let n=kl(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},e=>e.shape.length>0);var wf=class extends W{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=Al(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},Tf=(...e)=>e.findIndex(e=>Ef.check(e))>=0?Tf(...e.map(e=>Uf(e)).map(e=>Ef.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new wf(e),Ef=G(wf),Df=()=>!0,Of=K(Df),kf=G(Yd,e=>e.shape===Df),Af=K(e=>typeof e==`bigint`),jf=K(e=>e===Af),Mf=K(e=>typeof e==`symbol`);K(e=>e===Mf);var Nf=K(e=>typeof e==`number`),Pf=K(e=>e===Nf),Ff=K(e=>typeof e==`string`),If=K(e=>e===Ff),Lf=K(e=>typeof e==`boolean`),Rf=K(e=>e===Lf),zf=Zd(void 0);G(Xd,e=>e.shape.length===1&&e.shape[0]===void 0),Zd(void 0);var Bf=Zd(null),Vf=G(Xd,e=>e.shape.length===1&&e.shape[0]===null);G(Uint8Array),G(Jd,e=>e.shape===Uint8Array);var Hf=Tf(Nf,Ff,Bf,zf,Af,Lf,Mf);(()=>{let e=gf(Of),t=df(Ff,Of),n=Tf(Nf,Ff,Bf,Lf,e,t);return e.shape=n,t.shape.values=n,n})();var Uf=e=>{if(xf.check(e))return e;if(lf.check(e)){let t={};for(let n in e)t[n]=Uf(e[n]);return sf(t)}else if(vf.check(e))return Tf(...e.map(Uf));else if(Hf.check(e))return Zd(e);else if(Cf.check(e))return G(e);V()},Wf=Td?()=>{}:(e,t)=>{let n=new Kd;if(!t.check(e,n))throw Cu(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},Gf=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:Uf(e),h:t}),this}else(e){return this.if(Of,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw Cu(`Unhandled pattern`)}}},Kf=(e=>new Gf(e))(Of).if(Pf,(e,t)=>zd(t,Hl,Vl)).if(If,(e,t)=>Ud(t)).if(Rf,(e,t)=>Rd(t)).if(jf,(e,t)=>BigInt(zd(t,Hl,Vl))).if(Ef,(e,t)=>qf(t,Wd(t,e.shape))).if(cf,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(rf.check(i)){if(Rd(t))continue;i=i.shape}n[r]=Kf(i,t)}return n}).if(_f,(e,t)=>{let n=[],r=Bd(t,0,42);for(let i=0;i<r;i++)n.push(qf(t,e.shape));return n}).if(Qd,(e,t)=>Wd(t,e.shape)).if(Vf,(e,t)=>null).if(Sf,(e,t)=>{let n=qf(t,e.res);return()=>n}).if(kf,(e,t)=>qf(t,Wd(t,[Nf,Ff,Bf,zf,Af,Lf,gf(Nf),df(Tf(`a`,`b`,`c`),Nf)]))).if(ff,(e,t)=>{let n={},r=zd(t,0,3);for(let i=0;i<r;i++){let r=qf(t,e.shape.keys);n[r]=qf(t,e.shape.values)}return n}).done(),qf=(e,t)=>Kf(Uf(t),e),Jf=typeof document<`u`?document:{};K(e=>e.nodeType===Qf),typeof DOMParser<`u`&&new DOMParser,K(e=>e.nodeType===Yf),K(e=>e.nodeType===Xf);var Yf=Jf.ELEMENT_NODE,Xf=Jf.TEXT_NODE;Jf.CDATA_SECTION_NODE,Jf.COMMENT_NODE;var Zf=Jf.DOCUMENT_NODE;Jf.DOCUMENT_TYPE_NODE;var Qf=Jf.DOCUMENT_FRAGMENT_NODE;K(e=>e.nodeType===Zf);var $f=Symbol,ep=$f(),tp=$f();$f(),$f(),$f();var np=$f();$f();var rp=$f();$f(),Gu(),Ld(`font-weight`,`bold`),Ld(`font-weight`,`normal`),Ld(`color`,`blue`),Ld(`color`,`green`),Ld(`color`,`grey`),Ld(`color`,`red`),Ld(`color`,`purple`),Ld(`color`,`orange`),Ld(`color`,`black`);var ip=(...e)=>{op.forEach(t=>t.print(e))},ap=(...e)=>{e.unshift(rp),op.forEach(t=>t.print(e))},op=Tl(),sp=e=>({[Symbol.iterator](){return this},next:e}),cp=(e,t)=>sp(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),lp=(e,t)=>sp(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}),up=class{constructor(e,t){this.clock=e,this.len=t}},dp=class{constructor(){this.clients=new Map}},fp=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])Cm(e,i,o.clock,o.len,n)}}),pp=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=Fl((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},mp=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&pp(n,t.clock)!==null},hp=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new up(r.clock,Rl(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},gp=e=>{let t=new dp;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)Dl(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return hp(t),t},_p=(e,t,n,r)=>{Cl(e.clients,t,()=>[]).push(new up(n,r))},vp=()=>new dp,yp=e=>{let t=vp();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new up(i,a))}}r.length>0&&t.clients.set(n,r)}),t},bp=(e,t)=>{z(e.restEncoder,t.clients.size),Ol(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),z(e.restEncoder,t);let r=n.length;z(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},xp=e=>{let t=new dp,n=U(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=U(e.restDecoder),r=U(e.restDecoder);if(r>0){let i=Cl(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new up(e.readDsClock(),e.readDsLen()))}}return t},Sp=(e,t,n)=>{let r=new dp,i=U(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=U(e.restDecoder),a=U(e.restDecoder),o=n.clients.get(i)||[],s=J(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&_p(r,i,s,a-s);let e=_m(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,Ag(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,Ag(t,c,a-c.id.clock)),c.delete(t))}else _p(r,i,n,a-n)}}if(r.clients.size>0){let e=new Mp;return z(e.restEncoder,0),bp(e,r),e.toUint8Array()}return null},Cp=Hu,wp=class e extends Nl{constructor({guid:e=Wu(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=Cp(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new mm,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Ku(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>Ku(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&Y(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Ol(this.subdocs).map(e=>e.guid))}transact(e,t=null){return Y(this,e,t)}get(e,t=Z){let n=Cl(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==Z&&r!==t)if(r===Z){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}else throw Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=``){return this.get(e,bh)}getText(e=``){return this.get(e,Vh)}getMap(e=``){return this.get(e,Ch)}getXmlElement(e=``){return this.get(e,Kh)}getXmlFragment(e=``){return this.get(e,Wh)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,Ol(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,Y(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},Tp=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return U(this.restDecoder)}readDsLen(){return U(this.restDecoder)}},Ep=class extends Tp{readLeftID(){return q(U(this.restDecoder),U(this.restDecoder))}readRightID(){return q(U(this.restDecoder),U(this.restDecoder))}readClient(){return U(this.restDecoder)}readInfo(){return ju(this.restDecoder)}readString(){return Nu(this.restDecoder)}readParentInfo(){return U(this.restDecoder)===1}readTypeRef(){return U(this.restDecoder)}readLen(){return U(this.restDecoder)}readAny(){return Iu(this.restDecoder)}readBuf(){return Fd(H(this.restDecoder))}readJSON(){return JSON.parse(Nu(this.restDecoder))}readKey(){return Nu(this.restDecoder)}},Dp=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=U(this.restDecoder),this.dsCurrVal}readDsLen(){let e=U(this.restDecoder)+1;return this.dsCurrVal+=e,e}},Op=class extends Dp{constructor(e){super(e),this.keys=[],U(e),this.keyClockDecoder=new zu(H(e)),this.clientDecoder=new Ru(H(e)),this.leftClockDecoder=new zu(H(e)),this.rightClockDecoder=new zu(H(e)),this.infoDecoder=new Lu(H(e),ju),this.stringDecoder=new Bu(H(e)),this.parentInfoDecoder=new Lu(H(e),ju),this.typeRefDecoder=new Ru(H(e)),this.lenDecoder=new Ru(H(e))}readLeftID(){return new tm(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new tm(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Iu(this.restDecoder)}readBuf(){return H(this.restDecoder)}readJSON(){return Iu(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},kp=class{constructor(){this.restEncoder=I()}toUint8Array(){return L(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){z(this.restEncoder,e)}writeDsLen(e){z(this.restEncoder,e)}},Ap=class extends kp{writeLeftID(e){z(this.restEncoder,e.client),z(this.restEncoder,e.clock)}writeRightID(e){z(this.restEncoder,e.client),z(this.restEncoder,e.clock)}writeClient(e){z(this.restEncoder,e)}writeInfo(e){iu(this.restEncoder,e)}writeString(e){cu(this.restEncoder,e)}writeParentInfo(e){z(this.restEncoder,+!!e)}writeTypeRef(e){z(this.restEncoder,e)}writeLen(e){z(this.restEncoder,e)}writeAny(e){gu(this.restEncoder,e)}writeBuf(e){B(this.restEncoder,e)}writeJSON(e){cu(this.restEncoder,JSON.stringify(e))}writeKey(e){cu(this.restEncoder,e)}},jp=class{constructor(){this.restEncoder=I(),this.dsCurrVal=0}toUint8Array(){return L(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,z(this.restEncoder,t)}writeDsLen(e){e===0&&V(),z(this.restEncoder,e-1),this.dsCurrVal+=e}},Mp=class extends jp{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new xu,this.clientEncoder=new yu,this.leftClockEncoder=new xu,this.rightClockEncoder=new xu,this.infoEncoder=new _u(iu),this.stringEncoder=new Su,this.parentInfoEncoder=new _u(iu),this.typeRefEncoder=new yu,this.lenEncoder=new yu}toUint8Array(){let e=I();return z(e,0),B(e,this.keyClockEncoder.toUint8Array()),B(e,this.clientEncoder.toUint8Array()),B(e,this.leftClockEncoder.toUint8Array()),B(e,this.rightClockEncoder.toUint8Array()),B(e,L(this.infoEncoder)),B(e,this.stringEncoder.toUint8Array()),B(e,L(this.parentInfoEncoder)),B(e,this.typeRefEncoder.toUint8Array()),B(e,this.lenEncoder.toUint8Array()),lu(e,L(this.restEncoder)),L(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(+!!e)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){gu(this.restEncoder,e)}writeBuf(e){B(this.restEncoder,e)}writeJSON(e){gu(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},Np=(e,t,n,r)=>{r=Rl(r,t[0].id.clock);let i=_m(t,r);z(e.restEncoder,t.length-i),e.writeClient(n),z(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},Pp=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{J(t,n)>e&&r.set(n,e)}),hm(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),z(e.restEncoder,r.size),Ol(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{Np(e,t.clients.get(n),n,r)})},Fp=(e,t)=>{let n=xl(),r=U(e.restDecoder);for(let i=0;i<r;i++){let r=U(e.restDecoder),i=Array(r),a=e.readClient(),o=U(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new tg(q(a,o),t),o+=t;break}case 10:{let t=U(e.restDecoder);i[n]=new Pg(q(a,o),t),o+=t;break}default:{let s=(r&192)==0,c=new $(q(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,jg(e,r));i[n]=c,o+=c.length}}}}return n},Ip=(e,t,n)=>{let r=[],i=Ol(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new mm,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==Pg){let i=Cl(d,u.id.client,()=>J(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,J(t,a)),f();else{u=e.refs[e.i++];continue}}else (i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new Mp;return Pp(e,s,new Map),z(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},Lp=(e,t)=>Pp(e,t.doc.store,t.beforeState),Rp=(e,t,n,r=new Op(e))=>Y(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=Ip(e,i,Fp(r,n)),o=i.pendingStructs;if(o){for(let[e,n]of o.missing)if(n<J(i,e)){t=!0;break}if(a){for(let[e,t]of a.missing){let n=o.missing.get(e);(n==null||n>t)&&o.missing.set(e,t)}o.update=Im([o.update,a.update])}}else i.pendingStructs=a;let s=Sp(r,e,i);if(i.pendingDs){let t=new Op(Ou(i.pendingDs));U(t.restDecoder);let n=Sp(t,e,i);s&&n?i.pendingDs=Im([s,n]):i.pendingDs=s||n}else i.pendingDs=s;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,zp(e.doc,t)}},n,!1),zp=(e,t,n,r=Op)=>{let i=Ou(t);Rp(i,e,n,new r(i))},Bp=(e,t,n)=>zp(e,t,n,Ep),Vp=(e,t,n=new Map)=>{Pp(e,t.store,n),bp(e,yp(t.store))},Hp=(e,t=new Uint8Array([0]),n=new Mp)=>{Vp(n,e,Gp(t));let r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(Lm(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===Ap)return Pm(r.map((e,t)=>t===0?e:Hm(e)));if(n.constructor===Mp)return Im(r)}return r[0]},Up=(e,t)=>Hp(e,t,new Ap),Wp=e=>{let t=new Map,n=U(e.restDecoder);for(let r=0;r<n;r++){let n=U(e.restDecoder),r=U(e.restDecoder);t.set(n,r)}return t},Gp=e=>Wp(new Tp(Ou(e))),Kp=(e,t)=>(z(e.restEncoder,t.size),Ol(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{z(e.restEncoder,t),z(e.restEncoder,n)}),e),qp=(e,t)=>Kp(e,hm(t.store)),Jp=(e,t=new jp)=>(e instanceof Map?Kp(t,e):qp(t,e),t.toUint8Array()),Yp=e=>Jp(e,new kp),Xp=class{constructor(){this.l=[]}},Zp=()=>new Xp,Qp=(e,t)=>e.l.push(t),$p=(e,t)=>{let n=e.l;n.length,e.l=n.filter(e=>t!==e),e.l.length},em=(e,t,n)=>pd(e.l,[t,n]),tm=class{constructor(e,t){this.client=e,this.clock=t}},nm=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,q=(e,t)=>new tm(e,t),rm=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw V()},im=class{constructor(e,t,n,r=0){this.type=e,this.tname=t,this.item=n,this.assoc=r}},am=class{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}},om=(e,t,n=0)=>new am(e,t,n),sm=(e,t,n)=>{let r=null,i=null;return e._item===null?i=rm(e):r=q(e._item.id.client,e._item.id.clock),new im(r,i,t,n)},cm=(e,t,n=0)=>{let r=e._start;if(n<0){if(t===0)return sm(e,null,n);t--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>t)return sm(e,q(r.id.client,r.id.clock+t),n);t-=r.length}if(r.right===null&&n<0)return sm(e,r.lastId,n);r=r.right}return sm(e,null,n)},lm=(e,t)=>{let n=vm(e,t);return{item:n,diff:t.clock-n.id.clock}},um=(e,t,n=!0)=>{let r=t.store,i=e.item,a=e.type,o=e.tname,s=e.assoc,c=null,l=0;if(i!==null){if(J(r,i.client)<=i.clock)return null;let e=n?kg(r,i):lm(r,i),t=e.item;if(!(t instanceof $))return null;if(c=t.parent,c._item===null||!c._item.deleted){l=t.deleted||!t.countable?0:e.diff+(s>=0?0:1);let n=t.left;for(;n!==null;)!n.deleted&&n.countable&&(l+=n.length),n=n.left}}else{if(o!==null)c=t.get(o);else if(a!==null){if(J(r,a.client)<=a.clock)return null;let{item:e}=n?kg(r,a):{item:vm(r,a)};if(e instanceof $&&e.content instanceof Dg)c=e.content.type;else return null}else throw V();l=s>=0?c._length:0}return om(c,l,e.assoc)},dm=class{constructor(e,t){this.ds=e,this.sv=t}};((e,t)=>new dm(e,t))(vp(),new Map);var fm=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!mp(t.ds,e.id),pm=(e,t)=>{let n=Cl(e.meta,pm,Tl),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<J(r,n)&&bm(e,q(n,t))}),fp(e,t.ds,e=>{}),n.add(t))},mm=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},hm=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},J=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},gm=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw V()}n.push(t)},_m=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=Fl(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=Fl((n+r)/2)}throw V()},vm=(e,t)=>{let n=e.clients.get(t.client);return n[_m(n,t.clock)]},ym=(e,t,n)=>{let r=_m(t,n),i=t[r];return i.id.clock<n&&i instanceof $?(t.splice(r+1,0,Ag(e,i,n-i.id.clock)),r+1):r},bm=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[ym(e,n,t.clock)]},xm=(e,t,n)=>{let r=t.clients.get(n.client),i=_m(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==tg&&r.splice(i+1,0,Ag(e,a,n.clock-a.id.clock+1)),a},Sm=(e,t,n)=>{let r=e.clients.get(t.id.client);r[_m(r,t.id.clock)]=n},Cm=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=ym(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&ym(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},wm=class{constructor(e,t,n){this.doc=e,this.deleteSet=new dp,this.beforeState=hm(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},Tm=(e,t)=>t.deleteSet.clients.size===0&&!wl(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(hp(t.deleteSet),Lp(e,t),bp(e,t.deleteSet),!0),Em=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&Cl(e.changed,t,Tl).add(n)},Dm=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof $&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}let a=t-i;return a&&e.splice(t+1-a,a),a},Om=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=_m(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof $&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},km=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=Ll(r.length-1,1+_m(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+Dm(r,e)}})},Am=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{hp(a),n.afterState=hm(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{(r._item===null||!r._item.deleted)&&r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&(t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{em(r._dEH,t,n)}))}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&Rh(n)})}),pd(e,[])}finally{r.gc&&Om(a,i,r.gcFilter),km(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=Rl(_m(e,r),1);for(let t=e.length-1;t>=n;)t-=1+Dm(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=_m(r,n);a+1<r.length&&Dm(r,a+1)>1||a>0&&Dm(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(ip(rp,ep,`[yjs] `,tp,np,`Changed the client-id because another client seems to be using it.`),r.clientID=Cp()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new Ap;Tm(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new Mp;Tm(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):Am(e,t+1)}}},Y=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new wm(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&Am(i,0)}}return o};function*jm(e){let t=U(e.restDecoder);for(let n=0;n<t;n++){let t=U(e.restDecoder),n=e.readClient(),r=U(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=U(e.restDecoder);yield new Pg(q(n,r),t),r+=t}else if(31&t){let i=(t&192)==0,a=new $(q(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,jg(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new tg(q(n,r),t),r+=t}}}}var Mm=class{constructor(e,t){this.gen=jm(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===Pg);return this.curr}},Nm=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},Pm=e=>Im(e,Ep,Ap),Fm=(e,t)=>{if(e.constructor===tg){let{client:n,clock:r}=e.id;return new tg(q(n,r+t),e.length-t)}else if(e.constructor===Pg){let{client:n,clock:r}=e.id;return new Pg(q(n,r+t),e.length-t)}else{let n=e,{client:r,clock:i}=n.id;return new $(q(r,i+t),null,q(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},Im=(e,t=Op,n=Mp)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(Ou(e))),i=r.map(e=>new Mm(e,!0)),a=null,o=new n,s=new Nm(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===Pg?1:-1:n}else return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)zm(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock)if(a.struct.constructor===Pg)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{zm(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new Pg(q(t,a.struct.id.clock+a.struct.length),e),offset:0}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===Pg?a.struct.length-=t:n=Fm(n,t)),a.struct.mergeWith(n)||(zm(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==Pg;n=e.next())zm(s,a.struct,a.offset),a={struct:n,offset:0}}return a!==null&&(zm(s,a.struct,a.offset),a=null),Bm(s),bp(o,gp(r.map(e=>xp(e)))),o.toUint8Array()},Lm=(e,t,n=Op,r=Mp)=>{let i=Gp(t),a=new r,o=new Nm(a),s=new n(Ou(e)),c=new Mm(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===Pg){c.next();continue}if(e.id.clock+e.length>n)for(zm(o,e,Rl(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)zm(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}return Bm(o),bp(a,xp(s)),a.toUint8Array()},Rm=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:L(e.encoder.restEncoder)}),e.encoder.restEncoder=I(),e.written=0)},zm=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Rm(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),z(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Bm=e=>{Rm(e);let t=e.encoder.restEncoder;z(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];z(t,r.written),lu(t,r.restEncoder)}},Vm=(e,t,n,r)=>{let i=new n(Ou(e)),a=new Mm(i,!1),o=new r,s=new Nm(o);for(let e=a.curr;e!==null;e=a.next())zm(s,t(e),0);return Bm(s),bp(o,xp(i)),o.toUint8Array()},Hm=e=>Vm(e,md,Op,Ap),Um=`You must not compute changes after the event-handler fired.`,Wm=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=Gm(this.currentTarget,this.target)}deletes(e){return mp(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Cu(Um);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r))if(e!==null&&this.deletes(e))i=`delete`,a=El(e.content.getContent());else return;else e!==null&&this.deletes(e)?(i=`update`,a=El(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=El(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Cu(Um);let t=this.target,n=Tl(),r=Tl(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},Gm=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},X=()=>{ap(`Invalid access: Add Yjs type to a document before reading data.`)},Km=80,qm=0,Jm=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=qm++}},Ym=e=>{e.timestamp=qm++},Xm=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=qm++},Zm=(e,t,n)=>{if(e.length>=Km){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return Xm(r,t,n),r}else{let r=new Jm(t,n);return e.push(r),r}},Qm=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>Il(t-e.index)<Il(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,Ym(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&Il(n.index-i)<r.parent.length/Km?(Xm(n,r,i),n):Zm(e._searchMarker,r,i)},$m=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=Rl(t,i.index+n))}},eh=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;Cl(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;em(r._eH,n,t)},Z=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Zp(),this._dEH=Zp(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw wu()}clone(){throw wu()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Qp(this._eH,e)}observeDeep(e){Qp(this._dEH,e)}unobserve(e){$p(this._eH,e)}unobserveDeep(e){$p(this._dEH,e)}toJSON(){}},th=(e,t,n)=>{e.doc??X(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},nh=e=>{e.doc??X();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},rh=(e,t)=>{let n=0,r=e._start;for(e.doc??X();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},ih=(e,t)=>{let n=[];return rh(e,(r,i)=>{n.push(t(r,i,e))}),n},ah=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},oh=(e,t)=>{e.doc??X();let n=Qm(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},sh=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new $(q(o,J(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new hg(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new $(q(o,J(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new ng(new Uint8Array(n))),i.integrate(e,0);break;case wp:i=new $(q(o,J(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new sg(n)),i.integrate(e,0);break;default:if(n instanceof Z)i=new $(q(o,J(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new Dg(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},ch=()=>Cu(`Length exceeded!`),lh=(e,t,n,r)=>{if(n>t._length)throw ch();if(n===0)return t._searchMarker&&$m(t._searchMarker,n,r.length),sh(e,t,null,r);let i=n,a=Qm(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&bm(e,q(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&$m(t._searchMarker,i,r.length),sh(e,t,o,r)},uh=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return sh(e,t,r,n)},dh=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=Qm(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&bm(e,q(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&bm(e,q(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw ch();t._searchMarker&&$m(t._searchMarker,i,-a+r)},fh=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},ph=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new hg([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new hg([r]);break;case Uint8Array:s=new ng(r);break;case wp:s=new sg(r);break;default:if(r instanceof Z)s=new Dg(r);else throw Error(`Unexpected content type`)}new $(q(o,J(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},mh=(e,t)=>{e.doc??X();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},hh=e=>{let t={};return e.doc??X(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},gh=(e,t)=>{e.doc??X();let n=e._map.get(t);return n!==void 0&&!n.deleted},_h=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&fm(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},vh=e=>(e.doc??X(),cp(e._map.entries(),e=>!e[1].deleted)),yh=class extends Wm{},bh=class e extends Z{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof Z?e.clone():e)),t}get length(){return this.doc??X(),this._length}_callObserver(e,t){super._callObserver(e,t),eh(this,e,new yh(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):Y(this.doc,n=>{lh(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):Y(this.doc,t=>{uh(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):Y(this.doc,n=>{dh(n,this,e,t)})}get(e){return oh(this,e)}toArray(){return nh(this)}slice(e=0,t=this.length){return th(this,e,t)}toJSON(){return this.map(e=>e instanceof Z?e.toJSON():e)}map(e){return ih(this,e)}forEach(e){rh(this,e)}[Symbol.iterator](){return ah(this)}_write(e){e.writeTypeRef(bg)}},xh=e=>new bh,Sh=class extends Wm{constructor(e,t,n){super(e,t),this.keysChanged=n}},Ch=class e extends Z{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof Z?e.clone():e)}),t}_callObserver(e,t){eh(this,e,new Sh(this,e,t))}toJSON(){this.doc??X();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof Z?r.toJSON():r}}),e}get size(){return[...vh(this)].length}keys(){return lp(vh(this),e=>e[0])}values(){return lp(vh(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return lp(vh(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??X(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):Y(this.doc,t=>{fh(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):Y(this.doc,n=>{ph(n,this,e,t)}),t}get(e){return mh(this,e)}has(e){return gh(this,e)}clear(){this.doc===null?this._prelimContent.clear():Y(this.doc,e=>{this.forEach(function(t,n,r){fh(e,r,n)})})}_write(e){e.writeTypeRef(xg)}},wh=e=>new Ch,Th=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&ud(e,t),Eh=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&V(),this.right.content.constructor){case Q:this.right.deleted||Ah(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}},Dh=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case Q:t.right.deleted||Ah(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&bm(e,q(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},Oh=(e,t,n,r)=>{let i=new Map,a=r?Qm(t,n):null;return a?Dh(e,new Eh(a.p.left,a.p,a.index,i),n-a.index):Dh(e,new Eh(null,t._start,0,i),n)},kh=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Q&&Th(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new $(q(a,J(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new Q(o,r));l.integrate(e,0),n.right=l,n.forward()})},Ah=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},jh=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===Q&&Th(t[e.right.content.key]??null,e.right.content.value));)e.forward()},Mh=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!Th(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new $(q(a,J(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new Q(s,c)),n.right.integrate(e,0),n.forward()}}return o},Nh=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;jh(n,i);let s=Mh(e,t,n,i),c=r.constructor===String?new _g(r):r instanceof Z?new Dg(r):new lg(r),{left:l,right:u,index:d}=n;t._searchMarker&&$m(t._searchMarker,n.index,c.getLength()),u=new $(q(o,J(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),kh(e,t,n,s)},Ph=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;jh(n,i);let s=Mh(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===Q));){if(!n.right.deleted)switch(n.right.content.constructor){case Q:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(Th(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&bm(e,q(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
39
+ `;n.right=new $(q(o,J(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new _g(i)),n.right.integrate(e,0),n.forward()}kh(e,t,n,s)},Fh=(e,t,n,r,i)=>{let a=t,o=xl();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===Q){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case Q:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&Ah(i,n);break}}}t=t.right}return s},Ih=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Q){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},Lh=e=>{let t=0;return Y(e.doc,n=>{let r=e._start,i=e._start,a=xl(),o=Sl(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case Q:Ah(o,i.content);break;default:t+=Fh(n,r,i,a,o),a=Sl(o),r=i;break}i=i.right}}),t},Rh=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&Cm(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===Q&&e.constructor!==tg&&t.add(e.parent)})}Y(n,n=>{fp(e,e.deleteSet,e=>{if(e instanceof tg||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===Q?t.add(r):Ih(n,e)});for(let e of t)Lh(e)})},zh=(e,t,n)=>{let r=n,i=Sl(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case Dg:case lg:case _g:n<t.right.length&&bm(e,q(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}a&&Fh(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&$m(o._searchMarker,t.index,-r+n),t},Bh=class extends Wm{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){return this._changes===null&&(this._changes={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set}),this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];Y(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},sd(o)||(e.attributes=nd({},o))),c=0;break}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case Dg:case lg:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case _g:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case Q:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(Th(n.get(t)??null,s)?s!==null&&i.delete(e):(a===`retain`&&u(),Th(s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;Th(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(Th(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),Ah(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},Vh=class e extends Z{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??X(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch{}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new Bh(this,e,t);eh(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??X();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===_g&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):Y(this.doc,n=>{let r=new Eh(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
40
+ `?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&Nh(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&zh(n,r,a.delete):Ph(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??X();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(fm(s,e)||t!==void 0&&fm(s,t))switch(s.content.constructor){case _g:{let r=i.get(`ychange`);e!==void 0&&!fm(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!fm(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case Dg:case lg:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case Q:fm(s,e)&&(c(),Ah(i,s.content));break}s=s.right}c()};return e||t?Y(a,n=>{e&&pm(n,e),t&&pm(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):Y(r,r=>{let i=Oh(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),Nh(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):Y(r,r=>{let i=Oh(r,this,e,!n);Nh(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):Y(n,n=>{zh(n,Oh(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):Y(r,r=>{let i=Oh(r,this,e,!1);i.right!==null&&Ph(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):Y(this.doc,t=>{fh(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):Y(this.doc,n=>{ph(n,this,e,t)})}getAttribute(e){return mh(this,e)}getAttributes(){return hh(this)}_write(e){e.writeTypeRef(Sg)}},Hh=e=>new Vh,Uh=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??X()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===Kh||t.constructor===Wh)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}else e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},Wh=class e extends Z{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof Z?e.clone():e)),t}get length(){return this.doc??X(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Uh(this,e)}querySelector(e){e=e.toUpperCase();let t=new Uh(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),Ol(new Uh(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){eh(this,e,new Jh(this,t,e))}toString(){return ih(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),rh(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):Y(this.doc,n=>{lh(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)Y(this.doc,n=>{let r=e&&e instanceof Z?e._item:e;sh(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw Cu(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):Y(this.doc,n=>{dh(n,this,e,t)})}toArray(){return nh(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return oh(this,e)}slice(e=0,t=this.length){return th(this,e,t)}forEach(e){rh(this,e)}_write(e){e.writeTypeRef(wg)}},Gh=e=>new Wh,Kh=class e extends Wh{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName);return id(this.getAttributes(),(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof Z?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):Y(this.doc,t=>{fh(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):Y(this.doc,n=>{ph(n,this,e,t)})}getAttribute(e){return mh(this,e)}hasAttribute(e){return gh(this,e)}getAttributes(e){return e?_h(this,e):hh(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return rh(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(Cg),e.writeKey(this.nodeName)}},qh=e=>new Kh(e.readKey()),Jh=class extends Wm{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},Yh=class e extends Ch{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(Tg),e.writeKey(this.hookName)}},Xh=e=>new Yh(e.readKey()),Zh=class e extends Vh{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(Eg)}},Qh=e=>new Zh,$h=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw wu()}mergeWith(e){return!1}write(e,t,n){throw wu()}integrate(e,t){throw wu()}},eg=0,tg=class extends $h{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),gm(e.doc.store,this)}write(e,t){e.writeInfo(eg),e.writeLen(this.length-t)}getMissing(e,t){return null}},ng=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw wu()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},rg=e=>new ng(e.readBuf()),ig=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){_p(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},ag=e=>new ig(e.readLen()),og=(e,t)=>new wp({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),sg=class e{constructor(e){e._item,this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(og(this.doc.guid,this.opts))}splice(e){throw wu()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},cg=e=>new sg(og(e.readString(),e.readAny())),lg=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw wu()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},ug=e=>new lg(e.readJSON()),Q=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw wu()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},dg=e=>new Q(e.readKey(),e.readJSON()),fg=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},pg=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new fg(n)},mg=Cd(`node_env`)===`development`,hg=class e{constructor(e){this.arr=e,mg&&fd(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},gg=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new hg(n)},_g=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},vg=e=>new _g(e.readString()),yg=[xh,wh,Hh,qh,Gh,Xh,Qh],bg=0,xg=1,Sg=2,Cg=3,wg=4,Tg=5,Eg=6,Dg=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw wu()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},Og=e=>new Dg(yg[e.readTypeRef()](e)),kg=(e,t)=>{let n=t,r=0,i;do r>0&&(n=q(n.client,n.clock+r)),i=vm(e,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof $);return{item:i,diff:r}},Ag=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new $(q(r,i+n),t,q(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=q(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},$=class e extends $h{constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=J(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=J(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===tm&&this.id.client!==this.parent.client&&this.parent.clock>=J(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=xm(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=bm(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===tg||this.right&&this.right.constructor===tg)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===tm){let e=vm(n,this.parent);e.constructor===tg?this.parent=null:this.parent=e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=xm(e,e.doc.store,q(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),nm(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(nm(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(vm(e.doc.store,n.origin)))r.has(vm(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null)this.right=this.left.right,this.left.right=this;else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),gm(e.doc.store,this),this.content.integrate(e,this),Em(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new tg(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:q(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&nm(e.origin,this.lastId)&&this.right===e&&nm(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),_p(e.deleteSet,this.id.client,this.id.clock,this.length),Em(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw V();this.content.gc(e),t?Sm(e,this,new tg(this.id,this.length)):this.content=new ig(this.length)}write(e,t){let n=t>0?q(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=rm(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===tm?(e.writeParentInfo(!1),e.writeLeftID(t)):V();i!==null&&e.writeString(i)}this.content.write(e,t)}},jg=(e,t)=>Mg[t&31](e),Mg=[()=>{V()},ag,pg,rg,vg,ug,dg,Og,gg,cg,()=>{V()}],Ng=10,Pg=class extends $h{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){V()}write(e,t){e.writeInfo(Ng),z(e.restEncoder,this.length-t)}getMissing(e,t){return null}},Fg=typeof globalThis<`u`?globalThis:typeof window<`u`?window:r.r===void 0?{}:r.r,Ig=`__ $YJS$ __`;Fg[Ig],Fg[Ig]=!0;var Lg=new Map,Rg=class{constructor(e){this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&this.onmessage!==null&&this.onmessage({data:Pd(t.newValue||``)}),Zu(this._onChange)}postMessage(e){Xu.setItem(this.room,Nd(Od(e)))}close(){Qu(this._onChange)}},zg=typeof BroadcastChannel>`u`?Rg:BroadcastChannel,Bg=e=>Cl(Lg,e,()=>{let t=Tl(),n=new zg(e);return n.onmessage=e=>t.forEach(t=>t(e.data,`broadcastchannel`)),{bc:n,subs:t}}),Vg=(e,t)=>(Bg(e).subs.add(t),t),Hg=(e,t)=>{let n=Bg(e),r=n.subs.delete(t);return r&&n.subs.size===0&&(n.bc.close(),Lg.delete(e)),r},Ug=(e,t,n=null)=>{let r=Bg(e);r.bc.postMessage(t),r.subs.forEach(e=>e(t,n))},Wg=(e,t)=>{z(e,0),B(e,Yp(t))},Gg=(e,t,n)=>{z(e,1),B(e,Up(t,n))},Kg=(e,t,n)=>Gg(t,n,H(e)),qg=(e,t,n,r)=>{try{Bp(t,H(e),n)}catch(e){r?.(e)}},Jg=(e,t)=>{z(e,2),B(e,t)},Yg=qg,Xg=(e,t,n,r,i)=>{let a=U(e);switch(a){case 0:Kg(e,t,n);break;case 1:qg(e,n,r,i);break;case 2:Yg(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a},Zg=(e,t,n)=>{switch(U(e)){case 0:n(t,Nu(e))}},Qg=3e4,$g=class extends Pl{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=Gu();this.getLocalState()!==null&&3e4/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&e_(this,t,`timeout`)},Fl(Qg/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:Gu()});let a=[],o=[],s=[],c=[];e===null?c.push(t):i==null?e!=null&&a.push(t):(o.push(t),hd(i,e)||s.push(t)),(a.length>0||s.length>0||c.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:c},`local`]),this.emit(`update`,[{added:a,updated:o,removed:c},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},e_=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:Gu()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},t_=(e,t,n=e.states)=>{let r=t.length,i=I();z(i,r);for(let a=0;a<r;a++){let r=t[a],o=n.get(r)||null,s=e.meta.get(r).clock;z(i,r),z(i,s),cu(i,JSON.stringify(o))}return L(i)},n_=(e,t,n)=>{let r=Ou(t),i=Gu(),a=[],o=[],s=[],c=[],l=U(r);for(let t=0;t<l;t++){let t=U(r),n=U(r),l=JSON.parse(Nu(r)),u=e.meta.get(t),d=e.states.get(t),f=u===void 0?0:u.clock;(f<n||f===n&&l===null&&e.states.has(t))&&(l===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,l),e.meta.set(t,{clock:n,lastUpdated:i}),u===void 0&&l!==null?a.push(t):u!==void 0&&l===null?c.push(t):l!==null&&(hd(l,d)||s.push(t),o.push(t)))}(a.length>0||s.length>0||c.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:c},n]),(a.length>0||o.length>0||c.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:c},n])},r_=e=>ad(e,(e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join(`&`);a.n();var i_=[];i_[0]=(e,t,n,r,i)=>{z(e,0);let a=Xg(t,e,n.doc,n);r&&a===1&&!n.synced&&(n.synced=!0)},i_[3]=(e,t,n,r,i)=>{z(e,1),B(e,t_(n.awareness,Array.from(n.awareness.getStates().keys())))},i_[1]=(e,t,n,r,i)=>{n_(n.awareness,H(t),n)},i_[2]=(e,t,n,r,i)=>{Zg(t,n.doc,(e,t)=>o_(n,t))};var a_=3e4,o_=(e,t)=>void 0,s_=(e,t,n)=>{let r=Ou(t),i=I(),a=U(r),o=e.messageHandlers[a];return o&&o(i,r,e,n,a),i},c_=(e,t,n)=>{t===e.ws&&(e.emit(`connection-close`,[n,e]),e.ws=null,t.close(),e.wsconnecting=!1,e.wsconnected?(e.wsconnected=!1,e.synced=!1,e_(e.awareness,Array.from(e.awareness.getStates().keys()).filter(t=>t!==e.doc.clientID),e),e.emit(`status`,[{status:`disconnected`}])):e.wsUnsuccessfulReconnects++,setTimeout(l_,Ll(zl(2,e.wsUnsuccessfulReconnects)*100,e.maxBackoffTime),e))},l_=e=>{if(e.shouldConnect&&e.ws===null){let t=new e._WS(e.url,e.protocols);t.binaryType=`arraybuffer`,e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=n=>{e.wsLastMessageReceived=Gu();let r=s_(e,new Uint8Array(n.data),!0);nu(r)>1&&t.send(L(r))},t.onerror=t=>{e.emit(`connection-error`,[t,e])},t.onclose=n=>{c_(e,t,n)},t.onopen=()=>{e.wsLastMessageReceived=Gu(),e.wsconnecting=!1,e.wsconnected=!0,e.wsUnsuccessfulReconnects=0,e.emit(`status`,[{status:`connected`}]);let n=I();if(z(n,0),Wg(n,e.doc),t.send(L(n)),e.awareness.getLocalState()!==null){let n=I();z(n,1),B(n,t_(e.awareness,[e.doc.clientID])),t.send(L(n))}},e.emit(`status`,[{status:`connecting`}])}},u_=(e,t)=>{let n=e.ws;e.wsconnected&&n&&n.readyState===n.OPEN&&n.send(t),e.bcconnected&&Ug(e.bcChannel,t,e)},d_=class extends Nl{constructor(e,t,n,{connect:r=!0,awareness:i=new $g(n),params:o={},protocols:s=[],WebSocketPolyfill:c=WebSocket,resyncInterval:l=-1,maxBackoffTime:u=2500,disableBc:d=!1}={}){for(super();e[e.length-1]===`/`;)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+`/`+t,this.maxBackoffTime=u,this.params=o,this.protocols=s,this.roomname=t,this.doc=n,this._WS=c,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=d,this.wsUnsuccessfulReconnects=0,this.messageHandlers=i_.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=r,this._resyncInterval=0,l>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){let e=I();z(e,0),Wg(e,n),this.ws.send(L(e))}},l)),this._bcSubscriber=(e,t)=>{if(t!==this){let t=s_(this,new Uint8Array(e),!1);nu(t)>1&&Ug(this.bcChannel,L(t),this)}},this._updateHandler=(e,t)=>{if(t!==this){let t=I();z(t,0),Jg(t,e),u_(this,L(t))}},this.doc.on(`update`,this._updateHandler),this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{let a=e.concat(t).concat(n),o=I();z(o,1),B(o,t_(i,a)),u_(this,L(o))},this._exitHandler=()=>{e_(this.awareness,[n.clientID],`app closed`)},_d&&a.t!==void 0&&a.t.on(`exit`,this._exitHandler),i.on(`update`,this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&a_<Gu()-this.wsLastMessageReceived&&c_(this,this.ws,null)},a_/10),r&&this.connect()}get url(){let e=r_(this.params);return this.serverUrl+`/`+this.roomname+(e.length===0?``:`?`+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,this.emit(`synced`,[e]),this.emit(`sync`,[e]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),_d&&a.t!==void 0&&a.t.off(`exit`,this._exitHandler),this.awareness.off(`update`,this._awarenessUpdateHandler),this.doc.off(`update`,this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||=(Vg(this.bcChannel,this._bcSubscriber),!0);let e=I();z(e,0),Wg(e,this.doc),Ug(this.bcChannel,L(e),this);let t=I();z(t,0),Gg(t,this.doc),Ug(this.bcChannel,L(t),this);let n=I();z(n,3),Ug(this.bcChannel,L(n),this);let r=I();z(r,1),B(r,t_(this.awareness,[this.doc.clientID])),Ug(this.bcChannel,L(r),this)}disconnectBc(){let e=I();z(e,1),B(e,t_(this.awareness,[this.doc.clientID],new Map)),u_(this,L(e)),this.bcconnected&&=(Hg(this.bcChannel,this._bcSubscriber),!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&c_(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(l_(this),this.connectBc())}},f_=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},p_=class{constructor(e,t,n){this.start=e,this.end=t,this.direction=n}},m_=(e,t,n)=>{let r=e.getSelection();if(r!==null){let e=r.getStartPosition(),i=r.getEndPosition();return new p_(cm(n,t.getOffsetAt(e)),cm(n,t.getOffsetAt(i)),r.getDirection())}return null},h_=(e,t,n,r)=>{let i=um(n.start,r),a=um(n.end,r);if(i!==null&&a!==null&&i.type===t&&a.type===t){let t=e.getModel(),r=t.getPositionAt(i.index),o=t.getPositionAt(a.index);return c.l.createWithDirection(r.lineNumber,r.column,o.lineNumber,o.column,n.direction)}return null},g_=class{constructor(e,t,n=new Set,r=null){this.doc=e.doc,this.ytext=e,this.monacoModel=t,this.editors=n,this.mux=f_(),this._savedSelections=new Map,this._beforeTransaction=()=>{this.mux(()=>{this._savedSelections=new Map,n.forEach(n=>{if(n.getModel()===t){let r=m_(n,t,e);r!==null&&this._savedSelections.set(n,r)}})})},this.doc.on(`beforeAllTransactions`,this._beforeTransaction),this._decorations=new Map,this._rerenderDecorations=()=>{n.forEach(n=>{if(r&&n.getModel()===t){let i=this._decorations.get(n)||[],a=[];r.getStates().forEach((n,r)=>{if(r!==this.doc.clientID&&n.selection!=null&&n.selection.anchor!=null&&n.selection.head!=null){let i=um(n.selection.anchor,this.doc),o=um(n.selection.head,this.doc);if(i!==null&&o!==null&&i.type===e&&o.type===e){let e,n,s,l;i.index<o.index?(e=t.getPositionAt(i.index),n=t.getPositionAt(o.index),s=`yRemoteSelectionHead yRemoteSelectionHead-`+r,l=null):(e=t.getPositionAt(o.index),n=t.getPositionAt(i.index),s=null,l=`yRemoteSelectionHead yRemoteSelectionHead-`+r),a.push({range:new c.c(e.lineNumber,e.column,n.lineNumber,n.column),options:{className:`yRemoteSelection yRemoteSelection-`+r,afterContentClassName:s,beforeContentClassName:l}})}}}),this._decorations.set(n,n.deltaDecorations(i,a))}else this._decorations.delete(n)})},this._ytextObserver=n=>{this.mux(()=>{let r=0;n.delta.forEach(e=>{if(e.retain!==void 0)r+=e.retain;else if(e.insert!==void 0){let n=t.getPositionAt(r),i=new c.l(n.lineNumber,n.column,n.lineNumber,n.column),a=e.insert;t.applyEdits([{range:i,text:a}]),r+=a.length}else if(e.delete!==void 0){let n=t.getPositionAt(r),i=t.getPositionAt(r+e.delete),a=new c.l(n.lineNumber,n.column,i.lineNumber,i.column);t.applyEdits([{range:a,text:``}])}else throw V()}),this._savedSelections.forEach((t,n)=>{let r=h_(n,e,t,this.doc);r!==null&&n.setSelection(r)})}),this._rerenderDecorations()},e.observe(this._ytextObserver);{let n=e.toString();t.getValue()!==n&&t.setValue(n)}this._monacoChangeHandler=t.onDidChangeContent(t=>{this.mux(()=>{this.doc.transact(()=>{t.changes.sort((e,t)=>t.rangeOffset-e.rangeOffset).forEach(t=>{e.delete(t.rangeOffset,t.rangeLength),e.insert(t.rangeOffset,t.text)})},this)})}),this._monacoDisposeHandler=t.onWillDispose(()=>{this.destroy()}),r&&(n.forEach(n=>{n.onDidChangeCursorSelection(()=>{if(n.getModel()===t){let i=n.getSelection();if(i===null)return;let a=t.getOffsetAt(i.getStartPosition()),o=t.getOffsetAt(i.getEndPosition());if(i.getDirection()===c.u.RTL){let e=a;a=o,o=e}r.setLocalStateField(`selection`,{anchor:cm(e,a),head:cm(e,o)})}}),r.on(`change`,this._rerenderDecorations)}),this.awareness=r)}destroy(){this._monacoChangeHandler.dispose(),this._monacoDisposeHandler.dispose(),this.ytext.unobserve(this._ytextObserver),this.doc.off(`beforeAllTransactions`,this._beforeTransaction),this.awareness&&this.awareness.off(`change`,this._rerenderDecorations)}};function __(e,t){let[n]=i.m(),r=i.$t(i.w);return{saveEmailFromEditor:(0,d.useCallback)(()=>{let a=new Date().toISOString().slice(0,19).replace(`T`,` `),o=i.nr.isPlugin?r:e.project,s={parent:e?.id,...e?.meta===void 0?{}:{meta:e.meta},title:e.title,author:e.author,project:o,html:t?.getValue()||``,excerpt:a,subject:e.subject,preheader:e.preheader,common_styles:e.common_styles,parent_email:e.parent_email};n({emailId:e?.id,body:s}).catch(e=>{})},[t,e,r,n])}}var v_=()=>{let[e,t]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{let e=navigator.platform.toUpperCase().includes(`MAC`),n=n=>{let r=(e?n.metaKey:n.ctrlKey)&&n.code===`KeyZ`,i=r&&n.shiftKey;(r||i)&&(t(!0),n.preventDefault())},r=()=>{t(!1)},i=e=>{e.data?.operation===`application_action`&&(e.data.action===`undo`||e.data.action===`redo`)&&(t(!0),setTimeout(()=>t(!1),500))};return document.addEventListener(`keydown`,n,!0),document.addEventListener(`keyup`,r,!0),window.addEventListener(`message`,i),()=>{document.removeEventListener(`keydown`,n,!0),document.removeEventListener(`keyup`,r,!0),window.removeEventListener(`message`,i)}},[]),e},y_=({email:e,editorRef:t,setIsSpin:n,newEmailAiGeneratorRef:r})=>{let a=(0,d.useMemo)(()=>new wp,[]),o=u.u(),s=(0,d.useRef)([]),c=(0,d.useRef)([]),f=(0,d.useRef)(!1),p=(0,d.useRef)(0),m=(0,d.useRef)(``),[h,ee]=(0,d.useState)(null),[g,_]=(0,d.useState)(null),[v,y]=(0,d.useState)(!1),[te,b]=(0,d.useState)([]),[x,S]=(0,d.useState)(!1),[ne,C]=(0,d.useState)(!1),w=u.m(o),T=i.$t(l.x),{saveEmailFromEditor:re}=__(e,h),E=(0,d.useRef)(null),[D,ie]=(0,d.useState)(!1),[ae]=i.h(),O=e?.id,k=!!(O===`3769995`||i.nr.isPlugin),A=(0,d.useMemo)(()=>({name:{first_name:k?T?.username:T?.first_name,last_name:k?``:T?.last_name,email:T?.email},color:yl()}),[T,k]),oe=(0,d.useMemo)(()=>vl(te,A),[A,te]),se=(0,d.useCallback)(()=>{g&&(g?.destroy(),_(null))},[g]),ce=(0,d.useCallback)(()=>{try{re()}catch{}},[re]),le=(0,d.useCallback)(async e=>{try{return await ae({emailId:O,source:`editor`,html:e}).unwrap(),!0}catch{return!1}},[O,ae]),ue=(0,d.useCallback)(async e=>{if(await le(e)&&D){let e=setTimeout(()=>{ie(!1)},0);return()=>clearTimeout(e)}},[le,ie,D]);(0,d.useEffect)(()=>{!O||!i.En.isEditor||(te.length===1&&p.current>1&&g&&ce(),p.current=te.length)},[te.length,g,ce]),(0,d.useEffect)(()=>{if(!O||!i.En.isEditor||D)return;let e=new d_(u.c,k?`${O}-plugin`:`${O}-collaborate`,a);return _(e),e.awareness.setLocalStateField(`user`,A),()=>{e?.destroy(),a?.destroy()}},[a,A,k,O,D]);let j=(0,d.useCallback)(e=>{if(!f.current){f.current=!0;try{let t=c.current,n=Array.from(e.getStates().values());(n.length>1||n.length!==t.length)&&(b(n),requestAnimationFrame(()=>{hl(n,h,s,v,y,A)})),c.current=n}finally{f.current=!1}}},[h,s,v,y,A]);(0,d.useEffect)(()=>{if(!g||!h||!i.En.isEditor||!t.current||!h.getModel()||D)return;let e=null,r=g.awareness,o=a.getText(`monaco`),s=async i=>{let a=Array.from(r.getStates().values());if(i){if(o._length>0&&a.length>1&&!E.current){let e=h?.getModel()?.getValue()?.toString()||``,r=e=>e.replace(/\s+/g,` `).trim();r(e)!==r(o.toString())&&(await de(t,n),n?.(!1),h.executeEdits(`collaboration`,[{range:h.getModel().getFullModelRange(),text:o.toString(),forceMoveMarkers:!0}]))}o._length>0&&a.length===1&&!E.current&&o.applyDelta([{delete:o._length},{insert:t.current?.getModel().getValue()}]),o._length===0&&o.insert(0,t.current?.getModel().getValue()),E.current&&o.applyDelta([{delete:o._length},{insert:E.current}]),e=new g_(o,h?.getModel(),new Set([h]),r),h?.onDidChangeCursorPosition(e=>gl(e,r)),h?.onDidChangeCursorSelection(e=>_l(e,r)),r.on(`change`,()=>j(r)),E.current=null}};return g.on(`sync`,s),()=>{e&&e.destroy(),g.off(`sync`,s)}},[h,g,a,t,j,n,D]),(0,d.useEffect)(()=>{if(!g||!h||!i.En.isEditor||!t.current||D)return;let e=g?.awareness,n=setInterval(()=>{j(e)},500);return()=>clearInterval(n)},[g,h,v,t,x,j,se,D]);async function de(e,t){await new Promise(n=>{let r=()=>{t?.(!0),(e.current?.getModel()?.getValue()?.length||0)>0?n():setTimeout(r,100)};r()})}if((0,d.useEffect)(()=>{if(!O||!i.En.isEditor||x)return;let e=bl({CHECK_INTERVAL:u.r,SLEEP_THRESHOLD:u.s,provider:g,handleOfflineCollaboration:se,isNewEmailGeneration:D,saveEmailFromEditor:re});return()=>{clearInterval(e)}},[O,g,x,se,S,D]),h&&oe.length>0){let e=h?.getModel()?.getValue()?.toString()||``;m.current!==e&&`clear`in w&&w.clear(),m.current=e}let fe=v_()&&oe.length>0;return(0,d.useEffect)(()=>{if(!O||!i.En.isEditor)return;let e=setInterval(()=>{if(r?.current&&!D&&(se(),ie(!0)),!r?.current&&D){let e=o?.getValue();E.current=e,ue(e)}},300);return()=>clearInterval(e)},[D,g,O,i.En.isEditor]),(0,d.useEffect)(()=>{if(!O||!i.En.isEditor)return;let e=()=>{document.visibilityState===`hidden`&&re()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[e,O,i.En.isEditor]),[h,oe,ee,x,fe]};Ve.config({monaco:u.I}),u.I.languages.html?.htmlDefaults?.options?.format?u.I.languages.html.htmlDefaults.options.format.wrapLineLength=0:u.I.languages.onLanguage(`html`,()=>{setTimeout(()=>{u.I.languages.html?.htmlDefaults?.options?.format&&(u.I.languages.html.htmlDefaults.options.format.wrapLineLength=0)},100)}),sl(u.I),cl(u.I,[`html`]);var{useToken:b_}=p.theme,x_=`'Source Code Pro', Consolas, 'Courier New', monospace`,S_=14;t.default=({email:e,readOnly:t,setOtherUsers:n,newEmailAiGeneratorRef:r})=>{let a=u.u();a.getLanguageId()!==`html`&&u.I.editor.setModelLanguage(a,`html`);let s=l.h(i.Fr.ON_CODE_VALIDATE_ID),c=l.yt(),f=i.$t(o.i),p=i.$t(u.D),h=i.$t(o.r),ee=e?.hasOwnProperty(`type`)?p:f,g=i.$t(l.C),_=i.en(),v=(0,d.useRef)(null),y=(0,d.useRef)(null),te=(0,d.useRef)(null),b=(0,d.useRef)([]),x=i.I(),S=(0,d.useCallback)(()=>{_(l.T(!1))},[_]),[ne,C]=(0,d.useState)(!1),w=l.i(),{__:T}=l.v(),{token:re}=b_(),[,E,D,ie,ae]=y_({email:e,editorRef:y,setIsSpin:C,newEmailAiGeneratorRef:r});b.current=E,(0,d.useEffect)(()=>{t||n(b.current)},[E?.length,n,t]);let O=(0,d.useMemo)(()=>()=>{w.error({message:T(u.a)})},[T,w]),k=(0,d.useMemo)(()=>()=>{w.warning({message:T(u.i)})},[T,w]);(0,d.useEffect)(()=>{ie&&O()},[ie,O]),(0,d.useEffect)(()=>{ae&&k()},[ae,k]),(0,d.useEffect)(()=>S(),[S]),(0,d.useEffect)(()=>{if(h){let{current:e}=v;e&&(e.revealRangeInCenterIfOutsideViewport(h),e.setSelection(h))}},[h]);let A=(0,d.useCallback)(()=>{if(v.current){let e=v.current.getDomNode();if(e){let t=g.fontFamily||x_,n=g.fontSize||S_;e.style.setProperty(`--monaco-editor-font-family`,t,`important`),e.style.setProperty(`--monaco-monospace-font`,t,`important`),e.style.setProperty(`--monaco-editor-font-size`,`${n}px`,`important`),e.style.setProperty(`font-family`,t,`important`),e.style.setProperty(`font-size`,`${n}px`,`important`)}}},[g.fontFamily,g.fontSize]);(0,d.useEffect)(()=>{if(A(),v.current){let e=v.current.getDomNode();if(e){let t=new MutationObserver(()=>{A()});return t.observe(e,{childList:!0,subtree:!0}),()=>{t.disconnect()}}}},[g.fontFamily,A]);let oe=e=>{let{current:t}=v;if(t&&!t.hasTextFocus()){let n=t.getModel(),r=n.getPositionAt(e.start),i=n.getPositionAt(e.end),a={startColumn:r.column,startLineNumber:r.lineNumber,endColumn:i.column,endLineNumber:i.lineNumber};t.revealRangeInCenterIfOutsideViewport(a),t.setSelection(a)}},se=async e=>{let{current:t}=v;if(t){let n=t.getModel();c({operation:i.Vn.UPDATE_EDITOR_POSITION_FROM_EDITOR,data:n.getOffsetAt(e)})}};(0,d.useEffect)(()=>{matchMedia(i.rr).addEventListener(`change`,t=>{let n=window.localStorage.getItem(i.Kn.em_color_scheme),r=t.matches?i.On:i.Wn;e.hasOwnProperty(`type`)?_(n?u.N(n===`dark`?`vs-${n}`:i.Wn):u.N(r===`dark`?`vs-${r}`:i.Wn)):_(n?o.v(n===`dark`?`vs-${n}`:i.Wn):o.v(r===`dark`?`vs-${r}`:i.Wn))})},[_,e]),(0,d.useEffect)(()=>{let t=window.localStorage.getItem(i.Kn.em_color_scheme),n=matchMedia(`(prefers-color-scheme: dark)`).matches?i.On:i.Wn;e?.hasOwnProperty(`type`)?_(t?u.N(t===`dark`?`vs-${t}`:i.Wn):u.N(n===`dark`?`vs-${n}`:i.Wn)):_(t?o.v(t===`dark`?`vs-${t}`:i.Wn):o.v(n===`dark`?`vs-${n}`:i.Wn))},[_,e]);let ce=(e,t)=>{v.current=e,y.current=e,u.f(),mn();let n=()=>{let t=e.getContribution(`editor.linkDetector`);if(!t?.openerService){setTimeout(n,100);return}let r=t.openerService,i=r.open.bind(r),a=document.createElement(`div`);r.open=e=>(a.innerHTML=e,i(a.textContent))};n();let r=new cn.default(e,u.I,{"doctype-html5":!1,"html-lang-require":!1,"head-script-disabled":!1,"style-disabled":!1,"script-disabled":!1,"attr-lowercase":!1,"attr-value-single-quotes":!1,"attr-value-not-empty":!1,"attr-sorted":!1,"attr-whitespace":!1,"input-requires-label":!1,"tag-self-close":!1,"tagname-lowercase":!1,"href-abs-or-rel":!1,"inline-style-disabled":!1,"space-tab-mixed-disabled":!1,"attr-no-unnecessary-whitespace":!0,"tags-check":{img:{selfclosing:!1,attrsRequired:[`src`,`alt`]},a:{selfclosing:!1,attrsRequired:[`href`]}},"empty-tag-not-self-closed":!1,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0,"alt-require":!0,"inline-script-disabled":!0,"id-class-value":!1,"id-class-ad-disabled":!0,"attr-unsafe-chars":!0,csslint:{"display-property-grouping":!0,"known-properties":!0}});i.En.isEditor&&y.current&&D(y.current),r.watch(),_(l.T(!0)),e.onMouseUp(()=>{let t=e.getSelection();t.startColumn===t.endColumn&&t.startLineNumber===t.endLineNumber&&se(e.getPosition())}),e.onDidBlurEditorWidget(()=>{c({operation:i.Vn.EDITOR_CHANGE_FOCUS,data:!1}),_(u.x(!1))}),e.onDidFocusEditorWidget(()=>{c({operation:i.Vn.EDITOR_CHANGE_FOCUS,data:!0}),_(u.x(!0))}),e.onDidChangeModelContent(()=>{setTimeout(()=>{A()},0)}),setTimeout(()=>{A()},100)};u._(e=>{let t=e.data.operation,n=e.data;te.current=t,t===i.Vn.UPDATE_EDITOR_POSITION_FROM_IFRAME&&oe(n.data)});let le=(0,d.useMemo)(()=>document.createElement(`div`),[]),ue=(0,d.useMemo)(()=>({...g,fontFamily:g.fontFamily||x_,fontSize:g.fontSize||S_,fontWeight:g.fontWeight||`normal`,domReadOnly:t,readOnly:t,unusualLineTerminators:`off`,mouseWheelZoom:!0,wordWrap:x.onlyCodeModeInMobile?`off`:g.wordWrap,ariaContainerElement:le,unicodeHighlight:{ambiguousCharacters:!1,invisibleCharacters:!1}}),[g,x.onlyCodeModeInMobile,t,le]);function j(e){e[0]?.message!==`Doctype must be declared first.`&&(i.nr.isPlugin&&s.fire(e),_(o.N(e)))}return a?.uri&&(0,m.jsxs)(m.Fragment,{children:[ne&&(0,m.jsx)(u.t,{wrap:!0,style:{position:`fixed`,width:`100%`,height:`100%`,top:0,left:0,zIndex:re?.zIndexPopupBase,background:re?.colorBgLayout}}),(0,m.jsx)(`div`,{id:`monaco-editor-root`,style:{width:`100%`,height:`100%`},children:(0,m.jsx)(ct,{theme:ee,className:`monaco-editor`,defaultLanguage:`html`,onMount:ce,options:ue,keepCurrentModel:!0,path:a.uri.toString(),onValidate:j})})]})}});