@visulima/ono 1.0.11 → 2.0.0-alpha.1
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/CHANGELOG.md +28 -0
- package/README.md +33 -14
- package/dist/error-inspector/components/header-bar/editor-selector.d.ts +1 -1
- package/dist/error-inspector/components/header-bar/index.d.ts +1 -1
- package/dist/error-inspector/types.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +72 -72
- package/dist/server/open-in-editor.js +1 -3
- package/package.json +26 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
## @visulima/ono [2.0.0-alpha.1](https://github.com/visulima/visulima/compare/@visulima/ono@1.0.12...@visulima/ono@2.0.0-alpha.1) (2025-12-07)
|
|
2
|
+
|
|
3
|
+
### ⚠ BREAKING CHANGES
|
|
4
|
+
|
|
5
|
+
* change min node version to 22.13
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
|
|
10
|
+
* update Node.js engine version requirement to >=22.13 in multiple package.json files for improved compatibility ([b828e9a](https://github.com/visulima/visulima/commit/b828e9aeaebfc798eecddccd90e6ec7560c6d36a))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* **@visulima/error:** upgraded to 6.0.0-alpha.1
|
|
16
|
+
|
|
17
|
+
## @visulima/ono [1.0.12](https://github.com/visulima/visulima/compare/@visulima/ono@1.0.11...@visulima/ono@1.0.12) (2025-11-13)
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* bump packem, to fix minified version of the code ([2a36ceb](https://github.com/visulima/visulima/commit/2a36ceb09251b0ca1178701a26547a871ed717a7))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Dependencies
|
|
25
|
+
|
|
26
|
+
* **@visulima/error:** upgraded to 5.0.6
|
|
27
|
+
* **@visulima/path:** upgraded to 2.0.5
|
|
28
|
+
|
|
1
29
|
## @visulima/ono [1.0.11](https://github.com/visulima/visulima/compare/@visulima/ono@1.0.10...@visulima/ono@1.0.11) (2025-11-12)
|
|
2
30
|
|
|
3
31
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
2
|
+
|
|
3
|
+
<a href="https://www.anolilab.com/open-source" align="center">
|
|
4
|
+
|
|
5
|
+
<img src="__assets__/package-og.svg" alt="ono" />
|
|
6
|
+
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
<h3 align="center">Ono is an error-parsing library that pretty prints JavaScript errors on a web page or the terminal.</h3>
|
|
10
|
+
|
|
11
|
+
<!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
7
12
|
|
|
8
13
|
<br />
|
|
9
14
|
|
|
10
15
|
<div align="center">
|
|
11
16
|
|
|
12
|
-
[![typescript-image]
|
|
17
|
+
[![typescript-image][typescript-badge]][typescript-url]
|
|
18
|
+
[![mit licence][license-badge]][license]
|
|
19
|
+
[![npm downloads][npm-downloads-badge]][npm-downloads]
|
|
20
|
+
[![Chat][chat-badge]][chat]
|
|
21
|
+
[![PRs Welcome][prs-welcome-badge]][prs-welcome]
|
|
13
22
|
|
|
14
23
|
</div>
|
|
15
24
|
|
|
@@ -605,13 +614,23 @@ If you would like to help take a look at the [list of issues](https://github.com
|
|
|
605
614
|
- [Daniel Bannert](https://github.com/prisis)
|
|
606
615
|
- [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
|
|
607
616
|
|
|
617
|
+
## Made with ❤️ at Anolilab
|
|
618
|
+
|
|
619
|
+
This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!
|
|
620
|
+
|
|
608
621
|
## License
|
|
609
622
|
|
|
610
|
-
The visulima error is open-sourced software licensed under the [MIT][license
|
|
623
|
+
The visulima error is open-sourced software licensed under the [MIT][license]
|
|
624
|
+
|
|
625
|
+
<!-- badges -->
|
|
611
626
|
|
|
612
|
-
[
|
|
613
|
-
[
|
|
614
|
-
[
|
|
615
|
-
[
|
|
616
|
-
[
|
|
617
|
-
[
|
|
627
|
+
[license-badge]: https://img.shields.io/npm/l/@visulima/ono?style=for-the-badge
|
|
628
|
+
[license]: https://github.com/visulima/visulima/blob/main/LICENSE
|
|
629
|
+
[npm-downloads-badge]: https://img.shields.io/npm/dm/@visulima/ono?style=for-the-badge
|
|
630
|
+
[npm-downloads]: https://www.npmjs.com/package/@visulima/ono
|
|
631
|
+
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
|
|
632
|
+
[prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
|
|
633
|
+
[chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
|
|
634
|
+
[chat]: https://discord.gg/TtFJY8xkFK
|
|
635
|
+
[typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
636
|
+
[typescript-url]: https://www.typescriptlang.org/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SolutionFinder } from "@visulima/error/solution";
|
|
2
|
-
import type { BaseCliOptions } from "
|
|
2
|
+
import type { BaseCliOptions } from "../../../../shared/utils/cli-error-builder.d.ts";
|
|
3
3
|
import type { TemplateOptions as BaseTemplateOptions } from "./error-inspector/types.d.ts";
|
|
4
4
|
export type TemplateOptions = BaseTemplateOptions & {
|
|
5
5
|
solutionFinders?: SolutionFinder[];
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var Ao=Object.defineProperty;var f=(e,t)=>Ao(e,"name",{value:t,configurable:!0});import{createRequire as Do}from"node:module";import{parseStacktrace as Ht}from"@visulima/error/stacktrace";import{renderError as Bo,getErrorCauses as Lo}from"@visulima/error/error";import{ruleBasedFinder as Ut,errorHintFinder as Vt}from"@visulima/error/solution";import{s as S,a as E,b as _o,c as Fo,d as Mo,n as kt,e as xt,f as Oo}from"./packem_shared/clipboard-CI3XgYla.js";import Ze from"isomorphic-dompurify";import{t as Po,g as No}from"./packem_shared/process-B37didfB.js";import{parseStacktrace as at,codeFrame as st}from"@visulima/error";import Gt from"@visulima/error/solution/ai/prompt";const Io=Do(import.meta.url),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Re=f(e=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[t,o]=ie.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ie.getBuiltinModule(e)}return Io(e)},"__cjs_getBuiltinModule"),{createRequire:zo}=Re("node:module"),{readFile:Ro}=Re("node:fs/promises"),{fileURLToPath:jo}=Re("node:url"),{createHash:qo}=Re("node:crypto");var Wo=Object.defineProperty,R=f((e,t)=>Wo(e,"name",{value:t,configurable:!0}),"y$3"),Ho=Object.defineProperty,$=R((e,t)=>Ho(e,"name",{value:t,configurable:!0}),"w");const Uo=zo(import.meta.url),Y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,it=$(e=>{if(typeof Y<"u"&&Y.versions&&Y.versions.node){const[t,o]=Y.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Y.getBuiltinModule(e)}return Uo(e)},"__cjs_getBuiltinModule"),oe=Y,{execFileSync:Vo}=it("node:child_process"),xe=it("node:fs"),Go=it("node:tty");var Zo=Object.defineProperty,Ko=$((e,t)=>Zo(e,"name",{value:t,configurable:!0}),"p$2"),Qo=Object.defineProperty,Zt=Ko((e,t)=>Qo(e,"name",{value:t,configurable:!0}),"e"),Jo=Object.defineProperty,Xo=Zt((e,t)=>Jo(e,"name",{value:t,configurable:!0}),"E");const Kt=String.raw,yt=Kt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Yo=Xo(()=>new RegExp(Kt`\p{RI}{2}|(?)${yt}(?:\u200D${yt})*`,"gu"),"default");var er=Object.defineProperty,tr=Zt((e,t)=>er(e,"name",{value:t,configurable:!0}),"p");const re=new Set(["\x1B",""]),je="\x07",Qt="[",lt="m",Ae="]8;;",or=39,rr=/[\u200B\uFEFF\u2060-\u2064]/g,nr=new RegExp(`(?:\\${Qt}(?<code>\\d+)m|\\${Ae}(?<uri>.*)${je})`),ar=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),le=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ye=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Se=Yo();tr(e=>e.replace(Se,""),"stripEmoji");var sr=Object.defineProperty,N=$((e,t)=>sr(e,"name",{value:t,configurable:!0}),"f$1"),ir=Object.defineProperty,j=N((e,t)=>ir(e,"name",{value:t,configurable:!0}),"c"),lr=Object.defineProperty,_e=j((e,t)=>lr(e,"name",{value:t,configurable:!0}),"E$1");function H(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}f(H,"F$1");R(H,"M");$(H,"M$2");N(H,"M");j(H,"A");_e(H,"isAmbiguous");function U(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}f(U,"M");R(U,"N");$(U,"A$1");N(U,"C");j(U,"D$1");_e(U,"isFullWidth");function V(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}f(V,"N");R(V,"L");$(V,"N$3");N(V,"T");j(V,"C");_e(V,"isWide");function ne(e){return H(e)?"ambiguous":U(e)?"fullwidth":e===8361||e>=65377&&e<=65470||e>=65474&&e<=65479||e>=65482&&e<=65487||e>=65490&&e<=65495||e>=65498&&e<=65500||e>=65512&&e<=65518?"halfwidth":e>=32&&e<=126||e===162||e===163||e===165||e===166||e===172||e===175||e>=10214&&e<=10221||e===10629||e===10630?"narrow":V(e)?"wide":"neutral"}f(ne,"z");R(ne,"J");$(ne,"F$1");N(ne,"R");j(ne,"t");_e(ne,"getCategory");var cr=Object.defineProperty,ct=j((e,t)=>cr(e,"name",{value:t,configurable:!0}),"e");function G(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}f(G,"L$2");R(G,"_");$(G,"j$3");N(G,"O");j(G,"r");ct(G,"validate");function Z(e){return G(e),ne(e)}f(Z,"P$1");R(Z,"P");$(Z,"y$3");N(Z,"v");j(Z,"eastAsianWidthType");ct(Z,"eastAsianWidthType");function me(e,{ambiguousAsWide:t=!1}={}){return G(e),U(e)||V(e)||t&&H(e)?2:1}f(me,"Q");R(me,"le");$(me,"Y$1");N(me,"J");j(me,"eastAsianWidth");ct(me,"eastAsianWidth");var dr=Object.defineProperty,Fe=j((e,t)=>dr(e,"name",{value:t,configurable:!0}),"b");const $t=new Map,$e=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ce=Fe(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),pr=Fe((e,t)=>{const o=Math.floor(e/65536),n=e%65536;let r=$t.get(o);if(r||(r=new Map,$t.set(o,r)),r.has(n))return r.get(n);let s;if(Ce(e)==="latin")s=t.width.regular;else if(Ce(e)==="control")s=t.width.control;else if(Ce(e)==="wide")s=t.width.wide;else switch(Z(e)){case"ambiguous":{s=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{s=t.width.fullWidth;break}case"wide":{s=t.width.wide;break}default:s=t.width.regular}return r.set(n,s),s},"getCachedCharWidth"),hr=Fe(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Ke=Fe((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const o={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Ke(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,o.truncation.limit-o.truncation.ellipsisWidth),{length:r}=e,s=r>1e4;let a=0,l=0,i=r,d=!1;const c=e.includes("\x1B")||e.includes("");for(;a<r;){if(c&&(e[a]==="\x1B"||e[a]==="")){if(e.startsWith("\x1B]8;;",a)){const w="\x1B]8;;\x07",y=w.length,D=e.indexOf("\x07",a+5);if(D!==-1){const F=e.indexOf(w,D+1);if(F!==-1){const ae=F+y,M=e.slice(D+1,F).replace(le,""),I=Ke(M,{ambiguousIsNarrow:o.width.ambiguousIsNarrow,ansiWidth:o.width.ansi,controlWidth:o.width.control,countAnsiEscapeCodes:!1,ellipsis:o.truncation.ellipsis,ellipsisWidth:o.truncation.ellipsisWidth,emojiWidth:o.width.emoji,fullWidth:o.width.fullWidth,halfWidth:o.width.halfWidth,limit:Math.max(0,n-l),regularWidth:o.width.regular,tabWidth:o.width.tab,wideWidth:o.width.wide}),se=I.width;if(I.truncated)d=!0,i=Math.min(i,a);else if(l+se>n&&(i=Math.min(i,a),d=!0,l+se>o.truncation.limit))break;if(l+=se,a=ae,d&&l>=o.truncation.limit)break;continue}}}if(le.lastIndex=a,le.test(e)){const w=le.lastIndex-a,y=o.truncation.countAnsiEscapeCodes?w:o.width.ansi;if(l+y>n&&(i=Math.min(i,a),l+y>o.truncation.limit)){d=!0;break}l+=y,a=le.lastIndex;continue}}const u=e.codePointAt(a);if(u===8203||u===65279||u>=8288&&u<=8292){a+=1;continue}if(u===9){if(l+o.width.tab>n&&(i=Math.min(i,a),l+o.width.tab>o.truncation.limit)){d=!0;break}l+=o.width.tab,a+=1;continue}if($e.lastIndex=a,$e.test(e)){const w=($e.lastIndex-a)*o.width.regular;if(l+w>n){const y=Math.floor((n-l)/o.width.regular);if(i=Math.min(i,a+y),l+w>o.truncation.limit){d=!0;break}}l+=w,a=$e.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(ye.lastIndex=a,ye.test(e))){const w=(ye.lastIndex-a)*o.width.control;if(l+w>n&&(i=Math.min(i,a+Math.floor((n-l)/o.width.control)),l+w>o.truncation.limit)){d=!0;break}l+=w,a=ye.lastIndex;continue}if(Se.lastIndex=a,Se.test(e)){if(l+o.width.emoji>n&&(i=Math.min(i,a),l+o.width.emoji>o.truncation.limit)){d=!0;break}l+=o.width.emoji,a=Se.lastIndex;continue}const m=e.codePointAt(a)??0;if(hr(m)){a+=m>65535?2:1;continue}let g;if(s)g=pr(m,o);else switch(Ce(m)){case"control":{g=o.width.control;break}case"latin":{g=o.width.regular;break}case"wide":{g=o.width.wide;break}case"zero":{g=0;break}default:switch(Z(m)){case"ambiguous":{g=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{g=o.width.fullWidth;break}case"wide":{g=o.width.wide;break}default:g=o.width.regular}}if(l+g>n&&(i=Math.min(i,a),l+g>o.truncation.limit)){d=!0;break}l+=g,a+=m>65535?2:1}let h=l,p=!1;return d&&o.truncation.limit>=o.truncation.ellipsisWidth&&(h=o.truncation.limit,p=!0),{ellipsed:p,index:d?i:r,truncated:d,width:h}},"getStringTruncatedWidth");var ur=Object.defineProperty,gr=$((e,t)=>ur(e,"name",{value:t,configurable:!0}),"i$1"),mr=Object.defineProperty,fr=gr((e,t)=>mr(e,"name",{value:t,configurable:!0}),"e"),wr=Object.defineProperty,br=fr((e,t)=>wr(e,"name",{value:t,configurable:!0}),"r");const k=br((e,t={})=>Ke(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var vr=Object.defineProperty,kr=$((e,t)=>vr(e,"name",{value:t,configurable:!0}),"g"),xr=Object.defineProperty,yr=kr((e,t)=>xr(e,"name",{value:t,configurable:!0}),"s"),$r=Object.defineProperty,dt=yr((e,t)=>$r(e,"name",{value:t,configurable:!0}),"n");const Er=dt((e,t)=>Math.floor((e-t)/2),"halfDiff"),Sr=dt((e,t)=>e-t,"fullDiff"),Et=dt((e,t={})=>{const o=t.align??"center";if(o==="left")return e;const n=t.split??`
|
|
2
|
-
`,r=t.pad??" ",
|
|
3
|
-
`),
|
|
4
|
-
`?(n&&(t+=Ct("")),o&&d&&(t+=St(d))):
|
|
5
|
-
`&&(o&&d&&(t+=St(o)),n&&(t+=Ct(n))),a+=
|
|
1
|
+
var Ao=Object.defineProperty;var f=(e,t)=>Ao(e,"name",{value:t,configurable:!0});import{createRequire as Do}from"node:module";import{parseStacktrace as Ht}from"@visulima/error/stacktrace";import{renderError as Bo,getErrorCauses as Lo}from"@visulima/error/error";import{ruleBasedFinder as Ut,errorHintFinder as Zt}from"@visulima/error/solution";import{s as S,a as E,b as _o,c as Fo,d as Mo,n as kt,e as xt,f as Oo}from"./packem_shared/clipboard-CI3XgYla.js";import Ve from"isomorphic-dompurify";import{t as Po,g as No}from"./packem_shared/process-B37didfB.js";import{parseStacktrace as at,codeFrame as it}from"@visulima/error";import Gt from"@visulima/error/solution/ai/prompt";const Io=Do(import.meta.url),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Re=f(e=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[t,o]=ie.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ie.getBuiltinModule(e)}return Io(e)},"__cjs_getBuiltinModule"),{createRequire:zo}=Re("node:module"),{readFile:Ro}=Re("node:fs/promises"),{fileURLToPath:jo}=Re("node:url"),{createHash:qo}=Re("node:crypto");var Wo=Object.defineProperty,R=f((e,t)=>Wo(e,"name",{value:t,configurable:!0}),"y$3"),Ho=Object.defineProperty,$=R((e,t)=>Ho(e,"name",{value:t,configurable:!0}),"w");const Uo=zo(import.meta.url),Y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,st=$(e=>{if(typeof Y<"u"&&Y.versions&&Y.versions.node){const[t,o]=Y.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Y.getBuiltinModule(e)}return Uo(e)},"__cjs_getBuiltinModule"),oe=Y,{execFileSync:Zo}=st("node:child_process"),xe=st("node:fs"),Go=st("node:tty");var Vo=Object.defineProperty,Ko=$((e,t)=>Vo(e,"name",{value:t,configurable:!0}),"p$2"),Qo=Object.defineProperty,Vt=Ko((e,t)=>Qo(e,"name",{value:t,configurable:!0}),"e"),Jo=Object.defineProperty,Xo=Vt((e,t)=>Jo(e,"name",{value:t,configurable:!0}),"E");const Kt=String.raw,yt=Kt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Yo=Xo(()=>new RegExp(Kt`\p{RI}{2}|(?)${yt}(?:\u200D${yt})*`,"gu"),"default");var er=Object.defineProperty,tr=Vt((e,t)=>er(e,"name",{value:t,configurable:!0}),"p");const re=new Set(["\x1B",""]),je="\x07",Qt="[",lt="m",Ae="]8;;",or=39,rr=/[\u200B\uFEFF\u2060-\u2064]/g,nr=new RegExp(`(?:\\${Qt}(?<code>\\d+)m|\\${Ae}(?<uri>.*)${je})`),ar=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),se=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ye=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Se=Yo();tr(e=>e.replace(Se,""),"stripEmoji");var ir=Object.defineProperty,O=$((e,t)=>ir(e,"name",{value:t,configurable:!0}),"f$1"),sr=Object.defineProperty,j=O((e,t)=>sr(e,"name",{value:t,configurable:!0}),"c"),lr=Object.defineProperty,_e=j((e,t)=>lr(e,"name",{value:t,configurable:!0}),"E$1");function H(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}f(H,"F$1");R(H,"M");$(H,"M$2");O(H,"M");j(H,"A");_e(H,"isAmbiguous");function U(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}f(U,"M$1");R(U,"N");$(U,"A$1");O(U,"C");j(U,"D$1");_e(U,"isFullWidth");function Z(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}f(Z,"N$1");R(Z,"L");$(Z,"N$3");O(Z,"T");j(Z,"C");_e(Z,"isWide");function ne(e){return H(e)?"ambiguous":U(e)?"fullwidth":e===8361||e>=65377&&e<=65470||e>=65474&&e<=65479||e>=65482&&e<=65487||e>=65490&&e<=65495||e>=65498&&e<=65500||e>=65512&&e<=65518?"halfwidth":e>=32&&e<=126||e===162||e===163||e===165||e===166||e===172||e===175||e>=10214&&e<=10221||e===10629||e===10630?"narrow":Z(e)?"wide":"neutral"}f(ne,"z");R(ne,"J");$(ne,"F$1");O(ne,"R");j(ne,"t");_e(ne,"getCategory");var cr=Object.defineProperty,ct=j((e,t)=>cr(e,"name",{value:t,configurable:!0}),"e");function G(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}f(G,"L$2");R(G,"_");$(G,"j$3");O(G,"O");j(G,"r");ct(G,"validate");function V(e){return G(e),ne(e)}f(V,"P$1");R(V,"P");$(V,"y$3");O(V,"v");j(V,"eastAsianWidthType");ct(V,"eastAsianWidthType");function ge(e,{ambiguousAsWide:t=!1}={}){return G(e),U(e)||Z(e)||t&&H(e)?2:1}f(ge,"Q");R(ge,"le");$(ge,"Y$1");O(ge,"J");j(ge,"eastAsianWidth");ct(ge,"eastAsianWidth");var dr=Object.defineProperty,Fe=j((e,t)=>dr(e,"name",{value:t,configurable:!0}),"b");const $t=new Map,$e=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ce=Fe(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),pr=Fe((e,t)=>{const o=Math.floor(e/65536),n=e%65536;let r=$t.get(o);if(r||(r=new Map,$t.set(o,r)),r.has(n))return r.get(n);let i;if(Ce(e)==="latin")i=t.width.regular;else if(Ce(e)==="control")i=t.width.control;else if(Ce(e)==="wide")i=t.width.wide;else switch(V(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}return r.set(n,i),i},"getCachedCharWidth"),hr=Fe(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Ke=Fe((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const o={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Ke(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,o.truncation.limit-o.truncation.ellipsisWidth),{length:r}=e,i=r>1e4;let a=0,l=0,s=r,d=!1;const c=e.includes("\x1B")||e.includes("");for(;a<r;){if(c&&(e[a]==="\x1B"||e[a]==="")){if(e.startsWith("\x1B]8;;",a)){const w="\x1B]8;;\x07",y=w.length,D=e.indexOf("\x07",a+5);if(D!==-1){const P=e.indexOf(w,D+1);if(P!==-1){const N=P+y,I=e.slice(D+1,P).replace(se,""),ke=Ke(I,{ambiguousIsNarrow:o.width.ambiguousIsNarrow,ansiWidth:o.width.ansi,controlWidth:o.width.control,countAnsiEscapeCodes:!1,ellipsis:o.truncation.ellipsis,ellipsisWidth:o.truncation.ellipsisWidth,emojiWidth:o.width.emoji,fullWidth:o.width.fullWidth,halfWidth:o.width.halfWidth,limit:Math.max(0,n-l),regularWidth:o.width.regular,tabWidth:o.width.tab,wideWidth:o.width.wide}),ae=ke.width;if(ke.truncated)d=!0,s=Math.min(s,a);else if(l+ae>n&&(s=Math.min(s,a),d=!0,l+ae>o.truncation.limit))break;if(l+=ae,a=N,d&&l>=o.truncation.limit)break;continue}}}if(se.lastIndex=a,se.test(e)){const w=se.lastIndex-a,y=o.truncation.countAnsiEscapeCodes?w:o.width.ansi;if(l+y>n&&(s=Math.min(s,a),l+y>o.truncation.limit)){d=!0;break}l+=y,a=se.lastIndex;continue}}const u=e.codePointAt(a);if(u===8203||u===65279||u>=8288&&u<=8292){a+=1;continue}if(u===9){if(l+o.width.tab>n&&(s=Math.min(s,a),l+o.width.tab>o.truncation.limit)){d=!0;break}l+=o.width.tab,a+=1;continue}if($e.lastIndex=a,$e.test(e)){const w=($e.lastIndex-a)*o.width.regular;if(l+w>n){const y=Math.floor((n-l)/o.width.regular);if(s=Math.min(s,a+y),l+w>o.truncation.limit){d=!0;break}}l+=w,a=$e.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(ye.lastIndex=a,ye.test(e))){const w=(ye.lastIndex-a)*o.width.control;if(l+w>n&&(s=Math.min(s,a+Math.floor((n-l)/o.width.control)),l+w>o.truncation.limit)){d=!0;break}l+=w,a=ye.lastIndex;continue}if(Se.lastIndex=a,Se.test(e)){if(l+o.width.emoji>n&&(s=Math.min(s,a),l+o.width.emoji>o.truncation.limit)){d=!0;break}l+=o.width.emoji,a=Se.lastIndex;continue}const m=e.codePointAt(a)??0;if(hr(m)){a+=m>65535?2:1;continue}let g;if(i)g=pr(m,o);else switch(Ce(m)){case"control":{g=o.width.control;break}case"latin":{g=o.width.regular;break}case"wide":{g=o.width.wide;break}case"zero":{g=0;break}default:switch(V(m)){case"ambiguous":{g=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{g=o.width.fullWidth;break}case"wide":{g=o.width.wide;break}default:g=o.width.regular}}if(l+g>n&&(s=Math.min(s,a),l+g>o.truncation.limit)){d=!0;break}l+=g,a+=m>65535?2:1}let h=l,p=!1;return d&&o.truncation.limit>=o.truncation.ellipsisWidth&&(h=o.truncation.limit,p=!0),{ellipsed:p,index:d?s:r,truncated:d,width:h}},"getStringTruncatedWidth");var ur=Object.defineProperty,gr=$((e,t)=>ur(e,"name",{value:t,configurable:!0}),"i$1"),mr=Object.defineProperty,fr=gr((e,t)=>mr(e,"name",{value:t,configurable:!0}),"e"),wr=Object.defineProperty,br=fr((e,t)=>wr(e,"name",{value:t,configurable:!0}),"r");const k=br((e,t={})=>Ke(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var vr=Object.defineProperty,kr=$((e,t)=>vr(e,"name",{value:t,configurable:!0}),"g"),xr=Object.defineProperty,yr=kr((e,t)=>xr(e,"name",{value:t,configurable:!0}),"s"),$r=Object.defineProperty,dt=yr((e,t)=>$r(e,"name",{value:t,configurable:!0}),"n");const Er=dt((e,t)=>Math.floor((e-t)/2),"halfDiff"),Sr=dt((e,t)=>e-t,"fullDiff"),Et=dt((e,t={})=>{const o=t.align??"center";if(o==="left")return e;const n=t.split??`
|
|
2
|
+
`,r=t.pad??" ",i=o==="right"?Sr:Er;let a=!1;Array.isArray(e)||(a=!0,e=String(e).split(n));let l,s=0;return e=e.map(d=>(d=String(d),l=k(d,t.stringWidthOptions),s=Math.max(l,s),{str:d,width:l})).map(d=>Array.from({length:i(s,d.width)+1}).join(r)+d.str),a?e.join(n):e},"alignText");var Cr=Object.defineProperty,Jt=$((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"x$1"),Tr=Object.defineProperty,K=Jt((e,t)=>Tr(e,"name",{value:t,configurable:!0}),"m"),Ar=Object.defineProperty,Dr=K((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"n");class Xt{static{f(this,"Wt")}static{R(this,"Se")}static{$(this,"T")}static{Jt(this,"w")}static{K(this,"u")}static{Dr(this,"AnsiStateTracker")}activeForeground=null;activeBackground=null;activeFormatting=[];processEscape(t){const o=/\x1B\[(\d+)m/.exec(t);if(!o)return;const n=Number.parseInt(o[1],10);switch(n){case 0:{this.activeForeground=null,this.activeBackground=null,this.activeFormatting=[];break}case 39:{this.activeForeground=null;break}case 49:{this.activeBackground=null;break}default:if(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const r={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];r&&(this.activeFormatting=this.activeFormatting.filter(i=>!i.includes(r)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const o={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].reverse().forEach(n=>{const r=o[n];r&&t.push(r)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var Ir=Object.defineProperty,Yt=K((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"o");const eo=Yt((e,t)=>{if(!re.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const o=!0,n=e.slice(t+1,t+1+Ae.length).join("")===Ae;return{isInsideEscape:o,isInsideLinkEscape:n}},"checkEscapeSequence"),zr=Yt((e,t={})=>{const o=new Xt;let n="",r=!1,i=!1,a="",l="",s=!1;const d=[...e];for(let c=0;c<d.length;c++){const h=d[c];if(h&&re.has(h)){if(n){const m=t.getWidth?.(n)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:n,width:m};if(s&&(g.isHyperlink=!0,g.hyperlinkUrl=l),t.onSegment?.(g,o)===!1)return;n=""}if(r=!0,a=h,i=eo(d,c).isInsideLinkEscape,i){let m=c+1;for(l="";m<d.length;){const w=d[m];if(w===je)break;l+=w,m+=1}l=l.slice(4);const g={hyperlinkUrl:l,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(g,o)===!1)return;c=m,s=!0,r=!1,i=!1,a="";continue}if(c+1<d.length&&d[c+1]==="\\"&&s){const m={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(m,o)===!1)return;s=!1,l="",c+=1,r=!1,a="";continue}}if(r){if(a!==h&&(a+=h),h===lt){r=!1,o.processEscape(a);const m={isEscapeSequence:!0,isGrapheme:!1,text:a,width:0};if(t.onSegment?.(m,o)===!1)return;a=""}continue}n+=h;const p=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:p};if(s&&(u.isHyperlink=!0,u.hyperlinkUrl=l),t.onSegment?.(u,o)===!1)return;n=""}if(n){const c=t.getWidth?.(n)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:n,width:c};s&&(h.isHyperlink=!0,h.hyperlinkUrl=l),t.onSegment?.(h,o)}if(a){const c={isEscapeSequence:!0,isGrapheme:!1,text:a,width:0};t.onSegment?.(c,o)}},"processAnsiString");var Br=Object.defineProperty,Lr=K((e,t)=>Br(e,"name",{value:t,configurable:!0}),"t$1");const St=Lr(e=>`${re.values().next().value}${Qt}${e}${lt}`,"wrapAnsiCode");var Rr=Object.defineProperty,jr=K((e,t)=>Rr(e,"name",{value:t,configurable:!0}),"t");const Ct=jr(e=>`${re.values().next().value}${Ae}${e}${je}`,"wrapAnsiHyperlink");var _r=Object.defineProperty,Fr=K((e,t)=>_r(e,"name",{value:t,configurable:!0}),"l");const Mr=Fr(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",o,n;const r=e.join(`
|
|
3
|
+
`),i=[...r];let a=0;for(const[l,s]of i.entries()){if(t+=s,re.has(s)){const c=nr.exec(r.slice(a))?.groups??{};if(c.code!==void 0){const h=Number.parseFloat(c.code);o=h===or?void 0:h}else c.uri!==void 0&&(n=c.uri.length===0?void 0:c.uri)}const d=ar.get(Number(o));i[l+1]===`
|
|
4
|
+
`?(n&&(t+=Ct("")),o&&d&&(t+=St(d))):s===`
|
|
5
|
+
`&&(o&&d&&(t+=St(o)),n&&(t+=Ct(n))),a+=s.length}return t},"preserveAnsi");var Or=Object.defineProperty,M=K((e,t)=>Or(e,"name",{value:t,configurable:!0}),"h");const He=M(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),q=M(e=>{const t=e.split(" ");let o=t.length;for(;o>0&&k(t[o-1])===0;)o--;return o===t.length?e:t.slice(0,o).join(" ")+t.slice(o).join("")},"stringVisibleTrimSpacesRight"),to=M((e,t,o)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],r=new Xt;let i="",a=0,l=!1,s=!1,d="";for(let c=0;c<e.length;c++){const h=e[c];if(re.has(h)){l=!0,d=h,i+=h,s=eo([...e],c).isInsideLinkEscape;continue}if(l){d+=h,i+=h,s?h===je&&(l=s=!1):h===lt&&(l=!1,r.processEscape(d));continue}const p=k(h),u=h===" ";if(p===0){i+=h;continue}if(a+p>t&&(i&&n.push(i+r.getEndEscapesForAllActiveAttributes()),i=r.getStartEscapesForAllActiveAttributes(),a=k(i),u&&o)){for(;c<e.length&&e[c]===" "&&(c+=1,!(c>=e.length)););c<e.length&&c--;continue}if(i+=h,a+=p,a===t&&c<e.length-1&&(n.push(i+r.getEndEscapesForAllActiveAttributes()),i=r.getStartEscapesForAllActiveAttributes(),a=k(i),c+1<e.length&&e[c+1]===" "&&o)){for(c+=1;c<e.length&&e[c]===" ";)c+=1;c--}}return i&&n.push(i+r.getEndEscapesForAllActiveAttributes()),o?n.map(c=>q(c)):n},"wrapWithBreakAtWidth"),Pr=M((e,t,o)=>{if(e.length===0)return[];const n=o?e.trim():e;if(n.length===0)return[];const r=[];let i="",a=0;return zr(n,{getWidth:k,onSegment:M((l,s)=>{if(l.isEscapeSequence)i+=l.text;else{const d=l.text===" ";if(l.width===0)return i+=l.text,!0;if(a+l.width>t&&(i&&r.push(i),i=s.getStartEscapesForAllActiveAttributes(),a=0,d))return o||r.push(s.getStartEscapesForAllActiveAttributes()+l.text),!0;i+=l.text,a+=l.width}return!0},"onSegment")}),i&&r.push(i),o?r.map(l=>q(l)):r},"wrapCharByChar"),Nr=M((e,t,o)=>{if(e.length===0)return[];const n=o?e.trim():e;if(n.length===0)return[];const r=n.split(/(?=\s)|(?<=\s)/),i=[];let a="",l=0,s=0;for(;s<r.length;){const d=r[s],c=/^\s+$/.test(d),h=k(d);if(d.length===0){s+=1;continue}if(o&&c&&l===0){s+=1;continue}if(l+h>t&&l>0){o?i.push(q(a)):i.push(a),a="",l=0;continue}a+=d,l+=h,s+=1}return a&&(o?i.push(q(a)):i.push(a)),i},"wrapWithWordBoundaries"),qr=M((e,t,o)=>{if(e.length===0)return[];const n=o?e.trim():e;if(n.length===0)return[];const r=n.split(/(?=\s)|(?<=\s)/),i=[];let a="",l=0,s=0;for(;s<r.length;){const d=r[s],c=/^\s+$/.test(d),h=k(d);if(d.length===0){s+=1;continue}if(o&&c&&l===0){s+=1;continue}if(h>t){a&&i.push(He(o?q(a):a));const p=to(d,t,o);if(p.length>0){for(let u=0;u<p.length-1;u++)i.push(p[u]);a=p[p.length-1],l=k(a)}else a="",l=0;s+=1;continue}if(l+h>t&&l>0&&(i.push(He(o?q(a):a)),a="",l=0,o&&c)){s+=1;continue}a+=d,l+=h,s+=1}return a&&i.push(He(o?q(a):a)),i},"wrapAndBreakWords"),te={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},oo=M((e,t={})=>{const{removeZeroWidthCharacters:o=!0,trim:n=!0,width:r=80,wrapMode:i=te.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let a=String(e).normalize("NFC").replaceAll(`\r
|
|
6
6
|
`,`
|
|
7
7
|
`);return o&&(a=a.replaceAll(rr,"")),a.split(`
|
|
8
|
-
`).map(l=>{if(n&&l.trim()==="")return"";let
|
|
9
|
-
`)},"wordWrap");var Wr=Object.defineProperty,Q=$((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"e");const ro=80,no=24,Qe=Q((e,t,{shell:o,env:n}={})=>
|
|
10
|
-
`))t=Math.max(t,k(o));return t},"widestLine");var
|
|
11
|
-
`,A=" ",
|
|
12
|
-
`),m=Math.max(...u.map(g=>k(g)));for(const g of u){let w;switch(n){case"center":{w=A.repeat((l-m)/2)+g;break}case"right":{w=A.repeat(l-m)+g;break}default:{w=g;break}}c.push(w)}}
|
|
8
|
+
`).map(l=>{if(n&&l.trim()==="")return"";let s;switch(i){case te.BREAK_AT_CHARACTERS:{s=Pr(l,r,n);break}case te.BREAK_WORDS:{s=qr(l,r,n);break}case te.STRICT_WIDTH:{s=to(l,r,n);break}default:s=Nr(l,r,n)}return Mr(s)}).join(`
|
|
9
|
+
`)},"wordWrap");var Wr=Object.defineProperty,Q=$((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"e");const ro=80,no=24,Qe=Q((e,t,{shell:o,env:n}={})=>Zo(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:o,env:n}).trim(),"exec"),Te=Q((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),ao=Q((e,t)=>{const{columns:o,rows:n}=Te(e,t);if(!(Number.isNaN(o)||Number.isNaN(n))&&!(o===ro&&n===no))return{columns:o,rows:n}},"createIfNotDefault");function me(){const{env:e,stdout:t,stderr:o}=oe;if(t?.columns&&t?.rows)return Te(t.columns,t.rows);if(o?.columns&&o?.rows)return Te(o.columns,o.rows);if(e.COLUMNS&&e.LINES)return Te(e.COLUMNS,e.LINES);const n={columns:ro,rows:no};return oe.platform==="win32"?Ue()??n:oe.platform==="darwin"?Tt()??Ue()??n:Tt()??Ue()??Hr()??n}f(me,"tt");R(me,"ue");$(me,"O");Q(me,"terminalSize");const Tt=Q(()=>{try{const e=oe.platform==="darwin"?xe.constants.O_EVTONLY|xe.constants.O_NONBLOCK:xe.constants.O_NONBLOCK,{columns:t,rows:o}=Go.WriteStream(xe.openSync("/dev/tty",e));return{columns:t,rows:o}}catch{}},"devTty"),Ue=Q(()=>{try{const e=Qe("tput",["cols"],{env:{TERM:"dumb",...oe.env}}),t=Qe("tput",["lines"],{env:{TERM:"dumb",...oe.env}});if(e&&t)return ao(e,t)}catch{}},"tput"),Hr=Q(()=>{try{const e=Qe("resize",["-u"]).match(/\d+/g);if(e.length===2)return ao(e[0],e[1])}catch{}},"resize"),Ur={arrow:{bottom:"↑",bottomLeft:"↗",bottomRight:"↖",left:"→",right:"←",top:"↓",topLeft:"↘",topRight:"↙"},bold:{bottom:"━",bottomLeft:"┗",bottomRight:"┛",left:"┃",right:"┃",top:"━",topLeft:"┏",topRight:"┓"},classic:{bottom:"-",bottomLeft:"+",bottomRight:"+",left:"|",right:"|",top:"-",topLeft:"+",topRight:"+"},double:{bottom:"═",bottomLeft:"╚",bottomRight:"╝",left:"║",right:"║",top:"═",topLeft:"╔",topRight:"╗"},doubleSingle:{bottom:"═",bottomLeft:"╘",bottomRight:"╛",left:"│",right:"│",top:"═",topLeft:"╒",topRight:"╕"},round:{bottom:"─",bottomLeft:"╰",bottomRight:"╯",left:"│",right:"│",top:"─",topLeft:"╭",topRight:"╮"},single:{bottom:"─",bottomLeft:"└",bottomRight:"┘",left:"│",right:"│",top:"─",topLeft:"┌",topRight:"┐"},singleDouble:{bottom:"─",bottomLeft:"╙",bottomRight:"╜",left:"║",right:"║",top:"─",topLeft:"╓",topRight:"╖"}};var Zr=Object.defineProperty,Gr=$((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"n");const io=Gr(e=>{let t=0;for(const o of e.split(`
|
|
10
|
+
`))t=Math.max(t,k(o));return t},"widestLine");var Vr=Object.defineProperty,T=$((e,t)=>Vr(e,"name",{value:t,configurable:!0}),"s");const F=`
|
|
11
|
+
`,A=" ",he="none",At=T(e=>typeof e=="number"?{bottom:e,left:e*3,right:e*3,top:e}:{bottom:0,left:0,right:0,top:0,...e},"getObject"),ue=T(e=>e===he?0:2,"getBorderWidth"),Kr=T(e=>{const t=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"];let o;if(e===he){e={};for(const n of t)e[n]=""}if(typeof e=="string"){const n=Ur[e];if(n===void 0)throw new TypeError(`Invalid border style: ${e}`);o=n}else{typeof e.vertical=="string"&&(e.left=e.vertical,e.right=e.vertical),typeof e.horizontal=="string"&&(e.top=e.horizontal,e.bottom=e.horizontal);for(const n of t)if(e[n]===null||typeof e[n]!="string")throw new TypeError(`Invalid border style: ${n}`);o=e}return o},"getBorderChars"),Dt=T((e,t,o,n,r)=>{let i="";e=t(e);const a=k(e);switch(r){case"left":{i=e+n(o.slice(a),k(o.slice(a)));break}case"right":{i=`${n(o.slice(a+2),k(o.slice(a))+2)} ${e} `;break}default:{if(o=o.slice(a),o.length%2===1)o=o.slice(Math.floor(o.length/2)),i=n(o.slice(1),k(o.slice(1)))+e+n(o,k(o));else{o=o.slice(o.length/2);const l=k(o);i=n(o,l)+e+n(o,l)}break}}return i},"wrapText"),Qr=T((e,{height:t,padding:o,textAlignment:n,width:r})=>{e=Et(e,{align:n});let i=e.split(F);const a=io(e),l=r-o.left-o.right;if(a>l){const c=[];for(const h of i){const p=oo(h,{width:l,wrapMode:te.BREAK_WORDS}),u=Et(p,{align:n}).split(`
|
|
12
|
+
`),m=Math.max(...u.map(g=>k(g)));for(const g of u){let w;switch(n){case"center":{w=A.repeat((l-m)/2)+g;break}case"right":{w=A.repeat(l-m)+g;break}default:{w=g;break}}c.push(w)}}i=c}n==="center"&&a<l?i=i.map(c=>A.repeat((l-a)/2)+c):n==="right"&&a<l&&(i=i.map(c=>A.repeat(l-a)+c));const s=A.repeat(o.left),d=A.repeat(o.right);return i=i.map(c=>{const h=s+c+d,p=r-k(h);return h+A.repeat(Math.max(p,0))}),o.top>0&&(i=[...Array.from({length:o.top}).fill(A.repeat(r)),...i]),o.bottom>0&&(i=[...i,...Array.from({length:o.bottom}).fill(A.repeat(r))]),t&&i.length>t?i=i.slice(0,t):t&&i.length<t&&(i=[...i,...Array.from({length:t-i.length}).fill(A.repeat(r))]),i.join(F)},"makeContentText"),Jr=T((e,t,o,n)=>{const r=T((p,u,m)=>n.borderColor?n.borderColor(p,u,m):p,"colorizeBorder"),i=T(p=>n.headerTextColor?n.headerTextColor(p):p,"colorizeHeaderText"),a=T(p=>n.footerTextColor?n.footerTextColor(p):p,"colorizeFooterText"),l=T(p=>n.textColor?n.textColor(p):p,"colorizeContent"),s=Kr(n.borderStyle);let d=A.repeat(n.margin.left);if(n.float==="center"){const p=Math.max((o-t-ue(n.borderStyle))/2,0);d=A.repeat(p)}else if(n.float==="right"){const p=Math.max(o-t-n.margin.right-ue(n.borderStyle),0);d=A.repeat(p)}let c="";if(n.margin.top&&(c+=F.repeat(n.margin.top)),n.borderStyle!==he||n.headerText){let p=r(s.top.repeat(t),"top",t);n.headerText&&(p=Dt(n.headerText,i,s.top.repeat(t),(m,g)=>r(m,"top",g),n.headerAlignment));const u=r(d+s.topLeft,"topLeft",k(d+s.topLeft));c+=u+p+r(s.topRight,"topRight",k(s.topRight))+F}const h=e.split(F);if(c+=h.map(p=>d+r(s.left,"left",k(s.left))+l(p)+r(s.right,"right",k(s.right))).join(F),n.borderStyle!==he||n.footerText){const p=F+r(d+s.bottomLeft,"bottomLeft",k(d+s.bottomLeft));let u=r(s.bottom.repeat(t),"bottom",t);n.footerText&&(u=Dt(n.footerText,a,s.bottom.repeat(t),(m,g)=>r(m,"bottom",g),n.footerAlignment)),c+=p+u+r(s.bottomRight,"bottomRight",k(s.bottomRight))}return n.margin.bottom&&(c+=F.repeat(n.margin.bottom)),c},"boxContent"),Xr=T(e=>{if(e.fullscreen){let t=me();typeof e.fullscreen=="function"&&(t=e.fullscreen(t.columns,t.rows)),e.width||(e.width=t.columns),e.height||(e.height=t.rows)}return e.width&&(e.width=Math.max(1,e.width-ue(e.borderStyle))),e.height&&(e.height=Math.max(1,e.height-ue(e.borderStyle))),e},"sanitizeOptions"),It=T((e,t)=>t===he?e:` ${e} `,"formatTitle"),Yr=T((e,t,o)=>{o=Xr(o);const n=o.width!==void 0,r=ue(o.borderStyle),i=t-o.margin.left-o.margin.right-r,a=io(oo(e,{trim:!1,width:t-r,wrapMode:te.BREAK_WORDS}))+o.padding.left+o.padding.right;if(o.headerText&&n?(o.headerText=o.headerText.slice(0,Math.max(0,o.width-2)),o.headerText&&(o.headerText=It(o.headerText,o.borderStyle))):o.headerText&&(o.headerText=o.headerText.slice(0,Math.max(0,i-2)),o.headerText&&(o.headerText=It(o.headerText,o.borderStyle),k(o.headerText)>a&&(o.width=k(o.headerText)))),o.width=o.width||a,!n){if(o.margin.left&&o.margin.right&&o.width>i){const l=(t-o.width-r)/(o.margin.left+o.margin.right);o.margin.left=Math.max(0,Math.floor(o.margin.left*l)),o.margin.right=Math.max(0,Math.floor(o.margin.right*l))}o.width=Math.min(o.width,t-r-o.margin.left-o.margin.right)}return o.width-(o.padding.left+o.padding.right)<=0&&(o.padding.left=0,o.padding.right=0),o.height&&o.height-(o.padding.top+o.padding.bottom)<=0&&(o.padding.top=0,o.padding.bottom=0),o},"determineDimensions"),en=T((e,t={})=>{if(t.borderColor!==void 0&&typeof t.borderColor!="function")throw new Error('"borderColor" is not a valid function');if(t.textColor!==void 0&&typeof t.textColor!="function")throw new Error('"textColor" is not a valid function');let o={borderStyle:"single",dimBorder:!1,float:"left",footerAlignment:"right",headerAlignment:"left",textAlignment:"left",transformTabToSpace:4,...t};o.padding=At(t.padding??0),o.margin=At(t.margin),o.transformTabToSpace&&(e=e.replaceAll(" "," ".repeat(o.transformTabToSpace)));const{columns:n}=me();return o=Yr(e,n,o),Jr(Qr(e,o),o.width,n,o)},"boxen");var tn=Object.defineProperty,on=f((e,t)=>tn(e,"name",{value:t,configurable:!0}),"t$3");const rn=["cjs","mjs"],nn=["mdoc"],fe=on(e=>{const t=(e.split("?")[0]??e).split(".").pop()?.toLowerCase();if(!t||rn.includes(t))return"javascript";if(nn.includes(t))return"markdown";switch(t){case"js":return"javascript";case"json":return"json";case"json5":return"json5";case"jsonc":return"jsonc";case"jsx":return"jsx";case"sql":return"sql";case"ts":return"typescript";case"tsx":return"tsx";case"xml":return"xml";case"md":return"markdown";case"mdx":return"mdx";case"svelte":return"svelte";case"vue":return"vue";case"html":return"html";case"css":return"css";case"scss":return"scss";case"less":return"less";case"sass":return"sass";case"stylus":return"stylus";case"styl":return"styl";default:return"javascript"}},"findLanguageBasedOnExtension");var an=Object.defineProperty,so=f((e,t)=>an(e,"name",{value:t,configurable:!0}),"o$4");const ce=new Map,we=so(async e=>{if(/^(?:http|https|file|data):/.test(e)){if(ce.has(e))return ce.get(e);if(e.startsWith("file:"))try{const t=jo(e),o=await Ro(t,"utf8");return ce.set(e,o),o}catch{return}try{const t=await fetch(e);if(!t.ok)return;const o=await t.text();return ce.set(e,o),o}catch{return}}},"getFileSource");so(()=>{ce.clear()},"clearFileSourceCache");var sn=Object.defineProperty,Me=f((e,t)=>sn(e,"name",{value:t,configurable:!0}),"d$2");const ln=Me(e=>e.replace(/^\s*#+\s*/,"").trim(),"sanitizeTitle"),cn=Me(async(e,t,o=!1)=>{const n=[...t,Ut,Zt],r=Ht(e,{frameLimit:1})[0]??{};for await(const i of n.sort((a,l)=>a.priority-l.priority)){const{handle:a}=i;if(typeof a!="function")continue;const l=await a(e,{file:r.file??"",language:fe(r.file??""),line:r.line??0,snippet:r.file?await we(r.file):""});if(l)return l}},"runSolutionFinders"),lo=Me(async(e,t)=>{const{solutionFinders:o=[],solutionTitle:n,color:r,debug:i=!1,...a}=t,l=Bo(e,{...a,...r?.codeFrame}),s=await cn(e,o,i);if(!s)return{errorAnsi:l,solutionBox:void 0};const d=ln(s.header??n??"A possible solution to this error"),c=en(s.body,{borderStyle:"round",padding:{top:1,right:2,bottom:1,left:2},margin:{top:0,right:0,bottom:0,left:0},headerText:`💡 ${d}`,headerAlignment:"left",textAlignment:"left",...r?.boxen});return{errorAnsi:l,solutionBox:c}},"buildOutput");Me(async(e,t={})=>{const{logger:o=console,...n}=t,{errorAnsi:r,solutionBox:i}=await lo(e,n);o.error(r),i&&(o.log(""),o.log(i))},"terminalOutput");const zt="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-help-circle%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M9.09%209a3%203%200%200%201%205.83%201c0%202-3%203-3%203%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2017h.01%22%20%2F%3E%20%3C%2Fsvg%3E",Bt="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-keyboard%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M10%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M14%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2012h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M18%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M6%208h.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2016h10%22%20%2F%3E%20%3Cpath%20d%3D%22M8%2012h.01%22%20%2F%3E%20%3Crect%20width%3D%2220%22%20height%3D%2216%22%20x%3D%222%22%20y%3D%224%22%20rx%3D%222%22%20%2F%3E%20%3C%2Fsvg%3E";var dn=Object.defineProperty,pn=f((e,t)=>dn(e,"name",{value:t,configurable:!0}),"o$3");const hn=`
|
|
13
13
|
<div id="ono-shortcuts-modal" class="fixed inset-0 z-50 hidden backdrop-blur-xl items-center justify-center p-2" role="dialog" aria-modal="true" aria-hidden="true" aria-labelledby="ono-shortcuts-title">
|
|
14
14
|
<div class="bg-[var(--ono-surface)] rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-2)] max-w-md w-full max-h-[90vh] overflow-auto">
|
|
15
15
|
<div class="flex items-center justify-between px-4 py-2 border-b border-[var(--ono-border)]">
|
|
@@ -255,7 +255,7 @@ bindShortcutsModal();
|
|
|
255
255
|
`:`
|
|
256
256
|
bindShortcutsModal();
|
|
257
257
|
`}
|
|
258
|
-
`}},"headerBar"),$n=`<!-- @license lucide-static v0.
|
|
258
|
+
`}},"headerBar"),$n=`<!-- @license lucide-static v0.556.0 - ISC -->
|
|
259
259
|
<svg
|
|
260
260
|
class="lucide lucide-blocks"
|
|
261
261
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -271,7 +271,7 @@ bindShortcutsModal();
|
|
|
271
271
|
<path d="M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2" />
|
|
272
272
|
<rect x="14" y="2" width="8" height="8" rx="1" />
|
|
273
273
|
</svg>
|
|
274
|
-
`,En=`<!-- @license lucide-static v0.
|
|
274
|
+
`,En=`<!-- @license lucide-static v0.556.0 - ISC -->
|
|
275
275
|
<svg
|
|
276
276
|
class="lucide lucide-layers"
|
|
277
277
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -288,7 +288,7 @@ bindShortcutsModal();
|
|
|
288
288
|
<path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12" />
|
|
289
289
|
<path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17" />
|
|
290
290
|
</svg>
|
|
291
|
-
`,Sn=`<!-- @license lucide-static v0.
|
|
291
|
+
`,Sn=`<!-- @license lucide-static v0.556.0 - ISC -->
|
|
292
292
|
<svg
|
|
293
293
|
class="lucide lucide-square-dashed"
|
|
294
294
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -315,7 +315,7 @@ bindShortcutsModal();
|
|
|
315
315
|
<path d="M21 14v1" />
|
|
316
316
|
</svg>
|
|
317
317
|
`;var Cn=Object.defineProperty,Tn=f((e,t)=>Cn(e,"name",{value:t,configurable:!0}),"e$1");const po=Tn((...e)=>e.filter(t=>typeof t=="string"&&t.length>0).join(" "),"cn");var An=Object.defineProperty,jt=f((e,t)=>An(e,"name",{value:t,configurable:!0}),"r$3");const Dn=jt(e=>{const t=jt(o=>{if(o.icon)return S(o.icon);switch(o.id){case"context":return $n;case"stack":return En;default:return Sn}},"getIcon");return{html:`<nav class="flex gap-1 p-1 rounded-[var(--ono-radius-md)] bg-[var(--ono-surface-muted)] shadow-[var(--ono-elevation-1)]" role="tablist">
|
|
318
|
-
${e.map(o=>{const n=po("relative px-3 py-1.5 rounded-[var(--ono-radius-md)] text-sm font-medium cursor-pointer text-[var(--ono-text-muted)] dark:text-[var(--ono-neutral)] transition-all duration-150 hover:text-[var(--ono-text)] hover:bg-[var(--ono-surface)] focus:outline-hidden focus:ring-2 ring-[var(--ono-red-orange)] inline-flex gap-2 items-center","active:bg-[var(--ono-surface)] active:text-[var(--ono-text)] active:shadow-[var(--ono-elevation-1)] active:ring-2",o.selected?"active":"","[:>svg]:size-4"),r=E(o.id),
|
|
318
|
+
${e.map(o=>{const n=po("relative px-3 py-1.5 rounded-[var(--ono-radius-md)] text-sm font-medium cursor-pointer text-[var(--ono-text-muted)] dark:text-[var(--ono-neutral)] transition-all duration-150 hover:text-[var(--ono-text)] hover:bg-[var(--ono-surface)] focus:outline-hidden focus:ring-2 ring-[var(--ono-red-orange)] inline-flex gap-2 items-center","active:bg-[var(--ono-surface)] active:text-[var(--ono-text)] active:shadow-[var(--ono-elevation-1)] active:ring-2",o.selected?"active":"","[:>svg]:size-4"),r=E(o.id),i=S(o.name);return`<button type="button" class="${n}" id="ono-tab-${r}" aria-selected="${o.selected?"true":"false"}" data-ono-tab="#ono-section-${r}" aria-controls="ono-section-${r}" role="tab" title="${i}">${t(o)}<span>${i}</span></button>`}).join("")}
|
|
319
319
|
</nav>`,script:`
|
|
320
320
|
// Tabs system initialization
|
|
321
321
|
(function() {
|
|
@@ -456,7 +456,7 @@ bindShortcutsModal();
|
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
458
|
});
|
|
459
|
-
`,
|
|
459
|
+
`,Ze=Oe((e,t)=>`<script${t?` nonce="${De(t)}"`:""}>${e}<\/script>`,"createScriptTag"),Rn=Oe((e,t)=>`<style${t?` nonce="${De(t)}"`:""}>${e}</style>`,"createStyleTag"),jn=Oe(({content:e,cspNonce:t,css:o,description:n,error:r,scripts:i,theme:a,title:l})=>{const s=_o(t),d=De(l||"Error"),c=De(n||""),h=r.stack||r.toString(),p=Ve.sanitize(h.includes(`
|
|
460
460
|
`)?h.replaceAll(`
|
|
461
461
|
`,`
|
|
462
462
|
`):h);return`<!--
|
|
@@ -469,11 +469,11 @@ bindShortcutsModal();
|
|
|
469
469
|
<title>${d}</title>
|
|
470
470
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
471
471
|
<meta name="description" content="${c}">
|
|
472
|
-
${Rn(o,
|
|
473
|
-
${
|
|
474
|
-
${
|
|
472
|
+
${Rn(o,s)}
|
|
473
|
+
${Ze(Bn.trim(),s)}
|
|
474
|
+
${i.filter(Boolean).map(u=>Ze(u,s)).join(`
|
|
475
475
|
`)}
|
|
476
|
-
${
|
|
476
|
+
${Ze(Ln.trim(),s)}
|
|
477
477
|
</head>
|
|
478
478
|
<body>
|
|
479
479
|
<div id="visulima-ono-container" class="bg-[var(--ono-bg)] text-[var(--ono-text)]">
|
|
@@ -486,17 +486,17 @@ bindShortcutsModal();
|
|
|
486
486
|
<!--
|
|
487
487
|
${p}
|
|
488
488
|
-->
|
|
489
|
-
`},"layout");var _n=Object.defineProperty,Fn=f((e,t)=>_n(e,"name",{value:t,configurable:!0}),"o$1");const _=globalThis,Mn=[[!!_.Netlify,"netlify"],[!!_.EdgeRuntime,"edge-light"],[_.navigator?.userAgent==="Cloudono-Workers","workerd"],[!!_.Deno,"deno"],[!!_.__lagon__,"lagon"],[_.process?.release?.name==="node","node"],[!!_.Bun||!!_.process?.versions?.bun,"bun"],[!!_.fastly,"fastly"]],On=Fn(()=>{const e=Mn.find(t=>t[0]);if(e)return e[1]},"detectRuntime"),Pn=On(),_t="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-minus%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M5%2012h14%22%20%2F%3E%20%3C%2Fsvg%3E",Ft="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-plus%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M5%2012h14%22%20%2F%3E%20%3Cpath%20d%3D%22M12%205v14%22%20%2F%3E%20%3C%2Fsvg%3E",Ie="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-chevron-down%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22m6%209%206%206%206-6%22%20%2F%3E%20%3C%2Fsvg%3E";var Nn=Object.defineProperty,qn=f((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"t$1");const Wn=qn(e=>{if(typeof e!="string")throw new TypeError("revisionHash: input must be a string");return qo("sha256").update(e,"utf8").digest("hex").slice(0,16)},"revisionHash");var Hn=Object.defineProperty,Un=f((e,t)=>Hn(e,"name",{value:t,configurable:!0}),"n$3");const
|
|
489
|
+
`},"layout");var _n=Object.defineProperty,Fn=f((e,t)=>_n(e,"name",{value:t,configurable:!0}),"o$1");const _=globalThis,Mn=[[!!_.Netlify,"netlify"],[!!_.EdgeRuntime,"edge-light"],[_.navigator?.userAgent==="Cloudono-Workers","workerd"],[!!_.Deno,"deno"],[!!_.__lagon__,"lagon"],[_.process?.release?.name==="node","node"],[!!_.Bun||!!_.process?.versions?.bun,"bun"],[!!_.fastly,"fastly"]],On=Fn(()=>{const e=Mn.find(t=>t[0]);if(e)return e[1]},"detectRuntime"),Pn=On(),_t="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-minus%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M5%2012h14%22%20%2F%3E%20%3C%2Fsvg%3E",Ft="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-plus%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M5%2012h14%22%20%2F%3E%20%3Cpath%20d%3D%22M12%205v14%22%20%2F%3E%20%3C%2Fsvg%3E",Ie="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-chevron-down%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22m6%209%206%206%206-6%22%20%2F%3E%20%3C%2Fsvg%3E";var Nn=Object.defineProperty,qn=f((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"t$1");const Wn=qn(e=>{if(typeof e!="string")throw new TypeError("revisionHash: input must be a string");return qo("sha256").update(e,"utf8").digest("hex").slice(0,16)},"revisionHash");var Hn=Object.defineProperty,Un=f((e,t)=>Hn(e,"name",{value:t,configurable:!0}),"n$3");const Zn=Un(e=>{if(e.startsWith("node:"))return"internal";if(e.includes("node_modules"))return"node_modules";if(e.includes("native"))return"native";if(e.includes("webpack"))return"webpack"},"getType");var Gn=Object.defineProperty,Vn=f((e,t)=>Gn(e,"name",{value:t,configurable:!0}),"n$2");const Kn=Vn(e=>{const t=[];let o=[];for(let n=0;n<e.length;n+=1){o.push(e[n]);const r=n===e.length-1,i=!r&&e[n].type!==e[n+1].type;(r||i)&&(o.length>1?t.push(o):t.push(o[0]),o=[])}return t},"groupSimilarTypes");var Qn=Object.defineProperty,Jn=f((e,t)=>Qn(e,"name",{value:t,configurable:!0}),"y$2");const ho=Jn(async(e,t={})=>{const o=Wn(e.name+e.message+e.stack),n=await Fo(),r=at(e),i=[],a=[];for await(const[p,u]of r.entries()){const m=`// Unable to load source code for ${u.file}:${u.line}:${u.column}`,g=u.file?await we(u.file):void 0,w=!!g,y=g?it(g,{start:{column:u.column,line:u.line}},{linesAbove:9,linesBelow:10,showGutter:!1}):m,D=n.codeToHtml(y,{lang:fe(u.file||""),themes:{dark:"github-dark-default",light:"github-light"}}),P=S(D),N=`${u.file}:${u.line}:${u.column}`,I=(u.file||"").replace(/^file:\/\//,""),ke=N.replace(Po.cwd?.()||"","").replace("file:///",""),ae=S(u.methodName||""),X=S(ke);i.push({html:`<button type="button" id="source-code-tabs-item-${o}-${p}" data-stack-tab="#source-code-tabs-${o}-${p}" aria-controls="source-code-tabs-${o}-${p}" ${w?"":'disabled aria-disabled="true"'} class="${po("relative inline-flex items-center gap-x-2 text-sm whitespace-nowrap p-6 w-full text-left border-l-2 border-transparent hover:bg-[var(--ono-hover-overlay)] text-[var(--ono-text-muted)] cursor-pointer",w?"cursor-pointer":"cursor-not-allowed")}">
|
|
490
490
|
<div class="flex flex-col w-full text-left overflow-hidden min-w-0">
|
|
491
|
-
<span class="font-medium text-[var(--ono-text)] truncate">${
|
|
491
|
+
<span class="font-medium text-[var(--ono-text)] truncate">${ae}</span>
|
|
492
492
|
<span class="text-sm text-[var(--ono-text-muted)] truncate">${X}</span>
|
|
493
493
|
</div>
|
|
494
|
-
</button>`,type:u.file?
|
|
494
|
+
</button>`,type:u.file?Zn(u.file):void 0});let We=X;t.openInEditorUrl?We=`<button type="button" class="underline hover:text-[var(--ono-link)]" data-open-in-editor data-url="${Mo(t.openInEditorUrl)}" data-path="${E(I)}" data-line="${E(u.line||1)}" data-column="${E(u.column||1)}" title="Open ${X} in external editor">${X} — Open in editor</button>`:w&&(We=`<button type="button" class="underline hover:text-[var(--ono-link)]" data-editor-link data-path="${E(I)}" data-line="${E(u.line||1)}" data-column="${E(u.column||1)}" title="Open ${X} in editor">${X} — Open in editor</button>`),a.push(`<div id="source-code-tabs-${o}-${p}" class="${p===0&&w?"block":"hidden"}" aria-labelledby="source-code-tabs-item-${o}-${p}" tabindex="0">
|
|
495
495
|
<div class="pt-6 px-6 text-sm text-right text-[var(--ono-text)]">
|
|
496
496
|
${We}
|
|
497
497
|
</div>
|
|
498
|
-
<div class="p-6">${
|
|
499
|
-
</div>`)}const l=Kn(
|
|
498
|
+
<div class="p-6">${P}</div>
|
|
499
|
+
</div>`)}const l=Kn(i),s=l.map((p,u)=>{if(Array.isArray(p)){const m=p[0];let g;switch(m.type){case"bun":{g="bun";break}case"internal":{g="internal";break}case"native":{g="native";break}case"node_modules":{g="node_modules";break}case"webpack":{g="webpack";break}default:g="application"}const w=`small-switch-${o}-${u}`,y=`stack-trace-group-${o}-${u}`;return`<div class="flex items-center gap-2">
|
|
500
500
|
<label for="${w}" class="relative text-sm text-[var(--ono-text)] flex gap-2 items-center">
|
|
501
501
|
<div class="relative inline-flex h-5 w-9 cursor-pointer items-center">
|
|
502
502
|
<input type="checkbox" id="${w}" data-group-toggle="${o}" data-target-id="${y}" class="peer sr-only">
|
|
@@ -505,12 +505,12 @@ bindShortcutsModal();
|
|
|
505
505
|
</div>
|
|
506
506
|
<span class="cursor-pointer" title="Toggle visibility of ${g} frames">${g}</span>
|
|
507
507
|
</label>
|
|
508
|
-
</div>`}return""}).join(""),d=
|
|
508
|
+
</div>`}return""}).join(""),d=s.trim().length>0,c=`<section class="container rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-2)] bg-[var(--ono-surface)]" aria-label="Stack trace viewer">
|
|
509
509
|
<main id="stack-trace-viewer" class="flex flex-row">
|
|
510
510
|
<div class="w-4/12 rounded-tl-lg rounded-bl-lg overflow-hidden">
|
|
511
511
|
<div class="${d?"p-6":"p-0"}">
|
|
512
512
|
${d?'<span class="block text-xs mb-2 text-[var(--ono-text-muted)]">Show or Hide collapsed frames</span>':""}
|
|
513
|
-
<div class="flex flex-row items-center gap-2">${
|
|
513
|
+
<div class="flex flex-row items-center gap-2">${s}</div>
|
|
514
514
|
</div>
|
|
515
515
|
<nav class="flex flex-col" aria-label="Frames">
|
|
516
516
|
${l.map((p,u)=>{if(Array.isArray(p)){const m=p[0];let g;switch(m.type){case"bun":{g="bun";break}case"internal":{g="internal";break}case"native":{g="native";break}case"node_modules":{g="node_modules";break}case"webpack":{g="webpack";break}default:g="application"}return`<details id="stack-trace-group-${o}-${u}">
|
|
@@ -739,16 +739,16 @@ bindShortcutsModal();
|
|
|
739
739
|
})();
|
|
740
740
|
`;return{html:c,script:h}},"stackTraceViewer"),Xe="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-info%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2016v-4%22%20%2F%3E%20%3Cpath%20d%3D%22M12%208h.01%22%20%2F%3E%20%3C%2Fsvg%3E";var Xn=Object.defineProperty,Yn=f((e,t)=>Xn(e,"name",{value:t,configurable:!0}),"s$2");const uo=Yn(({message:e}={})=>e?`<span class="inline-flex justify-center items-center text-[var(--ono-text)] cursor-help" title="${S(e)}">
|
|
741
741
|
<span class="dui" style="-webkit-mask-image: url('${Xe}'); mask-image: url('${Xe}')"></span>
|
|
742
|
-
</span>`:"","tooltip");var ea=Object.defineProperty,ta=f((e,t)=>ea(e,"name",{value:t,configurable:!0}),"r$1");const oa=ta(async(e,t={})=>{if(e.length===0)return{html:"",script:""};const o=[],n=[];for await(const[r,
|
|
742
|
+
</span>`:"","tooltip");var ea=Object.defineProperty,ta=f((e,t)=>ea(e,"name",{value:t,configurable:!0}),"r$1");const oa=ta(async(e,t={})=>{if(e.length===0)return{html:"",script:""};const o=[],n=[];for await(const[r,i]of e.entries())if(i instanceof Error){const{html:a,script:l}=await ho(i,{openInEditorUrl:t.openInEditorUrl});o.push(`<details aria-label="Cause ${r+1}" class="relative rounded-[var(--ono-radius-lg)] mb-2 last:mb-0 group shadow-[var(--ono-elevation-1)] bg-[var(--ono-surface)]">
|
|
743
743
|
<summary class="pl-5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] transition-all inline-flex justify-between items-center gap-x-3 w-full font-semibold text-start py-4 px-5 disabled:opacity-50 disabled:pointer-events-none cursor-pointer text-[var(--ono-text)]">
|
|
744
|
-
${S(
|
|
744
|
+
${S(i.name)}: ${S(i.message)}
|
|
745
745
|
<span class="dui ono-expand-icon-closed size-4" style="-webkit-mask-image:url('${Ft}'); mask-image:url('${Ft}')"></span>
|
|
746
746
|
<span class="dui ono-expand-icon-open size-4" style="-webkit-mask-image:url('${_t}'); mask-image:url('${_t}')"></span>
|
|
747
747
|
</summary>
|
|
748
748
|
<section class="w-full overflow-hidden transition-[height] duration-300 p-5 pt-0">
|
|
749
749
|
${a}
|
|
750
750
|
</section>
|
|
751
|
-
</details>`),n.push(l)}else typeof
|
|
751
|
+
</details>`),n.push(l)}else typeof i=="string"?o.push(`<div class="container rounded-lg mt-2 py-4 px-5 shadow-xl bg-[var(--ono-white-smoke)] text-[var(--ono-text)]">${S(i)}</div>`):o.push(`<div class="container rounded-lg mt-2 py-4 px-5 shadow-xl bg-[var(--ono-white-smoke)] text-[var(--ono-text)]">${S(JSON.stringify(i))}</div>`);return{html:`<style>
|
|
752
752
|
/* Toggle plus/minus icons inside <details> */
|
|
753
753
|
details summary .ono-expand-icon-open { display: none !important; }
|
|
754
754
|
details[open] summary .ono-expand-icon-open { display: inline-block !important; }
|
|
@@ -763,12 +763,12 @@ bindShortcutsModal();
|
|
|
763
763
|
<div class="mt-6">${o.join(`
|
|
764
764
|
`)}</div>
|
|
765
765
|
</section>`,script:n.join(`
|
|
766
|
-
`)}},"causes"),Mt="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-external-link%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M15%203h6v6%22%20%2F%3E%20%3Cpath%20d%3D%22M10%2014%2021%203%22%20%2F%3E%20%3Cpath%20d%3D%22M18%2013v6a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V8a2%202%200%200%201%202-2h6%22%20%2F%3E%20%3C%2Fsvg%3E";var ra=Object.defineProperty,na=f((e,t)=>ra(e,"name",{value:t,configurable:!0}),"i$2");const go=na(({label:e="Copy",secondaryLabel:t="Copy fix prompt",secondaryText:o,successText:n="Copied!",targetId:r})=>{const
|
|
766
|
+
`)}},"causes"),Mt="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-external-link%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M15%203h6v6%22%20%2F%3E%20%3Cpath%20d%3D%22M10%2014%2021%203%22%20%2F%3E%20%3Cpath%20d%3D%22M18%2013v6a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V8a2%202%200%200%201%202-2h6%22%20%2F%3E%20%3C%2Fsvg%3E";var ra=Object.defineProperty,na=f((e,t)=>ra(e,"name",{value:t,configurable:!0}),"i$2");const go=na(({label:e="Copy",secondaryLabel:t="Copy fix prompt",secondaryText:o,successText:n="Copied!",targetId:r})=>{const i=S(t),a=E(o),l=E(r),s=E(e),d=S(e);return{html:`
|
|
767
767
|
<div class="ono-dropdown relative inline-block">
|
|
768
768
|
<button
|
|
769
769
|
type="button"
|
|
770
|
-
aria-label="${
|
|
771
|
-
title="${
|
|
770
|
+
aria-label="${s}"
|
|
771
|
+
title="${s}"
|
|
772
772
|
aria-haspopup="menu"
|
|
773
773
|
aria-expanded="false"
|
|
774
774
|
aria-controls="${E(`ono-copy-menu-${String(r).replace(/^#/,"")}`)}"
|
|
@@ -797,36 +797,36 @@ bindShortcutsModal();
|
|
|
797
797
|
data-text="${a}"
|
|
798
798
|
data-success-text="${E(n)}"
|
|
799
799
|
>
|
|
800
|
-
${
|
|
800
|
+
${i}
|
|
801
801
|
</button>
|
|
802
802
|
</div>
|
|
803
803
|
</div>
|
|
804
|
-
`}},"copyDropdown"),Ge="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-x%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M18%206%206%2018%22%20%2F%3E%20%3Cpath%20d%3D%22m6%206%2012%2012%22%20%2F%3E%20%3C%2Fsvg%3E";var aa=Object.defineProperty,v=f((e,t)=>aa(e,"name",{value:t,configurable:!0}),"k");function Pe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}f(Pe,"E$1");v(Pe,"L");var J=Pe();function pt(e){J=e}f(pt,"
|
|
805
|
-
]`).replace("lheading",fo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},va=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ka=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bo=/^( {2,}|\\)\n(?!\s*$)/,xa=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qe=/[\p{P}\p{S}]/u,wt=/[\s\p{P}\p{S}]/u,vo=/[^\s\p{P}\p{S}]/u,ya=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wt).getRegex(),ko=/(?!~)[\p{P}\p{S}]/u,$a=/(?!~)[\s\p{P}\p{S}]/u,Ea=/(?:[^\s\p{P}\p{S}]|~)/u,Sa=b(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",
|
|
806
|
-
`).map(
|
|
807
|
-
`)}f(Co,"
|
|
804
|
+
`}},"copyDropdown"),Ge="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-x%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M18%206%206%2018%22%20%2F%3E%20%3Cpath%20d%3D%22m6%206%2012%2012%22%20%2F%3E%20%3C%2Fsvg%3E";var aa=Object.defineProperty,v=f((e,t)=>aa(e,"name",{value:t,configurable:!0}),"k");function Pe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}f(Pe,"E$1");v(Pe,"L");var J=Pe();function pt(e){J=e}f(pt,"le");v(pt,"Z");var pe={exec:v(()=>null,"exec")};function b(e,t=""){let o=typeof e=="string"?e:e.source,n={replace:v((r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(C.caret,"$1"),o=o.replace(r,a),n},"replace"),getRegex:v(()=>new RegExp(o,t),"getRegex")};return n}f(b,"p");v(b,"k");var ia=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),C={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:v(e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),"listItemRegex"),nextBulletRegex:v(e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),"nextBulletRegex"),hrRegex:v(e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),"hrRegex"),fencesBeginRegex:v(e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),"fencesBeginRegex"),headingBeginRegex:v(e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),"headingBeginRegex"),htmlBeginRegex:v(e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),"htmlBeginRegex")},sa=/^(?:[ \t]*(?:\n|$))+/,la=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ca=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,be=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,da=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ht=/(?:[*+-]|\d{1,9}[.)])/,mo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fo=b(mo).replace(/bull/g,ht).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),pa=b(mo).replace(/bull/g,ht).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ut=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ha=/^[^\n]+/,gt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ua=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ga=b(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ht).getRegex(),Ne="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",mt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ma=b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",mt).replace("tag",Ne).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wo=b(ut).replace("hr",be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ne).getRegex(),fa=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wo).getRegex(),ft={blockquote:fa,code:la,def:ua,fences:ca,heading:da,hr:be,html:ma,lheading:fo,list:ga,newline:sa,paragraph:wo,table:pe,text:ha},Ot=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ne).getRegex(),wa={...ft,lheading:pa,table:Ot,paragraph:b(ut).replace("hr",be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ot).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ne).getRegex()},ba={...ft,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:pe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(ut).replace("hr",be).replace("heading",` *#{1,6} *[^
|
|
805
|
+
]`).replace("lheading",fo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},va=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ka=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bo=/^( {2,}|\\)\n(?!\s*$)/,xa=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qe=/[\p{P}\p{S}]/u,wt=/[\s\p{P}\p{S}]/u,vo=/[^\s\p{P}\p{S}]/u,ya=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wt).getRegex(),ko=/(?!~)[\p{P}\p{S}]/u,$a=/(?!~)[\s\p{P}\p{S}]/u,Ea=/(?:[^\s\p{P}\p{S}]|~)/u,Sa=b(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ia?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xo=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ca=b(xo,"u").replace(/punct/g,qe).getRegex(),Ta=b(xo,"u").replace(/punct/g,ko).getRegex(),yo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Aa=b(yo,"gu").replace(/notPunctSpace/g,vo).replace(/punctSpace/g,wt).replace(/punct/g,qe).getRegex(),Da=b(yo,"gu").replace(/notPunctSpace/g,Ea).replace(/punctSpace/g,$a).replace(/punct/g,ko).getRegex(),Ia=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vo).replace(/punctSpace/g,wt).replace(/punct/g,qe).getRegex(),za=b(/\\(punct)/,"gu").replace(/punct/g,qe).getRegex(),Ba=b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),La=b(mt).replace("(?:-->|$)","-->").getRegex(),Ra=b("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",La).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ze=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,ja=b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ze).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$o=b(/^!?\[(label)\]\[(ref)\]/).replace("label",ze).replace("ref",gt).getRegex(),Eo=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",gt).getRegex(),_a=b("reflink|nolink(?!\\()","g").replace("reflink",$o).replace("nolink",Eo).getRegex(),Pt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,bt={_backpedal:pe,anyPunctuation:za,autolink:Ba,blockSkip:Sa,br:bo,code:ka,del:pe,emStrongLDelim:Ca,emStrongRDelimAst:Aa,emStrongRDelimUnd:Ia,escape:va,link:ja,nolink:Eo,punctuation:ya,reflink:$o,reflinkSearch:_a,tag:Ra,text:xa,url:pe},Fa={...bt,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",ze).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ze).getRegex()},Ye={...bt,emStrongRDelimAst:Da,emStrongLDelim:Ta,url:b(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Pt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:b(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Pt).getRegex()},Ma={...Ye,br:b(bo).replace("{2,}","*").getRegex(),text:b(Ye.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ee={normal:ft,gfm:wa,pedantic:ba},le={normal:bt,gfm:Ye,breaks:Ma,pedantic:Fa},Oa={"&":"&","<":"<",">":">",'"':""","'":"'"},Nt=v(e=>Oa[e],"ke");function z(e,t){if(t){if(C.escapeTest.test(e))return e.replace(C.escapeReplace,Nt)}else if(C.escapeTestNoEncode.test(e))return e.replace(C.escapeReplaceNoEncode,Nt);return e}f(z,"$$2");v(z,"w");function et(e){try{e=encodeURI(e).replace(C.percentDecode,"%")}catch{return null}return e}f(et,"re");v(et,"X");function tt(e,t){let o=e.replace(C.findPipe,(i,a,l)=>{let s=!1,d=a;for(;--d>=0&&l[d]==="\\";)s=!s;return s?"|":" |"}),n=o.split(C.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(C.slashPipe,"|");return n}f(tt,"se");v(tt,"J");function ee(e,t,o){let n=e.length;if(n===0)return"";let r=0;for(;r<n;){let i=e.charAt(n-r-1);if(i===t&&!o)r++;else if(i!==t&&o)r++;else break}return e.slice(0,n-r)}f(ee,"_");v(ee,"z");function So(e,t){if(e.indexOf(t[1])===-1)return-1;let o=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])o++;else if(e[n]===t[1]&&(o--,o<0))return n;return o>0?-2:-1}f(So,"Ye");v(So,"de");function ot(e,t,o,n,r){let i=t.href,a=t.title||null,l=e[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let s={type:e[0].charAt(0)==="!"?"image":"link",raw:o,href:i,title:a,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,s}f(ot,"ne");v(ot,"ge");function Co(e,t,o){let n=e.match(o.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
806
|
+
`).map(i=>{let a=i.match(o.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=r.length?i.slice(r.length):i}).join(`
|
|
807
|
+
`)}f(Co,"et");v(Co,"Je");var Be=class{static{f(this,"I")}static{v(this,"y")}options;rules;lexer;constructor(e){this.options=e||J}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let o=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?o:ee(o,`
|
|
808
808
|
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let o=t[0],n=Co(o,t[3]||"",this.rules);return{type:"code",raw:o,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let o=t[2].trim();if(this.rules.other.endingHash.test(o)){let n=ee(o,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(o=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ee(t[0],`
|
|
809
809
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let o=ee(t[0],`
|
|
810
810
|
`).split(`
|
|
811
|
-
`),n="",r="",
|
|
811
|
+
`),n="",r="",i=[];for(;o.length>0;){let a=!1,l=[],s;for(s=0;s<o.length;s++)if(this.rules.other.blockquoteStart.test(o[s]))l.push(o[s]),a=!0;else if(!a)l.push(o[s]);else break;o=o.slice(s);let d=l.join(`
|
|
812
812
|
`),c=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
813
813
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
814
814
|
${d}`:d,r=r?`${r}
|
|
815
|
-
${c}`:c;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,
|
|
815
|
+
${c}`:c;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=h,o.length===0)break;let p=i.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let u=p,m=u.raw+`
|
|
816
816
|
`+o.join(`
|
|
817
|
-
`),g=this.blockquote(m);
|
|
817
|
+
`),g=this.blockquote(m);i[i.length-1]=g,n=n.substring(0,n.length-u.raw.length)+g.raw,r=r.substring(0,r.length-u.text.length)+g.text;break}else if(p?.type==="list"){let u=p,m=u.raw+`
|
|
818
818
|
`+o.join(`
|
|
819
|
-
`),g=this.list(m);
|
|
820
|
-
`);continue}}return{type:"blockquote",raw:n,tokens:
|
|
821
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
819
|
+
`),g=this.list(m);i[i.length-1]=g,n=n.substring(0,n.length-p.raw.length)+g.raw,r=r.substring(0,r.length-u.raw.length)+g.raw,o=m.substring(i.at(-1).raw.length).split(`
|
|
820
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let o=t[1].trim(),n=o.length>1,r={type:"list",raw:"",ordered:n,start:n?+o.slice(0,-1):"",loose:!1,items:[]};o=n?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=n?o:"[*+-]");let i=this.rules.other.listItemRegex(o),a=!1;for(;e;){let s=!1,d="",c="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let h=t[2].split(`
|
|
821
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,g=>" ".repeat(3*g.length)),p=e.split(`
|
|
822
822
|
`,1)[0],u=!h.trim(),m=0;if(this.options.pedantic?(m=2,c=h.trimStart()):u?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,c=h.slice(m),m+=t[1].length),u&&this.rules.other.blankLine.test(p)&&(d+=p+`
|
|
823
|
-
`,e=e.substring(p.length+1),
|
|
824
|
-
`,1)[0],I;if(p=
|
|
825
|
-
`+I.slice(m);else{if(u||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||
|
|
826
|
-
`+p}!u&&!p.trim()&&(u=!0),d+=
|
|
827
|
-
`,e=e.substring(
|
|
828
|
-
`):[],
|
|
829
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:o,tokens:this.lexer.inline(o)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let o=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;let
|
|
823
|
+
`,e=e.substring(p.length+1),s=!0),!s){let g=this.rules.other.nextBulletRegex(m),w=this.rules.other.hrRegex(m),y=this.rules.other.fencesBeginRegex(m),D=this.rules.other.headingBeginRegex(m),P=this.rules.other.htmlBeginRegex(m);for(;e;){let N=e.split(`
|
|
824
|
+
`,1)[0],I;if(p=N,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),I=p):I=p.replace(this.rules.other.tabCharGlobal," "),y.test(p)||D.test(p)||P.test(p)||g.test(p)||w.test(p))break;if(I.search(this.rules.other.nonSpaceChar)>=m||!p.trim())c+=`
|
|
825
|
+
`+I.slice(m);else{if(u||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(h)||D.test(h)||w.test(h))break;c+=`
|
|
826
|
+
`+p}!u&&!p.trim()&&(u=!0),d+=N+`
|
|
827
|
+
`,e=e.substring(N.length+1),h=I.slice(m)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(a=!0)),r.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=d}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let s of r.items){if(this.lexer.state.top=!1,s.tokens=this.lexer.blockTokens(s.text,[]),s.task){if(s.text=s.text.replace(this.rules.other.listReplaceTask,""),s.tokens[0]?.type==="text"||s.tokens[0]?.type==="paragraph"){s.tokens[0].raw=s.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),s.tokens[0].text=s.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(s.raw);if(d){let c={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};s.checked=c.checked,r.loose?s.tokens[0]&&["paragraph","text"].includes(s.tokens[0].type)&&"tokens"in s.tokens[0]&&s.tokens[0].tokens?(s.tokens[0].raw=c.raw+s.tokens[0].raw,s.tokens[0].text=c.raw+s.tokens[0].text,s.tokens[0].tokens.unshift(c)):s.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):s.tokens.unshift(c)}}if(!r.loose){let d=s.tokens.filter(h=>h.type==="space"),c=d.length>0&&d.some(h=>this.rules.other.anyLine.test(h.raw));r.loose=c}}if(r.loose)for(let s of r.items){s.loose=!0;for(let d of s.tokens)d.type==="text"&&(d.type="paragraph")}return r}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let o=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:o,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let o=tt(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
828
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(o.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<o.length;a++)i.header.push({text:o[a],tokens:this.lexer.inline(o[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(tt(a,i.header.length).map((l,s)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[s]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let o=t[1].charAt(t[1].length-1)===`
|
|
829
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:o,tokens:this.lexer.inline(o)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let o=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;let i=ee(o.slice(0,-1),"\\");if((o.length-i.length)%2===0)return}else{let i=So(t[2],"()");if(i===-2)return;if(i>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],r=i[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?n=n.slice(1):n=n.slice(1,-1)),ot(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let o;if((o=this.rules.inline.reflink.exec(e))||(o=this.rules.inline.nolink.exec(e))){let n=(o[2]||o[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[n.toLowerCase()];if(!r){let i=o[0].charAt(0);return{type:"text",raw:i,text:i}}return ot(o,r,o[0],this.lexer,this.rules)}}emStrong(e,t,o=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&o.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!o||this.rules.inline.punctuation.exec(o))){let r=[...n[0]].length-1,i,a,l=r,s=0,d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+r);(n=d.exec(t))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){l+=a;continue}else if((n[5]||n[6])&&r%3&&!((r+a)%3)){s+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+s);let c=[...n[0]][0].length,h=e.slice(0,r+n.index+c+a);if(Math.min(r,a)%2){let u=h.slice(1,-1);return{type:"em",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}let p=h.slice(2,-2);return{type:"strong",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let o=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(o),r=this.rules.other.startingSpaceChar.test(o)&&this.rules.other.endingSpaceChar.test(o);return n&&r&&(o=o.substring(1,o.length-1)),{type:"codespan",raw:t[0],text:o}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let o,n;return t[2]==="@"?(o=t[1],n="mailto:"+o):(o=t[1],n=o),{type:"link",raw:t[0],text:o,href:n,tokens:[{type:"text",raw:o,text:o}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let o,n;if(t[2]==="@")o=t[0],n="mailto:"+o;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);o=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:o,href:n,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let o=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:o}}}},B=class rt{static{f(this,"O")}static{v(this,"u")}tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||J,this.options.tokenizer=this.options.tokenizer||new Be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let o={other:C,block:Ee.normal,inline:le.normal};this.options.pedantic?(o.block=Ee.pedantic,o.inline=le.pedantic):this.options.gfm&&(o.block=Ee.gfm,this.options.breaks?o.inline=le.breaks:o.inline=le.gfm),this.tokenizer.rules=o}static get rules(){return{block:Ee,inline:le}}static lex(t,o){return new rt(o).lex(t)}static lexInline(t,o){return new rt(o).inlineTokens(t)}lex(t){t=t.replace(C.carriageReturn,`
|
|
830
830
|
`),this.blockTokens(t,this.tokens);for(let o=0;o<this.inlineQueue.length;o++){let n=this.inlineQueue[o];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,o=[],n=!1){for(this.options.pedantic&&(t=t.replace(C.tabCharGlobal," ").replace(C.spaceLine,""));t;){let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},t,o))?(t=t.substring(r.raw.length),o.push(r),!0):!1))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);let a=o.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
|
|
831
831
|
`:o.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let a=o.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
832
832
|
`)?"":`
|
|
@@ -834,39 +834,39 @@ ${c}`:c;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
834
834
|
`+r.text,this.inlineQueue.at(-1).src=a.text):o.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),o.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),o.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),o.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),o.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),o.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),o.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);let a=o.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
835
835
|
`)?"":`
|
|
836
836
|
`)+r.raw,a.text+=`
|
|
837
|
-
`+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},o.push(r));continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),o.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),o.push(r);continue}let
|
|
837
|
+
`+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},o.push(r));continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),o.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),o.push(r);continue}let i=t;if(this.options.extensions?.startBlock){let a=1/0,l=t.slice(1),s;this.options.extensions.startBlock.forEach(d=>{s=d.call({lexer:this},l),typeof s=="number"&&s>=0&&(a=Math.min(a,s))}),a<1/0&&a>=0&&(i=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=o.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
838
838
|
`)?"":`
|
|
839
839
|
`)+r.raw,a.text+=`
|
|
840
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):o.push(r),n=
|
|
840
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):o.push(r),n=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);let a=o.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
841
841
|
`)?"":`
|
|
842
842
|
`)+r.raw,a.text+=`
|
|
843
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):o.push(r);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,o}inline(t,o=[]){return this.inlineQueue.push({src:t,tokens:o}),o}inlineTokens(t,o=[]){let n=t,r=null;if(this.tokens.links){let
|
|
844
|
-
`;return r?'<pre><code class="language-'+z(r)+'">'+(n?
|
|
845
|
-
`:"<pre><code>"+(n?
|
|
843
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):o.push(r);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,o}inline(t,o=[]){return this.inlineQueue.push({src:t,tokens:o}),o}inlineTokens(t,o=[]){let n=t,r=null;if(this.tokens.links){let s=Object.keys(this.tokens.links);if(s.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)s.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,l="";for(;t;){a||(l=""),a=!1;let s;if(this.options.extensions?.inline?.some(c=>(s=c.call({lexer:this},t,o))?(t=t.substring(s.raw.length),o.push(s),!0):!1))continue;if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),o.push(s);continue}if(s=this.tokenizer.tag(t)){t=t.substring(s.raw.length),o.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),o.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length);let c=o.at(-1);s.type==="text"&&c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):o.push(s);continue}if(s=this.tokenizer.emStrong(t,n,l)){t=t.substring(s.raw.length),o.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),o.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),o.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),o.push(s);continue}if(s=this.tokenizer.autolink(t)){t=t.substring(s.raw.length),o.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(t))){t=t.substring(s.raw.length),o.push(s);continue}let d=t;if(this.options.extensions?.startInline){let c=1/0,h=t.slice(1),p;this.options.extensions.startInline.forEach(u=>{p=u.call({lexer:this},h),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(d=t.substring(0,c+1))}if(s=this.tokenizer.inlineText(d)){t=t.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(l=s.raw.slice(-1)),a=!0;let c=o.at(-1);c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):o.push(s);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return o}},Le=class{static{f(this,"L")}static{v(this,"P")}options;parser;constructor(t){this.options=t||J}space(t){return""}code({text:t,lang:o,escaped:n}){let r=(o||"").match(C.notSpaceStart)?.[0],i=t.replace(C.endingNewline,"")+`
|
|
844
|
+
`;return r?'<pre><code class="language-'+z(r)+'">'+(n?i:z(i,!0))+`</code></pre>
|
|
845
|
+
`:"<pre><code>"+(n?i:z(i,!0))+`</code></pre>
|
|
846
846
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
847
847
|
${this.parser.parse(t)}</blockquote>
|
|
848
848
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
|
|
849
849
|
`}hr(t){return`<hr>
|
|
850
|
-
`}list(t){let o=t.ordered,n=t.start,r="";for(let l=0;l<t.items.length;l++){let
|
|
851
|
-
`+r+"</"+
|
|
850
|
+
`}list(t){let o=t.ordered,n=t.start,r="";for(let l=0;l<t.items.length;l++){let s=t.items[l];r+=this.listitem(s)}let i=o?"ol":"ul",a=o&&n!==1?' start="'+n+'"':"";return"<"+i+a+`>
|
|
851
|
+
`+r+"</"+i+`>
|
|
852
852
|
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
853
853
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
854
|
-
`}table(t){let o="",n="";for(let
|
|
854
|
+
`}table(t){let o="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);o+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){let a=t.rows[i];n="";for(let l=0;l<a.length;l++)n+=this.tablecell(a[l]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
855
855
|
<thead>
|
|
856
856
|
`+o+`</thead>
|
|
857
857
|
`+r+`</table>
|
|
858
858
|
`}tablerow({text:t}){return`<tr>
|
|
859
859
|
${t}</tr>
|
|
860
860
|
`}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
|
|
861
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let r=this.parser.parseInline(n),
|
|
862
|
-
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+z(o.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(o);throw o}}},W=new Pa;function x(e,t){return W.parse(e,t)}f(x,"g");v(x,"d");x.options=x.setOptions=function(e){return W.setOptions(e),x.defaults=W.defaults,pt(x.defaults),x};x.getDefaults=Pe;x.defaults=J;x.use=function(...e){return W.use(...e),x.defaults=W.defaults,pt(x.defaults),x};x.walkTokens=function(e,t){return W.walkTokens(e,t)};x.parseInline=W.parseInline;x.Parser=L;x.parser=L.parse;x.Renderer=Le;x.TextRenderer=vt;x.Lexer=B;x.lexer=B.lex;x.Tokenizer=Be;x.Hooks=
|
|
861
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let r=this.parser.parseInline(n),i=et(t);if(i===null)return r;t=i;let a='<a href="'+t+'"';return o&&(a+=' title="'+z(o)+'"'),a+=">"+r+"</a>",a}image({href:t,title:o,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=et(t);if(i===null)return z(n);t=i;let a=`<img src="${t}" alt="${n}"`;return o&&(a+=` title="${z(o)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},vt=class{static{f(this,"D")}static{v(this,"$")}strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},L=class nt{static{f(this,"H")}static{v(this,"u")}options;renderer;textRenderer;constructor(t){this.options=t||J,this.options.renderer=this.options.renderer||new Le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vt}static parse(t,o){return new nt(o).parse(t)}static parseInline(t,o){return new nt(o).parseInline(t)}parse(t){let o="";for(let n=0;n<t.length;n++){let r=t[n];if(this.options.extensions?.renderers?.[r.type]){let a=r,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){o+=l||"";continue}}let i=r;switch(i.type){case"space":{o+=this.renderer.space(i);break}case"hr":{o+=this.renderer.hr(i);break}case"heading":{o+=this.renderer.heading(i);break}case"code":{o+=this.renderer.code(i);break}case"table":{o+=this.renderer.table(i);break}case"blockquote":{o+=this.renderer.blockquote(i);break}case"list":{o+=this.renderer.list(i);break}case"checkbox":{o+=this.renderer.checkbox(i);break}case"html":{o+=this.renderer.html(i);break}case"def":{o+=this.renderer.def(i);break}case"paragraph":{o+=this.renderer.paragraph(i);break}case"text":{o+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return o}parseInline(t,o=this.renderer){let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=l||"";continue}}let a=i;switch(a.type){case"escape":{n+=o.text(a);break}case"html":{n+=o.html(a);break}case"link":{n+=o.link(a);break}case"image":{n+=o.image(a);break}case"checkbox":{n+=o.checkbox(a);break}case"strong":{n+=o.strong(a);break}case"em":{n+=o.em(a);break}case"codespan":{n+=o.codespan(a);break}case"br":{n+=o.br(a);break}case"del":{n+=o.del(a);break}case"text":{n+=o.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}},de=class{static{f(this,"T")}static{v(this,"S")}options;block;constructor(t){this.options=t||J}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?B.lex:B.lexInline}provideParser(){return this.block?L.parse:L.parseInline}},Pa=class{static{f(this,"fe")}static{v(this,"B")}defaults=Pe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=L;Renderer=Le;TextRenderer=vt;Lexer=B;Tokenizer=Be;Hooks=de;constructor(...e){this.use(...e)}walkTokens(e,t){let o=[];for(let n of e)switch(o=o.concat(t.call(this,n)),n.type){case"table":{let r=n;for(let i of r.header)o=o.concat(this.walkTokens(i.tokens,t));for(let i of r.rows)for(let a of i)o=o.concat(this.walkTokens(a.tokens,t));break}case"list":{let r=n;o=o.concat(this.walkTokens(r.items,t));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let a=r[i].flat(1/0);o=o.concat(this.walkTokens(a,t))}):r.tokens&&(o=o.concat(this.walkTokens(r.tokens,t)))}}return o}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(o=>{let n={...o};if(n.async=this.defaults.async||n.async||!1,o.extensions&&(o.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=t.renderers[r.name];i?t.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[r.level];i?i.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),n.extensions=t),o.renderer){let r=this.defaults.renderer||new Le(this.defaults);for(let i in o.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=o.renderer[a],s=r[a];r[a]=(...d)=>{let c=l.apply(r,d);return c===!1&&(c=s.apply(r,d)),c||""}}n.renderer=r}if(o.tokenizer){let r=this.defaults.tokenizer||new Be(this.defaults);for(let i in o.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=o.tokenizer[a],s=r[a];r[a]=(...d)=>{let c=l.apply(r,d);return c===!1&&(c=s.apply(r,d)),c}}n.tokenizer=r}if(o.hooks){let r=this.defaults.hooks||new de;for(let i in o.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=o.hooks[a],s=r[a];de.passThroughHooks.has(i)?r[a]=d=>{if(this.defaults.async&&de.passThroughHooksRespectAsync.has(i))return(async()=>{let h=await l.call(r,d);return s.call(r,h)})();let c=l.call(r,d);return s.call(r,c)}:r[a]=(...d)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(r,d);return h===!1&&(h=await s.apply(r,d)),h})();let c=l.apply(r,d);return c===!1&&(c=s.apply(r,d)),c}}n.hooks=r}if(o.walkTokens){let r=this.defaults.walkTokens,i=o.walkTokens;n.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return B.lex(e,t??this.defaults)}parser(e,t){return L.parse(e,t??this.defaults)}parseMarkdown(e){return(t,o)=>{let n={...o},r={...this.defaults,...n},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=e),r.async)return(async()=>{let a=r.hooks?await r.hooks.preprocess(t):t,l=await(r.hooks?await r.hooks.provideLexer():e?B.lex:B.lexInline)(a,r),s=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(s,r.walkTokens));let d=await(r.hooks?await r.hooks.provideParser():e?L.parse:L.parseInline)(s,r);return r.hooks?await r.hooks.postprocess(d):d})().catch(i);try{r.hooks&&(t=r.hooks.preprocess(t));let a=(r.hooks?r.hooks.provideLexer():e?B.lex:B.lexInline)(t,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let l=(r.hooks?r.hooks.provideParser():e?L.parse:L.parseInline)(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(e,t){return o=>{if(o.message+=`
|
|
862
|
+
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+z(o.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(o);throw o}}},W=new Pa;function x(e,t){return W.parse(e,t)}f(x,"g");v(x,"d");x.options=x.setOptions=function(e){return W.setOptions(e),x.defaults=W.defaults,pt(x.defaults),x};x.getDefaults=Pe;x.defaults=J;x.use=function(...e){return W.use(...e),x.defaults=W.defaults,pt(x.defaults),x};x.walkTokens=function(e,t){return W.walkTokens(e,t)};x.parseInline=W.parseInline;x.Parser=L;x.parser=L.parse;x.Renderer=Le;x.TextRenderer=vt;x.Lexer=B;x.lexer=B.lex;x.Tokenizer=Be;x.Hooks=de;x.parse=x;var qt=x,Na=Object.defineProperty,qa=f((e,t)=>Na(e,"name",{value:t,configurable:!0}),"l$2");const Wa=qa(async(e,t=[])=>{let o;t.push(Ut,Zt);const n=Ht(e,{frameLimit:1})[0];for await(const r of t.toSorted((i,a)=>a.priority-i.priority)){if(o)break;const{handle:i,name:a}=r;if(process.env.DEBUG&&console.debug(`Running solution finder: ${a}`),typeof i=="function")try{o=await i(e,{file:n?.file??"",language:fe(n?.file??""),line:n?.line??0,snippet:n?.file?await we(n.file):""})}catch{continue}}return o?{html:`<div id="ono-solution-wrapper" class="relative w-full transition-all duration-300 ease-in-out overflow-visible">
|
|
863
863
|
<button id="ono-solution-button" type="button" aria-label="Toggle solutions" aria-controls="ono-solution-content" aria-expanded="true" title="Toggle solution details" class="bg-[var(--ono-success-bg)] text-[var(--ono-text)] rounded-[var(--ono-radius-md)] p-2 absolute top-2 right-2 z-10 h-9 w-8 cursor-pointer shadow-[var(--ono-elevation-1)]">
|
|
864
864
|
<span id="ono-solution-icon" class="dui" style="-webkit-mask-image: url('${Ge}'); mask-image: url('${Ge}')"></span>
|
|
865
865
|
</button>
|
|
866
866
|
<div id="ono-solution-content" role="region" aria-label="Suggested solutions" tabindex="-1" class="bg-[var(--ono-success-bg)] rounded-r-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] w-full h-full overflow-hidden transition-[max-height,opacity] duration-150 ease-in-out opacity-100">
|
|
867
867
|
<div class="p-6 prose prose-sm prose-headings:text-white prose-ul:list-none prose-hr:my-6 prose-hr:border-[var(--ono-success-border)] max-w-full relative text-[var(--ono-on-accent)]" aria-live="polite">
|
|
868
|
-
${await(async()=>{if(!o.header)return"<h2 class='text-[var(--ono-on-accent)]'>A possible solution to this error</h2>";const r=await qt(o.header);return
|
|
869
|
-
${await(async()=>{const r=await qt(o.body);return
|
|
868
|
+
${await(async()=>{if(!o.header)return"<h2 class='text-[var(--ono-on-accent)]'>A possible solution to this error</h2>";const r=await qt(o.header);return Ve.sanitize(String(r))})()}
|
|
869
|
+
${await(async()=>{const r=await qt(o.body);return Ve.sanitize(String(r))})()}
|
|
870
870
|
</div>
|
|
871
871
|
</div>
|
|
872
872
|
</div>`,script:`(window.subscribeToDOMContentLoaded || function (fn) {
|
|
@@ -972,7 +972,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
|
|
|
972
972
|
// Add event listeners
|
|
973
973
|
button.addEventListener('click', handleClick);
|
|
974
974
|
button.addEventListener('keydown', handleKeydown);
|
|
975
|
-
});`}:{html:"",script:""}},"solutions");var Ha=Object.defineProperty,Ua=f((e,t)=>Ha(e,"name",{value:t,configurable:!0}),"n");const
|
|
975
|
+
});`}:{html:"",script:""}},"solutions");var Ha=Object.defineProperty,Ua=f((e,t)=>Ha(e,"name",{value:t,configurable:!0}),"n");const Za=Ua(async e=>{const t=S(e.name),o=S(e.message),n=E(`${e.name}: ${e.message}`),r=at(e,{frameLimit:1})?.[0],i=r?.file??"",a=r?.line??0,l=i?await we(i):"",s=l?it(l,{start:{column:r?.column,line:a}},{linesAbove:9,linesBelow:10,showGutter:!0}):"",d=Gt({applicationType:void 0,error:e,file:{file:i,language:fe(i),line:a,snippet:s}}),c=co(),h=go({label:"Copy error title",secondaryLabel:"Copy fix prompt",secondaryText:d,targetId:"clipboard-sticky-error-title"});return{html:`<div id="error-card-sticky-header" class="fixed invisible container px-6 py-4 -top-40 z-10 rounded-[var(--ono-radius-lg)] transition-all duration-300 shadow-[var(--ono-elevation-1)] bg-[var(--ono-surface)]">
|
|
976
976
|
<input type="hidden" id="clipboard-sticky-error-title" value="${n}">
|
|
977
977
|
<div class="flex items-center gap-2">
|
|
978
978
|
<h1 class="text-sm font-semibold py-1 px-2 text-[var(--ono-chip-text)] bg-[var(--ono-chip-bg)] rounded-[var(--ono-radius-md)] shadow-[var(--ono-elevation-1)]" aria-label="Error name">${t}</h1>
|
|
@@ -1020,7 +1020,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
|
|
|
1020
1020
|
}
|
|
1021
1021
|
} catch (_) {}
|
|
1022
1022
|
});
|
|
1023
|
-
})();`}},"stickyHeader");var Ga=Object.defineProperty,
|
|
1023
|
+
})();`}},"stickyHeader");var Ga=Object.defineProperty,Va=f((e,t)=>Ga(e,"name",{value:t,configurable:!0}),"l$1");const Ka=Va(async({error:e,runtimeName:t,solutionFinders:o,version:n})=>{let r=`${t?.toUpperCase()} ${n??""}`;r.includes("NODE")&&(r=`<a href="https://nodejs.org/dist/latest-${n?.split(".")[0]}.x/docs/api/" class="text-blue-500 hover:underline inline-flex items-center text-sm" target="_blank" rel="noopener noreferrer">${r.replace("NODE","Node.js")}<span class="dui ml-1" style="-webkit-mask-image: url('${Mt}'); mask-image: url('${Mt}')" title="Open Node.js documentation"></span></a>`);const{html:i,script:a}=await Wa(e,o),{html:l,script:s}=await Za(e),d=S(e.name),c=S(e.message),h=E(`${e.name}: ${e.message}`),p=at(e,{frameLimit:1})?.[0],u=p?.file??"",m=p?.line??0,g=u?await we(u):"",w=g?it(g,{start:{column:p?.column,line:m}},{linesAbove:9,linesBelow:10,showGutter:!0}):"",y=Gt({applicationType:void 0,error:e,file:{file:u,language:fe(u),line:m,snippet:w}}),D=go({label:"Copy error title",secondaryLabel:"Copy fix prompt",secondaryText:y,targetId:"clipboard-error-title"});return{html:`<section id="error-card" class="container rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-2)] bg-[var(--ono-surface)]">
|
|
1024
1024
|
<input type="hidden" id="clipboard-error-title" value="${h}">
|
|
1025
1025
|
<div class="flex flex-row">
|
|
1026
1026
|
<div class="flex flex-col gap-3 grow min-w-6/12 w-full p-6 pt-5">
|
|
@@ -1038,17 +1038,17 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
|
|
|
1038
1038
|
${c}
|
|
1039
1039
|
</div>
|
|
1040
1040
|
</div>
|
|
1041
|
-
${
|
|
1041
|
+
${i}
|
|
1042
1042
|
</div>
|
|
1043
1043
|
</section>
|
|
1044
|
-
${l}`,scripts:[a,
|
|
1044
|
+
${l}`,scripts:[a,s]}},"errorCard");var Qa=Object.defineProperty,Ja=f((e,t)=>Qa(e,"name",{value:t,configurable:!0}),"o");const Xa=Ja(e=>{const t=uo({message:"The orginal stack trace from the main error."}),o=S(e);return`<section>
|
|
1045
1045
|
<h3 class="text-xl font-bold inline-flex justify-center items-center text-[var(--ono-text)]">Stack Trace</h3>
|
|
1046
1046
|
${t}
|
|
1047
1047
|
<div class="container rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] my-6 bg-[var(--ono-surface)]">
|
|
1048
1048
|
<main id="raw-stack-trace" class="p-6 prose prose-sm max-w-full text-[var(--ono-text)]">${o}</main>
|
|
1049
1049
|
</div>
|
|
1050
|
-
</section>`},"rawStackTrace");var Ya=Object.defineProperty,
|
|
1051
|
-
`),"buildScriptContent"),
|
|
1050
|
+
</section>`},"rawStackTrace");var Ya=Object.defineProperty,ve=f((e,t)=>Ya(e,"name",{value:t,configurable:!0}),"s");const ei=ve(e=>{if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.name=="string"&&typeof t.message=="string"&&(t.stack===void 0||typeof t.stack=="string")},"isErrorLike"),ti=ve(e=>{if(e.length===0)throw new TypeError("No errors found in the error stack");const t=e[0];if(t instanceof Error)return t;if(ei(t)){const o=new Error(t.message);return o.name=t.name,typeof t.stack=="string"&&(o.stack=t.stack),o}throw new TypeError("Main cause is not a valid Error object")},"extractMainError"),oi=ve((e,t,o,n)=>['<div class="flex flex-col gap-6">',e,t,o,n,"</div>"].join(""),"buildHtmlContent"),ri=ve((e,t,o)=>[e,t,...o].filter(Boolean).join(`
|
|
1051
|
+
`),"buildScriptContent"),ni=ve(async(e,t=[],o={})=>{if(!e)throw new TypeError("Error parameter is required");if(!Array.isArray(t))throw new TypeError("solutionFinders must be an array");const n=Lo(e),r=ti(n),i=n.length>1?n.slice(1):[],[a,l,s]=await Promise.all([Ka({error:r,runtimeName:Pn,solutionFinders:t,version:No()}),ho(r,{openInEditorUrl:o.openInEditorUrl}),oa(i,o)]),{html:d,scripts:c}=a,{html:h,script:p}=l,{html:u,script:m}=s,g=oi(d,h,u,Xa(r.stack)),w=ri(p,m,c);return{code:{html:g,script:w},defaultSelected:!0,id:"stack",name:"Stack"}},"stack");var ai=Object.defineProperty,ii=f((e,t)=>ai(e,"name",{value:t,configurable:!0}),"f");const si=`
|
|
1052
1052
|
// DOM utility functions
|
|
1053
1053
|
function ready(fn) {
|
|
1054
1054
|
if (document.readyState !== 'loading') fn();
|
|
@@ -1078,7 +1078,7 @@ function removeClass(el, className) {
|
|
|
1078
1078
|
function toggleClass(el, className) {
|
|
1079
1079
|
el.classList.toggle(className);
|
|
1080
1080
|
}
|
|
1081
|
-
`,
|
|
1081
|
+
`,li=`
|
|
1082
1082
|
// Enhanced clipboard and dropdown functionality
|
|
1083
1083
|
|
|
1084
1084
|
// Clipboard functionality
|
|
@@ -1225,7 +1225,7 @@ ready(function() {
|
|
|
1225
1225
|
console.log('Copy dropdown: Script initialized and ready');
|
|
1226
1226
|
// Dropdown and clipboard initialization complete
|
|
1227
1227
|
});
|
|
1228
|
-
`,
|
|
1228
|
+
`,ci=`
|
|
1229
1229
|
// Shortcuts modal functionality
|
|
1230
1230
|
|
|
1231
1231
|
// Make modal functions globally available immediately
|
|
@@ -1283,7 +1283,7 @@ document.addEventListener('click', function(e) {
|
|
|
1283
1283
|
ready(function() {
|
|
1284
1284
|
// Shortcuts modal initialization complete
|
|
1285
1285
|
});
|
|
1286
|
-
`,
|
|
1286
|
+
`,di=`
|
|
1287
1287
|
// Clipboard functionality for copy buttons
|
|
1288
1288
|
function copyToClipboard(text, successCallback) {
|
|
1289
1289
|
if (!text) return;
|
|
@@ -1323,4 +1323,4 @@ document.addEventListener('click', function(e) {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
1325
|
});
|
|
1326
|
-
`,
|
|
1326
|
+
`,pi=ii(async(e,t=[],o={})=>{if(!e)throw new TypeError("Error parameter is required");if(!Array.isArray(t))throw new TypeError("solutionFinders must be an array");const n=Oo(o),{code:{html:r,script:i},id:a,name:l}=await ni(e,t,n),s=Array.isArray(n.content)?n.content:[],d=s.some(g=>g.defaultSelected),c=[{id:a,name:l,selected:!d}];for(const g of s)c.push({id:String(g.id),name:String(g.name),selected:!!g.defaultSelected});const h=Dn(c),p=yn(n),u=['<div class="flex flex-row gap-6 w-full mb-6">',h.html,p.html,"</div>"],m=E(a);u.push(`<div id="ono-section-${m}" class="${d?"hidden relative":"relative"}" role="tabpanel" aria-labelledby="ono-tab-${m}">${r}</div>`);for(const g of s){const w=E(String(g.id)),y=g.defaultSelected?"":" hidden";u.push(`<div id="ono-section-${w}" class="${y} relative" role="tabpanel" aria-labelledby="ono-tab-${w}">${g.code.html}</div>`)}return jn({content:u.join("").trim(),cspNonce:o?.cspNonce,css:In,description:"Error",error:e,scripts:[si,li,ci,di,h.script,p.script,i,...s.map(g=>g.code.script||"")].filter(Boolean),theme:o?.theme,title:"Error"})},"template");var hi=Object.defineProperty,To=f((e,t)=>hi(e,"name",{value:t,configurable:!0}),"e");const Wt=To(e=>e instanceof Error?e:new Error(String(e)),"ensureError");class Si{static{f(this,"Ono")}static{To(this,"Ono")}async toHTML(t,o){const n=Wt(t),{solutionFinders:r=[],...i}=o??{};return await pi(n,r,i)}async toANSI(t,o={}){const n=Wt(t);return lo(n,o)}}export{Si as Ono};
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
var Cr=Object.defineProperty;var B=(n,i)=>Cr(n,"name",{value:i,configurable:!0});import{createRequire as wr}from"node:module";import{a as Ye}from"../packem_shared/process-B37didfB.js";const Ar=wr(import.meta.url),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ce=B(n=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[i,l]=me.versions.node.split(".").map(Number);if(i>22||i===22&&l>=3||i===20&&l>=16)return me.getBuiltinModule(n)}return Ar(n)},"__cjs_getBuiltinModule"),{realpathSync:Je}=ce("node:fs"),Be=ce("path"),$r=ce("fs"),Mr=ce("os"),mt=ce("child_process"),Er=ce("url");var Rr=Object.defineProperty,Ir=B((n,i)=>Rr(n,"name",{value:i,configurable:!0}),"$e"),jr=Object.defineProperty,Te=Ir((n,i)=>jr(n,"name",{value:i,configurable:!0}),"W"),Pr=Object.defineProperty,d=Te((n,i)=>Pr(n,"name",{value:i,configurable:!0}),"u$1");let Ke=d(()=>{var n=(()=>{var i=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,m=d((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},"ne"),h=d((e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of c(t))!u.call(e,o)&&o!==r&&i(e,o,{get:d(()=>t[o],"get"),enumerable:!(a=l(t,o))||a.enumerable});return e},"ae"),v=d(e=>h(i({},"__esModule",{value:!0}),e),"oe"),y={};m(y,{zeptomatch:d(()=>Ze,"zeptomatch")});var x=d(e=>{const t=new Set,r=[e];for(let a=0;a<r.length;a++){const o=r[a];if(t.has(o))continue;t.add(o);const{children:p}=o;if(p?.length)for(let f=0,w=p.length;f<w;f++)r.push(p[f])}return Array.from(t)},"M"),s=d(e=>{let t="";const r=x(e);for(let a=0,o=r.length;a<o;a++){const p=r[a];if(!p.regex)continue;const f=p.regex.flags;if(t||(t=f),t!==f)throw new Error(`Inconsistent RegExp flags used: "${t}" and "${f}"`)}return t},"se"),b=d((e,t,r)=>{const a=r.get(e);if(a!==void 0)return a;const o=e.partial??t;let p="";if(e.regex&&(p+=o?"(?:$|":"",p+=e.regex.source),e.children?.length){const f=S(e.children.map(w=>b(w,t,r)).filter(Boolean));if(f?.length){const w=e.children.some(pe=>!pe.regex||!(pe.partial??t)),z=f.length>1||o&&(!p.length||w);p+=z?o?"(?:$|":"(?:":"",p+=f.join("|"),p+=z?")":""}}return e.regex&&(p+=o?")":""),r.set(e,p),p},"O"),$=d((e,t)=>{const r=new Map,a=x(e);for(let o=a.length-1;o>=0;o--){const p=b(a[o],t,r);if(!(o>0))return p}return""},"ie"),S=d(e=>Array.from(new Set(e)),"ue"),I=d((e,t,r)=>I.compile(e,r).test(t),"R");I.compile=(e,t)=>{const r=t?.partial??!1,a=$(e,r),o=s(e);return new RegExp(`^(?:${a})$`,o)};var j=I,q=d((e,t)=>{const r=j.compile(e,t),a=`${r.source.slice(0,-1)}[\\\\/]?$`,o=r.flags;return new RegExp(a,o)},"le"),R=q,_=d(e=>{const t=e.map(a=>a.source).join("|")||"$^",r=e[0]?.flags;return new RegExp(t,r)},"ve"),O=_,N=d(e=>Array.isArray(e),"j"),A=d(e=>typeof e=="function","_"),L=d(e=>e.length===0,"he"),D=(()=>{const{toString:e}=Function.prototype,t=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return r=>(r.length===0||r.length===1)&&t.test(e.call(r))})(),k=d(e=>typeof e=="number","de"),U=d(e=>typeof e=="object"&&e!==null,"xe"),G=d(e=>e instanceof RegExp,"me"),C=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return t=>e.test(t.source)})(),Z=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return t=>e.test(t.source)&&!t.flags.includes("i")})(),ne=d(e=>typeof e=="string","A"),P=d(e=>e===void 0,"f"),le=d(e=>{const t=new Map;return r=>{const a=t.get(r);if(a!==void 0)return a;const o=e(r);return t.set(r,o),o}},"ye"),M=d((e,t,r={})=>{const a={cache:{},input:e,index:0,indexBacktrackMax:0,options:r,output:[]},o=J(t)(a),p=Math.max(a.index,a.indexBacktrackMax);if(o&&a.index===e.length)return a.output;throw new Error(`Failed to parse at index ${p}`)},"I"),g=d((e,t)=>N(e)?E(e,t):ne(e)?oe(e,t):fe(e,t),"i"),E=d((e,t)=>{const r={};for(const a of e){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const o=a.charCodeAt(0);r[o]=!0}return a=>{const o=a.input;let p=a.index,f=p;for(;f<o.length&&o.charCodeAt(f)in r;)f+=1;if(f>p){if(!P(t)&&!a.options.silent){const w=o.slice(p,f),z=A(t)?t(w,o,`${p}`):t;P(z)||a.output.push(z)}a.index=f}return!0}},"we"),fe=d((e,t)=>{if(Z(e))return oe(e.source,t);{const r=e.source,a=e.flags.replace(/y|$/,"y"),o=new RegExp(r,a);return C(e)&&A(t)&&!D(t)?F(o,t):K(o,t)}},"$e"),F=d((e,t)=>r=>{const a=r.index,o=r.input;e.lastIndex=a;const p=e.exec(o);if(p){const f=e.lastIndex;if(!r.options.silent){const w=t(...p,o,`${a}`);P(w)||r.output.push(w)}return r.index=f,!0}else return!1},"Ee"),K=d((e,t)=>r=>{const a=r.index,o=r.input;if(e.lastIndex=a,e.test(o)){const p=e.lastIndex;if(!P(t)&&!r.options.silent){const f=A(t)?t(o.slice(a,p),o,`${a}`):t;P(f)||r.output.push(f)}return r.index=p,!0}else return!1},"Ce"),oe=d((e,t)=>r=>{const a=r.index,o=r.input;if(o.startsWith(e,a)){if(!P(t)&&!r.options.silent){const p=A(t)?t(e,o,`${a}`):t;P(p)||r.output.push(p)}return r.index+=e.length,!0}else return!1},"F"),X=d((e,t,r,a)=>{const o=J(e),p=t>1;return Oe(ye(Le(f=>{let w=0;for(;w<r;){const z=f.index;if(!o(f)||(w+=1,f.index===z))break}return w>=t},p),a))},"k"),qe=d((e,t)=>X(e,0,1,t),"L"),he=d((e,t)=>X(e,0,1/0,t),"$"),gt=d((e,t)=>X(e,1,1/0,t),"Re"),ae=d((e,t)=>{const r=e.map(J);return Oe(ye(Le(a=>{for(let o=0,p=r.length;o<p;o++)if(!r[o](a))return!1;return!0}),t))},"x"),V=d((e,t)=>{const r=e.map(J);return Oe(ye(a=>{for(let o=0,p=r.length;o<p;o++)if(r[o](a))return!0;return!1},t))},"p"),Le=d((e,t=!0,r=!1)=>{const a=J(e);return t?o=>{const p=o.index,f=o.output.length,w=a(o);return!w&&!r&&(o.indexBacktrackMax=Math.max(o.indexBacktrackMax,o.index)),(!w||r)&&(o.index=p,o.output.length!==f&&(o.output.length=f)),w}:a},"q"),ye=d((e,t)=>{const r=J(e);return t?a=>{if(a.options.silent)return r(a);const o=a.output.length;if(r(a)){const p=a.output.splice(o,1/0),f=t(p);return P(f)||a.output.push(f),!0}else return!1}:r},"B"),Oe=(()=>{let e=0;return t=>{const r=J(t),a=e+=1;return o=>{var p;if(o.options.memoization===!1)return r(o);const f=o.index,w=(p=o.cache)[a]||(p[a]={indexMax:-1,queue:[]}),z=w.queue;if(f<=w.indexMax){const de=w.store||(w.store=new Map);if(z.length){for(let se=0,yr=z.length;se<yr;se+=2){const Or=z[se*2],Sr=z[se*2+1];de.set(Or,Sr)}z.length=0}const Q=de.get(f);if(Q===!1)return!1;if(k(Q))return o.index=Q,!0;if(Q)return o.index=Q.index,Q.output?.length&&o.output.push(...Q.output),!0}const pe=o.output.length,Br=r(o);if(w.indexMax=Math.max(w.indexMax,f),Br){const de=o.index,Q=o.output.length;if(Q>pe){const se=o.output.slice(pe,Q);z.push(f,{index:de,output:se})}else z.push(f,de);return!0}else return z.push(f,!1),!1}}})(),ke=d(e=>{let t;return r=>(t||(t=J(e())),t(r))},"G"),J=le(e=>{if(A(e))return L(e)?ke(e):e;if(ne(e)||G(e))return g(e);if(N(e))return ae(e);if(U(e))return V(Object.values(e));throw new Error("Invalid rule")}),ee=d(e=>e,"d"),bt=d(e=>typeof e=="string","ke"),vt=d(e=>{const t=new WeakMap,r=new WeakMap;return(a,o)=>{const p=o?.partial?r:t,f=p.get(a);if(f!==void 0)return f;const w=e(a,o);return p.set(a,w),w}},"Be"),Bt=d(e=>{const t={},r={};return(a,o)=>{const p=o?.partial?r:t;return p[a]??(p[a]=e(a,o))}},"Pe"),yt=g(/\\./,ee),Ot=g(/./,ee),St=g(/\*\*\*+/,"*"),Ct=g(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),wt=g(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),At=he(V([yt,St,Ct,wt,Ot])),$t=At,Mt=d(e=>M(e,$t,{memoization:!1}).join(""),"Ie"),Et=Mt,Ne="abcdefghijklmnopqrstuvwxyz",Rt=d(e=>{let t="";for(;e>0;){const r=(e-1)%26;t=Ne[r]+t,e=Math.floor((e-1)/26)}return t},"Le"),ze=d(e=>{let t=0;for(let r=0,a=e.length;r<a;r++)t=t*26+Ne.indexOf(e[r])+1;return t},"V"),Se=d((e,t)=>{if(t<e)return Se(t,e);const r=[];for(;e<=t;)r.push(e++);return r},"b"),It=d((e,t,r)=>Se(e,t).map(a=>String(a).padStart(r,"0")),"qe"),We=d((e,t)=>Se(ze(e),ze(t)).map(Rt),"W"),T=d(e=>({partial:!1,regex:new RegExp(e,"s"),children:[]}),"c"),ue=d(e=>({children:e}),"y"),ie=(()=>{const e=d((t,r,a)=>{if(a.has(t))return;a.add(t);const{children:o}=t;if(!o.length)o.push(r);else for(let p=0,f=o.length;p<f;p++)e(o[p],r,a)},"e");return t=>{if(!t.length)return ue([]);for(let r=t.length-1;r>=1;r--){const a=new Set,o=t[r-1],p=t[r];e(o,p,a)}return t[0]}})(),Y=d(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),jt=g(/\\./,T),Pt=g(/[$.*+?^(){}[\]\|]/,e=>T(`\\${e}`)),_t=g(/[\\\/]/,Y),Tt=g(/[^$.*+?^(){}[\]\|\\\/]+/,T),qt=g(/^(?:!!)*!(.*)$/,(e,t)=>T(`(?!^${Ze.compile(t).source}$).*?`)),Lt=g(/^(!!)+/),kt=V([qt,Lt]),Nt=g(/\/(\*\*\/)+/,()=>ue([ie([Y(),T(".+?"),Y()]),Y()])),zt=g(/^(\*\*\/)+/,()=>ue([T("^"),ie([T(".*?"),Y()])])),Wt=g(/\/(\*\*)$/,()=>ue([ie([Y(),T(".*?")]),T("$")])),Dt=g(/\*\*/,()=>T(".*?")),De=V([Nt,zt,Wt,Dt]),Ut=g(/\*\/(?!\*\*\/|\*$)/,()=>ie([T("[^\\\\/]*?"),Y()])),Gt=g(/\*/,()=>T("[^\\\\/]*")),Ue=V([Ut,Gt]),Ge=g("?",()=>T("[^\\\\/]")),Ft=g("[",ee),Vt=g("]",ee),Qt=g(/[!^]/,"^\\\\/"),Ht=g(/[a-z]-[a-z]|[0-9]-[0-9]/i,ee),Zt=g(/\\./,ee),Jt=g(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Yt=g(/[\\\/]/,"\\\\/"),Kt=g(/[^$.*+?^(){}[\]\|\\\/]+/,ee),Xt=V([Zt,Jt,Yt,Ht,Kt]),Fe=ae([Ft,qe(Qt),he(Xt),Vt],e=>T(e.join(""))),er=g("{","(?:"),tr=g("}",")"),rr=g(/(\d+)\.\.(\d+)/,(e,t,r)=>It(+t,+r,Math.min(t.length,r.length)).join("|")),nr=g(/([a-z]+)\.\.([a-z]+)/,(e,t,r)=>We(t,r).join("|")),or=g(/([A-Z]+)\.\.([A-Z]+)/,(e,t,r)=>We(t.toLowerCase(),r.toLowerCase()).join("|").toUpperCase()),ar=V([rr,nr,or]),Ve=ae([er,ar,tr],e=>T(e.join(""))),ir=g("{"),sr=g("}"),cr=g(","),lr=g(/\\./,T),ur=g(/[$.*+?^(){[\]\|]/,e=>T(`\\${e}`)),pr=g(/[\\\/]/,Y),dr=g(/[^$.*+?^(){}[\]\|\\\/,]+/,T),mr=ke(()=>He),fr=g("",()=>T("(?:)")),hr=gt(V([De,Ue,Ge,Fe,Ve,mr,lr,ur,pr,dr]),ie),Qe=V([hr,fr]),He=ae([ir,qe(ae([Qe,he(ae([cr,Qe]))])),sr],ue),xr=he(V([kt,De,Ue,Ge,Fe,Ve,He,jt,Pt,_t,Tt]),ie),gr=xr,br=d(e=>M(e,gr,{memoization:!1})[0],"kr"),vr=br,Ce=d((e,t,r)=>Ce.compile(e,r).test(t),"N");Ce.compile=(()=>{const e=Bt((r,a)=>R(vr(Et(r)),a)),t=vt((r,a)=>O(r.map(o=>e(o,a))));return(r,a)=>bt(r)?e(r,a):t(r,a)})();var Ze=Ce;return v(y)})();return n.default||n},"_lazyMatch"),we;const _r=d((n,i)=>(we||(we=Ke(),Ke=null),we(n,i)),"default");var Tr=Object.defineProperty,qr=Te((n,i)=>Tr(n,"name",{value:i,configurable:!0}),"t$1");const Lr=/^[A-Z]:\//i,re=qr((n="")=>n&&n.replaceAll("\\","/").replace(Lr,i=>i.toUpperCase()),"normalizeWindowsPath");var kr=Object.defineProperty,W=Te((n,i)=>kr(n,"name",{value:i,configurable:!0}),"r");const Nr=/^[/\\]{2}/,zr=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,ft=/^[A-Z]:$/i,Xe=/^\/([A-Z]:)?$/i,Wr=/.(\.[^./]+)$/,Dr=/^[/\\]|^[a-z]:[/\\]/i,Ur=W(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),et="/",ht=W((n,i)=>{let l="",c=0,u=-1,m=0,h;for(let v=0;v<=n.length;++v){if(v<n.length)h=n[v];else{if(h==="/")break;h="/"}if(h==="/"){if(!(u===v-1||m===1))if(m===2){if(l.length<2||c!==2||!l.endsWith(".")||l.at(-2)!=="."){if(l.length>2){const y=l.lastIndexOf("/");y===-1?(l="",c=0):(l=l.slice(0,y),c=l.length-1-l.lastIndexOf("/")),u=v,m=0;continue}else if(l.length>0){l="",c=0,u=v,m=0;continue}}i&&(l+=l.length>0?"/..":"..",c=2)}else l.length>0?l+=`/${n.slice(u+1,v)}`:l=n.slice(u+1,v),c=v-u-1;u=v,m=0}else h==="."&&m!==-1?++m:m=-1}return l},"normalizeString"),te=W(n=>zr.test(n),"isAbsolute"),be=W(function(n){if(n.length===0)return".";n=re(n);const i=Nr.exec(n),l=te(n),c=n.at(-1)==="/";return n=ht(n,!l),n.length===0?l?"/":c?"./":".":(c&&(n+="/"),ft.test(n)&&(n+="/"),i?l?`//${n}`:`//./${n}`:l&&!te(n)?`/${n}`:n)},"normalize");W((...n)=>{let i="";for(const l of n)if(l)if(i.length>0){const c=i[i.length-1]==="/",u=l[0]==="/";c&&u?i+=l.slice(1):i+=c||u?l:`/${l}`}else i+=l;return be(i)},"join");const ve=W(function(...n){n=n.map(c=>re(c));let i="",l=!1;for(let c=n.length-1;c>=-1&&!l;c--){const u=c>=0?n[c]:Ur();!u||u.length===0||(i=`${u}/${i}`,l=te(u))}return i=ht(i,!l),l&&!te(i)?`/${i}`:i.length>0?i:"."},"resolve");W(function(n){return re(n)},"toNamespacedPath");const Gr=W(function(n){return Wr.exec(re(n))?.[1]??""},"extname"),Fr=W(function(n,i){const l=ve(n).replace(Xe,"$1").split("/"),c=ve(i).replace(Xe,"$1").split("/");if(c[0][1]===":"&&l[0][1]===":"&&l[0]!==c[0])return c.join("/");const u=[...l];for(const m of u){if(c[0]!==m)break;l.shift(),c.shift()}return[...l.map(()=>".."),...c].join("/")},"relative"),Vr=W(n=>{const i=re(n).replace(/\/$/,"").split("/").slice(0,-1);return i.length===1&&ft.test(i[0])&&(i[0]+="/"),i.join("/")||(te(n)?"/":".")},"dirname");W(function(n){const i=[n.root,n.dir,n.base??n.name+n.ext].filter(Boolean);return re(n.root?ve(...i):i.join("/"))},"format");const Qr=W((n,i)=>{const l=re(n).split("/").pop();return i&&l.endsWith(i)?l.slice(0,-i.length):l},"basename");W(function(n){const i=Dr.exec(n)?.[0]?.replaceAll("\\","/")??"",l=Qr(n),c=Gr(l);return{base:l,dir:Vr(n),ext:c,name:l.slice(0,l.length-c.length),root:i}},"parse");W((n,i)=>_r(i,be(n)),"matchesGlob");function Hr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}B(Hr,"getDefaultExportFromCjs");var xe={exports:{}},tt;function Zr(){if(tt)return xe.exports;tt=1;var n=Object.defineProperty,i=B((x,s)=>n(x,"name",{value:s,configurable:!0}),"t");let l=process||{},c=l.argv||[],u=l.env||{},m=!(u.NO_COLOR||c.includes("--no-color"))&&(!!u.FORCE_COLOR||c.includes("--color")||l.platform==="win32"||(l.stdout||{}).isTTY&&u.TERM!=="dumb"||!!u.CI),h=i((x,s,b=x)=>$=>{let S=""+$,I=S.indexOf(s,x.length);return~I?x+v(S,s,b,I)+s:x+S+s},"formatter"),v=i((x,s,b,$)=>{let S="",I=0;do S+=x.substring(I,$)+b,I=$+s.length,$=x.indexOf(s,I);while(~$);return S+x.substring(I)},"replaceClose"),y=i((x=m)=>{let s=x?h:()=>String;return{isColorSupported:x,reset:s("\x1B[0m","\x1B[0m"),bold:s("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:s("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:s("\x1B[3m","\x1B[23m"),underline:s("\x1B[4m","\x1B[24m"),inverse:s("\x1B[7m","\x1B[27m"),hidden:s("\x1B[8m","\x1B[28m"),strikethrough:s("\x1B[9m","\x1B[29m"),black:s("\x1B[30m","\x1B[39m"),red:s("\x1B[31m","\x1B[39m"),green:s("\x1B[32m","\x1B[39m"),yellow:s("\x1B[33m","\x1B[39m"),blue:s("\x1B[34m","\x1B[39m"),magenta:s("\x1B[35m","\x1B[39m"),cyan:s("\x1B[36m","\x1B[39m"),white:s("\x1B[37m","\x1B[39m"),gray:s("\x1B[90m","\x1B[39m"),bgBlack:s("\x1B[40m","\x1B[49m"),bgRed:s("\x1B[41m","\x1B[49m"),bgGreen:s("\x1B[42m","\x1B[49m"),bgYellow:s("\x1B[43m","\x1B[49m"),bgBlue:s("\x1B[44m","\x1B[49m"),bgMagenta:s("\x1B[45m","\x1B[49m"),bgCyan:s("\x1B[46m","\x1B[49m"),bgWhite:s("\x1B[47m","\x1B[49m"),blackBright:s("\x1B[90m","\x1B[39m"),redBright:s("\x1B[91m","\x1B[39m"),greenBright:s("\x1B[92m","\x1B[39m"),yellowBright:s("\x1B[93m","\x1B[39m"),blueBright:s("\x1B[94m","\x1B[39m"),magentaBright:s("\x1B[95m","\x1B[39m"),cyanBright:s("\x1B[96m","\x1B[39m"),whiteBright:s("\x1B[97m","\x1B[39m"),bgBlackBright:s("\x1B[100m","\x1B[49m"),bgRedBright:s("\x1B[101m","\x1B[49m"),bgGreenBright:s("\x1B[102m","\x1B[49m"),bgYellowBright:s("\x1B[103m","\x1B[49m"),bgBlueBright:s("\x1B[104m","\x1B[49m"),bgMagentaBright:s("\x1B[105m","\x1B[49m"),bgCyanBright:s("\x1B[106m","\x1B[49m"),bgWhiteBright:s("\x1B[107m","\x1B[49m")}},"createColors");return xe.exports=y(),xe.exports.createColors=y,xe.exports}B(Zr,"requirePicocolors");var ge={},Ae,rt;function Jr(){if(rt)return Ae;rt=1;var n=Object.defineProperty,i=B((l,c)=>n(l,"name",{value:c,configurable:!0}),"n");return Ae=i(function(l){return l.map(function(c){return c===""?"''":c&&typeof c=="object"?c.op.replace(/(.)/g,"\\$1"):/["\s\\]/.test(c)&&!/'/.test(c)?"'"+c.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(c)?'"'+c.replace(/(["\\$`!])/g,"\\$1")+'"':String(c).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")},"quote"),Ae}B(Jr,"requireQuote");var $e,nt;function Yr(){if(nt)return $e;nt=1;for(var n=Object.defineProperty,i=B((_,O)=>n(_,"name",{value:O,configurable:!0}),"c"),l="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",c=new RegExp("^"+l+"$"),u="|&;()<> \\t",m='"((\\\\"|[^"])*?)"',h="'((\\\\'|[^'])*?)'",v=/^#$/,y="'",x='"',s="$",b="",$=4294967296,S=0;S<4;S++)b+=($*Math.random()).toString(16);var I=new RegExp("^"+b);function j(_,O){for(var N=O.lastIndex,A=[],L;L=O.exec(_);)A.push(L),O.lastIndex===L.index&&(O.lastIndex+=1);return O.lastIndex=N,A}B(j,"matchAll"),i(j,"matchAll");function q(_,O,N){var A=typeof _=="function"?_(N):_[N];return typeof A>"u"&&N!=""?A="":typeof A>"u"&&(A="$"),typeof A=="object"?O+b+JSON.stringify(A)+b:O+A}B(q,"getVar"),i(q,"getVar");function R(_,O,N){N||(N={});var A=N.escape||"\\",L="(\\"+A+`['"`+u+`]|[^\\s'"`+u+"])+",D=new RegExp(["("+l+")","("+L+"|"+m+"|"+h+")+"].join("|"),"g"),k=j(_,D);if(k.length===0)return[];O||(O={});var U=!1;return k.map(function(G){var C=G[0];if(!C||U)return;if(c.test(C))return{op:C};var Z=!1,ne=!1,P="",le=!1,M;function g(){M+=1;var F,K,oe=C.charAt(M);if(oe==="{"){if(M+=1,C.charAt(M)==="}")throw new Error("Bad substitution: "+C.slice(M-2,M+1));if(F=C.indexOf("}",M),F<0)throw new Error("Bad substitution: "+C.slice(M));K=C.slice(M,F),M=F}else if(/[*@#?$!_-]/.test(oe))K=oe,M+=1;else{var X=C.slice(M);F=X.match(/[^\w\d_]/),F?(K=X.slice(0,F.index),M+=F.index-1):(K=X,M=C.length)}return q(O,"",K)}for(B(g,"R"),i(g,"parseEnvVar"),M=0;M<C.length;M++){var E=C.charAt(M);if(le=le||!Z&&(E==="*"||E==="?"),ne)P+=E,ne=!1;else if(Z)E===Z?Z=!1:Z==y?P+=E:E===A?(M+=1,E=C.charAt(M),E===x||E===A||E===s?P+=E:P+=A+E):E===s?P+=g():P+=E;else if(E===x||E===y)Z=E;else{if(c.test(E))return{op:C};if(v.test(E)){U=!0;var fe={comment:_.slice(G.index+M+1)};return P.length?[P,fe]:[fe]}else E===A?ne=!0:E===s?P+=g():P+=E}}return le?{op:"glob",pattern:P}:P}).reduce(function(G,C){return typeof C>"u"?G:G.concat(C)},[])}return B(R,"parseInternal"),i(R,"parseInternal"),$e=i(function(_,O,N){var A=R(_,O,N);return typeof O!="function"?A:A.reduce(function(L,D){if(typeof D=="object")return L.concat(D);var k=D.split(RegExp("("+b+".*?"+b+")","g"));return k.length===1?L.concat(k[0]):L.concat(k.filter(Boolean).map(function(U){return I.test(U)?JSON.parse(U.split(b)[1]):U}))},[])},"parse"),$e}B(Yr,"requireParse");var ot;function Kr(){return ot||(ot=1,ge.quote=Jr(),ge.parse=Yr()),ge}B(Kr,"requireShellQuote");var Me,at;function Xr(){return at||(at=1,Me={"/Applications/Atom.app/Contents/MacOS/Atom":"atom","/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta","/Applications/Brackets.app/Contents/MacOS/Brackets":"brackets","/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text.app/Contents/MacOS/sublime_text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/Applications/Visual Studio Code.app/Contents/MacOS/Electron":"code","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"code-insiders","/Applications/VSCodium.app/Contents/MacOS/Electron":"codium","/Applications/Cursor.app/Contents/MacOS/Cursor":"cursor","/Applications/Trae.app/Contents/MacOS/Electron":"trae","/Applications/AppCode.app/Contents/MacOS/appcode":"/Applications/AppCode.app/Contents/MacOS/appcode","/Applications/CLion.app/Contents/MacOS/clion":"/Applications/CLion.app/Contents/MacOS/clion","/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea","/Applications/PhpStorm.app/Contents/MacOS/phpstorm":"/Applications/PhpStorm.app/Contents/MacOS/phpstorm","/Applications/PyCharm.app/Contents/MacOS/pycharm":"/Applications/PyCharm.app/Contents/MacOS/pycharm","/Applications/PyCharm CE.app/Contents/MacOS/pycharm":"/Applications/PyCharm CE.app/Contents/MacOS/pycharm","/Applications/RubyMine.app/Contents/MacOS/rubymine":"/Applications/RubyMine.app/Contents/MacOS/rubymine","/Applications/WebStorm.app/Contents/MacOS/webstorm":"/Applications/WebStorm.app/Contents/MacOS/webstorm","/Applications/MacVim.app/Contents/MacOS/MacVim":"mvim","/Applications/GoLand.app/Contents/MacOS/goland":"/Applications/GoLand.app/Contents/MacOS/goland","/Applications/Rider.app/Contents/MacOS/rider":"/Applications/Rider.app/Contents/MacOS/rider","/Applications/Zed.app/Contents/MacOS/zed":"zed"}),Me}B(Xr,"requireMacos");var Ee,it;function en(){return it||(it=1,Ee={atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",code:"code",vscodium:"vscodium",codium:"codium",cursor:"cursor",trae:"trae",emacs:"emacs",gvim:"gvim",idea:"idea","idea.sh":"idea",phpstorm:"phpstorm","phpstorm.sh":"phpstorm",pycharm:"pycharm","pycharm.sh":"pycharm",rubymine:"rubymine","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim",webstorm:"webstorm","webstorm.sh":"webstorm",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider",zed:"zed"}),Ee}B(en,"requireLinux");var Re,st;function tn(){return st||(st=1,Re=["Brackets.exe","Code.exe","Code - Insiders.exe","VSCodium.exe","Cursor.exe","atom.exe","sublime_text.exe","notepad++.exe","clion.exe","clion64.exe","idea.exe","idea64.exe","phpstorm.exe","phpstorm64.exe","pycharm.exe","pycharm64.exe","rubymine.exe","rubymine64.exe","webstorm.exe","webstorm64.exe","goland.exe","goland64.exe","rider.exe","rider64.exe","trae.exe"]),Re}B(tn,"requireWindows");var Ie,ct;function rn(){if(ct)return Ie;ct=1;var n=Object.defineProperty,i=B((y,x)=>n(y,"name",{value:x,configurable:!0}),"u");const l=Be,c=Kr(),u=mt,m=Xr(),h=en(),v=tn();return Ie=i(function(y){if(y)return c.parse(y);if(process.env.LAUNCH_EDITOR)return[process.env.LAUNCH_EDITOR];if(process.versions.webcontainer)return[process.env.EDITOR||"code"];try{if(process.platform==="darwin"){const x=u.execSync("ps x -o comm=",{stdio:["pipe","pipe","ignore"]}).toString(),s=Object.keys(m),b=x.split(`
|
|
2
|
-
`);for(let $=0;$<s.length;$++){const S=s[$];if(b.includes(S))return[m[S]];const I=S.replace("/Applications","");if(x.indexOf(I)!==-1){if(S!==m[S])return[m[S]];const j=b.find(q=>q.endsWith(I));if(j!==void 0)return[j]}}}else if(process.platform==="win32"){const x=u.execSync('powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',{stdio:["pipe","pipe","ignore"]}).toString().split(`\r
|
|
3
|
-
`);for(let s=0;s<x.length;s++){const b=x[s].trim(),$=l.basename(b);if(v.indexOf($)!==-1)return[b]}}else if(process.platform==="linux"){const x=u.execSync("ps x --no-heading -o comm --sort=comm",{stdio:["pipe","pipe","ignore"]}).toString(),s=Object.keys(h);for(let b=0;b<s.length;b++){const $=s[b];if(x.indexOf($)!==-1)return[h[$]]}}}catch{}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]},"guessEditor"),Ie}B(rn,"requireGuess");var je,lt;function nn(){if(lt)return je;lt=1;var n=Object.defineProperty,i=B((c,u)=>n(c,"name",{value:u,configurable:!0}),"r");const l=Be;return je=i(function(c,u,m,h=1){switch(l.basename(c).replace(/\.(exe|cmd|bat)$/i,"")){case"atom":case"Atom":case"Atom Beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return[`${u}:${m}:${h}`];case"notepad++":return["-n"+m,"-c"+h,u];case"vim":case"mvim":return[`+call cursor(${m}, ${h})`,u];case"joe":case"gvim":return[`+${m}`,u];case"emacs":case"emacsclient":return[`+${m}:${h}`,u];case"rmate":case"mate":case"mine":return["--line",m,u];case"code":case"Code":case"code-insiders":case"Code - Insiders":case"codium":case"trae":case"cursor":case"vscodium":case"VSCodium":return["-r","-g",`${u}:${m}:${h}`];case"appcode":case"clion":case"clion64":case"idea":case"idea64":case"phpstorm":case"phpstorm64":case"pycharm":case"pycharm64":case"rubymine":case"rubymine64":case"webstorm":case"webstorm64":case"goland":case"goland64":case"rider":case"rider64":return["--line",m,"--column",h,u]}return process.env.LAUNCH_EDITOR?[u,m,h]:[u]},"getArgumentsForPosition"),je}B(nn,"requireGetArgs");var Pe,ut;function on(){if(ut)return Pe;ut=1;var n=Object.defineProperty,i=B((j,q)=>n(j,"name",{value:q,configurable:!0}),"c");const l=$r,c=Mr,u=Be,m=Zr(),h=mt,v=rn(),y=nn();function x(j){return(q,R)=>{console.log(),console.log(m.red("Could not open "+u.basename(q)+" in the editor.")),R&&(R[R.length-1]!=="."&&(R+="."),console.log(m.red("The editor process exited with an error: "+R))),console.log(),j&&j(q,R)}}B(x,"wrapErrorCallback"),i(x,"wrapErrorCallback");function s(j){switch(j){case"vim":case"emacs":case"nano":return!0}return!1}B(s,"isTerminalEditor"),i(s,"isTerminalEditor");const b=/:(\d+)(:(\d+))?$/;function $(j){j.startsWith("file://")&&(j=Er.fileURLToPath(j));const q=j.replace(b,""),R=j.match(b),_=R&&R[1],O=R&&R[3];return{fileName:q,lineNumber:_,columnNumber:O}}B($,"parseFile"),i($,"parseFile");let S=null;function I(j,q,R){const _=$(j);let{fileName:O}=_;const{lineNumber:N,columnNumber:A}=_;if(!l.existsSync(O))return;typeof q=="function"&&(R=q,q=void 0),R=x(R);const[L,...D]=v(q);if(!L){R(O,null);return}if(process.platform==="linux"&&O.startsWith("/mnt/")&&/Microsoft/i.test(c.release())&&(O=u.relative("",O)),N){const k=y(L,O,N,A);D.push.apply(D,k)}else D.push(O);if(S&&s(L)&&S.kill("SIGKILL"),process.platform==="win32"){let k=B(function(C){return C.replace(/([&|<>,;=^])/g,"^$1")},"i"),U=B(function(C){return C.includes("^")?`^"${C}^"`:C.includes(" ")?`"${C}"`:C},"a");i(k,"escapeCmdArgs"),i(U,"doubleQuoteIfNeeded");const G=[L,...D.map(k)].map(U).join(" ");S=h.exec(G,{stdio:"inherit",shell:!0})}else S=h.spawn(L,D,{stdio:"inherit"});S.on("exit",function(k){S=null,k&&R(O,"(code "+k+")")}),S.on("error",function(k){let{code:U,message:G}=k;U==="ENOENT"&&(G=`${G} ('${L}' command does not exist in 'PATH')`),R(O,G)})}return B(I,"launchEditor"),i(I,"launchEditor"),Pe=I,Pe}B(on,"requireLaunchEditor");var _e,pt;function an(){if(pt)return _e;pt=1;var n=Object.defineProperty,i=B((u,m)=>n(u,"name",{value:m,configurable:!0}),"r");const l=Be,c=on();return _e=B((u,m,h)=>(typeof u=="function"&&(h=u,u=void 0),typeof m=="function"&&(h=m,m=void 0),m=m||process.cwd(),i(function(v,y){let x;try{const b=v.url.startsWith("http")?v.url:`http://localhost${v.url}`;x=new URL(b)}catch{y.statusCode=500,y.end("launch-editor-middleware: invalid URL.");return}const s=x.searchParams.get("file");if(!s)y.statusCode=500,y.end('launch-editor-middleware: required query param "file" is missing.');else{const b=s.startsWith("file://")?s:l.resolve(m,s);c(b,u,h),y.end()}},"launchEditorMiddleware")),"launchEditorMiddleware"),_e}B(an,"requireLaunchEditorMiddleware");var sn=an();const cn=Hr(sn);var ln=Object.defineProperty,H=B((n,i)=>ln(n,"name",{value:i,configurable:!0}),"a");const dt=H(n=>{if(typeof n.status=="function"){n.status(400).send("Failed to open editor");return}n.statusCode=400,n.end("Failed to open editor")},"respond400"),xt=H((n={})=>{const i=H(async c=>{if(String(c.method||"GET").toUpperCase()==="POST")return c.body&&typeof c.body=="object"?c.body:new Promise(m=>{try{let h="";const v=H(x=>{h+=String(x)},"onData"),y=H(()=>{try{m(h?JSON.parse(h):{})}catch{m({})}},"onEnd");c.on("data",v),c.on("end",y),c.on("error",()=>m({}))}catch{m({})}});const u=new URL(c.url||"","http://localhost");return{column:Number(u.searchParams.get("column")||1),editor:u.searchParams.get("editor")||void 0,file:u.searchParams.get("file")||void 0,line:Number(u.searchParams.get("line")||1)}},"parseRequestBody"),l=H((c,u,m)=>{if(!c)return;const h=te(c)?c:ve(u,c);if(!m)try{const v=Je(u),y=Je(h),x=be(v),s=be(y),b=Ye()==="win32"||Ye()==="darwin",$=b?x.toLowerCase():x,S=b?s.toLowerCase():s,I=Fr(x,s);if(I.startsWith("..")||te(I)||b&&!S.startsWith($))return}catch{const v=u.endsWith(et)?u:u+et;if(!h.startsWith(v))return}return h},"validateFilePath");return H(async function(c,u,m){try{const h=await i(c),v=n.projectRoot??process.cwd(),y=l(h.file,v,n.allowOutsideProject??!1);if(!y){dt(u);return}const x=cn(h.editor,v),s=new URLSearchParams({column:String(h.column??1),file:y,line:String(h.line??1)});if(h.editor&&s.set("editor",String(h.editor)),c.url=`/?${s.toString()}`,typeof m=="function"){x(c,u,m);return}await new Promise(b=>{x(c,u,()=>{b()})})}catch{dt(u)}},"universalHandler")},"createOpenInEditorMiddleware"),mn=H((n={})=>{const i=xt(n);return async(l,c)=>i(l,c)},"createNodeHttpHandler"),fn=H((n={})=>xt(n),"createExpressHandler");export{fn as createExpressHandler,mn as createNodeHttpHandler,xt as createOpenInEditorMiddleware};
|
|
1
|
+
var Qt=Object.defineProperty;var F=(s,i)=>Qt(s,"name",{value:i,configurable:!0});import{createRequire as Xt}from"node:module";import tn from"launch-editor-middleware";import{a as we}from"../packem_shared/process-B37didfB.js";const Yt=Xt(import.meta.url),L=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,en=F(s=>{if(typeof L<"u"&&L.versions&&L.versions.node){const[i,a]=L.versions.node.split(".").map(Number);if(i>22||i===22&&a>=3||i===20&&a>=16)return L.getBuiltinModule(s)}return Yt(s)},"__cjs_getBuiltinModule"),{realpathSync:$e}=en("node:fs");var nn=Object.defineProperty,l=F((s,i)=>nn(s,"name",{value:i,configurable:!0}),"s");let ye=l(()=>{var s=(()=>{var i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,g=l((e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},"ne"),x=l((e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!d.call(e,r)&&r!==n&&i(e,r,{get:l(()=>t[r],"get"),enumerable:!(o=a(t,r))||o.enumerable});return e},"ae"),m=l(e=>x(i({},"__esModule",{value:!0}),e),"oe"),y={};g(y,{zeptomatch:l(()=>me,"zeptomatch")});var b=l(e=>{const t=new Set,n=[e];for(let o=0;o<n.length;o++){const r=n[o];if(t.has(r))continue;t.add(r);const{children:c}=r;if(c?.length)for(let f=0,h=c.length;f<h;f++)n.push(c[f])}return Array.from(t)},"M"),P=l(e=>{let t="";const n=b(e);for(let o=0,r=n.length;o<r;o++){const c=n[o];if(!c.regex)continue;const f=c.regex.flags;if(t||(t=f),t!==f)throw new Error(`Inconsistent RegExp flags used: "${t}" and "${f}"`)}return t},"se"),z=l((e,t,n)=>{const o=n.get(e);if(o!==void 0)return o;const r=e.partial??t;let c="";if(e.regex&&(c+=r?"(?:$|":"",c+=e.regex.source),e.children?.length){const f=D(e.children.map(h=>z(h,t,n)).filter(Boolean));if(f?.length){const h=e.children.some(N=>!N.regex||!(N.partial??t)),w=f.length>1||r&&(!c.length||h);c+=w?r?"(?:$|":"(?:":"",c+=f.join("|"),c+=w?")":""}}return e.regex&&(c+=r?")":""),n.set(e,c),c},"O"),G=l((e,t)=>{const n=new Map,o=b(e);for(let r=o.length-1;r>=0;r--){const c=z(o[r],t,n);if(!(r>0))return c}return""},"ie"),D=l(e=>Array.from(new Set(e)),"ue"),S=l((e,t,n)=>S.compile(e,n).test(t),"R");S.compile=(e,t)=>{const n=t?.partial??!1,o=G(e,n),r=P(e);return new RegExp(`^(?:${o})$`,r)};var Ae=S,Ee=l((e,t)=>{const n=Ae.compile(e,t),o=`${n.source.slice(0,-1)}[\\\\/]?$`,r=n.flags;return new RegExp(o,r)},"le"),ke=Ee,Oe=l(e=>{const t=e.map(o=>o.source).join("|")||"$^",n=e[0]?.flags;return new RegExp(t,n)},"ve"),_e=Oe,ee=l(e=>Array.isArray(e),"j"),W=l(e=>typeof e=="function","_"),Re=l(e=>e.length===0,"he"),Se=(()=>{const{toString:e}=Function.prototype,t=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return n=>(n.length===0||n.length===1)&&t.test(e.call(n))})(),Ie=l(e=>typeof e=="number","de"),Be=l(e=>typeof e=="object"&&e!==null,"xe"),Ce=l(e=>e instanceof RegExp,"me"),We=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return t=>e.test(t.source)})(),qe=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return t=>e.test(t.source)&&!t.flags.includes("i")})(),te=l(e=>typeof e=="string","A"),A=l(e=>e===void 0,"f"),Ne=l(e=>{const t=new Map;return n=>{const o=t.get(n);if(o!==void 0)return o;const r=e(n);return t.set(n,r),r}},"ye"),ne=l((e,t,n={})=>{const o={cache:{},input:e,index:0,indexBacktrackMax:0,options:n,output:[]},r=E(t)(o),c=Math.max(o.index,o.indexBacktrackMax);if(r&&o.index===e.length)return o.output;throw new Error(`Failed to parse at index ${c}`)},"I"),p=l((e,t)=>ee(e)?Ze(e,t):te(e)?re(e,t):Le(e,t),"i"),Ze=l((e,t)=>{const n={};for(const o of e){if(o.length!==1)throw new Error(`Invalid character: "${o}"`);const r=o.charCodeAt(0);n[r]=!0}return o=>{const r=o.input;let c=o.index,f=c;for(;f<r.length&&r.charCodeAt(f)in n;)f+=1;if(f>c){if(!A(t)&&!o.options.silent){const h=r.slice(c,f),w=W(t)?t(h,r,`${c}`):t;A(w)||o.output.push(w)}o.index=f}return!0}},"we"),Le=l((e,t)=>{if(qe(e))return re(e.source,t);{const n=e.source,o=e.flags.replace(/y|$/,"y"),r=new RegExp(n,o);return We(e)&&W(t)&&!Se(t)?He(r,t):Fe(r,t)}},"$e"),He=l((e,t)=>n=>{const o=n.index,r=n.input;e.lastIndex=o;const c=e.exec(r);if(c){const f=e.lastIndex;if(!n.options.silent){const h=t(...c,r,`${o}`);A(h)||n.output.push(h)}return n.index=f,!0}else return!1},"Ee"),Fe=l((e,t)=>n=>{const o=n.index,r=n.input;if(e.lastIndex=o,e.test(r)){const c=e.lastIndex;if(!A(t)&&!n.options.silent){const f=W(t)?t(r.slice(o,c),r,`${o}`):t;A(f)||n.output.push(f)}return n.index=c,!0}else return!1},"Ce"),re=l((e,t)=>n=>{const o=n.index,r=n.input;if(r.startsWith(e,o)){if(!A(t)&&!n.options.silent){const c=W(t)?t(e,r,`${o}`):t;A(c)||n.output.push(c)}return n.index+=e.length,!0}else return!1},"F"),J=l((e,t,n,o)=>{const r=E(e),c=t>1;return K(V(se(f=>{let h=0;for(;h<n;){const w=f.index;if(!r(f)||(h+=1,f.index===w))break}return h>=t},c),o))},"k"),oe=l((e,t)=>J(e,0,1,t),"L"),H=l((e,t)=>J(e,0,1/0,t),"$"),Te=l((e,t)=>J(e,1,1/0,t),"Re"),I=l((e,t)=>{const n=e.map(E);return K(V(se(o=>{for(let r=0,c=n.length;r<c;r++)if(!n[r](o))return!1;return!0}),t))},"x"),j=l((e,t)=>{const n=e.map(E);return K(V(o=>{for(let r=0,c=n.length;r<c;r++)if(n[r](o))return!0;return!1},t))},"p"),se=l((e,t=!0,n=!1)=>{const o=E(e);return t?r=>{const c=r.index,f=r.output.length,h=o(r);return!h&&!n&&(r.indexBacktrackMax=Math.max(r.indexBacktrackMax,r.index)),(!h||n)&&(r.index=c,r.output.length!==f&&(r.output.length=f)),h}:o},"q"),V=l((e,t)=>{const n=E(e);return t?o=>{if(o.options.silent)return n(o);const r=o.output.length;if(n(o)){const c=o.output.splice(r,1/0),f=t(c);return A(f)||o.output.push(f),!0}else return!1}:n},"B"),K=(()=>{let e=0;return t=>{const n=E(t),o=e+=1;return r=>{var c;if(r.options.memoization===!1)return n(r);const f=r.index,h=(c=r.cache)[o]||(c[o]={indexMax:-1,queue:[]}),w=h.queue;if(f<=h.indexMax){const Z=h.store||(h.store=new Map);if(w.length){for(let C=0,Jt=w.length;C<Jt;C+=2){const Vt=w[C*2],Kt=w[C*2+1];Z.set(Vt,Kt)}w.length=0}const v=Z.get(f);if(v===!1)return!1;if(Ie(v))return r.index=v,!0;if(v)return r.index=v.index,v.output?.length&&r.output.push(...v.output),!0}const N=r.output.length,Dt=n(r);if(h.indexMax=Math.max(h.indexMax,f),Dt){const Z=r.index,v=r.output.length;if(v>N){const C=r.output.slice(N,v);w.push(f,{index:Z,output:C})}else w.push(f,Z);return!0}else return w.push(f,!1),!1}}})(),le=l(e=>{let t;return n=>(t||(t=E(e())),t(n))},"G"),E=Ne(e=>{if(W(e))return Re(e)?le(e):e;if(te(e)||Ce(e))return p(e);if(ee(e))return I(e);if(Be(e))return j(Object.values(e));throw new Error("Invalid rule")}),O=l(e=>e,"d"),Ue=l(e=>typeof e=="string","ke"),Ge=l(e=>{const t=new WeakMap,n=new WeakMap;return(o,r)=>{const c=r?.partial?n:t,f=c.get(o);if(f!==void 0)return f;const h=e(o,r);return c.set(o,h),h}},"Be"),De=l(e=>{const t={},n={};return(o,r)=>{const c=r?.partial?n:t;return c[o]??(c[o]=e(o,r))}},"Pe"),Je=p(/\\./,O),Ve=p(/./,O),Ke=p(/\*\*\*+/,"*"),Qe=p(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),Xe=p(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),Ye=H(j([Je,Ke,Qe,Xe,Ve])),et=Ye,tt=l(e=>ne(e,et,{memoization:!1}).join(""),"Ie"),nt=tt,ie="abcdefghijklmnopqrstuvwxyz",rt=l(e=>{let t="";for(;e>0;){const n=(e-1)%26;t=ie[n]+t,e=Math.floor((e-1)/26)}return t},"Le"),ae=l(e=>{let t=0;for(let n=0,o=e.length;n<o;n++)t=t*26+ie.indexOf(e[n])+1;return t},"V"),Q=l((e,t)=>{if(t<e)return Q(t,e);const n=[];for(;e<=t;)n.push(e++);return n},"b"),ot=l((e,t,n)=>Q(e,t).map(o=>String(o).padStart(n,"0")),"qe"),ce=l((e,t)=>Q(ae(e),ae(t)).map(rt),"W"),$=l(e=>({partial:!1,regex:new RegExp(e,"s"),children:[]}),"c"),q=l(e=>({children:e}),"y"),B=(()=>{const e=l((t,n,o)=>{if(o.has(t))return;o.add(t);const{children:r}=t;if(!r.length)r.push(n);else for(let c=0,f=r.length;c<f;c++)e(r[c],n,o)},"e");return t=>{if(!t.length)return q([]);for(let n=t.length-1;n>=1;n--){const o=new Set,r=t[n-1],c=t[n];e(r,c,o)}return t[0]}})(),k=l(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),st=p(/\\./,$),lt=p(/[$.*+?^(){}[\]\|]/,e=>$(`\\${e}`)),it=p(/[\\\/]/,k),at=p(/[^$.*+?^(){}[\]\|\\\/]+/,$),ct=p(/^(?:!!)*!(.*)$/,(e,t)=>$(`(?!^${me.compile(t).source}$).*?`)),ut=p(/^(!!)+/),ft=j([ct,ut]),pt=p(/\/(\*\*\/)+/,()=>q([B([k(),$(".+?"),k()]),k()])),dt=p(/^(\*\*\/)+/,()=>q([$("^"),B([$(".*?"),k()])])),ht=p(/\/(\*\*)$/,()=>q([B([k(),$(".*?")]),$("$")])),gt=p(/\*\*/,()=>$(".*?")),ue=j([pt,dt,ht,gt]),xt=p(/\*\/(?!\*\*\/|\*$)/,()=>B([$("[^\\\\/]*?"),k()])),mt=p(/\*/,()=>$("[^\\\\/]*")),fe=j([xt,mt]),pe=p("?",()=>$("[^\\\\/]")),$t=p("[",O),wt=p("]",O),yt=p(/[!^]/,"^\\\\/"),bt=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,O),jt=p(/\\./,O),vt=p(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Mt=p(/[\\\/]/,"\\\\/"),Pt=p(/[^$.*+?^(){}[\]\|\\\/]+/,O),zt=j([jt,vt,Mt,bt,Pt]),de=I([$t,oe(yt),H(zt),wt],e=>$(e.join(""))),At=p("{","(?:"),Et=p("}",")"),kt=p(/(\d+)\.\.(\d+)/,(e,t,n)=>ot(+t,+n,Math.min(t.length,n.length)).join("|")),Ot=p(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>ce(t,n).join("|")),_t=p(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>ce(t.toLowerCase(),n.toLowerCase()).join("|").toUpperCase()),Rt=j([kt,Ot,_t]),he=I([At,Rt,Et],e=>$(e.join(""))),St=p("{"),It=p("}"),Bt=p(","),Ct=p(/\\./,$),Wt=p(/[$.*+?^(){[\]\|]/,e=>$(`\\${e}`)),qt=p(/[\\\/]/,k),Nt=p(/[^$.*+?^(){}[\]\|\\\/,]+/,$),Zt=le(()=>xe),Lt=p("",()=>$("(?:)")),Ht=Te(j([ue,fe,pe,de,he,Zt,Ct,Wt,qt,Nt]),B),ge=j([Ht,Lt]),xe=I([St,oe(I([ge,H(I([Bt,ge]))])),It],q),Ft=H(j([ft,ue,fe,pe,de,he,xe,st,lt,it,at]),B),Tt=Ft,Ut=l(e=>ne(e,Tt,{memoization:!1})[0],"kr"),Gt=Ut,X=l((e,t,n)=>X.compile(e,n).test(t),"N");X.compile=(()=>{const e=De((n,o)=>ke(Gt(nt(n)),o)),t=Ge((n,o)=>_e(n.map(r=>e(r,o))));return(n,o)=>Ue(n)?e(n,o):t(n,o)})();var me=X;return m(y)})();return s.default||s},"_lazyMatch"),Y;const rn=l((s,i)=>(Y||(Y=ye(),ye=null),Y(s,i)),"zeptomatch"),on=/^[A-Z]:\//i,R=l((s="")=>s&&s.replaceAll("\\","/").replace(on,i=>i.toUpperCase()),"normalizeWindowsPath"),sn=/^[/\\]{2}/,ln=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Me=/^[A-Z]:$/i,be=/^\/([A-Z]:)?$/i,an=/.(\.[^./]+)$/,cn=/^[/\\]|^[a-z]:[/\\]/i,un=l(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),je="/",Pe=l((s,i)=>{let a="",u=0,d=-1,g=0,x;for(let m=0;m<=s.length;++m){if(m<s.length)x=s[m];else{if(x==="/")break;x="/"}if(x==="/"){if(!(d===m-1||g===1))if(g===2){if(a.length<2||u!==2||!a.endsWith(".")||a.at(-2)!=="."){if(a.length>2){const y=a.lastIndexOf("/");y===-1?(a="",u=0):(a=a.slice(0,y),u=a.length-1-a.lastIndexOf("/")),d=m,g=0;continue}else if(a.length>0){a="",u=0,d=m,g=0;continue}}i&&(a+=a.length>0?"/..":"..",u=2)}else a.length>0?a+=`/${s.slice(d+1,m)}`:a=s.slice(d+1,m),u=m-d-1;d=m,g=0}else x==="."&&g!==-1?++g:g=-1}return a},"normalizeString"),_=l(s=>ln.test(s),"isAbsolute"),T=l(function(s){if(s.length===0)return".";s=R(s);const i=sn.exec(s),a=_(s),u=s.at(-1)==="/";return s=Pe(s,!a),s.length===0?a?"/":u?"./":".":(u&&(s+="/"),Me.test(s)&&(s+="/"),i?a?`//${s}`:`//./${s}`:a&&!_(s)?`/${s}`:s)},"normalize");l((...s)=>{let i="";for(const a of s)if(a)if(i.length>0){const u=i[i.length-1]==="/",d=a[0]==="/";u&&d?i+=a.slice(1):i+=u||d?a:`/${a}`}else i+=a;return T(i)},"join");const U=l(function(...s){s=s.map(u=>R(u));let i="",a=!1;for(let u=s.length-1;u>=-1&&!a;u--){const d=u>=0?s[u]:un();!d||d.length===0||(i=`${d}/${i}`,a=_(d))}return i=Pe(i,!a),a&&!_(i)?`/${i}`:i.length>0?i:"."},"resolve");l(function(s){return R(s)},"toNamespacedPath");const fn=l(function(s){return an.exec(R(s))?.[1]??""},"extname"),pn=l(function(s,i){const a=U(s).replace(be,"$1").split("/"),u=U(i).replace(be,"$1").split("/");if(u[0][1]===":"&&a[0][1]===":"&&a[0]!==u[0])return u.join("/");const d=[...a];for(const g of d){if(u[0]!==g)break;a.shift(),u.shift()}return[...a.map(()=>".."),...u].join("/")},"relative"),dn=l(s=>{const i=R(s).replace(/\/$/,"").split("/").slice(0,-1);return i.length===1&&Me.test(i[0])&&(i[0]+="/"),i.join("/")||(_(s)?"/":".")},"dirname");l(function(s){const i=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return R(s.root?U(...i):i.join("/"))},"format");const hn=l((s,i)=>{const a=R(s).split("/").pop();return i&&a.endsWith(i)?a.slice(0,-i.length):a},"basename");l(function(s){const i=cn.exec(s)?.[0]?.replaceAll("\\","/")??"",a=hn(s),u=fn(a);return{base:a,dir:dn(s),ext:u,name:a.slice(0,a.length-u.length),root:i}},"parse");l((s,i)=>rn(i,T(s)),"matchesGlob");var gn=Object.defineProperty,M=F((s,i)=>gn(s,"name",{value:i,configurable:!0}),"a");const ve=M(s=>{if(typeof s.status=="function"){s.status(400).send("Failed to open editor");return}s.statusCode=400,s.end("Failed to open editor")},"respond400"),ze=M((s={})=>{const i=M(async u=>{if(String(u.method||"GET").toUpperCase()==="POST")return u.body&&typeof u.body=="object"?u.body:new Promise(g=>{try{let x="";const m=M(b=>{x+=String(b)},"onData"),y=M(()=>{try{g(x?JSON.parse(x):{})}catch{g({})}},"onEnd");u.on("data",m),u.on("end",y),u.on("error",()=>g({}))}catch{g({})}});const d=new URL(u.url||"","http://localhost");return{column:Number(d.searchParams.get("column")||1),editor:d.searchParams.get("editor")||void 0,file:d.searchParams.get("file")||void 0,line:Number(d.searchParams.get("line")||1)}},"parseRequestBody"),a=M((u,d,g)=>{if(!u)return;const x=_(u)?u:U(d,u);if(!g)try{const m=$e(d),y=$e(x),b=T(m),P=T(y),z=we()==="win32"||we()==="darwin",G=z?b.toLowerCase():b,D=z?P.toLowerCase():P,S=pn(b,P);if(S.startsWith("..")||_(S)||z&&!D.startsWith(G))return}catch{const m=d.endsWith(je)?d:d+je;if(!x.startsWith(m))return}return x},"validateFilePath");return M(async function(u,d,g){try{const x=await i(u),m=s.projectRoot??process.cwd(),y=a(x.file,m,s.allowOutsideProject??!1);if(!y){ve(d);return}const b=tn(x.editor,m),P=new URLSearchParams({column:String(x.column??1),file:y,line:String(x.line??1)});if(x.editor&&P.set("editor",String(x.editor)),u.url=`/?${P.toString()}`,typeof g=="function"){b(u,d,g);return}await new Promise(z=>{b(u,d,()=>{z()})})}catch{ve(d)}},"universalHandler")},"createOpenInEditorMiddleware"),yn=M((s={})=>{const i=ze(s);return async(a,u)=>i(a,u)},"createNodeHttpHandler"),bn=M((s={})=>ze(s),"createExpressHandler");export{bn as createExpressHandler,yn as createNodeHttpHandler,ze as createOpenInEditorMiddleware};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/ono",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
4
|
"description": "Ono is an error-parsing library that pretty prints JavaScript errors on a web page or the terminal.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visulima",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
36
|
"url": "https://github.com/visulima/visulima.git",
|
|
37
|
-
"directory": "packages/ono"
|
|
37
|
+
"directory": "packages/error-debugging/ono"
|
|
38
38
|
},
|
|
39
39
|
"funding": [
|
|
40
40
|
{
|
|
@@ -93,16 +93,17 @@
|
|
|
93
93
|
"test:watch": "vitest"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@shikijs/langs": "^3.
|
|
97
|
-
"@shikijs/themes": "^3.
|
|
98
|
-
"@visulima/error": "
|
|
99
|
-
"isomorphic-dompurify": "^2.
|
|
100
|
-
"
|
|
96
|
+
"@shikijs/langs": "^3.19.0",
|
|
97
|
+
"@shikijs/themes": "^3.19.0",
|
|
98
|
+
"@visulima/error": "6.0.0-alpha.1",
|
|
99
|
+
"isomorphic-dompurify": "^2.33.0",
|
|
100
|
+
"launch-editor-middleware": "2.12.0",
|
|
101
|
+
"shiki": "^3.19.0"
|
|
101
102
|
},
|
|
102
103
|
"devDependencies": {
|
|
103
|
-
"@anolilab/eslint-config": "^16.4.
|
|
104
|
-
"@anolilab/prettier-config": "^6.0.
|
|
105
|
-
"@anolilab/semantic-release-preset": "^
|
|
104
|
+
"@anolilab/eslint-config": "^16.4.4",
|
|
105
|
+
"@anolilab/prettier-config": "^6.0.8",
|
|
106
|
+
"@anolilab/semantic-release-preset": "^12.1.2",
|
|
106
107
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
107
108
|
"@eslint/css": "0.14.1",
|
|
108
109
|
"@tailwindcss/forms": "^0.5.10",
|
|
@@ -111,29 +112,28 @@
|
|
|
111
112
|
"@tailwindcss/typography": "^0.5.19",
|
|
112
113
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
113
114
|
"@types/http-errors": "^2.0.5",
|
|
114
|
-
"@types/node": "24.10.
|
|
115
|
-
"@visulima/packem": "2.0.0-alpha.
|
|
116
|
-
"@visulima/path": "
|
|
117
|
-
"@vitest/coverage-v8": "^4.0.
|
|
115
|
+
"@types/node": "24.10.1",
|
|
116
|
+
"@visulima/packem": "2.0.0-alpha.40",
|
|
117
|
+
"@visulima/path": "3.0.0-alpha.2",
|
|
118
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
118
119
|
"cssnano": "7.1.2",
|
|
119
|
-
"esbuild": "0.27.
|
|
120
|
+
"esbuild": "0.27.1",
|
|
120
121
|
"eslint": "^9.39.1",
|
|
121
|
-
"http-errors": "^2.0.
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"marked": "^17.0.0",
|
|
122
|
+
"http-errors": "^2.0.1",
|
|
123
|
+
"lucide-static": "^0.556.0",
|
|
124
|
+
"marked": "^17.0.1",
|
|
125
125
|
"node-mocks-http": "^1.17.2",
|
|
126
|
-
"openai": "6.
|
|
127
|
-
"prettier": "^3.
|
|
128
|
-
"prettier-plugin-tailwindcss": "0.7.
|
|
126
|
+
"openai": "6.10.0",
|
|
127
|
+
"prettier": "^3.7.4",
|
|
128
|
+
"prettier-plugin-tailwindcss": "0.7.2",
|
|
129
129
|
"publint": "^0.3.15",
|
|
130
|
-
"rimraf": "^6.1.
|
|
130
|
+
"rimraf": "^6.1.2",
|
|
131
131
|
"semantic-release": "^25.0.2",
|
|
132
|
-
"sort-package-json": "^3.
|
|
132
|
+
"sort-package-json": "^3.5.0",
|
|
133
133
|
"tailwind-csstree": "0.1.4",
|
|
134
134
|
"tailwindcss": "^4.1.17",
|
|
135
135
|
"typescript": "^5.9.3",
|
|
136
|
-
"vitest": "^4.0.
|
|
136
|
+
"vitest": "^4.0.15"
|
|
137
137
|
},
|
|
138
138
|
"peerDependencies": {
|
|
139
139
|
"@ai-sdk/anthropic": "^1.0.9",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
"engines": {
|
|
170
|
-
"node": ">=
|
|
170
|
+
"node": ">=22.13 <=25.x"
|
|
171
171
|
},
|
|
172
172
|
"publishConfig": {
|
|
173
173
|
"access": "public",
|