@emailmaker/emailmaker 1.0.97 → 1.0.98

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 (185) hide show
  1. package/README.md +1 -1
  2. package/iframe/429.js +1 -1
  3. package/iframe/766.js +1 -1
  4. package/iframe/iframe-eblock.441a4dbc4384f20fcf1e.html +1 -0
  5. package/iframe/iframe.441a4dbc4384f20fcf1e.html +1 -0
  6. package/iframe/js/330.378aec42.js +1 -0
  7. package/iframe/js/{826.c93ee277.js.LICENSE.txt → 330.378aec42.js.LICENSE.txt} +1 -1
  8. package/iframe/sandbox-eblock.js +1 -1
  9. package/iframe/sandbox.js +1 -1
  10. package/package.json +1 -1
  11. package/react/index.js +1 -1
  12. package/react/index.mjs +1 -1
  13. package/translations.pot +267 -250
  14. package/asset-manifest.json +0 -165
  15. package/css.worker.js +0 -2
  16. package/css.worker.js.LICENSE.txt +0 -6
  17. package/editor.worker.js +0 -1
  18. package/emailmaker-esm.js +0 -1
  19. package/emailmaker.d.ts +0 -1826
  20. package/emailmaker.js +0 -1
  21. package/html.worker.js +0 -2
  22. package/html.worker.js.LICENSE.txt +0 -14
  23. package/iframe/iframe-eblock.e8d51b90ab45966000c9.html +0 -1
  24. package/iframe/iframe.e8d51b90ab45966000c9.html +0 -1
  25. package/iframe/js/826.c93ee277.js +0 -1
  26. package/plugin.html +0 -294
  27. package/plugin_blocks_test.html +0 -144
  28. package/plugin_default.html +0 -56
  29. package/plugin_idigital.html +0 -254
  30. package/plugin_nota.html +0 -861
  31. package/plugin_s.html +0 -31
  32. package/static/css/57.3f9e7de8.chunk.css +0 -1
  33. package/static/css/578.fe5765dd.chunk.css +0 -1
  34. package/static/css/6501.e131603e.chunk.css +0 -1
  35. package/static/css/6798.94b6a519.chunk.css +0 -1
  36. package/static/css/8084.15f07f40.chunk.css +0 -1
  37. package/static/js/1303.f6ad7f62.js +0 -2
  38. package/static/js/1303.f6ad7f62.js.LICENSE.txt +0 -11
  39. package/static/js/1538.7a45fa30.chunk.js +0 -2
  40. package/static/js/1538.7a45fa30.chunk.js.LICENSE.txt +0 -23
  41. package/static/js/1654.d922b07e.js +0 -2
  42. package/static/js/1654.d922b07e.js.LICENSE.txt +0 -38
  43. package/static/js/1729.a0be903e.chunk.js +0 -1
  44. package/static/js/1880.a21db601.chunk.js +0 -1
  45. package/static/js/2642.b60a63f6.chunk.js +0 -1
  46. package/static/js/2715.c21845e3.js +0 -2
  47. package/static/js/2715.c21845e3.js.LICENSE.txt +0 -59
  48. package/static/js/3017.6335b77e.chunk.js +0 -1
  49. package/static/js/3019.aaa6d087.chunk.js +0 -2
  50. package/static/js/3019.aaa6d087.chunk.js.LICENSE.txt +0 -6
  51. package/static/js/3085.b9d27236.chunk.js +0 -2
  52. package/static/js/3085.b9d27236.chunk.js.LICENSE.txt +0 -54
  53. package/static/js/3220.db24c24f.js +0 -2
  54. package/static/js/3220.db24c24f.js.LICENSE.txt +0 -39
  55. package/static/js/4309.ae8e4ad0.chunk.js +0 -1
  56. package/static/js/4972.264e4569.js +0 -1
  57. package/static/js/5346.4aaf9222.chunk.js +0 -2
  58. package/static/js/5346.4aaf9222.chunk.js.LICENSE.txt +0 -6
  59. package/static/js/542.c5e7e839.js +0 -2
  60. package/static/js/542.c5e7e839.js.LICENSE.txt +0 -21
  61. package/static/js/57.4cd2b40e.chunk.js +0 -1
  62. package/static/js/578.068dd4e8.chunk.js +0 -2
  63. package/static/js/578.068dd4e8.chunk.js.LICENSE.txt +0 -6
  64. package/static/js/6144.a3bf0881.chunk.js +0 -2
  65. package/static/js/6144.a3bf0881.chunk.js.LICENSE.txt +0 -6
  66. package/static/js/6419.e52a6158.js +0 -2
  67. package/static/js/6419.e52a6158.js.LICENSE.txt +0 -1
  68. package/static/js/6501.7570e270.chunk.js +0 -1
  69. package/static/js/6798.20c2d528.chunk.js +0 -2
  70. package/static/js/6798.20c2d528.chunk.js.LICENSE.txt +0 -39
  71. package/static/js/6819.85c72c79.chunk.js +0 -2
  72. package/static/js/6819.85c72c79.chunk.js.LICENSE.txt +0 -6
  73. package/static/js/6957.5082b810.chunk.js +0 -1
  74. package/static/js/7463.69864ff5.chunk.js +0 -2
  75. package/static/js/7463.69864ff5.chunk.js.LICENSE.txt +0 -6
  76. package/static/js/8084.5458cfaf.chunk.js +0 -1
  77. package/static/js/8473.54e12d36.chunk.js +0 -2
  78. package/static/js/8473.54e12d36.chunk.js.LICENSE.txt +0 -101
  79. package/static/js/8521.a1623fc2.chunk.js +0 -2
  80. package/static/js/8521.a1623fc2.chunk.js.LICENSE.txt +0 -6
  81. package/static/js/9644.1ae95bb7.chunk.js +0 -2
  82. package/static/js/9644.1ae95bb7.chunk.js.LICENSE.txt +0 -6
  83. package/static/js/9960.218c70ae.chunk.js +0 -2
  84. package/static/js/9960.218c70ae.chunk.js.LICENSE.txt +0 -30
  85. package/static/js/9981.656d52eb.js +0 -1
  86. package/static/js/ant-locale/locale-ar_EG-js.a1f4a2ee.chunk.js +0 -1
  87. package/static/js/ant-locale/locale-az_AZ-js.1b3f2ec6.chunk.js +0 -1
  88. package/static/js/ant-locale/locale-bg_BG-js.2f68d816.chunk.js +0 -1
  89. package/static/js/ant-locale/locale-bn_BD-js.38ca14cb.chunk.js +0 -1
  90. package/static/js/ant-locale/locale-by_BY-js.927570db.chunk.js +0 -1
  91. package/static/js/ant-locale/locale-ca_ES-js.e4bdfa2b.chunk.js +0 -1
  92. package/static/js/ant-locale/locale-cs_CZ-js.f1151015.chunk.js +0 -1
  93. package/static/js/ant-locale/locale-da_DK-js.33e12cfb.chunk.js +0 -1
  94. package/static/js/ant-locale/locale-de_DE-js.42497042.chunk.js +0 -1
  95. package/static/js/ant-locale/locale-el_GR-js.007d40b4.chunk.js +0 -1
  96. package/static/js/ant-locale/locale-en_GB-js.6756ba01.chunk.js +0 -1
  97. package/static/js/ant-locale/locale-es_ES-js.43424efe.chunk.js +0 -1
  98. package/static/js/ant-locale/locale-et_EE-js.3694348e.chunk.js +0 -1
  99. package/static/js/ant-locale/locale-eu_ES-js.e2678a29.chunk.js +0 -1
  100. package/static/js/ant-locale/locale-fa_IR-js.3b6bfddc.chunk.js +0 -1
  101. package/static/js/ant-locale/locale-fi_FI-js.8e749864.chunk.js +0 -1
  102. package/static/js/ant-locale/locale-fr_BE-js.2aec36ca.chunk.js +0 -1
  103. package/static/js/ant-locale/locale-fr_CA-js.ba00ca3a.chunk.js +0 -1
  104. package/static/js/ant-locale/locale-fr_FR-js.1e6d0a10.chunk.js +0 -1
  105. package/static/js/ant-locale/locale-ga_IE-js.cc1f0f56.chunk.js +0 -1
  106. package/static/js/ant-locale/locale-gl_ES-js.c1588dec.chunk.js +0 -1
  107. package/static/js/ant-locale/locale-he_IL-js.1be3257a.chunk.js +0 -1
  108. package/static/js/ant-locale/locale-hi_IN-js.8e3ea1dc.chunk.js +0 -1
  109. package/static/js/ant-locale/locale-hr_HR-js.94001d08.chunk.js +0 -1
  110. package/static/js/ant-locale/locale-hu_HU-js.50a3ffc6.chunk.js +0 -1
  111. package/static/js/ant-locale/locale-hy_AM-js.6b20bceb.chunk.js +0 -1
  112. package/static/js/ant-locale/locale-id_ID-js.b380cc8b.chunk.js +0 -1
  113. package/static/js/ant-locale/locale-is_IS-js.995979c0.chunk.js +0 -1
  114. package/static/js/ant-locale/locale-it_IT-js.46a8ce6d.chunk.js +0 -1
  115. package/static/js/ant-locale/locale-ja_JP-js.69f9da33.chunk.js +0 -1
  116. package/static/js/ant-locale/locale-ka_GE-js.8b08646c.chunk.js +0 -1
  117. package/static/js/ant-locale/locale-kk_KZ-js.a1cc2ddc.chunk.js +0 -1
  118. package/static/js/ant-locale/locale-km_KH-js.09c630f9.chunk.js +0 -1
  119. package/static/js/ant-locale/locale-kmr_IQ-js.c25f3afa.chunk.js +0 -1
  120. package/static/js/ant-locale/locale-kn_IN-js.40066823.chunk.js +0 -1
  121. package/static/js/ant-locale/locale-ko_KR-js.68047848.chunk.js +0 -1
  122. package/static/js/ant-locale/locale-ku_IQ-js.594553b1.chunk.js +0 -1
  123. package/static/js/ant-locale/locale-lt_LT-js.08ac662b.chunk.js +0 -1
  124. package/static/js/ant-locale/locale-lv_LV-js.2a33af61.chunk.js +0 -1
  125. package/static/js/ant-locale/locale-mk_MK-js.caa088c9.chunk.js +0 -1
  126. package/static/js/ant-locale/locale-ml_IN-js.3aa233eb.chunk.js +0 -1
  127. package/static/js/ant-locale/locale-mn_MN-js.2550caa5.chunk.js +0 -1
  128. package/static/js/ant-locale/locale-ms_MY-js.924bfbf0.chunk.js +0 -1
  129. package/static/js/ant-locale/locale-my_MM-js.bc3805ae.chunk.js +0 -1
  130. package/static/js/ant-locale/locale-nb_NO-js.471cc88a.chunk.js +0 -1
  131. package/static/js/ant-locale/locale-ne_NP-js.52b65a1a.chunk.js +0 -1
  132. package/static/js/ant-locale/locale-nl_BE-js.2af0a7fe.chunk.js +0 -1
  133. package/static/js/ant-locale/locale-nl_NL-js.453457a0.chunk.js +0 -1
  134. package/static/js/ant-locale/locale-pl_PL-js.1e4b27da.chunk.js +0 -1
  135. package/static/js/ant-locale/locale-pt_BR-js.75dc6403.chunk.js +0 -1
  136. package/static/js/ant-locale/locale-pt_PT-js.b07438c3.chunk.js +0 -1
  137. package/static/js/ant-locale/locale-ro_RO-js.4a05dc9d.chunk.js +0 -1
  138. package/static/js/ant-locale/locale-si_LK-js.3b54f4c4.chunk.js +0 -1
  139. package/static/js/ant-locale/locale-sk_SK-js.cd76b6b1.chunk.js +0 -1
  140. package/static/js/ant-locale/locale-sl_SI-js.8afbce30.chunk.js +0 -1
  141. package/static/js/ant-locale/locale-sr_RS-js.0708405f.chunk.js +0 -1
  142. package/static/js/ant-locale/locale-sv_SE-js.9f47a065.chunk.js +0 -1
  143. package/static/js/ant-locale/locale-ta_IN-js.3b46361c.chunk.js +0 -1
  144. package/static/js/ant-locale/locale-th_TH-js.83e732d3.chunk.js +0 -1
  145. package/static/js/ant-locale/locale-tk_TK-js.63d0b187.chunk.js +0 -1
  146. package/static/js/ant-locale/locale-tr_TR-js.b5e42917.chunk.js +0 -1
  147. package/static/js/ant-locale/locale-uk_UA-js.ef0d8c8e.chunk.js +0 -1
  148. package/static/js/ant-locale/locale-ur_PK-js.904c3e1c.chunk.js +0 -1
  149. package/static/js/ant-locale/locale-vi_VN-js.f0324229.chunk.js +0 -1
  150. package/static/js/ant-locale/locale-zh_CN-js.428a6bc7.chunk.js +0 -1
  151. package/static/js/ant-locale/locale-zh_HK-js.0feb368f.chunk.js +0 -1
  152. package/static/js/ant-locale/locale-zh_TW-js.163140fa.chunk.js +0 -1
  153. package/static/js/emailmaker_core.596eeeca.js +0 -2
  154. package/static/js/emailmaker_core.596eeeca.js.LICENSE.txt +0 -23
  155. package/static/js/mergeTags/locale0.594765fd.chunk.js +0 -1
  156. package/static/js/mergeTags/locale1.7a79e21e.chunk.js +0 -1
  157. package/static/media/ai-image.7c42c2e12001ebf31881.png +0 -0
  158. package/static/media/codicon.f13d28f3e470ec5c0896.ttf +0 -0
  159. package/static/media/empty-image.1827d6561f3c4042dfb3.png +0 -0
  160. package/static/media/fb.ff10384394f8044ec889.png +0 -0
  161. package/static/media/frame_dark.318d7ed53535d80662dc.png +0 -0
  162. package/static/media/frame_light.22a9b4ec728365d8193f.png +0 -0
  163. package/static/media/frame_template_gallery.85693b3950e7689fb3a5.png +0 -0
  164. package/static/media/icon-border-radius.2a56b93a7711558098a622296b7ae2e1.svg +0 -1
  165. package/static/media/icon-create-block.0b077f4000bf7907b9ea871d28c7fb1e.svg +0 -1
  166. package/static/media/icon-menu-block-welcome.1c534a003522feadd2e7.png +0 -0
  167. package/static/media/ig.47a89992b4bec92d4364.png +0 -0
  168. package/static/media/project-email-back-dark.9916625a9a714830b770.svg +0 -29
  169. package/static/media/project-email-back.0ce470def19ce7c063e0.svg +0 -29
  170. package/static/media/sign_up_01.333271584216122b89ba.png +0 -0
  171. package/static/media/sign_up_01_blocks.5538cfdb90d4869794dc.png +0 -0
  172. package/static/media/sign_up_02.d99d2aa6bf1ea74f01fa.png +0 -0
  173. package/static/media/sign_up_02_blocks.837fc2c9a9461fda13be.png +0 -0
  174. package/static/media/sign_up_03.5545ffad60a2cb5e0336.png +0 -0
  175. package/static/media/sign_up_03_blocks.126601f7a6fbea4b6c54.png +0 -0
  176. package/static/media/sign_up_04.398a4ca50d5f5b3cd837.png +0 -0
  177. package/static/media/sign_up_04_blocks.255c5c07b23cbcc256fd.png +0 -0
  178. package/static/media/sign_up_05.4c58df1be2edaa79d52b.png +0 -0
  179. package/static/media/sign_up_05_blocks.431b6844fdf3e14642c2.png +0 -0
  180. package/static/media/tg.10f004529a98df9732b9.png +0 -0
  181. package/static/media/tw.823a7736ac2d82815c71.png +0 -0
  182. package/static/media/video.854adea50295d0a3f7ae.png +0 -0
  183. package/static/media/vk.fe41df919f4e8718e0b3.png +0 -0
  184. package/static/media/yd.c40d05dde64ef695fdf2.png +0 -0
  185. package/static/media/yt.4ac57e55d158b40c7fc1.png +0 -0
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8084],{15688:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLParser=t.Reporter=t.HTMLRules=t.HTMLHint=void 0;const r=n(18713);t.HTMLParser=r.default;const i=n(28970);t.Reporter=i.default;const o=n(36391);t.HTMLRules=o;function s(e,t){return new Array(e+1).join(t||" ")}t.HTMLHint=new 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,t=this.defaultRuleset){0===Object.keys(t).length&&(t=this.defaultRuleset),e=e.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i,((e,n)=>(n.replace(/(?:^|,)\s*([^:,]+)\s*(?:\:\s*([^,\s]+))?/g,((e,n,r)=>(t[n]=!(void 0!==r&&r.length>0)||JSON.parse(r),""))),"")));const n=new r.default,o=new i.default(e,t),s=this.rules;let a;for(const r in t)a=s[r],void 0!==a&&!1!==t[r]&&a.init(n,o,t[r]);return n.parse(e),o.messages}format(e,t={}){const n=[],r={white:"",grey:"",red:"",reset:""};t.colors&&(r.white="\x1b[37m",r.grey="\x1b[90m",r.red="\x1b[31m",r.reset="\x1b[39m");const i=t.indent||0;return e.forEach((e=>{let t=e.evidence;const o=e.line,a=e.col,l=t.length;let c=a>41?a-40:1,u=t.length>a+60?a+60:l;a<41&&(u+=40-a+1),t=t.replace(/\t/g," ").substring(c-1,u),c>1&&(t=`...${t}`,c-=3),u<l&&(t+="..."),n.push(`${r.white+s(i)}L${o} |${r.grey}${t}${r.reset}`);let d=a-c;const h=t.substring(0,d).match(/[^\u0000-\u00ff]/g);null!==h&&(d+=h.length),n.push(`${r.white+s(i)+s(String(o).length+3+d)}^ ${r.red}${e.message} (${e.rule.id})${r.reset}`)})),n}},Object.keys(o).forEach((e=>{t.HTMLHint.addRule(o[e])}))},18713:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this._listeners={},this._mapCdataTags=this.makeMap("script,style"),this._arrBlocks=[],this.lastEvent=null}makeMap(e){const t={},n=e.split(",");for(let r=0;r<n.length;r++)t[n[r]]=!0;return t}parse(e){const 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;let o,s,a,l,c,u,d=0,h=null,f=[],p=0,g=0,m=1;const b=this._arrBlocks;this.fire("start",{pos:0,line:1,col:1});const y=()=>{const e=l.find((e=>"type"===e.name))||{value:""};return t[a]&&-1===e.value.indexOf("text/ng-template")},w=(e,t,n,r)=>{const o=n-g+1;for(void 0===r&&(r={}),r.raw=t,r.pos=n,r.line=m,r.col=o,b.push(r),this.fire(e,r);i.exec(t);)m++,g=n+i.lastIndex};for(;o=n.exec(e);)if(s=o.index,s>d&&(u=e.substring(d,s),h?f.push(u):w("text",u,d)),d=n.lastIndex,!(a=o[1])||(h&&a===h&&(u=f.join(""),w("cdata",u,p,{tagName:h,attrs:c}),h=null,c=void 0,f=[]),h))if(h)f.push(o[0]);else if(a=o[4]){l=[];const e=o[5];let t,n=0;for(;t=r.exec(e);){const 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?(w("tagstart",o[0],s,{tagName:a,attrs:l,close:o[6]}),y()&&(h=a,c=l.concat(),f=[],p=d)):w("text",o[0],s)}else(o[2]||o[3])&&w("comment",o[0],s,{content:o[2]||o[3],long:!!o[2]});else w("tagend",o[0],s,{tagName:a});e.length>d&&(u=e.substring(d,e.length),w("text",u,d)),this.fire("end",{pos:d,line:m,col:e.length-g+1})}addListener(e,t){const n=this._listeners,r=e.split(/[,\s]/);let i;for(let o=0,s=r.length;o<s;o++)i=r[o],void 0===n[i]&&(n[i]=[]),n[i].push(t)}fire(e,t){void 0===t&&(t={}),t.type=e;let n=[];const r=this._listeners[e],i=this._listeners.all;void 0!==r&&(n=n.concat(r)),void 0!==i&&(n=n.concat(i));const o=this.lastEvent;null!==o&&(delete o.lastEvent,t.lastEvent=o),this.lastEvent=t;for(let s=0,a=n.length;s<a;s++)n[s].call(this,t)}removeListener(e,t){const n=this._listeners[e];if(void 0!==n)for(let r=0,i=n.length;r<i;r++)if(n[r]===t){n.splice(r,1);break}}fixPos(e,t){const n=e.raw.substr(0,t).split(/\r?\n/),r=n.length-1;let i,o=e.line;return r>0?(o+=r,i=n[r].length+1):i=e.col+t,{line:o,col:i}}getMapAttrs(e){const t={};let n;for(let r=0,i=e.length;r<i;r++)n=e[r],t[n.name]=n.value;return t}}},28970:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t){this.html=e,this.lines=e.split(/\r?\n/);const n=/\r?\n/.exec(e);this.brLen=null!==n?n[0].length:0,this.ruleset=t,this.messages=[]}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,o){const s=this.lines,a=this.brLen;let l="",c=0;for(let u=n-1,d=s.length;u<d&&(l=s[u],c=l.length,r>c&&n<d);u++)n++,1!==(r-=c)&&(r-=a);this.messages.push({type:e,message:t,raw:o,evidence:l,line:n,col:r,rule:{id:i.id,description:i.description,link:`https://htmlhint.com/docs/user-guide/rules/${i.id}`}})}}},38530:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.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=>{const r=n.tagName.toLowerCase(),i=e.getMapAttrs(n.attrs),o=n.col+r.length+1;let s;"img"!==r||"alt"in i?("area"===r&&"href"in i||"input"===r&&"image"===i.type)&&("alt"in i&&""!==i.alt||(s="area"===r?"area[href]":"input[type=image]",t.warn(`The alt attribute of ${s} must have a value.`,n.line,o,this,n.raw))):t.warn("An alt attribute must be present on <img> elements.",n.line,o,this,n.raw)}))}}},36116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=["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"];function r(e,t){if(t instanceof RegExp)return!!t.test(e)&&{match:e,pattern:t};const n=t[0],r=t[t.length-1],i=t[t.length-2],o="/"===n&&("/"===r||"/"===i&&"i"===r);if(o){return o&&"i"===r?new RegExp(t.slice(1,-2),"i").test(e):new RegExp(t.slice(1,-1)).test(e)}return e===t}t.default={id:"attr-lowercase",description:"All attribute names must be in lowercase.",init(e,t,i){const o=(Array.isArray(i)?i:[]).concat(n);e.addListener("tagstart",(e=>{const n=e.attrs;let i;const s=e.col+e.tagName.length+1;for(let a=0,l=n.length;a<l;a++){i=n[a];const l=i.name;o.find((e=>r(l,e)))||l===l.toLowerCase()||t.error(`The attribute name of [ ${l} ] must be in lowercase.`,e.line,s+i.index,this,i.raw)}}))}}},26079:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-no-duplication",description:"Elements cannot have duplicate attributes.",init(e,t){e.addListener("tagstart",(e=>{const n=e.attrs;let r,i;const o=e.col+e.tagName.length+1,s={};for(let a=0,l=n.length;a<l;a++)r=n[a],i=r.name,!0===s[i]&&t.error(`Duplicate of attribute name [ ${r.name} ] was found.`,e.line,o+r.index,this,r.raw),s[i]=!0}))}}},43903:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-no-unnecessary-whitespace",description:"No spaces between attribute names and values.",init(e,t,n){const r=Array.isArray(n)?n:[];e.addListener("tagstart",(e=>{const n=e.attrs,i=e.col+e.tagName.length+1;for(let o=0;o<n.length;o++)if(-1===r.indexOf(n[o].name)){const r=/(\s*)=(\s*)/.exec(n[o].raw.trim());!r||0===r[1].length&&0===r[2].length||t.error(`The attribute '${n[o].name}' must not have spaces between the name and value.`,e.line,i+n[o].index,this,n[o].raw)}}))}}},88020:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-sorted",description:"Attribute tags must be in proper order.",init(e,t){const n={},r=["class","id","name","src","for","type","href","value","title","alt","role"];for(let i=0;i<r.length;i++)n[r[i]]=i;e.addListener("tagstart",(e=>{const r=e.attrs,i=[];for(let t=0;t<r.length;t++)i.push(r[t].name);const o=JSON.stringify(i);i.sort(((e,t)=>void 0==n[e]&&void 0==n[t]?0:void 0==n[e]?1:void 0==n[t]?-1:n[e]-n[t]||e.localeCompare(t))),o!==JSON.stringify(i)&&t.error(`Inaccurate order ${o} should be in hierarchy ${JSON.stringify(i)} `,e.line,e.col,this,e.raw)}))}}},28075:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-unsafe-chars",description:"Attribute values cannot contain unsafe chars.",init(e,t){e.addListener("tagstart",(e=>{const n=e.attrs;let r;const i=e.col+e.tagName.length+1,o=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/;let s;for(let a=0,l=n.length;a<l;a++)if(r=n[a],s=o.exec(r.value),null!==s){const n=escape(s[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)}}))}}},78028:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-value-double-quotes",description:"Attribute values must be in double quotes.",init(e,t){e.addListener("tagstart",(e=>{const n=e.attrs;let r;const i=e.col+e.tagName.length+1;for(let o=0,s=n.length;o<s;o++)r=n[o],(""!==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)}))}}},61452:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-value-not-empty",description:"All attributes must have values.",init(e,t){e.addListener("tagstart",(e=>{const n=e.attrs;let r;const i=e.col+e.tagName.length+1;for(let o=0,s=n.length;o<s;o++)r=n[o],""===r.quote&&""===r.value&&t.warn(`The attribute [ ${r.name} ] must have a value.`,e.line,i+r.index,this,r.raw)}))}}},76735:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-value-single-quotes",description:"Attribute values must be in single quotes.",init(e,t){e.addListener("tagstart",(e=>{const n=e.attrs;let r;const i=e.col+e.tagName.length+1;for(let o=0,s=n.length;o<s;o++)r=n[o],(""!==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)}))}}},8028:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"attr-whitespace",description:"All attributes should be separated by only one space and not have leading/trailing whitespace.",init(e,t,n){const r=Array.isArray(n)?n:[];e.addListener("tagstart",(e=>{const n=e.attrs;let i;const o=e.col+e.tagName.length+1;n.forEach((n=>{i=n;const s=n.name;-1===r.indexOf(s)&&(n.value.trim()!==n.value&&t.error(`The attributes of [ ${s} ] must not have leading or trailing whitespace.`,e.line,o+i.index,this,i.raw),n.value.replace(/ +(?= )/g,"")!==n.value&&t.error(`The attributes of [ ${s} ] must be separated by only one space.`,e.line,o+i.index,this,i.raw))}))}))}}},61730:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"doctype-first",description:"Doctype must be declared first.",init(e,t){const n=r=>{"start"===r.type||"text"===r.type&&/^\s*$/.test(r.raw)||(("comment"!==r.type&&!1===r.long||!1===/^DOCTYPE\s+/i.test(r.content))&&t.error("Doctype must be declared first.",r.line,r.col,this,r.raw),e.removeListener("all",n))};e.addListener("all",n)}}},58212:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"doctype-html5",description:'Invalid doctype. Use: "<!DOCTYPE html>"',init(e,t){const n=e=>{!1===e.long&&"doctype html"!==e.content.toLowerCase()&&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)}}},81544:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"empty-tag-not-self-closed",description:"Empty tags must not use self closed syntax.",init(e,t){const 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=>{const r=e.tagName.toLowerCase();void 0!==n[r]&&e.close&&t.error(`The empty tag : [ ${r} ] must not use self closed syntax.`,e.line,e.col,this,e.raw)}))}}},22610:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"head-script-disabled",description:"The <script> tag cannot be used in a <head> tag.",init(e,t){const n=/^(text\/javascript|application\/javascript)$/i;let r=!1;const i=i=>{const o=e.getMapAttrs(i.attrs).type,s=i.tagName.toLowerCase();"head"===s&&(r=!0),!0!==r||"script"!==s||o&&!0!==n.test(o)||t.warn("The <script> tag cannot be used in a <head> tag.",i.line,i.col,this,i.raw)},o=t=>{"head"===t.tagName.toLowerCase()&&(e.removeListener("tagstart",i),e.removeListener("tagend",o))};e.addListener("tagstart",i),e.addListener("tagend",o)}}},43035:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"href-abs-or-rel",description:"An href attribute must be either absolute or relative.",init(e,t,n){const r="abs"===n?"absolute":"relative";e.addListener("tagstart",(e=>{const n=e.attrs;let i;const o=e.col+e.tagName.length+1;for(let s=0,a=n.length;s<a;s++)if(i=n[s],"href"===i.name){("absolute"===r&&!1===/^\w+?:/.test(i.value)||"relative"===r&&!0===/^https?:\/\//.test(i.value))&&t.warn(`The value of the href attribute [ ${i.value} ] must be ${r}.`,e.line,o+i.index,this,i.raw);break}}))}}},45141:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default={id:"html-lang-require",description:"The lang attribute of an <html> element must be present and should be valid.",init(e,t){e.addListener("tagstart",(n=>{const r=n.tagName.toLowerCase(),i=e.getMapAttrs(n.attrs),o=n.col+r.length+1,s=new RegExp("((?<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})+))","g");"html"===r&&("lang"in i?i.lang?s.test(i.lang)||t.warn("The lang attribute value of <html> element must be a valid BCP47.",n.line,o,this,n.raw):t.warn("The lang attribute of <html> element must have a value.",n.line,o,this,n.raw):t.warn("An lang attribute must be present on <html> elements.",n.line,o,this,n.raw))}))}}},30058:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.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=>{const n=e.attrs;let r,i;const o=e.col+e.tagName.length+1;for(let s=0,a=n.length;s<a;s++)r=n[s],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,o+r.index,this,r.raw)}))}}},11247:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"id-class-value",description:"The id and class attribute values must meet the specified rules.",init(e,t,n){let r;if(r="string"===typeof n?{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."}}[n]:n,"object"===typeof r&&r.regId){let n=r.regId;const i=r.message;n instanceof RegExp||(n=new RegExp(n)),e.addListener("tagstart",(e=>{const r=e.attrs;let o;const s=e.col+e.tagName.length+1;for(let a=0,l=r.length;a<l;a++)if(o=r[a],"id"===o.name.toLowerCase()&&!1===n.test(o.value)&&t.warn(i,e.line,s+o.index,this,o.raw),"class"===o.name.toLowerCase()){const r=o.value.split(/\s+/g);let a;for(let l=0,c=r.length;l<c;l++)a=r[l],a&&!1===n.test(a)&&t.warn(i,e.line,s+o.index,this,a)}}))}}}},59e3:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"id-unique",description:"The value of id attributes must be unique.",init(e,t){const n={};e.addListener("tagstart",(e=>{const r=e.attrs;let i,o;const s=e.col+e.tagName.length+1;for(let a=0,l=r.length;a<l;a++)if(i=r[a],"id"===i.name.toLowerCase()){o=i.value,o&&(void 0===n[o]?n[o]=1:n[o]++,n[o]>1&&t.error(`The id value [ ${o} ] must be unique.`,e.line,s+i.index,this,i.raw));break}}))}}},36391:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.attrNoUnnecessaryWhitespace=t.tagsCheck=t.titleRequire=t.tagnameSpecialChars=t.tagnameLowercase=t.emptyTagNotSelfClosed=t.tagSelfClose=t.tagPair=t.styleDisabled=t.srcNotEmpty=t.specCharEscape=t.spaceTabMixedDisabled=t.scriptDisabled=t.inputRequiresLabel=t.inlineStyleDisabled=t.inlineScriptDisabled=t.idUnique=t.idClassValue=t.idClsasAdDisabled=t.htmlLangRequire=t.hrefAbsOrRel=t.headScriptDisabled=t.doctypeHTML5=t.doctypeFirst=t.attrWhitespace=t.attrValueSingleQuotes=t.attrValueNotEmpty=t.attrValueDoubleQuotes=t.attrUnsafeChars=t.attrNoDuplication=t.attrSort=t.attrLowercase=t.altRequire=void 0;var r=n(38530);Object.defineProperty(t,"altRequire",{enumerable:!0,get:function(){return r.default}});var i=n(36116);Object.defineProperty(t,"attrLowercase",{enumerable:!0,get:function(){return i.default}});var o=n(88020);Object.defineProperty(t,"attrSort",{enumerable:!0,get:function(){return o.default}});var s=n(26079);Object.defineProperty(t,"attrNoDuplication",{enumerable:!0,get:function(){return s.default}});var a=n(28075);Object.defineProperty(t,"attrUnsafeChars",{enumerable:!0,get:function(){return a.default}});var l=n(78028);Object.defineProperty(t,"attrValueDoubleQuotes",{enumerable:!0,get:function(){return l.default}});var c=n(61452);Object.defineProperty(t,"attrValueNotEmpty",{enumerable:!0,get:function(){return c.default}});var u=n(76735);Object.defineProperty(t,"attrValueSingleQuotes",{enumerable:!0,get:function(){return u.default}});var d=n(8028);Object.defineProperty(t,"attrWhitespace",{enumerable:!0,get:function(){return d.default}});var h=n(61730);Object.defineProperty(t,"doctypeFirst",{enumerable:!0,get:function(){return h.default}});var f=n(58212);Object.defineProperty(t,"doctypeHTML5",{enumerable:!0,get:function(){return f.default}});var p=n(22610);Object.defineProperty(t,"headScriptDisabled",{enumerable:!0,get:function(){return p.default}});var g=n(43035);Object.defineProperty(t,"hrefAbsOrRel",{enumerable:!0,get:function(){return g.default}});var m=n(45141);Object.defineProperty(t,"htmlLangRequire",{enumerable:!0,get:function(){return m.default}});var b=n(30058);Object.defineProperty(t,"idClsasAdDisabled",{enumerable:!0,get:function(){return b.default}});var y=n(11247);Object.defineProperty(t,"idClassValue",{enumerable:!0,get:function(){return y.default}});var w=n(59e3);Object.defineProperty(t,"idUnique",{enumerable:!0,get:function(){return w.default}});var v=n(28953);Object.defineProperty(t,"inlineScriptDisabled",{enumerable:!0,get:function(){return v.default}});var k=n(26691);Object.defineProperty(t,"inlineStyleDisabled",{enumerable:!0,get:function(){return k.default}});var x=n(66583);Object.defineProperty(t,"inputRequiresLabel",{enumerable:!0,get:function(){return x.default}});var _=n(39353);Object.defineProperty(t,"scriptDisabled",{enumerable:!0,get:function(){return _.default}});var C=n(7686);Object.defineProperty(t,"spaceTabMixedDisabled",{enumerable:!0,get:function(){return C.default}});var E=n(60761);Object.defineProperty(t,"specCharEscape",{enumerable:!0,get:function(){return E.default}});var S=n(62433);Object.defineProperty(t,"srcNotEmpty",{enumerable:!0,get:function(){return S.default}});var O=n(33091);Object.defineProperty(t,"styleDisabled",{enumerable:!0,get:function(){return O.default}});var A=n(79960);Object.defineProperty(t,"tagPair",{enumerable:!0,get:function(){return A.default}});var $=n(38659);Object.defineProperty(t,"tagSelfClose",{enumerable:!0,get:function(){return $.default}});var M=n(81544);Object.defineProperty(t,"emptyTagNotSelfClosed",{enumerable:!0,get:function(){return M.default}});var L=n(14148);Object.defineProperty(t,"tagnameLowercase",{enumerable:!0,get:function(){return L.default}});var j=n(23949);Object.defineProperty(t,"tagnameSpecialChars",{enumerable:!0,get:function(){return j.default}});var D=n(52979);Object.defineProperty(t,"titleRequire",{enumerable:!0,get:function(){return D.default}});var N=n(73343);Object.defineProperty(t,"tagsCheck",{enumerable:!0,get:function(){return N.default}});var T=n(43903);Object.defineProperty(t,"attrNoUnnecessaryWhitespace",{enumerable:!0,get:function(){return T.default}})},28953:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"inline-script-disabled",description:"Inline script cannot be used.",init(e,t){e.addListener("tagstart",(e=>{const n=e.attrs;let r;const i=e.col+e.tagName.length+1;let o;const s=/^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 a=0,l=n.length;a<l;a++)r=n[a],o=r.name.toLowerCase(),!0===s.test(o)?t.warn(`Inline script [ ${r.raw} ] cannot be used.`,e.line,i+r.index,this,r.raw):"src"!==o&&"href"!==o||/^\s*javascript:/i.test(r.value)&&t.warn(`Inline script [ ${r.raw} ] cannot be used.`,e.line,i+r.index,this,r.raw)}))}}},26691:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"inline-style-disabled",description:"Inline style cannot be used.",init(e,t){e.addListener("tagstart",(e=>{const n=e.attrs;let r;const i=e.col+e.tagName.length+1;for(let o=0,s=n.length;o<s;o++)r=n[o],"style"===r.name.toLowerCase()&&t.warn(`Inline style [ ${r.raw} ] cannot be used.`,e.line,i+r.index,this,r.raw)}))}}},66583:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"input-requires-label",description:"All [ input ] tags must have a corresponding [ label ] tag. ",init(e,t){const n=[],r=[];e.addListener("tagstart",(t=>{const i=t.tagName.toLowerCase(),o=e.getMapAttrs(t.attrs),s=t.col+i.length+1;"input"===i&&"hidden"!==o.type&&r.push({event:t,col:s,id:o.id}),"label"===i&&"for"in o&&""!==o.for&&n.push({event:t,col:s,forValue:o.for})})),e.addListener("end",(()=>{r.forEach((e=>{(function(e){let t=!1;return n.forEach((n=>{e.id&&e.id===n.forValue&&(t=!0)})),t})(e)||t.warn("No matching [ label ] tag found.",e.event.line,e.col,this,e.event.raw)}))}))}}},39353:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"script-disabled",description:"The <script> tag cannot be used.",init(e,t){e.addListener("tagstart",(e=>{"script"===e.tagName.toLowerCase()&&t.error("The <script> tag cannot be used.",e.line,e.col,this,e.raw)}))}}},7686:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.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("string"===typeof n){const e=/^([a-z]+)(\d+)?/.exec(n);e&&(r=e[1],i=e[2]&&parseInt(e[2],10))}e.addListener("text",(n=>{const o=n.raw,s=/(^|\r?\n)([ \t]+)/g;let a;for(;a=s.exec(o);){const o=e.fixPos(n,a.index+a[1].length);if(1!==o.col)continue;const s=a[2];"space"===r?i?!1!==/^ +$/.test(s)&&s.length%i===0||t.warn(`Please use space for indentation and keep ${i} length.`,o.line,1,this,n.raw):!1===/^ +$/.test(s)&&t.warn("Please use space for indentation.",o.line,1,this,n.raw):"tab"===r&&!1===/^\t+$/.test(s)?t.warn("Please use tab for indentation.",o.line,1,this,n.raw):!0===/ +\t|\t+ /.test(s)&&t.warn("Do not mix tabs and spaces for indentation.",o.line,1,this,n.raw)}}))}}},60761:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"spec-char-escape",description:"Special characters must be escaped.",init(e,t){e.addListener("text",(n=>{const r=n.raw,i=/([<>])|( \& )/g;let o;for(;o=i.exec(r);){const r=e.fixPos(n,o.index);t.error(`Special characters must be escaped : [ ${o[0]} ].`,r.line,r.col,this,n.raw)}}))}}},62433:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.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=>{const n=e.tagName,r=e.attrs;let i;const o=e.col+n.length+1;for(let s=0,a=r.length;s<a;s++)i=r[s],(!0===/^(img|script|embed|bgsound|iframe)$/.test(n)&&"src"===i.name||"link"===n&&"href"===i.name||"object"===n&&"data"===i.name)&&""===i.value&&t.error(`The attribute [ ${i.name} ] of the tag [ ${n} ] must have a value.`,e.line,o+i.index,this,i.raw)}))}}},33091:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"style-disabled",description:"<style> tags cannot be used.",init(e,t){e.addListener("tagstart",(e=>{"style"===e.tagName.toLowerCase()&&t.warn("The <style> tag cannot be used.",e.line,e.col,this,e.raw)}))}}},79960:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"tag-pair",description:"Tag must be paired.",init(e,t){const 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=>{const t=e.tagName.toLowerCase();void 0!==r[t]||e.close||n.push({tagName:t,line:e.line,raw:e.raw})})),e.addListener("tagend",(e=>{const r=e.tagName.toLowerCase();let i;for(i=n.length-1;i>=0&&n[i].tagName!==r;i--);if(i>=0){const r=[];for(let e=n.length-1;e>i;e--)r.push(`</${n[e].tagName}>`);if(r.length>0){const i=n[n.length-1];t.error(`Tag must be paired, missing: [ ${r.join("")} ], start tag match failed [ ${i.raw} ] on line ${i.line}.`,e.line,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=>{const r=[];for(let t=n.length-1;t>=0;t--)r.push(`</${n[t].tagName}>`);if(r.length>0){const 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,"")}}))}}},38659:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"tag-self-close",description:"Empty tags must be self closed.",init(e,t){const 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=>{const r=e.tagName.toLowerCase();void 0!==n[r]&&(e.close||t.warn(`The empty tag : [ ${r} ] must be self closed.`,e.line,e.col,this,e.raw))}))}}},14148:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"tagname-lowercase",description:"All html element names must be in lowercase.",init(e,t,n){const r=Array.isArray(n)?n:[];e.addListener("tagstart,tagend",(e=>{const n=e.tagName;-1===r.indexOf(n)&&n!==n.toLowerCase()&&t.error(`The html element name of [ ${n} ] must be in lowercase.`,e.line,e.col,this,e.raw)}))}}},23949:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"tagname-specialchars",description:"All special characters must be escaped.",init(e,t){const n=/[^a-zA-Z0-9\-:_]/;e.addListener("tagstart,tagend",(e=>{const r=e.tagName;n.test(r)&&t.error(`The html element name of [ ${r} ] contains special character.`,e.line,e.col,this,e.raw)}))}}},73343:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});let n={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"]}};t.default={id:"tags-check",description:"Checks html tags.",init(e,t,r){n=Object.assign(Object.assign({},n),r),e.addListener("tagstart",(e=>{const r=e.attrs,i=e.col+e.tagName.length+1,o=e.tagName.toLowerCase();if(n[o]){const s=n[o];if(!0!==s.selfclosing||e.close?!1===s.selfclosing&&e.close&&t.warn(`The <${o}> tag must not be selfclosing.`,e.line,e.col,this,e.raw):t.warn(`The <${o}> tag must be selfclosing.`,e.line,e.col,this,e.raw),Array.isArray(s.attrsRequired)){s.attrsRequired.forEach((n=>{if(Array.isArray(n)){const s=n.map((e=>e)),a=s.shift(),l=s;r.some((e=>e.name===a))?r.forEach((n=>{n.name===a&&-1===l.indexOf(n.value)&&t.error(`The <${o}> tag must have attr '${a}' with one value of '${l.join("' or '")}'.`,e.line,i,this,e.raw)})):t.error(`The <${o}> tag must have attr '${a}'.`,e.line,i,this,e.raw)}else r.some((e=>-1!==n.split("|").indexOf(e.name)))||t.error(`The <${o}> tag must have attr '${n}'.`,e.line,i,this,e.raw)}))}if(Array.isArray(s.attrsOptional)){s.attrsOptional.forEach((n=>{if(Array.isArray(n)){const s=n.map((e=>e)),a=s.shift(),l=s;r.some((e=>e.name===a))&&r.forEach((n=>{n.name===a&&-1===l.indexOf(n.value)&&t.error(`The <${o}> tag must have optional attr '${a}' with one value of '${l.join("' or '")}'.`,e.line,i,this,e.raw)}))}}))}if(Array.isArray(s.redundantAttrs)){s.redundantAttrs.forEach((n=>{r.some((e=>e.name===n))&&t.error(`The attr '${n}' is redundant for <${o}> and should be omitted.`,e.line,i,this,e.raw)}))}}}))}}},52979:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={id:"title-require",description:"<title> must be present in <head> tag.",init(e,t){let n=!1,r=!1;const i=e=>{const t=e.tagName.toLowerCase();"head"===t?n=!0:"title"===t&&n&&(r=!0)},o=n=>{const s=n.tagName.toLowerCase();if(r&&"title"===s){const e=n.lastEvent;("text"!==e.type||"text"===e.type&&!0===/^\s*$/.test(e.raw))&&t.error("<title></title> must not be empty.",n.line,n.col,this,n.raw)}else"head"===s&&(!1===r&&t.error("<title> must be present in <head> tag.",n.line,n.col,this,n.raw),e.removeListener("tagstart",i),e.removeListener("tagend",o))};e.addListener("tagstart",i),e.addListener("tagend",o)}}},59168:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLMonacoLinter=void 0;const r=n(94266);t.HTMLMonacoLinter=class{constructor(e,t,n){this.editor=e,this.monaco=t,this.ruleset=n}lint(){var e;const t=this.editor.getValue();if("html"===(null===(e=this.editor.getModel())||void 0===e?void 0:e.getLanguageId())){const e=new r.HTMLMonacoMarks(t,this.ruleset,this.editor.getModel()||void 0).getEditorMarks(this.monaco),n=this.editor.getModel();if(null===n)throw new Error("Your model still does't exist.");this.monaco.editor.setModelMarkers(n,"owner",e)}}watch(){this.lint(),this.editor.onDidChangeModelContent((e=>{this.lint()}))}}},94266:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLMonacoMarks=void 0;const r=n(15688),i=n(23495),o={"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};t.HTMLMonacoMarks=class{constructor(e,t=o,n){this.html=e,this.ruleset=t,this.linterResponse=this.lint(),this.model=n}lint(){return r.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?t.col+t.evidence.length:void 0!==this.model?this.model.getLineLength(t.line):t.col+1,message:t.message,severity:e.MarkerSeverity[(0,i.capitalize)(t.type)]})))}getLinterResponse(){return this.linterResponse}}},33510:(e,t,n)=>{t.Ay=void 0;var r=n(94266);var i=n(59168);Object.defineProperty(t,"Ay",{enumerable:!0,get:function(){return i.HTMLMonacoLinter}})},23495:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.capitalize=void 0;t.capitalize=e=>{const 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(" ")}},10275:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_d});var r=n(98173);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}}function f(e){return{}.toString.call(e).includes("Object")}function p(e){return"function"===typeof e}var g=h((function(e,t){throw new Error(e[t]||e.default)}))({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"}),m={changes:function(e,t){return f(t)||g("changeType"),Object.keys(t).some((function(t){return!function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)}))&&g("changeField"),t},selector:function(e){p(e)||g("selectorType")},handler:function(e){p(e)||f(e)||g("handlerType"),f(e)&&Object.values(e).some((function(e){return!p(e)}))&&g("handlersType")},initial:function(e){var t;e||g("initialIsRequired"),f(e)||g("initialType"),t=e,Object.keys(t).length||g("initialContent")}};function b(e,t){return p(t)?t(e.current):t}function y(e,t){return e.current=d(d({},e.current),t),t}function w(e,t,n){return p(t)?t(e.current):Object.keys(n).forEach((function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])})),n}const v={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m.initial(e),m.handler(t);var n={current:e},r=h(w)(n,t),i=h(y)(n),o=h(m.changes)(e),s=h(b)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return m.selector(e),e(n.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight((function(e,t){return t(e)}),e)}}(r,i,o,s)(e)}]}};const k={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"}};const x=function(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}};const _=function(e){return{}.toString.call(e).includes("Object")};var C={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!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},E=x((function(e,t){throw new Error(e[t]||e.default)}))(C),S={config:function(e){return e||E("configIsRequired"),_(e)||E("configType"),e.urls?{paths:{vs:e.urls.monacoBase}}:e}};const O=S;const A=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight((function(e,t){return t(e)}),e)}};const $=function e(t,n){return Object.keys(n).forEach((function(r){n[r]instanceof Object&&t[r]&&Object.assign(n[r],e(t[r],n[r]))})),s(s({},t),n)};var M={type:"cancelation",msg:"operation is manually canceled"};const L=function(e){var t=!1,n=new Promise((function(n,r){e.then((function(e){return t?r(M):n(e)})),e.catch(r)}));return n.cancel=function(){return t=!0},n};var j,D,N=v.create({config:k,isInitialized:!1,resolve:null,reject:null,monaco:null}),T=(D=2,function(e){if(Array.isArray(e))return e}(j=N)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}}(j,D)||function(e,t){if(e){if("string"===typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(j,D)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),z=T[0],P=T[1];function I(e){return document.body.appendChild(e)}function R(e){var t=z((function(e){return{config:e.config,reject:e.reject}})),n=function(e){var t=document.createElement("script");return e&&(t.src=e),t}("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function U(){var e=z((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){q(t),e.resolve(t)}),(function(t){e.reject(t)}))}function q(e){z().monaco||P({monaco:e})}var V=new Promise((function(e,t){return P({resolve:e,reject:t})})),F={config:function(e){var t=O.config(e),n=t.monaco,r=a(t,["monaco"]);P((function(e){return{config:$(e.config,r),monaco:n}}))},init:function(){var e=z((function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}}));if(!e.isInitialized){if(P({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),L(V);if(window.monaco&&window.monaco.editor)return q(window.monaco),e.resolve(window.monaco),L(V);A(I,R)(U)}return L(V)},__getMonacoInstance:function(){return z((function(e){return e.monaco}))}};const W=F;var B=n(2407),H=n.n(B);function Z(){return Z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z.apply(this,arguments)}const J={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"};const X=function({content:e}){return r.createElement("div",{style:J},e)},Y={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}};function K({width:e,height:t,isEditorReady:n,loading:i,_ref:o,className:s,wrapperProps:a}){return r.createElement("section",Z({style:{...Y.wrapper,width:e,height:t}},a),!n&&r.createElement(X,{content:i}),r.createElement("div",{ref:o,style:{...Y.fullWidth,...!n&&Y.hide},className:s}))}K.propTypes={width:H().oneOfType([H().number,H().string]).isRequired,height:H().oneOfType([H().number,H().string]).isRequired,loading:H().oneOfType([H().element,H().string]).isRequired,isEditorReady:H().bool.isRequired,className:H().string,wrapperProps:H().object};const G=K;const Q=(0,r.memo)(G);const ee=function(e){(0,r.useEffect)(e,[])};const te=function(e,t,n=!0){const i=(0,r.useRef)(!0);(0,r.useEffect)(i.current||!n?()=>{i.current=!1}:e,t)};function ne(){}function re(e,t,n,r){return function(e,t){return e.editor.getModel(ie(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r&&ie(e,r))}(e,t,n,r)}function ie(e,t){return e.Uri.parse(t)}function oe({original:e,modified:t,language:n,originalLanguage:i,modifiedLanguage:o,originalModelPath:s,modifiedModelPath:a,keepCurrentOriginalModel:l,keepCurrentModifiedModel:c,theme:u,loading:d,options:h,height:f,width:p,className:g,wrapperProps:m,beforeMount:b,onMount:y}){const[w,v]=(0,r.useState)(!1),[k,x]=(0,r.useState)(!0),_=(0,r.useRef)(null),C=(0,r.useRef)(null),E=(0,r.useRef)(null),S=(0,r.useRef)(y),O=(0,r.useRef)(b);ee((()=>{const e=W.init();return e.then((e=>(C.current=e)&&x(!1))).catch((e=>"cancelation"!==(null===e||void 0===e?void 0:e.type)&&void 0)),()=>_.current?function(){const e=_.current.getModel();var t,n;l||null===(t=e.original)||void 0===t||t.dispose();c||null===(n=e.modified)||void 0===n||n.dispose();_.current.dispose()}():e.cancel()})),te((()=>{const e=_.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(t):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t,forceMoveMarkers:!0}]),e.pushUndoStop())}),[t],w),te((()=>{_.current.getModel().original.setValue(e)}),[e],w),te((()=>{const{original:e,modified:t}=_.current.getModel();C.current.editor.setModelLanguage(e,i||n),C.current.editor.setModelLanguage(t,o||n)}),[n,i,o],w),te((()=>{C.current.editor.setTheme(u)}),[u],w),te((()=>{_.current.updateOptions(h)}),[h],w);const A=(0,r.useCallback)((()=>{O.current(C.current);const r=re(C.current,e,i||n,s),l=re(C.current,t,o||n,a);_.current.setModel({original:r,modified:l})}),[n,t,o,e,i,s,a]),$=(0,r.useCallback)((()=>{_.current=C.current.editor.createDiffEditor(E.current,{automaticLayout:!0,...h}),A(),C.current.editor.setTheme(u),v(!0)}),[h,u,A]);return(0,r.useEffect)((()=>{w&&S.current(_.current,C.current)}),[w]),(0,r.useEffect)((()=>{!k&&!w&&$()}),[k,w,$]),r.createElement(Q,{width:p,height:f,isEditorReady:w,loading:d,_ref:E,className:g,wrapperProps:m})}oe.propTypes={original:H().string,modified:H().string,language:H().string,originalLanguage:H().string,modifiedLanguage:H().string,originalModelPath:H().string,modifiedModelPath:H().string,keepCurrentOriginalModel:H().bool,keepCurrentModifiedModel:H().bool,theme:H().string,loading:H().oneOfType([H().element,H().string]),options:H().object,width:H().oneOfType([H().number,H().string]),height:H().oneOfType([H().number,H().string]),className:H().string,wrapperProps:H().object,beforeMount:H().func,onMount:H().func},oe.defaultProps={theme:"light",loading:"Loading...",options:{},keepCurrentOriginalModel:!1,keepCurrentModifiedModel:!1,width:"100%",height:"100%",wrapperProps:{},beforeMount:ne,onMount:ne};const se=function(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current},ae=new Map;function le({defaultValue:e,defaultLanguage:t,defaultPath:n,value:i,language:o,path:s,theme:a,line:l,loading:c,options:u,overrideServices:d,saveViewState:h,keepCurrentModel:f,width:p,height:g,className:m,wrapperProps:b,beforeMount:y,onMount:w,onChange:v,onValidate:k}){const[x,_]=(0,r.useState)(!1),[C,E]=(0,r.useState)(!0),S=(0,r.useRef)(null),O=(0,r.useRef)(null),A=(0,r.useRef)(null),$=(0,r.useRef)(w),M=(0,r.useRef)(y),L=(0,r.useRef)(null),j=(0,r.useRef)(i),D=se(s),N=(0,r.useRef)(!1);ee((()=>{const e=W.init();return e.then((e=>(S.current=e)&&E(!1))).catch((e=>"cancelation"!==(null===e||void 0===e?void 0:e.type)&&void 0)),()=>O.current?function(){var e,t;null===(e=L.current)||void 0===e||e.dispose(),f?h&&ae.set(s,O.current.saveViewState()):null===(t=O.current.getModel())||void 0===t||t.dispose();O.current.dispose()}():e.cancel()})),te((()=>{const n=re(S.current,e||i,t||o,s);n!==O.current.getModel()&&(h&&ae.set(D,O.current.saveViewState()),O.current.setModel(n),h&&O.current.restoreViewState(ae.get(s)))}),[s],x),te((()=>{O.current.updateOptions(u)}),[u],x),te((()=>{O.current.getOption(S.current.editor.EditorOption.readOnly)?O.current.setValue(i):i!==O.current.getValue()&&(O.current.executeEdits("",[{range:O.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),O.current.pushUndoStop())}),[i],x),te((()=>{S.current.editor.setModelLanguage(O.current.getModel(),o)}),[o],x),te((()=>{void 0!==l&&O.current.revealLine(l)}),[l],x),te((()=>{S.current.editor.setTheme(a)}),[a],x);const T=(0,r.useCallback)((()=>{if(!N.current){M.current(S.current);const r=s||n,l=re(S.current,i||e,t||o,r);O.current=S.current.editor.create(A.current,{model:l,automaticLayout:!0,...u},d),h&&O.current.restoreViewState(ae.get(r)),S.current.editor.setTheme(a),_(!0),N.current=!0}}),[e,t,n,i,o,s,u,d,h,a]);return(0,r.useEffect)((()=>{x&&$.current(O.current,S.current)}),[x]),(0,r.useEffect)((()=>{!C&&!x&&T()}),[C,x,T]),j.current=i,(0,r.useEffect)((()=>{var e,t;x&&v&&(null===(e=L.current)||void 0===e||e.dispose(),L.current=null===(t=O.current)||void 0===t?void 0:t.onDidChangeModelContent((e=>{v(O.current.getValue(),e)})))}),[x,v]),(0,r.useEffect)((()=>{if(x){const e=S.current.editor.onDidChangeMarkers((e=>{var t;const n=null===(t=O.current.getModel())||void 0===t?void 0:t.uri;if(n){if(e.find((e=>e.path===n.path))){const e=S.current.editor.getModelMarkers({resource:n});null===k||void 0===k||k(e)}}}));return()=>{null===e||void 0===e||e.dispose()}}}),[x,k]),r.createElement(Q,{width:p,height:g,isEditorReady:x,loading:c,_ref:A,className:m,wrapperProps:b})}le.propTypes={defaultValue:H().string,defaultPath:H().string,defaultLanguage:H().string,value:H().string,language:H().string,path:H().string,theme:H().string,line:H().number,loading:H().oneOfType([H().element,H().string]),options:H().object,overrideServices:H().object,saveViewState:H().bool,keepCurrentModel:H().bool,width:H().oneOfType([H().number,H().string]),height:H().oneOfType([H().number,H().string]),className:H().string,wrapperProps:H().object,beforeMount:H().func,onMount:H().func,onChange:H().func,onValidate:H().func},le.defaultProps={theme:"light",loading:"Loading...",options:{},overrideServices:{},saveViewState:!0,keepCurrentModel:!1,width:"100%",height:"100%",wrapperProps:{},beforeMount:ne,onMount:ne,onValidate:ne};const ce=le;const ue=(0,r.memo)(ce);var de=n(2604),he=n(33510),fe=n(52919),pe=n(89114),ge=n(64796);const me=100;class be extends pe.m{constructor(e,t,n,r){super(e,t,n,r),this._onScrollDisposable=null,this._editor=e}updateColorDecorators(e){if(this._onScrollDisposable&&(this._onScrollDisposable.dispose(),this._onScrollDisposable=null),e.length>=500){const t=this._editor;let[n,r]=[Number.MAX_VALUE,Number.MIN_VALUE];const i=()=>{const i=t.getVisibleRanges(),[o,s]=i.reduce(((e,{startLineNumber:t,endLineNumber:n})=>[Math.min(t,e[0]),Math.max(n,e[1])]),[Number.MAX_VALUE,Number.MIN_VALUE]);if(n-o>me||s-r>me){let t=e.filter((({colorInfo:e})=>{const{startLineNumber:t,endLineNumber:n}=e.range;return o-t<me&&n-s<me}));super.updateColorDecorators(t)}};this._onScrollDisposable=t.onDidScrollChange(i),i()}else super.updateColorDecorators(e)}dispose(){var e;null===(e=this._onScrollDisposable)||void 0===e||e.dispose(),super.dispose()}}var ye=n(47014),we=n(1047),ve=n(22536),ke=n(38540),xe=n(62093),_e=n(21551),Ce=n(32947);function Ee(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function Se(e){return e>47&&e<58}function Oe(e,t,n){return n=n||90,(e&=-33)>=(t=t||65)&&e<=n}function Ae(e){return Se(e)||$e(e)}function $e(e){return 95===e||Oe(e)}function Me(e){return function(e){return 32===e||9===e||160===e}(e)||10===e||13===e}function Le(e){return 39===e||34===e}class je{constructor(e,t,n){null==n&&"string"===typeof e&&(n=e.length),this.string=e,this.pos=this.start=t||0,this.end=n||0}eof(){return this.pos>=this.end}limit(e,t){return new je(this.string,e,t)}peek(){return this.string.charCodeAt(this.pos)}next(){if(this.pos<this.string.length)return this.string.charCodeAt(this.pos++)}eat(e){const t=this.peek(),n="function"===typeof e?e(t):t===e;return n&&this.next(),n}eatWhile(e){const 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 De(`${e} at ${t+1}`,t,this.string)}}class De extends Error{constructor(e,t,n){super(e),this.pos=t,this.string=n}}function Ne(e){return e.tokens[e.pos]}function Te(e){return e.tokens[e.pos++]}function ze(e,t=e.start,n=e.pos){return e.tokens.slice(t,n)}function Pe(e){return e.pos<e.size}function Ie(e,t){const n=Ne(e);return!(!n||!t(n))&&(e.pos++,!0)}function Re(e,t,n=Ne(e)){n&&null!=n.start&&(t+=` at ${n.start}`);const r=new Error(t);return r.pos=n&&n.start,r}function Ue(e,t){const n={type:"TokenGroup",elements:[]};let r,i=n;const o=[];for(;Pe(e)&&(r=Ve(e,t)||qe(e,t));)if(i.elements.push(r),Ie(e,ut))o.push(i),i=r;else{if(Ie(e,dt))continue;if(Ie(e,ht))do{o.length&&(i=o.pop())}while(Ie(e,ht))}return n}function qe(e,t){if(Ie(e,lt)){const n=Ue(e,t);return Ye(Te(e),"group",!1)&&(n.repeat=function(e){return tt(Ne(e))?e.tokens[e.pos++]:void 0}(e)),n}}function Ve(e,t){let n;const r={type:"TokenElement",name:void 0,attributes:void 0,value:void 0,repeat:void 0,selfClose:!1,elements:[]};for(function(e,t){const n=e.pos;if(t.jsx&&Ie(e,nt))for(;Pe(e);){const{pos:t}=e;if(!Ie(e,it)||!Ie(e,nt)){e.pos=t;break}}for(;Pe(e)&&Ie(e,rt););if(e.pos!==n)return e.start=n,!0;return!1}(e,t)&&(r.name=ze(e));Pe(e);)if(e.start=e.pos,r.repeat||ct(r)||!Ie(e,tt))if(!r.value&&Je(e))r.value=Xe(e);else{if(!(n=We(e,"id",t)||We(e,"class",t)||Fe(e))){!ct(r)&&Ie(e,ft)&&(r.selfClose=!0,!r.repeat&&Ie(e,tt)&&(r.repeat=e.tokens[e.pos-1]));break}r.attributes?r.attributes=r.attributes.concat(n):r.attributes=Array.isArray(n)?n.slice():[n]}else r.repeat=e.tokens[e.pos-1];return ct(r)?void 0:r}function Fe(e){if(Ie(e,ot)){const t=[];let n;for(;Pe(e);)if(n=Be(e))t.push(n);else{if(Ie(e,st))break;if(!Ie(e,Qe))throw Re(e,`Unexpected "${Ne(e).type}" token`)}return t}}function We(e,t,n){if(Ke(Ne(e),t)){e.pos++;const i={name:[(r=t,{type:"Literal",value:r})]};return n.jsx&&Je(e)?(i.value=Xe(e),i.expression=!0):i.value=Ze(e)?ze(e):void 0,i}var r}function Be(e){return He(e)?{value:ze(e)}:Ze(e,!0)?{name:ze(e),value:Ie(e,et)&&(He(e)||Ze(e,!0))?ze(e):void 0}:void 0}function He(e){const t=e.pos,n=Ne(e);if(Ge(n)){for(e.pos++;Pe(e);)if(Ge(Te(e),n.single))return e.start=t,!0;throw Re(e,"Unclosed quote",n)}return!1}function Ze(e,t){const n=e.pos,r={attribute:0,expression:0,group:0};for(;Pe(e);){const n=Ne(e);if(r.expression)Ye(n,"expression")&&(r[n.context]+=n.open?1:-1);else{if(Ge(n)||Ke(n)||Qe(n)||tt(n))break;if(Ye(n)){if(!t)break;if(n.open)r[n.context]++;else{if(!r[n.context])break;r[n.context]--}}}e.pos++}return n!==e.pos&&(e.start=n,!0)}function Je(e){const t=e.pos;if(Ie(e,at)){let n=0;for(;Pe(e);){const t=Te(e);if(Ye(t,"expression"))if(t.open)n++;else{if(!n)break;n--}}return e.start=t,!0}return!1}function Xe(e){let t=e.start,n=e.pos;return Ye(e.tokens[t],"expression",!0)&&t++,Ye(e.tokens[n-1],"expression",!1)&&n--,ze(e,t,n)}function Ye(e,t,n){return Boolean(e&&"Bracket"===e.type&&(!t||e.context===t)&&(null==n||e.open===n))}function Ke(e,t){return Boolean(e&&"Operator"===e.type&&(!t||e.operator===t))}function Ge(e,t){return Boolean(e&&"Quote"===e.type&&(null==t||e.single===t))}function Qe(e){return Boolean(e&&"WhiteSpace"===e.type)}function et(e){return Ke(e,"equal")}function tt(e){return Boolean(e&&"Repeater"===e.type)}function nt(e){if(function(e){return"Literal"===e.type}(e)){const t=e.value.charCodeAt(0);return t>=65&&t<=90}return!1}function rt(e){return"Literal"===e.type||"RepeaterNumber"===e.type||"RepeaterPlaceholder"===e.type}function it(e){return Ke(e,"class")}function ot(e){return Ye(e,"attribute",!0)}function st(e){return Ye(e,"attribute",!1)}function at(e){return Ye(e,"expression",!0)}function lt(e){return Ye(e,"group",!0)}function ct(e){return!e.name&&!e.value&&!e.attributes}function ut(e){return Ke(e,"child")}function dt(e){return Ke(e,"sibling")}function ht(e){return Ke(e,"climb")}function ft(e){return Ke(e,"close")}function pt(e){return!!e.eat(92)&&(e.start=e.pos,e.eof()||e.pos++,!0)}function gt(e,t){return function(e,t){const n=e.pos;if((t.expression||t.attribute)&&e.eat(36)&&e.eat(123)){let t;e.start=e.pos;let r="";if(e.eatWhile(Se)?(t=Number(e.current()),r=e.eat(58)?mt(e):""):Oe(e.peek())&&(r=mt(e)),e.eat(125))return{type:"Field",index:t,name:r,start:n,end:e.pos};throw e.error("Expecting }")}e.pos=n}(e,t)||function(e){const t=e.pos;if(e.eat(36)&&e.eat(35))return{type:"RepeaterPlaceholder",value:void 0,start:t,end:e.pos};e.pos=t}(e)||function(e){const t=e.pos;if(e.eatWhile(36)){const n=e.pos-t;let r=!1,i=1,o=0;if(e.eat(64)){for(;e.eat(94);)o++;r=e.eat(45),e.start=e.pos,e.eatWhile(Se)&&(i=Number(e.current()))}return e.start=t,{type:"RepeaterNumber",size:n,reverse:r,base:i,parent:o,start:t,end:e.pos}}}(e)||function(e){const t=e.pos;if(e.eat(42)){e.start=e.pos;let n=1,r=!1;return e.eatWhile(Se)?n=Number(e.current()):r=!0,{type:"Repeater",count:n,value:0,implicit:r,start:t,end:e.pos}}}(e)||function(e){const t=e.pos;if(e.eatWhile(Me))return{type:"WhiteSpace",start:t,end:e.pos,value:e.substring(t,e.pos)}}(e)||function(e,t){const n=e.pos;let r="";for(;!e.eof();){if(pt(e)){r+=e.current();continue}const n=e.peek();if(n===t.quote||36===n||bt(n,t))break;if(t.expression&&125===n)break;if(!t.quote&&!t.expression){if(!t.attribute&&!_t(n))break;if(yt(n,t)||wt(n,t)||Le(n)||vt(n))break}r+=e.string[e.pos++]}if(n!==e.pos)return e.start=n,{type:"Literal",value:r,start:n,end:e.pos}}(e,t)||function(e){const t=kt(e.peek());if(t)return{type:"Operator",operator:t,start:e.pos++,end:e.pos}}(e)||function(e){const t=e.peek();if(Le(t))return{type:"Quote",single:39===t,start:e.pos++,end:e.pos}}(e)||function(e){const t=e.peek(),n=vt(t);if(n)return{type:"Bracket",open:xt(t),context:n,start:e.pos++,end:e.pos}}(e)}function mt(e){const 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 bt(e,t){const n=kt(e);return!(!n||t.quote||t.expression)&&(!t.attribute||"equal"===n)}function yt(e,t){return Me(e)&&!t.expression}function wt(e,t){return 42===e&&!t.attribute&&!t.expression}function vt(e){return 40===e||41===e?"group":91===e||93===e?"attribute":123===e||125===e?"expression":void 0}function kt(e){return(62===e?"child":43===e&&"sibling")||94===e&&"climb"||46===e&&"class"||35===e&&"id"||47===e&&"close"||61===e&&"equal"||void 0}function xt(e){return 123===e||91===e||40===e}function _t(e){return Ae(e)||45===e||58===e||33===e}const Ct={child:">",class:".",climb:"^",id:"#",equal:"=",close:"/",sibling:"+"},Et={Literal:e=>e.value,Quote:e=>e.single?"'":'"',Bracket:e=>"attribute"===e.context?e.open?"[":"]":"expression"===e.context?e.open?"{":"}":e.open?"(":"}",Operator:e=>Ct[e.operator],Field:(e,t)=>null!=e.index?e.name?`\${${e.index}:${e.name}}`:`\${${e.index}`:e.name?t.getVariable(e.name):"",RepeaterPlaceholder(e,t){let n;for(let r=t.repeaters.length-1;r>=0;r--)if(t.repeaters[r].implicit){n=t.repeaters[r];break}return t.inserted=!0,t.getText(n&&n.value)},RepeaterNumber(e,t){let n=1;const 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)){const o=Math.max(0,r-e.parent);if(o!==r){const e=t.repeaters[o];n+=i.count*e.value}}let o=String(n);for(;o.length<e.size;)o="0"+o;return o},WhiteSpace:e=>e.value};function St(e,t){if(!Et[e.type])throw new Error(`Unknown token ${e.type}`);return Et[e.type](e,t)}const Ot=/^((https?:|ftp:|file:)?\/\/|(www|ftp)\.)[^ ]*$/,At=/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,5}$/;function $t(e,t={}){let n,r=!1;t.text&&(n=Array.isArray(t.text)?t.text.filter((e=>e.trim())):t.text);const i={type:"Abbreviation",children:jt(e,{inserted:!1,repeaters:[],text:t.text,cleanText:n,repeatGuard:t.maxRepeat||Number.POSITIVE_INFINITY,getText(e){var i;let o;if(r=!0,Array.isArray(t.text)){if(void 0!==e&&e>=0&&e<n.length)return n[e];o=void 0!==e?t.text[e]:t.text.join("\n")}else o=null!==(i=t.text)&&void 0!==i?i:"";return o},getVariable(e){const n=t.variables&&t.variables[e];return null!=n?n:e}})};if(null!=t.text&&!r){const e=Rt(It(i.children));if(e){const n=Array.isArray(t.text)?t.text.join("\n"):t.text;Ut(e,n),"a"===e.name&&t.href&&function(e,t){var n;let r="";Ot.test(t)?(r=t,/\w+:/.test(r)||r.startsWith("//")||(r=`http://${r}`)):At.test(t)&&(r=`mailto:${t}`);const i=null===(n=e.attributes)||void 0===n?void 0:n.find((e=>"href"===e.name));i?i.value||(i.value=[r]):(e.attributes||(e.attributes=[]),e.attributes.push({name:"href",value:[r],valueType:"doubleQuote"}))}(e,n)}}return i}function Mt(e,t){let n=[];if(e.repeat){const r=e.repeat,i=Object.assign({},r);let o;i.count=i.implicit&&Array.isArray(t.text)?t.cleanText.length:i.count||1,t.repeaters.push(i);for(let s=0;s<i.count;s++){if(i.value=s,e.repeat=i,o=zt(e)?jt(e,t):Lt(e,t),i.implicit&&!t.inserted){const e=It(o),n=e&&Rt(e);n&&Ut(n,t.getText(i.value))}if(n=n.concat(o),--t.repeatGuard<=0)break}t.repeaters.pop(),e.repeat=r,i.implicit&&(t.inserted=!0)}else n=n.concat(zt(e)?jt(e,t):Lt(e,t));return n}function Lt(e,t){let n=[];const r={type:"AbbreviationNode",name:e.name&&Nt(e.name,t),value:e.value&&Tt(e.value,t),attributes:void 0,children:n,repeat:e.repeat&&Object.assign({},e.repeat),selfClosing:e.selfClose};let i=[r];for(const o of e.elements)n=n.concat(Mt(o,t));if(e.attributes){r.attributes=[];for(const n of e.attributes)r.attributes.push(Dt(n,t))}return r.name||r.attributes||!r.value||r.value.some(Pt)?r.children=n:i=i.concat(n),i}function jt(e,t){let n=[];for(const r of e.elements)n=n.concat(Mt(r,t));return e.repeat&&(n=function(e,t){for(const n of e)n.repeat||(n.repeat=Object.assign({},t));return e}(n,e.repeat)),n}function Dt(e,t){let n,r=!1,i=!1,o=e.expression?"expression":"raw";const s=e.name&&Nt(e.name,t);if(s&&"!"===s[0]&&(r=!0),s&&"."===s[s.length-1]&&(i=!0),e.value){const r=e.value.slice();if(Ge(r[0])){const e=r.shift();r.length&&It(r).type===e.type&&r.pop(),o=e.single?"singleQuote":"doubleQuote"}else Ye(r[0],"expression",!0)&&(o="expression",r.shift(),Ye(It(r),"expression",!1)&&r.pop());n=Tt(r,t)}return{name:i||r?s.slice(r?1:0,i?-1:void 0):s,value:n,boolean:i,implied:r,valueType:o}}function Nt(e,t){let n="";for(let r=0;r<e.length;r++)n+=St(e[r],t);return n}function Tt(e,t){const n=[];let r="";for(let i,o=0;o<e.length;o++)i=e[o],Pt(i)?(r&&(n.push(r),r=""),n.push(i)):r+=St(i,t);return r&&n.push(r),n}function zt(e){return"TokenGroup"===e.type}function Pt(e){return"object"===typeof e&&"Field"===e.type&&null!=e.index}function It(e){return e[e.length-1]}function Rt(e){return e.children.length?Rt(It(e.children)):e}function Ut(e,t){if(e.value){"string"===typeof It(e.value)?e.value[e.value.length-1]+=t:e.value.push(t)}else e.value=[t]}function qt(e,t){try{return $t(function(e,t={}){const n={tokens:r=e,start:0,pos:0,size:r.length};var r;const i=Ue(n,t);if(Pe(n))throw Re(n,"Unexpected character");return i}("string"===typeof e?function(e){const t=new je(e),n=[],r={group:0,attribute:0,expression:0,quote:0};let i,o=0;for(;!t.eof();){if(o=t.peek(),i=gt(t,r),!i)throw t.error("Unexpected character");n.push(i),"Quote"===i.type?r.quote=o===r.quote?0:o:"Bracket"===i.type&&(r[i.context]+=i.open?1:-1)}return n}(e):e,t),t)}catch(n){throw n instanceof De&&"string"===typeof e&&(n.message+=`\n${e}\n${"-".repeat(n.pos)}^`),n}}function Vt(e,t){return function(e){const t=e.pos;if(e.eat(36)&&e.eat(123)){let n;e.start=e.pos;let r="";if(e.eatWhile(Se)?(n=Number(e.current()),r=e.eat(58)?Ft(e):""):Oe(e.peek())&&(r=Ft(e)),e.eat(125))return{type:"Field",index:n,name:r,start:t,end:e.pos};throw e.error("Expecting }")}e.pos=t}(e)||function(e){const t=e.pos;if(function(e){const t=e.pos;e.eat(45);const n=e.pos,r=e.eatWhile(Se),i=e.pos;if(e.eat(46)){const t=e.eatWhile(Se);r||t||(e.pos=i)}e.pos===n&&(e.pos=t);return e.pos!==t}(e)){e.start=t;const n=e.current();return e.start=e.pos,e.eat(37)||e.eatWhile($e),{type:"NumberValue",value:Number(n),rawValue:n,unit:e.current(),start:t,end:e.pos}}}(e)||function(e){const t=e.pos;if(e.eat(35)){const n=e.pos;let r="",i="";if(e.eatWhile(Jt)?(r=e.substring(n,e.pos),i=Bt(e)):e.eat(116)?(r="0",i=Bt(e)||"0"):i=Bt(e),r||i||e.eof()){const{r:n,g:o,b:s,a:a}=function(e,t){let n="0",r="0",i="0",o=Number(null!=t&&""!==t?t:1);if("t"===e)o=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:n=(e+=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:o}}(r,i);return{type:"ColorValue",r:n,g:o,b:s,a:a,raw:e.substring(t+1,e.pos),start:t,end:e.pos}}return Wt(e,t)}e.pos=t}(e)||function(e){const t=e.peek(),n=e.pos;let r=!1;if(Le(t)){for(e.pos++;!e.eof();){if(e.eat(t)){r=!0;break}e.pos++}return e.start=n,{type:"StringValue",value:e.substring(n+1,e.pos-(r?1:0)),quote:39===t?"single":"double",start:n,end:e.pos}}}(e)||function(e){const t=e.peek();if(function(e){return 40===e||41===e}(t))return{type:"Bracket",open:40===t,start:e.pos++,end:e.pos}}(e)||Ht(e)||function(e){const t=e.pos;if(e.eatWhile(Me))return{type:"WhiteSpace",start:t,end:e.pos}}(e)||function(e,t){const n=e.pos;e.eat(Zt)?e.eatWhile(n?Xt:Yt):e.eat($e)?e.eatWhile(t?Yt:Xt):(e.eat(46),e.eatWhile(Yt));if(n!==e.pos)return e.start=n,Wt(e,e.start=n)}(e,t)}function Ft(e){const 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 Wt(e,t=e.start,n=e.pos){return{type:"Literal",value:e.substring(t,n),start:t,end:n}}function Bt(e){const t=e.pos;return e.eat(46)?(e.start=t,e.eatWhile(Se)?e.current():"1"):""}function Ht(e){const t=(43===(n=e.peek())?"+":33===n&&"!")||44===n&&","||58===n&&":"||45===n&&"-"||void 0;var n;if(t)return{type:"Operator",operator:t,start:e.pos++,end:e.pos}}function Zt(e){return 64===e||36===e}function Jt(e){return Se(e)||Oe(e,65,70)}function Xt(e){return Ae(e)||45===e}function Yt(e){return $e(e)||37===e||47===e}function Kt(e){return"ColorValue"===e.type||"NumberValue"===e.type&&!e.unit}function Gt(e,t){let n=0,r=0;for(;t.length;){const e=Qt(t);if("Literal"!==e.type&&"NumberValue"!==e.type)break;n=e.start,r||(r=e.end),t.pop()}n!==r&&t.push(Wt(e,n,r))}function Qt(e){return e[e.length-1]}function en(e){return e.tokens[e.pos]}function tn(e){return e.pos<e.size}function nn(e,t){return!!t(en(e))&&(e.pos++,!0)}function rn(e,t,n=en(e)){n&&null!=n.start&&(t+=` at ${n.start}`);const r=new Error(t);return r.pos=n&&n.start,r}function on(e,t){let n,r,i=!1;const o=[],s=en(e),a=!!t.value;for(a||!ln(s)||function(e){const t=e.tokens[e.pos],n=e.tokens[e.pos+1];return t&&n&&ln(t)&&"Bracket"===n.type}(e)||(e.pos++,n=s.value,nn(e,wn)),a&&nn(e,hn);tn(e);)if(nn(e,bn))i=!0;else if(r=sn(e,a))o.push(r);else if(!nn(e,mn))break;if(n||o.length||i)return{name:n,value:o,important:i}}function sn(e,t){const n=[];let r,i;for(;tn(e);)if(r=en(e),yn(r))e.pos++,ln(r)&&(i=an(e))?n.push({type:"FunctionCall",name:r.value,arguments:i}):n.push(r);else{if(!(wn(r)||t&&hn(r)))break;e.pos++}return n.length?{type:"CSSValue",value:n}:void 0}function an(e){const t=e.pos;if(nn(e,un)){const n=[];let r;for(;tn(e)&&!nn(e,dn);)if(r=sn(e,!0))n.push(r);else if(!nn(e,hn)&&!nn(e,gn))throw rn(e,"Unexpected token");return e.start=t,n}}function ln(e){return e&&"Literal"===e.type}function cn(e,t){return e&&"Bracket"===e.type&&(null==t||e.open===t)}function un(e){return cn(e,!0)}function dn(e){return cn(e,!1)}function hn(e){return e&&"WhiteSpace"===e.type}function fn(e,t){return e&&"Operator"===e.type&&(!t||e.operator===t)}function pn(e){return fn(e,"+")}function gn(e){return fn(e,",")}function mn(e){return gn(e)}function bn(e){return fn(e,"!")}function yn(e){return"StringValue"===e.type||"ColorValue"===e.type||"NumberValue"===e.type||"Literal"===e.type||"Field"===e.type}function wn(e){return fn(e,":")||fn(e,"-")}function vn(e,t){try{const n="string"===typeof e?function(e,t){let n,r=0;const i=new je(e),o=[];for(;!i.eof();){if(n=Vt(i,0===r&&!t),!n)throw i.error("Unexpected character");if("Bracket"===n.type&&(!r&&n.open&&Gt(i,o),r+=n.open?1:-1,r<0))throw i.error("Unexpected bracket",n.start);o.push(n),Kt(n)&&(n=Ht(i))&&o.push(n)}return o}(e,t&&t.value):e;return function(e,t={}){const n=function(e){return{tokens:e,start:0,pos:0,size:e.length}}(e),r=[];let i;for(;tn(n);)if(i=on(n,t))r.push(i);else if(!nn(n,pn))throw rn(n,"Unexpected token");return r}(n,t)}catch(n){throw n instanceof De&&"string"===typeof e&&(n.message+=`\n${e}\n${"-".repeat(n.pos)}^`),n}}function kn(e,t,n){if(e&&t){e.length&&n&&_n(e,n);for(const n of t)_n(e,n);return e}const r=e||t;return r&&r.slice()}function xn(e,t,n){return e.name=t.name,n.options["output.reverseAttributes"]||(e.value=t.value),e.implied||(e.implied=t.implied),e.boolean||(e.boolean=t.boolean),"expression"!==e.valueType&&(e.valueType=t.valueType),e}function _n(e,t){const n=e.length-1;"string"===typeof e[n]&&"string"===typeof t?e[n]+=t:e.push(t)}function Cn(e){let t;for(;e.children.length;)t=e,e=e.children[e.children.length-1];return{parent:t,node:e}}function En(e){return"AbbreviationNode"===e.type}function Sn(e,t,n){let r=[];for(const i of e.children){const e=t(i);if(e){r=r.concat(e.children);const n=Cn(e);En(n.node)&&(n.node.children=n.node.children.concat(Sn(i,t)))}else r.push(i),i.children=Sn(i,t)}return e.children=r}function On(e,t){e.selfClosing&&(t.selfClosing=!0),null!=e.value&&(t.value=e.value),e.repeat&&(t.repeat=e.repeat)}function An(e,t=0){return{options:e,value:"",level:t,offset:0,line:0,column:0}}function $n(e,t){Pn(e,(0,e.options["output.text"])(t,e.offset,e.line,e.column))}function Mn(e,t){const n=t.split(/\r\n|\r|\n/g);for(let r=0,i=n.length-1;r<=i;r++)$n(e,n[r]),r!==i&&Ln(e,!0)}function Ln(e,t){const n=e.options["output.baseIndent"];$n(e,e.options["output.newline"]+n),e.line++,e.column=n.length,t&&function(e,t=e.level){const n=e.options["output.indent"];$n(e,n.repeat(Math.max(t,0)))}(e,!0===t?e.level:t)}function jn(e,t,n){Pn(e,(0,e.options["output.field"])(t,n,e.offset,e.line,e.column))}function Dn(e,t){return In(e,t.options["output.attributeCase"])}function Nn(e,t,n){return"expression"===e.valueType?n?"{":"}":"single"===t.options["output.attributeQuotes"]?"'":'"'}function Tn(e,t){return e.boolean||t.options["output.booleanAttributes"].includes((e.name||"").toLowerCase())}function zn(e,t){return"string"===typeof e?t.options.inlineElements.includes(e.toLowerCase()):e.name?zn(e.name,t):Boolean(e.value&&!e.attributes)}function Pn(e,t){e.value+=t,e.offset+=t.length,e.column+=t.length}function In(e,t){return t?"upper"===t?e.toUpperCase():e.toLowerCase():e}const Rn={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 Un(e,t,n){const r=function(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(En(n))return n}}(t),i=n.context?n.context.name:"",o=((r?r.name:i)||"").toLowerCase();e.name=Rn[o]||(zn(o,n)?"span":"div")}const qn={ru:{common:["\u0434\u0430\u043b\u0435\u043a\u043e-\u0434\u0430\u043b\u0435\u043a\u043e","\u0437\u0430","\u0441\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u043c\u0438","\u0433\u043e\u0440\u0430\u043c\u0438","\u0432 \u0441\u0442\u0440\u0430\u043d\u0435","\u0433\u043b\u0430\u0441\u043d\u044b\u0445","\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u044b\u0445","\u0436\u0438\u0432\u0443\u0442","\u0440\u044b\u0431\u043d\u044b\u0435","\u0442\u0435\u043a\u0441\u0442\u044b"],words:["\u0432\u0434\u0430\u043b\u0438","\u043e\u0442 \u0432\u0441\u0435\u0445","\u043e\u043d\u0438","\u0431\u0443\u043a\u0432\u0435\u043d\u043d\u044b\u0445","\u0434\u043e\u043c\u0430\u0445","\u043d\u0430 \u0431\u0435\u0440\u0435\u0433\u0443","\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430","\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e","\u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0433\u043e","\u043e\u043a\u0435\u0430\u043d\u0430","\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439","\u0440\u0443\u0447\u0435\u0435\u043a","\u0434\u0430\u043b\u044c","\u0436\u0443\u0440\u0447\u0438\u0442","\u043f\u043e \u0432\u0441\u0435\u0439","\u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442","\u0435\u0435","\u0432\u0441\u0435\u043c\u0438","\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438","\u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438","\u044d\u0442\u0430","\u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f","\u0441\u0442\u0440\u0430\u043d\u0430","\u043a\u043e\u0442\u043e\u0440\u043e\u0439","\u0436\u0430\u0440\u0435\u043d\u043d\u044b\u0435","\u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f","\u0437\u0430\u043b\u0435\u0442\u0430\u044e\u0442","\u043f\u0440\u044f\u043c\u043e","\u0440\u043e\u0442","\u0434\u0430\u0436\u0435","\u0432\u0441\u0435\u043c\u043e\u0433\u0443\u0449\u0430\u044f","\u043f\u0443\u043d\u043a\u0442\u0443\u0430\u0446\u0438\u044f","\u043d\u0435","\u0438\u043c\u0435\u0435\u0442","\u0432\u043b\u0430\u0441\u0442\u0438","\u043d\u0430\u0434","\u0440\u044b\u0431\u043d\u044b\u043c\u0438","\u0442\u0435\u043a\u0441\u0442\u0430\u043c\u0438","\u0432\u0435\u0434\u0443\u0449\u0438\u043c\u0438","\u0431\u0435\u0437\u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u043d\u044b\u0439","\u043e\u0431\u0440\u0430\u0437","\u0436\u0438\u0437\u043d\u0438","\u043e\u0434\u043d\u0430\u0436\u0434\u044b","\u043e\u0434\u043d\u0430","\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f","\u0441\u0442\u0440\u043e\u0447\u043a\u0430","\u0440\u044b\u0431\u043d\u043e\u0433\u043e","\u0442\u0435\u043a\u0441\u0442\u0430","\u0438\u043c\u0435\u043d\u0438","lorem","ipsum","\u0440\u0435\u0448\u0438\u043b\u0430","\u0432\u044b\u0439\u0442\u0438","\u0431\u043e\u043b\u044c\u0448\u043e\u0439","\u043c\u0438\u0440","\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0438","\u0432\u0435\u043b\u0438\u043a\u0438\u0439","\u043e\u043a\u0441\u043c\u043e\u043a\u0441","\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u043b","\u043e","\u0437\u043b\u044b\u0445","\u0437\u0430\u043f\u044f\u0442\u044b\u0445","\u0434\u0438\u043a\u0438\u0445","\u0437\u043d\u0430\u043a\u0430\u0445","\u0432\u043e\u043f\u0440\u043e\u0441\u0430","\u043a\u043e\u0432\u0430\u0440\u043d\u044b\u0445","\u0442\u043e\u0447\u043a\u0430\u0445","\u0437\u0430\u043f\u044f\u0442\u043e\u0439","\u043d\u043e","\u0442\u0435\u043a\u0441\u0442","\u0434\u0430\u043b","\u0441\u0431\u0438\u0442\u044c","\u0441\u0435\u0431\u044f","\u0442\u043e\u043b\u043a\u0443","\u043e\u043d","\u0441\u043e\u0431\u0440\u0430\u043b","\u0441\u0435\u043c\u044c","\u0441\u0432\u043e\u0438\u0445","\u0437\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u0445","\u0431\u0443\u043a\u0432","\u043f\u043e\u0434\u043f\u043e\u044f\u0441\u0430\u043b","\u0438\u043d\u0438\u0446\u0438\u0430\u043b","\u0437\u0430","\u043f\u043e\u044f\u0441","\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f","\u0434\u043e\u0440\u043e\u0433\u0443","\u0432\u0437\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c","\u043f\u0435\u0440\u0432\u0443\u044e","\u0432\u0435\u0440\u0448\u0438\u043d\u0443","\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0445","\u0433\u043e\u0440","\u0431\u0440\u043e\u0441\u0438\u043b","\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439","\u0432\u0437\u0433\u043b\u044f\u0434","\u043d\u0430\u0437\u0430\u0434","\u0441\u0438\u043b\u0443\u044d\u0442","\u0441\u0432\u043e\u0435\u0433\u043e","\u0440\u043e\u0434\u043d\u043e\u0433\u043e","\u0433\u043e\u0440\u043e\u0434\u0430","\u0431\u0443\u043a\u0432\u043e\u0433\u0440\u0430\u0434","\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a","\u0434\u0435\u0440\u0435\u0432\u043d\u0438","\u0430\u043b\u0444\u0430\u0432\u0438\u0442","\u043f\u043e\u0434\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a","\u0441\u0432\u043e\u0435\u0433\u043e","\u043f\u0435\u0440\u0435\u0443\u043b\u043a\u0430","\u0433\u0440\u0443\u0441\u0442\u043d\u044b\u0439","\u0440\u0435\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439","\u0432\u043e\u043f\u0440\u043e\u0441","\u0441\u043a\u0430\u0442\u0438\u043b\u0441\u044f","\u0435\u0433\u043e","\u0449\u0435\u043a\u0435","\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b","\u0441\u0432\u043e\u0439","\u043f\u0443\u0442\u044c","\u0434\u043e\u0440\u043e\u0433\u0435","\u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b","\u0440\u0443\u043a\u043e\u043f\u0438\u0441\u044c","\u043e\u043d\u0430","\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u043b\u0430","\u043c\u043e\u0435\u0439","\u0432\u0441\u0435","\u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f","\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e","\u0440\u0430\u0437","\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435","\u0447\u0442\u043e","\u043c\u0435\u043d\u044f","\u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c","\u044d\u0442\u043e","\u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430","\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0439\u0441\u044f","\u0442\u044b","\u043b\u0443\u0447\u0448\u0435","\u0441\u0432\u043e\u044e","\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0443\u044e","\u0441\u0442\u0440\u0430\u043d\u0443","\u043f\u043e\u0441\u043b\u0443\u0448\u0430\u0432\u0448\u0438\u0441\u044c","\u0440\u0443\u043a\u043e\u043f\u0438\u0441\u0438","\u043d\u0430\u0448","\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b","\u0441\u0432\u043e\u0439","\u043f\u0443\u0442\u044c","\u0432\u0441\u043a\u043e\u0440\u0435","\u0435\u043c\u0443","\u043f\u043e\u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0441\u044f","\u043a\u043e\u0432\u0430\u0440\u043d\u044b\u0439","\u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u044c","\u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0445","\u0442\u0435\u043a\u0441\u0442\u043e\u0432","\u043d\u0430\u043f\u043e\u0438\u0432\u0448\u0438\u0439","\u044f\u0437\u044b\u043a\u043e\u043c","\u0440\u0435\u0447\u044c\u044e","\u0437\u0430\u043c\u0430\u043d\u0438\u0432\u0448\u0438\u0439","\u0441\u0432\u043e\u0435","\u0430\u0433\u0435\u043d\u0442\u0441\u0442\u0432\u043e","\u043a\u043e\u0442\u043e\u0440\u043e\u0435","\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e","\u0441\u043d\u043e\u0432\u0430","\u0441\u043d\u043e\u0432\u0430","\u0441\u0432\u043e\u0438\u0445","\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445","\u0435\u0441\u043b\u0438","\u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b\u0438","\u0442\u043e","\u0436\u0438\u0432\u0435\u0442","\u0442\u0430\u043c","\u0434\u043e","\u0441\u0438\u0445","\u043f\u043e\u0440"]},sp:{common:["mujer","uno","dolor","m\xe1s","de","poder","mismo","si"],words:["ejercicio","preferencia","perspicacia","laboral","pa\xf1o","suntuoso","molde","namibia","planeador","mirar","dem\xe1s","oficinista","excepci\xf3n","odio","consecuencia","casi","auto","chicharra","velo","elixir","ataque","no","odio","temporal","cu\xf3rum","dign\xedsimo","facilismo","letra","nihilista","expedici\xf3n","alma","alveolar","aparte","le\xf3n","animal","como","paria","belleza","modo","natividad","justo","ataque","s\xe9quito","pillo","sed","ex","y","voluminoso","temporalidad","verdades","racional","asunci\xf3n","incidente","marejada","placenta","amanecer","fuga","previsor","presentaci\xf3n","lejos","necesariamente","sospechoso","adiposidad","quind\xedo","p\xf3cima","voluble","d\xe9bito","sinti\xf3","accesorio","falda","sapiencia","volutas","queso","permacultura","laudo","soluciones","entero","pan","litro","tonelada","culpa","libertario","mosca","dictado","reincidente","nascimiento","dolor","escolar","impedimento","m\xednima","mayores","repugnante","dulce","obcecado","monta\xf1a","enigma","total","delet\xe9reo","d\xe9cima","c\xe1bala","fotograf\xeda","dolores","molesto","olvido","paciencia","resiliencia","voluntad","molestias","magn\xedfico","distinci\xf3n","ovni","marejada","cerro","torre","y","abogada","manantial","corporal","agua","crep\xfasculo","ataque","desierto","laboriosamente","angustia","afortunado","alma","encefalograma","materialidad","cosas","o","renuncia","error","menos","conejo","abad\xeda","analfabeto","remo","fugacidad","oficio","en","alm\xe1cigo","vos","pan","represi\xf3n","n\xfameros","triste","refugiado","trote","inventor","corchea","repelente","magma","recusado","patr\xf3n","expl\xedcito","paloma","s\xedndrome","inmune","autoinmune","comodidad","ley","vietnamita","demonio","tasmania","repeler","ap\xe9ndice","arquitecto","columna","yugo","computador","mula","a","prop\xf3sito","fantas\xeda","alias","rayo","tenedor","deleznable","ventana","cara","anemia","corrupto"]},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"]}},Vn=/^lorem([a-z]*)(\d*)(-\d*)?$/i;function Fn(e,t){return Math.floor(Math.random()*(t-e)+e)}function Wn(e,t){const n=e.length,r=Math.min(n,t),i=[];for(;i.length<r;){const t=e[Fn(0,n)];i.includes(t)||i.push(t)}return i}function Bn(e,t){var n,r;return e.length&&(e=[(n=e[0],n[0].toUpperCase()+n.slice(1))].concat(e.slice(1))),e.join(" ")+(t||(r="?!...")[Fn(0,r.length-1)])}function Hn(e){if(e.length<2)return e;const t=(e=e.slice()).length,n=/,$/;let r=0;r=t>3&&t<=6?Fn(0,1):t>6&&t<=12?Fn(0,2):Fn(1,4);for(let i,o=0;o<r;o++)i=Fn(0,t-2),n.test(e[i])||(e[i]+=",");return e}function Zn(e,t,n){const r=[];let i,o=0;for(n&&e.common&&(i=e.common.slice(0,t),o+=i.length,r.push(Bn(Hn(i),".")));o<t;)i=Wn(e.words,Math.min(Fn(2,30),t-o)),o+=i.length,r.push(Bn(Hn(i)));return r.join(" ")}function Jn(e){"class"===e.name?e.name="className":"for"===e.name&&(e.name="htmlFor")}function Xn(e){return"select"!==e.name}const Yn=/^(-+)([a-z0-9]+[a-z0-9-]*)/i,Kn=/^(_+)([a-z0-9]+[a-z0-9-_]*)/i,Gn=e=>/^[a-z]\-/i.test(e),Qn=e=>/^[a-z]/i.test(e);function er(e,t,n){!function(e){const t=tr(e),n=[];for(const r of t.classNames){const e=r.indexOf("_");e>0&&!r.startsWith("-")?(n.push(r.slice(0,e)),n.push(r.slice(e))):n.push(r)}n.length&&(t.classNames=n.filter(lr),t.block=ir(t.classNames),sr(e,t.classNames.join(" ")))}(e),function(e,t,n){const r=tr(e),i=[],{options:o}=n,s=t.slice(1).concat(e);for(let l of r.classNames){let e,t="";const r=l;(e=l.match(Yn))&&(t=rr(s,e[1].length,n.context)+o["bem.element"]+e[2],i.push(t),l=l.slice(e[0].length)),(e=l.match(Kn))&&(t||(t=rr(s,e[1].length),i.push(t)),i.push(`${t}${o["bem.modifier"]}${e[2]}`),l=l.slice(e[0].length)),l===r&&i.push(r)}const a=i.filter(lr);a.length&&sr(e,a.join(" "))}(e,t,n)}function tr(e){if(!e._bem){let t="";if(e.attributes)for(const n of e.attributes)if("class"===n.name&&n.value){t=ar(n.value);break}e._bem=nr(t)}return e._bem}function nr(e){const t=e?e.split(/\s+/):[];return{classNames:t,block:ir(t)}}function rr(e,t=0,n){let r=Math.max(e.length-t,0);do{const t=e[r];if(t){const e=tr(t);if(e.block)return e.block}}while(0<r--);if(n){const e=function(e){return e._bem||(e._bem=nr(e.attributes&&e.attributes.class||"")),e._bem}(n);if(e.block)return e.block}return""}function ir(e){return or(e,Gn)||or(e,Qn)||void 0}function or(e,t){for(const n of e){if(Yn.test(n)||Kn.test(n))break;if(t(n))return n}}function sr(e,t){for(const n of e.attributes)if("class"===n.name){n.value=[t];break}}function ar(e){let t="";for(const n of e)t+="string"===typeof n?n:n.name;return t}function lr(e,t,n){return!!e&&n.indexOf(e)===t}function cr(e,t,n){const r=(e,r,o)=>{const{parent:s,current:a}=n;n.parent=a,n.current=e,t(e,r,o,n,i),n.current=a,n.parent=s},i=(e,t,i)=>{n.ancestors.push(n.current),r(e,t,i),n.ancestors.pop()};e.children.forEach(r)}function ur(e){return{current:null,parent:void 0,ancestors:[],config:e,field:1,out:An(e.options)}}const dr=[{type:"Field",index:0,name:""}];function hr(e){return!!e&&(!e.name&&!e.attributes)}function fr(e,t){return!!e&&zn(e,t)}function pr(e){return"object"===typeof e&&"Field"===e.type}function gr(e,t){const{out:n}=t;let r=-1;for(const i of e)"string"===typeof i?Mn(n,i):(jn(n,t.field+i.index,i.name),i.index>r&&(r=i.index));-1!==r&&(t.field+=r+1)}function mr(e){return!e.implied||"raw"!==e.valueType||!!e.value&&e.value.length>0}function br(e){const t=[],n={pos:0,text:e};let r,i=n.pos,o=n.pos;for(;n.pos<n.text.length;)o=n.pos,(r=yr(n))?(i!==n.pos&&t.push(e.slice(i,o)),t.push(r),i=n.pos):n.pos++;return i!==n.pos&&t.push(e.slice(i)),t}function yr(e){if(91===wr(e)){const t=++e.pos;let n=t,r=t,i=1;for(;e.pos<e.text.length;){const o=wr(e);if(vr(o)){for(n=e.pos;kr(wr(e));)e.pos++;r=e.pos}else{if(91===o)i++;else if(93===o&&0===--i)return{before:e.text.slice(t,n),after:e.text.slice(r,e.pos++),name:e.text.slice(n,r)};e.pos++}}}}function wr(e,t=e.pos){return e.text.charCodeAt(t)}function vr(e){return e>=65&&e<=90}function kr(e){return vr(e)||e>47&&e<58||95===e||45===e}function xr(e,t){const{comment:n}=t;if(!n.enabled||!n.trigger||!e.name||!e.attributes)return!1;for(const r of e.attributes)if(r.name&&n.trigger.includes(r.name))return!0;return!1}function _r(e,t,n){const r={},{out:i}=n;for(const o of e.attributes)o.name&&o.value&&(r[o.name.toUpperCase()]=o.value);for(const o of t)"string"===typeof o?Mn(i,o):r[o.name]&&(Mn(i,o.before),gr(r[o.name],n),Mn(i,o.after))}const Cr=/^<([\w\-:]+)[\s>]/;function Er(e,t){const n=ur(t);return n.comment=function(e){const{options:t}=e;return{enabled:t["comment.enabled"],trigger:t["comment.trigger"],before:t["comment.before"]?br(t["comment.before"]):void 0,after:t["comment.after"]?br(t["comment.after"]):void 0}}(t),cr(e,Sr,n),n.out.value}function Sr(e,t,n,r,i){const{out:o,config:s}=r,a=$r(e,t,n,r),l=function(e){const{config:t,parent:n}=e;if(!n||hr(n)||n.name&&t.options["output.formatSkip"].includes(n.name))return 0;return 1}(r);if(o.level+=l,a&&Ln(o,!0),e.name){const t=function(e,t){return In(e,t.options["output.tagCase"])}(e.name,s);if(function(e,t){xr(e,t)&&t.comment.before&&_r(e,t.comment.before,t)}(e,r),Mn(o,`<${t}`),e.attributes)for(const n of e.attributes)mr(n)&&Or(n,r);if(!e.selfClosing||e.children.length||e.value){if(Mn(o,">"),!Ar(e,r,i)){if(e.value){const t=e.value.some(Mr)||function(e,t){if(e.length&&"string"===typeof e[0]){const n=Cr.exec(e[0]);if((null===n||void 0===n?void 0:n.length)&&!t.options.inlineElements.includes(n[1].toLowerCase()))return!0}return!1}(e.value,s);t&&Ln(r.out,++o.level),gr(e.value,r),t&&Ln(r.out,--o.level)}if(e.children.forEach(i),!e.value&&!e.children.length){const t=s.options["output.formatLeafNode"]||s.options["output.formatForce"].includes(e.name);t&&Ln(r.out,++o.level),gr(dr,r),t&&Ln(r.out,--o.level)}}Mn(o,`</${t}>`),function(e,t){xr(e,t)&&t.comment.after&&_r(e,t.comment.after,t)}(e,r)}else Mn(o,`${function(e){switch(e.options["output.selfClosingStyle"]){case"xhtml":return" /";case"xml":return"/";default:return""}}(s)}>`)}else!Ar(e,r,i)&&e.value&&(gr(e.value,r),e.children.forEach(i));if(a&&t===n.length-1&&r.parent){const e=hr(r.parent)?0:1;Ln(o,o.level-e)}o.level-=l}function Or(e,t){const{out:n,config:r}=t;if(e.name){const i=Dn(e.name,r),o=Nn(e,r,!0),s=Nn(e,r);let a=e.value;Tn(e,r)&&!a?r.options["output.compactBoolean"]||(a=[i]):a||(a=dr),Mn(n," "+i),a?(Mn(n,"="+o),gr(a,t),Mn(n,s)):"html"!==r.options["output.selfClosingStyle"]&&Mn(n,"="+o+s)}}function Ar(e,t,n){if(e.value&&e.children.length){const r=e.value.findIndex(pr);if(-1!==r){gr(e.value.slice(0,r),t);const i=t.out.line;let o=r+1;return e.children.forEach(n),t.out.line!==i&&"string"===typeof e.value[o]&&Mn(t.out,e.value[o++].trimLeft()),gr(e.value.slice(o),t),!0}}return!1}function $r(e,t,n,r){const{config:i,parent:o}=r;if(!i.options["output.format"])return!1;if(0===t&&!o)return!1;if(o&&hr(o)&&1===n.length)return!1;if(hr(e)){if(hr(n[t-1])||hr(n[t+1])||e.value.some(Mr)||e.value.some(pr)&&e.children.length)return!0}if(zn(e,i)){if(0===t){for(let e=0;e<n.length;e++)if(!zn(n[e],i))return!0}else if(!zn(n[t-1],i))return!0;if(i.options["output.inlineBreak"]){let e=1,r=t,o=t;for(;fr(n[--r],i);)e++;for(;fr(n[++o],i);)e++;if(e>=i.options["output.inlineBreak"])return!0}for(let t=0,n=e.children.length;t<n;t++)if($r(e.children[t],t,e.children,r))return!0;return!1}return!0}function Mr(e){return"string"===typeof e&&/\r|\n/.test(e)}function Lr(e,t,n){const r=ur(t);return r.options=n||{},cr(e,jr,r),r.out.value}function jr(e,t,n,r,i){const{out:o,options:s}=r,{primary:a,secondary:l}=function(e){const t=[],n=[];if(e.attributes)for(const r of e.attributes)Dr(r)?t.push(r):n.push(r);return{primary:t,secondary:n}}(e),c=r.parent?1:0;o.level+=c,function(e,t,n,r){if(!r.parent&&0===t)return!1;return!hr(e)}(e,t,0,r)&&Ln(o,!0),!e.name||"div"===e.name&&a.length||Mn(o,(s.beforeName||"")+e.name+(s.afterName||"")),function(e,t){for(const n of e)if(n.value)if("class"===n.name){Mn(t.out,".");gr(n.value.map((e=>"string"===typeof e?e.replace(/\s+/g,"."):e)),t)}else Mn(t.out,"#"),gr(n.value,t)}(a,r),function(e,t){if(e.length){const{out:n,config:r,options:i}=t;i.beforeAttribute&&Mn(n,i.beforeAttribute);for(let o=0;o<e.length;o++){const s=e[o];Mn(n,Dn(s.name||"",r)),Tn(s,r)&&!s.value?!r.options["output.compactBoolean"]&&i.booleanValue&&Mn(n,"="+i.booleanValue):(Mn(n,"="+Nn(s,r,!0)),gr(s.value||dr,t),Mn(n,Nn(s,r))),o!==e.length-1&&i.glueAttribute&&Mn(n,i.glueAttribute)}i.afterAttribute&&Mn(n,i.afterAttribute)}}(l.filter(mr),r),!e.selfClosing||e.value||e.children.length?(!function(e,t){if(!e.value&&e.children.length)return;const n=e.value||dr,r=function(e){const t=[];let n=[];for(const r of e)if("string"===typeof r){const 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}(n),{out:i,options:o}=t;if(1===r.length)(e.name||e.attributes)&&$n(i," "),gr(n,t);else{const e=[];let n=0;for(const t of r){const r=Nr(t);e.push(r),r>n&&(n=r)}i.level++;for(let s=0;s<r.length;s++)Ln(i,!0),o.beforeTextLine&&$n(i,o.beforeTextLine),gr(r[s],t),o.afterTextLine&&($n(i," ".repeat(n-e[s])),$n(i,o.afterTextLine));i.level--}}(e,r),e.children.forEach(i)):r.options.selfClose&&Mn(o,r.options.selfClose),o.level-=c}function Dr(e){return"class"===e.name||"id"===e.name}function Nr(e){let t=0;for(const n of e)t+="string"===typeof n?n.length:n.name.length;return t}const Tr={html:Er,haml:function(e,t){return Lr(e,t,{beforeName:"%",beforeAttribute:"(",afterAttribute:")",glueAttribute:" ",afterTextLine:" |",booleanValue:"true",selfClose:"/"})},slim:function(e,t){return Lr(e,t,{beforeAttribute:" ",glueAttribute:" ",beforeTextLine:"| ",selfClose:"/"})},pug:function(e,t){return Lr(e,t,{beforeAttribute:"(",afterAttribute:")",glueAttribute:", ",beforeTextLine:"| ",selfClose:"xml"===t.options["output.selfClosingStyle"]?"/":""})}};function zr(e,t){let n;if("string"===typeof e){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=qt(e,r),n=t.text,t.text=void 0}return e=function(e,t){const n=[],r=t.options["output.reverseAttributes"],i=e=>{const o=e.name&&t.snippets[e.name];if(!o||n.includes(o))return null;const s=qt(o,t);n.push(o),Sn(s,i),n.pop();for(const t of s.children){if(e.attributes){const n=t.attributes||[],i=e.attributes||[];t.attributes=r?i.concat(n):n.concat(i)}On(e,t)}return s};return Sn(e,i),e}(e,t),function(e,t,n){const r=[e],i=e=>{t(e,r,n),r.push(e),e.children.forEach(i),r.pop()};e.children.forEach(i)}(e,Ir,t),t.text=null!==n&&void 0!==n?n:t.text,e}function Pr(e,t){return(Tr[t.syntax]||Er)(e,t)}function Ir(e,t,n){!function(e,t,n){!e.name&&e.attributes&&Un(e,t,n)}(e,t,n),function(e,t){if(!e.attributes)return;const n=[],r={};for(const i of e.attributes)if(i.name){const e=i.name;if(e in r){const n=r[e];"class"===e?n.value=kn(n.value,i.value," "):xn(n,i,t)}else n.push(r[e]=Object.assign({},i))}else n.push(i);e.attributes=n}(e,n),function(e,t,n){let r;if(e.name&&(r=e.name.match(Vn))){const i=qn[r[1]]||qn.latin,o=r[2]?Math.max(1,Number(r[2])):30,s=Fn(o,r[3]?Math.max(o,Number(r[3].slice(1))):o),a=e.repeat||function(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if("AbbreviationNode"===n.type&&n.repeat)return n.repeat}}(t);e.name=e.attributes=void 0,e.value=[Zn(i,s,!a||0===a.value)],e.repeat&&t.length>1&&Un(e,t,n)}}(e,t,n),"xsl"===n.syntax&&function(e){var t;"xsl:variable"!==(t=e.name)&&"xsl:with-param"!==t||!e.attributes||!e.children.length&&!e.value||(e.attributes=e.attributes.filter(Xn))}(e),n.options["jsx.enabled"]&&function(e){e.attributes&&e.attributes.forEach(Jn)}(e),n.options["bem.enabled"]&&er(e,t,n)}const Rr=/^([a-z-]+)(?:\s*:\s*([^\n\r;]+?);*)?$/,Ur={value:!0};function qr(e,t){const n=t.match(Rr);if(n){const t={},r=n[2]?n[2].split("|").map(Fr):[];for(const e of r)for(const n of e)Br(n,t);return{type:"Property",key:e,property:n[1],value:r,keywords:t,dependencies:[]}}return{type:"Raw",key:e,value:t}}function Vr(e,t){return e.key===t.key?0:e.key<t.key?-1:1}function Fr(e){return vn(e.trim(),Ur)[0].value}function Wr(e){return"Property"===e.type}function Br(e,t){for(const n of e.value)if("Literal"===n.type)t[n.value]=n;else if("FunctionCall"===n.type)t[n.name]=n;else if("Field"===n.type){const e=n.name.trim();e&&(t[e]={type:"Literal",value:e})}}function Hr(e,t,n=!1){if((e=e.toLowerCase())===(t=t.toLowerCase()))return 1;if(!e||!t||e.charCodeAt(0)!==t.charCodeAt(0))return 0;const r=e.length,i=t.length;if(!n&&r>i)return 0;const o=Math.min(r,i),s=Math.max(r,i);let a=1,l=1,c=s,u=0,d=0,h=!1,f=!1;for(;a<r;){for(u=e.charCodeAt(a),h=!1,f=!1;l<i;){if(d=t.charCodeAt(l),u===d){h=!0,c+=s-(f?a:l);break}f=45===d,l++}if(!h){if(!n)return 0;break}a++}const p=s-o;return c*(a/s)/(Zr(s)-Zr(p))}function Zr(e){return e*(e+1)/2}function Jr(e,t){return e.r||e.g||e.b||e.a?1===e.a?function(e,t){const n=t&&Yr(e.r)&&Yr(e.g)&&Yr(e.b)?Kr:Gr;return"#"+n(e.r)+n(e.g)+n(e.b)}(e,t):function(e){const t=[e.r,e.g,e.b];1!==e.a&&t.push(Xr(e.a,8));return`${3===t.length?"rgb":"rgba"}(${t.join(", ")})`}(e):"transparent"}function Xr(e,t=4){return e.toFixed(t).replace(/\.?0+$/,"")}function Yr(e){return!(e%17)}function Kr(e){return(e>>4).toString(16)}function Gr(e){return function(e,t){for(;e.length<t;)e="0"+e;return e}(e.toString(16),2)}function Qr(e,t){var n;const r=An(t.options),i=t.options["output.format"];"@@section"===(null===(n=t.context)||void 0===n?void 0:n.name)&&(e=e.filter((e=>e.snippet)));for(let o=0;o<e.length;o++)i&&0!==o&&Ln(r,!0),ei(e[o],r,t);return r.value}function ei(e,t,n){const r=n.options["stylesheet.json"];if(e.name){Mn(t,(r?e.name.replace(/\-(\w)/g,((e,t)=>t.toUpperCase())):e.name)+n.options["stylesheet.between"]),e.value.length?function(e,t,n){const r=n.options["stylesheet.json"],i=r?function(e){if(1===e.value.length){const t=e.value[0];if(1===t.value.length&&"NumberValue"===t.value[0].type)return t.value[0]}}(e):null;if(!i||i.unit&&"px"!==i.unit){const i=function(e){return e.options["stylesheet.jsonDoubleQuotes"]?'"':"'"}(n);r&&$n(t,i);for(let r=0;r<e.value.length;r++)0!==r&&$n(t,", "),ni(e.value[r],t,n);r&&$n(t,i)}else $n(t,String(i.value))}(e,t,n):jn(t,0,""),r?$n(t,","):(ti(e,t,!0),$n(t,n.options["stylesheet.after"]))}else{for(const r of e.value)for(const e of r.value)ri(e,t,n);ti(e,t,e.value.length>0)}}function ti(e,t,n){e.important&&(n&&$n(t," "),$n(t,"!important"))}function ni(e,t,n){for(let r=0,i=-1;r<e.value.length;r++){const o=e.value[r];0===r||"Field"===o.type&&o.start===i||$n(t," "),ri(o,t,n),i=o.end}}function ri(e,t,n){if("ColorValue"===e.type)$n(t,Jr(e,n.options["stylesheet.shortHex"]));else if("Literal"===e.type)Mn(t,e.value);else if("NumberValue"===e.type)Mn(t,Xr(e.value,4)+e.unit);else if("StringValue"===e.type){const n="double"===e.quote?'"':"'";Mn(t,n+e.value+n)}else if("Field"===e.type)jn(t,e.index,e.name);else if("FunctionCall"===e.type){$n(t,e.name+"(");for(let r=0;r<e.arguments.length;r++)r&&$n(t,", "),ni(e.arguments[r],t,n);$n(t,")")}}const ii="lg";function oi(e,t){var n;const r=(null===(n=t.cache)||void 0===n?void 0:n.stylesheetSnippets)||function(e){const t=[];for(const n of Object.keys(e))t.push(qr(n,e[n]));return function(e){e=e.slice().sort(Vr);const t=[];let n;for(const r of e.filter(Wr)){for(;t.length;){if(n=t[t.length-1],r.property.startsWith(n.property)&&45===r.property.charCodeAt(n.property.length)){n.dependencies.push(r),t.push(r);break}t.pop()}t.length||t.push(r)}return e}(t)}(t.snippets);t.cache&&(t.cache.stylesheetSnippets=r),"string"===typeof e&&(e=vn(e,{value:mi(t)}));const i=function(e,t){if(t.context){if("@@section"===t.context.name)return e.filter((e=>"Raw"===e.type));if("@@property"===t.context.name)return e.filter((e=>"Property"===e.type))}return e}(r,t);for(const o of e)si(o,i,t);return e}function si(e,t,n){if(!function(e,t){let n=null;const r=1===e.value.length?e.value[0]:null;if(r&&1===r.value.length){const e=r.value[0];"FunctionCall"===e.type&&e.name===ii&&(n=e)}if(n||e.name===ii)return n=n?Object.assign(Object.assign({},n),{name:"linear-gradient"}):{type:"FunctionCall",name:"linear-gradient",arguments:[di(fi(0,""))]},t.context||(e.name="background-image"),e.value=[di(n)],!0;return!1}(e,n)){const r=n.options["stylesheet.fuzzySearchMinScore"];if(mi(n)){const i=n.context.name,o=t.find((e=>"Property"===e.type&&e.property===i));ai(e,n,o,r),e.snippet=o}else if(e.name){const i=li(e.name,t,r,!0);e.snippet=i,i&&("Property"===i.type?function(e,t,n){const r=e.name,i=function(e,t){for(let n=0,r=0;n<e.length;n++){if(r=t.indexOf(e[n],r),-1===r)return e.slice(n);r++}return""}(r,t.key);if(i){if(e.value.length)return e;const r=ui(i,n,t);if(!r)return e;e.value.push(di(r))}if(e.name=t.property,e.value.length)ai(e,n,t);else if(t.value.length){const r=t.value[0];e.value=1===t.value.length||r.some(pi)?r:r.map((e=>gi(e,n)))}}(e,i,n):function(e,t){let n,r=0;const i=/\$\{(\d+)(:[^}]+)?\}/g,o=e.value[0],s=[];for(;n=i.exec(t.value);)r!==n.index&&s.push(hi(t.value.slice(r,n.index))),r=n.index+n[0].length,o&&o.value.length?s.push(o.value.shift()):s.push(fi(Number(n[1]),n[2]?n[2].slice(1):""));const a=t.value.slice(r);a&&s.push(hi(a));e.name=void 0,e.value=[di(...s)]}(e,i))}}return(e.name||n.context)&&function(e,t){const n=t.options["stylesheet.unitAliases"],r=t.options["stylesheet.unitless"];for(const i of e.value)for(const o of i.value)"NumberValue"===o.type&&(o.unit?o.unit=n[o.unit]||o.unit:0===o.value||r.includes(e.name)||(o.unit=o.rawValue.includes(".")?t.options["stylesheet.floatUnit"]:t.options["stylesheet.intUnit"]))}(e,n),e}function ai(e,t,n,r){for(const i of e.value){const e=[];for(const o of i.value)if("Literal"===o.type)e.push(ui(o.value,t,n,r)||o);else if("FunctionCall"===o.type){const i=ui(o.name,t,n,r);i&&"FunctionCall"===i.type?e.push(Object.assign(Object.assign({},i),{arguments:o.arguments.concat(i.arguments.slice(o.arguments.length))})):e.push(o)}else e.push(o);i.value=e}}function li(e,t,n=0,r=!1){let i=null,o=0;for(const s of t){const t=Hr(e,ci(s),r);if(1===t)return s;t&&t>=o&&(o=t,i=s)}return o>=n?i:null}function ci(e){return"string"===typeof e?e:e.key}function ui(e,t,n,r){let i;if(n){if(i=li(e,Object.keys(n.keywords),r))return n.keywords[i];for(const t of n.dependencies)if(i=li(e,Object.keys(t.keywords),r))return t.keywords[i]}return(i=li(e,t.options["stylesheet.keywords"],r))?hi(i):null}function di(...e){return{type:"CSSValue",value:e}}function hi(e){return{type:"Literal",value:e}}function fi(e,t){return{type:"Field",index:e,name:t}}function pi(e){for(const t of e.value)if("Field"===t.type||"FunctionCall"===t.type&&t.arguments.some(pi))return!0;return!1}function gi(e,t,n={index:1}){let r=[];for(const i of e.value)switch(i.type){case"ColorValue":r.push(fi(n.index++,Jr(i,t.options["stylesheet.shortHex"])));break;case"Literal":r.push(fi(n.index++,i.value));break;case"NumberValue":r.push(fi(n.index++,`${i.value}${i.unit}`));break;case"StringValue":const e="single"===i.quote?"'":'"';r.push(fi(n.index++,e+i.value+e));break;case"FunctionCall":r.push(fi(n.index++,i.name),hi("("));for(let o=0,s=i.arguments.length;o<s;o++)r=r.concat(gi(i.arguments[o],t,n).value),o!==s-1&&r.push(hi(", "));r.push(hi(")"));break;default:r.push(i)}return Object.assign(Object.assign({},e),{value:r})}function mi(e){return!!e.context&&("@@value"===e.context.name||!e.context.name.startsWith("@@"))}const bi={markup:"html",stylesheet:"css"},yi={type:"markup",syntax:"html",variables:{lang:"en",locale:"en-US",charset:"UTF-8",indentation:"\t",newline:"\n"},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"],"output.indent":"\t","output.baseIndent":"","output.newline":"\n","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":"\n\x3c!-- /[#ID][.CLASS] --\x3e","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}},wi={markup:{snippets:vi({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:"{\x3c!-- ${0} --\x3e}","cc:ie":"{\x3c!--[if IE]>${0}<![endif]--\x3e}","cc:noie":"{\x3c!--[if !IE]>\x3c!--\x3e${0}\x3c!--<![endif]--\x3e}"})},xhtml:{options:{"output.selfClosingStyle":"xhtml"}},xml:{options:{"output.selfClosingStyle":"xml"}},xsl:{snippets:vi({"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]>{\n|}","!!!":'{<?xml version="1.0" encoding="UTF-8"?>}'}),options:{"output.selfClosingStyle":"xml"}},jsx:{options:{"jsx.enabled":!0}},pug:{snippets:vi({"!!!":"{doctype html}"})},stylesheet:{snippets:vi({"@f":"@font-face {\n\tfont-family: ${1};\n\tsrc: url(${2});\n}","@ff":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}","@i|@import":"@import url(${0});","@kf":"@keyframes ${1:identifier} {\n\t${2}\n}","@m|@media":"@media ${1:screen} {\n\t${0}\n}",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"})},sass:{options:{"stylesheet.after":""}},stylus:{options:{"stylesheet.between":" ","stylesheet.after":""}}};function vi(e){const t={};return Object.keys(e).forEach((n=>{for(const r of n.split("|"))t[r]=e[n]})),t}function ki(e={},t={}){const n=e.type||"markup",r=e.syntax||bi[n];return Object.assign(Object.assign(Object.assign({},yi),e),{type:n,syntax:r,variables:xi(n,r,"variables",e,t),snippets:xi(n,r,"snippets",e,t),options:xi(n,r,"options",e,t)})}function xi(e,t,n,r,i={}){const o=wi[e],s=i[e],a=wi[t],l=i[t];return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},yi[n]),o&&o[n]),a&&a[n]),s&&s[n]),l&&l[n]),r[n])}function _i(e,t=0){return{text:e,start:t,pos:e.length}}function Ci(e){return e.pos===e.start}function Ei(e,t=0){return e.text.charCodeAt(e.pos-1+t)}function Si(e){if(!Ci(e))return e.text.charCodeAt(--e.pos)}function Oi(e,t){if(Ci(e))return!1;const n="function"===typeof t?t(Ei(e)):t===Ei(e);return n&&e.pos--,!!n}function Ai(e,t){const n=e.pos;for(;Oi(e,t););return e.pos<n}function $i(e){return 39===e||34===e}const Mi={91:93,40:41,123:125};function Li(e){const t=e.pos;if(!Oi(e,62))return!1;let n=!1;for(Oi(e,47);!Ci(e);){if(Ai(e,zi),Ni(e)){if(Oi(e,47)){n=Oi(e,60);break}if(Oi(e,60)){n=!0;break}if(Oi(e,zi))continue;if(Oi(e,61)){if(Ni(e))continue;break}if(Di(e)){n=!0;break}break}if(!ji(e))break}return e.pos=t,n}function ji(e){return function(e){const t=e.pos;if(function(e){const t=e.pos,n=Si(e);if($i(n))for(;!Ci(e);)if(Si(e)===n&&92!==Ei(e))return!0;return e.pos=t,!1}(e)&&Oi(e,61)&&Ni(e))return!0;return e.pos=t,!1}(e)||Di(e)}function Di(e){const t=e.pos,n=[];for(;!Ci(e);){const t=Ei(e);if(Ri(t))n.push(t);else if(Ii(t)){if(n.pop()!==Mi[t])break}else if(!Pi(t))break;e.pos--}return!(t===e.pos||!Oi(e,61)||!Ni(e))||(e.pos=t,!1)}function Ni(e){return Ai(e,Ti)}function Ti(e){return 58===e||45===e||function(e){return e&=-33,e>=65&&e<=90}(e)||function(e){return e>47&&e<58}(e)}function zi(e){return 32===e||9===e}function Pi(e){return!isNaN(e)&&61!==e&&!zi(e)&&!$i(e)}function Ii(e){return 123===e||40===e||91===e}function Ri(e){return 125===e||41===e||93===e}const Ui=e=>e.charCodeAt(0),qi="#.*:$-_!@%^+>/".split("").map(Ui),Vi={type:"markup",lookAhead:!0,prefix:""};function Fi(e,t=e.length,n={}){const r=Object.assign(Object.assign({},Vi),n);let i;t=Math.min(e.length,Math.max(0,null==t?e.length:t)),r.lookAhead&&(t=function(e,t,n){$i(e.charCodeAt(t))&&t++;for(;Ji(e.charCodeAt(t),n.type);)t++;return t}(e,t,r));const o=function(e,t,n){if(!n)return 0;const r=_i(e),i=n.split("").map(Ui);let o;r.pos=t;for(;!Ci(r);)if(!Wi(r,93,91)&&!Wi(r,125,123)){if(o=r.pos,Bi(r,i))return o;r.pos--}return-1}(e,t,r.prefix||"");if(-1===o)return;const s=_i(e,o);s.pos=t;const a=[];for(;!Ci(s);){if(i=Ei(s),a.includes(125)){if(125===i){a.push(i),s.pos--;continue}if(123!==i){s.pos--;continue}}if(Ji(i,r.type))a.push(i);else if(Zi(i,r.type)){if(a.pop()!==Mi[i])break}else{if(a.includes(93)||a.includes(125)){s.pos--;continue}if(Li(s)||!Hi(i))break}s.pos--}if(!a.length&&s.pos!==t){const r=e.slice(s.pos,t).replace(/^[*+>^]+/,"");return{abbreviation:r,location:t-r.length,start:n.prefix?o-n.prefix.length:t-r.length,end:t}}}function Wi(e,t,n){const r=e.pos;if(Oi(e,t))for(;!Ci(e);){if(Oi(e,n))return!0;e.pos--}return e.pos=r,!1}function Bi(e,t){const n=e.pos;let r=!1;for(let i=t.length-1;i>=0&&!Ci(e)&&Oi(e,t[i]);i--)r=0===i;return r||(e.pos=n),r}function Hi(e){return e>64&&e<91||e>96&&e<123||e>47&&e<58||qi.includes(e)}function Zi(e,t){return 40===e||"markup"===t&&(91===e||123===e)}function Ji(e,t){return 41===e||"markup"===t&&(93===e||125===e)}function Xi(e,t){const n=ki(t);return"stylesheet"===n.type?function(e,t){return Qr(oi(e,t),t)}(e,n):function(e,t){return Pr(zr(e,t),t)}(e,n)}var Yi,Ki={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"]},Gi={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"]},Qi=new Map,eo=new Map,to=/^[a-z,A-Z,!,(,[,#,\.\{]/,no=/^[a-z,A-Z,!,(,[,#,\.]/,ro=/^-?[a-z,A-Z,!,@,#]/,io=/[a-z,A-Z\.]/,oo=Ee(Ee([],Gi.tags,!0),["lorem"],!1),so="bem",ao="|",lo="t",co="c";function uo(e,t,n,r,i){var o,s=bo(r);if(!s){if(!Qi.has(r)){var a=function(e){var t=yo(e),n={type:t,syntax:e},r=ki(n);return"xml"===e?{}:r.snippets}(r);Qi.set(r,Object.keys(a))}Yi=null!==(o=Qi.get(r))&&void 0!==o?o:[]}var l={lookAhead:!s,type:yo(r)},c=function(e,t,n,r){var i=t.getLineContent(n.lineNumber),o=i.substr(0,n.column-1),s=function(e,t){for(var n,r=0;r<3;r++)if(e.endsWith("".concat(ao).concat(so),t))t-=4,n=n?so+","+n:so;else if(e.endsWith("".concat(ao).concat(co),t))t-=2,n=n?"c,"+n:co;else{if(!e.endsWith("".concat(ao).concat(lo),t))break;t-=2,n=n?"t,"+n:lo}return{pos:t,filter:n}}(o,n.column-1),a=s.pos,l=s.filter,c=l?l.length+1:0,u=Fi(i,a,r);if(!u)return;var d=new e.Range(n.lineNumber,u.location+1,n.lineNumber,u.location+u.abbreviation.length+c+1);return{abbreviationRange:d,abbreviation:u.abbreviation,currentLineTillPosition:o,filter:l}}(e,t,n,l);if(c){var u=c.abbreviationRange,d=c.abbreviation,h=c.currentLineTillPosition,f=c.filter,p=function(e){if(e){var t=e.match(/[\w,:,-,\.]*$/);if(t)return t[0]}}(h);if(p!==d||!h.endsWith("<".concat(d))||s){var g,m=function(e,t){var n=yo(e),r=t?t.split(",").map((function(e){return e.trim()})):[],i=r.includes("bem"),o=r.includes("c"),s={"output.formatSkip":["html"],"output.formatForce":["body"],"output.field":mo,"output.inlineBreak":0,"output.compactBoolean":!1,"output.reverseAttributes":!1,"markup.href":!0,"comment.enabled":o,"comment.trigger":["id","class"],"comment.before":"","comment.after":"\n\x3c!-- /[#ID][.CLASS] --\x3e","bem.enabled":i,"bem.element":"__","bem.modifier":"_","jsx.enabled":"jsx"===e,"stylesheet.shortHex":!0,"stylesheet.between":"stylus"===e?" ":": ","stylesheet.after":"sass"===e||"stylus"===e?"":";","stylesheet.intUnit":"px","stylesheet.floatUnit":"em","stylesheet.unitAliases":{e:"em",p:"%",x:"ex",r:"rem"},"stylesheet.fuzzySearchMinScore":.3,"output.format":!0,"output.selfClosingStyle":"html"};return{type:n,options:s,variables:{},snippets:{},syntax:e,text:void 0,maxRepeat:1e3}}(r,f),b="",y=[];if(function(t,n){if(function(e,t){if(!t)return!1;if(bo(e)){if(t.includes("#")){if(t.startsWith("#"))return/^#[\d,a-f,A-F]{1,6}$/.test(t);if(oo.includes(t.substring(0,t.indexOf("#"))))return!1}return ro.test(t)}if(t.startsWith("!"))return!/[^!]/.test(t);if((/\(/.test(t)||/\)/.test(t))&&!/\{[^\}\{]*[\(\)]+[^\}\{]*\}(?:[>\+\*\^]|$)/.test(t)&&!/\(.*\)[>\+\*\^]/.test(t)&&!/\[[^\[\]\(\)]+=".*"\]/.test(t)&&!/[>\+\*\^]\(.*\)/.test(t))return!1;if("jsx"===e)return no.test(t)&&io.test(t);return to.test(t)&&io.test(t)}(t,d)){try{b=Xi(n,m),s&&"!important".startsWith(n)&&(b="!important")}catch(r){}b&&!function(e,t,n,r){var i,o;if(bo(e)&&r){var s=null!==(i=r["stylesheet.between"])&&void 0!==i?i:": ",a=null!==(o=r["stylesheet.after"])&&void 0!==o?o:";",l=t.indexOf(s[0],Math.max(t.length-s.length,0));l=l>=0?l:t.length;var c=t.substring(0,l);return n==="".concat(c).concat(s,"${0}").concat(a)||n.replace(/\s/g,"")===t.replace(/\s/g,"")+a}if("xml"===e&&oo.some((function(e){return e.startsWith(t.toLowerCase())})))return!0;if(oo.includes(t.toLowerCase())||Yi.includes(t))return!1;if(/[-,:]/.test(t)&&!/--|::/.test(t)&&!t.endsWith(":"))return!1;if("."===t)return!1;var u=t.match(/^([a-z,A-Z,\d]*)\.$/);if(u)return!u[1]||!Gi.tags.includes(u[1]);if("jsx"===e&&/^([A-Z][A-Za-z0-9]*)+$/.test(t))return!1;return n.toLowerCase()==="<".concat(t.toLowerCase(),">${1}</").concat(t.toLowerCase(),">")}(t,n,b,m.options)&&(g={kind:e.languages.CompletionItemKind.Property,label:d+(f?"|"+f.replace(",","|"):""),documentation:fo(b),detail:"Emmet abbreviation",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u,insertText:po(go(b))},y=[g])}}(r,d),s){if(d.length>4&&Ki.properties.some((function(e){return e.startsWith(d)})))return{suggestions:[],incomplete:!0};if(g&&b.length){g.range=u,g.insertText=po(go(b)),g.documentation=fo(b),g.label=b.replace(/([^\\])\$\{\d+\}/g,"$1").replace(/\$\{\d+:([^\}]+)\}/g,"$1"),g.filterText=d;var w=eo.has(r)?eo.get(r):eo.get("css");if(!(y=ho(e,null!==w&&void 0!==w?w:[],d,d,u,m,"Emmet Custom Snippet",!1)).find((function(e){return e.insertText===(null===g||void 0===g?void 0:g.insertText)}))){var v=new RegExp(".*"+d.split("").map((function(e){return"$"===e||"+"===e?"\\"+e:e})).join(".*")+".*","i");(/\d/.test(d)||v.test(g.label))&&y.push(g)}}}else{var k=d,x=d.match(/(>|\+)([\w:-]+)$/);if(x&&3===x.length&&(k=x[2]),"xml"!==r){var _=ho(e,oo,k,d,u,m,"Emmet Abbreviation");y=y.concat(_)}if(!0===i.showAbbreviationSuggestions){var C=ho(e,Yi.filter((function(e){return!oo.includes(e)})),k,d,u,m,"Emmet Abbreviation");g&&C.length>0&&k!==d&&(g.sortText="0"+g.label,C.forEach((function(e){e.filterText=d,e.sortText="9"+d}))),y=y.concat(C)}"html"===r&&y.length>=2&&d.includes(":")&&(null===g||void 0===g?void 0:g.insertText)==="<".concat(d,">${0}</").concat(d,">")&&(y=y.filter((function(e){return e.label!==d})))}return!0===i.showSuggestionsAsSnippets&&y.forEach((function(t){return t.kind=e.languages.CompletionItemKind.Snippet})),y.length?{suggestions:y,incomplete:!0}:void 0}}}function ho(e,t,n,r,i,o,s,a){if(void 0===a&&(a=!0),!n||!t)return[];var l=[];return t.forEach((function(t){if(t.startsWith(n.toLowerCase())&&(!a||t!==n.toLowerCase())){var c,u=r+t.substr(n.length);try{c=Xi(u,o)}catch(h){}if(c){var d={kind:e.languages.CompletionItemKind.Property,label:n+t.substr(n.length),documentation:fo(c),detail:s,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:i,insertText:po(go(c))};l.push(d)}}})),l}function fo(e){return e.replace(/([^\\])\$\{\d+\}/g,"$1|").replace(/\$\{\d+:([^\}]+)\}/g,"$1")}function po(e){return e?e.replace(/([^\\])(\$)([^\{])/g,"$1\\$2$3"):e}function go(e){if(!e||!e.trim())return e;var t=-1,n=[],r=!1,i=!1,o=0,s=e.length;try{for(;o<s&&!r;)if("$"==e[o++]&&"{"==e[o++]){for(var a=-1,l=-1;o<s&&/\d/.test(e[o]);)a=a<0?o:a,l=o+1,o++;if(!(-1===a||-1===l||o>=s||"}"!=e[o]&&":"!=e[o])){var c=e.substring(a,l);if(r="0"===c)break;var u=!1;if(":"==e[o++])for(;o<s;){if("}"==e[o]){u=!0;break}o++}Number(c)>Number(t)?(t=Number(c),n=[{numberStart:a,numberEnd:l}],i=!u):Number(c)===t&&n.push({numberStart:a,numberEnd:l})}}}catch(p){}if(i&&!r)for(var d=0;d<n.length;d++){var h=n[d].numberStart,f=n[d].numberEnd;e=e.substr(0,h)+"0"+e.substr(f)}return e}var mo=function(e,t){return"${".concat(e).concat(t?":"+t:"","}")};function bo(e){return"css"===e}function yo(e){return bo(e)?"stylesheet":"markup"}function wo(e,t,n,r){var i=e[t],o=i.type,s=i.language;return"html"===n&&"html"===s?""===o&&(0===t||"delimiter.html"===e[t-1].type)||"text.html.basic"===e[0].type:"css"===n&&"css"===s?""===o||o==="tag."+r:"jsx"===n&&(!!t&&["identifier.js","type.identifier.js","identifier.ts","type.identifier.ts"].includes(o))}var vo={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"]},ko={handlebars:"html",php:"html",twig:"html"},xo={showExpandedAbbreviation:"always",showAbbreviationSuggestions:!0,showSuggestionsAsSnippets:!1};function _o(e,t,n){if(e){var r=t.map((function(t){return e.languages.registerCompletionItemProvider(t,{triggerCharacters:vo[ko[t]||t],provideCompletionItems:function(t,r){return function(e,t,n,r){for(var i,o=t.column,s=t.lineNumber,a=e._tokenization||e.tokenization._tokenization,l=a._tokenizationStateStore,c=l.tokenizationSupport||a._tokenizationSupport,u=l.getBeginState(s-1).clone(),d=c.tokenize(e.getLineContent(s),!0,u,0),h=d.tokens,f=!1,p=h.length-1;p>=0;p--){var g=h[p];if(o-1>g.offset){if(!(f=wo(h,p,n,r))&&"css"===n&&"attribute.value.html"===g.type){do{if(p--<=0){if(0==s--)break;p=(h=(d=c.tokenize(e.getLineContent(s),!0,u,0)).tokens).length-1}g=h[p]}while("attribute.name.html"===g.type);"style"===((null===(i=e.getWordAtPosition({column:g.offset,lineNumber:s}))||void 0===i?void 0:i.word)||"")&&(f=!0)}break}}return f}(t,r,n,n)?uo(e,t,r,n,xo):void 0}})}));return function(){r.forEach((function(e){return e.dispose()}))}}}var Co=n(86095),Eo=n(27941),So=n(90614),Oo=n(15626);const Ao=(e,t)=>(Mo(),Lo(e.user.color,t),e.cursor?[{range:new _e.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};`}}]:[]),$o=e=>e.selection?[{range:new _e.Range(e.selection.startLineNumber,e.selection.startColumn,e.selection.endLineNumber,e.selection.endColumn),options:{className:"user-selection-decoration"}}]:[],Mo=()=>{const e=document.styleSheets[0];Array.from(e.cssRules).some((e=>e.cssText.includes(".applyColorToThis")))||e.insertRule(".applyColorToThis {\n border-left: 2px solid var(--cursor-color, #000);\n color: var(--cursor-color, #000);\n }",e.cssRules.length)},Lo=(e,t)=>{const 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)},jo=(e,t,n)=>{if(!e.textContent){const r=document.createElement("div");r.style.background=t,r.style.color="#fff",r.textContent=n,r.className="cursor-hover",e.appendChild(r)}},Do=(e,t,n,r,i,o)=>{if(r)return;i(!0);const s=e.flatMap((e=>[...Ao(e,o),...$o(e)]));n.current=t.deltaDecorations(n.current,s.map((e=>({range:e.range,options:e.options}))));((e,t,n,r,i)=>{for(let d=0;d<e.length;d++){const h=e[d],f=h.className.split(" ");for(const e of f)if(e.startsWith(t)){const d=`#${e.replace(t,"")}`,f=r.find((e=>e.user.color===d));var o,s,a,l,c,u;f&&(n&&d!==(null===i||void 0===i?void 0:i.color)?jo(h,d,null!==f&&void 0!==f&&null!==(o=f.user)&&void 0!==o&&null!==(s=o.name)&&void 0!==s&&s.first_name?`${null===f||void 0===f||null===(a=f.user)||void 0===a||null===(l=a.name)||void 0===l?void 0:l.first_name} ${null===f||void 0===f||null===(c=f.user)||void 0===c||null===(u=c.name)||void 0===u?void 0:u.last_name}`.replace(/[\n\r]/g,""):f.user.name.email.split("@")[0]):h.style.backgroundColor=d)}}})(document.getElementsByClassName("applyColorToThis"),"backgroundPrefix-",!0,e,o),i(!1)},No=()=>{const e=50,t=(e,t,n)=>{const r=e=>{const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)};return.2126*r(e)+.7152*r(t)+.0722*r(n)},n=(e,n,r)=>(t(255,255,255)+.05)/(t(e,n,r)+.05)>=4.5;let r;do{const t=Math.floor(206*Math.random()+e),s=Math.floor(206*Math.random()+e),a=Math.floor(206*Math.random()+e);t+s+a>=400&&(i=s,o=a,!(t>100&&i>50&&i<150&&o<100))&&n(t,s,a)&&(r=`#${(t<<16|s<<8|a).toString(16).padStart(6,"0")}`)}while(!r);var i,o;return r},To=()=>new Map,zo=e=>{const t=To();return e.forEach(((e,n)=>{t.set(n,e)})),t},Po=(e,t,n)=>{let r=e.get(t);return void 0===r&&e.set(t,r=n()),r},Io=()=>new Set,Ro=e=>e[e.length-1],Uo=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},qo=Array.from,Vo=Array.isArray;class Fo{constructor(){this._observers=To()}on(e,t){return Po(this._observers,e,Io).add(t),t}once(e,t){const n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){const n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return qo((this._observers.get(e)||To()).values()).forEach((e=>e(...t)))}destroy(){this._observers=To()}}class Wo{constructor(){this._observers=To()}on(e,t){Po(this._observers,e,Io).add(t)}once(e,t){const n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){const n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return qo((this._observers.get(e)||To()).values()).forEach((e=>e(...t)))}destroy(){this._observers=To()}}const Bo=Math.floor,Ho=(Math.ceil,Math.abs),Zo=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(e,t)=>e<t?e:t),Jo=(e,t)=>e>t?e:t,Xo=(Number.isNaN,Math.pow),Yo=(Math.sign,e=>0!==e?e<0:1/e<0),Ko=64,Go=128,Qo=127,es=2147483647,ts=Number.MAX_SAFE_INTEGER,ns=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"===typeof e&&isFinite(e)&&Bo(e)===e)),rs=(Number.isNaN,Number.parseInt,String.fromCharCode),is=(String.fromCodePoint,rs(65535),/^\s*/g),os=/([A-Z])/g,ss=(e,t)=>(e=>e.replace(is,""))(e.replace(os,(e=>`${t}${(e=>e.toLowerCase())(e)}`))),as="undefined"!==typeof TextEncoder?new TextEncoder:null,ls=as?e=>as.encode(e):e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=t.codePointAt(i);return r};let cs="undefined"===typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});cs&&1===cs.decode(new Uint8Array).length&&(cs=null);class us{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const ds=()=>new us,hs=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},fs=e=>{const t=new Uint8Array(hs(e));let n=0;for(let r=0;r<e.bufs.length;r++){const i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},ps=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*n),e.cpos=0),e.cbuf[e.cpos++]=t},gs=ps,ms=(e,t)=>{for(;t>Qo;)ps(e,Go|Qo&t),t=Bo(t/128);ps(e,Qo&t)},bs=(e,t)=>{const n=Yo(t);for(n&&(t=-t),ps(e,(t>63?Go:0)|(n?Ko:0)|63&t),t=Bo(t/64);t>0;)ps(e,(t>Qo?Go:0)|Qo&t),t=Bo(t/128)},ys=new Uint8Array(3e4),ws=ys.length/3,vs=as&&as.encodeInto?(e,t)=>{if(t.length<ws){const n=as.encodeInto(t,ys).written||0;ms(e,n);for(let t=0;t<n;t++)ps(e,ys[t])}else xs(e,ls(t))}:(e,t)=>{const n=unescape(encodeURIComponent(t)),r=n.length;ms(e,r);for(let i=0;i<r;i++)ps(e,n.codePointAt(i))},ks=(e,t)=>{const n=e.cbuf.length,r=e.cpos,i=Zo(n-r,t.length),o=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,o>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Jo(2*n,o)),e.cbuf.set(t.subarray(i)),e.cpos=o)},xs=(e,t)=>{ms(e,t.byteLength),ks(e,t)},_s=(e,t)=>{((e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*Jo(n,t)),e.cpos=0)})(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},Cs=new DataView(new ArrayBuffer(4)),Es=(e,t)=>{switch(typeof t){case"string":ps(e,119),vs(e,t);break;case"number":ns(t)&&Ho(t)<=es?(ps(e,125),bs(e,t)):(n=t,Cs.setFloat32(0,n),Cs.getFloat32(0)===n?(ps(e,124),((e,t)=>{_s(e,4).setFloat32(0,t,!1)})(e,t)):(ps(e,123),((e,t)=>{_s(e,8).setFloat64(0,t,!1)})(e,t)));break;case"bigint":ps(e,122),((e,t)=>{_s(e,8).setBigInt64(0,t,!1)})(e,t);break;case"object":if(null===t)ps(e,126);else if(Vo(t)){ps(e,117),ms(e,t.length);for(let n=0;n<t.length;n++)Es(e,t[n])}else if(t instanceof Uint8Array)ps(e,116),xs(e,t);else{ps(e,118);const n=Object.keys(t);ms(e,n.length);for(let r=0;r<n.length;r++){const i=n[r];vs(e,i),Es(e,t[i])}}break;case"boolean":ps(e,t?120:121);break;default:ps(e,127)}var n};class Ss extends us{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ms(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const Os=e=>{e.count>0&&(bs(e.encoder,1===e.count?e.s:-e.s),e.count>1&&ms(e.encoder,e.count-2))};class As{constructor(){this.encoder=new us,this.s=0,this.count=0}write(e){this.s===e?this.count++:(Os(this),this.count=1,this.s=e)}toUint8Array(){return Os(this),fs(this.encoder)}}const $s=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);bs(e.encoder,t),e.count>1&&ms(e.encoder,e.count-2)}};class Ms{constructor(){this.encoder=new us,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):($s(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return $s(this),fs(this.encoder)}}class Ls{constructor(){this.sarr=[],this.s="",this.lensE=new As}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new us;return this.sarr.push(this.s),this.s="",vs(e,this.sarr.join("")),ks(e,this.lensE.toUint8Array()),fs(e)}}const js=e=>new Error(e),Ds=()=>{throw js("Method unimplemented")},Ns=()=>{throw js("Unexpected case")},Ts=js("Unexpected end of array"),zs=js("Integer out of Range");class Ps{constructor(e){this.arr=e,this.pos=0}}const Is=e=>new Ps(e),Rs=e=>e.pos!==e.arr.length,Us=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},qs=e=>Us(e,Fs(e)),Vs=e=>e.arr[e.pos++],Fs=e=>{let t=0,n=1;const r=e.arr.length;for(;e.pos<r;){const r=e.arr[e.pos++];if(t+=(r&Qo)*n,n*=128,r<Go)return t;if(t>ts)throw zs}throw Ts},Ws=e=>{let t=e.arr[e.pos++],n=63&t,r=64;const i=(t&Ko)>0?-1:1;if(0===(t&Go))return i*n;const o=e.arr.length;for(;e.pos<o;){if(t=e.arr[e.pos++],n+=(t&Qo)*r,r*=128,t<Go)return i*n;if(n>ts)throw zs}throw Ts},Bs=cs?e=>cs.decode(qs(e)):e=>{let t=Fs(e);if(0===t)return"";{let n=String.fromCodePoint(Vs(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Vs(e));else for(;t>0;){const 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))}},Hs=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Zs=[e=>{},e=>null,Ws,e=>Hs(e,4).getFloat32(0,!1),e=>Hs(e,8).getFloat64(0,!1),e=>Hs(e,8).getBigInt64(0,!1),e=>!1,e=>!0,Bs,e=>{const t=Fs(e),n={};for(let r=0;r<t;r++){n[Bs(e)]=Js(e)}return n},e=>{const t=Fs(e),n=[];for(let r=0;r<t;r++)n.push(Js(e));return n},qs],Js=e=>Zs[127-Vs(e)](e);class Xs extends Ps{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),Rs(this)?this.count=Fs(this)+1:this.count=-1),this.count--,this.s}}class Ys extends Ps{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=Ws(this);const e=Yo(this.s);this.count=1,e&&(this.s=-this.s,this.count=Fs(this)+2)}return this.count--,this.s}}class Ks extends Ps{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=Ws(this),t=1&e;this.diff=Bo(e/2),this.count=1,t&&(this.count=Fs(this)+2)}return this.s+=this.diff,this.count--,this.s}}class Gs{constructor(e){this.decoder=new Ys(e),this.str=Bs(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}crypto.subtle;const Qs=crypto.getRandomValues.bind(crypto),ea=(Math.random,()=>Qs(new Uint32Array(1))[0]),ta=[1e7]+-1e3+-4e3+-8e3+-1e11,na=()=>ta.replace(/[018]/g,(e=>(e^ea()&15>>e/4).toString(16))),ra=e=>new Promise(e),ia=(Promise.all.bind(Promise),e=>void 0===e?null:e);let oa=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},sa=!0;try{"undefined"!==typeof localStorage&&localStorage&&(oa=localStorage,sa=!1)}catch(Cd){}const aa=oa,la=Object.assign,ca=Object.keys,ua=e=>ca(e).length,da=e=>ca(e).length,ha=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),fa=Object.freeze,pa=e=>{for(const t in e){const n=e[t];"object"!==typeof n&&"function"!==typeof n||pa(e[t])}return fa(e)},ga=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&ga(e,t,n+1)}},ma=e=>e,ba=(e,t)=>{if(null==e||null==t)return((e,t)=>e===t)(e,t);if(e.constructor!==t.constructor)return!1;if(e===t)return!0;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(const n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(const n of e.keys())if(!t.has(n)||!ba(e.get(n),t.get(n)))return!1;break;case Object:if(ua(e)!==ua(t))return!1;for(const n in e)if(!ha(e,n)||!ba(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(!ba(e[n],t[n]))return!1;break;default:return!1}return!0};var ya=n(88295);const wa="undefined"!==typeof ya&&ya.release&&/node|io\.js/.test(ya.release.name)&&"[object process]"===Object.prototype.toString.call("undefined"!==typeof ya?ya:0),va="undefined"!==typeof window&&"undefined"!==typeof document&&!wa;"undefined"!==typeof navigator&&/Mac/.test(navigator.platform);let ka;const xa=[],_a=()=>{if(void 0===ka)if(wa){ka=To();const e=ya.argv;let t=null;for(let n=0;n<e.length;n++){const r=e[n];"-"===r[0]?(null!==t&&ka.set(t,""),t=r):null!==t?(ka.set(t,r),t=null):xa.push(r)}null!==t&&ka.set(t,"")}else"object"===typeof location?(ka=To(),(location.search||"?").slice(1).split("&").forEach((e=>{if(0!==e.length){const[t,n]=e.split("=");ka.set(`--${ss(t,"-")}`,n),ka.set(`-${ss(t,"-")}`,n)}}))):ka=To();return ka},Ca=e=>_a().has(e),Ea=e=>ia(wa?{}[e.toUpperCase().replaceAll("-","_")]:aa.getItem(e)),Sa=e=>Ca("--"+e)||null!==Ea(e);Sa("production");wa&&["true","1","2"].includes({}.FORCE_COLOR)||!Ca("--no-colors")&&!Sa("no-color")&&(!wa||ya.stdout.isTTY)&&(!wa||Ca("--color")||null!==Ea("COLORTERM")||(Ea("TERM")||"").includes("color"));var Oa=n(45764).Buffer;const Aa=e=>new Uint8Array(e),$a=va?e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=rs(e[n]);return btoa(t)}:e=>Oa.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),Ma=va?e=>{const t=atob(e),n=Aa(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}:e=>{const t=Oa.from(e,"base64");return n=t.buffer,r=t.byteOffset,i=t.byteLength,new Uint8Array(n,r,i);var n,r,i};class La{constructor(e,t){this.left=e,this.right=t}}const ja=(e,t)=>new La(e,t),Da="undefined"!==typeof document?document:{},Na=("undefined"!==typeof DOMParser&&new DOMParser,Da.ELEMENT_NODE,Da.TEXT_NODE,Da.CDATA_SECTION_NODE,Da.COMMENT_NODE,Da.DOCUMENT_NODE,Da.DOCUMENT_TYPE_NODE,Da.DOCUMENT_FRAGMENT_NODE,Symbol),Ta=Date.now,za=Na(),Pa=Na(),Ia=Na(),Ra=Na(),Ua=Na(),qa=Na(),Va=Na(),Fa=Na(),Wa=Na();Ta();ja("font-weight","bold"),ja("font-weight","normal"),ja("color","blue"),ja("color","green"),ja("color","grey"),ja("color","red"),ja("color","purple"),ja("color","orange"),ja("color","black");const Ba=(...e)=>{Za.forEach((t=>t.print(e)))},Ha=(...e)=>{e.unshift(Fa),Za.forEach((t=>t.print(e)))},Za=Io();const Ja=e=>({[Symbol.iterator](){return this},next:e}),Xa=(e,t)=>Ja((()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}));class Ya{constructor(e,t){this.clock=e,this.len=t}}class Ka{constructor(){this.clients=new Map}}const Ga=(e,t,n)=>t.clients.forEach(((t,r)=>{const i=e.doc.store.clients.get(r);for(let o=0;o<t.length;o++){const r=t[o];Ql(e,i,r.clock,r.len,n)}})),Qa=(e,t)=>{const n=e.clients.get(t.client);return void 0!==n&&null!==((e,t)=>{let n=0,r=e.length-1;for(;n<=r;){const i=Bo((n+r)/2),o=e[i],s=o.clock;if(s<=t){if(t<s+o.len)return i;n=i+1}else r=i-1}return null})(n,t.clock)},el=e=>{e.clients.forEach((e=>{let t,n;for(e.sort(((e,t)=>e.clock-t.clock)),t=1,n=1;t<e.length;t++){const r=e[n-1],i=e[t];r.clock+r.len>=i.clock?r.len=Jo(r.len,i.clock+i.len-r.clock):(n<t&&(e[n]=i),n++)}e.length=n}))},tl=e=>{const t=new Ka;for(let n=0;n<e.length;n++)e[n].clients.forEach(((r,i)=>{if(!t.clients.has(i)){const o=r.slice();for(let t=n+1;t<e.length;t++)Uo(o,e[t].clients.get(i)||[]);t.clients.set(i,o)}}));return el(t),t},nl=(e,t,n,r)=>{Po(e.clients,t,(()=>[])).push(new Ya(n,r))},rl=()=>new Ka,il=e=>{const t=rl();return e.clients.forEach(((e,n)=>{const r=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.deleted){const i=n.id.clock;let o=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[1+ ++t])o+=n.length;r.push(new Ya(i,o))}}r.length>0&&t.clients.set(n,r)})),t},ol=(e,t)=>{ms(e.restEncoder,t.clients.size),qo(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{e.resetDsCurVal(),ms(e.restEncoder,t);const r=n.length;ms(e.restEncoder,r);for(let i=0;i<r;i++){const t=n[i];e.writeDsClock(t.clock),e.writeDsLen(t.len)}}))},sl=e=>{const t=new Ka,n=Fs(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();const n=Fs(e.restDecoder),r=Fs(e.restDecoder);if(r>0){const i=Po(t.clients,n,(()=>[]));for(let t=0;t<r;t++)i.push(new Ya(e.readDsClock(),e.readDsLen()))}}return t},al=(e,t,n)=>{const r=new Ka,i=Fs(e.restDecoder);for(let o=0;o<i;o++){e.resetDsCurVal();const i=Fs(e.restDecoder),o=Fs(e.restDecoder),s=n.clients.get(i)||[],a=Hl(n,i);for(let n=0;n<o;n++){const n=e.readDsClock(),o=n+e.readDsLen();if(n<a){a<o&&nl(r,i,a,o-a);let e=Jl(s,n),l=s[e];for(!l.deleted&&l.id.clock<n&&(s.splice(e+1,0,Uu(t,l,n-l.id.clock)),e++);e<s.length&&(l=s[e++],l.id.clock<o);)l.deleted||(o<l.id.clock+l.length&&s.splice(e,0,Uu(t,l,o-l.id.clock)),l.delete(t))}else nl(r,i,n,o-n)}}if(r.clients.size>0){const e=new bl;return ms(e.restEncoder,0),ol(e,r),e.toUint8Array()}return null},ll=ea;class cl extends Fo{constructor({guid:e=na(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:o=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=ll(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new Wl,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=o,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=ra((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const a=()=>ra((e=>{const t=n=>{void 0!==n&&!0!==n||(this.off("sync",t),e())};this.on("sync",t)}));this.on("sync",(e=>{!1===e&&this.isSynced&&(this.whenSynced=a()),this.isSynced=void 0===e||!0===e,this.isSynced&&!this.isLoaded&&this.emit("load",[this])})),this.whenSynced=a()}load(){const e=this._item;null===e||this.shouldLoad||ac(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(qo(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return ac(this,e,t)}get(e,t=$c){const n=Po(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),r=n.constructor;if(t!==$c&&r!==t){if(r===$c){const r=new t;r._map=n._map,n._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=r})),r._start=n._start;for(let e=r._start;null!==e;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,Zc)}getText(e=""){return this.get(e,du)}getMap(e=""){return this.get(e,Xc)}getXmlElement(e=""){return this.get(e,pu)}getXmlFragment(e=""){return this.get(e,fu)}toJSON(){const e={};return this.share.forEach(((t,n)=>{e[n]=t.toJSON()})),e}destroy(){this.isDestroyed=!0,qo(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new cl({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,ac(e.parent.doc,(n=>{const r=t.doc;e.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class ul{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Fs(this.restDecoder)}readDsLen(){return Fs(this.restDecoder)}}class dl extends ul{readLeftID(){return Dl(Fs(this.restDecoder),Fs(this.restDecoder))}readRightID(){return Dl(Fs(this.restDecoder),Fs(this.restDecoder))}readClient(){return Fs(this.restDecoder)}readInfo(){return Vs(this.restDecoder)}readString(){return Bs(this.restDecoder)}readParentInfo(){return 1===Fs(this.restDecoder)}readTypeRef(){return Fs(this.restDecoder)}readLen(){return Fs(this.restDecoder)}readAny(){return Js(this.restDecoder)}readBuf(){return(e=>{const t=Aa(e.byteLength);return t.set(e),t})(qs(this.restDecoder))}readJSON(){return JSON.parse(Bs(this.restDecoder))}readKey(){return Bs(this.restDecoder)}}class hl{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Fs(this.restDecoder),this.dsCurrVal}readDsLen(){const e=Fs(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class fl extends hl{constructor(e){super(e),this.keys=[],Fs(e),this.keyClockDecoder=new Ks(qs(e)),this.clientDecoder=new Ys(qs(e)),this.leftClockDecoder=new Ks(qs(e)),this.rightClockDecoder=new Ks(qs(e)),this.infoDecoder=new Xs(qs(e),Vs),this.stringDecoder=new Gs(qs(e)),this.parentInfoDecoder=new Xs(qs(e),Vs),this.typeRefDecoder=new Ys(qs(e)),this.lenDecoder=new Ys(qs(e))}readLeftID(){return new Ll(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Ll(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Js(this.restDecoder)}readBuf(){return qs(this.restDecoder)}readJSON(){return Js(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const e=this.stringDecoder.read();return this.keys.push(e),e}}}class pl{constructor(){this.restEncoder=ds()}toUint8Array(){return fs(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ms(this.restEncoder,e)}writeDsLen(e){ms(this.restEncoder,e)}}class gl extends pl{writeLeftID(e){ms(this.restEncoder,e.client),ms(this.restEncoder,e.clock)}writeRightID(e){ms(this.restEncoder,e.client),ms(this.restEncoder,e.clock)}writeClient(e){ms(this.restEncoder,e)}writeInfo(e){gs(this.restEncoder,e)}writeString(e){vs(this.restEncoder,e)}writeParentInfo(e){ms(this.restEncoder,e?1:0)}writeTypeRef(e){ms(this.restEncoder,e)}writeLen(e){ms(this.restEncoder,e)}writeAny(e){Es(this.restEncoder,e)}writeBuf(e){xs(this.restEncoder,e)}writeJSON(e){vs(this.restEncoder,JSON.stringify(e))}writeKey(e){vs(this.restEncoder,e)}}class ml{constructor(){this.restEncoder=ds(),this.dsCurrVal=0}toUint8Array(){return fs(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,ms(this.restEncoder,t)}writeDsLen(e){0===e&&Ns(),ms(this.restEncoder,e-1),this.dsCurrVal+=e}}class bl extends ml{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ms,this.clientEncoder=new As,this.leftClockEncoder=new Ms,this.rightClockEncoder=new Ms,this.infoEncoder=new Ss(gs),this.stringEncoder=new Ls,this.parentInfoEncoder=new Ss(gs),this.typeRefEncoder=new As,this.lenEncoder=new As}toUint8Array(){const e=ds();return ms(e,0),xs(e,this.keyClockEncoder.toUint8Array()),xs(e,this.clientEncoder.toUint8Array()),xs(e,this.leftClockEncoder.toUint8Array()),xs(e,this.rightClockEncoder.toUint8Array()),xs(e,fs(this.infoEncoder)),xs(e,this.stringEncoder.toUint8Array()),xs(e,fs(this.parentInfoEncoder)),xs(e,this.typeRefEncoder.toUint8Array()),xs(e,this.lenEncoder.toUint8Array()),ks(e,fs(this.restEncoder)),fs(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?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Es(this.restEncoder,e)}writeBuf(e){xs(this.restEncoder,e)}writeJSON(e){Es(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);void 0===t?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const yl=(e,t,n)=>{const r=new Map;n.forEach(((e,n)=>{Hl(t,n)>e&&r.set(n,e)})),Bl(t).forEach(((e,t)=>{n.has(t)||r.set(t,0)})),ms(e.restEncoder,r.size),qo(r.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([n,r])=>{((e,t,n,r)=>{r=Jo(r,t[0].id.clock);const i=Jl(t,r);ms(e.restEncoder,t.length-i),e.writeClient(n),ms(e.restEncoder,r);const o=t[i];o.write(e,r-o.id.clock);for(let s=i+1;s<t.length;s++)t[s].write(e,0)})(e,t.clients.get(n),n,r)}))},wl=(e,t,n,r=new fl(e))=>ac(t,(e=>{e.local=!1;let t=!1;const n=e.doc,i=n.store,o=((e,t)=>{const n=To(),r=Fs(e.restDecoder);for(let i=0;i<r;i++){const r=Fs(e.restDecoder),i=new Array(r),o=e.readClient();let s=Fs(e.restDecoder);n.set(o,{i:0,refs:i});for(let n=0;n<r;n++){const r=e.readInfo();switch(31&r){case 0:{const t=e.readLen();i[n]=new wu(Dl(o,s),t),s+=t;break}case 10:{const t=Fs(e.restDecoder);i[n]=new Wu(Dl(o,s),t),s+=t;break}default:{const a=0===(192&r),l=new qu(Dl(o,s),null,(r&Go)===Go?e.readLeftID():null,null,(r&Ko)===Ko?e.readRightID():null,a?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,a&&32===(32&r)?e.readString():null,Vu(e,r));i[n]=l,s+=l.length}}}}return n})(r,n),s=((e,t,n)=>{const r=[];let i=qo(n.keys()).sort(((e,t)=>e-t));if(0===i.length)return null;const o=()=>{if(0===i.length)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;){if(i.pop(),!(i.length>0))return null;e=n.get(i[i.length-1])}return e};let s=o();if(null===s)return null;const a=new Wl,l=new Map,c=(e,t)=>{const n=l.get(e);(null==n||n>t)&&l.set(e,t)};let u=s.refs[s.i++];const d=new Map,h=()=>{for(const e of r){const t=e.id.client,r=n.get(t);r?(r.i--,a.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):a.clients.set(t,[e]),i=i.filter((e=>e!==t))}r.length=0};for(;;){if(u.constructor!==Wu){const i=Po(d,u.id.client,(()=>Hl(t,u.id.client)))-u.id.clock;if(i<0)r.push(u),c(u.id.client,u.id.clock-1),h();else{const o=u.getMissing(e,t);if(null!==o){r.push(u);const e=n.get(o)||{refs:[],i:0};if(e.refs.length!==e.i){u=e.refs[e.i++];continue}c(o,Hl(t,o)),h()}else(0===i||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(null!==s&&s.i<s.refs.length)u=s.refs[s.i++];else{if(s=o(),null===s)break;u=s.refs[s.i++]}}if(a.clients.size>0){const e=new bl;return yl(e,a,new Map),ms(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null})(e,i,o),a=i.pendingStructs;if(a){for(const[e,n]of a.missing)if(n<Hl(i,e)){t=!0;break}if(s){for(const[e,t]of s.missing){const n=a.missing.get(e);(null==n||n>t)&&a.missing.set(e,t)}a.update=hc([a.update,s.update])}}else i.pendingStructs=s;const l=al(r,e,i);if(i.pendingDs){const t=new fl(Is(i.pendingDs));Fs(t.restDecoder);const n=al(t,e,i);i.pendingDs=l&&n?hc([l,n]):l||n}else i.pendingDs=l;if(t){const t=i.pendingStructs.update;i.pendingStructs=null,vl(e.doc,t)}}),n,!1),vl=(e,t,n,r=fl)=>{const i=Is(t);wl(i,e,n,new r(i))},kl=(e,t=new Uint8Array([0]),n=new bl)=>{((e,t,n=new Map)=>{yl(e,t.store,n),ol(e,il(t.store))})(n,e,_l(t));const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(fc(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===gl)return uc(r.map(((e,t)=>0===t?e:yc(e))));if(n.constructor===bl)return hc(r)}return r[0]},xl=e=>{const t=new Map,n=Fs(e.restDecoder);for(let r=0;r<n;r++){const n=Fs(e.restDecoder),r=Fs(e.restDecoder);t.set(n,r)}return t},_l=e=>xl(new ul(Is(e))),Cl=(e,t)=>(ms(e.restEncoder,t.size),qo(t.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{ms(e.restEncoder,t),ms(e.restEncoder,n)})),e),El=(e,t=new ml)=>(e instanceof Map?Cl(t,e):((e,t)=>{Cl(e,Bl(t.store))})(t,e),t.toUint8Array());class Sl{constructor(){this.l=[]}}const Ol=()=>new Sl,Al=(e,t)=>e.l.push(t),$l=(e,t)=>{const n=e.l;n.length;e.l=n.filter((e=>t!==e)),e.l.length},Ml=(e,t,n)=>ga(e.l,[t,n]);class Ll{constructor(e,t){this.client=e,this.clock=t}}const jl=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,Dl=(e,t)=>new Ll(e,t),Nl=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw Ns()};class Tl{constructor(e,t,n,r=0){this.type=e,this.tname=t,this.item=n,this.assoc=r}}class zl{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}}const Pl=(e,t,n)=>{let r=null,i=null;return null===e._item?i=Nl(e):r=Dl(e._item.id.client,e._item.id.clock),new Tl(r,i,t,n)},Il=(e,t,n=0)=>{let r=e._start;if(n<0){if(0===t)return Pl(e,null,n);t--}for(;null!==r;){if(!r.deleted&&r.countable){if(r.length>t)return Pl(e,Dl(r.id.client,r.id.clock+t),n);t-=r.length}if(null===r.right&&n<0)return Pl(e,r.lastId,n);r=r.right}return Pl(e,null,n)},Rl=(e,t,n=!0)=>{const r=t.store,i=e.item,o=e.type,s=e.tname,a=e.assoc;let l=null,c=0;if(null!==i){if(Hl(r,i.client)<=i.clock)return null;const e=n?Ru(r,i):{item:Xl(r,i),diff:0},t=e.item;if(!(t instanceof qu))return null;if(l=t.parent,null===l._item||!l._item.deleted){c=t.deleted||!t.countable?0:e.diff+(a>=0?0:1);let n=t.left;for(;null!==n;)!n.deleted&&n.countable&&(c+=n.length),n=n.left}}else{if(null!==s)l=t.get(s);else{if(null===o)throw Ns();{if(Hl(r,o.client)<=o.clock)return null;const{item:e}=n?Ru(r,o):{item:Xl(r,o)};if(!(e instanceof qu&&e.content instanceof Iu))return null;l=e.content.type}}c=a>=0?l._length:0}return((e,t,n=0)=>new zl(e,t,n))(l,c,e.assoc)};class Ul{constructor(e,t){this.ds=e,this.sv=t}}const ql=(e,t)=>new Ul(e,t),Vl=(ql(rl(),new Map),(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!Qa(t.ds,e.id)),Fl=(e,t)=>{const n=Po(e.meta,Fl,Io),r=e.doc.store;n.has(t)||(t.sv.forEach(((t,n)=>{t<Hl(r,n)&&Kl(e,Dl(n,t))})),Ga(e,t.ds,(e=>{})),n.add(t))};class Wl{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Bl=e=>{const t=new Map;return e.clients.forEach(((e,n)=>{const r=e[e.length-1];t.set(n,r.id.clock+r.length)})),t},Hl=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const r=n[n.length-1];return r.id.clock+r.length},Zl=(e,t)=>{let n=e.clients.get(t.id.client);if(void 0===n)n=[],e.clients.set(t.id.client,n);else{const e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw Ns()}n.push(t)},Jl=(e,t)=>{let n=0,r=e.length-1,i=e[r],o=i.id.clock;if(o===t)return r;let s=Bo(t/(o+i.length-1)*r);for(;n<=r;){if(i=e[s],o=i.id.clock,o<=t){if(t<o+i.length)return s;n=s+1}else r=s-1;s=Bo((n+r)/2)}throw Ns()},Xl=(e,t)=>{const n=e.clients.get(t.client);return n[Jl(n,t.clock)]},Yl=(e,t,n)=>{const r=Jl(t,n),i=t[r];return i.id.clock<n&&i instanceof qu?(t.splice(r+1,0,Uu(e,i,n-i.id.clock)),r+1):r},Kl=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[Yl(e,n,t.clock)]},Gl=(e,t,n)=>{const r=t.clients.get(n.client),i=Jl(r,n.clock),o=r[i];return n.clock!==o.id.clock+o.length-1&&o.constructor!==wu&&r.splice(i+1,0,Uu(e,o,n.clock-o.id.clock+1)),o},Ql=(e,t,n,r,i)=>{if(0===r)return;const o=n+r;let s,a=Yl(e,t,n);do{s=t[a++],o<s.id.clock+s.length&&Yl(e,t,o),i(s)}while(a<t.length&&t[a].id.clock<o)};class ec{constructor(e,t,n){this.doc=e,this.deleteSet=new Ka,this.beforeState=Bl(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}}const tc=(e,t)=>!(0===t.deleteSet.clients.size&&!((e,t)=>{for(const[n,r]of e)if(t(r,n))return!0;return!1})(t.afterState,((e,n)=>t.beforeState.get(n)!==e)))&&(el(t.deleteSet),((e,t)=>{yl(e,t.doc.store,t.beforeState)})(e,t),ol(e,t.deleteSet),!0),nc=(e,t,n)=>{const r=t._item;(null===r||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&Po(e.changed,t,Io).add(n)},rc=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0&&(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n));n=r,r=e[--i-1])n instanceof qu&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);const o=t-i;return o&&e.splice(t+1-o,o),o},ic=(e,t,n)=>{for(const[r,i]of e.clients.entries()){const e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){const o=i[r],s=o.clock+o.len;for(let r=Jl(e,o.clock),i=e[r];r<e.length&&i.id.clock<s;i=e[++r]){const i=e[r];if(o.clock+o.len<=i.id.clock)break;i instanceof qu&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},oc=(e,t)=>{e.clients.forEach(((e,n)=>{const r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t];for(let e=Zo(r.length-1,1+Jl(r,n.clock+n.len-1)),t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+rc(r,e)}}))},sc=(e,t)=>{if(t<e.length){const n=e[t],r=n.doc,i=r.store,o=n.deleteSet,s=n._mergeStructs;try{el(o),n.afterState=Bl(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const e=[];n.changed.forEach(((t,r)=>e.push((()=>{null!==r._item&&r._item.deleted||r._callObserver(n,t)})))),e.push((()=>{n.changedParentTypes.forEach(((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&((e=e.filter((e=>null===e.target._item||!e.target._item.deleted))).forEach((e=>{e.currentTarget=t,e._path=null})),e.sort(((e,t)=>e.path.length-t.path.length)),Ml(t._dEH,e,n))}))})),e.push((()=>r.emit("afterTransaction",[n,r]))),ga(e,[]),n._needFormattingCleanup&&lu(n)}finally{r.gc&&ic(o,i,r.gcFilter),oc(o,i),n.afterState.forEach(((e,t)=>{const r=n.beforeState.get(t)||0;if(r!==e){const e=i.clients.get(t),n=Jo(Jl(e,r),1);for(let t=e.length-1;t>=n;)t-=1+rc(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,r=i.clients.get(t),o=Jl(r,n);o+1<r.length&&rc(r,o+1)>1||o>0&&rc(r,o)}if(n.local||n.afterState.get(r.clientID)===n.beforeState.get(r.clientID)||(Ba(Fa,za,"[yjs] ",Pa,qa,"Changed the client-id because another client seems to be using it."),r.clientID=ll()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const e=new gl;tc(e,n)&&r.emit("update",[e.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const e=new bl;tc(e,n)&&r.emit("updateV2",[e.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach((e=>{e.clientID=r.clientID,null==e.collectionid&&(e.collectionid=r.collectionid),r.subdocs.add(e)})),c.forEach((e=>r.subdocs.delete(e))),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach((e=>e.destroy()))),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):sc(e,t+1)}}},ac=(e,t,n=null,r=!0)=>{const i=e._transactionCleanups;let o=!1,s=null;null===e._transaction&&(o=!0,e._transaction=new ec(e,n,r),i.push(e._transaction),1===i.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(o){const t=e._transaction===i[0];e._transaction=null,t&&sc(i,0)}}return s};class lc{constructor(e,t){this.gen=function*(e){const t=Fs(e.restDecoder);for(let n=0;n<t;n++){const t=Fs(e.restDecoder),n=e.readClient();let r=Fs(e.restDecoder);for(let i=0;i<t;i++){const t=e.readInfo();if(10===t){const t=Fs(e.restDecoder);yield new Wu(Dl(n,r),t),r+=t}else if(0!==(31&t)){const i=0===(192&t),o=new qu(Dl(n,r),null,(t&Go)===Go?e.readLeftID():null,null,(t&Ko)===Ko?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&32===(32&t)?e.readString():null,Vu(e,t));yield o,r+=o.length}else{const t=e.readLen();yield new wu(Dl(n,r),t),r+=t}}}}(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do{this.curr=this.gen.next().value||null}while(this.filterSkips&&null!==this.curr&&this.curr.constructor===Wu);return this.curr}}class cc{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const uc=e=>hc(e,dl,gl),dc=(e,t)=>{if(e.constructor===wu){const{client:n,clock:r}=e.id;return new wu(Dl(n,r+t),e.length-t)}if(e.constructor===Wu){const{client:n,clock:r}=e.id;return new Wu(Dl(n,r+t),e.length-t)}{const n=e,{client:r,clock:i}=n.id;return new qu(Dl(r,i+t),null,Dl(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},hc=(e,t=fl,n=bl)=>{if(1===e.length)return e[0];const r=e.map((e=>new t(Is(e))));let i=r.map((e=>new lc(e,!0))),o=null;const s=new n,a=new cc(s);for(;i=i.filter((e=>null!==e.curr)),i.sort(((e,t)=>{if(e.curr.id.client===t.curr.id.client){const n=e.curr.id.clock-t.curr.id.clock;return 0===n?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===Wu?1:-1:n}return t.curr.id.client-e.curr.id.client})),0!==i.length;){const e=i[0],t=e.curr.id.client;if(null!==o){let n=e.curr,r=!1;for(;null!==n&&n.id.clock+n.length<=o.struct.id.clock+o.struct.length&&n.id.client>=o.struct.id.client;)n=e.next(),r=!0;if(null===n||n.id.client!==t||r&&n.id.clock>o.struct.id.clock+o.struct.length)continue;if(t!==o.struct.id.client)gc(a,o.struct,o.offset),o={struct:n,offset:0},e.next();else if(o.struct.id.clock+o.struct.length<n.id.clock)if(o.struct.constructor===Wu)o.struct.length=n.id.clock+n.length-o.struct.id.clock;else{gc(a,o.struct,o.offset);const e=n.id.clock-o.struct.id.clock-o.struct.length;o={struct:new Wu(Dl(t,o.struct.id.clock+o.struct.length),e),offset:0}}else{const t=o.struct.id.clock+o.struct.length-n.id.clock;t>0&&(o.struct.constructor===Wu?o.struct.length-=t:n=dc(n,t)),o.struct.mergeWith(n)||(gc(a,o.struct,o.offset),o={struct:n,offset:0},e.next())}}else o={struct:e.curr,offset:0},e.next();for(let n=e.curr;null!==n&&n.id.client===t&&n.id.clock===o.struct.id.clock+o.struct.length&&n.constructor!==Wu;n=e.next())gc(a,o.struct,o.offset),o={struct:n,offset:0}}null!==o&&(gc(a,o.struct,o.offset),o=null),mc(a);const l=r.map((e=>sl(e))),c=tl(l);return ol(s,c),s.toUint8Array()},fc=(e,t,n=fl,r=bl)=>{const i=_l(t),o=new r,s=new cc(o),a=new n(Is(e)),l=new lc(a,!1);for(;l.curr;){const e=l.curr,t=e.id.client,n=i.get(t)||0;if(l.curr.constructor!==Wu)if(e.id.clock+e.length>n)for(gc(s,e,Jo(n-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)gc(s,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===t&&l.curr.id.clock+l.curr.length<=n;)l.next();else l.next()}mc(s);const c=sl(a);return ol(o,c),o.toUint8Array()},pc=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:fs(e.encoder.restEncoder)}),e.encoder.restEncoder=ds(),e.written=0)},gc=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&pc(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),ms(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},mc=e=>{pc(e);const t=e.encoder.restEncoder;ms(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const r=e.clientStructs[n];ms(t,r.written),ks(t,r.restEncoder)}},bc=(e,t,n,r)=>{const i=new n(Is(e)),o=new lc(i,!1),s=new r,a=new cc(s);for(let c=o.curr;null!==c;c=o.next())gc(a,t(c),0);mc(a);const l=sl(i);return ol(s,l),s.toUint8Array()},yc=e=>bc(e,ma,fl,gl),wc="You must not compute changes after the event-handler fired.";class vc{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||(this._path=kc(this.currentTarget,this.target))}deletes(e){return Qa(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw js(wc);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach((n=>{if(null!==n){const r=t._map.get(n);let i,o;if(this.adds(r)){let e=r.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(r)){if(null===e||!this.deletes(e))return;i="delete",o=Ro(e.content.getContent())}else null!==e&&this.deletes(e)?(i="update",o=Ro(e.content.getContent())):(i="add",o=void 0)}else{if(!this.deletes(r))return;i="delete",o=Ro(r.content.getContent())}e.set(n,{action:i,oldValue:o})}})),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(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw js(wc);const t=this.target,n=Io(),r=Io(),i=[];e={added:n,deleted:r,delta:i,keys:this.keys};if(this.transaction.changed.get(t).has(null)){let e=null;const o=()=>{e&&i.push(e)};for(let i=t._start;null!==i;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&(null!==e&&void 0!==e.delete||(o(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?(null!==e&&void 0!==e.insert||(o(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):(null!==e&&void 0!==e.retain||(o(),e={retain:0}),e.retain+=i.length);null!==e&&void 0===e.retain&&o()}this._changes=e}return e}}const kc=(e,t)=>{const n=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&null!==r;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},xc=()=>{Ha("Invalid access: Add Yjs type to a document before reading data.")};let _c=0;class Cc{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=_c++}}const Ec=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=_c++},Sc=(e,t)=>{if(null===e._start||0===t||null===e._searchMarker)return null;const n=0===e._searchMarker.length?null:e._searchMarker.reduce(((e,n)=>Ho(t-e.index)<Ho(t-n.index)?e:n));let r=e._start,i=0;for(null!==n&&(r=n.p,i=n.index,(e=>{e.timestamp=_c++})(n));null!==r.right&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;null!==r.left&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;null!==r.left&&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 null!==n&&Ho(n.index-i)<r.parent.length/80?(Ec(n,r,i),n):((e,t,n)=>{if(e.length>=80){const r=e.reduce(((e,t)=>e.timestamp<t.timestamp?e:t));return Ec(r,t,n),r}{const r=new Cc(t,n);return e.push(r),r}})(e._searchMarker,r,i)},Oc=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){const 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(null===t||!0===t.marker){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=Jo(t,i.index+n))}},Ac=(e,t,n)=>{const r=e,i=t.changedParentTypes;for(;Po(i,e,(()=>[])).push(n),null!==e._item;)e=e._item.parent;Ml(r._eH,n,t)};class $c{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Ol(),this._dEH=Ol(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Ds()}clone(){throw Ds()}_write(e){}get _first(){let e=this._start;for(;null!==e&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Al(this._eH,e)}observeDeep(e){Al(this._dEH,e)}unobserve(e){$l(this._eH,e)}unobserveDeep(e){$l(this._dEH,e)}toJSON(){}}const Mc=(e,t,n)=>{e.doc??xc(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t;const i=[];let o=e._start;for(;null!==o&&r>0;){if(o.countable&&!o.deleted){const e=o.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}}o=o.right}return i},Lc=e=>{e.doc??xc();const t=[];let n=e._start;for(;null!==n;){if(n.countable&&!n.deleted){const e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},jc=(e,t)=>{let n=0,r=e._start;for(e.doc??xc();null!==r;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},Dc=(e,t)=>{const n=[];return jc(e,((r,i)=>{n.push(t(r,i,e))})),n},Nc=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(null===n){for(;null!==t&&t.deleted;)t=t.right;if(null===t)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}const e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},Tc=(e,t)=>{e.doc??xc();const n=Sc(e,t);let r=e._start;for(null!==n&&(r=n.p,t-=n.index);null!==r;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},zc=(e,t,n,r)=>{let i=n;const o=e.doc,s=o.clientID,a=o.store,l=null===n?t._start:n.right;let c=[];const u=()=>{c.length>0&&(i=new qu(Dl(s,Hl(a,s)),i,i&&i.lastId,l,l&&l.id,t,null,new Au(c)),i.integrate(e,0),c=[])};r.forEach((n=>{if(null===n)c.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new qu(Dl(s,Hl(a,s)),i,i&&i.lastId,l,l&&l.id,t,null,new vu(new Uint8Array(n))),i.integrate(e,0);break;case cl:i=new qu(Dl(s,Hl(a,s)),i,i&&i.lastId,l,l&&l.id,t,null,new _u(n)),i.integrate(e,0);break;default:if(!(n instanceof $c))throw new Error("Unexpected content type in insert operation");i=new qu(Dl(s,Hl(a,s)),i,i&&i.lastId,l,l&&l.id,t,null,new Iu(n)),i.integrate(e,0)}}})),u()},Pc=()=>js("Length exceeded!"),Ic=(e,t,n,r)=>{if(n>t._length)throw Pc();if(0===n)return t._searchMarker&&Oc(t._searchMarker,n,r.length),zc(e,t,null,r);const i=n,o=Sc(t,n);let s=t._start;for(null!==o&&(s=o.p,0===(n-=o.index)&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));null!==s;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&Kl(e,Dl(s.id.client,s.id.clock+n));break}n-=s.length}return t._searchMarker&&Oc(t._searchMarker,i,r.length),zc(e,t,s,r)},Rc=(e,t,n,r)=>{if(0===r)return;const i=n,o=r,s=Sc(t,n);let a=t._start;for(null!==s&&(a=s.p,n-=s.index);null!==a&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&Kl(e,Dl(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&null!==a;)a.deleted||(r<a.length&&Kl(e,Dl(a.id.client,a.id.clock+r)),a.delete(e),r-=a.length),a=a.right;if(r>0)throw Pc();t._searchMarker&&Oc(t._searchMarker,i,-o+r)},Uc=(e,t,n)=>{const r=t._map.get(n);void 0!==r&&r.delete(e)},qc=(e,t,n,r)=>{const i=t._map.get(n)||null,o=e.doc,s=o.clientID;let a;if(null==r)a=new Au([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new Au([r]);break;case Uint8Array:a=new vu(r);break;case cl:a=new _u(r);break;default:if(!(r instanceof $c))throw new Error("Unexpected content type");a=new Iu(r)}new qu(Dl(s,Hl(o.store,s)),i,i&&i.lastId,null,null,t,n,a).integrate(e,0)},Vc=(e,t)=>{e.doc??xc();const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},Fc=e=>{const t={};return e.doc??xc(),e._map.forEach(((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])})),t},Wc=(e,t)=>{e.doc??xc();const n=e._map.get(t);return void 0!==n&&!n.deleted},Bc=e=>{return e.doc??xc(),t=e._map.entries(),n=e=>!e[1].deleted,Ja((()=>{let e;do{e=t.next()}while(!e.done&&!n(e.value));return e}));var t,n};class Hc extends vc{}class Zc extends $c{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new Zc;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Zc}clone(){const e=new Zc;return e.insert(0,this.toArray().map((e=>e instanceof $c?e.clone():e))),e}get length(){return this.doc??xc(),this._length}_callObserver(e,t){super._callObserver(e,t),Ac(this,e,new Hc(this,e))}insert(e,t){null!==this.doc?ac(this.doc,(n=>{Ic(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?ac(this.doc,(t=>{((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;zc(e,t,r,n)})(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?ac(this.doc,(n=>{Rc(n,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return Tc(this,e)}toArray(){return Lc(this)}slice(e=0,t=this.length){return Mc(this,e,t)}toJSON(){return this.map((e=>e instanceof $c?e.toJSON():e))}map(e){return Dc(this,e)}forEach(e){jc(this,e)}[Symbol.iterator](){return Nc(this)}_write(e){e.writeTypeRef(Lu)}}class Jc extends vc{constructor(e,t,n){super(e,t),this.keysChanged=n}}class Xc extends $c{constructor(e){super(),this._prelimContent=null,this._prelimContent=void 0===e?new Map: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 Xc}clone(){const e=new Xc;return this.forEach(((t,n)=>{e.set(n,t instanceof $c?t.clone():t)})),e}_callObserver(e,t){Ac(this,e,new Jc(this,e,t))}toJSON(){this.doc??xc();const e={};return this._map.forEach(((t,n)=>{if(!t.deleted){const r=t.content.getContent()[t.length-1];e[n]=r instanceof $c?r.toJSON():r}})),e}get size(){return[...Bc(this)].length}keys(){return Xa(Bc(this),(e=>e[0]))}values(){return Xa(Bc(this),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return Xa(Bc(this),(e=>[e[0],e[1].content.getContent()[e[1].length-1]]))}forEach(e){this.doc??xc(),this._map.forEach(((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)}))}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?ac(this.doc,(t=>{Uc(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?ac(this.doc,(n=>{qc(n,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return Vc(this,e)}has(e){return Wc(this,e)}clear(){null!==this.doc?ac(this.doc,(e=>{this.forEach((function(t,n,r){Uc(e,r,n)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(ju)}}const Yc=(e,t)=>e===t||"object"===typeof e&&"object"===typeof t&&e&&t&&((e,t)=>e===t||da(e)===da(t)&&((e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0})(e,((e,n)=>(void 0!==e||ha(t,n))&&t[n]===e)))(e,t);class Kc{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){if(null===this.right&&Ns(),this.right.content.constructor===Eu)this.right.deleted||tu(this.currentAttributes,this.right.content);else this.right.deleted||(this.index+=this.right.length);this.left=this.right,this.right=this.right.right}}const Gc=(e,t,n)=>{for(;null!==t.right&&n>0;){if(t.right.content.constructor===Eu)t.right.deleted||tu(t.currentAttributes,t.right.content);else t.right.deleted||(n<t.right.length&&Kl(e,Dl(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);t.left=t.right,t.right=t.right.right}return t},Qc=(e,t,n,r)=>{const i=new Map,o=r?Sc(t,n):null;if(o){const t=new Kc(o.p.left,o.p,o.index,i);return Gc(e,t,n-o.index)}{const r=new Kc(null,t._start,0,i);return Gc(e,r,n)}},eu=(e,t,n,r)=>{for(;null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===Eu&&Yc(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=e.doc,o=i.clientID;r.forEach(((r,s)=>{const a=n.left,l=n.right,c=new qu(Dl(o,Hl(i.store,o)),a,a&&a.lastId,l,l&&l.id,t,null,new Eu(s,r));c.integrate(e,0),n.right=c,n.forward()}))},tu=(e,t)=>{const{key:n,value:r}=t;null===r?e.delete(n):e.set(n,r)},nu=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===Eu&&Yc(t[e.right.content.key]??null,e.right.content.value));)e.forward()},ru=(e,t,n,r)=>{const i=e.doc,o=i.clientID,s=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!Yc(c,l)){s.set(a,c);const{left:r,right:u}=n;n.right=new qu(Dl(o,Hl(i.store,o)),r,r&&r.lastId,u,u&&u.id,t,null,new Eu(a,l)),n.right.integrate(e,0),n.forward()}}return s},iu=(e,t,n,r,i)=>{n.currentAttributes.forEach(((e,t)=>{void 0===i[t]&&(i[t]=null)}));const o=e.doc,s=o.clientID;nu(n,i);const a=ru(e,t,n,i),l=r.constructor===String?new $u(r):r instanceof $c?new Iu(r):new Cu(r);let{left:c,right:u,index:d}=n;t._searchMarker&&Oc(t._searchMarker,n.index,l.getLength()),u=new qu(Dl(s,Hl(o.store,s)),c,c&&c.lastId,u,u&&u.id,t,null,l),u.integrate(e,0),n.right=u,n.index=d,n.forward(),eu(e,t,n,a)},ou=(e,t,n,r,i)=>{const o=e.doc,s=o.clientID;nu(n,i);const a=ru(e,t,n,i);e:for(;null!==n.right&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Eu));){if(!n.right.deleted)switch(n.right.content.constructor){case Eu:{const{key:t,value:o}=n.right.content,s=i[t];if(void 0!==s){if(Yc(s,o))a.delete(t);else{if(0===r)break e;a.set(t,o)}n.right.delete(e)}else n.currentAttributes.set(t,o);break}default:r<n.right.length&&Kl(e,Dl(n.right.id.client,n.right.id.clock+r)),r-=n.right.length}n.forward()}if(r>0){let i="";for(;r>0;r--)i+="\n";n.right=new qu(Dl(s,Hl(o.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new $u(i)),n.right.integrate(e,0),n.forward()}eu(e,t,n,a)},su=(e,t,n,r,i)=>{let o=t;const s=To();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===Eu){const e=o.content;s.set(e.key,e)}o=o.right}let a=0,l=!1;for(;t!==o;){if(n===t&&(l=!0),!t.deleted){const n=t.content;switch(n.constructor){case Eu:{const{key:o,value:c}=n,u=r.get(o)??null;s.get(o)===n&&u!==c||(t.delete(e),a++,l||(i.get(o)??null)!==c||u===c||(null===u?i.delete(o):i.set(o,u))),l||t.deleted||tu(i,n);break}}}t=t.right}return a},au=e=>{let t=0;return ac(e.doc,(n=>{let r=e._start,i=e._start,o=To();const s=zo(o);for(;i;){if(!1===i.deleted)if(i.content.constructor===Eu)tu(s,i.content);else t+=su(n,r,i,o,s),o=zo(s),r=i;i=i.right}})),t},lu=e=>{const t=new Set,n=e.doc;for(const[r,i]of e.afterState.entries()){const o=e.beforeState.get(r)||0;i!==o&&Ql(e,n.store.clients.get(r),o,i,(e=>{e.deleted||e.content.constructor!==Eu||e.constructor===wu||t.add(e.parent)}))}ac(n,(n=>{Ga(e,e.deleteSet,(e=>{if(e instanceof wu||!e.parent._hasFormatting||t.has(e.parent))return;const r=e.parent;e.content.constructor===Eu?t.add(r):((e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Eu){const r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}})(n,e)}));for(const e of t)au(e)}))},cu=(e,t,n)=>{const r=n,i=zo(t.currentAttributes),o=t.right;for(;n>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case Iu:case Cu:case $u:n<t.right.length&&Kl(e,Dl(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e)}t.forward()}o&&su(e,o,t.right,i,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&Oc(s._searchMarker,t.index,-r+n),t};class uu extends vc{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach((e=>{null===e?this.childListChanged=!0:this.keysChanged.add(e)}))}get changes(){if(null===this._changes){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(null===this._delta){const e=this.target.doc,t=[];ac(e,(e=>{const n=new Map,r=new Map;let i=this.target._start,o=null;const s={};let a="",l=0,c=0;const u=()=>{if(null!==o){let e=null;switch(o){case"delete":c>0&&(e={delete:c}),c=0;break;case"insert":("object"===typeof a||a.length>0)&&(e={insert:a},n.size>0&&(e.attributes={},n.forEach(((t,n)=>{null!==t&&(e.attributes[n]=t)})))),a="";break;case"retain":l>0&&(e={retain:l},(e=>{for(const t in e)return!1;return!0})(s)||(e.attributes=la({},s))),l=0}e&&t.push(e),o=null}};for(;null!==i;){switch(i.content.constructor){case Iu:case Cu:this.adds(i)?this.deletes(i)||(u(),o="insert",a=i.content.getContent()[0],u()):this.deletes(i)?("delete"!==o&&(u(),o="delete"),c+=1):i.deleted||("retain"!==o&&(u(),o="retain"),l+=1);break;case $u:this.adds(i)?this.deletes(i)||("insert"!==o&&(u(),o="insert"),a+=i.content.str):this.deletes(i)?("delete"!==o&&(u(),o="delete"),c+=i.length):i.deleted||("retain"!==o&&(u(),o="retain"),l+=i.length);break;case Eu:{const{key:t,value:a}=i.content;if(this.adds(i)){if(!this.deletes(i)){const l=n.get(t)??null;Yc(l,a)?null!==a&&i.delete(e):("retain"===o&&u(),Yc(a,r.get(t)??null)?delete s[t]:s[t]=a)}}else if(this.deletes(i)){r.set(t,a);const e=n.get(t)??null;Yc(e,a)||("retain"===o&&u(),s[t]=e)}else if(!i.deleted){r.set(t,a);const n=s[t];void 0!==n&&(Yc(n,a)?null!==n&&i.delete(e):("retain"===o&&u(),null===a?delete s[t]:s[t]=a))}i.deleted||("insert"===o&&u(),tu(n,i.content));break}}i=i.right}for(u();t.length>0;){const e=t[t.length-1];if(void 0===e.retain||void 0!==e.attributes)break;t.pop()}})),this._delta=t}return this._delta}}class du extends $c{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??xc(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach((e=>e()))}catch(Cd){}this._pending=null}_copy(){return new du}clone(){const e=new du;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new uu(this,e,t);Ac(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??xc();let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===$u&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?ac(this.doc,(n=>{const r=new Kc(null,this._start,0,new Map);for(let i=0;i<e.length;i++){const o=e[i];if(void 0!==o.insert){const s=t||"string"!==typeof o.insert||i!==e.length-1||null!==r.right||"\n"!==o.insert.slice(-1)?o.insert:o.insert.slice(0,-1);("string"!==typeof s||s.length>0)&&iu(n,this,r,s,o.attributes||{})}else void 0!==o.retain?ou(n,this,r,o.retain,o.attributes||{}):void 0!==o.delete&&cu(n,r,o.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,n){this.doc??xc();const r=[],i=new Map,o=this.doc;let s="",a=this._start;function l(){if(s.length>0){const e={};let t=!1;i.forEach(((n,r)=>{t=!0,e[r]=n}));const n={insert:s};t&&(n.attributes=e),r.push(n),s=""}}const c=()=>{for(;null!==a;){if(Vl(a,e)||void 0!==t&&Vl(a,t))switch(a.content.constructor){case $u:{const r=i.get("ychange");void 0===e||Vl(a,e)?void 0===t||Vl(a,t)?void 0!==r&&(l(),i.delete("ychange")):void 0!==r&&r.user===a.id.client&&"added"===r.type||(l(),i.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==r&&r.user===a.id.client&&"removed"===r.type||(l(),i.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case Iu:case Cu:{l();const e={insert:a.content.getContent()[0]};if(i.size>0){const t={};e.attributes=t,i.forEach(((e,n)=>{t[n]=e}))}r.push(e);break}case Eu:Vl(a,e)&&(l(),tu(i,a.content))}a=a.right}l()};return e||t?ac(o,(n=>{e&&Fl(n,e),t&&Fl(n,t),c()}),"cleanup"):c(),r}insert(e,t,n){if(t.length<=0)return;const r=this.doc;null!==r?ac(r,(r=>{const i=Qc(r,this,e,!n);n||(n={},i.currentAttributes.forEach(((e,t)=>{n[t]=e}))),iu(r,this,i,t,n)})):this._pending.push((()=>this.insert(e,t,n)))}insertEmbed(e,t,n){const r=this.doc;null!==r?ac(r,(r=>{const i=Qc(r,this,e,!n);iu(r,this,i,t,n||{})})):this._pending.push((()=>this.insertEmbed(e,t,n||{})))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?ac(n,(n=>{cu(n,Qc(n,this,e,!0),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,n){if(0===t)return;const r=this.doc;null!==r?ac(r,(r=>{const i=Qc(r,this,e,!1);null!==i.right&&ou(r,this,i,t,n)})):this._pending.push((()=>this.format(e,t,n)))}removeAttribute(e){null!==this.doc?ac(this.doc,(t=>{Uc(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?ac(this.doc,(n=>{qc(n,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return Vc(this,e)}getAttributes(){return Fc(this)}_write(e){e.writeTypeRef(Du)}}class hu{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??xc()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do{if(t=e.content.type,e.deleted||t.constructor!==pu&&t.constructor!==fu||null===t._start)for(;null!==e;){if(null!==e.right){e=e.right;break}e=e.parent===this._root?null:e.parent._item}else e=t._start}while(null!==e&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,null===e?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class fu extends $c{constructor(){super(),this._prelimContent=[]}get firstChild(){const 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 fu}clone(){const e=new fu;return e.insert(0,this.toArray().map((e=>e instanceof $c?e.clone():e))),e}get length(){return this.doc??xc(),null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new hu(this,e)}querySelector(e){e=e.toUpperCase();const t=new hu(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),qo(new hu(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){Ac(this,e,new gu(this,t,e))}toString(){return Dc(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const r=e.createDocumentFragment();return void 0!==n&&n._createAssociation(r,this),jc(this,(i=>{r.insertBefore(i.toDOM(e,t,n),null)})),r}insert(e,t){null!==this.doc?ac(this.doc,(n=>{Ic(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)ac(this.doc,(n=>{const r=e&&e instanceof $c?e._item:e;zc(n,this,r,t)}));else{const n=this._prelimContent,r=null===e?0:n.findIndex((t=>t===e))+1;if(0===r&&null!==e)throw js("Reference item not found");n.splice(r,0,...t)}}delete(e,t=1){null!==this.doc?ac(this.doc,(n=>{Rc(n,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return Lc(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Tc(this,e)}slice(e=0,t=this.length){return Mc(this,e,t)}forEach(e){jc(this,e)}_write(e){e.writeTypeRef(Tu)}}class pu extends fu{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const 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 pu(this.nodeName)}clone(){const e=new pu(this.nodeName);return((e,t)=>{for(const n in e)t(e[n],n)})(this.getAttributes(),((t,n)=>{"string"===typeof t&&e.setAttribute(n,t)})),e.insert(0,this.toArray().map((e=>e instanceof $c?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const o in e)n.push(o);n.sort();const r=n.length;for(let o=0;o<r;o++){const r=n[o];t.push(r+'="'+e[r]+'"')}const i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?" "+t.join(" "):""}>${super.toString()}</${i}>`}removeAttribute(e){null!==this.doc?ac(this.doc,(t=>{Uc(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?ac(this.doc,(n=>{qc(n,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return Vc(this,e)}hasAttribute(e){return Wc(this,e)}getAttributes(e){return e?((e,t)=>{const n={};return e._map.forEach(((e,r)=>{let i=e;for(;null!==i&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;null!==i&&Vl(i,t)&&(n[r]=i.content.getContent()[i.length-1])})),n})(this,e):Fc(this)}toDOM(e=document,t={},n){const r=e.createElement(this.nodeName),i=this.getAttributes();for(const o in i){const e=i[o];"string"===typeof e&&r.setAttribute(o,e)}return jc(this,(i=>{r.appendChild(i.toDOM(e,t,n))})),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(Nu),e.writeKey(this.nodeName)}}class gu extends vc{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach((e=>{null===e?this.childListChanged=!0:this.attributesChanged.add(e)}))}}class mu extends Xc{constructor(e){super(),this.hookName=e}_copy(){return new mu(this.hookName)}clone(){const e=new mu(this.hookName);return this.forEach(((t,n)=>{e.set(n,t)})),e}toDOM(e=document,t={},n){const r=t[this.hookName];let i;return i=void 0!==r?r.createDom(this):document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(zu),e.writeKey(this.hookName)}}class bu extends du{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new bu}clone(){const e=new bu;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const r=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(r,this),r}toString(){return this.toDelta().map((e=>{const t=[];for(const r in e.attributes){const n=[];for(const t in e.attributes[r])n.push({key:t,value:e.attributes[r][t]});n.sort(((e,t)=>e.key<t.key?-1:1)),t.push({nodeName:r,attrs:n})}t.sort(((e,t)=>e.nodeName<t.nodeName?-1:1));let n="";for(let r=0;r<t.length;r++){const e=t[r];n+=`<${e.nodeName}`;for(let t=0;t<e.attrs.length;t++){const r=e.attrs[t];n+=` ${r.key}="${r.value}"`}n+=">"}n+=e.insert;for(let r=t.length-1;r>=0;r--)n+=`</${t[r].nodeName}>`;return n})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(Pu)}}class yu{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Ds()}mergeWith(e){return!1}write(e,t,n){throw Ds()}integrate(e,t){throw Ds()}}class wu extends yu{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),Zl(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class vu{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new vu(this.content)}splice(e){throw Ds()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class ku{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new ku(this.len)}splice(e){const t=new ku(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){nl(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}}const xu=(e,t)=>new cl({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class _u{constructor(e){e._item,this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),null!==e.meta&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new _u(xu(this.doc.guid,this.opts))}splice(e){throw Ds()}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}}class Cu{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Cu(this.embed)}splice(e){throw Ds()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Eu{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Eu(this.key,this.value)}splice(e){throw Ds()}mergeWith(e){return!1}integrate(e,t){const 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}}class Su{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Su(this.arr)}splice(e){const t=new Su(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}const Ou="development"===Ea("node_env");class Au{constructor(e){this.arr=e,Ou&&pa(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Au(this.arr)}splice(e){const t=new Au(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeAny(t)}}getRef(){return 8}}class $u{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new $u(this.str)}splice(e){const t=new $u(this.str.slice(e));this.str=this.str.slice(0,e);const n=this.str.charCodeAt(e-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"\ufffd",t.str="\ufffd"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(0===t?this.str:this.str.slice(t))}getRef(){return 4}}const Mu=[e=>new Zc,e=>new Xc,e=>new du,e=>new pu(e.readKey()),e=>new fu,e=>new mu(e.readKey()),e=>new bu],Lu=0,ju=1,Du=2,Nu=3,Tu=4,zu=5,Pu=6;class Iu{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Iu(this.type._copy())}splice(e){throw Ds()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;null!==t;)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(;null!==t;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach((t=>{for(;null!==t;)t.gc(e,!0),t=t.left})),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const Ru=(e,t)=>{let n,r=t,i=0;do{i>0&&(r=Dl(r.client,r.clock+i)),n=Xl(e,r),i=r.clock-n.id.clock,r=n.redone}while(null!==r&&n instanceof qu);return{item:n,diff:i}},Uu=(e,t,n)=>{const{client:r,clock:i}=t.id,o=new qu(Dl(r,i+n),t,Dl(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&o.markDeleted(),t.keep&&(o.keep=!0),null!==t.redone&&(o.redone=Dl(t.redone.client,t.redone.clock+n)),t.right=o,null!==o.right&&(o.right.left=o),e._mergeStructs.push(o),null!==o.parentSub&&null===o.right&&o.parent._map.set(o.parentSub,o),t.length=n,o};class qu extends yu{constructor(e,t,n,r,i,o,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=o,this.parentSub=s,this.redone=null,this.content=a,this.info=this.content.isCountable()?2:0}set marker(e){(8&this.info)>0!==e&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Hl(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Hl(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Ll&&this.id.client!==this.parent.client&&this.parent.clock>=Hl(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=Gl(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Kl(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===wu||this.right&&this.right.constructor===wu)this.parent=null;else if(this.parent){if(this.parent.constructor===Ll){const e=Xl(t,this.parent);e.constructor===wu?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===qu&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===qu&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=Gl(e,e.doc.store,Dl(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||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,n=this.left;if(null!==n)t=n.right;else if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start;const r=new Set,i=new Set;for(;null!==t&&t!==this.right;){if(i.add(t),r.add(t),jl(this.origin,t.origin)){if(t.id.client<this.id.client)n=t,r.clear();else if(jl(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!i.has(Xl(e.doc.store,t.origin)))break;r.has(Xl(e.doc.store,t.origin))||(n=t,r.clear())}t=t.right}this.left=n}if(null!==this.left){const e=this.left.right;this.right=e,this.left.right=this}else{let e;if(null!==this.parentSub)for(e=this.parent._map.get(this.parentSub)||null;null!==e&&null!==e.left;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(e)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Zl(e.doc.store,this),this.content.integrate(e,this),nc(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new wu(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;null!==e&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;null!==e&&e.deleted;)e=e.left;return e}get lastId(){return 1===this.length?this.id:Dl(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&jl(e.origin,this.lastId)&&this.right===e&&jl(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&null===this.redone&&null===e.redone&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const 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,null!==this.right&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&null===this.parentSub&&(t._length-=this.length),this.markDeleted(),nl(e.deleteSet,this.id.client,this.id.clock,this.length),nc(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw Ns();this.content.gc(e),t?((e,t,n)=>{const r=e.clients.get(t.id.client);r[Jl(r,t.id.clock)]=n})(e,this,new wu(this.id,this.length)):this.content=new ku(this.length)}write(e,t){const n=t>0?Dl(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,o=31&this.content.getRef()|(null===n?0:Go)|(null===r?0:Ko)|(null===i?0:32);if(e.writeInfo(o),null!==n&&e.writeLeftID(n),null!==r&&e.writeRightID(r),null===n&&null===r){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=Nl(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===Ll?(e.writeParentInfo(!1),e.writeLeftID(t)):Ns();null!==i&&e.writeString(i)}this.content.write(e,t)}}const Vu=(e,t)=>Fu[31&t](e),Fu=[()=>{Ns()},e=>new ku(e.readLen()),e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++){const t=e.readString();"undefined"===t?n.push(void 0):n.push(JSON.parse(t))}return new Su(n)},e=>new vu(e.readBuf()),e=>new $u(e.readString()),e=>new Cu(e.readJSON()),e=>new Eu(e.readKey(),e.readJSON()),e=>new Iu(Mu[e.readTypeRef()](e)),e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new Au(n)},e=>new _u(xu(e.readString(),e.readAny())),()=>{Ns()}];class Wu extends yu{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){Ns()}write(e,t){e.writeInfo(10),ms(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const Bu="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:{},Hu="__ $YJS$ __";Bu[Hu],Bu[Hu]=!0;const Zu=new Map;const Ju="undefined"===typeof BroadcastChannel?class{constructor(e){var t;this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&null!==this.onmessage&&this.onmessage({data:Ma(t.newValue||"")}),t=this._onChange,sa||addEventListener("storage",t)}postMessage(e){aa.setItem(this.room,$a(new Uint8Array(e)))}close(){var e;e=this._onChange,sa||removeEventListener("storage",e)}}:BroadcastChannel,Xu=e=>Po(Zu,e,(()=>{const t=Io(),n=new Ju(e);return n.onmessage=e=>t.forEach((t=>t(e.data,"broadcastchannel"))),{bc:n,subs:t}})),Yu=(e,t,n=null)=>{const r=Xu(e);r.bc.postMessage(t),r.subs.forEach((e=>e(t,n)))},Ku=(e,t)=>{ms(e,0);const n=(e=>El(e,new pl))(t);xs(e,n)},Gu=(e,t,n)=>{ms(e,1),xs(e,((e,t)=>kl(e,t,new gl))(t,n))},Qu=(e,t,n)=>{try{((e,t,n)=>{vl(e,t,n,dl)})(t,qs(e),n)}catch(r){}},ed=Qu,td=(e,t,n,r)=>{const i=Fs(e);switch(i){case 0:((e,t,n)=>{Gu(t,n,qs(e))})(e,t,n);break;case 1:Qu(e,n,r);break;case 2:ed(e,n,r);break;default:throw new Error("Unknown message type")}return i},nd=3e4;class rd extends Wo{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval((()=>{const e=Ta();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach(((n,r)=>{r!==this.clientID&&nd<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)})),t.length>0&&id(this,t,"timeout")}),Bo(3e3)),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){const t=this.clientID,n=this.meta.get(t),r=void 0===n?0:n.clock+1,i=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:Ta()});const o=[],s=[],a=[],l=[];null===e?l.push(t):null==i?null!=e&&o.push(t):(s.push(t),ba(i,e)||a.push(t)),(o.length>0||a.length>0||l.length>0)&&this.emit("change",[{added:o,updated:a,removed:l},"local"]),this.emit("update",[{added:o,updated:s,removed:l},"local"])}setLocalStateField(e,t){const n=this.getLocalState();null!==n&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}}const id=(e,t,n)=>{const r=[];for(let i=0;i<t.length;i++){const n=t[i];if(e.states.has(n)){if(e.states.delete(n),n===e.clientID){const t=e.meta.get(n);e.meta.set(n,{clock:t.clock+1,lastUpdated:Ta()})}r.push(n)}}r.length>0&&(e.emit("change",[{added:[],updated:[],removed:r},n]),e.emit("update",[{added:[],updated:[],removed:r},n]))},od=(e,t,n=e.states)=>{const r=t.length,i=ds();ms(i,r);for(let o=0;o<r;o++){const r=t[o],s=n.get(r)||null,a=e.meta.get(r).clock;ms(i,r),ms(i,a),vs(i,JSON.stringify(s))}return fs(i)};var sd=n(88295);const ad=[];ad[0]=(e,t,n,r,i)=>{ms(e,0);const o=td(t,e,n.doc,n);r&&1===o&&!n.synced&&(n.synced=!0)},ad[3]=(e,t,n,r,i)=>{ms(e,1),xs(e,od(n.awareness,Array.from(n.awareness.getStates().keys())))},ad[1]=(e,t,n,r,i)=>{((e,t,n)=>{const r=Is(t),i=Ta(),o=[],s=[],a=[],l=[],c=Fs(r);for(let u=0;u<c;u++){const t=Fs(r);let n=Fs(r);const c=JSON.parse(Bs(r)),u=e.meta.get(t),d=e.states.get(t),h=void 0===u?0:u.clock;(h<n||h===n&&null===c&&e.states.has(t))&&(null===c?t===e.clientID&&null!=e.getLocalState()?n++:e.states.delete(t):e.states.set(t,c),e.meta.set(t,{clock:n,lastUpdated:i}),void 0===u&&null!==c?o.push(t):void 0!==u&&null===c?l.push(t):null!==c&&(ba(c,d)||a.push(t),s.push(t)))}(o.length>0||a.length>0||l.length>0)&&e.emit("change",[{added:o,updated:a,removed:l},n]),(o.length>0||s.length>0||l.length>0)&&e.emit("update",[{added:o,updated:s,removed:l},n])})(n.awareness,qs(t),n)},ad[2]=(e,t,n,r,i)=>{((e,t,n)=>{0===Fs(e)&&n(t,Bs(e))})(t,n.doc,((e,t)=>ld(n,t)))};const ld=(e,t)=>{},cd=(e,t,n)=>{const r=Is(t),i=ds(),o=Fs(r),s=e.messageHandlers[o];return s&&s(i,r,e,n,o),i},ud=e=>{if(e.shouldConnect&&null===e.ws){const 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=Ta();const r=cd(e,new Uint8Array(n.data),!0);hs(r)>1&&t.send(fs(r))},t.onerror=t=>{e.emit("connection-error",[t,e])},t.onclose=t=>{e.emit("connection-close",[t,e]),e.ws=null,e.wsconnecting=!1,e.wsconnected?(e.wsconnected=!1,e.synced=!1,id(e.awareness,Array.from(e.awareness.getStates().keys()).filter((t=>t!==e.doc.clientID)),e),e.emit("status",[{status:"disconnected"}])):e.wsUnsuccessfulReconnects++,setTimeout(ud,Zo(100*Xo(2,e.wsUnsuccessfulReconnects),e.maxBackoffTime),e)},t.onopen=()=>{e.wsLastMessageReceived=Ta(),e.wsconnecting=!1,e.wsconnected=!0,e.wsUnsuccessfulReconnects=0,e.emit("status",[{status:"connected"}]);const n=ds();if(ms(n,0),Ku(n,e.doc),t.send(fs(n)),null!==e.awareness.getLocalState()){const n=ds();ms(n,1),xs(n,od(e.awareness,[e.doc.clientID])),t.send(fs(n))}},e.emit("status",[{status:"connecting"}])}},dd=(e,t)=>{const n=e.ws;e.wsconnected&&n&&n.readyState===n.OPEN&&n.send(t),e.bcconnected&&Yu(e.bcChannel,t,e)};class hd extends Wo{constructor(e,t,n,{connect:r=!0,awareness:i=new rd(n),params:o={},protocols:s=[],WebSocketPolyfill:a=WebSocket,resyncInterval:l=-1,maxBackoffTime:c=2500,disableBc:u=!1}={}){for(super();"/"===e[e.length-1];)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+"/"+t,this.maxBackoffTime=c,this.params=o,this.protocols=s,this.roomname=t,this.doc=n,this._WS=a,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=u,this.wsUnsuccessfulReconnects=0,this.messageHandlers=ad.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){const e=ds();ms(e,0),Ku(e,n),this.ws.send(fs(e))}}),l)),this._bcSubscriber=(e,t)=>{if(t!==this){const t=cd(this,new Uint8Array(e),!1);hs(t)>1&&Yu(this.bcChannel,fs(t),this)}},this._updateHandler=(e,t)=>{if(t!==this){const t=ds();ms(t,0),((e,t)=>{ms(e,2),xs(e,t)})(t,e),dd(this,fs(t))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{const o=e.concat(t).concat(n),s=ds();ms(s,1),xs(s,od(i,o)),dd(this,fs(s))},this._exitHandler=()=>{id(this.awareness,[n.clientID],"app closed")},wa&&"undefined"!==typeof sd&&sd.on("exit",this._exitHandler),i.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval((()=>{this.wsconnected&&3e4<Ta()-this.wsLastMessageReceived&&this.ws.close()}),3e3),r&&this.connect()}get url(){const e=(e=>((e,t)=>{const n=[];for(const r in e)n.push(t(e[r],r));return n})(e,((e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&"))(this.params);return this.serverUrl+"/"+this.roomname+(0===e.length?"":"?"+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,this.emit("synced",[e]),this.emit("sync",[e]))}destroy(){0!==this._resyncInterval&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),wa&&"undefined"!==typeof sd&&sd.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||(((e,t)=>{Xu(e).subs.add(t)})(this.bcChannel,this._bcSubscriber),this.bcconnected=!0);const e=ds();ms(e,0),Ku(e,this.doc),Yu(this.bcChannel,fs(e),this);const t=ds();ms(t,0),Gu(t,this.doc),Yu(this.bcChannel,fs(t),this);const n=ds();ms(n,3),Yu(this.bcChannel,fs(n),this);const r=ds();ms(r,1),xs(r,od(this.awareness,[this.doc.clientID])),Yu(this.bcChannel,fs(r),this)}disconnectBc(){const e=ds();ms(e,1),xs(e,od(this.awareness,[this.doc.clientID],new Map)),dd(this,fs(e)),this.bcconnected&&(((e,t)=>{const n=Xu(e),r=n.subs.delete(t);r&&0===n.subs.size&&(n.bc.close(),Zu.delete(e))})(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),null!==this.ws&&this.ws.close()}connect(){this.shouldConnect=!0,this.wsconnected||null!==this.ws||(ud(this),this.connectBc())}}class fd{constructor(e,t,n){this.start=e,this.end=t,this.direction=n}}class pd{constructor(e,t,n=new Set,r=null){this.doc=e.doc,this.ytext=e,this.monacoModel=t,this.editors=n,this.mux=(()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else void 0!==n&&n()}})(),this._savedSelections=new Map,this._beforeTransaction=()=>{this.mux((()=>{this._savedSelections=new Map,n.forEach((n=>{if(n.getModel()===t){const r=((e,t,n)=>{const r=e.getSelection();if(null!==r){const e=r.getStartPosition(),i=r.getEndPosition(),o=Il(n,t.getOffsetAt(e)),s=Il(n,t.getOffsetAt(i));return new fd(o,s,r.getDirection())}return null})(n,t,e);null!==r&&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){const i=this._decorations.get(n)||[],o=[];r.getStates().forEach(((n,r)=>{if(r!==this.doc.clientID&&null!=n.selection&&null!=n.selection.anchor&&null!=n.selection.head){const i=Rl(n.selection.anchor,this.doc),s=Rl(n.selection.head,this.doc);if(null!==i&&null!==s&&i.type===e&&s.type===e){let e,n,a,l;i.index<s.index?(e=t.getPositionAt(i.index),n=t.getPositionAt(s.index),a="yRemoteSelectionHead yRemoteSelectionHead-"+r,l=null):(e=t.getPositionAt(s.index),n=t.getPositionAt(i.index),a=null,l="yRemoteSelectionHead yRemoteSelectionHead-"+r),o.push({range:new _e.Range(e.lineNumber,e.column,n.lineNumber,n.column),options:{className:"yRemoteSelection yRemoteSelection-"+r,afterContentClassName:a,beforeContentClassName:l}})}}})),this._decorations.set(n,n.deltaDecorations(i,o))}else this._decorations.delete(n)}))},this._ytextObserver=n=>{this.mux((()=>{let r=0;n.delta.forEach((e=>{if(void 0!==e.retain)r+=e.retain;else if(void 0!==e.insert){const n=t.getPositionAt(r),i=new _e.Selection(n.lineNumber,n.column,n.lineNumber,n.column),o=e.insert;t.applyEdits([{range:i,text:o}]),r+=o.length}else{if(void 0===e.delete)throw Ns();{const n=t.getPositionAt(r),i=t.getPositionAt(r+e.delete),o=new _e.Selection(n.lineNumber,n.column,i.lineNumber,i.column);t.applyEdits([{range:o,text:""}])}}})),this._savedSelections.forEach(((t,n)=>{const r=((e,t,n,r)=>{const i=Rl(n.start,r),o=Rl(n.end,r);if(null!==i&&null!==o&&i.type===t&&o.type===t){const t=e.getModel(),r=t.getPositionAt(i.index),s=t.getPositionAt(o.index);return _e.Selection.createWithDirection(r.lineNumber,r.column,s.lineNumber,s.column,n.direction)}return null})(n,e,t,this.doc);null!==r&&n.setSelection(r)}))})),this._rerenderDecorations()},e.observe(this._ytextObserver);{const 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){const i=n.getSelection();if(null===i)return;let o=t.getOffsetAt(i.getStartPosition()),s=t.getOffsetAt(i.getEndPosition());if(i.getDirection()===_e.SelectionDirection.RTL){const e=o;o=s,s=e}r.setLocalStateField("selection",{anchor:Il(e,o),head:Il(e,s)})}})),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)}}var gd=n(98845);var md=n(55835);const bd=({email:e,editorRef:t,setIsSpin:n,newEmailAiGeneratorRef:i})=>{const o=(0,r.useMemo)((()=>new cl),[]),s=(0,Co.fn)(),a=(0,r.useRef)([]),l=(0,r.useRef)([]),c=(0,r.useRef)(!1),u=(0,r.useRef)(0),d=(0,r.useRef)(""),[h,f]=(0,r.useState)(null),[p,g]=(0,r.useState)(null),[m,b]=(0,r.useState)(!1),[y,w]=(0,r.useState)([]),[v,k]=(0,r.useState)(!1),[x,_]=(0,r.useState)(!1),C=(0,Co.aD)(s),E=(0,de.d4)(ye.C1),{saveEmailFromEditor:S}=function(e,t){const[n]=(0,gd.LX)(),i=(0,r.useCallback)((()=>{const r=(new Date).toISOString().slice(0,19).replace("T"," "),i={parent:null===e||void 0===e?void 0:e.id,title:e.title,author:e.author,project:e.project,html:(null===t||void 0===t?void 0:t.getValue())||"",excerpt:r,subject:e.subject,preheader:e.preheader,common_styles:e.common_styles,parent_email:e.parent_email};n({emailId:null===e||void 0===e?void 0:e.id,body:i}).catch((e=>{}))}),[t,e]);return{saveEmailFromEditor:i}}(e,h),O=(0,r.useRef)(null),[A,$]=(0,r.useState)(!1),[M]=(0,gd.dN)(),L=null===e||void 0===e?void 0:e.id,j=!(L!==md.LA&&!Ce.EW.isPlugin),D=(0,r.useMemo)((()=>({name:{first_name:j?null===E||void 0===E?void 0:E.username:null===E||void 0===E?void 0:E.first_name,last_name:j?"":null===E||void 0===E?void 0:E.last_name,email:null===E||void 0===E?void 0:E.email},color:No()})),[E,j]),N=(0,r.useMemo)((()=>((e,t)=>e.filter((e=>e.user.color!==t.color)))(y,D)),[D,y]),T=(0,r.useCallback)((()=>{p&&(null===p||void 0===p||p.destroy(),g(null))}),[p]),z=(0,r.useCallback)((()=>{try{S()}catch(e){}}),[S]),P=(0,r.useCallback)((async e=>{try{const t={emailId:L,source:"editor",html:e};return await M(t).unwrap(),!0}catch(t){return!1}}),[L,M]),I=(0,r.useCallback)((async e=>{if(await P(e)&&A){const e=setTimeout((()=>{$(!1)}),0);return()=>clearTimeout(e)}}),[P,$,A]);(0,r.useEffect)((()=>{L&&Ce._P.isEditor&&(1===y.length&&u.current>1&&p&&z(),u.current=y.length)}),[y.length,p,z]),(0,r.useEffect)((()=>{if(!L||!Ce._P.isEditor||A)return;const e=j?`${L}-plugin`:`${L}-collaborate`,t=new hd(md.ZW,e,o);return g(t),t.awareness.setLocalStateField("user",D),()=>{null===t||void 0===t||t.destroy(),null===o||void 0===o||o.destroy()}}),[o,D,j,L,A]);const R=(0,r.useCallback)((e=>{if(!c.current){c.current=!0;try{const t=l.current,n=Array.from(e.getStates().values());(n.length>1||n.length!==t.length)&&(w(n),requestAnimationFrame((()=>{Do(n,h,a,m,b,D)}))),l.current=n}finally{c.current=!1}}}),[h,a,m,b,D]);if((0,r.useEffect)((()=>{if(!p||!h||!Ce._P.isEditor||!t.current||!h.getModel()||A)return;let e=null;const r=p.awareness,i=o.getText("monaco"),s=async o=>{const s=Array.from(r.getStates().values());if(o){if(i._length>0&&s.length>1&&!O.current){var a,l;const e=e=>e.replace(/\s+/g," ").trim();e((null===h||void 0===h||null===(a=h.getModel())||void 0===a||null===(l=a.getValue())||void 0===l?void 0:l.toString())||"")!==e(i.toString())&&(await async function(e,t){await new Promise((n=>{const r=()=>{var i,o,s;null===t||void 0===t||t(!0);((null===(i=e.current)||void 0===i||null===(o=i.getModel())||void 0===o||null===(s=o.getValue())||void 0===s?void 0:s.length)||0)>0?n():setTimeout(r,100)};r()}))}(t,n),null===n||void 0===n||n(!1),h.executeEdits("collaboration",[{range:h.getModel().getFullModelRange(),text:i.toString(),forceMoveMarkers:!0}]))}var c,u;if(i._length>0&&1===s.length&&!O.current)i.applyDelta([{delete:i._length},{insert:null===(c=t.current)||void 0===c?void 0:c.getModel().getValue()}]);if(0===i._length)i.insert(0,null===(u=t.current)||void 0===u?void 0:u.getModel().getValue());O.current&&i.applyDelta([{delete:i._length},{insert:O.current}]),e=new pd(i,null===h||void 0===h?void 0:h.getModel(),new Set([h]),r),null===h||void 0===h||h.onDidChangeCursorPosition((e=>((e,t)=>{t.setLocalStateField("cursor",e.position)})(e,r))),null===h||void 0===h||h.onDidChangeCursorSelection((e=>((e,t)=>{const n=e.selection;t.setLocalStateField("selection",{startLineNumber:n.startLineNumber,startColumn:n.startColumn,endLineNumber:n.endLineNumber,endColumn:n.endColumn})})(e,r))),r.on("change",(()=>R(r))),O.current=null}};return p.on("sync",s),()=>{e&&e.destroy(),p.off("sync",s)}}),[h,p,o,t,R,n,A]),(0,r.useEffect)((()=>{if(!p||!h||!Ce._P.isEditor||!t.current||A)return;const e=null===p||void 0===p?void 0:p.awareness,n=setInterval((()=>{R(e)}),md.pX);return()=>clearInterval(n)}),[p,h,m,t,v,R,T,A]),(0,r.useEffect)((()=>{if(!L||!Ce._P.isEditor)return;if(v)return;const e=(({CHECK_INTERVAL:e,SLEEP_THRESHOLD:t,provider:n,handleOfflineCollaboration:r,isNewEmailGeneration:i,saveEmailFromEditor:o})=>{let s=Date.now();return setInterval((()=>{const e=Date.now(),r=e-s;r>t&&n&&(o(),window.location.reload(),window.location.reload()),r<t&&!n&&document.visibilityState,s=e}),e)})({CHECK_INTERVAL:md.Pp,SLEEP_THRESHOLD:md.Q9,provider:p,handleOfflineCollaboration:T,isNewEmailGeneration:A,saveEmailFromEditor:S});return()=>{clearInterval(e)}}),[L,p,v,T,k,A]),h&&N.length>0){var U,q;const e=(null===h||void 0===h||null===(U=h.getModel())||void 0===U||null===(q=U.getValue())||void 0===q?void 0:q.toString())||"";d.current!==e&&"clear"in C&&C.clear(),d.current=e}const V=(()=>{const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=navigator.platform.toUpperCase().includes("MAC"),n=n=>{const r=(e?n.metaKey:n.ctrlKey)&&"KeyZ"===n.code,i=r&&n.shiftKey;(r||i)&&(t(!0),n.preventDefault())},r=()=>{t(!1)},i=e=>{var n;"application_action"===(null===(n=e.data)||void 0===n?void 0:n.operation)&&("undo"!==e.data.action&&"redo"!==e.data.action||(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})()&&N.length>0;return(0,r.useEffect)((()=>{if(!L||!Ce._P.isEditor)return;const e=setInterval((()=>{if(null!==i&&void 0!==i&&i.current&&!A&&(T(),$(!0)),(null===i||void 0===i||!i.current)&&A){const e=null===s||void 0===s?void 0:s.getValue();O.current=e,I(e)}}),300);return()=>clearInterval(e)}),[A,p,L,Ce._P.isEditor]),(0,r.useEffect)((()=>{if(!L||!Ce._P.isEditor)return;const e=()=>{"hidden"===document.visibilityState&&S()};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}}),[e,L,Ce._P.isEditor]),[h,N,f,v,V]};n(37507);var yd=n(40120),wd=n(56605),vd=n(5558),kd=n(12543);!function(){const e={editorWorkerService:"editor.worker.js",html:"html.worker.js",css:"css.worker.js",typescript:"ts.worker.js",json:"json.worker.js",javascript:"ts.worker.js",less:"css.worker.js",scss:"css.worker.js",handlebars:"html.worker.js",razor:"html.worker.js"};function t(e,t){/^(\/\/)/.test(e)&&(e=window.location.protocol+e);const n=new Blob(["/*"+t+'*/importScripts("'+e+'");'],{type:"application/javascript"});return URL.createObjectURL(n)}emailmakerMonacoEnvironment.getWorkerUrl=(r,i)=>{const o=n.p,s=(o?o.replace(/\/$/,"")+"/":"")+e[i];const a=new URL(s,window.location.origin),l=a.protocol;if("http:"===l||"https:"===l){if(a.protocol!==window.location.protocol||a.hostname!==window.location.hostname)return t(s,i);if("localhost"===a.hostname&&(a.port||"80")!==(window.location.port||"80"))return t(s,i)}else if("file:"===l)return t(s,i);return s}}(),(0,Co.Xb)(),_e.languages.html.htmlDefaults.options.format.wrapLineLength=0,W.config({monaco:_e}),function(e,t){const n=ge.dS.getEditorContributions().find((t=>t.id===e));if(!n)throw new Error(`No contribution ${e}`);n.ctor=t(n)}(be.ID,(()=>be)),function(e,t){void 0===e&&(e=window.monaco),void 0===t&&(t=["html"]),_o(e,t,"html")}(_e),function(e,t){void 0===e&&(e=window.monaco),void 0===t&&(t=["css"]),_o(e,t,"css")}(_e,["html"]);const{useToken:xd}=yd.A,_d=({email:e,readOnly:t,setOtherUsers:n,newEmailAiGeneratorRef:i})=>{const o=(0,Co.fn)();"html"!==o.getLanguageId()&&_e.editor.setModelLanguage(o,"html");const s=(0,So.ml)(Oo.AZ.ON_CODE_VALIDATE_ID),a=(0,fe.XW)(),l=(0,de.d4)(we.Up),c=(0,de.d4)(ve.Up),u=(0,de.d4)(we.VZ),d=null!==e&&void 0!==e&&e.hasOwnProperty("type")?c:l,h=(0,de.d4)(ye.hZ),f=(0,de.wA)(),p=(0,r.useRef)(null),g=(0,r.useRef)(null),m=(0,r.useRef)(null),b=(0,r.useRef)([]),y=(0,Eo.rD)(),w=(0,r.useCallback)((()=>{f((0,ye.ku)(!1))}),[f]),[v,k]=(0,r.useState)(!1),x=(0,vd.hN)(),{__:_}=(0,kd.s9)(),{token:C}=xd(),[,E,S,O,A]=bd({email:e,editorRef:g,setIsSpin:k,newEmailAiGeneratorRef:i});b.current=E,(0,r.useEffect)((()=>{t||n(b.current)}),[null===E||void 0===E?void 0:E.length,n,t]);const $=(0,r.useMemo)((()=>()=>{x.error({message:_(md.k0)})}),[_,x]),M=(0,r.useMemo)((()=>()=>{x.warning({message:_(md.LJ)})}),[_,x]);(0,r.useEffect)((()=>{O&&$()}),[O,$]),(0,r.useEffect)((()=>{A&&M()}),[A,M]),(0,r.useEffect)((()=>w()),[w]),(0,r.useEffect)((()=>{if(u){const{current:e}=p;e&&(e.revealRangeInCenterIfOutsideViewport(u),e.setSelection(u))}}),[u]);(0,r.useEffect)((()=>{matchMedia(Ce.F3).addEventListener("change",(t=>{const n=window.localStorage.getItem(Ce.V0.em_color_scheme),r=t.matches?Ce.nd:Ce.T;e.hasOwnProperty("type")?f(n?(0,ve.eX)(n===Ce.nd?`vs-${n}`:Ce.T):(0,ve.eX)(r===Ce.nd?`vs-${r}`:Ce.T)):f(n?(0,we.eX)(n===Ce.nd?`vs-${n}`:Ce.T):(0,we.eX)(r===Ce.nd?`vs-${r}`:Ce.T))}))}),[f,e]),(0,r.useEffect)((()=>{const t=window.localStorage.getItem(Ce.V0.em_color_scheme),n=matchMedia(Ce.F3).matches?Ce.nd:Ce.T;null!==e&&void 0!==e&&e.hasOwnProperty("type")?f(t?(0,ve.eX)(t===Ce.nd?`vs-${t}`:Ce.T):(0,ve.eX)(n===Ce.nd?`vs-${n}`:Ce.T)):f(t?(0,we.eX)(t===Ce.nd?`vs-${t}`:Ce.T):(0,we.eX)(n===Ce.nd?`vs-${n}`:Ce.T))}),[f,e]);(0,xe.A)((e=>{const t=e.data.operation,n=e.data;m.current=t,t===Ce.Ru.UPDATE_EDITOR_POSITION_FROM_IFRAME&&(e=>{const{current:t}=p;if(t&&!t.hasTextFocus()){const n=t.getModel(),r=n.getPositionAt(e.start),i=n.getPositionAt(e.end),o={startColumn:r.column,startLineNumber:r.lineNumber,endColumn:i.column,endLineNumber:i.lineNumber};t.revealRangeInCenterIfOutsideViewport(o),t.setSelection(o)}})(n.data)}));const L=(0,r.useMemo)((()=>document.createElement("div")),[]),j=(0,r.useMemo)((()=>({...h,domReadOnly:t,readOnly:t,unusualLineTerminators:"off",mouseWheelZoom:!0,wordWrap:y.onlyCodeModeInMobile?"off":h.wordWrap,ariaContainerElement:L})),[h,y.onlyCodeModeInMobile,t,L]);return(null===o||void 0===o?void 0:o.uri)&&r.createElement(r.Fragment,null,v&&r.createElement(wd.A,{wrap:!0,style:{position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:null===C||void 0===C?void 0:C.zIndexPopupBase,background:null===C||void 0===C?void 0:C.colorBgLayout}}),r.createElement(ue,{theme:d,className:"monaco-editor",defaultLanguage:"html",onMount:(e,t)=>{p.current=e,g.current=e;const n=e.getContribution("editor.linkDetector").openerService,r=n.open.bind(n),i=document.createElement("div"),o=new he.Ay(e,_e,{"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}});Ce._P.isEditor&&g.current&&S(g.current),o.watch(),e.getContribution("editor.linkDetector").openerService.open=e=>(i.innerHTML=e,r(i.textContent)),f((0,ye.ku)(!0)),e.onMouseUp((()=>{const t=e.getSelection();t.startColumn===t.endColumn&&t.startLineNumber===t.endLineNumber&&(async e=>{const{current:t}=p;if(t){const n=t.getModel();a({operation:Ce.Ru.UPDATE_EDITOR_POSITION_FROM_EDITOR,data:n.getOffsetAt(e)})}})(e.getPosition())})),e.onDidBlurEditorWidget((()=>{a({operation:Ce.Ru.EDITOR_CHANGE_FOCUS,data:!1}),f((0,ke.YT)(!1))})),e.onDidFocusEditorWidget((()=>{a({operation:Ce.Ru.EDITOR_CHANGE_FOCUS,data:!0}),f((0,ke.YT)(!0))}))},options:j,keepCurrentModel:!0,path:o.uri.toString(),onValidate:function(e){var t;"Doctype must be declared first."!==(null===(t=e[0])||void 0===t?void 0:t.message)&&(Ce.EW.isPlugin&&s.fire(e),f((0,we.Bj)(e)))}}))}}}]);