@feathery/react 2.37.4 → 2.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/Form/index.d.ts.map +1 -1
- package/cjs/assistant/AssistantChat.d.ts +31 -0
- package/cjs/assistant/AssistantChat.d.ts.map +1 -0
- package/cjs/assistant/AssistantClient.d.ts +15 -0
- package/cjs/assistant/AssistantClient.d.ts.map +1 -0
- package/cjs/assistant/MarkdownText.d.ts +2 -1
- package/cjs/assistant/MarkdownText.d.ts.map +1 -1
- package/cjs/assistant/ToolStatus.d.ts +20 -3
- package/cjs/assistant/ToolStatus.d.ts.map +1 -1
- package/cjs/assistant/colors.d.ts +1 -0
- package/cjs/assistant/colors.d.ts.map +1 -1
- package/cjs/assistant/icons.d.ts +8 -0
- package/cjs/assistant/icons.d.ts.map +1 -1
- package/cjs/assistant/index.d.ts +3 -15
- package/cjs/assistant/index.d.ts.map +1 -1
- package/cjs/assistant/tools/clickElement.d.ts +16 -0
- package/cjs/assistant/tools/clickElement.d.ts.map +1 -0
- package/cjs/assistant/tools/panelRuntime.d.ts +91 -0
- package/cjs/assistant/tools/panelRuntime.d.ts.map +1 -0
- package/cjs/assistant/tools/setFieldValue.d.ts +32 -0
- package/cjs/assistant/tools/setFieldValue.d.ts.map +1 -0
- package/cjs/assistant/utils.d.ts +11 -5
- package/cjs/assistant/utils.d.ts.map +1 -1
- package/cjs/elements/basic/ImageElement.d.ts.map +1 -1
- package/cjs/elements/fields/index.d.ts +28 -23
- package/cjs/elements/fields/index.d.ts.map +1 -1
- package/cjs/elements/index.d.ts +66 -22
- package/cjs/elements/index.d.ts.map +1 -1
- package/cjs/fthry_AssistantChat.L8QqDrZ9.js +53283 -0
- package/cjs/{fthry_FormControl.BCawW2JY.js → fthry_FormControl.B6IeQ4Ds.js} +1 -1
- package/cjs/{fthry_InlineTooltip.DXAGdsG6.js → fthry_InlineTooltip.CHwGV2ye.js} +2 -2
- package/cjs/{fthry_Overlay.Dxddifgf.js → fthry_Overlay.BApTL35K.js} +1 -1
- package/cjs/{fthry_PaymentMethodField.BBn_I5Y-.js → fthry_PaymentMethodField.B4dRDX90.js} +4 -4
- package/cjs/{fthry_Placeholder.DgCge_qQ.js → fthry_Placeholder.DWR5nO5t.js} +1 -1
- package/cjs/{fthry_ShowEyeIcon.6chMT9tB.js → fthry_ShowEyeIcon.CrWpuKPG.js} +1 -1
- package/cjs/fthry_clsx.BtxeOLZW.js +5 -0
- package/cjs/fthry_highlighted-body-TPN3WLV5.CIRngtHJ.js +15 -0
- package/cjs/{fthry_index.DxstWM8L.js → fthry_index.7DwrYriA.js} +8 -8
- package/cjs/{fthry_index.DSS9EjkL.js → fthry_index.B9CMlFfK.js} +2 -2
- package/cjs/{fthry_index.b2DipouN.js → fthry_index.BBz67wEv.js} +5 -5
- package/cjs/{fthry_index.Co7zM36I.js → fthry_index.BEpOYeuD.js} +4 -4
- package/cjs/{fthry_index.D_1t-ApQ.js → fthry_index.BVr4Lcyo.js} +4 -105
- package/cjs/{fthry_index.WYWtukPG.js → fthry_index.Bde3s5tl.js} +5 -5
- package/cjs/{fthry_index.BrcBLxiN.js → fthry_index.Bq4ONiuv.js} +1 -1
- package/cjs/{fthry_index.CWvKP0U9.js → fthry_index.BwxSWwJZ.js} +3 -3
- package/cjs/{fthry_index.BCakShY6.js → fthry_index.BxTMSKYR.js} +6 -6
- package/cjs/{fthry_index.D-6wkDz2.js → fthry_index.C7zyqnbf.js} +5 -5
- package/cjs/{fthry_index.B2WATisk.js → fthry_index.CLqeg1q-.js} +5 -5
- package/cjs/{fthry_index.1G5WWnt8.js → fthry_index.Ca9y1U8W.js} +1 -1
- package/cjs/{fthry_index.Dsv-TeBu.js → fthry_index.CaQDsoPD.js} +670 -52197
- package/cjs/{fthry_index.C2MePzk3.js → fthry_index.CznkErSr.js} +24 -23
- package/cjs/{fthry_index.DzI22-a-.js → fthry_index.D7IlFInQ.js} +2 -2
- package/cjs/{fthry_index.Bg8trysI.js → fthry_index.DKe_zH6q.js} +1 -1
- package/cjs/{fthry_index.DAqPVi5Z.js → fthry_index.DYCg5RsQ.js} +3 -3
- package/cjs/{fthry_index.Y_UP_4ct.js → fthry_index.Dl1GeWM6.js} +4 -4
- package/cjs/{fthry_index.dFaOUdRp.js → fthry_index.Dly0rruo.js} +1 -1
- package/cjs/{fthry_index.DFi7wHj1.js → fthry_index.IxpG538L.js} +1 -1
- package/cjs/{fthry_index.4_yQ3xcB.js → fthry_index.TVlALn4r.js} +1 -1
- package/cjs/fthry_index.YyKms2Ty.js +109 -0
- package/cjs/{fthry_index.BvCKY-AY.js → fthry_index.fFWtGd8u.js} +1 -1
- package/cjs/{fthry_index.BCDEI_8h.js → fthry_index.qxBbMcVu.js} +6 -6
- package/cjs/{fthry_index.DclxO6k2.js → fthry_index.xHwcINEA.js} +1 -1
- package/cjs/{fthry_input.WfgR8fOH.js → fthry_input.C-RhGr8Z.js} +1 -1
- package/cjs/fthry_mermaid-O7DHMXV3.B40IiwEd.js +15 -0
- package/cjs/{fthry_script.B921m9AF.js → fthry_script.BUzm9HxD.js} +1 -1
- package/cjs/{fthry_styles.DyHc8mjo.js → fthry_styles.BD-5zYX4.js} +1 -1
- package/cjs/{fthry_useElementSize.Bx50W_pE.js → fthry_useElementSize.7Vh9Fjsi.js} +1 -1
- package/cjs/{fthry_useSalesforceSync.CCCfBjU1.js → fthry_useSalesforceSync.BYr2Zkyy.js} +1 -1
- package/cjs/{fthry_webfontloader.DxmcEISV.js → fthry_webfontloader.B3eO9SnD.js} +1 -1
- package/cjs/index.d.ts +67 -23
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +1 -1
- package/cjs/utils/internalState.d.ts +4 -0
- package/cjs/utils/internalState.d.ts.map +1 -1
- package/dist/Form/index.d.ts.map +1 -1
- package/dist/assistant/AssistantChat.d.ts +31 -0
- package/dist/assistant/AssistantChat.d.ts.map +1 -0
- package/dist/assistant/AssistantClient.d.ts +15 -0
- package/dist/assistant/AssistantClient.d.ts.map +1 -0
- package/dist/assistant/MarkdownText.d.ts +2 -1
- package/dist/assistant/MarkdownText.d.ts.map +1 -1
- package/dist/assistant/ToolStatus.d.ts +20 -3
- package/dist/assistant/ToolStatus.d.ts.map +1 -1
- package/dist/assistant/colors.d.ts +1 -0
- package/dist/assistant/colors.d.ts.map +1 -1
- package/dist/assistant/icons.d.ts +8 -0
- package/dist/assistant/icons.d.ts.map +1 -1
- package/dist/assistant/index.d.ts +3 -15
- package/dist/assistant/index.d.ts.map +1 -1
- package/dist/assistant/tools/clickElement.d.ts +16 -0
- package/dist/assistant/tools/clickElement.d.ts.map +1 -0
- package/dist/assistant/tools/panelRuntime.d.ts +91 -0
- package/dist/assistant/tools/panelRuntime.d.ts.map +1 -0
- package/dist/assistant/tools/setFieldValue.d.ts +32 -0
- package/dist/assistant/tools/setFieldValue.d.ts.map +1 -0
- package/dist/assistant/utils.d.ts +11 -5
- package/dist/assistant/utils.d.ts.map +1 -1
- package/dist/elements/basic/ImageElement.d.ts.map +1 -1
- package/dist/elements/fields/index.d.ts +28 -23
- package/dist/elements/fields/index.d.ts.map +1 -1
- package/dist/elements/index.d.ts +66 -22
- package/dist/elements/index.d.ts.map +1 -1
- package/dist/fthry_AssistantChat.B4O7bQrp.js +53277 -0
- package/dist/{fthry_FormControl.76_0PuFC.js → fthry_FormControl.BEWaNHn3.js} +1 -1
- package/dist/{fthry_InlineTooltip.d3TjV-eF.js → fthry_InlineTooltip.CP92bAZA.js} +2 -2
- package/dist/{fthry_Overlay.C9ZwYfq9.js → fthry_Overlay.D_UvdjmJ.js} +1 -1
- package/dist/{fthry_PaymentMethodField.CA0KyKcm.js → fthry_PaymentMethodField.BiBx9LjH.js} +4 -4
- package/dist/{fthry_Placeholder.3BQCtk4i.js → fthry_Placeholder.CsY-scXc.js} +1 -1
- package/dist/{fthry_ShowEyeIcon.Bqj7gJGW.js → fthry_ShowEyeIcon.CN_11GCA.js} +1 -1
- package/dist/fthry_clsx.ChV9xqsO.js +3 -0
- package/dist/{fthry_highlighted-body-TPN3WLV5.uNKEZjAy.js → fthry_highlighted-body-TPN3WLV5.B91Jtsra.js} +4 -1
- package/dist/fthry_index.BFwgxX3L.js +107 -0
- package/dist/{fthry_index.C_22SPRt.js → fthry_index.BK2Hnx9K.js} +1 -1
- package/dist/{fthry_index.CET1YvDN.js → fthry_index.BXAOPQ-N.js} +5 -5
- package/dist/{fthry_index.ChBrRALN.js → fthry_index.BYoImnvU.js} +1 -1
- package/dist/{fthry_index.aJzVeSoS.js → fthry_index.BitwCfs0.js} +1 -1
- package/dist/{fthry_index.CpjiI4uf.js → fthry_index.BqX45OG8.js} +3 -3
- package/dist/{fthry_index.Brftvfe7.js → fthry_index.BwsOm7hb.js} +5 -5
- package/dist/{fthry_index.BlrxJyUS.js → fthry_index.CCXpngi5.js} +5 -5
- package/dist/{fthry_index.BvdLAZLu.js → fthry_index.CNjt1dpv.js} +1 -1
- package/dist/{fthry_index.Cbk-4lUW.js → fthry_index.CRbJuR5X.js} +7 -6
- package/dist/{fthry_index.BCWRiQGq.js → fthry_index.CUa6fIIV.js} +8 -8
- package/dist/{fthry_index.BmcdgXn3.js → fthry_index.D5kSN9-t.js} +2 -105
- package/dist/{fthry_index.DIIgA2I2.js → fthry_index.DHr6yAT3.js} +6 -6
- package/dist/{fthry_index.20OBT_43.js → fthry_index.DJwLQi_x.js} +1 -1
- package/dist/{fthry_index.g8KGIqrC.js → fthry_index.DTkLn4V9.js} +3 -3
- package/dist/{fthry_index.BvSqC2z2.js → fthry_index.DUEiyRBT.js} +4 -4
- package/dist/{fthry_index.Bbxtbp4a.js → fthry_index.DgVE4qW7.js} +673 -52202
- package/dist/{fthry_index.Dh3vrOA4.js → fthry_index.DtBZRH06.js} +5 -5
- package/dist/{fthry_index.CGjEfzIL.js → fthry_index.OjuYAGjs.js} +1 -1
- package/dist/{fthry_index.Dn8hTYS2.js → fthry_index.W8pRYyDi.js} +6 -6
- package/dist/{fthry_index.B2J5J4jS.js → fthry_index.ebPmN15E.js} +4 -4
- package/dist/{fthry_index.-pimdPng.js → fthry_index.k6djaqmS.js} +2 -2
- package/dist/{fthry_index.54Em8Q1w.js → fthry_index.slanwBPP.js} +1 -1
- package/dist/{fthry_index.DhichOKe.js → fthry_index.tw8xNWZc.js} +2 -2
- package/dist/{fthry_index.x1TUK-im.js → fthry_index.w7Nx6zNo.js} +1 -1
- package/dist/{fthry_input.Dj1IMwey.js → fthry_input.D94H5xWk.js} +1 -1
- package/dist/fthry_mermaid-O7DHMXV3.D_D0ytjk.js +9 -0
- package/dist/{fthry_script.BmwMDCAZ.js → fthry_script.C4MOLOaj.js} +1 -1
- package/dist/{fthry_styles.B6qGnHJ1.js → fthry_styles.BQL5_8xd.js} +1 -1
- package/dist/{fthry_useElementSize.BppSuCUN.js → fthry_useElementSize.C7pCjEY0.js} +1 -1
- package/dist/{fthry_useSalesforceSync.D0nLeVuk.js → fthry_useSalesforceSync.Bj6SvTIc.js} +1 -1
- package/dist/{fthry_webfontloader.D5C7-qaj.js → fthry_webfontloader.CT2fb2Df.js} +1 -1
- package/dist/index.d.ts +67 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/internalState.d.ts +4 -0
- package/dist/utils/internalState.d.ts.map +1 -1
- package/package.json +2 -2
- package/umd/542.f1dbbbb062e82a2995e9.js +1 -0
- package/umd/602.1fde434923c6596acd40.js +1 -0
- package/umd/{AddressField.2d777eda22a67a0ed3a3.js → AddressField.c4188872f2a931394aa1.js} +1 -1
- package/umd/AssistantChat.2f8dbf760e2412585af9.js +1 -0
- package/umd/DropdownField.36bb515df8083884f0f3.js +1 -0
- package/umd/{DropdownMultiField.c8c926000cbed5ee771a.js → DropdownMultiField.72a44c0280217eeb5652.js} +1 -1
- package/umd/{PhoneField.6b9ad2d0d9387ef78a1f.js → PhoneField.8183bed71fa92767aa3a.js} +1 -1
- package/umd/{TextField.f5cc4a03e69d5872027b.js → TextField.28c59425e129e78a4551.js} +1 -1
- package/umd/index.js +1 -1
- package/cjs/fthry_highlighted-body-TPN3WLV5.DkI91-Zy.js +0 -12
- package/cjs/fthry_mermaid-O7DHMXV3.v4t8IYSq.js +0 -12
- package/dist/fthry_mermaid-O7DHMXV3.C5f8Q-rK.js +0 -6
- package/umd/DropdownField.1d440e016d425637032d.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(this.webpackChunkFeathery=this.webpackChunkFeathery||[]).push([[602],{4470:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,s=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!s&&!i)return!1;for(r in e);return void 0===r||t.call(e,r)},o=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(s)return s(e,n).value}return e[n]};e.exports=function e(){var t,n,r,s,c,u,d=arguments[0],p=1,h=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<h;++p)if(null!=(t=arguments[p]))for(n in t)r=l(d,n),d!==(s=l(t,n))&&(f&&s&&(a(s)||(c=i(s)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&a(r)?r:{},o(d,{name:n,newValue:e(f,u,s)})):void 0!==s&&o(d,{name:n,newValue:s}));return d}},5321:e=>{"use strict";var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,p=1;function h(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function f(){var e={line:d,column:p};return function(t){return t.position=new m(e),y(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=l.source}function g(t){var n=new Error(l.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=p,n.source=e,!l.silent)throw n}function E(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function y(){E(r)}function _(e){var t;for(e=e||[];t=T();)!1!==t&&e.push(t);return e}function T(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return p+=2,h(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function b(){var e=f(),n=E(s);if(n){if(T(),!E(i))return g("property missing ':'");var r=E(a),l=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return E(o),l}}return m.prototype.content=e,y(),function(){var e,t=[];for(_(t);e=b();)!1!==e&&(t.push(e),_(t));return t}()}},1476:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(5174)),s=n(6678);function i(e,t){var n={};return e&&"string"==typeof e?((0,r.default)(e,(function(e,r){e&&r&&(n[(0,s.camelCase)(e,t)]=r)})),n):n}i.default=i,e.exports=i},6678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||s.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(a,l):e.replace(i,l)).replace(r,o))}},5174:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;const r=(0,s.default)(e),i="function"==typeof t;return r.forEach((e=>{if("declaration"!==e.type)return;const{property:r,value:s}=e;i?t(r,s,e):s&&(n=n||{},n[r]=s)})),n};const s=r(n(5321))},9623:e=>{e.exports=function(e,t){if("function"!=typeof e)throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...s){clearTimeout(n);const i=Date.now(),a=t-(i-r);a<=0?(r=i,e.apply(this,s)):n=setTimeout((()=>{r=Date.now(),e.apply(this,s)}),a)}}},4790:(e,t,n)=>{"use strict";n.d(t,{RJ:()=>b,en:()=>T});var r,s,i,a,o,l,c,u,d,p,h=n(7294),f=n(4438),m=n(9623),g=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},E=(e,t,n)=>(g(e,t,"read from private field"),n?n.call(e):t.get(e)),y=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},_=(e,t,n,r)=>(g(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);r=new WeakMap,s=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap;var T=class extends f.Pu{constructor({messages:e,...t}){const n=new class{constructor(e=[]){y(this,r,void 0),y(this,s,"ready"),y(this,i,void 0),y(this,a,new Set),y(this,o,new Set),y(this,l,new Set),this.pushMessage=e=>{_(this,r,E(this,r).concat(e)),E(this,c).call(this)},this.popMessage=()=>{_(this,r,E(this,r).slice(0,-1)),E(this,c).call(this)},this.replaceMessage=(e,t)=>{_(this,r,[...E(this,r).slice(0,e),this.snapshot(t),...E(this,r).slice(e+1)]),E(this,c).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,t)=>{const n=t?(r=e,null!=(s=t)?m(r,s):r):e;var r,s;return E(this,a).add(n),()=>{E(this,a).delete(n)}},this["~registerStatusCallback"]=e=>(E(this,o).add(e),()=>{E(this,o).delete(e)}),this["~registerErrorCallback"]=e=>(E(this,l).add(e),()=>{E(this,l).delete(e)}),y(this,c,(()=>{E(this,a).forEach((e=>e()))})),y(this,u,(()=>{E(this,o).forEach((e=>e()))})),y(this,d,(()=>{E(this,l).forEach((e=>e()))})),_(this,r,e)}get status(){return E(this,s)}set status(e){_(this,s,e),E(this,u).call(this)}get error(){return E(this,i)}set error(e){_(this,i,e),E(this,d).call(this)}get messages(){return E(this,r)}set messages(e){_(this,r,[...e]),E(this,c).call(this)}}(e);super({...t,state:n}),y(this,p,void 0),this["~registerMessagesCallback"]=(e,t)=>E(this,p)["~registerMessagesCallback"](e,t),this["~registerStatusCallback"]=e=>E(this,p)["~registerStatusCallback"](e),this["~registerErrorCallback"]=e=>E(this,p)["~registerErrorCallback"](e),_(this,p,n)}};function b({experimental_throttle:e,resume:t=!1,...n}={}){const r=(0,h.useRef)("chat"in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});"chat"in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});const s={...n,onToolCall:e=>{var t,n;return null==(n=(t=r.current).onToolCall)?void 0:n.call(t,e)},onData:e=>{var t,n;return null==(n=(t=r.current).onData)?void 0:n.call(t,e)},onFinish:e=>{var t,n;return null==(n=(t=r.current).onFinish)?void 0:n.call(t,e)},onError:e=>{var t,n;return null==(n=(t=r.current).onError)?void 0:n.call(t,e)},sendAutomaticallyWhen:e=>{var t,n,s;return null!=(s=null==(n=(t=r.current).sendAutomaticallyWhen)?void 0:n.call(t,e))&&s}},i=(0,h.useRef)("chat"in n?n.chat:new T(s));("chat"in n&&n.chat!==i.current||"id"in n&&i.current.id!==n.id)&&(i.current="chat"in n?n.chat:new T(s));const a=(0,h.useCallback)((t=>i.current["~registerMessagesCallback"](t,e)),[e,i.current.id]),o=(0,h.useSyncExternalStore)(a,(()=>i.current.messages),(()=>i.current.messages)),l=(0,h.useSyncExternalStore)(i.current["~registerStatusCallback"],(()=>i.current.status),(()=>i.current.status)),c=(0,h.useSyncExternalStore)(i.current["~registerErrorCallback"],(()=>i.current.error),(()=>i.current.error)),u=(0,h.useCallback)((e=>{"function"==typeof e&&(e=e(i.current.messages)),i.current.messages=e}),[i]);return(0,h.useEffect)((()=>{t&&i.current.resumeStream()}),[t,i]),{id:i.current.id,messages:o,setMessages:u,sendMessage:i.current.sendMessage,regenerate:i.current.regenerate,clearError:i.current.clearError,stop:i.current.stop,error:c,resumeStream:i.current.resumeStream,status:l,addToolResult:i.current.addToolOutput,addToolOutput:i.current.addToolOutput,addToolApprovalResponse:i.current.addToolApprovalResponse}}p=new WeakMap},4438:(e,t,n)=>{"use strict";n.d(t,{Pu:()=>qp,PD:()=>Yp,Qk:()=>Wp});var r={};n.r(r),n.d(r,{base64:()=>_t,base64url:()=>Tt,bigint:()=>Ct,boolean:()=>Dt,browserEmail:()=>pt,cidrv4:()=>Et,cidrv6:()=>yt,cuid:()=>qe,cuid2:()=>We,date:()=>xt,datetime:()=>Nt,domain:()=>kt,duration:()=>et,e164:()=>vt,email:()=>ot,emoji:()=>ht,extendedDuration:()=>tt,guid:()=>nt,hex:()=>zt,hostname:()=>bt,html5Email:()=>lt,idnEmail:()=>dt,integer:()=>Ot,ipv4:()=>ft,ipv6:()=>mt,ksuid:()=>Je,lowercase:()=>Mt,mac:()=>gt,md5_base64:()=>jt,md5_base64url:()=>$t,md5_hex:()=>Ht,nanoid:()=>Xe,null:()=>Lt,number:()=>Rt,rfc5322Email:()=>ct,sha1_base64:()=>Gt,sha1_base64url:()=>Vt,sha1_hex:()=>Zt,sha256_base64:()=>qt,sha256_base64url:()=>Wt,sha256_hex:()=>Yt,sha384_base64:()=>Qt,sha384_base64url:()=>Jt,sha384_hex:()=>Kt,sha512_base64:()=>en,sha512_base64url:()=>tn,sha512_hex:()=>Xt,string:()=>wt,time:()=>St,ulid:()=>Ke,undefined:()=>Pt,unicodeEmail:()=>ut,uppercase:()=>Ft,uuid:()=>rt,uuid4:()=>st,uuid6:()=>it,uuid7:()=>at,xid:()=>Qe});var s={};n.r(s),n.d(s,{endsWith:()=>si,gt:()=>Us,gte:()=>Hs,includes:()=>ni,length:()=>Js,lowercase:()=>ei,lt:()=>zs,lte:()=>Bs,maxLength:()=>Ks,maxSize:()=>Ys,mime:()=>ai,minLength:()=>Qs,minSize:()=>qs,multipleOf:()=>Vs,negative:()=>$s,nonnegative:()=>Gs,nonpositive:()=>Zs,normalize:()=>li,overwrite:()=>oi,positive:()=>js,property:()=>ii,regex:()=>Xs,size:()=>Ws,slugify:()=>pi,startsWith:()=>ri,toLowerCase:()=>ui,toUpperCase:()=>di,trim:()=>ci,uppercase:()=>ti});var i={};n.r(i),n.d(i,{ZodISODate:()=>oa,ZodISODateTime:()=>ia,ZodISODuration:()=>da,ZodISOTime:()=>ca,date:()=>la,datetime:()=>aa,duration:()=>pa,time:()=>ua});var a={};n.r(a),n.d(a,{ZodAny:()=>Wo,ZodArray:()=>il,ZodBase64:()=>mo,ZodBase64URL:()=>Eo,ZodBigInt:()=>zo,ZodBigIntFormat:()=>Uo,ZodBoolean:()=>Mo,ZodCIDRv4:()=>uo,ZodCIDRv6:()=>ho,ZodCUID:()=>qa,ZodCUID2:()=>Ka,ZodCatch:()=>ec,ZodCodec:()=>ac,ZodCustom:()=>yc,ZodCustomStringFormat:()=>vo,ZodDate:()=>rl,ZodDefault:()=>Vl,ZodDiscriminatedUnion:()=>gl,ZodE164:()=>_o,ZodEmail:()=>Ra,ZodEmoji:()=>Za,ZodEnum:()=>Cl,ZodExactOptional:()=>Hl,ZodFile:()=>Pl,ZodFunction:()=>gc,ZodGUID:()=>La,ZodIPv4:()=>so,ZodIPv6:()=>lo,ZodIntersection:()=>yl,ZodJWT:()=>bo,ZodKSUID:()=>no,ZodLazy:()=>pc,ZodLiteral:()=>Dl,ZodMAC:()=>ao,ZodMap:()=>Il,ZodNaN:()=>nc,ZodNanoID:()=>Va,ZodNever:()=>Xo,ZodNonOptional:()=>Kl,ZodNull:()=>Yo,ZodNullable:()=>$l,ZodNumber:()=>No,ZodNumberFormat:()=>Co,ZodObject:()=>ll,ZodOptional:()=>Bl,ZodPipe:()=>sc,ZodPrefault:()=>ql,ZodPromise:()=>fc,ZodReadonly:()=>lc,ZodRecord:()=>kl,ZodSet:()=>Nl,ZodString:()=>wa,ZodStringFormat:()=>Oa,ZodSuccess:()=>Jl,ZodSymbol:()=>$o,ZodTemplateLiteral:()=>uc,ZodTransform:()=>Fl,ZodTuple:()=>Tl,ZodType:()=>Sa,ZodULID:()=>Ja,ZodURL:()=>Ha,ZodUUID:()=>Ma,ZodUndefined:()=>Go,ZodUnion:()=>pl,ZodUnknown:()=>Qo,ZodVoid:()=>tl,ZodXID:()=>eo,ZodXor:()=>fl,_ZodString:()=>Na,_default:()=>Yl,_function:()=>Ec,any:()=>Ko,array:()=>al,base64:()=>go,base64url:()=>yo,bigint:()=>Bo,boolean:()=>Fo,catch:()=>tc,check:()=>_c,cidrv4:()=>po,cidrv6:()=>fo,codec:()=>oc,cuid:()=>Wa,cuid2:()=>Qa,custom:()=>Tc,date:()=>sl,describe:()=>vc,discriminatedUnion:()=>El,e164:()=>To,email:()=>Da,emoji:()=>Ga,enum:()=>Ol,exactOptional:()=>jl,file:()=>Ml,float32:()=>Ro,float64:()=>Do,function:()=>Ec,guid:()=>Pa,hash:()=>So,hex:()=>Io,hostname:()=>xo,httpUrl:()=>$a,instanceof:()=>xc,int:()=>Oo,int32:()=>Lo,int64:()=>Ho,intersection:()=>_l,ipv4:()=>io,ipv6:()=>co,json:()=>Sc,jwt:()=>ko,keyof:()=>ol,ksuid:()=>ro,lazy:()=>hc,literal:()=>Ll,looseObject:()=>dl,looseRecord:()=>xl,mac:()=>oo,map:()=>Sl,meta:()=>Ac,nan:()=>rc,nanoid:()=>Ya,nativeEnum:()=>Rl,never:()=>el,nonoptional:()=>Ql,null:()=>qo,nullable:()=>Zl,nullish:()=>Gl,number:()=>wo,object:()=>cl,optional:()=>Ul,partialRecord:()=>Al,pipe:()=>ic,prefault:()=>Wl,preprocess:()=>Nc,promise:()=>mc,readonly:()=>cc,record:()=>vl,refine:()=>bc,set:()=>wl,strictObject:()=>ul,string:()=>Ca,stringFormat:()=>Ao,stringbool:()=>Ic,success:()=>Xl,superRefine:()=>kc,symbol:()=>Zo,templateLiteral:()=>dc,transform:()=>zl,tuple:()=>bl,uint32:()=>Po,uint64:()=>jo,ulid:()=>Xa,undefined:()=>Vo,union:()=>hl,unknown:()=>Jo,url:()=>ja,uuid:()=>Fa,uuidv4:()=>za,uuidv6:()=>Ba,uuidv7:()=>Ua,void:()=>nl,xid:()=>to,xor:()=>ml});var o,l,c="vercel.ai.error",u=Symbol.for(c),d=class e extends(l=Error,o=u,l){constructor({name:e,message:t,cause:n}){super(t),this[o]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,c)}static hasMarker(e,t){const n=Symbol.for(t);return null!=e&&"object"==typeof e&&n in e&&"boolean"==typeof e[n]&&!0===e[n]}},p=Symbol.for("vercel.ai.error.AI_APICallError"),h=`vercel.ai.error.${d,p,"AI_EmptyResponseBodyError"}`,f=Symbol.for(h);function m(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var g,E,y,_,T,b,k="AI_InvalidArgumentError",v=`vercel.ai.error.${k}`,A=Symbol.for(v),x=class extends(E=d,g=A,E){constructor({message:e,cause:t,argument:n}){super({name:k,message:e,cause:t}),this[g]=!0,this.argument=n}static isInstance(e){return d.hasMarker(e,v)}},I=Symbol.for("vercel.ai.error.AI_InvalidPromptError"),S=`vercel.ai.error.${d,I,"AI_InvalidResponseDataError"}`,N=Symbol.for(S),w=(d,N,"AI_JSONParseError"),C=`vercel.ai.error.${w}`,O=Symbol.for(C),R=class extends(_=d,y=O,_){constructor({text:e,cause:t}){super({name:w,message:`JSON parsing failed: Text: ${e}.\nError message: ${m(t)}`,cause:t}),this[y]=!0,this.text=e}static isInstance(e){return d.hasMarker(e,C)}},D=Symbol.for("vercel.ai.error.AI_LoadAPIKeyError"),L=`vercel.ai.error.${d,D,"AI_LoadSettingError"}`,P=Symbol.for(L),M=`vercel.ai.error.${d,P,"AI_NoContentGeneratedError"}`,F=Symbol.for(M),z=`vercel.ai.error.${d,F,"AI_NoSuchModelError"}`,B=Symbol.for(z),U=`vercel.ai.error.${d,B,"AI_TooManyEmbeddingValuesForCallError"}`,H=Symbol.for(U),j=(d,H,"AI_TypeValidationError"),$=`vercel.ai.error.${j}`,Z=Symbol.for($),G=class e extends(b=d,T=Z,b){constructor({value:e,cause:t,context:n}){let r="Type validation failed";if((null==n?void 0:n.field)&&(r+=` for ${n.field}`),(null==n?void 0:n.entityName)||(null==n?void 0:n.entityId)){r+=" (";const e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(", "),r+=")"}super({name:j,message:`${r}: Value: ${JSON.stringify(e)}.\nError message: ${m(t)}`,cause:t}),this[T]=!0,this.value=e,this.context=n}static isInstance(e){return d.hasMarker(e,$)}static wrap({value:t,cause:n,context:r}){var s,i,a;return e.isInstance(n)&&n.value===t&&(null==(s=n.context)?void 0:s.field)===(null==r?void 0:r.field)&&(null==(i=n.context)?void 0:i.entityName)===(null==r?void 0:r.entityName)&&(null==(a=n.context)?void 0:a.entityId)===(null==r?void 0:r.entityId)?n:new e({value:t,cause:n,context:r})}},V=Symbol.for("vercel.ai.error.AI_UnsupportedFunctionalityError");function Y(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:a,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const s=a.prototype,i=Object.keys(s);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=s[t].bind(n))}}const s=n?.Parent??Object;class i extends s{}function a(e){var t;const s=n?.Parent?new i:this;r(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}Object.freeze({status:"aborted"}),Symbol("zod_brand");class q extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class W extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const K={};function Q(e){return e&&Object.assign(K,e),K}function J(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}function X(e,t="|"){return e.map((e=>_e(e))).join(t)}function ee(e,t){return"bigint"==typeof t?t.toString():t}function te(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ne(e){return null==e}function re(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const se=Symbol("evaluating");function ie(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==se)return void 0===r&&(r=se,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ae(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function oe(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function le(e){return JSON.stringify(e)}const ce="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ue(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const de=te((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function pe(e){if(!1===ue(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==ue(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function he(e){return pe(e)?{...e}:Array.isArray(e)?[...e]:e}const fe=new Set(["string","number","symbol"]),me=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ee(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function ye(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function _e(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}const Te={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},be={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ke(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function ve(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ae(e){return"string"==typeof e?e:e?.message}function xe(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=Ae(e.inst?._zod.def?.error?.(e))??Ae(t?.error?.(e))??Ae(n.customError?.(e))??Ae(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ie(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Se(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Ne(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const we=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ee,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ce=Y("$ZodError",we),Oe=Y("$ZodError",we,{Parent:Error}),Re=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new q;if(a.issues.length){const t=new(s?.Err??e)(a.issues.map((e=>xe(e,i,Q()))));throw ce(t,s?.callee),t}return a.value},De=Re(Oe),Le=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const t=new(s?.Err??e)(a.issues.map((e=>xe(e,i,Q()))));throw ce(t,s?.callee),t}return a.value},Pe=Le(Oe),Me=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new q;return i.issues.length?{success:!1,error:new(e??Ce)(i.issues.map((e=>xe(e,s,Q()))))}:{success:!0,data:i.value}},Fe=Me(Oe),ze=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map((e=>xe(e,s,Q()))))}:{success:!0,data:i.value}},Be=ze(Oe),Ue=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Re(e)(t,n,s)},He=e=>(t,n,r)=>Re(e)(t,n,r),je=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Le(e)(t,n,s)},$e=e=>async(t,n,r)=>Le(e)(t,n,r),Ze=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Me(e)(t,n,s)},Ge=e=>(t,n,r)=>Me(e)(t,n,r),Ve=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ze(e)(t,n,s)},Ye=e=>async(t,n,r)=>ze(e)(t,n,r),qe=/^[cC][^\s-]{8,}$/,We=/^[0-9a-z]+$/,Ke=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qe=/^[0-9a-vA-V]{20}$/,Je=/^[A-Za-z0-9]{27}$/,Xe=/^[a-zA-Z0-9_-]{21}$/,et=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,rt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,st=rt(4),it=rt(6),at=rt(7),ot=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ct=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ut=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,dt=ut,pt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function ht(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}const ft=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,gt=e=>{const t=ge(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Et=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,yt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Tt=/^[A-Za-z0-9_-]*$/,bt=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,kt=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,vt=/^\+[1-9]\d{6,14}$/,At="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",xt=new RegExp(`^${At}$`);function It(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function St(e){return new RegExp(`^${It(e)}$`)}function Nt(e){const t=It({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${At}T(?:${r})$`)}const wt=e=>new RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*"}$`),Ct=/^-?\d+n?$/,Ot=/^-?\d+$/,Rt=/^-?\d+(?:\.\d+)?$/,Dt=/^(?:true|false)$/i,Lt=/^null$/i,Pt=/^undefined$/i,Mt=/^[^A-Z]*$/,Ft=/^[^a-z]*$/,zt=/^[0-9a-fA-F]*$/;function Bt(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ut(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const Ht=/^[0-9a-fA-F]{32}$/,jt=Bt(22,"=="),$t=Ut(22),Zt=/^[0-9a-fA-F]{40}$/,Gt=Bt(27,"="),Vt=Ut(27),Yt=/^[0-9a-fA-F]{64}$/,qt=Bt(43,"="),Wt=Ut(43),Kt=/^[0-9a-fA-F]{96}$/,Qt=Bt(64,""),Jt=Ut(64),Xt=/^[0-9a-fA-F]{128}$/,en=Bt(86,"=="),tn=Ut(86),nn=Y("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),rn={number:"number",bigint:"bigint",object:"date"},sn=Y("$ZodCheckLessThan",((e,t)=>{nn.init(e,t);const n=rn[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),an=Y("$ZodCheckGreaterThan",((e,t)=>{nn.init(e,t);const n=rn[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),on=Y("$ZodCheckMultipleOf",((e,t)=>{nn.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(0===s&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(s=Number.parseInt(e[1]))}const i=n>s?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),ln=Y("$ZodCheckNumberFormat",((e,t)=>{nn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=Te[t.format];e._zod.onattach.push((e=>{const r=e._zod.bag;r.format=t.format,r.minimum=s,r.maximum=i,n&&(r.pattern=Ot)})),e._zod.check=a=>{const o=a.value;if(n){if(!Number.isInteger(o))return void a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}o<s&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),o>i&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}})),cn=Y("$ZodCheckBigIntFormat",((e,t)=>{nn.init(e,t);const[n,r]=be[t.format];e._zod.onattach.push((e=>{const s=e._zod.bag;s.format=t.format,s.minimum=n,s.maximum=r})),e._zod.check=s=>{const i=s.value;i<n&&s.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&s.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}})),un=Y("$ZodCheckMaxSize",((e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ne(t)&&void 0!==t.size}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const r=n.value;r.size<=t.maximum||n.issues.push({origin:Ie(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}})),dn=Y("$ZodCheckMinSize",((e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ne(t)&&void 0!==t.size}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const r=n.value;r.size>=t.minimum||n.issues.push({origin:Ie(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}})),pn=Y("$ZodCheckSizeEquals",((e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ne(t)&&void 0!==t.size}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size})),e._zod.check=n=>{const r=n.value,s=r.size;if(s===t.size)return;const i=s>t.size;n.issues.push({origin:Ie(r),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),hn=Y("$ZodCheckMaxLength",((e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ne(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const s=Se(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}})),fn=Y("$ZodCheckMinLength",((e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ne(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const s=Se(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}})),mn=Y("$ZodCheckLengthEquals",((e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ne(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=Se(r),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),gn=Y("$ZodCheckStringFormat",((e,t)=>{var n,r;nn.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})})),En=Y("$ZodCheckRegex",((e,t)=>{gn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),yn=Y("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=Mt),gn.init(e,t)})),_n=Y("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=Ft),gn.init(e,t)})),Tn=Y("$ZodCheckIncludes",((e,t)=>{nn.init(e,t);const n=ge(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),bn=Y("$ZodCheckStartsWith",((e,t)=>{nn.init(e,t);const n=new RegExp(`^${ge(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),kn=Y("$ZodCheckEndsWith",((e,t)=>{nn.init(e,t);const n=new RegExp(`.*${ge(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}));function vn(e,t,n){e.issues.length&&t.issues.push(...ve(n,e.issues))}const An=Y("$ZodCheckProperty",((e,t)=>{nn.init(e,t),e._zod.check=e=>{const n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then((n=>vn(n,e,t.property)));vn(n,e,t.property)}})),xn=Y("$ZodCheckMimeType",((e,t)=>{nn.init(e,t);const n=new Set(t.mime);e._zod.onattach.push((e=>{e._zod.bag.mime=t.mime})),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}})),In=Y("$ZodCheckOverwrite",((e,t)=>{nn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Sn{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),r=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Nn={major:4,minor:3,patch:6},wn=Y("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Nn;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let r,s=ke(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,a=i._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new q;if(r||a instanceof Promise)r=(r??Promise.resolve()).then((async()=>{await a,e.issues.length!==t&&(s||(s=ke(e,t)))}));else{if(e.issues.length===t)continue;s||(s=ke(e,t))}}return r?r.then((()=>e)):e},n=(n,s,i)=>{if(ke(n))return n.aborted=!0,n;const a=t(s,r,i);if(a instanceof Promise){if(!1===i.async)throw new q;return a.then((t=>e._zod.parse(t,i)))}return e._zod.parse(a,i)};e._zod.run=(s,i)=>{if(i.skipChecks)return e._zod.parse(s,i);if("backward"===i.direction){const t=e._zod.parse({value:s.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,s,i))):n(t,s,i)}const a=e._zod.parse(s,i);if(a instanceof Promise){if(!1===i.async)throw new q;return a.then((e=>t(e,r,i)))}return t(a,r,i)}}ie(e,"~standard",(()=>({validate:t=>{try{const n=Fe(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return Be(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1})))})),Cn=Y("$ZodString",((e,t)=>{wn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),On=Y("$ZodStringFormat",((e,t)=>{gn.init(e,t),Cn.init(e,t)})),Rn=Y("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=nt),On.init(e,t)})),Dn=Y("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=rt(e))}else t.pattern??(t.pattern=rt());On.init(e,t)})),Ln=Y("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=ot),On.init(e,t)})),Pn=Y("$ZodURL",((e,t)=>{On.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=s.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),Mn=Y("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=ht()),On.init(e,t)})),Fn=Y("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=Xe),On.init(e,t)})),zn=Y("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=qe),On.init(e,t)})),Bn=Y("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=We),On.init(e,t)})),Un=Y("$ZodULID",((e,t)=>{t.pattern??(t.pattern=Ke),On.init(e,t)})),Hn=Y("$ZodXID",((e,t)=>{t.pattern??(t.pattern=Qe),On.init(e,t)})),jn=Y("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=Je),On.init(e,t)})),$n=Y("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=Nt(t)),On.init(e,t)})),Zn=Y("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=xt),On.init(e,t)})),Gn=Y("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=St(t)),On.init(e,t)})),Vn=Y("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=et),On.init(e,t)})),Yn=Y("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=ft),On.init(e,t),e._zod.bag.format="ipv4"})),qn=Y("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=mt),On.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),Wn=Y("$ZodMAC",((e,t)=>{t.pattern??(t.pattern=gt(t.delimiter)),On.init(e,t),e._zod.bag.format="mac"})),Kn=Y("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=Et),On.init(e,t)})),Qn=Y("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=yt),On.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Jn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Xn=Y("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=_t),On.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Jn(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),er=Y("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=Tt),On.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!Tt.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Jn(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),tr=Y("$ZodE164",((e,t)=>{t.pattern??(t.pattern=vt),On.init(e,t)})),nr=Y("$ZodJWT",((e,t)=>{On.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),rr=Y("$ZodCustomStringFormat",((e,t)=>{On.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}})),sr=Y("$ZodNumber",((e,t)=>{wn.init(e,t),e._zod.pattern=e._zod.bag.pattern??Rt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const s=n.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}})),ir=Y("$ZodNumberFormat",((e,t)=>{ln.init(e,t),sr.init(e,t)})),ar=Y("$ZodBoolean",((e,t)=>{wn.init(e,t),e._zod.pattern=Dt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const s=n.value;return"boolean"==typeof s||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}})),or=Y("$ZodBigInt",((e,t)=>{wn.init(e,t),e._zod.pattern=Ct,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}})),lr=Y("$ZodBigIntFormat",((e,t)=>{cn.init(e,t),or.init(e,t)})),cr=Y("$ZodSymbol",((e,t)=>{wn.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return"symbol"==typeof r||t.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),t}})),ur=Y("$ZodUndefined",((e,t)=>{wn.init(e,t),e._zod.pattern=Pt,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}})),dr=Y("$ZodNull",((e,t)=>{wn.init(e,t),e._zod.pattern=Lt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}})),pr=Y("$ZodAny",((e,t)=>{wn.init(e,t),e._zod.parse=e=>e})),hr=Y("$ZodUnknown",((e,t)=>{wn.init(e,t),e._zod.parse=e=>e})),fr=Y("$ZodNever",((e,t)=>{wn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),mr=Y("$ZodVoid",((e,t)=>{wn.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}})),gr=Y("$ZodDate",((e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const s=n.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:e}),n}}));function Er(e,t,n){e.issues.length&&t.issues.push(...ve(n,e.issues)),t.value[n]=e.value}const yr=Y("$ZodArray",((e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let e=0;e<s.length;e++){const a=s[e],o=t.element._zod.run({value:a,issues:[]},r);o instanceof Promise?i.push(o.then((t=>Er(t,n,e)))):Er(o,n,e)}return i.length?Promise.all(i).then((()=>n)):n}}));function _r(e,t,n,r,s){if(e.issues.length){if(s&&!(n in r))return;t.issues.push(...ve(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Tr(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter((e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout)));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function br(e,t,n,r,s,i){const a=[],o=s.keySet,l=s.catchall._zod,c=l.def.type,u="optional"===l.optout;for(const s in t){if(o.has(s))continue;if("never"===c){a.push(s);continue}const i=l.run({value:t[s],issues:[]},r);i instanceof Promise?e.push(i.then((e=>_r(e,n,s,t,u)))):_r(i,n,s,t,u)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then((()=>n)):n}const kr=Y("$ZodObject",((e,t)=>{if(wn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const n=te((()=>Tr(t)));ie(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n}));const r=ue,s=t.catchall;let i;e._zod.parse=(t,a)=>{i??(i=n.value);const o=t.value;if(!r(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};const l=[],c=i.shape;for(const e of i.keys){const n=c[e],r="optional"===n._zod.optout,s=n._zod.run({value:o[e],issues:[]},a);s instanceof Promise?l.push(s.then((n=>_r(n,t,e,o,r)))):_r(s,t,e,o,r)}return s?br(l,o,t,a,n.value,e):l.length?Promise.all(l).then((()=>t)):t}})),vr=Y("$ZodObjectJIT",((e,t)=>{kr.init(e,t);const n=e._zod.parse,r=te((()=>Tr(t)));let s;const i=ue,a=!K.jitless,o=a&&de.value,l=t.catchall;let c;e._zod.parse=(u,d)=>{c??(c=r.value);const p=u.value;return i(p)?a&&o&&!1===d?.async&&!0!==d.jitless?(s||(s=(e=>{const t=new Sn(["shape","payload","ctx"]),n=r.value,s=e=>{const t=le(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let a=0;for(const e of n.keys)i[e]="key_"+a++;t.write("const newResult = {};");for(const r of n.keys){const n=i[r],a=le(r),o="optional"===e[r]?._zod?.optout;t.write(`const ${n} = ${s(r)};`),o?t.write(`\n if (${n}.issues.length) {\n if (${a} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${a}, ...iss.path] : [${a}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${a} in input) {\n newResult[${a}] = undefined;\n }\n } else {\n newResult[${a}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${a}, ...iss.path] : [${a}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${a} in input) {\n newResult[${a}] = undefined;\n }\n } else {\n newResult[${a}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const o=t.compile();return(t,n)=>o(e,t,n)})(t.shape)),u=s(u,d),l?br([],p,u,d,c,e):u):n(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}}));function Ar(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const s=e.filter((e=>!ke(e)));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>xe(e,r,Q())))))}),t)}const xr=Y("$ZodUnion",((e,t)=>{wn.init(e,t),ie(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),ie(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),ie(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),ie(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>re(e.source))).join("|")})$`)}}));const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let a=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(0===t.issues.length)return t;o.push(t)}}return a?Promise.all(o).then((t=>Ar(t,s,e,i))):Ar(o,s,e,i)}}));function Ir(e,t,n,r){const s=e.filter((e=>0===e.issues.length));return 1===s.length?(t.value=s[0].value,t):(0===s.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>xe(e,r,Q())))))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const Sr=Y("$ZodXor",((e,t)=>{xr.init(e,t),t.inclusive=!1;const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let a=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);t instanceof Promise?(o.push(t),a=!0):o.push(t)}return a?Promise.all(o).then((t=>Ir(t,s,e,i))):Ir(o,s,e,i)}})),Nr=Y("$ZodDiscriminatedUnion",((e,t)=>{t.inclusive=!1,xr.init(e,t);const n=e._zod.parse;ie(e._zod,"propValues",(()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e}));const r=te((()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n}));e._zod.parse=(s,i)=>{const a=s.value;if(!ue(a))return s.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),s;const o=r.value.get(a?.[t.discriminator]);return o?o._zod.run(s,i):t.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),s)}})),wr=Y("$ZodIntersection",((e,t)=>{wn.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then((([t,n])=>Or(e,t,n))):Or(e,s,i)}}));function Cr(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pe(e)&&pe(t)){const n=Object.keys(t),r=Object.keys(e).filter((e=>-1!==n.indexOf(e))),s={...e,...t};for(const n of r){const r=Cr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=Cr(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Or(e,t,n){const r=new Map;let s;for(const n of t.issues)if("unrecognized_keys"===n.code){s??(s=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter((([,e])=>e.l&&e.r)).map((([e])=>e));if(i.length&&s&&e.issues.push({...s,keys:i}),ke(e))return e;const a=Cr(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Rr=Y("$ZodTuple",((e,t)=>{wn.init(e,t);const n=t.items;e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const a=[],o=[...n].reverse().findIndex((e=>"optional"!==e._zod.optin)),l=-1===o?0:n.length-o;if(!t.rest){const t=i.length>n.length,s=i.length<l-1;if(t||s)return r.issues.push({...t?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let c=-1;for(const e of n){if(c++,c>=i.length&&c>=l)continue;const t=e._zod.run({value:i[c],issues:[]},s);t instanceof Promise?a.push(t.then((e=>Dr(e,r,c)))):Dr(t,r,c)}if(t.rest){const e=i.slice(n.length);for(const n of e){c++;const e=t.rest._zod.run({value:n,issues:[]},s);e instanceof Promise?a.push(e.then((e=>Dr(e,r,c)))):Dr(e,r,c)}}return a.length?Promise.all(a).then((()=>r)):r}}));function Dr(e,t,n){e.issues.length&&t.issues.push(...ve(n,e.issues)),t.value[n]=e.value}const Lr=Y("$ZodRecord",((e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!pe(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],a=t.keyType._zod.values;if(a){n.value={};const o=new Set;for(const e of a)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){o.add("number"==typeof e?e.toString():e);const a=t.valueType._zod.run({value:s[e],issues:[]},r);a instanceof Promise?i.push(a.then((t=>{t.issues.length&&n.issues.push(...ve(e,t.issues)),n.value[e]=t.value}))):(a.issues.length&&n.issues.push(...ve(e,a.issues)),n.value[e]=a.value)}let l;for(const e in s)o.has(e)||(l=l??[],l.push(e));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(s)){if("__proto__"===a)continue;let o=t.keyType._zod.run({value:a,issues:[]},r);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof a&&Rt.test(a)&&o.issues.length){const e=t.keyType._zod.run({value:Number(a),issues:[]},r);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(o=e)}if(o.issues.length){"loose"===t.mode?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map((e=>xe(e,r,Q()))),input:a,path:[a],inst:e});continue}const l=t.valueType._zod.run({value:s[a],issues:[]},r);l instanceof Promise?i.push(l.then((e=>{e.issues.length&&n.issues.push(...ve(a,e.issues)),n.value[o.value]=e.value}))):(l.issues.length&&n.issues.push(...ve(a,l.issues)),n.value[o.value]=l.value)}}return i.length?Promise.all(i).then((()=>n)):n}})),Pr=Y("$ZodMap",((e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:s,inst:e}),n;const i=[];n.value=new Map;for(const[a,o]of s){const l=t.keyType._zod.run({value:a,issues:[]},r),c=t.valueType._zod.run({value:o,issues:[]},r);l instanceof Promise||c instanceof Promise?i.push(Promise.all([l,c]).then((([t,i])=>{Mr(t,i,n,a,s,e,r)}))):Mr(l,c,n,a,s,e,r)}return i.length?Promise.all(i).then((()=>n)):n}}));function Mr(e,t,n,r,s,i,a){e.issues.length&&(fe.has(typeof r)?n.issues.push(...ve(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:s,inst:i,issues:e.issues.map((e=>xe(e,a,Q())))})),t.issues.length&&(fe.has(typeof r)?n.issues.push(...ve(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:s,inst:i,key:r,issues:t.issues.map((e=>xe(e,a,Q())))})),n.value.set(e.value,t.value)}const Fr=Y("$ZodSet",((e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Set))return n.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),n;const i=[];n.value=new Set;for(const e of s){const s=t.valueType._zod.run({value:e,issues:[]},r);s instanceof Promise?i.push(s.then((e=>zr(e,n)))):zr(s,n)}return i.length?Promise.all(i).then((()=>n)):n}}));function zr(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const Br=Y("$ZodEnum",((e,t)=>{wn.init(e,t);const n=J(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter((e=>fe.has(typeof e))).map((e=>"string"==typeof e?ge(e):e.toString())).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}})),Ur=Y("$ZodLiteral",((e,t)=>{if(wn.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map((e=>"string"==typeof e?ge(e):e?ge(e.toString()):String(e))).join("|")})$`),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}})),Hr=Y("$ZodFile",((e,t)=>{wn.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}})),jr=Y("$ZodTransform",((e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new W(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then((e=>(n.value=e,n)));if(s instanceof Promise)throw new q;return n.value=s,n}}));function $r(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Zr=Y("$ZodOptional",((e,t)=>{wn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ie(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),ie(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${re(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((t=>$r(t,e.value))):$r(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),Gr=Y("$ZodExactOptional",((e,t)=>{Zr.init(e,t),ie(e._zod,"values",(()=>t.innerType._zod.values)),ie(e._zod,"pattern",(()=>t.innerType._zod.pattern)),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)})),Vr=Y("$ZodNullable",((e,t)=>{wn.init(e,t),ie(e._zod,"optin",(()=>t.innerType._zod.optin)),ie(e._zod,"optout",(()=>t.innerType._zod.optout)),ie(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${re(e.source)}|null)$`):void 0})),ie(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),Yr=Y("$ZodDefault",((e,t)=>{wn.init(e,t),e._zod.optin="optional",ie(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((e=>qr(e,t))):qr(r,t)}}));function qr(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Wr=Y("$ZodPrefault",((e,t)=>{wn.init(e,t),e._zod.optin="optional",ie(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),Kr=Y("$ZodNonOptional",((e,t)=>{wn.init(e,t),ie(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then((t=>Qr(t,e))):Qr(s,e)}}));function Qr(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Jr=Y("$ZodSuccess",((e,t)=>{wn.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new W("ZodSuccess");const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((t=>(e.value=0===t.issues.length,e))):(e.value=0===r.issues.length,e)}})),Xr=Y("$ZodCatch",((e,t)=>{wn.init(e,t),ie(e._zod,"optin",(()=>t.innerType._zod.optin)),ie(e._zod,"optout",(()=>t.innerType._zod.optout)),ie(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>xe(e,n,Q())))},input:e.value}),e.issues=[]),e))):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>xe(e,n,Q())))},input:e.value}),e.issues=[]),e)}})),es=Y("$ZodNaN",((e,t)=>{wn.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)})),ts=Y("$ZodPipe",((e,t)=>{wn.init(e,t),ie(e._zod,"values",(()=>t.in._zod.values)),ie(e._zod,"optin",(()=>t.in._zod.optin)),ie(e._zod,"optout",(()=>t.out._zod.optout)),ie(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then((e=>ns(e,t.in,n))):ns(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then((e=>ns(e,t.out,n))):ns(r,t.out,n)}}));function ns(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const rs=Y("$ZodCodec",((e,t)=>{wn.init(e,t),ie(e._zod,"values",(()=>t.in._zod.values)),ie(e._zod,"optin",(()=>t.in._zod.optin)),ie(e._zod,"optout",(()=>t.out._zod.optout)),ie(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){const r=t.in._zod.run(e,n);return r instanceof Promise?r.then((e=>ss(e,t,n))):ss(r,t,n)}{const r=t.out._zod.run(e,n);return r instanceof Promise?r.then((e=>ss(e,t,n))):ss(r,t,n)}}}));function ss(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){const r=t.transform(e.value,e);return r instanceof Promise?r.then((r=>is(e,r,t.out,n))):is(e,r,t.out,n)}{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then((r=>is(e,r,t.in,n))):is(e,r,t.in,n)}}function is(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const as=Y("$ZodReadonly",((e,t)=>{wn.init(e,t),ie(e._zod,"propValues",(()=>t.innerType._zod.propValues)),ie(e._zod,"values",(()=>t.innerType._zod.values)),ie(e._zod,"optin",(()=>t.innerType?._zod?.optin)),ie(e._zod,"optout",(()=>t.innerType?._zod?.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(os):os(r)}}));function os(e){return e.value=Object.freeze(e.value),e}const ls=Y("$ZodTemplateLiteral",((e,t)=>{wn.init(e,t);const n=[];for(const e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);const t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${e._zod.traits}`);const r=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,s))}else{if(null!==e&&!me.has(typeof e))throw new Error(`Invalid template literal part: ${e}`);n.push(ge(`${e}`))}e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>"string"!=typeof n.value?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)})),cs=Y("$ZodFunction",((e,t)=>(wn.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw new Error("implement() must be called with a function");return function(...n){const r=e._def.input?De(e._def.input,n):n,s=Reflect.apply(t,this,r);return e._def.output?De(e._def.output,s):s}},e.implementAsync=t=>{if("function"!=typeof t)throw new Error("implementAsync() must be called with a function");return async function(...n){const r=e._def.input?await Pe(e._def.input,n):n,s=await Reflect.apply(t,this,r);return e._def.output?await Pe(e._def.output,s):s}},e._zod.parse=(t,n)=>{if("function"!=typeof t.value)return t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}),t;const r=e._def.output&&"promise"===e._def.output._zod.def.type;return t.value=r?e.implementAsync(t.value):e.implement(t.value),t},e.input=(...t)=>{const n=e.constructor;return Array.isArray(t[0])?new n({type:"function",input:new Rr({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}):new n({type:"function",input:t[0],output:e._def.output})},e.output=t=>new(0,e.constructor)({type:"function",input:e._def.input,output:t}),e))),us=Y("$ZodPromise",((e,t)=>{wn.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then((e=>t.innerType._zod.run({value:e,issues:[]},n)))})),ds=Y("$ZodLazy",((e,t)=>{wn.init(e,t),ie(e._zod,"innerType",(()=>t.getter())),ie(e._zod,"pattern",(()=>e._zod.innerType?._zod?.pattern)),ie(e._zod,"propValues",(()=>e._zod.innerType?._zod?.propValues)),ie(e._zod,"optin",(()=>e._zod.innerType?._zod?.optin??void 0)),ie(e._zod,"optout",(()=>e._zod.innerType?._zod?.optout??void 0)),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)})),ps=Y("$ZodCustom",((e,t)=>{nn.init(e,t),wn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then((t=>hs(t,n,r,e)));hs(s,n,r,e)}}));function hs(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ne(e))}}var fs;Symbol("ZodOutput"),Symbol("ZodInput");(fs=globalThis).__zod_globalRegistry??(fs.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const ms=globalThis.__zod_globalRegistry;function gs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ye(t)})}function Es(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ye(t)})}function ys(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(t)})}function Ts(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(t)})}function bs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(t)})}function ks(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ye(t)})}function vs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(t)})}function As(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(t)})}function xs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(t)})}function Is(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(t)})}function Ss(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(t)})}function Ns(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ye(t)})}function ws(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(t)})}function Cs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(t)})}function Os(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(t)})}function Rs(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(t)})}function Ds(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(t)})}function Ls(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ye(t)})}function Ps(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(t)})}function Ms(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ye(t)})}function Fs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(t)})}function zs(e,t){return new sn({check:"less_than",...ye(t),value:e,inclusive:!1})}function Bs(e,t){return new sn({check:"less_than",...ye(t),value:e,inclusive:!0})}function Us(e,t){return new an({check:"greater_than",...ye(t),value:e,inclusive:!1})}function Hs(e,t){return new an({check:"greater_than",...ye(t),value:e,inclusive:!0})}function js(e){return Us(0,e)}function $s(e){return zs(0,e)}function Zs(e){return Bs(0,e)}function Gs(e){return Hs(0,e)}function Vs(e,t){return new on({check:"multiple_of",...ye(t),value:e})}function Ys(e,t){return new un({check:"max_size",...ye(t),maximum:e})}function qs(e,t){return new dn({check:"min_size",...ye(t),minimum:e})}function Ws(e,t){return new pn({check:"size_equals",...ye(t),size:e})}function Ks(e,t){return new hn({check:"max_length",...ye(t),maximum:e})}function Qs(e,t){return new fn({check:"min_length",...ye(t),minimum:e})}function Js(e,t){return new mn({check:"length_equals",...ye(t),length:e})}function Xs(e,t){return new En({check:"string_format",format:"regex",...ye(t),pattern:e})}function ei(e){return new yn({check:"string_format",format:"lowercase",...ye(e)})}function ti(e){return new _n({check:"string_format",format:"uppercase",...ye(e)})}function ni(e,t){return new Tn({check:"string_format",format:"includes",...ye(t),includes:e})}function ri(e,t){return new bn({check:"string_format",format:"starts_with",...ye(t),prefix:e})}function si(e,t){return new kn({check:"string_format",format:"ends_with",...ye(t),suffix:e})}function ii(e,t,n){return new An({check:"property",property:e,schema:t,...ye(n)})}function ai(e,t){return new xn({check:"mime_type",mime:e,...ye(t)})}function oi(e){return new In({check:"overwrite",tx:e})}function li(e){return oi((t=>t.normalize(e)))}function ci(){return oi((e=>e.trim()))}function ui(){return oi((e=>e.toLowerCase()))}function di(){return oi((e=>e.toUpperCase()))}function pi(){return oi((e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}function hi(e,t,n,r={}){const s=ye(r),i={...ye(r),check:"string_format",type:"string",format:t,fn:"function"==typeof n?n:e=>n.test(e),...s};return n instanceof RegExp&&(i.pattern=n),new e(i)}function fi(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ms,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function mi(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{const n=a.schema,i=t.processors[s.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(a.ref||(a.ref=i),mi(i,t,r),t.seen.get(i).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),"input"===t.io&&yi(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function gi(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const s=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:s,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,s=e.external.uri??(e=>e);if(n)return{ref:s(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${s("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const s=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:s+i}})(t);r.def={...r.schema},i&&(r.defId=i);const a=r.schema;for(const e in a)delete a[e];a.$ref=s};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){s(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){s(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;(i||r.cycle||r.count>1&&"ref"===e.reused)&&s(n)}}function Ei(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const s=n.def??n.schema,i={...s},a=n.ref;if(n.ref=null,a){r(a);const n=e.seen.get(a),o=n.schema;if(!o.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(s,o):(s.allOf=s.allOf??[],s.allOf.push(o)),Object.assign(s,i),t._zod.parent===a)for(const e in s)"$ref"!==e&&"allOf"!==e&&(e in i||delete s[e]);if(o.$ref&&n.def)for(const e in s)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(s[e])===JSON.stringify(n.def[e])&&delete s[e]}const o=t._zod.parent;if(o&&o!==a){r(o);const t=e.seen.get(o);if(t?.schema.$ref&&(s.$ref=t.schema.$ref,t.def))for(const e in s)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(s[e])===JSON.stringify(t.def[e])&&delete s[e]}e.override({zodSchema:t,jsonSchema:s,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const s={};if("draft-2020-12"===e.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(n)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?s.$defs=i:s.definitions=i);try{const n=JSON.parse(JSON.stringify(s));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:_i(t,"input",e.processors),output:_i(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function yi(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return yi(r.element,n);if("set"===r.type)return yi(r.valueType,n);if("lazy"===r.type)return yi(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return yi(r.innerType,n);if("intersection"===r.type)return yi(r.left,n)||yi(r.right,n);if("record"===r.type||"map"===r.type)return yi(r.keyType,n)||yi(r.valueType,n);if("pipe"===r.type)return yi(r.in,n)||yi(r.out,n);if("object"===r.type){for(const e in r.shape)if(yi(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(yi(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(yi(e,n))return!0;return!(!r.rest||!yi(r.rest,n))}return!1}const _i=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},a=fi({...s??{},target:i,io:t,processors:n});return mi(e,a),gi(a,e),Ei(a,e)},Ti={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bi=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:a,format:o,patterns:l,contentEncoding:c}=e._zod.bag;if("number"==typeof i&&(s.minLength=i),"number"==typeof a&&(s.maxLength=a),o&&(s.format=Ti[o]??o,""===s.format&&delete s.format,"time"===o&&delete s.format),c&&(s.contentEncoding=c),l&&l.size>0){const e=[...l];1===e.length?s.pattern=e[0].source:e.length>1&&(s.allOf=[...e.map((e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source})))])}},ki=(e,t,n,r)=>{const s=n,{minimum:i,maximum:a,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;"string"==typeof o&&o.includes("int")?s.type="integer":s.type="number","number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u),"number"==typeof i&&(s.minimum=i,"number"==typeof u&&"draft-04"!==t.target&&(u>=i?delete s.minimum:delete s.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c),"number"==typeof a&&(s.maximum=a,"number"==typeof c&&"draft-04"!==t.target&&(c<=a?delete s.maximum:delete s.exclusiveMaximum)),"number"==typeof l&&(s.multipleOf=l)},vi=(e,t,n,r)=>{n.type="boolean"},Ai=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")},xi=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema")},Ii=(e,t,n,r)=>{"openapi-3.0"===t.target?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Si=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")},Ni=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Void cannot be represented in JSON Schema")},wi=(e,t,n,r)=>{n.not={}},Ci=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")},Oi=(e,t,n,r)=>{const s=J(e._zod.def.entries);s.every((e=>"number"==typeof e))&&(n.type="number"),s.every((e=>"string"==typeof e))&&(n.type="string"),n.enum=s},Ri=(e,t,n,r)=>{const s=e._zod.def,i=[];for(const e of s.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(e))}else i.push(e);if(0===i.length);else if(1===i.length){const e=i[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else i.every((e=>"number"==typeof e))&&(n.type="number"),i.every((e=>"string"==typeof e))&&(n.type="string"),i.every((e=>"boolean"==typeof e))&&(n.type="boolean"),i.every((e=>null===e))&&(n.type="null"),n.enum=i},Di=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema")},Li=(e,t,n,r)=>{const s=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=i.source},Pi=(e,t,n,r)=>{const s=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:o,mime:l}=e._zod.bag;void 0!==a&&(i.minLength=a),void 0!==o&&(i.maxLength=o),l?1===l.length?(i.contentMediaType=l[0],Object.assign(s,i)):(Object.assign(s,i),s.anyOf=l.map((e=>({contentMediaType:e})))):Object.assign(s,i)},Mi=(e,t,n,r)=>{n.type="boolean"},Fi=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")},zi=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")},Bi=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")},Ui=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Map cannot be represented in JSON Schema")},Hi=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Set cannot be represented in JSON Schema")},ji=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:a,maximum:o}=e._zod.bag;"number"==typeof a&&(s.minItems=a),"number"==typeof o&&(s.maxItems=o),s.type="array",s.items=mi(i.element,t,{...r,path:[...r.path,"items"]})},$i=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const a=i.shape;for(const e in a)s.properties[e]=mi(a[e],t,{...r,path:[...r.path,"properties",e]});const o=new Set(Object.keys(a)),l=new Set([...o].filter((e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout})));l.size>0&&(s.required=Array.from(l)),"never"===i.catchall?._zod.def.type?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=mi(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(s.additionalProperties=!1)},Zi=(e,t,n,r)=>{const s=e._zod.def,i=!1===s.inclusive,a=s.options.map(((e,n)=>mi(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]})));i?n.oneOf=a:n.anyOf=a},Gi=(e,t,n,r)=>{const s=e._zod.def,i=mi(s.left,t,{...r,path:[...r.path,"allOf",0]}),a=mi(s.right,t,{...r,path:[...r.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,l=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];n.allOf=l},Vi=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="array";const a="draft-2020-12"===t.target?"prefixItems":"items",o="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",l=i.items.map(((e,n)=>mi(e,t,{...r,path:[...r.path,a,n]}))),c=i.rest?mi(i.rest,t,{...r,path:[...r.path,o,..."openapi-3.0"===t.target?[i.items.length]:[]]}):null;"draft-2020-12"===t.target?(s.prefixItems=l,c&&(s.items=c)):"openapi-3.0"===t.target?(s.items={anyOf:l},c&&s.items.anyOf.push(c),s.minItems=l.length,c||(s.maxItems=l.length)):(s.items=l,c&&(s.additionalItems=c));const{minimum:u,maximum:d}=e._zod.bag;"number"==typeof u&&(s.minItems=u),"number"==typeof d&&(s.maxItems=d)},Yi=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const a=i.keyType,o=a._zod.bag?.patterns;if("loose"===i.mode&&o&&o.size>0){const e=mi(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const t of o)s.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(s.propertyNames=mi(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=mi(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const l=a._zod.values;if(l){const e=[...l].filter((e=>"string"==typeof e||"number"==typeof e));e.length>0&&(s.required=e)}},qi=(e,t,n,r)=>{const s=e._zod.def,i=mi(s.innerType,t,r),a=t.seen.get(e);"openapi-3.0"===t.target?(a.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Wi=(e,t,n,r)=>{const s=e._zod.def;mi(s.innerType,t,r),t.seen.get(e).ref=s.innerType},Ki=(e,t,n,r)=>{const s=e._zod.def;mi(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},Qi=(e,t,n,r)=>{const s=e._zod.def;mi(s.innerType,t,r),t.seen.get(e).ref=s.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Ji=(e,t,n,r)=>{const s=e._zod.def;let i;mi(s.innerType,t,r),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},Xi=(e,t,n,r)=>{const s=e._zod.def,i="input"===t.io?"transform"===s.in._zod.def.type?s.out:s.in:s.out;mi(i,t,r),t.seen.get(e).ref=i},ea=(e,t,n,r)=>{const s=e._zod.def;mi(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.readOnly=!0},ta=(e,t,n,r)=>{const s=e._zod.def;mi(s.innerType,t,r),t.seen.get(e).ref=s.innerType},na=(e,t,n,r)=>{const s=e._zod.def;mi(s.innerType,t,r),t.seen.get(e).ref=s.innerType},ra=(e,t,n,r)=>{const s=e._zod.innerType;mi(s,t,r),t.seen.get(e).ref=s},sa={string:bi,number:ki,boolean:vi,bigint:Ai,symbol:xi,null:Ii,undefined:Si,void:Ni,never:wi,any:(e,t,n,r)=>{},unknown:(e,t,n,r)=>{},date:Ci,enum:Oi,literal:Ri,nan:Di,template_literal:Li,file:Pi,success:Mi,custom:Fi,function:zi,transform:Bi,map:Ui,set:Hi,array:ji,object:$i,union:Zi,intersection:Gi,tuple:Vi,record:Yi,nullable:qi,nonoptional:Wi,default:Ki,prefault:Qi,catch:Ji,pipe:Xi,readonly:ea,promise:ta,optional:na,lazy:ra},ia=Y("ZodISODateTime",((e,t)=>{$n.init(e,t),Oa.init(e,t)}));function aa(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(t)})}(ia,e)}const oa=Y("ZodISODate",((e,t)=>{Zn.init(e,t),Oa.init(e,t)}));function la(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...ye(t)})}(oa,e)}const ca=Y("ZodISOTime",((e,t)=>{Gn.init(e,t),Oa.init(e,t)}));function ua(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ye(t)})}(ca,e)}const da=Y("ZodISODuration",((e,t)=>{Vn.init(e,t),Oa.init(e,t)}));function pa(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...ye(t)})}(da,e)}const ha=(e,t)=>{Ce.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=(e=>e.message)){const n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map((e=>r({issues:e})));else if("invalid_key"===s.code)r({issues:s.issues});else if("invalid_element"===s.code)r({issues:s.issues});else if(0===s.path.length)n._errors.push(t(s));else{let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ee,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ee,2)}},isEmpty:{get:()=>0===e.issues.length}})},fa=(Y("ZodError",ha),Y("ZodError",ha,{Parent:Error})),ma=Re(fa),ga=Le(fa),Ea=Me(fa),ya=ze(fa),_a=Ue(fa),Ta=He(fa),ba=je(fa),ka=$e(fa),va=Ze(fa),Aa=Ge(fa),xa=Ve(fa),Ia=Ye(fa),Sa=Y("ZodType",((e,t)=>(wn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:_i(e,"input"),output:_i(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=fi({...n,processors:t});return mi(e,r),gi(r,e),Ei(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(oe(t,{checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Ee(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>ma(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ea(e,t,n),e.parseAsync=async(t,n)=>ga(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ya(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>_a(e,t,n),e.decode=(t,n)=>Ta(e,t,n),e.encodeAsync=async(t,n)=>ba(e,t,n),e.decodeAsync=async(t,n)=>ka(e,t,n),e.safeEncode=(t,n)=>va(e,t,n),e.safeDecode=(t,n)=>Aa(e,t,n),e.safeEncodeAsync=async(t,n)=>xa(e,t,n),e.safeDecodeAsync=async(t,n)=>Ia(e,t,n),e.refine=(t,n)=>e.check(bc(t,n)),e.superRefine=t=>e.check(kc(t)),e.overwrite=t=>e.check(oi(t)),e.optional=()=>Ul(e),e.exactOptional=()=>jl(e),e.nullable=()=>Zl(e),e.nullish=()=>Ul(Zl(e)),e.nonoptional=t=>Ql(e,t),e.array=()=>al(e),e.or=t=>hl([e,t]),e.and=t=>_l(e,t),e.transform=t=>ic(e,zl(t)),e.default=t=>Yl(e,t),e.prefault=t=>Wl(e,t),e.catch=t=>tc(e,t),e.pipe=t=>ic(e,t),e.readonly=()=>cc(e),e.describe=t=>{const n=e.clone();return ms.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>ms.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return ms.get(e);const n=e.clone();return ms.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e))),Na=Y("_ZodString",((e,t)=>{Cn.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Xs(...t)),e.includes=(...t)=>e.check(ni(...t)),e.startsWith=(...t)=>e.check(ri(...t)),e.endsWith=(...t)=>e.check(si(...t)),e.min=(...t)=>e.check(Qs(...t)),e.max=(...t)=>e.check(Ks(...t)),e.length=(...t)=>e.check(Js(...t)),e.nonempty=(...t)=>e.check(Qs(1,...t)),e.lowercase=t=>e.check(ei(t)),e.uppercase=t=>e.check(ti(t)),e.trim=()=>e.check(ci()),e.normalize=(...t)=>e.check(li(...t)),e.toLowerCase=()=>e.check(ui()),e.toUpperCase=()=>e.check(di()),e.slugify=()=>e.check(pi())})),wa=Y("ZodString",((e,t)=>{Cn.init(e,t),Na.init(e,t),e.email=t=>e.check(gs(Ra,t)),e.url=t=>e.check(ks(Ha,t)),e.jwt=t=>e.check(Fs(bo,t)),e.emoji=t=>e.check(vs(Za,t)),e.guid=t=>e.check(Es(La,t)),e.uuid=t=>e.check(ys(Ma,t)),e.uuidv4=t=>e.check(_s(Ma,t)),e.uuidv6=t=>e.check(Ts(Ma,t)),e.uuidv7=t=>e.check(bs(Ma,t)),e.nanoid=t=>e.check(As(Va,t)),e.guid=t=>e.check(Es(La,t)),e.cuid=t=>e.check(xs(qa,t)),e.cuid2=t=>e.check(Is(Ka,t)),e.ulid=t=>e.check(Ss(Ja,t)),e.base64=t=>e.check(Ls(mo,t)),e.base64url=t=>e.check(Ps(Eo,t)),e.xid=t=>e.check(Ns(eo,t)),e.ksuid=t=>e.check(ws(no,t)),e.ipv4=t=>e.check(Cs(so,t)),e.ipv6=t=>e.check(Os(lo,t)),e.cidrv4=t=>e.check(Rs(uo,t)),e.cidrv6=t=>e.check(Ds(ho,t)),e.e164=t=>e.check(Ms(_o,t)),e.datetime=t=>e.check(aa(t)),e.date=t=>e.check(la(t)),e.time=t=>e.check(ua(t)),e.duration=t=>e.check(pa(t))}));function Ca(e){return function(e,t){return new e({type:"string",...ye(t)})}(wa,e)}const Oa=Y("ZodStringFormat",((e,t)=>{On.init(e,t),Na.init(e,t)})),Ra=Y("ZodEmail",((e,t)=>{Ln.init(e,t),Oa.init(e,t)}));function Da(e){return gs(Ra,e)}const La=Y("ZodGUID",((e,t)=>{Rn.init(e,t),Oa.init(e,t)}));function Pa(e){return Es(La,e)}const Ma=Y("ZodUUID",((e,t)=>{Dn.init(e,t),Oa.init(e,t)}));function Fa(e){return ys(Ma,e)}function za(e){return _s(Ma,e)}function Ba(e){return Ts(Ma,e)}function Ua(e){return bs(Ma,e)}const Ha=Y("ZodURL",((e,t)=>{Pn.init(e,t),Oa.init(e,t)}));function ja(e){return ks(Ha,e)}function $a(e){return ks(Ha,{protocol:/^https?$/,hostname:kt,...ye(e)})}const Za=Y("ZodEmoji",((e,t)=>{Mn.init(e,t),Oa.init(e,t)}));function Ga(e){return vs(Za,e)}const Va=Y("ZodNanoID",((e,t)=>{Fn.init(e,t),Oa.init(e,t)}));function Ya(e){return As(Va,e)}const qa=Y("ZodCUID",((e,t)=>{zn.init(e,t),Oa.init(e,t)}));function Wa(e){return xs(qa,e)}const Ka=Y("ZodCUID2",((e,t)=>{Bn.init(e,t),Oa.init(e,t)}));function Qa(e){return Is(Ka,e)}const Ja=Y("ZodULID",((e,t)=>{Un.init(e,t),Oa.init(e,t)}));function Xa(e){return Ss(Ja,e)}const eo=Y("ZodXID",((e,t)=>{Hn.init(e,t),Oa.init(e,t)}));function to(e){return Ns(eo,e)}const no=Y("ZodKSUID",((e,t)=>{jn.init(e,t),Oa.init(e,t)}));function ro(e){return ws(no,e)}const so=Y("ZodIPv4",((e,t)=>{Yn.init(e,t),Oa.init(e,t)}));function io(e){return Cs(so,e)}const ao=Y("ZodMAC",((e,t)=>{Wn.init(e,t),Oa.init(e,t)}));function oo(e){return function(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ye(t)})}(ao,e)}const lo=Y("ZodIPv6",((e,t)=>{qn.init(e,t),Oa.init(e,t)}));function co(e){return Os(lo,e)}const uo=Y("ZodCIDRv4",((e,t)=>{Kn.init(e,t),Oa.init(e,t)}));function po(e){return Rs(uo,e)}const ho=Y("ZodCIDRv6",((e,t)=>{Qn.init(e,t),Oa.init(e,t)}));function fo(e){return Ds(ho,e)}const mo=Y("ZodBase64",((e,t)=>{Xn.init(e,t),Oa.init(e,t)}));function go(e){return Ls(mo,e)}const Eo=Y("ZodBase64URL",((e,t)=>{er.init(e,t),Oa.init(e,t)}));function yo(e){return Ps(Eo,e)}const _o=Y("ZodE164",((e,t)=>{tr.init(e,t),Oa.init(e,t)}));function To(e){return Ms(_o,e)}const bo=Y("ZodJWT",((e,t)=>{nr.init(e,t),Oa.init(e,t)}));function ko(e){return Fs(bo,e)}const vo=Y("ZodCustomStringFormat",((e,t)=>{rr.init(e,t),Oa.init(e,t)}));function Ao(e,t,n={}){return hi(vo,e,t,n)}function xo(e){return hi(vo,"hostname",bt,e)}function Io(e){return hi(vo,"hex",zt,e)}function So(e,t){const n=`${e}_${t?.enc??"hex"}`,s=r[n];if(!s)throw new Error(`Unrecognized hash format: ${n}`);return hi(vo,n,s,t)}const No=Y("ZodNumber",((e,t)=>{sr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n),e.gt=(t,n)=>e.check(Us(t,n)),e.gte=(t,n)=>e.check(Hs(t,n)),e.min=(t,n)=>e.check(Hs(t,n)),e.lt=(t,n)=>e.check(zs(t,n)),e.lte=(t,n)=>e.check(Bs(t,n)),e.max=(t,n)=>e.check(Bs(t,n)),e.int=t=>e.check(Oo(t)),e.safe=t=>e.check(Oo(t)),e.positive=t=>e.check(Us(0,t)),e.nonnegative=t=>e.check(Hs(0,t)),e.negative=t=>e.check(zs(0,t)),e.nonpositive=t=>e.check(Bs(0,t)),e.multipleOf=(t,n)=>e.check(Vs(t,n)),e.step=(t,n)=>e.check(Vs(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function wo(e){return function(e,t){return new e({type:"number",checks:[],...ye(t)})}(No,e)}const Co=Y("ZodNumberFormat",((e,t)=>{ir.init(e,t),No.init(e,t)}));function Oo(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(t)})}(Co,e)}function Ro(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ye(t)})}(Co,e)}function Do(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ye(t)})}(Co,e)}function Lo(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ye(t)})}(Co,e)}function Po(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ye(t)})}(Co,e)}const Mo=Y("ZodBoolean",((e,t)=>{ar.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>vi(0,0,t)}));function Fo(e){return function(e,t){return new e({type:"boolean",...ye(t)})}(Mo,e)}const zo=Y("ZodBigInt",((e,t)=>{or.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Ai(0,e),e.gte=(t,n)=>e.check(Hs(t,n)),e.min=(t,n)=>e.check(Hs(t,n)),e.gt=(t,n)=>e.check(Us(t,n)),e.gte=(t,n)=>e.check(Hs(t,n)),e.min=(t,n)=>e.check(Hs(t,n)),e.lt=(t,n)=>e.check(zs(t,n)),e.lte=(t,n)=>e.check(Bs(t,n)),e.max=(t,n)=>e.check(Bs(t,n)),e.positive=t=>e.check(Us(BigInt(0),t)),e.negative=t=>e.check(zs(BigInt(0),t)),e.nonpositive=t=>e.check(Bs(BigInt(0),t)),e.nonnegative=t=>e.check(Hs(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Vs(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}));function Bo(e){return function(e,t){return new e({type:"bigint",...ye(t)})}(zo,e)}const Uo=Y("ZodBigIntFormat",((e,t)=>{lr.init(e,t),zo.init(e,t)}));function Ho(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ye(t)})}(Uo,e)}function jo(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ye(t)})}(Uo,e)}const $o=Y("ZodSymbol",((e,t)=>{cr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>xi(0,e)}));function Zo(e){return function(e,t){return new e({type:"symbol",...ye(t)})}($o,e)}const Go=Y("ZodUndefined",((e,t)=>{ur.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Si(0,e)}));function Vo(e){return function(e,t){return new e({type:"undefined",...ye(t)})}(Go,e)}const Yo=Y("ZodNull",((e,t)=>{dr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Ii(0,e,t)}));function qo(e){return function(e,t){return new e({type:"null",...ye(t)})}(Yo,e)}const Wo=Y("ZodAny",((e,t)=>{pr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));function Ko(){return new Wo({type:"any"})}const Qo=Y("ZodUnknown",((e,t)=>{hr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));function Jo(){return new Qo({type:"unknown"})}const Xo=Y("ZodNever",((e,t)=>{fr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>wi(0,0,t)}));function el(e){return function(e,t){return new e({type:"never",...ye(t)})}(Xo,e)}const tl=Y("ZodVoid",((e,t)=>{mr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Ni(0,e)}));function nl(e){return function(e,t){return new e({type:"void",...ye(t)})}(tl,e)}const rl=Y("ZodDate",((e,t)=>{gr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Ci(0,e),e.min=(t,n)=>e.check(Hs(t,n)),e.max=(t,n)=>e.check(Bs(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}));function sl(e){return function(e,t){return new e({type:"date",...ye(t)})}(rl,e)}const il=Y("ZodArray",((e,t)=>{yr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Qs(t,n)),e.nonempty=t=>e.check(Qs(1,t)),e.max=(t,n)=>e.check(Ks(t,n)),e.length=(t,n)=>e.check(Js(t,n)),e.unwrap=()=>e.element}));function al(e,t){return function(e,t,n){return new e({type:"array",element:t,...ye(n)})}(il,e,t)}function ol(e){const t=e._zod.def.shape;return Ol(Object.keys(t))}const ll=Y("ZodObject",((e,t)=>{vr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$i(e,t,n,r),ie(e,"shape",(()=>t.shape)),e.keyof=()=>Ol(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Jo()}),e.loose=()=>e.clone({...e._zod.def,catchall:Jo()}),e.strict=()=>e.clone({...e._zod.def,catchall:el()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!pe(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=oe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return ae(this,"shape",n),n}});return Ee(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!pe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=oe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return ae(this,"shape",n),n}});return Ee(e,n)}(e,t),e.merge=t=>function(e,t){const n=oe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return ae(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ee(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Ee(e,oe(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ae(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=oe(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ae(this,"shape",r),r},checks:[]});return Ee(e,s)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=oe(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)s[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return ae(this,"shape",s),s},checks:[]});return Ee(t,s)}(Bl,e,t[0]),e.required=(...t)=>function(e,t,n){const r=oe(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)s[t]=new e({type:"nonoptional",innerType:r[t]});return ae(this,"shape",s),s}});return Ee(t,r)}(Kl,e,t[0])}));function cl(e,t){const n={type:"object",shape:e??{},...ye(t)};return new ll(n)}function ul(e,t){return new ll({type:"object",shape:e,catchall:el(),...ye(t)})}function dl(e,t){return new ll({type:"object",shape:e,catchall:Jo(),...ye(t)})}const pl=Y("ZodUnion",((e,t)=>{xr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zi(e,t,n,r),e.options=t.options}));function hl(e,t){return new pl({type:"union",options:e,...ye(t)})}const fl=Y("ZodXor",((e,t)=>{pl.init(e,t),Sr.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zi(e,t,n,r),e.options=t.options}));function ml(e,t){return new fl({type:"union",options:e,inclusive:!1,...ye(t)})}const gl=Y("ZodDiscriminatedUnion",((e,t)=>{pl.init(e,t),Nr.init(e,t)}));function El(e,t,n){return new gl({type:"union",options:t,discriminator:e,...ye(n)})}const yl=Y("ZodIntersection",((e,t)=>{wr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r)}));function _l(e,t){return new yl({type:"intersection",left:e,right:t})}const Tl=Y("ZodTuple",((e,t)=>{Rr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})}));function bl(e,t,n){const r=t instanceof wn;return new Tl({type:"tuple",items:e,rest:r?t:null,...ye(r?n:t)})}const kl=Y("ZodRecord",((e,t)=>{Lr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType}));function vl(e,t,n){return new kl({type:"record",keyType:e,valueType:t,...ye(n)})}function Al(e,t,n){const r=Ee(e);return r._zod.values=void 0,new kl({type:"record",keyType:r,valueType:t,...ye(n)})}function xl(e,t,n){return new kl({type:"record",keyType:e,valueType:t,mode:"loose",...ye(n)})}const Il=Y("ZodMap",((e,t)=>{Pr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Ui(0,e),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(qs(...t)),e.nonempty=t=>e.check(qs(1,t)),e.max=(...t)=>e.check(Ys(...t)),e.size=(...t)=>e.check(Ws(...t))}));function Sl(e,t,n){return new Il({type:"map",keyType:e,valueType:t,...ye(n)})}const Nl=Y("ZodSet",((e,t)=>{Fr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Hi(0,e),e.min=(...t)=>e.check(qs(...t)),e.nonempty=t=>e.check(qs(1,t)),e.max=(...t)=>e.check(Ys(...t)),e.size=(...t)=>e.check(Ws(...t))}));function wl(e,t){return new Nl({type:"set",valueType:e,...ye(t)})}const Cl=Y("ZodEnum",((e,t)=>{Br.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const s={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);s[r]=t.entries[r]}return new Cl({...t,checks:[],...ye(r),entries:s})},e.exclude=(e,r)=>{const s={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t]}return new Cl({...t,checks:[],...ye(r),entries:s})}}));function Ol(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Cl({type:"enum",entries:n,...ye(t)})}function Rl(e,t){return new Cl({type:"enum",entries:e,...ye(t)})}const Dl=Y("ZodLiteral",((e,t)=>{Ur.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}));function Ll(e,t){return new Dl({type:"literal",values:Array.isArray(e)?e:[e],...ye(t)})}const Pl=Y("ZodFile",((e,t)=>{Hr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,0,n),e.min=(t,n)=>e.check(qs(t,n)),e.max=(t,n)=>e.check(Ys(t,n)),e.mime=(t,n)=>e.check(ai(Array.isArray(t)?t:[t],n))}));function Ml(e){return function(e,t){return new e({type:"file",...ye(t)})}(Pl,e)}const Fl=Y("ZodTransform",((e,t)=>{jr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Bi(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new W(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(Ne(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Ne(t))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then((e=>(n.value=e,n))):(n.value=s,n)}}));function zl(e){return new Fl({type:"transform",transform:e})}const Bl=Y("ZodOptional",((e,t)=>{Zr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>na(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));function Ul(e){return new Bl({type:"optional",innerType:e})}const Hl=Y("ZodExactOptional",((e,t)=>{Gr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>na(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));function jl(e){return new Hl({type:"optional",innerType:e})}const $l=Y("ZodNullable",((e,t)=>{Vr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}));function Zl(e){return new $l({type:"nullable",innerType:e})}function Gl(e){return Ul(Zl(e))}const Vl=Y("ZodDefault",((e,t)=>{Yr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}));function Yl(e,t){return new Vl({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():he(t)}})}const ql=Y("ZodPrefault",((e,t)=>{Wr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}));function Wl(e,t){return new ql({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():he(t)}})}const Kl=Y("ZodNonOptional",((e,t)=>{Kr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));function Ql(e,t){return new Kl({type:"nonoptional",innerType:e,...ye(t)})}const Jl=Y("ZodSuccess",((e,t)=>{Jr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Mi(0,0,t),e.unwrap=()=>e._zod.def.innerType}));function Xl(e){return new Jl({type:"success",innerType:e})}const ec=Y("ZodCatch",((e,t)=>{Xr.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}));function tc(e,t){return new ec({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}const nc=Y("ZodNaN",((e,t)=>{es.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Di(0,e)}));function rc(e){return function(e,t){return new e({type:"nan",...ye(t)})}(nc,e)}const sc=Y("ZodPipe",((e,t)=>{ts.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xi(e,t,0,r),e.in=t.in,e.out=t.out}));function ic(e,t){return new sc({type:"pipe",in:e,out:t})}const ac=Y("ZodCodec",((e,t)=>{sc.init(e,t),rs.init(e,t)}));function oc(e,t,n){return new ac({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const lc=Y("ZodReadonly",((e,t)=>{as.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ea(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}));function cc(e){return new lc({type:"readonly",innerType:e})}const uc=Y("ZodTemplateLiteral",((e,t)=>{ls.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,0,n)}));function dc(e,t){return new uc({type:"template_literal",parts:e,...ye(t)})}const pc=Y("ZodLazy",((e,t)=>{ds.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ra(e,t,0,r),e.unwrap=()=>e._zod.def.getter()}));function hc(e){return new pc({type:"lazy",getter:e})}const fc=Y("ZodPromise",((e,t)=>{us.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ta(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}));function mc(e){return new fc({type:"promise",innerType:e})}const gc=Y("ZodFunction",((e,t)=>{cs.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>zi(0,e)}));function Ec(e){return new gc({type:"function",input:Array.isArray(e?.input)?bl(e?.input):e?.input??al(Jo()),output:e?.output??Jo()})}const yc=Y("ZodCustom",((e,t)=>{ps.init(e,t),Sa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>Fi(0,e)}));function _c(e){const t=new nn({check:"custom"});return t._zod.check=e,t}function Tc(e,t){return function(e,t,n){const r=ye(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}(yc,e??(()=>!0),t)}function bc(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ye(n)})}(yc,e,t)}function kc(e){return function(e){const t=function(e,t){const n=new nn({check:"custom",...ye(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Ne(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Ne(r))}},e(n.value,n))));return t}(e)}const vc=function(e){const t=new nn({check:"describe"});return t._zod.onattach=[t=>{const n=ms.get(t)??{};ms.add(t,{...n,description:e})}],t._zod.check=()=>{},t},Ac=function(e){const t=new nn({check:"meta"});return t._zod.onattach=[t=>{const n=ms.get(t)??{};ms.add(t,{...n,...e})}],t._zod.check=()=>{},t};function xc(e,t={}){const n=new yc({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...ye(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}const Ic=(...e)=>function(e,t){const n=ye(t);let r=n.truthy??["true","1","yes","on","y","enabled"],s=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(r=r.map((e=>"string"==typeof e?e.toLowerCase():e)),s=s.map((e=>"string"==typeof e?e.toLowerCase():e)));const i=new Set(r),a=new Set(s),o=e.Codec??rs,l=e.Boolean??ar,c=new o({type:"pipe",in:new(e.String??Cn)({type:"string",error:n.error}),out:new l({type:"boolean",error:n.error}),transform:(e,t)=>{let r=e;return"sensitive"!==n.case&&(r=r.toLowerCase()),!!i.has(r)||!a.has(r)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:t.value,inst:c,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?r[0]||"true":s[0]||"false",error:n.error});return c}({Codec:ac,Boolean:Mo,String:wa},...e);function Sc(e){const t=hc((()=>hl([Ca(e),wo(),Fo(),qo(),al(t),vl(Ca(),t)])));return t}function Nc(e,t){return ic(zl(e),t)}var wc,Cc,Oc;wc||(wc={}),new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]),Q({localeError:(()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(t){return e[t]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return e=>{switch(e.code){case"invalid_type":{const t=r[e.expected]??e.expected,n=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(null===e)return"null";if(Array.isArray(e))return"array";const t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return t}(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case"invalid_value":return 1===e.values.length?`Invalid input: expected ${_e(e.values[0])}`:`Invalid option: expected one of ${X(e.values,"|")}`;case"too_big":{const n=e.inclusive?"<=":"<",r=t(e.origin);return r?`Too big: expected ${e.origin??"value"} to have ${n}${e.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${e.origin??"value"} to be ${n}${e.maximum.toString()}`}case"too_small":{const n=e.inclusive?">=":">",r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case"invalid_format":{const t=e;return"starts_with"===t.format?`Invalid string: must start with "${t.prefix}"`:"ends_with"===t.format?`Invalid string: must end with "${t.suffix}"`:"includes"===t.format?`Invalid string: must include "${t.includes}"`:"regex"===t.format?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${X(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}}})()}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Cc||(Cc={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Oc||(Oc={}));const Rc=Cc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Dc=e=>{switch(typeof e){case"undefined":return Rc.undefined;case"string":return Rc.string;case"number":return Number.isNaN(e)?Rc.nan:Rc.number;case"boolean":return Rc.boolean;case"function":return Rc.function;case"bigint":return Rc.bigint;case"symbol":return Rc.symbol;case"object":return Array.isArray(e)?Rc.array:null===e?Rc.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Rc.promise:"undefined"!=typeof Map&&e instanceof Map?Rc.map:"undefined"!=typeof Set&&e instanceof Set?Rc.set:"undefined"!=typeof Date&&e instanceof Date?Rc.date:Rc.object;default:return Rc.unknown}},Lc=Cc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Pc extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(r);else if("invalid_return_type"===s.code)r(s.returnTypeError);else if("invalid_arguments"===s.code)r(s.argumentsError);else if(0===s.path.length)n._errors.push(t(s));else{let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof Pc))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Cc.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t=Object.create(null),n=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Pc.create=e=>new Pc(e);const Mc=(e,t)=>{let n;switch(e.code){case Lc.invalid_type:n=e.received===Rc.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Lc.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Cc.jsonStringifyReplacer)}`;break;case Lc.unrecognized_keys:n=`Unrecognized key(s) in object: ${Cc.joinValues(e.keys,", ")}`;break;case Lc.invalid_union:n="Invalid input";break;case Lc.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Cc.joinValues(e.options)}`;break;case Lc.invalid_enum_value:n=`Invalid enum value. Expected ${Cc.joinValues(e.options)}, received '${e.received}'`;break;case Lc.invalid_arguments:n="Invalid function arguments";break;case Lc.invalid_return_type:n="Invalid function return type";break;case Lc.invalid_date:n="Invalid date";break;case Lc.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Cc.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Lc.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Lc.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Lc.custom:n="Invalid input";break;case Lc.invalid_intersection_types:n="Intersection results could not be merged";break;case Lc.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Lc.not_finite:n="Number must be finite";break;default:n=t.defaultError,Cc.assertNever(e)}return{message:n}};let Fc=Mc;function zc(e,t){const n=Fc,r=(e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],a={...s,path:i};if(void 0!==s.message)return{...s,path:i,message:s.message};let o="";const l=r.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(a,{data:t,defaultError:o}).message;return{...s,path:i,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Mc?void 0:Mc].filter((e=>!!e))});e.common.issues.push(r)}class Bc{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return Uc;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return Bc.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:s}=r;if("aborted"===t.status)return Uc;if("aborted"===s.status)return Uc;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!r.alwaysSet||(n[t.value]=s.value)}return{status:e.value,value:n}}}const Uc=Object.freeze({status:"aborted"}),Hc=e=>({status:"dirty",value:e}),jc=e=>({status:"valid",value:e}),$c=e=>"aborted"===e.status,Zc=e=>"dirty"===e.status,Gc=e=>"valid"===e.status,Vc=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Yc;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(Yc||(Yc={}));class qc{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Wc=(e,t)=>{if(Gc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Pc(e.common.issues);return this._error=t,this._error}}};function Kc(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{const{message:i}=e;return"invalid_enum_value"===t.code?{message:i??s.defaultError}:void 0===s.data?{message:i??r??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:i??n??s.defaultError}},description:s}}class Qc{get description(){return this._def.description}_getType(e){return Dc(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Dc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Bc,ctx:{common:e.parent.common,data:e.data,parsedType:Dc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Vc(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Dc(e)},r=this._parseSync({data:e,path:n.path,parent:n});return Wc(n,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Dc(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return Gc(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>Gc(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Dc(e)},r=this._parse({data:e,path:n.path,parent:n}),s=await(Vc(r)?r:Promise.resolve(r));return Wc(n,s)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const s=e(t),i=()=>r.addIssue({code:Lc.custom,...n(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new qu({schema:this,typeName:rd.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Wu.create(this,this._def)}nullable(){return Ku.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Du.create(this)}promise(){return Yu.create(this,this._def)}or(e){return Mu.create([this,e],this._def)}and(e){return zu.create(this,e,this._def)}transform(e){return new qu({...Kc(this._def),schema:this,typeName:rd.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Qu({...Kc(this._def),innerType:this,defaultValue:t,typeName:rd.ZodDefault})}brand(){return new ed({typeName:rd.ZodBranded,type:this,...Kc(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ju({...Kc(this._def),innerType:this,catchValue:t,typeName:rd.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return td.create(this,e)}readonly(){return nd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Jc=/^c[^\s-]{8,}$/i,Xc=/^[0-9a-z]+$/,eu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,tu=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nu=/^[a-z0-9_-]{21}$/i,ru=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,su=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,iu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let au;const ou=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,lu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,cu=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,uu=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,du=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pu=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hu="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fu=new RegExp(`^${hu}$`);function mu(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function gu(e){let t=`${hu}T${mu(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Eu(e,t){return!("v4"!==t&&t||!ou.test(e))||!("v6"!==t&&t||!cu.test(e))}function yu(e,t){if(!ru.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!("object"!=typeof s||null===s||"typ"in s&&"JWT"!==s?.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function _u(e,t){return!("v4"!==t&&t||!lu.test(e))||!("v6"!==t&&t||!uu.test(e))}class Tu extends Qc{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Rc.string){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.string,received:t.parsedType}),Uc}const t=new Bc;let n;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const s=e.data.length>r.value,i=e.data.length<r.value;(s||i)&&(n=this._getOrReturnCtx(e,n),s?zc(n,{code:Lc.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):i&&zc(n,{code:Lc.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)iu.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"email",code:Lc.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)au||(au=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),au.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"emoji",code:Lc.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)tu.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"uuid",code:Lc.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)nu.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"nanoid",code:Lc.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)Jc.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"cuid",code:Lc.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)Xc.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"cuid2",code:Lc.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)eu.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"ulid",code:Lc.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),zc(n,{validation:"url",code:Lc.invalid_string,message:r.message}),t.dirty()}else"regex"===r.kind?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"regex",code:Lc.invalid_string,message:r.message}),t.dirty())):"trim"===r.kind?e.data=e.data.trim():"includes"===r.kind?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):"toLowerCase"===r.kind?e.data=e.data.toLowerCase():"toUpperCase"===r.kind?e.data=e.data.toUpperCase():"startsWith"===r.kind?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):"endsWith"===r.kind?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):"datetime"===r.kind?gu(r).test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.invalid_string,validation:"datetime",message:r.message}),t.dirty()):"date"===r.kind?fu.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.invalid_string,validation:"date",message:r.message}),t.dirty()):"time"===r.kind?new RegExp(`^${mu(r)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.invalid_string,validation:"time",message:r.message}),t.dirty()):"duration"===r.kind?su.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"duration",code:Lc.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?Eu(e.data,r.version)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"ip",code:Lc.invalid_string,message:r.message}),t.dirty()):"jwt"===r.kind?yu(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"jwt",code:Lc.invalid_string,message:r.message}),t.dirty()):"cidr"===r.kind?_u(e.data,r.version)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"cidr",code:Lc.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?du.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"base64",code:Lc.invalid_string,message:r.message}),t.dirty()):"base64url"===r.kind?pu.test(e.data)||(n=this._getOrReturnCtx(e,n),zc(n,{validation:"base64url",code:Lc.invalid_string,message:r.message}),t.dirty()):Cc.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:Lc.invalid_string,...Yc.errToObj(n)})}_addCheck(e){return new Tu({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Yc.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Yc.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Yc.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Yc.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Yc.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Yc.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Yc.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Yc.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Yc.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Yc.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Yc.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Yc.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Yc.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Yc.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...Yc.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Yc.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Yc.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Yc.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Yc.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Yc.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Yc.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Yc.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Yc.errToObj(t)})}nonempty(e){return this.min(1,Yc.errToObj(e))}trim(){return new Tu({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Tu({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Tu({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function bu(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}Tu.create=e=>new Tu({checks:[],typeName:rd.ZodString,coerce:e?.coerce??!1,...Kc(e)});class ku extends Qc{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Rc.number){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.number,received:t.parsedType}),Uc}let t;const n=new Bc;for(const r of this._def.checks)"int"===r.kind?Cc.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),zc(t,{code:Lc.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),zc(t,{code:Lc.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),zc(t,{code:Lc.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==bu(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),zc(t,{code:Lc.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),zc(t,{code:Lc.not_finite,message:r.message}),n.dirty()):Cc.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Yc.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Yc.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Yc.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Yc.toString(t))}setLimit(e,t,n,r){return new ku({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Yc.toString(r)}]})}_addCheck(e){return new ku({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Yc.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Yc.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Yc.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Yc.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Yc.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Yc.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Yc.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Yc.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Yc.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Cc.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ku.create=e=>new ku({checks:[],typeName:rd.ZodNumber,coerce:e?.coerce||!1,...Kc(e)});class vu extends Qc{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Rc.bigint)return this._getInvalidInput(e);let t;const n=new Bc;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),zc(t,{code:Lc.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),zc(t,{code:Lc.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),zc(t,{code:Lc.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Cc.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.bigint,received:t.parsedType}),Uc}gte(e,t){return this.setLimit("min",e,!0,Yc.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Yc.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Yc.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Yc.toString(t))}setLimit(e,t,n,r){return new vu({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Yc.toString(r)}]})}_addCheck(e){return new vu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Yc.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Yc.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Yc.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Yc.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Yc.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}vu.create=e=>new vu({checks:[],typeName:rd.ZodBigInt,coerce:e?.coerce??!1,...Kc(e)});class Au extends Qc{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==Rc.boolean){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.boolean,received:t.parsedType}),Uc}return jc(e.data)}}Au.create=e=>new Au({typeName:rd.ZodBoolean,coerce:e?.coerce||!1,...Kc(e)});class xu extends Qc{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Rc.date){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.date,received:t.parsedType}),Uc}if(Number.isNaN(e.data.getTime()))return zc(this._getOrReturnCtx(e),{code:Lc.invalid_date}),Uc;const t=new Bc;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),zc(n,{code:Lc.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Cc.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xu({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Yc.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Yc.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}xu.create=e=>new xu({checks:[],coerce:e?.coerce||!1,typeName:rd.ZodDate,...Kc(e)});class Iu extends Qc{_parse(e){if(this._getType(e)!==Rc.symbol){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.symbol,received:t.parsedType}),Uc}return jc(e.data)}}Iu.create=e=>new Iu({typeName:rd.ZodSymbol,...Kc(e)});class Su extends Qc{_parse(e){if(this._getType(e)!==Rc.undefined){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.undefined,received:t.parsedType}),Uc}return jc(e.data)}}Su.create=e=>new Su({typeName:rd.ZodUndefined,...Kc(e)});class Nu extends Qc{_parse(e){if(this._getType(e)!==Rc.null){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.null,received:t.parsedType}),Uc}return jc(e.data)}}Nu.create=e=>new Nu({typeName:rd.ZodNull,...Kc(e)});class wu extends Qc{constructor(){super(...arguments),this._any=!0}_parse(e){return jc(e.data)}}wu.create=e=>new wu({typeName:rd.ZodAny,...Kc(e)});class Cu extends Qc{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jc(e.data)}}Cu.create=e=>new Cu({typeName:rd.ZodUnknown,...Kc(e)});class Ou extends Qc{_parse(e){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.never,received:t.parsedType}),Uc}}Ou.create=e=>new Ou({typeName:rd.ZodNever,...Kc(e)});class Ru extends Qc{_parse(e){if(this._getType(e)!==Rc.undefined){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.void,received:t.parsedType}),Uc}return jc(e.data)}}Ru.create=e=>new Ru({typeName:rd.ZodVoid,...Kc(e)});class Du extends Qc{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Rc.array)return zc(t,{code:Lc.invalid_type,expected:Rc.array,received:t.parsedType}),Uc;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,s=t.data.length<r.exactLength.value;(e||s)&&(zc(t,{code:e?Lc.too_big:Lc.too_small,minimum:s?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(zc(t,{code:Lc.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(zc(t,{code:Lc.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new qc(t,e,t.path,n))))).then((e=>Bc.mergeArray(n,e)));const s=[...t.data].map(((e,n)=>r.type._parseSync(new qc(t,e,t.path,n))));return Bc.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new Du({...this._def,minLength:{value:e,message:Yc.toString(t)}})}max(e,t){return new Du({...this._def,maxLength:{value:e,message:Yc.toString(t)}})}length(e,t){return new Du({...this._def,exactLength:{value:e,message:Yc.toString(t)}})}nonempty(e){return this.min(1,e)}}function Lu(e){if(e instanceof Pu){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Wu.create(Lu(r))}return new Pu({...e._def,shape:()=>t})}return e instanceof Du?new Du({...e._def,type:Lu(e.element)}):e instanceof Wu?Wu.create(Lu(e.unwrap())):e instanceof Ku?Ku.create(Lu(e.unwrap())):e instanceof Bu?Bu.create(e.items.map((e=>Lu(e)))):e}Du.create=(e,t)=>new Du({type:e,minLength:null,maxLength:null,exactLength:null,typeName:rd.ZodArray,...Kc(t)});class Pu extends Qc{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Cc.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Rc.object){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.object,received:t.parsedType}),Uc}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof Ou&&"strip"===this._def.unknownKeys))for(const e in n.data)s.includes(e)||i.push(e);const a=[];for(const e of s){const t=r[e],s=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new qc(n,s,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Ou){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(zc(n,{code:Lc.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new qc(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>Bc.mergeObjectSync(t,e))):Bc.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Yc.errToObj,new Pu({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const r=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:Yc.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new Pu({...this._def,unknownKeys:"strip"})}passthrough(){return new Pu({...this._def,unknownKeys:"passthrough"})}extend(e){return new Pu({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Pu({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:rd.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Pu({...this._def,catchall:e})}pick(e){const t={};for(const n of Cc.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new Pu({...this._def,shape:()=>t})}omit(e){const t={};for(const n of Cc.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new Pu({...this._def,shape:()=>t})}deepPartial(){return Lu(this)}partial(e){const t={};for(const n of Cc.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new Pu({...this._def,shape:()=>t})}required(e){const t={};for(const n of Cc.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Wu;)e=e._def.innerType;t[n]=e}return new Pu({...this._def,shape:()=>t})}keyof(){return Zu(Cc.objectKeys(this.shape))}}Pu.create=(e,t)=>new Pu({shape:()=>e,unknownKeys:"strip",catchall:Ou.create(),typeName:rd.ZodObject,...Kc(t)}),Pu.strictCreate=(e,t)=>new Pu({shape:()=>e,unknownKeys:"strict",catchall:Ou.create(),typeName:rd.ZodObject,...Kc(t)}),Pu.lazycreate=(e,t)=>new Pu({shape:e,unknownKeys:"strip",catchall:Ou.create(),typeName:rd.ZodObject,...Kc(t)});class Mu extends Qc{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new Pc(e.ctx.common.issues)));return zc(t,{code:Lc.invalid_union,unionErrors:n}),Uc}));{let e;const r=[];for(const s of n){const n={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=r.map((e=>new Pc(e)));return zc(t,{code:Lc.invalid_union,unionErrors:s}),Uc}}get options(){return this._def.options}}function Fu(e,t){const n=Dc(e),r=Dc(t);if(e===t)return{valid:!0,data:e};if(n===Rc.object&&r===Rc.object){const n=Cc.objectKeys(t),r=Cc.objectKeys(e).filter((e=>-1!==n.indexOf(e))),s={...e,...t};for(const n of r){const r=Fu(e[n],t[n]);if(!r.valid)return{valid:!1};s[n]=r.data}return{valid:!0,data:s}}if(n===Rc.array&&r===Rc.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const s=Fu(e[r],t[r]);if(!s.valid)return{valid:!1};n.push(s.data)}return{valid:!0,data:n}}return n===Rc.date&&r===Rc.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}Mu.create=(e,t)=>new Mu({options:e,typeName:rd.ZodUnion,...Kc(t)});class zu extends Qc{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if($c(e)||$c(r))return Uc;const s=Fu(e.value,r.value);return s.valid?((Zc(e)||Zc(r))&&t.dirty(),{status:t.value,value:s.data}):(zc(n,{code:Lc.invalid_intersection_types}),Uc)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}zu.create=(e,t,n)=>new zu({left:e,right:t,typeName:rd.ZodIntersection,...Kc(n)});class Bu extends Qc{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rc.array)return zc(n,{code:Lc.invalid_type,expected:Rc.array,received:n.parsedType}),Uc;if(n.data.length<this._def.items.length)return zc(n,{code:Lc.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Uc;!this._def.rest&&n.data.length>this._def.items.length&&(zc(n,{code:Lc.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new qc(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Bc.mergeArray(t,e))):Bc.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Bu({...this._def,rest:e})}}Bu.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bu({items:e,typeName:rd.ZodTuple,rest:null,...Kc(t)})};class Uu extends Qc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rc.map)return zc(n,{code:Lc.invalid_type,expected:Rc.map,received:n.parsedType}),Uc;const r=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map((([e,t],i)=>({key:r._parse(new qc(n,e,n.path,[i,"key"])),value:s._parse(new qc(n,t,n.path,[i,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const r=await n.key,s=await n.value;if("aborted"===r.status||"aborted"===s.status)return Uc;"dirty"!==r.status&&"dirty"!==s.status||t.dirty(),e.set(r.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of i){const r=n.key,s=n.value;if("aborted"===r.status||"aborted"===s.status)return Uc;"dirty"!==r.status&&"dirty"!==s.status||t.dirty(),e.set(r.value,s.value)}return{status:t.value,value:e}}}}Uu.create=(e,t,n)=>new Uu({valueType:t,keyType:e,typeName:rd.ZodMap,...Kc(n)});class Hu extends Qc{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rc.set)return zc(n,{code:Lc.invalid_type,expected:Rc.set,received:n.parsedType}),Uc;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(zc(n,{code:Lc.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(zc(n,{code:Lc.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function i(e){const n=new Set;for(const r of e){if("aborted"===r.status)return Uc;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>s._parse(new qc(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>i(e))):i(a)}min(e,t){return new Hu({...this._def,minSize:{value:e,message:Yc.toString(t)}})}max(e,t){return new Hu({...this._def,maxSize:{value:e,message:Yc.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Hu.create=(e,t)=>new Hu({valueType:e,minSize:null,maxSize:null,typeName:rd.ZodSet,...Kc(t)});class ju extends Qc{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ju.create=(e,t)=>new ju({getter:e,typeName:rd.ZodLazy,...Kc(t)});class $u extends Qc{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return zc(t,{received:t.data,code:Lc.invalid_literal,expected:this._def.value}),Uc}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Zu(e,t){return new Gu({values:e,typeName:rd.ZodEnum,...Kc(t)})}$u.create=(e,t)=>new $u({value:e,typeName:rd.ZodLiteral,...Kc(t)});class Gu extends Qc{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return zc(t,{expected:Cc.joinValues(n),received:t.parsedType,code:Lc.invalid_type}),Uc}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return zc(t,{received:t.data,code:Lc.invalid_enum_value,options:n}),Uc}return jc(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Gu.create(e,{...this._def,...t})}exclude(e,t=this._def){return Gu.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}Gu.create=Zu;class Vu extends Qc{_parse(e){const t=Cc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Rc.string&&n.parsedType!==Rc.number){const e=Cc.objectValues(t);return zc(n,{expected:Cc.joinValues(e),received:n.parsedType,code:Lc.invalid_type}),Uc}if(this._cache||(this._cache=new Set(Cc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=Cc.objectValues(t);return zc(n,{received:n.data,code:Lc.invalid_enum_value,options:e}),Uc}return jc(e.data)}get enum(){return this._def.values}}Vu.create=(e,t)=>new Vu({values:e,typeName:rd.ZodNativeEnum,...Kc(t)});class Yu extends Qc{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Rc.promise&&!1===t.common.async)return zc(t,{code:Lc.invalid_type,expected:Rc.promise,received:t.parsedType}),Uc;const n=t.parsedType===Rc.promise?t.data:Promise.resolve(t.data);return jc(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Yu.create=(e,t)=>new Yu({type:e,typeName:rd.ZodPromise,...Kc(t)});class qu extends Qc{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===rd.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:e=>{zc(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===r.type){const e=r.transform(n.data,s);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return Uc;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?Uc:"dirty"===r.status||"dirty"===t.value?Hc(r.value):r}));{if("aborted"===t.value)return Uc;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?Uc:"dirty"===r.status||"dirty"===t.value?Hc(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?Uc:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?Uc:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Gc(e))return Uc;const i=r.transform(e.value,s);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>Gc(e)?Promise.resolve(r.transform(e.value,s)).then((e=>({status:t.value,value:e}))):Uc))}Cc.assertNever(r)}}qu.create=(e,t,n)=>new qu({schema:e,typeName:rd.ZodEffects,effect:t,...Kc(n)}),qu.createWithPreprocess=(e,t,n)=>new qu({schema:t,effect:{type:"preprocess",transform:e},typeName:rd.ZodEffects,...Kc(n)});class Wu extends Qc{_parse(e){return this._getType(e)===Rc.undefined?jc(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Wu.create=(e,t)=>new Wu({innerType:e,typeName:rd.ZodOptional,...Kc(t)});class Ku extends Qc{_parse(e){return this._getType(e)===Rc.null?jc(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ku.create=(e,t)=>new Ku({innerType:e,typeName:rd.ZodNullable,...Kc(t)});class Qu extends Qc{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Rc.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Qu.create=(e,t)=>new Qu({innerType:e,typeName:rd.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Kc(t)});class Ju extends Qc{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Vc(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new Pc(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new Pc(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ju.create=(e,t)=>new Ju({innerType:e,typeName:rd.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Kc(t)});class Xu extends Qc{_parse(e){if(this._getType(e)!==Rc.nan){const t=this._getOrReturnCtx(e);return zc(t,{code:Lc.invalid_type,expected:Rc.nan,received:t.parsedType}),Uc}return{status:"valid",value:e.data}}}Xu.create=e=>new Xu({typeName:rd.ZodNaN,...Kc(e)}),Symbol("zod_brand");class ed extends Qc{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class td extends Qc{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Uc:"dirty"===e.status?(t.dirty(),Hc(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Uc:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new td({in:e,out:t,typeName:rd.ZodPipeline})}}class nd extends Qc{_parse(e){const t=this._def.innerType._parse(e),n=e=>(Gc(e)&&(e.value=Object.freeze(e.value)),e);return Vc(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}var rd;nd.create=(e,t)=>new nd({innerType:e,typeName:rd.ZodReadonly,...Kc(t)}),Pu.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(rd||(rd={})),Tu.create,ku.create,Xu.create,vu.create,Au.create,xu.create,Iu.create,Su.create,Nu.create,wu.create,Cu.create,Ou.create,Ru.create,Du.create,Pu.create,Pu.strictCreate,Mu.create,zu.create,Bu.create,Uu.create,Hu.create,ju.create,$u.create,Gu.create,Vu.create,Yu.create,qu.create,Wu.create,Ku.create,qu.createWithPreprocess,td.create;class sd extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function id(e){}class ad extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(s){r=function(e){if("function"==typeof e)throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=id,onError:n=id,onRetry:r=id,onComment:s}=e;let i,a="",o=!0,l="",c="";function u(e){if(""===e)return l.length>0&&t({id:i,event:c||void 0,data:l.endsWith("\n")?l.slice(0,-1):l}),i=void 0,l="",void(c="");if(e.startsWith(":"))return void(s&&s(e.slice(e.startsWith(": ")?2:1)));const n=e.indexOf(":");if(-1===n)d(e,"",e);else{const t=e.slice(0,n),r=" "===e[n+1]?2:1;d(t,e.slice(n+r),e)}}function d(e,t,s){switch(e){case"event":c=t;break;case"data":l=`${l}${t}\n`;break;case"id":i=t.includes("\0")?void 0:t;break;case"retry":/^\d+$/.test(t)?r(parseInt(t,10)):n(new sd(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:s}));break;default:n(new sd(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:"unknown-field",field:e,value:t,line:s}))}}return{feed:function(e){const t=o?e.replace(/^\xEF\xBB\xBF/,""):e,[n,r]=function(e){const t=[];let n="",r=0;for(;r<e.length;){const s=e.indexOf("\r",r),i=e.indexOf("\n",r);let a=-1;if(-1!==s&&-1!==i?a=Math.min(s,i):-1!==s?a=s===e.length-1?-1:s:-1!==i&&(a=i),-1===a){n=e.slice(r);break}{const n=e.slice(r,a);t.push(n),r=a+1,"\r"===e[r-1]&&"\n"===e[r]&&r++}}return[t,n]}(`${a}${t}`);for(const e of n)u(e);a=r,o=!1},reset:function(e={}){a&&e.consume&&u(a),o=!0,i=void 0,l="",c="",a=""}}}({onEvent:e=>{s.enqueue(e)},onError(t){"terminate"===e?s.error(t):"function"==typeof e&&e(t)},onRetry:t,onComment:n})},transform(e){r.feed(e)}})}}var{btoa:od,atob:ld}=globalThis,cd=Symbol.for("vercel.ai.error.AI_DownloadError");var ud=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const e=n.length,r=new Array(t);for(let s=0;s<t;s++)r[s]=n[Math.random()*e|0];return r.join("")};if(null==e)return s;if(n.includes(r))throw new x({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${s()}`},dd=ud();function pd(e=globalThis){var t,n,r;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(r=null==(n=e.process)?void 0:n.versions)?void 0:r.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function hd(e){if(null==e)return{};const t={};if(e instanceof Headers)e.forEach(((e,n)=>{t[n.toLowerCase()]=e}));else{Array.isArray(e)||(e=Object.entries(e));for(const[n,r]of e)null!=r&&(t[n.toLowerCase()]=r)}return t}function fd(e,...t){const n=new Headers(hd(e)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var md=/"__proto__"\s*:/,gd=/"constructor"\s*:/;function Ed(e){const t=JSON.parse(e);return null===t||"object"!=typeof t||!1===md.test(e)&&!1===gd.test(e)?t:function(e){let t=[e];for(;t.length;){const e=t;t=[];for(const n of e){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const e in n){const r=n[e];r&&"object"==typeof r&&t.push(r)}}}return e}(t)}function yd(e){if("object"===e.type||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:t}=e;if(null!=t)for(const e of Object.keys(t))t[e]=_d(t[e])}null!=e.items&&(e.items=Array.isArray(e.items)?e.items.map(_d):_d(e.items)),null!=e.anyOf&&(e.anyOf=e.anyOf.map(_d)),null!=e.allOf&&(e.allOf=e.allOf.map(_d)),null!=e.oneOf&&(e.oneOf=e.oneOf.map(_d));const{definitions:t}=e;if(null!=t)for(const e of Object.keys(t))t[e]=_d(t[e]);return e}function _d(e){return"boolean"==typeof e?e:yd(e)}var Td=Symbol("Let zodToJsonSchema decide on which parser to use"),bd={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function kd(e,t){return Yd(e.type._def,t)}function vd(e,t,n){const r=null!=n?n:t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(((n,r)=>vd(e,t,n)))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Ad(e)}}var Ad=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value}return t},xd=void 0,Id=/^[cC][^\s-]{8,}$/,Sd=/^[0-9a-z]+$/,Nd=/^[0-9A-HJKMNP-TV-Z]{26}$/,wd=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,Cd=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Od=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rd=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dd=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ld=/^[a-zA-Z0-9_-]{21}$/,Pd=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function Md(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":Bd(n,"email",r.message,t);break;case"format:idn-email":Bd(n,"idn-email",r.message,t);break;case"pattern:zod":Ud(n,wd,r.message,t)}break;case"url":Bd(n,"uri",r.message,t);break;case"uuid":Bd(n,"uuid",r.message,t);break;case"regex":Ud(n,r.regex,r.message,t);break;case"cuid":Ud(n,Id,r.message,t);break;case"cuid2":Ud(n,Sd,r.message,t);break;case"startsWith":Ud(n,RegExp(`^${Fd(r.value,t)}`),r.message,t);break;case"endsWith":Ud(n,RegExp(`${Fd(r.value,t)}$`),r.message,t);break;case"datetime":Bd(n,"date-time",r.message,t);break;case"date":Bd(n,"date",r.message,t);break;case"time":Bd(n,"time",r.message,t);break;case"duration":Bd(n,"duration",r.message,t);break;case"length":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,r.value):r.value,n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,r.value):r.value;break;case"includes":Ud(n,RegExp(Fd(r.value,t)),r.message,t);break;case"ip":"v6"!==r.version&&Bd(n,"ipv4",r.message,t),"v4"!==r.version&&Bd(n,"ipv6",r.message,t);break;case"base64url":Ud(n,Dd,r.message,t);break;case"jwt":Ud(n,Pd,r.message,t);break;case"cidr":"v6"!==r.version&&Ud(n,Cd,r.message,t),"v4"!==r.version&&Ud(n,Od,r.message,t);break;case"emoji":Ud(n,(void 0===xd&&(xd=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),xd),r.message,t);break;case"ulid":Ud(n,Nd,r.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":Bd(n,"binary",r.message,t);break;case"contentEncoding:base64":n.contentEncoding="base64";break;case"pattern:zod":Ud(n,Rd,r.message,t)}break;case"nanoid":Ud(n,Ld,r.message,t)}return n}function Fd(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let n=0;n<e.length;n++)zd.has(e[n])||(t+="\\"),t+=e[n];return t}(e):e}var zd=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Bd(e,t,n,r){var s;e.format||(null==(s=e.anyOf)?void 0:s.some((e=>e.format)))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function Ud(e,t,n,r){var s;e.pattern||(null==(s=e.allOf)?void 0:s.some((e=>e.pattern)))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:Hd(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=Hd(t,r)}function Hd(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const r=e.flags.includes("i"),s=e.flags.includes("m"),i=e.flags.includes("s"),a=r?e.source.toLowerCase():e.source;let o="",l=!1,c=!1,u=!1;for(let e=0;e<a.length;e++)if(l)o+=a[e],l=!1;else{if(r)if(c){if(a[e].match(/[a-z]/)){u?(o+=a[e],o+=`${a[e-2]}-${a[e]}`.toUpperCase(),u=!1):"-"===a[e+1]&&(null==(n=a[e+2])?void 0:n.match(/[a-z]/))?(o+=a[e],u=!0):o+=`${a[e]}${a[e].toUpperCase()}`;continue}}else if(a[e].match(/[a-z]/)){o+=`[${a[e]}${a[e].toUpperCase()}]`;continue}if(s){if("^"===a[e]){o+="(^|(?<=[\r\n]))";continue}if("$"===a[e]){o+="($|(?=[\r\n]))";continue}}i&&"."===a[e]?o+=c?`${a[e]}\r\n`:`[${a[e]}\r\n]`:(o+=a[e],"\\"===a[e]?l=!0:c&&"]"===a[e]?c=!1:c||"["!==a[e]||(c=!0))}try{new RegExp(o)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function jd(e,t){var n,r,s,i,a,o;const l={type:"object",additionalProperties:null!=(n=Yd(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if((null==(r=e.keyType)?void 0:r._def.typeName)===rd.ZodString&&(null==(s=e.keyType._def.checks)?void 0:s.length)){const{type:n,...r}=Md(e.keyType._def,t);return{...l,propertyNames:r}}if((null==(i=e.keyType)?void 0:i._def.typeName)===rd.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(a=e.keyType)?void 0:a._def.typeName)===rd.ZodBranded&&e.keyType._def.type._def.typeName===rd.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){const{type:n,...r}=kd(e.keyType._def,t);return{...l,propertyNames:r}}return l}var $d={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Zd(e){try{return e.isOptional()}catch(e){return!0}}var Gd=(e,t,n)=>{switch(t){case rd.ZodString:return Md(e,n);case rd.ZodNumber:return function(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case rd.ZodObject:return function(e,t){const n={type:"object",properties:{}},r=[],s=e.shape();for(const e in s){let i=s[e];if(void 0===i||void 0===i._def)continue;const a=Zd(i),o=Yd(i._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(n.properties[e]=o,a||r.push(e))}r.length&&(n.required=r);const i=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return Yd(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==i&&(n.additionalProperties=i),n}(e,n);case rd.ZodBigInt:return function(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case rd.ZodBoolean:return{type:"boolean"};case rd.ZodDate:return vd(e,n);case rd.ZodUndefined:return{not:{}};case rd.ZodNull:return{type:"null"};case rd.ZodArray:return function(e,t){var n,r,s;const i={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(s=null==(r=e.type)?void 0:r._def)?void 0:s.typeName)!==rd.ZodAny&&(i.items=Yd(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(i.minItems=e.minLength.value),e.maxLength&&(i.maxItems=e.maxLength.value),e.exactLength&&(i.minItems=e.exactLength.value,i.maxItems=e.exactLength.value),i}(e,n);case rd.ZodUnion:case rd.ZodDiscriminatedUnion:return function(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every((e=>e._def.typeName in $d&&(!e._def.checks||!e._def.checks.length)))){const e=n.reduce(((e,t)=>{const n=$d[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e}),[]);return{type:e.length>1?e:e[0]}}if(n.every((e=>"ZodLiteral"===e._def.typeName&&!e.description))){const e=n.reduce(((e,t)=>{const n=typeof t._def.value;switch(n){case"string":case"number":case"boolean":return[...e,n];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}}),[]);if(e.length===n.length){const t=e.filter(((e,t,n)=>n.indexOf(e)===t));return{type:t.length>1?t:t[0],enum:n.reduce(((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value]),[])}}}else if(n.every((e=>"ZodEnum"===e._def.typeName)))return{type:"string",enum:n.reduce(((e,t)=>[...e,...t._def.values.filter((t=>!e.includes(t)))]),[])};return((e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(((e,n)=>Yd(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]}))).filter((e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0)));return n.length?{anyOf:n}:void 0})(e,t)}(e,n);case rd.ZodIntersection:return function(e,t){const n=[Yd(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Yd(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((e=>!!e)),r=[];return n.forEach((e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:n,...r}=e;t=r}r.push(t)}else r.push(...e.allOf);var t})),r.length?{allOf:r}:void 0}(e,n);case rd.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(((e,n)=>Yd(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[]),additionalItems:Yd(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(((e,n)=>Yd(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[])}}(e,n);case rd.ZodRecord:return jd(e,n);case rd.ZodLiteral:return function(e){const t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case rd.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case rd.ZodNativeEnum:return function(e){const t=e.values,n=Object.keys(e.values).filter((e=>"number"!=typeof t[t[e]])).map((e=>t[e])),r=Array.from(new Set(n.map((e=>typeof e))));return{type:1===r.length?"string"===r[0]?"string":"number":["string","number"],enum:n}}(e);case rd.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[$d[e.innerType._def.typeName],"null"]};const n=Yd(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case rd.ZodOptional:return((e,t)=>{var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return Yd(e.innerType._def,t);const r=Yd(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}})(e,n);case rd.ZodMap:return function(e,t){return"record"===t.mapStrategy?jd(e,t):{type:"array",maxItems:125,items:{type:"array",items:[Yd(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},Yd(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,n);case rd.ZodSet:return function(e,t){const n={type:"array",uniqueItems:!0,items:Yd(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case rd.ZodLazy:return()=>e.getter()._def;case rd.ZodPromise:return function(e,t){return Yd(e.type._def,t)}(e,n);case rd.ZodNaN:case rd.ZodNever:return{not:{}};case rd.ZodEffects:return function(e,t){return"input"===t.effectStrategy?Yd(e.schema._def,t):{}}(e,n);case rd.ZodAny:case rd.ZodUnknown:return{};case rd.ZodDefault:return function(e,t){return{...Yd(e.innerType._def,t),default:e.defaultValue()}}(e,n);case rd.ZodBranded:return kd(e,n);case rd.ZodReadonly:case rd.ZodCatch:return((e,t)=>Yd(e.innerType._def,t))(e,n);case rd.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return Yd(e.in._def,t);if("output"===t.pipeStrategy)return Yd(e.out._def,t);const n=Yd(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[n,Yd(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]})].filter((e=>void 0!==e))}})(e,n);case rd.ZodFunction:case rd.ZodVoid:case rd.ZodSymbol:default:return}},Vd=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function Yd(e,t,n=!1){var r;const s=t.seen.get(e);if(t.override){const i=null==(r=t.override)?void 0:r.call(t,e,t,s,n);if(i!==Td)return i}if(s&&!n){const e=qd(s,t);if(void 0!==e)return e}const i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);const a=Gd(e,e.typeName,t),o="function"==typeof a?Yd(a(),t):a;if(o&&Wd(e,t,o),t.postProcess){const n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var qd=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Vd(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(((e,n)=>t.currentPath[n]===e))?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},Wd=(e,t,n)=>(e.description&&(n.description=e.description),n),Kd=Symbol.for("vercel.ai.schema");function Qd(e){let t;return()=>(null==t&&(t=e()),t)}function Jd(e,{validate:t}={}){return{[Kd]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function Xd(e){return null==e?Jd({properties:{},additionalProperties:!1}):"object"==typeof(n=e)&&null!==n&&Kd in n&&!0===n[Kd]&&"jsonSchema"in n&&"validate"in n?e:"~standard"in e?"zod"===e["~standard"].vendor?tp(e):(t=e,Jd((()=>yd(t["~standard"].jsonSchema.input({target:"draft-07"}))),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new G({value:e,cause:n.issues})}}})):e();var t,n}function ep(e,t){var n;const r=null!=(n=null==t?void 0:t.useReferences)&&n;return Jd((()=>((e,t)=>{var n;const r=(e=>{const t=(e=>"string"==typeof e?{...bd,name:e}:{...bd,...e})(e),n=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map((([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}])))}})(t);let s="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce(((e,[t,n])=>{var s;return{...e,[t]:null!=(s=Yd(n._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0))?s:{}}}),{}):void 0;const i="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,a=null!=(n=Yd(e._def,void 0===i?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1))?n:{},o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(a.title=o);const l=void 0===i?s?{...a,[r.definitionPath]:s}:a:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...s,[i]:a}};return l.$schema="http://json-schema.org/draft-07/schema#",l})(e,{$refStrategy:r?"root":"none"})),{validate:async t=>{const n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function tp(e,t){return function(e){return"_zod"in e}(e)?function(e,t){var n;const r=null!=(n=null==t?void 0:t.useReferences)&&n;return Jd((()=>yd(function(e,t){if("_idmap"in e){const n=e,r=fi({...t,processors:sa}),s={};for(const e of n._idmap.entries()){const[t,n]=e;mi(n,r)}const i={},a={registry:n,uri:t?.uri,defs:s};r.external=a;for(const e of n._idmap.entries()){const[t,n]=e;gi(r,n),i[t]=Ei(r,n)}if(Object.keys(s).length>0){const e="draft-2020-12"===r.target?"$defs":"definitions";i.__shared={[e]:s}}return{schemas:i}}const n=fi({...t,processors:sa});return mi(e,n),gi(n,e),Ei(n,e)}(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"}))),{validate:async t=>{const n=await ya(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e,t):ep(e,t)}async function np({value:e,schema:t,context:n}){const r=await rp({value:e,schema:t,context:n});if(!r.success)throw G.wrap({value:e,cause:r.error,context:n});return r.value}async function rp({value:e,schema:t,context:n}){const r=Xd(t);try{if(null==r.validate)return{success:!0,value:e,rawValue:e};const t=await r.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:G.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:G.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function sp({text:e,schema:t}){try{const n=function(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return Ed(e)}try{return Ed(e)}finally{Error.stackTraceLimit=t}}(e);return null==t?{success:!0,value:n,rawValue:n}:await rp({value:n,schema:t})}catch(t){return{success:!1,error:R.isInstance(t)?t:new R({text:e,cause:t}),rawValue:void 0}}}async function ip(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var ap,op=Object.defineProperty,lp=(Symbol.for("vercel.ai.error.AI_InvalidArgumentError"),Symbol.for("vercel.ai.error.AI_InvalidStreamPartError"),Symbol.for("vercel.ai.error.AI_InvalidToolApprovalError"),Symbol.for("vercel.ai.error.AI_InvalidToolInputError"),Symbol.for("vercel.ai.error.AI_ToolCallNotFoundForApprovalError"),Symbol.for("vercel.ai.error.AI_MissingToolResultsError"),Symbol.for("vercel.ai.error.AI_NoImageGeneratedError"),"AI_NoObjectGeneratedError"),cp=`vercel.ai.error.${lp}`,up=Symbol.for(cp),dp=class extends d{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:s,finishReason:i}){super({name:lp,message:e,cause:t}),this[ap]=!0,this.text=n,this.response=r,this.usage=s,this.finishReason=i}static isInstance(e){return d.hasMarker(e,cp)}};ap=up;Symbol.for("vercel.ai.error.AI_NoOutputGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSpeechGeneratedError"),Symbol.for("vercel.ai.error.AI_NoTranscriptGeneratedError"),Symbol.for("vercel.ai.error.AI_NoVideoGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSuchToolError"),Symbol.for("vercel.ai.error.AI_ToolCallRepairError");var pp,hp="AI_UIMessageStreamError",fp=`vercel.ai.error.${hp}`,mp=Symbol.for(fp),gp=class extends d{constructor({chunkType:e,chunkId:t,message:n}){super({name:hp,message:n}),this[pp]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return d.hasMarker(e,fp)}};pp=mp;Symbol.for("vercel.ai.error.AI_InvalidDataContentError"),Symbol.for("vercel.ai.error.AI_InvalidMessageRoleError"),Symbol.for("vercel.ai.error.AI_MessageConversionError"),Symbol.for("vercel.ai.error.AI_RetryError");var Ep=hl([Ca(),xc(Uint8Array),xc(ArrayBuffer),Tc((e=>{var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n}),{message:"Must be a Buffer"})]),yp=hc((()=>hl([qo(),Ca(),wo(),Fo(),vl(Ca(),yp.optional()),al(yp)]))),_p=vl(Ca(),vl(Ca(),yp.optional())),Tp=cl({type:Ll("text"),text:Ca(),providerOptions:_p.optional()}),bp=cl({type:Ll("image"),image:hl([Ep,xc(URL)]),mediaType:Ca().optional(),providerOptions:_p.optional()}),kp=cl({type:Ll("file"),data:hl([Ep,xc(URL)]),filename:Ca().optional(),mediaType:Ca(),providerOptions:_p.optional()}),vp=cl({type:Ll("reasoning"),text:Ca(),providerOptions:_p.optional()}),Ap=cl({type:Ll("tool-call"),toolCallId:Ca(),toolName:Ca(),input:Jo(),providerOptions:_p.optional(),providerExecuted:Fo().optional()}),xp=El("type",[cl({type:Ll("text"),value:Ca(),providerOptions:_p.optional()}),cl({type:Ll("json"),value:yp,providerOptions:_p.optional()}),cl({type:Ll("execution-denied"),reason:Ca().optional(),providerOptions:_p.optional()}),cl({type:Ll("error-text"),value:Ca(),providerOptions:_p.optional()}),cl({type:Ll("error-json"),value:yp,providerOptions:_p.optional()}),cl({type:Ll("content"),value:al(hl([cl({type:Ll("text"),text:Ca(),providerOptions:_p.optional()}),cl({type:Ll("media"),data:Ca(),mediaType:Ca()}),cl({type:Ll("file-data"),data:Ca(),mediaType:Ca(),filename:Ca().optional(),providerOptions:_p.optional()}),cl({type:Ll("file-url"),url:Ca(),providerOptions:_p.optional()}),cl({type:Ll("file-id"),fileId:hl([Ca(),vl(Ca(),Ca())]),providerOptions:_p.optional()}),cl({type:Ll("image-data"),data:Ca(),mediaType:Ca(),providerOptions:_p.optional()}),cl({type:Ll("image-url"),url:Ca(),providerOptions:_p.optional()}),cl({type:Ll("image-file-id"),fileId:hl([Ca(),vl(Ca(),Ca())]),providerOptions:_p.optional()}),cl({type:Ll("custom"),providerOptions:_p.optional()})]))})]),Ip=cl({type:Ll("tool-result"),toolCallId:Ca(),toolName:Ca(),output:xp,providerOptions:_p.optional()}),Sp=cl({type:Ll("tool-approval-request"),approvalId:Ca(),toolCallId:Ca()}),Np=cl({type:Ll("tool-approval-response"),approvalId:Ca(),approved:Fo(),reason:Ca().optional()}),wp=cl({role:Ll("system"),content:Ca(),providerOptions:_p.optional()}),Cp=cl({role:Ll("user"),content:hl([Ca(),al(hl([Tp,bp,kp]))]),providerOptions:_p.optional()}),Op=cl({role:Ll("assistant"),content:hl([Ca(),al(hl([Tp,kp,vp,Ap,Ip,Sp]))]),providerOptions:_p.optional()}),Rp=cl({role:Ll("tool"),content:al(hl([Ip,Np])),providerOptions:_p.optional()});function Dp(e,t){if(void 0===e&&void 0===t)return;if(void 0===e)return t;if(void 0===t)return e;const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const s=t[r];if(void 0===s)continue;const i=r in e?e[r]:void 0,a=!(null===s||"object"!=typeof s||Array.isArray(s)||s instanceof Date||s instanceof RegExp),o=!(null==i||"object"!=typeof i||Array.isArray(i)||i instanceof Date||i instanceof RegExp);n[r]=a&&o?Dp(i,s):s}return n}function Lp(e){const t=["ROOT"];let n=-1,r=null;function s(e,s,i){switch(e){case'"':n=s,t.pop(),t.push(i),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=s,r=s,t.pop(),t.push(i),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=s,t.pop(),t.push(i),t.push("INSIDE_NUMBER");break;case"{":n=s,t.pop(),t.push(i),t.push("INSIDE_OBJECT_START");break;case"[":n=s,t.pop(),t.push(i),t.push("INSIDE_ARRAY_START")}}function i(e,r){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=r,t.pop()}}function a(e,r){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=r,t.pop()}}for(let o=0;o<e.length;o++){const l=e[o];switch(t[t.length-1]){case"ROOT":s(l,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(l){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===l&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":s(l,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":i(l,o);break;case"INSIDE_STRING":switch(l){case'"':t.pop(),n=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=o}break;case"INSIDE_ARRAY_START":"]"===l?(n=o,t.pop()):(n=o,s(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(l){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=o,t.pop();break;default:n=o}break;case"INSIDE_ARRAY_AFTER_COMMA":s(l,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=o;break;case"INSIDE_NUMBER":switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&a(l,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&a(l,o);break;default:t.pop()}break;case"INSIDE_LITERAL":{const s=e.substring(r,o+1);"false".startsWith(s)||"true".startsWith(s)||"null".startsWith(s)?n=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?i(l,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&a(l,o));break}}}let o=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case"INSIDE_STRING":o+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":o+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":o+="]";break;case"INSIDE_LITERAL":{const t=e.substring(r,e.length);"true".startsWith(t)?o+="true".slice(t.length):"false".startsWith(t)?o+="false".slice(t.length):"null".startsWith(t)&&(o+="null".slice(t.length))}}return o}async function Pp(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await sp({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await sp({text:Lp(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}hl([wp,Cp,Op,Rp]),((e,t)=>{for(var n in t)op(e,n,{get:t[n],enumerable:!0})})({},{array:()=>zp,choice:()=>Bp,json:()=>Up,object:()=>Fp,text:()=>Mp});var Mp=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:async({text:e})=>e,parsePartialOutput:async({text:e})=>({partial:e}),createElementStreamTransform(){}}),Fp=({schema:e,name:t,description:n})=>{const r=Xd(e);return{name:"object",responseFormat:ip(r.jsonSchema).then((e=>({type:"json",schema:e,...null!=t&&{name:t},...null!=n&&{description:n}}))),async parseCompleteOutput({text:e},t){const n=await sp({text:e});if(!n.success)throw new dp({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});const s=await rp({value:n.value,schema:r});if(!s.success)throw new dp({message:"No object generated: response did not match schema.",cause:s.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return s.value},async parsePartialOutput({text:e}){const t=await Pp(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value}}},createElementStreamTransform(){}}},zp=({element:e,name:t,description:n})=>{const r=Xd(e);return{name:"array",responseFormat:ip(r.jsonSchema).then((e=>{const{$schema:r,...s}=e;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}})),async parseCompleteOutput({text:e},t){const n=await sp({text:e});if(!n.success)throw new dp({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});const s=n.value;if(null==s||"object"!=typeof s||!("elements"in s)||!Array.isArray(s.elements))throw new dp({message:"No object generated: response did not match schema.",cause:new G({value:s,cause:"response must be an object with an elements array"}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});for(const n of s.elements){const s=await rp({value:n,schema:r});if(!s.success)throw new dp({message:"No object generated: response did not match schema.",cause:s.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason})}return s.elements},async parsePartialOutput({text:e}){const t=await Pp(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const e=t.value;if(null==e||"object"!=typeof e||!("elements"in e)||!Array.isArray(e.elements))return;const n="repaired-parse"===t.state&&e.elements.length>0?e.elements.slice(0,-1):e.elements,s=[];for(const e of n){const t=await rp({value:e,schema:r});t.success&&s.push(t.value)}return{partial:s}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},n){if(null!=t)for(;e<t.length;e++)n.enqueue(t[e])}})}}},Bp=({options:e,name:t,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}),async parseCompleteOutput({text:t},n){const r=await sp({text:t});if(!r.success)throw new dp({message:"No object generated: could not parse the response.",cause:r.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});const s=r.value;if(null==s||"object"!=typeof s||!("result"in s)||"string"!=typeof s.result||!e.includes(s.result))throw new dp({message:"No object generated: response did not match schema.",cause:new G({value:s,cause:"response must be an object that contains a choice value."}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return s.result},async parsePartialOutput({text:t}){const n=await Pp(t);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const t=n.value;if(null==t||"object"!=typeof t||!("result"in t)||"string"!=typeof t.result)return;const r=e.filter((e=>e.startsWith(t.result)));return"successful-parse"===n.state?r.includes(t.result)?{partial:t.result}:void 0:1===r.length?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),Up=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...null!=e&&{name:e},...null!=t&&{description:t}}),async parseCompleteOutput({text:e},t){const n=await sp({text:e});if(!n.success)throw new dp({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){const t=await Pp(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return void 0===t.value?void 0:{partial:t.value}}},createElementStreamTransform(){}});ud({prefix:"aitxt",size:24}),TransformStream;var Hp=Qd((()=>tp(hl([ul({type:Ll("text-start"),id:Ca(),providerMetadata:_p.optional()}),ul({type:Ll("text-delta"),id:Ca(),delta:Ca(),providerMetadata:_p.optional()}),ul({type:Ll("text-end"),id:Ca(),providerMetadata:_p.optional()}),ul({type:Ll("error"),errorText:Ca()}),ul({type:Ll("tool-input-start"),toolCallId:Ca(),toolName:Ca(),providerExecuted:Fo().optional(),providerMetadata:_p.optional(),dynamic:Fo().optional(),title:Ca().optional()}),ul({type:Ll("tool-input-delta"),toolCallId:Ca(),inputTextDelta:Ca()}),ul({type:Ll("tool-input-available"),toolCallId:Ca(),toolName:Ca(),input:Jo(),providerExecuted:Fo().optional(),providerMetadata:_p.optional(),dynamic:Fo().optional(),title:Ca().optional()}),ul({type:Ll("tool-input-error"),toolCallId:Ca(),toolName:Ca(),input:Jo(),providerExecuted:Fo().optional(),providerMetadata:_p.optional(),dynamic:Fo().optional(),errorText:Ca(),title:Ca().optional()}),ul({type:Ll("tool-approval-request"),approvalId:Ca(),toolCallId:Ca()}),ul({type:Ll("tool-output-available"),toolCallId:Ca(),output:Jo(),providerExecuted:Fo().optional(),dynamic:Fo().optional(),preliminary:Fo().optional()}),ul({type:Ll("tool-output-error"),toolCallId:Ca(),errorText:Ca(),providerExecuted:Fo().optional(),dynamic:Fo().optional()}),ul({type:Ll("tool-output-denied"),toolCallId:Ca()}),ul({type:Ll("reasoning-start"),id:Ca(),providerMetadata:_p.optional()}),ul({type:Ll("reasoning-delta"),id:Ca(),delta:Ca(),providerMetadata:_p.optional()}),ul({type:Ll("reasoning-end"),id:Ca(),providerMetadata:_p.optional()}),ul({type:Ll("source-url"),sourceId:Ca(),url:Ca(),title:Ca().optional(),providerMetadata:_p.optional()}),ul({type:Ll("source-document"),sourceId:Ca(),mediaType:Ca(),title:Ca(),filename:Ca().optional(),providerMetadata:_p.optional()}),ul({type:Ll("file"),url:Ca(),mediaType:Ca(),providerMetadata:_p.optional()}),ul({type:Tc((e=>"string"==typeof e&&e.startsWith("data-")),{message:'Type must start with "data-"'}),id:Ca().optional(),data:Jo(),transient:Fo().optional()}),ul({type:Ll("start-step")}),ul({type:Ll("finish-step")}),ul({type:Ll("start"),messageId:Ca().optional(),messageMetadata:Jo().optional()}),ul({type:Ll("finish"),finishReason:Ol(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Jo().optional()}),ul({type:Ll("abort"),reason:Ca().optional()}),ul({type:Ll("message-metadata"),messageMetadata:Jo()})]))));function jp(e){return e.type.startsWith("tool-")}function $p(e){return jp(e)||function(e){return"dynamic-tool"===e.type}(e)}function Zp(e){return e.type.split("-").slice(1).join("-")}function Gp({lastMessage:e,messageId:t}){return{message:"assistant"===(null==e?void 0:e.role)?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Vp({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:s,onToolCall:i,onData:a}){return e.pipeThrough(new TransformStream({async transform(e,o){await r((async({state:r,write:l})=>{var c,u,d,p;function h(e){const t=r.message.parts.filter($p).find((t=>t.toolCallId===e));if(null==t)throw new gp({chunkType:"tool-invocation",chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function f(e){var t;const n=r.message.parts.find((t=>jp(t)&&t.toolCallId===e.toolCallId)),s=e,i=n;null!=n?(n.state=e.state,i.input=s.input,i.output=s.output,i.errorText=s.errorText,i.rawInput=s.rawInput,i.preliminary=s.preliminary,void 0!==e.title&&(i.title=e.title),i.providerExecuted=null!=(t=s.providerExecuted)?t:n.providerExecuted,null!=s.providerMetadata&&(n.callProviderMetadata=s.providerMetadata)):r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,input:s.input,output:s.output,rawInput:s.rawInput,errorText:s.errorText,providerExecuted:s.providerExecuted,preliminary:s.preliminary,...null!=s.providerMetadata?{callProviderMetadata:s.providerMetadata}:{}})}function m(e){var t,n;const s=r.message.parts.find((t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId)),i=e,a=s;null!=s?(s.state=e.state,a.toolName=e.toolName,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=null!=(t=i.rawInput)?t:a.rawInput,a.preliminary=i.preliminary,void 0!==e.title&&(a.title=e.title),a.providerExecuted=null!=(n=i.providerExecuted)?n:s.providerExecuted,null!=i.providerMetadata&&(s.callProviderMetadata=i.providerMetadata)):r.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:i.input,output:i.output,errorText:i.errorText,preliminary:i.preliminary,providerExecuted:i.providerExecuted,title:e.title,...null!=i.providerMetadata?{callProviderMetadata:i.providerMetadata}:{}})}async function g(e){if(null!=e){const n=null!=r.message.metadata?Dp(r.message.metadata,e):e;null!=t&&await np({value:n,schema:t,context:{field:"message.metadata",entityId:r.message.id}}),r.message.metadata=n}}switch(e.type){case"text-start":{const t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeTextParts[e.id]=t,r.message.parts.push(t),l();break}case"text-delta":{const t=r.activeTextParts[e.id];if(null==t)throw new gp({chunkType:"text-delta",chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,l();break}case"text-end":{const t=r.activeTextParts[e.id];if(null==t)throw new gp({chunkType:"text-end",chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state="done",t.providerMetadata=null!=(u=e.providerMetadata)?u:t.providerMetadata,delete r.activeTextParts[e.id],l();break}case"reasoning-start":{const t={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),l();break}case"reasoning-delta":{const t=r.activeReasoningParts[e.id];if(null==t)throw new gp({chunkType:"reasoning-delta",chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,l();break}case"reasoning-end":{const t=r.activeReasoningParts[e.id];if(null==t)throw new gp({chunkType:"reasoning-end",chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=null!=(p=e.providerMetadata)?p:t.providerMetadata,t.state="done",delete r.activeReasoningParts[e.id],l();break}case"file":r.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url}),l();break;case"source-url":r.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),l();break;case"source-document":r.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),l();break;case"tool-input-start":{const t=r.message.parts.filter(jp);r.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title},e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,providerMetadata:e.providerMetadata}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,providerMetadata:e.providerMetadata}),l();break}case"tool-input-delta":{const t=r.partialToolCalls[e.toolCallId];if(null==t)throw new gp({chunkType:"tool-input-delta",chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;const{value:n}=await Pp(t.text);t.dynamic?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}):f({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}),l();break}case"tool-input-available":e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}),l(),i&&!e.providerExecuted&&await i({toolCall:e});break;case"tool-input-error":e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),l();break;case"tool-approval-request":{const t=h(e.toolCallId);t.state="approval-requested",t.approval={id:e.approvalId},l();break}case"tool-output-denied":h(e.toolCallId).state="output-denied",l();break;case"tool-output-available":{const t=h(e.toolCallId);"dynamic-tool"===t.type?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:t.title}):f({toolCallId:e.toolCallId,toolName:Zp(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,title:t.title}),l();break}case"tool-output-error":{const t=h(e.toolCallId);"dynamic-tool"===t.type?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}):f({toolCallId:e.toolCallId,toolName:Zp(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}),l();break}case"start-step":r.message.parts.push({type:"step-start"});break;case"finish-step":r.activeTextParts={},r.activeReasoningParts={};break;case"start":null!=e.messageId&&(r.message.id=e.messageId),await g(e.messageMetadata),null==e.messageId&&null==e.messageMetadata||l();break;case"finish":null!=e.finishReason&&(r.finishReason=e.finishReason),await g(e.messageMetadata),null!=e.messageMetadata&&l();break;case"message-metadata":await g(e.messageMetadata),null!=e.messageMetadata&&l();break;case"error":null==s||s(new Error(e.errorText));break;default:if(function(e){return e.type.startsWith("data-")}(e)){if(null!=(null==n?void 0:n[e.type])){const t=r.message.parts.findIndex((t=>"id"in t&&"data"in t&&t.id===e.id&&t.type===e.type)),s=t>=0?t:r.message.parts.length;await np({value:e.data,schema:n[e.type],context:{field:`message.parts[${s}].data`,entityName:e.type,entityId:e.id}})}const t=e;if(t.transient){null==a||a(t);break}const s=null!=t.id?r.message.parts.find((e=>t.type===e.type&&t.id===e.id)):void 0;null!=s?s.data=t.data:r.message.parts.push(t),null==a||a(t),l()}}o.enqueue(e)}))}}))}ud({prefix:"aitxt",size:24}),Qd((()=>tp(al(cl({id:Ca(),role:Ol(["system","user","assistant"]),metadata:Jo().optional(),parts:al(hl([cl({type:Ll("text"),text:Ca(),state:Ol(["streaming","done"]).optional(),providerMetadata:_p.optional()}),cl({type:Ll("reasoning"),text:Ca(),state:Ol(["streaming","done"]).optional(),providerMetadata:_p.optional()}),cl({type:Ll("source-url"),sourceId:Ca(),url:Ca(),title:Ca().optional(),providerMetadata:_p.optional()}),cl({type:Ll("source-document"),sourceId:Ca(),mediaType:Ca(),title:Ca(),filename:Ca().optional(),providerMetadata:_p.optional()}),cl({type:Ll("file"),mediaType:Ca(),filename:Ca().optional(),url:Ca(),providerMetadata:_p.optional()}),cl({type:Ll("step-start")}),cl({type:Ca().startsWith("data-"),id:Ca().optional(),data:Jo()}),cl({type:Ll("dynamic-tool"),toolName:Ca(),toolCallId:Ca(),state:Ll("input-streaming"),input:Jo().optional(),providerExecuted:Fo().optional(),callProviderMetadata:_p.optional(),output:el().optional(),errorText:el().optional(),approval:el().optional()}),cl({type:Ll("dynamic-tool"),toolName:Ca(),toolCallId:Ca(),state:Ll("input-available"),input:Jo(),providerExecuted:Fo().optional(),output:el().optional(),errorText:el().optional(),callProviderMetadata:_p.optional(),approval:el().optional()}),cl({type:Ll("dynamic-tool"),toolName:Ca(),toolCallId:Ca(),state:Ll("approval-requested"),input:Jo(),providerExecuted:Fo().optional(),output:el().optional(),errorText:el().optional(),callProviderMetadata:_p.optional(),approval:cl({id:Ca(),approved:el().optional(),reason:el().optional()})}),cl({type:Ll("dynamic-tool"),toolName:Ca(),toolCallId:Ca(),state:Ll("approval-responded"),input:Jo(),providerExecuted:Fo().optional(),output:el().optional(),errorText:el().optional(),callProviderMetadata:_p.optional(),approval:cl({id:Ca(),approved:Fo(),reason:Ca().optional()})}),cl({type:Ll("dynamic-tool"),toolName:Ca(),toolCallId:Ca(),state:Ll("output-available"),input:Jo(),providerExecuted:Fo().optional(),output:Jo(),errorText:el().optional(),callProviderMetadata:_p.optional(),preliminary:Fo().optional(),approval:cl({id:Ca(),approved:Ll(!0),reason:Ca().optional()}).optional()}),cl({type:Ll("dynamic-tool"),toolName:Ca(),toolCallId:Ca(),state:Ll("output-error"),input:Jo(),rawInput:Jo().optional(),providerExecuted:Fo().optional(),output:el().optional(),errorText:Ca(),callProviderMetadata:_p.optional(),approval:cl({id:Ca(),approved:Ll(!0),reason:Ca().optional()}).optional()}),cl({type:Ll("dynamic-tool"),toolName:Ca(),toolCallId:Ca(),state:Ll("output-denied"),input:Jo(),providerExecuted:Fo().optional(),output:el().optional(),errorText:el().optional(),callProviderMetadata:_p.optional(),approval:cl({id:Ca(),approved:Ll(!1),reason:Ca().optional()})}),cl({type:Ca().startsWith("tool-"),toolCallId:Ca(),state:Ll("input-streaming"),providerExecuted:Fo().optional(),callProviderMetadata:_p.optional(),input:Jo().optional(),output:el().optional(),errorText:el().optional(),approval:el().optional()}),cl({type:Ca().startsWith("tool-"),toolCallId:Ca(),state:Ll("input-available"),providerExecuted:Fo().optional(),input:Jo(),output:el().optional(),errorText:el().optional(),callProviderMetadata:_p.optional(),approval:el().optional()}),cl({type:Ca().startsWith("tool-"),toolCallId:Ca(),state:Ll("approval-requested"),input:Jo(),providerExecuted:Fo().optional(),output:el().optional(),errorText:el().optional(),callProviderMetadata:_p.optional(),approval:cl({id:Ca(),approved:el().optional(),reason:el().optional()})}),cl({type:Ca().startsWith("tool-"),toolCallId:Ca(),state:Ll("approval-responded"),input:Jo(),providerExecuted:Fo().optional(),output:el().optional(),errorText:el().optional(),callProviderMetadata:_p.optional(),approval:cl({id:Ca(),approved:Fo(),reason:Ca().optional()})}),cl({type:Ca().startsWith("tool-"),toolCallId:Ca(),state:Ll("output-available"),providerExecuted:Fo().optional(),input:Jo(),output:Jo(),errorText:el().optional(),callProviderMetadata:_p.optional(),preliminary:Fo().optional(),approval:cl({id:Ca(),approved:Ll(!0),reason:Ca().optional()}).optional()}),cl({type:Ca().startsWith("tool-"),toolCallId:Ca(),state:Ll("output-error"),providerExecuted:Fo().optional(),input:Jo(),rawInput:Jo().optional(),output:el().optional(),errorText:Ca(),callProviderMetadata:_p.optional(),approval:cl({id:Ca(),approved:Ll(!0),reason:Ca().optional()}).optional()}),cl({type:Ca().startsWith("tool-"),toolCallId:Ca(),state:Ll("output-denied"),providerExecuted:Fo().optional(),input:Jo(),output:el().optional(),errorText:el().optional(),callProviderMetadata:_p.optional(),approval:cl({id:Ca(),approved:Ll(!1),reason:Ca().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")))),ud({prefix:"aiobj",size:24}),ud({prefix:"aiobj",size:24});Symbol.for("vercel.ai.error.AI_NoSuchProviderError");var Yp=class extends class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:s,prepareSendMessagesRequest:i,prepareReconnectToStreamRequest:a}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=s,this.prepareSendMessagesRequest=i,this.prepareReconnectToStreamRequest=a}async sendMessages({abortSignal:e,...t}){var n,r,s,i,a;const o=await ip(this.body),l=await ip(this.headers),c=await ip(this.credentials),u={...hd(l),...hd(t.headers)},d=await(null==(n=this.prepareSendMessagesRequest)?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...o,...t.body},headers:u,credentials:c,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),p=null!=(r=null==d?void 0:d.api)?r:this.api,h=void 0!==(null==d?void 0:d.headers)?hd(d.headers):u,f=void 0!==(null==d?void 0:d.body)?d.body:{...o,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},m=null!=(s=null==d?void 0:d.credentials)?s:c,g=null!=(i=this.fetch)?i:globalThis.fetch,E=await g(p,{method:"POST",headers:fd({"Content-Type":"application/json",...h},"ai-sdk/6.0.72",pd()),body:JSON.stringify(f),credentials:m,signal:e});if(!E.ok)throw new Error(null!=(a=await E.text())?a:"Failed to fetch the chat response.");if(!E.body)throw new Error("The response body is empty.");return this.processResponseStream(E.body)}async reconnectToStream(e){var t,n,r,s,i;const a=await ip(this.body),o=await ip(this.headers),l=await ip(this.credentials),c={...hd(o),...hd(e.headers)},u=await(null==(t=this.prepareReconnectToStreamRequest)?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...a,...e.body},headers:c,credentials:l,requestMetadata:e.metadata})),d=null!=(n=null==u?void 0:u.api)?n:`${this.api}/${e.chatId}/stream`,p=void 0!==(null==u?void 0:u.headers)?hd(u.headers):c,h=null!=(r=null==u?void 0:u.credentials)?r:l,f=null!=(s=this.fetch)?s:globalThis.fetch,m=await f(d,{method:"GET",headers:fd(p,"ai-sdk/6.0.72",pd()),credentials:h});if(204===m.status)return null;if(!m.ok)throw new Error(null!=(i=await m.text())?i:"Failed to fetch the chat response.");if(!m.body)throw new Error("The response body is empty.");return this.processResponseStream(m.body)}}{constructor(e={}){super(e)}processResponseStream(e){return function({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new ad).pipeThrough(new TransformStream({async transform({data:e},n){"[DONE]"!==e&&n.enqueue(await sp({text:e,schema:t}))}}))}({stream:e,schema:Hp}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},qp=class{constructor({generateId:e=dd,id:t=e(),transport:n=new Yp,messageMetadataSchema:r,dataPartSchemas:s,state:i,onError:a,onToolCall:o,onFinish:l,onData:c,sendAutomaticallyWhen:u}){this.activeResponse=void 0,this.jobExecutor=new class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise(((t,n)=>{this.queue.push((async()=>{try{await e(),t()}catch(e){n(e)}})),this.processQueue()}))}},this.sendMessage=async(e,t)=>{var n,r,s,i;if(null==e)return void await this.makeRequest({trigger:"submit-message",messageId:null==(n=this.lastMessage)?void 0:n.id,...t});let a;if("text"in e||"files"in e){const t=Array.isArray(e.files)?e.files:await async function(e){if(null==e)return[];if(!(globalThis.FileList&&e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map((async e=>{const{name:t,type:n}=e,r=await new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{var n;t(null==(n=e.target)?void 0:n.result)},r.onerror=e=>n(e),r.readAsDataURL(e)}));return{type:"file",mediaType:n,filename:t,url:r}})))}(e.files);a={parts:[...t,..."text"in e&&null!=e.text?[{type:"text",text:e.text}]:[]]}}else a=e;if(null!=e.messageId){const t=this.state.messages.findIndex((t=>t.id===e.messageId));if(-1===t)throw new Error(`message with id ${e.messageId} not found`);if("user"!==this.state.messages[t].role)throw new Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...a,id:e.messageId,role:null!=(r=a.role)?r:"user",metadata:e.metadata})}else this.state.pushMessage({...a,id:null!=(s=a.id)?s:this.generateId(),role:null!=(i=a.role)?i:"user",metadata:e.metadata});await this.makeRequest({trigger:"submit-message",messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{const n=null==e?this.state.messages.length-1:this.state.messages.findIndex((t=>t.id===e));if(-1===n)throw new Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,"assistant"===this.messages[n].role?n:n+1),await this.makeRequest({trigger:"regenerate-message",messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:"resume-stream",...e})},this.clearError=()=>{"error"===this.status&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n})=>this.jobExecutor.run((async()=>{const r=this.state.messages,s=r[r.length-1],i=r=>$p(r)&&"approval-requested"===r.state&&r.approval.id===e?{...r,state:"approval-responded",approval:{id:e,approved:t,reason:n}}:r;this.state.replaceMessage(r.length-1,{...s,parts:s.parts.map(i)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(i)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then((e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id})}))})),this.addToolOutput=async({state:e="output-available",tool:t,toolCallId:n,output:r,errorText:s})=>this.jobExecutor.run((async()=>{const t=this.state.messages,i=t[t.length-1],a=t=>$p(t)&&t.toolCallId===n?{...t,state:e,output:r,errorText:s}:t;this.state.replaceMessage(t.length-1,{...i,parts:i.parts.map(a)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(a)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then((e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id})}))})),this.addToolResult=this.addToolOutput,this.stop=async()=>{var e;"streaming"!==this.status&&"submitted"!==this.status||(null==(e=this.activeResponse)?void 0:e.abortController)&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=s,this.state=i,this.onError=a,this.onToolCall=o,this.onFinish=l,this.onData=c,this.sendAutomaticallyWhen=u}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;const e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&"object"==typeof e&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:s}){var i,a,o;this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let c=!1,u=!1,d=!1;try{const o={state:Gp({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};let p;if(o.abortController.signal.addEventListener("abort",(()=>{c=!0})),this.activeResponse=o,"resume-stream"===e){const e=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(null==e)return void this.setStatus({status:"ready"});p=e}else p=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:o.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:s});const h=e=>this.jobExecutor.run((()=>e({state:o.state,write:()=>{var e;this.setStatus({status:"streaming"}),o.state.message.id===(null==(e=this.lastMessage)?void 0:e.id)?this.state.replaceMessage(this.state.messages.length-1,o.state.message):this.state.pushMessage(o.state.message)}})));await async function({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:e}=await n.read();if(e)break}}catch(e){null==t||t(e)}finally{n.releaseLock()}}({stream:Vp({stream:p,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:h,onError:e=>{throw e}}),onError:e=>{throw e}}),this.setStatus({status:"ready"})}catch(e){if(c||"AbortError"===e.name)return c=!0,this.setStatus({status:"ready"}),null;d=!0,e instanceof TypeError&&(e.message.toLowerCase().includes("fetch")||e.message.toLowerCase().includes("network"))&&(u=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e})}finally{try{null==(a=this.onFinish)||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:u,isError:d,finishReason:null==(i=this.activeResponse)?void 0:i.state.finishReason})}catch(e){console.error(e)}this.activeResponse=void 0}!d&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:null==(o=this.lastMessage)?void 0:o.id,metadata:t,headers:n,body:r})}};function Wp({messages:e}){const t=e[e.length-1];if(!t)return!1;if("assistant"!==t.role)return!1;const n=t.parts.reduce(((e,t,n)=>"step-start"===t.type?n:e),-1),r=t.parts.slice(n+1).filter($p).filter((e=>!e.providerExecuted));return r.length>0&&r.every((e=>"output-available"===e.state||"output-error"===e.state))}},7989:(e,t,n)=>{"use strict";n.d(t,{A:()=>qf,C:()=>Qf,c:()=>Bp,f:()=>dh,l:()=>Xf});var r={};n.r(r),n.d(r,{boolean:()=>F,booleanish:()=>z,commaOrSpaceSeparated:()=>$,commaSeparated:()=>j,number:()=>U,overloadedBoolean:()=>B,spaceSeparated:()=>H});var s={};n.r(s),n.d(s,{attentionMarkers:()=>su,contentInitial:()=>Jc,disable:()=>iu,document:()=>Qc,flow:()=>eu,flowInitial:()=>Xc,insideSpan:()=>ru,string:()=>tu,text:()=>nu});var i=n(7294);const a=function(e){if(null==e)return l;if("function"==typeof e)return o(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=a(e[n]);return o((function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}))}(e):function(e){const t=e;return o((function(n){const r=n;let s;for(s in e)if(r[s]!==t[s])return!1;return!0}))}(e);if("string"==typeof e)return t=e,o((function(e){return e&&e.type===t}));var t;throw new Error("Expected function, string, or object as test")};function o(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function l(){return!0}const c=[],u=!0,d=!1,p="skip";function h(e,t,n,r){let s;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):s=t;const i=a(s),o=r?-1:1;!function e(s,a,l){const h=s&&"object"==typeof s?s:{};if("string"==typeof h.type){const e="string"==typeof h.tagName?h.tagName:"string"==typeof h.name?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+s.type+(e?"<"+e+">":"")+")"})}return f;function f(){let h,f,m,g=c;if((!t||i(s,a,l[l.length-1]||void 0))&&(g=function(e){return Array.isArray(e)?e:"number"==typeof e?[u,e]:null==e?c:[e]}(n(s,l)),g[0]===d))return g;if("children"in s&&s.children){const t=s;if(t.children&&g[0]!==p)for(f=(r?t.children.length:-1)+o,m=l.concat(t);f>-1&&f<t.children.length;){const n=t.children[f];if(h=e(n,f,m)(),h[0]===d)return h;f="number"==typeof h[1]?h[1]:f+o}}return g}}(e,void 0,[])()}function f(e,t,n,r){let s,i,a;"function"==typeof t&&"function"!=typeof n?(i=void 0,a=t,s=n):(i=t,a=n,s=r),h(e,i,(function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)}),s)}const m="text-only",g="remove";function E(e,t){if("string"!=typeof e)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}const y=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),_=new Set(["javascript:","data:","file:","vbscript:"]);function T(e,t,n,r=!1,s=!1,i=[]){if(!e)return null;if("string"==typeof e&&e.startsWith("#")&&!s)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if("string"==typeof e&&e.startsWith("data:"))return s&&r&&e.startsWith("data:image/")?e:null;if("string"==typeof e&&e.startsWith("blob:")){try{if("blob:"===new URL(e).protocol&&e.length>5){const t=e.substring(5);if(t&&t.length>0&&"invalid"!==t)return e}}catch{return null}return null}const a=E(e,n);if(!a)return null;if(_.has(a.protocol))return null;if(!(y.has(a.protocol)||i.includes(a.protocol)||i.includes("*")))return null;if("mailto:"===a.protocol||!a.protocol.match(/^https?:$/))return a.href;const o=function(e){return"string"==typeof e&&(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))}(e);return a&&t.some((e=>{const t=E(e,n);return!!t&&t.origin===a.origin&&a.href.startsWith(t.href)}))?o?a.pathname+a.search+a.hash:a.href:t.includes("*")?"https:"!==a.protocol&&"http:"!==a.protocol?null:o?a.pathname+a.search+a.hash:a.href:null}function b(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter((e=>null!=e));for(const t of e.children)b(t)}}const k=Symbol("node-seen"),v="object"==typeof self?self:globalThis,A=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=s=>{if(e.has(s))return e.get(s);const[i,a]=t[s];switch(i){case 0:case-1:return n(a,s);case 1:{const e=n([],s);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},s);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),s);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),s)}case 5:{const e=n(new Map,s);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,s);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new v[e](t),s)}case 8:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new v[i](a),s)};return r})(new Map,e)(0),x="",{toString:I}={},{keys:S}=Object,N=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=I.call(e).slice(8,-1);switch(n){case"Array":return[1,x];case"Object":return[2,x];case"Date":return[3,x];case"RegExp":return[4,x];case"Map":return[5,x];case"Set":return[6,x];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},w=([e,t])=>0===e&&("function"===t||"symbol"===t),C=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const s=(e,t)=>{const s=r.push(e)-1;return n.set(t,s),s},i=r=>{if(n.has(r))return n.get(r);let[a,o]=N(r);switch(a){case 0:{let t=r;switch(o){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);t=null;break;case"undefined":return s([-1],r)}return s([a,t],r)}case 1:{if(o){let e=r;return"DataView"===o?e=new Uint8Array(r.buffer):"ArrayBuffer"===o&&(e=new Uint8Array(r)),s([o,[...e]],r)}const e=[],t=s([a,e],r);for(const t of r)e.push(i(t));return t}case 2:{if(o)switch(o){case"BigInt":return s([o,r.toString()],r);case"Boolean":case"Number":case"String":return s([o,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],l=s([a,n],r);for(const t of S(r))!e&&w(N(r[t]))||n.push([i(t),i(r[t])]);return l}case 3:return s([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return s([a,{source:e,flags:t}],r)}case 5:{const t=[],n=s([a,t],r);for(const[n,s]of r)(e||!w(N(n))&&!w(N(s)))&&t.push([i(n),i(s)]);return n}case 6:{const t=[],n=s([a,t],r);for(const n of r)!e&&w(N(n))||t.push(i(n));return n}}const{message:l}=r;return s([a,{name:o,message:l}],r)};return i})(!(t||n),!!t,new Map,r)(e),r},O="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?A(C(e,t)):structuredClone(e):(e,t)=>A(C(e,t));class R{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function D(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new R(n,r,t)}function L(e){return e.toLowerCase()}R.prototype.normal={},R.prototype.property={},R.prototype.space=void 0;class P{constructor(e,t){this.attribute=t,this.property=e}}P.prototype.attribute="",P.prototype.booleanish=!1,P.prototype.boolean=!1,P.prototype.commaOrSpaceSeparated=!1,P.prototype.commaSeparated=!1,P.prototype.defined=!1,P.prototype.mustUseProperty=!1,P.prototype.number=!1,P.prototype.overloadedBoolean=!1,P.prototype.property="",P.prototype.spaceSeparated=!1,P.prototype.space=void 0;let M=0;const F=Z(),z=Z(),B=Z(),U=Z(),H=Z(),j=Z(),$=Z();function Z(){return 2**++M}const G=Object.keys(r);class V extends P{constructor(e,t,n,s){let i=-1;if(super(e,t),Y(this,"space",s),"number"==typeof n)for(;++i<G.length;){const e=G[i];Y(this,G[i],(n&r[e])===r[e])}}}function Y(e,t,n){n&&(e[t]=n)}function q(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new V(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[L(r)]=r,n[L(i.attribute)]=r}return new R(t,n,e.space)}V.prototype.defined=!0;const W=q({properties:{ariaActiveDescendant:null,ariaAtomic:z,ariaAutoComplete:null,ariaBusy:z,ariaChecked:z,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:H,ariaCurrent:null,ariaDescribedBy:H,ariaDetails:null,ariaDisabled:z,ariaDropEffect:H,ariaErrorMessage:null,ariaExpanded:z,ariaFlowTo:H,ariaGrabbed:z,ariaHasPopup:null,ariaHidden:z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:H,ariaLevel:U,ariaLive:null,ariaModal:z,ariaMultiLine:z,ariaMultiSelectable:z,ariaOrientation:null,ariaOwns:H,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:z,ariaReadOnly:z,ariaRelevant:null,ariaRequired:z,ariaRoleDescription:H,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:z,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function K(e,t){return t in e?e[t]:t}function Q(e,t){return K(e,t.toLowerCase())}const J=q({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:j,acceptCharset:H,accessKey:H,action:null,allow:null,allowFullScreen:F,allowPaymentRequest:F,allowUserMedia:F,alt:null,as:null,async:F,autoCapitalize:null,autoComplete:H,autoFocus:F,autoPlay:F,blocking:H,capture:null,charSet:null,checked:F,cite:null,className:H,cols:U,colSpan:null,content:null,contentEditable:z,controls:F,controlsList:H,coords:U|j,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F,defer:F,dir:null,dirName:null,disabled:F,download:B,draggable:z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F,formTarget:null,headers:H,height:U,hidden:B,high:U,href:null,hrefLang:null,htmlFor:H,httpEquiv:H,id:null,imageSizes:null,imageSrcSet:null,inert:F,inputMode:null,integrity:null,is:null,isMap:F,itemId:null,itemProp:H,itemRef:H,itemScope:F,itemType:H,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:F,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:F,muted:F,name:null,nonce:null,noModule:F,noValidate:F,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:F,optimum:U,pattern:null,ping:H,placeholder:null,playsInline:F,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F,referrerPolicy:null,rel:H,required:F,reversed:F,rows:U,rowSpan:U,sandbox:H,scope:null,scoped:F,seamless:F,selected:F,shadowRootClonable:F,shadowRootDelegatesFocus:F,shadowRootMode:null,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:F,useMap:null,value:z,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:H,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:F,declare:F,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:F,noHref:F,noShade:F,noWrap:F,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:z,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:F,disableRemotePlayback:F,prefix:null,property:null,results:U,security:null,unselectable:null},space:"html",transform:Q}),X=q({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:$,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:H,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:F,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:j,g2:j,glyphName:j,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:$,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:H,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$,rev:$,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$,requiredFeatures:$,requiredFonts:$,requiredFormats:$,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:$,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:K}),ee=q({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),te=q({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Q}),ne=q({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),re=D([W,J,ee,te,ne],"html"),se=D([W,X,ee,te,ne],"svg");function ie(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){-1===r&&(r=n.length,i=!0);const e=n.slice(s,r).trim();!e&&i||t.push(e),s=r+1,r=n.indexOf(",",s)}return t}function ae(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const oe=/[#.]/g,le=/[A-Z]/g,ce=/-[a-z]/g,ue=/^data[-\w.:]+$/i;function de(e,t){const n=L(t);let r=t,s=P;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&ue.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(ce,he);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!ce.test(e)){let n=e.replace(le,pe);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}s=V}return new s(r,t)}function pe(e){return"-"+e.toLowerCase()}function he(e){return e.charAt(1).toUpperCase()}function fe(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function me(e){return e.join(" ").trim()}function ge(e,t,n){const r=n?function(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}(n):void 0;return function(n,s,...i){let a;if(null==n){a={type:"root",children:[]};const e=s;i.unshift(e)}else{a=function(e,t){const n=e||"",r={};let s,i,a=0;for(;a<n.length;){oe.lastIndex=a;const e=oe.exec(n),t=n.slice(a,e?e.index:n.length);t&&(s?"#"===s?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:i=t,a+=t.length),e&&(s=e[0],a++)}return{type:"element",tagName:i||t||"div",properties:r,children:[]}}(n,t);const o=a.tagName.toLowerCase(),l=r?r.get(o):void 0;if(a.tagName=l||o,function(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!0;if("string"!=typeof e.type)return!1;const t=e,n=Object.keys(e);for(const e of n){const n=t[e];if(n&&"object"==typeof n){if(!Array.isArray(n))return!0;const e=n;for(const t of e)if("number"!=typeof t&&"string"!=typeof t)return!0}}return!(!("children"in e)||!Array.isArray(e.children))}(s))i.unshift(s);else for(const[t,n]of Object.entries(s))Ee(e,a.properties,t,n)}for(const e of i)ye(a.children,e);return"element"===a.type&&"template"===a.tagName&&(a.content={type:"root",children:a.children},a.children=[]),a}}function Ee(e,t,n,r){const s=de(e,n);let i;if(null!=r){if("number"==typeof r){if(Number.isNaN(r))return;i=r}else i="boolean"==typeof r?r:"string"==typeof r?s.spaceSeparated?fe(r):s.commaSeparated?ie(r):s.commaOrSpaceSeparated?fe(ie(r).join(" ")):_e(s,s.property,r):Array.isArray(r)?[...r]:"style"===s.property?function(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}(r):String(r);if(Array.isArray(i)){const e=[];for(const t of i)e.push(_e(s,s.property,t));i=e}"className"===s.property&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[s.property]=i}}function ye(e,t){if(null==t);else if("number"==typeof t||"string"==typeof t)e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)ye(e,n);else{if("object"!=typeof t||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");"root"===t.type?ye(e,t.children):e.push(t)}}function _e(e,t,n){if("string"==typeof n){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(""===n||L(n)===L(t)))return!0}return n}const Te=ge(re,"div"),be=ge(se,"g",["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"]);function ke(e,t){const n=e.indexOf("\r",t),r=e.indexOf("\n",t);return-1===r?n:-1===n||n+1===r?r:n<r?n:r}const ve={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Ae={}.hasOwnProperty,xe=Object.prototype;function Ie(e,t){const n=t||{};return Se({file:n.file||void 0,location:!1,schema:"svg"===n.space?se:re,verbose:n.verbose||!1},e)}function Se(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},we(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r&&("quirks"===r.mode||"limited-quirks"===r.mode);if(n={type:"root",children:Ne(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const t=String(e.file),r=function(e){const t=String(e),n=[];return{toOffset:function(e){if(e&&"number"==typeof e.line&&"number"==typeof e.column&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){const e=n[n.length-1],r=ke(t,e),s=-1===r?t.length+1:r+1;if(e===s)break;n.push(s)}const r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}},toPoint:function(e){if("number"==typeof e&&e>-1&&e<=t.length){let r=0;for(;;){let s=n[r];if(void 0===s){const e=ke(t,n[r-1]);s=-1===e?t.length+1:e+1,n[r]=s}if(s>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}}}(t),s=r.toPoint(0),i=r.toPoint(t.length);n.position={start:s,end:i}}return n}case"#documentType":return n={type:"doctype"},we(e,t,n),n;case"#text":{const r=t;return n={type:"text",value:r.value},we(e,r,n),n}default:return n=function(e,t){const n=e.schema;e.schema=t.namespaceURI===ve.svg?se:re;let r=-1;const s={};for(;++r<t.attrs.length;){const e=t.attrs[r],n=(e.prefix?e.prefix+":":"")+e.name;Ae.call(xe,n)||(s[n]=e.value)}const i=("svg"===e.schema.space?be:Te)(t.tagName,s,Ne(e,t.childNodes));if(we(e,t,i),"template"===i.tagName){const n=t,r=n.sourceCodeLocation,s=r&&r.startTag&&Oe(r.startTag),a=r&&r.endTag&&Oe(r.endTag),o=Se(e,n.content);s&&a&&e.file&&(o.position={start:s.end,end:a.start}),i.content=o}return e.schema=n,i}(e,t),n}}function Ne(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=Se(e,t[n]);r.push(s)}return r}function we(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=Ce(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Ce(e,t,n){const r=Oe(n);if("element"===t.type){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const r={};let s;if(n.attrs)for(s in n.attrs)Ae.call(n.attrs,s)&&(r[de(e.schema,s).property]=Oe(n.attrs[s]));n.startTag;const i=Oe(n.startTag),a=n.endTag?Oe(n.endTag):void 0,o={opening:i};a&&(o.closing=a),o.properties=r,t.data={position:o}}}return r}function Oe(e){const t=Re({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Re({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Re(e){return e.line&&e.column?e:void 0}const De={}.hasOwnProperty;function Le(e,t){const n=t||{};function r(t,...n){let s=r.invalid;const i=r.handlers;if(t&&De.call(t,e)){const n=String(t[e]);s=De.call(i,n)?i[n]:r.unknown}if(s)return s.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Pe={},Me={}.hasOwnProperty,Fe=Le("type",{handlers:{root:function(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Be(e.children,n,t),Ue(e,n),n},element:function(e,t){const n=t;let r=n;"element"===e.type&&"svg"===e.tagName.toLowerCase()&&"html"===n.space&&(r=se);const s=[];let i;if(e.properties)for(i in e.properties)if("children"!==i&&Me.call(e.properties,i)){const t=ze(r,i,e.properties[i]);t&&s.push(t)}const a=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:ve[a],childNodes:[],parentNode:null};return o.childNodes=Be(e.children,o,r),Ue(e,o),"template"===e.tagName&&e.content&&(o.content=function(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Be(e.children,n,t),Ue(e,n),n}(e.content,r)),o},text:function(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ue(e,t),t},comment:function(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ue(e,t),t},doctype:function(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ue(e,t),t}}});function ze(e,t,n){const r=de(e,t);if(!1===n||null==n||"number"==typeof n&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?ae(n):me(n));const s={name:r.attribute,value:!0===n?"":String(n)};if(r.space&&"html"!==r.space&&"svg"!==r.space){const e=s.name.indexOf(":");e<0?s.prefix="":(s.name=s.name.slice(e+1),s.prefix=r.attribute.slice(0,e)),s.namespace=ve[r.space]}return s}function Be(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const i=Fe(e[r],n);i.parentNode=t,s.push(i)}return s}function Ue(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const He=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],je=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),$e="�";var Ze;!function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"}(Ze||(Ze={}));const Ge="[CDATA[",Ve="doctype",Ye="script";function qe(e){return e>=55296&&e<=57343}function We(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159}function Ke(e){return e>=64976&&e<=65007||je.has(e)}var Qe,Je;!function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"}(Qe||(Qe={}));class Xe{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){const{line:n,col:r,offset:s}=this,i=r+t,a=s+t;return{code:e,startLine:n,endLine:n,startCol:i,endCol:i,startOffset:a,endOffset:a}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if(function(e){return e>=56320&&e<=57343}(t))return this.pos++,this._addGap(),1024*(e-55296)+9216+t}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Ze.EOF;return this._err(Qe.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((32|this.html.charCodeAt(this.pos+t))!==e.charCodeAt(t))return!1;return!0}peek(e){const t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Ze.EOF;const n=this.html.charCodeAt(t);return n===Ze.CARRIAGE_RETURN?Ze.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Ze.EOF;let e=this.html.charCodeAt(this.pos);return e===Ze.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Ze.LINE_FEED):e===Ze.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,qe(e)&&(e=this._processSurrogate(e)),null===this.handler.onParseError||e>31&&e<127||e===Ze.LINE_FEED||e===Ze.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){We(e)?this._err(Qe.controlCharacterInInputStream):Ke(e)&&this._err(Qe.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}function et(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}!function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"}(Je||(Je={}));const tt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((e=>e.charCodeAt(0))));const nt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var rt,st,it,at,ot,lt,ct,ut,dt,pt;function ht(e){return e>=rt.ZERO&&e<=rt.NINE}String.fromCodePoint,function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(rt||(rt={})),function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(st||(st={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(it||(it={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(at||(at={}));class ft{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=it.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=at.Strict}startEntity(e){this.decodeMode=e,this.state=it.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case it.EntityStart:return e.charCodeAt(t)===rt.NUM?(this.state=it.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=it.NamedEntity,this.stateNamedEntity(e,t));case it.NumericStart:return this.stateNumericStart(e,t);case it.NumericDecimal:return this.stateNumericDecimal(e,t);case it.NumericHex:return this.stateNumericHex(e,t);case it.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===rt.LOWER_X?(this.state=it.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=it.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){const s=n-t;this.result=this.result*Math.pow(r,s)+Number.parseInt(e.substr(t,s),r),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(!(ht(s)||(r=s,r>=rt.UPPER_A&&r<=rt.UPPER_F||r>=rt.LOWER_A&&r<=rt.LOWER_F)))return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3);t+=1}var r;return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(!ht(r))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2);t+=1}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===rt.SEMI)this.consumed+=1;else if(this.decodeMode===at.Strict)return 0;return this.emitCodePoint(function(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=nt.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==rt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],s=(r&st.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const a=e.charCodeAt(t);if(this.treeIndex=mt(n,r,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return 0===this.result||this.decodeMode===at.Attribute&&(0===s||((i=a)===rt.EQUALS||function(e){return e>=rt.UPPER_A&&e<=rt.UPPER_Z||e>=rt.LOWER_A&&e<=rt.LOWER_Z||ht(e)}(i)))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],s=(r&st.VALUE_LENGTH)>>14,0!==s){if(a===rt.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==at.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}var i;return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,r=(n[t]&st.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~st.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case it.NamedEntity:return 0===this.result||this.decodeMode===at.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case it.NumericDecimal:return this.emitNumericEntity(0,2);case it.NumericHex:return this.emitNumericEntity(0,3);case it.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case it.EntityStart:return 0}}}function mt(e,t,n,r){const s=(t&st.BRANCH_LENGTH)>>7,i=t&st.JUMP_TABLE;if(0===s)return 0!==i&&r===i?n:-1;if(i){const t=r-i;return t<0||t>=s?-1:e[n+t]-1}let a=n,o=a+s-1;for(;a<=o;){const t=a+o>>>1,n=e[t];if(n<r)a=t+1;else{if(!(n>r))return e[t+s];o=t-1}}return-1}(pt=ot||(ot={})).HTML="http://www.w3.org/1999/xhtml",pt.MATHML="http://www.w3.org/1998/Math/MathML",pt.SVG="http://www.w3.org/2000/svg",pt.XLINK="http://www.w3.org/1999/xlink",pt.XML="http://www.w3.org/XML/1998/namespace",pt.XMLNS="http://www.w3.org/2000/xmlns/",function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"}(lt||(lt={})),function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"}(ct||(ct={})),function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"}(ut||(ut={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"}(dt||(dt={}));const gt=new Map([[ut.A,dt.A],[ut.ADDRESS,dt.ADDRESS],[ut.ANNOTATION_XML,dt.ANNOTATION_XML],[ut.APPLET,dt.APPLET],[ut.AREA,dt.AREA],[ut.ARTICLE,dt.ARTICLE],[ut.ASIDE,dt.ASIDE],[ut.B,dt.B],[ut.BASE,dt.BASE],[ut.BASEFONT,dt.BASEFONT],[ut.BGSOUND,dt.BGSOUND],[ut.BIG,dt.BIG],[ut.BLOCKQUOTE,dt.BLOCKQUOTE],[ut.BODY,dt.BODY],[ut.BR,dt.BR],[ut.BUTTON,dt.BUTTON],[ut.CAPTION,dt.CAPTION],[ut.CENTER,dt.CENTER],[ut.CODE,dt.CODE],[ut.COL,dt.COL],[ut.COLGROUP,dt.COLGROUP],[ut.DD,dt.DD],[ut.DESC,dt.DESC],[ut.DETAILS,dt.DETAILS],[ut.DIALOG,dt.DIALOG],[ut.DIR,dt.DIR],[ut.DIV,dt.DIV],[ut.DL,dt.DL],[ut.DT,dt.DT],[ut.EM,dt.EM],[ut.EMBED,dt.EMBED],[ut.FIELDSET,dt.FIELDSET],[ut.FIGCAPTION,dt.FIGCAPTION],[ut.FIGURE,dt.FIGURE],[ut.FONT,dt.FONT],[ut.FOOTER,dt.FOOTER],[ut.FOREIGN_OBJECT,dt.FOREIGN_OBJECT],[ut.FORM,dt.FORM],[ut.FRAME,dt.FRAME],[ut.FRAMESET,dt.FRAMESET],[ut.H1,dt.H1],[ut.H2,dt.H2],[ut.H3,dt.H3],[ut.H4,dt.H4],[ut.H5,dt.H5],[ut.H6,dt.H6],[ut.HEAD,dt.HEAD],[ut.HEADER,dt.HEADER],[ut.HGROUP,dt.HGROUP],[ut.HR,dt.HR],[ut.HTML,dt.HTML],[ut.I,dt.I],[ut.IMG,dt.IMG],[ut.IMAGE,dt.IMAGE],[ut.INPUT,dt.INPUT],[ut.IFRAME,dt.IFRAME],[ut.KEYGEN,dt.KEYGEN],[ut.LABEL,dt.LABEL],[ut.LI,dt.LI],[ut.LINK,dt.LINK],[ut.LISTING,dt.LISTING],[ut.MAIN,dt.MAIN],[ut.MALIGNMARK,dt.MALIGNMARK],[ut.MARQUEE,dt.MARQUEE],[ut.MATH,dt.MATH],[ut.MENU,dt.MENU],[ut.META,dt.META],[ut.MGLYPH,dt.MGLYPH],[ut.MI,dt.MI],[ut.MO,dt.MO],[ut.MN,dt.MN],[ut.MS,dt.MS],[ut.MTEXT,dt.MTEXT],[ut.NAV,dt.NAV],[ut.NOBR,dt.NOBR],[ut.NOFRAMES,dt.NOFRAMES],[ut.NOEMBED,dt.NOEMBED],[ut.NOSCRIPT,dt.NOSCRIPT],[ut.OBJECT,dt.OBJECT],[ut.OL,dt.OL],[ut.OPTGROUP,dt.OPTGROUP],[ut.OPTION,dt.OPTION],[ut.P,dt.P],[ut.PARAM,dt.PARAM],[ut.PLAINTEXT,dt.PLAINTEXT],[ut.PRE,dt.PRE],[ut.RB,dt.RB],[ut.RP,dt.RP],[ut.RT,dt.RT],[ut.RTC,dt.RTC],[ut.RUBY,dt.RUBY],[ut.S,dt.S],[ut.SCRIPT,dt.SCRIPT],[ut.SEARCH,dt.SEARCH],[ut.SECTION,dt.SECTION],[ut.SELECT,dt.SELECT],[ut.SOURCE,dt.SOURCE],[ut.SMALL,dt.SMALL],[ut.SPAN,dt.SPAN],[ut.STRIKE,dt.STRIKE],[ut.STRONG,dt.STRONG],[ut.STYLE,dt.STYLE],[ut.SUB,dt.SUB],[ut.SUMMARY,dt.SUMMARY],[ut.SUP,dt.SUP],[ut.TABLE,dt.TABLE],[ut.TBODY,dt.TBODY],[ut.TEMPLATE,dt.TEMPLATE],[ut.TEXTAREA,dt.TEXTAREA],[ut.TFOOT,dt.TFOOT],[ut.TD,dt.TD],[ut.TH,dt.TH],[ut.THEAD,dt.THEAD],[ut.TITLE,dt.TITLE],[ut.TR,dt.TR],[ut.TRACK,dt.TRACK],[ut.TT,dt.TT],[ut.U,dt.U],[ut.UL,dt.UL],[ut.SVG,dt.SVG],[ut.VAR,dt.VAR],[ut.WBR,dt.WBR],[ut.XMP,dt.XMP]]);function Et(e){var t;return null!==(t=gt.get(e))&&void 0!==t?t:dt.UNKNOWN}const yt=dt,_t={[ot.HTML]:new Set([yt.ADDRESS,yt.APPLET,yt.AREA,yt.ARTICLE,yt.ASIDE,yt.BASE,yt.BASEFONT,yt.BGSOUND,yt.BLOCKQUOTE,yt.BODY,yt.BR,yt.BUTTON,yt.CAPTION,yt.CENTER,yt.COL,yt.COLGROUP,yt.DD,yt.DETAILS,yt.DIR,yt.DIV,yt.DL,yt.DT,yt.EMBED,yt.FIELDSET,yt.FIGCAPTION,yt.FIGURE,yt.FOOTER,yt.FORM,yt.FRAME,yt.FRAMESET,yt.H1,yt.H2,yt.H3,yt.H4,yt.H5,yt.H6,yt.HEAD,yt.HEADER,yt.HGROUP,yt.HR,yt.HTML,yt.IFRAME,yt.IMG,yt.INPUT,yt.LI,yt.LINK,yt.LISTING,yt.MAIN,yt.MARQUEE,yt.MENU,yt.META,yt.NAV,yt.NOEMBED,yt.NOFRAMES,yt.NOSCRIPT,yt.OBJECT,yt.OL,yt.P,yt.PARAM,yt.PLAINTEXT,yt.PRE,yt.SCRIPT,yt.SECTION,yt.SELECT,yt.SOURCE,yt.STYLE,yt.SUMMARY,yt.TABLE,yt.TBODY,yt.TD,yt.TEMPLATE,yt.TEXTAREA,yt.TFOOT,yt.TH,yt.THEAD,yt.TITLE,yt.TR,yt.TRACK,yt.UL,yt.WBR,yt.XMP]),[ot.MATHML]:new Set([yt.MI,yt.MO,yt.MN,yt.MS,yt.MTEXT,yt.ANNOTATION_XML]),[ot.SVG]:new Set([yt.TITLE,yt.FOREIGN_OBJECT,yt.DESC]),[ot.XLINK]:new Set,[ot.XML]:new Set,[ot.XMLNS]:new Set},Tt=new Set([yt.H1,yt.H2,yt.H3,yt.H4,yt.H5,yt.H6]);var bt;new Set([ut.STYLE,ut.SCRIPT,ut.XMP,ut.IFRAME,ut.NOEMBED,ut.NOFRAMES,ut.PLAINTEXT]),function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"}(bt||(bt={}));const kt={DATA:bt.DATA,RCDATA:bt.RCDATA,RAWTEXT:bt.RAWTEXT,SCRIPT_DATA:bt.SCRIPT_DATA,PLAINTEXT:bt.PLAINTEXT,CDATA_SECTION:bt.CDATA_SECTION};function vt(e){return e>=Ze.LATIN_CAPITAL_A&&e<=Ze.LATIN_CAPITAL_Z}function At(e){return function(e){return e>=Ze.LATIN_SMALL_A&&e<=Ze.LATIN_SMALL_Z}(e)||vt(e)}function xt(e){return At(e)||function(e){return e>=Ze.DIGIT_0&&e<=Ze.DIGIT_9}(e)}function It(e){return e+32}function St(e){return e===Ze.SPACE||e===Ze.LINE_FEED||e===Ze.TABULATION||e===Ze.FORM_FEED}function Nt(e){return St(e)||e===Ze.SOLIDUS||e===Ze.GREATER_THAN_SIGN}class wt{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=bt.DATA,this.returnState=bt.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Xe(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new ft(tt,((e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)}),t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Qe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(Qe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{const t=function(e){return e===Ze.NULL?Qe.nullCharacterReference:e>1114111?Qe.characterReferenceOutsideUnicodeRange:qe(e)?Qe.surrogateCharacterReference:Ke(e)?Qe.noncharacterCharacterReference:We(e)||e===Ze.CARRIAGE_RETURN?Qe.controlCharacterReference:null}(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;null===(r=(n=this.handler).onParseError)||void 0===r||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,this.inLoop||(this._runParsingLoop(),this.paused||null==e||e())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||null==n||n()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return!!this.preprocessor.endOfChunkHit&&(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0)}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return!!this.preprocessor.startsWith(e,t)&&(this._advanceBy(e.length-1),!0)}_createStartTagToken(){this.currentToken={type:Je.START_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Je.END_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:Je.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:Je.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,t;const n=this.currentToken;null===et(n,this.currentAttr.name)?(n.attrs.push(this.currentAttr),n.location&&this.currentLocation&&((null!==(e=(t=n.location).attrs)&&void 0!==e?e:t.attrs=Object.create(null))[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue())):this._err(Qe.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=Et(e.tagName),e.type===Je.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(Qe.endTagWithAttributes),e.selfClosing&&this._err(Qe.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Je.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case Je.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case Je.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Je.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e)return void(this.currentCharacterToken.chars+=t);this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){const t=St(e)?Je.WHITESPACE_CHARACTER:e===Ze.NULL?Je.NULL_CHARACTER:Je.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Je.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=bt.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?at.Attribute:at.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===bt.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===bt.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===bt.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case bt.DATA:this._stateData(e);break;case bt.RCDATA:this._stateRcdata(e);break;case bt.RAWTEXT:this._stateRawtext(e);break;case bt.SCRIPT_DATA:this._stateScriptData(e);break;case bt.PLAINTEXT:this._statePlaintext(e);break;case bt.TAG_OPEN:this._stateTagOpen(e);break;case bt.END_TAG_OPEN:this._stateEndTagOpen(e);break;case bt.TAG_NAME:this._stateTagName(e);break;case bt.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case bt.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case bt.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case bt.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case bt.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case bt.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case bt.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case bt.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case bt.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case bt.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case bt.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case bt.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case bt.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case bt.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case bt.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case bt.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case bt.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case bt.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case bt.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case bt.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case bt.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case bt.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case bt.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case bt.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case bt.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case bt.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case bt.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case bt.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case bt.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case bt.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case bt.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case bt.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case bt.BOGUS_COMMENT:this._stateBogusComment(e);break;case bt.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case bt.COMMENT_START:this._stateCommentStart(e);break;case bt.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case bt.COMMENT:this._stateComment(e);break;case bt.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case bt.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case bt.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case bt.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case bt.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case bt.COMMENT_END:this._stateCommentEnd(e);break;case bt.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case bt.DOCTYPE:this._stateDoctype(e);break;case bt.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case bt.DOCTYPE_NAME:this._stateDoctypeName(e);break;case bt.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case bt.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case bt.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case bt.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case bt.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case bt.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case bt.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case bt.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case bt.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case bt.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case bt.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case bt.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case bt.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case bt.CDATA_SECTION:this._stateCdataSection(e);break;case bt.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case bt.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case bt.CHARACTER_REFERENCE:this._stateCharacterReference();break;case bt.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Ze.LESS_THAN_SIGN:this.state=bt.TAG_OPEN;break;case Ze.AMPERSAND:this._startCharacterReference();break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this._emitCodePoint(e);break;case Ze.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case Ze.AMPERSAND:this._startCharacterReference();break;case Ze.LESS_THAN_SIGN:this.state=bt.RCDATA_LESS_THAN_SIGN;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this._emitChars($e);break;case Ze.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case Ze.LESS_THAN_SIGN:this.state=bt.RAWTEXT_LESS_THAN_SIGN;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this._emitChars($e);break;case Ze.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case Ze.LESS_THAN_SIGN:this.state=bt.SCRIPT_DATA_LESS_THAN_SIGN;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this._emitChars($e);break;case Ze.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this._emitChars($e);break;case Ze.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(At(e))this._createStartTagToken(),this.state=bt.TAG_NAME,this._stateTagName(e);else switch(e){case Ze.EXCLAMATION_MARK:this.state=bt.MARKUP_DECLARATION_OPEN;break;case Ze.SOLIDUS:this.state=bt.END_TAG_OPEN;break;case Ze.QUESTION_MARK:this._err(Qe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=bt.BOGUS_COMMENT,this._stateBogusComment(e);break;case Ze.EOF:this._err(Qe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(Qe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=bt.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(At(e))this._createEndTagToken(),this.state=bt.TAG_NAME,this._stateTagName(e);else switch(e){case Ze.GREATER_THAN_SIGN:this._err(Qe.missingEndTagName),this.state=bt.DATA;break;case Ze.EOF:this._err(Qe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break;default:this._err(Qe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=bt.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:this.state=bt.BEFORE_ATTRIBUTE_NAME;break;case Ze.SOLIDUS:this.state=bt.SELF_CLOSING_START_TAG;break;case Ze.GREATER_THAN_SIGN:this.state=bt.DATA,this.emitCurrentTagToken();break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),t.tagName+=$e;break;case Ze.EOF:this._err(Qe.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(vt(e)?It(e):e)}}_stateRcdataLessThanSign(e){e===Ze.SOLIDUS?this.state=bt.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=bt.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){At(e)?(this.state=bt.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=bt.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();switch(this._createEndTagToken(),this.currentToken.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=bt.BEFORE_ATTRIBUTE_NAME,!1;case Ze.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=bt.SELF_CLOSING_START_TAG,!1;case Ze.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=bt.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=bt.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===Ze.SOLIDUS?this.state=bt.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=bt.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){At(e)?(this.state=bt.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=bt.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=bt.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case Ze.SOLIDUS:this.state=bt.SCRIPT_DATA_END_TAG_OPEN;break;case Ze.EXCLAMATION_MARK:this.state=bt.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break;default:this._emitChars("<"),this.state=bt.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){At(e)?(this.state=bt.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=bt.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=bt.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===Ze.HYPHEN_MINUS?(this.state=bt.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=bt.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===Ze.HYPHEN_MINUS?(this.state=bt.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=bt.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case Ze.HYPHEN_MINUS:this.state=bt.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break;case Ze.LESS_THAN_SIGN:this.state=bt.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this._emitChars($e);break;case Ze.EOF:this._err(Qe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case Ze.HYPHEN_MINUS:this.state=bt.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break;case Ze.LESS_THAN_SIGN:this.state=bt.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this.state=bt.SCRIPT_DATA_ESCAPED,this._emitChars($e);break;case Ze.EOF:this._err(Qe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=bt.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case Ze.HYPHEN_MINUS:this._emitChars("-");break;case Ze.LESS_THAN_SIGN:this.state=bt.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case Ze.GREATER_THAN_SIGN:this.state=bt.SCRIPT_DATA,this._emitChars(">");break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this.state=bt.SCRIPT_DATA_ESCAPED,this._emitChars($e);break;case Ze.EOF:this._err(Qe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=bt.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Ze.SOLIDUS?this.state=bt.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:At(e)?(this._emitChars("<"),this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=bt.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){At(e)?(this.state=bt.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=bt.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=bt.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Ye,!1)&&Nt(this.preprocessor.peek(Ye.length))){this._emitCodePoint(e);for(let e=0;e<Ye.length;e++)this._emitCodePoint(this._consume());this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=bt.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case Ze.HYPHEN_MINUS:this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break;case Ze.LESS_THAN_SIGN:this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this._emitChars($e);break;case Ze.EOF:this._err(Qe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case Ze.HYPHEN_MINUS:this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break;case Ze.LESS_THAN_SIGN:this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars($e);break;case Ze.EOF:this._err(Qe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case Ze.HYPHEN_MINUS:this._emitChars("-");break;case Ze.LESS_THAN_SIGN:this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case Ze.GREATER_THAN_SIGN:this.state=bt.SCRIPT_DATA,this._emitChars(">");break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars($e);break;case Ze.EOF:this._err(Qe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Ze.SOLIDUS?(this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ye,!1)&&Nt(this.preprocessor.peek(Ye.length))){this._emitCodePoint(e);for(let e=0;e<Ye.length;e++)this._emitCodePoint(this._consume());this.state=bt.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=bt.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:break;case Ze.SOLIDUS:case Ze.GREATER_THAN_SIGN:case Ze.EOF:this.state=bt.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case Ze.EQUALS_SIGN:this._err(Qe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=bt.ATTRIBUTE_NAME;break;default:this._createAttr(""),this.state=bt.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:case Ze.SOLIDUS:case Ze.GREATER_THAN_SIGN:case Ze.EOF:this._leaveAttrName(),this.state=bt.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case Ze.EQUALS_SIGN:this._leaveAttrName(),this.state=bt.BEFORE_ATTRIBUTE_VALUE;break;case Ze.QUOTATION_MARK:case Ze.APOSTROPHE:case Ze.LESS_THAN_SIGN:this._err(Qe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this.currentAttr.name+=$e;break;default:this.currentAttr.name+=String.fromCodePoint(vt(e)?It(e):e)}}_stateAfterAttributeName(e){switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:break;case Ze.SOLIDUS:this.state=bt.SELF_CLOSING_START_TAG;break;case Ze.EQUALS_SIGN:this.state=bt.BEFORE_ATTRIBUTE_VALUE;break;case Ze.GREATER_THAN_SIGN:this.state=bt.DATA,this.emitCurrentTagToken();break;case Ze.EOF:this._err(Qe.eofInTag),this._emitEOFToken();break;default:this._createAttr(""),this.state=bt.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:break;case Ze.QUOTATION_MARK:this.state=bt.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case Ze.APOSTROPHE:this.state=bt.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.missingAttributeValue),this.state=bt.DATA,this.emitCurrentTagToken();break;default:this.state=bt.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case Ze.QUOTATION_MARK:this.state=bt.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case Ze.AMPERSAND:this._startCharacterReference();break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this.currentAttr.value+=$e;break;case Ze.EOF:this._err(Qe.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case Ze.APOSTROPHE:this.state=bt.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case Ze.AMPERSAND:this._startCharacterReference();break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this.currentAttr.value+=$e;break;case Ze.EOF:this._err(Qe.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:this._leaveAttrValue(),this.state=bt.BEFORE_ATTRIBUTE_NAME;break;case Ze.AMPERSAND:this._startCharacterReference();break;case Ze.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=bt.DATA,this.emitCurrentTagToken();break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this.currentAttr.value+=$e;break;case Ze.QUOTATION_MARK:case Ze.APOSTROPHE:case Ze.LESS_THAN_SIGN:case Ze.EQUALS_SIGN:case Ze.GRAVE_ACCENT:this._err(Qe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case Ze.EOF:this._err(Qe.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:this._leaveAttrValue(),this.state=bt.BEFORE_ATTRIBUTE_NAME;break;case Ze.SOLIDUS:this._leaveAttrValue(),this.state=bt.SELF_CLOSING_START_TAG;break;case Ze.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=bt.DATA,this.emitCurrentTagToken();break;case Ze.EOF:this._err(Qe.eofInTag),this._emitEOFToken();break;default:this._err(Qe.missingWhitespaceBetweenAttributes),this.state=bt.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case Ze.GREATER_THAN_SIGN:this.currentToken.selfClosing=!0,this.state=bt.DATA,this.emitCurrentTagToken();break;case Ze.EOF:this._err(Qe.eofInTag),this._emitEOFToken();break;default:this._err(Qe.unexpectedSolidusInTag),this.state=bt.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const t=this.currentToken;switch(e){case Ze.GREATER_THAN_SIGN:this.state=bt.DATA,this.emitCurrentComment(t);break;case Ze.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),t.data+=$e;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch("--",!0)?(this._createCommentToken("--".length+1),this.state=bt.COMMENT_START):this._consumeSequenceIfMatch(Ve,!1)?(this.currentLocation=this.getCurrentLocation(Ve.length+1),this.state=bt.DOCTYPE):this._consumeSequenceIfMatch(Ge,!0)?this.inForeignNode?this.state=bt.CDATA_SECTION:(this._err(Qe.cdataInHtmlContent),this._createCommentToken(Ge.length+1),this.currentToken.data="[CDATA[",this.state=bt.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Qe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=bt.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case Ze.HYPHEN_MINUS:this.state=bt.COMMENT_START_DASH;break;case Ze.GREATER_THAN_SIGN:{this._err(Qe.abruptClosingOfEmptyComment),this.state=bt.DATA;const e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=bt.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const t=this.currentToken;switch(e){case Ze.HYPHEN_MINUS:this.state=bt.COMMENT_END;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.abruptClosingOfEmptyComment),this.state=bt.DATA,this.emitCurrentComment(t);break;case Ze.EOF:this._err(Qe.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="-",this.state=bt.COMMENT,this._stateComment(e)}}_stateComment(e){const t=this.currentToken;switch(e){case Ze.HYPHEN_MINUS:this.state=bt.COMMENT_END_DASH;break;case Ze.LESS_THAN_SIGN:t.data+="<",this.state=bt.COMMENT_LESS_THAN_SIGN;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),t.data+=$e;break;case Ze.EOF:this._err(Qe.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const t=this.currentToken;switch(e){case Ze.EXCLAMATION_MARK:t.data+="!",this.state=bt.COMMENT_LESS_THAN_SIGN_BANG;break;case Ze.LESS_THAN_SIGN:t.data+="<";break;default:this.state=bt.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===Ze.HYPHEN_MINUS?this.state=bt.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=bt.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===Ze.HYPHEN_MINUS?this.state=bt.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=bt.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==Ze.GREATER_THAN_SIGN&&e!==Ze.EOF&&this._err(Qe.nestedComment),this.state=bt.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const t=this.currentToken;switch(e){case Ze.HYPHEN_MINUS:this.state=bt.COMMENT_END;break;case Ze.EOF:this._err(Qe.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="-",this.state=bt.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const t=this.currentToken;switch(e){case Ze.GREATER_THAN_SIGN:this.state=bt.DATA,this.emitCurrentComment(t);break;case Ze.EXCLAMATION_MARK:this.state=bt.COMMENT_END_BANG;break;case Ze.HYPHEN_MINUS:t.data+="-";break;case Ze.EOF:this._err(Qe.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="--",this.state=bt.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const t=this.currentToken;switch(e){case Ze.HYPHEN_MINUS:t.data+="--!",this.state=bt.COMMENT_END_DASH;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.incorrectlyClosedComment),this.state=bt.DATA,this.emitCurrentComment(t);break;case Ze.EOF:this._err(Qe.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+="--!",this.state=bt.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:this.state=bt.BEFORE_DOCTYPE_NAME;break;case Ze.GREATER_THAN_SIGN:this.state=bt.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case Ze.EOF:{this._err(Qe.eofInDoctype),this._createDoctypeToken(null);const e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(Qe.missingWhitespaceBeforeDoctypeName),this.state=bt.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(vt(e))this._createDoctypeToken(String.fromCharCode(It(e))),this.state=bt.DOCTYPE_NAME;else switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),this._createDoctypeToken($e),this.state=bt.DOCTYPE_NAME;break;case Ze.GREATER_THAN_SIGN:{this._err(Qe.missingDoctypeName),this._createDoctypeToken(null);const e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=bt.DATA;break}case Ze.EOF:{this._err(Qe.eofInDoctype),this._createDoctypeToken(null);const e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=bt.DOCTYPE_NAME}}_stateDoctypeName(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:this.state=bt.AFTER_DOCTYPE_NAME;break;case Ze.GREATER_THAN_SIGN:this.state=bt.DATA,this.emitCurrentDoctype(t);break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),t.name+=$e;break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(vt(e)?It(e):e)}}_stateAfterDoctypeName(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:break;case Ze.GREATER_THAN_SIGN:this.state=bt.DATA,this.emitCurrentDoctype(t);break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch("public",!1)?this.state=bt.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch("system",!1)?this.state=bt.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Qe.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=bt.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:this.state=bt.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case Ze.QUOTATION_MARK:this._err(Qe.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=bt.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case Ze.APOSTROPHE:this._err(Qe.missingWhitespaceAfterDoctypePublicKeyword),t.publicId="",this.state=bt.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=bt.DATA,this.emitCurrentDoctype(t);break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(Qe.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=bt.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:break;case Ze.QUOTATION_MARK:t.publicId="",this.state=bt.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case Ze.APOSTROPHE:t.publicId="",this.state=bt.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=bt.DATA,this.emitCurrentDoctype(t);break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(Qe.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=bt.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case Ze.QUOTATION_MARK:this.state=bt.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),t.publicId+=$e;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=bt.DATA;break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case Ze.APOSTROPHE:this.state=bt.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),t.publicId+=$e;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=bt.DATA;break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:this.state=bt.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case Ze.GREATER_THAN_SIGN:this.state=bt.DATA,this.emitCurrentDoctype(t);break;case Ze.QUOTATION_MARK:this._err(Qe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=bt.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Ze.APOSTROPHE:this._err(Qe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId="",this.state=bt.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(Qe.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=bt.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:break;case Ze.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=bt.DATA;break;case Ze.QUOTATION_MARK:t.systemId="",this.state=bt.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Ze.APOSTROPHE:t.systemId="",this.state=bt.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(Qe.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=bt.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:this.state=bt.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case Ze.QUOTATION_MARK:this._err(Qe.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=bt.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Ze.APOSTROPHE:this._err(Qe.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId="",this.state=bt.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=bt.DATA,this.emitCurrentDoctype(t);break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(Qe.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=bt.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:break;case Ze.QUOTATION_MARK:t.systemId="",this.state=bt.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Ze.APOSTROPHE:t.systemId="",this.state=bt.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=bt.DATA,this.emitCurrentDoctype(t);break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(Qe.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=bt.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const t=this.currentToken;switch(e){case Ze.QUOTATION_MARK:this.state=bt.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),t.systemId+=$e;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=bt.DATA;break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const t=this.currentToken;switch(e){case Ze.APOSTROPHE:this.state=bt.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter),t.systemId+=$e;break;case Ze.GREATER_THAN_SIGN:this._err(Qe.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=bt.DATA;break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const t=this.currentToken;switch(e){case Ze.SPACE:case Ze.LINE_FEED:case Ze.TABULATION:case Ze.FORM_FEED:break;case Ze.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=bt.DATA;break;case Ze.EOF:this._err(Qe.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(Qe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=bt.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const t=this.currentToken;switch(e){case Ze.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=bt.DATA;break;case Ze.NULL:this._err(Qe.unexpectedNullCharacter);break;case Ze.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case Ze.RIGHT_SQUARE_BRACKET:this.state=bt.CDATA_SECTION_BRACKET;break;case Ze.EOF:this._err(Qe.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===Ze.RIGHT_SQUARE_BRACKET?this.state=bt.CDATA_SECTION_END:(this._emitChars("]"),this.state=bt.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case Ze.GREATER_THAN_SIGN:this.state=bt.DATA;break;case Ze.RIGHT_SQUARE_BRACKET:this._emitChars("]");break;default:this._emitChars("]]"),this.state=bt.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(!this.preprocessor.lastChunkWritten)return this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,void(this.preprocessor.endOfChunkHit=!0);e=this.entityDecoder.end()}0===e?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(Ze.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&xt(this.preprocessor.peek(1))?bt.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){xt(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===Ze.SEMICOLON&&this._err(Qe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Ct=new Set([dt.DD,dt.DT,dt.LI,dt.OPTGROUP,dt.OPTION,dt.P,dt.RB,dt.RP,dt.RT,dt.RTC]),Ot=new Set([...Ct,dt.CAPTION,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]),Rt=new Set([dt.APPLET,dt.CAPTION,dt.HTML,dt.MARQUEE,dt.OBJECT,dt.TABLE,dt.TD,dt.TEMPLATE,dt.TH]),Dt=new Set([...Rt,dt.OL,dt.UL]),Lt=new Set([...Rt,dt.BUTTON]),Pt=new Set([dt.ANNOTATION_XML,dt.MI,dt.MN,dt.MO,dt.MS,dt.MTEXT]),Mt=new Set([dt.DESC,dt.FOREIGN_OBJECT,dt.TITLE]),Ft=new Set([dt.TR,dt.TEMPLATE,dt.HTML]),zt=new Set([dt.TBODY,dt.TFOOT,dt.THEAD,dt.TEMPLATE,dt.HTML]),Bt=new Set([dt.TABLE,dt.TEMPLATE,dt.HTML]),Ut=new Set([dt.TD,dt.TH]);class Ht{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=dt.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===dt.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ot.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){const r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&void 0!==this.currentTagId&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do{t=this.tagIDs.lastIndexOf(e,t-1)}while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==ot.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){const t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Tt,ot.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Ut,ot.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Bt,ot.HTML)}clearBackToTableBodyContext(){this.clearBackTo(zt,ot.HTML)}clearBackToTableRowContext(){this.clearBackTo(Ft,ot.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===dt.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===dt.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case ot.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case ot.SVG:if(Mt.has(r))return!1;break;case ot.MATHML:if(Pt.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Rt)}hasInListItemScope(e){return this.hasInDynamicScope(e,Dt)}hasInButtonScope(e){return this.hasInDynamicScope(e,Lt)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case ot.HTML:if(Tt.has(t))return!0;if(Rt.has(t))return!1;break;case ot.SVG:if(Mt.has(t))return!1;break;case ot.MATHML:if(Pt.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ot.HTML)switch(this.tagIDs[t]){case e:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===ot.HTML)switch(this.tagIDs[e]){case dt.TBODY:case dt.THEAD:case dt.TFOOT:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ot.HTML)switch(this.tagIDs[t]){case e:return!0;case dt.OPTION:case dt.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;void 0!==this.currentTagId&&Ct.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;void 0!==this.currentTagId&&Ot.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;void 0!==this.currentTagId&&this.currentTagId!==e&&Ot.has(this.currentTagId);)this.pop()}}var jt;!function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"}(jt||(jt={}));const $t={type:jt.Marker};class Zt{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const n=[],r=t.length,s=this.treeAdapter.getTagName(e),i=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){const t=this.entries[e];if(t.type===jt.Marker)break;const{element:a}=t;if(this.treeAdapter.getTagName(a)===s&&this.treeAdapter.getNamespaceURI(a)===i){const t=this.treeAdapter.getAttrList(a);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<3)return;const t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<3)return;const r=new Map(t.map((e=>[e.name,e.value])));let s=0;for(let e=0;e<n.length;e++){const t=n[e];t.attrs.every((e=>r.get(e.name)===e.value))&&(s+=1,s>=3&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift($t)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:jt.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:jt.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);-1!==t&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf($t);-1===e?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const t=this.entries.find((t=>t.type===jt.Marker||this.treeAdapter.getTagName(t.element)===e));return t&&t.type===jt.Element?t:null}getElementEntry(e){return this.entries.find((t=>t.type===jt.Element&&t.element===e))}}const Gt={createDocument:()=>({nodeName:"#document",mode:ct.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(e,t,n)=>({nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}),createCommentNode:e=>({nodeName:"#comment",data:e,parentNode:null}),createTextNode:e=>({nodeName:"#text",value:e,parentNode:null}),appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent:e=>e.content,setDocumentType(e,t,n,r){const s=e.childNodes.find((e=>"#documentType"===e.nodeName));if(s)s.name=t,s.publicId=n,s.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Gt.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode:e=>e.mode,detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Gt.isTextNode(n))return void(n.value+=t)}Gt.appendChild(e,Gt.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Gt.isTextNode(r)?r.value+=t:Gt.insertBefore(e,Gt.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map((e=>e.name)));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild:e=>e.childNodes[0],getChildNodes:e=>e.childNodes,getParentNode:e=>e.parentNode,getAttrList:e=>e.attrs,getTagName:e=>e.tagName,getNamespaceURI:e=>e.namespaceURI,getTextNodeContent:e=>e.value,getCommentNodeContent:e=>e.data,getDocumentTypeNodeName:e=>e.name,getDocumentTypeNodePublicId:e=>e.publicId,getDocumentTypeNodeSystemId:e=>e.systemId,isTextNode:e=>"#text"===e.nodeName,isCommentNode:e=>"#comment"===e.nodeName,isDocumentTypeNode:e=>"#documentType"===e.nodeName,isElementNode:e=>Object.prototype.hasOwnProperty.call(e,"tagName"),setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation:e=>e.sourceCodeLocation,updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Vt="html",Yt=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],qt=[...Yt,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Wt=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Kt=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Qt=[...Kt,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Jt(e,t){return t.some((t=>e.startsWith(t)))}const Xt=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","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"].map((e=>[e.toLowerCase(),e]))),en=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ot.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ot.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ot.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ot.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ot.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ot.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ot.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ot.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ot.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ot.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ot.XMLNS}]]),tn=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((e=>[e.toLowerCase(),e]))),nn=new Set([dt.B,dt.BIG,dt.BLOCKQUOTE,dt.BODY,dt.BR,dt.CENTER,dt.CODE,dt.DD,dt.DIV,dt.DL,dt.DT,dt.EM,dt.EMBED,dt.H1,dt.H2,dt.H3,dt.H4,dt.H5,dt.H6,dt.HEAD,dt.HR,dt.I,dt.IMG,dt.LI,dt.LISTING,dt.MENU,dt.META,dt.NOBR,dt.OL,dt.P,dt.PRE,dt.RUBY,dt.S,dt.SMALL,dt.SPAN,dt.STRONG,dt.STRIKE,dt.SUB,dt.SUP,dt.TABLE,dt.TT,dt.U,dt.UL,dt.VAR]);function rn(e){for(let t=0;t<e.attrs.length;t++)if("definitionurl"===e.attrs[t].name){e.attrs[t].name="definitionURL";break}}function sn(e){for(let t=0;t<e.attrs.length;t++){const n=Xt.get(e.attrs[t].name);null!=n&&(e.attrs[t].name=n)}}function an(e){for(let t=0;t<e.attrs.length;t++){const n=en.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}var on;!function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"}(on||(on={}));const ln={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},cn=new Set([dt.TABLE,dt.TBODY,dt.TFOOT,dt.THEAD,dt.TR]),un={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Gt,onParseError:null};class dn{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=on.INITIAL,this.originalInsertionMode=on.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...un,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=null!=t?t:this.treeAdapter.createDocument(),this.tokenizer=new wt(this.options,this),this.activeFormattingElements=new Zt(this.treeAdapter),this.fragmentContextID=n?Et(this.treeAdapter.getTagName(n)):dt.UNKNOWN,this._setContextModes(null!=n?n:this.document,this.fragmentContextID),this.openElements=new Ht(this.document,this.treeAdapter,this)}static parse(e,t){const n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){const n={...un,...t};null!=e||(e=n.treeAdapter.createElement(ut.TEMPLATE,ot.HTML,[]));const r=n.treeAdapter.createElement("documentmock",ot.HTML,[]),s=new this(n,r,e);return s.fragmentContextID===dt.TEMPLATE&&s.tmplInsertionModeStack.unshift(on.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){var r;if(!this.onParseError)return;const s=null!==(r=e.location)&&void 0!==r?r:ln,i={code:t,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:n?s.startLine:s.endLine,endCol:n?s.startCol:s.endCol,endOffset:n?s.startOffset:s.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,s;null===(s=(r=this.treeAdapter).onItemPush)||void 0===s||s.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),null===(r=(n=this.treeAdapter).onItemPop)||void 0===r||r.call(n,e,this.openElements.current),t){let e,t;0===this.openElements.stackTop&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):({current:e,currentTagId:t}=this.openElements),this._setContextModes(e,t)}}_setContextModes(e,t){const n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===ot.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&void 0!==e&&void 0!==t&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,ot.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=on.TEXT}switchToPlaintextParsing(){this.insertionMode=on.TEXT,this.originalInsertionMode=on.IN_BODY,this.tokenizer.state=kt.PLAINTEXT}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===ut.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===ot.HTML)switch(this.fragmentContextID){case dt.TITLE:case dt.TEXTAREA:this.tokenizer.state=kt.RCDATA;break;case dt.STYLE:case dt.XMP:case dt.IFRAME:case dt.NOEMBED:case dt.NOFRAMES:case dt.NOSCRIPT:this.tokenizer.state=kt.RAWTEXT;break;case dt.SCRIPT:this.tokenizer.state=kt.SCRIPT_DATA;break;case dt.PLAINTEXT:this.tokenizer.state=kt.PLAINTEXT}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){const t=this.treeAdapter.getChildNodes(this.document).find((e=>this.treeAdapter.isDocumentTypeNode(e)));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(null!=t?t:this.document,e)}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){const n=this.treeAdapter.createElement(e,ot.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,ot.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(ut.HTML,ot.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,dt.HTML)}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?(({parent:t,beforeElement:n}=this._findFosterParentingLocation()),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(t),s=n?r.lastIndexOf(n):r.length,i=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,r=this.treeAdapter.getTagName(e),s=t.type===Je.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return 0===this.openElements.stackTop&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):({current:t,currentTagId:n}=this.openElements),(e.tagID!==dt.SVG||this.treeAdapter.getTagName(t)!==ut.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(t)!==ot.MATHML)&&(this.tokenizer.inForeignNode||(e.tagID===dt.MGLYPH||e.tagID===dt.MALIGNMARK)&&void 0!==n&&!this._isIntegrationPoint(n,t,ot.HTML))}_processToken(e){switch(e.type){case Je.CHARACTER:this.onCharacter(e);break;case Je.NULL_CHARACTER:this.onNullCharacter(e);break;case Je.COMMENT:this.onComment(e);break;case Je.DOCTYPE:this.onDoctype(e);break;case Je.START_TAG:this._processStartTag(e);break;case Je.END_TAG:this.onEndTag(e);break;case Je.EOF:this.onEof(e);break;case Je.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return function(e,t,n,r){return(!r||r===ot.HTML)&&function(e,t,n){if(t===ot.MATHML&&e===dt.ANNOTATION_XML)for(let e=0;e<n.length;e++)if(n[e].name===lt.ENCODING){const t=n[e].value.toLowerCase();return"text/html"===t||"application/xhtml+xml"===t}return t===ot.SVG&&(e===dt.FOREIGN_OBJECT||e===dt.DESC||e===dt.TITLE)}(e,t,n)||(!r||r===ot.MATHML)&&function(e,t){return t===ot.MATHML&&(e===dt.MI||e===dt.MO||e===dt.MN||e===dt.MS||e===dt.MTEXT)}(e,t)}(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex((e=>e.type===jt.Marker||this.openElements.contains(e.element)));for(let n=-1===t?e-1:t-1;n>=0;n--){const e=this.activeFormattingElements.entries[n];this._insertElement(e.token,this.treeAdapter.getNamespaceURI(e.element)),e.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=on.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(dt.P),this.openElements.popUntilTagNamePopped(dt.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(0===e&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case dt.TR:return void(this.insertionMode=on.IN_ROW);case dt.TBODY:case dt.THEAD:case dt.TFOOT:return void(this.insertionMode=on.IN_TABLE_BODY);case dt.CAPTION:return void(this.insertionMode=on.IN_CAPTION);case dt.COLGROUP:return void(this.insertionMode=on.IN_COLUMN_GROUP);case dt.TABLE:return void(this.insertionMode=on.IN_TABLE);case dt.BODY:return void(this.insertionMode=on.IN_BODY);case dt.FRAMESET:return void(this.insertionMode=on.IN_FRAMESET);case dt.SELECT:return void this._resetInsertionModeForSelect(e);case dt.TEMPLATE:return void(this.insertionMode=this.tmplInsertionModeStack[0]);case dt.HTML:return void(this.insertionMode=this.headElement?on.AFTER_HEAD:on.BEFORE_HEAD);case dt.TD:case dt.TH:if(e>0)return void(this.insertionMode=on.IN_CELL);break;case dt.HEAD:if(e>0)return void(this.insertionMode=on.IN_HEAD)}this.insertionMode=on.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.tagIDs[t];if(e===dt.TEMPLATE)break;if(e===dt.TABLE)return void(this.insertionMode=on.IN_SELECT_IN_TABLE)}this.insertionMode=on.IN_SELECT}_isElementCausesFosterParenting(e){return cn.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&void 0!==this.openElements.currentTagId&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case dt.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===ot.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case dt.TABLE:{const n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const n=this.treeAdapter.getNamespaceURI(e);return _t[n].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){e._insertCharacters(t),e.framesetOk=!1}(this,e);else switch(this.insertionMode){case on.INITIAL:bn(this,e);break;case on.BEFORE_HTML:kn(this,e);break;case on.BEFORE_HEAD:vn(this,e);break;case on.IN_HEAD:In(this,e);break;case on.IN_HEAD_NO_SCRIPT:Sn(this,e);break;case on.AFTER_HEAD:Nn(this,e);break;case on.IN_BODY:case on.IN_CAPTION:case on.IN_CELL:case on.IN_TEMPLATE:On(this,e);break;case on.TEXT:case on.IN_SELECT:case on.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case on.IN_TABLE:case on.IN_TABLE_BODY:case on.IN_ROW:Un(this,e);break;case on.IN_TABLE_TEXT:Gn(this,e);break;case on.IN_COLUMN_GROUP:Wn(this,e);break;case on.AFTER_BODY:sr(this,e);break;case on.AFTER_AFTER_BODY:ir(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){t.chars=$e,e._insertCharacters(t)}(this,e);else switch(this.insertionMode){case on.INITIAL:bn(this,e);break;case on.BEFORE_HTML:kn(this,e);break;case on.BEFORE_HEAD:vn(this,e);break;case on.IN_HEAD:In(this,e);break;case on.IN_HEAD_NO_SCRIPT:Sn(this,e);break;case on.AFTER_HEAD:Nn(this,e);break;case on.TEXT:this._insertCharacters(e);break;case on.IN_TABLE:case on.IN_TABLE_BODY:case on.IN_ROW:Un(this,e);break;case on.IN_COLUMN_GROUP:Wn(this,e);break;case on.AFTER_BODY:sr(this,e);break;case on.AFTER_AFTER_BODY:ir(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)_n(this,e);else switch(this.insertionMode){case on.INITIAL:case on.BEFORE_HTML:case on.BEFORE_HEAD:case on.IN_HEAD:case on.IN_HEAD_NO_SCRIPT:case on.AFTER_HEAD:case on.IN_BODY:case on.IN_TABLE:case on.IN_CAPTION:case on.IN_COLUMN_GROUP:case on.IN_TABLE_BODY:case on.IN_ROW:case on.IN_CELL:case on.IN_SELECT:case on.IN_SELECT_IN_TABLE:case on.IN_TEMPLATE:case on.IN_FRAMESET:case on.AFTER_FRAMESET:_n(this,e);break;case on.IN_TABLE_TEXT:Vn(this,e);break;case on.AFTER_BODY:!function(e,t){e._appendCommentNode(t,e.openElements.items[0])}(this,e);break;case on.AFTER_AFTER_BODY:case on.AFTER_AFTER_FRAMESET:!function(e,t){e._appendCommentNode(t,e.document)}(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case on.INITIAL:!function(e,t){e._setDocumentType(t);const n=t.forceQuirks?ct.QUIRKS:function(e){if(e.name!==Vt)return ct.QUIRKS;const{systemId:t}=e;if(t&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===t.toLowerCase())return ct.QUIRKS;let{publicId:n}=e;if(null!==n){if(n=n.toLowerCase(),Wt.has(n))return ct.QUIRKS;let e=null===t?qt:Yt;if(Jt(n,e))return ct.QUIRKS;if(e=null===t?Kt:Qt,Jt(n,e))return ct.LIMITED_QUIRKS}return ct.NO_QUIRKS}(t);(function(e){return e.name===Vt&&null===e.publicId&&(null===e.systemId||"about:legacy-compat"===e.systemId)})(t)||e._err(t,Qe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=on.BEFORE_HTML}(this,e);break;case on.BEFORE_HEAD:case on.IN_HEAD:case on.IN_HEAD_NO_SCRIPT:case on.AFTER_HEAD:this._err(e,Qe.misplacedDoctype);break;case on.IN_TABLE_TEXT:Vn(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,Qe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?function(e,t){if(function(e){const t=e.tagID;return t===dt.FONT&&e.attrs.some((({name:e})=>e===lt.COLOR||e===lt.SIZE||e===lt.FACE))||nn.has(t)}(t))ar(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ot.MATHML?rn(t):r===ot.SVG&&(function(e){const t=tn.get(e.tagName);null!=t&&(e.tagName=t,e.tagID=Et(e.tagName))}(t),sn(t)),an(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case on.INITIAL:bn(this,e);break;case on.BEFORE_HTML:!function(e,t){t.tagID===dt.HTML?(e._insertElement(t,ot.HTML),e.insertionMode=on.BEFORE_HEAD):kn(e,t)}(this,e);break;case on.BEFORE_HEAD:!function(e,t){switch(t.tagID){case dt.HTML:Mn(e,t);break;case dt.HEAD:e._insertElement(t,ot.HTML),e.headElement=e.openElements.current,e.insertionMode=on.IN_HEAD;break;default:vn(e,t)}}(this,e);break;case on.IN_HEAD:An(this,e);break;case on.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case dt.HTML:Mn(e,t);break;case dt.BASEFONT:case dt.BGSOUND:case dt.HEAD:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.STYLE:An(e,t);break;case dt.NOSCRIPT:e._err(t,Qe.nestedNoscriptInHead);break;default:Sn(e,t)}}(this,e);break;case on.AFTER_HEAD:!function(e,t){switch(t.tagID){case dt.HTML:Mn(e,t);break;case dt.BODY:e._insertElement(t,ot.HTML),e.framesetOk=!1,e.insertionMode=on.IN_BODY;break;case dt.FRAMESET:e._insertElement(t,ot.HTML),e.insertionMode=on.IN_FRAMESET;break;case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:e._err(t,Qe.abandonedHeadElementChild),e.openElements.push(e.headElement,dt.HEAD),An(e,t),e.openElements.remove(e.headElement);break;case dt.HEAD:e._err(t,Qe.misplacedStartTagForHeadElement);break;default:Nn(e,t)}}(this,e);break;case on.IN_BODY:Mn(this,e);break;case on.IN_TABLE:Hn(this,e);break;case on.IN_TABLE_TEXT:Vn(this,e);break;case on.IN_CAPTION:!function(e,t){const n=t.tagID;Yn.has(n)?e.openElements.hasInTableScope(dt.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(dt.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=on.IN_TABLE,Hn(e,t)):Mn(e,t)}(this,e);break;case on.IN_COLUMN_GROUP:qn(this,e);break;case on.IN_TABLE_BODY:Kn(this,e);break;case on.IN_ROW:Jn(this,e);break;case on.IN_CELL:!function(e,t){const n=t.tagID;Yn.has(n)?(e.openElements.hasInTableScope(dt.TD)||e.openElements.hasInTableScope(dt.TH))&&(e._closeTableCell(),Jn(e,t)):Mn(e,t)}(this,e);break;case on.IN_SELECT:er(this,e);break;case on.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===dt.CAPTION||n===dt.TABLE||n===dt.TBODY||n===dt.TFOOT||n===dt.THEAD||n===dt.TR||n===dt.TD||n===dt.TH?(e.openElements.popUntilTagNamePopped(dt.SELECT),e._resetInsertionMode(),e._processStartTag(t)):er(e,t)}(this,e);break;case on.IN_TEMPLATE:!function(e,t){switch(t.tagID){case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:An(e,t);break;case dt.CAPTION:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:e.tmplInsertionModeStack[0]=on.IN_TABLE,e.insertionMode=on.IN_TABLE,Hn(e,t);break;case dt.COL:e.tmplInsertionModeStack[0]=on.IN_COLUMN_GROUP,e.insertionMode=on.IN_COLUMN_GROUP,qn(e,t);break;case dt.TR:e.tmplInsertionModeStack[0]=on.IN_TABLE_BODY,e.insertionMode=on.IN_TABLE_BODY,Kn(e,t);break;case dt.TD:case dt.TH:e.tmplInsertionModeStack[0]=on.IN_ROW,e.insertionMode=on.IN_ROW,Jn(e,t);break;default:e.tmplInsertionModeStack[0]=on.IN_BODY,e.insertionMode=on.IN_BODY,Mn(e,t)}}(this,e);break;case on.AFTER_BODY:!function(e,t){t.tagID===dt.HTML?Mn(e,t):sr(e,t)}(this,e);break;case on.IN_FRAMESET:!function(e,t){switch(t.tagID){case dt.HTML:Mn(e,t);break;case dt.FRAMESET:e._insertElement(t,ot.HTML);break;case dt.FRAME:e._appendElement(t,ot.HTML),t.ackSelfClosing=!0;break;case dt.NOFRAMES:An(e,t)}}(this,e);break;case on.AFTER_FRAMESET:!function(e,t){switch(t.tagID){case dt.HTML:Mn(e,t);break;case dt.NOFRAMES:An(e,t)}}(this,e);break;case on.AFTER_AFTER_BODY:!function(e,t){t.tagID===dt.HTML?Mn(e,t):ir(e,t)}(this,e);break;case on.AFTER_AFTER_FRAMESET:!function(e,t){switch(t.tagID){case dt.HTML:Mn(e,t);break;case dt.NOFRAMES:An(e,t)}}(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?function(e,t){if(t.tagID===dt.P||t.tagID===dt.BR)return ar(e),void e._endTagOutsideForeignContent(t);for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ot.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case on.INITIAL:bn(this,e);break;case on.BEFORE_HTML:!function(e,t){const n=t.tagID;n!==dt.HTML&&n!==dt.HEAD&&n!==dt.BODY&&n!==dt.BR||kn(e,t)}(this,e);break;case on.BEFORE_HEAD:!function(e,t){const n=t.tagID;n===dt.HEAD||n===dt.BODY||n===dt.HTML||n===dt.BR?vn(e,t):e._err(t,Qe.endTagWithoutMatchingOpenElement)}(this,e);break;case on.IN_HEAD:!function(e,t){switch(t.tagID){case dt.HEAD:e.openElements.pop(),e.insertionMode=on.AFTER_HEAD;break;case dt.BODY:case dt.BR:case dt.HTML:In(e,t);break;case dt.TEMPLATE:xn(e,t);break;default:e._err(t,Qe.endTagWithoutMatchingOpenElement)}}(this,e);break;case on.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case dt.NOSCRIPT:e.openElements.pop(),e.insertionMode=on.IN_HEAD;break;case dt.BR:Sn(e,t);break;default:e._err(t,Qe.endTagWithoutMatchingOpenElement)}}(this,e);break;case on.AFTER_HEAD:!function(e,t){switch(t.tagID){case dt.BODY:case dt.HTML:case dt.BR:Nn(e,t);break;case dt.TEMPLATE:xn(e,t);break;default:e._err(t,Qe.endTagWithoutMatchingOpenElement)}}(this,e);break;case on.IN_BODY:zn(this,e);break;case on.TEXT:!function(e,t){var n;t.tagID===dt.SCRIPT&&(null===(n=e.scriptHandler)||void 0===n||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}(this,e);break;case on.IN_TABLE:jn(this,e);break;case on.IN_TABLE_TEXT:Vn(this,e);break;case on.IN_CAPTION:!function(e,t){const n=t.tagID;switch(n){case dt.CAPTION:case dt.TABLE:e.openElements.hasInTableScope(dt.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(dt.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=on.IN_TABLE,n===dt.TABLE&&jn(e,t));break;case dt.BODY:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:zn(e,t)}}(this,e);break;case on.IN_COLUMN_GROUP:!function(e,t){switch(t.tagID){case dt.COLGROUP:e.openElements.currentTagId===dt.COLGROUP&&(e.openElements.pop(),e.insertionMode=on.IN_TABLE);break;case dt.TEMPLATE:xn(e,t);break;case dt.COL:break;default:Wn(e,t)}}(this,e);break;case on.IN_TABLE_BODY:Qn(this,e);break;case on.IN_ROW:Xn(this,e);break;case on.IN_CELL:!function(e,t){const n=t.tagID;switch(n){case dt.TD:case dt.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=on.IN_ROW);break;case dt.TABLE:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Xn(e,t));break;case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:break;default:zn(e,t)}}(this,e);break;case on.IN_SELECT:tr(this,e);break;case on.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===dt.CAPTION||n===dt.TABLE||n===dt.TBODY||n===dt.TFOOT||n===dt.THEAD||n===dt.TR||n===dt.TD||n===dt.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(dt.SELECT),e._resetInsertionMode(),e.onEndTag(t)):tr(e,t)}(this,e);break;case on.IN_TEMPLATE:!function(e,t){t.tagID===dt.TEMPLATE&&xn(e,t)}(this,e);break;case on.AFTER_BODY:rr(this,e);break;case on.IN_FRAMESET:!function(e,t){t.tagID!==dt.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagId===dt.FRAMESET||(e.insertionMode=on.AFTER_FRAMESET))}(this,e);break;case on.AFTER_FRAMESET:!function(e,t){t.tagID===dt.HTML&&(e.insertionMode=on.AFTER_AFTER_FRAMESET)}(this,e);break;case on.AFTER_AFTER_BODY:ir(this,e)}}onEof(e){switch(this.insertionMode){case on.INITIAL:bn(this,e);break;case on.BEFORE_HTML:kn(this,e);break;case on.BEFORE_HEAD:vn(this,e);break;case on.IN_HEAD:In(this,e);break;case on.IN_HEAD_NO_SCRIPT:Sn(this,e);break;case on.AFTER_HEAD:Nn(this,e);break;case on.IN_BODY:case on.IN_TABLE:case on.IN_CAPTION:case on.IN_COLUMN_GROUP:case on.IN_TABLE_BODY:case on.IN_ROW:case on.IN_CELL:case on.IN_SELECT:case on.IN_SELECT_IN_TABLE:Bn(this,e);break;case on.TEXT:!function(e,t){e._err(t,Qe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}(this,e);break;case on.IN_TABLE_TEXT:Vn(this,e);break;case on.IN_TEMPLATE:nr(this,e);break;case on.AFTER_BODY:case on.IN_FRAMESET:case on.AFTER_FRAMESET:case on.AFTER_AFTER_BODY:case on.AFTER_AFTER_FRAMESET:Tn(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===Ze.LINE_FEED)){if(1===e.chars.length)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case on.IN_HEAD:case on.IN_HEAD_NO_SCRIPT:case on.AFTER_HEAD:case on.TEXT:case on.IN_COLUMN_GROUP:case on.IN_SELECT:case on.IN_SELECT_IN_TABLE:case on.IN_FRAMESET:case on.AFTER_FRAMESET:this._insertCharacters(e);break;case on.IN_BODY:case on.IN_CAPTION:case on.IN_CELL:case on.IN_TEMPLATE:case on.AFTER_BODY:case on.AFTER_AFTER_BODY:case on.AFTER_AFTER_FRAMESET:Cn(this,e);break;case on.IN_TABLE:case on.IN_TABLE_BODY:case on.IN_ROW:Un(this,e);break;case on.IN_TABLE_TEXT:Zn(this,e)}}}function pn(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Fn(e,t),n}function hn(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function fn(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let i=0,a=s;a!==n;i++,a=s){s=e.openElements.getCommonAncestor(a);const n=e.activeFormattingElements.getElementEntry(a),o=n&&i>=3;!n||o?(o&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(a)):(a=mn(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function mn(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function gn(e,t,n){const r=Et(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===dt.TEMPLATE&&s===ot.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function En(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,s.tagID)}function yn(e,t){for(let n=0;n<8;n++){const n=pn(e,t);if(!n)break;const r=hn(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;const s=fn(e,r,n.element),i=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(s),i&&gn(e,i,s),En(e,r,n)}}function _n(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Tn(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){const n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function bn(e,t){e._err(t,Qe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ct.QUIRKS),e.insertionMode=on.BEFORE_HTML,e._processToken(t)}function kn(e,t){e._insertFakeRootElement(),e.insertionMode=on.BEFORE_HEAD,e._processToken(t)}function vn(e,t){e._insertFakeElement(ut.HEAD,dt.HEAD),e.headElement=e.openElements.current,e.insertionMode=on.IN_HEAD,e._processToken(t)}function An(e,t){switch(t.tagID){case dt.HTML:Mn(e,t);break;case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:e._appendElement(t,ot.HTML),t.ackSelfClosing=!0;break;case dt.TITLE:e._switchToTextParsing(t,kt.RCDATA);break;case dt.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,kt.RAWTEXT):(e._insertElement(t,ot.HTML),e.insertionMode=on.IN_HEAD_NO_SCRIPT);break;case dt.NOFRAMES:case dt.STYLE:e._switchToTextParsing(t,kt.RAWTEXT);break;case dt.SCRIPT:e._switchToTextParsing(t,kt.SCRIPT_DATA);break;case dt.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=on.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(on.IN_TEMPLATE);break;case dt.HEAD:e._err(t,Qe.misplacedStartTagForHeadElement);break;default:In(e,t)}}function xn(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==dt.TEMPLATE&&e._err(t,Qe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(dt.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,Qe.endTagWithoutMatchingOpenElement)}function In(e,t){e.openElements.pop(),e.insertionMode=on.AFTER_HEAD,e._processToken(t)}function Sn(e,t){const n=t.type===Je.EOF?Qe.openElementsLeftAfterEof:Qe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=on.IN_HEAD,e._processToken(t)}function Nn(e,t){e._insertFakeElement(ut.BODY,dt.BODY),e.insertionMode=on.IN_BODY,wn(e,t)}function wn(e,t){switch(t.type){case Je.CHARACTER:On(e,t);break;case Je.WHITESPACE_CHARACTER:Cn(e,t);break;case Je.COMMENT:_n(e,t);break;case Je.START_TAG:Mn(e,t);break;case Je.END_TAG:zn(e,t);break;case Je.EOF:Bn(e,t)}}function Cn(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function On(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Rn(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ot.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Dn(e){const t=et(e,lt.TYPE);return null!=t&&"hidden"===t.toLowerCase()}function Ln(e,t){e._switchToTextParsing(t,kt.RAWTEXT)}function Pn(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ot.HTML)}function Mn(e,t){switch(t.tagID){case dt.I:case dt.S:case dt.B:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.SMALL:case dt.STRIKE:case dt.STRONG:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ot.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case dt.A:!function(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ut.A);n&&(yn(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ot.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:!function(e,t){e.openElements.hasInButtonScope(dt.P)&&e._closePElement(),void 0!==e.openElements.currentTagId&&Tt.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ot.HTML)}(e,t);break;case dt.P:case dt.DL:case dt.OL:case dt.UL:case dt.DIV:case dt.DIR:case dt.NAV:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.DETAILS:case dt.ADDRESS:case dt.ARTICLE:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:!function(e,t){e.openElements.hasInButtonScope(dt.P)&&e._closePElement(),e._insertElement(t,ot.HTML)}(e,t);break;case dt.LI:case dt.DD:case dt.DT:!function(e,t){e.framesetOk=!1;const n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){const r=e.openElements.tagIDs[t];if(n===dt.LI&&r===dt.LI||(n===dt.DD||n===dt.DT)&&(r===dt.DD||r===dt.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==dt.ADDRESS&&r!==dt.DIV&&r!==dt.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(dt.P)&&e._closePElement(),e._insertElement(t,ot.HTML)}(e,t);break;case dt.BR:case dt.IMG:case dt.WBR:case dt.AREA:case dt.EMBED:case dt.KEYGEN:Rn(e,t);break;case dt.HR:!function(e,t){e.openElements.hasInButtonScope(dt.P)&&e._closePElement(),e._appendElement(t,ot.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}(e,t);break;case dt.RB:case dt.RTC:!function(e,t){e.openElements.hasInScope(dt.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ot.HTML)}(e,t);break;case dt.RT:case dt.RP:!function(e,t){e.openElements.hasInScope(dt.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(dt.RTC),e._insertElement(t,ot.HTML)}(e,t);break;case dt.PRE:case dt.LISTING:!function(e,t){e.openElements.hasInButtonScope(dt.P)&&e._closePElement(),e._insertElement(t,ot.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}(e,t);break;case dt.XMP:!function(e,t){e.openElements.hasInButtonScope(dt.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,kt.RAWTEXT)}(e,t);break;case dt.SVG:!function(e,t){e._reconstructActiveFormattingElements(),sn(t),an(t),t.selfClosing?e._appendElement(t,ot.SVG):e._insertElement(t,ot.SVG),t.ackSelfClosing=!0}(e,t);break;case dt.HTML:!function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}(e,t);break;case dt.BASE:case dt.LINK:case dt.META:case dt.STYLE:case dt.TITLE:case dt.SCRIPT:case dt.BGSOUND:case dt.BASEFONT:case dt.TEMPLATE:An(e,t);break;case dt.BODY:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}(e,t);break;case dt.FORM:!function(e,t){const n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(dt.P)&&e._closePElement(),e._insertElement(t,ot.HTML),n||(e.formElement=e.openElements.current))}(e,t);break;case dt.NOBR:!function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(dt.NOBR)&&(yn(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ot.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case dt.MATH:!function(e,t){e._reconstructActiveFormattingElements(),rn(t),an(t),t.selfClosing?e._appendElement(t,ot.MATHML):e._insertElement(t,ot.MATHML),t.ackSelfClosing=!0}(e,t);break;case dt.TABLE:!function(e,t){e.treeAdapter.getDocumentMode(e.document)!==ct.QUIRKS&&e.openElements.hasInButtonScope(dt.P)&&e._closePElement(),e._insertElement(t,ot.HTML),e.framesetOk=!1,e.insertionMode=on.IN_TABLE}(e,t);break;case dt.INPUT:!function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ot.HTML),Dn(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}(e,t);break;case dt.PARAM:case dt.TRACK:case dt.SOURCE:!function(e,t){e._appendElement(t,ot.HTML),t.ackSelfClosing=!0}(e,t);break;case dt.IMAGE:!function(e,t){t.tagName=ut.IMG,t.tagID=dt.IMG,Rn(e,t)}(e,t);break;case dt.BUTTON:!function(e,t){e.openElements.hasInScope(dt.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(dt.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ot.HTML),e.framesetOk=!1}(e,t);break;case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ot.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}(e,t);break;case dt.IFRAME:!function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,kt.RAWTEXT)}(e,t);break;case dt.SELECT:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ot.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===on.IN_TABLE||e.insertionMode===on.IN_CAPTION||e.insertionMode===on.IN_TABLE_BODY||e.insertionMode===on.IN_ROW||e.insertionMode===on.IN_CELL?on.IN_SELECT_IN_TABLE:on.IN_SELECT}(e,t);break;case dt.OPTION:case dt.OPTGROUP:!function(e,t){e.openElements.currentTagId===dt.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ot.HTML)}(e,t);break;case dt.NOEMBED:case dt.NOFRAMES:Ln(e,t);break;case dt.FRAMESET:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ot.HTML),e.insertionMode=on.IN_FRAMESET)}(e,t);break;case dt.TEXTAREA:!function(e,t){e._insertElement(t,ot.HTML),e.skipNextNewLine=!0,e.tokenizer.state=kt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=on.TEXT}(e,t);break;case dt.NOSCRIPT:e.options.scriptingEnabled?Ln(e,t):Pn(e,t);break;case dt.PLAINTEXT:!function(e,t){e.openElements.hasInButtonScope(dt.P)&&e._closePElement(),e._insertElement(t,ot.HTML),e.tokenizer.state=kt.PLAINTEXT}(e,t);break;case dt.COL:case dt.TH:case dt.TD:case dt.TR:case dt.HEAD:case dt.FRAME:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.CAPTION:case dt.COLGROUP:break;default:Pn(e,t)}}function Fn(e,t){const n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){const s=e.openElements.items[t],i=e.openElements.tagIDs[t];if(r===i&&(r!==dt.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(s,i))break}}function zn(e,t){switch(t.tagID){case dt.A:case dt.B:case dt.I:case dt.S:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.NOBR:case dt.SMALL:case dt.STRIKE:case dt.STRONG:yn(e,t);break;case dt.P:!function(e){e.openElements.hasInButtonScope(dt.P)||e._insertFakeElement(ut.P,dt.P),e._closePElement()}(e);break;case dt.DL:case dt.UL:case dt.OL:case dt.DIR:case dt.DIV:case dt.NAV:case dt.PRE:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.BUTTON:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.ADDRESS:case dt.ARTICLE:case dt.DETAILS:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.LISTING:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case dt.LI:!function(e){e.openElements.hasInListItemScope(dt.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(dt.LI),e.openElements.popUntilTagNamePopped(dt.LI))}(e);break;case dt.DD:case dt.DT:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:!function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}(e);break;case dt.BR:!function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ut.BR,dt.BR),e.openElements.pop(),e.framesetOk=!1}(e);break;case dt.BODY:!function(e,t){if(e.openElements.hasInScope(dt.BODY)&&(e.insertionMode=on.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}(e,t);break;case dt.HTML:!function(e,t){e.openElements.hasInScope(dt.BODY)&&(e.insertionMode=on.AFTER_BODY,rr(e,t))}(e,t);break;case dt.FORM:!function(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(dt.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(dt.FORM):n&&e.openElements.remove(n))}(e);break;case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}(e,t);break;case dt.TEMPLATE:xn(e,t);break;default:Fn(e,t)}}function Bn(e,t){e.tmplInsertionModeStack.length>0?nr(e,t):Tn(e,t)}function Un(e,t){if(void 0!==e.openElements.currentTagId&&cn.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=on.IN_TABLE_TEXT,t.type){case Je.CHARACTER:Gn(e,t);break;case Je.WHITESPACE_CHARACTER:Zn(e,t)}else $n(e,t)}function Hn(e,t){switch(t.tagID){case dt.TD:case dt.TH:case dt.TR:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ut.TBODY,dt.TBODY),e.insertionMode=on.IN_TABLE_BODY,Kn(e,t)}(e,t);break;case dt.STYLE:case dt.SCRIPT:case dt.TEMPLATE:An(e,t);break;case dt.COL:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ut.COLGROUP,dt.COLGROUP),e.insertionMode=on.IN_COLUMN_GROUP,qn(e,t)}(e,t);break;case dt.FORM:!function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,ot.HTML),e.formElement=e.openElements.current,e.openElements.pop())}(e,t);break;case dt.TABLE:!function(e,t){e.openElements.hasInTableScope(dt.TABLE)&&(e.openElements.popUntilTagNamePopped(dt.TABLE),e._resetInsertionMode(),e._processStartTag(t))}(e,t);break;case dt.TBODY:case dt.TFOOT:case dt.THEAD:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ot.HTML),e.insertionMode=on.IN_TABLE_BODY}(e,t);break;case dt.INPUT:!function(e,t){Dn(t)?e._appendElement(t,ot.HTML):$n(e,t),t.ackSelfClosing=!0}(e,t);break;case dt.CAPTION:!function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ot.HTML),e.insertionMode=on.IN_CAPTION}(e,t);break;case dt.COLGROUP:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ot.HTML),e.insertionMode=on.IN_COLUMN_GROUP}(e,t);break;default:$n(e,t)}}function jn(e,t){switch(t.tagID){case dt.TABLE:e.openElements.hasInTableScope(dt.TABLE)&&(e.openElements.popUntilTagNamePopped(dt.TABLE),e._resetInsertionMode());break;case dt.TEMPLATE:xn(e,t);break;case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:$n(e,t)}}function $n(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,wn(e,t),e.fosterParentingEnabled=n}function Zn(e,t){e.pendingCharacterTokens.push(t)}function Gn(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Vn(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)$n(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Yn=new Set([dt.CAPTION,dt.COL,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]);function qn(e,t){switch(t.tagID){case dt.HTML:Mn(e,t);break;case dt.COL:e._appendElement(t,ot.HTML),t.ackSelfClosing=!0;break;case dt.TEMPLATE:An(e,t);break;default:Wn(e,t)}}function Wn(e,t){e.openElements.currentTagId===dt.COLGROUP&&(e.openElements.pop(),e.insertionMode=on.IN_TABLE,e._processToken(t))}function Kn(e,t){switch(t.tagID){case dt.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ot.HTML),e.insertionMode=on.IN_ROW;break;case dt.TH:case dt.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ut.TR,dt.TR),e.insertionMode=on.IN_ROW,Jn(e,t);break;case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=on.IN_TABLE,Hn(e,t));break;default:Hn(e,t)}}function Qn(e,t){const n=t.tagID;switch(t.tagID){case dt.TBODY:case dt.TFOOT:case dt.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=on.IN_TABLE);break;case dt.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=on.IN_TABLE,jn(e,t));break;case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:case dt.TR:break;default:jn(e,t)}}function Jn(e,t){switch(t.tagID){case dt.TH:case dt.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,ot.HTML),e.insertionMode=on.IN_CELL,e.activeFormattingElements.insertMarker();break;case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:e.openElements.hasInTableScope(dt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=on.IN_TABLE_BODY,Kn(e,t));break;default:Hn(e,t)}}function Xn(e,t){switch(t.tagID){case dt.TR:e.openElements.hasInTableScope(dt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=on.IN_TABLE_BODY);break;case dt.TABLE:e.openElements.hasInTableScope(dt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=on.IN_TABLE_BODY,Qn(e,t));break;case dt.TBODY:case dt.TFOOT:case dt.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(dt.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=on.IN_TABLE_BODY,Qn(e,t));break;case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:break;default:jn(e,t)}}function er(e,t){switch(t.tagID){case dt.HTML:Mn(e,t);break;case dt.OPTION:e.openElements.currentTagId===dt.OPTION&&e.openElements.pop(),e._insertElement(t,ot.HTML);break;case dt.OPTGROUP:e.openElements.currentTagId===dt.OPTION&&e.openElements.pop(),e.openElements.currentTagId===dt.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ot.HTML);break;case dt.HR:e.openElements.currentTagId===dt.OPTION&&e.openElements.pop(),e.openElements.currentTagId===dt.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ot.HTML),t.ackSelfClosing=!0;break;case dt.INPUT:case dt.KEYGEN:case dt.TEXTAREA:case dt.SELECT:e.openElements.hasInSelectScope(dt.SELECT)&&(e.openElements.popUntilTagNamePopped(dt.SELECT),e._resetInsertionMode(),t.tagID!==dt.SELECT&&e._processStartTag(t));break;case dt.SCRIPT:case dt.TEMPLATE:An(e,t)}}function tr(e,t){switch(t.tagID){case dt.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===dt.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===dt.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===dt.OPTGROUP&&e.openElements.pop();break;case dt.OPTION:e.openElements.currentTagId===dt.OPTION&&e.openElements.pop();break;case dt.SELECT:e.openElements.hasInSelectScope(dt.SELECT)&&(e.openElements.popUntilTagNamePopped(dt.SELECT),e._resetInsertionMode());break;case dt.TEMPLATE:xn(e,t)}}function nr(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(dt.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Tn(e,t)}function rr(e,t){var n;if(t.tagID===dt.HTML){if(e.fragmentContext||(e.insertionMode=on.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===dt.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(null===(n=e.treeAdapter.getNodeSourceCodeLocation(r))||void 0===n?void 0:n.endTag)&&e._setEndLocation(r,t)}}else sr(e,t)}function sr(e,t){e.insertionMode=on.IN_BODY,wn(e,t)}function ir(e,t){e.insertionMode=on.IN_BODY,wn(e,t)}function ar(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ot.HTML&&void 0!==e.openElements.currentTagId&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),String.prototype.codePointAt,new Map([[34,"""],[38,"&"],[160," "]]),new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]),new Set([ut.AREA,ut.BASE,ut.BASEFONT,ut.BGSOUND,ut.BR,ut.COL,ut.EMBED,ut.FRAME,ut.HR,ut.IMG,ut.INPUT,ut.KEYGEN,ut.LINK,ut.META,ut.PARAM,ut.SOURCE,ut.TRACK,ut.WBR]);const or=cr("end"),lr=cr("start");function cr(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function ur(e){const t=lr(e),n=or(e);if(t&&n)return{start:t,end:n}}const dr=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,pr=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),hr={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function fr(e,t){const n=function(e){const t="root"===e.type?e.children[0]:e;return Boolean(t&&("doctype"===t.type||"element"===t.type&&"html"===t.tagName.toLowerCase()))}(e),r=Le("type",{handlers:{root:gr,element:Er,text:yr,comment:Tr,doctype:_r,raw:br},unknown:kr}),s={parser:n?new dn(hr):dn.getFragmentParser(void 0,hr),handle(e){r(e,s)},stitches:!1,options:t||{}};r(e,s),vr(s,lr());const i=Ie(n?s.parser.document:s.parser.getFragment(),{file:s.options.file});return s.stitches&&f(i,"comment",(function(e,t,n){const r=e;if(r.value.stitch&&n&&void 0!==t)return n.children[t]=r.value.stitch,t})),"root"===i.type&&1===i.children.length&&i.children[0].type===e.type?i.children[0]:i}function mr(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function gr(e,t){mr(e.children,t)}function Er(e,t){!function(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===kt.PLAINTEXT)return;vr(t,lr(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:ve.html;s===ve.html&&"svg"===n&&(s=ve.svg);const i=(o={...e,children:[]},Fe(o,"svg"===({space:s===ve.svg?"svg":"html"}||Pe).space?se:re)),a={type:Je.START_TAG,tagName:n,tagID:Et(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:xr(e)};var o;t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}(e,t),mr(e.children,t),function(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&He.includes(n))return;if(t.parser.tokenizer.state===kt.PLAINTEXT)return;vr(t,or(e));const r={type:Je.END_TAG,tagName:n,tagID:Et(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:xr(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n!==t.parser.tokenizer.lastStartTagName||t.parser.tokenizer.state!==kt.RCDATA&&t.parser.tokenizer.state!==kt.RAWTEXT&&t.parser.tokenizer.state!==kt.SCRIPT_DATA||(t.parser.tokenizer.state=kt.DATA)}(e,t)}function yr(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Je.CHARACTER,chars:e.value,location:xr(e)};vr(t,lr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function _r(e,t){const n={type:Je.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:xr(e)};vr(t,lr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Tr(e,t){const n=e.value,r={type:Je.COMMENT,data:n,location:xr(e)};vr(t,lr(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function br(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Ar(t,lr(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(dr,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),72===t.parser.tokenizer.state||78===t.parser.tokenizer.state){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function kr(e,t){const n=e;if(!t.options.passThrough||!t.options.passThrough.includes(n.type)){let e="";throw pr.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+e)}!function(e,t){t.stitches=!0;const n=function(e){return O("children"in e?{...e,children:[]}:e)}(e);if("children"in e&&"children"in n){const r=fr({type:"root",children:e.children},t.options);n.children=r.children}Tr({type:"comment",value:{stitch:n}},t)}(n,t)}function vr(e,t){Ar(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=kt.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Ar(e,t){if(t&&void 0!==t.offset){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=1-t.column,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function xr(e){const t=lr(e)||{line:void 0,column:void 0,offset:void 0},n=or(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Ir(e){return function(t,n){return fr(t,{...e,file:n})}}const Sr=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Nr={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Sr,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Sr],h2:[["className","sr-only"]],img:[...Sr,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Sr,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Sr],table:[...Sr],ul:[...Sr,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},wr={}.hasOwnProperty;function Cr(e,t){if(t&&"object"==typeof t){const n=t;switch("string"==typeof n.type?n.type:""){case"comment":return function(e,t){if(e.schema.allowComments){const e="string"==typeof t.value?t.value:"",n=e.indexOf("--\x3e"),r={type:"comment",value:n<0?e:e.slice(0,n)};return Lr(r,t),r}}(e,n);case"doctype":return function(e,t){if(e.schema.allowDoctypes){const e={type:"doctype"};return Lr(e,t),e}}(e,n);case"element":return function(e,t){const n="string"==typeof t.tagName?t.tagName:"";e.stack.push(n);const r=Or(e,t.children),s=function(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,i=r&&wr.call(r,n)?r[n]:void 0,a=r&&wr.call(r,"*")?r["*"]:void 0,o=t&&"object"==typeof t?t:{},l={};let c;for(c in o)if(wr.call(o,c)){const t=o[c];let n=Rr(e,Pr(i,c),c,t);null==n&&(n=Rr(e,Pr(a,c),c,t)),null!=n&&(l[c]=n)}if(s&&wr.call(s,n)){const e=s[n];for(c in e)wr.call(e,c)&&!wr.call(l,c)&&(l[c]=e[c])}return l}(e,t.properties);e.stack.pop();let i=!1;if(n&&"*"!==n&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(i=!0,e.schema.ancestors&&wr.call(e.schema.ancestors,n))){const t=e.schema.ancestors[n];let r=-1;for(i=!1;++r<t.length;)e.stack.includes(t[r])&&(i=!0)}if(!i)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const a={type:"element",tagName:n,properties:s,children:r};return Lr(a,t),a}(e,n);case"root":return function(e,t){const n={type:"root",children:Or(e,t.children)};return Lr(n,t),n}(e,n);case"text":return function(e,t){const n={type:"text",value:"string"==typeof t.value?t.value:""};return Lr(n,t),n}(0,n)}}}function Or(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const t=Cr(e,r[s]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Rr(e,t,n,r){return t?Array.isArray(r)?function(e,t,n,r){let s=-1;const i=[];for(;++s<r.length;){const a=Dr(e,t,n,r[s]);"number"!=typeof a&&"string"!=typeof a||i.push(a)}return i}(e,t,n,r):Dr(e,t,n,r):void 0}function Dr(e,t,n,r){if(("boolean"==typeof r||"number"==typeof r||"string"==typeof r)&&function(e,t,n){const r=e.schema.protocols&&wr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||0===r.length)return!0;const s=String(n),i=s.indexOf(":"),a=s.indexOf("?"),o=s.indexOf("#"),l=s.indexOf("/");if(i<0||l>-1&&i>l||a>-1&&i>a||o>-1&&i>o)return!0;let c=-1;for(;++c<r.length;){const e=r[c];if(i===e.length&&s.slice(0,e.length)===e)return!0}return!1}(e,n,r)){if("object"==typeof t&&t.length>1){let e=!1,n=0;for(;++n<t.length;){const s=t[n];if(s&&"object"==typeof s&&"flags"in s){if(s.test(String(r))){e=!0;break}}else if(s===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Lr(e,t){const n=ur(t);t.data&&(e.data=O(t.data)),n&&(e.position=n)}function Pr(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],i="string"==typeof s?s:s[0];if(i===t)return s;"data*"===i&&(n=s)}if(t.length>4&&"data"===t.slice(0,4).toLowerCase())return n}function Mr(e){return function(t){const n=function(e,t){let n={type:"root",children:[]};const r=Cr({schema:t?{...Nr,...t}:Nr,stack:[]},e);return r&&(Array.isArray(r)?1===r.length?n=r[0]:n.children=r:n=r),n}(t,e);return n}}function Fr(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;-1!==s;)r++,s=n.indexOf(t,s+t.length);return r}const zr=Kr(/[A-Za-z]/),Br=Kr(/[\dA-Za-z]/),Ur=Kr(/[#-'*+\--9=?A-Z^-~]/);function Hr(e){return null!==e&&(e<32||127===e)}const jr=Kr(/\d/),$r=Kr(/[\dA-Fa-f]/),Zr=Kr(/[!-/:-@[-`{-~]/);function Gr(e){return null!==e&&e<-2}function Vr(e){return null!==e&&(e<0||32===e)}function Yr(e){return-2===e||-1===e||32===e}const qr=Kr(/\p{P}|\p{S}/u),Wr=Kr(/\s/);function Kr(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function Qr(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function Jr(e){return"function"==typeof e?e:function(){return e}}const Xr="phrasing",es=["autolink","link","image","label"];function ts(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ns(e){this.config.enter.autolinkProtocol.call(this,e)}function rs(e){this.config.exit.autolinkProtocol.call(this,e)}function ss(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function is(e){this.config.exit.autolinkEmail.call(this,e)}function as(e){this.exit(e)}function os(e){!function(e,t,n){const r=a((n||{}).ignore||[]),s=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([Qr(e[0]),Jr(e[1])])}return t}(t);let i=-1;for(;++i<s.length;)h(e,"text",o);function o(e,t){let n,a=-1;for(;++a<t.length;){const e=t[a],s=n?n.children:void 0;if(r(e,s?s.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=s[i][0],a=s[i][1];let o=0;const l=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,s={index:d.index,input:d.input,stack:[...t,e]};let i=a(...d,s);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(o!==n&&u.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(i)?u.push(...i):i&&u.push(i),o=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}return c?(o<e.value.length&&u.push({type:"text",value:e.value.slice(o)}),n.children.splice(l,1,...u)):u=[e],l+u.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ls],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,cs]],{ignore:["link","linkReference"]})}function ls(e,t,n,r,s){let i="";if(!us(s))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}(n))return!1;const a=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=Fr(e,"(");let i=Fr(e,")");for(;-1!==r&&s>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function cs(e,t,n,r){return!(!us(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function us(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||Wr(n)||qr(n))&&(!t||47!==n)}function ds(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function ps(){this.buffer()}function hs(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fs(){this.buffer()}function ms(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gs(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ds(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Es(e){this.exit(e)}function ys(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ds(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _s(e){this.exit(e)}function Ts(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function bs(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,s){const i=r.createTracker(s);let a=i.move("[^");const o=r.enter("footnoteDefinition"),l=r.enter("label");return a+=i.move(r.safe(r.associationId(e),{before:a,after:"]"})),l(),a+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),a+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?vs:ks))),o(),a},footnoteReference:Ts},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function ks(e,t,n){return 0===t?e:vs(e,0,n)}function vs(e,t,n){return(n?"":" ")+e}Ts.peek=function(){return"["};const As=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function xs(e){this.enter({type:"delete",children:[]},e)}function Is(e){this.exit(e)}function Ss(e,t,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function Ns(e){return e.length}function ws(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function Cs(e,t,n){return">"+(n?"":" ")+e}function Os(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Rs(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if("\n"===n.unsafe[s].character&&(Os(i=n.stack,(a=n.unsafe[s]).inConstruct,!0)&&!Os(i,a.notInConstruct,!1)))return/[ \t]/.test(r.before)?"":" ";var i,a;return"\\\n"}function Ds(e,t,n){return(n?"":" ")+e}function Ls(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ps(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ms(e){return null===e||Vr(e)||Wr(e)?1:qr(e)?2:void 0}function Fs(e,t,n){const r=Ms(e),s=Ms(t);return void 0===r?void 0===s?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===s?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===s?{inside:!1,outside:!1}:1===s?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===s?{inside:!1,outside:!1}:1===s?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function zs(e,t,n,r){const s=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const c=l.charCodeAt(0),u=Fs(r.before.charCodeAt(r.before.length-1),c,s);u.inside&&(l=Ps(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Fs(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+Ps(d));const h=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},o+l+h}Ss.peek=function(){return"~"},zs.peek=function(e,t,n){return n.options.emphasis||"*"};const Bs={};function Us(e,t){const n=t||Bs;return Hs(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function Hs(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return js(e.children,t,n)}return Array.isArray(e)?js(e,t,n):""}function js(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Hs(e[s],t,n);return r.join("")}function $s(e){return e.value||""}function Zs(e,t,n,r){const s=Ls(n),i='"'===s?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),o()),c+=l.move(")"),a(),c}function Gs(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const c=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=u,i(),"full"!==s&&c&&c===d?"shortcut"===s?l=l.slice(0,-1):l+=o.move("]"):l+=o.move(d+"]"),l}function Vs(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=n.compilePattern(e);let s;if(e.atBreak)for(;s=t.exec(r);){let e=s.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(s.index+1)}}return s+r+s}function Ys(e,t){const n=Us(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function qs(e,t,n,r){const s=Ls(n),i='"'===s?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(Ys(e,n)){const t=n.stack;n.stack=[],o=n.enter("autolink");let r=a.move("<");return r+=a.move(n.containerPhrasing(e,{before:r,after:">",...a.current()})),r+=a.move(">"),o(),n.stack=t,r}o=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=a.move(" "+s),c+=a.move(n.safe(e.title,{before:c,after:s,...a.current()})),c+=a.move(s),l()),c+=a.move(")"),o(),c}function Ws(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=u,i(),"full"!==s&&c&&c===d?"shortcut"===s?l=l.slice(0,-1):l+=o.move("]"):l+=o.move(d+"]"),l}function Ks(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Qs(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}$s.peek=function(){return"<"},Zs.peek=function(){return"!"},Gs.peek=function(){return"!"},Vs.peek=function(){return"`"},qs.peek=function(e,t,n){return Ys(e,n)?"<":"["},Ws.peek=function(){return"["};const Js=a(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xs(e,t,n,r){const s=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let l=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const c=l.charCodeAt(0),u=Fs(r.before.charCodeAt(r.before.length-1),c,s);u.inside&&(l=Ps(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Fs(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+Ps(d));const h=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},o+l+h}Xs.peek=function(e,t,n){return n.options.strong||"*"};const ei={blockquote:function(e,t,n,r){const s=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),Cs);return s(),a},break:Rs,code:function(e,t,n,r){const s=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",a="`"===s?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,Ds);return e(),t}const o=n.createTracker(r),l=s.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),s=r,i=0,a=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===s?++i>a&&(a=i):i=1,s=r+t.length,r=n.indexOf(t,s);return a}(i,s)+1,3)),c=n.enter("codeFenced");let u=o.move(l);if(e.lang){const t=n.enter(`codeFencedLang${a}`);u+=o.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${a}`);u+=o.move(" "),u+=o.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...o.current()})),t()}return u+=o.move("\n"),i&&(u+=o.move(i+"\n")),u+=o.move(l),c(),u},definition:function(e,t,n,r){const s=Ls(n),i='"'===s?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),o()),a(),c},emphasis:zs,hardBreak:Rs,heading:function(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(function(e,t){let n=!1;return f(e,(function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,d})),Boolean((!e.depth||e.depth<3)&&Us(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),a=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),a+"\n"+(1===s?"=":"-").repeat(a.length-(Math.max(a.lastIndexOf("\r"),a.lastIndexOf("\n"))+1))}const a="#".repeat(s),o=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(c)&&(c=Ps(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),o(),c},html:$s,image:Zs,imageReference:Gs,inlineCode:Vs,link:qs,linkReference:Ws,list:function(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):Ks(n);const o=e.ordered?"."===a?")":".":function(e){const t=Ks(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&a===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==a&&"-"!==a||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),Qs(n)===a&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,s(),c},listItem:function(e,t,n,r){const s=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||Ks(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let a=i.length+1;("tab"===s||"mixed"===s&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));const o=n.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),(function(e,t,n){return t?(n?"":" ".repeat(a))+e:(n?i:i+" ".repeat(a-i.length))+e}));return l(),c},paragraph:function(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a},root:function(e,t,n,r){const s=e.children.some((function(e){return Js(e)}));return(s?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:Xs,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(Qs(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function ti(e){const t=e._align;this.enter({type:"table",align:t.map((function(e){return"none"===e?null:e})),children:[]},e),this.data.inTable=!0}function ni(e){this.exit(e),this.data.inTable=void 0}function ri(e){this.enter({type:"tableRow",children:[]},e)}function si(e){this.exit(e)}function ii(e){this.enter({type:"tableCell",children:[]},e)}function ai(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,oi));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function oi(e,t){return"|"===t?t:e}function li(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=ei.inlineCode(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return o(function(e,t,n){const r=e.children;let s=-1;const i=[],a=t.enter("table");for(;++s<r.length;)i[s]=l(r[s],t,n);return a(),i}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){const s=o([l(e,n,r)]);return s.slice(0,s.indexOf("\n"))}}};function a(e,t,n,r){const s=n.enter("tableCell"),a=n.enter("phrasing"),o=n.containerPhrasing(e,{...r,before:i,after:i});return a(),s(),o}function o(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||Ns,i=[],a=[],o=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],r=[];let i=-1;for(e[u].length>c&&(c=e[u].length);++i<e[u].length;){const a=null==(d=e[u][i])?"":String(d);if(!1!==n.alignDelimiters){const e=s(a);r[i]=e,(void 0===l[i]||e>l[i])&&(l[i]=e)}t.push(a)}a[u]=t,o[u]=r}var d;let p=-1;if("object"==typeof r&&"length"in r)for(;++p<c;)i[p]=ws(r[p]);else{const e=ws(r);for(;++p<c;)i[p]=e}p=-1;const h=[],f=[];for(;++p<c;){const e=i[p];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let s=!1===n.alignDelimiters?1:Math.max(1,l[p]-t.length-r.length);const a=t+"-".repeat(s)+r;!1!==n.alignDelimiters&&(s=t.length+s+r.length,s>l[p]&&(l[p]=s),f[p]=s),h[p]=a}a.splice(1,0,h),o.splice(1,0,f),u=-1;const m=[];for(;++u<a.length;){const e=a[u],t=o[u];p=-1;const r=[];for(;++p<c;){const s=e[p]||"";let a="",o="";if(!1!==n.alignDelimiters){const e=l[p]-(t[p]||0),n=i[p];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):(a=" ".repeat(e/2),o=a):o=" ".repeat(e)}!1===n.delimiterStart||p||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===s||!1===n.delimiterStart&&!p||r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(s),!1!==n.alignDelimiters&&r.push(o),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&p===c-1||r.push("|")}m.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return m.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:s})}function l(e,t,n){const r=e.children;let s=-1;const i=[],o=t.enter("tableRow");for(;++s<r.length;)i[s]=a(r[s],0,t,n);return o(),i}}function ci(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function ui(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let s,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){s=e;break}}s===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function di(e,t,n,r){const s=e.children[0],i="boolean"==typeof e.checked&&s&&"paragraph"===s.type,a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(a);let l=ei.listItem(e,t,n,{...r,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,(function(e){return e+a}))),l}function pi(e,t,n,r){const s=e.length;let i,a=0;if(t=t<0?-t>s?0:s+t:t>s?s:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function hi(e,t){return e.length>0?(pi(e,e.length,0,t),e):t}const fi={}.hasOwnProperty;function mi(e){const t={};let n=-1;for(;++n<e.length;)gi(t,e[n]);return t}function gi(e,t){let n;for(n in t){const r=(fi.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let i;if(s)for(i in s){fi.call(r,i)||(r[i]=[]);const e=s[i];Ei(r[i],Array.isArray(e)?e:e?[e]:[])}}}function Ei(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);pi(e,0,0,r)}const yi={tokenize:function(e,t,n){let r=0;return function t(i){return(87===i||119===i)&&r<3?(r++,e.consume(i),t):46===i&&3===r?(e.consume(i),s):n(i)};function s(e){return null===e?n(e):t(e)}},partial:!0},_i={tokenize:function(e,t,n){let r,s,i;return a;function a(t){return 46===t||95===t?e.check(bi,l,o)(t):null===t||Vr(t)||Wr(t)||45!==t&&qr(t)?l(t):(i=!0,e.consume(t),a)}function o(t){return 95===t?r=!0:(s=r,r=void 0),e.consume(t),a}function l(e){return s||r||!i?n(e):t(e)}},partial:!0},Ti={tokenize:function(e,t){let n=0,r=0;return s;function s(a){return 40===a?(n++,e.consume(a),s):41===a&&r<n?i(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(bi,t,i)(a):null===a||Vr(a)||Wr(a)?t(a):(e.consume(a),s)}function i(t){return 41===t&&r++,e.consume(t),s}},partial:!0},bi={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),i):93===a?(e.consume(a),s):60===a||null===a||Vr(a)||Wr(a)?t(a):n(a)}function s(e){return null===e||40===e||91===e||Vr(e)||Wr(e)?t(e):r(e)}function i(e){return zr(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):zr(t)?(e.consume(t),a):n(t)}},partial:!0},ki={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return Br(e)?n(e):t(e)}},partial:!0},vi={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){return 87!==t&&119!==t||!Ni.call(r,r.previous)||Ri(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(yi,e.attempt(_i,e.attempt(Ti,s),n),n)(t))};function s(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:Ni},Ai={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let s="",i=!1;return function(t){return 72!==t&&104!==t||!wi.call(r,r.previous)||Ri(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(t),e.consume(t),a)};function a(t){if(zr(t)&&s.length<5)return s+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=s.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),i?l:(i=!0,o)):n(t)}function l(t){return null===t||Hr(t)||Vr(t)||Wr(t)||qr(t)?n(t):e.attempt(_i,e.attempt(Ti,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:wi},xi={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let s,i;return function(t){return Oi(t)&&Ci.call(r,r.previous)&&!Ri(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)):n(t)};function a(t){return Oi(t)?(e.consume(t),a):64===t?(e.consume(t),o):n(t)}function o(t){return 46===t?e.check(ki,c,l)(t):45===t||95===t||Br(t)?(i=!0,e.consume(t),o):c(t)}function l(t){return e.consume(t),s=!0,o}function c(a){return i&&s&&zr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:Ci},Ii={};let Si=48;for(;Si<123;)Ii[Si]=xi,Si++,58===Si?Si=65:91===Si&&(Si=97);function Ni(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||Vr(e)}function wi(e){return!zr(e)}function Ci(e){return!(47===e||Oi(e))}function Oi(e){return 43===e||45===e||46===e||95===e||Br(e)}function Ri(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Di(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){return Yr(r)?(e.enter(n),a(r)):t(r)};function a(r){return Yr(r)&&i++<s?(e.consume(r),a):(e.exit(n),t(r))}}Ii[43]=xi,Ii[45]=xi,Ii[46]=xi,Ii[95]=xi,Ii[72]=[xi,Ai],Ii[104]=[xi,Ai],Ii[87]=[xi,vi],Ii[119]=[xi,vi];const Li={partial:!0,tokenize:function(e,t,n){return function(t){return Yr(t)?Di(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||Gr(e)?t(e):n(e)}}},Pi={tokenize:function(e,t,n){const r=this;return Di(e,(function(e){const s=r.events[r.events.length-1];return s&&"gfmFootnoteDefinitionIndent"===s[1].type&&4===s[2].sliceSerialize(s[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function Mi(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const e=r.events[s][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(s){if(!a||!a._balanced)return n(s);const o=ds(r.sliceSerialize({start:a.end,end:r.now()}));return 94===o.codePointAt(0)&&i.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s)):n(s)}}function Fi(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[r+1],e[r+2],["enter",s,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(r,e.length-r+1,...l),e}function zi(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(o){if(a>999||93===o&&!i||null===o||91===o||Vr(o))return n(o);if(93===o){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return s.includes(ds(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return Vr(o)||(i=!0),a++,e.consume(o),92===o?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function Bi(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a,o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(o>999||93===t&&!a||null===t||91===t||Vr(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=ds(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Vr(t)||(a=!0),o++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),o++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s.includes(i)||s.push(i),Di(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function Ui(e,t,n){return e.check(Li,t,e.attempt(Pi,t,n))}function Hi(e){e.exit("gfmFootnoteDefinition")}function ji(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}function $i(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const s=this.previous,i=this.events;let a=0;return function(t){return 126===s&&"characterEscape"!==i[i.length-1][1].type?r(t):(e.enter("strikethroughSequenceTemporary"),o(t))};function o(i){const l=Ms(s);if(126===i)return a>1?r(i):(e.consume(i),a++,o);if(a<2&&!t)return r(i);const c=e.exit("strikethroughSequenceTemporary"),u=Ms(i);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const s={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",s,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],o=t.parser.constructs.insideSpan.null;o&&pi(a,a.length,0,ji(o,e.slice(r+1,n),t)),pi(a,a.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",s,t]]),pi(e,r-1,n-r+3,a),n=r+a.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class Zi{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let s=0;if(0!==n||0!==r.length){for(;s<e.map.length;){if(e.map[s][0]===t)return e.map[s][1]+=n,void e.map[s][2].push(...r);s+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort((function(e,t){return e[0]-t[0]})),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function Gi(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if("enter"===s[0])"tableContent"===s[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===s[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===s[1].type)break}else"enter"===s[0]&&"tableDelimiterRow"===s[1].type&&(n=!0);t+=1}return r}function Vi(e,t,n){const r=this;let s,i=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const s=t>-1?r.events[t][1].type:null,i="tableHead"===s||"tableRow"===s?T:o;return i===T&&r.parser.lazy[r.now().line]?n(e):i(e)};function o(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(s=!0,a+=1),l(e)}(t)}function l(t){return null===t?n(t):Gr(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):Yr(t)?Di(e,l,"whitespace")(t):(a+=1,s&&(s=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),s=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||Vr(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),s=!1,Yr(t)?Di(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?f(t):124===t?(s=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):_(t)}function h(t){return Yr(t)?Di(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||Gr(t)?y(t):_(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):_(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(t))}function E(t){return Yr(t)?Di(e,y,"whitespace")(t):y(t)}function y(n){return 124===n?p(n):(null===n||Gr(n))&&s&&i===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):_(n)}function _(e){return n(e)}function T(t){return e.enter("tableRow"),b(t)}function b(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),b):null===n||Gr(n)?(e.exit("tableRow"),t(n)):Yr(n)?Di(e,b,"whitespace")(n):(e.enter("data"),k(n))}function k(t){return null===t||124===t||Vr(t)?(e.exit("data"),b(t)):(e.consume(t),92===t?v:k)}function v(t){return 92===t||124===t?(e.consume(t),k):k(t)}}function Yi(e,t){let n,r,s,i=-1,a=!0,o=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new Zi;for(;++i<e.length;){const h=e[i],f=h[1];"enter"===h[0]?"tableHead"===f.type?(u=!1,0!==d&&(Wi(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(a=!0,s=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(i,0,[["enter",r,t]])),o="tableDelimiterRow"===f.type?2:r?3:1):!o||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],s=qi(p,t,l,o,void 0,s)),l=c,c=[l[1],i,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],s=qi(p,t,l,o,void 0,s),l=[0,0,0,0]),c[2]=i)):"tableHead"===f.type?(u=!0,d=i):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=i,0!==l[1]?(c[0]=c[1],s=qi(p,t,l,o,i,s)):0!==c[1]&&(s=qi(p,t,c,o,i,s)),o=0):!o||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=i)}for(0!==d&&Wi(p,t,d,n,r),p.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=Gi(t.events,i))}return e}function qi(e,t,n,r,s,i){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},Ki(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const o=Ki(t.events,n[1]);if(i={type:a,start:Object.assign({},o),end:Object.assign({},o)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const s=Ki(t.events,n[2]),i=Ki(t.events,n[3]),a={type:"tableContent",start:Object.assign({},s),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],s=t.events[n[3]];if(r[1].end=Object.assign({},s[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==s&&(i.end=Object.assign({},Ki(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function Wi(e,t,n,r,s){const i=[],a=Ki(t.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function Ki(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const Qi={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),s):n(t)};function s(t){return Vr(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return Gr(r)?t(r):Yr(r)?e.check({tokenize:Ji},t,n)(r):n(r)}}};function Ji(e,t,n){return Di(e,(function(e){return null===e?n(e):t(e)}),"whitespace")}const Xi={};var ea=Object.defineProperty,ta=Object.defineProperties,na=Object.getOwnPropertyDescriptors,ra=Object.getOwnPropertySymbols,sa=Object.prototype.hasOwnProperty,ia=Object.prototype.propertyIsEnumerable,aa=(e,t,n)=>t in e?ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oa=(e,t)=>{for(var n in t||(t={}))sa.call(t,n)&&aa(e,n,t[n]);if(ra)for(var n of ra(t))ia.call(t,n)&&aa(e,n,t[n]);return e},la=(e,t)=>ta(e,na(t)),ca=(e,t)=>{let n=!1,r=!1;for(let s=0;s<t;s+=1)"\\"===e[s]&&s+1<e.length&&"`"===e[s+1]?s+=1:"```"!==e.substring(s,s+3)?!r&&"`"===e[s]&&(n=!n):(r=!r,s+=2);return n||r},ua=(e,t)=>{let n="```"===e.substring(t,t+3),r=t>0&&"```"===e.substring(t-1,t+2),s=t>1&&"```"===e.substring(t-2,t+1);return n||r||s},da=(e,t)=>{let n=!1,r=!1,s=-1;for(let i=0;i<e.length;i+=1)if("\\"===e[i]&&i+1<e.length&&"`"===e[i+1])i+=1;else if("```"!==e.substring(i,i+3)){if(!r&&"`"===e[i])if(n){if(s<t&&t<i)return!0;n=!1,s=-1}else n=!0,s=i}else r=!r,i+=2;return!1},pa=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,ha=/(\*\*)([^*]*\*?)$/,fa=/(__)([^_]*?)$/,ma=/(\*\*\*)([^*]*?)$/,ga=/(\*)([^*]*?)$/,Ea=/(_)([^_]*?)$/,ya=/(`)([^`]*?)$/,_a=/(~~)([^~]*?)$/,Ta=/^[\s_~*`]*$/,ba=/^[\s]*[-*+][\s]+$/,ka=/[\p{L}\p{N}_]/u,va=/^```[^`\n]*```?$/,Aa=/^\*{4,}$/,xa=/(__)([^_]+)_$/,Ia=/(~~)([^~]+)~$/,Sa=/~~/g,Na=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||95===t||ka.test(e)},wa=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if("["===e[r])n+=1;else if("]"===e[r]&&(n-=1,0===n))return r;return-1},Ca=(e,t)=>{let n=!1,r=!1;for(let s=0;s<e.length&&s<t;s+=1)"\\"!==e[s]||"$"!==e[s+1]?"$"===e[s]&&("$"===e[s+1]?(r=!r,s+=1,n=!1):r||(n=!n)):s+=1;return n||r},Oa=(e,t)=>{for(let n=t;n<e.length;n+=1){if(")"===e[n])return!0;if("\n"===e[n])return!1}return!1},Ra=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(")"===e[n])return!1;if("("===e[n])return n>0&&"]"===e[n-1]&&Oa(e,t);if("\n"===e[n])return!1}return!1},Da=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;n-=1)if("\n"===e[n]){r=n+1;break}let s=e.length;for(let n=t;n<e.length;n+=1)if("\n"===e[n]){s=n;break}let i=e.substring(r,s),a=0,o=!1;for(let e of i)if(e===n)a+=1;else if(" "!==e&&"\t"!==e){o=!0;break}return a>=3&&!o},La=(e,t,n,r)=>!(!("\\"===n||e.includes("$")&&Ca(e,t))&&("*"!==n&&"*"===r?"*"===(t<e.length-2?e[t+2]:""):!("*"===n||n&&r&&Na(n)&&Na(r))&&(n&&" "!==n&&"\t"!==n&&"\n"!==n||r&&" "!==r&&"\t"!==r&&"\n"!==r))),Pa=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if("`"===e[s]&&s+2<r&&"`"===e[s+1]&&"`"===e[s+2]){n=!n,s+=2;continue}if(n||"*"!==e[s])continue;let i=s>0?e[s-1]:"",a=s<r-1?e[s+1]:"";La(e,s,i,a)||(t+=1)}return t},Ma=(e,t,n,r)=>!!("\\"===n||e.includes("$")&&Ca(e,t)||Ra(e,t)||((e,t)=>{for(let n=t-1;n>=0;n-=1){if(">"===e[n])return!1;if("<"===e[n]){let t=n+1<e.length?e[n+1]:"";return t>="a"&&t<="z"||t>="A"&&t<="Z"||"/"===t}if("\n"===e[n])return!1}return!1})(e,t)||"_"===n||"_"===r||n&&r&&Na(n)&&Na(r)),Fa=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1)"`"===e[r]&&r+2<e.length&&"`"===e[r+1]&&"`"===e[r+2]?(n=!n,r+=2):n||"*"===e[r]&&r+1<e.length&&"*"===e[r+1]&&(t+=1,r+=1);return t},za=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1)"`"===e[r]&&r+2<e.length&&"`"===e[r+1]&&"`"===e[r+2]?(n=!n,r+=2):n||"_"===e[r]&&r+1<e.length&&"_"===e[r+1]&&(t+=1,r+=1);return t},Ba=e=>{let t=!1;for(let n=0;n<e.length;n+=1)if("`"===e[n]&&n+2<e.length&&"`"===e[n+1]&&"`"===e[n+2])t=!t,n+=2;else if(!t&&"_"===e[n]&&"_"!==e[n-1]&&"_"!==e[n+1]&&"\\"!==e[n-1]&&!Ca(e,n)&&!Ra(e,n)){let t=n>0?e[n-1]:"",r=n<e.length-1?e[n+1]:"";if(t&&r&&Na(t)&&Na(r))continue;return n}return-1},Ua=/<[a-zA-Z/][^>]*$/,Ha=(e,t)=>t>=2&&"```"===e.substring(t-2,t+1)||t>=1&&"```"===e.substring(t-1,t+2)||t<=e.length-3&&"```"===e.substring(t,t+3),ja=(e,t)=>{for(let n=0;n<t;n++)if("["===e[n]&&!ca(e,n)){if(n>0&&"!"===e[n-1])continue;let t=wa(e,n);if(-1===t)return n;if(t+1<e.length&&"("===e[t+1]){let r=e.indexOf(")",t+2);-1!==r&&(n=r)}}return t},$a=(e,t,n)=>{let r=t>0&&"!"===e[t-1],s=r?t-1:t;if(!e.substring(t+1).includes("]")){let i=e.substring(0,s);if(r)return i;if("text-only"===n){let n=ja(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}if(-1===wa(e,t)){let i=e.substring(0,s);if(r)return i;if("text-only"===n){let n=ja(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}return null},Za=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(-1!==n&&!ca(e,n)){let r=((e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=((e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if("]"===e[r])n+=1;else if("["===e[r]&&(n-=1,0===n))return r;return-1})(e,t);if(-1===r||ca(e,r))return null;let s=r>0&&"!"===e[r-1],i=s?r-1:r,a=e.substring(0,i);if(s)return a;let o=e.substring(r+1,t);return"text-only"===n?`${a}${o}`:`${a}[${o}](streamdown:incomplete-link)`})(e,n,t);if(null!==r)return r}for(let n=e.length-1;n>=0;n-=1)if("["===e[n]&&!ca(e,n)){let r=$a(e,n,t);if(null!==r)return r}return e},Ga=/^-{1,2}$/,Va=/^[\s]*-{1,2}[\s]+$/,Ya=/^={1,2}$/,qa=/^[\s]*={1,2}[\s]+$/,Wa=e=>!1!==e,Ka=[{handler:{name:"comparisonOperators",handle:e=>e&&"string"==typeof e&&e.includes(">")?e.replace(pa,((t,n,r,s)=>ca(e,s)?t:`${n}\\>${r}`)):e,priority:-10},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:e=>{let t=e.match(Ua);return!t||void 0===t.index||ca(e,t.index)?e:e.substring(0,t.index).trimEnd()},priority:-5},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:e=>{if(!e||"string"!=typeof e)return e;let t=e.lastIndexOf("\n");if(-1===t)return e;let n=e.substring(t+1),r=e.substring(0,t),s=n.trim();if(Ga.test(s)&&!n.match(Va)){let t=r.split("\n").at(-1);if(t&&t.trim().length>0)return`${e}`}if(Ya.test(s)&&!n.match(qa)){let t=r.split("\n").at(-1);if(t&&t.trim().length>0)return`${e}`}return e},priority:0},optionKey:"setextHeadings"},{handler:{name:"links",handle:Za,priority:10},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:e=>{if(Aa.test(e))return e;let t=e.match(ma);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return((e,t,n)=>!(t&&!Ta.test(t)&&!ca(e,n)&&!da(e,n))||Da(e,n,"*"))(e,n,r)?e:(e=>{let t=0,n=0,r=!1;for(let s=0;s<e.length;s+=1)"`"===e[s]&&s+2<e.length&&"`"===e[s+1]&&"`"===e[s+2]?(n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,s+=2):r||("*"===e[s]?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0));return n>=3&&(t+=Math.floor(n/3)),t})(e)%2==1?(e=>{let t=Fa(e),n=Pa(e);return t%2==0&&n%2==0})(e)?e:`${e}***`:e},priority:20},optionKey:"boldItalic"},{handler:{name:"bold",handle:e=>{let t=e.match(ha);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return ca(e,r)||da(e,r)||((e,t,n)=>{if(!t||Ta.test(t))return!0;let r=e.substring(0,n).lastIndexOf("\n"),s=-1===r?0:r+1,i=e.substring(s,n);return!(!ba.test(i)||!t.includes("\n"))||Da(e,n,"*")})(e,n,r)?e:Fa(e)%2==1?n.endsWith("*")?`${e}*`:`${e}**`:e},priority:30},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:e=>{let t=e.match(fa);if(!t){let t=e.match(xa);if(t){let n=e.lastIndexOf(t[1]);if(!ca(e,n)&&!da(e,n)&&za(e)%2==1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return ca(e,r)||da(e,r)||((e,t,n)=>{if(!t||Ta.test(t))return!0;let r=e.substring(0,n).lastIndexOf("\n"),s=-1===r?0:r+1,i=e.substring(s,n);return!(!ba.test(i)||!t.includes("\n"))||Da(e,n,"_")})(e,n,r)?e:za(e)%2==1?`${e}__`:e},priority:40},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:e=>{if(!e.match(ga))return e;let t=(e=>{let t=!1;for(let n=0;n<e.length;n+=1)if("`"===e[n]&&n+2<e.length&&"`"===e[n+1]&&"`"===e[n+2])t=!t,n+=2;else if(!t&&"*"===e[n]&&"*"!==e[n-1]&&"*"!==e[n+1]&&"\\"!==e[n-1]&&!Ca(e,n)){let t=n>0?e[n-1]:"",r=n<e.length-1?e[n+1]:"";if((!t||" "===t||"\t"===t||"\n"===t)&&(!r||" "===r||"\t"===r||"\n"===r)||t&&r&&Na(t)&&Na(r))continue;return n}return-1})(e);if(-1===t||ca(e,t)||da(e,t))return e;let n=e.substring(t+1);return!n||Ta.test(n)?e:Pa(e)%2==1?`${e}*`:e},priority:41},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:e=>{if(!e.match(Ea))return e;let t=Ba(e);if(-1===t)return e;let n=e.substring(t+1);if(!n||Ta.test(n)||ca(e,t)||da(e,t))return e;if((e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if("`"===e[s]&&s+2<r&&"`"===e[s+1]&&"`"===e[s+2]){n=!n,s+=2;continue}if(n||"_"!==e[s])continue;let i=s>0?e[s-1]:"",a=s<r-1?e[s+1]:"";Ma(e,s,i,a)||(t+=1)}return t})(e)%2==1){let t=(e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(Fa(t)%2!=1)return null;let n=t.indexOf("**"),r=Ba(t);return-1!==n&&-1!==r&&n<r?`${t}_**`:null})(e);return null!==t?t:(e=>{let t=e.length;for(;t>0&&"\n"===e[t-1];)t-=1;return t<e.length?`${e.slice(0,t)}_${e.slice(t)}`:`${e}_`})(e)}return e},priority:42},optionKey:"italic"},{handler:{name:"inlineCode",handle:e=>{let t=(e=>!e.match(va)||e.includes("\n")?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e)(e);if(null!==t)return t;let n=e.match(ya);if(n&&!(e=>(e.match(/```/g)||[]).length%2==1)(e)){let t=n[2];if(!t||Ta.test(t))return e;if((e=>{let t=0;for(let n=0;n<e.length;n+=1)"\\"===e[n]&&n+1<e.length&&"`"===e[n+1]?n+=1:"`"===e[n]&&!ua(e,n)&&(t+=1);return t})(e)%2==1)return`${e}\``}return e},priority:50},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:e=>{var t,n;let r=e.match(_a);if(r){let n=r[2];if(!n||Ta.test(n))return e;let s=e.lastIndexOf(r[1]);if(ca(e,s)||da(e,s))return e;if((null==(t=e.match(Sa))?void 0:t.length)%2==1)return`${e}~~`}else{let t=e.match(Ia);if(t){let r=e.lastIndexOf(t[0].slice(0,2));if(ca(e,r)||da(e,r))return e;if((null==(n=e.match(Sa))?void 0:n.length)%2==1)return`${e}~`}}return e},priority:60},optionKey:"strikethrough"},{handler:{name:"katex",handle:e=>(e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)"`"===e[r]&&!Ha(e,r)&&(n=!n),!n&&"$"===e[r]&&"$"===e[r+1]&&(t+=1,r+=1);return t})(e)%2==0?e:(e=>{let t=e.indexOf("$$");return-1===t||-1===e.indexOf("\n",t)||e.endsWith("\n")?`${e}$$`:`${e}\n$$`})(e),priority:70},optionKey:"katex"}],Qa=(e,t)=>{var n;if(!e||"string"!=typeof e)return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,s=(e=>{var t;let n=null!=(t=null==e?void 0:e.linkMode)?t:"protocol";return Ka.filter((({handler:t,optionKey:n})=>"links"===t.name?Wa(null==e?void 0:e.links)||Wa(null==e?void 0:e.images):Wa(null==e?void 0:e[n]))).map((({handler:e,earlyReturn:t})=>"links"===e.name?{handler:la(oa({},e),{handle:e=>Za(e,n)}),earlyReturn:"protocol"===n?t:void 0}:{handler:e,earlyReturn:t}))})(t),i=[...s,...(null!=(n=null==t?void 0:t.handlers)?n:[]).map((e=>{var t;return{handler:la(oa({},e),{priority:null!=(t=e.priority)?t:100}),earlyReturn:void 0}}))].sort(((e,t)=>{var n,r;return(null!=(n=e.handler.priority)?n:0)-(null!=(r=t.handler.priority)?r:0)}));for(let{handler:e,earlyReturn:t}of i)if(r=e.handle(r),null!=t&&t(r))return r;return r};function Ja(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Ja(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xa(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Ja(e))&&(r&&(r+=" "),r+=t);return r}const eo=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),to="-",no=[],ro=e=>{const t=ao(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return io(e);const n=e.split(to),r=""===n[0]&&n.length>1?1:0;return so(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],s=n[e];return t?s?((e,t)=>{const n=new Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(s,t):t:s||no}return n[e]||no}}},so=(e,t,n)=>{if(0==e.length-t)return n.classGroupId;const r=e[t],s=n.nextPart.get(r);if(s){const n=so(e,t+1,s);if(n)return n}const i=n.validators;if(null===i)return;const a=0===t?e.join(to):e.slice(t).join(to),o=i.length;for(let e=0;e<o;e++){const t=i[e];if(t.validator(a))return t.classGroupId}},io=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),ao=e=>{const{theme:t,classGroups:n}=e;return oo(n,t)},oo=(e,t)=>{const n=eo();for(const r in e){const s=e[r];lo(s,n,r,t)}return n},lo=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const s=e[i];co(s,t,n,r)}},co=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?ho(e,t,n,r):po(e,t,n,r):uo(e,t,n)},uo=(e,t,n)=>{(""===e?t:fo(t,e)).classGroupId=n},po=(e,t,n,r)=>{mo(e)?lo(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},ho=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let e=0;e<i;e++){const[i,a]=s[e];lo(a,fo(t,i),n,r)}},fo=(e,t)=>{let n=e;const r=t.split(to),s=r.length;for(let e=0;e<s;e++){const t=r[e];let s=n.nextPart.get(t);s||(s=eo(),n.nextPart.set(t,s)),n=s}return n},mo=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,go=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(s(e,t),t):void 0},set(e,t){e in n?n[e]=t:s(e,t)}}},Eo=[],yo=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),_o=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,s=0,i=0;const a=e.length;for(let o=0;o<a;o++){const a=e[o];if(0===r&&0===s){if(":"===a){t.push(e.slice(i,o)),i=o+1;continue}if("/"===a){n=o;continue}}"["===a?r++:"]"===a?r--:"("===a?s++:")"===a&&s--}const o=0===t.length?e:e.slice(i);let l=o,c=!1;return o.endsWith("!")?(l=o.slice(0,-1),c=!0):o.startsWith("!")&&(l=o.slice(1),c=!0),yo(t,c,l,n&&n>i?n-i:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):yo(Eo,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},To=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach(((e,n)=>{t.set(e,1e6+n)})),e=>{const n=[];let r=[];for(let s=0;s<e.length;s++){const i=e[s],a="["===i[0],o=t.has(i);a||o?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(i)):r.push(i)}return r.length>0&&(r.sort(),n.push(...r)),n}},bo=/\s+/,ko=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ko(e[r]))&&(n&&(n+=" "),n+=t);return n},vo=(e,...t)=>{let n,r,s,i;const a=e=>{const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,a=[],o=e.trim().split(bo);let l="";for(let e=o.length-1;e>=0;e-=1){const t=o[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(t);if(c){l=t+(l.length>0?" "+l:l);continue}let f=!!h,m=r(f?p.substring(0,h):p);if(!m){if(!f){l=t+(l.length>0?" "+l:l);continue}if(m=r(p),!m){l=t+(l.length>0?" "+l:l);continue}f=!1}const g=0===u.length?"":1===u.length?u[0]:i(u).join(":"),E=d?g+"!":g,y=E+m;if(a.indexOf(y)>-1)continue;a.push(y);const _=s(m,f);for(let e=0;e<_.length;++e){const t=_[e];a.push(E+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return s(e,i),i};return i=o=>{const l=t.reduce(((e,t)=>t(e)),e());return n=(e=>({cache:go(e.cacheSize),parseClassName:_o(e),sortModifiers:To(e),...ro(e)}))(l),r=n.cache.get,s=n.cache.set,i=a,a(o)},(...e)=>i(((...e)=>{let t,n,r=0,s="";for(;r<e.length;)(t=e[r++])&&(n=ko(t))&&(s&&(s+=" "),s+=n);return s})(...e))},Ao=[],xo=e=>{const t=t=>t[e]||Ao;return t.isThemeGetter=!0,t},Io=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,So=/^\((?:(\w[\w-]*):)?(.+)\)$/i,No=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Co=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Oo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ro=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Do=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lo=e=>No.test(e),Po=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>!!e&&Number.isInteger(Number(e)),Fo=e=>e.endsWith("%")&&Po(e.slice(0,-1)),zo=e=>wo.test(e),Bo=()=>!0,Uo=e=>Co.test(e)&&!Oo.test(e),Ho=()=>!1,jo=e=>Ro.test(e),$o=e=>Do.test(e),Zo=e=>!Vo(e)&&!el(e),Go=e=>ll(e,pl,Ho),Vo=e=>Io.test(e),Yo=e=>ll(e,hl,Uo),qo=e=>ll(e,fl,Po),Wo=e=>ll(e,gl,Bo),Ko=e=>ll(e,ml,Ho),Qo=e=>ll(e,ul,Ho),Jo=e=>ll(e,dl,$o),Xo=e=>ll(e,El,jo),el=e=>So.test(e),tl=e=>cl(e,hl),nl=e=>cl(e,ml),rl=e=>cl(e,ul),sl=e=>cl(e,pl),il=e=>cl(e,dl),al=e=>cl(e,El,!0),ol=e=>cl(e,gl,!0),ll=(e,t,n)=>{const r=Io.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},cl=(e,t,n=!1)=>{const r=So.exec(e);return!!r&&(r[1]?t(r[1]):n)},ul=e=>"position"===e||"percentage"===e,dl=e=>"image"===e||"url"===e,pl=e=>"length"===e||"size"===e||"bg-size"===e,hl=e=>"length"===e,fl=e=>"number"===e,ml=e=>"family-name"===e,gl=e=>"number"===e||"weight"===e,El=e=>"shadow"===e,yl=vo((Symbol.toStringTag,()=>{const e=xo("color"),t=xo("font"),n=xo("text"),r=xo("font-weight"),s=xo("tracking"),i=xo("leading"),a=xo("breakpoint"),o=xo("container"),l=xo("spacing"),c=xo("radius"),u=xo("shadow"),d=xo("inset-shadow"),p=xo("text-shadow"),h=xo("drop-shadow"),f=xo("blur"),m=xo("perspective"),g=xo("aspect"),E=xo("ease"),y=xo("animate"),_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",el,Vo],T=()=>[el,Vo,l],b=()=>[Lo,"full","auto",...T()],k=()=>[Mo,"none","subgrid",el,Vo],v=()=>["auto",{span:["full",Mo,el,Vo]},Mo,el,Vo],A=()=>[Mo,"auto",el,Vo],x=()=>["auto","min","max","fr",el,Vo],I=()=>["auto",...T()],S=()=>[Lo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],N=()=>[Lo,"screen","full","dvw","lvw","svw","min","max","fit",...T()],w=()=>[Lo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],C=()=>[e,el,Vo],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",rl,Qo,{position:[el,Vo]}],R=()=>["auto","cover","contain",sl,Go,{size:[el,Vo]}],D=()=>[Fo,tl,Yo],L=()=>["","none","full",c,el,Vo],P=()=>["",Po,tl,Yo],M=()=>[Po,Fo,rl,Qo],F=()=>["","none",f,el,Vo],z=()=>["none",Po,el,Vo],B=()=>["none",Po,el,Vo],U=()=>[Po,el,Vo],H=()=>[Lo,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zo],breakpoint:[zo],color:[Bo],container:[zo],"drop-shadow":[zo],ease:["in","out","in-out"],font:[Zo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zo],shadow:[zo],spacing:["px",Po],text:[zo],"text-shadow":[zo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Lo,Vo,el,g]}],container:["container"],columns:[{columns:[Po,Vo,el,o]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:b()}],"inset-x":[{"inset-x":b()}],"inset-y":[{"inset-y":b()}],start:[{"inset-s":b(),start:b()}],end:[{"inset-e":b(),end:b()}],"inset-bs":[{"inset-bs":b()}],"inset-be":[{"inset-be":b()}],top:[{top:b()}],right:[{right:b()}],bottom:[{bottom:b()}],left:[{left:b()}],visibility:["visible","invisible","collapse"],z:[{z:[Mo,"auto",el,Vo]}],basis:[{basis:[Lo,"full","auto",o,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Po,Lo,"auto","initial","none",Vo]}],grow:[{grow:["",Po,el,Vo]}],shrink:[{shrink:["",Po,el,Vo]}],order:[{order:[Mo,"first","last","none",el,Vo]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:v()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:v()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":x()}],"auto-rows":[{"auto-rows":x()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mbs:[{mbs:I()}],mbe:[{mbe:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],"inline-size":[{inline:["auto",...N()]}],"min-inline-size":[{"min-inline":["auto",...N()]}],"max-inline-size":[{"max-inline":["none",...N()]}],"block-size":[{block:["auto",...w()]}],"min-block-size":[{"min-block":["auto",...w()]}],"max-block-size":[{"max-block":["none",...w()]}],w:[{w:[o,"screen",...S()]}],"min-w":[{"min-w":[o,"screen","none",...S()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",n,tl,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ol,Wo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fo,Vo]}],"font-family":[{font:[nl,Ko,t]}],"font-features":[{"font-features":[Vo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,el,Vo]}],"line-clamp":[{"line-clamp":[Po,"none",el,qo]}],leading:[{leading:[i,...T()]}],"list-image":[{"list-image":["none",el,Vo]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",el,Vo]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:C()}],"text-color":[{text:C()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Po,"from-font","auto",el,Yo]}],"text-decoration-color":[{decoration:C()}],"underline-offset":[{"underline-offset":[Po,"auto",el,Vo]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",el,Vo]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",el,Vo]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mo,el,Vo],radial:["",el,Vo],conic:[Mo,el,Vo]},il,Jo]}],"bg-color":[{bg:C()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:C()}],"gradient-via":[{via:C()}],"gradient-to":[{to:C()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-bs":[{"border-bs":P()}],"border-w-be":[{"border-be":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:C()}],"border-color-x":[{"border-x":C()}],"border-color-y":[{"border-y":C()}],"border-color-s":[{"border-s":C()}],"border-color-e":[{"border-e":C()}],"border-color-bs":[{"border-bs":C()}],"border-color-be":[{"border-be":C()}],"border-color-t":[{"border-t":C()}],"border-color-r":[{"border-r":C()}],"border-color-b":[{"border-b":C()}],"border-color-l":[{"border-l":C()}],"divide-color":[{divide:C()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Po,el,Vo]}],"outline-w":[{outline:["",Po,tl,Yo]}],"outline-color":[{outline:C()}],shadow:[{shadow:["","none",u,al,Xo]}],"shadow-color":[{shadow:C()}],"inset-shadow":[{"inset-shadow":["none",d,al,Xo]}],"inset-shadow-color":[{"inset-shadow":C()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:C()}],"ring-offset-w":[{"ring-offset":[Po,Yo]}],"ring-offset-color":[{"ring-offset":C()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":C()}],"text-shadow":[{"text-shadow":["none",p,al,Xo]}],"text-shadow-color":[{"text-shadow":C()}],opacity:[{opacity:[Po,el,Vo]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Po]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":C()}],"mask-image-linear-to-color":[{"mask-linear-to":C()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":C()}],"mask-image-t-to-color":[{"mask-t-to":C()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":C()}],"mask-image-r-to-color":[{"mask-r-to":C()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":C()}],"mask-image-b-to-color":[{"mask-b-to":C()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":C()}],"mask-image-l-to-color":[{"mask-l-to":C()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":C()}],"mask-image-x-to-color":[{"mask-x-to":C()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":C()}],"mask-image-y-to-color":[{"mask-y-to":C()}],"mask-image-radial":[{"mask-radial":[el,Vo]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":C()}],"mask-image-radial-to-color":[{"mask-radial-to":C()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Po]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":C()}],"mask-image-conic-to-color":[{"mask-conic-to":C()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",el,Vo]}],filter:[{filter:["","none",el,Vo]}],blur:[{blur:F()}],brightness:[{brightness:[Po,el,Vo]}],contrast:[{contrast:[Po,el,Vo]}],"drop-shadow":[{"drop-shadow":["","none",h,al,Xo]}],"drop-shadow-color":[{"drop-shadow":C()}],grayscale:[{grayscale:["",Po,el,Vo]}],"hue-rotate":[{"hue-rotate":[Po,el,Vo]}],invert:[{invert:["",Po,el,Vo]}],saturate:[{saturate:[Po,el,Vo]}],sepia:[{sepia:["",Po,el,Vo]}],"backdrop-filter":[{"backdrop-filter":["","none",el,Vo]}],"backdrop-blur":[{"backdrop-blur":F()}],"backdrop-brightness":[{"backdrop-brightness":[Po,el,Vo]}],"backdrop-contrast":[{"backdrop-contrast":[Po,el,Vo]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Po,el,Vo]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Po,el,Vo]}],"backdrop-invert":[{"backdrop-invert":["",Po,el,Vo]}],"backdrop-opacity":[{"backdrop-opacity":[Po,el,Vo]}],"backdrop-saturate":[{"backdrop-saturate":[Po,el,Vo]}],"backdrop-sepia":[{"backdrop-sepia":["",Po,el,Vo]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",el,Vo]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Po,"initial",el,Vo]}],ease:[{ease:["linear","initial",E,el,Vo]}],delay:[{delay:[Po,el,Vo]}],animate:[{animate:["none",y,el,Vo]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,el,Vo]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":["scale-3d"],skew:[{skew:U()}],"skew-x":[{"skew-x":U()}],"skew-y":[{"skew-y":U()}],transform:[{transform:[el,Vo,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":["translate-none"],accent:[{accent:C()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:C()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",el,Vo]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",el,Vo]}],fill:[{fill:["none",...C()]}],"stroke-w":[{stroke:[Po,tl,Yo,qo]}],stroke:[{stroke:["none",...C()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}));var _l=n(5893),Tl=n(3935);const bl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vl={};function Al(e,t){return((t||vl).jsx?kl:bl).test(e)}const xl=/[ \t\n\f\r]/g;function Il(e){return""===e.replace(xl,"")}const Sl={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var Nl=n(1476);function wl(e){return e&&"object"==typeof e?"position"in e||"type"in e?Ol(e.position):"start"in e||"end"in e?Ol(e):"line"in e||"column"in e?Cl(e):"":""}function Cl(e){return Rl(e&&e.line)+":"+Rl(e&&e.column)}function Ol(e){return Cl(e&&e.start)+"-"+Cl(e&&e.end)}function Rl(e){return e&&"number"==typeof e?e:1}class Dl extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",s={},i=!1;if(t&&(s="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!s.cause&&e&&(i=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?s.ruleId=n:(s.source=n.slice(0,e),s.ruleId=n.slice(e+1))}if(!s.place&&s.ancestors&&s.ancestors){const e=s.ancestors[s.ancestors.length-1];e&&(s.place=e.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=wl(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=i&&s.cause&&"string"==typeof s.cause.stack?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dl.prototype.file="",Dl.prototype.name="",Dl.prototype.reason="",Dl.prototype.message="",Dl.prototype.stack="",Dl.prototype.column=void 0,Dl.prototype.line=void 0,Dl.prototype.ancestors=void 0,Dl.prototype.cause=void 0,Dl.prototype.fatal=void 0,Dl.prototype.place=void 0,Dl.prototype.ruleId=void 0,Dl.prototype.source=void 0;const Ll={}.hasOwnProperty,Pl=new Map,Ml=/[A-Z]/g,Fl=new Set(["table","tbody","thead","tfoot","tr"]),zl=new Set(["td","th"]),Bl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ul(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let s=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(s=se,e.schema=s),e.ancestors.push(t);const i=Gl(e,t.tagName,!1),a=function(e,t){const n={};let r,s;for(s in t.properties)if("children"!==s&&Ll.call(t.properties,s)){const i=Zl(e,s,t.properties[s]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&"align"===s&&"string"==typeof a&&zl.has(t.tagName)?r=a:n[s]=a}}return r&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),n}(e,t);let o=$l(e,t);return Fl.has(t.tagName)&&(o=o.filter((function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&Il(t.value):Il(t));var t}))),Hl(e,a,i,t),jl(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Vl(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let s=r;"svg"===t.name&&"html"===r.space&&(s=se,e.schema=s),e.ancestors.push(t);const i=null===t.name?e.Fragment:Gl(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const s=t.expression;s.type;const i=s.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Vl(e,t.position);else{const s=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,i=e.evaluater.evaluateExpression(t.expression)}else Vl(e,t.position);else i=null===r.value||r.value;n[s]=i}return n}(e,t),o=$l(e,t);return Hl(e,a,i,t),jl(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vl(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return jl(r,$l(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Hl(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $l(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:Pl;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=s.get(e)||0;a=e+"-"+t,s.set(e,t+1)}}const o=Ul(e,i,a);void 0!==o&&n.push(o)}return n}function Zl(e,t,n){const r=de(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ae(n):me(n)),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return Nl(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,r=new Dl("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Bl+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Ll.call(e,n)&&(t[Yl(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?Sl[r.property]||r.property:r.attribute,n]}}function Gl(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,s=-1;for(;++s<e.length;){const t=Al(e[s])?{type:"Identifier",name:e[s]}:{type:"Literal",value:e[s]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(s&&"Literal"===t.type),optional:!1}:t}r=n}else r=Al(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Ll.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vl(e)}function Vl(e,t){const n=new Dl("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Bl+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Yl(e){let t=e.replace(Ml,ql);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function ql(e){return"-"+e.toLowerCase()}const Wl={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};class Kl{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Ql(this.left,n),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Ql(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ql(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Ql(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ql(this.left,t.reverse())}}}function Ql(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Jl(e){const t={};let n,r,s,i,a,o,l,c=-1;const u=new Kl(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(o=n[1]._tokenizer.events,s=0,s<o.length&&"lineEndingBlank"===o[s][1].type&&(s+=2),s<o.length&&"content"===o[s][1].type))for(;++s<o.length&&"content"!==o[s][1].type;)"chunkText"===o[s][1].type&&(o[s][1]._isInFirstContentOfListItem=!0,s++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Xl(u,c)),c=t[c],l=!0);else if(n[1]._container){for(s=c,r=void 0;s--;)if(i=u.get(s),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=s);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return pi(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function Xl(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],c={};let u,d,p=-1,h=n,f=0,m=0;const g=[m];for(;h;){for(;e.get(++s)[1]!==h;);i.push(s),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<o.length;)"exit"===o[p][0]&&"enter"===o[p-1][0]&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(m=p+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),p=g.length;p--;){const t=o.slice(g[p],g[p+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),p=-1;++p<l.length;)c[f+l[p][0]]=f+l[p][1],f+=l[p][1]-l[p][0]-1;return c}const ec={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Di(e,t,"linePrefix");e.consume(n)}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,s(t)}function s(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):Gr(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),s)}}},tc={tokenize:function(e){const t=this,n=[];let r,s,i,a=0;return o;function o(r){if(a<n.length){const s=n[a];return t.containerState=s[1],e.attempt(s[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const n=t.events.length;let s,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){s=t.events[i][1].end;break}E(a);let o=n;for(;o<t.events.length;)t.events[o][1].end={...s},o++;return pi(t.events,i+1,0,t.events.slice(n)),t.events.length=o,c(e)}return o(e)}function c(s){if(a===n.length){if(!r)return p(s);if(r.currentConstruct&&r.currentConstruct.concrete)return f(s);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nc,u,d)(s)}function u(e){return r&&y(),E(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,f(e)}function p(n){return t.containerState={},e.attempt(nc,h,f)(n)}function h(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function f(n){return null===n?(r&&y(),E(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),E(0),void e.consume(n)):Gr(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,o):(e.consume(n),m)}function g(e,n){const o=t.sliceStream(e);if(n&&o.push(null),e.previous=s,s&&(s.next=e),s=e,r.defineSkip(e.start),r.write(o),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let s,o,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(s){o=t.events[l][1].end;break}s=!0}for(E(a),e=n;e<t.events.length;)t.events[e][1].end={...o},e++;pi(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function E(r){let s=n.length;for(;s-- >r;){const r=n[s];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}},nc={tokenize:function(e,t,n){return Di(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},rc={resolve:function(e){return Jl(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?s(t):Gr(t)?e.check(sc,i,s)(t):(e.consume(t),r)}function s(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},sc={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Di(e,s,"linePrefix")};function s(s){if(null===s||Gr(s))return n(s);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}},ic={tokenize:function(e){const t=this,n=e.attempt(Li,(function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)}),e.attempt(this.parser.constructs.flowInitial,r,Di(e,e.attempt(this.parser.constructs.flow,r,e.attempt(rc,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},ac={resolveAll:uc()},oc=cc("string"),lc=cc("text");function cc(e){return{resolveAll:uc("text"===e?dc:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],s=t.attempt(r,i,a);return i;function i(e){return l(e)?s(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),o;t.consume(e)}function o(e){return l(e)?(t.exit("data"),s(e)):(t.consume(e),o)}function l(e){if(null===e)return!0;const t=r[e];let s=-1;if(t)for(;++s<t.length;){const e=t[s];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function uc(e){return function(t,n){let r,s=-1;for(;++s<=t.length;)void 0===r?t[s]&&"data"===t[s][1].type&&(r=s,s++):t[s]&&"data"===t[s][1].type||(s!==r+2&&(t[r][1].end=t[s-1][1].end,t.splice(r+2,s-r-2),s=r+2),r=void 0);return e?e(t,n):t}}function dc(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],s=t.sliceStream(r);let i,a=s.length,o=-1,l=0;for(;a--;){const e=s[a];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)l++,o--;if(o)break;o=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const s={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(n,0,["enter",s,t],["exit",s,t]),n+=2)}n++}return e}const pc={name:"thematicBreak",tokenize:function(e,t,n){let r,s=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):s>=3&&(null===i||Gr(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),s++,a):(e.exit("thematicBreakSequence"),Yr(t)?Di(e,i,"whitespace")(t):i(t))}}},hc={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Li,(function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Di(e,t,"listItemIndent",r.containerState.size+1)(n)}),(function(n){return r.containerState.furtherBlankLines||!Yr(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(mc,t,s)(n))}));function s(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Di(e,e.attempt(hc,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&"linePrefix"===s[1].type?s[2].sliceSerialize(s[1],!0).length:0,a=0;return function(t){const s=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===s?!r.containerState.marker||t===r.containerState.marker:jr(t)){if(r.containerState.type||(r.containerState.type=s,e.enter(s,{_container:!0})),"listUnordered"===s)return e.enter("listItemPrefix"),42===t||45===t?e.check(pc,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(t)}return n(t)};function o(t){return jr(t)&&++a<10?(e.consume(t),o):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(Li,r.interrupt?n:c,e.attempt(fc,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return Yr(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},fc={partial:!0,tokenize:function(e,t,n){const r=this;return Di(e,(function(e){const s=r.events[r.events.length-1];return!Yr(e)&&s&&"listItemPrefixWhitespace"===s[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},mc={partial:!0,tokenize:function(e,t,n){const r=this;return Di(e,(function(e){const s=r.events[r.events.length-1];return s&&"listItemIndent"===s[1].type&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)}},gc={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return Yr(t)?Di(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)};function s(r){return e.attempt(gc,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),s}return n(t)};function s(n){return Yr(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function Ec(e,t,n,r,s,i,a,o,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(r),e.enter(s),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||Hr(t)?n(t):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(o),d(t)):null===t||60===t||Gr(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(s){return u||null!==s&&41!==s&&!Vr(s)?u<c&&40===s?(e.consume(s),u++,f):41===s?(e.consume(s),u--,f):null===s||32===s||40===s||Hr(s)?n(s):(e.consume(s),92===s?m:f):(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(s))}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function yc(e,t,n,r,s,i){const a=this;let o,l=0;return function(t){return e.enter(r),e.enter(s),e.consume(t),e.exit(s),e.enter(i),c};function c(d){return l>999||null===d||91===d||93===d&&!o||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(s),e.consume(d),e.exit(s),e.exit(r),t):Gr(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||Gr(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),o||(o=!Yr(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function _c(e,t,n,r,s,i){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(s),e.consume(t),e.exit(s),a=40===t?41:t,o):n(t)};function o(n){return n===a?(e.enter(s),e.consume(n),e.exit(s),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),o(a)):null===t?n(t):Gr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Di(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||Gr(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function Tc(e,t){let n;return function r(s){return Gr(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Yr(s)?Di(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const bc={name:"definition",tokenize:function(e,t,n){const r=this;let s;return function(t){return e.enter("definition"),function(t){return yc.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return s=ds(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return Vr(t)?Tc(e,o)(t):o(t)}function o(t){return Ec(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(kc,c,c)(t)}function c(t){return Yr(t)?Di(e,u,"whitespace")(t):u(t)}function u(i){return null===i||Gr(i)?(e.exit("definition"),r.parser.defined.push(s),t(i)):n(i)}}},kc={partial:!0,tokenize:function(e,t,n){return function(t){return Vr(t)?Tc(e,r)(t):n(t)};function r(t){return _c(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function s(t){return Yr(t)?Di(e,i,"whitespace")(t):i(t)}function i(e){return null===e||Gr(e)?t(e):n(e)}}},vc={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),Di(e,s,"linePrefix",5)(t)};function s(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?o(t):Gr(t)?e.attempt(Ac,i,o)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||Gr(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function o(n){return e.exit("codeIndented"),t(n)}}},Ac={partial:!0,tokenize:function(e,t,n){const r=this;return s;function s(t){return r.parser.lazy[r.now().line]?n(t):Gr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):Di(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):Gr(e)?s(e):n(e)}}},xc={name:"headingAtx",resolve:function(e,t){let n,r,s=e.length-2,i=3;return"whitespace"===e[i][1].type&&(i+=2),s-2>i&&"whitespace"===e[s][1].type&&(s-=2),"atxHeadingSequence"===e[s][1].type&&(i===s-1||s-4>i&&"whitespace"===e[s-2][1].type)&&(s-=i+1===s?2:4),s>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[s][1].end},r={type:"chunkText",start:e[i][1].start,end:e[s][1].end,contentType:"text"},pi(e,i,s-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),s(t)}(t)};function s(t){return 35===t&&r++<6?(e.consume(t),s):null===t||Vr(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||Gr(n)?(e.exit("atxHeading"),t(n)):Yr(n)?Di(e,i,"whitespace")(n):(e.enter("atxHeadingText"),o(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function o(t){return null===t||35===t||Vr(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),o)}}},Ic={name:"setextUnderline",resolveTo:function(e,t){let n,r,s,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),s||"definition"!==e[i][1].type||(s=i);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",a,t]),e.splice(s+1,0,["exit",e[n][1],t]),e[n][1].end={...e[s][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let s;return function(t){let a,o=r.events.length;for(;o--;)if("lineEnding"!==r.events[o][1].type&&"linePrefix"!==r.events[o][1].type&&"content"!==r.events[o][1].type){a="paragraph"===r.events[o][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!a?n(t):(e.enter("setextHeadingLine"),s=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t))};function i(t){return t===s?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),Yr(t)?Di(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||Gr(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}},Sc=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Nc=["pre","script","style","textarea"],wc={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){const r=this;let s,i,a,o,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(o){return 33===o?(e.consume(o),u):47===o?(e.consume(o),i=!0,h):63===o?(e.consume(o),s=3,r.interrupt?t:L):zr(o)?(e.consume(o),a=String.fromCharCode(o),f):n(o)}function u(i){return 45===i?(e.consume(i),s=2,d):91===i?(e.consume(i),s=5,o=0,p):zr(i)?(e.consume(i),s=4,r.interrupt?t:L):n(i)}function d(s){return 45===s?(e.consume(s),r.interrupt?t:L):n(s)}function p(s){const i="CDATA[";return s===i.charCodeAt(o++)?(e.consume(s),o===i.length?r.interrupt?t:I:p):n(s)}function h(t){return zr(t)?(e.consume(t),a=String.fromCharCode(t),f):n(t)}function f(o){if(null===o||47===o||62===o||Vr(o)){const l=47===o,c=a.toLowerCase();return l||i||!Nc.includes(c)?Sc.includes(a.toLowerCase())?(s=6,l?(e.consume(o),m):r.interrupt?t(o):I(o)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(o):i?g(o):E(o)):(s=1,r.interrupt?t(o):I(o))}return 45===o||Br(o)?(e.consume(o),a+=String.fromCharCode(o),f):n(o)}function m(s){return 62===s?(e.consume(s),r.interrupt?t:I):n(s)}function g(t){return Yr(t)?(e.consume(t),g):A(t)}function E(t){return 47===t?(e.consume(t),A):58===t||95===t||zr(t)?(e.consume(t),y):Yr(t)?(e.consume(t),E):A(t)}function y(t){return 45===t||46===t||58===t||95===t||Br(t)?(e.consume(t),y):_(t)}function _(t){return 61===t?(e.consume(t),T):Yr(t)?(e.consume(t),_):E(t)}function T(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,b):Yr(t)?(e.consume(t),T):k(t)}function b(t){return t===l?(e.consume(t),l=null,v):null===t||Gr(t)?n(t):(e.consume(t),b)}function k(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Vr(t)?_(t):(e.consume(t),k)}function v(e){return 47===e||62===e||Yr(e)?E(e):n(e)}function A(t){return 62===t?(e.consume(t),x):n(t)}function x(t){return null===t||Gr(t)?I(t):Yr(t)?(e.consume(t),x):n(t)}function I(t){return 45===t&&2===s?(e.consume(t),C):60===t&&1===s?(e.consume(t),O):62===t&&4===s?(e.consume(t),P):63===t&&3===s?(e.consume(t),L):93===t&&5===s?(e.consume(t),D):!Gr(t)||6!==s&&7!==s?null===t||Gr(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),I):(e.exit("htmlFlowData"),e.check(Cc,M,S)(t))}function S(t){return e.check(Oc,N,M)(t)}function N(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),w}function w(t){return null===t||Gr(t)?S(t):(e.enter("htmlFlowData"),I(t))}function C(t){return 45===t?(e.consume(t),L):I(t)}function O(t){return 47===t?(e.consume(t),a="",R):I(t)}function R(t){if(62===t){const n=a.toLowerCase();return Nc.includes(n)?(e.consume(t),P):I(t)}return zr(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),R):I(t)}function D(t){return 93===t?(e.consume(t),L):I(t)}function L(t){return 62===t?(e.consume(t),P):45===t&&2===s?(e.consume(t),L):I(t)}function P(t){return null===t||Gr(t)?(e.exit("htmlFlowData"),M(t)):(e.consume(t),P)}function M(n){return e.exit("htmlFlow"),t(n)}}},Cc={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Li,t,n)}}},Oc={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return Gr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):n(t)};function s(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},Rc={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s)};function s(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},Dc={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,s={partial:!0,tokenize:function(e,t,n){let s=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),Yr(t)?Di(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(s++,e.consume(t),c):s>=o?(e.exit("codeFencedFenceSequence"),Yr(t)?Di(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||Gr(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,o=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(o++,e.consume(t),l):o<3?n(t):(e.exit("codeFencedFenceSequence"),Yr(t)?Di(e,c,"whitespace")(t):c(t))}function c(n){return null===n||Gr(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(Rc,h,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||Gr(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):Yr(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Di(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function d(t){return null===t||Gr(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(t))}function p(t){return null===t||Gr(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),p)}function h(t){return e.attempt(s,y,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&Yr(t)?Di(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||Gr(t)?e.check(Rc,h,y)(t):(e.enter("codeFlowValue"),E(t))}function E(t){return null===t||Gr(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),E)}function y(n){return e.exit("codeFenced"),t(n)}}},Lc=document.createElement("i");function Pc(e){const t="&"+e+";";Lc.innerHTML=t;const n=Lc.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const Mc={name:"characterReference",tokenize:function(e,t,n){const r=this;let s,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),s=31,i=Br,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,i=$r,c):(e.enter("characterReferenceValue"),s=7,i=jr,c(t))}function c(o){if(59===o&&a){const s=e.exit("characterReferenceValue");return i!==Br||Pc(r.sliceSerialize(s))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return i(o)&&a++<s?(e.consume(o),c):n(o)}}},Fc={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return Zr(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},zc={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Di(e,t,"linePrefix")}}},Bc={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&pi(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,s,i,a=e.length,o=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(s){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(s=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[s-2][1].start}};return i=[["enter",l,t],["enter",c,t]],i=hi(i,e.slice(r+1,r+o+3)),i=hi(i,[["enter",u,t]]),i=hi(i,ji(t.parser.constructs.insideSpan.null,e.slice(r+o+4,s-3),t)),i=hi(i,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),i=hi(i,e.slice(s+1)),i=hi(i,[["exit",l,t]]),pi(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let s,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){s=r.events[a][1];break}return function(t){return s?s._inactive?u(t):(i=r.parser.defined.includes(ds(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(Uc,c,i?c:u)(t):91===t?e.attempt(Hc,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(jc,c,u)(t)}function c(e){return t(e)}function u(e){return s._balanced=!0,n(e)}}},Uc={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return Vr(t)?Tc(e,s)(t):s(t)}function s(t){return 41===t?c(t):Ec(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return Vr(t)?Tc(e,o)(t):c(t)}function a(e){return n(e)}function o(t){return 34===t||39===t||40===t?_c(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return Vr(t)?Tc(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},Hc={tokenize:function(e,t,n){const r=this;return function(t){return yc.call(r,e,s,i,"reference","referenceMarker","referenceString")(t)};function s(e){return r.parser.defined.includes(ds(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},jc={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},$c={name:"labelStartImage",resolveAll:Bc.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),s};function s(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},Zc={name:"attention",resolveAll:function(e,t){let n,r,s,i,a,o,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},p={...e[u][1].start};Gc(d,-o),Gc(p,o),i={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:o>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},s={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:o>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=hi(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=hi(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",s,t]]),l=hi(l,ji(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=hi(l,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=hi(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,pi(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Ms(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(o){if(o===i)return e.consume(o),a;const l=e.exit("attentionSequence"),c=Ms(o),u=!c||2===c&&s||n.includes(o),d=!s||2===s&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(s||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(o)}}};function Gc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Vc={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s};function s(t){return zr(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||Br(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,o):(43===t||45===t||46===t||Br(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function o(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||Hr(r)?n(r):(e.consume(r),o)}function l(t){return 64===t?(e.consume(t),c):Ur(t)?(e.consume(t),l):n(t)}function c(e){return Br(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||Br(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}},Yc={name:"htmlText",tokenize:function(e,t,n){const r=this;let s,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),T):63===t?(e.consume(t),y):zr(t)?(e.consume(t),v):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,h):zr(t)?(e.consume(t),E):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):Gr(t)?(a=u,R(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?O(e):45===e?d(e):u(e)}function h(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):Gr(t)?(a=f,R(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?O(t):93===t?(e.consume(t),g):f(t)}function E(t){return null===t||62===t?O(t):Gr(t)?(a=E,R(t)):(e.consume(t),E)}function y(t){return null===t?n(t):63===t?(e.consume(t),_):Gr(t)?(a=y,R(t)):(e.consume(t),y)}function _(e){return 62===e?O(e):y(e)}function T(t){return zr(t)?(e.consume(t),b):n(t)}function b(t){return 45===t||Br(t)?(e.consume(t),b):k(t)}function k(t){return Gr(t)?(a=k,R(t)):Yr(t)?(e.consume(t),k):O(t)}function v(t){return 45===t||Br(t)?(e.consume(t),v):47===t||62===t||Vr(t)?A(t):n(t)}function A(t){return 47===t?(e.consume(t),O):58===t||95===t||zr(t)?(e.consume(t),x):Gr(t)?(a=A,R(t)):Yr(t)?(e.consume(t),A):O(t)}function x(t){return 45===t||46===t||58===t||95===t||Br(t)?(e.consume(t),x):I(t)}function I(t){return 61===t?(e.consume(t),S):Gr(t)?(a=I,R(t)):Yr(t)?(e.consume(t),I):A(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,N):Gr(t)?(a=S,R(t)):Yr(t)?(e.consume(t),S):(e.consume(t),w)}function N(t){return t===s?(e.consume(t),s=void 0,C):null===t?n(t):Gr(t)?(a=N,R(t)):(e.consume(t),N)}function w(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||Vr(t)?A(t):(e.consume(t),w)}function C(e){return 47===e||62===e||Vr(e)?A(e):n(e)}function O(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function R(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),D}function D(t){return Yr(t)?Di(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):L(t)}function L(t){return e.enter("htmlTextData"),a(t)}}},qc={name:"labelStartLink",resolveAll:Bc.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),s};function s(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},Wc={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return Gr(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},Kc={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,s=3;if(!("lineEnding"!==e[s][1].type&&"space"!==e[s][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=s;++t<r;)if("codeTextData"===e[t][1].type){e[s][1].type="codeTextPadding",e[r][1].type="codeTextPadding",s+=2,r-=2;break}for(t=s-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,s,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),o(t))}function o(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),o):96===t?(s=e.enter("codeTextSequence"),r=0,c(t)):Gr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||Gr(t)?(e.exit("codeTextData"),o(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(s.type="codeTextData",l(n))}}},Qc={42:hc,43:hc,45:hc,48:hc,49:hc,50:hc,51:hc,52:hc,53:hc,54:hc,55:hc,56:hc,57:hc,62:gc},Jc={91:bc},Xc={[-2]:vc,[-1]:vc,32:vc},eu={35:xc,42:pc,45:[Ic,pc],60:wc,61:Ic,95:pc,96:Dc,126:Dc},tu={38:Mc,92:Fc},nu={[-5]:zc,[-4]:zc,[-3]:zc,33:$c,38:Mc,42:Zc,60:[Vc,Yc],91:qc,92:[Wc,Fc],93:Bc,95:Zc,96:Kc},ru={null:[Zc,ac]},su={null:[42,95]},iu={null:[]};function au(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let a=[],o=[],l=!0;const c={attempt:E((function(e,t){y(e,t.from)})),check:E(g),consume:function(e){Gr(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,_()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e,l=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),o.push(n),n},exit:function(e){const t=o.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:E(g,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){s[e.line]=e.column,_()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&s)continue;a=" ";break;default:a=String.fromCharCode(i)}s=-2===i,r.push(a)}return r.join("")}(h(e),t)},sliceStream:h,write:function(e){return a=hi(a,e),function(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)m(t.charCodeAt(r._bufferIndex));else m(t)}}(),null!==a[a.length-1]?[]:(y(t,0),u.events=ji(i,u.events,u),u.events)}};let d,p=t.tokenize.call(u,c);return t.resolveAll&&i.push(t),u;function h(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let a;if(n===s)a=[e[n].slice(r,i)];else{if(a=e.slice(n,s),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}(a,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:s,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:s,offset:i}}function m(e){l=void 0,d=e,p=p(e)}function g(e,t){t.restore()}function E(e,t){return function(n,s,i){let a,d,p,h;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):function(e){return function(t){const n=null!==t&&e[t],r=null!==t&&e.null;return m([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function m(e){return a=e,d=0,0===e.length?i:g(e[d])}function g(e){return function(n){return h=function(){const e=f(),t=u.previous,n=u.currentConstruct,s=u.events.length,i=Array.from(o);return{from:s,restore:function(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=s,o=i,_()}}}(),p=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?y():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,E,y)(n)}}function E(t){return l=!0,e(p,h),s}function y(e){return l=!0,h.restore(),++d<a.length?g(a[d]):i}}}function y(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&pi(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function _(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}const ou=/[\0\t\n\r]/g;function lu(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||65535==(65535&n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}const cu=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uu(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return lu(n.slice(t?2:1),t?16:10)}return Pc(n)||e}const du={}.hasOwnProperty;function pu(e,t,n){return t&&"object"==typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(y),autolinkProtocol:u,autolinkEmail:u,atxHeading:s(m),blockQuote:s((function(){return{type:"blockquote",children:[]}})),characterEscape:u,characterReference:u,codeFenced:s(f),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:s(f,i),codeText:s((function(){return{type:"inlineCode",value:""}}),i),codeTextData:u,data:u,codeFlowValue:u,definition:s((function(){return{type:"definition",identifier:"",label:null,title:null,url:""}})),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:s((function(){return{type:"emphasis",children:[]}})),hardBreakEscape:s(g),hardBreakTrailing:s(g),htmlFlow:s(E,i),htmlFlowData:u,htmlText:s(E,i),htmlTextData:u,image:s((function(){return{type:"image",title:null,url:"",alt:null}})),label:i,link:s(y),listItem:s((function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}})),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:s(_,(function(){this.data.expectingFirstListItemValue=!0})),listUnordered:s(_),paragraph:s((function(){return{type:"paragraph",children:[]}})),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:s(m),strong:s((function(){return{type:"strong",children:[]}})),thematicBreak:s((function(){return{type:"thematicBreak"}}))},exit:{atxHeading:o(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:o(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:o(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:h,characterReferenceMarkerNumeric:h,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=lu(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=Pc(t);this.stack[this.stack.length-1].value+=r},characterReference:function(e){this.stack.pop().position.end=hu(e.end)},codeFenced:o((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0})),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:d,codeIndented:o((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")})),codeText:o((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),codeTextData:d,data:d,definition:o(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ds(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:o(),hardBreakEscape:o(p),hardBreakTrailing:o(p),htmlFlow:o((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlFlowData:d,htmlText:o((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlTextData:d,image:o((function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0})),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(cu,uu)}(t),n.identifier=ds(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak)return n.children[n.children.length-1].position.end=hu(e.end),void(this.data.atHardBreak=void 0);!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(u.call(this,e),d.call(this,e))},link:o((function(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0})),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ds(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:o((function(){this.data.setextHeadingSlurpLineEnding=void 0})),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:o(),thematicBreak:o()}};fu(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let s={type:"root",children:[]};const o={stack:[s],tokenStack:[],config:t,enter:a,exit:l,buffer:i,resume:c,data:n},u=[];let d=-1;for(;++d<e.length;)"listOrdered"!==e[d][1].type&&"listUnordered"!==e[d][1].type||("enter"===e[d][0]?u.push(d):d=r(e,u.pop(),d));for(d=-1;++d<e.length;){const n=t[e[d][0]];du.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},o),e[d][1])}if(o.tokenStack.length>0){const e=o.tokenStack[o.tokenStack.length-1];(e[1]||gu).call(o,void 0,e[0])}for(s.position={start:hu(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:hu(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)s=t.transforms[d](s)||s;return s};function r(e,t,n){let r,s,i,a,o=t-1,l=-1,c=!1;for(;++o<=n;){const t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||i||(i=o),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=o;for(s=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;s&&(e[s][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",s=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!s||i<s)&&(r._spread=!0),r.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){const s={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=s,e.splice(o,0,["enter",s,t[2]]),o++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}function s(e,t){return function(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:hu(t.start),end:void 0}}function o(e){return function(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+wl({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||gu).call(this,e,r[0])),n.position.end=hu(e.end)}function c(){return Us(this.stack.pop())}function u(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n={type:"text",value:""},n.position={start:hu(e.start),end:void 0},t.push(n)),this.stack.push(n)}function d(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=hu(e.end)}function p(){this.data.atHardBreak=!0}function h(e){this.data.characterReferenceType=e.type}function f(){return{type:"code",lang:null,meta:null,value:""}}function m(){return{type:"heading",depth:0,children:[]}}function g(){return{type:"break"}}function E(){return{type:"html",value:""}}function y(){return{type:"link",title:null,url:"",children:[]}}function _(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}}(n)(function(e){for(;!Jl(e););return e}(function(e){const t={constructs:mi([s,...(e||{}).extensions||[]]),content:n(ec),defined:[],document:n(tc),flow:n(ic),lazy:{},string:n(oc),text:n(lc)};return t;function n(e){return function(n){return au(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(s,i,a){const o=[];let l,c,u,d,p;for(s=n+("string"==typeof s?s.toString():new TextDecoder(i||void 0).decode(s)),u=0,n="",r&&(65279===s.charCodeAt(0)&&u++,r=void 0);u<s.length;){if(ou.lastIndex=u,l=ou.exec(s),d=l&&void 0!==l.index?l.index:s.length,p=s.charCodeAt(d),!l){n=s.slice(u);break}if(10===p&&u===d&&e)o.push(-3),e=void 0;else switch(e&&(o.push(-5),e=void 0),u<d&&(o.push(s.slice(u,d)),t+=d-u),p){case 0:o.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),o.push(-2);t++<c;)o.push(-1);break;case 10:o.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return a&&(e&&o.push(-5),n&&o.push(n),o.push(null)),o}}()(e,t,!0))))}function hu(e){return{line:e.line,column:e.column,offset:e.offset}}function fu(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?fu(e,r):mu(e,r)}}function mu(e,t){let n;for(n in t)if(du.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function gu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wl({start:t.start,end:t.end})+") is still open")}function Eu(e){const t=this;t.parser=function(n){return pu(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function yu(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(37===i&&Br(e.charCodeAt(n+1))&&Br(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),s=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function _u(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Tu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function bu(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),i=s[0];i&&"text"===i.type?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&"text"===a.type?a.value+=r:s.push({type:"text",value:r}),s}function ku(e){const t=e.spread;return null==t?e.children.length>1:t}function vu(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(Au(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(Au(t.slice(s),s>0,!1)),i.join("")}function Au(e,t,n){let r=0,s=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(s-1);for(;9===t||32===t;)s--,t=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}const xu={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=yu(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);void 0===o?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bu(e,t);const s={src:yu(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:yu(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bu(e,t);const s={href:yu(r.url||"")};null!==r.title&&void 0!==r.title&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:yu(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),s=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ku(n[r])}return t}(n):ku(t),i={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const e=r[o];(s||0!==o||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||s?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(s||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let s=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++s<r.length;){const e=r[s];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),s.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=lr(t.children[1]),a=or(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),s.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,s=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length;let o=-1;const l=[];for(;++o<a;){const n=t.children[o],r={},a=i?i[o]:void 0;a&&(r.align=a);let c={type:"element",tagName:s,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:vu(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Iu,yaml:Iu,definition:Iu,footnoteDefinition:Iu};function Iu(){}const Su={}.hasOwnProperty,Nu={};function wu(e,t){e.position&&(t.position=ur(e))}function Cu(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,s=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&s&&Object.assign(n.properties,O(s)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function Ou(e,t){const n=t.data||{},r=!("value"in t)||Su.call(n,"hProperties")||Su.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function Ru(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function Du(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function Lu(e,t){const n=function(e,t){const n=t||Nu,r=new Map,s=new Map,i=new Map,a={...xu,...n.handlers},o={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const s=o.one(n[r],e);if(s){if(r&&"break"===n[r-1].type&&(Array.isArray(s)||"text"!==s.type||(s.value=Du(s.value)),!Array.isArray(s)&&"element"===s.type)){const e=s.children[0];e&&"text"===e.type&&(e.value=Du(e.value))}Array.isArray(s)?t.push(...s):t.push(s)}}}return t},applyData:Cu,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=o.handlers[n];if(Su.call(o.handlers,n)&&r)return r(o,e,t);if(o.options.passThrough&&o.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=O(n);return r.children=o.all(e),r}return O(e)}return(o.options.unknownHandler||Ou)(o,e,t)},options:n,patch:wu,wrap:Ru};return f(e,(function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:s,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}})),o}(e,t),r=n.one(e,void 0),s=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||_u,r=e.options.footnoteBackLabel||Tu,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const s=e.footnoteById.get(e.footnoteOrder[l]);if(!s)continue;const i=e.all(s),a=String(s.identifier).toUpperCase(),c=yu(a.toLowerCase());let u=0;const d=[],p=e.footnoteCounts.get(a);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){const e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(s,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...O(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:"\n"},s),i}function Pu(e,t){return e&&"run"in e?async function(n,r){const s=Lu(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Lu(n,{file:r,...e||t})}}function Mu(e){if(e)throw e}var Fu=n(4470);function zu(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}const Bu=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Zu(e);let n,r=0,s=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else s<0&&(n=!0,s=i+1);return s<0?"":e.slice(r,s)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(s=i):(o=-1,s=a));return r===s?s=a:s<0&&(s=e.length),e.slice(r,s)},Uu=function(e){if(Zu(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},Hu=function(e){Zu(e);let t,n=e.length,r=-1,s=0,i=-1,a=0;for(;n--;){const o=e.codePointAt(n);if(47!==o)r<0&&(t=!0,r=n+1),46===o?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1);else if(t){s=n+1;break}}return i<0||r<0||0===a||1===a&&i===r-1&&i===s+1?"":e.slice(i,r)},ju=function(...e){let t,n=-1;for(;++n<e.length;)Zu(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Zu(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,s="",i=0,a=-1,o=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===o);else if(a!==l-1&&2===o){if(s.length<2||2!==i||46!==s.codePointAt(s.length-1)||46!==s.codePointAt(s.length-2))if(s.length>2){if(r=s.lastIndexOf("/"),r!==s.length-1){r<0?(s="",i=0):(s=s.slice(0,r),i=s.length-1-s.lastIndexOf("/")),a=l,o=0;continue}}else if(s.length>0){s="",i=0,a=l,o=0;continue}t&&(s=s.length>0?s+"/..":"..",i=2)}else s.length>0?s+="/"+e.slice(a+1,l):s=e.slice(a+1,l),i=l-a-1;a=l,o=0}else 46===n&&o>-1?o++:o=-1}return s}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},$u="/";function Zu(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Gu=function(){return"/"};function Vu(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}const Yu=["history","path","basename","stem","extname","dirname"];class qu{constructor(e){let t;t=e?Vu(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":Gu(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<Yu.length;){const e=Yu[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)Yu.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?Bu(this.path):void 0}set basename(e){Ku(e,"basename"),Wu(e,"basename"),this.path=ju(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Uu(this.path):void 0}set dirname(e){Qu(this.basename,"dirname"),this.path=ju(e||"",this.basename)}get extname(){return"string"==typeof this.path?Hu(this.path):void 0}set extname(e){if(Wu(e,"extname"),Qu(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ju(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Vu(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!Vu(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),Ku(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Bu(this.path,this.extname):void 0}set stem(e){Ku(e,"stem"),Wu(e,"stem"),this.path=ju(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Dl(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Wu(e,t){if(e&&e.includes($u))throw new Error("`"+t+"` cannot be a path: did not expect `"+$u+"`")}function Ku(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Qu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Ju=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Xu={}.hasOwnProperty;class ed extends Ju{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function s(i,...a){const o=e[++n];let l=-1;if(i)r(i);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,o?function(e,t){let n;return function(...t){const i=e.length>t.length;let a;i&&t.push(r);try{a=e.apply(this,t)}catch(e){const t=e;if(i&&n)throw t;return r(t)}i||(a&&a.then&&"function"==typeof a.then?a.then(s,r):a instanceof Error?r(a):s(a))};function r(e,...r){n||(n=!0,t(e,...r))}function s(e){r(null,e)}}(o,s)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){const e=new ed;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Fu(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(sd("data",this.frozen),this.namespace[e]=t,this):Xu.call(this.namespace,e)&&this.namespace[e]||void 0:e?(sd("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=od(e),n=this.parser||this.Parser;return nd("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),nd("process",this.parser||this.Parser),rd("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,s){const i=od(e),a=n.parse(i);function o(e,n){e||!n?s(e):r?r(n):t(void 0,n)}n.run(a,i,(function(e,t,r){if(e||!t||!r)return o(e);const s=t,i=n.stringify(s,r);var a;"string"==typeof(a=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=i:r.result=i,o(e,r)}))}}processSync(e){let t,n=!1;return this.freeze(),nd("processSync",this.parser||this.Parser),rd("processSync",this.compiler||this.Compiler),this.process(e,(function(e,r){n=!0,Mu(e),t=r})),ad("processSync","process",n),t}run(e,t,n){id(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?s(void 0,n):new Promise(s);function s(s,i){const a=od(t);r.run(e,a,(function(t,r,a){const o=r||e;t?i(t):s?s(o):n(void 0,o,a)}))}}runSync(e,t){let n,r=!1;return this.run(e,t,(function(e,t){Mu(e),n=t,r=!0})),ad("runSync","run",r),n}stringify(e,t){this.freeze();const n=od(t),r=this.compiler||this.Compiler;return rd("stringify",r),id(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(sd("use",this.frozen),null==e);else if("function"==typeof e)o(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function s(e){if("function"==typeof e)o(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;o(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=Fu(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;)s(e[t])}}function o(e,t){let r=-1,s=-1;for(;++r<n.length;)if(n[r][0]===e){s=r;break}if(-1===s)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const a=n[s][1];zu(a)&&zu(r)&&(r=Fu(!0,a,r)),n[s]=[e,r,...i]}}}}const td=(new ed).freeze();function nd(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function rd(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function sd(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function id(e){if(!zu(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function ad(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function od(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new qu(e)}var ld={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function cd(e){ld=e}var ud={exec:()=>null};function dd(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(hd.caret,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}var pd=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),hd={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},fd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,md=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ed=dd(gd).replace(/bull/g,md).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),yd=dd(gd).replace(/bull/g,md).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_d=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Td=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,bd=dd(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Td).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),kd=dd(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,md).getRegex(),vd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ad=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,xd=dd("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Ad).replace("tag",vd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Id=dd(_d).replace("hr",fd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vd).getRegex(),Sd={blockquote:dd(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Id).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:bd,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:fd,html:xd,lheading:Ed,list:kd,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Id,table:ud,text:/^[^\n]+/},Nd=dd("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vd).getRegex(),wd={...Sd,lheading:yd,table:Nd,paragraph:dd(_d).replace("hr",fd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Nd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vd).getRegex()},Cd={...Sd,html:dd("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Ad).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ud,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:dd(_d).replace("hr",fd).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ed).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Od=/^( {2,}|\\)\n(?!\s*$)/,Rd=/[\p{P}\p{S}]/u,Dd=/[\s\p{P}\p{S}]/u,Ld=/[^\s\p{P}\p{S}]/u,Pd=dd(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Dd).getRegex(),Md=/(?!~)[\p{P}\p{S}]/u,Fd=dd(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",pd?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),zd=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Bd=dd(zd,"u").replace(/punct/g,Rd).getRegex(),Ud=dd(zd,"u").replace(/punct/g,Md).getRegex(),Hd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",jd=dd(Hd,"gu").replace(/notPunctSpace/g,Ld).replace(/punctSpace/g,Dd).replace(/punct/g,Rd).getRegex(),$d=dd(Hd,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,Md).getRegex(),Zd=dd("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ld).replace(/punctSpace/g,Dd).replace(/punct/g,Rd).getRegex(),Gd=dd(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Rd).getRegex(),Vd=dd("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Ld).replace(/punctSpace/g,Dd).replace(/punct/g,Rd).getRegex(),Yd=dd(/\\(punct)/,"gu").replace(/punct/g,Rd).getRegex(),qd=dd(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Wd=dd(Ad).replace("(?:--\x3e|$)","--\x3e").getRegex(),Kd=dd("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Wd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Jd=dd(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Qd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xd=dd(/^!?\[(label)\]\[(ref)\]/).replace("label",Qd).replace("ref",Td).getRegex(),ep=dd(/^!?\[(ref)\](?:\[\])?/).replace("ref",Td).getRegex(),tp=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,np={_backpedal:ud,anyPunctuation:Yd,autolink:qd,blockSkip:Fd,br:Od,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ud,delLDelim:ud,delRDelim:ud,emStrongLDelim:Bd,emStrongRDelimAst:jd,emStrongRDelimUnd:Zd,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Jd,nolink:ep,punctuation:Pd,reflink:Xd,reflinkSearch:dd("reflink|nolink(?!\\()","g").replace("reflink",Xd).replace("nolink",ep).getRegex(),tag:Kd,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ud},rp={...np,link:dd(/^!?\[(label)\]\((.*?)\)/).replace("label",Qd).getRegex(),reflink:dd(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qd).getRegex()},sp={...np,emStrongRDelimAst:$d,emStrongLDelim:Ud,delLDelim:Gd,delRDelim:Vd,url:dd(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",tp).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:dd(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",tp).getRegex()},ip={...sp,br:dd(Od).replace("{2,}","*").getRegex(),text:dd(sp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ap={normal:Sd,gfm:wd,pedantic:Cd},op={normal:np,gfm:sp,breaks:ip,pedantic:rp},lp={"&":"&","<":"<",">":">",'"':""","'":"'"},cp=e=>lp[e];function up(e,t){if(t){if(hd.escapeTest.test(e))return e.replace(hd.escapeReplace,cp)}else if(hd.escapeTestNoEncode.test(e))return e.replace(hd.escapeReplaceNoEncode,cp);return e}function dp(e){try{e=encodeURI(e).replace(hd.percentDecode,"%")}catch{return null}return e}function pp(e,t){let n=e.replace(hd.findPipe,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})),r=n.split(hd.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(hd.slashPipe,"|");return r}function hp(e,t,n){let r=e.length;if(0===r)return"";let s=0;for(;s<r;){let i=e.charAt(r-s-1);if(i!==t||n){if(i===t||!n)break;s++}else s++}return e.slice(0,r-s)}function fp(e,t=0){let n=t,r="";for(let t of e)if("\t"===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}function mp(e,t,n,r,s){let i=t.href,a=t.title||null,o=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,l}var gp=class{options;rules;lexer;constructor(e){this.options=e||ld}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:hp(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let s=r[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=hp(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:hp(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=hp(t[0],"\n").split("\n"),n="",r="",s=[];for(;e.length>0;){let t,i=!1,a=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))a.push(e[t]),i=!0;else{if(i)break;a.push(e[t])}e=e.slice(t);let o=a.join("\n"),l=o.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${o}`:o,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,s,!0),this.lexer.state.top=c,0===e.length)break;let u=s.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,i=t.raw+"\n"+e.join("\n"),a=this.blockquote(i);s[s.length-1]=a,n=n.substring(0,n.length-t.raw.length)+a.raw,r=r.substring(0,r.length-t.text.length)+a.text;break}if("list"!==u?.type);else{let t=u,i=t.raw+"\n"+e.join("\n"),a=this.list(i);s[s.length-1]=a,n=n.substring(0,n.length-u.raw.length)+a.raw,r=r.substring(0,r.length-t.raw.length)+a.raw,e=i.substring(s.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),a=!1;for(;e;){let n=!1,r="",o="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=fp(t[2].split("\n",1)[0],t[1].length),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,o=l.trimStart()):u?d=t[1].length+1:(d=l.search(this.rules.other.nonSpaceChar),d=d>4?1:d,o=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),s=this.rules.other.fencesBeginRegex(d),i=this.rules.other.headingBeginRegex(d),a=this.rules.other.htmlBeginRegex(d),p=this.rules.other.blockquoteBeginRegex(d);for(;e;){let h,f=e.split("\n",1)[0];if(c=f,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),s.test(c)||i.test(c)||a.test(c)||p.test(c)||t.test(c)||n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())o+="\n"+h.slice(d);else{if(u||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||s.test(l)||i.test(l)||n.test(l))break;o+="\n"+c}u=!c.trim(),r+=f+"\n",e=e.substring(f.length+1),l=h.slice(d)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(a=!0)),s.items.push({type:"list_item",raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(o),loose:!1,text:o,tokens:[]}),s.raw+=r}let o=s.items.at(-1);if(!o)return;o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd(),s.raw=s.raw.trimEnd();for(let e of s.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,""),"text"===e.tokens[0]?.type||"paragraph"===e.tokens[0]?.type){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=n.checked,s.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:"paragraph",raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!s.loose){let t=e.tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));s.loose=n}}if(s.loose)for(let e of s.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=pp(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?i.align.push("right"):this.rules.other.tableAlignCenter.test(e)?i.align.push("center"):this.rules.other.tableAlignLeft.test(e)?i.align.push("left"):i.align.push(null);for(let e=0;e<n.length;e++)i.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:i.align[e]});for(let e of s)i.rows.push(pp(e,i.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]}))));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=hp(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),mp(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return mp(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(r[1]||r[2]||r[3]||r[4])&&(!r[4]||!n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[3]||!n||this.rules.inline.punctuation.exec(n))){let n,s,i=[...r[0]].length-1,a=i,o=0,l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!==(r=l.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(s=[...n].length,r[3]||r[4]){a+=s;continue}if((r[5]||r[6])&&i%3&&!((i+s)%3)){o+=s;continue}if(a-=s,a>0)continue;s=Math.min(s,s+a+o);let t=[...r[0]][0].length,l=e.slice(0,i+r.index+t+s);if(Math.min(i,s)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n,s,i=[...r[0]].length-1,a=i,o=this.rules.inline.delRDelim;for(o.lastIndex=0,t=t.slice(-1*e.length+i);null!==(r=o.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(s=[...n].length,s!==i))continue;if(r[3]||r[4]){a+=s;continue}if(a-=s,a>0)continue;s=Math.min(s,s+a);let t=[...r[0]][0].length,o=e.slice(0,i+r.index+t+s),l=o.slice(i,-i);return{type:"del",raw:o,text:l,tokens:this.lexer.inlineTokens(l)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Ep=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ld,this.options.tokenizer=this.options.tokenizer||new gp,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:hd,block:ap.normal,inline:op.normal};this.options.pedantic?(t.block=ap.pedantic,t.inline=op.pedantic):this.options.gfm&&(t.block=ap.gfm,this.options.breaks?t.inline=op.breaks:t.inline=op.gfm),this.tokenizer.rules=t}static get rules(){return{block:ap,inline:op}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(hd.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(hd.tabCharGlobal," ").replace(hd.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(s=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let i=t.at(-1);n&&"paragraph"===i?.type?(i.raw+=(i.raw.endsWith("\n")?"":"\n")+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(r),n=s.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n,r=e,s=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!==(s=this.tokenizer.rules.inline.reflinkSearch.exec(r));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!==(s=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!==(s=this.tokenizer.rules.inline.blockSkip.exec(r));)n=s[2]?s[2].length:0,r=r.slice(0,s.index+n)+"["+"a".repeat(s[0].length-n-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,a="";for(;e;){let n;if(i||(a=""),i=!1,this.options.extensions?.inline?.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))continue;if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let r=t.at(-1);"text"===n.type&&"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,r,a)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e,r,a)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let s=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(s=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(s)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0;let r=t.at(-1);"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},yp=class{options;parser;constructor(e){this.options=e||ld}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(hd.notSpaceStart)?.[0],s=e.replace(hd.endingNewline,"")+"\n";return r?'<pre><code class="language-'+up(r)+'">'+(n?s:up(s,!0))+"</code></pre>\n":"<pre><code>"+(n?s:up(s,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+s+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let s=e.rows[t];n="";for(let e=0;e<s.length;e++)n+=this.tablecell(s[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${up(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),s=dp(e);if(null===s)return r;let i='<a href="'+(e=s)+'"';return t&&(i+=' title="'+up(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=dp(e);if(null===s)return up(n);let i=`<img src="${e=s}" alt="${up(n)}"`;return t&&(i+=` title="${up(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:up(e.text)}},_p=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Tp=class e{options;renderer;textRenderer;constructor(e){this.options=e||ld,this.options.renderer=this.options.renderer||new yp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _p}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){t+=n||"";continue}}let s=r;switch(s.type){case"space":t+=this.renderer.space(s);break;case"hr":t+=this.renderer.hr(s);break;case"heading":t+=this.renderer.heading(s);break;case"code":t+=this.renderer.code(s);break;case"table":t+=this.renderer.table(s);break;case"blockquote":t+=this.renderer.blockquote(s);break;case"list":t+=this.renderer.list(s);break;case"checkbox":t+=this.renderer.checkbox(s);break;case"html":t+=this.renderer.html(s);break;case"def":t+=this.renderer.def(s);break;case"paragraph":t+=this.renderer.paragraph(s);break;case"text":t+=this.renderer.text(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=e||"";continue}}let i=s;switch(i.type){case"escape":case"text":n+=t.text(i);break;case"html":n+=t.html(i);break;case"link":n+=t.link(i);break;case"image":n+=t.image(i);break;case"checkbox":n+=t.checkbox(i);break;case"strong":n+=t.strong(i);break;case"em":n+=t.em(i);break;case"codespan":n+=t.codespan(i);break;case"br":n+=t.br(i);break;case"del":n+=t.del(i);break;default:{let e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},bp=class{options;block;constructor(e){this.options=e||ld}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ep.lex:Ep.lexInline}provideParser(e=this.block){return e?Tp.parse:Tp.parseInline}},kp=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Tp;Renderer=yp;TextRenderer=_p;Lexer=Ep;Tokenizer=gp;Hooks=bp;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{let s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new yp(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,s=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new gp(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,s=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new bp;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,s=e.hooks[r],i=t[r];bp.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&bp.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await s.call(t,e);return i.call(t,n)})();let r=s.call(t,e);return i.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await s.apply(t,e);return!1===n&&(n=await i.apply(t,e)),n})();let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ep.lex(e,t??this.defaults)}parser(e,t){return Tp.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===r.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(t):t,r=await(s.hooks?await s.hooks.provideLexer(e):e?Ep.lex:Ep.lexInline)(n,s),i=s.hooks?await s.hooks.processAllTokens(r):r;s.walkTokens&&await Promise.all(this.walkTokens(i,s.walkTokens));let a=await(s.hooks?await s.hooks.provideParser(e):e?Tp.parse:Tp.parseInline)(i,s);return s.hooks?await s.hooks.postprocess(a):a})().catch(i);try{s.hooks&&(t=s.hooks.preprocess(t));let n=(s.hooks?s.hooks.provideLexer(e):e?Ep.lex:Ep.lexInline)(t,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let r=(s.hooks?s.hooks.provideParser(e):e?Tp.parse:Tp.parseInline)(n,s);return s.hooks&&(r=s.hooks.postprocess(r)),r}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+up(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function vp(e,t){return kp.parse(e,t)}vp.options=vp.setOptions=function(e){return kp.setOptions(e),vp.defaults=kp.defaults,cd(vp.defaults),vp},vp.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},vp.defaults=ld,vp.use=function(...e){return kp.use(...e),vp.defaults=kp.defaults,cd(vp.defaults),vp},vp.walkTokens=function(e,t){return kp.walkTokens(e,t)},vp.parseInline=kp.parseInline,vp.Parser=Tp,vp.parser=Tp.parse,vp.Renderer=yp,vp.TextRenderer=_p,vp.Lexer=Ep,vp.lexer=Ep.lex,vp.Tokenizer=gp,vp.Hooks=bp,vp.parse=vp,vp.options,vp.setOptions,vp.use,vp.walkTokens,vp.parseInline,Tp.parse,Ep.lex;var Ap=300,xp="300px",Ip=500;function Sp(e={}){let{immediate:t=!1,debounceDelay:n=Ap,rootMargin:r=xp,idleTimeout:s=Ip}=e,[a,o]=(0,i.useState)(!1),l=(0,i.useRef)(null),c=(0,i.useRef)(null),u=(0,i.useRef)(null),d=(0,i.useMemo)((()=>e=>{let t=Date.now();return window.setTimeout((()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})}),1)}),[]),p=(0,i.useMemo)((()=>"undefined"!=typeof window&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):d),[d]),h=(0,i.useMemo)((()=>"undefined"!=typeof window&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)}),[]);return(0,i.useEffect)((()=>{if(t)return void o(!0);let e=l.current;if(!e)return;c.current&&(clearTimeout(c.current),c.current=null),u.current&&(h(u.current),u.current=null);let i=()=>{c.current&&(clearTimeout(c.current),c.current=null),u.current&&(h(u.current),u.current=null)},a=(e,t)=>{e.isIntersecting?(e=>{i(),c.current=window.setTimeout((()=>{var t,n;let r=e.takeRecords();(0===r.length||null!=(n=null==(t=r.at(-1))?void 0:t.isIntersecting)&&n)&&(e=>{u.current=p((t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):u.current=p((()=>{o(!0),e.disconnect()}),{timeout:s/2})}),{timeout:s})})(e)}),n)})(t):i()},d=new IntersectionObserver((e=>{for(let t of e)a(t,d)}),{rootMargin:r,threshold:0});return d.observe(e),()=>{c.current&&clearTimeout(c.current),u.current&&h(u.current),d.disconnect()}}),[t,n,r,s,h,p]),{shouldRender:a,containerRef:l}}var Np=/\s/,wp=/^\s+$/,Cp=new Set(["code","pre","svg","math","annotation"]),Op=0;function Rp(e){var t,n,r,s;let i={animation:null!=(t=null==e?void 0:e.animation)?t:"fadeIn",duration:null!=(n=null==e?void 0:e.duration)?n:150,easing:null!=(r=null==e?void 0:e.easing)?r:"ease",sep:null!=(s=null==e?void 0:e.sep)?s:"word"},a={prevContentLength:0,lastRenderCharCount:0},o=Op++,l=()=>e=>{let t={count:0};h(e,"text",((e,n)=>((e,t,n,r,s)=>{let i=t.at(-1);if(!i||!("children"in i))return;if((e=>e.some((e=>(e=>"object"==typeof e&&null!==e&&"type"in e&&"element"===e.type)(e)&&Cp.has(e.tagName))))(t))return p;let a=i,o=a.children.indexOf(e);if(-1===o)return;let l=e.value;if(!l.trim())return void(s.count+=l.length);let c="char"===n.sep?(e=>{let t=[],n="";for(let r of e)Np.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t})(l):(e=>{let t=[],n="",r=!1;for(let s of e){let e=Np.test(s);e!==r&&n&&(t.push(n),n=""),n+=s,r=e}return n&&t.push(n),t})(l),u=r.prevContentLength,d=c.map((e=>{let t=s.count;if(s.count+=e.length,wp.test(e))return{type:"text",value:e};let r=u>0&&t<u;return((e,t,n,r,s)=>({type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:s?`--sd-animation:sd-${t};--sd-duration:0ms;--sd-easing:${r}`:`--sd-animation:sd-${t};--sd-duration:${n}ms;--sd-easing:${r}`},children:[{type:"text",value:e}]}))(e,n.animation,n.duration,n.easing,r)}));return a.children.splice(o,1,...d),o+d.length})(e,n,i,a,t))),a.lastRenderCharCount=t.count,a.prevContentLength=0};return Object.defineProperty(l,"name",{value:`rehypeAnimate$${o}`}),{name:"animate",type:"animate",rehypePlugin:l,setPrevContentLength(e){a.prevContentLength=e},getLastRenderCharCount(){let e=a.lastRenderCharCount;return a.lastRenderCharCount=0,e}}}Rp();var Dp=(0,i.createContext)(!1),Lp=(...e)=>yl(Xa(e)),Pp=(e,t,n)=>{let r="string"==typeof t?new Blob([t],{type:n}):t,s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)},Mp=(0,i.createContext)(Lp),Fp=()=>(0,i.useContext)(Mp),zp=Lp("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),Bp=(0,i.memo)((({children:e,result:t,language:n,className:r,startLine:s,...a})=>{let o=Fp(),l=(0,i.useMemo)((()=>o(zp)),[o]),c=(0,i.useMemo)((()=>{let e={};return t.bg&&(e["--sdm-bg"]=t.bg),t.fg&&(e["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(e,(e=>{let t={};for(let n of e.split(";")){let e=n.indexOf(":");if(e>0){let r=n.slice(0,e).trim(),s=n.slice(e+1).trim();r&&s&&(t[r]=s)}}return t})(t.rootStyle)),e}),[t.bg,t.fg,t.rootStyle]);return(0,_l.jsx)("div",{className:o(r,"overflow-hidden rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...a,children:(0,_l.jsx)("pre",{className:o(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:c,children:(0,_l.jsx)("code",{className:o("[counter-increment:line_0] [counter-reset:line]"),style:s&&s>1?{counterReset:"line "+(s-1)}:void 0,children:t.tokens.map(((e,t)=>(0,_l.jsx)("span",{className:l,children:0===e.length||1===e.length&&""===e[0].content?"\n":e.map(((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n["--sdm-c"]=e.color),e.bgColor&&(n["--sdm-tbg"]=e.bgColor),e.htmlStyle)for(let[t,s]of Object.entries(e.htmlStyle))"color"===t?n["--sdm-c"]=s:"background-color"===t?(n["--sdm-tbg"]=s,r=!0):n[t]=s;return(0,_l.jsx)("span",{className:o("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",r&&"bg-[var(--sdm-tbg)]",r&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:n,...e.htmlAttrs,children:e.content},t)}))},t)))})})})}),((e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine)),Up=({className:e,language:t,style:n,isIncomplete:r,...s})=>{let i=Fp();return(0,_l.jsx)("div",{className:i("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...s})},Hp=(0,i.createContext)({code:""}),jp=()=>(0,i.useContext)(Hp),$p=({language:e})=>{let t=Fp();return(0,_l.jsx)("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:(0,_l.jsx)("span",{className:t("ml-1 font-mono lowercase"),children:e})})},Zp=/\n+$/,Gp=(0,i.lazy)((()=>n.e(435).then(n.bind(n,6435)).then((e=>({default:e.HighlightedCodeBlockBody}))))),Vp=({code:e,language:t,className:n,children:r,isIncomplete:s=!1,startLine:a,...o})=>{let l=Fp(),c=(0,i.useMemo)((()=>e.replace(Zp,"")),[e]),u=(0,i.useMemo)((()=>({bg:"transparent",fg:"inherit",tokens:c.split("\n").map((e=>[{content:e,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}]))})),[c]);return(0,_l.jsx)(Hp.Provider,{value:{code:e},children:(0,_l.jsxs)(Up,{isIncomplete:s,language:t,children:[(0,_l.jsx)($p,{language:t}),r?(0,_l.jsx)("div",{className:l("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:(0,_l.jsx)("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,(0,_l.jsx)(i.Suspense,{fallback:(0,_l.jsx)(Bp,{className:n,language:t,result:u,startLine:a,...o}),children:(0,_l.jsx)(Gp,{className:n,code:c,language:t,raw:u,startLine:a,...o})})]})})},Yp={CheckIcon:e=>(0,_l.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,_l.jsx)("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),CopyIcon:e=>(0,_l.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,_l.jsx)("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),DownloadIcon:e=>(0,_l.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,_l.jsx)("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),ExternalLinkIcon:e=>(0,_l.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,_l.jsx)("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),Loader2Icon:e=>(0,_l.jsxs)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[(0,_l.jsx)("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),(0,_l.jsx)("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,_l.jsx)("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),(0,_l.jsx)("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),(0,_l.jsx)("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),(0,_l.jsx)("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),(0,_l.jsx)("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,_l.jsx)("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),(0,_l.jsx)("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),(0,_l.jsx)("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Maximize2Icon:e=>(0,_l.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,_l.jsx)("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),RotateCcwIcon:e=>(0,_l.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,_l.jsx)("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),XIcon:e=>(0,_l.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,_l.jsx)("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),ZoomInIcon:e=>(0,_l.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,_l.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),ZoomOutIcon:e=>(0,_l.jsx)("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:(0,_l.jsx)("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})})},qp=(0,i.createContext)(Yp),Wp=({icons:e,children:t})=>{let n=(0,i.useRef)(e),r=(0,i.useRef)(e?{...Yp,...e}:Yp);((e,t)=>{if(e===t)return!0;if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((n=>e[n]===t[n]))})(n.current,e)||(n.current=e,r.current=e?{...Yp,...e}:Yp);let s=r.current;return(0,_l.jsx)(qp.Provider,{value:s,children:t})},Kp=()=>(0,i.useContext)(qp),Qp={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},Jp=(0,i.createContext)(Qp),Xp=()=>(0,i.useContext)(Jp),eh=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:s,code:a,...o})=>{let l=Fp(),[c,u]=(0,i.useState)(!1),d=(0,i.useRef)(0),{code:p}=jp(),{isAnimating:h}=(0,i.useContext)(qf),f=Xp(),m=null!=a?a:p;(0,i.useEffect)((()=>()=>{window.clearTimeout(d.current)}),[]);let g=Kp(),E=c?g.CheckIcon:g.CopyIcon;return(0,_l.jsx)("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-copy-button",disabled:h,onClick:async()=>{var r;if("undefined"!=typeof window&&null!=(r=null==navigator?void 0:navigator.clipboard)&&r.writeText)try{c||(await navigator.clipboard.writeText(m),u(!0),null==e||e(),d.current=window.setTimeout((()=>u(!1)),n))}catch(e){null==t||t(e)}else null==t||t(new Error("Clipboard API not available"))},title:f.copyCode,type:"button",...o,children:null!=r?r:(0,_l.jsx)(E,{size:14})})},th={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},nh=({onDownload:e,onError:t,language:n,children:r,className:s,code:a,...o})=>{let l=Fp(),{code:c}=jp(),{isAnimating:u}=(0,i.useContext)(qf),d=Xp(),p=Kp(),h=null!=a?a:c,f=`file.${n&&n in th?th[n]:"txt"}`;return(0,_l.jsx)("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-download-button",disabled:u,onClick:()=>{try{Pp(f,h,"text/plain"),null==e||e()}catch(e){null==t||t(e)}},title:d.downloadFile,type:"button",...o,children:null!=r?r:(0,_l.jsx)(p.DownloadIcon,{size:14})})},rh=()=>{let{Loader2Icon:e}=Kp(),t=Fp();return(0,_l.jsxs)("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[(0,_l.jsx)("div",{className:t("h-[46px] w-full bg-muted/80")}),(0,_l.jsx)("div",{className:t("flex w-full items-center justify-center p-4"),children:(0,_l.jsx)(e,{className:t("size-4 animate-spin")})})]})},sh=/\.[^/.]+$/,ih=0,ah=()=>{1===(ih+=1)&&(document.body.style.overflow="hidden")},oh=()=>{0===(ih=Math.max(0,ih-1))&&(document.body.style.overflow="")},lh=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:s,CopyIcon:a,ExternalLinkIcon:o,XIcon:l}=Kp(),c=Fp(),[u,d]=(0,i.useState)(!1),p=Xp(),h=(0,i.useCallback)((async()=>{try{await navigator.clipboard.writeText(e),d(!0),setTimeout((()=>d(!1)),2e3)}catch(e){}}),[e]),f=(0,i.useCallback)((()=>{r(),n()}),[r,n]);return(0,i.useEffect)((()=>{if(t){ah();let e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e),oh()}}}),[t,n]),t?(0,_l.jsx)("div",{className:c("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:e=>{"Escape"===e.key&&n()},role:"button",tabIndex:0,children:(0,_l.jsxs)("div",{className:c("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:"presentation",children:[(0,_l.jsx)("button",{className:c("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:p.close,type:"button",children:(0,_l.jsx)(l,{size:16})}),(0,_l.jsxs)("div",{className:c("flex flex-col gap-2"),children:[(0,_l.jsxs)("div",{className:c("flex items-center gap-2 font-semibold text-lg"),children:[(0,_l.jsx)(o,{size:20}),(0,_l.jsx)("span",{children:p.openExternalLink})]}),(0,_l.jsx)("p",{className:c("text-muted-foreground text-sm"),children:p.externalLinkWarning})]}),(0,_l.jsx)("div",{className:c("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),(0,_l.jsxs)("div",{className:c("flex gap-2"),children:[(0,_l.jsx)("button",{className:c("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:h,type:"button",children:u?(0,_l.jsxs)(_l.Fragment,{children:[(0,_l.jsx)(s,{size:14}),(0,_l.jsx)("span",{children:p.copied})]}):(0,_l.jsxs)(_l.Fragment,{children:[(0,_l.jsx)(a,{size:14}),(0,_l.jsx)("span",{children:p.copyLink})]})}),(0,_l.jsxs)("button",{className:c("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:f,type:"button",children:[(0,_l.jsx)(o,{size:14}),(0,_l.jsx)("span",{children:p.openLink})]})]})]})}):null},ch=(0,i.createContext)(null),uh=()=>(0,i.useContext)(ch),dh=()=>{var e;let t=uh();return null!=(e=null==t?void 0:t.code)?e:null},ph=()=>{var e;let t=uh();return null!=(e=null==t?void 0:t.mermaid)?e:null},hh=({chart:e,children:t,className:n,onDownload:r,config:s,onError:a})=>{let o=Fp(),[l,c]=(0,i.useState)(!1),u=(0,i.useRef)(null),{isAnimating:d}=(0,i.useContext)(qf),p=Kp(),h=ph(),f=Xp(),m=async t=>{try{if("mmd"===t)return Pp("diagram.mmd",e,"text/plain"),c(!1),void(null==r||r(t));if(!h)return void(null==a||a(new Error("Mermaid plugin not available")));let n=h.getMermaid(s),i=e.split("").reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)|0),0),o=`mermaid-${Math.abs(i)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(o,e);if(!l)return void(null==a||a(new Error("SVG not found. Please wait for the diagram to render.")));if("svg"===t)return Pp("diagram.svg",l,"image/svg+xml"),c(!1),void(null==r||r(t));if("png"===t){let e=await((e,t)=>new Promise(((t,n)=>{let r="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{let e=document.createElement("canvas"),r=5*s.width,i=5*s.height;e.width=r,e.height=i;let a=e.getContext("2d");a?(a.drawImage(s,0,0,r,i),e.toBlob((e=>{e?t(e):n(new Error("Failed to create PNG blob"))}),"image/png")):n(new Error("Failed to create 2D canvas context for PNG export"))},s.onerror=()=>n(new Error("Failed to load SVG image")),s.src=r})))(l);return Pp("diagram.png",e,"image/png"),null==r||r(t),void c(!1)}}catch(e){null==a||a(e)}};return(0,i.useEffect)((()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&c(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),(0,_l.jsxs)("div",{className:o("relative"),ref:u,children:[(0,_l.jsx)("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:d,onClick:()=>c(!l),title:f.downloadDiagram,type:"button",children:null!=t?t:(0,_l.jsx)(p.DownloadIcon,{size:14})}),l?(0,_l.jsxs)("div",{className:o("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,_l.jsx)("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("svg"),title:f.downloadDiagramAsSvg,type:"button",children:f.mermaidFormatSvg}),(0,_l.jsx)("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("png"),title:f.downloadDiagramAsPng,type:"button",children:f.mermaidFormatPng}),(0,_l.jsx)("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("mmd"),title:f.downloadDiagramAsMmd,type:"button",children:f.mermaidFormatMmd})]}):null]})},fh=({chart:e,config:t,onFullscreen:n,onExit:r,className:s,...a})=>{let{Maximize2Icon:o,XIcon:l}=Kp(),c=Fp(),[u,d]=(0,i.useState)(!1),{isAnimating:p,controls:h}=(0,i.useContext)(qf),f=Xp(),m=(()=>{if("boolean"==typeof h)return h;let e=h.mermaid;return!1!==e&&(!0===e||void 0===e||!1!==e.panZoom)})(),g=()=>{d(!u)};return(0,i.useEffect)((()=>{if(u){ah();let e=e=>{"Escape"===e.key&&d(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e),oh()}}}),[u]),(0,i.useEffect)((()=>{u?null==n||n():r&&r()}),[u,n,r]),(0,_l.jsxs)(_l.Fragment,{children:[(0,_l.jsx)("button",{className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),disabled:p,onClick:g,title:f.viewFullscreen,type:"button",...a,children:(0,_l.jsx)(o,{size:14})}),u?(0,Tl.createPortal)((0,_l.jsxs)("div",{className:c("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:g,onKeyDown:e=>{"Escape"===e.key&&g()},role:"button",tabIndex:0,children:[(0,_l.jsx)("button",{className:c("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:g,title:f.exitFullscreen,type:"button",children:(0,_l.jsx)(l,{size:20})}),(0,_l.jsx)("div",{className:c("flex size-full items-center justify-center p-4"),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:"presentation",children:(0,_l.jsx)(Xf,{chart:e,className:c("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})},mh=e=>{var t,n;let r=[],s=[],i=e.querySelectorAll("thead th");for(let e of i)r.push((null==(t=e.textContent)?void 0:t.trim())||"");let a=e.querySelectorAll("tbody tr");for(let e of a){let t=[],r=e.querySelectorAll("td");for(let e of r)t.push((null==(n=e.textContent)?void 0:n.trim())||"");s.push(t)}return{headers:r,rows:s}},gh=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r of e){if('"'===r){t=!0,n=!0;break}(","===r||"\n"===r)&&(t=!0)}return t?n?`"${e.replace(/"/g,'""')}"`:`"${e}"`:e},s=t.length>0?n.length+1:n.length,i=new Array(s),a=0;t.length>0&&(i[a]=t.map(r).join(","),a+=1);for(let e of n)i[a]=e.map(r).join(","),a+=1;return i.join("\n")},Eh=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if("\t"===n||"\n"===n||"\r"===n){t=!0;break}if(!t)return e;let n=[];for(let t of e)"\t"===t?n.push("\\t"):"\n"===t?n.push("\\n"):"\r"===t?n.push("\\r"):n.push(t);return n.join("")},s=t.length>0?n.length+1:n.length,i=new Array(s),a=0;t.length>0&&(i[a]=t.map(r).join("\t"),a+=1);for(let e of n)i[a]=e.map(r).join("\t"),a+=1;return i.join("\n")},yh=e=>{let t=!1;for(let n of e)if("\\"===n||"|"===n){t=!0;break}if(!t)return e;let n=[];for(let t of e)"\\"===t?n.push("\\\\"):"|"===t?n.push("\\|"):n.push(t);return n.join("")},_h=e=>{let{headers:t,rows:n}=e;if(0===t.length)return"";let r=new Array(n.length+2),s=0,i=t.map((e=>yh(e)));r[s]=`| ${i.join(" | ")} |`,s+=1;let a=new Array(t.length);for(let e=0;e<t.length;e+=1)a[e]="---";r[s]=`| ${a.join(" | ")} |`,s+=1;for(let e of n)if(e.length<t.length){let n=new Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?yh(e[r]):"";r[s]=`| ${n.join(" | ")} |`,s+=1}else{let t=e.map((e=>yh(e)));r[s]=`| ${t.join(" | ")} |`,s+=1}return r.join("\n")},Th=({children:e,className:t,onCopy:n,onError:r,timeout:s=2e3})=>{let a=Fp(),[o,l]=(0,i.useState)(!1),[c,u]=(0,i.useState)(!1),d=(0,i.useRef)(null),p=(0,i.useRef)(0),{isAnimating:h}=(0,i.useContext)(qf),f=Xp(),m=async e=>{var t,i;if("undefined"!=typeof window&&null!=(t=null==navigator?void 0:navigator.clipboard)&&t.write)try{let t=null==(i=d.current)?void 0:i.closest('[data-streamdown="table-wrapper"]'),a=null==t?void 0:t.querySelector("table");if(!a)return void(null==r||r(new Error("Table not found")));let o=mh(a),c=({csv:gh,tsv:Eh,md:_h}[e]||_h)(o),h=new ClipboardItem({"text/plain":new Blob([c],{type:"text/plain"}),"text/html":new Blob([a.outerHTML],{type:"text/html"})});await navigator.clipboard.write([h]),u(!0),l(!1),null==n||n(e),p.current=window.setTimeout((()=>u(!1)),s)}catch(e){null==r||r(e)}else null==r||r(new Error("Clipboard API not available"))};(0,i.useEffect)((()=>{let e=e=>{let t=e.composedPath();d.current&&!t.includes(d.current)&&l(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e),window.clearTimeout(p.current)}}),[]);let g=Kp(),E=c?g.CheckIcon:g.CopyIcon;return(0,_l.jsxs)("div",{className:a("relative"),ref:d,children:[(0,_l.jsx)("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:()=>l(!o),title:f.copyTable,type:"button",children:null!=e?e:(0,_l.jsx)(E,{height:14,width:14})}),o?(0,_l.jsxs)("div",{className:a("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,_l.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("md"),title:f.copyTableAsMarkdown,type:"button",children:f.tableFormatMarkdown}),(0,_l.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("csv"),title:f.copyTableAsCsv,type:"button",children:f.tableFormatCsv}),(0,_l.jsx)("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("tsv"),title:f.copyTableAsTsv,type:"button",children:f.tableFormatTsv})]}):null]})},bh=({children:e,className:t,onDownload:n,onError:r})=>{let s=Fp(),[a,o]=(0,i.useState)(!1),l=(0,i.useRef)(null),{isAnimating:c}=(0,i.useContext)(qf),u=Xp(),d=Kp(),p=e=>{var t;try{let s=null==(t=l.current)?void 0:t.closest('[data-streamdown="table-wrapper"]'),i=null==s?void 0:s.querySelector("table");if(!i)return void(null==r||r(new Error("Table not found")));let a=mh(i),c="csv"===e?gh(a):_h(a);Pp("table."+("csv"===e?"csv":"md"),c,"csv"===e?"text/csv":"text/markdown"),o(!1),null==n||n(e)}catch(e){null==r||r(e)}};return(0,i.useEffect)((()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&o(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),(0,_l.jsxs)("div",{className:s("relative"),ref:l,children:[(0,_l.jsx)("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:"button",children:null!=e?e:(0,_l.jsx)(d.DownloadIcon,{size:14})}),a?(0,_l.jsxs)("div",{className:s("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[(0,_l.jsx)("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("csv"),title:u.downloadTableAsCsv,type:"button",children:u.tableFormatCsv}),(0,_l.jsx)("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("markdown"),title:u.downloadTableAsMarkdown,type:"button",children:u.tableFormatMarkdown})]}):null]})},kh=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:s,XIcon:a}=Kp(),o=Fp(),[l,c]=(0,i.useState)(!1),{isAnimating:u}=(0,i.useContext)(qf),d=Xp(),p=()=>{c(!1)};return(0,i.useEffect)((()=>{if(l){ah();let e=e=>{"Escape"===e.key&&c(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e),oh()}}}),[l]),(0,_l.jsxs)(_l.Fragment,{children:[(0,_l.jsx)("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>{c(!0)},title:d.viewFullscreen,type:"button",children:(0,_l.jsx)(s,{size:14})}),l?(0,Tl.createPortal)((0,_l.jsx)("div",{"aria-label":d.viewFullscreen,"aria-modal":"true",className:o("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:p,onKeyDown:e=>{"Escape"===e.key&&p()},role:"dialog",children:(0,_l.jsxs)("div",{className:o("flex h-full flex-col"),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:"presentation",children:[(0,_l.jsxs)("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?(0,_l.jsx)(Th,{}):null,r?(0,_l.jsx)(bh,{}):null,(0,_l.jsx)("button",{className:o("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:p,title:d.exitFullscreen,type:"button",children:(0,_l.jsx)(a,{size:20})})]}),(0,_l.jsx)("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:(0,_l.jsx)("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},vh=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:s=!0,showFullscreen:i=!0,...a})=>{let o=Fp(),l=n&&r,c=n&&s,u=n&&i,d=l||c||u;return(0,_l.jsxs)("div",{className:o("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[d?(0,_l.jsxs)("div",{className:o("flex items-center justify-end gap-1"),children:[l?(0,_l.jsx)(Th,{}):null,c?(0,_l.jsx)(bh,{}):null,u?(0,_l.jsx)(kh,{showCopy:l,showDownload:c,children:e}):null]}):null,(0,_l.jsx)("div",{className:o("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:(0,_l.jsx)("table",{className:o("w-full divide-y divide-border",t),"data-streamdown":"table",...a,children:e})})]})},Ah=/startLine=(\d+)/,xh=(0,i.lazy)((()=>n.e(301).then(n.bind(n,5301)).then((e=>({default:e.Mermaid}))))),Ih=/language-([^\s]+)/;function Sh(e,t){if(!(null!=e&&e.position||null!=t&&t.position))return!0;if(null==e||!e.position||null==t||!t.position)return!1;let n=e.position.start,r=t.position.start,s=e.position.end,i=t.position.end;return(null==n?void 0:n.line)===(null==r?void 0:r.line)&&(null==n?void 0:n.column)===(null==r?void 0:r.column)&&(null==s?void 0:s.line)===(null==i?void 0:i.line)&&(null==s?void 0:s.column)===(null==i?void 0:i.column)}function Nh(e,t){return e.className===t.className&&Sh(e.node,t.node)}var wh=(e,t)=>"boolean"==typeof e?e:!1!==e[t],Ch=(e,t)=>{if("boolean"==typeof e)return e;let n=e.table;return!1!==n&&(!0===n||void 0===n||!1!==n[t])},Oh=(e,t)=>{if("boolean"==typeof e)return e;let n=e.code;return!1!==n&&(!0===n||void 0===n||!1!==n[t])},Rh=(e,t)=>{if("boolean"==typeof e)return e;let n=e.mermaid;return!1!==n&&(!0===n||void 0===n||!1!==n[t])},Dh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("ol",{className:s("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})}),((e,t)=>Nh(e,t)));Dh.displayName="MarkdownOl";var Lh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("li",{className:s("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})}),((e,t)=>e.className===t.className&&Sh(e.node,t.node)));Lh.displayName="MarkdownLi";var Ph=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("ul",{className:s("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})}),((e,t)=>Nh(e,t)));Ph.displayName="MarkdownUl";var Mh=(0,i.memo)((({className:e,node:t,...n})=>{let r=Fp();return(0,_l.jsx)("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})}),((e,t)=>Nh(e,t)));Mh.displayName="MarkdownHr";var Fh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("span",{className:s("font-semibold",t),"data-streamdown":"strong",...r,children:e})}),((e,t)=>Nh(e,t)));Fh.displayName="MarkdownStrong";var zh=(0,i.memo)((({children:e,className:t,href:n,node:r,...s})=>{let a=Fp(),{linkSafety:o}=(0,i.useContext)(qf),[l,c]=(0,i.useState)(!1),u="streamdown:incomplete-link"===n,d=(0,i.useCallback)((async e=>{if(null!=o&&o.enabled&&n&&!u){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n))return void window.open(n,"_blank","noreferrer");c(!0)}}),[o,n,u]),p=(0,i.useCallback)((()=>{n&&window.open(n,"_blank","noreferrer")}),[n]),h=(0,i.useCallback)((()=>{c(!1)}),[]),f={url:null!=n?n:"",isOpen:l,onClose:h,onConfirm:p};return null!=o&&o.enabled&&n?(0,_l.jsxs)(_l.Fragment,{children:[(0,_l.jsx)("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",onClick:d,type:"button",children:e}),o.renderModal?o.renderModal(f):(0,_l.jsx)(lh,{...f})]}):(0,_l.jsx)("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...s,children:e})}),((e,t)=>Nh(e,t)&&e.href===t.href));zh.displayName="MarkdownA";var Bh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("h1",{className:s("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})}),((e,t)=>Nh(e,t)));Bh.displayName="MarkdownH1";var Uh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("h2",{className:s("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})}),((e,t)=>Nh(e,t)));Uh.displayName="MarkdownH2";var Hh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("h3",{className:s("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})}),((e,t)=>Nh(e,t)));Hh.displayName="MarkdownH3";var jh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("h4",{className:s("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})}),((e,t)=>Nh(e,t)));jh.displayName="MarkdownH4";var $h=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("h5",{className:s("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})}),((e,t)=>Nh(e,t)));$h.displayName="MarkdownH5";var Zh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("h6",{className:s("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})}),((e,t)=>Nh(e,t)));Zh.displayName="MarkdownH6";var Gh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let{controls:s}=(0,i.useContext)(qf),a=wh(s,"table"),o=Ch(s,"copy"),l=Ch(s,"download"),c=Ch(s,"fullscreen");return(0,_l.jsx)(vh,{className:t,showControls:a,showCopy:o,showDownload:l,showFullscreen:c,...r,children:e})}),((e,t)=>Nh(e,t)));Gh.displayName="MarkdownTable";var Vh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("thead",{className:s("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})}),((e,t)=>Nh(e,t)));Vh.displayName="MarkdownThead";var Yh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("tbody",{className:s("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})}),((e,t)=>Nh(e,t)));Yh.displayName="MarkdownTbody";var qh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("tr",{className:s("border-border",t),"data-streamdown":"table-row",...r,children:e})}),((e,t)=>Nh(e,t)));qh.displayName="MarkdownTr";var Wh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("th",{className:s("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})}),((e,t)=>Nh(e,t)));Wh.displayName="MarkdownTh";var Kh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("td",{className:s("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})}),((e,t)=>Nh(e,t)));Kh.displayName="MarkdownTd";var Qh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("blockquote",{className:s("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})}),((e,t)=>Nh(e,t)));Qh.displayName="MarkdownBlockquote";var Jh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("sup",{className:s("text-sm",t),"data-streamdown":"superscript",...r,children:e})}),((e,t)=>Nh(e,t)));Jh.displayName="MarkdownSup";var Xh=(0,i.memo)((({children:e,className:t,node:n,...r})=>{let s=Fp();return(0,_l.jsx)("sub",{className:s("text-sm",t),"data-streamdown":"subscript",...r,children:e})}),((e,t)=>Nh(e,t)));Xh.displayName="MarkdownSub";var ef=(0,i.memo)((({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let n=e=>{var t,n;if(!(0,i.isValidElement)(e))return!1;let r=Array.isArray(e.props.children)?e.props.children:[e.props.children],s=!1,a=!1;for(let e of r)if(e)if("string"==typeof e)""!==e.trim()&&(s=!0);else if((0,i.isValidElement)(e))if(void 0!==(null==(t=e.props)?void 0:t["data-footnote-backref"]))a=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if("string"==typeof e&&""!==e.trim()){s=!0;break}if((0,i.isValidElement)(e)&&void 0===(null==(n=e.props)?void 0:n["data-footnote-backref"])){s=!0;break}}}return a&&!s},s=Array.isArray(e)?e.map((e=>{if(!(0,i.isValidElement)(e))return e;if(e.type===Dh){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter((e=>!n(e)));return 0===t.length?null:{...e,props:{...e.props,children:t}}}return e})):e;return(Array.isArray(s)?s.some((e=>null!==e)):null!==s)?(0,_l.jsx)("section",{className:t,...r,children:s}):null}return(0,_l.jsx)("section",{className:t,...r,children:e})}),((e,t)=>Nh(e,t)));ef.displayName="MarkdownSection";var tf=(0,i.memo)((({node:e,className:t,children:n,...r})=>{var s,a;let o=Fp(),l=!("data-block"in r),{mermaid:c,controls:u}=(0,i.useContext)(qf),d=ph(),p=(0,i.useContext)(Dp),h=null==t?void 0:t.match(Ih),f=null!=(s=null==h?void 0:h.at(1))?s:"",m=(e=>{var t;let n=uh();return null!=n&&n.renderers&&e&&null!=(t=n.renderers.find((t=>Array.isArray(t.language)?t.language.includes(e):t.language===e)))?t:null})(f);if(l)return(0,_l.jsx)("code",{className:o("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let g=null==(a=null==e?void 0:e.properties)?void 0:a.metastring,E=null==g?void 0:g.match(Ah),y=E?Number.parseInt(E[1],10):void 0,_=void 0!==y&&y>=1?y:void 0,T="";if((0,i.isValidElement)(n)&&n.props&&"object"==typeof n.props&&"children"in n.props&&"string"==typeof n.props.children?T=n.props.children:"string"==typeof n&&(T=n),m){let e=m.component;return(0,_l.jsx)(i.Suspense,{fallback:(0,_l.jsx)(rh,{}),children:(0,_l.jsx)(e,{code:T,isIncomplete:p,language:f})})}if("mermaid"===f&&d){let e=wh(u,"mermaid"),n=Rh(u,"download"),r=Rh(u,"copy"),s=Rh(u,"fullscreen"),a=Rh(u,"panZoom"),l=e&&(n||r||s);return(0,_l.jsx)(i.Suspense,{fallback:(0,_l.jsx)(rh,{}),children:(0,_l.jsxs)("div",{className:o("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[(0,_l.jsx)("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:(0,_l.jsx)("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),l?(0,_l.jsx)("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:(0,_l.jsxs)("div",{className:o("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[n?(0,_l.jsx)(hh,{chart:T,config:null==c?void 0:c.config}):null,r?(0,_l.jsx)(eh,{code:T}):null,s?(0,_l.jsx)(fh,{chart:T,config:null==c?void 0:c.config}):null]})}):null,(0,_l.jsx)("div",{className:o("rounded-md border border-border bg-background"),children:(0,_l.jsx)(xh,{chart:T,config:null==c?void 0:c.config,showControls:a})})]})})}let b=wh(u,"code"),k=Oh(u,"download"),v=Oh(u,"copy");return(0,_l.jsx)(Vp,{className:t,code:T,isIncomplete:p,language:f,startLine:_,children:b?(0,_l.jsxs)(_l.Fragment,{children:[k?(0,_l.jsx)(nh,{code:T,language:f}):null,v?(0,_l.jsx)(eh,{}):null]}):null})}),((e,t)=>e.className===t.className&&Sh(e.node,t.node)));tf.displayName="MarkdownCode";var nf=(0,i.memo)((({node:e,className:t,src:n,alt:r,onLoad:s,onError:a,...o})=>{let{DownloadIcon:l}=Kp(),c=Fp(),u=(0,i.useRef)(null),[d,p]=(0,i.useState)(!1),[h,f]=(0,i.useState)(!1),m=Xp(),g=null!=o.width||null!=o.height,E=(d||g)&&!h,y=h&&!g;(0,i.useEffect)((()=>{let e=u.current;if(null!=e&&e.complete){let t=e.naturalWidth>0;p(t),f(!t)}}),[]);let _=(0,i.useCallback)((e=>{p(!0),f(!1),null==s||s(e)}),[s]),T=(0,i.useCallback)((e=>{p(!1),f(!0),null==a||a(e)}),[a]);return n?(0,_l.jsxs)("div",{className:c("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[(0,_l.jsx)("img",{alt:r,className:c("max-w-full rounded-lg",y&&"hidden",t),"data-streamdown":"image",onError:T,onLoad:_,ref:u,src:n,...o}),y&&(0,_l.jsx)("span",{className:c("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:m.imageNotAvailable}),(0,_l.jsx)("div",{className:c("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),E&&(0,_l.jsx)("button",{className:c("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split("/").pop()||"",s=t.split(".").pop(),i=t.includes(".")&&void 0!==s&&s.length<=4,a="";if(i)a=t;else{let n=e.type,s="png";n.includes("jpeg")||n.includes("jpg")?s="jpg":n.includes("png")?s="png":n.includes("svg")?s="svg":n.includes("gif")?s="gif":n.includes("webp")&&(s="webp"),a=`${(r||t||"image").replace(sh,"")}.${s}`}Pp(a,e,e.type)}catch(e){window.open(n,"_blank")}},title:m.downloadImage,type:"button",children:(0,_l.jsx)(l,{size:14})})]}):null}),((e,t)=>e.className===t.className&&Sh(e.node,t.node)));nf.displayName="MarkdownImg";var rf=(0,i.memo)((({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter((e=>null!=e&&""!==e));if(1===r.length&&(0,i.isValidElement)(r[0])){let t=r[0].props.node,n=null==t?void 0:t.tagName;if("img"===n)return(0,_l.jsx)(_l.Fragment,{children:e});if("code"===n&&"data-block"in r[0].props)return(0,_l.jsx)(_l.Fragment,{children:e})}return(0,_l.jsx)("p",{...n,children:e})}),((e,t)=>Nh(e,t)));rf.displayName="MarkdownParagraph";var sf={ol:Dh,li:Lh,ul:Ph,hr:Mh,strong:Fh,a:zh,h1:Bh,h2:Uh,h3:Hh,h4:jh,h5:$h,h6:Zh,table:Gh,thead:Vh,tbody:Yh,tr:qh,th:Wh,td:Kh,blockquote:Qh,code:tf,img:nf,pre:({children:e})=>(0,i.isValidElement)(e)?(0,i.cloneElement)(e,{"data-block":"true"}):e,sup:Jh,sub:Xh,p:rf,section:ef},af=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,of=/\p{L}/u;function lf(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let e of t){if(af.test(e))return"rtl";if(of.test(e))return"ltr"}return"ltr"}var cf,uf,df,pf,hf=/^[ \t]{0,3}(`{3,}|~{3,})/,ff=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,mf=e=>{let t=e.split("\n"),n=null,r=0;for(let e of t){let t=hf.exec(e);if(null===n){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],s=e[0],i=e.length;s===n&&i>=r&&(n=null,r=0)}}return null!==n},gf=()=>e=>{f(e,"html",((e,t,n)=>{!n||"number"!=typeof t||(n.children[t]={type:"text",value:e.value})}))},Ef=[],yf={allowDangerousHtml:!0},_f=new WeakMap,Tf=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,s=e.remarkRehypeOptions;if(!(n||r||s)){let t="default";return this.keyCache.set(e,t),t}let i=e=>{if(!e||0===e.length)return"";let t="";for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=","),Array.isArray(r)){let[e,n]=r;if("function"==typeof e){let n=_f.get(e);n||(n=e.name,_f.set(e,n)),t+=n}else t+=String(e);t+=":",t+=JSON.stringify(n)}else if("function"==typeof r){let e=_f.get(r);e||(e=r.name,_f.set(r,e)),t+=e}else t+=String(r)}return t},a=i(n),o=`${i(r)}::${a}::${s?JSON.stringify(s):""}`;return this.keyCache.set(e,o),o}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},bf=e=>{let t=kf(e),n=e.children||"",r=t.runSync(t.parse(n),n);return xf(r,e)},kf=e=>{let t=Tf.get(e);if(t)return t;let n=vf(e);return Tf.set(e,n),n},vf=e=>{let t=e.rehypePlugins||Ef,n=e.remarkPlugins||Ef,r=(e=>e.some((e=>Array.isArray(e)?e[0]===Ir:e===Ir)))(t)?n:[...n,gf],s=e.remarkRehypeOptions?{...yf,...e.remarkRehypeOptions}:yf;return td().use(Eu).use(r).use(Pu,s).use(t)},Af=e=>e,xf=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:s,skipHtml:i,unwrapDisallowed:a,urlTransform:o}=t;if(n||r||s||i||o){let t=o||Af;f(e,((e,o,l)=>"raw"===e.type&&l&&"number"==typeof o?(((e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}})(l,o,i,e.value),o):"element"===e.type&&(((e,t)=>{var n;for(let r in Wl)if(Object.hasOwn(Wl,r)&&Object.hasOwn(e.properties,r)){let s=e.properties[r],i=Wl[r];(null===i||i.includes(e.tagName))&&(e.properties[r]=null!=(n=t(String(s||""),r,e))?n:void 0)}})(e,t),((e,t,n,r,s,i)=>{let a=!1;return r?a=!r.includes(e.tagName):s&&(a=s.includes(e.tagName)),!a&&i&&"number"==typeof t&&(a=!i(e,t,n)),a})(e,o,l,r,s,n)&&l&&"number"==typeof o)?(a&&e.children?l.children.splice(o,1,...e.children):l.children.splice(o,1),o):void 0))}return function(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return function(n,r,s,i){const a=Array.isArray(s.children),o=lr(n);return t(r,s,i,a,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");s=t.jsx,i=t.jsxs,r=function(e,t,n,r){const a=Array.isArray(n.children)?i:s;return r?a(t,n,r):a(t,n)}}var s,i;const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?se:re,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},o=Ul(a,e,void 0);return o&&"string"!=typeof o?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}(e,{Fragment:_l.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:_l.jsx,jsxs:_l.jsxs,passKeys:!0,passNode:!0})},If=/\[\^[\w-]{1,200}\](?!:)/,Sf=/\[\^[\w-]{1,200}\]:/,Nf=/<(\w+)[\s>]/,wf=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Cf=new Map,Of=new Map,Rf=(e,t)=>{if(wf.has(t.toLowerCase()))return 0;let n=e.match((e=>{let t=e.toLowerCase(),n=Cf.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return Cf.set(t,r),r})(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith("/>")||(r+=1);return r},Df=(e,t)=>{let n=e.match((e=>{let t=e.toLowerCase(),n=Of.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return Of.set(t,r),r})(t));return n?n.length:0},Lf=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)"$"===e[n]&&"$"===e[n+1]&&(t+=1,n+=1);return t},Pf=e=>{let t=If.test(e),n=Sf.test(e);if(t||n)return[e];let r=Ep.lex(e,{gfm:!0}),s=[],i=[],a=!1;for(let e of r){let t=e.raw,n=s.length;if(i.length>0){s[n-1]+=t;let e=i.at(-1),r=Rf(t,e),a=Df(t,e);for(let t=0;t<r;t+=1)i.push(e);for(let t=0;t<a;t+=1)i.length>0&&i.at(-1)===e&&i.pop()}else{if("html"===e.type&&e.block){let e=t.match(Nf);if(e){let n=e[1];Rf(t,n)>Df(t,n)&&i.push(n)}}if(n>0&&!a){let e=s[n-1];if(Lf(e)%2==1){s[n-1]=e+t;continue}}s.push(t),"space"!==e.type&&(a="code"===e.type)}}return s},Mf=/([\\`*_~[\]|])/g,Ff=e=>e.replace(Mf,"\\$1"),zf=e=>"text"===e.type?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(zf).join(""):"",Bf=e=>t=>{if(!e||0===e.length)return;let n=new Set(e.map((e=>e.toLowerCase())));f(t,"element",(e=>{if(n.has(e.tagName.toLowerCase())){let t=zf(e);e.children=t?[{type:"text",value:t}]:[]}}))},Uf=/^[ \t]*<[\w!/?-]/,Hf=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,jf={...Nr,protocols:{...Nr.protocols,href:[...null!=(uf=null==(cf=Nr.protocols)?void 0:cf.href)?uf:[],"tel"]},attributes:{...Nr.attributes,code:[...null!=(pf=null==(df=Nr.attributes)?void 0:df.code)?pf:[],"metastring"]}},$f={raw:Ir,sanitize:[Mr,jf],harden:[function({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:s=[],blockedImageClass:i="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:a="text-gray-500",linkBlockPolicy:o="indicator",imageBlockPolicy:l="indicator"}){const c=t.length&&!t.every((e=>"*"===e)),d=n.length&&!n.every((e=>"*"===e));if(!e&&(c||d))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return c=>{const d=((e,t,n,r,s,i,a,o,l)=>{const c=(d,h,E)=>{if("element"!==d.type||d[k])return u;if("a"===d.tagName){const n=T(d.properties.href,t,e,!1,!1,s);if(null===n){if(d[k]=!0,f(d,c),E&&"number"==typeof h){const e=function(e,t,n){return t===g?{type:"remove"}:t===m?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}(d,o,a);if("remove"===e.type)return E.children.splice(h,1),[p,h];E.children[h]=e.element}return p}return d.properties.href=n,d.properties.target="_blank",d.properties.rel="noopener noreferrer",u}if("img"===d.tagName){const t=T(d.properties.src,n,e,r,!0,s);if(null===t){if(d[k]=!0,f(d,c),E&&"number"==typeof h){const e=function(e,t,n){if(t===g)return{type:"remove"};if(t===m){const t=String(e.properties.alt||"");return t?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:t}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}(d,l,i);if("remove"===e.type)return E.children.splice(h,1),[p,h];E.children[h]=e.element}return p}return d.properties.src=t,u}return u};return c})(e,t,n,r,s,i,a,o,l);b(c),f(c,d)}},{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},Zf={gfm:[function(e){const t=e||Xi,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return mi([{text:Ii},{document:{91:{name:"gfmFootnoteDefinition",tokenize:Bi,continuation:{tokenize:Ui},exit:Hi}},text:{91:{name:"gfmFootnoteCall",tokenize:zi},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Mi,resolveTo:Fi}}},$i(e),{flow:{null:{name:"table",tokenize:Vi,resolveAll:Yi}}},{text:{91:Qi}}])}(t)),s.push([{transforms:[os],enter:{literalAutolink:ts,literalAutolinkEmail:ns,literalAutolinkHttp:ns,literalAutolinkWww:ns},exit:{literalAutolink:as,literalAutolinkEmail:is,literalAutolinkHttp:rs,literalAutolinkWww:ss}},{enter:{gfmFootnoteCallString:ps,gfmFootnoteCall:hs,gfmFootnoteDefinitionLabelString:fs,gfmFootnoteDefinition:ms},exit:{gfmFootnoteCallString:gs,gfmFootnoteCall:Es,gfmFootnoteDefinitionLabelString:ys,gfmFootnoteDefinition:_s}},{canContainEols:["delete"],enter:{strikethrough:xs},exit:{strikethrough:Is}},{enter:{table:ti,tableData:ii,tableHeader:ii,tableRow:ri},exit:{codeText:ai,table:ni,tableData:si,tableHeader:si,tableRow:si}},{exit:{taskListCheckValueChecked:ci,taskListCheckValueUnchecked:ci,paragraph:ui}}]),i.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Xr,notInConstruct:es},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Xr,notInConstruct:es},{character:":",before:"[ps]",after:"\\/",inConstruct:Xr,notInConstruct:es}]},bs(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:As}],handlers:{delete:Ss}},li(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:di}}]}}(t))},{}],codeMeta:()=>e=>{f(e,"code",(e=>{var t,n;e.meta&&(e.data=null!=(t=e.data)?t:{},e.data.hProperties={...null!=(n=e.data.hProperties)?n:{},metastring:e.meta})}))}},Gf=Object.values($f),Vf=Object.values(Zf),Yf={block:" ▋",circle:" ●"},qf=(0,i.createContext)({shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}}),Wf=(0,i.memo)((({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:s,dir:i,animatePlugin:a,...o})=>{if(a){let e=a.getLastRenderCharCount();a.setPrevContentLength(e)}let l="string"==typeof e&&n?(e=>"string"==typeof e&&0!==e.length&&Uf.test(e)?e.replace(Hf,"$1"):e)(e):e,c=(0,_l.jsx)(bf,{...o,children:l});return(0,_l.jsx)(Dp.Provider,{value:s,children:i?(0,_l.jsx)("div",{dir:i,style:{display:"contents"},children:c}):c})}),((e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some((n=>{var r,s;return(null==(r=e.components)?void 0:r[n])!==(null==(s=t.components)?void 0:s[n])})))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)}));Wf.displayName="Block";var Kf=["github-light","github-dark"],Qf=(0,i.memo)((({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:s=!1,components:a,rehypePlugins:o=Gf,remarkPlugins:l=Vf,className:c,shikiTheme:u=Kf,mermaid:d,controls:p=!0,isAnimating:h=!1,animated:f,BlockComponent:m=Wf,parseMarkdownIntoBlocksFn:g=Pf,caret:E,plugins:y,remend:_,linkSafety:T={enabled:!0},allowedTags:b,literalTagContent:k,translations:v,icons:A,prefix:x,onAnimationStart:I,onAnimationEnd:S,...N})=>{let w=(0,i.useId)(),[C,O]=(0,i.useTransition)(),R=(0,i.useMemo)((()=>(e=>e?(...t)=>((e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map((t=>t.startsWith(n)?t:`${e}:${t}`)).join(" ")})(e,yl(Xa(t))):Lp)(x)),[x]),D=(0,i.useRef)(null),L=(0,i.useRef)(I),P=(0,i.useRef)(S);L.current=I,P.current=S,(0,i.useEffect)((()=>{var e,n,r;if("static"===t)return;let s=D.current;D.current=h,null!==s?h&&!s?null==(n=L.current)||n.call(L):!h&&s&&(null==(r=P.current)||r.call(P)):h&&(null==(e=L.current)||e.call(L))}),[h,t]);let M=(0,i.useMemo)((()=>b?Object.keys(b):[]),[b]),F=(0,i.useMemo)((()=>{if("string"!=typeof e)return"";let n="streaming"===t&&r?Qa(e,_):e;return k&&k.length>0&&(n=((e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=new RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,"gi");n=n.replace(t,((e,t,n,r)=>t+Ff(n)+r))}return n})(n,k)),M.length>0&&(n=((e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=new RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,"gi");n=n.replace(t,((e,t,n,r)=>t+n.replace(/\n\n/g,"\n\x3c!----\x3e\n")+r))}return n})(n,M)),n}),[e,t,r,_,M,k]),z=(0,i.useMemo)((()=>g(F)),[F,g]),[B,U]=(0,i.useState)(z);(0,i.useEffect)((()=>{"streaming"!==t||G?U(z):O((()=>{U(z)}))}),[z,t]);let H="streaming"===t?B:z,j=(0,i.useMemo)((()=>"auto"===n?H.map(lf):void 0),[H,n]),$=(0,i.useMemo)((()=>H.map(((e,t)=>`${w}-${t}`))),[H.length,w]),Z=(0,i.useMemo)((()=>!0===f?"true":f?JSON.stringify(f):""),[f]),G=(0,i.useMemo)((()=>Z?"true"===Z?Rp():Rp(f):null),[Z]),V=(0,i.useMemo)((()=>{var e,n;return{shikiTheme:null!=(n=null==(e=null==y?void 0:y.code)?void 0:e.getThemes())?n:u,controls:p,isAnimating:h,mode:t,mermaid:d,linkSafety:T}}),[u,p,h,t,d,T,null==y?void 0:y.code]),Y=(0,i.useMemo)((()=>v?JSON.stringify(v):""),[v]),q=(0,i.useMemo)((()=>({...Qp,...v})),[Y]),W=(0,i.useMemo)((()=>{let{inlineCode:e,...t}=null!=a?a:{},n={...sf,...t};if(e){let t=n.code;n.code=n=>"data-block"in n?t?(0,i.createElement)(t,n):null:(0,i.createElement)(e,n)}return n}),[a]),K=(0,i.useMemo)((()=>{let e=[];return null!=y&&y.cjk&&(e=[...e,...y.cjk.remarkPluginsBefore]),e=[...e,...l],null!=y&&y.cjk&&(e=[...e,...y.cjk.remarkPluginsAfter]),null!=y&&y.math&&(e=[...e,y.math.remarkPlugin]),e}),[l,null==y?void 0:y.math,null==y?void 0:y.cjk]),Q=(0,i.useMemo)((()=>{var e;let t=o;if(b&&Object.keys(b).length>0&&o===Gf){let n={...jf,tagNames:[...null!=(e=jf.tagNames)?e:[],...Object.keys(b)],attributes:{...jf.attributes,...b}};t=[$f.raw,[Mr,n],$f.harden]}return k&&k.length>0&&(t=[...t,[Bf,k]]),null!=y&&y.math&&(t=[...t,y.math.rehypePlugin]),G&&h&&(t=[...t,G.rehypePlugin]),t}),[o,null==y?void 0:y.math,G,h,b,k]),J=(0,i.useMemo)((()=>{if(!h||0===H.length)return!1;let e=H.at(-1);return mf(e)||(e=>{let t=e.split("\n");for(let e of t){let t=e.trim();if(t.length>0&&t.includes("|")&&ff.test(t))return!0}return!1})(e)}),[h,H]),X=(0,i.useMemo)((()=>E&&h&&!J?{"--streamdown-caret":`"${Yf[E]}"`}:void 0),[E,h,J]);return"static"===t?(0,_l.jsx)(Jp.Provider,{value:q,children:(0,_l.jsx)(ch.Provider,{value:null!=y?y:null,children:(0,_l.jsx)(qf.Provider,{value:V,children:(0,_l.jsx)(Wp,{icons:A,children:(0,_l.jsx)(Mp.Provider,{value:R,children:(0,_l.jsx)("div",{className:R("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",c),dir:"auto"===n?lf(F):n,children:(0,_l.jsx)(bf,{components:W,rehypePlugins:Q,remarkPlugins:K,...N,children:F})})})})})})}):(0,_l.jsx)(Jp.Provider,{value:q,children:(0,_l.jsx)(ch.Provider,{value:null!=y?y:null,children:(0,_l.jsx)(qf.Provider,{value:V,children:(0,_l.jsx)(Wp,{icons:A,children:(0,_l.jsx)(Mp.Provider,{value:R,children:(0,_l.jsxs)("div",{className:R("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",E&&!J?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,c),style:X,children:[0===H.length&&E&&h&&(0,_l.jsx)("span",{}),H.map(((e,t)=>{var i;let a=t===H.length-1,o=h&&a&&mf(e);return(0,_l.jsx)(m,{animatePlugin:G,components:W,content:e,dir:null!=(i=null==j?void 0:j[t])?i:"auto"!==n?n:void 0,index:t,isIncomplete:o,rehypePlugins:Q,remarkPlugins:K,shouldNormalizeHtmlIndentation:s,shouldParseIncompleteMarkdown:r,...N},$[t])}))]})})})})})})}),((e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir));Qf.displayName="Streamdown";var Jf=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:s=.1,showControls:a=!0,initialZoom:o=1,fullscreen:l=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:u,ZoomOutIcon:d}=Kp(),p=Fp(),h=(0,i.useRef)(null),f=(0,i.useRef)(null),[m,g]=(0,i.useState)(o),[E,y]=(0,i.useState)({x:0,y:0}),[_,T]=(0,i.useState)(!1),[b,k]=(0,i.useState)({x:0,y:0}),[v,A]=(0,i.useState)({x:0,y:0}),x=(0,i.useCallback)((e=>{g((t=>Math.max(n,Math.min(r,t+e))))}),[n,r]),I=(0,i.useCallback)((()=>{x(s)}),[x,s]),S=(0,i.useCallback)((()=>{x(-s)}),[x,s]),N=(0,i.useCallback)((()=>{g(o),y({x:0,y:0})}),[o]),w=(0,i.useCallback)((e=>{e.preventDefault();let t=e.deltaY>0?-s:s;x(t)}),[x,s]),C=(0,i.useCallback)((e=>{if(0!==e.button||!1===e.isPrimary)return;T(!0),k({x:e.clientX,y:e.clientY}),A(E);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)}),[E]),O=(0,i.useCallback)((e=>{if(!_)return;e.preventDefault();let t=e.clientX-b.x,n=e.clientY-b.y;y({x:v.x+t,y:v.y+n})}),[_,b,v]),R=(0,i.useCallback)((e=>{T(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)}),[]);return(0,i.useEffect)((()=>{let e=h.current;if(e)return e.addEventListener("wheel",w,{passive:!1}),()=>{e.removeEventListener("wheel",w)}}),[w]),(0,i.useEffect)((()=>{let e=f.current;if(e&&_)return document.body.style.userSelect="none",e.addEventListener("pointermove",O,{passive:!1}),e.addEventListener("pointerup",R),e.addEventListener("pointercancel",R),()=>{document.body.style.userSelect="",e.removeEventListener("pointermove",O),e.removeEventListener("pointerup",R),e.removeEventListener("pointercancel",R)}}),[_,O,R]),(0,_l.jsxs)("div",{className:p("relative flex flex-col",l?"h-full w-full":"min-h-28 w-full",t),ref:h,style:{cursor:_?"grabbing":"grab"},children:[a?(0,_l.jsxs)("div",{className:p("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",l?"bottom-4 left-4":"bottom-2 left-2"),children:[(0,_l.jsx)("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:m>=r,onClick:I,title:"Zoom in",type:"button",children:(0,_l.jsx)(u,{size:16})}),(0,_l.jsx)("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:m<=n,onClick:S,title:"Zoom out",type:"button",children:(0,_l.jsx)(d,{size:16})}),(0,_l.jsx)("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:N,title:"Reset zoom and pan",type:"button",children:(0,_l.jsx)(c,{size:16})})]}):null,(0,_l.jsx)("div",{className:p("flex-1 origin-center transition-transform duration-150 ease-out",l?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:C,ref:f,role:"application",style:{transform:`translate(${E.x}px, ${E.y}px) scale(${m})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},Xf=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:s=!0})=>{let a=Fp(),[o,l]=(0,i.useState)(null),[c,u]=(0,i.useState)(!1),[d,p]=(0,i.useState)(""),[h,f]=(0,i.useState)(""),[m,g]=(0,i.useState)(0),{mermaid:E}=(0,i.useContext)(qf),y=ph(),_=null==E?void 0:E.errorComponent,{shouldRender:T,containerRef:b}=Sp({immediate:r});if((0,i.useEffect)((()=>{T&&(y?(async()=>{try{l(null),u(!0);let t=y.getMermaid(n),r=e.split("").reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)|0),0),s=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:i}=await t.render(s,e);p(i),f(i)}catch(e){if(!h&&!d){let t=e instanceof Error?e.message:"Failed to render Mermaid chart";l(t)}}finally{u(!1)}})():l("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering."))}),[e,n,m,T,y]),!(T||d||h))return(0,_l.jsx)("div",{className:a("my-4 min-h-[200px]",t),ref:b});if(c&&!d&&!h)return(0,_l.jsx)("div",{className:a("my-4 flex justify-center p-4",t),ref:b,children:(0,_l.jsxs)("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[(0,_l.jsx)("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),(0,_l.jsx)("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(o&&!d&&!h){let n=()=>g((e=>e+1));return _?(0,_l.jsx)("div",{ref:b,children:(0,_l.jsx)(_,{chart:e,error:o,retry:n})}):(0,_l.jsxs)("div",{className:a("rounded-md bg-red-50 p-4",t),ref:b,children:[(0,_l.jsxs)("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),(0,_l.jsxs)("details",{className:a("mt-2"),children:[(0,_l.jsx)("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),(0,_l.jsx)("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let k=d||h;return(0,_l.jsx)("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:b,children:(0,_l.jsx)(Jf,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:s,zoomStep:.1,children:(0,_l.jsx)("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:k},role:"img"})})})}},4123:(e,t,n)=>{"use strict";n.d(t,{qI:()=>r.C});var r=n(7989)}}]);
|