offsite 0.0.40 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/web/dist/apple-touch-icon.png +0 -0
- package/apps/web/dist/assets/{dist-DflF8aCJ.js → dist-fLTPb8e0.js} +1 -1
- package/apps/web/dist/assets/{index-CoZzbJKk.js → index-BXRn07Vg.js} +2 -2
- package/apps/web/dist/assets/index-Dvjspoom.css +2 -0
- package/apps/web/dist/icon-192.png +0 -0
- package/apps/web/dist/icon-512.png +0 -0
- package/apps/web/dist/icon-maskable-512.png +0 -0
- package/apps/web/dist/icon.svg +19 -2
- package/apps/web/dist/index.html +2 -2
- package/apps/web/dist/sw.js +1 -1
- package/package.json +1 -1
- package/apps/web/dist/assets/index-CrPSXX9l.css +0 -2
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{n as getSharedHighlighter}from"./dist-CkDQKgh1.js";import"./index-
|
|
1
|
+
export{n as getSharedHighlighter}from"./dist-CkDQKgh1.js";import"./index-BXRn07Vg.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/image-viewer-4LhMaTO_.js","assets/jsx-runtime-DKj5X9O4.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/zoomable-image-CZlWBm_z.js","assets/button-BF3wjXXJ.js","assets/utils-PtDt7m8t.js","assets/tooltip-CiWlkHa6.js","assets/preview-dialog-jk_R2034.js","assets/dist-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/image-viewer-4LhMaTO_.js","assets/jsx-runtime-DKj5X9O4.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/zoomable-image-CZlWBm_z.js","assets/button-BF3wjXXJ.js","assets/utils-PtDt7m8t.js","assets/tooltip-CiWlkHa6.js","assets/preview-dialog-jk_R2034.js","assets/dist-fLTPb8e0.js","assets/dist-CkDQKgh1.js","assets/preload-helper-BLdHbfdN.js","assets/video-viewer-CJ129jI3.js","assets/video-player-Bcow2OC5.js","assets/react-99wk3OSj.js","assets/audio-player-BBuXiV2_.js","assets/mermaid.core-BvdElKsv.js","assets/tags-DrTyXsO5.js","assets/chunk-7S6XSTFO-VvdR34BD.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-BbHDS76q.js","assets/chunk-DSNLSHJZ-Npz5XPWZ.js","assets/dist-B_J_HbC0.js","assets/chunk-OYAV6JZA-rT8O_-D6.js","assets/chunk-YZO67HFG-B_UXK566.js","assets/chunk-AQDTSKZB-DWCLLcEu.js","assets/chunk-UHW7PFBP-Cu9Ayl_R.js","assets/chunk-HAGFOTED-B1IVU9Z4.js","assets/chunk-J5ZVWO5B-oDCd-gWO.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-ZAUX2LTX-BaD-GxqC.js","assets/chunk-WQQL4CDK-BAxY1EoE.js","assets/line-QLqjjjjp.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/chunk-HNE4Q36P-ByoLUQMm.js","assets/chunk-EJLWFMJV-DyjKClu9.js","assets/chunk-DUW6YSOI-Dgx8z5s3.js","assets/chunk-LNGE3PJU-Cz3NAIRA.js","assets/video-player-hDoAwJRk.js","assets/zoomable-image-DyuZJmov.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{i as e,n as t,t as n}from"./rolldown-runtime-Dd_uD5pT.js";import{n as r,t as i}from"./jsx-runtime-DKj5X9O4.js";import{S as a,_ as o,a as s,b as c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,x as w}from"./button-BF3wjXXJ.js";import{A as T,C as E,D,E as O,O as k,S as A,T as ee,_ as j,a as M,b as te,c as ne,d as re,f as ie,g as ae,h as oe,i as se,k as ce,l as le,m as ue,n as de,o as fe,p as pe,r as me,s as he,u as ge,v as N,w as _e,x as ve,y as ye}from"./tags-DrTyXsO5.js";import{a as be,c as xe,i as Se,l as Ce,n as we,o as Te,r as Ee,s as De,t as Oe}from"./tooltip-CiWlkHa6.js";import{C as ke,S as Ae,T as je,_ as Me,a as Ne,b as Pe,c as Fe,d as Ie,f as Le,g as Re,h as ze,i as Be,l as Ve,m as He,n as Ue,o as We,p as Ge,r as Ke,s as qe,t as Je,u as Ye,v as Xe,w as Ze,x as Qe,y as $e}from"./preview-dialog-jk_R2034.js";import{a as et,i as tt,n as nt,r as rt,t as P}from"./utils-PtDt7m8t.js";import{t as it}from"./preload-helper-BLdHbfdN.js";import{A as at,B as ot,C as st,D as ct,E as lt,F as ut,G as dt,H as ft,I as pt,J as mt,K as ht,L as gt,M as _t,N as vt,O as yt,P as bt,Q as xt,R as St,S as Ct,T as wt,U as Tt,V as Et,W as Dt,X as Ot,Y as kt,Z as At,g as jt,h as Mt,j as Nt,k as Pt,l as Ft,n as It,o as Lt,p as Rt,q as zt,t as Bt,w as Vt,x as Ht,z as Ut}from"./dist-CkDQKgh1.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var F=e(r(),1),Wt=F.useLayoutEffect;function Gt(e){return e[e.length-1]}function Kt(e,t){return typeof e==`function`?e(t):e}var qt=Object.prototype.hasOwnProperty;function Jt(e){for(let t in e)if(qt.call(e,t))return!0;return!1}var Yt=()=>Object.create(null),Xt=(e,t)=>Zt(e,t,!0);function Zt(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(Qt(e)&&Qt(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&Gt(a)!==`${o-1}`||c&&Gt(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?Zt(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?Zt(d,o,n,r):o,i&&=u===d&&(a[l]===f||qt.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?Yt():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?Zt(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function Qt(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function $t(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!$t(a,o,n,r))return!1}return!0}if(Qt(e)&&Qt(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!$t(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!$t(e[a],t[a],n,r)))return!1;return i===0}return!1}var en=/[\x00-\x1f\x7f"<>`{}]/g;function tn(e){return e.replace(en,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function nn(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return tn(t)}var rn=[`http:`,`https:`,`mailto:`,`tel:`];function an(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var on=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function sn(e,t){if(!e)return!1;if(on.test(e))return!0;let n=an(e);return n?!t.has(n):!1}function cn(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=nn(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=nn(r?e.slice(r):e)}return t}function ln(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function un(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function dn(){throw Error(`Invariant failed`)}function fn(e){return e.replace(/\/{2,}/g,`/`)}function pn(e){return e===`/`?e:e.replace(/^\/+/,``)}function mn(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function hn(e){return mn(pn(e))}function gn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function _n(e,t,n=`never`,r){if(t.includes(`//`)&&(t=fn(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=fn(e)),o=e.split(`/`);o.length>1&&Gt(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(Gt(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?fn(s):s)||`/`;return a&&r&&r.set(a,c),c}function vn(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function yn(e){return e==null||e===``}function bn(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function xn(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&yn(f)){if(c===`/`&&!d)continue;f=``}o+=c+bn(s,f,r)+(d||``)}}return o+a||`/`}function Sn(e){return e?.isNotFound===!0}function Cn(){try{return sessionStorage}catch{return}}var wn=`tsr-scroll-restoration-v1_3`,Tn=Cn();function En(){try{return JSON.parse(Tn?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Dn=En(),On=`data-scroll-restoration-id`,kn=e=>e.state.__TSR_key||e.href;function An(e){let t=e.getAttribute(On);if(t)return`[${On}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var jn=!1,Mn=`window`;function Nn(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Pn(e){let t=new Set;for(let n of e){if(n===Mn)continue;let e=Nn(n);e&&t.add(e)}return t}function Fn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||kn,a=new Set,o=e=>{let t=Dn[e]||={};for(let e of a)e===document?t[Mn]={scrollX,scrollY}:e.isConnected&&(t[An(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,jn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{jn||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{Tn?.setItem(wn,JSON.stringify(Dn))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=Dn[d];if(e){let t=Dn[u];for(let n in e){if(n===Mn){if(s)continue}else{let e=Nn(n);if(!e||s&&o&&(l??=Pn(o),l.has(e)))continue}t||=Dn[u]={},t[n]??=e[n]}}}jn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Pn(o));let t=e&&i&&c,s=r.e?Dn[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Mn){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Nn(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{jn=!1}}))}function In(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function Ln(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Rn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Ln(r):Array.isArray(t)?t.push(Ln(r)):n[e]=[t,Ln(r)]}return n}var zn=/^(?:\s|["[{\d-]|fa|nu|tr)/,Bn=Hn(JSON.parse),Vn=Un(JSON.stringify,JSON.parse);function Hn(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=Rn(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!zn.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Un(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!zn.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=In(e,r);return t?`?${t}`:``}}var Wn=`__root__`;function Gn(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Kn(e){return e instanceof Response&&!!e.options}function qn(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Jn=4,Yn=5;function Xn(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Zn(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function Qn(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,m=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=Gt(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],m=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=Zn(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=er(r);c=n,t.set(e,n)}}else{let t=a[0],h=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&m<n&&(m<e-1&&p.push(s.slice(m,e-1)),a[2]=`/`+h,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),m=n),!r)continue;let _=d&&!!(h||g);d||(h=h.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=er(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m<u&&p.push(s.slice(m,u));let h=p?.slice();if(!r)return h;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=er(r,Yn);(r.pathless??=[]).push(e),r=e}let g=(t.path||!t.children)&&!t.isRoot;if(g&&u<l){let e=er(r,Jn);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=h,g&&(r.route=t)),[r,o,h]}function $n(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function er(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function tr(e,t){let n=er(),r=[];function i(e,t,n,a){let[o,s,c]=Qn(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort($n);t.masksTree=n,t.flatCache=qn(1e3)}function nr(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=or(e,t.masksTree);return t.flatCache.set(e,r),r}function rr(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=er(),Qn(t,{from:e},1,o),i.singleCache.set(a,o)),or(r,o,n)}function ir(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=or(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=cr(a.route)),t.matchCache.set(r,a),a}function ar(e,t=!1){let n=er(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&dn(),i[e.id]=e,o!==0&&e.path){let t=mn(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=Qn(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort($n);return{processedTree:{segmentTree:n,singleCache:qn(1e3),matchCache:qn(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function or(e,t,n=!1){let r=e.split(`/`),i=ur(e,r,t,n);if(!i)return null;let[a]=sr(e,r,i);return{route:i.node.route,rawParams:a}}function sr(e,t,n){let r=lr(n.node),i=n.node.data&&Xn(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===Jn)break;if(u.kind===Yn){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function cr(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function lr(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function ur(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!Gt(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!mr(l,n))continue;if(i.parse){if(!pr(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Jn&&mr(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Jn||i.kind===2)&&mr(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(pr(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&fr(f,o))return n;mr(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+dr(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+dr(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+dr(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+dr(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function dr(e,t){return 2**(e-t-1)}function fr(e,t){return e===2**(t-1)-1}function pr(e,t,n){let r,i;try{[r,i]=sr(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function mr(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Jn)>(e.node.kind===Jn)||t.node.kind===Jn==(e.node.kind===Jn)&&t.node.depth>e.node.depth)))}function hr(e,t,n){let r=hn(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=fn(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>gr(n,s.input({url:e})),output:({url:e})=>s.output({url:_r(n,e)})}:s}function gr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function _r(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function vr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{un(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var yr=`__TSR_index`,br=`popstate`,xr=`beforeunload`,Sr=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function Cr(e){let t=Sr.exec(e);return t?`/`+e.slice(t[0].length):e}function wr(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
3
3
|
\r`.includes(e)?``:encodeURIComponent(e))),Cr(e)}function Tr(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=Or(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[yr];i=Er(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[yr];i=Er(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[yr]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function Er(e,t){let n=kr();return{...t,key:n,__TSR_key:n,[yr]:e}}function Dr(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>wr(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>Or(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=kr();t.history.replaceState({[yr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=Or(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[yr]-l.state[yr],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Tr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(xr,x,{capture:!0}),t.removeEventListener(br,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(xr,x,{capture:!0}),t.addEventListener(br,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function Or(e,t){let n=wr(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=kr();t={[yr]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function kr(){return(Math.random()+1).toString(36).slice(7)}function Ar(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function jr(e){return e.pathname+e.search+e.hash}function Mr(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Nr(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Pr({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Fr(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Ir(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Lr=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Dr()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&hn(n)?hr(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=vr(this.latestLocation,e),Fn(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ar(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&tr(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:qn(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:cn(e),external:!1,searchStr:o,search:Xt(t?.search,i),hash:cn(r.slice(1)),state:Zt(t?.state,a)}}let o=gr(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:cn(Cr(o.pathname)),external:!!this.rewrite&&Ar(o,this.origin),searchStr:c,search:Xt(t?.search,s),hash:cn(o.hash.slice(1)),state:Zt(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=ir(mn(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=Or(n.href,{});n={...n,to:gr(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=_n(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[mn(c)],u=c.includes(`$`),d;if(l)d=l._branch??=cr(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??Qn(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Hr(n.params,e),!Jt(p))break;p===e&&(p=Object.assign(Yt(),p));try{Object.assign(p,t(p))}catch{}}}p??=Hr(n.params,Ur(n.params,f)?o()[3]:Wr);let m=e.leaveParams?c:Cr(cn(f?xn(c,f,p,this.pathParamsDecoder):c)),h=Gr(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Vr(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?Kr(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Wr,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,x=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Wr,S=`${m}${v}${b}`,C,w,T=!1;if(this.rewrite){let e=new URL(S,this.origin),t=e.origin,n=_r(this.rewrite,e);C=jr(e),Ar(n,t)?(w=n.href,T=!0):w=Cr(jr(n))}else C=ln(S),w=C;return{publicHref:w,href:C,pathname:m,search:_,searchStr:v,state:x,hash:y??``,external:T,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=nr(r.pathname,this.processedTree);if(t){let i=Object.assign(Yt(),t.rawParams),{from:a,params:o,...s}=t.route,c=Hr(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return Rr(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=mn(this.latestLocation.href)===mn(n.href)&&$t(Pr(n.state),Pr(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?an(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return Rr(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await zi(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Nr(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Mr(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(on.test(n)||(r=an(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:Ar(e,this.origin)||(n=jr(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Zr,this.preloadRoute=e=>Bi(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?_n(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=rr(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!$t(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?$t(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=vn(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Vn,parseSearch:e.parseSearch??Bn,protocolAllowlist:e.protocolAllowlist??rn}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Qn(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:mn(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?qr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Vr(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof zr||(r=new zr(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=Yt(),_=i._interpolation?xn(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,v=i.id+_+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(g,d);let x;if(!b)try{Jr(i,d)}catch(e){if(x=Sn(e)||Kn(e)?e:new Br(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:Xt(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Mr(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:y?Xt(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?Zt(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?Xt(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=Gt(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=Gt(a),c={...e.search};for(let e of a)try{Object.assign(c,Vr(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{Jr(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function Rr(e,t,{replace:n,ignoreBlocker:r}){if(!sn(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var zr=class extends Error{},Br=class extends Error{};function Vr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new zr(`Async validation not supported`);if(n.issues)throw new zr(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Hr(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Ur(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!qt.call(e,t[1]))}var Wr=Object.freeze({});function Gr(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Vr(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Kr(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=Kt(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function qr(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Wn}function Jr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Yr(e,t){return e.options[t]?.preload?.()}function Xr(e,t){let n=Yr(e,`component`),r=Yr(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Zr(e,t,n){let r=()=>t===!1?void 0:t?Yr(e,t):Xr(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Qr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function $r(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var ei=0,ti=1,ni=2,ri=3,ii=[4];function ai(e){return typeof e[0]==`number`}function oi(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function si(e,t){return e.routesById[t.routeId]}function ci(e,t,n){return Kn(e)?[ri,e]:Sn(e)?(e.routeId||=n,[ni,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[ti,e]):[ei,e]}function li(e,t){let n=ci(t,!0,e.id);if(n[0]!==ti)return n;try{e.options.onError?.(n[1])}catch(t){n=ci(t,!0,e.id)}return n}function ui(e,t,n,r,i){return i[0].signal.aborted?ii:Ei(e,t,n,li(n,r),i)}async function di(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=si(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return pi(e,r),[i,ui(e,t,u,a,n)]}if(c.aborted)return[i,ii];let p=r.paramsError??r.searchError;if(p!==void 0)return pi(e,r),[i,ui(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{gi(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?oi(a,c):a);if(c.aborted)return[i,ii];let s=Ei(e,t,u,ci(o,!1,u.id),n);if(s[0]!==ei)return pi(e,r),[i,s];r.context={...r.context,...o}}catch(a){return pi(e,r),[i,ui(e,t,u,a,n)]}finally{r.status=h,gi(e,r,!1,n[0])}}i()}function fi(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function pi(e,t){let n=t._flight;t._flight=void 0,fi(e,t,n)?.abort()}function mi(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=fi(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function hi(e){for(let t of e){let e=t._flight;e&&e[2]++}}function gi(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function _i(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function vi(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return ii;if(!i)return[ei,void 0];let l=n._flight;gi(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(_i(e,t,n,r,s,a,!!o[3]))).then(e=>ci(e,!1,r.id),e=>ci(e,!0,r.id)).then(t=>(t[0]!==ei&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===ti&&l[2]?li(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Ei(e,t,r,await oi(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return pi(e,n),ii}finally{gi(e,n,!1,s)}}function yi(e,t,n){t[0]!==ri&&(e.status=`success`,e.error=void 0,t[0]===ei?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function bi(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&pi(e,r)}function xi(e,t){return t[0]===ti||t[0]===ni?{...e,status:t[0]===ti?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Si(e,t,n,r,i,a,o){let s=t[1][n],c=si(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(_i(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=ii)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,pi(e,s),p=ui(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,fi(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?vi(e,t,s,c,g,i,a).then(t=>(yi(s,t,l),t[0]===ei&&(m&&!a[0].signal.aborted&&bi(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[ei,s.loaderData]),T=(async()=>{try{let e=Zr(c,void 0,C);e&&await oi(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,ui(e,t,c,r,a)]}let r=await w;x&&r[0]===ei&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>xi(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=vi(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,yi(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>xi(E,e))}async function Ci(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=si(e,t[n]);try{let e=Zr(i,!1);e&&await oi(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function wi(e,t){t[2]&&=(mi(e,t[2].map(e=>e[3])),void 0)}async function Ti(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=ri)throw[a,t];!i&&t[0]!==ei&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===ri)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Ei(e,t,n,r,i,a){for(;r[0]===ri;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[ri,t]:[ri,t,a]}return[ri,o,n]}catch(e){r=a?[ti,e]:li(n,e),a=!0}}return r}async function Di(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===ni?Ci(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=ri)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==ei&&t[0]<ri&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=ri){let n=s[1];if(n[0]!==ri||n[1].options.reloadDocument||n[2])return wi(e,t),n;c=!0,s=[0,[ti,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===ti?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=si(e,u);try{await oi(i?Promise.resolve().then(()=>Zr(m,l===ti?`errorComponent`:`notFoundComponent`)):Promise.all([Zr(m),Zr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return wi(e,t),ii}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),wi(e,t),mi(e,o),p()):u.status=`success`}return t}async function Oi(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=si(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await oi(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function ki(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Ci(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Si(e,i,t,u,f,r,l)},m=await di(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===ni){let t=await Ci(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=ri&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Di(e,i,u,r[0],Ti(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Ti(i[2],void 0,void 0,h.then(e=>ai(e)?0:Qr(n).length,()=>0))),o=await h}catch(t){if(wi(e,i),t===a&&a.aborted)return ii;throw t}return ai(o)?o:Oi(e,o,a,r[6]===n.length?r[6]:0)}function Ai(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=si(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Ai(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function ji(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Mi(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Qr(t[3]).some(e=>e.id===n[1]))return;let i;try{await oi(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Ni(e,t){e._committed=t,e.stores.setMatches(t)}function Pi(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Qr(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=si(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Fr(n);Ni(e,n),mi(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Ir(e,i,n,a,l,t)}async function Fi(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Ii(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Li(e,t,n,r,i){let a=n.map(e=>({...e}));hi(a);for(let t of r)pi(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Di(e,o,r,t[0],i)}catch(t){throw mi(e,a),t}if(ai(s))mi(e,a),s[0]===ri&&e._tx===t&&e._committed===n&&await Ii(e,t,s);else if(await Oi(e,s,t[0].signal),e._tx!==t||e._committed!==n)mi(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),pi(e,n))}Ni(e,a),mi(e,n,a)}}async function Ri(e,t,n,r,i,a){let o=await ki(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(ai(o)){let n=o[0]===ri&&e._tx===t;if((!n||o[1].options.reloadDocument)&&ji(e,t),mi(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){ji(e,t);return}await Ii(e,t,o);return}let s=o[1];if(e._tx===t&&await Mi(e,t),e._tx!==t){ji(e,t),mi(e,s),wi(e,o);return}let c=t[2],l=Nr(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Mi(e,t),e._tx!==t){ji(e,t),mi(e,s),wi(e,o);return}let n=await e.startTransition(()=>{ji(e,t),Pi(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&Li(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):wi(e,o)})}async function zi(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Nr(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Fi(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});hi(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){mi(e,m),await Fi(e,n);return}e._preflight=void 0;let g,_=()=>Ri(e,y,f,()=>Ai(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>Fi(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&gi(e,t,!1)}n[0].abort(),mi(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Ai(e,y),g?.(_()),await y[5]):(mi(e,y[3]),y[3]=[],g?.(),await Fi(e,y))}async function Bi(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),hi(a),o=(e._preloads??=new Map).set(i,a),s=await ki(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),mi(e,a)),i.abort()}if(!ai(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Sn(e)||console.error(e);return}}}var Vi=`Error preloading route! ☝️`,Hi=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Wn:this.parentRoute||dn();let r=n?Wn:t?.path;r&&r!==`/`&&(r=pn(r));let i=t?.id||r,a=n?Wn:fn((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:fn(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=mn(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Gn({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Ui=class extends Hi{constructor(e){super(e)}},I=i(),Wi=class extends F.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?F.createElement(this.props.errorComponent??Gi,{error:e[0],reset:this.reset}):this.props.children}};function Gi({error:e}){let[t,n]=F.useState(!1);return(0,I.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,I.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,I.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,I.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,I.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,I.jsx)(`div`,{children:(0,I.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,I.jsx)(`code`,{children:e.message}):null})}):null]})}var Ki=()=>!0,qi=()=>!1;function Ji({children:e,fallback:t=null}){return(0,I.jsx)(F.Fragment,{children:Yi()?e:t})}function Yi(e=!0){return F.useSyncExternalStore(Xi,Ki,e?qi:Ki)}function Xi(){return()=>{}}var Zi=F.createContext(null);function Qi(e){return F.useContext(Zi)}function $i(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{$r(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var ea=F.createContext(void 0),ta=F.createContext(void 0);function na({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function ra(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var ia=[],aa=0,{link:oa,unlink:sa,propagate:ca,checkDirty:la,shallowPropagate:ua}=na({update(e){return e._update()},notify(e){ia[fa++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ga(e))}}),da=0,fa=0,pa,ma=0;function ha(e){try{++ma,e()}finally{--ma||_a()}}function ga(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=sa(n,e)}function _a(){if(!(ma>0)){for(;da<fa;){let e=ia[da];ia[da++]=void 0,e.notify()}da=0,fa=0}}function va(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return pa!==void 0&&oa(i,pa,aa),i._snapshot},subscribe(e){let t=ra(e),n={current:!1},r=ya(()=>{i.get(),n.current?(pa=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=pa,o=t?.compare??Object.is;if(n)pa=i,++aa,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{pa=a,n&&(i.flags&=-5),ga(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&la(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ua(e)}}else e&32&&(i.flags=e&-33);return pa!==void 0&&oa(i,pa,aa),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ca(e),ua(e),_a())}},i}function ya(e){let t=()=>{let t=pa;pa=n,++aa,n.depsTail=void 0,n.flags=6;try{return e()}finally{pa=t,n.flags&=-5,ga(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&la(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,ga(this)}};return t(),n}var ba=n((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),xa=n(((e,t)=>{t.exports=ba()})),Sa=n((e=>{var t=r(),n=xa();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Ca=n(((e,t)=>{t.exports=Sa()}))();function wa(e,t){return e===t}function Ta(e,t=e=>e,n){let r=n?.compare??wa,i=(0,F.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,F.useCallback)(()=>e.get(),[e]);return(0,Ca.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var Ea={};function Da(e,t){let n=F.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Zt(n.current,i):i}}function Oa(e){let t=Qi(),n=F.useContext(e.from?ta:ea),r=e.from??n,i=t.stores.getMatchStore(r),a=Da(e,t),o=Ta(i,e=>e?a(e):Ea);if(o!==Ea)return o;(e.shouldThrow??!0)&&dn()}function ka(e){return Oa({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Aa(e){let{select:t,...n}=e;return Oa({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ja(e){return Oa({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ma(e){return Oa({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Na(e){let t=Qi();return F.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Pa(e){return Oa({...e,select:t=>e.select?e.select(t.context):t.context})}function Fa(...e){let t=F.useRef(e),n=t.current;return e.forEach((e,t)=>{$t(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Ia(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(Vi)})}function La(e,t){let n=typeof e==`string`&&an(e);if(n)return t.has(n)?e:null}function Ra(e,t,n,r){let i=gn(e.pathname,r),a=gn(t.pathname,r);return(n?.exact?i!==a:!i.startsWith(a)||i.length!==a.length&&i[a.length]!==`/`)||(n?.includeSearch??!0)&&!$t(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||e.hash===t.hash}function za(e,t,n){let r=Qi(),i=F.useRef(null),a=F.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,disabled:u,target:d,onClick:f,onBlur:p,onFocus:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:_}=e,[v,y,b]=Fa(e.search,e.params,o),x=F.useContext(ea),S=(r.stores._linkScopes??={})[x]??=$i(r,x),[C,w,T]=F.useMemo(()=>{let t=La(s,r.protocolAllowlist);if(t!==void 0){let n=[t??void 0];return[e,()=>n]}let n={...e},i,a,o,c=()=>{let e=S[0]();if(e!==i){n._fromLocation=e;let t=r.buildLocation(n),o=qa(t,r,u),s=u||o&&!an(o)?Ra(e,t,b,r.basepath):void 0;(!a||a[0]!==o||a[1]!==s)&&(a=[o,s]),i=e}return a};return[n,c,b?.includeHash&&(()=>{let e=c();return e[1]?o??=[e[0],!1]:e})]},[r,S,e.from,e.hash,e.href,s,v,y,e.state,e.mask,e.unsafeRelative,b,u]),[E,D]=F.useSyncExternalStore(S[1],w,T||w),O=D===void 0&&E,k=u||E===void 0,A=F.useRef(!1),ee=e.reloadDocument||O||k?!1:c??r.options.defaultPreload,j=l??r.options.defaultPreloadDelay??0,M=F.useCallback(e=>{let t=e?.isIntersecting;t??ee===`intent`?j?i.t??=setTimeout(()=>{i.t=void 0,Ia(r,C)},j):Ia(r,C):t===!1&&Ga(i)},[r,C,i,ee,j]);F.useEffect(()=>{if(!ee)return;ee===`render`&&!A.current&&(A.current=!0,Ia(r,C));let e=!0,t;return ee===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&M(t.pop())},{rootMargin:`100px`}),t.observe(i.current)),()=>{e=!1,t?.disconnect(),Ga(i)}},[r,C,ee,M,i]);let te=Ua(e,n);if(te.ref=t?a:i,O)return te.href=O,te;let ne=t=>{let n=d??t.currentTarget.getAttribute(`target`);!k&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(!n||n===`_self`)&&t.button===0&&(t.preventDefault(),Ga(i),r.navigate({...e,_fromLocation:C._fromLocation}))},re=()=>{ee===`intent`&&Ia(r,C)},ie=()=>{ee===`intent`&&Ga(i)};return te.onClick=Ka(f,ne),te.onBlur=Ka(p,ie),te.onFocus=Ka(m,M),te.onMouseEnter=Ka(h,M),te.onMouseLeave=Ka(g,ie),te.onTouchStart=Ka(_,re),Wa(te,e,D,E,k,n)}var Ba={},Va={className:`active`},Ha=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function Ua(e,t){let n={};for(let r in e)Ha.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function Wa(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=Kt(n?o:s,{})??(n?Va:Ba);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var Ga=e=>{clearTimeout(e.t),e.t=void 0},Ka=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function qa(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!sn(i,t.protocolAllowlist))return i}var Ja=F.memo(F.forwardRef((e,t)=>{let n=e._asChild||`a`,r=za(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return F.createElement(n,r,i)}),Ya);function Ya(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!Ha.has(r)||!$t(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var Xa=class extends Hi{constructor(e){super(e),this.useMatch=e=>Oa({...e,from:this.id}),this.useRouteContext=e=>Pa({...e,from:this.id}),this.useSearch=e=>Ma({...e,from:this.id}),this.useParams=e=>ja({...e,from:this.id}),this.useLoaderDeps=e=>Aa({...e,from:this.id}),this.useLoaderData=e=>ka({...e,from:this.id}),this.useNavigate=()=>Na({from:this.fullPath}),this.Link=F.forwardRef((e,t)=>(0,I.jsx)(Ja,{ref:t,from:this.fullPath,...e}))}};function Za(e){return new Xa(e)}var Qa=class extends Ui{constructor(e){super(e),this.useMatch=e=>Oa({...e,from:this.id}),this.useRouteContext=e=>Pa({...e,from:this.id}),this.useSearch=e=>Ma({...e,from:this.id}),this.useParams=e=>ja({...e,from:this.id}),this.useLoaderDeps=e=>Aa({...e,from:this.id}),this.useLoaderData=e=>ka({...e,from:this.id}),this.useNavigate=()=>Na({from:this.fullPath}),this.Link=F.forwardRef((e,t)=>(0,I.jsx)(Ja,{ref:t,from:this.fullPath,...e}))}};function $a(e){return new Qa(e)}function eo(e){let t=Qi(),n=`not-found-${Ta(t.stores.location,e=>e.pathname)}-${Ta(t.stores.status)}`;return(0,I.jsx)(Wi,{getResetKey:()=>n,onCatch:(t,n)=>{if(Sn(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Sn(t))return e.fallback?.(t);throw t},children:e.children})}function to(){return(0,I.jsx)(`p`,{children:`Not Found`})}function no(e,t,n){return t.options.notFoundComponent?(0,I.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,I.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,I.jsx)(to,{})}function ro(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,I.jsx)(n,{}):null}var io=(e,t)=>e[0]===t[0]&&e[1]===t[1],ao=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,oo=F.memo(function({routeId:e}){let t=Qi();return so(t,Ta(t.stores.getMatchStore(e)))});function so(e,t){let n=e.routesById[t.routeId],r=ro(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=ao(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,I.jsx)(co,{match:t});s&&(l=(0,I.jsx)(Ji,{fallback:r,children:l})),o&&(l=(0,I.jsx)(eo,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return F.createElement(o,e)},children:l})),i&&(l=(0,I.jsx)(Wi,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Sn(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,I.jsx)(F.Suspense,{fallback:r,children:l}));let u=n.isRoot&&n.options.shellComponent;return u?(0,I.jsx)(ea.Provider,{value:t.routeId,children:(0,I.jsxs)(u,{children:[l,null]})}):(0,I.jsxs)(ea.Provider,{value:t.routeId,children:[l,null]})}var co=F.memo(function({match:e}){let t=Qi(),n=e.routeId,r=t.routesById[n],i=F.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=F.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,I.jsx)(e,{},i):(0,I.jsx)(lo,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!ao(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return ro(t,r)}if(e.status===`notFound`)return no(t,r,e.error);if(e.status===`error`)throw e.error;return a}),lo=F.memo(function(){let e=Qi(),t=F.useContext(ea),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Ta(a,e=>[!!e._notFound,e.error],{compare:io}),i=Ta(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return no(e,e.routesById[t],r);if(!i)return null;let a=(0,I.jsx)(oo,{routeId:i});return t===`__root__`?(0,I.jsx)(F.Suspense,{fallback:ro(e),children:a}):a});function uo(e,t){let n=e[1];e.length=0,n?.(t)}function fo({t:e}){let t=Qi(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{uo(n,!1),n.push(i,a),e(t),F.startTransition(r)}),Wt(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(mn(r.publicHref)!==mn(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Nr(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function po(){let e=Qi(),t=e.routesById[Wn],n=ro(e,t),r=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(fo,{t:F.useState()[1]}),e.ssr?(0,I.jsx)(mo,{}):(0,I.jsx)(F.Suspense,{fallback:n,children:(0,I.jsx)(mo,{})})]});return e.options.InnerWrap?(0,I.jsx)(e.options.InnerWrap,{children:r}):r}function mo(){let e=Qi(),t=e._rendered,n=Ta(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;Wt(()=>{t[0]===n&&uo(t,!0)},[t,n]);let a=i?(0,I.jsx)(oo,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,I.jsx)(Wi,{getResetKey:()=>r,onCatch:void 0,children:a})}var ho=e=>({createMutableStore:va,createReadonlyStore:va,batch:ha}),go=e=>new _o(e),_o=class extends Lr{constructor(e){super(e,ho)}};function vo({router:e,children:t,...n}){Jt(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,I.jsx)(Zi.Provider,{value:e,children:t});return e.options.Wrap?(0,I.jsx)(e.options.Wrap,{children:r}):r}function yo({router:e,...t}){return(0,I.jsx)(vo,{router:e,...t,children:(0,I.jsx)(po,{})})}var bo=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),eee=n(((e,t)=>{t.exports=bo()})),xo=n((e=>{var t=eee(),n=r(),i=a();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function h(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function g(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function _(e){var t=[null,null],n=h(e);return n===null||v(t,e,n.child,{foundSelf:!1}),t}function v(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&v(e,t,n.child,r))return!0;n=n.sibling}return!1}function y(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var b=null,x=null;function S(e,t,n){return e===n||e===t&&(b=e,!0)}function C(e,t,n){return e===n?(x=e,!1):e===t&&(x!==null&&(b=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function T(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,D=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),A=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),j=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function he(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case A:return`Fragment`;case j:return`Profiler`;case ee:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case te:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?he(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ge=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ye=[],be=-1;function xe(e){return{current:e}}function Se(e){0>be||(e.current=ye[be],ye[be]=null,be--)}function Ce(e,t){be++,ye[be]=e.current,e.current=t}var we=xe(null),Te=xe(null),Ee=xe(null),De=xe(null);function Oe(e,t){switch(Ce(Ee,t),Ce(Te,e),Ce(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Sp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Sp(t),e=Cp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Se(we),Ce(we,e)}function ke(){Se(we),Se(Te),Se(Ee)}function Ae(e){var t=e.memoizedState;t!==null&&(yh._currentValue=t.memoizedState,Ce(De,e)),t=we.current;var n=Cp(t,e.type);t!==n&&(Ce(Te,e),Ce(we,n))}function je(e){Te.current===e&&(Se(we),Se(Te)),De.current===e&&(Se(De),yh._currentValue=ve)}var Me,Ne;function Pe(e){if(Me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||``,Ne=-1<e.stack.indexOf(`
|
|
4
4
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
@@ -92,7 +92,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
92
92
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
93
93
|
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=DP(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}AP.peek=jP;function AP(e){return e.value||``}function jP(){return`<`}MP.peek=NP;function MP(e,t,n,r){let i=xP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function NP(){return`!`}PP.peek=FP;function PP(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function FP(){return`!`}IP.peek=LP;function IP(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function LP(){return"`"}function RP(e,t){let n=fT(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}zP.peek=BP;function zP(e,t,n,r){let i=xP(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(RP(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function BP(e,t,n){return RP(e,n)?`<`:`[`}VP.peek=HP;function VP(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function HP(){return`[`}function UP(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function WP(e){let t=UP(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function GP(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function KP(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function qP(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?GP(n):UP(n),s=e.ordered?o===`.`?`)`:`.`:WP(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),KP(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function JP(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function YP(e,t,n,r){let i=JP(n),a=n.bulletCurrent||UP(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function XP(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function ZP(e,t,n,r){if(!e.children.some(function(e){return uP(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function QP(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$P.attention=eF,$P.peek=tF;function $P(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function eF(e,t){return{construct:`strong`,markers:QP(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function tF(e,t,n){return n.options.strong||`*`}function nF(e,t,n,r){let i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function rF(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function iF(e,t,n){let r=(KP(n)+(n.options.ruleSpaces?` `:``)).repeat(rF(n));return n.options.ruleSpaces?r.slice(0,-1):r}var aF={blockquote:dP,break:hP,code:yP,definition:SP,emphasis:wP,hardBreak:hP,heading:kP,html:AP,image:MP,imageReference:PP,inlineCode:IP,link:zP,linkReference:VP,list:qP,listItem:YP,paragraph:XP,root:ZP,strong:$P,text:nF,thematicBreak:iF};function oF(){return{enter:{table:sF,tableData:dF,tableHeader:dF,tableRow:lF},exit:{codeText:fF,table:cF,tableData:uF,tableHeader:uF,tableRow:uF}}}function sF(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function cF(e){this.exit(e),this.data.inTable=void 0}function lF(e){this.enter({type:`tableRow`,children:[]},e)}function uF(e){this.exit(e)}function dF(e){this.enter({type:`tableCell`,children:[]},e)}function fF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pF));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pF(e,t){return t===`|`?t:e}function mF(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
94
94
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
95
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return sP(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=aF.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function hF(){return{exit:{taskListCheckValueChecked:_F,taskListCheckValueUnchecked:_F,paragraph:vF}}}function gF(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:yF}}}function _F(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function vF(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function yF(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=aF.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function bF(){return[wN(),JN(),$N(),oF(),hF()]}function xF(e){return{extensions:[TN(),YN(e),eP(),mF(e),gF()]}}var SF={tokenize:IF,partial:!0},CF={tokenize:LF,partial:!0},wF={tokenize:RF,partial:!0},TF={tokenize:zF,partial:!0},EF={tokenize:BF,partial:!0},DF={name:`wwwAutolink`,tokenize:PF,previous:VF},OF={name:`protocolAutolink`,tokenize:FF,previous:HF},kF={name:`emailAutolink`,tokenize:NF,previous:UF},AF={};function jF(){return{text:AF}}for(var MF=48;MF<123;)AF[MF]=kF,MF++,MF===58?MF=65:MF===91&&(MF=97);AF[43]=kF,AF[45]=kF,AF[46]=kF,AF[95]=kF,AF[72]=[kF,OF],AF[104]=[kF,OF],AF[87]=[kF,DF],AF[119]=[kF,DF];function NF(e,t,n){let r=this,i,a;return o;function o(t){return!WF(t)||!UF.call(r,r.previous)||GF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return WF(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(EF,u,l)(t):t===45||t===95||wT(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&CT(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function PF(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!VF.call(r,r.previous)||GF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(SF,e.attempt(CF,e.attempt(wF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function FF(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&HF.call(r,r.previous)&&!GF(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(CT(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||TT(t)||DT(t)||AT(t)||kT(t)?n(t):e.attempt(CF,e.attempt(wF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function IF(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function LF(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(TF,c,s)(t):t===null||DT(t)||AT(t)||t!==45&&kT(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function RF(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(TF,t,a)(o):o===null||DT(o)||AT(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function zF(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||DT(o)||AT(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||DT(e)||AT(e)?t(e):r(e)}function a(e){return CT(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):CT(t)?(e.consume(t),o):n(t)}}function BF(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return wT(e)?n(e):t(e)}}function VF(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||DT(e)}function HF(e){return!CT(e)}function UF(e){return!(e===47||WF(e))}function WF(e){return e===43||e===45||e===46||e===95||wT(e)}function GF(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var KF={tokenize:eI,partial:!0};function qF(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:ZF,continuation:{tokenize:QF},exit:$F}},text:{91:{name:`gfmFootnoteCall`,tokenize:XF},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:JF,resolveTo:YF}}}}function JF(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=ST(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function YF(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function XF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||DT(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ST(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return DT(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function ZF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||DT(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ST(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return DT(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),NT(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function QF(e,t,n){return e.check(HT,t,e.attempt(KF,t,n))}function $F(e){e.exit(`gfmFootnoteDefinition`)}function eI(e,t,n){let r=this;return NT(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function tI(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&_T(o,o.length,0,zT(s,e.slice(r+1,n),t)),_T(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),_T(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=RT(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=RT(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var nI=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){rI(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function rI(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function iI(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function aI(){return{flow:{null:{name:`table`,tokenize:oI,resolveAll:sI}}}}function oI(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):V(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):OT(t)?NT(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||DT(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,OT(t)?NT(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return OT(t)?NT(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||V(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return OT(t)?NT(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||V(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||V(n)?(e.exit(`tableRow`),t(n)):OT(n)?NT(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||DT(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function sI(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new nI;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(lI(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=cI(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=cI(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=cI(f,t,o,i,n,d)):(o[0]=o[1],d=cI(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&lI(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=iI(t.events,n))}return e}function cI(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},uI(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=uI(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=uI(t.events,n[2]),a=uI(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},uI(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function lI(e,t,n,r,i){let a=[],o=uI(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function uI(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var dI={name:`tasklistCheck`,tokenize:pI};function fI(){return{text:{91:dI}}}function pI(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return DT(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return V(r)?t(r):OT(r)?e.check({tokenize:mI},t,n)(r):n(r)}}function mI(e,t,n){return NT(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function hI(e){return bT([jF(),qF(),tI(e),aI(),fI()])}var gI={};function _I(e){let t=this,n=e||gI,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(hI(n)),a.push(bF()),o.push(xF(n))}var vI=[{id:`one-dark-darker`,name:`One Dark Darker`,codeTheme:`one-dark-pro`,background:`#15181C`,foreground:`#ABB2BF`,cursor:`#B3BAC5`,selectionBackground:`#3B414D`,palette:[`#4A4F5A`,`#EE5D69`,`#97C775`,`#B68353`,`#61AFEF`,`#C678DD`,`#56B6C2`,`#CCCCCC`,`#616A7B`,`#FE808A`,`#C2DEAD`,`#D1A47A`,`#93CFFF`,`#E0A8F1`,`#82D2DC`,`#FFFFFF`]},{id:`one-dark-pro`,name:`One Dark Pro`,codeTheme:`one-dark-pro`,background:`#282C34`,foreground:`#ABB2BF`,cursor:`#528BFF`,selectionBackground:`#41454E`,palette:[`#3F4451`,`#E05561`,`#8CC265`,`#D18F52`,`#4AA5F0`,`#C162DE`,`#42B3C2`,`#D7DAE0`,`#4F5666`,`#FF616E`,`#A5E075`,`#F0A45D`,`#4DC4FF`,`#DE73FF`,`#4CD1E0`,`#E6E6E6`]},{id:`dracula`,name:`Dracula`,codeTheme:`dracula`,background:`#282A36`,foreground:`#F8F8F2`,cursor:`#F8F8F2`,selectionBackground:`#44475A`,palette:[`#21222C`,`#FF5555`,`#50FA7B`,`#F1FA8C`,`#BD93F9`,`#FF79C6`,`#8BE9FD`,`#F8F8F2`,`#6272A4`,`#FF6E6E`,`#69FF94`,`#FFFFA5`,`#D6ACFF`,`#FF92DF`,`#A4FFFF`,`#FFFFFF`]},{id:`tokyo-night`,name:`Tokyo Night`,codeTheme:`tokyo-night`,background:`#1A1B26`,foreground:`#C0CAF5`,cursor:`#C0CAF5`,selectionBackground:`#33467C`,palette:[`#15161E`,`#F7768E`,`#9ECE6A`,`#E0AF68`,`#7AA2F7`,`#BB9AF7`,`#7DCFFF`,`#A9B1D6`,`#414868`,`#F7768E`,`#9ECE6A`,`#E0AF68`,`#7AA2F7`,`#BB9AF7`,`#7DCFFF`,`#C0CAF5`]},{id:`catppuccin-mocha`,name:`Catppuccin Mocha`,codeTheme:`catppuccin-mocha`,background:`#1E1E2E`,foreground:`#CDD6F4`,cursor:`#F5E0DC`,selectionBackground:`#585B70`,palette:[`#45475A`,`#F38BA8`,`#A6E3A1`,`#F9E2AF`,`#89B4FA`,`#F5C2E7`,`#94E2D5`,`#BAC2DE`,`#585B70`,`#F38BA8`,`#A6E3A1`,`#F9E2AF`,`#89B4FA`,`#F5C2E7`,`#94E2D5`,`#A6ADC8`]},{id:`nord`,name:`Nord`,codeTheme:`nord`,background:`#2E3440`,foreground:`#D8DEE9`,cursor:`#D8DEE9`,selectionBackground:`#434C5E`,palette:[`#3B4252`,`#BF616A`,`#A3BE8C`,`#EBCB8B`,`#81A1C1`,`#B48EAD`,`#88C0D0`,`#E5E9F0`,`#4C566A`,`#BF616A`,`#A3BE8C`,`#EBCB8B`,`#81A1C1`,`#B48EAD`,`#8FBCBB`,`#ECEFF4`]},{id:`gruvbox-dark`,name:`Gruvbox Dark`,codeTheme:`gruvbox-dark-medium`,background:`#282828`,foreground:`#EBDBB2`,cursor:`#EBDBB2`,selectionBackground:`#504945`,palette:[`#282828`,`#CC241D`,`#98971A`,`#D79921`,`#458588`,`#B16286`,`#689D6A`,`#A89984`,`#928374`,`#FB4934`,`#B8BB26`,`#FABD2F`,`#83A598`,`#D3869B`,`#8EC07C`,`#EBDBB2`]},{id:`solarized-dark`,name:`Solarized Dark`,codeTheme:`solarized-dark`,background:`#002B36`,foreground:`#839496`,cursor:`#839496`,selectionBackground:`#073642`,palette:[`#073642`,`#DC322F`,`#859900`,`#B58900`,`#268BD2`,`#D33682`,`#2AA198`,`#EEE8D5`,`#002B36`,`#CB4B16`,`#586E75`,`#657B83`,`#839496`,`#6C71C4`,`#93A1A1`,`#FDF6E3`]},{id:`github-dark`,name:`GitHub Dark`,codeTheme:`github-dark`,background:`#0D1117`,foreground:`#E6EDF3`,cursor:`#E6EDF3`,selectionBackground:`#264F78`,palette:[`#484F58`,`#FF7B72`,`#3FB950`,`#D29922`,`#58A6FF`,`#BC8CFF`,`#39C5CF`,`#B1BAC4`,`#6E7681`,`#FFA198`,`#56D364`,`#E3B341`,`#79C0FF`,`#D2A8FF`,`#56D4DD`,`#FFFFFF`]},{id:`rose-pine`,name:`Rosé Pine`,codeTheme:`rose-pine`,background:`#191724`,foreground:`#E0DEF4`,cursor:`#E0DEF4`,selectionBackground:`#403D52`,palette:[`#26233A`,`#EB6F92`,`#31748F`,`#F6C177`,`#9CCFD8`,`#C4A7E7`,`#EBBCBA`,`#E0DEF4`,`#6E6A86`,`#EB6F92`,`#31748F`,`#F6C177`,`#9CCFD8`,`#C4A7E7`,`#EBBCBA`,`#E0DEF4`]}];function yI(){let e=Z().prefs.theme,t=vI.find(t=>t.id===e);if(t===void 0)throw Error(`unknown theme ${e}`);return t}function bI(){let e=Q(e=>e.prefs.theme),t=vI.find(t=>t.id===e);if(t===void 0)throw Error(`unknown theme ${e}`);return t.codeTheme}function xI(){let e=yI(),t=document.documentElement.style;t.setProperty(`--bg`,e.background),t.setProperty(`--text`,e.foreground),t.setProperty(`--blue`,e.palette[4]),t.setProperty(`--danger`,e.palette[1]),t.setProperty(`--green`,e.palette[2]),t.setProperty(`--yellow`,e.palette[3]),document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,e.background)}function SI(e){let[t,n]=(0,F.useState)(null),r=bI();return(0,F.useEffect)(()=>{let t=!0;return it(async()=>{let{getSharedHighlighter:e}=await import(`./dist-DflF8aCJ.js`);return{getSharedHighlighter:e}},__vite__mapDeps([8,9,2,10])).then(({getSharedHighlighter:t})=>t({themes:[r],langs:[e.language],preferredHighlighter:`shiki-wasm`}).then(t=>({highlighter:t,lang:e.language})).catch(()=>t({themes:[r],langs:[`text`],preferredHighlighter:`shiki-wasm`}).then(e=>({highlighter:e,lang:`text`})))).then(({highlighter:t,lang:n})=>t.codeToHast(e.code,{lang:n,themes:{light:r,dark:r},defaultColor:!1,transformers:[{pre(e){delete e.properties.style}}]})).then(e=>{t&&n((0,I.jsx)(`div`,{className:`chat-markdown-shiki`,children:iT(e,{Fragment:F.Fragment,jsx:I.jsx,jsxs:I.jsxs})}))}).catch(e=>console.error(e)),()=>{t=!1}},[e.code,e.language,r]),t===null?(0,I.jsx)(`pre`,{children:(0,I.jsx)(`code`,{children:e.code})}):t}function CI(){let[e,t]=(0,F.useState)(!1);async function n(e){try{if(!window.isSecureContext)throw Error(`Copying needs https or localhost`);await navigator.clipboard.writeText(e),t(!0),setTimeout(()=>t(!1),1500)}catch(e){R9(e)}}return{copied:e,copy:n}}function wI(e){let t=(0,F.useRef)(null),[n,r]=(0,F.useState)(!0),i=CI(),a=n?`Collapse table cells`:`Expand table cells`,o=i.copied?`Copied`:`Copy table`;function s(e){let n=t.current;if(n===null)return;let r=[...n.rows].map(e=>[...e.cells].map(e=>(e.textContent??``).trim())),a=e===`markdown`?r.flatMap((e,t)=>{let n=`| ${e.map(e=>e.replaceAll(`|`,`\\|`)).join(` | `)} |`;return t===0?[n,`| ${e.map(()=>`---`).join(` | `)} |`]:[n]}).join(`
|
|
95
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return sP(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=aF.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function hF(){return{exit:{taskListCheckValueChecked:_F,taskListCheckValueUnchecked:_F,paragraph:vF}}}function gF(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:yF}}}function _F(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function vF(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function yF(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=aF.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function bF(){return[wN(),JN(),$N(),oF(),hF()]}function xF(e){return{extensions:[TN(),YN(e),eP(),mF(e),gF()]}}var SF={tokenize:IF,partial:!0},CF={tokenize:LF,partial:!0},wF={tokenize:RF,partial:!0},TF={tokenize:zF,partial:!0},EF={tokenize:BF,partial:!0},DF={name:`wwwAutolink`,tokenize:PF,previous:VF},OF={name:`protocolAutolink`,tokenize:FF,previous:HF},kF={name:`emailAutolink`,tokenize:NF,previous:UF},AF={};function jF(){return{text:AF}}for(var MF=48;MF<123;)AF[MF]=kF,MF++,MF===58?MF=65:MF===91&&(MF=97);AF[43]=kF,AF[45]=kF,AF[46]=kF,AF[95]=kF,AF[72]=[kF,OF],AF[104]=[kF,OF],AF[87]=[kF,DF],AF[119]=[kF,DF];function NF(e,t,n){let r=this,i,a;return o;function o(t){return!WF(t)||!UF.call(r,r.previous)||GF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return WF(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(EF,u,l)(t):t===45||t===95||wT(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&CT(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function PF(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!VF.call(r,r.previous)||GF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(SF,e.attempt(CF,e.attempt(wF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function FF(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&HF.call(r,r.previous)&&!GF(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(CT(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||TT(t)||DT(t)||AT(t)||kT(t)?n(t):e.attempt(CF,e.attempt(wF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function IF(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function LF(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(TF,c,s)(t):t===null||DT(t)||AT(t)||t!==45&&kT(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function RF(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(TF,t,a)(o):o===null||DT(o)||AT(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function zF(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||DT(o)||AT(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||DT(e)||AT(e)?t(e):r(e)}function a(e){return CT(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):CT(t)?(e.consume(t),o):n(t)}}function BF(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return wT(e)?n(e):t(e)}}function VF(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||DT(e)}function HF(e){return!CT(e)}function UF(e){return!(e===47||WF(e))}function WF(e){return e===43||e===45||e===46||e===95||wT(e)}function GF(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var KF={tokenize:eI,partial:!0};function qF(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:ZF,continuation:{tokenize:QF},exit:$F}},text:{91:{name:`gfmFootnoteCall`,tokenize:XF},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:JF,resolveTo:YF}}}}function JF(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=ST(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function YF(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function XF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||DT(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ST(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return DT(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function ZF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||DT(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ST(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return DT(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),NT(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function QF(e,t,n){return e.check(HT,t,e.attempt(KF,t,n))}function $F(e){e.exit(`gfmFootnoteDefinition`)}function eI(e,t,n){let r=this;return NT(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function tI(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&_T(o,o.length,0,zT(s,e.slice(r+1,n),t)),_T(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),_T(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=RT(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=RT(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var nI=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){rI(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function rI(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function iI(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function aI(){return{flow:{null:{name:`table`,tokenize:oI,resolveAll:sI}}}}function oI(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):V(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):OT(t)?NT(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||DT(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,OT(t)?NT(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return OT(t)?NT(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||V(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return OT(t)?NT(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||V(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||V(n)?(e.exit(`tableRow`),t(n)):OT(n)?NT(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||DT(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function sI(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new nI;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(lI(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=cI(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=cI(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=cI(f,t,o,i,n,d)):(o[0]=o[1],d=cI(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&lI(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=iI(t.events,n))}return e}function cI(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},uI(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=uI(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=uI(t.events,n[2]),a=uI(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},uI(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function lI(e,t,n,r,i){let a=[],o=uI(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function uI(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var dI={name:`tasklistCheck`,tokenize:pI};function fI(){return{text:{91:dI}}}function pI(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return DT(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return V(r)?t(r):OT(r)?e.check({tokenize:mI},t,n)(r):n(r)}}function mI(e,t,n){return NT(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function hI(e){return bT([jF(),qF(),tI(e),aI(),fI()])}var gI={};function _I(e){let t=this,n=e||gI,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(hI(n)),a.push(bF()),o.push(xF(n))}var vI=[{id:`one-dark-darker`,name:`One Dark Darker`,codeTheme:`one-dark-pro`,background:`#15181C`,foreground:`#ABB2BF`,cursor:`#B3BAC5`,selectionBackground:`#3B414D`,palette:[`#4A4F5A`,`#EE5D69`,`#97C775`,`#B68353`,`#61AFEF`,`#C678DD`,`#56B6C2`,`#CCCCCC`,`#616A7B`,`#FE808A`,`#C2DEAD`,`#D1A47A`,`#93CFFF`,`#E0A8F1`,`#82D2DC`,`#FFFFFF`]},{id:`one-dark-pro`,name:`One Dark Pro`,codeTheme:`one-dark-pro`,background:`#282C34`,foreground:`#ABB2BF`,cursor:`#528BFF`,selectionBackground:`#41454E`,palette:[`#3F4451`,`#E05561`,`#8CC265`,`#D18F52`,`#4AA5F0`,`#C162DE`,`#42B3C2`,`#D7DAE0`,`#4F5666`,`#FF616E`,`#A5E075`,`#F0A45D`,`#4DC4FF`,`#DE73FF`,`#4CD1E0`,`#E6E6E6`]},{id:`dracula`,name:`Dracula`,codeTheme:`dracula`,background:`#282A36`,foreground:`#F8F8F2`,cursor:`#F8F8F2`,selectionBackground:`#44475A`,palette:[`#21222C`,`#FF5555`,`#50FA7B`,`#F1FA8C`,`#BD93F9`,`#FF79C6`,`#8BE9FD`,`#F8F8F2`,`#6272A4`,`#FF6E6E`,`#69FF94`,`#FFFFA5`,`#D6ACFF`,`#FF92DF`,`#A4FFFF`,`#FFFFFF`]},{id:`tokyo-night`,name:`Tokyo Night`,codeTheme:`tokyo-night`,background:`#1A1B26`,foreground:`#C0CAF5`,cursor:`#C0CAF5`,selectionBackground:`#33467C`,palette:[`#15161E`,`#F7768E`,`#9ECE6A`,`#E0AF68`,`#7AA2F7`,`#BB9AF7`,`#7DCFFF`,`#A9B1D6`,`#414868`,`#F7768E`,`#9ECE6A`,`#E0AF68`,`#7AA2F7`,`#BB9AF7`,`#7DCFFF`,`#C0CAF5`]},{id:`catppuccin-mocha`,name:`Catppuccin Mocha`,codeTheme:`catppuccin-mocha`,background:`#1E1E2E`,foreground:`#CDD6F4`,cursor:`#F5E0DC`,selectionBackground:`#585B70`,palette:[`#45475A`,`#F38BA8`,`#A6E3A1`,`#F9E2AF`,`#89B4FA`,`#F5C2E7`,`#94E2D5`,`#BAC2DE`,`#585B70`,`#F38BA8`,`#A6E3A1`,`#F9E2AF`,`#89B4FA`,`#F5C2E7`,`#94E2D5`,`#A6ADC8`]},{id:`nord`,name:`Nord`,codeTheme:`nord`,background:`#2E3440`,foreground:`#D8DEE9`,cursor:`#D8DEE9`,selectionBackground:`#434C5E`,palette:[`#3B4252`,`#BF616A`,`#A3BE8C`,`#EBCB8B`,`#81A1C1`,`#B48EAD`,`#88C0D0`,`#E5E9F0`,`#4C566A`,`#BF616A`,`#A3BE8C`,`#EBCB8B`,`#81A1C1`,`#B48EAD`,`#8FBCBB`,`#ECEFF4`]},{id:`gruvbox-dark`,name:`Gruvbox Dark`,codeTheme:`gruvbox-dark-medium`,background:`#282828`,foreground:`#EBDBB2`,cursor:`#EBDBB2`,selectionBackground:`#504945`,palette:[`#282828`,`#CC241D`,`#98971A`,`#D79921`,`#458588`,`#B16286`,`#689D6A`,`#A89984`,`#928374`,`#FB4934`,`#B8BB26`,`#FABD2F`,`#83A598`,`#D3869B`,`#8EC07C`,`#EBDBB2`]},{id:`solarized-dark`,name:`Solarized Dark`,codeTheme:`solarized-dark`,background:`#002B36`,foreground:`#839496`,cursor:`#839496`,selectionBackground:`#073642`,palette:[`#073642`,`#DC322F`,`#859900`,`#B58900`,`#268BD2`,`#D33682`,`#2AA198`,`#EEE8D5`,`#002B36`,`#CB4B16`,`#586E75`,`#657B83`,`#839496`,`#6C71C4`,`#93A1A1`,`#FDF6E3`]},{id:`github-dark`,name:`GitHub Dark`,codeTheme:`github-dark`,background:`#0D1117`,foreground:`#E6EDF3`,cursor:`#E6EDF3`,selectionBackground:`#264F78`,palette:[`#484F58`,`#FF7B72`,`#3FB950`,`#D29922`,`#58A6FF`,`#BC8CFF`,`#39C5CF`,`#B1BAC4`,`#6E7681`,`#FFA198`,`#56D364`,`#E3B341`,`#79C0FF`,`#D2A8FF`,`#56D4DD`,`#FFFFFF`]},{id:`rose-pine`,name:`Rosé Pine`,codeTheme:`rose-pine`,background:`#191724`,foreground:`#E0DEF4`,cursor:`#E0DEF4`,selectionBackground:`#403D52`,palette:[`#26233A`,`#EB6F92`,`#31748F`,`#F6C177`,`#9CCFD8`,`#C4A7E7`,`#EBBCBA`,`#E0DEF4`,`#6E6A86`,`#EB6F92`,`#31748F`,`#F6C177`,`#9CCFD8`,`#C4A7E7`,`#EBBCBA`,`#E0DEF4`]}];function yI(){let e=Z().prefs.theme,t=vI.find(t=>t.id===e);if(t===void 0)throw Error(`unknown theme ${e}`);return t}function bI(){let e=Q(e=>e.prefs.theme),t=vI.find(t=>t.id===e);if(t===void 0)throw Error(`unknown theme ${e}`);return t.codeTheme}function xI(){let e=yI(),t=document.documentElement.style;t.setProperty(`--bg`,e.background),t.setProperty(`--text`,e.foreground),t.setProperty(`--blue`,e.palette[4]),t.setProperty(`--danger`,e.palette[1]),t.setProperty(`--green`,e.palette[2]),t.setProperty(`--yellow`,e.palette[3]),document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,e.background)}function SI(e){let[t,n]=(0,F.useState)(null),r=bI();return(0,F.useEffect)(()=>{let t=!0;return it(async()=>{let{getSharedHighlighter:e}=await import(`./dist-fLTPb8e0.js`);return{getSharedHighlighter:e}},__vite__mapDeps([8,9,2,10])).then(({getSharedHighlighter:t})=>t({themes:[r],langs:[e.language],preferredHighlighter:`shiki-wasm`}).then(t=>({highlighter:t,lang:e.language})).catch(()=>t({themes:[r],langs:[`text`],preferredHighlighter:`shiki-wasm`}).then(e=>({highlighter:e,lang:`text`})))).then(({highlighter:t,lang:n})=>t.codeToHast(e.code,{lang:n,themes:{light:r,dark:r},defaultColor:!1,transformers:[{pre(e){delete e.properties.style}}]})).then(e=>{t&&n((0,I.jsx)(`div`,{className:`chat-markdown-shiki`,children:iT(e,{Fragment:F.Fragment,jsx:I.jsx,jsxs:I.jsxs})}))}).catch(e=>console.error(e)),()=>{t=!1}},[e.code,e.language,r]),t===null?(0,I.jsx)(`pre`,{children:(0,I.jsx)(`code`,{children:e.code})}):t}function CI(){let[e,t]=(0,F.useState)(!1);async function n(e){try{if(!window.isSecureContext)throw Error(`Copying needs https or localhost`);await navigator.clipboard.writeText(e),t(!0),setTimeout(()=>t(!1),1500)}catch(e){R9(e)}}return{copied:e,copy:n}}function wI(e){let t=(0,F.useRef)(null),[n,r]=(0,F.useState)(!0),i=CI(),a=n?`Collapse table cells`:`Expand table cells`,o=i.copied?`Copied`:`Copy table`;function s(e){let n=t.current;if(n===null)return;let r=[...n.rows].map(e=>[...e.cells].map(e=>(e.textContent??``).trim())),a=e===`markdown`?r.flatMap((e,t)=>{let n=`| ${e.map(e=>e.replaceAll(`|`,`\\|`)).join(` | `)} |`;return t===0?[n,`| ${e.map(()=>`---`).join(` | `)} |`]:[n]}).join(`
|
|
96
96
|
`):r.map(e=>e.map(e=>/[",\n]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e).join(`,`)).join(`
|
|
97
97
|
`);i.copy(a)}return(0,I.jsxs)(`div`,{className:`chat-markdown-table-container`,"data-expanded":n,children:[(0,I.jsx)(`div`,{className:`chat-markdown-table-scroll`,children:(0,I.jsx)(`table`,{ref:t,children:e.children})}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex items-center justify-between select-none`,children:[(0,I.jsx)(Oe,{label:a,children:(0,I.jsx)(x,{type:`button`,variant:n?`secondary`:`ghost-muted`,size:`icon-xs`,"aria-pressed":n,"aria-label":a,onClick:()=>{let e=t.current;if(e!==null&&!n){let t=[];for(let n of e.rows)[...n.cells].forEach((e,n)=>{t[n]=Math.max(t[n]??0,e.getBoundingClientRect().width)});[...e.tHead?.rows[0]?.cells??[]].forEach((e,n)=>{e.style.minWidth=`${t[n]}px`})}r(!n)},children:(0,I.jsx)(w,{icon:n?A_:yee,className:`size-3`})})}),(0,I.jsxs)(MC,{children:[(0,I.jsx)(Oe,{label:o,children:(0,I.jsx)(PC,{asChild:!0,children:(0,I.jsx)(x,{type:`button`,variant:`ghost-muted`,size:`icon-xs`,"aria-label":o,children:(0,I.jsx)(w,{icon:i.copied?Zg:p_,className:`size-3`})})})}),(0,I.jsxs)(FC,{align:`end`,children:[(0,I.jsx)(IC,{onSelect:()=>s(`markdown`),children:`Copy as Markdown`}),(0,I.jsx)(IC,{onSelect:()=>s(`csv`),children:`Copy as CSV`})]})]})]})]})}function TI(e){let[t,n]=(0,F.useState)(e.open),r=F.Children.toArray(e.children),i=r.findIndex(e=>(0,F.isValidElement)(e)&&e.type===`summary`),a=r[i];return(0,I.jsxs)(`div`,{className:`border-border/60 my-2 border-y`,children:[(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":t,className:`text-foreground flex w-full items-center gap-2 py-2 text-left text-sm font-medium`,onClick:()=>n(!t),children:[(0,I.jsx)(w,{icon:e_,"aria-hidden":!0,className:P(`text-muted-foreground size-4 shrink-0 transition-transform`,t&&`rotate-90`)}),(0,I.jsx)(`span`,{children:(0,F.isValidElement)(a)&&a.props.children!==void 0?a.props.children:`Details`})]}),t&&(0,I.jsx)(`div`,{className:`text-foreground/80 ps-6 pb-3`,children:r.filter((e,t)=>t!==i)})]})}var EI=(0,F.lazy)(async()=>({default:(await it(async()=>{let{VideoViewer:e}=await import(`./video-viewer-CJ129jI3.js`);return{VideoViewer:e}},__vite__mapDeps([11,1,2,7,4,5,12,13]))).VideoViewer}));function Nie(e){let[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null),a=e.alt===``?e.name:e.alt;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,"aria-label":`Play ${a}`,className:P(`group focus-visible:ring-ring border-border/40 relative inline-block cursor-pointer overflow-hidden rounded-lg border bg-black align-top outline-none focus-visible:ring-2`,e.className),onClick:()=>n(!0),children:[(0,I.jsx)(`video`,{src:`${e.src}#t=0.001`,"aria-hidden":!0,tabIndex:-1,muted:!0,playsInline:!0,preload:`metadata`,className:`pointer-events-none block size-full object-contain`,onError:e.onError,onLoadedMetadata:e=>i(Number.isFinite(e.currentTarget.duration)?e.currentTarget.duration:null)}),(0,I.jsx)(`span`,{className:`absolute inset-0 grid place-items-center bg-black/10 transition-colors group-hover:bg-black/25`,children:(0,I.jsx)(`span`,{className:`grid size-12 place-items-center rounded-full bg-black/60 text-white backdrop-blur-sm transition-transform group-hover:scale-105`,children:(0,I.jsx)(w,{icon:kee,className:`size-5 translate-x-px fill-current`})})}),r!==null&&(0,I.jsx)(`span`,{className:`text-2xs absolute right-2 bottom-2 rounded-md bg-black/60 px-1.5 py-0.5 font-mono text-white tabular-nums`,children:Pw(r)})]}),t&&(0,I.jsx)(F.Suspense,{children:(0,I.jsx)(EI,{src:e.src,label:a,name:e.name,onClose:()=>n(!1)})})]})}var Pie=new Map([[`.png`,`image/png`],[`.jpg`,`image/jpeg`],[`.jpeg`,`image/jpeg`],[`.gif`,`image/gif`],[`.webp`,`image/webp`],[`.svg`,`image/svg+xml`],[`.mp4`,`video/mp4`],[`.m4v`,`video/mp4`],[`.webm`,`video/webm`],[`.mov`,`video/quicktime`],[`.mp3`,`audio/mpeg`],[`.wav`,`audio/wav`],[`.ogg`,`audio/ogg`],[`.opus`,`audio/ogg`],[`.m4a`,`audio/mp4`],[`.aac`,`audio/aac`],[`.flac`,`audio/flac`]]);function DI(e){let t=/\.[a-z0-9]+$/i.exec(e.split(/[?#]/)[0])?.[0],n=t===void 0?void 0:Pie.get(t.toLowerCase());return n?.startsWith(`image/`)===!0?`image`:n?.startsWith(`video/`)===!0?`video`:n?.startsWith(`audio/`)===!0?`audio`:null}async function OI(e,t,n){let r=await R(e,`files.media`,{projectId:t,path:n});return`${$o(e)}/api/media?${new URLSearchParams({token:r})}`}async function kI(e,t){let n=await fetch(e);if(!n.ok)throw Error(await n.text());let r=URL.createObjectURL(await n.blob()),i=document.createElement(`a`);i.href=r,i.download=t.slice(t.lastIndexOf(`/`)+1),i.click(),setTimeout(()=>URL.revokeObjectURL(r),6e4)}var Fie=(0,F.lazy)(async()=>({default:(await it(async()=>{let{AudioPlayer:e}=await import(`./audio-player-BBuXiV2_.js`);return{AudioPlayer:e}},__vite__mapDeps([14,1,2,5,13]))).AudioPlayer})),Iie={image:E_,video:Pee,audio:wee},Lie={image:lee,video:Fee,audio:jee},Rie={image:`Image unavailable`,video:`Video unavailable`,audio:`Audio unavailable`};function zie(e){let t=Q(e=>e.selection),n=CI(),[r,i]=(0,F.useState)(null);(0,F.useEffect)(()=>{if(t===null)return;let n=!0;async function r(e,t,r){try{let a=await OI(e,t,r);n&&i({path:r,src:a})}catch(e){n&&i({path:r,error:rt(e)})}}return r(t.machine,t.projectId,e.path),()=>{n=!1}},[t,e.path]);let a=r!==null&&r.path===e.path?r:null;return a!==null&&`error`in a?(0,I.jsx)(jI,{kind:DI(e.path)??`image`,reason:a.error,raw:e.raw}):(0,I.jsxs)(`span`,{className:P(`border-border bg-muted/50 flex flex-col gap-1 rounded-xl border p-1`,DI(e.path)===`audio`&&`w-fit max-w-[min(100%,36rem)]`,DI(e.path)!==`audio`&&`w-1/2`),children:[(0,I.jsxs)(`span`,{className:`text-muted-foreground flex items-center gap-1.5 pl-1.5 [contain:inline-size]`,children:[(0,I.jsx)(w,{icon:Iie[DI(e.path)??`image`],"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,I.jsx)(`span`,{className:`text-2xs min-w-0 flex-1 truncate font-mono`,title:e.path,children:e.path}),(0,I.jsx)(Oe,{label:n.copied?`Copied`:`Copy path`,children:(0,I.jsx)(x,{type:`button`,variant:`ghost-muted`,size:`icon-xs`,"aria-label":`Copy path`,onClick:()=>void n.copy(e.path),children:(0,I.jsx)(w,{icon:n.copied?Zg:p_,className:`size-3`})})}),(0,I.jsx)(Oe,{label:`Download`,children:(0,I.jsx)(x,{type:`button`,variant:`ghost-muted`,size:`icon-xs`,"aria-label":`Download`,disabled:a===null,onClick:()=>{if(a===null)throw Error(`media is still loading`);kI(a.src,e.path).catch(R9)},children:(0,I.jsx)(w,{icon:g_,className:`size-3`})})})]}),a!==null&&(0,I.jsx)(AI,{src:a.src,alt:e.alt,name:e.path,kind:DI(e.path)??`image`,raw:e.raw}),a===null&&DI(e.path)!==`audio`&&(0,I.jsx)(`span`,{className:`border-border/40 block aspect-[3/2] w-full rounded-lg border`})]})}function AI(e){let[t,n]=(0,F.useState)(null);return t===e.src?(0,I.jsx)(jI,{kind:e.kind,reason:`It could not be loaded`,raw:e.raw}):e.kind===`video`?(0,I.jsx)(Nie,{src:e.src,alt:e.alt,name:e.name,className:`block aspect-[3/2] w-full`,onError:()=>n(e.src)}):e.kind===`audio`?(0,I.jsx)(F.Suspense,{children:(0,I.jsx)(Fie,{src:e.src,label:e.alt===``?e.name:e.alt,className:`flex w-[28rem] max-w-full`,onError:()=>n(e.src)})}):(0,I.jsx)(Cw,{src:e.src,alt:e.alt,name:e.name,className:`border-border/40 block aspect-[3/2] w-full overflow-hidden rounded-lg border`,imageClassName:`size-full object-contain`,onError:()=>n(e.src)})}function jI(e){return(0,I.jsxs)(`span`,{className:`border-border/70 text-muted-foreground flex w-fit max-w-full flex-col gap-1 rounded-lg border border-dashed px-3 py-2 text-xs`,children:[(0,I.jsxs)(`span`,{className:`flex items-start gap-1.5`,children:[(0,I.jsx)(w,{icon:Lie[e.kind],"aria-hidden":!0,className:`mt-px size-3.5 shrink-0`}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:`text-foreground/80 font-medium`,children:Rie[e.kind]}),` · ${e.reason}`]})]}),(0,I.jsx)(`span`,{className:`text-2xs font-mono break-all opacity-80`,children:e.raw})]})}var Bie=(0,F.lazy)(async()=>({default:(await it(async()=>{let{ImageViewer:e}=await import(`./image-viewer-4LhMaTO_.js`);return{ImageViewer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7]))).ImageViewer})),MI=0;function Vie(e){let t=Q(e=>e.prefs.theme),[n,r]=(0,F.useState)(null);return(0,F.useEffect)(()=>{if(e===null)return;let t=!0,n=setTimeout(()=>{let n=yI();it(async()=>{let{default:e}=await import(`./mermaid.core-BvdElKsv.js`);return{default:e}},__vite__mapDeps([15,16,17,18,19,2,20,10,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37])).then(({default:t})=>(t.initialize({startOnLoad:!1,theme:`base`,themeCSS:`rect.basic, .node rect, .cluster rect, rect.actor { rx: 6px; ry: 6px } * { filter: none !important } .edgeLabel, .edgeLabel p { background-color: var(--mermaid-surface, ${n.background}) } .edgeLabel rect, .cluster rect, .relationshipLabelBox { fill: var(--mermaid-surface, ${n.background}); opacity: 1 }`,themeVariables:{darkMode:!0,fontFamily:getComputedStyle(document.body).fontFamily,fontSize:`13px`,useGradient:!1,background:n.background,primaryColor:n.selectionBackground,primaryTextColor:n.foreground,primaryBorderColor:n.palette[8],lineColor:n.palette[8],textColor:n.foreground,edgeLabelBackground:n.background,clusterBkg:n.background,clusterBorder:n.palette[0],noteBkgColor:n.palette[0],noteTextColor:n.foreground,noteBorderColor:n.palette[8],pieOpacity:`0.8`,pieStrokeColor:n.background,pieOuterStrokeColor:n.background,pieSectionTextColor:n.background,...Object.fromEntries([4,5,6,2,3,1].flatMap((e,t)=>[[`pie${t+1}`,n.palette[e]],[`git${t}`,n.palette[e]],[`cScale${t}`,n.palette[e]],[`cScaleLabel${t}`,n.background]]))}}),MI+=1,t.render(`mermaid-${MI}`,e))).then(e=>{t&&r(e.svg)}).catch(()=>{t&&r(null)})},400);return()=>{t=!1,clearTimeout(n)}},[e,t]),e===null?null:n}function Hie(e){let[t,n]=(0,F.useState)(!1);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{type:`button`,"aria-label":`View diagram`,className:`focus-visible:ring-ring flex w-full cursor-zoom-in justify-center rounded-lg px-3 pt-2 pb-3 outline-none [--mermaid-surface:color-mix(in_srgb,var(--text)_3.2%,var(--bg))] focus-visible:ring-2 [&>svg]:h-auto`,onClick:()=>n(!0),dangerouslySetInnerHTML:{__html:e.svg}}),t&&(0,I.jsx)(F.Suspense,{children:(0,I.jsx)(Bie,{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.svg)}`,alt:`Diagram`,name:`Mermaid diagram`,onClose:()=>n(!1)})})]})}var Uie={note:{label:`Note`,icon:uee,border:`border-blue-500/70`,title:`text-blue-600 dark:text-blue-400`},tip:{label:`Tip`,icon:hee,border:`border-emerald-500/70`,title:`text-emerald-600 dark:text-emerald-400`},important:{label:`Important`,icon:See,border:`border-purple-500/70`,title:`text-purple-600 dark:text-purple-400`},warning:{label:`Warning`,icon:Aee,border:`border-amber-500/70`,title:`text-amber-600 dark:text-amber-500`},caution:{label:`Caution`,icon:Eee,border:`border-red-500/70`,title:`text-red-600 dark:text-red-400`}},Wie={...XM,attributes:{...XM.attributes,blockquote:[...XM.attributes?.blockquote??[],`dataAlert`]},protocols:{...XM.protocols,href:[...XM.protocols?.href??[],`file`]}},NI=new Set;function PI(){return e=>{function t(e){e.children?.forEach(t),Gie(e)}t(e)}}function Gie(e){if(e.type!==`blockquote`)return;let t=e.children?.[0],n=t?.children?.[0];if(t?.type!==`paragraph`||n?.type!==`text`||typeof n.value!=`string`)return;let r=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\](?:\r?\n|$)/i.exec(n.value);if(r===null)return;let i=n.value.slice(r[0].length);if(i.length>0)n.value=i;else if(r[0].endsWith(`
|
|
98
98
|
`)||t.children?.length===1)t.children?.shift(),t.children?.length===0&&e.children?.shift();else return;e.data={...e.data,hProperties:{...e.data?.hProperties,dataAlert:r[1].toLowerCase()}}}var Kie={blockquote({node:e,children:t}){let n=e?.properties.dataAlert,r=n===`note`||n===`tip`||n===`important`||n===`warning`||n===`caution`?Uie[n]:null;return r===null?(0,I.jsx)(`blockquote`,{children:t}):(0,I.jsxs)(`div`,{role:`note`,className:P(`my-1 border-l-2 pl-3`,r.border),children:[(0,I.jsxs)(`p`,{className:P(`flex items-center gap-1.5 font-medium`,r.title),children:[(0,I.jsx)(w,{icon:r.icon,"aria-hidden":!0,className:`size-3.5 shrink-0`}),r.label]}),t]})},ol({node:e,start:t,children:n}){let r=e?.children.filter(e=>e.type===`element`&&e.tagName===`li`).length??0,i=t??1,a=Math.max(String(i).length,String(i+Math.max(r-1,0)).length);return(0,I.jsx)(`ol`,{start:t,ref:e=>{e!==null&&a>1&&e.style.setProperty(`--list-gutter`,`${a+2}ch`)},children:n})},a({node:e,href:t,children:n}){let r=Jie(t);if(r!==null)return(0,I.jsx)(`a`,{href:t,onClick:e=>{e.preventDefault(),ew(r)},children:n});let i=Yie(t);if(i===null)return(0,I.jsx)(`a`,{href:t,children:n});let a=e?.children.every(e=>e.type===`text`)?e.children.map(e=>e.type===`text`?e.value:``).join(``):``;return(0,I.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:a===``?n:(0,I.jsx)(Xie,{host:i,text:a})})},table({children:e}){return(0,I.jsx)(wI,{children:e})},details({open:e,children:t}){return(0,I.jsx)(TI,{open:e===!0,children:t})},img({src:e,alt:t}){return typeof e==`string`?e.startsWith(`/`)&&!e.startsWith(`//`)||e.startsWith(`./`)?(0,I.jsx)(zie,{path:decodeURI(e),alt:t??``,raw:``}):(0,I.jsx)(`span`,{className:P(`block`,DI(e)!==`audio`&&`w-1/2`),children:(0,I.jsx)(AI,{src:e,alt:t??``,name:e.startsWith(`data:`)?`Image`:e.split(/[?#]/)[0],kind:DI(e)??`image`,raw:``})}):null},pre({node:e,children:t}){let n=e?.children[0];if(n?.type!==`element`||n.tagName!==`code`)return(0,I.jsx)(`pre`,{children:t});let r=n.children.map(e=>e.type===`text`?e.value:``).join(``),i=n.properties.className,a=Array.isArray(i)?i.map(String).find(e=>e.startsWith(`language-`))?.slice(9):void 0;return(0,I.jsx)(Qie,{code:r.replace(/\n$/,``),language:a===`gitignore`?`ini`:a??`text`})}},FI=(0,F.memo)(qie);function qie(e){return(0,I.jsx)(`div`,{className:P(`chat-markdown text-foreground w-full min-w-0 text-sm leading-relaxed [overflow-wrap:anywhere] [word-break:break-word]`,e.className),"data-streaming":e.streaming===!0?``:void 0,children:(0,I.jsx)(oO,{remarkPlugins:e.lineBreaks===!0?[_I,PI,xN]:[_I,PI],rehypePlugins:e.rawHtml===!1?[]:[JM,[pN,Wie]],components:Kie,urlTransform:e=>e.startsWith(`file:`)?e:uO(e),children:e.text})})}function Jie(e){if(e===void 0||e===``||e.startsWith(`#`)||e.startsWith(`//`))return null;if(e.startsWith(`file:`))return e;if(!/^[a-z]:[\\/]/i.test(e)&&/^[a-z][a-z0-9+.-]*:/i.test(e))return null;try{return decodeURI(e)}catch{return e}}function Yie(e){if(e===void 0||!/^https?:\/\//i.test(e))return null;try{return new URL(e).host}catch{return null}}function Xie(e){let t=/^https?:\/\//i.exec(e.text)?.[0].length??Math.min(e.text.length,1);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,I.jsx)(Zie,{host:e.host}),e.text.slice(0,t)]}),Array.from(e.text.slice(t),(e,t)=>(0,I.jsxs)(`span`,{children:[e,(0,I.jsx)(`wbr`,{})]},t))]})}function Zie(e){let[t,n]=(0,F.useState)(NI.has(e.host)),r=e.host.toLowerCase(),i=r===`github.com`||r.endsWith(`.github.com`);return(0,I.jsx)(`span`,{className:`ms-[0.25em] me-[0.2em] inline-flex size-[14px] [vertical-align:-0.125em]`,"aria-hidden":!0,children:i?(0,I.jsx)(w,{icon:iee,className:`block size-full shrink-0 select-none`}):t?(0,I.jsx)(w,{icon:aee,className:`block size-full shrink-0 select-none`}):(0,I.jsx)(`img`,{src:`https://${e.host}/favicon.ico`,alt:``,loading:`lazy`,draggable:!1,className:`block size-full shrink-0 rounded-sm select-none`,onError:()=>{NI.add(e.host),n(!0)}})})}function Qie(e){let[t,n]=(0,F.useState)(!0),[r,i]=(0,F.useState)(!1),a=Vie(e.language===`mermaid`?e.code:null),o=CI(),s=t?`Disable line wrap`:`Wrap lines`,c=r?`Show diagram`:`Show code`,l=o.copied?`Copied`:`Copy code`;return(0,I.jsxs)(`div`,{className:`chat-markdown-codeblock border-border/70 bg-secondary dark:bg-input/32 my-[0.65rem] overflow-hidden rounded-lg border leading-snug dark:border-transparent`,"data-language":e.language,"data-wrap":t,children:[(0,I.jsxs)(`div`,{className:`chat-markdown-codeblock-header flex items-center justify-between gap-2 pt-1.5 pr-1.5 pb-0 pl-3 select-none`,children:[(0,I.jsx)(`span`,{className:`text-2xs inline-flex min-w-0 items-center gap-1.5 font-mono`,children:Ie(e.language)?(0,I.jsx)(Oe,{label:e.language,children:(0,I.jsx)(`span`,{className:`inline-flex shrink-0 rounded-sm`,"aria-label":`Language: ${e.language}`,children:(0,I.jsx)(Ye,{path:Le(e.language),className:`size-3.5`})})}):(0,I.jsx)(`span`,{className:`truncate`,children:e.language})}),(0,I.jsxs)(`span`,{className:`flex items-center gap-0.5`,role:`toolbar`,children:[a!==null&&(0,I.jsx)(Oe,{label:c,children:(0,I.jsx)(x,{type:`button`,variant:r?`secondary`:`ghost-muted`,size:`icon-xs`,"aria-pressed":r,"aria-label":c,onClick:()=>i(!r),children:(0,I.jsx)(w,{icon:$_,className:`size-3`})})}),(a===null||r)&&(0,I.jsx)(Oe,{label:s,children:(0,I.jsx)(x,{type:`button`,variant:t?`secondary`:`ghost-muted`,size:`icon-xs`,"aria-pressed":t,"aria-label":s,onClick:()=>n(!t),children:(0,I.jsx)(w,{icon:av,className:`size-3`})})}),(0,I.jsx)(Oe,{label:l,children:(0,I.jsx)(x,{type:`button`,variant:`ghost-muted`,size:`icon-xs`,"aria-label":l,onClick:()=>void o.copy(e.code),children:(0,I.jsx)(w,{icon:o.copied?Zg:p_,className:`size-3`})})})]})]}),a!==null&&!r?(0,I.jsx)(Hie,{svg:a}):(0,I.jsx)(SI,{code:e.code,language:e.language})]})}var II=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r)setTimeout(function(){r(e)},0);else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h)d[r]=void 0;else{if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},$ie=new class extends II{};function eae(e,t,n){return $ie.diff(e,t,n)}function LI(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function RI(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function zI(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function BI(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function VI(e,t){return zI(e,t,``)}function HI(e,t){return BI(e,t,``)}function UI(e,t){return t.slice(0,tae(e,t))}function tae(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function WI(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function GI(e,t){if(t)return qI(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function KI(e,t){if(t)return qI(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function qI(e,t){if(!t)return[KI(e),GI(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=WI(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var JI=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,nae=RegExp(`[${JI}]+|\\s+|[^${JI}]`,`ug`);new class extends II{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=WI(e,r)}else n=e.match(nae)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&YI(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&YI(n,i,r,null,t.intlSegmenter),e}};function YI(e,t,n,r,i){if(t&&n){let[a,o]=qI(t.value,i),[s,c]=qI(n.value,i);if(e){let r=LI(a,s);e.value=BI(e.value,s,r),t.value=VI(t.value,r),n.value=VI(n.value,r)}if(r){let e=RI(o,c);r.value=zI(r.value,c,e),t.value=HI(t.value,e),n.value=HI(n.value,e)}}else if(n){if(e){let e=KI(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=KI(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=KI(r.value,i),[a,o]=qI(t.value,i),s=LI(n,a);t.value=VI(t.value,s);let c=RI(VI(n,s),o);t.value=HI(t.value,c),r.value=zI(r.value,n,c),e.value=BI(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=KI(r.value,i),n=UI(GI(t.value,i),e);t.value=HI(t.value,n)}else if(e){let n=UI(GI(e.value,i),KI(t.value,i));t.value=VI(t.value,n)}}var rae=new class extends II{tokenize(e){let t=RegExp(`(\\r?\\n)|[${JI}]+|[^\\S\\n\\r]+|[^${JI}]`,`ug`);return e.match(t)||[]}};function iae(e,t,n){return rae.diff(e,t,n)}var aae=new class extends II{constructor(){super(...arguments),this.tokenize=ZI}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|