62 lines
95 KiB
JavaScript
62 lines
95 KiB
JavaScript
|
var Yt=Object.defineProperty;var en=(s,e,t)=>e in s?Yt(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var T=(s,e,t)=>en(s,typeof e!="symbol"?e+"":e,t);import{d as tn,r as j,b as nn,e as sn,f as rn,c as $,a as k,n as on,g as H,F as ln,h as an,i as Ae,w as cn,v as un,j as pn,k as We,t as Qe,l as Xe,m as Ke,p as hn,o as B}from"./index-CXb-FhKb.js";const fn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAG1BMVEUAAAD///8/Pz+/v78fHx9fX19/f3+fn5+Pj4/ctHcOAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAmklEQVRYhe3RQQrCMBCF4YdkkmsUvIIHmFXXRbR22YXZu8j9MVM0lmpp3Or7oIU/kDJJASIiIqK/5PKj8wVd9MJeJSb0Fy1t8ep30muL4EbcSudIpT8N5fUILw1G7Lr8yp0jWq/yeoW0ihNwDmrtFcPUFVvkgMotz8EQ4tQVg5XjJ+mst45vX31cslM01luXbL79lURERES/6w4ftR+JUiBWQgAAAABJRU5ErkJggg==";function bt(s,e){return function(){return s.apply(e,arguments)}}const{toString:dn}=Object.prototype,{getPrototypeOf:Ne}=Object,be=(s=>e=>{const t=dn.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),I=s=>(s=s.toLowerCase(),e=>be(e)===s),we=s=>e=>typeof e===s,{isArray:Q}=Array,re=we("undefined");function gn(s){return s!==null&&!re(s)&&s.constructor!==null&&!re(s.constructor)&&P(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const wt=I("ArrayBuffer");function mn(s){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&wt(s.buffer),e}const bn=we("string"),P=we("function"),kt=we("number"),ke=s=>s!==null&&typeof s=="object",wn=s=>s===!0||s===!1,ce=s=>{if(be(s)!=="object")return!1;const e=Ne(s);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},kn=I("Date"),Cn=I("File"),xn=I("Blob"),yn=I("FileList"),Sn=s=>ke(s)&&P(s.pipe),Rn=s=>{let e;return s&&(typeof FormData=="function"&&s instanceof FormData||P(s.append)&&((e=be(s))==="formdata"||e==="object"&&P(s.toString)&&s.toString()==="[object FormData]"))},An=I("URLSearchParams"),[En,Tn,_n,vn]=["ReadableStream","Request","Response","Headers"].map(I),Ln=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ie(s,e,{allOwnKeys:t=!1}={}){if(s===null||typeof s>"u")return;let n,r;if(typeof s!="object"&&(s=[s]),Q(s))for(n=0,r=s.length;n<r;n++)e.call(null,s[n],n,s);else{const i=t?Object.getOwnPropertyNames(s):Object.keys(s),o=i.length;let l;for(n=0;n<o;n++)l=i[n],e.call(null,s[l],l,s)}}function Ct(s,e){e=e.toLowerCase();const t=Object.keys(s);let n=t.length,r;for(;n-- >0;)if(r=t[n],e===r.toLowerCase())return r;return null}const J=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xt=s=>!re(s)&&s!==J;function ve(){const{caseless:s}=xt(this)&&this||{},e={},t=(n,r)=>{const i=s&&Ct(e,r)||r;ce(e[i])&&ce(n)?e[i]=ve(e[i],n):ce(n)?e[i]=ve({},n):Q(n)?e[i]=n.slice():e[i]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&ie(arguments[n],t);return e}const On=(s,e,t,{allOwnKeys:n}={})=>(ie(e,(r,i)=>{t&&P(r)?s[i]=bt(r,t):s[i]=r},{allOwnKeys:n}),s),Pn=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),$n=(s,e,t,n)=>{s.prototype=Object.create(e.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:e.prototype}),t&&Object.assign(s.prototype,t)},Bn=(s,e,t,n)=>{let r,i,o;const l={};if(e=e||{},s==null)return e;do{for(r=Object.getOwnPropertyNames(s),i=r.length;i-- >0;)o=r[i],(!n||n(o,s,e))&&!l[o]&&(e[o]=s[o],l[o]=!0);s=t!==!1&&Ne(s)}while(s&&(!t||t(s,e))&&s!==Object.prototype);return e},zn=(s,e,t)=>{s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=e.length;const n=s.indexOf(e,t);return n!==-1&&n===t},Nn=s=>{if(!s)return null;if(Q(s))return s;let e=s.length;if(!kt(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=s[e];return t},Dn=(s=>e=>s&&e instanceof s)(typeof Uint8Array<"u"&&Ne(Uint8Array)),In=(s,e)=>{const n=(s&&s[Symbol.iterator]).call(s);let r;for(;(r=n.next())&&!r.done;){const i=r.value;e.call(s,i[0],i[1])}},Fn=(s,e)=>{let t;const n=[];for(;(t=s.exec(e))!==null;)n.push(t);return n},Un=I("HTMLFormElement"),qn=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,r){return n.toUpperCase()+r}),Ye=(({hasOwnPrope
|
||
|
`).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),n=o.substring(r+1).trim(),!(!t||e[t]&&ds[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},st=Symbol("internals");function K(s){return s&&String(s).trim().toLowerCase()}function ue(s){return s===!1||s==null?s:p.isArray(s)?s.map(ue):String(s)}function ms(s){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(s);)e[n[1]]=n[2];return e}const bs=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function Ee(s,e,t,n,r){if(p.isFunction(n))return n.call(this,e,t);if(r&&(e=t),!!p.isString(e)){if(p.isString(n))return e.indexOf(n)!==-1;if(p.isRegExp(n))return n.test(e)}}function ws(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function ks(s,e){const t=p.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(s,n+t,{value:function(r,i,o){return this[n].call(this,e,r,i,o)},configurable:!0})})}let O=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(l,u,a){const c=K(u);if(!c)throw new Error("header name must be a non-empty string");const h=p.findKey(r,c);(!h||r[h]===void 0||a===!0||a===void 0&&r[h]!==!1)&&(r[h||u]=ue(l))}const o=(l,u)=>p.forEach(l,(a,c)=>i(a,c,u));if(p.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(p.isString(e)&&(e=e.trim())&&!bs(e))o(gs(e),t);else if(p.isHeaders(e))for(const[l,u]of e.entries())i(u,l,n);else e!=null&&i(t,e,n);return this}get(e,t){if(e=K(e),e){const n=p.findKey(this,e);if(n){const r=this[n];if(!t)return r;if(t===!0)return ms(r);if(p.isFunction(t))return t.call(this,r,n);if(p.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=K(e),e){const n=p.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Ee(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let r=!1;function i(o){if(o=K(o),o){const l=p.findKey(n,o);l&&(!t||Ee(n,n[l],l,t))&&(delete n[l],r=!0)}}return p.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];(!e||Ee(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return p.forEach(this,(r,i)=>{const o=p.findKey(n,i);if(o){t[o]=ue(r),delete t[i];return}const l=e?ws(i):String(i).trim();l!==i&&delete t[i],t[l]=ue(r),n[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return p.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&p.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
||
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[st]=this[st]={accessors:{}}).accessors,r=this.prototype;function i(o){const l=K(o);n[l]||(ks(r,o),n[l]=!0)}return p.isArray(e)?e.forEach(i):i(e),this}};O.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);p.reduceDescriptors(O.prototype,({value:s},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(n){this[t]=n}}});p.freezeMethods(O);function Te(s,e){const t=this||oe,n=e||t,r=O.from(n.headers);let i=n.data;return p.forEach(s,function(l){i=l.call(t,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function Ot(s){return!!(s&&s.__CANCEL__)}function X(s,e,t){C.call(this,s??"canceled",C.ERR_CANCELED,e,t),this.name="CanceledError"}p.inherits(X,C,{__CANCEL__:!0});function Pt(s,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?s(t):e(new C("Request failed with status code "+t.status,[C.ERR_BAD_REQUEST,C.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Cs(s){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}function xs(s,e){s=s||10;const t=new Array(s),n=new Array(s);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(u){const a=Date.now(),c=n[i];o||(o=a),t[r]=u,n[r]=a;let h=i,d=0;for(;h!==r;)d+=t[h++],h=h%s;if(r=(r+1)%s,r===i&&(i=(i+1)%s),a-o<e)return;const w=c&&a-c;return w?Math.round(d*1e3/w):void 0}}function ys(s,e){let t=0,n=1e3/e,r,i;const o=(a,c=Date.now())=>{t=c,r=null,i&&(clearTimeout(i),i=null),s.apply(null,a)};return[(...a)=>{const c=Date.now(),h=c-t;h>=n?o(a,c):(r=a,i||(i=setTimeout(()=>{i=null,o(r)},n-h)))},()=>r&&o(r)]}const he=(s,e,t=3)=>{let n=0;const r=xs(50,250);return ys(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,u=o-n,a=r(u),c=o<=l;n=o;const h={loaded:o,total:l,progress:l?o/l:void 0,bytes:u,rate:a||void 0,estimated:a&&l&&c?(l-o)/a:void 0,event:i,lengthComputable:l!=null,[e?"download":"upload"]:!0};s(h)},t)},rt=(s,e)=>{const t=s!=null;return[n=>e[0]({lengthComputable:t,total:s,loaded:n}),e[1]]},it=s=>(...e)=>p.asap(()=>s(...e)),Ss=v.hasStandardBrowserEnv?((s,e)=>t=>(t=new URL(t,v.origin),s.protocol===t.protocol&&s.host===t.host&&(e||s.port===t.port)))(new URL(v.origin),v.navigator&&/(msie|trident)/i.test(v.navigator.userAgent)):()=>!0,Rs=v.hasStandardBrowserEnv?{write(s,e,t,n,r,i){const o=[s+"="+encodeURIComponent(e)];p.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),p.isString(n)&&o.push("path="+n),p.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(s){const e=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function As(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Es(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}function $t(s,e,t){let n=!As(e);return s&&n||t==!1?Es(s,e):e}const ot=s=>s instanceof O?{...s}:s;function Z(s,e){e=e||{};const t={};function n(a,c,h,d){return p.isPlainObject(a)&&p.isPlainObject(c)?p.merge.call({caseless:d},a,c):p.isPlainObject(c)?p.merge({},c):p.isArray(c)?c.slice():c}function r(a,c,h,d){if(p.isUndefined(c)){if(!p.isUndefined(a))return n(void 0,a,h,d)}else return n(a,c,h,d)}function i(a,c){if(!p.isUndefined(c))return n(void 0,c)}function o(a,c){if(p.isUndefined(c)){if(!p.isUndefined(a))return n(void 0,a)}else return n(void 0,c)}function l(a,c,h){if(h in e)return n(a,c);if(h in s)return n(void 0,a)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(a,c,h)=>
|
||
|
`+i.map(ct).join(`
|
||
|
`):" "+ct(i[0]):"as no adapter specified";throw new C("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:$e};function _e(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new X(null,s)}function ut(s){return _e(s),s.headers=O.from(s.headers),s.data=Te.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Dt.getAdapter(s.adapter||oe.adapter)(s).then(function(n){return _e(s),n.data=Te.call(s,s.transformResponse,n),n.headers=O.from(n.headers),n},function(n){return Ot(n)||(_e(s),n&&n.response&&(n.response.data=Te.call(s,s.transformResponse,n.response),n.response.headers=O.from(n.response.headers))),Promise.reject(n)})}const It="1.8.1",ye={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{ye[s]=function(n){return typeof n===s||"a"+(e<1?"n ":" ")+s}});const pt={};ye.transitional=function(e,t,n){function r(i,o){return"[Axios v"+It+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,l)=>{if(e===!1)throw new C(r(o," has been removed"+(t?" in "+t:"")),C.ERR_DEPRECATED);return t&&!pt[o]&&(pt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,l):!0}};ye.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Fs(s,e,t){if(typeof s!="object")throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let r=n.length;for(;r-- >0;){const i=n[r],o=e[i];if(o){const l=s[i],u=l===void 0||o(l,i,s);if(u!==!0)throw new C("option "+i+" must be "+u,C.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new C("Unknown option "+i,C.ERR_BAD_OPTION)}}const pe={assertOptions:Fs,validators:ye},q=pe.validators;let V=class{constructor(e){this.defaults=e,this.interceptors={request:new nt,response:new nt}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
||
|
`+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Z(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&pe.assertOptions(n,{silentJSONParsing:q.transitional(q.boolean),forcedJSONParsing:q.transitional(q.boolean),clarifyTimeoutError:q.transitional(q.boolean)},!1),r!=null&&(p.isFunction(r)?t.paramsSerializer={serialize:r}:pe.assertOptions(r,{encode:q.function,serialize:q.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),pe.assertOptions(t,{baseUrl:q.spelling("baseURL"),withXsrfToken:q.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&p.merge(i.common,i[t.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),t.headers=O.concat(o,i);const l=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(u=u&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const a=[];this.interceptors.response.forEach(function(g){a.push(g.fulfilled,g.rejected)});let c,h=0,d;if(!u){const f=[ut.bind(this),void 0];for(f.unshift.apply(f,l),f.push.apply(f,a),d=f.length,c=Promise.resolve(t);h<d;)c=c.then(f[h++],f[h++]);return c}d=l.length;let w=t;for(h=0;h<d;){const f=l[h++],g=l[h++];try{w=f(w)}catch(m){g.call(this,m);break}}try{c=ut.call(this,w)}catch(f){return Promise.reject(f)}for(h=0,d=a.length;h<d;)c=c.then(a[h++],a[h++]);return c}getUri(e){e=Z(this.defaults,e);const t=$t(e.baseURL,e.url,e.allowAbsoluteUrls);return _t(t,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){V.prototype[e]=function(t,n){return this.request(Z(n||{},{method:e,url:t,data:(n||{}).data}))}});p.forEach(["post","put","patch"],function(e){function t(n){return function(i,o,l){return this.request(Z(l||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}V.prototype[e]=t(),V.prototype[e+"Form"]=t(!0)});let Us=class Ft{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(l=>{n.subscribe(l),i=l}).then(r);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,l){n.reason||(n.reason=new X(i,o,l),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Ft(function(r){e=r}),cancel:e}}};function qs(s){return function(t){return s.apply(null,t)}}function Ms(s){return p.isObject(s)&&s.isAxiosError===!0}const Be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,Unavailab
|
||
|
]`).replace("lheading",Ht).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ir=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vt=/^( {2,}|\\)\n(?!\s*$)/,or=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Re=/[\p{P}\p{S}]/u,Je=/[\s\p{P}\p{S}]/u,Zt=/[^\s\p{P}\p{S}]/u,lr=R(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Je).getRegex(),Gt=/(?!~)[\p{P}\p{S}]/u,ar=/(?!~)[\s\p{P}\p{S}]/u,cr=/(?:[^\s\p{P}\p{S}]|~)/u,ur=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Wt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,pr=R(Wt,"u").replace(/punct/g,Re).getRegex(),hr=R(Wt,"u").replace(/punct/g,Gt).getRegex(),Qt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fr=R(Qt,"gu").replace(/notPunctSpace/g,Zt).replace(/punctSpace/g,Je).replace(/punct/g,Re).getRegex(),dr=R(Qt,"gu").replace(/notPunctSpace/g,cr).replace(/punctSpace/g,ar).replace(/punct/g,Gt).getRegex(),gr=R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zt).replace(/punctSpace/g,Je).replace(/punct/g,Re).getRegex(),mr=R(/\\(punct)/,"gu").replace(/punct/g,Re).getRegex(),br=R(/^<(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(),wr=R(je).replace("(?:-->|$)","-->").getRegex(),kr=R("^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",wr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),de=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cr=R(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",de).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xt=R(/^!?\[(label)\]\[(ref)\]/).replace("label",de).replace("ref",Me).getRegex(),Kt=R(/^!?\[(ref)\](?:\[\])?/).replace("ref",Me).getRegex(),xr=R("reflink|nolink(?!\\()","g").replace("reflink",Xt).replace("nolink",Kt).getRegex(),Ve={_backpedal:ne,anyPunctuation:mr,autolink:br,blockSkip:ur,br:Vt,code:ir,del:ne,emStrongLDelim:pr,emStrongRDelimAst:fr,emStrongRDelimUnd:gr,escape:rr,link:Cr,nolink:Kt,punctuation:lr,reflink:Xt,reflinkSearch:xr,tag:kr,text:or,url:ne},yr={...Ve,link:R(/^!?\[(label)\]\((.*?)\)/).replace("label",de).getRegex(),reflink:R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de).getRegex()},ze={...Ve,emStrongRDelimAst:dr,emStrongLDelim:hr,url:R(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Sr={...ze,br:R(Vt).replace("{2,}","*").getRegex(),text:R(ze.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ae={normal:He,gfm:nr,pedantic:sr},Y={normal:Ve,gfm:ze,breaks:Sr,pedantic:yr},Rr={"&":"&","<":"<",">":">",'"':""","'":"'"},ft=s=>Rr[s];function M(s,e){if(e){if(L.escapeTest.test(s))
|
||
|
`).map(i=>{const o=i.match(t.other.beginningSpace);if(o===null)return i;const[l]=o;return l.length>=r.length?i.slice(r.length):i}).join(`
|
||
|
`)}class ge{constructor(e){T(this,"options");T(this,"rules");T(this,"lexer");this.options=e||W}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ee(n,`
|
||
|
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=Er(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=ee(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ee(t[0],`
|
||
|
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=ee(t[0],`
|
||
|
`).split(`
|
||
|
`),r="",i="";const o=[];for(;n.length>0;){let l=!1;const u=[];let a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))u.push(n[a]),l=!0;else if(!l)u.push(n[a]);else break;n=n.slice(a);const c=u.join(`
|
||
|
`),h=c.replace(this.rules.other.blockquoteSetextReplace,`
|
||
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
||
|
${c}`:c,i=i?`${i}
|
||
|
${h}`:h;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,o,!0),this.lexer.state.top=d,n.length===0)break;const w=o.at(-1);if((w==null?void 0:w.type)==="code")break;if((w==null?void 0:w.type)==="blockquote"){const f=w,g=f.raw+`
|
||
|
`+n.join(`
|
||
|
`),m=this.blockquote(g);o[o.length-1]=m,r=r.substring(0,r.length-f.raw.length)+m.raw,i=i.substring(0,i.length-f.text.length)+m.text;break}else if((w==null?void 0:w.type)==="list"){const f=w,g=f.raw+`
|
||
|
`+n.join(`
|
||
|
`),m=this.list(g);o[o.length-1]=m,r=r.substring(0,r.length-w.raw.length)+m.raw,i=i.substring(0,i.length-f.raw.length)+m.raw,n=g.substring(o.at(-1).raw.length).split(`
|
||
|
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={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:"[*+-]");const o=this.rules.other.listItemRegex(n);let l=!1;for(;e;){let a=!1,c="",h="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let d=t[2].split(`
|
||
|
`,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),w=e.split(`
|
||
|
`,1)[0],f=!d.trim(),g=0;if(this.options.pedantic?(g=2,h=d.trimStart()):f?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,h=d.slice(g),g+=t[1].length),f&&this.rules.other.blankLine.test(w)&&(c+=w+`
|
||
|
`,e=e.substring(w.length+1),a=!0),!a){const b=this.rules.other.nextBulletRegex(g),S=this.rules.other.hrRegex(g),y=this.rules.other.fencesBeginRegex(g),E=this.rules.other.headingBeginRegex(g),F=this.rules.other.htmlBeginRegex(g);for(;e;){const D=e.split(`
|
||
|
`,1)[0];let U;if(w=D,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),U=w):U=w.replace(this.rules.other.tabCharGlobal," "),y.test(w)||E.test(w)||F.test(w)||b.test(w)||S.test(w))break;if(U.search(this.rules.other.nonSpaceChar)>=g||!w.trim())h+=`
|
||
|
`+U.slice(g);else{if(f||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||E.test(d)||S.test(d))break;h+=`
|
||
|
`+w}!f&&!w.trim()&&(f=!0),c+=D+`
|
||
|
`,e=e.substring(D.length+1),d=U.slice(g)}}i.loose||(l?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(l=!0));let m=null,x;this.options.gfm&&(m=this.rules.other.listIsTask.exec(h),m&&(x=m[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:c,task:!!m,checked:x,loose:!1,text:h,tokens:[]}),i.raw+=c}const u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let a=0;a<i.items.length;a++)if(this.lexer.state.top=!1,i.items[a].tokens=this.lexer.blockTokens(i.items[a].text,[]),!i.loose){const c=i.items[a].tokens.filter(d=>d.type==="space"),h=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=h}if(i.loose)for(let a=0;a<i.items.length;a++)i.items[a].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){var l;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=gt(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(l=t[3])!=null&&l.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||
|
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const u of r)this.rules.other.tableAlignRight.test(u)?o.align.push("right"):this.rules.other.tableAlignCenter.test(u)?o.align.push("center"):this.rules.other.tableAlignLeft.test(u)?o.align.push("left"):o.align.push(null);for(let u=0;u<n.length;u++)o.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:o.align[u]});for(const u of i)o.rows.push(gt(u,o.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:o.align[c]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
||
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const 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){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const 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){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=ee(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=Ar(t[2],"()");if(o>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),mt(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.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))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return mt(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let l,u,a=o,c=0;const h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+o);(r=h.exec(t))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(u=[...l].length,r[3]||r[4]){a+=u;continue}else if((r[5]||r[6])&&o%3&&!((o+u)%3)){c+=u;continue}if(a-=u,a>0)continue;u=Math.min(u,u+a+c);const d=[...r[0]][0].length,w=e.slice(0,o+r.index+d+u);if(Math.min(o,u)%2){const g=w.slice(1,-1);return{type:"em",raw:w,text:g,tokens:this.lexer.inlineTokens(g)}}const f=w.slice(2,-2);return{type:"strong",raw:w,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class
|
||
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var r,i,o;for(this.options.pedantic&&(e=e.replace(L.tabCharGlobal," ").replace(L.spaceLine,""));e;){let l;if((i=(r=this.options.extensions)==null?void 0:r.block)!=null&&i.some(a=>(l=a.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);const a=t.at(-1);l.raw.length===1&&a!==void 0?a.raw+=`
|
||
|
`:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
|
||
|
`+l.raw,a.text+=`
|
||
|
`+l.text,this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
|
||
|
`+l.raw,a.text+=`
|
||
|
`+l.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),t.push(l);continue}let u=e;if((o=this.options.extensions)!=null&&o.startBlock){let a=1/0;const c=e.slice(1);let h;this.options.extensions.startBlock.forEach(d=>{h=d.call({lexer:this},c),typeof h=="number"&&h>=0&&(a=Math.min(a,h))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(this.state.top&&(l=this.tokenizer.paragraph(u))){const a=t.at(-1);n&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=`
|
||
|
`+l.raw,a.text+=`
|
||
|
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l),n=u.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=`
|
||
|
`+l.raw,a.text+=`
|
||
|
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var l,u,a;let n=e,r=null;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)c.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i=!1,o="";for(;e;){i||(o=""),i=!1;let c;if((u=(l=this.options.extensions)==null?void 0:l.inline)!=null&&u.some(d=>(c=d.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);const d=t.at(-1);c.type==="text"&&(d==null?void 0:d.type)==="text"?(d.raw+=c.raw,d.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,n,o)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let h=e;if((a=this.options.extensions)!=null&&a.startInline){let d=1/0;const w=e.slice(1);let f;this.options.extensions.startInline.forEach(g=>{f=g.call({lexer:this},w),typeof f=="number"&&f>=0&&(d=Math.min(d,f))}),d<1/0&&d>=0&&(h=e.substring(0,d+1))}if(c=this.tokenizer.inlineText(h)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(o=c.raw.slice(-1)),i=!0;const d=t.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=c.raw,d.text+=c.text):t.push(c);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}class me{constructor(e){T(this,"options");T(this,"parser");this.options=e||W}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(L.notSpaceStart))==null?void 0:o[0],i=e.replace(L.endingNewline,"")+`
|
||
|
`;return r?'<pre><code class="language-'+M(r)+'">'+(n?i:M(i,!0))+`</code></pre>
|
||
|
`:"<pre><code>"+(n?i:M(i,!0))+`</code></pre>
|
||
|
`}blockquote({tokens:e}){return`<blockquote>
|
||
|
${this.parser.parse(e)}</blockquote>
|
||
|
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
||
|
`}hr(e){return`<hr>
|
||
|
`}list(e){const t=e.ordered,n=e.start;let r="";for(let l=0;l<e.items.length;l++){const u=e.items[l];r+=this.listitem(u)}const i=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+i+o+`>
|
||
|
`+r+"</"+i+`>
|
||
|
`}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+M(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
||
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
||
|
`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0;i<e.rows.length;i++){const o=e.rows[i];n="";for(let l=0;l<o.length;l++)n+=this.tablecell(o[l]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
||
|
<thead>
|
||
|
`+t+`</thead>
|
||
|
`+r+`</table>
|
||
|
`}tablerow({text:e}){return`<tr>
|
||
|
${e}</tr>
|
||
|
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${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>${M(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=dt(e);if(i===null)return r;e=i;let o='<a href="'+e+'"';return t&&(o+=' title="'+M(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n}){const r=dt(e);if(r===null)return M(n);e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${M(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:M(e.text)}}class Ze{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""}}class N{constructor(e){T(this,"options");T(this,"renderer");T(this,"textRenderer");this.options=e||W,this.options.renderer=this.options.renderer||new me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ze}static parse(e,t){return new N(t).parse(e)}static parseInline(e,t){return new N(t).parseInline(e)}parse(e,t=!0){var r,i;let n="";for(let o=0;o<e.length;o++){const l=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[l.type]){const a=l,c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){n+=c||"";continue}}const u=l;switch(u.type){case"space":{n+=this.renderer.space(u);continue}case"hr":{n+=this.renderer.hr(u);continue}case"heading":{n+=this.renderer.heading(u);continue}case"code":{n+=this.renderer.code(u);continue}case"table":{n+=this.renderer.table(u);continue}case"blockquote":{n+=this.renderer.blockquote(u);continue}case"list":{n+=this.renderer.list(u);continue}case"html":{n+=this.renderer.html(u);continue}case"paragraph":{n+=this.renderer.paragraph(u);continue}case"text":{let a=u,c=this.renderer.text(a);for(;o+1<e.length&&e[o+1].type==="text";)a=e[++o],c+=`
|
||
|
`+this.renderer.text(a);t?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,t=this.renderer){var r,i;let n="";for(let o=0;o<e.length;o++){const l=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[l.type]){const a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=a||"";continue}}const u=l;switch(u.type){case"escape":{n+=t.text(u);break}case"html":{n+=t.html(u);break}case"link":{n+=t.link(u);break}case"image":{n+=t.image(u);break}case"strong":{n+=t.strong(u);break}case"em":{n+=t.em(u);break}case"codespan":{n+=t.codespan(u);break}case"br":{n+=t.br(u);break}case"del":{n+=t.del(u);break}case"text":{n+=t.text(u);break}default:{const a='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}}class se{constructor(e){T(this,"options");T(this,"block");this.options=e||W}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?z.lex:z.lexInline}provideParser(){return this.block?N.parse:N.parseInline}}T(se,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Tr{constructor(...e){T(this,"defaults",Fe());T(this,"options",this.setOptions);T(this,"parse",this.parseMarkdown(!0));T(this,"parseInline",this.parseMarkdown(!1));T(this,"Parser",N);T(this,"Renderer",me);T(this,"TextRenderer",Ze);T(this,"Lexer",z);T(this,"Tokenizer",ge);T(this,"Hooks",se);this.use(...e)}walkTokens(e,t){var r,i;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const l=o;for(const u of l.header)n=n.concat(this.walkTokens(u.tokens,t));for(const u of l.rows)for(const a of u)n=n.concat(this.walkTokens(a.tokens,t));break}case"list":{const l=o;n=n.concat(this.walkTokens(l.items,t));break}default:{const l=o;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[l.type]?this.defaults.extensions.childTokens[l.type].forEach(u=>{const a=l[u].flat(1/0);n=n.concat(this.walkTokens(a,t))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...l){let u=i.renderer.apply(this,l);return u===!1&&(u=o.apply(this,l)),u}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=this.defaults.renderer||new me(this.defaults);for(const o in n.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const l=o,u=n.renderer[l],a=i[l];i[l]=(...c)=>{let h=u.apply(i,c);return h===!1&&(h=a.apply(i,c)),h||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new ge(this.defaults);for(const o in n.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const l=o,u=n.tokenizer[l],a=i[l];i[l]=(...c)=>{let h=u.apply(i,c);return h===!1&&(h=a.apply(i,c)),h}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new se;for(const o in n.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options"
|
||
|
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+M(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}const G=new Tr;function A(s,e){return G.parse(s,e)}A.options=A.setOptions=function(s){return G.setOptions(s),A.defaults=G.defaults,Mt(A.defaults),A};A.getDefaults=Fe;A.defaults=W;A.use=function(...s){return G.use(...s),A.defaults=G.defaults,Mt(A.defaults),A};A.walkTokens=function(s,e){return G.walkTokens(s,e)};A.parseInline=G.parseInline;A.Parser=N;A.parser=N.parse;A.Renderer=me;A.TextRenderer=Ze;A.Lexer=z;A.lexer=z.lex;A.Tokenizer=ge;A.Hooks=se;A.parse=A;A.options;A.setOptions;A.use;A.walkTokens;A.parseInline;N.parse;z.lex;const _r={id:"root"},vr={class:"cb86951c"},Lr={class:"c3ecdb44"},Or={class:"f2eea526"},Pr={class:"a5cd95be"},$r={class:"b83ee326"},Br={key:0,class:"fa81"},zr={class:"fbb737a4"},Nr={class:"ds-flex e0558cb1",style:{position:"absolute",right:"calc(100% + 18px)",top:"12px",gap:"12px"}},Dr={class:"ds-icon-button",tabindex:"0",style:{"--ds-icon-button-text-color":"#909090","--ds-icon-button-size":"20px"}},Ir=["onClick"],Fr={viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Ur={key:1,class:"f9bf7997 d7dc56a8 c05b5566"},qr={class:"edb250b1"},Mr={key:0,class:"a6d716f5 db5991dd"},jr={key:1,class:"ds-loading b4e4476b",style:{"font-size":"20px"}},Hr={class:"e1675d8b"},Jr={class:"ba94db8a"},Vr={class:"ds-markdown ds-markdown--block",style:{"--ds-md-zoom":"1.143"}},Zr=["innerHTML"],Gr={class:"ds-flex",style:{"margin-top":"12px",height:"20px","align-items":"center",gap:"12px"}},Wr={class:"ds-flex abe97156",style:{"align-items":"center",gap:"12px"}},Qr={class:"ds-icon-button",tabindex:"0",style:{"--ds-icon-button-text-color":"#909090","--ds-icon-button-size":"20px"}},Xr=["onClick"],Kr={viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Yr={key:1,class:"a85a674a"},ei={class:"cbcaa82c"},ti={class:"aaff8b8f"},ni={class:"cefa5c26"},si={class:"dd442025 b699646e"},ri={class:"fad49dec"},ii={class:"ec4f5d61"},oi={class:"bf38813a"},Ti=tn({__name:"ai",setup(s){const e=j(""),t=j(!1),n=j(""),r=j([]),i=nn({page:1,limit:1}),o=j(new Set),l=j(null),u=j(!1),a=j(!0),c=async()=>{u.value||(await pn(),setTimeout(()=>{if(l.value){const x=l.value;x.scrollTop=x.scrollHeight}},100))};sn(()=>{e.value=Date.now().toString()});const h=x=>{const b=x.target,S=b.scrollHeight-b.scrollTop<b.clientHeight;S||(u.value=!0),S&&(u.value=!1)},d=()=>{if(w.value==!0){w.value=!1,a.value=!0;return}const x=r.value.length-1;r.value[x].role!="assistant"&&r.value.push({role:"assistant",sk:"",content:"",skLong:!0}),Js({key:e.value,page:i.page,limit:i.limit}).then(b=>{if(b.code==1){for(let S=0;S<b.data.list.length;S++){const y=b.data.list[S];if(!o.value.has(y.id)){o.value.add(y.id);const E=r.value.length-1;y.reasoning==1?r.value[E].sk+=y.content:(r.value[E].skLong=!1,r.value[E].content+=y.content)}if(y.usage_json.length>0||y.usage_json.prompt_tokens){const E=r.value.length-1;r.value[E].content=A(r.value[E].content),r.value[E].skLong=!1,a.value=!0;return}c()}b.data.list.length==i.limit&&i.page++,d()}})},w=j(!1),f=()=>{!n.value||n.value.trim()===""||(console.log(a.value),a.value==!0&&(t.value=!0,r.value.push({role:"user",content:n.value}),e.value=Date.now().toString(),i.page=1,o.value.clear(),n.value="",a.value=!1,u.value=!1,c(),Hs({key:e.value,messages:JSON.stringify(r.value)}).then(x=>{console.log(x)}),d()))},g=()=>{w.value=!0,r.value=[],a.value=!0,t.value=!1};rn(()=>{o.value.clear(),i.page=1});const m=x=>{navigator.clipboard.writeText(x)};return(x,b)=>{const S=hn("clippath");return B(),$("div",_r,[k("div",vr,[k("div",Lr,[k("div",Or,[k("div",Pr,[k("div",$r,[k("div",{class:"f6004764",ref_key:"chatContainerRef",ref:l,onScroll:h},[k("div",{class:"f72b0bab",style:on({height:t.value?"100%":"60%"})},[t.value?(B(!0),$(ln,{key:0},an(r.value,y=>(B(),$("div",{class:"dad65929",style:{"flex-grow":"0",margin:"0px auto"},ref_for:!0,ref:"chatContainer"},[y.role
|