@fuel-ts/account 0.0.0-rc-2143-20240516132942 → 0.0.0-rc-2143-20240516153006

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.

Potentially problematic release.


This version of @fuel-ts/account might be problematic. Click here for more details.

@@ -9511,16 +9511,16 @@ spurious results.`);
9511
9511
  },
9512
9512
  // Document
9513
9513
  Document: {
9514
- leave: (node) => join3(node.definitions, "\n\n")
9514
+ leave: (node) => join2(node.definitions, "\n\n")
9515
9515
  },
9516
9516
  OperationDefinition: {
9517
9517
  leave(node) {
9518
- const varDefs = wrap2("(", join3(node.variableDefinitions, ", "), ")");
9519
- const prefix = join3(
9518
+ const varDefs = wrap2("(", join2(node.variableDefinitions, ", "), ")");
9519
+ const prefix = join2(
9520
9520
  [
9521
9521
  node.operation,
9522
- join3([node.name, varDefs]),
9523
- join3(node.directives, " ")
9522
+ join2([node.name, varDefs]),
9523
+ join2(node.directives, " ")
9524
9524
  ],
9525
9525
  " "
9526
9526
  );
@@ -9528,7 +9528,7 @@ spurious results.`);
9528
9528
  }
9529
9529
  },
9530
9530
  VariableDefinition: {
9531
- leave: ({ variable, type: type3, defaultValue, directives }) => variable + ": " + type3 + wrap2(" = ", defaultValue) + wrap2(" ", join3(directives, " "))
9531
+ leave: ({ variable, type: type3, defaultValue, directives }) => variable + ": " + type3 + wrap2(" = ", defaultValue) + wrap2(" ", join2(directives, " "))
9532
9532
  },
9533
9533
  SelectionSet: {
9534
9534
  leave: ({ selections }) => block2(selections)
@@ -9536,11 +9536,11 @@ spurious results.`);
9536
9536
  Field: {
9537
9537
  leave({ alias, name, arguments: args, directives, selectionSet }) {
9538
9538
  const prefix = wrap2("", alias, ": ") + name;
9539
- let argsLine = prefix + wrap2("(", join3(args, ", "), ")");
9539
+ let argsLine = prefix + wrap2("(", join2(args, ", "), ")");
9540
9540
  if (argsLine.length > MAX_LINE_LENGTH2) {
9541
- argsLine = prefix + wrap2("(\n", indent2(join3(args, "\n")), "\n)");
9541
+ argsLine = prefix + wrap2("(\n", indent2(join2(args, "\n")), "\n)");
9542
9542
  }
9543
- return join3([argsLine, join3(directives, " "), selectionSet], " ");
9543
+ return join2([argsLine, join2(directives, " "), selectionSet], " ");
9544
9544
  }
9545
9545
  },
9546
9546
  Argument: {
@@ -9548,14 +9548,14 @@ spurious results.`);
9548
9548
  },
9549
9549
  // Fragments
9550
9550
  FragmentSpread: {
9551
- leave: ({ name, directives }) => "..." + name + wrap2(" ", join3(directives, " "))
9551
+ leave: ({ name, directives }) => "..." + name + wrap2(" ", join2(directives, " "))
9552
9552
  },
