@pen.dev/cli 0.3.10 → 0.3.12

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.
Files changed (43) hide show
  1. package/README.md +6 -4
  2. package/dist/browserAll-BVNfpTCH.mjs +15 -0
  3. package/dist/chunk-V2S4ZYJR-B9IPlZGx.mjs +7 -0
  4. package/dist/esm-N6I77Ols.mjs +63 -0
  5. package/dist/esm-Rg36NIlb.mjs +2 -0
  6. package/dist/html-BzmDMzcE.mjs +26 -0
  7. package/dist/index.d.mts +2 -0
  8. package/dist/index.mjs +3 -2
  9. package/dist/init-79Ivv_Iw.mjs +555 -0
  10. package/dist/limit-io-DqzENcBM.mjs +3 -0
  11. package/dist/module-ES6BEMUI-nLDaJUtp.mjs +2 -0
  12. package/dist/module-asyncify-2EFITU5U-B-l6gXmU.mjs +2 -0
  13. package/dist/node_modules/@highagency/pencil-wasm/enums.gen.d.ts +5 -0
  14. package/dist/node_modules/@highagency/pencil-wasm/package.json +1 -1
  15. package/dist/node_modules/@highagency/pencil-wasm/pencil.d.ts +11 -6
  16. package/dist/node_modules/@highagency/pencil-wasm/pencil.js +1 -1
  17. package/dist/node_modules/@highagency/pencil-wasm/pencil.wasm +0 -0
  18. package/dist/out/mcp-server-darwin-arm64 +0 -0
  19. package/dist/out/mcp-server-darwin-x64 +0 -0
  20. package/dist/out/mcp-server-linux-arm64 +0 -0
  21. package/dist/out/mcp-server-linux-x64 +0 -0
  22. package/dist/out/mcp-server-windows-arm64.exe +0 -0
  23. package/dist/out/mcp-server-windows-x64.exe +0 -0
  24. package/dist/out/skills/pen-dev/SKILL.md +1 -0
  25. package/dist/out/skills/pen-dev/execute.md +1 -0
  26. package/dist/out/skills/pen-dev/pen-schema.md +5 -11
  27. package/dist/out/skills/pen-dev/scripts-and-shaders.md +35 -3
  28. package/dist/rolldown-runtime-DUc_qoCt.mjs +2 -0
  29. package/dist/standalone-DmZDPu3b.mjs +30 -0
  30. package/dist/validate-response-Cd_RKmhH.mjs +3 -0
  31. package/dist/webworkerAll-tGgDIbvf.mjs +2 -0
  32. package/package.json +32 -31
  33. package/dist/browserAll-DN_YxOXQ.mjs +0 -2
  34. package/dist/dist-CbU0Evuc.mjs +0 -4
  35. package/dist/esm-BHQtsEyo.mjs +0 -2
  36. package/dist/esm-BYcFG9-N.mjs +0 -25
  37. package/dist/html-C5EUiP3B.mjs +0 -26
  38. package/dist/init-C4ANyG-9.mjs +0 -2
  39. package/dist/module-ES6BEMUI-fiUywq2c.mjs +0 -2
  40. package/dist/module-asyncify-2EFITU5U-Ck30SKgw.mjs +0 -2
  41. package/dist/standalone-D4MlQZsr.mjs +0 -30
  42. package/dist/validate-response-DHB60j_7.mjs +0 -3
  43. package/dist/webworkerAll-FVvp_NgY.mjs +0 -2
@@ -34,6 +34,8 @@ export interface Position { x?: number; y?: number; }
34
34
  export interface Size { width?: NumberOrVariable | SizingBehavior; height?: NumberOrVariable | SizingBehavior; }
35
35
  /** Affine matrix [a, b, c, d, tx, ty]. */
36
36
  export type AffineTransform = [number, number, number, number, number, number];
37
+ /** Override values for shader uniforms, keyed by uniform name. Uniforms annotated with `@resolution` or `@time` must not appear here. Allowed value shapes: number (float/int), boolean (bool), hex color string like `#RRGGBB[AA]` (color), array of 2-4 numbers (vec2/3/4), or a variable reference `$name` (numeric uniforms accept number variables; color uniforms accept color variables). */
38
+ export interface ShaderUniforms { [key: string]: number | boolean | string | number[]; }
37
39
  export type BlendMode = 'normal' | 'darken' | 'multiply' | 'linearBurn' | 'colorBurn' | 'light' | 'screen' | 'linearDodge' | 'colorDodge' | 'overlay' | 'softLight' | 'hardLight' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity';
