import{e as br,g as Pt,j as W,r as Te,h as wr,L as Sr,E as Er,B as Cr,R as Ir,k as Tr,t as en}from"./index-BNRf8j5s.js";/** * @license lucide-react v0.553.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ar=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Pr=br("file-text",Ar);function zr(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Lr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nr={};function qn(e,n){return(Nr.jsx?vr:Lr).test(e)}const Dr=/[ \t\n\f\r]/g;function _r(e){return typeof e=="object"?e.type==="text"?$n(e.value):!1:$n(e)}function $n(e){return e.replace(Dr,"")===""}class Ue{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Ue.prototype.normal={};Ue.prototype.property={};Ue.prototype.space=void 0;function zt(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Ue(t,r,n)}function dn(e){return e.toLowerCase()}class Z{constructor(n,t){this.attribute=t,this.property=n}}Z.prototype.attribute="";Z.prototype.booleanish=!1;Z.prototype.boolean=!1;Z.prototype.commaOrSpaceSeparated=!1;Z.prototype.commaSeparated=!1;Z.prototype.defined=!1;Z.prototype.mustUseProperty=!1;Z.prototype.number=!1;Z.prototype.overloadedBoolean=!1;Z.prototype.property="";Z.prototype.spaceSeparated=!1;Z.prototype.space=void 0;let Rr=0;const v=Se(),Y=Se(),gn=Se(),x=Se(),H=Se(),we=Se(),ne=Se();function Se(){return 2**++Rr}const yn=Object.freeze(Object.defineProperty({__proto__:null,boolean:v,booleanish:Y,commaOrSpaceSeparated:ne,commaSeparated:we,number:x,overloadedBoolean:gn,spaceSeparated:H},Symbol.toStringTag,{value:"Module"})),nn=Object.keys(yn);class In extends Z{constructor(n,t,r,i){let l=-1;if(super(n,t),Wn(this,"space",i),typeof r=="number")for(;++l4&&t.slice(0,4)==="data"&&jr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Yn,Vr);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Yn.test(l)){let o=l.replace(Br,Ur);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=In}return new i(r,n)}function Ur(e){return"-"+e.toLowerCase()}function Vr(e){return e.charAt(1).toUpperCase()}const qr=zt([Lt,Or,Dt,_t,Rt],"html"),Tn=zt([Lt,Fr,Dt,_t,Rt],"svg");function $r(e){return e.join(" ").trim()}var Ae={},tn,Xn;function Wr(){if(Xn)return tn;Xn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,c=` `,u="/",s="*",p="",d="comment",f="declaration";function w(I,k){if(typeof I!="string")throw new TypeError("First argument must be a string");if(!I)return[];k=k||{};var L=1,C=1;function B(P){var S=P.match(n);S&&(L+=S.length);var M=P.lastIndexOf(c);C=~M?P.length-M:C+P.length}function U(){var P={line:L,column:C};return function(S){return S.position=new y(P),O(),S}}function y(P){this.start=P,this.end={line:L,column:C},this.source=k.source}y.prototype.content=I;function _(P){var S=new Error(k.source+":"+L+":"+C+": "+P);if(S.reason=P,S.filename=k.source,S.line=L,S.column=C,S.source=I,!k.silent)throw S}function V(P){var S=P.exec(I);if(S){var M=S[0];return B(M),I=I.slice(M.length),S}}function O(){V(t)}function F(P){var S;for(P=P||[];S=A();)S!==!1&&P.push(S);return P}function A(){var P=U();if(!(u!=I.charAt(0)||s!=I.charAt(1))){for(var S=2;p!=I.charAt(S)&&(s!=I.charAt(S)||u!=I.charAt(S+1));)++S;if(S+=2,p===I.charAt(S-1))return _("End of comment missing");var M=I.slice(2,S-2);return C+=2,B(M),I=I.slice(S),C+=2,P({type:d,comment:M})}}function T(){var P=U(),S=V(r);if(S){if(A(),!V(i))return _("property missing ':'");var M=V(l),X=P({type:f,property:E(S[0].replace(e,p)),value:M?E(M[0].replace(e,p)):p});return V(o),X}}function q(){var P=[];F(P);for(var S;S=T();)S!==!1&&(P.push(S),F(P));return P}return O(),q()}function E(I){return I?I.replace(a,p):p}return tn=w,tn}var Qn;function Yr(){if(Qn)return Ae;Qn=1;var e=Ae&&Ae.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.default=t;const n=e(Wr());function t(r,i){let l=null;if(!r||typeof r!="string")return l;const o=(0,n.default)(r),a=typeof i=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:s}=c;a?i(u,s,c):s&&(l=l||{},l[u]=s)}),l}return Ae}var _e={},Kn;function Xr(){if(Kn)return _e;Kn=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(u){return!u||t.test(u)||e.test(u)},o=function(u,s){return s.toUpperCase()},a=function(u,s){return"".concat(s,"-")},c=function(u,s){return s===void 0&&(s={}),l(u)?u:(u=u.toLowerCase(),s.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(n,o))};return _e.camelCase=c,_e}var Re,Gn;function Qr(){if(Gn)return Re;Gn=1;var e=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Yr()),t=Xr();function r(i,l){var o={};return!i||typeof i!="string"||(0,n.default)(i,function(a,c){a&&c&&(o[(0,t.camelCase)(a,l)]=c)}),o}return r.default=r,Re=r,Re}var Kr=Qr();const Gr=Pt(Kr),Ot=Ft("end"),An=Ft("start");function Ft(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Jr(e){const n=An(e),t=Ot(e);if(n&&t)return{start:n,end:t}}function Me(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jn(e.position):"start"in e||"end"in e?Jn(e):"line"in e||"column"in e?xn(e):""}function xn(e){return Zn(e&&e.line)+":"+Zn(e&&e.column)}function Jn(e){return xn(e&&e.start)+"-"+xn(e&&e.end)}function Zn(e){return e&&typeof e=="number"?e:1}class K extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Me(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const Pn={}.hasOwnProperty,Zr=new Map,ei=/[A-Z]/g,ni=new Set(["table","tbody","thead","tfoot","tr"]),ti=new Set(["td","th"]),Mt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ri(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=pi(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=ci(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Tn:qr,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Bt(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Bt(e,n,t){if(n.type==="element")return ii(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return li(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return ai(e,n,t);if(n.type==="mdxjsEsm")return oi(e,n);if(n.type==="root")return ui(e,n,t);if(n.type==="text")return si(e,n)}function ii(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Tn,e.schema=i),e.ancestors.push(n);const l=Ht(e,n.tagName,!1),o=fi(e,n);let a=Ln(e,n);return ni.has(n.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!_r(c):!0})),jt(e,o,l,n),zn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function li(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}He(e,n.position)}function oi(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);He(e,n.position)}function ai(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Tn,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:Ht(e,n.name,!0),o=hi(e,n),a=Ln(e,n);return jt(e,o,l,n),zn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function ui(e,n,t){const r={};return zn(r,Ln(e,n)),e.create(n,e.Fragment,r,t)}function si(e,n){return n.value}function jt(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function zn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function ci(e,n,t){return r;function r(i,l,o,a){const u=Array.isArray(o.children)?t:n;return a?u(l,o,a):u(l,o)}}function pi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),c=An(r);return n(i,l,o,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function fi(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Pn.call(n.properties,i)){const l=mi(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&ti.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function hi(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else He(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else He(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function Ln(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Zr;for(;++ri?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l0?(ce(e,e.length,0,n),e):n}const tt={}.hasOwnProperty;function Si(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Pe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const se=ye(/[A-Za-z]/),te=ye(/[\dA-Za-z]/),Ii=ye(/[#-'*+\--9=?A-Z^-~]/);function kn(e){return e!==null&&(e<32||e===127)}const bn=ye(/\d/),Ti=ye(/[\dA-Fa-f]/),Ai=ye(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}const Pi=ye(new RegExp("\\p{P}|\\p{S}","u")),zi=ye(/\s/);function ye(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Le(e){const n=[];let t=-1,r=0,i=0;for(;++t55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function $(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(c){return R(c)?(e.enter(t),a(c)):n(c)}function a(c){return R(c)&&l++o))return;const _=n.events.length;let V=_,O,F;for(;V--;)if(n.events[V][0]==="exit"&&n.events[V][1].type==="chunkFlow"){if(O){F=n.events[V][1].end;break}O=!0}for(k(r),y=_;yC;){const U=t[B];n.containerState=U[1],U[0].exit.call(n,e)}t.length=C}function L(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function _i(e,n,t){return $(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function it(e){if(e===null||J(e)||zi(e))return 1;if(Pi(e))return 2}function Nn(e,n,t){const r=[];let i=-1;for(;++i1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const p={...e[r][1].end},d={...e[t][1].start};lt(p,-c),lt(d,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=re(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=re(u,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),u=re(u,Nn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=re(u,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(s=2,u=re(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):s=0,ce(e,r-1,t-r+3,u),t=r+u.length-s-2;break}}for(t=-1;++t0&&R(y)?$(e,L,"linePrefix",l+1)(y):L(y)}function L(y){return y===null||z(y)?e.check(ot,E,B)(y):(e.enter("codeFlowValue"),C(y))}function C(y){return y===null||z(y)?(e.exit("codeFlowValue"),L(y)):(e.consume(y),C)}function B(y){return e.exit("codeFenced"),n(y)}function U(y,_,V){let O=0;return F;function F(S){return y.enter("lineEnding"),y.consume(S),y.exit("lineEnding"),A}function A(S){return y.enter("codeFencedFence"),R(S)?$(y,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):T(S)}function T(S){return S===a?(y.enter("codeFencedFenceSequence"),q(S)):V(S)}function q(S){return S===a?(O++,y.consume(S),q):O>=o?(y.exit("codeFencedFenceSequence"),R(S)?$(y,P,"whitespace")(S):P(S)):V(S)}function P(S){return S===null||z(S)?(y.exit("codeFencedFence"),_(S)):V(S)}}}function Wi(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const ln={name:"codeIndented",tokenize:Xi},Yi={partial:!0,tokenize:Qi};function Xi(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),$(e,l,"linePrefix",5)(u)}function l(u){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?o(u):t(u)}function o(u){return u===null?c(u):z(u)?e.attempt(Yi,o,c)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function c(u){return e.exit("codeIndented"),n(u)}}function Qi(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):$(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):z(o)?i(o):t(o)}}const Ki={name:"codeText",previous:Ji,resolve:Gi,tokenize:Zi};function Gi(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Oe(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Oe(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Oe(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function Xt(e,n,t,r,i,l,o,a,c){const u=c||Number.POSITIVE_INFINITY;let s=0;return p;function p(k){return k===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(k),e.exit(l),d):k===null||k===32||k===41||kn(k)?t(k):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),E(k))}function d(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===62?(e.exit("chunkString"),e.exit(a),d(k)):k===null||k===60||z(k)?t(k):(e.consume(k),k===92?w:f)}function w(k){return k===60||k===62||k===92?(e.consume(k),f):f(k)}function E(k){return!s&&(k===null||k===41||J(k))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(k)):s999||f===null||f===91||f===93&&!c||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(f):f===93?(e.exit(l),e.enter(i),e.consume(f),e.exit(i),e.exit(r),n):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),s(f)):(e.consume(f),c||(c=!R(f)),f===92?d:p)}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,p):p(f)}}function Kt(e,n,t,r,i,l){let o;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),o=d===40?41:d,c):t(d)}function c(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):(e.enter(l),u(d))}function u(d){return d===o?(e.exit(l),c(o)):d===null?t(d):z(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),$(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(d))}function s(d){return d===o||d===null||z(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?p:s)}function p(d){return d===o||d===92?(e.consume(d),s):s(d)}}function Be(e,n){let t;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):R(i)?$(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const al={name:"definition",tokenize:sl},ul={partial:!0,tokenize:cl};function sl(e,n,t){const r=this;let i;return l;function l(f){return e.enter("definition"),o(f)}function o(f){return Qt.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):t(f)}function c(f){return J(f)?Be(e,u)(f):u(f)}function u(f){return Xt(e,s,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function s(f){return e.attempt(ul,p,p)(f)}function p(f){return R(f)?$(e,d,"whitespace")(f):d(f)}function d(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),n(f)):t(f)}}function cl(e,n,t){return r;function r(a){return J(a)?Be(e,i)(a):t(a)}function i(a){return Kt(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return R(a)?$(e,o,"whitespace")(a):o(a)}function o(a){return a===null||z(a)?n(a):t(a)}}const pl={name:"hardBreakEscape",tokenize:fl};function fl(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return z(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const hl={name:"headingAtx",resolve:ml,tokenize:dl};function ml(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ce(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function dl(e,n,t){let r=0;return i;function i(s){return e.enter("atxHeading"),l(s)}function l(s){return e.enter("atxHeadingSequence"),o(s)}function o(s){return s===35&&r++<6?(e.consume(s),o):s===null||J(s)?(e.exit("atxHeadingSequence"),a(s)):t(s)}function a(s){return s===35?(e.enter("atxHeadingSequence"),c(s)):s===null||z(s)?(e.exit("atxHeading"),n(s)):R(s)?$(e,a,"whitespace")(s):(e.enter("atxHeadingText"),u(s))}function c(s){return s===35?(e.consume(s),c):(e.exit("atxHeadingSequence"),a(s))}function u(s){return s===null||s===35||J(s)?(e.exit("atxHeadingText"),a(s)):(e.consume(s),u)}}const gl=["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"],ut=["pre","script","style","textarea"],yl={concrete:!0,name:"htmlFlow",resolveTo:bl,tokenize:wl},xl={partial:!0,tokenize:El},kl={partial:!0,tokenize:Sl};function bl(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function wl(e,n,t){const r=this;let i,l,o,a,c;return u;function u(m){return s(m)}function s(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),p}function p(m){return m===33?(e.consume(m),d):m===47?(e.consume(m),l=!0,E):m===63?(e.consume(m),i=3,r.interrupt?n:h):se(m)?(e.consume(m),o=String.fromCharCode(m),I):t(m)}function d(m){return m===45?(e.consume(m),i=2,f):m===91?(e.consume(m),i=5,a=0,w):se(m)?(e.consume(m),i=4,r.interrupt?n:h):t(m)}function f(m){return m===45?(e.consume(m),r.interrupt?n:h):t(m)}function w(m){const oe="CDATA[";return m===oe.charCodeAt(a++)?(e.consume(m),a===oe.length?r.interrupt?n:T:w):t(m)}function E(m){return se(m)?(e.consume(m),o=String.fromCharCode(m),I):t(m)}function I(m){if(m===null||m===47||m===62||J(m)){const oe=m===47,xe=o.toLowerCase();return!oe&&!l&&ut.includes(xe)?(i=1,r.interrupt?n(m):T(m)):gl.includes(o.toLowerCase())?(i=6,oe?(e.consume(m),k):r.interrupt?n(m):T(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?L(m):C(m))}return m===45||te(m)?(e.consume(m),o+=String.fromCharCode(m),I):t(m)}function k(m){return m===62?(e.consume(m),r.interrupt?n:T):t(m)}function L(m){return R(m)?(e.consume(m),L):F(m)}function C(m){return m===47?(e.consume(m),F):m===58||m===95||se(m)?(e.consume(m),B):R(m)?(e.consume(m),C):F(m)}function B(m){return m===45||m===46||m===58||m===95||te(m)?(e.consume(m),B):U(m)}function U(m){return m===61?(e.consume(m),y):R(m)?(e.consume(m),U):C(m)}function y(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),c=m,_):R(m)?(e.consume(m),y):V(m)}function _(m){return m===c?(e.consume(m),c=null,O):m===null||z(m)?t(m):(e.consume(m),_)}function V(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||J(m)?U(m):(e.consume(m),V)}function O(m){return m===47||m===62||R(m)?C(m):t(m)}function F(m){return m===62?(e.consume(m),A):t(m)}function A(m){return m===null||z(m)?T(m):R(m)?(e.consume(m),A):t(m)}function T(m){return m===45&&i===2?(e.consume(m),M):m===60&&i===1?(e.consume(m),X):m===62&&i===4?(e.consume(m),le):m===63&&i===3?(e.consume(m),h):m===93&&i===5?(e.consume(m),pe):z(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xl,fe,q)(m)):m===null||z(m)?(e.exit("htmlFlowData"),q(m)):(e.consume(m),T)}function q(m){return e.check(kl,P,fe)(m)}function P(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),S}function S(m){return m===null||z(m)?q(m):(e.enter("htmlFlowData"),T(m))}function M(m){return m===45?(e.consume(m),h):T(m)}function X(m){return m===47?(e.consume(m),o="",ie):T(m)}function ie(m){if(m===62){const oe=o.toLowerCase();return ut.includes(oe)?(e.consume(m),le):T(m)}return se(m)&&o.length<8?(e.consume(m),o+=String.fromCharCode(m),ie):T(m)}function pe(m){return m===93?(e.consume(m),h):T(m)}function h(m){return m===62?(e.consume(m),le):m===45&&i===2?(e.consume(m),h):T(m)}function le(m){return m===null||z(m)?(e.exit("htmlFlowData"),fe(m)):(e.consume(m),le)}function fe(m){return e.exit("htmlFlow"),n(m)}}function Sl(e,n,t){const r=this;return i;function i(o){return z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function El(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ge,n,t)}}const Cl={name:"htmlText",tokenize:Il};function Il(e,n,t){const r=this;let i,l,o;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),c}function c(h){return h===33?(e.consume(h),u):h===47?(e.consume(h),U):h===63?(e.consume(h),C):se(h)?(e.consume(h),V):t(h)}function u(h){return h===45?(e.consume(h),s):h===91?(e.consume(h),l=0,w):se(h)?(e.consume(h),L):t(h)}function s(h){return h===45?(e.consume(h),f):t(h)}function p(h){return h===null?t(h):h===45?(e.consume(h),d):z(h)?(o=p,X(h)):(e.consume(h),p)}function d(h){return h===45?(e.consume(h),f):p(h)}function f(h){return h===62?M(h):h===45?d(h):p(h)}function w(h){const le="CDATA[";return h===le.charCodeAt(l++)?(e.consume(h),l===le.length?E:w):t(h)}function E(h){return h===null?t(h):h===93?(e.consume(h),I):z(h)?(o=E,X(h)):(e.consume(h),E)}function I(h){return h===93?(e.consume(h),k):E(h)}function k(h){return h===62?M(h):h===93?(e.consume(h),k):E(h)}function L(h){return h===null||h===62?M(h):z(h)?(o=L,X(h)):(e.consume(h),L)}function C(h){return h===null?t(h):h===63?(e.consume(h),B):z(h)?(o=C,X(h)):(e.consume(h),C)}function B(h){return h===62?M(h):C(h)}function U(h){return se(h)?(e.consume(h),y):t(h)}function y(h){return h===45||te(h)?(e.consume(h),y):_(h)}function _(h){return z(h)?(o=_,X(h)):R(h)?(e.consume(h),_):M(h)}function V(h){return h===45||te(h)?(e.consume(h),V):h===47||h===62||J(h)?O(h):t(h)}function O(h){return h===47?(e.consume(h),M):h===58||h===95||se(h)?(e.consume(h),F):z(h)?(o=O,X(h)):R(h)?(e.consume(h),O):M(h)}function F(h){return h===45||h===46||h===58||h===95||te(h)?(e.consume(h),F):A(h)}function A(h){return h===61?(e.consume(h),T):z(h)?(o=A,X(h)):R(h)?(e.consume(h),A):O(h)}function T(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(e.consume(h),i=h,q):z(h)?(o=T,X(h)):R(h)?(e.consume(h),T):(e.consume(h),P)}function q(h){return h===i?(e.consume(h),i=void 0,S):h===null?t(h):z(h)?(o=q,X(h)):(e.consume(h),q)}function P(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||J(h)?O(h):(e.consume(h),P)}function S(h){return h===47||h===62||J(h)?O(h):t(h)}function M(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),n):t(h)}function X(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ie}function ie(h){return R(h)?$(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):pe(h)}function pe(h){return e.enter("htmlTextData"),o(h)}}const Dn={name:"labelEnd",resolveAll:zl,resolveTo:Ll,tokenize:vl},Tl={tokenize:Nl},Al={tokenize:Dl},Pl={tokenize:_l};function zl(e){let n=-1;const t=[];for(;++n=3&&(u===null||z(u))?(e.exit("thematicBreak"),n(u)):t(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),R(u)?$(e,a,"whitespace")(u):a(u))}}const G={continuation:{tokenize:ql},exit:Wl,name:"list",tokenize:Vl},Hl={partial:!0,tokenize:Yl},Ul={partial:!0,tokenize:$l};function Vl(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(f){const w=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:bn(f)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Xe,t,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return t(f)}function c(f){return bn(f)&&++o<10?(e.consume(f),c):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):t(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Ge,r.interrupt?t:s,e.attempt(Hl,d,p))}function s(f){return r.containerState.initialBlankLine=!0,l++,d(f)}function p(f){return R(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),d):t(f)}function d(f){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(f)}}function ql(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ge,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!R(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ul,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,$(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function $l(e,n,t){const r=this;return $(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function Wl(e){e.exit(this.containerState.type)}function Yl(e,n,t){const r=this;return $(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!R(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const st={name:"setextUnderline",resolveTo:Xl,tokenize:Ql};function Xl(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function Ql(e,n,t){const r=this;let i;return l;function l(u){let s=r.events.length,p;for(;s--;)if(r.events[s][1].type!=="lineEnding"&&r.events[s][1].type!=="linePrefix"&&r.events[s][1].type!=="content"){p=r.events[s][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=u,o(u)):t(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),R(u)?$(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||z(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const Kl={tokenize:Gl};function Gl(e){const n=this,t=e.attempt(Ge,r,e.attempt(this.parser.constructs.flowInitial,i,$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(tl,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Jl={resolveAll:Jt()},Zl=Gt("string"),eo=Gt("text");function Gt(e){return{resolveAll:Jt(e==="text"?no:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(s){return u(s)?l(s):a(s)}function a(s){if(s===null){t.consume(s);return}return t.enter("data"),t.consume(s),c}function c(s){return u(s)?(t.exit("data"),l(s)):(t.consume(s),c)}function u(s){if(s===null)return!0;const p=i[s];let d=-1;if(p)for(;++d-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function mo(e,n){let t=-1;const r=[];let i;for(;++t0){const ae=N.tokenStack[N.tokenStack.length-1];(ae[1]||pt).call(N,void 0,ae[0])}for(b.position={start:ge(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:ge(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},j=-1;++j0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(l.data={meta:n.meta}),e.patch(n,l),l=e.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(n,l),l}function zo(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Lo(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function vo(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Le(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,a+=1,e.footnoteCounts.set(r,a);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,u),e.applyData(n,u)}function No(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Do(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function nr(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function _o(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return nr(e,n);const i={src:Le(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function Ro(e,n){const t={src:Le(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function Oo(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function Fo(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return nr(e,n);const i={href:Le(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function Mo(e,n){const t={href:Le(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Bo(e,n,t){const r=e.all(n),i=t?jo(t):tr(n),l={},o=[];if(typeof n.checked=="boolean"){const s=r[0];let p;s&&s.type==="element"&&s.tagName==="p"?p=s:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a1}function Ho(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=An(n.children[1]),c=Ot(n.children[n.children.length-1]);a&&c&&(o.position={start:a,end:c}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function Wo(e,n,t){const r=t?t.children:void 0,l=(r?r.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:n.children.length;let c=-1;const u=[];for(;++c0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(mt(n.slice(i),i>0,!1)),l.join("")}function mt(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===ft||l===ht;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===ft||l===ht;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Qo(e,n){const t={type:"text",value:Xo(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Ko(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Go={blockquote:To,break:Ao,code:Po,delete:zo,emphasis:Lo,footnoteReference:vo,heading:No,html:Do,imageReference:_o,image:Ro,inlineCode:Oo,linkReference:Fo,link:Mo,listItem:Bo,list:Ho,paragraph:Uo,root:Vo,strong:qo,table:$o,tableCell:Yo,tableRow:Wo,text:Qo,thematicBreak:Ko,toml:$e,yaml:$e,definition:$e,footnoteDefinition:$e};function $e(){}const rr=-1,Je=0,je=1,Qe=2,_n=3,Rn=4,On=5,Fn=6,ir=7,lr=8,{defineProperty:Jo}=Object,or=typeof self=="object"?self:globalThis,dt=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new or[e](n)},Zo=(e,n)=>{const t=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=n[i];switch(l){case Je:case rr:return t(o,i);case je:{const a=t([],i);for(const c of o)a.push(r(c));return a}case Qe:{const a=t({},i);for(const[c,u]of o){const s=r(c),p=r(u);s==="__proto__"?Jo(a,s,{value:p,configurable:!0,enumerable:!0,writable:!0}):a[s]=p}return a}case _n:return t(new Date(o),i);case Rn:{const{source:a,flags:c}=o;return t(new RegExp(a,c),i)}case On:{const a=t(new Map,i);for(const[c,u]of o)a.set(r(c),r(u));return a}case Fn:{const a=t(new Set,i);for(const c of o)a.add(r(c));return a}case ir:{const{name:a,message:c}=o;return t(typeof or[a]=="function"?dt(a,c):new Error(c),i)}case lr:return t(BigInt(o),i);case"BigInt":return t(Object(BigInt(o)),i);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return t(new DataView(a),o)}case"-0":return-0}return t(dt(l,o),i)};return r},gt=e=>Zo(new Map,e)(0),be="",{toString:ea}={},{keys:na,is:ta}=Object,Fe=e=>{const n=typeof e;if(n!=="object"||!e)return[Je,n];const t=ea.call(e).slice(8,-1);switch(t){case"Array":return[je,be];case"Object":return[Qe,be];case"Date":return[_n,be];case"RegExp":return[Rn,be];case"Map":return[On,be];case"Set":return[Fn,be];case"DataView":return[je,t]}return t.includes("Array")?[je,t]:e instanceof Error?[ir,e.name||"Error"]:[Qe,t]},We=([e,n])=>e===Je&&(n==="function"||n==="symbol"),ra=(e,n,t,r)=>{const i=(o,a)=>{const c=r.push(o)-1;return t.set(a,c),c},l=o=>{if(t.has(o))return t.get(o);let[a,c]=Fe(o);switch(a){case Je:{let s=o;switch(c){case"bigint":a=lr,s=o.toString();break;case"number":if(!o&&ta(o,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);s=null;break;case"undefined":return i([rr],o)}return i([a,s],o)}case je:{if(c){let d=o;return c==="DataView"?d=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(d=new Uint8Array(o)),i([c,[...d]],o)}const s=[],p=i([a,s],o);for(const d of o)s.push(l(d));return p}case Qe:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const s=[],p=i([a,s],o);for(const d of na(o))(e||!We(Fe(o[d])))&&s.push([l(d),l(o[d])]);return p}case _n:return i([a,isNaN(o.getTime())?be:o.toISOString()],o);case Rn:{const{source:s,flags:p}=o;return i([a,{source:s,flags:p}],o)}case On:{const s=[],p=i([a,s],o);for(const[d,f]of o)(e||!(We(Fe(d))||We(Fe(f))))&&s.push([l(d),l(f)]);return p}case Fn:{const s=[],p=i([a,s],o);for(const d of o)(e||!We(Fe(d)))&&s.push(l(d));return p}}const{message:u}=o;return i([a,{name:c,message:u}],o)};return l},yt=(e,{json:n,lossy:t}={})=>{const r=[];return ra(!(n||t),!!n,new Map,r)(e),r},Ke=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?gt(yt(e,n)):structuredClone(e):(e,n)=>gt(yt(e,n));function ia(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function la(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function oa(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||ia,r=e.options.footnoteBackLabel||la,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c0&&w.push({type:"text",value:" "});let L=typeof t=="string"?t:t(c,f);typeof L=="string"&&(L={type:"text",value:L}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+d+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(L)?L:[L]})}const I=s[s.length-1];if(I&&I.type==="element"&&I.tagName==="p"){const L=I.children[I.children.length-1];L&&L.type==="text"?L.value+=" ":I.children.push({type:"text",value:" "}),I.children.push(...w)}else s.push(...w);const k={type:"element",tagName:"li",properties:{id:n+"fn-"+d},children:e.wrap(s,!0)};e.patch(u,k),a.push(k)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Ke(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` `}]}}const ar=(function(e){if(e==null)return ca;if(typeof e=="function")return Ze(e);if(typeof e=="object")return Array.isArray(e)?aa(e):ua(e);if(typeof e=="string")return sa(e);throw new Error("Expected function, string, or object as test")});function aa(e){const n=[];let t=-1;for(;++t":""))+")"})}return d;function d(){let f=ur,w,E,I;if((!n||l(c,u,s[s.length-1]||void 0))&&(f=da(t(c,s)),f[0]===xt))return f;if("children"in c&&c.children){const k=c;if(k.children&&f[0]!==ha)for(E=(r?k.children.length:-1)+o,I=s.concat(k);E>-1&&E0&&t.push({type:"text",value:` `}),t}function kt(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function bt(e,n){const t=ya(e,n),r=t.one(e,void 0),i=oa(t),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:` `},i),l}function Sa(e,n){return e&&"run"in e?async function(t,r){const i=bt(t,{file:r,...n});await e.run(i,r)}:function(t,r){return bt(t,{file:r,...e||n})}}function wt(e){if(e)throw e}var an,St;function Ea(){if(St)return an;St=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},l=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var s=e.call(u,"constructor"),p=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!s&&!p)return!1;var d;for(d in u);return typeof d>"u"||e.call(u,d)},o=function(u,s){t&&s.name==="__proto__"?t(u,s.name,{enumerable:!0,configurable:!0,value:s.newValue,writable:!0}):u[s.name]=s.newValue},a=function(u,s){if(s==="__proto__")if(e.call(u,s)){if(r)return r(u,s).value}else return;return u[s]};return an=function c(){var u,s,p,d,f,w,E=arguments[0],I=1,k=arguments.length,L=!1;for(typeof E=="boolean"&&(L=E,E=arguments[1]||{},I=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});Io.length;let c;a&&o.push(i);try{c=e.apply(this,o)}catch(u){const s=u;if(a&&t)throw s;return i(s)}a||(c&&c.then&&typeof c.then=="function"?c.then(l,i):c instanceof Error?i(c):l(c))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}const ue={basename:Aa,dirname:Pa,extname:za,join:La,sep:"/"};function Aa(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ve(e);let t=0,r=-1,i=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else o<0&&(l=!0,o=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function Pa(e){if(Ve(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function za(e){Ve(e);let n=e.length,t=-1,r=0,i=-1,l=0,o;for(;n--;){const a=e.codePointAt(n);if(a===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),a===46?i<0?i=n:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||t<0||l===0||l===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function La(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Na(e,n){let t="",r=0,i=-1,l=0,o=-1,a,c;for(;++o<=e.length;){if(o2){if(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",r=0):(t=t.slice(0,c),r=t.length-1-t.lastIndexOf("/")),i=o,l=0;continue}}else if(t.length>0){t="",r=0,i=o,l=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,o):t=e.slice(i+1,o),r=o-i-1;i=o,l=0}else a===46&&l>-1?l++:l=-1}return t}function Ve(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Da={cwd:_a};function _a(){return"/"}function Cn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ra(e){if(typeof e=="string")e=new URL(e);else if(!Cn(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return Oa(e)}function Oa(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[f,...w]=s;const E=r[d][1];En(E)&&En(f)&&(f=un(!0,E,f)),r[d]=[u,f,...w]}}}}const ja=new Mn().freeze();function fn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mn(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ct(e){if(!En(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function It(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ye(e){return Ha(e)?e:new cr(e)}function Ha(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ua(e){return typeof e=="string"||Va(e)}function Va(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qa="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tt=[],At={allowDangerousHtml:!0},$a=/^(https?|ircs?|mailto|xmpp)$/i,Wa=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ya(e){const n=Xa(e),t=Qa(e);return Ka(n.runSync(n.parse(t),t),e)}function Xa(e){const n=e.rehypePlugins||Tt,t=e.remarkPlugins||Tt,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...At}:At;return ja().use(Io).use(t).use(Sa,r).use(n)}function Qa(e){const n=e.children||"",t=new cr;return typeof n=="string"&&(t.value=n),t}function Ka(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,c=n.urlTransform||Ga;for(const s of Wa)Object.hasOwn(n,s.from)&&(""+s.from+(s.to?"use `"+s.to+"` instead":"remove it")+qa+s.id,void 0);return sr(e,u),ri(e,{Fragment:W.Fragment,components:i,ignoreInvalidStyle:!0,jsx:W.jsx,jsxs:W.jsxs,passKeys:!0,passNode:!0});function u(s,p,d){if(s.type==="raw"&&d&&typeof p=="number")return o?d.children.splice(p,1):d.children[p]={type:"text",value:s.value},p;if(s.type==="element"){let f;for(f in rn)if(Object.hasOwn(rn,f)&&Object.hasOwn(s.properties,f)){const w=s.properties[f],E=rn[f];(E===null||E.includes(s.tagName))&&(s.properties[f]=c(String(w||""),f,s))}}if(s.type==="element"){let f=t?!t.includes(s.tagName):l?l.includes(s.tagName):!1;if(!f&&r&&typeof p=="number"&&(f=!r(s,p,d)),f&&d&&typeof p=="number")return a&&s.children?d.children.splice(p,1,...s.children):d.children.splice(p,1),p}}}function Ga(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||$a.test(e.slice(0,n))?e:""}function Za({deviceId:e,selectedDate:n}){const[t,r]=Te.useState(null),[i,l]=Te.useState(!1),[o,a]=Te.useState(null),c=Te.useCallback(async()=>{if(!t){l(!0),a(null);try{const u=await wr.getDailyReport(e,n);r(u)}catch(u){console.error("Error loading analysis:",u),a("خطا در دریافت تحلیل. لطفاً دوباره تلاش کنید.")}finally{l(!1)}}},[e,n,t]);return Te.useEffect(()=>{r(null),a(null)},[n]),Te.useEffect(()=>{c()},[c]),i?W.jsx(Sr,{message:"در حال دریافت تحلیل...",fullScreen:!1}):o?W.jsx(Er,{message:o,action:W.jsx(Cr,{onClick:()=>{r(null),c()},variant:"primary",icon:Ir,children:"تلاش مجدد"})}):t?W.jsxs("div",{className:"space-y-6",children:[W.jsx("div",{className:"bg-gradient-to-l from-indigo-50 to-purple-50 rounded-xl p-4 border border-indigo-100",children:W.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-center",children:[W.jsxs("div",{children:[W.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"تعداد رکوردها"}),W.jsx("p",{className:"text-lg font-bold text-gray-800",children:en(t.recordCount)})]}),W.jsxs("div",{children:[W.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"رکوردهای نمونه"}),W.jsx("p",{className:"text-lg font-bold text-gray-800",children:en(t.sampledRecordCount)})]}),W.jsxs("div",{children:[W.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"توکن‌های مصرفی"}),W.jsx("p",{className:"text-lg font-bold text-gray-800",children:en(t.totalTokens)})]}),W.jsxs("div",{children:[W.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"منبع"}),W.jsx("p",{className:"text-lg font-bold text-gray-800",children:t.fromCache?"💾 کش":"🆕 جدید"})]})]})}),W.jsx("div",{className:"bg-white rounded-xl shadow-md p-6 prose prose-sm max-w-none markdown-content",children:W.jsx(Ya,{children:t.analysis})})]}):W.jsx(Tr,{icon:Pr,title:"تحلیلی موجود نیست",message:"تحلیلی برای نمایش وجود ندارد"})}export{Za as AnalysisTab};