9553
9553
  InlineFragment: {
9554
- leave: ({ typeCondition, directives, selectionSet }) => join3(
9554
+ leave: ({ typeCondition, directives, selectionSet }) => join2(
9555
9555
  [
9556
9556
  "...",
9557
9557
  wrap2("on ", typeCondition),
9558
- join3(directives, " "),
9558
+ join2(directives, " "),
9559
9559
  selectionSet
9560
9560
  ],
9561
9561
  " "
@@ -9564,7 +9564,7 @@ spurious results.`);
9564
9564
  FragmentDefinition: {
9565
9565
  leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet }) => (
9566
9566
  // or removed in the future.
9567
- `fragment ${name}${wrap2("(", join3(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap2("", join3(directives, " "), " ")}` + selectionSet
9567
+ `fragment ${name}${wrap2("(", join2(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap2("", join2(directives, " "), " ")}` + selectionSet
9568
9568
  )
9569
9569
  },
9570
9570
  // Value
@@ -9587,17 +9587,17 @@ spurious results.`);
9587
9587
  leave: ({ value }) => value
9588
9588
  },
9589
9589
  ListValue: {
9590
- leave: ({ values }) => "[" + join3(values, ", ") + "]"
9590
+ leave: ({ values }) => "[" + join2(values, ", ") + "]"
9591
9591
  },
9592
9592
  ObjectValue: {
9593
- leave: ({ fields }) => "{" + join3(fields, ", ") + "}"
9593
+ leave: ({ fields }) => "{" + join2(fields, ", ") + "}"
9594
9594
  },
9595
9595
  ObjectField: {
9596
9596
  leave: ({ name, value }) => name + ": " + value
9597
9597
  },
9598
9598
  // Directive
9599
9599
  Directive: {
9600
- leave: ({ name, arguments: args }) => "@" + name + wrap2("(", join3(args, ", "), ")")
9600
+ leave: ({ name, arguments: args }) => "@" + name + wrap2("(", join2(args, ", "), ")")
9601
9601
  },
9602
9602
  // Type
9603
9603
  NamedType: {
@@ -9611,122 +9611,122 @@ spurious results.`);
9611
9611
  },
9612
9612
  // Type System Definitions
9613
9613
  SchemaDefinition: {
9614
- leave: ({ description, directives, operationTypes }) => wrap2("", description, "\n") + join3(["schema", join3(directives, " "), block2(operationTypes)], " ")
9614
+ leave: ({ description, directives, operationTypes }) => wrap2("", description, "\n") + join2(["schema", join2(directives, " "), block2(operationTypes)], " ")
9615
9615
  },
9616
9616
  OperationTypeDefinition: {
9617
9617
  leave: ({ operation, type: type3 }) => operation + ": " + type3
9618
9618
  },
9619
9619
  ScalarTypeDefinition: {
9620
- leave: ({ description, name, directives }) => wrap2("", description, "\n") + join3(["scalar", name, join3(directives, " ")], " ")
9620
+ leave: ({ description, name, directives }) => wrap2("", description, "\n") + join2(["scalar", name, join2(directives, " ")], " ")
9621
9621
  },
9622
9622
  ObjectTypeDefinition: {
9623
- leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join3(
9623
+ leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join2(
9624
9624
  [
9625
9625
  "type",
9626
9626
  name,
9627
- wrap2("implements ", join3(interfaces, " & ")),
9628
- join3(directives, " "),
9627
+ wrap2("implements ", join2(interfaces, " & ")),
9628
+ join2(directives, " "),
9629
9629
  block2(fields)
9630
9630
  ],
9631
9631
  " "
9632
9632
  )
9633
9633
  },
9634
9634
  FieldDefinition: {
9635
- leave: ({ description, name, arguments: args, type: type3, directives }) => wrap2("", description, "\n") + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join3(args, "\n")), "\n)") : wrap2("(", join3(args, ", "), ")")) + ": " + type3 + wrap2(" ", join3(directives, " "))
9635
+ leave: ({ description, name, arguments: args, type: type3, directives }) => wrap2("", description, "\n") + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join2(args, "\n")), "\n)") : wrap2("(", join2(args, ", "), ")")) + ": " + type3 + wrap2(" ", join2(directives, " "))
9636
9636
  },
9637
9637
  InputValueDefinition: {
9638
- leave: ({ description, name, type: type3, defaultValue, directives }) => wrap2("", description, "\n") + join3(
9639
- [name + ": " + type3, wrap2("= ", defaultValue), join3(directives, " ")],
9638
+ leave: ({ description, name, type: type3, defaultValue, directives }) => wrap2("", description, "\n") + join2(
9639
+ [name + ": " + type3, wrap2("= ", defaultValue), join2(directives, " ")],
9640
9640
  " "
9641
9641
  )
9642
9642
  },
9643
9643
  InterfaceTypeDefinition: {
9644
- leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join3(
9644
+ leave: ({ description, name, interfaces, directives, fields }) => wrap2("", description, "\n") + join2(
9645
9645
  [
9646
9646
  "interface",
9647
9647
  name,
9648
- wrap2("implements ", join3(interfaces, " & ")),
9649
- join3(directives, " "),
9648
+ wrap2("implements ", join2(interfaces, " & ")),
9649
+ join2(directives, " "),
9650
9650
  block2(fields)
9651
9651
  ],
9652
9652
  " "
9653
9653
  )
9654
9654
  },
9655
9655
  UnionTypeDefinition: {
9656
- leave: ({ description, name, directives, types }) => wrap2("", description, "\n") + join3(
9657
- ["union", name, join3(directives, " "), wrap2("= ", join3(types, " | "))],
9656
+ leave: ({ description, name, directives, types }) => wrap2("", description, "\n") + join2(
9657
+ ["union", name, join2(directives, " "), wrap2("= ", join2(types, " | "))],
9658
9658
  " "
9659
9659
  )
9660
9660
  },
9661
9661
  EnumTypeDefinition: {
9662
- leave: ({ description, name, directives, values }) => wrap2("", description, "\n") + join3(["enum", name, join3(directives, " "), block2(values)], " ")
9662
+ leave: ({ description, name, directives, values }) => wrap2("", description, "\n") + join2(["enum", name, join2(directives, " "), block2(values)], " ")
9663
9663
  },
9664
9664
  EnumValueDefinition: {
9665
- leave: ({ description, name, directives }) => wrap2("", description, "\n") + join3([name, join3(directives, " ")], " ")
9665
+ leave: ({ description, name, directives }) => wrap2("", description, "\n") + join2([name, join2(directives, " ")], " ")
9666
9666
  },
9667
9667
  InputObjectTypeDefinition: {
9668
- leave: ({ description, name, directives, fields }) => wrap2("", description, "\n") + join3(["input", name, join3(directives, " "), block2(fields)], " ")
9668
+ leave: ({ description, name, directives, fields }) => wrap2("", description, "\n") + join2(["input", name, join2(directives, " "), block2(fields)], " ")
9669
9669
  },
9670
9670
  DirectiveDefinition: {
9671
- leave: ({ description, name, arguments: args, repeatable, locations }) => wrap2("", description, "\n") + "directive @" + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join3(args, "\n")), "\n)") : wrap2("(", join3(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join3(locations, " | ")
9671
+ leave: ({ description, name, arguments: args, repeatable, locations }) => wrap2("", description, "\n") + "directive @" + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join2(args, "\n")), "\n)") : wrap2("(", join2(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join2(locations, " | ")
9672
9672
  },
9673
9673
  SchemaExtension: {
9674
- leave: ({ directives, operationTypes }) => join3(
9675
- ["extend schema", join3(directives, " "), block2(operationTypes)],
9674
+ leave: ({ directives, operationTypes }) => join2(
9675
+ ["extend schema", join2(directives, " "), block2(operationTypes)],
9676
9676
  " "
9677
9677
  )
9678
9678
  },
9679
9679
  ScalarTypeExtension: {
9680
- leave: ({ name, directives }) => join3(["extend scalar", name, join3(directives, " ")], " ")
9680
+ leave: ({ name, directives }) => join2(["extend scalar", name, join2(directives, " ")], " ")
9681
9681
  },
9682
9682
  ObjectTypeExtension: {
9683
- leave: ({ name, interfaces, directives, fields }) => join3(
9683
+ leave: ({ name, interfaces, directives, fields }) => join2(
9684
9684
  [
9685
9685
  "extend type",
9686
9686
  name,
9687
- wrap2("implements ", join3(interfaces, " & ")),
9688
- join3(directives, " "),
9687
+ wrap2("implements ", join2(interfaces, " & ")),
9688
+ join2(directives, " "),
9689
9689
  block2(fields)
9690
9690
  ],
9691
9691
  " "
9692
9692
  )
9693
9693
  },
9694
9694
  InterfaceTypeExtension: {
9695
- leave: ({ name, interfaces, directives, fields }) => join3(
9695
+ leave: ({ name, interfaces, directives, fields }) => join2(
9696
9696
  [
9697
9697
  "extend interface",
9698
9698
  name,
9699
- wrap2("implements ", join3(interfaces, " & ")),
9700
- join3(directives, " "),
9699
+ wrap2("implements ", join2(interfaces, " & ")),
9700
+ join2(directives, " "),
9701
9701
  block2(fields)
9702
9702
  ],
9703
9703
  " "
9704
9704
  )
9705
9705
  },
9706
9706
  UnionTypeExtension: {
9707
- leave: ({ name, directives, types }) => join3(
9707
+ leave: ({ name, directives, types }) => join2(
9708
9708
  [
9709
9709
  "extend union",
9710
9710
  name,
9711
- join3(directives, " "),
9712
- wrap2("= ", join3(types, " | "))
9711
+ join2(directives, " "),
9712
+ wrap2("= ", join2(types, " | "))
9713
9713
  ],
9714
9714
  " "
9715
9715
  )
9716
9716
  },
9717
9717
  EnumTypeExtension: {
9718
- leave: ({ name, directives, values }) => join3(["extend enum", name, join3(directives, " "), block2(values)], " ")
9718
+ leave: ({ name, directives, values }) => join2(["extend enum", name, join2(directives, " "), block2(values)], " ")
9719
9719
  },
9720
9720
  InputObjectTypeExtension: {
9721
- leave: ({ name, directives, fields }) => join3(["extend input", name, join3(directives, " "), block2(fields)], " ")
9721
+ leave: ({ name, directives, fields }) => join2(["extend input", name, join2(directives, " "), block2(fields)], " ")
9722
9722
  }
9723
9723
  };
9724
- function join3(maybeArray, separator = "") {
9724
+ function join2(maybeArray, separator = "") {
9725
9725
  var _maybeArray$filter$jo;
9726
9726
  return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter((x) => x).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : "";
9727
9727
  }
9728
9728
  function block2(array) {
9729
- return wrap2("{\n", indent2(join3(array, "\n")), "\n}");
9729
+ return wrap2("{\n", indent2(join2(array, "\n")), "\n}");
9730
9730
  }
9731
9731
  function wrap2(start, maybeString, end = "") {
9732
9732
  return maybeString != null && maybeString !== "" ? start + maybeString + end : "";
@@ -28629,2339 +28629,6 @@ spurious results.`);
28629
28629
  }
28630
28630
  });
28631
28631
 
28632
- // ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
28633
- var require_color_name = __commonJS({
28634
- "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports, module) {
28635
- "use strict";
28636
- module.exports = {
28637
- "aliceblue": [240, 248, 255],
28638
- "antiquewhite": [250, 235, 215],
28639
- "aqua": [0, 255, 255],
28640
- "aquamarine": [127, 255, 212],
28641
- "azure": [240, 255, 255],
28642
- "beige": [245, 245, 220],
28643
- "bisque": [255, 228, 196],
28644
- "black": [0, 0, 0],
28645
- "blanchedalmond": [255, 235, 205],
28646
- "blue": [0, 0, 255],
28647
- "blueviolet": [138, 43, 226],
28648
- "brown": [165, 42, 42],
28649
- "burlywood": [222, 184, 135],
28650
- "cadetblue": [95, 158, 160],
28651
- "chartreuse": [127, 255, 0],
28652
- "chocolate": [210, 105, 30],
28653
- "coral": [255, 127, 80],
28654
- "cornflowerblue": [100, 149, 237],
28655
- "cornsilk": [255, 248, 220],
28656
- "crimson": [220, 20, 60],
28657
- "cyan": [0, 255, 255],
28658
- "darkblue": [0, 0, 139],
28659
- "darkcyan": [0, 139, 139],
28660
- "darkgoldenrod": [184, 134, 11],
28661
- "darkgray": [169, 169, 169],
28662
- "darkgreen": [0, 100, 0],
28663
- "darkgrey": [169, 169, 169],
28664
- "darkkhaki": [189, 183, 107],
28665
- "darkmagenta": [139, 0, 139],
28666
- "darkolivegreen": [85, 107, 47],
28667
- "darkorange": [255, 140, 0],
28668
- "darkorchid": [153, 50, 204],
28669
- "darkred": [139, 0, 0],
28670
- "darksalmon": [233, 150, 122],
28671
- "darkseagreen": [143, 188, 143],
28672
- "darkslateblue": [72, 61, 139],
28673
- "darkslategray": [47, 79, 79],
28674
- "darkslategrey": [47, 79, 79],
28675
- "darkturquoise": [0, 206, 209],
28676
- "darkviolet": [148, 0, 211],
28677
- "deeppink": [255, 20, 147],
28678
- "deepskyblue": [0, 191, 255],
28679
- "dimgray": [105, 105, 105],
28680
- "dimgrey": [105, 105, 105],
28681
- "dodgerblue": [30, 144, 255],
28682
- "firebrick": [178, 34, 34],
28683
- "floralwhite": [255, 250, 240],
28684
- "forestgreen": [34, 139, 34],
28685
- "fuchsia": [255, 0, 255],
28686
- "gainsboro": [220, 220, 220],
28687
- "ghostwhite": [248, 248, 255],
28688
- "gold": [255, 215, 0],
28689
- "goldenrod": [218, 165, 32],
28690
- "gray": [128, 128, 128],
28691
- "green": [0, 128, 0],
28692
- "greenyellow": [173, 255, 47],
28693
- "grey": [128, 128, 128],
28694
- "honeydew": [240, 255, 240],
28695
- "hotpink": [255, 105, 180],
28696
- "indianred": [205, 92, 92],
28697
- "indigo": [75, 0, 130],
28698
- "ivory": [255, 255, 240],
28699
- "khaki": [240, 230, 140],
28700
- "lavender": [230, 230, 250],
28701
- "lavenderblush": [255, 240, 245],
28702
- "lawngreen": [124, 252, 0],
28703
- "lemonchiffon": [255, 250, 205],
28704
- "lightblue": [173, 216, 230],
28705
- "lightcoral": [240, 128, 128],
28706
- "lightcyan": [224, 255, 255],
28707
- "lightgoldenrodyellow": [250, 250, 210],
28708
- "lightgray": [211, 211, 211],
28709
- "lightgreen": [144, 238, 144],
28710
- "lightgrey": [211, 211, 211],
28711
- "lightpink": [255, 182, 193],
28712
- "lightsalmon": [255, 160, 122],
28713
- "lightseagreen": [32, 178, 170],
28714
- "lightskyblue": [135, 206, 250],
28715
- "lightslategray": [119, 136, 153],
28716
- "lightslategrey": [119, 136, 153],
28717
- "lightsteelblue": [176, 196, 222],
28718
- "lightyellow": [255, 255, 224],
28719
- "lime": [0, 255, 0],
28720
- "limegreen": [50, 205, 50],
28721
- "linen": [250, 240, 230],
28722
- "magenta": [255, 0, 255],
28723
- "maroon": [128, 0, 0],
28724
- "mediumaquamarine": [102, 205, 170],
28725
- "mediumblue": [0, 0, 205],
28726
- "mediumorchid": [186, 85, 211],
28727
- "mediumpurple": [147, 112, 219],
28728
- "mediumseagreen": [60, 179, 113],
28729
- "mediumslateblue": [123, 104, 238],
28730
- "mediumspringgreen": [0, 250, 154],
28731
- "mediumturquoise": [72, 209, 204],
28732
- "mediumvioletred": [199, 21, 133],
28733
- "midnightblue": [25, 25, 112],
28734
- "mintcream": [245, 255, 250],
28735
- "mistyrose": [255, 228, 225],
28736
- "moccasin": [255, 228, 181],
28737
- "navajowhite": [255, 222, 173],
28738
- "navy": [0, 0, 128],
28739
- "oldlace": [253, 245, 230],
28740
- "olive": [128, 128, 0],
28741
- "olivedrab": [107, 142, 35],
28742
- "orange": [255, 165, 0],
28743
- "orangered": [255, 69, 0],
28744
- "orchid": [218, 112, 214],
28745
- "palegoldenrod": [238, 232, 170],
28746
- "palegreen": [152, 251, 152],
28747
- "paleturquoise": [175, 238, 238],
28748
- "palevioletred": [219, 112, 147],
28749
- "papayawhip": [255, 239, 213],
28750
- "peachpuff": [255, 218, 185],
28751
- "peru": [205, 133, 63],
28752
- "pink": [255, 192, 203],
28753
- "plum": [221, 160, 221],
28754
- "powderblue": [176, 224, 230],
28755
- "purple": [128, 0, 128],
28756
- "rebeccapurple": [102, 51, 153],
28757
- "red": [255, 0, 0],
28758
- "rosybrown": [188, 143, 143],
28759
- "royalblue": [65, 105, 225],
28760
- "saddlebrown": [139, 69, 19],
28761
- "salmon": [250, 128, 114],
28762
- "sandybrown": [244, 164, 96],
28763
- "seagreen": [46, 139, 87],
28764
- "seashell": [255, 245, 238],
28765
- "sienna": [160, 82, 45],
28766
- "silver": [192, 192, 192],
28767
- "skyblue": [135, 206, 235],
28768
- "slateblue": [106, 90, 205],
28769
- "slategray": [112, 128, 144],
28770
- "slategrey": [112, 128, 144],
28771
- "snow": [255, 250, 250],
28772
- "springgreen": [0, 255, 127],
28773
- "steelblue": [70, 130, 180],
28774
- "tan": [210, 180, 140],
28775
- "teal": [0, 128, 128],
28776
- "thistle": [216, 191, 216],
28777
- "tomato": [255, 99, 71],
28778
- "turquoise": [64, 224, 208],
28779
- "violet": [238, 130, 238],
28780
- "wheat": [245, 222, 179],
28781
- "white": [255, 255, 255],
28782
- "whitesmoke": [245, 245, 245],
28783
- "yellow": [255, 255, 0],
28784
- "yellowgreen": [154, 205, 50]
28785
- };
28786
- }
28787
- });
28788
-
28789
- // ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js
28790
- var require_conversions = __commonJS({
28791
- "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports, module) {
28792
- var cssKeywords = require_color_name();
28793
- var reverseKeywords = {};
28794
- for (const key of Object.keys(cssKeywords)) {
28795
- reverseKeywords[cssKeywords[key]] = key;
28796
- }
28797
- var convert2 = {
28798
- rgb: { channels: 3, labels: "rgb" },
28799
- hsl: { channels: 3, labels: "hsl" },
28800
- hsv: { channels: 3, labels: "hsv" },
28801
- hwb: { channels: 3, labels: "hwb" },
28802
- cmyk: { channels: 4, labels: "cmyk" },
28803
- xyz: { channels: 3, labels: "xyz" },
28804
- lab: { channels: 3, labels: "lab" },
28805
- lch: { channels: 3, labels: "lch" },
28806
- hex: { channels: 1, labels: ["hex"] },
28807
- keyword: { channels: 1, labels: ["keyword"] },
28808
- ansi16: { channels: 1, labels: ["ansi16"] },
28809
- ansi256: { channels: 1, labels: ["ansi256"] },
28810
- hcg: { channels: 3, labels: ["h", "c", "g"] },
28811
- apple: { channels: 3, labels: ["r16", "g16", "b16"] },
28812
- gray: { channels: 1, labels: ["gray"] }
28813
- };
28814
- module.exports = convert2;
28815
- for (const model of Object.keys(convert2)) {
28816
- if (!("channels" in convert2[model])) {
28817
- throw new Error("missing channels property: " + model);
28818
- }
28819
- if (!("labels" in convert2[model])) {
28820
- throw new Error("missing channel labels property: " + model);
28821
- }
28822
- if (convert2[model].labels.length !== convert2[model].channels) {
28823
- throw new Error("channel and label counts mismatch: " + model);
28824
- }
28825
- const { channels, labels } = convert2[model];
28826
- delete convert2[model].channels;
28827
- delete convert2[model].labels;
28828
- Object.defineProperty(convert2[model], "channels", { value: channels });
28829
- Object.defineProperty(convert2[model], "labels", { value: labels });
28830
- }
28831
- convert2.rgb.hsl = function(rgb) {
28832
- const r = rgb[0] / 255;
28833
- const g = rgb[1] / 255;
28834
- const b = rgb[2] / 255;
28835
- const min = Math.min(r, g, b);
28836
- const max = Math.max(r, g, b);
28837
- const delta = max - min;
28838
- let h;
28839
- let s;
28840
- if (max === min) {
28841
- h = 0;
28842
- } else if (r === max) {
28843
- h = (g - b) / delta;
28844
- } else if (g === max) {
28845
- h = 2 + (b - r) / delta;
28846
- } else if (b === max) {
28847
- h = 4 + (r - g) / delta;
28848
- }
28849
- h = Math.min(h * 60, 360);
28850
- if (h < 0) {
28851
- h += 360;
28852
- }
28853
- const l = (min + max) / 2;
28854
- if (max === min) {
28855
- s = 0;
28856
- } else if (l <= 0.5) {
28857
- s = delta / (max + min);
28858
- } else {
28859
- s = delta / (2 - max - min);
28860
- }
28861
- return [h, s * 100, l * 100];
28862
- };
28863
- convert2.rgb.hsv = function(rgb) {
28864
- let rdif;
28865
- let gdif;
28866
- let bdif;
28867
- let h;
28868
- let s;
28869
- const r = rgb[0] / 255;
28870
- const g = rgb[1] / 255;
28871
- const b = rgb[2] / 255;
28872
- const v = Math.max(r, g, b);
28873
- const diff = v - Math.min(r, g, b);
28874
- const diffc = function(c) {
28875
- return (v - c) / 6 / diff + 1 / 2;
28876
- };
28877
- if (diff === 0) {
28878
- h = 0;
28879
- s = 0;
28880
- } else {
28881
- s = diff / v;
28882
- rdif = diffc(r);
28883
- gdif = diffc(g);
28884
- bdif = diffc(b);
28885
- if (r === v) {
28886
- h = bdif - gdif;
28887
- } else if (g === v) {
28888
- h = 1 / 3 + rdif - bdif;
28889
- } else if (b === v) {
28890
- h = 2 / 3 + gdif - rdif;
28891
- }
28892
- if (h < 0) {
28893
- h += 1;
28894
- } else if (h > 1) {
28895
- h -= 1;
28896
- }
28897
- }
28898
- return [
28899
- h * 360,
28900
- s * 100,
28901
- v * 100
28902
- ];
28903
- };
28904
- convert2.rgb.hwb = function(rgb) {
28905
- const r = rgb[0];
28906
- const g = rgb[1];
28907
- let b = rgb[2];
28908
- const h = convert2.rgb.hsl(rgb)[0];
28909
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
28910
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
28911
- return [h, w * 100, b * 100];
28912
- };
28913
- convert2.rgb.cmyk = function(rgb) {
28914
- const r = rgb[0] / 255;
28915
- const g = rgb[1] / 255;
28916
- const b = rgb[2] / 255;
28917
- const k = Math.min(1 - r, 1 - g, 1 - b);
28918
- const c = (1 - r - k) / (1 - k) || 0;
28919
- const m = (1 - g - k) / (1 - k) || 0;
28920
- const y = (1 - b - k) / (1 - k) || 0;
28921
- return [c * 100, m * 100, y * 100, k * 100];
28922
- };
28923
- function comparativeDistance(x, y) {
28924
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
28925
- }
28926
- convert2.rgb.keyword = function(rgb) {
28927
- const reversed = reverseKeywords[rgb];
28928
- if (reversed) {
28929
- return reversed;
28930
- }
28931
- let currentClosestDistance = Infinity;
28932
- let currentClosestKeyword;
28933
- for (const keyword of Object.keys(cssKeywords)) {
28934
- const value = cssKeywords[keyword];
28935
- const distance = comparativeDistance(rgb, value);
28936
- if (distance < currentClosestDistance) {
28937
- currentClosestDistance = distance;
28938
- currentClosestKeyword = keyword;
28939
- }
28940
- }
28941
- return currentClosestKeyword;
28942
- };
28943
- convert2.keyword.rgb = function(keyword) {
28944
- return cssKeywords[keyword];
28945
- };
28946
- convert2.rgb.xyz = function(rgb) {
28947
- let r = rgb[0] / 255;
28948
- let g = rgb[1] / 255;
28949
- let b = rgb[2] / 255;
28950
- r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
28951
- g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
28952
- b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
28953
- const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
28954
- const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
28955
- const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
28956
- return [x * 100, y * 100, z * 100];
28957
- };
28958
- convert2.rgb.lab = function(rgb) {
28959
- const xyz = convert2.rgb.xyz(rgb);
28960
- let x = xyz[0];
28961
- let y = xyz[1];
28962
- let z = xyz[2];
28963
- x /= 95.047;
28964
- y /= 100;
28965
- z /= 108.883;
28966
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
28967
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
28968
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
28969
- const l = 116 * y - 16;
28970
- const a = 500 * (x - y);
28971
- const b = 200 * (y - z);
28972
- return [l, a, b];
28973
- };
28974
- convert2.hsl.rgb = function(hsl) {
28975
- const h = hsl[0] / 360;
28976
- const s = hsl[1] / 100;
28977
- const l = hsl[2] / 100;
28978
- let t2;
28979
- let t3;
28980
- let val;
28981
- if (s === 0) {
28982
- val = l * 255;
28983
- return [val, val, val];
28984
- }
28985
- if (l < 0.5) {
28986
- t2 = l * (1 + s);
28987
- } else {
28988
- t2 = l + s - l * s;
28989
- }
28990
- const t1 = 2 * l - t2;
28991
- const rgb = [0, 0, 0];
28992
- for (let i = 0; i < 3; i++) {
28993
- t3 = h + 1 / 3 * -(i - 1);
28994
- if (t3 < 0) {
28995
- t3++;
28996
- }
28997
- if (t3 > 1) {
28998
- t3--;
28999
- }
29000
- if (6 * t3 < 1) {
29001
- val = t1 + (t2 - t1) * 6 * t3;
29002
- } else if (2 * t3 < 1) {
29003
- val = t2;
29004
- } else if (3 * t3 < 2) {
29005
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
29006
- } else {
29007
- val = t1;
29008
- }
29009
- rgb[i] = val * 255;
29010
- }
29011
- return rgb;
29012
- };
29013
- convert2.hsl.hsv = function(hsl) {
29014
- const h = hsl[0];
29015
- let s = hsl[1] / 100;
29016
- let l = hsl[2] / 100;
29017
- let smin = s;
29018
- const lmin = Math.max(l, 0.01);
29019
- l *= 2;
29020
- s *= l <= 1 ? l : 2 - l;
29021
- smin *= lmin <= 1 ? lmin : 2 - lmin;
29022
- const v = (l + s) / 2;
29023
- const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
29024
- return [h, sv * 100, v * 100];
29025
- };
29026
- convert2.hsv.rgb = function(hsv) {
29027
- const h = hsv[0] / 60;
29028
- const s = hsv[1] / 100;
29029
- let v = hsv[2] / 100;
29030
- const hi = Math.floor(h) % 6;
29031
- const f2 = h - Math.floor(h);
29032
- const p = 255 * v * (1 - s);
29033
- const q = 255 * v * (1 - s * f2);
29034
- const t = 255 * v * (1 - s * (1 - f2));
29035
- v *= 255;
29036
- switch (hi) {
29037
- case 0:
29038
- return [v, t, p];
29039
- case 1:
29040
- return [q, v, p];
29041
- case 2:
29042
- return [p, v, t];
29043
- case 3:
29044
- return [p, q, v];
29045
- case 4:
29046
- return [t, p, v];
29047
- case 5:
29048
- return [v, p, q];
29049
- }
29050
- };
29051
- convert2.hsv.hsl = function(hsv) {
29052
- const h = hsv[0];
29053
- const s = hsv[1] / 100;
29054
- const v = hsv[2] / 100;
29055
- const vmin = Math.max(v, 0.01);
29056
- let sl;
29057
- let l;
29058
- l = (2 - s) * v;
29059
- const lmin = (2 - s) * vmin;
29060
- sl = s * vmin;
29061
- sl /= lmin <= 1 ? lmin : 2 - lmin;
29062
- sl = sl || 0;
29063
- l /= 2;
29064
- return [h, sl * 100, l * 100];
29065
- };
29066
- convert2.hwb.rgb = function(hwb) {
29067
- const h = hwb[0] / 360;
29068
- let wh = hwb[1] / 100;
29069
- let bl = hwb[2] / 100;
29070
- const ratio = wh + bl;
29071
- let f2;
29072
- if (ratio > 1) {
29073
- wh /= ratio;
29074
- bl /= ratio;
29075
- }
29076
- const i = Math.floor(6 * h);
29077
- const v = 1 - bl;
29078
- f2 = 6 * h - i;
29079
- if ((i & 1) !== 0) {
29080
- f2 = 1 - f2;
29081
- }
29082
- const n = wh + f2 * (v - wh);
29083
- let r;
29084
- let g;
29085
- let b;
29086
- switch (i) {
29087
- default:
29088
- case 6:
29089
- case 0:
29090
- r = v;
29091
- g = n;
29092
- b = wh;
29093
- break;
29094
- case 1:
29095
- r = n;
29096
- g = v;
29097
- b = wh;
29098
- break;
29099
- case 2:
29100
- r = wh;
29101
- g = v;
29102
- b = n;
29103
- break;
29104
- case 3:
29105
- r = wh;
29106
- g = n;
29107
- b = v;
29108
- break;
29109
- case 4:
29110
- r = n;
29111
- g = wh;
29112
- b = v;
29113
- break;
29114
- case 5:
29115
- r = v;
29116
- g = wh;
29117
- b = n;
29118
- break;
29119
- }
29120
- return [r * 255, g * 255, b * 255];
29121
- };
29122
- convert2.cmyk.rgb = function(cmyk) {
29123
- const c = cmyk[0] / 100;
29124
- const m = cmyk[1] / 100;
29125
- const y = cmyk[2] / 100;
29126
- const k = cmyk[3] / 100;
29127
- const r = 1 - Math.min(1, c * (1 - k) + k);
29128
- const g = 1 - Math.min(1, m * (1 - k) + k);
29129
- const b = 1 - Math.min(1, y * (1 - k) + k);
29130
- return [r * 255, g * 255, b * 255];
29131
- };
29132
- convert2.xyz.rgb = function(xyz) {
29133
- const x = xyz[0] / 100;
29134
- const y = xyz[1] / 100;
29135
- const z = xyz[2] / 100;
29136
- let r;
29137
- let g;
29138
- let b;
29139
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
29140
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
29141
- b = x * 0.0557 + y * -0.204 + z * 1.057;
29142
- r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
29143
- g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
29144
- b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
29145
- r = Math.min(Math.max(0, r), 1);
29146
- g = Math.min(Math.max(0, g), 1);
29147
- b = Math.min(Math.max(0, b), 1);
29148
- return [r * 255, g * 255, b * 255];
29149
- };
29150
- convert2.xyz.lab = function(xyz) {
29151
- let x = xyz[0];
29152
- let y = xyz[1];
29153
- let z = xyz[2];
29154
- x /= 95.047;
29155
- y /= 100;
29156
- z /= 108.883;
29157
- x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
29158
- y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
29159
- z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
29160
- const l = 116 * y - 16;
29161
- const a = 500 * (x - y);
29162
- const b = 200 * (y - z);
29163
- return [l, a, b];
29164
- };
29165
- convert2.lab.xyz = function(lab) {
29166
- const l = lab[0];
29167
- const a = lab[1];
29168
- const b = lab[2];
29169
- let x;
29170
- let y;
29171
- let z;
29172
- y = (l + 16) / 116;
29173
- x = a / 500 + y;
29174
- z = y - b / 200;
29175
- const y2 = y ** 3;
29176
- const x2 = x ** 3;
29177
- const z2 = z ** 3;
29178
- y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
29179
- x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
29180
- z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
29181
- x *= 95.047;
29182
- y *= 100;
29183
- z *= 108.883;
29184
- return [x, y, z];
29185
- };
29186
- convert2.lab.lch = function(lab) {
29187
- const l = lab[0];
29188
- const a = lab[1];
29189
- const b = lab[2];
29190
- let h;
29191
- const hr = Math.atan2(b, a);
29192
- h = hr * 360 / 2 / Math.PI;
29193
- if (h < 0) {
29194
- h += 360;
29195
- }
29196
- const c = Math.sqrt(a * a + b * b);
29197
- return [l, c, h];
29198
- };
29199
- convert2.lch.lab = function(lch) {
29200
- const l = lch[0];
29201
- const c = lch[1];
29202
- const h = lch[2];
29203
- const hr = h / 360 * 2 * Math.PI;
29204
- const a = c * Math.cos(hr);
29205
- const b = c * Math.sin(hr);
29206
- return [l, a, b];
29207
- };
29208
- convert2.rgb.ansi16 = function(args, saturation = null) {
29209
- const [r, g, b] = args;
29210
- let value = saturation === null ? convert2.rgb.hsv(args)[2] : saturation;
29211
- value = Math.round(value / 50);
29212
- if (value === 0) {
29213
- return 30;
29214
- }
29215
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
29216
- if (value === 2) {
29217
- ansi += 60;
29218
- }
29219
- return ansi;
29220
- };
29221
- convert2.hsv.ansi16 = function(args) {
29222
- return convert2.rgb.ansi16(convert2.hsv.rgb(args), args[2]);
29223
- };
29224
- convert2.rgb.ansi256 = function(args) {
29225
- const r = args[0];
29226
- const g = args[1];
29227
- const b = args[2];
29228
- if (r === g && g === b) {
29229
- if (r < 8) {
29230
- return 16;
29231
- }
29232
- if (r > 248) {
29233
- return 231;
29234
- }
29235
- return Math.round((r - 8) / 247 * 24) + 232;
29236
- }
29237
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
29238
- return ansi;
29239
- };
29240
- convert2.ansi16.rgb = function(args) {
29241
- let color = args % 10;
29242
- if (color === 0 || color === 7) {
29243
- if (args > 50) {
29244
- color += 3.5;
29245
- }
29246
- color = color / 10.5 * 255;
29247
- return [color, color, color];
29248
- }
29249
- const mult = (~~(args > 50) + 1) * 0.5;
29250
- const r = (color & 1) * mult * 255;
29251
- const g = (color >> 1 & 1) * mult * 255;
29252
- const b = (color >> 2 & 1) * mult * 255;
29253
- return [r, g, b];
29254
- };
29255
- convert2.ansi256.rgb = function(args) {
29256
- if (args >= 232) {
29257
- const c = (args - 232) * 10 + 8;
29258
- return [c, c, c];
29259
- }
29260
- args -= 16;
29261
- let rem;
29262
- const r = Math.floor(args / 36) / 5 * 255;
29263
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
29264
- const b = rem % 6 / 5 * 255;
29265
- return [r, g, b];
29266
- };
29267
- convert2.rgb.hex = function(args) {
29268
- const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
29269
- const string = integer.toString(16).toUpperCase();
29270
- return "000000".substring(string.length) + string;
29271
- };
29272
- convert2.hex.rgb = function(args) {
29273
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
29274
- if (!match) {
29275
- return [0, 0, 0];
29276
- }
29277
- let colorString = match[0];
29278
- if (match[0].length === 3) {
29279
- colorString = colorString.split("").map((char) => {
29280
- return char + char;
29281
- }).join("");
29282
- }
29283
- const integer = parseInt(colorString, 16);
29284
- const r = integer >> 16 & 255;
29285
- const g = integer >> 8 & 255;
29286
- const b = integer & 255;
29287
- return [r, g, b];
29288
- };
29289
- convert2.rgb.hcg = function(rgb) {
29290
- const r = rgb[0] / 255;
29291
- const g = rgb[1] / 255;
29292
- const b = rgb[2] / 255;
29293
- const max = Math.max(Math.max(r, g), b);
29294
- const min = Math.min(Math.min(r, g), b);
29295
- const chroma = max - min;
29296
- let grayscale;
29297
- let hue;
29298
- if (chroma < 1) {
29299
- grayscale = min / (1 - chroma);
29300
- } else {
29301
- grayscale = 0;
29302
- }
29303
- if (chroma <= 0) {
29304
- hue = 0;
29305
- } else if (max === r) {
29306
- hue = (g - b) / chroma % 6;
29307
- } else if (max === g) {
29308
- hue = 2 + (b - r) / chroma;
29309
- } else {
29310
- hue = 4 + (r - g) / chroma;
29311
- }
29312
- hue /= 6;
29313
- hue %= 1;
29314
- return [hue * 360, chroma * 100, grayscale * 100];
29315
- };
29316
- convert2.hsl.hcg = function(hsl) {
29317
- const s = hsl[1] / 100;
29318
- const l = hsl[2] / 100;
29319
- const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
29320
- let f2 = 0;
29321
- if (c < 1) {
29322
- f2 = (l - 0.5 * c) / (1 - c);
29323
- }
29324
- return [hsl[0], c * 100, f2 * 100];
29325
- };
29326
- convert2.hsv.hcg = function(hsv) {
29327
- const s = hsv[1] / 100;
29328
- const v = hsv[2] / 100;
29329
- const c = s * v;
29330
- let f2 = 0;
29331
- if (c < 1) {
29332
- f2 = (v - c) / (1 - c);
29333
- }
29334
- return [hsv[0], c * 100, f2 * 100];
29335
- };
29336
- convert2.hcg.rgb = function(hcg) {
29337
- const h = hcg[0] / 360;
29338
- const c = hcg[1] / 100;
29339
- const g = hcg[2] / 100;
29340
- if (c === 0) {
29341
- return [g * 255, g * 255, g * 255];
29342
- }
29343
- const pure = [0, 0, 0];
29344
- const hi = h % 1 * 6;
29345
- const v = hi % 1;
29346
- const w = 1 - v;
29347
- let mg = 0;
29348
- switch (Math.floor(hi)) {
29349
- case 0:
29350
- pure[0] = 1;
29351
- pure[1] = v;
29352
- pure[2] = 0;
29353
- break;
29354
- case 1:
29355
- pure[0] = w;
29356
- pure[1] = 1;
29357
- pure[2] = 0;
29358
- break;
29359
- case 2:
29360
- pure[0] = 0;
29361
- pure[1] = 1;
29362
- pure[2] = v;
29363
- break;
29364
- case 3:
29365
- pure[0] = 0;
29366
- pure[1] = w;
29367
- pure[2] = 1;
29368
- break;
29369
- case 4:
29370
- pure[0] = v;
29371
- pure[1] = 0;
29372
- pure[2] = 1;
29373
- break;
29374
- default:
29375
- pure[0] = 1;
29376
- pure[1] = 0;
29377
- pure[2] = w;
29378
- }
29379
- mg = (1 - c) * g;
29380
- return [
29381
- (c * pure[0] + mg) * 255,
29382
- (c * pure[1] + mg) * 255,
29383
- (c * pure[2] + mg) * 255
29384
- ];
29385
- };
29386
- convert2.hcg.hsv = function(hcg) {
29387
- const c = hcg[1] / 100;
29388
- const g = hcg[2] / 100;
29389
- const v = c + g * (1 - c);
29390
- let f2 = 0;
29391
- if (v > 0) {
29392
- f2 = c / v;
29393
- }
29394
- return [hcg[0], f2 * 100, v * 100];
29395
- };
29396
- convert2.hcg.hsl = function(hcg) {
29397
- const c = hcg[1] / 100;
29398
- const g = hcg[2] / 100;
29399
- const l = g * (1 - c) + 0.5 * c;
29400
- let s = 0;
29401
- if (l > 0 && l < 0.5) {
29402
- s = c / (2 * l);
29403
- } else if (l >= 0.5 && l < 1) {
29404
- s = c / (2 * (1 - l));
29405
- }
29406
- return [hcg[0], s * 100, l * 100];
29407
- };
29408
- convert2.hcg.hwb = function(hcg) {
29409
- const c = hcg[1] / 100;
29410
- const g = hcg[2] / 100;
29411
- const v = c + g * (1 - c);
29412
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
29413
- };
29414
- convert2.hwb.hcg = function(hwb) {
29415
- const w = hwb[1] / 100;
29416
- const b = hwb[2] / 100;
29417
- const v = 1 - b;
29418
- const c = v - w;
29419
- let g = 0;
29420
- if (c < 1) {
29421
- g = (v - c) / (1 - c);
29422
- }
29423
- return [hwb[0], c * 100, g * 100];
29424
- };
29425
- convert2.apple.rgb = function(apple) {
29426
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
29427
- };
29428
- convert2.rgb.apple = function(rgb) {
29429
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
29430
- };
29431
- convert2.gray.rgb = function(args) {
29432
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
29433
- };
29434
- convert2.gray.hsl = function(args) {
29435
- return [0, 0, args[0]];
29436
- };
29437
- convert2.gray.hsv = convert2.gray.hsl;
29438
- convert2.gray.hwb = function(gray) {
29439
- return [0, 100, gray[0]];
29440
- };
29441
- convert2.gray.cmyk = function(gray) {
29442
- return [0, 0, 0, gray[0]];
29443
- };
29444
- convert2.gray.lab = function(gray) {
29445
- return [gray[0], 0, 0];
29446
- };
29447
- convert2.gray.hex = function(gray) {
29448
- const val = Math.round(gray[0] / 100 * 255) & 255;
29449
- const integer = (val << 16) + (val << 8) + val;
29450
- const string = integer.toString(16).toUpperCase();
29451
- return "000000".substring(string.length) + string;
29452
- };
29453
- convert2.rgb.gray = function(rgb) {
29454
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
29455
- return [val / 255 * 100];
29456
- };
29457
- }
29458
- });
29459
-
29460
- // ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
29461
- var require_route = __commonJS({
29462
- "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports, module) {
29463
- var conversions = require_conversions();
29464
- function buildGraph() {
29465
- const graph = {};
29466
- const models = Object.keys(conversions);
29467
- for (let len = models.length, i = 0; i < len; i++) {
29468
- graph[models[i]] = {
29469
- // http://jsperf.com/1-vs-infinity
29470
- // micro-opt, but this is simple.
29471
- distance: -1,
29472
- parent: null
29473
- };
29474
- }
29475
- return graph;
29476
- }
29477
- function deriveBFS(fromModel) {
29478
- const graph = buildGraph();
29479
- const queue = [fromModel];
29480
- graph[fromModel].distance = 0;
29481
- while (queue.length) {
29482
- const current = queue.pop();
29483
- const adjacents = Object.keys(conversions[current]);
29484
- for (let len = adjacents.length, i = 0; i < len; i++) {
29485
- const adjacent = adjacents[i];
29486
- const node = graph[adjacent];
29487
- if (node.distance === -1) {
29488
- node.distance = graph[current].distance + 1;
29489
- node.parent = current;
29490
- queue.unshift(adjacent);
29491
- }
29492
- }
29493
- }
29494
- return graph;
29495
- }
29496
- function link(from, to) {
29497
- return function(args) {
29498
- return to(from(args));
29499
- };
29500
- }
29501
- function wrapConversion(toModel, graph) {
29502
- const path2 = [graph[toModel].parent, toModel];
29503
- let fn = conversions[graph[toModel].parent][toModel];
29504
- let cur = graph[toModel].parent;
29505
- while (graph[cur].parent) {
29506
- path2.unshift(graph[cur].parent);
29507
- fn = link(conversions[graph[cur].parent][cur], fn);
29508
- cur = graph[cur].parent;
29509
- }
29510
- fn.conversion = path2;
29511
- return fn;
29512
- }
29513
- module.exports = function(fromModel) {
29514
- const graph = deriveBFS(fromModel);
29515
- const conversion = {};
29516
- const models = Object.keys(graph);
29517
- for (let len = models.length, i = 0; i < len; i++) {
29518
- const toModel = models[i];
29519
- const node = graph[toModel];
29520
- if (node.parent === null) {
29521
- continue;
29522
- }
29523
- conversion[toModel] = wrapConversion(toModel, graph);
29524
- }
29525
- return conversion;
29526
- };
29527
- }
29528
- });
29529
-
29530
- // ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js
29531
- var require_color_convert = __commonJS({
29532
- "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports, module) {
29533
- var conversions = require_conversions();
29534
- var route = require_route();
29535
- var convert2 = {};
29536
- var models = Object.keys(conversions);
29537
- function wrapRaw(fn) {
29538
- const wrappedFn = function(...args) {
29539
- const arg0 = args[0];
29540
- if (arg0 === void 0 || arg0 === null) {
29541
- return arg0;
29542
- }
29543
- if (arg0.length > 1) {
29544
- args = arg0;
29545
- }
29546
- return fn(args);
29547
- };
29548
- if ("conversion" in fn) {
29549
- wrappedFn.conversion = fn.conversion;
29550
- }
29551
- return wrappedFn;
29552
- }
29553
- function wrapRounded(fn) {
29554
- const wrappedFn = function(...args) {
29555
- const arg0 = args[0];
29556
- if (arg0 === void 0 || arg0 === null) {
29557
- return arg0;
29558
- }
29559
- if (arg0.length > 1) {
29560
- args = arg0;
29561
- }
29562
- const result = fn(args);
29563
- if (typeof result === "object") {
29564
- for (let len = result.length, i = 0; i < len; i++) {
29565
- result[i] = Math.round(result[i]);
29566
- }
29567
- }
29568
- return result;
29569
- };
29570
- if ("conversion" in fn) {
29571
- wrappedFn.conversion = fn.conversion;
29572
- }
29573
- return wrappedFn;
29574
- }
29575
- models.forEach((fromModel) => {
29576
- convert2[fromModel] = {};
29577
- Object.defineProperty(convert2[fromModel], "channels", { value: conversions[fromModel].channels });
29578
- Object.defineProperty(convert2[fromModel], "labels", { value: conversions[fromModel].labels });
29579
- const routes = route(fromModel);
29580
- const routeModels = Object.keys(routes);
29581
- routeModels.forEach((toModel) => {
29582
- const fn = routes[toModel];
29583
- convert2[fromModel][toModel] = wrapRounded(fn);
29584
- convert2[fromModel][toModel].raw = wrapRaw(fn);
29585
- });
29586
- });
29587
- module.exports = convert2;
29588
- }
29589
- });
29590
-
29591
- // ../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
29592
- var require_ansi_styles = __commonJS({
29593
- "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports, module) {
29594
- "use strict";
29595
- var wrapAnsi16 = (fn, offset) => (...args) => {
29596
- const code = fn(...args);
29597
- return `\x1B[${code + offset}m`;
29598
- };
29599
- var wrapAnsi256 = (fn, offset) => (...args) => {
29600
- const code = fn(...args);
29601
- return `\x1B[${38 + offset};5;${code}m`;
29602
- };
29603
- var wrapAnsi16m = (fn, offset) => (...args) => {
29604
- const rgb = fn(...args);
29605
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
29606
- };
29607
- var ansi2ansi = (n) => n;
29608
- var rgb2rgb = (r, g, b) => [r, g, b];
29609
- var setLazyProperty = (object, property, get) => {
29610
- Object.defineProperty(object, property, {
29611
- get: () => {
29612
- const value = get();
29613
- Object.defineProperty(object, property, {
29614
- value,
29615
- enumerable: true,
29616
- configurable: true
29617
- });
29618
- return value;
29619
- },
29620
- enumerable: true,
29621
- configurable: true
29622
- });
29623
- };
29624
- var colorConvert;
29625
- var makeDynamicStyles = (wrap2, targetSpace, identity, isBackground) => {
29626
- if (colorConvert === void 0) {
29627
- colorConvert = require_color_convert();
29628
- }
29629
- const offset = isBackground ? 10 : 0;
29630
- const styles = {};
29631
- for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
29632
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
29633
- if (sourceSpace === targetSpace) {
29634
- styles[name] = wrap2(identity, offset);
29635
- } else if (typeof suite === "object") {
29636
- styles[name] = wrap2(suite[targetSpace], offset);
29637
- }
29638
- }
29639
- return styles;
29640
- };
29641
- function assembleStyles() {
29642
- const codes = /* @__PURE__ */ new Map();
29643
- const styles = {
29644
- modifier: {
29645
- reset: [0, 0],
29646
- // 21 isn't widely supported and 22 does the same thing
29647
- bold: [1, 22],
29648
- dim: [2, 22],
29649
- italic: [3, 23],
29650
- underline: [4, 24],
29651
- inverse: [7, 27],
29652
- hidden: [8, 28],
29653
- strikethrough: [9, 29]
29654
- },
29655
- color: {
29656
- black: [30, 39],
29657
- red: [31, 39],
29658
- green: [32, 39],
29659
- yellow: [33, 39],
29660
- blue: [34, 39],
29661
- magenta: [35, 39],
29662
- cyan: [36, 39],
29663
- white: [37, 39],
29664
- // Bright color
29665
- blackBright: [90, 39],
29666
- redBright: [91, 39],
29667
- greenBright: [92, 39],
29668
- yellowBright: [93, 39],
29669
- blueBright: [94, 39],
29670
- magentaBright: [95, 39],
29671
- cyanBright: [96, 39],
29672
- whiteBright: [97, 39]
29673
- },
29674
- bgColor: {
29675
- bgBlack: [40, 49],
29676
- bgRed: [41, 49],
29677
- bgGreen: [42, 49],
29678
- bgYellow: [43, 49],
29679
- bgBlue: [44, 49],
29680
- bgMagenta: [45, 49],
29681
- bgCyan: [46, 49],
29682
- bgWhite: [47, 49],
29683
- // Bright color
29684
- bgBlackBright: [100, 49],
29685
- bgRedBright: [101, 49],
29686
- bgGreenBright: [102, 49],
29687
- bgYellowBright: [103, 49],
29688
- bgBlueBright: [104, 49],
29689
- bgMagentaBright: [105, 49],
29690
- bgCyanBright: [106, 49],
29691
- bgWhiteBright: [107, 49]
29692
- }
29693
- };
29694
- styles.color.gray = styles.color.blackBright;
29695
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
29696
- styles.color.grey = styles.color.blackBright;
29697
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
29698
- for (const [groupName, group] of Object.entries(styles)) {
29699
- for (const [styleName, style] of Object.entries(group)) {
29700
- styles[styleName] = {
29701
- open: `\x1B[${style[0]}m`,
29702
- close: `\x1B[${style[1]}m`
29703
- };
29704
- group[styleName] = styles[styleName];
29705
- codes.set(style[0], style[1]);
29706
- }
29707
- Object.defineProperty(styles, groupName, {
29708
- value: group,
29709
- enumerable: false
29710
- });
29711
- }
29712
- Object.defineProperty(styles, "codes", {
29713
- value: codes,
29714
- enumerable: false
29715
- });
29716
- styles.color.close = "\x1B[39m";
29717
- styles.bgColor.close = "\x1B[49m";
29718
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
29719
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
29720
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
29721
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
29722
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
29723
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
29724
- return styles;
29725
- }
29726
- Object.defineProperty(module, "exports", {
29727
- enumerable: true,
29728
- get: assembleStyles
29729
- });
29730
- }
29731
- });
29732
-
29733
- // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
29734
- var require_has_flag = __commonJS({
29735
- "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
29736
- "use strict";
29737
- module.exports = (flag, argv = process.argv) => {
29738
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
29739
- const position = argv.indexOf(prefix + flag);
29740
- const terminatorPosition = argv.indexOf("--");
29741
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
29742
- };
29743
- }
29744
- });
29745
-
29746
- // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
29747
- var require_supports_color = __commonJS({
29748
- "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
29749
- "use strict";
29750
- var os2 = __require("os");
29751
- var tty = __require("tty");
29752
- var hasFlag = require_has_flag();
29753
- var { env } = process;
29754
- var forceColor;
29755
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
29756
- forceColor = 0;
29757
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
29758
- forceColor = 1;
29759
- }
29760
- if ("FORCE_COLOR" in env) {
29761
- if (env.FORCE_COLOR === "true") {
29762
- forceColor = 1;
29763
- } else if (env.FORCE_COLOR === "false") {
29764
- forceColor = 0;
29765
- } else {
29766
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
29767
- }
29768
- }
29769
- function translateLevel(level) {
29770
- if (level === 0) {
29771
- return false;
29772
- }
29773
- return {
29774
- level,
29775
- hasBasic: true,
29776
- has256: level >= 2,
29777
- has16m: level >= 3
29778
- };
29779
- }
29780
- function supportsColor(haveStream, streamIsTTY) {
29781
- if (forceColor === 0) {
29782
- return 0;
29783
- }
29784
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
29785
- return 3;
29786
- }
29787
- if (hasFlag("color=256")) {
29788
- return 2;
29789
- }
29790
- if (haveStream && !streamIsTTY && forceColor === void 0) {
29791
- return 0;
29792
- }
29793
- const min = forceColor || 0;
29794
- if (env.TERM === "dumb") {
29795
- return min;
29796
- }
29797
- if (process.platform === "win32") {
29798
- const osRelease = os2.release().split(".");
29799
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
29800
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
29801
- }
29802
- return 1;
29803
- }
29804
- if ("CI" in env) {
29805
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
29806
- return 1;
29807
- }
29808
- return min;
29809
- }
29810
- if ("TEAMCITY_VERSION" in env) {
29811
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
29812
- }
29813
- if (env.COLORTERM === "truecolor") {
29814
- return 3;
29815
- }
29816
- if ("TERM_PROGRAM" in env) {
29817
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
29818
- switch (env.TERM_PROGRAM) {
29819
- case "iTerm.app":
29820
- return version >= 3 ? 3 : 2;
29821
- case "Apple_Terminal":
29822
- return 2;
29823
- }
29824
- }
29825
- if (/-256(color)?$/i.test(env.TERM)) {
29826
- return 2;
29827
- }
29828
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
29829
- return 1;
29830
- }
29831
- if ("COLORTERM" in env) {
29832
- return 1;
29833
- }
29834
- return min;
29835
- }
29836
- function getSupportLevel(stream) {
29837
- const level = supportsColor(stream, stream && stream.isTTY);
29838
- return translateLevel(level);
29839
- }
29840
- module.exports = {
29841
- supportsColor: getSupportLevel,
29842
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
29843
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
29844
- };
29845
- }
29846
- });
29847
-
29848
- // ../../node_modules/.pnpm/chalk@4.0.0/node_modules/chalk/source/util.js
29849
- var require_util = __commonJS({
29850
- "../../node_modules/.pnpm/chalk@4.0.0/node_modules/chalk/source/util.js"(exports, module) {
29851
- "use strict";
29852
- var stringReplaceAll = (string, substring, replacer) => {
29853
- let index = string.indexOf(substring);
29854
- if (index === -1) {
29855
- return string;
29856
- }
29857
- const substringLength = substring.length;
29858
- let endIndex = 0;
29859
- let returnValue = "";
29860
- do {
29861
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
29862
- endIndex = index + substringLength;
29863
- index = string.indexOf(substring, endIndex);
29864
- } while (index !== -1);
29865
- returnValue += string.substr(endIndex);
29866
- return returnValue;
29867
- };
29868
- var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
29869
- let endIndex = 0;
29870
- let returnValue = "";
29871
- do {
29872
- const gotCR = string[index - 1] === "\r";
29873
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
29874
- endIndex = index + 1;
29875
- index = string.indexOf("\n", endIndex);
29876
- } while (index !== -1);
29877
- returnValue += string.substr(endIndex);
29878
- return returnValue;
29879
- };
29880
- module.exports = {
29881
- stringReplaceAll,
29882
- stringEncaseCRLFWithFirstIndex
29883
- };
29884
- }
29885
- });
29886
-
29887
- // ../../node_modules/.pnpm/chalk@4.0.0/node_modules/chalk/source/templates.js
29888
- var require_templates = __commonJS({
29889
- "../../node_modules/.pnpm/chalk@4.0.0/node_modules/chalk/source/templates.js"(exports, module) {
29890
- "use strict";
29891
- var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
29892
- var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
29893
- var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
29894
- var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
29895
- var ESCAPES = /* @__PURE__ */ new Map([
29896
- ["n", "\n"],
29897
- ["r", "\r"],
29898
- ["t", " "],
29899
- ["b", "\b"],
29900
- ["f", "\f"],
29901
- ["v", "\v"],
29902
- ["0", "\0"],
29903
- ["\\", "\\"],
29904
- ["e", "\x1B"],
29905
- ["a", "\x07"]
29906
- ]);
29907
- function unescape(c) {
29908
- const u = c[0] === "u";
29909
- const bracket = c[1] === "{";
29910
- if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
29911
- return String.fromCharCode(parseInt(c.slice(1), 16));
29912
- }
29913
- if (u && bracket) {
29914
- return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
29915
- }
29916
- return ESCAPES.get(c) || c;
29917
- }
29918
- function parseArguments(name, arguments_) {
29919
- const results = [];
29920
- const chunks = arguments_.trim().split(/\s*,\s*/g);
29921
- let matches;
29922
- for (const chunk of chunks) {
29923
- const number2 = Number(chunk);
29924
- if (!Number.isNaN(number2)) {
29925
- results.push(number2);
29926
- } else if (matches = chunk.match(STRING_REGEX)) {
29927
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
29928
- } else {
29929
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
29930
- }
29931
- }
29932
- return results;
29933
- }
29934
- function parseStyle(style) {
29935
- STYLE_REGEX.lastIndex = 0;
29936
- const results = [];
29937
- let matches;
29938
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
29939
- const name = matches[1];
29940
- if (matches[2]) {
29941
- const args = parseArguments(name, matches[2]);
29942
- results.push([name].concat(args));
29943
- } else {
29944
- results.push([name]);
29945
- }
29946
- }
29947
- return results;
29948
- }
29949
- function buildStyle(chalk3, styles) {
29950
- const enabled = {};
29951
- for (const layer of styles) {
29952
- for (const style of layer.styles) {
29953
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
29954
- }
29955
- }
29956
- let current = chalk3;
29957
- for (const [styleName, styles2] of Object.entries(enabled)) {
29958
- if (!Array.isArray(styles2)) {
29959
- continue;
29960
- }
29961
- if (!(styleName in current)) {
29962
- throw new Error(`Unknown Chalk style: ${styleName}`);
29963
- }
29964
- current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
29965
- }
29966
- return current;
29967
- }
29968
- module.exports = (chalk3, temporary) => {
29969
- const styles = [];
29970
- const chunks = [];
29971
- let chunk = [];
29972
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
29973
- if (escapeCharacter) {
29974
- chunk.push(unescape(escapeCharacter));
29975
- } else if (style) {
29976
- const string = chunk.join("");
29977
- chunk = [];
29978
- chunks.push(styles.length === 0 ? string : buildStyle(chalk3, styles)(string));
29979
- styles.push({ inverse, styles: parseStyle(style) });
29980
- } else if (close) {
29981
- if (styles.length === 0) {
29982
- throw new Error("Found extraneous } in Chalk template literal");
29983
- }
29984
- chunks.push(buildStyle(chalk3, styles)(chunk.join("")));
29985
- chunk = [];
29986
- styles.pop();
29987
- } else {
29988
- chunk.push(character);
29989
- }
29990
- });
29991
- chunks.push(chunk.join(""));
29992
- if (styles.length > 0) {
29993
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
29994
- throw new Error(errMessage);
29995
- }
29996
- return chunks.join("");
29997
- };
29998
- }
29999
- });
30000
-
30001
- // ../../node_modules/.pnpm/chalk@4.0.0/node_modules/chalk/source/index.js
30002
- var require_source2 = __commonJS({
30003
- "../../node_modules/.pnpm/chalk@4.0.0/node_modules/chalk/source/index.js"(exports, module) {
30004
- "use strict";
30005
- var ansiStyles = require_ansi_styles();
30006
- var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
30007
- var {
30008
- stringReplaceAll,
30009
- stringEncaseCRLFWithFirstIndex
30010
- } = require_util();
30011
- var levelMapping = [
30012
- "ansi",
30013
- "ansi",
30014
- "ansi256",
30015
- "ansi16m"
30016
- ];
30017
- var styles = /* @__PURE__ */ Object.create(null);
30018
- var applyOptions = (object, options = {}) => {
30019
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
30020
- throw new Error("The `level` option should be an integer from 0 to 3");
30021
- }
30022
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
30023
- object.level = options.level === void 0 ? colorLevel : options.level;
30024
- };
30025
- var ChalkClass = class {
30026
- constructor(options) {
30027
- return chalkFactory(options);
30028
- }
30029
- };
30030
- var chalkFactory = (options) => {
30031
- const chalk4 = {};
30032
- applyOptions(chalk4, options);
30033
- chalk4.template = (...arguments_) => chalkTag(chalk4.template, ...arguments_);
30034
- Object.setPrototypeOf(chalk4, Chalk.prototype);
30035
- Object.setPrototypeOf(chalk4.template, chalk4);
30036
- chalk4.template.constructor = () => {
30037
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
30038
- };
30039
- chalk4.template.Instance = ChalkClass;
30040
- return chalk4.template;
30041
- };
30042
- function Chalk(options) {
30043
- return chalkFactory(options);
30044
- }
30045
- for (const [styleName, style] of Object.entries(ansiStyles)) {
30046
- styles[styleName] = {
30047
- get() {
30048
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
30049
- Object.defineProperty(this, styleName, { value: builder });
30050
- return builder;
30051
- }
30052
- };
30053
- }
30054
- styles.visible = {
30055
- get() {
30056
- const builder = createBuilder(this, this._styler, true);
30057
- Object.defineProperty(this, "visible", { value: builder });
30058
- return builder;
30059
- }
30060
- };
30061
- var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
30062
- for (const model of usedModels) {
30063
- styles[model] = {
30064
- get() {
30065
- const { level } = this;
30066
- return function(...arguments_) {
30067
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
30068
- return createBuilder(this, styler, this._isEmpty);
30069
- };
30070
- }
30071
- };
30072
- }
30073
- for (const model of usedModels) {
30074
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
30075
- styles[bgModel] = {
30076
- get() {
30077
- const { level } = this;
30078
- return function(...arguments_) {
30079
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
30080
- return createBuilder(this, styler, this._isEmpty);
30081
- };
30082
- }
30083
- };
30084
- }
30085
- var proto = Object.defineProperties(() => {
30086
- }, {
30087
- ...styles,
30088
- level: {
30089
- enumerable: true,
30090
- get() {
30091
- return this._generator.level;
30092
- },
30093
- set(level) {
30094
- this._generator.level = level;
30095
- }
30096
- }
30097
- });
30098
- var createStyler = (open, close, parent) => {
30099
- let openAll;
30100
- let closeAll;
30101
- if (parent === void 0) {
30102
- openAll = open;
30103
- closeAll = close;
30104
- } else {
30105
- openAll = parent.openAll + open;
30106
- closeAll = close + parent.closeAll;
30107
- }
30108
- return {
30109
- open,
30110
- close,
30111
- openAll,
30112
- closeAll,
30113
- parent
30114
- };
30115
- };
30116
- var createBuilder = (self2, _styler, _isEmpty) => {
30117
- const builder = (...arguments_) => {
30118
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
30119
- };
30120
- Object.setPrototypeOf(builder, proto);
30121
- builder._generator = self2;
30122
- builder._styler = _styler;
30123
- builder._isEmpty = _isEmpty;
30124
- return builder;
30125
- };
30126
- var applyStyle = (self2, string) => {
30127
- if (self2.level <= 0 || !string) {
30128
- return self2._isEmpty ? "" : string;
30129
- }
30130
- let styler = self2._styler;
30131
- if (styler === void 0) {
30132
- return string;
30133
- }
30134
- const { openAll, closeAll } = styler;
30135
- if (string.indexOf("\x1B") !== -1) {
30136
- while (styler !== void 0) {
30137
- string = stringReplaceAll(string, styler.close, styler.open);
30138
- styler = styler.parent;
30139
- }
30140
- }
30141
- const lfIndex = string.indexOf("\n");
30142
- if (lfIndex !== -1) {
30143
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
30144
- }
30145
- return openAll + string + closeAll;
30146
- };
30147
- var template;
30148
- var chalkTag = (chalk4, ...strings) => {
30149
- const [firstString] = strings;
30150
- if (!Array.isArray(firstString)) {
30151
- return strings.join(" ");
30152
- }
30153
- const arguments_ = strings.slice(1);
30154
- const parts = [firstString.raw[0]];
30155
- for (let i = 1; i < firstString.length; i++) {
30156
- parts.push(
30157
- String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
30158
- String(firstString.raw[i])
30159
- );
30160
- }
30161
- if (template === void 0) {
30162
- template = require_templates();
30163
- }
30164
- return template(chalk4, parts.join(""));
30165
- };
30166
- Object.defineProperties(Chalk.prototype, styles);
30167
- var chalk3 = Chalk();
30168
- chalk3.supportsColor = stdoutColor;
30169
- chalk3.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
30170
- chalk3.stderr.supportsColor = stderrColor;
30171
- module.exports = chalk3;
30172
- }
30173
- });
30174
-
30175
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/styles.js
30176
- var require_styles = __commonJS({
30177
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/styles.js"(exports, module) {
30178
- var styles = {};
30179
- module["exports"] = styles;
30180
- var codes = {
30181
- reset: [0, 0],
30182
- bold: [1, 22],
30183
- dim: [2, 22],
30184
- italic: [3, 23],
30185
- underline: [4, 24],
30186
- inverse: [7, 27],
30187
- hidden: [8, 28],
30188
- strikethrough: [9, 29],
30189
- black: [30, 39],
30190
- red: [31, 39],
30191
- green: [32, 39],
30192
- yellow: [33, 39],
30193
- blue: [34, 39],
30194
- magenta: [35, 39],
30195
- cyan: [36, 39],
30196
- white: [37, 39],
30197
- gray: [90, 39],
30198
- grey: [90, 39],
30199
- bgBlack: [40, 49],
30200
- bgRed: [41, 49],
30201
- bgGreen: [42, 49],
30202
- bgYellow: [43, 49],
30203
- bgBlue: [44, 49],
30204
- bgMagenta: [45, 49],
30205
- bgCyan: [46, 49],
30206
- bgWhite: [47, 49],
30207
- // legacy styles for colors pre v1.0.0
30208
- blackBG: [40, 49],
30209
- redBG: [41, 49],
30210
- greenBG: [42, 49],
30211
- yellowBG: [43, 49],
30212
- blueBG: [44, 49],
30213
- magentaBG: [45, 49],
30214
- cyanBG: [46, 49],
30215
- whiteBG: [47, 49]
30216
- };
30217
- Object.keys(codes).forEach(function(key) {
30218
- var val = codes[key];
30219
- var style = styles[key] = [];
30220
- style.open = "\x1B[" + val[0] + "m";
30221
- style.close = "\x1B[" + val[1] + "m";
30222
- });
30223
- }
30224
- });
30225
-
30226
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/system/supports-colors.js
30227
- var require_supports_colors = __commonJS({
30228
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/system/supports-colors.js"(exports, module) {
30229
- var argv = process.argv;
30230
- module.exports = function() {
30231
- if (argv.indexOf("--no-color") !== -1 || argv.indexOf("--color=false") !== -1) {
30232
- return false;
30233
- }
30234
- if (argv.indexOf("--color") !== -1 || argv.indexOf("--color=true") !== -1 || argv.indexOf("--color=always") !== -1) {
30235
- return true;
30236
- }
30237
- if (process.stdout && !process.stdout.isTTY) {
30238
- return false;
30239
- }
30240
- if (process.platform === "win32") {
30241
- return true;
30242
- }
30243
- if ("COLORTERM" in process.env) {
30244
- return true;
30245
- }
30246
- if (process.env.TERM === "dumb") {
30247
- return false;
30248
- }
30249
- if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
30250
- return true;
30251
- }
30252
- return false;
30253
- }();
30254
- }
30255
- });
30256
-
30257
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/custom/trap.js
30258
- var require_trap = __commonJS({
30259
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/custom/trap.js"(exports, module) {
30260
- module["exports"] = function runTheTrap(text, options) {
30261
- var result = "";
30262
- text = text || "Run the trap, drop the bass";
30263
- text = text.split("");
30264
- var trap = {
30265
- a: ["@", "\u0104", "\u023A", "\u0245", "\u0394", "\u039B", "\u0414"],
30266
- b: ["\xDF", "\u0181", "\u0243", "\u026E", "\u03B2", "\u0E3F"],
30267
- c: ["\xA9", "\u023B", "\u03FE"],
30268
- d: ["\xD0", "\u018A", "\u0500", "\u0501", "\u0502", "\u0503"],
30269
- e: ["\xCB", "\u0115", "\u018E", "\u0258", "\u03A3", "\u03BE", "\u04BC", "\u0A6C"],
30270
- f: ["\u04FA"],
30271
- g: ["\u0262"],
30272
- h: ["\u0126", "\u0195", "\u04A2", "\u04BA", "\u04C7", "\u050A"],
30273
- i: ["\u0F0F"],
30274
- j: ["\u0134"],
30275
- k: ["\u0138", "\u04A0", "\u04C3", "\u051E"],
30276
- l: ["\u0139"],
30277
- m: ["\u028D", "\u04CD", "\u04CE", "\u0520", "\u0521", "\u0D69"],
30278
- n: ["\xD1", "\u014B", "\u019D", "\u0376", "\u03A0", "\u048A"],
30279
- o: ["\xD8", "\xF5", "\xF8", "\u01FE", "\u0298", "\u047A", "\u05DD", "\u06DD", "\u0E4F"],
30280
- p: ["\u01F7", "\u048E"],
30281
- q: ["\u09CD"],
30282
- r: ["\xAE", "\u01A6", "\u0210", "\u024C", "\u0280", "\u042F"],
30283
- s: ["\xA7", "\u03DE", "\u03DF", "\u03E8"],
30284
- t: ["\u0141", "\u0166", "\u0373"],
30285
- u: ["\u01B1", "\u054D"],
30286
- v: ["\u05D8"],
30287
- w: ["\u0428", "\u0460", "\u047C", "\u0D70"],
30288
- x: ["\u04B2", "\u04FE", "\u04FC", "\u04FD"],
30289
- y: ["\xA5", "\u04B0", "\u04CB"],
30290
- z: ["\u01B5", "\u0240"]
30291
- };
30292
- text.forEach(function(c) {
30293
- c = c.toLowerCase();
30294
- var chars = trap[c] || [" "];
30295
- var rand = Math.floor(Math.random() * chars.length);
30296
- if (typeof trap[c] !== "undefined") {
30297
- result += trap[c][rand];
30298
- } else {
30299
- result += c;
30300
- }
30301
- });
30302
- return result;
30303
- };
30304
- }
30305
- });
30306
-
30307
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/custom/zalgo.js
30308
- var require_zalgo = __commonJS({
30309
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/custom/zalgo.js"(exports, module) {
30310
- module["exports"] = function zalgo(text, options) {
30311
- text = text || " he is here ";
30312
- var soul = {
30313
- "up": [
30314
- "\u030D",
30315
- "\u030E",
30316
- "\u0304",
30317
- "\u0305",
30318
- "\u033F",
30319
- "\u0311",
30320
- "\u0306",
30321
- "\u0310",
30322
- "\u0352",
30323
- "\u0357",
30324
- "\u0351",
30325
- "\u0307",
30326
- "\u0308",
30327
- "\u030A",
30328
- "\u0342",
30329
- "\u0313",
30330
- "\u0308",
30331
- "\u034A",
30332
- "\u034B",
30333
- "\u034C",
30334
- "\u0303",
30335
- "\u0302",
30336
- "\u030C",
30337
- "\u0350",
30338
- "\u0300",
30339
- "\u0301",
30340
- "\u030B",
30341
- "\u030F",
30342
- "\u0312",
30343
- "\u0313",
30344
- "\u0314",
30345
- "\u033D",
30346
- "\u0309",
30347
- "\u0363",
30348
- "\u0364",
30349
- "\u0365",
30350
- "\u0366",
30351
- "\u0367",
30352
- "\u0368",
30353
- "\u0369",
30354
- "\u036A",
30355
- "\u036B",
30356
- "\u036C",
30357
- "\u036D",
30358
- "\u036E",
30359
- "\u036F",
30360
- "\u033E",
30361
- "\u035B",
30362
- "\u0346",
30363
- "\u031A"
30364
- ],
30365
- "down": [
30366
- "\u0316",
30367
- "\u0317",
30368
- "\u0318",
30369
- "\u0319",
30370
- "\u031C",
30371
- "\u031D",
30372
- "\u031E",
30373
- "\u031F",
30374
- "\u0320",
30375
- "\u0324",
30376
- "\u0325",
30377
- "\u0326",
30378
- "\u0329",
30379
- "\u032A",
30380
- "\u032B",
30381
- "\u032C",
30382
- "\u032D",
30383
- "\u032E",
30384
- "\u032F",
30385
- "\u0330",
30386
- "\u0331",
30387
- "\u0332",
30388
- "\u0333",
30389
- "\u0339",
30390
- "\u033A",
30391
- "\u033B",
30392
- "\u033C",
30393
- "\u0345",
30394
- "\u0347",
30395
- "\u0348",
30396
- "\u0349",
30397
- "\u034D",
30398
- "\u034E",
30399
- "\u0353",
30400
- "\u0354",
30401
- "\u0355",
30402
- "\u0356",
30403
- "\u0359",
30404
- "\u035A",
30405
- "\u0323"
30406
- ],
30407
- "mid": [
30408
- "\u0315",
30409
- "\u031B",
30410
- "\u0300",
30411
- "\u0301",
30412
- "\u0358",
30413
- "\u0321",
30414
- "\u0322",
30415
- "\u0327",
30416
- "\u0328",
30417
- "\u0334",
30418
- "\u0335",
30419
- "\u0336",
30420
- "\u035C",
30421
- "\u035D",
30422
- "\u035E",
30423
- "\u035F",
30424
- "\u0360",
30425
- "\u0362",
30426
- "\u0338",
30427
- "\u0337",
30428
- "\u0361",
30429
- " \u0489"
30430
- ]
30431
- }, all = [].concat(soul.up, soul.down, soul.mid), zalgo2 = {};
30432
- function randomNumber(range) {
30433
- var r = Math.floor(Math.random() * range);
30434
- return r;
30435
- }
30436
- function is_char(character) {
30437
- var bool = false;
30438
- all.filter(function(i) {
30439
- bool = i === character;
30440
- });
30441
- return bool;
30442
- }
30443
- function heComes(text2, options2) {
30444
- var result = "", counts, l;
30445
- options2 = options2 || {};
30446
- options2["up"] = options2["up"] || true;
30447
- options2["mid"] = options2["mid"] || true;
30448
- options2["down"] = options2["down"] || true;
30449
- options2["size"] = options2["size"] || "maxi";
30450
- text2 = text2.split("");
30451
- for (l in text2) {
30452
- if (is_char(l)) {
30453
- continue;
30454
- }
30455
- result = result + text2[l];
30456
- counts = { "up": 0, "down": 0, "mid": 0 };
30457
- switch (options2.size) {
30458
- case "mini":
30459
- counts.up = randomNumber(8);
30460
- counts.min = randomNumber(2);
30461
- counts.down = randomNumber(8);
30462
- break;
30463
- case "maxi":
30464
- counts.up = randomNumber(16) + 3;
30465
- counts.min = randomNumber(4) + 1;
30466
- counts.down = randomNumber(64) + 3;
30467
- break;
30468
- default:
30469
- counts.up = randomNumber(8) + 1;
30470
- counts.mid = randomNumber(6) / 2;
30471
- counts.down = randomNumber(8) + 1;
30472
- break;
30473
- }
30474
- var arr = ["up", "mid", "down"];
30475
- for (var d in arr) {
30476
- var index = arr[d];
30477
- for (var i = 0; i <= counts[index]; i++) {
30478
- if (options2[index]) {
30479
- result = result + soul[index][randomNumber(soul[index].length)];
30480
- }
30481
- }
30482
- }
30483
- }
30484
- return result;
30485
- }
30486
- return heComes(text);
30487
- };
30488
- }
30489
- });
30490
-
30491
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/maps/america.js
30492
- var require_america = __commonJS({
30493
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/maps/america.js"(exports, module) {
30494
- var colors = require_colors();
30495
- module["exports"] = function() {
30496
- return function(letter, i, exploded) {
30497
- if (letter === " ")
30498
- return letter;
30499
- switch (i % 3) {
30500
- case 0:
30501
- return colors.red(letter);
30502
- case 1:
30503
- return colors.white(letter);
30504
- case 2:
30505
- return colors.blue(letter);
30506
- }
30507
- };
30508
- }();
30509
- }
30510
- });
30511
-
30512
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/maps/zebra.js
30513
- var require_zebra = __commonJS({
30514
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/maps/zebra.js"(exports, module) {
30515
- var colors = require_colors();
30516
- module["exports"] = function(letter, i, exploded) {
30517
- return i % 2 === 0 ? letter : colors.inverse(letter);
30518
- };
30519
- }
30520
- });
30521
-
30522
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/maps/rainbow.js
30523
- var require_rainbow = __commonJS({
30524
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/maps/rainbow.js"(exports, module) {
30525
- var colors = require_colors();
30526
- module["exports"] = function() {
30527
- var rainbowColors = ["red", "yellow", "green", "blue", "magenta"];
30528
- return function(letter, i, exploded) {
30529
- if (letter === " ") {
30530
- return letter;
30531
- } else {
30532
- return colors[rainbowColors[i++ % rainbowColors.length]](letter);
30533
- }
30534
- };
30535
- }();
30536
- }
30537
- });
30538
-
30539
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/maps/random.js
30540
- var require_random = __commonJS({
30541
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/maps/random.js"(exports, module) {
30542
- var colors = require_colors();
30543
- module["exports"] = function() {
30544
- var available = ["underline", "inverse", "grey", "yellow", "red", "green", "blue", "white", "cyan", "magenta"];
30545
- return function(letter, i, exploded) {
30546
- return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter);
30547
- };
30548
- }();
30549
- }
30550
- });
30551
-
30552
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/colors.js
30553
- var require_colors = __commonJS({
30554
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/lib/colors.js"(exports, module) {
30555
- var colors = {};
30556
- module["exports"] = colors;
30557
- colors.themes = {};
30558
- var ansiStyles = colors.styles = require_styles();
30559
- var defineProps = Object.defineProperties;
30560
- colors.supportsColor = require_supports_colors();
30561
- if (typeof colors.enabled === "undefined") {
30562
- colors.enabled = colors.supportsColor;
30563
- }
30564
- colors.stripColors = colors.strip = function(str) {
30565
- return ("" + str).replace(/\x1B\[\d+m/g, "");
30566
- };
30567
- var stylize = colors.stylize = function stylize2(str, style) {
30568
- return ansiStyles[style].open + str + ansiStyles[style].close;
30569
- };
30570
- var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
30571
- var escapeStringRegexp = function(str) {
30572
- if (typeof str !== "string") {
30573
- throw new TypeError("Expected a string");
30574
- }
30575
- return str.replace(matchOperatorsRe, "\\$&");
30576
- };
30577
- function build(_styles) {
30578
- var builder = function builder2() {
30579
- return applyStyle.apply(builder2, arguments);
30580
- };
30581
- builder._styles = _styles;
30582
- builder.__proto__ = proto;
30583
- return builder;
30584
- }
30585
- var styles = function() {
30586
- var ret2 = {};
30587
- ansiStyles.grey = ansiStyles.gray;
30588
- Object.keys(ansiStyles).forEach(function(key) {
30589
- ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g");
30590
- ret2[key] = {
30591
- get: function() {
30592
- return build(this._styles.concat(key));
30593
- }
30594
- };
30595
- });
30596
- return ret2;
30597
- }();
30598
- var proto = defineProps(function colors2() {
30599
- }, styles);
30600
- function applyStyle() {
30601
- var args = arguments;
30602
- var argsLen = args.length;
30603
- var str = argsLen !== 0 && String(arguments[0]);
30604
- if (argsLen > 1) {
30605
- for (var a = 1; a < argsLen; a++) {
30606
- str += " " + args[a];
30607
- }
30608
- }
30609
- if (!colors.enabled || !str) {
30610
- return str;
30611
- }
30612
- var nestedStyles = this._styles;
30613
- var i = nestedStyles.length;
30614
- while (i--) {
30615
- var code = ansiStyles[nestedStyles[i]];
30616
- str = code.open + str.replace(code.closeRe, code.open) + code.close;
30617
- }
30618
- return str;
30619
- }
30620
- function applyTheme(theme) {
30621
- for (var style in theme) {
30622
- (function(style2) {
30623
- colors[style2] = function(str) {
30624
- return colors[theme[style2]](str);
30625
- };
30626
- })(style);
30627
- }
30628
- }
30629
- colors.setTheme = function(theme) {
30630
- if (typeof theme === "string") {
30631
- try {
30632
- colors.themes[theme] = __require(theme);
30633
- applyTheme(colors.themes[theme]);
30634
- return colors.themes[theme];
30635
- } catch (err) {
30636
- console.log(err);
30637
- return err;
30638
- }
30639
- } else {
30640
- applyTheme(theme);
30641
- }
30642
- };
30643
- function init() {
30644
- var ret2 = {};
30645
- Object.keys(styles).forEach(function(name) {
30646
- ret2[name] = {
30647
- get: function() {
30648
- return build([name]);
30649
- }
30650
- };
30651
- });
30652
- return ret2;
30653
- }
30654
- var sequencer = function sequencer2(map2, str) {
30655
- var exploded = str.split(""), i = 0;
30656
- exploded = exploded.map(map2);
30657
- return exploded.join("");
30658
- };
30659
- colors.trap = require_trap();
30660
- colors.zalgo = require_zalgo();
30661
- colors.maps = {};
30662
- colors.maps.america = require_america();
30663
- colors.maps.zebra = require_zebra();
30664
- colors.maps.rainbow = require_rainbow();
30665
- colors.maps.random = require_random();
30666
- for (map in colors.maps) {
30667
- (function(map2) {
30668
- colors[map2] = function(str) {
30669
- return sequencer(colors.maps[map2], str);
30670
- };
30671
- })(map);
30672
- }
30673
- var map;
30674
- defineProps(colors, init());
30675
- }
30676
- });
30677
-
30678
- // ../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/safe.js
30679
- var require_safe = __commonJS({
30680
- "../../node_modules/.pnpm/colors@1.0.3/node_modules/colors/safe.js"(exports, module) {
30681
- var colors = require_colors();
30682
- module["exports"] = colors;
30683
- }
30684
- });
30685
-
30686
- // ../../node_modules/.pnpm/cli-table@0.3.11/node_modules/cli-table/lib/utils.js
30687
- var require_utils2 = __commonJS({
30688
- "../../node_modules/.pnpm/cli-table@0.3.11/node_modules/cli-table/lib/utils.js"(exports) {
30689
- exports.repeat = function(str, times) {
30690
- return Array(times + 1).join(str);
30691
- };
30692
- exports.pad = function(str, len, pad3, dir) {
30693
- if (len + 1 >= str.length)
30694
- switch (dir) {
30695
- case "left":
30696
- str = Array(len + 1 - str.length).join(pad3) + str;
30697
- break;
30698
- case "both":
30699
- var right = Math.ceil((padlen = len - str.length) / 2);
30700
- var left = padlen - right;
30701
- str = Array(left + 1).join(pad3) + str + Array(right + 1).join(pad3);
30702
- break;
30703
- default:
30704
- str = str + Array(len + 1 - str.length).join(pad3);
30705
- }
30706
- ;
30707
- return str;
30708
- };
30709
- exports.truncate = function(str, length, chr) {
30710
- chr = chr || "\u2026";
30711
- return str.length >= length ? str.substr(0, length - chr.length) + chr : str;
30712
- };
30713
- function options(defaults, opts) {
30714
- for (var p in opts) {
30715
- if (p === "__proto__" || p === "constructor" || p === "prototype") {
30716
- continue;
30717
- }
30718
- if (opts[p] && opts[p].constructor && opts[p].constructor === Object) {
30719
- defaults[p] = defaults[p] || {};
30720
- options(defaults[p], opts[p]);
30721
- } else {
30722
- defaults[p] = opts[p];
30723
- }
30724
- }
30725
- return defaults;
30726
- }
30727
- exports.options = options;
30728
- exports.strlen = function(str) {
30729
- var code = /\u001b\[(?:\d*;){0,5}\d*m/g;
30730
- var stripped = ("" + str).replace(code, "");
30731
- var split2 = stripped.split("\n");
30732
- return split2.reduce(function(memo, s) {
30733
- return s.length > memo ? s.length : memo;
30734
- }, 0);
30735
- };
30736
- }
30737
- });
30738
-
30739
- // ../../node_modules/.pnpm/cli-table@0.3.11/node_modules/cli-table/lib/index.js
30740
- var require_lib2 = __commonJS({
30741
- "../../node_modules/.pnpm/cli-table@0.3.11/node_modules/cli-table/lib/index.js"(exports, module) {
30742
- var colors = require_safe();
30743
- var utils = require_utils2();
30744
- var repeat = utils.repeat;
30745
- var truncate = utils.truncate;
30746
- var pad3 = utils.pad;
30747
- function Table(options) {
30748
- this.options = utils.options({
30749
- chars: {
30750
- "top": "\u2500",
30751
- "top-mid": "\u252C",
30752
- "top-left": "\u250C",
30753
- "top-right": "\u2510",
30754
- "bottom": "\u2500",
30755
- "bottom-mid": "\u2534",
30756
- "bottom-left": "\u2514",
30757
- "bottom-right": "\u2518",
30758
- "left": "\u2502",
30759
- "left-mid": "\u251C",
30760
- "mid": "\u2500",
30761
- "mid-mid": "\u253C",
30762
- "right": "\u2502",
30763
- "right-mid": "\u2524",
30764
- "middle": "\u2502"
30765
- },
30766
- truncate: "\u2026",
30767
- colWidths: [],
30768
- colAligns: [],
30769
- style: {
30770
- "padding-left": 1,
30771
- "padding-right": 1,
30772
- head: ["red"],
30773
- border: ["grey"],
30774
- compact: false
30775
- },
30776
- head: []
30777
- }, options);
30778
- if (options && options.rows) {
30779
- for (var i = 0; i < options.rows.length; i++) {
30780
- this.push(options.rows[i]);
30781
- }
30782
- }
30783
- }
30784
- Table.prototype.__proto__ = Array.prototype;
30785
- Table.prototype.__defineGetter__("width", function() {
30786
- var str = this.toString().split("\n");
30787
- if (str.length)
30788
- return str[0].length;
30789
- return 0;
30790
- });
30791
- Table.prototype.render;
30792
- Table.prototype.toString = function() {
30793
- var ret2 = "", options = this.options, style = options.style, head = options.head, chars = options.chars, truncater = options.truncate, colWidths = options.colWidths || new Array(this.head.length), totalWidth = 0;
30794
- if (!head.length && !this.length)
30795
- return "";
30796
- if (!colWidths.length) {
30797
- var all_rows = this.slice(0);
30798
- if (head.length) {
30799
- all_rows = all_rows.concat([head]);
30800
- }
30801
- ;
30802
- all_rows.forEach(function(cells) {
30803
- if (typeof cells === "object" && cells.length) {
30804
- extractColumnWidths(cells);
30805
- } else {
30806
- var header_cell = Object.keys(cells)[0], value_cell = cells[header_cell];
30807
- colWidths[0] = Math.max(colWidths[0] || 0, get_width(header_cell) || 0);
30808
- if (typeof value_cell === "object" && value_cell.length) {
30809
- extractColumnWidths(value_cell, 1);
30810
- } else {
30811
- colWidths[1] = Math.max(colWidths[1] || 0, get_width(value_cell) || 0);
30812
- }
30813
- }
30814
- });
30815
- }
30816
- ;
30817
- totalWidth = (colWidths.length == 1 ? colWidths[0] : colWidths.reduce(
30818
- function(a, b) {
30819
- return a + b;
30820
- }
30821
- )) + colWidths.length + 1;
30822
- function extractColumnWidths(arr, offset) {
30823
- var offset = offset || 0;
30824
- arr.forEach(function(cell, i) {
30825
- colWidths[i + offset] = Math.max(colWidths[i + offset] || 0, get_width(cell) || 0);
30826
- });
30827
- }
30828
- ;
30829
- function get_width(obj) {
30830
- return typeof obj == "object" && obj.width != void 0 ? obj.width : (typeof obj == "object" ? utils.strlen(obj.text) : utils.strlen(obj)) + (style["padding-left"] || 0) + (style["padding-right"] || 0);
30831
- }
30832
- function line(line2, left, right, intersection) {
30833
- var width = 0, line2 = left + repeat(line2, totalWidth - 2) + right;
30834
- colWidths.forEach(function(w, i) {
30835
- if (i == colWidths.length - 1)
30836
- return;
30837
- width += w + 1;
30838
- line2 = line2.substr(0, width) + intersection + line2.substr(width + 1);
30839
- });
30840
- return applyStyles(options.style.border, line2);
30841
- }
30842
- ;
30843
- function lineTop() {
30844
- var l2 = line(
30845
- chars.top,
30846
- chars["top-left"] || chars.top,
30847
- chars["top-right"] || chars.top,
30848
- chars["top-mid"]
30849
- );
30850
- if (l2)
30851
- ret2 += l2 + "\n";
30852
- }
30853
- ;
30854
- function generateRow(items, style2) {
30855
- var cells = [], max_height = 0;
30856
- if (!Array.isArray(items) && typeof items === "object") {
30857
- var key = Object.keys(items)[0], value = items[key], first_cell_head = true;
30858
- if (Array.isArray(value)) {
30859
- items = value;
30860
- items.unshift(key);
30861
- } else {
30862
- items = [key, value];
30863
- }
30864
- }
30865
- items.forEach(function(item, i) {
30866
- var contents = item.toString().split("\n").reduce(function(memo, l2) {
30867
- memo.push(string(l2, i));
30868
- return memo;
30869
- }, []);
30870
- var height = contents.length;
30871
- if (height > max_height) {
30872
- max_height = height;
30873
- }
30874
- ;
30875
- cells.push({ contents, height });
30876
- });
30877
- var lines = new Array(max_height);
30878
- cells.forEach(function(cell, i) {
30879
- cell.contents.forEach(function(line2, j2) {
30880
- if (!lines[j2]) {
30881
- lines[j2] = [];
30882
- }
30883
- ;
30884
- if (style2 || first_cell_head && i === 0 && options.style.head) {
30885
- line2 = applyStyles(options.style.head, line2);
30886
- }
30887
- lines[j2].push(line2);
30888
- });
30889
- for (var j = cell.height, l2 = max_height; j < l2; j++) {
30890
- if (!lines[j]) {
30891
- lines[j] = [];
30892
- }
30893
- ;
30894
- lines[j].push(string("", i));
30895
- }
30896
- });
30897
- var ret3 = "";
30898
- lines.forEach(function(line2, index) {
30899
- if (ret3.length > 0) {
30900
- ret3 += "\n" + applyStyles(options.style.border, chars.left);
30901
- }
30902
- ret3 += line2.join(applyStyles(options.style.border, chars.middle)) + applyStyles(options.style.border, chars.right);
30903
- });
30904
- return applyStyles(options.style.border, chars.left) + ret3;
30905
- }
30906
- ;
30907
- function applyStyles(styles, subject) {
30908
- if (!subject)
30909
- return "";
30910
- styles.forEach(function(style2) {
30911
- subject = colors[style2](subject);
30912
- });
30913
- return subject;
30914
- }
30915
- ;
30916
- function string(str, index) {
30917
- var str = String(typeof str == "object" && str.text ? str.text : str), length = utils.strlen(str), width = colWidths[index] - (style["padding-left"] || 0) - (style["padding-right"] || 0), align = options.colAligns[index] || "left";
30918
- return repeat(" ", style["padding-left"] || 0) + (length == width ? str : length < width ? pad3(str, width + (str.length - length), " ", align == "left" ? "right" : align == "middle" ? "both" : "left") : truncater ? truncate(str, width, truncater) : str) + repeat(" ", style["padding-right"] || 0);
30919
- }
30920
- ;
30921
- if (head.length) {
30922
- lineTop();
30923
- ret2 += generateRow(head, style.head) + "\n";
30924
- }
30925
- if (this.length)
30926
- this.forEach(function(cells, i) {
30927
- if (!head.length && i == 0)
30928
- lineTop();
30929
- else {
30930
- if (!style.compact || i < !!head.length ? 1 : cells.length == 0) {
30931
- var l2 = line(
30932
- chars.mid,
30933
- chars["left-mid"],
30934
- chars["right-mid"],
30935
- chars["mid-mid"]
30936
- );
30937
- if (l2)
30938
- ret2 += l2 + "\n";
30939
- }
30940
- }
30941
- if (cells.hasOwnProperty("length") && !cells.length) {
30942
- return;
30943
- } else {
30944
- ret2 += generateRow(cells) + "\n";
30945
- }
30946
- ;
30947
- });
30948
- var l = line(
30949
- chars.bottom,
30950
- chars["bottom-left"] || chars.bottom,
30951
- chars["bottom-right"] || chars.bottom,
30952
- chars["bottom-mid"]
30953
- );
30954
- if (l)
30955
- ret2 += l;
30956
- else
30957
- ret2 = ret2.slice(0, -1);
30958
- return ret2;
30959
- };
30960
- module.exports = Table;
30961
- module.exports.version = "0.0.1";
30962
- }
30963
- });
30964
-
30965
28632
  // ../../node_modules/.pnpm/async@2.6.4/node_modules/async/dist/async.js
30966
28633
  var require_async2 = __commonJS({
30967
28634
  "../../node_modules/.pnpm/async@2.6.4/node_modules/async/dist/async.js"(exports, module) {
@@ -33266,6 +30933,121 @@ spurious results.`);
33266
30933
  }
33267
30934
  });
33268
30935
 
30936
+ // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
30937
+ var require_has_flag = __commonJS({
30938
+ "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
30939
+ "use strict";
30940
+ module.exports = (flag, argv = process.argv) => {
30941
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
30942
+ const position = argv.indexOf(prefix + flag);
30943
+ const terminatorPosition = argv.indexOf("--");
30944
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
30945
+ };
30946
+ }
30947
+ });
30948
+
30949
+ // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
30950
+ var require_supports_color = __commonJS({
30951
+ "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
30952
+ "use strict";
30953
+ var os2 = __require("os");
30954
+ var tty = __require("tty");
30955
+ var hasFlag = require_has_flag();
30956
+ var { env } = process;
30957
+ var forceColor;
30958
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
30959
+ forceColor = 0;
30960
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
30961
+ forceColor = 1;
30962
+ }
30963
+ if ("FORCE_COLOR" in env) {
30964
+ if (env.FORCE_COLOR === "true") {
30965
+ forceColor = 1;
30966
+ } else if (env.FORCE_COLOR === "false") {
30967
+ forceColor = 0;
30968
+ } else {
30969
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
30970
+ }
30971
+ }
30972
+ function translateLevel(level) {
30973
+ if (level === 0) {
30974
+ return false;
30975
+ }
30976
+ return {
30977
+ level,
30978
+ hasBasic: true,
30979
+ has256: level >= 2,
30980
+ has16m: level >= 3
30981
+ };
30982
+ }
30983
+ function supportsColor(haveStream, streamIsTTY) {
30984
+ if (forceColor === 0) {
30985
+ return 0;
30986
+ }
30987
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
30988
+ return 3;
30989
+ }
30990
+ if (hasFlag("color=256")) {
30991
+ return 2;
30992
+ }
30993
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
30994
+ return 0;
30995
+ }
30996
+ const min = forceColor || 0;
30997
+ if (env.TERM === "dumb") {
30998
+ return min;
30999
+ }
31000
+ if (process.platform === "win32") {
31001
+ const osRelease = os2.release().split(".");
31002
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
31003
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
31004
+ }
31005
+ return 1;
31006
+ }
31007
+ if ("CI" in env) {
31008
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
31009
+ return 1;
31010
+ }
31011
+ return min;
31012
+ }
31013
+ if ("TEAMCITY_VERSION" in env) {
31014
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
31015
+ }
31016
+ if (env.COLORTERM === "truecolor") {
31017
+ return 3;
31018
+ }
31019
+ if ("TERM_PROGRAM" in env) {
31020
+ const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
31021
+ switch (env.TERM_PROGRAM) {
31022
+ case "iTerm.app":
31023
+ return version >= 3 ? 3 : 2;
31024
+ case "Apple_Terminal":
31025
+ return 2;
31026
+ }
31027
+ }
31028
+ if (/-256(color)?$/i.test(env.TERM)) {
31029
+ return 2;
31030
+ }
31031
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
31032
+ return 1;
31033
+ }
31034
+ if ("COLORTERM" in env) {
31035
+ return 1;
31036
+ }
31037
+ return min;
31038
+ }
31039
+ function getSupportLevel(stream) {
31040
+ const level = supportsColor(stream, stream && stream.isTTY);
31041
+ return translateLevel(level);
31042
+ }
31043
+ module.exports = {
31044
+ supportsColor: getSupportLevel,
31045
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
31046
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
31047
+ };
31048
+ }
31049
+ });
31050
+
33269
31051
  // ../../node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/node.js
33270
31052
  var require_node2 = __commonJS({
33271
31053
  "../../node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/node.js"(exports, module) {
@@ -52123,34 +49905,12 @@ Supported fuel-core version: ${supportedVersion}.`
52123
49905
  return wallet;
52124
49906
  };
52125
49907
 
52126
- // ../utils/dist/cli-utils.mjs
52127
- var import_fs = __require("fs");
52128
- var import_path7 = __require("path");
52129
-
52130
- // ../versions/dist/cli.mjs
52131
- var import_chalk = __toESM(require_source2(), 1);
52132
- var import_cli_table = __toESM(require_lib2(), 1);
52133
- var import_chalk2 = __toESM(require_source2(), 1);
52134
-
52135
- // ../utils/dist/cli-utils.mjs
52136
- var findBinPath = (binCommandName, startingDir) => {
52137
- const cmdPath = (0, import_path7.join)(startingDir, "node_modules", ".bin", binCommandName);
52138
- const parentDir = (0, import_path7.join)(startingDir, "..");
52139
- if ((0, import_fs.existsSync)(cmdPath)) {
52140
- return cmdPath;
52141
- }
52142
- if (parentDir === startingDir) {
52143
- throw new Error(`Command not found: ${binCommandName}`);
52144
- }
52145
- return findBinPath(binCommandName, parentDir);
52146
- };
52147
-
52148
49908
  // src/test-utils/launchNode.ts
52149
49909
  var import_child_process = __require("child_process");
52150
49910
  var import_crypto19 = __require("crypto");
52151
- var import_fs2 = __require("fs");
49911
+ var import_fs = __require("fs");
52152
49912
  var import_os = __toESM(__require("os"));
52153
- var import_path8 = __toESM(__require("path"));
49913
+ var import_path7 = __toESM(__require("path"));
52154
49914
  var import_portfinder = __toESM(require_portfinder());
52155
49915
  var import_tree_kill = __toESM(require_tree_kill());
52156
49916
  var getFlagValueFromArgs = (args, flag) => {
@@ -52179,8 +49939,8 @@ Supported fuel-core version: ${supportedVersion}.`
52179
49939
  }
52180
49940
  child.stdout.removeAllListeners();
52181
49941
  child.stderr.removeAllListeners();
52182
- if ((0, import_fs2.existsSync)(configPath)) {
52183
- (0, import_fs2.rmSync)(configPath, { recursive: true });
49942
+ if ((0, import_fs.existsSync)(configPath)) {
49943
+ (0, import_fs.rmSync)(configPath, { recursive: true });
52184
49944
  }
52185
49945
  }
52186
49946
  };
@@ -52188,8 +49948,7 @@ Supported fuel-core version: ${supportedVersion}.`
52188
49948
  ip,
52189
49949
  port,
52190
49950
  args = [],
52191
- fuelCorePath = void 0,
52192
- useSystemFuelCore = false,
49951
+ fuelCorePath = process.env.FUEL_CORE_PATH ?? void 0,
52193
49952
  loggingEnabled = true,
52194
49953
  debugEnabled = false,
52195
49954
  basePath
@@ -52209,8 +49968,7 @@ Supported fuel-core version: ${supportedVersion}.`
52209
49968
  const poaInstantFlagValue = getFlagValueFromArgs(args, "--poa-instant");
52210
49969
  const poaInstant = poaInstantFlagValue === "true" || poaInstantFlagValue === void 0;
52211
49970
  const graphQLStartSubstring = "Binding GraphQL provider to";
52212
- const binPath = fuelCorePath ?? findBinPath("fuels-core", __dirname);
52213
- const command = useSystemFuelCore ? "fuel-core" : binPath;
49971
+ const command = fuelCorePath ?? "fuel-core";
52214
49972
  const ipToUse = ip || "0.0.0.0";
52215
49973
  const portToUse = port || (await (0, import_portfinder.getPortPromise)({
52216
49974
  port: 4e3,
@@ -52221,12 +49979,12 @@ Supported fuel-core version: ${supportedVersion}.`
52221
49979
  let snapshotDirToUse;
52222
49980
  const prefix = basePath || import_os.default.tmpdir();
52223
49981
  const suffix = basePath ? "" : (0, import_crypto19.randomUUID)();
52224
- const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "snapshotDir");
49982
+ const tempDirPath = import_path7.default.join(prefix, ".fuels", suffix, "snapshotDir");
52225
49983
  if (snapshotDir) {
52226
49984
  snapshotDirToUse = snapshotDir;
52227
49985
  } else {
52228
- if (!(0, import_fs2.existsSync)(tempDirPath)) {
52229
- (0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
49986
+ if (!(0, import_fs.existsSync)(tempDirPath)) {
49987
+ (0, import_fs.mkdirSync)(tempDirPath, { recursive: true });
52230
49988
  }
52231
49989
  let { stateConfigJson } = defaultSnapshotConfigs;
52232
49990
  const { chainConfigJson, metadataJson } = defaultSnapshotConfigs;
@@ -52262,14 +50020,14 @@ Supported fuel-core version: ${supportedVersion}.`
52262
50020
  let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
52263
50021
  const regexMakeNumber = /("amount":)"(\d+)"/gm;
52264
50022
  fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
52265
- const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
52266
- const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
52267
- const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
52268
- const stateTransitionWritePath = import_path8.default.join(tempDirPath, "state_transition_bytecode.wasm");
52269
- (0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
52270
- (0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
52271
- (0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
52272
- (0, import_fs2.writeFileSync)(stateTransitionWritePath, JSON.stringify(""));
50023
+ const chainConfigWritePath = import_path7.default.join(tempDirPath, "chainConfig.json");
50024
+ const stateConfigWritePath = import_path7.default.join(tempDirPath, "stateConfig.json");
50025
+ const metadataWritePath = import_path7.default.join(tempDirPath, "metadata.json");
50026
+ const stateTransitionWritePath = import_path7.default.join(tempDirPath, "state_transition_bytecode.wasm");
50027
+ (0, import_fs.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
50028
+ (0, import_fs.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
50029
+ (0, import_fs.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
50030
+ (0, import_fs.writeFileSync)(stateTransitionWritePath, JSON.stringify(""));
52273
50031
  snapshotDirToUse = tempDirPath;
52274
50032
  }
52275
50033
  const child = (0, import_child_process.spawn)(