38
40
  export type Fill = ColorOrVariable | {
39
41
  type: "color";
@@ -64,15 +66,7 @@ url?: string;
64
66
  mode?: "cover" | "contain" | "stretch";
65
67
  /** Crops the image. Maps normalized image coordinates (0..1 across its width and height) into the crop's 0..1 box, so [2, 0, 0, 1, -1, 0] is the right half. The mode fits the crop into the shape like a whole image, and cover keeps it inside the image. Defaults to identity, no crop. */
66
68
  transform?: AffineTransform;
67
- } | /** Shader fill. URL points to a WebGL 1.0 (#version 100) fragment shader file, relative to the .pen file, e.g. `./effect.glsl`. Uniforms are described via `@directive` annotations inside block comments in the shader source. A `vec2` uniform annotated with `@resolution` is auto-bound to the fill size in pixels. Other uniforms' user-set values are stored in `uniforms`. */ {
68
- type: "shader";
69
- enabled?: BooleanOrVariable;
70
- blendMode?: BlendMode;
71
- opacity?: NumberOrVariable;
72
- url: string;
73
- /** Override values for shader uniforms, keyed by uniform name. Uniforms annotated with `@resolution` or `@time` must not appear here. Allowed value shapes: number (float/int), boolean (bool), hex color string like `#RRGGBB[AA]` (color), array of 2-4 numbers (vec2/3/4), or a variable reference `$name` (numeric uniforms accept number variables; color uniforms accept color variables). */
74
- uniforms?: { [key: string]: number | boolean | string | number[] };
75
- } | /** Bezier-interpolated color grid, row-major. Keep edge points at default positions. */ {
69
+ } | /** Shader fill. URL points to a WebGL 1.0 (#version 100) fragment shader file, relative to the .pen file, e.g. `./effect.glsl`. Uniforms are described via `@directive` annotations inside block comments in the shader source. A `vec2` uniform annotated with `@resolution` is auto-bound to the fill size in pixels. Other uniforms' user-set values are stored in `uniforms`. */ { type: "shader"; enabled?: BooleanOrVariable; blendMode?: BlendMode; opacity?: NumberOrVariable; url: string; uniforms?: ShaderUniforms } | /** Bezier-interpolated color grid, row-major. Keep edge points at default positions. */ {
76
70
  type: "mesh_gradient";
77
71
  enabled?: BooleanOrVariable;
78
72
  blendMode?: BlendMode;
@@ -93,7 +87,7 @@ export interface CanHaveStroke {
93
87
  strokeLinejoin?: "miter" | "bevel" | "round";
94
88
  strokeAlignment?: "inner" | "center" | "outer";
95
89
  }
96
- export type Effect = /** Blurs the entire node. */ { enabled?: BooleanOrVariable; type: "blur"; radius?: NumberOrVariable } | /** Blurs the backdrop behind the node. */ { enabled?: BooleanOrVariable; type: "background_blur"; radius?: NumberOrVariable } | /** Inner or outer drop shadow. */ { type: "shadow"; enabled?: BooleanOrVariable; shadowType?: "inner" | "outer"; offset?: { x: NumberOrVariable; y: NumberOrVariable }; blur?: NumberOrVariable; color?: ColorOrVariable; blendMode?: BlendMode };
90
+ export type Effect = /** Blurs the entire node. */ { enabled?: BooleanOrVariable; type: "blur"; radius?: NumberOrVariable } | /** Blurs the backdrop behind the node. */ { enabled?: BooleanOrVariable; type: "background_blur"; radius?: NumberOrVariable } | /** Inner or outer drop shadow. */ { type: "shadow"; enabled?: BooleanOrVariable; shadowType?: "inner" | "outer"; offset?: { x: NumberOrVariable; y: NumberOrVariable }; blur?: NumberOrVariable; color?: ColorOrVariable; blendMode?: BlendMode } | /** Post-processes the rendered node with a fragment shader. Same shader format as the shader fill. A `sampler2D` uniform annotated with `@content` is auto-bound to the rendered node. `@resolution` is the size of the node's visual bounds. */ { type: "shader"; enabled?: BooleanOrVariable; url: string; uniforms?: ShaderUniforms };
97
91
  export type Effects = Effect | Effect[];
98
92
  export interface CanHaveEffects { effect?: Effects; }
99
93
  export interface CanHaveGraphics extends CanHaveEffects, CanHaveStroke { fill?: Fills; }
@@ -223,5 +217,5 @@ export interface Ref extends Entity {
223
217
  }
224
218
  export type Child = Frame | Group | Rectangle | Ellipse | Path | Polygon | Text | Note | Prompt | Context | Icon | Script | Browser | Ref;
225
219
  export type IdPath = string;
226
- export interface Document { version: "2.20"; themes?: { [key: string /** RegEx: [^:]+ */]: string[] }; imports?: { [key: string]: string /** Value: relative URI of imported .pen file. Key: short alias. */ }; variables?: { [key: string /** RegEx: [^:]+ */]: { type: "boolean"; value: BooleanOrVariable | { value: BooleanOrVariable; theme?: Theme }[] } | { type: "color"; value: ColorOrVariable | { value: ColorOrVariable; theme?: Theme }[] } | { type: "number"; value: NumberOrVariable | { value: NumberOrVariable; theme?: Theme }[] } | { type: "string"; value: StringOrVariable | { value: StringOrVariable; theme?: Theme }[] } }; children: (Frame | Group | Rectangle | Ellipse | Polygon | Path | Text | Note | Context | Prompt | Icon | Script | Browser | Ref)[]; }
220
+ export interface Document { version: "2.21"; themes?: { [key: string /** RegEx: [^:]+ */]: string[] }; imports?: { [key: string]: string /** Value: relative URI of imported .pen file. Key: short alias. */ }; variables?: { [key: string /** RegEx: [^:]+ */]: { type: "boolean"; value: BooleanOrVariable | { value: BooleanOrVariable; theme?: Theme }[] } | { type: "color"; value: ColorOrVariable | { value: ColorOrVariable; theme?: Theme }[] } | { type: "number"; value: NumberOrVariable | { value: NumberOrVariable; theme?: Theme }[] } | { type: "string"; value: StringOrVariable | { value: StringOrVariable; theme?: Theme }[] } }; children: (Frame | Group | Rectangle | Ellipse | Polygon | Path | Text | Note | Context | Prompt | Icon | Script | Browser | Ref)[]; }
227
221
  ```
@@ -42,7 +42,7 @@ return nodes;
42
42
 
43
43
  ## Shaders
44
44
 
45
- The `shader` fill type can be used to create complex graphics effects using WebGL shaders.
45
+ The `shader` fill type can be used to create complex graphics effects using WebGL shaders. The `shader` effect type runs the same kind of shader over the rendered node instead (see Shader effects below).
46
46
 
47
47
  - Shaders are WebGL 1.0 fragment shaders (#version 100), with one addition: textureSize(sampler, lod) is available for aspect-correct texturing.
48
48
  - Supported uniform types:
@@ -55,8 +55,10 @@ The `shader` fill type can be used to create complex graphics effects using WebG
55
55
  - @resolution: set to the resolution of the output. e.g. can be used to normalize gl_FragCoord.
56
56
  - @mouse: set to the mouse position in the same space as gl_FragCoord. For interactive effects.
57
57
  - @time: set to the elapsed time in seconds. For animations.
58
- - @sdf: a sampler2D set to an SDF texture of the node's shape. The r channel holds the signed distance in @resolution units (positive = inside). The gb channels hold the gradient of the distance field (direction of increasing distance), in texel space. Use gb instead of numerically differentiating the r channel!
59
- - @backdrop: a sampler2D set to the content rendered behind the node. offset/distort the sampling coordinate for refraction-like effects. Ideal for glass/frosted/refraction/magnifier effects. Prefer @backdrop over faking the background.
58
+ - @sdf: a sampler2D set to an SDF texture of the node's shape (in a shader effect: of the rendered content). The r channel holds the signed distance in @resolution units (positive = inside). The gb channels hold the gradient of the distance field (direction of increasing distance), in texel space. Use gb instead of numerically differentiating the r channel!
59
+ - @content: a sampler2D set to the node's own rendering below the shader, over transparent: in a fill the fills under it (plus the node's effects drawn before fills, like shadows), in a stroke additionally all fills, in an effect every fill, stroke and earlier effect. Texels are premultiplied by alpha, like gl_FragColor; outside the node it is transparent.
60
+ - @backdrop: a sampler2D set to the content rendered behind the node, with nothing of the node itself. Outside the node it mirrors. Offset/distort the sampling coordinate for refraction-like effects. Ideal for glass/frosted/refraction/magnifier effects. Prefer @backdrop over faking the background.
61
+ - @mipmap: the texture will be mipmapped. Off by default. Turn it on when the sample coordinate varies smoothly (glass, refraction, blur); keep it off when it jumps between neighboring pixels (pixelation, mosaics, high-frequency turbulence).
60
62
  - @min/@max: set the range of a uniform for better UI controls. Only applies to number uniforms.
61
63
  - @range <min>, <max>: shorthand for @min and @max on the same line. Shows a slider in the UI.
62
64
  - @label <text>: sets the uniform's display name in the UI. Always set the label.
@@ -92,3 +94,33 @@ void main() {
92
94
  gl_FragColor = vec4(color, 1.0);
93
95
  }
94
96
  ```
97
+
98
+ ### Shader effects
99
+
100
+ A `shader` effect (`effect: { type: "shader", url, uniforms }`) post-processes the node: the node, its children and its other effects are rendered into the `@content` texture, and the shader's output is drawn in place of the node. Use it for distortion, pixelation, color grading, glitch and similar effects on existing content. Use a shader fill when the shader generates the image itself. `@content` and `@backdrop` mean the same in fills and effects, so a shader written for one works as the other; a `@backdrop` shader (glass, ripple, ...) refracts what is behind the node either way.
101
+
102
+ - `@resolution` and `gl_FragCoord` are the same as for a fill: the node's size and the node's own coordinates. The shader is run over the node's visual bounds (strokes, shadows, blur, unclipped children included), so there `gl_FragCoord` goes outside `0..@resolution`, and `@content`, `@sdf` and `@backdrop` cover those bounds too: uv outside `0..1` samples them.
103
+ - Multiple shader effects are chained in list order: each one's `@content` is the output of the previous one.
104
+ - `@sdf` is the SDF of the content's alpha channel (edge at 50% alpha), so shadows, blurs and earlier shader effects on the node move the edge.
105
+ - `@content` is rendered over transparent, so blend modes inside the node only blend with the node's own content below them. A blend mode that reaches the bottom of the node (nothing opaque under it) blends with the scene when drawn normally, but not inside `@content`.
106
+ - Combine `@content` and `@backdrop`: distort the shape with `@content` and refract `@backdrop` through the result for a glass effect on a distorted node.
107
+
108
+ ```glsl
109
+ /** @resolution */
110
+ uniform vec2 u_resolution;
111
+
112
+ /** @content */
113
+ uniform sampler2D u_content;
114
+
115
+ /**
116
+ * @label Pixel Size
117
+ * @default 8
118
+ * @range 1, 64
119
+ */
120
+ uniform float u_pixelSize;
121
+
122
+ void main() {
123
+ vec2 cell = (floor(gl_FragCoord.xy / u_pixelSize) + 0.5) * u_pixelSize;
124
+ gl_FragColor = texture2D(u_content, cell / u_resolution);
125
+ }
126
+ ```
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=/* @__PURE__ */ e(import.meta.url);export{u as i,c as n,d as r,s as t};
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(let c of r(i))!a.call(e,c)&&c!==o&&t(e,c,{get:()=>i[c],enumerable:!(s=n(i,c))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=o((e,t)=>{var n,r,i,a,o,s,c,l,u,d,f,p,m=/\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy,h,g,_,v,y,ee;p=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,n=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/uy,g=/(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y,f=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,_=/[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y,ee=/[\t\v\f\ufeff\p{Zs}]+/uy,l=/\r?\n|[\r\u2028\u2029]/y,u=/\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y,h=/\/\/.*/y,i=/[<>.:={}]|\/(?![\/*])/y,r=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/uy,a=/(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y,o=/[^<>{}]+/y,y=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,v=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,s=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,c=/^(?:return|throw|yield)$/,d=RegExp(l.source),t.exports=function*(e,{jsx:t=!1}={}){var b,x,te,S,C,ne,w,T,re,E,ie,D,O,k;for({length:ne}=e,S=0,C=``,k=[{tag:`JS`}],b=[],ie=0,D=!1;S<ne;){switch(T=k[k.length-1],T.tag){case`JS`:case`JSNonExpressionParen`:case`InterpolationInTemplate`:case`InterpolationInJSX`:if(e[S]===`/`&&(y.test(C)||s.test(C))&&(m.lastIndex=S,w=m.exec(e))){S=m.lastIndex,C=w[0],D=!0,yield{type:`RegularExpressionLiteral`,value:w[0],closed:w[1]!==void 0&&w[1]!==`\\`};continue}if(p.lastIndex=S,w=p.exec(e)){switch(O=w[0],re=p.lastIndex,E=O,O){case`(`:C===`?NonExpressionParenKeyword`&&k.push({tag:`JSNonExpressionParen`,nesting:ie}),ie++,D=!1;break;case`)`:ie--,D=!0,T.tag===`JSNonExpressionParen`&&ie===T.nesting&&(k.pop(),E=`?NonExpressionParenEnd`,D=!1);break;case`{`:p.lastIndex=0,te=!v.test(C)&&(y.test(C)||s.test(C)),b.push(te),D=!1;break;case`}`:switch(T.tag){case`InterpolationInTemplate`:if(b.length===T.nesting){_.lastIndex=S,w=_.exec(e),S=_.lastIndex,C=w[0],w[1]==="${"?(C=`?InterpolationInTemplate`,D=!1,yield{type:`TemplateMiddle`,value:w[0]}):(k.pop(),D=!0,yield{type:`TemplateTail`,value:w[0],closed:w[1]==="`"});continue}break;case`InterpolationInJSX`:if(b.length===T.nesting){k.pop(),S+=1,C=`}`,yield{type:`JSXPunctuator`,value:`}`};continue}}D=b.pop(),E=D?`?ExpressionBraceEnd`:`}`;break;case`]`:D=!0;break;case`++`:case`--`:E=D?`?PostfixIncDec`:`?UnaryIncDec`;break;case`<`:if(t&&(y.test(C)||s.test(C))){k.push({tag:`JSXTag`}),S+=1,C=`<`,yield{type:`JSXPunctuator`,value:O};continue}D=!1;break;default:D=!1}S=re,C=E,yield{type:`Punctuator`,value:O};continue}if(n.lastIndex=S,w=n.exec(e)){switch(S=n.lastIndex,E=w[0],w[0]){case`for`:case`if`:case`while`:case`with`:C!==`.`&&C!==`?.`&&(E=`?NonExpressionParenKeyword`)}C=E,D=!s.test(w[0]),yield{type:w[1]===`#`?`PrivateIdentifier`:`IdentifierName`,value:w[0]};continue}if(g.lastIndex=S,w=g.exec(e)){S=g.lastIndex,C=w[0],D=!0,yield{type:`StringLiteral`,value:w[0],closed:w[2]!==void 0};continue}if(f.lastIndex=S,w=f.exec(e)){S=f.lastIndex,C=w[0],D=!0,yield{type:`NumericLiteral`,value:w[0]};continue}if(_.lastIndex=S,w=_.exec(e)){S=_.lastIndex,C=w[0],w[1]==="${"?(C=`?InterpolationInTemplate`,k.push({tag:`InterpolationInTemplate`,nesting:b.length}),D=!1,yield{type:`TemplateHead`,value:w[0]}):(D=!0,yield{type:`NoSubstitutionTemplate`,value:w[0],closed:w[1]==="`"});continue}break;case`JSXTag`:case`JSXTagEnd`:if(i.lastIndex=S,w=i.exec(e)){switch(S=i.lastIndex,E=w[0],w[0]){case`<`:k.push({tag:`JSXTag`});break;case`>`:k.pop(),C===`/`||T.tag===`JSXTagEnd`?(E=`?JSX`,D=!0):k.push({tag:`JSXChildren`});break;case`{`:k.push({tag:`InterpolationInJSX`,nesting:b.length}),E=`?InterpolationInJSX`,D=!1;break;case`/`:C===`<`&&(k.pop(),k[k.length-1].tag===`JSXChildren`&&k.pop(),k.push({tag:`JSXTagEnd`}))}C=E,yield{type:`JSXPunctuator`,value:w[0]};continue}if(r.lastIndex=S,w=r.exec(e)){S=r.lastIndex,C=w[0],yield{type:`JSXIdentifier`,value:w[0]};continue}if(a.lastIndex=S,w=a.exec(e)){S=a.lastIndex,C=w[0],yield{type:`JSXString`,value:w[0],closed:w[2]!==void 0};continue}break;case`JSXChildren`:if(o.lastIndex=S,w=o.exec(e)){S=o.lastIndex,C=w[0],yield{type:`JSXText`,value:w[0]};continue}switch(e[S]){case`<`:k.push({tag:`JSXTag`}),S++,C=`<`,yield{type:`JSXPunctuator`,value:`<`};continue;case`{`:k.push({tag:`InterpolationInJSX`,nesting:b.length}),S++,C=`?InterpolationInJSX`,D=!1,yield{type:`JSXPunctuator`,value:`{`};continue}}if(ee.lastIndex=S,w=ee.exec(e)){S=ee.lastIndex,yield{type:`WhiteSpace`,value:w[0]};continue}if(l.lastIndex=S,w=l.exec(e)){S=l.lastIndex,D=!1,c.test(C)&&(C=`?NoLineTerminatorHere`),yield{type:`LineTerminatorSequence`,value:w[0]};continue}if(u.lastIndex=S,w=u.exec(e)){S=u.lastIndex,d.test(w[0])&&(D=!1,c.test(C)&&(C=`?NoLineTerminatorHere`)),yield{type:`MultiLineComment`,value:w[0],closed:w[1]!==void 0};continue}if(h.lastIndex=S,w=h.exec(e)){S=h.lastIndex,D=!1,yield{type:`SingleLineComment`,value:w[0]};continue}x=String.fromCodePoint(e.codePointAt(S)),S+=x.length,C=x,D=!1,yield{type:T.tag.startsWith(`JSX`)?`JSXInvalid`:`Invalid`,value:x}}}}),d={};s(d,{__debug:()=>Ya,check:()=>qa,doc:()=>oa,format:()=>Ka,formatWithCursor:()=>Ga,getSupportInfo:()=>Ja,util:()=>da,version:()=>ua});var f=(e,t)=>(n,r,...i)=>n|1&&r==null?void 0:(t.call(r)??r[e]).apply(r,i),p=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},m=f(`replaceAll`,function(){if(typeof this==`string`)return p}),h=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},g=new class extends h{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function _(e,t,n){return g.diff(e,t,n)}var v=()=>{},y=`cr`,ee=`crlf`,b=`lf`,x=`\r`,te=`\r
3
+ `,S=`
4
+ `,C=S;function ne(e){let t=e.indexOf(x);return t===-1?b:e.charAt(t+1)===S?ee:y}function w(e){return e===y?x:e===ee?te:C}var T=/* @__PURE__ */ new Map([[S,/\n/gu],[x,/\r/gu],[te,/\r\n/gu]]);function re(e,t){let n=T.get(t);return e.match(n)?.length??0}var E=/\r\n?/gu;function ie(e){return m(0,e,E,S)}function D(e){return this[e<0?this.length+e:e]}var O=f(`at`,function(){if(Array.isArray(this)||typeof this==`string`)return D}),k=`string`,A=`array`,j=`cursor`,M=`indent`,N=`align`,P=`trim`,F=`group`,I=`fill`,L=`if-break`,R=`indent-if-break`,z=`line-suffix`,B=`line-suffix-boundary`,V=`line`,H=`label`,U=`break-parent`,ae=/* @__PURE__ */ new Set([j,M,N,P,F,I,L,R,z,B,V,H,U]);function oe(e){let t=e.length;for(;t>0&&(e[t-1]===`\r`||e[t-1]===`
5
+ `);)t--;return t<e.length?e.slice(0,t):e}function se(e){if(typeof e==`string`)return k;if(Array.isArray(e))return A;if(!e)return;let{type:t}=e;if(ae.has(t))return t}var ce=se,le=e=>new Intl.ListFormat(`en-US`,{type:`disjunction`}).format(e);function ue(e){let t=e===null?`null`:typeof e;if(t!==`string`&&t!==`object`)return`Unexpected doc '${t}',
6
+ Expected it to be 'string' or 'object'.`;if(ce(e))throw Error(`doc is valid.`);let n=Object.prototype.toString.call(e);if(n!==`[object Object]`)return`Unexpected doc '${n}'.`;let r=le([...ae].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.
7
+ Expected it to be ${r}.`}var de=class extends Error{name=`InvalidDocError`;constructor(e){super(ue(e)),this.doc=e}},fe={};function pe(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===fe){n(i.pop());continue}n&&i.push(e,fe);let a=ce(e);if(!a)throw new de(e);if(t?.(e)!==!1)switch(a){case A:case I:{let t=a===A?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case L:i.push(e.flatContents,e.breakContents);break;case F:if(r&&e.expandedStates)for(let t=e.expandedStates.length,n=t-1;n>=0;--n)i.push(e.expandedStates[n]);else i.push(e.contents);break;case N:case M:case R:case H:case z:i.push(e.contents);break;case k:case j:case P:case B:case V:case U:break;default:throw new de(e)}}}var me=pe;function he(e,t){if(typeof e==`string`)return t(e);let n=/* @__PURE__ */ new Map;return r(e);function r(e){if(n.has(e))return n.get(e);let t=i(e);return n.set(e,t),t}function i(e){switch(ce(e)){case A:return t(e.map(r));case I:return t({...e,parts:e.parts.map(r)});case L:return t({...e,breakContents:r(e.breakContents),flatContents:r(e.flatContents)});case F:{let{expandedStates:n,contents:i}=e;return n?(n=n.map(r),i=n[0]):i=r(i),t({...e,contents:i,expandedStates:n})}case N:case M:case R:case H:case z:return t({...e,contents:r(e.contents)});case k:case j:case P:case B:case V:case U:return t(e);default:throw new de(e)}}}function ge(e,t,n){let r=n,i=!1;function a(e){if(i)return!1;let n=t(e);n!==void 0&&(i=!0,r=n)}return me(e,a),r}function _e(e){if(e.type===F&&e.break||e.type===V&&e.hard||e.type===U)return!0}function ve(e){return ge(e,_e,!1)}function ye(e){if(e.length>0){let t=O(0,e,-1);!t.expandedStates&&!t.break&&(t.break=`propagated`)}return null}function be(e){let t=/* @__PURE__ */ new Set,n=[];function r(e){if(e.type===U&&ye(n),e.type===F){if(n.push(e),t.has(e))return!1;t.add(e)}}function i(e){e.type===F&&n.pop().break&&ye(n)}me(e,r,i,!0)}function xe(e){return e.type===V&&!e.hard?e.soft?``:` `:e.type===L?e.flatContents:e}function Se(e){return he(e,xe)}function Ce(e){for(e=[...e];e.length>=2&&O(0,e,-2).type===V&&O(0,e,-1).type===U;)e.length-=2;if(e.length>0){let t=we(O(0,e,-1));e[e.length-1]=t}return e}function we(e){switch(ce(e)){case M:case R:case F:case z:case H:{let t=we(e.contents);return{...e,contents:t}}case L:return{...e,breakContents:we(e.breakContents),flatContents:we(e.flatContents)};case I:return{...e,parts:Ce(e.parts)};case A:return Ce(e);case k:return oe(e);case N:case j:case P:case B:case V:case U:break;default:throw new de(e)}return e}function Te(e){return we(De(e))}function Ee(e){switch(ce(e)){case I:if(e.parts.every(e=>e===``))return``;break;case F:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return``;if(e.contents.type===F&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case N:case M:case R:case z:if(!e.contents)return``;break;case L:if(!e.flatContents&&!e.breakContents)return``;break;case A:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];typeof e==`string`&&typeof O(0,t,-1)==`string`?t[t.length-1]+=e:t.push(e),t.push(...r)}return t.length===0?``:t.length===1?t[0]:t}case k:case j:case P:case B:case V:case H:case U:break;default:throw new de(e)}return e}function De(e){return he(e,e=>Ee(e))}function Oe(e,t=$e){return he(e,e=>typeof e==`string`?qe(t,e.split(`
8
+ `)):e)}function ke(e){if(e.type===V)return!0}function Ae(e){return ge(e,ke,!1)}function je(e,t){return e.type===H?{...e,contents:t(e.contents)}:t(e)}var W=v,Me=v,Ne=v,Pe=v;function Fe(e){return W(e),{type:M,contents:e}}function Ie(e,t){return Pe(e),W(t),{type:N,contents:t,n:e}}function Le(e){return Ie(-1/0,e)}function Re(e){return Ie({type:`root`},e)}function ze(e){return Ie(-1,e)}function Be(e,t,n){W(e);let r=e;if(t>0){for(let e=0;e<Math.floor(t/n);++e)r=Fe(r);r=Ie(t%n,r),r=Ie(-1/0,r)}return r}var Ve={type:U},G={type:j};function He(e){return Ne(e),{type:I,parts:e}}function Ue(e,t={}){return W(e),Me(t.expandedStates,!0),{type:F,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function We(e,t){return Ue(e[0],{...t,expandedStates:e})}function Ge(e,t=``,n={}){return W(e),t!==``&&W(t),{type:L,breakContents:e,flatContents:t,groupId:n.groupId}}function Ke(e,t){return W(e),{type:R,contents:e,groupId:t.groupId,negate:t.negate}}function qe(e,t){W(e),Me(t);let n=[];for(let r=0;r<t.length;r++)r!==0&&n.push(e),n.push(t[r]);return n}function Je(e,t){return W(t),e?{type:H,label:e,contents:t}:t}var Ye={type:V},Xe={type:V,soft:!0},Ze={type:V,hard:!0},K=[Ze,Ve],Qe={type:V,hard:!0,literal:!0},$e=[Qe,Ve];function et(e){return W(e),{type:z,contents:e}}var tt={type:B},nt={type:P};function q(e){if(!e)return``;if(Array.isArray(e)){let t=[];for(let n of e)if(Array.isArray(n))t.push(...q(n));else{let e=q(n);e!==``&&t.push(e)}return t}return e.type===L?{...e,breakContents:q(e.breakContents),flatContents:q(e.flatContents)}:e.type===F?{...e,contents:q(e.contents),expandedStates:e.expandedStates?.map(q)}:e.type===I?{type:`fill`,parts:e.parts.map(q)}:e.contents?{...e,contents:q(e.contents)}:e}function rt(e){let t=Object.create(null),n=/* @__PURE__ */ new Set;return r(q(e));function r(e,t,n){if(typeof e==`string`)return JSON.stringify(e);if(Array.isArray(e)){let t=e.map(r).filter(Boolean);return t.length===1?t[0]:`[${t.join(`, `)}]`}if(e.type===V){let r=n?.[t+1]?.type===U;return e.literal?r?`literalline`:`literallineWithoutBreakParent`:e.hard?r?`hardline`:`hardlineWithoutBreakParent`:e.soft?`softline`:`line`}if(e.type===U)return n?.[t-1]?.type===V&&n[t-1].hard?void 0:`breakParent`;if(e.type===P)return`trim`;if(e.type===M)return`indent(`+r(e.contents)+`)`;if(e.type===N)return e.n===-1/0?`dedentToRoot(`+r(e.contents)+`)`:e.n<0?`dedent(`+r(e.contents)+`)`:e.n.type===`root`?`markAsRoot(`+r(e.contents)+`)`:`align(`+JSON.stringify(e.n)+`, `+r(e.contents)+`)`;if(e.type===L)return`ifBreak(`+r(e.breakContents)+(e.flatContents?`, `+r(e.flatContents):``)+(e.groupId?(e.flatContents?``:`, ""`)+`, { groupId: ${i(e.groupId)} }`:``)+`)`;if(e.type===R){let t=[];e.negate&&t.push(`negate: true`),e.groupId&&t.push(`groupId: ${i(e.groupId)}`);let n=t.length>0?`, { ${t.join(`, `)} }`:``;return`indentIfBreak(${r(e.contents)}${n})`}if(e.type===F){let t=[];e.break&&e.break!==`propagated`&&t.push(`shouldBreak: true`),e.id&&t.push(`id: ${i(e.id)}`);let n=t.length>0?`, { ${t.join(`, `)} }`:``;return e.expandedStates?`conditionalGroup([${e.expandedStates.map(e=>r(e)).join(`,`)}]${n})`:`group(${r(e.contents)}${n})`}if(e.type===I)return`fill([${e.parts.map(e=>r(e)).join(`, `)}])`;if(e.type===z)return`lineSuffix(`+r(e.contents)+`)`;if(e.type===B)return`lineSuffixBoundary`;if(e.type===H)return`label(${JSON.stringify(e.label)}, ${r(e.contents)})`;if(e.type===j)return`cursor`;throw Error(`Unknown doc type `+e.type)}function i(e){if(typeof e!=`symbol`)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||`symbol`;for(let i=0;;i++){let a=r+(i>0?` #${i}`:``);if(!n.has(a))return n.add(a),t[e]=`Symbol.for(${JSON.stringify(a)})`}}}var it=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function at(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function ot(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}var st=`©®‼⁉™ℹ↔↕↖↗↘↙↩↪⌨⏏⏱⏲⏸⏹⏺▪▫▶◀◻◼☀☁☂☃☄☎☑☘☝☠☢☣☦☪☮☯☸☹☺♀♂♟♠♣♥♦♨♻♾⚒⚔⚕⚖⚗⚙⚛⚜⚠⚧⚰⚱⛈⛏⛑⛓⛩⛱⛷⛸⛹✂✈✉✌✍✏✒✔✖✝✡✳✴❄❇❣❤➡⤴⤵⬅⬆⬇`,ct=/[^\x20-\x7F]/u,lt=new Set(st);function ut(e){if(!e)return 0;if(!ct.test(e))return e.length;e=e.replace(it(),e=>lt.has(e)?` `:` `);let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||e>=65024&&e<=65039||(t+=at(e)||ot(e)?2:1)}return t}var dt=ut,ft={type:0},pt={type:1},mt={value:``,length:0,queue:[],get root(){return mt}};function ht(e,t,n){let r=t.type===1?e.queue.slice(0,-1):[...e.queue,t],i=``,a=0,o=0,s=0;for(let e of r)switch(e.type){case 0:u(),n.useTabs?c(1):l(n.tabWidth);break;case 3:{let{string:t}=e;u(),i+=t,a+=t.length;break}case 2:{let{width:t}=e;o+=1,s+=t;break}default:throw Error(`Unexpected indent comment '${e.type}'.`)}return f(),{...e,value:i,length:a,queue:r};function c(e){i+=` `.repeat(e),a+=n.tabWidth*e}function l(e){i+=` `.repeat(e),a+=e}function u(){n.useTabs?d():f()}function d(){o>0&&c(o),p()}function f(){s>0&&l(s),p()}function p(){o=0,s=0}}function gt(e,t,n){if(!t)return e;if(t.type===`root`)return{...e,root:e};if(t===-1/0)return e.root;let r;return r=typeof t==`number`?t<0?pt:{type:2,width:t}:{type:3,string:t},ht(e,r,n)}function _t(e,t){return ht(e,ft,t)}function vt(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r===` `||r===` `)t++;else break}return t}function yt(e){let t=vt(e);return{text:t===0?e:e.slice(0,e.length-t),count:t}}var J=Symbol(`MODE_BREAK`),Y=Symbol(`MODE_FLAT`),bt=Symbol(`DOC_FILL_PRINTED_LENGTH`);function xt(e,t,n,r,i,a){if(n===1/0)return!0;let o=t.length,s=!1,c=[e],l=``;for(;n>=0;){if(c.length===0){if(o===0)return!0;c.push(t[--o]);continue}let{mode:e,doc:u}=c.pop(),d=ce(u);switch(d){case k:u&&(s&&=(l+=` `,--n,!1),l+=u,n-=dt(u));break;case A:case I:{let t=d===A?u:u.parts,n=u[bt]??0;for(let r=t.length-1;r>=n;r--)c.push({mode:e,doc:t[r]});break}case M:case N:case R:case H:c.push({mode:e,doc:u.contents});break;case P:{let{text:e,count:t}=yt(l);l=e,n+=t;break}case F:{if(a&&u.break)return!1;let t=u.break?J:e,n=u.expandedStates&&t===J?O(0,u.expandedStates,-1):u.contents;c.push({mode:t,doc:n});break}case L:{let t=(u.groupId?i[u.groupId]||Y:e)===J?u.breakContents:u.flatContents;t&&c.push({mode:e,doc:t});break}case V:if(e===J||u.hard)return!0;u.soft||(s=!0);break;case z:r=!0;break;case B:if(r)return!1}}return!1}function St(e,t){let n=Object.create(null),r=t.printWidth,i=w(t.endOfLine),a=0,o=[{indent:mt,mode:J,doc:e}],s=``,c=!1,l=[],u=[],d=[],f=[],p=0;for(be(e);o.length>0;){let{indent:e,mode:d,doc:f}=o.pop();switch(ce(f)){case k:{let e=i===`
9
+ `?f:m(0,f,`
10
+ `,i);e&&(s+=e,o.length>0&&(a+=dt(e)));break}case A:for(let t=f.length-1;t>=0;t--)o.push({indent:e,mode:d,doc:f[t]});break;case j:if(u.length>=2)throw Error(`There are too many 'cursor' in doc.`);u.push(p+s.length);break;case M:o.push({indent:_t(e,t),mode:d,doc:f.contents});break;case N:o.push({indent:gt(e,f.n,t),mode:d,doc:f.contents});break;case P:v();break;case F:switch(d){case Y:if(!c){o.push({indent:e,mode:f.break?J:Y,doc:f.contents});break}case J:{c=!1;let t={indent:e,mode:Y,doc:f.contents},i=r-a,s=l.length>0;if(!f.break&&xt(t,o,i,s,n))o.push(t);else if(f.expandedStates){let t=O(0,f.expandedStates,-1);if(f.break){o.push({indent:e,mode:J,doc:t});break}for(let r=1;r<f.expandedStates.length+1;r++)if(r>=f.expandedStates.length){o.push({indent:e,mode:J,doc:t});break}else{let t={indent:e,mode:Y,doc:f.expandedStates[r]};if(xt(t,o,i,s,n)){o.push(t);break}}}else o.push({indent:e,mode:J,doc:f.contents});break}}f.id&&(n[f.id]=O(0,o,-1).mode);break;case I:{let t=r-a,i=f[bt]??0,{parts:s}=f,c=s.length-i;if(c===0)break;let u=s[i+0],p=s[i+1],m={indent:e,mode:Y,doc:u},h={indent:e,mode:J,doc:u},g=xt(m,[],t,l.length>0,n,!0);if(c===1){g?o.push(m):o.push(h);break}let _={indent:e,mode:Y,doc:p},v={indent:e,mode:J,doc:p};if(c===2){g?o.push(_,m):o.push(v,h);break}let y=s[i+2],ee={indent:e,mode:d,doc:{...f,[bt]:i+2}},b=xt({indent:e,mode:Y,doc:[u,p,y]},[],t,l.length>0,n,!0);o.push(ee),b?o.push(_,m):g?o.push(v,m):o.push(v,h);break}case L:case R:{let t=f.groupId?n[f.groupId]:d;if(t===J){let t=f.type===L?f.breakContents:f.negate?f.contents:Fe(f.contents);t&&o.push({indent:e,mode:d,doc:t})}if(t===Y){let t=f.type===L?f.flatContents:f.negate?Fe(f.contents):f.contents;t&&o.push({indent:e,mode:d,doc:t})}break}case z:l.push({indent:e,mode:d,doc:f.contents});break;case B:l.length>0&&o.push({indent:e,mode:d,doc:Ze});break;case V:switch(d){case Y:if(f.hard)c=!0;else{f.soft||(s+=` `,a+=1);break}case J:if(l.length>0){o.push({indent:e,mode:d,doc:f},...l.reverse()),l.length=0;break}f.literal?(s+=i,a=0,e.root&&(e.root.value&&(s+=e.root.value),a=e.root.length)):(v(),s+=i+e.value,a=e.length)}break;case H:o.push({indent:e,mode:d,doc:f.contents});break;case U:break;default:throw new de(f)}o.length===0&&l.length>0&&(o.push(...l.reverse()),l.length=0)}let h=d.join(``)+s,g=[...f,...u];if(g.length!==2)return{formatted:h};let _=g[0];return{formatted:h,cursorNodeStart:_,cursorNodeText:h.slice(_,O(0,g,-1))};function v(){let{text:e,count:t}=yt(s);e&&(d.push(e),p+=e.length),s=``,a-=t,u.length>0&&(f.push(...u.map(e=>Math.min(e,p))),u.length=0)}}function Ct(e,t,n=0){let r=0;for(let i=n;i<e.length;++i)e[i]===` `?r=r+t-r%t:r++;return r}var wt=Ct,Tt=class{constructor(e){this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return O(0,e,t===null?-2:-4)??null}get index(){return this.siblings===null?null:O(0,this.stack,-2)}get node(){return O(0,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:e}=this,t=O(0,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return e===null?null:e[this.index+1]}get previous(){let{siblings:e}=this;return e===null?null:e[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:e,index:t}=this;return e!==null&&t===e.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...this.#t()]}getName(){let{stack:e}=this,{length:t}=e;return t>1?O(0,e,-2):null}getValue(){return O(0,this.stack,-1)}getNode(e=0){let t=this.#e(e);return t===-1?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}#e(e){let{stack:t}=this;for(let n=t.length-1;n>=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1}call(e,...t){let{stack:n}=this,{length:r}=n,i=O(0,n,-1);for(let e of t)i=i?.[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=this.#e(t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=O(0,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t<i.length;++t)n.push(t,i[t]),e(this,t,i),n.length-=2}finally{n.length=r}}map(e,...t){let n=[];return this.each((t,r,i)=>{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(r===void 0)return!1;let e=null;if(typeof n==`number`&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of this.#t())if(e(t))return t}hasAncestor(e){for(let t of this.#t())if(e(t))return!0;return!1}*#t(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}}};function Et(e){return typeof e==`object`&&!!e}var Dt=Et;function Ot(e){return(t,n,r)=>{let i=!!r?.backwards;if(n===!1)return!1;let{length:a}=t,o=n;for(;o>=0&&o<a;){let n=t.charAt(o);if(e instanceof RegExp){if(!e.test(n))return o}else if(!e.includes(n))return o;i?o--:o++}return o===-1||o===a?o:!1}}var kt=Ot(/\s/u),X=Ot(` `),At=Ot(`,; `),jt=Ot(/[^\n\r]/u),Mt=e=>e===`
11
+ `||e===`\r`||e===`\u2028`||e===`\u2029`;function Nt(e,t,n){let r=!!n?.backwards;if(t===!1)return!1;let i=e.charAt(t);if(r){if(e.charAt(t-1)===`\r`&&i===`
12
+ `)return t-2;if(Mt(i))return t-1}else{if(i===`\r`&&e.charAt(t+1)===`
13
+ `)return t+2;if(Mt(i))return t+1}return t}var Pt=Nt;function Ft(e,t,n={}){let r=X(e,n.backwards?t-1:t,n);return r!==Pt(e,r,n)}var Z=Ft;function It(e){return Array.isArray(e)&&e.length>0}var Lt=It;function*Rt(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>Dt(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function*zt(e,t){let n=[e];for(let e=0;e<n.length;e++){let r=n[e];for(let e of Rt(r,t))yield e,n.push(e)}}function Bt(e,t){return Rt(e,t).next().done}function Vt(e,t,n){let{cache:r}=n;if(r.has(e))return r.get(e);let{filter:i}=n;if(!i)return[];let a,o=(n.getChildren?.(e,n)??[...Rt(e,{getVisitorKeys:n.getVisitorKeys})]).flatMap(r=>(a??=[e,...t],i(r,a)?[r]:Vt(r,a,n))),{locStart:s,locEnd:c}=n;return o.sort((e,t)=>s(e)-s(t)||c(e)-c(t)),r.set(e,o),o}var Ht=Vt;function Ut(e){let t=e.type||e.kind||`(unknown type)`,n=String(e.name||e.id&&(typeof e.id==`object`?e.id.name:e.id)||e.key&&(typeof e.key==`object`?e.key.name:e.key)||e.value&&(typeof e.value==`object`?``:String(e.value))||e.operator||``);return n.length>20&&(n=n.slice(0,19)+`…`),t+(n?` `+n:``)}function Wt(e,t){(e.comments??=[]).push(t),t.printed=!1,t.nodeDescription=Ut(e)}function Gt(e,t){t.leading=!0,t.trailing=!1,Wt(e,t)}function Kt(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Wt(e,t)}function qt(e,t){t.leading=!1,t.trailing=!0,Wt(e,t)}var Jt=/* @__PURE__ */ new WeakMap;function Yt(e,t,n,r,i=[]){let{locStart:a,locEnd:o}=n,s=a(t),c=o(t),l=Ht(e,i,{cache:Jt,locStart:a,locEnd:o,getVisitorKeys:n.getVisitorKeys,filter:n.printer.canAttachComment,getChildren:n.printer.getCommentChildNodes}),u,d,f=0,p=l.length;for(;f<p;){let e=f+p>>1,r=l[e],m=a(r),h=o(r);if(m<=s&&c<=h)return Yt(r,t,n,r,[r,...i]);if(h<=s){u=r,f=e+1;continue}if(c<=m){d=r,p=e;continue}throw Error(`Comment location overlaps with node location`)}if(r?.type===`TemplateLiteral`){let{quasis:e}=r,i=nn(e,t,n);u&&nn(e,u,n)!==i&&(u=null),d&&nn(e,d,n)!==i&&(d=null)}return{enclosingNode:r,precedingNode:u,followingNode:d}}var Xt=()=>!1;function Zt(e,t){let{comments:n}=e;if(delete e.comments,!Lt(n)||!t.printer.canAttachComment)return;let r=[],{printer:{features:{experimental_avoidAstMutation:i},handleComments:a={}},originalText:o}=t,{ownLine:s=Xt,endOfLine:c=Xt,remaining:l=Xt}=a,u=n.map((r,i)=>({...Yt(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of u.entries()){let{comment:n,precedingNode:a,enclosingNode:o,followingNode:d,text:f,options:p,ast:m,isLastComment:h}=t,g;if(i?g=[t]:(n.enclosingNode=o,n.precedingNode=a,n.followingNode=d,g=[n,f,p,m,h]),$t(f,p,u,e))n.placement=`ownLine`,s(...g)||(d?Gt(d,n):a?qt(a,n):Kt(o||m,n));else if(en(f,p,u,e))n.placement=`endOfLine`,c(...g)||(a?qt(a,n):d?Gt(d,n):Kt(o||m,n));else if(n.placement=`remaining`,!l(...g)){if(a&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&tn(r,p),r.push(t)}else a?qt(a,n):d?Gt(d,n):Kt(o||m,n)}}if(tn(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}var Qt=e=>!/[\S\n\u2028\u2029]/u.test(e);function $t(e,t,n,r){let{comment:i,precedingNode:a}=n[r],{locStart:o,locEnd:s}=t,c=o(i);if(a)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==a||!Qt(e.slice(s(r),c)))break;c=o(r)}return Z(e,c,{backwards:!0})}function en(e,t,n,r){let{comment:i,followingNode:a}=n[r],{locStart:o,locEnd:s}=t,c=s(i);if(a)for(let t=r+1;t<n.length;t++){let{comment:r,followingNode:i}=n[t];if(i!==a||!Qt(e.slice(c,o(r))))break;c=s(r)}return Z(e,c)}function tn(e,t){let n=e.length;if(n===0)return;let{precedingNode:r,followingNode:i}=e[0],a=t.locStart(i),o;for(o=n;o>0;--o){let{comment:n,precedingNode:r,followingNode:i}=e[o-1],s=t.originalText.slice(t.locEnd(n),a);if(t.printer.isGap?.(s,t)??/^[\s(]*$/u.test(s))a=t.locStart(n);else break}for(let[t,{comment:n}]of e.entries())t<o?qt(r,n):Gt(i,n);for(let e of[r,i])e.comments&&e.comments.length>1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function nn(e,t,n){let r=n.locStart(t)-1;for(let t=1;t<e.length;++t)if(r<n.locStart(e[t]))return t-1;return 0}function rn(e,t){let n=t-1;n=X(e,n,{backwards:!0}),n=Pt(e,n,{backwards:!0}),n=X(e,n,{backwards:!0});let r=Pt(e,n,{backwards:!0});return n!==r}var an=rn;function on(e,t){let n=e.node;return n.printed=!0,t.printer.printComment(e,t)}function sn(e,t){let n=e.node,r=[on(e,t)],{printer:i,originalText:a,locStart:o,locEnd:s}=t;if(i.isBlockComment?.(n)){let e=Z(a,s(n))?Z(a,o(n),{backwards:!0})?K:Ye:` `;r.push(e)}else r.push(K);let c=Pt(a,X(a,s(n)));return c!==!1&&Z(a,c)&&r.push(K),r}function cn(e,t,n){let r=e.node,i=on(e,t),{printer:a,originalText:o,locStart:s}=t,c=a.isBlockComment?.(r);return n?.hasLineSuffix&&!n?.isBlock||Z(o,s(r),{backwards:!0})?{doc:et([K,an(o,s(r))?K:``,i]),isBlock:c,hasLineSuffix:!0}:!c||n?.hasLineSuffix?{doc:[et([` `,i]),Ve],isBlock:c,hasLineSuffix:!0}:{doc:[` `,i],isBlock:c,hasLineSuffix:!1}}function ln(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for(`printedComments`)];if((n.comments||[]).filter(e=>!r.has(e)).length===0)return{leading:``,trailing:``};let i=[],a=[],o;return e.each(()=>{let n=e.node;if(r?.has(n))return;let{leading:s,trailing:c}=n;s?i.push(sn(e,t)):c&&(o=cn(e,t,o),a.push(o.doc))},`comments`),{leading:i,trailing:a}}function un(e,t,n){let{leading:r,trailing:i}=ln(e,n);return!r&&!i?t:je(t,e=>[r,e,i])}function dn(e){let{[Symbol.for(`comments`)]:t,[Symbol.for(`printedComments`)]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw Error(`Comment "`+e.value.trim()+`" was not printed. Please report this error!`);delete e.printed}}var fn=()=>v,pn=class extends Error{name=`ConfigError`},mn=class extends Error{name=`UndefinedParserError`},hn={checkIgnorePragma:{category:`Special`,type:`boolean`,default:!1,description:`Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.`,cliCategory:`Other`},cursorOffset:{category:`Special`,type:`int`,default:-1,range:{start:-1,end:1/0,step:1},description:`Print (to stderr) where a cursor at the given position would move to after formatting.`,cliCategory:`Editor`},endOfLine:{category:`Global`,type:`choice`,default:`lf`,description:`Which end of line characters to apply.`,choices:[{value:`lf`,description:`Line Feed only (\\n), common on Linux and macOS as well as inside git repos`},{value:`crlf`,description:`Carriage Return + Line Feed characters (\\r\\n), common on Windows`},{value:`cr`,description:`Carriage Return character only (\\r), used very rarely`},{value:`auto`,description:`Maintain existing
14
+ (mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:`Special`,type:`path`,description:`Specify the input filepath. This will be used to do parser inference.`,cliName:`stdin-filepath`,cliCategory:`Other`,cliDescription:`Path to the file to pretend that stdin comes from.`},insertPragma:{category:`Special`,type:`boolean`,default:!1,description:`Insert @format pragma into file's first docblock comment.`,cliCategory:`Other`},parser:{category:`Global`,type:`choice`,default:void 0,description:`Which parser to use.`,exception:e=>typeof e==`string`||typeof e==`function`,choices:[{value:`flow`,description:`Flow`},{value:`babel`,description:`JavaScript`},{value:`babel-flow`,description:`Flow`},{value:`babel-ts`,description:`TypeScript`},{value:`typescript`,description:`TypeScript`},{value:`acorn`,description:`JavaScript`},{value:`espree`,description:`JavaScript`},{value:`meriyah`,description:`JavaScript`},{value:`css`,description:`CSS`},{value:`less`,description:`Less`},{value:`scss`,description:`SCSS`},{value:`json`,description:`JSON`},{value:`json5`,description:`JSON5`},{value:`jsonc`,description:`JSON with Comments`},{value:`json-stringify`,description:`JSON.stringify`},{value:`graphql`,description:`GraphQL`},{value:`markdown`,description:`Markdown`},{value:`mdx`,description:`MDX`},{value:`vue`,description:`Vue`},{value:`yaml`,description:`YAML`},{value:`glimmer`,description:`Ember / Handlebars`},{value:`html`,description:`HTML`},{value:`angular`,description:`Angular`},{value:`lwc`,description:`Lightning Web Components`},{value:`mjml`,description:`MJML`}]},plugins:{type:`path`,array:!0,default:[{value:[]}],category:`Global`,description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e==`string`||typeof e==`object`,cliName:`plugin`,cliCategory:`Config`},printWidth:{category:`Global`,type:`int`,default:80,description:`The line length where Prettier will try wrap.`,range:{start:0,end:1/0,step:1}},rangeEnd:{category:`Special`,type:`int`,default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
15
+ The range will extend forwards to the end of the selected statement.`,cliCategory:`Editor`},rangeStart:{category:`Special`,type:`int`,default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
16
+ The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:`Editor`},requirePragma:{category:`Special`,type:`boolean`,default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.`,cliCategory:`Other`},tabWidth:{type:`int`,category:`Global`,default:2,description:`Number of spaces per indentation level.`,range:{start:0,end:1/0,step:1}},useTabs:{category:`Global`,type:`boolean`,default:!1,description:`Indent with tabs instead of spaces.`},embeddedLanguageFormatting:{category:`Global`,type:`choice`,default:`auto`,description:`Control how Prettier formats quoted code embedded in the file.`,choices:[{value:`auto`,description:`Format embedded code if Prettier can automatically identify it.`},{value:`off`,description:`Never automatically format embedded code.`}]}};function gn({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of vn(Object.assign({},...e.map(({options:e})=>e),hn)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),i.name===`parser`&&(i.choices=[...i.choices,..._n(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>e.defaultOptions?.[i.name]!==void 0).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*_n(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers){for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),a=e.name;i?.name&&(a+=` (plugin: ${i.name})`),yield{value:t,description:a}}}}function vn(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=O(0,e.default,-1).value),t.push(e)}return t}var yn=Array.prototype.toReversed??function(){return[...this].reverse()},bn=f(`toReversed`,function(){if(Array.isArray(this))return yn});function xn(){let e=globalThis,t=e.Deno?.build?.os;return typeof t==`string`?t===`windows`:e.navigator?.platform?.startsWith(`Win`)??e.process?.platform?.startsWith(`win`)??!1}var Sn=xn();function Cn(e){if(e=e instanceof URL?e:new URL(e),e.protocol!==`file:`)throw TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function wn(e){return e=Cn(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,`%25`))}function Tn(e){e=Cn(e);let t=decodeURIComponent(e.pathname.replace(/\//g,`\\`).replace(/%(?![0-9A-Fa-f]{2})/g,`%25`)).replace(/^\\*([A-Za-z]:)(\\|$)/,`$1\\`);return e.hostname!==``&&(t=`\\\\${e.hostname}${t}`),t}function En(e){return Sn?Tn(e):wn(e)}var Dn=e=>String(e).split(/[/\\]/u).pop(),On=e=>String(e).startsWith(`file:`);function kn(e,t){if(!t)return;let n=Dn(t).toLowerCase();return e.find(({filenames:e})=>e?.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>e?.some(e=>n.endsWith(e)))}function An(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>e?.includes(t))??e.find(({extensions:e})=>e?.includes(`.${t}`))}var jn=void 0;function Mn(e,t){if(t){if(On(t))try{t=En(t)}catch{return}if(typeof t==`string`)return e.find(({isSupported:e})=>e?.({filepath:t}))}}function Nn(e,t){let n=bn(0,e.plugins).flatMap(e=>e.languages??[]);return(An(n,t.language)??kn(n,t.physicalFile)??kn(n,t.file)??Mn(n,t.physicalFile)??Mn(n,t.file)??jn?.(n,t.physicalFile))?.parsers[0]}var Pn=Nn,Fn={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>Fn.value(e)).join(`, `)}]`;let t=Object.keys(e);return t.length===0?`{}`:`{ ${t.map(t=>`${Fn.key(t)}: ${Fn.value(e[t])}`).join(`, `)} }`},pair:({key:e,value:t})=>Fn.value({[e]:t})},In=new Proxy(String,{get:()=>In}),Q=In,Ln=()=>In,Rn=(e,t,{descriptor:n})=>{let r=[`${Q.yellow(typeof e==`string`?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${Q.blue(typeof t==`string`?n.key(t):n.pair(t))}`),r.join(`; `)+`.`},zn=Symbol.for(`vnopts.VALUE_NOT_EXIST`),Bn=Symbol.for(`vnopts.VALUE_UNCHANGED`),Vn=` `.repeat(2),Hn=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),a=[];return r&&a.push(Un(e,t,r,n.descriptor)),i&&a.push([Un(e,t,i.title,n.descriptor)].concat(i.values.map(e=>Wn(e,n.loggerPrintWidth))).join(`
17
+ `)),Gn(a,n.loggerPrintWidth)};function Un(e,t,n,r){return[`Invalid ${Q.red(r.key(e))} value.`,`Expected ${Q.blue(n)},`,`but received ${t===zn?Q.gray(`nothing`):Q.red(r.value(t))}.`].join(` `)}function Wn({text:e,list:t},n){let r=[];return e&&r.push(`- ${Q.blue(e)}`),t&&r.push([`- ${Q.blue(t.title)}:`].concat(t.values.map(e=>Wn(e,n-Vn.length).replace(/^|\n/g,`$&${Vn}`))).join(`
18
+ `)),Gn(r,n)}function Gn(e,t){if(e.length===1)return e[0];let[n,r]=e,[i,a]=e.map(e=>e.split(`
19
+ `,1)[0].length);return i>t&&i>a?r:n}var Kn=[],qn=[];function Jn(e,t,n){if(e===t)return 0;let r=n?.maxDistance,i=e;e.length>t.length&&(e=t,t=i);let a=e.length,o=t.length;for(;a>0&&e.charCodeAt(~-a)===t.charCodeAt(~-o);)a--,o--;let s=0;for(;s<a&&e.charCodeAt(s)===t.charCodeAt(s);)s++;if(a-=s,o-=s,r!==void 0&&o-a>r)return r;if(a===0)return r!==void 0&&o>r?r:o;let c,l,u,d,f=0,p=0;for(;f<a;)qn[f]=e.charCodeAt(s+f),Kn[f]=++f;for(;p<o;){for(c=t.charCodeAt(s+p),u=p++,l=p,f=0;f<a;f++)d=c===qn[f]?u:u+1,u=Kn[f],l=Kn[f]=u>l?d>l?l+1:d:d>u?u+1:d;if(r!==void 0){let e=l;for(f=0;f<a;f++)Kn[f]<e&&(e=Kn[f]);if(e>r)return r}}return Kn.length=a,qn.length=a,r!==void 0&&l>r?r:l}function Yn(e,t,n){if(!Array.isArray(t)||t.length===0)return;let r=n?.maxDistance,i=e.length;for(let n of t)if(n===e)return n;if(r===0)return;let a,o=1/0,s=/* @__PURE__ */ new Set;for(let n of t){if(s.has(n))continue;s.add(n);let t=Math.abs(n.length-i);if(t>=o||r!==void 0&&t>r)continue;let c=Number.isFinite(o)?r===void 0?o:Math.min(o,r):r,l=c===void 0?Jn(e,n):Jn(e,n,{maxDistance:c});if(r!==void 0&&l>r)continue;let u=l;if(c!==void 0&&l===c&&c===r&&(u=Jn(e,n)),u<o&&(o=u,a=n,o===0))break}if(!(r!==void 0&&o>r))return a}var Xn=(e,t,{descriptor:n,logger:r,schemas:i})=>{let a=[`Ignored unknown option ${Q.yellow(n.pair({key:e,value:t}))}.`],o=Yn(e,Object.keys(i),{maxDistance:3});o&&a.push(`Did you mean ${Q.blue(n.key(o))}?`),r.warn(a.join(` `))},Zn=[`default`,`expected`,`validate`,`deprecated`,`forward`,`redirect`,`overlap`,`preprocess`,`postprocess`];function Qn(e,t){let n=new e(t),r=Object.create(n);for(let e of Zn)e in t&&(r[e]=$n(t[e],n,$.prototype[e].length));return r}var $=class{static create(e){return Qn(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return`nothing`}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return Bn}};function $n(e,t,n){return typeof e==`function`?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var er=class extends ${constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},tr=class extends ${expected(){return`anything`}validate(){return!0}},nr=class extends ${constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:`an array of the following values`,values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);e!==!0&&n.push(e.value)}return n.length===0||{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);e!==!1&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(rr))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);`remain`in e&&n.push(e.remain),r.push(...e.redirect.map(rr))}return n.length===0?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function rr({from:e,to:t}){return{from:[e],to:t}}var ir=class extends ${expected(){return`true or false`}validate(e){return typeof e==`boolean`}};function ar(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function or(e,t){let n=/* @__PURE__ */ new Map;for(let r of e){let e=r[t];if(n.has(e))throw Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}function sr(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return e[n]?!0:(e[n]=!0,!1)}}function cr(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}function lr(e){return e===Math.floor(e)}function ur(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=[`undefined`,`object`,`boolean`,`number`,`string`];return n===r?n===`string`?e.localeCompare(t):Number(e)-Number(t):i.indexOf(n)-i.indexOf(r)}function dr(e){return(...t)=>{let n=e(...t);return typeof n==`string`?Error(n):n}}function fr(e){return e===void 0?{}:e}function pr(e){if(typeof e==`string`)return{text:e};let{text:t,list:n}=e;return yr((t||n)!==void 0,"Unexpected `expected` result, there should be at least one field."),n?{text:t,list:{title:n.title,values:n.values.map(pr)}}:{text:t}}function mr(e,t){return e===!0?!0:e===!1?{value:t}:e}function hr(e,t,n=!1){return e===!1?!1:e===!0?n?!0:[{value:t}]:`value`in e?[e]:e.length!==0&&e}function gr(e,t){return typeof e==`string`||`key`in e?{from:t,to:e}:`from`in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function _r(e,t){return e===void 0?[]:Array.isArray(e)?e.map(e=>gr(e,t)):[gr(e,t)]}function vr(e,t){let n=_r(typeof e==`object`&&`redirect`in e?e.redirect:e,t);return n.length===0?{remain:t,redirect:n}:typeof e==`object`&&`remain`in e?{remain:e.remain,redirect:n}:{redirect:n}}function yr(e,t){if(!e)throw Error(t)}var br=class extends ${constructor(e){super(e),this._choices=or(e.choices.map(e=>e&&typeof e==`object`?e:{value:e}),`value`)}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(ur).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(` or `)).join(`, `),list:{title:`one of the following values`,values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return t&&t.deprecated?{value:e}:!1}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},xr=class extends ${expected(){return`a number`}validate(e,t){return typeof e==`number`}},Sr=class extends xr{expected(){return`an integer`}validate(e,t){return t.normalizeValidateResult(super.validate(e,t),e)===!0&&lr(e)}},Cr=class extends ${expected(){return`a string`}validate(e){return typeof e==`string`}},wr=Fn,Tr=Xn,Er=Hn,Dr=Rn,Or=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=wr,unknown:a=Tr,invalid:o=Er,deprecated:s=Dr,missing:c=()=>!1,required:l=()=>!1,preprocess:u=e=>e,postprocess:d=()=>Bn}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:ar(e,`name`),normalizeDefaultResult:fr,normalizeExpectedResult:pr,normalizeDeprecatedResult:hr,normalizeForwardResult:_r,normalizeRedirectResult:vr,normalizeValidateResult:mr},this._unknownHandler=a,this._invalidHandler=dr(o),this._deprecatedHandler=s,this._identifyMissing=(e,t)=>!(e in t)||c(e,t),this._identifyRequired=l,this._preprocess=u,this._postprocess=d,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=sr()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;n.length!==0;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=fr(r.default(this._utils));`value`in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==Bn&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],a=r.preprocess(e[i],this._utils);this._applyValidation(a,i,r);let o=({from:e,to:t})=>{n.push(typeof t==`string`?{[t]:e}:{[t.key]:t.value})},s=({value:e,redirectTo:t})=>{let n=hr(r.deprecated(e,this._utils),a,!0);if(n!==!1){if(n===!0)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r=typeof t==`string`?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}}};_r(r.forward(a,this._utils),a).forEach(o);let c=vr(r.redirect(a,this._utils),a);if(c.redirect.forEach(o),`remain`in c){let e=c.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,s({value:e})}for(let{from:e,to:t}of c.redirect)s({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,zn,this._utils)}_partitionOptionKeys(e){let[t,n]=cr(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=mr(n.validate(e,this._utils),e);if(r!==!0)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==Bn){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}},kr;function Ar(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:a,descriptor:o}={}){if(r){if(!a)throw Error(`'FlagSchema' option is required.`);if(!o)throw Error(`'descriptor' option is required.`)}else o=Fn;let s=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return Xn(e,t,{...n,schemas:i})},c=new Or(jr(t,{isCLI:r,FlagSchema:a}),{logger:n,unknown:s,descriptor:o}),l=n!==!1;l&&kr&&(c._hasDeprecationWarned=kr);let u=c.normalize(e);return l&&(kr=c._hasDeprecationWarned),u}function jr(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(tr.create({name:`_`}));for(let i of e)r.push(Mr(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(er.create({name:i.alias,sourceName:i.name}));return r}function Mr(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let{name:i}=e,a={name:i},o,s={};switch(e.type){case`int`:o=Sr,t&&(a.preprocess=Number);break;case`string`:o=Cr;break;case`choice`:o=br,a.choices=e.choices.map(t=>t?.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case`boolean`:o=ir;break;case`flag`:o=r,a.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;case`path`:o=Cr;break;default:throw Error(`Unexpected type ${e.type}`)}if(a.validate=e.exception?(t,n,r)=>e.exception(t)||n.validate(t,r):(e,t,n)=>e===void 0||t.validate(e,n),e.redirect&&(s.redirect=t=>t?{to:typeof e.redirect==`string`?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let e=a.preprocess||(e=>e);a.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?O(0,t,-1):t),r)}return e.array?nr.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...s,valueSchema:o.create(a)}):o.create({...a,...s})}var Nr=Ar,Pr=Array.prototype.findLast??function(e){for(let t=this.length-1;t>=0;t--){let n=this[t];if(e(n,t,this))return n}},Fr=f(`findLast`,function(){if(Array.isArray(this))return Pr}),Ir=Symbol.for(`PRETTIER_IS_FRONT_MATTER`),Lr=[];function Rr(e){return!!e?.[Ir]}var zr=Rr,Br=/* @__PURE__ */ new Set([`yaml`,`toml`]),Vr=({node:e})=>zr(e)&&Br.has(e.language);async function Hr(e,t,n,r){let{node:i}=n,{language:a}=i;if(!Br.has(a))return;let o=i.value.trim(),s;if(o){let t=a===`yaml`?a:Pn(r,{language:a});if(!t)return;s=o?await e(o,{parser:t}):``}else s=o;return Re([i.startDelimiter,i.explicitLanguage??``,K,s,s?K:``,i.endDelimiter])}function Ur(e,t){return Vr({node:e})&&(delete t.end,delete t.raw,delete t.value),t}var Wr=Ur;function Gr({node:e}){return e.raw}var Kr=Gr,qr=/* @__PURE__ */ new Set([`tokens`,`comments`,`parent`,`enclosingNode`,`precedingNode`,`followingNode`]),Jr=e=>Object.keys(e).filter(e=>!qr.has(e));function Yr(e,t){let n=e?t=>e(t,qr):Jr;return t?new Proxy(n,{apply:(e,t,n)=>zr(n[0])?Lr:Reflect.apply(e,t,n)}):n}var Xr=Yr;function Zr(e,t){if(!t)throw Error(`parserName is required.`);let n=Fr(0,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;let r=`Couldn't resolve parser "${t}".`;throw r+=` Plugins must be explicitly added to the standalone bundle.`,new pn(r)}function Qr(e,t){if(!t)throw Error(`astFormat is required.`);let n=Fr(0,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;let r=`Couldn't find plugin for AST format "${t}".`;throw r+=` Plugins must be explicitly added to the standalone bundle.`,new pn(r)}function $r({plugins:e,parser:t}){return ei(Zr(e,t),t)}function ei(e,t){let n=e.parsers[t];return typeof n==`function`?n():n}async function ti(e,t){let n=e.printers[t];return ri(typeof n==`function`?await n():n)}var ni=/* @__PURE__ */ new WeakMap;function ri(e){if(ni.has(e))return ni.get(e);let{features:t,getVisitorKeys:n,embed:r,massageAstNode:i,print:a,...o}=e;t=oi(t);let s=t.experimental_frontMatterSupport;n=Xr(n,s.massageAstNode||s.embed||s.print);let c=i;i&&s.massageAstNode&&(c=new Proxy(i,{apply(e,t,n){return Wr(...n),Reflect.apply(e,t,n)}}));let l=r;if(r){let e;l=new Proxy(r,{get(t,i,a){return i===`getVisitorKeys`?(e??=r.getVisitorKeys?Xr(r.getVisitorKeys,s.massageAstNode||s.embed):n,e):Reflect.get(t,i,a)},apply:(e,t,n)=>s.embed&&Vr(...n)?Hr:Reflect.apply(e,t,n)})}let u=a;s.print&&(u=new Proxy(a,{apply(e,t,n){let[r]=n;return zr(r.node)?Kr(r):Reflect.apply(e,t,n)}}));let d={features:t,getVisitorKeys:n,embed:l,massageAstNode:c,print:u,...o};return ni.set(e,d),d}var ii=Object.fromEntries([`clean`,`embed`,`print`].map(e=>[e,!1]));function ai(e){return{...ii,...e}}function oi(e){return{experimental_avoidAstMutation:!1,...e,experimental_frontMatterSupport:ai(e?.experimental_frontMatterSupport)}}var si={astFormat:`estree`,printer:{},originalText:void 0,locStart:null,locEnd:null,getVisitorKeys:null};async function ci(e,t={}){let n={...e};if(!n.parser){if(n.filepath){if(n.parser=Pn(n,{physicalFile:n.filepath}),!n.parser)throw new mn(`No parser could be inferred for file "${n.filepath}".`)}else throw new mn(`No parser and no file path given, couldn't infer a parser.`)}let r=gn({plugins:e.plugins,showDeprecated:!0}).options,i={...si,...Object.fromEntries(r.filter(e=>e.default!==void 0).map(e=>[e.name,e.default]))},a=Zr(n.plugins,n.parser),o=await ei(a,n.parser);n.astFormat=o.astFormat,n.locEnd=o.locEnd,n.locStart=o.locStart;let s=a.printers?.[o.astFormat]?a:Qr(n.plugins,o.astFormat),c=await ti(s,o.astFormat);n.printer=c,n.getVisitorKeys=c.getVisitorKeys;let l=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,e])=>e!==void 0)):{},u={...i,...l};for(let[e,t]of Object.entries(u))(n[e]===null||n[e]===void 0)&&(n[e]=t);return n.parser===`json`&&(n.trailingComma=`none`),Nr(n,r,{passThrough:Object.keys(si),...t})}var li=ci;l(u(),1);var ui=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,di=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`;RegExp(`[`+ui+`]`),RegExp(`[`+ui+di+`]`),ui=di=null;var fi={keyword:/* @__PURE__ */ `break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete`.split(`.`),strict:[`implements`,`interface`,`let`,`package`,`private`,`protected`,`public`,`static`,`yield`],strictBind:[`eval`,`arguments`]};new Set(fi.keyword),new Set(fi.strict),new Set(fi.strictBind);var pi=(e,t)=>n=>e(t(n));function mi(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.gray,invalid:pi(pi(e.white,e.bgRed),e.bold),gutter:e.gray,marker:pi(e.red,e.bold),message:pi(e.red,e.bold),reset:e.reset}}mi(Ln(!0)),mi(Ln(!1));function hi(){return new Proxy({},{get:()=>e=>e})}var gi=/\r\n|[\n\r\u2028\u2029]/;function _i(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:a=2,linesBelow:o=3}=n||{},s=r.line,c=r.column,l=i.line,u=i.column,d=Math.max(s-(a+1),0),f=Math.min(t.length,l+o);s===-1&&(d=0),l===-1&&(f=t.length);let p=l-s,m={};if(p)for(let e=0;e<=p;e++){let n=e+s;m[n]=c?e===0?[c,t[n-1].length-c+1]:e===p?[0,u]:[0,t[n-e].length]:!0}else m[s]=c===u?!c||[c,0]:[c,u-c];return{start:d,end:f,markerLines:m}}function vi(e,t,n={}){let r=hi(!1),{start:i,end:a,markerLines:o}=_i(t,e.split(gi),n),s=t.start&&typeof t.start.column==`number`,c=String(a).length,l=e.split(gi,a).slice(i,a).map((e,t)=>{let a=i+1+t,s=` ${` ${a}`.slice(-c)} |`,l=o[a],u=!o[a+1];if(l){let t=``;if(Array.isArray(l)){let i=e.slice(0,Math.max(l[0]-1,0)).replace(/[^\t]/g,` `),a=l[1]||1;t=[`
20
+ `,r.gutter(s.replace(/\d/g,` `)),` `,i,r.marker(`^`).repeat(a)].join(``),u&&n.message&&(t+=` `+r.message(n.message))}return[r.marker(`>`),r.gutter(s),e.length>0?` ${e}`:``,t].join(``)}return` ${r.gutter(s)}${e.length>0?` ${e}`:``}`}).join(`
21
+ `);return n.message&&!s&&(l=`${` `.repeat(c+1)}${n.message}
22
+ ${l}`),l}async function yi(e,t){let n=await $r(t),r=n.preprocess?await n.preprocess(e,t):e;t.originalText=r;let i;try{i=await n.parse(r,t,t)}catch(t){bi(t,e)}return{text:r,ast:i}}function bi(e,t){let{loc:n}=e;if(n){let r=vi(t,n,{highlightCode:!0});throw e.message+=`
23
+ `+r,e.codeFrame=r,e}throw e}var xi=yi;async function Si(e,t,n,r,i){if(n.embeddedLanguageFormatting!==`auto`)return;let{printer:a}=n,{embed:o}=a;if(!o)return;if(o.length>2)throw Error(`printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed`);let{hasPrettierIgnore:s}=a,{getVisitorKeys:c}=o,l=[];f();let u=e.stack;for(let{print:r,node:a,pathStack:o}of l)try{e.stack=o;let s=await r(d,t,e,n);s&&i.set(a,s)}catch(e){if(globalThis.PRETTIER_DEBUG)throw e}e.stack=u;function d(e,t){return Ci(e,t,n,r)}function f(){let{node:t}=e;if(typeof t!=`object`||!t||s?.(e))return;for(let n of c(t))Array.isArray(t[n])?e.each(f,n):e.call(f,n);let r=o(e,n);if(r){if(typeof r==`function`){l.push({print:r,node:t,pathStack:[...e.stack]});return}i.set(t,r)}}}async function Ci(e,t,n,r){let i=await li({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:a}=await xi(e,i);return Te(await r(a,i))}function wi(e,t,n,r){let{originalText:i,[Symbol.for(`comments`)]:a,locStart:o,locEnd:s,[Symbol.for(`printedComments`)]:c}=t,{node:l}=e,u=o(l),d=s(l);for(let e of a)o(e)>=u&&s(e)<=d&&c.add(e);let{printPrettierIgnored:f}=t.printer;return f?f(e,t,n,r):i.slice(u,d)}var Ti=wi;async function Ei(e,t){({ast:e}=await Oi(e,t));let n=/* @__PURE__ */ new Map,r=new Tt(e),i=fn(t),a=/* @__PURE__ */ new Map;await Si(r,s,t,Ei,a);let o=await Di(r,t,s,void 0,a);if(dn(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[G,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,G]}return o;function s(e,t){return e===void 0||e===r?c(t):Array.isArray(e)?r.call(()=>c(t),...e):r.call(()=>c(t),e)}function c(e){i(r);let o=r.node;if(o==null)return``;let c=Dt(o)&&e===void 0;if(c&&n.has(o))return n.get(o);let l=Di(r,t,s,e,a);return c&&n.set(o,l),l}}function Di(e,t,n,r,i){let{node:a}=e,{printer:o}=t,s;switch(s=o.hasPrettierIgnore?.(e)?Ti(e,t,n,r):i.has(a)?i.get(a):o.print(e,t,n,r),a){case t.cursorNode:s=je(s,e=>[G,e,G]);break;case t.nodeBeforeCursor:s=je(s,e=>[e,G]);break;case t.nodeAfterCursor:s=je(s,e=>[G,e])}return o.printComment&&!o.willPrintOwnComments?.(e,t)&&(s=un(e,s,t)),s}async function Oi(e,t){let n=e.comments??[];t[Symbol.for(`comments`)]=n,t[Symbol.for(`printedComments`)]=/* @__PURE__ */ new Set,Zt(e,t);let{printer:{preprocess:r}}=t;return e=r?await r(e,t):e,{ast:e,comments:n}}function ki(e,t){let{cursorOffset:n,locStart:r,locEnd:i,getVisitorKeys:a}=t,o=e=>r(e)<=n&&i(e)>=n,s=e,c=[e];for(let t of zt(e,{getVisitorKeys:a,filter:o}))c.push(t),s=t;if(Bt(s,{getVisitorKeys:a}))return{cursorNode:s};let l,u,d=-1,f=1/0;for(;c.length>0&&(l===void 0||u===void 0);){s=c.pop();let e=l!==void 0,t=u!==void 0;for(let o of Rt(s,{getVisitorKeys:a})){if(!e){let e=i(o);e<=n&&e>d&&(l=o,d=e)}if(!t){let e=r(o);e>=n&&e<f&&(u=o,f=e)}}}return{nodeBeforeCursor:l,nodeAfterCursor:u}}var Ai=ki;function ji(e,t){let{printer:n}=t,r=n.massageAstNode;if(!r)return e;let{getVisitorKeys:i}=n,{ignoredProperties:a}=r;return o(e);function o(e,t){if(!Dt(e))return e;if(Array.isArray(e))return e.map(e=>o(e,t)).filter(Boolean);let n={},s=new Set(i(e));for(let t in e)!Object.prototype.hasOwnProperty.call(e,t)||a?.has(t)||(n[t]=s.has(t)?o(e[t],e):e[t]);let c=r(e,n,t);if(c!==null)return c??n}}var Mi=ji,Ni=Array.prototype.findLastIndex??function(e){for(let t=this.length-1;t>=0;t--){let n=this[t];if(e(n,t,this))return t}return-1},Pi=f(`findLastIndex`,function(){if(Array.isArray(this))return Ni}),Fi=({parser:e})=>e===`json`||e===`json5`||e===`jsonc`||e===`json-stringify`;function Ii(e,t){return t=new Set(t),e.find(e=>Vi.has(e.type)&&t.has(e))}function Li(e){let t=Pi(0,e,e=>e.type!==`Program`&&e.type!==`File`);return t===-1?e:e.slice(0,t+1)}function Ri(e,t,{locStart:n,locEnd:r}){let[i,...a]=e,[o,...s]=t;if(i===o)return[i,o];let c=n(i);for(let e of Li(s))if(n(e)>=c)o=e;else break;let l=r(o);for(let e of Li(a)){if(r(e)<=l)i=e;else break;if(i===o)break}return[i,o]}function zi(e,t,n,r,i=[],a){let{locStart:o,locEnd:s}=n,c=o(e),l=s(e);if(t>l||t<c||a===`rangeEnd`&&t===c||a===`rangeStart`&&t===l)return;let u=[e,...i],d=Ht(e,u,{cache:Jt,locStart:o,locEnd:s,getVisitorKeys:n.getVisitorKeys,filter:n.printer.canAttachComment,getChildren:n.printer.getCommentChildNodes});for(let e of d){let i=zi(e,t,n,r,u,a);if(i)return i}if(r(e,i[0]))return u}function Bi(e,t){return t!==`DeclareExportDeclaration`&&e!==`TypeParameterDeclaration`&&(e===`Directive`||e===`TypeAlias`||e===`TSExportAssignment`||e.startsWith(`Declare`)||e.startsWith(`TSDeclare`)||e.endsWith(`Statement`)||e.endsWith(`Declaration`))}var Vi=/* @__PURE__ */ new Set([`JsonRoot`,`ObjectExpression`,`ArrayExpression`,`StringLiteral`,`NumericLiteral`,`BooleanLiteral`,`NullLiteral`,`UnaryExpression`,`TemplateLiteral`]),Hi=/* @__PURE__ */ new Set([`OperationDefinition`,`FragmentDefinition`,`VariableDefinition`,`TypeExtensionDefinition`,`ObjectTypeDefinition`,`FieldDefinition`,`DirectiveDefinition`,`EnumTypeDefinition`,`EnumValueDefinition`,`InputValueDefinition`,`InputObjectTypeDefinition`,`SchemaDefinition`,`OperationTypeDefinition`,`InterfaceTypeDefinition`,`UnionTypeDefinition`,`ScalarTypeDefinition`]);function Ui(e,t,n){if(!t)return!1;switch(e.parser){case`flow`:case`hermes`:case`babel`:case`babel-flow`:case`babel-ts`:case`typescript`:case`acorn`:case`espree`:case`meriyah`:case`oxc`:case`oxc-ts`:case`__babel_estree`:return Bi(t.type,n?.type);case`json`:case`json5`:case`jsonc`:case`json-stringify`:return Vi.has(t.type);case`graphql`:return Hi.has(t.kind);case`vue`:return t.tag!==`root`}return!1}function Wi(e,t,n){let{rangeStart:r,rangeEnd:i,locStart:a,locEnd:o}=t,s=e.slice(r,i).search(/\S/u),c=s===-1;if(!c)for(r+=s;i>r&&!/\S/u.test(e[i-1]);--i);let l=zi(n,r,t,(e,n)=>Ui(t,e,n),[],`rangeStart`);if(!l)return;let u=c?l:zi(n,i,t,e=>Ui(t,e),[],`rangeEnd`);if(!u)return;let d,f;if(Fi(t)){let e=Ii(l,u);d=e,f=e}else[d,f]=Ri(l,u,t);return[Math.min(a(d),a(f)),Math.max(o(d),o(f))]}var Gi=``,Ki=Symbol(`cursor`);async function qi(e,t,n=0){if(!e||e.trim().length===0)return{formatted:``,cursorOffset:-1,comments:[]};let{ast:r,text:i}=await xi(e,t);t.cursorOffset>=0&&(t={...t,...Ai(r,t)});let a=await Ei(r,t,n);n>0&&(a=Be([K,a],n,t.tabWidth));let o=St(a,t);if(n>0){let e=o.formatted.trim();o.cursorNodeStart!==void 0&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+w(t.endOfLine)}let s=t[Symbol.for(`comments`)];if(t.cursorOffset>=0){let e,n,r,a;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText){if(r=o.cursorNodeStart,a=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw Error(`Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor`);e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}}else e=0,n=i,r=0,a=o.formatted;let c=t.cursorOffset-e;if(n===a)return{formatted:o.formatted,cursorOffset:r+c,comments:s};let l=n.split(``);l.splice(c,0,Ki);let u=_(l,a.split(``)),d=r;for(let e of u)if(e.removed){if(e.value.includes(Ki))break}else d+=e.count;return{formatted:o.formatted,cursorOffset:d,comments:s}}return{formatted:o.formatted,cursorOffset:-1,comments:s}}async function Ji(e,t){let{ast:n,text:r}=await xi(e,t),[i,a]=Wi(r,t,n)??[0,0],o=r.slice(i,a),s=Math.min(i,r.lastIndexOf(`
24
+ `,i)+1),c=r.slice(s,i).match(/^\s*/u)[0],l=wt(c,t.tabWidth),u=await qi(o,{...t,rangeStart:0,rangeEnd:1/0,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=a?t.cursorOffset-i:-1,endOfLine:`lf`},l),d=u.formatted.trimEnd(),{cursorOffset:f}=t;f>a?f+=d.length-o.length:u.cursorOffset>=0&&(f=u.cursorOffset+i);let p=r.slice(0,i)+d+r.slice(a);if(t.endOfLine!==`lf`){let e=w(t.endOfLine);f>=0&&e===`\r
25
+ `&&(f+=re(p.slice(0,f),`
26
+ `)),p=m(0,p,`
27
+ `,e)}return{formatted:p,cursorOffset:f,comments:u.comments}}function Yi(e,t,n){return typeof t!=`number`||Number.isNaN(t)||t<0||t>e.length?n:t}function Xi(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=Yi(e,n,-1),r=Yi(e,r,0),i=Yi(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function Zi(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:a}=Xi(e,t),o=e.charAt(0)===Gi;if(o&&(e=e.slice(1),n--,r--,i--),a===`auto`&&(a=ne(e)),e.includes(`\r`)){let t=t=>re(e.slice(0,Math.max(t,0)),`\r
28
+ `);n-=t(n),r-=t(r),i-=t(i),e=ie(e)}return{hasBOM:o,text:e,options:Xi(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:a})}}async function Qi(e,t){let n=await $r(t);return!n.hasPragma||n.hasPragma(e)}async function $i(e,t){return(await $r(t)).hasIgnorePragma?.(e)}async function ea(e,t){let{hasBOM:n,text:r,options:i}=Zi(e,await li(t));if(i.rangeStart>=i.rangeEnd&&r!==``||i.requirePragma&&!await Qi(r,i)||i.checkIgnorePragma&&await $i(r,i))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let a;return i.rangeStart>0||i.rangeEnd<r.length?a=await Ji(r,i):(!i.requirePragma&&i.insertPragma&&i.printer.insertPragma&&!await Qi(r,i)&&(r=i.printer.insertPragma(r)),a=await qi(r,i)),n&&(a.formatted=Gi+a.formatted,a.cursorOffset>=0&&a.cursorOffset++),a}async function ta(e,t,n){let{text:r,options:i}=Zi(e,await li(t)),a=await xi(r,i);return n&&(n.preprocessForPrint&&(a.ast=await Oi(a.ast,i)),n.massage&&(a.ast=Mi(a.ast,i))),a}async function na(e,t){return t=await li(t),St(await Ei(e,t),t)}async function ra(e,t){let{formatted:n}=await ea(rt(e),{...t,parser:`__js_expression`});return n}async function ia(e,t){t=await li(t);let{ast:n}=await xi(e,t);return t.cursorOffset>=0&&(t={...t,...Ai(n,t)}),Ei(n,t)}async function aa(e,t){return St(e,await li(t))}var oa={};s(oa,{builders:()=>sa,printer:()=>ca,utils:()=>la});var sa={join:qe,line:Ye,softline:Xe,hardline:K,literalline:$e,group:Ue,conditionalGroup:We,fill:He,lineSuffix:et,lineSuffixBoundary:tt,cursor:G,breakParent:Ve,ifBreak:Ge,trim:nt,indent:Fe,indentIfBreak:Ke,align:Ie,addAlignmentToDoc:Be,markAsRoot:Re,dedentToRoot:Le,dedent:ze,hardlineWithoutBreakParent:Ze,literallineWithoutBreakParent:Qe,label:Je,concat:e=>e},ca={printDocToString:St},la={willBreak:ve,traverseDoc:me,findInDoc:ge,mapDoc:he,removeLines:Se,stripTrailingHardline:Te,replaceEndOfLine:Oe,canBreak:Ae},ua=`3.8.3`,da={};s(da,{addDanglingComment:()=>Kt,addLeadingComment:()=>Gt,addTrailingComment:()=>qt,getAlignmentSize:()=>wt,getIndentSize:()=>xa,getMaxContinuousCount:()=>wa,getNextNonSpaceNonCommentCharacter:()=>Ea,getNextNonSpaceNonCommentCharacterIndex:()=>Ra,getPreferredQuote:()=>Ma,getStringWidth:()=>dt,hasNewline:()=>Z,hasNewlineInRange:()=>Pa,hasSpaces:()=>Ia,isNextLineEmpty:()=>Ua,isNextLineEmptyAfterIndex:()=>ya,isPreviousLineEmpty:()=>Ba,makeString:()=>Ha,skip:()=>Ot,skipEverythingButNewLine:()=>jt,skipInlineComment:()=>pa,skipNewline:()=>Pt,skipSpaces:()=>X,skipToLineEnd:()=>At,skipTrailingComment:()=>ha,skipWhitespace:()=>kt});function fa(e,t){if(t===!1)return!1;if(e.charAt(t)===`/`&&e.charAt(t+1)===`*`){for(let n=t+2;n<e.length;++n)if(e.charAt(n)===`*`&&e.charAt(n+1)===`/`)return n+2}return t}var pa=fa;function ma(e,t){return t===!1?!1:e.charAt(t)===`/`&&e.charAt(t+1)===`/`?jt(e,t):t}var ha=ma;function ga(e,t){let n=null,r=t;for(;r!==n;)n=r,r=X(e,r),r=pa(e,r),r=ha(e,r),r=Pt(e,r);return r}var _a=ga;function va(e,t){let n=null,r=t;for(;r!==n;)n=r,r=At(e,r),r=pa(e,r),r=X(e,r);return r=ha(e,r),r=Pt(e,r),r!==!1&&Z(e,r)}var ya=va;function ba(e,t){let n=e.lastIndexOf(`
29
+ `);return n===-1?0:wt(e.slice(n+1).match(/^[\t ]*/u)[0],t)}var xa=ba;function Sa(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Ca(e,t){let n=e.matchAll(RegExp(`(?:${Sa(t)})+`,`gu`));return n.reduce||(n=[...n]),n.reduce((e,[t])=>Math.max(e,t.length),0)/t.length}var wa=Ca;function Ta(e,t){let n=_a(e,t);return n===!1?``:e.charAt(n)}var Ea=Ta,Da=Object.freeze({character:`'`,codePoint:39}),Oa=Object.freeze({character:`"`,codePoint:34}),ka=Object.freeze({preferred:Da,alternate:Oa}),Aa=Object.freeze({preferred:Oa,alternate:Da});function ja(e,t){let{preferred:n,alternate:r}=t===!0||t===`'`?ka:Aa,{length:i}=e,a=0,o=0;for(let t=0;t<i;t++){let i=e.charCodeAt(t);i===n.codePoint?a++:i===r.codePoint&&o++}return(a>o?r:n).character}var Ma=ja;function Na(e,t,n){for(let r=t;r<n;++r)if(e.charAt(r)===`
30
+ `)return!0;return!1}var Pa=Na;function Fa(e,t,n={}){return X(e,n.backwards?t-1:t,n)!==t}var Ia=Fa;function La(e,t,n){return _a(e,n(t))}function Ra(e,t){return arguments.length===2||typeof t==`number`?_a(e,t):La(...arguments)}function za(e,t,n){return an(e,n(t))}function Ba(e,t){return arguments.length===2||typeof t==`number`?an(e,t):za(...arguments)}function Va(e,t,n){return ya(e,n(t))}function Ha(e,t,n){let r=t===`"`?`'`:`"`;return t+m(0,e,/\\(.)|(["'])/gsu,(e,i,a)=>i===r?i:a===t?`\\`+a:a||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:`\\`+i))+t}function Ua(e,t){return arguments.length===2||typeof t==`number`?ya(e,t):Va(...arguments)}function Wa(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},e(...n)}}var Ga=Wa(ea);async function Ka(e,t){let{formatted:n}=await Ga(e,{...t,cursorOffset:-1});return n}async function qa(e,t){return await Ka(e,t)===e}var Ja=Wa(gn,0),Ya={parse:Wa(ta),formatAST:Wa(na),formatDoc:Wa(ra),printToDoc:Wa(ia),printDocToString:Wa(aa)};export{Ya as __debug,qa as check,d as default,oa as doc,Ka as format,Ga as formatWithCursor,Ja as getSupportInfo,da as util,ua as version};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{d as e,f as t,g as n,h as r,l as i,m as a,n as o,t as s,u as c,v as l}from"./limit-io-DqzENcBM.mjs";var u=class e extends l{constructor(e){super(),this.typeUrl=``,this.value=/* @__PURE__ */ new Uint8Array,r.util.initPartial(e,this)}toJson(e){if(this.typeUrl===``)return{};let t=this.typeUrlToName(this.typeUrl),n=(e?.typeRegistry)?.findMessage(t);if(!n)throw Error(`cannot encode message google.protobuf.Any to JSON: "${this.typeUrl}" is not in the type registry`);let r=n.fromBinary(this.value).toJson(e);return(t.startsWith(`google.protobuf.`)||r===null||Array.isArray(r)||typeof r!=`object`)&&(r={value:r}),r[`@type`]=this.typeUrl,r}fromJson(e,t){if(e===null||Array.isArray(e)||typeof e!=`object`)throw Error(`cannot decode message google.protobuf.Any from JSON: expected object but got ${e===null?`null`:Array.isArray(e)?`array`:typeof e}`);if(Object.keys(e).length==0)return this;let n=e[`@type`];if(typeof n!=`string`||n==``)throw Error(`cannot decode message google.protobuf.Any from JSON: "@type" is empty`);let r=this.typeUrlToName(n),i=(t?.typeRegistry)?.findMessage(r);if(!i)throw Error(`cannot decode message google.protobuf.Any from JSON: ${n} is not in the type registry`);let a;if(r.startsWith(`google.protobuf.`)&&Object.prototype.hasOwnProperty.call(e,`value`))a=i.fromJson(e.value,t);else{let n=Object.assign({},e);delete n[`@type`],a=i.fromJson(n,t)}return this.packFrom(a),this}packFrom(e){this.value=e.toBinary(),this.typeUrl=this.typeNameToUrl(e.getType().typeName)}unpackTo(e){return this.is(e.getType())?(e.fromBinary(this.value),!0):!1}unpack(e){if(this.typeUrl===``)return;let t=e.findMessage(this.typeUrlToName(this.typeUrl));if(t)return t.fromBinary(this.value)}is(e){if(this.typeUrl===``)return!1;let t=this.typeUrlToName(this.typeUrl),n=``;return n=typeof e==`string`?e:e.typeName,t===n}typeNameToUrl(e){return`type.googleapis.com/${e}`}typeUrlToName(e){if(!e.length)throw Error(`invalid type url: ${e}`);let t=e.lastIndexOf(`/`),n=t>=0?e.substring(t+1):e;if(!n.length)throw Error(`invalid type url: ${e}`);return n}static pack(t){let n=new e;return n.packFrom(t),n}static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return r.util.equals(e,t,n)}};u.runtime=r,u.typeName=`google.protobuf.Any`,u.fields=r.util.newFieldList(()=>[{no:1,name:`type_url`,kind:`scalar`,T:9},{no:2,name:`value`,kind:`scalar`,T:12}]);function ee(e){let t;return t=typeof e==`object`&&`getType`in e?e.toBinary():typeof e==`string`?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e),n.enc(t).replace(/=+$/,``)}function te(e,r,a){try{let t=n.dec(e);return r?r.fromBinary(t,a):t}catch(e){throw i.from(e,t.DataLoss)}}function d(...e){let t=new Headers;for(let n of e)n.forEach((e,n)=>{t.append(n,e)});return t}function f(...e){let t=new AbortController,n=e.filter(e=>e!==void 0).concat(t.signal);for(let e of n){if(e.aborted){r.apply(e);break}e.addEventListener(`abort`,r)}function r(){t.signal.aborted||t.abort(m(this));for(let e of n)e.removeEventListener(`abort`,r)}return t}function p(e){let n=new AbortController,r=()=>{n.abort(new i(`the operation timed out`,t.DeadlineExceeded))},a;return e!==void 0&&(e<=0?r():a=setTimeout(r,e)),{signal:n.signal,cleanup:()=>clearTimeout(a)}}function m(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;let t=/* @__PURE__ */ Error(`This operation was aborted`);return t.name=`AbortError`,t}function ne(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}function h(e){let t=new Headers,n=new TextDecoder().decode(e).split(`\r
3
+ `);for(let e of n){if(e===``)continue;let n=e.indexOf(`:`);if(n>0){let r=e.substring(0,n).trim(),i=e.substring(n+1).trim();t.append(r,i)}}return t}function re(e){let t=[];return e.forEach((e,n)=>{t.push(`${n}: ${e}\r\n`)}),new TextEncoder().encode(t.join(``))}function ie(){return{serialize:re,parse:h}}const g=`Content-Type`,_=`Grpc-Encoding`,v=`Grpc-Accept-Encoding`,y=`Grpc-Timeout`,b=`Grpc-Status`,x=`Grpc-Status-Details-Bin`,S=`User-Agent`,C=/^application\/grpc-web(-text)?(?:\+(?:(json)(?:; ?charset=utf-?8)?|proto))?$/i,ae=`application/grpc-web+proto`,w=`application/grpc-web+json`;function oe(e){let t=e?.match(C);if(t)return{text:!!t[1],binary:!t[2]}}var T=class e extends l{constructor(e){super(),this.code=0,this.message=``,this.details=[],r.util.initPartial(e,this)}static fromBinary(t,n){return new e().fromBinary(t,n)}static fromJson(t,n){return new e().fromJson(t,n)}static fromJsonString(t,n){return new e().fromJsonString(t,n)}static equals(t,n){return r.util.equals(e,t,n)}};T.runtime=r,T.typeName=`google.rpc.Status`,T.fields=r.util.newFieldList(()=>[{no:1,name:`code`,kind:`scalar`,T:5},{no:2,name:`message`,kind:`scalar`,T:9},{no:3,name:`details`,kind:`message`,T:u,repeated:!0}]);function se(e,t){if(t){if(e.set(b,t.code.toString(10)),e.set(`Grpc-Message`,encodeURIComponent(t.rawMessage)),t.details.length>0){let n=new T({code:t.code,message:t.rawMessage,details:t.details.map(e=>`getType`in e?u.pack(e):new u({typeUrl:`type.googleapis.com/${e.type}`,value:e.value}))});e.set(x,ee(n))}}else e.set(b,`0`);return e}function E(e){let n=e.get(x);if(n!=null){let t=te(n,T);if(t.code==0)return;let r=new i(t.message,t.code,e);return r.details=t.details.map(e=>({type:e.typeUrl.substring(e.typeUrl.lastIndexOf(`/`)+1),value:e.value})),r}let r=e.get(b);if(r!=null){if(r===`0`)return;let n=parseInt(r,10);return n in t?new i(decodeURIComponent(e.get(`Grpc-Message`)??``),n,e):new i(`invalid grpc-status: ${r}`,t.Internal,e)}}function ce(e,t,n){let r=typeof t==`string`?t:t.typeName,i=typeof n==`string`?n:n.name;return e.toString().replace(/\/?$/,`/${r}/${i}`)}function D(e,t){return t instanceof e?t:new e(t)}function O(e,t){function n(t){return t.done===!0?t:{done:t.done,value:D(e,t.value)}}return{[Symbol.asyncIterator](){let e=t[Symbol.asyncIterator](),r={next:()=>e.next().then(n)};return e.throw!==void 0&&(r.throw=t=>e.throw(t).then(n)),e.return!==void 0&&(r.return=t=>e.return(t).then(n)),r}}}function k(e,t){return t?.concat().reverse().reduce((e,t)=>t(e),e)??e}function A(e){let t=Object.assign({},e);return t.ignoreUnknownFields??=!0,t}function le(e,t,n,r){let i=j(M(e.I,t),r),a=j(N(e.I,n),r),o=j(M(e.O,t),r),s=j(N(e.O,n),r);return{getI(e){return e?i:a},getO(e){return e?o:s}}}function ue(e,t,n,r){let i=t?M(e.I,r):N(e.I,n);return{parse:(t?M(e.O,r):N(e.O,n)).parse,serialize:i.serialize}}function j(e,t){return{serialize(n){let r=e.serialize(n);return o(t.writeMaxBytes,r.byteLength),r},parse(n){return s(t.readMaxBytes,n.byteLength,!0),e.parse(n)}}}function M(e,n){return{parse(r){try{return e.fromBinary(r,n)}catch(e){let n=e instanceof Error?e.message:String(e);throw new i(`parse binary: ${n}`,t.Internal)}},serialize(e){try{return e.toBinary(n)}catch(e){let n=e instanceof Error?e.message:String(e);throw new i(`serialize binary: ${n}`,t.Internal)}}}}function N(e,n){let r=n?.textEncoder??new TextEncoder,a=n?.textDecoder??new TextDecoder,o=A(n);return{parse(n){try{let t=a.decode(n);return e.fromJsonString(t,o)}catch(e){throw i.from(e,t.InvalidArgument)}},serialize(e){try{let t=e.toJsonString(o);return r.encode(t)}catch(e){throw i.from(e,t.Internal)}}}}const de=/^application\/(connect\+)?(?:(json)(?:; ?charset=utf-?8)?|(proto))$/i,fe=/^application\/(?:json(?:; ?charset=utf-?8)?|proto)$/i,pe=/^application\/connect\+?(?:json(?:; ?charset=utf-?8)?|proto)$/i,P=`application/proto`,F=`application/json`,I=`application/connect+proto`,L=`application/connect+json`;function R(e){let t=e?.match(de);if(t)return{stream:!!t[1],binary:!!t[3]}}function me(e){switch(e){case`proto`:return{stream:!1,binary:!0};case`json`:return{stream:!1,binary:!1};default:return}}var he=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function z(e,t,r){if(t&&new Headers(t).forEach((e,t)=>r.metadata.append(t,e)),typeof e!=`object`||!e||Array.isArray(e))throw r;let a=r.code;`code`in e&&typeof e.code==`string`&&(a=c(e.code)??a);let o=e.message;if(o!=null&&typeof o!=`string`)throw r;let s=new i(o??``,a,t);if(`details`in e&&Array.isArray(e.details))for(let t of e.details){if(typeof t!=`object`||!t||Array.isArray(t)||typeof t.type!=`string`||typeof t.value!=`string`)throw r;try{s.details.push({type:t.type,value:n.dec(t.value),debug:t.debug})}catch{throw r}}return s}function ge(e,t,n){let r;try{r=JSON.parse(new TextDecoder().decode(e))}catch{throw n}return z(r,t,n)}function B(t,r){let i={code:e(t.code)};return t.rawMessage.length>0&&(i.message=t.rawMessage),t.details.length>0&&(i.details=t.details.map(e=>{if(`getType`in e){let t={type:e.getType().typeName,value:e.toBinary()};try{t.debug=e.toJson(r)}catch{}return t}return e}).map(e=>{var{value:t}=e,r=he(e,[`value`]);return Object.assign(Object.assign({},r),{value:n.enc(t).replace(/=+$/,``)})})),i}function _e(e,n){let r=new TextEncoder;try{let t=B(e,n),i=JSON.stringify(t);return r.encode(i)}catch(e){let n=e instanceof Error?e.message:String(e);throw new i(`failed to serialize Connect Error: ${n}`,t.Internal)}}function V(e){let n=new i(`invalid end stream`,t.Unknown),r;try{r=JSON.parse(typeof e==`string`?e:new TextDecoder().decode(e))}catch{throw n}if(typeof r!=`object`||!r||Array.isArray(r))throw n;let a=new Headers;if(`metadata`in r){if(typeof r.metadata!=`object`||r.metadata==null||Array.isArray(r.metadata))throw n;for(let[e,t]of Object.entries(r.metadata)){if(!Array.isArray(t)||t.some(e=>typeof e!=`string`))throw n;for(let n of t)a.append(e,n)}}return{metadata:a,error:`error`in r&&r.error!=null?z(r.error,a,n):void 0}}function ve(e,t,n){let r={};t!==void 0&&(r.error=B(t,n),e=d(e,t.metadata));let i=!1,a={};return e.forEach((e,t)=>{i=!0,a[t]=[e]}),i&&(r.metadata=a),r}function ye(e){let n=new TextEncoder;return{serialize(r){try{let t=ve(r.metadata,r.error,e),i=JSON.stringify(t);return n.encode(i)}catch(e){let n=e instanceof Error?e.message:String(e);throw new i(`failed to serialize EndStreamResponse: ${n}`,t.Internal)}},parse(e){try{return V(e)}catch(e){let n=e instanceof Error?e.message:String(e);throw new i(`failed to parse EndStreamResponse: ${n}`,t.InvalidArgument)}}}}const H=`Content-Type`,U=`Content-Length`,W=`Content-Encoding`,G=`Connect-Content-Encoding`,K=`Accept-Encoding`,q=`Connect-Accept-Encoding`,J=`Connect-Timeout-Ms`,Y=`Connect-Protocol-Version`;function be(e){switch(e){case 400:return t.Internal;case 401:return t.Unauthenticated;case 403:return t.PermissionDenied;case 404:return t.Unimplemented;case 429:return t.Unavailable;case 502:return t.Unavailable;case 503:return t.Unavailable;case 504:return t.Unavailable;default:return t.Unknown}}function xe(e){switch(e){case t.Canceled:return 499;case t.Unknown:return 500;case t.InvalidArgument:return 400;case t.DeadlineExceeded:return 504;case t.NotFound:return 404;case t.AlreadyExists:return 409;case t.PermissionDenied:return 403;case t.ResourceExhausted:return 429;case t.FailedPrecondition:return 400;case t.Aborted:return 409;case t.OutOfRange:return 400;case t.Unimplemented:return 501;case t.Internal:return 500;case t.Unavailable:return 503;case t.DataLoss:return 500;case t.Unauthenticated:return 401;default:return 500}}const X=`connect`,Se=`encoding`,Ce=`compression`,we=`base64`,Te=`message`;function Ee(e){let t=new Headers,n=new Headers;return e.forEach((e,r)=>{r.toLowerCase().startsWith(`trailer-`)?n.append(r.substring(8),e):t.append(r,e)}),[t,n]}function De(e,t){let n=new Headers(e);return t.forEach((e,t)=>{n.append(`trailer-${t}`,e)}),n}function Oe(e){let n=e.get(Y);if(n===null)throw new i(`missing required header: set ${Y} to "1"`,t.InvalidArgument);if(n!==`1`)throw new i(`${Y} must be "1": got "${n}"`,t.InvalidArgument)}function ke(e){let n=e.get(X);if(n===null)throw new i(`missing required parameter: set ${X} to "v1"`,t.InvalidArgument);if(n!==`v1`)throw new i(`${X} must be "v1": got "${n}"`,t.InvalidArgument)}function Z(e,t,n,r,i){let o=new Headers(r??{});return n!==void 0&&o.set(J,`${n}`),o.set(H,e==a.Unary?t?P:F:t?I:L),o.set(Y,`1`),i&&!o.has(`User-Agent`)&&o.set(`User-Agent`,`connect-es/1.7.0`),o}function Ae(e,t,n,r,i,o,s){let c=Z(e,t,n,r,s);if(o!=null){let t=e==a.Unary?W:G;c.set(t,o.name)}if(i.length>0){let t=e==a.Unary?K:q;c.set(t,i.map(e=>e.name).join(`,`))}return c}function Q(e,n,r,o){let s=o.get(H),c=R(s);if(r!==200){let t=new i(`HTTP ${r}`,be(r),o);if(e==a.Unary&&c&&!c.binary)return{isUnaryError:!0,unaryError:t};throw t}let l={binary:n,stream:e!==a.Unary};if(c?.binary!==l.binary||c.stream!==l.stream)throw new i(`unsupported content type ${s}`,c===void 0?t.Unknown:t.Internal,o);return{isUnaryError:!1}}function je(e,n,r,o,s){let c,l=s.get(e==a.Unary?W:G);if(l!=null&&l.toLowerCase()!==`identity`&&(c=n.find(e=>e.name===l),!c))throw new i(`unsupported response encoding "${l}"`,t.Internal,s);return Object.assign({compression:c},Q(e,r,o,s))}function Me(e,t){return t?n.enc(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``):encodeURIComponent(new TextDecoder().decode(e))}function Ne(e,t,n){let r=`?connect=v1`,i=e.header.get(H);i?.indexOf(`application/`)===0&&(r+=`&encoding=`+encodeURIComponent(i.slice(12)));let a=e.header.get(W);a!==null&&a!==`identity`&&(r+=`&compression=`+encodeURIComponent(a),n=!0),n&&(r+=`&base64=1`),r+=`&message=`+Me(t,n);let o=e.url+r,s=new Headers(e.header);return[Y,H,U,W,K].forEach(e=>s.delete(e)),Object.assign(Object.assign({},e),{init:Object.assign(Object.assign({},e.init),{method:`GET`}),url:o,header:s})}function Pe(e){let t=k(e.next,e.interceptors),[n,r,i]=$(e);return t(Object.assign(Object.assign({},e.req),{message:D(e.req.method.I,e.req.message),signal:n})).then(e=>(i(),e),r)}function Fe(e){let t=k(e.next,e.interceptors),[n,r,i]=$(e),a=Object.assign(Object.assign({},e.req),{message:O(e.req.method.I,e.req.message),signal:n}),o=!1;return n.addEventListener(`abort`,function(){var t,n;let r=e.req.message[Symbol.asyncIterator]();o||(t=r.throw)==null||t.call(r,this.reason).catch(()=>{}),(n=r.return)==null||n.call(r).catch(()=>{})}),t(a).then(e=>Object.assign(Object.assign({},e),{message:{[Symbol.asyncIterator](){let t=e.message[Symbol.asyncIterator]();return{next(){return t.next().then(e=>(e.done==1&&(o=!0,i()),e),r)}}}}}),r)}function $(e){let{signal:t,cleanup:n}=p(e.timeoutMs),r=f(e.signal,t);return[r.signal,function(e){let a=i.from(t.aborted?m(t):e);return r.abort(a),n(),Promise.reject(a)},function(){n(),r.abort()}]}function Ie(e,n){let r=E(e);if(r)throw n.forEach((e,t)=>{r.metadata.append(t,e)}),r;if(!n.has(`Grpc-Status`)&&!e.has(`Grpc-Status`))throw new i(`protocol error: missing status`,t.Internal)}function Le(e,t,n,r){let i=new Headers(n??{});i.set(g,e?ae:w),i.set(`X-Grpc-Web`,`1`);let a=i.get(`User-Agent`)??i.get(`X-User-Agent`)??`connect-es/1.7.0`;return i.set(`X-User-Agent`,a),r&&i.set(S,a),t!==void 0&&i.set(y,`${t}m`),i}function Re(e,t,n,r,i,a){let o=Le(e,t,n,a);return i!=null&&o.set(_,i.name),r.length>0&&o.set(v,r.map(e=>e.name).join(`,`)),o}function ze(e){switch(e){case 400:return t.Internal;case 401:return t.Unauthenticated;case 403:return t.PermissionDenied;case 404:return t.Unimplemented;case 429:return t.Unavailable;case 502:return t.Unavailable;case 503:return t.Unavailable;case 504:return t.Unavailable;default:return t.Unknown}}function Be(e,t){if(e>=200&&e<300)return{foundStatus:t.has(b),headerError:E(t)};throw new i(decodeURIComponent(t.get(`Grpc-Message`)??`HTTP ${e}`),ze(e),t)}function Ve(e,n,r){let{foundStatus:a,headerError:o}=Be(n,r),s,c=r.get(_);if(c!==null&&c.toLowerCase()!==`identity`&&(s=e.find(e=>e.name===c),!s))throw new i(`unsupported response encoding "${c}"`,t.Internal,r);return{foundStatus:a,compression:s,headerError:o}}export{ae as $,ye as A,fe as B,H as C,K as D,J as E,L as F,A as G,me as H,I,O as J,k as K,pe as L,z as M,ge as N,U as O,_e as P,w as Q,F as R,xe as S,G as T,ue as U,R as V,le as W,E as X,ce as Y,se as Z,De as _,Re as a,b as at,Se as b,Pe as c,ie as ct,je as d,p as dt,C as et,Z as f,f as ft,Ee as g,ke as h,Le as i,_ as it,V as j,W as k,Ne as l,h as lt,Oe as m,d as mt,Ve as n,v as nt,Ie as o,y as ot,Ae as p,m as pt,D as q,ze as r,g as rt,Fe as s,S as st,Be as t,oe as tt,Q as u,ne as ut,we as v,q as w,Te as x,Ce as y,P as z};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import"./init-79Ivv_Iw.mjs";import"./index.mjs";export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pen.dev/cli",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "CLI tool for running the pen.dev AI agent manipulating .pen design files",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -8,22 +8,6 @@
8
8
  "pen": "dist/index.mjs",
9
9
  "pencil": "dist/index.mjs"
10
10
  },
11
- "scripts": {
12
- "build": "tsdown && npm run bundle:chmod && npm run bundle:mcp && npm run bundle:wasm && npm run bundle:pen-libs && npm run bundle:skill",
13
- "bundle:skill": "cp ../../SKILL.md ./SKILL.md && rm -rf dist/out/skills && mkdir -p dist/out/skills && cp -Rp ../../skills/pen-dev dist/out/skills/",
14
- "build:prod": "npm run build && node scripts/obfuscate.js",
15
- "bundle:mcp": "mkdir -p dist/out && cp ../../servers/mcp/mcp-server-* dist/out/ && chmod +x dist/out/mcp-server-*",
16
- "bundle:wasm": "node scripts/copy-pencil-wasm.mjs",
17
- "bundle:pen-libs": "mkdir -p dist/out/data && cp ../../lib/pencil-editor/data/*.lib.pen dist/out/data/",
18
- "bundle:chmod": "node scripts/chmod-dist-entry.mjs",
19
- "dev": "npm run build && cross-env NODE_ENV=development npm run start --",
20
- "start": "node dist/index.mjs",
21
- "lint": "biome check",
22
- "lint:ci": "biome ci",
23
- "test:package": "bash scripts/test-package-docker.sh",
24
- "test:interactive": "bash scripts/test-interactive.sh",
25
- "typecheck": "tsc --noEmit"
26
- },
27
11
  "keywords": [
28
12
  "pen.dev",
29
13
  "pencil",
@@ -35,8 +19,8 @@
35
19
  "author": "High Agency, Inc.",
36
20
  "license": "UNLICENSED",
37
21
  "dependencies": {
38
- "@anthropic-ai/claude-agent-sdk": "^0.3.284",
39
- "@earendil-works/pi-coding-agent": "^0.87.1",
22
+ "@anthropic-ai/claude-agent-sdk": "^0.3.293",
23
+ "@earendil-works/pi-coding-agent": "^1.0.1",
40
24
  "@inquirer/prompts": "^8.3.0",
41
25
  "@jitl/quickjs-wasmfile-release-asyncify": "^0.32.0",
42
26
  "@jitl/quickjs-wasmfile-release-sync": "^0.32.0",
@@ -48,21 +32,22 @@
48
32
  "svgo": "^4.0.0"
49
33
  },
50
34
  "devDependencies": {
51
- "@biomejs/biome": "^2.4.5",
52
- "@ha/agent": "file:../../lib/agent",
53
- "@ha/device-auth": "file:../../lib/device-auth",
54
- "@ha/ipc": "file:../../lib/ipc",
55
- "@ha/mcp": "file:../../lib/mcp",
56
- "@ha/pencil-editor": "file:../../lib/pencil-editor",
57
- "@ha/schema": "file:../../lib/schema",
58
- "@ha/shared": "file:../../lib/shared",
35
+ "@ha/agent": "0.1.0",
36
+ "@ha/device-auth": "0.1.0",
37
+ "@ha/headless": "0.1.0",
38
+ "@ha/ipc": "0.1.0",
39
+ "@ha/mcp": "0.1.0",
40
+ "@ha/mcp-server": "0.1.0",
41
+ "@ha/pencil-editor": "0.0.1",
42
+ "@ha/schema": "0.1.0",
43
+ "@ha/shared": "0.1.0",
59
44
  "@types/node": "^20.0.0",
60
45
  "@types/node-ipc": "^9.2.3",
61
46
  "@types/semver": "^7.7.1",
62
47
  "cross-env": "^10.1.0",
63
48
  "javascript-obfuscator": "^4.2.2",
64
- "tsdown": "^0.20.1",
65
- "typescript": "^5.0.0"
49
+ "tsdown": "^0.23.0",
50
+ "typescript": "7.0.2"
66
51
  },
67
52
  "engines": {
68
53
  "node": ">=22.19.0"
@@ -70,5 +55,21 @@
70
55
  "files": [
71
56
  "dist",
72
57
  "SKILL.md"
73
- ]
74
- }
58
+ ],
59
+ "scripts": {
60
+ "build": "tsdown && pnpm run bundle:chmod && pnpm run bundle:mcp && pnpm run bundle:wasm && pnpm run bundle:pen-libs && pnpm run bundle:skill",
61
+ "bundle:skill": "cp ../../SKILL.md ./SKILL.md && rm -rf dist/out/skills && mkdir -p dist/out/skills && cp -Rp ../../skills/pen-dev dist/out/skills/",
62
+ "build:prod": "pnpm run build && node scripts/obfuscate.js",
63
+ "bundle:mcp": "mkdir -p dist/out && cp ../../servers/mcp/mcp-server-* dist/out/ && chmod +x dist/out/mcp-server-*",
64
+ "bundle:wasm": "node scripts/copy-pencil-wasm.mjs",
65
+ "bundle:pen-libs": "mkdir -p dist/out/data && cp ../../lib/pencil-editor/data/*.lib.pen dist/out/data/",
66
+ "bundle:chmod": "node scripts/chmod-dist-entry.mjs",
67
+ "dev": "pnpm run build && cross-env NODE_ENV=development pnpm run start",
68
+ "start": "node dist/index.mjs",
69
+ "lint": "biome check",
70
+ "lint:ci": "biome ci",
71
+ "test:package": "bash scripts/test-package-docker.sh",
72
+ "test:interactive": "bash scripts/test-interactive.sh",
73
+ "typecheck": "tsc --noEmit"
74
+ }
75
+ }
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{D as e,E as t,O as n,T as r,b as i,x as a,y as o}from"./index.mjs";import"./init-C4ANyG-9.mjs";n.add(t),n.mixin(e,r),n.add(i),n.mixin(e,o),n.add(a);export{};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{promises as e,statSync as t}from"fs";import n from"path";import{createRequire as r}from"module";import i from"os";import{spawn as a}from"child_process";import o from"readline";async function s(t){if(t===void 0)return{cleanup:async()=>{}};if(!c(t))throw Error(`outputSchema must be a plain JSON object`);let r=await e.mkdtemp(n.join(i.tmpdir(),`codex-output-schema-`)),a=n.join(r,`schema.json`),o=async()=>{try{await e.rm(r,{recursive:!0,force:!0})}catch{}};try{return await e.writeFile(a,JSON.stringify(t),`utf8`),{schemaPath:a,cleanup:o}}catch(e){throw await o(),e}}function c(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var l=class{_exec;_options;_id;_threadOptions;get id(){return this._id}constructor(e,t,n,r=null){this._exec=e,this._options=t,this._id=r,this._threadOptions=n}async runStreamed(e,t={}){return{events:this.runStreamedInternal(e,t)}}async*runStreamedInternal(e,t={}){let{schemaPath:n,cleanup:r}=await s(t.outputSchema),i=this._threadOptions,{prompt:a,images:o}=u(e),c=this._exec.run({input:a,baseUrl:this._options.baseUrl,apiKey:this._options.apiKey,threadId:this._id,images:o,model:i?.model,threadSource:i?.threadSource,sandboxMode:i?.sandboxMode,workingDirectory:i?.workingDirectory,skipGitRepoCheck:i?.skipGitRepoCheck,outputSchemaFile:n,modelReasoningEffort:i?.modelReasoningEffort,signal:t.signal,networkAccessEnabled:i?.networkAccessEnabled,webSearchMode:i?.webSearchMode,webSearchEnabled:i?.webSearchEnabled,approvalPolicy:i?.approvalPolicy,additionalDirectories:i?.additionalDirectories});try{for await(let e of c){let t;try{t=JSON.parse(e)}catch(t){throw Error(`Failed to parse item: ${e}`,{cause:t})}t.type===`thread.started`?this._id=t.thread_id:t.type===`turn.completed`&&(t.usage.cache_write_input_tokens??=0),yield t}}finally{await r()}}async run(e,t={}){let n=this.runStreamedInternal(e,t),r=[],i=``,a=null,o=null;for await(let e of n)if(e.type===`item.completed`)e.item.type===`agent_message`&&(i=e.item.text),r.push(e.item);else if(e.type===`turn.completed`)a=e.usage;else if(e.type===`turn.failed`){o=e.error;break}if(o)throw Error(o.message);return{items:r,finalResponse:i,usage:a}}};function u(e){if(typeof e==`string`)return{prompt:e,images:[]};let t=[],n=[];for(let r of e)r.type===`text`?t.push(r.text):r.type===`local_image`&&n.push(r.path);return{prompt:t.join(`
3
-
4
- `),images:n}}var d=`CODEX_INTERNAL_ORIGINATOR_OVERRIDE`,f=`codex_sdk_ts`,p=`@openai/codex`,m={"x86_64-unknown-linux-musl":`@openai/codex-linux-x64`,"aarch64-unknown-linux-musl":`@openai/codex-linux-arm64`,"x86_64-apple-darwin":`@openai/codex-darwin-x64`,"aarch64-apple-darwin":`@openai/codex-darwin-arm64`,"x86_64-pc-windows-msvc":`@openai/codex-win32-x64`,"aarch64-pc-windows-msvc":`@openai/codex-win32-arm64`},h=r(import.meta.url),g=class{executablePath;pathDirs;envOverride;configOverrides;rawConfigOverrides;constructor(e=null,t,n,r){if(e)this.executablePath=e,this.pathDirs=[];else{let e=C();this.executablePath=e.executablePath,this.pathDirs=e.pathDirs}this.envOverride=t,this.configOverrides=n,this.rawConfigOverrides=r}async*run(e){let t=[`exec`,`--experimental-json`];if(this.configOverrides)for(let e of _(this.configOverrides))t.push(`--config`,e);if(this.rawConfigOverrides)for(let e of this.rawConfigOverrides)t.push(`--config`,e);if(e.baseUrl&&t.push(`--config`,`openai_base_url=${y(e.baseUrl,`openai_base_url`)}`),e.model&&t.push(`--model`,e.model),e.threadSource!==void 0&&!e.threadId&&t.push(`--thread-source`,e.threadSource),e.sandboxMode&&t.push(`--sandbox`,e.sandboxMode),e.workingDirectory&&t.push(`--cd`,e.workingDirectory),e.additionalDirectories?.length)for(let n of e.additionalDirectories)t.push(`--add-dir`,n);if(e.skipGitRepoCheck&&t.push(`--skip-git-repo-check`),e.outputSchemaFile&&t.push(`--output-schema`,e.outputSchemaFile),e.modelReasoningEffort&&t.push(`--config`,`model_reasoning_effort="${e.modelReasoningEffort}"`),e.networkAccessEnabled!==void 0&&t.push(`--config`,`sandbox_workspace_write.network_access=${e.networkAccessEnabled}`),e.webSearchMode?t.push(`--config`,`web_search="${e.webSearchMode}"`):e.webSearchEnabled===!0?t.push(`--config`,`web_search="live"`):e.webSearchEnabled===!1&&t.push(`--config`,`web_search="disabled"`),e.approvalPolicy&&t.push(`--config`,`approval_policy="${e.approvalPolicy}"`),e.threadId&&t.push(`resume`,e.threadId),e.images?.length)for(let n of e.images)t.push(`--image`,n);let n={};if(this.envOverride)Object.assign(n,this.envOverride);else for(let[e,t]of Object.entries(process.env))t!==void 0&&(n[e]=t);n[d]||(n[d]=f),e.apiKey&&(n.CODEX_API_KEY=e.apiKey),this.pathDirs.length>0&&E(n,this.pathDirs);let r=a(this.executablePath,t,{env:n,signal:e.signal}),i=null;if(r.once(`error`,e=>i=e),!r.stdin)throw r.kill(),Error(`Child process has no stdin`);if(r.stdin.write(e.input),r.stdin.end(),!r.stdout)throw r.kill(),Error(`Child process has no stdout`);let s=[];r.stderr&&r.stderr.on(`data`,e=>{s.push(e)});let c=new Promise(e=>{r.once(`exit`,(t,n)=>{e({code:t,signal:n})})}),l=o.createInterface({input:r.stdout,crlfDelay:1/0});try{for await(let e of l)yield e;if(i)throw i;let{code:e,signal:t}=await c;if(e!==0||t){let n=Buffer.concat(s),r=t?`signal ${t}`:`code ${e??1}`;throw Error(`Codex Exec exited with ${r}: ${n.toString(`utf8`)}`)}}finally{l.close(),r.removeAllListeners();try{r.killed||r.kill()}catch{}}}};function _(e){let t=[];return v(e,``,t),t}function v(e,t,n){if(!S(e))if(t){n.push(`${t}=${y(e,t)}`);return}else throw Error(`Codex config overrides must be a plain object`);let r=Object.entries(e);if(!(!t&&r.length===0)){if(t&&r.length===0){n.push(`${t}={}`);return}for(let[e,i]of r){if(!e)throw Error(`Codex config override keys must be non-empty strings`);if(i===void 0)continue;let r=t?`${t}.${e}`:e;S(i)?v(i,r,n):n.push(`${r}=${y(i,r)}`)}}}function y(e,t){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`){if(!Number.isFinite(e))throw Error(`Codex config override at ${t} must be a finite number`);return`${e}`}else if(typeof e==`boolean`)return e?`true`:`false`;else if(Array.isArray(e))return`[${e.map((e,n)=>y(e,`${t}[${n}]`)).join(`, `)}]`;else if(S(e)){let n=[];for(let[r,i]of Object.entries(e)){if(!r)throw Error(`Codex config override keys must be non-empty strings`);i!==void 0&&n.push(`${x(r)} = ${y(i,`${t}.${r}`)}`)}return`{${n.join(`, `)}}`}else if(e===null)throw Error(`Codex config override at ${t} cannot be null`);else{let n=typeof e;throw Error(`Unsupported Codex config override value at ${t}: ${n}`)}}var b=/^[A-Za-z0-9_-]+$/;function x(e){return b.test(e)?e:JSON.stringify(e)}function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C(){let{platform:e,arch:t}=process,i=null;switch(e){case`linux`:case`android`:switch(t){case`x64`:i=`x86_64-unknown-linux-musl`;break;case`arm64`:i=`aarch64-unknown-linux-musl`;break;default:break}break;case`darwin`:switch(t){case`x64`:i=`x86_64-apple-darwin`;break;case`arm64`:i=`aarch64-apple-darwin`;break;default:break}break;case`win32`:switch(t){case`x64`:i=`x86_64-pc-windows-msvc`;break;case`arm64`:i=`aarch64-pc-windows-msvc`;break;default:break}break;default:break}if(!i)throw Error(`Unsupported platform: ${e} (${t})`);let a=m[i];if(!a)throw Error(`Unsupported target triple: ${i}`);let o;try{let e=r(h.resolve(`${p}/package.json`)).resolve(`${a}/package.json`);o=n.join(n.dirname(e),`vendor`)}catch{throw Error(`Unable to locate Codex CLI binaries. Ensure ${p} is installed with optional dependencies.`)}let s=process.platform===`win32`?`codex.exe`:`codex`,c=w(o,i,s);if(!c)throw Error(`Unable to locate Codex CLI binaries for ${i}. Ensure ${p} is installed with optional dependencies.`);return c}function w(e,t,r){let i=n.join(e,t),a=n.join(i,`bin`,r);if(O(a)&&O(n.join(i,`codex-package.json`)))return{executablePath:a,pathDirs:T(n.join(i,`codex-path`))};let o=n.join(i,`codex`,r);return O(o)?{executablePath:o,pathDirs:T(n.join(i,`path`))}:null}function T(...e){return e.filter(k)}function E(e,t,r=process.platform){let i=D(e,r);if(r===`win32`)for(let t of Object.keys(e))t.toLowerCase()===`path`&&t!==i&&delete e[t];let a=(e[i]??``).split(n.delimiter).filter(e=>e.length>0&&!t.includes(e));e[i]=[...t,...a].join(n.delimiter)}function D(e,t){if(t!==`win32`)return`PATH`;let n=Object.keys(e).filter(e=>e.toLowerCase()===`path`);return n.includes(`Path`)?`Path`:n.at(-1)??`PATH`}function O(e){try{return t(e).isFile()}catch{return!1}}function k(e){try{return t(e).isDirectory()}catch{return!1}}var A=class{exec;options;constructor(e={}){let{codexPathOverride:t,env:n,config:r,configOverrides:i}=e;this.exec=new g(t,n,r,i),this.options=e}startThread(e={}){return new l(this.exec,this.options,e)}resumeThread(e,t={}){return new l(this.exec,this.options,t,e)}};export{A as Codex};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{K as e,M as t,N as n,W as r,X as i,_t as a,c as o,dt as s,f as c,ft as l,g as u,i as d,j as f,l as p,o as m,pt as h,s as g,st as _,t as v,u as y}from"./validate-response-DHB60j_7.mjs";import{$ as b,J as x,K as S,X as C,et as w,q as T,tt as E}from"./index.mjs";function D(){try{new Headers}catch{throw Error(`connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.`)}}var O=function(e){return this instanceof O?(this.v=e,this):new O(e)},k=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i={},s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof O?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function A(s){D();let l=s.useBinaryFormat??!1;return{async unary(t,d,f,m,g,_,v){let{serialize:b,parse:x}=r(d,l,s.jsonOptions,s.binaryOptions);return m=m===void 0?s.defaultTimeoutMs:m<=0?void 0:m,await o({interceptors:s.interceptors,signal:f,timeoutMs:m,req:{stream:!1,service:t,method:d,url:i(s.baseUrl,t,d),init:{method:`POST`,credentials:s.credentials??`same-origin`,redirect:`error`,mode:`cors`},header:c(d.kind,l,m,g,!1),contextValues:v??h(),message:_},next:async r=>{let i=s.useHttpGet===!0&&d.idempotency===w.NoSideEffects,o=null;i?r=p(r,b(r.message),l):o=b(r.message);let c=await(s.fetch??globalThis.fetch)(r.url,Object.assign(Object.assign({},r.init),{headers:r.header,signal:r.signal,body:o})),{isUnaryError:f,unaryError:m}=y(d.kind,l,c.status,c.headers);if(f)throw n(await c.json(),a(...u(c.headers)),m);let[h,g]=u(c.headers);return{stream:!1,service:t,method:d,header:h,message:l?x(new Uint8Array(await c.arrayBuffer())):d.O.fromJson(await c.json(),e(s.jsonOptions)),trailer:g}}})},async stream(e,n,a,o,u,d,p){let{serialize:m,parse:_}=r(n,l,s.jsonOptions,s.binaryOptions);function v(e,n,r,i){return k(this,arguments,function*(){let a=S(e).getReader(),o=!1;for(;;){let e=yield O(a.read());if(e.done)break;let{flags:i,data:s}=e.value;if((i&x)===x)throw new C(`protocol error: received unsupported compressed output`,b.Internal);if((i&f)===f){o=!0;let e=t(s);if(e.error){let t=e.error;throw r.forEach((e,n)=>{t.metadata.append(n,e)}),t}e.metadata.forEach((e,t)=>n.set(t,e));continue}yield yield O(_(s))}if(`throwIfAborted`in i&&i.throwIfAborted(),!o)throw`missing EndStreamResponse`})}async function w(e){if(n.kind!=E.ServerStreaming)throw`The fetch API does not support streaming request bodies`;let t=await e[Symbol.asyncIterator]().next();if(t.done==1)throw`missing request message`;return T(0,m(t.value))}return o=o===void 0?s.defaultTimeoutMs:o<=0?void 0:o,await g({interceptors:s.interceptors,timeoutMs:o,signal:a,req:{stream:!0,service:e,method:n,url:i(s.baseUrl,e,n),init:{method:`POST`,credentials:s.credentials??`same-origin`,redirect:`error`,mode:`cors`},header:c(n.kind,l,o,u,!1),contextValues:p??h(),message:d},next:async e=>{let t=await(s.fetch??globalThis.fetch)(e.url,Object.assign(Object.assign({},e.init),{headers:e.header,signal:e.signal,body:await w(e.message)}));if(y(n.kind,l,t.status,t.headers),t.body===null)throw`missing response body`;let r=new Headers;return Object.assign(Object.assign({},e),{header:t.headers,trailer:r,message:v(t.body,r,t.headers,e.signal)})}})}}}var j=function(e){return this instanceof j?(this.v=e,this):new j(e)},M=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i={},s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof j?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function N(e){D();let t=e.useBinaryFormat??!0;return{async unary(n,a,c,u,f,p,g){let{serialize:y,parse:w}=r(a,t,e.jsonOptions,e.binaryOptions);return u=u===void 0?e.defaultTimeoutMs:u<=0?void 0:u,await o({interceptors:e.interceptors,signal:c,timeoutMs:u,req:{stream:!1,service:n,method:a,url:i(e.baseUrl,n,a),init:{method:`POST`,credentials:e.credentials??`same-origin`,redirect:`error`,mode:`cors`},header:d(t,u,f,!1),contextValues:g??h(),message:p},next:async t=>{let r=await(e.fetch??globalThis.fetch)(t.url,Object.assign(Object.assign({},t.init),{headers:t.header,signal:t.signal,body:T(0,y(t.message))})),{headerError:i}=v(r.status,r.headers);if(!r.body)throw i===void 0?`missing response body`:i;let o=S(r.body).getReader(),c,u;for(;;){let e=await o.read();if(e.done)break;let{flags:t,data:n}=e.value;if((t&x)===x)throw new C(`protocol error: received unsupported compressed output`,b.Internal);if(t===s){if(c!==void 0)throw`extra trailer`;c=l(n);continue}if(u!==void 0)throw new C(`extra message`,b.Unimplemented);u=w(n)}if(c===void 0)throw i===void 0?new C(`missing trailer`,r.headers.has(_)?b.Unimplemented:b.Unknown):i;if(m(c,r.headers),u===void 0)throw new C(`missing message`,c.has(_)?b.Unimplemented:b.Unknown);return{stream:!1,service:n,method:a,header:r.headers,message:u,trailer:c}}})},async stream(n,a,o,c,u,f,p){let{serialize:_,parse:y}=r(a,t,e.jsonOptions,e.binaryOptions);function b(e,t,n,r,i){return M(this,arguments,function*(){let a=S(e).getReader();if(t){if(!(yield j(a.read())).done)throw`extra data for trailers-only`;return yield j(void 0)}let o=!1;for(;;){let e=yield j(a.read());if(e.done)break;let{flags:t,data:i}=e.value;if((t&s)===s){if(o)throw`extra trailer`;o=!0;let e=l(i);m(e,r),e.forEach((e,t)=>n.set(t,e));continue}if(o)throw`extra message`;yield yield j(y(i))}if(`throwIfAborted`in i&&i.throwIfAborted(),!o)throw`missing trailer`})}async function x(e){if(a.kind!=E.ServerStreaming)throw`The fetch API does not support streaming request bodies`;let t=await e[Symbol.asyncIterator]().next();if(t.done==1)throw`missing request message`;return T(0,_(t.value))}return c=c===void 0?e.defaultTimeoutMs:c<=0?void 0:c,g({interceptors:e.interceptors,signal:o,timeoutMs:c,req:{stream:!0,service:n,method:a,url:i(e.baseUrl,n,a),init:{method:`POST`,credentials:e.credentials??`same-origin`,redirect:`error`,mode:`cors`},header:d(t,c,u,!1),contextValues:p??h(),message:f},next:async t=>{let n=await(e.fetch??globalThis.fetch)(t.url,Object.assign(Object.assign({},t.init),{headers:t.header,signal:t.signal,body:await x(t.message)})),{foundStatus:r,headerError:i}=v(n.status,n.headers);if(i!=null)throw i;if(!n.body)throw`missing response body`;let a=new Headers;return Object.assign(Object.assign({},t),{header:n.headers,trailer:a,message:b(n.body,r,a,n.headers,t.signal)})}})}}}export{A as createConnectTransport,N as createGrpcWebTransport};