@typespec/html-program-viewer 0.58.0 → 0.59.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18698,6 +18698,7 @@ var code$1 = {};
18698
18698
  (function (exports) {
18699
18699
  Object.defineProperty(exports, "__esModule", { value: true });
18700
18700
  exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
18701
+ // eslint-disable-next-line @typescript-eslint/no-extraneous-class
18701
18702
  class _CodeOrName {
18702
18703
  }
18703
18704
  exports._CodeOrName = _CodeOrName;
@@ -20706,7 +20707,7 @@ function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, composi
20706
20707
  }
20707
20708
  subschema.extendSubschemaMode = extendSubschemaMode;
20708
20709
 
20709
- var resolve$1 = {};
20710
+ var resolve$2 = {};
20710
20711
 
20711
20712
  // do not edit .js files directly - edit src/index.jst
20712
20713
 
@@ -20849,10 +20850,10 @@ function escapeJsonPtr(str) {
20849
20850
 
20850
20851
  var jsonSchemaTraverseExports = jsonSchemaTraverse.exports;
20851
20852
 
20852
- Object.defineProperty(resolve$1, "__esModule", { value: true });
20853
- resolve$1.getSchemaRefs = resolve$1.resolveUrl = resolve$1.normalizeId = resolve$1._getFullPath = resolve$1.getFullPath = resolve$1.inlineRef = void 0;
20853
+ Object.defineProperty(resolve$2, "__esModule", { value: true });
20854
+ resolve$2.getSchemaRefs = resolve$2.resolveUrl = resolve$2.normalizeId = resolve$2._getFullPath = resolve$2.getFullPath = resolve$2.inlineRef = void 0;
20854
20855
  const util_1$m = util;
20855
- const equal$2 = fastDeepEqual;
20856
+ const equal$3 = fastDeepEqual;
20856
20857
  const traverse = jsonSchemaTraverseExports;
20857
20858
  // TODO refactor to use keyword definitions
20858
20859
  const SIMPLE_INLINED = new Set([
@@ -20882,7 +20883,7 @@ function inlineRef(schema, limit = true) {
20882
20883
  return false;
20883
20884
  return countKeys(schema) <= limit;
20884
20885
  }
20885
- resolve$1.inlineRef = inlineRef;
20886
+ resolve$2.inlineRef = inlineRef;
20886
20887
  const REF_KEYWORDS = new Set([
20887
20888
  "$ref",
20888
20889
  "$recursiveRef",
@@ -20924,22 +20925,22 @@ function getFullPath(resolver, id = "", normalize) {
20924
20925
  const p = resolver.parse(id);
20925
20926
  return _getFullPath(resolver, p);
20926
20927
  }
20927
- resolve$1.getFullPath = getFullPath;
20928
+ resolve$2.getFullPath = getFullPath;
20928
20929
  function _getFullPath(resolver, p) {
20929
20930
  const serialized = resolver.serialize(p);
20930
20931
  return serialized.split("#")[0] + "#";
20931
20932
  }
20932
- resolve$1._getFullPath = _getFullPath;
20933
+ resolve$2._getFullPath = _getFullPath;
20933
20934
  const TRAILING_SLASH_HASH = /#\/?$/;
20934
20935
  function normalizeId(id) {
20935
20936
  return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
20936
20937
  }
20937
- resolve$1.normalizeId = normalizeId;
20938
+ resolve$2.normalizeId = normalizeId;
20938
20939
  function resolveUrl(resolver, baseId, id) {
20939
20940
  id = normalizeId(id);
20940
20941
  return resolver.resolve(baseId, id);
20941
20942
  }
20942
- resolve$1.resolveUrl = resolveUrl;
20943
+ resolve$2.resolveUrl = resolveUrl;
20943
20944
  const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
20944
20945
  function getSchemaRefs(schema, baseId) {
20945
20946
  if (typeof schema == "boolean")
@@ -20994,14 +20995,14 @@ function getSchemaRefs(schema, baseId) {
20994
20995
  });
20995
20996
  return localRefs;
20996
20997
  function checkAmbiguosRef(sch1, sch2, ref) {
20997
- if (sch2 !== undefined && !equal$2(sch1, sch2))
20998
+ if (sch2 !== undefined && !equal$3(sch1, sch2))
20998
20999
  throw ambiguos(ref);
20999
21000
  }
21000
21001
  function ambiguos(ref) {
21001
21002
  return new Error(`reference "${ref}" resolves to more than one schema`);
21002
21003
  }
21003
21004
  }
21004
- resolve$1.getSchemaRefs = getSchemaRefs;
21005
+ resolve$2.getSchemaRefs = getSchemaRefs;
21005
21006
 
21006
21007
  Object.defineProperty(validate, "__esModule", { value: true });
21007
21008
  validate.getData = validate.KeywordCxt = validate.validateFunctionCode = void 0;
@@ -21014,7 +21015,7 @@ const keyword_1 = keyword;
21014
21015
  const subschema_1 = subschema;
21015
21016
  const codegen_1$n = codegen;
21016
21017
  const names_1$3 = names$1;
21017
- const resolve_1$2 = resolve$1;
21018
+ const resolve_1$2 = resolve$2;
21018
21019
  const util_1$l = util;
21019
21020
  const errors_1 = errors;
21020
21021
  // schema compilation - generates validation function, subschemaCode (below) is used for subschemas
@@ -21536,7 +21537,7 @@ validation_error.default = ValidationError;
21536
21537
  var ref_error = {};
21537
21538
 
21538
21539
  Object.defineProperty(ref_error, "__esModule", { value: true });
21539
- const resolve_1$1 = resolve$1;
21540
+ const resolve_1$1 = resolve$2;
21540
21541
  class MissingRefError extends Error {
21541
21542
  constructor(resolver, baseId, ref, msg) {
21542
21543
  super(msg || `can't resolve reference ${ref} from id ${baseId}`);
@@ -21553,7 +21554,7 @@ compile.resolveSchema = compile.getCompilingSchema = compile.resolveRef = compil
21553
21554
  const codegen_1$m = codegen;
21554
21555
  const validation_error_1 = validation_error;
21555
21556
  const names_1$2 = names$1;
21556
- const resolve_1 = resolve$1;
21557
+ const resolve_1 = resolve$2;
21557
21558
  const util_1$k = util;
21558
21559
  const validate_1$1 = validate;
21559
21560
  class SchemaEnv {
@@ -21679,7 +21680,7 @@ function resolveRef(root, baseId, ref) {
21679
21680
  const schOrFunc = root.refs[ref];
21680
21681
  if (schOrFunc)
21681
21682
  return schOrFunc;
21682
- let _sch = resolve.call(this, root, ref);
21683
+ let _sch = resolve$1.call(this, root, ref);
21683
21684
  if (_sch === undefined) {
21684
21685
  const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv
21685
21686
  const { schemaId } = this.opts;
@@ -21709,7 +21710,7 @@ function sameSchemaEnv(s1, s2) {
21709
21710
  }
21710
21711
  // resolve and compile the references ($ref)
21711
21712
  // TODO returns AnySchemaObject (if the schema can be inlined) or validation function
21712
- function resolve(root, // information about the root schema for the current schema
21713
+ function resolve$1(root, // information about the root schema for the current schema
21713
21714
  ref // reference to resolve
21714
21715
  ) {
21715
21716
  let sch;
@@ -21820,1418 +21821,776 @@ const require$$9 = {
21820
21821
 
21821
21822
  var uri$1 = {};
21822
21823
 
21823
- var uri_all = {exports: {}};
21824
-
21825
- /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
21826
-
21827
- (function (module, exports) {
21828
- (function (global, factory) {
21829
- factory(exports) ;
21830
- }(commonjsGlobal, (function (exports) {
21831
- function merge() {
21832
- for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
21833
- sets[_key] = arguments[_key];
21834
- }
21835
-
21836
- if (sets.length > 1) {
21837
- sets[0] = sets[0].slice(0, -1);
21838
- var xl = sets.length - 1;
21839
- for (var x = 1; x < xl; ++x) {
21840
- sets[x] = sets[x].slice(1, -1);
21841
- }
21842
- sets[xl] = sets[xl].slice(1);
21843
- return sets.join('');
21844
- } else {
21845
- return sets[0];
21846
- }
21847
- }
21848
- function subexp(str) {
21849
- return "(?:" + str + ")";
21850
- }
21851
- function typeOf(o) {
21852
- return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
21853
- }
21854
- function toUpperCase(str) {
21855
- return str.toUpperCase();
21856
- }
21857
- function toArray(obj) {
21858
- return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
21859
- }
21860
- function assign(target, source) {
21861
- var obj = target;
21862
- if (source) {
21863
- for (var key in source) {
21864
- obj[key] = source[key];
21865
- }
21866
- }
21867
- return obj;
21868
- }
21869
-
21870
- function buildExps(isIRI) {
21871
- var ALPHA$$ = "[A-Za-z]",
21872
- DIGIT$$ = "[0-9]",
21873
- HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"),
21874
- PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)),
21875
- //expanded
21876
- GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]",
21877
- SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
21878
- RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),
21879
- UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]",
21880
- //subset, excludes bidi control characters
21881
- IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
21882
- //subset
21883
- UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$);
21884
- subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*");
21885
- subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*");
21886
- var DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$),
21887
- //relaxed parsing rules
21888
- IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
21889
- H16$ = subexp(HEXDIG$$ + "{1,4}"),
21890
- LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$),
21891
- IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$),
21892
- // 6( h16 ":" ) ls32
21893
- IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$),
21894
- // "::" 5( h16 ":" ) ls32
21895
- IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$),
21896
- //[ h16 ] "::" 4( h16 ":" ) ls32
21897
- IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$),
21898
- //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
21899
- IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$),
21900
- //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
21901
- IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$),
21902
- //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
21903
- IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$),
21904
- //[ *4( h16 ":" ) h16 ] "::" ls32
21905
- IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$),
21906
- //[ *5( h16 ":" ) h16 ] "::" h16
21907
- IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
21908
- //[ *6( h16 ":" ) h16 ] "::"
21909
- IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
21910
- ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+");
21911
- //RFC 6874, with relaxed parsing rules
21912
- subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+");
21913
- //RFC 6874
21914
- subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*");
21915
- var PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]"));
21916
- subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+");
21917
- subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*");
21918
- return {
21919
- NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
21920
- NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
21921
- NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
21922
- NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
21923
- NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
21924
- NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
21925
- NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
21926
- ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
21927
- UNRESERVED: new RegExp(UNRESERVED$$, "g"),
21928
- OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
21929
- PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
21930
- IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
21931
- IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
21932
- };
21933
- }
21934
- var URI_PROTOCOL = buildExps(false);
21935
-
21936
- var IRI_PROTOCOL = buildExps(true);
21937
-
21938
- var slicedToArray = function () {
21939
- function sliceIterator(arr, i) {
21940
- var _arr = [];
21941
- var _n = true;
21942
- var _d = false;
21943
- var _e = undefined;
21944
-
21945
- try {
21946
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
21947
- _arr.push(_s.value);
21948
-
21949
- if (i && _arr.length === i) break;
21950
- }
21951
- } catch (err) {
21952
- _d = true;
21953
- _e = err;
21954
- } finally {
21955
- try {
21956
- if (!_n && _i["return"]) _i["return"]();
21957
- } finally {
21958
- if (_d) throw _e;
21959
- }
21960
- }
21961
-
21962
- return _arr;
21963
- }
21964
-
21965
- return function (arr, i) {
21966
- if (Array.isArray(arr)) {
21967
- return arr;
21968
- } else if (Symbol.iterator in Object(arr)) {
21969
- return sliceIterator(arr, i);
21970
- } else {
21971
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
21972
- }
21973
- };
21974
- }();
21975
-
21824
+ var fastUri$1 = {exports: {}};
21825
+
21826
+ const HEX$1 = {
21827
+ 0: 0,
21828
+ 1: 1,
21829
+ 2: 2,
21830
+ 3: 3,
21831
+ 4: 4,
21832
+ 5: 5,
21833
+ 6: 6,
21834
+ 7: 7,
21835
+ 8: 8,
21836
+ 9: 9,
21837
+ a: 10,
21838
+ A: 10,
21839
+ b: 11,
21840
+ B: 11,
21841
+ c: 12,
21842
+ C: 12,
21843
+ d: 13,
21844
+ D: 13,
21845
+ e: 14,
21846
+ E: 14,
21847
+ f: 15,
21848
+ F: 15
21849
+ };
21976
21850
 
21851
+ var scopedChars = {
21852
+ HEX: HEX$1
21853
+ };
21977
21854
 
21855
+ const { HEX } = scopedChars;
21978
21856
 
21857
+ function normalizeIPv4$1 (host) {
21858
+ if (findToken(host, '.') < 3) { return { host, isIPV4: false } }
21859
+ const matches = host.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u) || [];
21860
+ const [address] = matches;
21861
+ if (address) {
21862
+ return { host: stripLeadingZeros(address, '.'), isIPV4: true }
21863
+ } else {
21864
+ return { host, isIPV4: false }
21865
+ }
21866
+ }
21979
21867
 
21868
+ /**
21869
+ * @param {string[]} input
21870
+ * @param {boolean} [keepZero=false]
21871
+ * @returns {string|undefined}
21872
+ */
21873
+ function stringArrayToHexStripped (input, keepZero = false) {
21874
+ let acc = '';
21875
+ let strip = true;
21876
+ for (const c of input) {
21877
+ if (HEX[c] === undefined) return undefined
21878
+ if (c !== '0' && strip === true) strip = false;
21879
+ if (!strip) acc += c;
21880
+ }
21881
+ if (keepZero && acc.length === 0) acc = '0';
21882
+ return acc
21883
+ }
21884
+
21885
+ function getIPV6 (input) {
21886
+ let tokenCount = 0;
21887
+ const output = { error: false, address: '', zone: '' };
21888
+ const address = [];
21889
+ const buffer = [];
21890
+ let isZone = false;
21891
+ let endipv6Encountered = false;
21892
+ let endIpv6 = false;
21893
+
21894
+ function consume () {
21895
+ if (buffer.length) {
21896
+ if (isZone === false) {
21897
+ const hex = stringArrayToHexStripped(buffer);
21898
+ if (hex !== undefined) {
21899
+ address.push(hex);
21900
+ } else {
21901
+ output.error = true;
21902
+ return false
21903
+ }
21904
+ }
21905
+ buffer.length = 0;
21906
+ }
21907
+ return true
21908
+ }
21980
21909
 
21910
+ for (let i = 0; i < input.length; i++) {
21911
+ const cursor = input[i];
21912
+ if (cursor === '[' || cursor === ']') { continue }
21913
+ if (cursor === ':') {
21914
+ if (endipv6Encountered === true) {
21915
+ endIpv6 = true;
21916
+ }
21917
+ if (!consume()) { break }
21918
+ tokenCount++;
21919
+ address.push(':');
21920
+ if (tokenCount > 7) {
21921
+ // not valid
21922
+ output.error = true;
21923
+ break
21924
+ }
21925
+ if (i - 1 >= 0 && input[i - 1] === ':') {
21926
+ endipv6Encountered = true;
21927
+ }
21928
+ continue
21929
+ } else if (cursor === '%') {
21930
+ if (!consume()) { break }
21931
+ // switch to zone detection
21932
+ isZone = true;
21933
+ } else {
21934
+ buffer.push(cursor);
21935
+ continue
21936
+ }
21937
+ }
21938
+ if (buffer.length) {
21939
+ if (isZone) {
21940
+ output.zone = buffer.join('');
21941
+ } else if (endIpv6) {
21942
+ address.push(buffer.join(''));
21943
+ } else {
21944
+ address.push(stringArrayToHexStripped(buffer));
21945
+ }
21946
+ }
21947
+ output.address = address.join('');
21948
+ return output
21949
+ }
21981
21950
 
21951
+ function normalizeIPv6$1 (host, opts = {}) {
21952
+ if (findToken(host, ':') < 2) { return { host, isIPV6: false } }
21953
+ const ipv6 = getIPV6(host);
21982
21954
 
21955
+ if (!ipv6.error) {
21956
+ let newHost = ipv6.address;
21957
+ let escapedHost = ipv6.address;
21958
+ if (ipv6.zone) {
21959
+ newHost += '%' + ipv6.zone;
21960
+ escapedHost += '%25' + ipv6.zone;
21961
+ }
21962
+ return { host: newHost, escapedHost, isIPV6: true }
21963
+ } else {
21964
+ return { host, isIPV6: false }
21965
+ }
21966
+ }
21983
21967
 
21968
+ function stripLeadingZeros (str, token) {
21969
+ let out = '';
21970
+ let skip = true;
21971
+ const l = str.length;
21972
+ for (let i = 0; i < l; i++) {
21973
+ const c = str[i];
21974
+ if (c === '0' && skip) {
21975
+ if ((i + 1 <= l && str[i + 1] === token) || i + 1 === l) {
21976
+ out += c;
21977
+ skip = false;
21978
+ }
21979
+ } else {
21980
+ if (c === token) {
21981
+ skip = true;
21982
+ } else {
21983
+ skip = false;
21984
+ }
21985
+ out += c;
21986
+ }
21987
+ }
21988
+ return out
21989
+ }
21984
21990
 
21991
+ function findToken (str, token) {
21992
+ let ind = 0;
21993
+ for (let i = 0; i < str.length; i++) {
21994
+ if (str[i] === token) ind++;
21995
+ }
21996
+ return ind
21997
+ }
21998
+
21999
+ const RDS1 = /^\.\.?\//u;
22000
+ const RDS2 = /^\/\.(?:\/|$)/u;
22001
+ const RDS3 = /^\/\.\.(?:\/|$)/u;
22002
+ const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u;
22003
+
22004
+ function removeDotSegments$1 (input) {
22005
+ const output = [];
22006
+
22007
+ while (input.length) {
22008
+ if (input.match(RDS1)) {
22009
+ input = input.replace(RDS1, '');
22010
+ } else if (input.match(RDS2)) {
22011
+ input = input.replace(RDS2, '/');
22012
+ } else if (input.match(RDS3)) {
22013
+ input = input.replace(RDS3, '/');
22014
+ output.pop();
22015
+ } else if (input === '.' || input === '..') {
22016
+ input = '';
22017
+ } else {
22018
+ const im = input.match(RDS5);
22019
+ if (im) {
22020
+ const s = im[0];
22021
+ input = input.slice(s.length);
22022
+ output.push(s);
22023
+ } else {
22024
+ throw new Error('Unexpected dot segment condition')
22025
+ }
22026
+ }
22027
+ }
22028
+ return output.join('')
22029
+ }
21985
22030
 
22031
+ function normalizeComponentEncoding$1 (components, esc) {
22032
+ const func = esc !== true ? escape : unescape;
22033
+ if (components.scheme !== undefined) {
22034
+ components.scheme = func(components.scheme);
22035
+ }
22036
+ if (components.userinfo !== undefined) {
22037
+ components.userinfo = func(components.userinfo);
22038
+ }
22039
+ if (components.host !== undefined) {
22040
+ components.host = func(components.host);
22041
+ }
22042
+ if (components.path !== undefined) {
22043
+ components.path = func(components.path);
22044
+ }
22045
+ if (components.query !== undefined) {
22046
+ components.query = func(components.query);
22047
+ }
22048
+ if (components.fragment !== undefined) {
22049
+ components.fragment = func(components.fragment);
22050
+ }
22051
+ return components
22052
+ }
21986
22053
 
22054
+ function recomposeAuthority$1 (components, options) {
22055
+ const uriTokens = [];
21987
22056
 
21988
- var toConsumableArray = function (arr) {
21989
- if (Array.isArray(arr)) {
21990
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
22057
+ if (components.userinfo !== undefined) {
22058
+ uriTokens.push(components.userinfo);
22059
+ uriTokens.push('@');
22060
+ }
21991
22061
 
21992
- return arr2;
21993
- } else {
21994
- return Array.from(arr);
21995
- }
21996
- };
22062
+ if (components.host !== undefined) {
22063
+ let host = unescape(components.host);
22064
+ const ipV4res = normalizeIPv4$1(host);
21997
22065
 
21998
- /** Highest positive signed 32-bit float value */
21999
-
22000
- var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
22001
-
22002
- /** Bootstring parameters */
22003
- var base = 36;
22004
- var tMin = 1;
22005
- var tMax = 26;
22006
- var skew = 38;
22007
- var damp = 700;
22008
- var initialBias = 72;
22009
- var initialN = 128; // 0x80
22010
- var delimiter = '-'; // '\x2D'
22011
-
22012
- /** Regular expressions */
22013
- var regexPunycode = /^xn--/;
22014
- var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
22015
- var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
22016
-
22017
- /** Error messages */
22018
- var errors = {
22019
- 'overflow': 'Overflow: input needs wider integers to process',
22020
- 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
22021
- 'invalid-input': 'Invalid input'
22022
- };
22066
+ if (ipV4res.isIPV4) {
22067
+ host = ipV4res.host;
22068
+ } else {
22069
+ const ipV6res = normalizeIPv6$1(ipV4res.host, { isIPV4: false });
22070
+ if (ipV6res.isIPV6 === true) {
22071
+ host = `[${ipV6res.escapedHost}]`;
22072
+ } else {
22073
+ host = components.host;
22074
+ }
22075
+ }
22076
+ uriTokens.push(host);
22077
+ }
22023
22078
 
22024
- /** Convenience shortcuts */
22025
- var baseMinusTMin = base - tMin;
22026
- var floor = Math.floor;
22027
- var stringFromCharCode = String.fromCharCode;
22079
+ if (typeof components.port === 'number' || typeof components.port === 'string') {
22080
+ uriTokens.push(':');
22081
+ uriTokens.push(String(components.port));
22082
+ }
22028
22083
 
22029
- /*--------------------------------------------------------------------------*/
22084
+ return uriTokens.length ? uriTokens.join('') : undefined
22085
+ }
22086
+ var utils$1 = {
22087
+ recomposeAuthority: recomposeAuthority$1,
22088
+ normalizeComponentEncoding: normalizeComponentEncoding$1,
22089
+ removeDotSegments: removeDotSegments$1,
22090
+ normalizeIPv4: normalizeIPv4$1,
22091
+ normalizeIPv6: normalizeIPv6$1,
22092
+ stringArrayToHexStripped
22093
+ };
22030
22094
 
22031
- /**
22032
- * A generic error utility function.
22033
- * @private
22034
- * @param {String} type The error type.
22035
- * @returns {Error} Throws a `RangeError` with the applicable error message.
22036
- */
22037
- function error$1(type) {
22038
- throw new RangeError(errors[type]);
22039
- }
22095
+ const UUID_REG = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu;
22096
+ const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
22040
22097
 
22041
- /**
22042
- * A generic `Array#map` utility function.
22043
- * @private
22044
- * @param {Array} array The array to iterate over.
22045
- * @param {Function} callback The function that gets called for every array
22046
- * item.
22047
- * @returns {Array} A new array of values returned by the callback function.
22048
- */
22049
- function map(array, fn) {
22050
- var result = [];
22051
- var length = array.length;
22052
- while (length--) {
22053
- result[length] = fn(array[length]);
22054
- }
22055
- return result;
22056
- }
22098
+ function isSecure (wsComponents) {
22099
+ return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === 'wss'
22100
+ }
22057
22101
 
22058
- /**
22059
- * A simple `Array#map`-like wrapper to work with domain name strings or email
22060
- * addresses.
22061
- * @private
22062
- * @param {String} domain The domain name or email address.
22063
- * @param {Function} callback The function that gets called for every
22064
- * character.
22065
- * @returns {Array} A new string of characters returned by the callback
22066
- * function.
22067
- */
22068
- function mapDomain(string, fn) {
22069
- var parts = string.split('@');
22070
- var result = '';
22071
- if (parts.length > 1) {
22072
- // In email addresses, only the domain name should be punycoded. Leave
22073
- // the local part (i.e. everything up to `@`) intact.
22074
- result = parts[0] + '@';
22075
- string = parts[1];
22076
- }
22077
- // Avoid `split(regex)` for IE8 compatibility. See #17.
22078
- string = string.replace(regexSeparators, '\x2E');
22079
- var labels = string.split('.');
22080
- var encoded = map(labels, fn).join('.');
22081
- return result + encoded;
22082
- }
22102
+ function httpParse (components) {
22103
+ if (!components.host) {
22104
+ components.error = components.error || 'HTTP URIs must have a host.';
22105
+ }
22083
22106
 
22084
- /**
22085
- * Creates an array containing the numeric code points of each Unicode
22086
- * character in the string. While JavaScript uses UCS-2 internally,
22087
- * this function will convert a pair of surrogate halves (each of which
22088
- * UCS-2 exposes as separate characters) into a single code point,
22089
- * matching UTF-16.
22090
- * @see `punycode.ucs2.encode`
22091
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
22092
- * @memberOf punycode.ucs2
22093
- * @name decode
22094
- * @param {String} string The Unicode input string (UCS-2).
22095
- * @returns {Array} The new array of code points.
22096
- */
22097
- function ucs2decode(string) {
22098
- var output = [];
22099
- var counter = 0;
22100
- var length = string.length;
22101
- while (counter < length) {
22102
- var value = string.charCodeAt(counter++);
22103
- if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
22104
- // It's a high surrogate, and there is a next character.
22105
- var extra = string.charCodeAt(counter++);
22106
- if ((extra & 0xFC00) == 0xDC00) {
22107
- // Low surrogate.
22108
- output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
22109
- } else {
22110
- // It's an unmatched surrogate; only append this code unit, in case the
22111
- // next code unit is the high surrogate of a surrogate pair.
22112
- output.push(value);
22113
- counter--;
22114
- }
22115
- } else {
22116
- output.push(value);
22117
- }
22118
- }
22119
- return output;
22120
- }
22107
+ return components
22108
+ }
22121
22109
 
22122
- /**
22123
- * Creates a string based on an array of numeric code points.
22124
- * @see `punycode.ucs2.decode`
22125
- * @memberOf punycode.ucs2
22126
- * @name encode
22127
- * @param {Array} codePoints The array of numeric code points.
22128
- * @returns {String} The new Unicode string (UCS-2).
22129
- */
22130
- var ucs2encode = function ucs2encode(array) {
22131
- return String.fromCodePoint.apply(String, toConsumableArray(array));
22132
- };
22110
+ function httpSerialize (components) {
22111
+ const secure = String(components.scheme).toLowerCase() === 'https';
22133
22112
 
22134
- /**
22135
- * Converts a basic code point into a digit/integer.
22136
- * @see `digitToBasic()`
22137
- * @private
22138
- * @param {Number} codePoint The basic numeric code point value.
22139
- * @returns {Number} The numeric value of a basic code point (for use in
22140
- * representing integers) in the range `0` to `base - 1`, or `base` if
22141
- * the code point does not represent a value.
22142
- */
22143
- var basicToDigit = function basicToDigit(codePoint) {
22144
- if (codePoint - 0x30 < 0x0A) {
22145
- return codePoint - 0x16;
22146
- }
22147
- if (codePoint - 0x41 < 0x1A) {
22148
- return codePoint - 0x41;
22149
- }
22150
- if (codePoint - 0x61 < 0x1A) {
22151
- return codePoint - 0x61;
22152
- }
22153
- return base;
22154
- };
22113
+ // normalize the default port
22114
+ if (components.port === (secure ? 443 : 80) || components.port === '') {
22115
+ components.port = undefined;
22116
+ }
22155
22117
 
22156
- /**
22157
- * Converts a digit/integer into a basic code point.
22158
- * @see `basicToDigit()`
22159
- * @private
22160
- * @param {Number} digit The numeric value of a basic code point.
22161
- * @returns {Number} The basic code point whose value (when used for
22162
- * representing integers) is `digit`, which needs to be in the range
22163
- * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
22164
- * used; else, the lowercase form is used. The behavior is undefined
22165
- * if `flag` is non-zero and `digit` has no uppercase form.
22166
- */
22167
- var digitToBasic = function digitToBasic(digit, flag) {
22168
- // 0..25 map to ASCII a..z or A..Z
22169
- // 26..35 map to ASCII 0..9
22170
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
22171
- };
22118
+ // normalize the empty path
22119
+ if (!components.path) {
22120
+ components.path = '/';
22121
+ }
22172
22122
 
22173
- /**
22174
- * Bias adaptation function as per section 3.4 of RFC 3492.
22175
- * https://tools.ietf.org/html/rfc3492#section-3.4
22176
- * @private
22177
- */
22178
- var adapt = function adapt(delta, numPoints, firstTime) {
22179
- var k = 0;
22180
- delta = firstTime ? floor(delta / damp) : delta >> 1;
22181
- delta += floor(delta / numPoints);
22182
- for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
22183
- delta = floor(delta / baseMinusTMin);
22184
- }
22185
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
22186
- };
22123
+ // NOTE: We do not parse query strings for HTTP URIs
22124
+ // as WWW Form Url Encoded query strings are part of the HTML4+ spec,
22125
+ // and not the HTTP spec.
22187
22126
 
22188
- /**
22189
- * Converts a Punycode string of ASCII-only symbols to a string of Unicode
22190
- * symbols.
22191
- * @memberOf punycode
22192
- * @param {String} input The Punycode string of ASCII-only symbols.
22193
- * @returns {String} The resulting string of Unicode symbols.
22194
- */
22195
- var decode = function decode(input) {
22196
- // Don't use UCS-2.
22197
- var output = [];
22198
- var inputLength = input.length;
22199
- var i = 0;
22200
- var n = initialN;
22201
- var bias = initialBias;
22202
-
22203
- // Handle the basic code points: let `basic` be the number of input code
22204
- // points before the last delimiter, or `0` if there is none, then copy
22205
- // the first basic code points to the output.
22206
-
22207
- var basic = input.lastIndexOf(delimiter);
22208
- if (basic < 0) {
22209
- basic = 0;
22210
- }
22127
+ return components
22128
+ }
22211
22129
 
22212
- for (var j = 0; j < basic; ++j) {
22213
- // if it's not a basic code point
22214
- if (input.charCodeAt(j) >= 0x80) {
22215
- error$1('not-basic');
22216
- }
22217
- output.push(input.charCodeAt(j));
22218
- }
22130
+ function wsParse (wsComponents) {
22131
+ // indicate if the secure flag is set
22132
+ wsComponents.secure = isSecure(wsComponents);
22219
22133
 
22220
- // Main decoding loop: start just after the last delimiter if any basic code
22221
- // points were copied; start at the beginning otherwise.
22134
+ // construct resouce name
22135
+ wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
22136
+ wsComponents.path = undefined;
22137
+ wsComponents.query = undefined;
22222
22138
 
22223
- for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{
22139
+ return wsComponents
22140
+ }
22224
22141
 
22225
- // `index` is the index of the next character to be consumed.
22226
- // Decode a generalized variable-length integer into `delta`,
22227
- // which gets added to `i`. The overflow checking is easier
22228
- // if we increase `i` as we go, then subtract off its starting
22229
- // value at the end to obtain `delta`.
22230
- var oldi = i;
22231
- for (var w = 1, k = base;; /* no condition */k += base) {
22142
+ function wsSerialize (wsComponents) {
22143
+ // normalize the default port
22144
+ if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === '') {
22145
+ wsComponents.port = undefined;
22146
+ }
22232
22147
 
22233
- if (index >= inputLength) {
22234
- error$1('invalid-input');
22235
- }
22148
+ // ensure scheme matches secure flag
22149
+ if (typeof wsComponents.secure === 'boolean') {
22150
+ wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');
22151
+ wsComponents.secure = undefined;
22152
+ }
22236
22153
 
22237
- var digit = basicToDigit(input.charCodeAt(index++));
22154
+ // reconstruct path from resource name
22155
+ if (wsComponents.resourceName) {
22156
+ const [path, query] = wsComponents.resourceName.split('?');
22157
+ wsComponents.path = (path && path !== '/' ? path : undefined);
22158
+ wsComponents.query = query;
22159
+ wsComponents.resourceName = undefined;
22160
+ }
22238
22161
 
22239
- if (digit >= base || digit > floor((maxInt - i) / w)) {
22240
- error$1('overflow');
22241
- }
22162
+ // forbid fragment component
22163
+ wsComponents.fragment = undefined;
22242
22164
 
22243
- i += digit * w;
22244
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
22165
+ return wsComponents
22166
+ }
22245
22167
 
22246
- if (digit < t) {
22247
- break;
22248
- }
22168
+ function urnParse (urnComponents, options) {
22169
+ if (!urnComponents.path) {
22170
+ urnComponents.error = 'URN can not be parsed';
22171
+ return urnComponents
22172
+ }
22173
+ const matches = urnComponents.path.match(URN_REG);
22174
+ if (matches) {
22175
+ const scheme = options.scheme || urnComponents.scheme || 'urn';
22176
+ urnComponents.nid = matches[1].toLowerCase();
22177
+ urnComponents.nss = matches[2];
22178
+ const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`;
22179
+ const schemeHandler = SCHEMES$1[urnScheme];
22180
+ urnComponents.path = undefined;
22181
+
22182
+ if (schemeHandler) {
22183
+ urnComponents = schemeHandler.parse(urnComponents, options);
22184
+ }
22185
+ } else {
22186
+ urnComponents.error = urnComponents.error || 'URN can not be parsed.';
22187
+ }
22249
22188
 
22250
- var baseMinusT = base - t;
22251
- if (w > floor(maxInt / baseMinusT)) {
22252
- error$1('overflow');
22253
- }
22189
+ return urnComponents
22190
+ }
22254
22191
 
22255
- w *= baseMinusT;
22256
- }
22192
+ function urnSerialize (urnComponents, options) {
22193
+ const scheme = options.scheme || urnComponents.scheme || 'urn';
22194
+ const nid = urnComponents.nid.toLowerCase();
22195
+ const urnScheme = `${scheme}:${options.nid || nid}`;
22196
+ const schemeHandler = SCHEMES$1[urnScheme];
22257
22197
 
22258
- var out = output.length + 1;
22259
- bias = adapt(i - oldi, out, oldi == 0);
22198
+ if (schemeHandler) {
22199
+ urnComponents = schemeHandler.serialize(urnComponents, options);
22200
+ }
22260
22201
 
22261
- // `i` was supposed to wrap around from `out` to `0`,
22262
- // incrementing `n` each time, so we'll fix that now:
22263
- if (floor(i / out) > maxInt - n) {
22264
- error$1('overflow');
22265
- }
22202
+ const uriComponents = urnComponents;
22203
+ const nss = urnComponents.nss;
22204
+ uriComponents.path = `${nid || options.nid}:${nss}`;
22266
22205
 
22267
- n += floor(i / out);
22268
- i %= out;
22206
+ options.skipEscape = true;
22207
+ return uriComponents
22208
+ }
22269
22209
 
22270
- // Insert `n` at position `i` of the output.
22271
- output.splice(i++, 0, n);
22272
- }
22210
+ function urnuuidParse (urnComponents, options) {
22211
+ const uuidComponents = urnComponents;
22212
+ uuidComponents.uuid = uuidComponents.nss;
22213
+ uuidComponents.nss = undefined;
22273
22214
 
22274
- return String.fromCodePoint.apply(String, output);
22275
- };
22215
+ if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) {
22216
+ uuidComponents.error = uuidComponents.error || 'UUID is not valid.';
22217
+ }
22276
22218
 
22277
- /**
22278
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
22279
- * Punycode string of ASCII-only symbols.
22280
- * @memberOf punycode
22281
- * @param {String} input The string of Unicode symbols.
22282
- * @returns {String} The resulting Punycode string of ASCII-only symbols.
22283
- */
22284
- var encode = function encode(input) {
22285
- var output = [];
22219
+ return uuidComponents
22220
+ }
22286
22221
 
22287
- // Convert the input in UCS-2 to an array of Unicode code points.
22288
- input = ucs2decode(input);
22222
+ function urnuuidSerialize (uuidComponents) {
22223
+ const urnComponents = uuidComponents;
22224
+ // normalize UUID
22225
+ urnComponents.nss = (uuidComponents.uuid || '').toLowerCase();
22226
+ return urnComponents
22227
+ }
22289
22228
 
22290
- // Cache the length.
22291
- var inputLength = input.length;
22229
+ const http = {
22230
+ scheme: 'http',
22231
+ domainHost: true,
22232
+ parse: httpParse,
22233
+ serialize: httpSerialize
22234
+ };
22292
22235
 
22293
- // Initialize the state.
22294
- var n = initialN;
22295
- var delta = 0;
22296
- var bias = initialBias;
22236
+ const https = {
22237
+ scheme: 'https',
22238
+ domainHost: http.domainHost,
22239
+ parse: httpParse,
22240
+ serialize: httpSerialize
22241
+ };
22297
22242
 
22298
- // Handle the basic code points.
22299
- var _iteratorNormalCompletion = true;
22300
- var _didIteratorError = false;
22301
- var _iteratorError = undefined;
22243
+ const ws = {
22244
+ scheme: 'ws',
22245
+ domainHost: true,
22246
+ parse: wsParse,
22247
+ serialize: wsSerialize
22248
+ };
22302
22249
 
22303
- try {
22304
- for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
22305
- var _currentValue2 = _step.value;
22250
+ const wss = {
22251
+ scheme: 'wss',
22252
+ domainHost: ws.domainHost,
22253
+ parse: ws.parse,
22254
+ serialize: ws.serialize
22255
+ };
22306
22256
 
22307
- if (_currentValue2 < 0x80) {
22308
- output.push(stringFromCharCode(_currentValue2));
22309
- }
22310
- }
22311
- } catch (err) {
22312
- _didIteratorError = true;
22313
- _iteratorError = err;
22314
- } finally {
22315
- try {
22316
- if (!_iteratorNormalCompletion && _iterator.return) {
22317
- _iterator.return();
22318
- }
22319
- } finally {
22320
- if (_didIteratorError) {
22321
- throw _iteratorError;
22322
- }
22323
- }
22324
- }
22257
+ const urn = {
22258
+ scheme: 'urn',
22259
+ parse: urnParse,
22260
+ serialize: urnSerialize,
22261
+ skipNormalize: true
22262
+ };
22325
22263
 
22326
- var basicLength = output.length;
22327
- var handledCPCount = basicLength;
22264
+ const urnuuid = {
22265
+ scheme: 'urn:uuid',
22266
+ parse: urnuuidParse,
22267
+ serialize: urnuuidSerialize,
22268
+ skipNormalize: true
22269
+ };
22328
22270
 
22329
- // `handledCPCount` is the number of code points that have been handled;
22330
- // `basicLength` is the number of basic code points.
22271
+ const SCHEMES$1 = {
22272
+ http,
22273
+ https,
22274
+ ws,
22275
+ wss,
22276
+ urn,
22277
+ 'urn:uuid': urnuuid
22278
+ };
22331
22279
 
22332
- // Finish the basic string with a delimiter unless it's empty.
22333
- if (basicLength) {
22334
- output.push(delimiter);
22335
- }
22280
+ var schemes = SCHEMES$1;
22336
22281
 
22337
- // Main encoding loop:
22338
- while (handledCPCount < inputLength) {
22282
+ const { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = utils$1;
22283
+ const SCHEMES = schemes;
22339
22284
 
22340
- // All non-basic code points < n have been handled already. Find the next
22341
- // larger one:
22342
- var m = maxInt;
22343
- var _iteratorNormalCompletion2 = true;
22344
- var _didIteratorError2 = false;
22345
- var _iteratorError2 = undefined;
22285
+ function normalize (uri, options) {
22286
+ if (typeof uri === 'string') {
22287
+ uri = serialize(parse$2(uri, options), options);
22288
+ } else if (typeof uri === 'object') {
22289
+ uri = parse$2(serialize(uri, options), options);
22290
+ }
22291
+ return uri
22292
+ }
22346
22293
 
22347
- try {
22348
- for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
22349
- var currentValue = _step2.value;
22294
+ function resolve (baseURI, relativeURI, options) {
22295
+ const schemelessOptions = Object.assign({ scheme: 'null' }, options);
22296
+ const resolved = resolveComponents(parse$2(baseURI, schemelessOptions), parse$2(relativeURI, schemelessOptions), schemelessOptions, true);
22297
+ return serialize(resolved, { ...schemelessOptions, skipEscape: true })
22298
+ }
22350
22299
 
22351
- if (currentValue >= n && currentValue < m) {
22352
- m = currentValue;
22353
- }
22354
- }
22300
+ function resolveComponents (base, relative, options, skipNormalization) {
22301
+ const target = {};
22302
+ if (!skipNormalization) {
22303
+ base = parse$2(serialize(base, options), options); // normalize base components
22304
+ relative = parse$2(serialize(relative, options), options); // normalize relative components
22305
+ }
22306
+ options = options || {};
22307
+
22308
+ if (!options.tolerant && relative.scheme) {
22309
+ target.scheme = relative.scheme;
22310
+ // target.authority = relative.authority;
22311
+ target.userinfo = relative.userinfo;
22312
+ target.host = relative.host;
22313
+ target.port = relative.port;
22314
+ target.path = removeDotSegments(relative.path || '');
22315
+ target.query = relative.query;
22316
+ } else {
22317
+ if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
22318
+ // target.authority = relative.authority;
22319
+ target.userinfo = relative.userinfo;
22320
+ target.host = relative.host;
22321
+ target.port = relative.port;
22322
+ target.path = removeDotSegments(relative.path || '');
22323
+ target.query = relative.query;
22324
+ } else {
22325
+ if (!relative.path) {
22326
+ target.path = base.path;
22327
+ if (relative.query !== undefined) {
22328
+ target.query = relative.query;
22329
+ } else {
22330
+ target.query = base.query;
22331
+ }
22332
+ } else {
22333
+ if (relative.path.charAt(0) === '/') {
22334
+ target.path = removeDotSegments(relative.path);
22335
+ } else {
22336
+ if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
22337
+ target.path = '/' + relative.path;
22338
+ } else if (!base.path) {
22339
+ target.path = relative.path;
22340
+ } else {
22341
+ target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path;
22342
+ }
22343
+ target.path = removeDotSegments(target.path);
22344
+ }
22345
+ target.query = relative.query;
22346
+ }
22347
+ // target.authority = base.authority;
22348
+ target.userinfo = base.userinfo;
22349
+ target.host = base.host;
22350
+ target.port = base.port;
22351
+ }
22352
+ target.scheme = base.scheme;
22353
+ }
22355
22354
 
22356
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
22357
- // but guard against overflow.
22358
- } catch (err) {
22359
- _didIteratorError2 = true;
22360
- _iteratorError2 = err;
22361
- } finally {
22362
- try {
22363
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
22364
- _iterator2.return();
22365
- }
22366
- } finally {
22367
- if (_didIteratorError2) {
22368
- throw _iteratorError2;
22369
- }
22370
- }
22371
- }
22355
+ target.fragment = relative.fragment;
22372
22356
 
22373
- var handledCPCountPlusOne = handledCPCount + 1;
22374
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
22375
- error$1('overflow');
22376
- }
22357
+ return target
22358
+ }
22377
22359
 
22378
- delta += (m - n) * handledCPCountPlusOne;
22379
- n = m;
22380
-
22381
- var _iteratorNormalCompletion3 = true;
22382
- var _didIteratorError3 = false;
22383
- var _iteratorError3 = undefined;
22384
-
22385
- try {
22386
- for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
22387
- var _currentValue = _step3.value;
22388
-
22389
- if (_currentValue < n && ++delta > maxInt) {
22390
- error$1('overflow');
22391
- }
22392
- if (_currentValue == n) {
22393
- // Represent delta as a generalized variable-length integer.
22394
- var q = delta;
22395
- for (var k = base;; /* no condition */k += base) {
22396
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
22397
- if (q < t) {
22398
- break;
22399
- }
22400
- var qMinusT = q - t;
22401
- var baseMinusT = base - t;
22402
- output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
22403
- q = floor(qMinusT / baseMinusT);
22404
- }
22405
-
22406
- output.push(stringFromCharCode(digitToBasic(q, 0)));
22407
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
22408
- delta = 0;
22409
- ++handledCPCount;
22410
- }
22411
- }
22412
- } catch (err) {
22413
- _didIteratorError3 = true;
22414
- _iteratorError3 = err;
22415
- } finally {
22416
- try {
22417
- if (!_iteratorNormalCompletion3 && _iterator3.return) {
22418
- _iterator3.return();
22419
- }
22420
- } finally {
22421
- if (_didIteratorError3) {
22422
- throw _iteratorError3;
22423
- }
22424
- }
22425
- }
22360
+ function equal$2 (uriA, uriB, options) {
22361
+ if (typeof uriA === 'string') {
22362
+ uriA = unescape(uriA);
22363
+ uriA = serialize(normalizeComponentEncoding(parse$2(uriA, options), true), { ...options, skipEscape: true });
22364
+ } else if (typeof uriA === 'object') {
22365
+ uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
22366
+ }
22426
22367
 
22427
- ++delta;
22428
- ++n;
22429
- }
22430
- return output.join('');
22431
- };
22368
+ if (typeof uriB === 'string') {
22369
+ uriB = unescape(uriB);
22370
+ uriB = serialize(normalizeComponentEncoding(parse$2(uriB, options), true), { ...options, skipEscape: true });
22371
+ } else if (typeof uriB === 'object') {
22372
+ uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
22373
+ }
22432
22374
 
22433
- /**
22434
- * Converts a Punycode string representing a domain name or an email address
22435
- * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
22436
- * it doesn't matter if you call it on a string that has already been
22437
- * converted to Unicode.
22438
- * @memberOf punycode
22439
- * @param {String} input The Punycoded domain name or email address to
22440
- * convert to Unicode.
22441
- * @returns {String} The Unicode representation of the given Punycode
22442
- * string.
22443
- */
22444
- var toUnicode = function toUnicode(input) {
22445
- return mapDomain(input, function (string) {
22446
- return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
22447
- });
22448
- };
22375
+ return uriA.toLowerCase() === uriB.toLowerCase()
22376
+ }
22377
+
22378
+ function serialize (cmpts, opts) {
22379
+ const components = {
22380
+ host: cmpts.host,
22381
+ scheme: cmpts.scheme,
22382
+ userinfo: cmpts.userinfo,
22383
+ port: cmpts.port,
22384
+ path: cmpts.path,
22385
+ query: cmpts.query,
22386
+ nid: cmpts.nid,
22387
+ nss: cmpts.nss,
22388
+ uuid: cmpts.uuid,
22389
+ fragment: cmpts.fragment,
22390
+ reference: cmpts.reference,
22391
+ resourceName: cmpts.resourceName,
22392
+ secure: cmpts.secure,
22393
+ error: ''
22394
+ };
22395
+ const options = Object.assign({}, opts);
22396
+ const uriTokens = [];
22449
22397
 
22450
- /**
22451
- * Converts a Unicode string representing a domain name or an email address to
22452
- * Punycode. Only the non-ASCII parts of the domain name will be converted,
22453
- * i.e. it doesn't matter if you call it with a domain that's already in
22454
- * ASCII.
22455
- * @memberOf punycode
22456
- * @param {String} input The domain name or email address to convert, as a
22457
- * Unicode string.
22458
- * @returns {String} The Punycode representation of the given domain name or
22459
- * email address.
22460
- */
22461
- var toASCII = function toASCII(input) {
22462
- return mapDomain(input, function (string) {
22463
- return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
22464
- });
22465
- };
22398
+ // find scheme handler
22399
+ const schemeHandler = SCHEMES[(options.scheme || components.scheme || '').toLowerCase()];
22466
22400
 
22467
- /*--------------------------------------------------------------------------*/
22468
-
22469
- /** Define the public API */
22470
- var punycode = {
22471
- /**
22472
- * A string representing the current Punycode.js version number.
22473
- * @memberOf punycode
22474
- * @type String
22475
- */
22476
- 'version': '2.1.0',
22477
- /**
22478
- * An object of methods to convert from JavaScript's internal character
22479
- * representation (UCS-2) to Unicode code points, and back.
22480
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
22481
- * @memberOf punycode
22482
- * @type Object
22483
- */
22484
- 'ucs2': {
22485
- 'decode': ucs2decode,
22486
- 'encode': ucs2encode
22487
- },
22488
- 'decode': decode,
22489
- 'encode': encode,
22490
- 'toASCII': toASCII,
22491
- 'toUnicode': toUnicode
22492
- };
22401
+ // perform scheme specific serialization
22402
+ if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
22493
22403
 
22494
- /**
22495
- * URI.js
22496
- *
22497
- * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
22498
- * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
22499
- * @see http://github.com/garycourt/uri-js
22500
- */
22501
- /**
22502
- * Copyright 2011 Gary Court. All rights reserved.
22503
- *
22504
- * Redistribution and use in source and binary forms, with or without modification, are
22505
- * permitted provided that the following conditions are met:
22506
- *
22507
- * 1. Redistributions of source code must retain the above copyright notice, this list of
22508
- * conditions and the following disclaimer.
22509
- *
22510
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
22511
- * of conditions and the following disclaimer in the documentation and/or other materials
22512
- * provided with the distribution.
22513
- *
22514
- * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
22515
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
22516
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
22517
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22518
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22519
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22520
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22521
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22522
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22523
- *
22524
- * The views and conclusions contained in the software and documentation are those of the
22525
- * authors and should not be interpreted as representing official policies, either expressed
22526
- * or implied, of Gary Court.
22527
- */
22528
- var SCHEMES = {};
22529
- function pctEncChar(chr) {
22530
- var c = chr.charCodeAt(0);
22531
- var e = void 0;
22532
- if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
22533
- return e;
22534
- }
22535
- function pctDecChars(str) {
22536
- var newStr = "";
22537
- var i = 0;
22538
- var il = str.length;
22539
- while (i < il) {
22540
- var c = parseInt(str.substr(i + 1, 2), 16);
22541
- if (c < 128) {
22542
- newStr += String.fromCharCode(c);
22543
- i += 3;
22544
- } else if (c >= 194 && c < 224) {
22545
- if (il - i >= 6) {
22546
- var c2 = parseInt(str.substr(i + 4, 2), 16);
22547
- newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
22548
- } else {
22549
- newStr += str.substr(i, 6);
22550
- }
22551
- i += 6;
22552
- } else if (c >= 224) {
22553
- if (il - i >= 9) {
22554
- var _c = parseInt(str.substr(i + 4, 2), 16);
22555
- var c3 = parseInt(str.substr(i + 7, 2), 16);
22556
- newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
22557
- } else {
22558
- newStr += str.substr(i, 9);
22559
- }
22560
- i += 9;
22561
- } else {
22562
- newStr += str.substr(i, 3);
22563
- i += 3;
22564
- }
22565
- }
22566
- return newStr;
22567
- }
22568
- function _normalizeComponentEncoding(components, protocol) {
22569
- function decodeUnreserved(str) {
22570
- var decStr = pctDecChars(str);
22571
- return !decStr.match(protocol.UNRESERVED) ? str : decStr;
22572
- }
22573
- if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
22574
- if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
22575
- if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
22576
- if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
22577
- if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
22578
- if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
22579
- return components;
22580
- }
22404
+ if (components.path !== undefined) {
22405
+ if (!options.skipEscape) {
22406
+ components.path = escape(components.path);
22581
22407
 
22582
- function _stripLeadingZeros(str) {
22583
- return str.replace(/^0*(.*)/, "$1") || "0";
22584
- }
22585
- function _normalizeIPv4(host, protocol) {
22586
- var matches = host.match(protocol.IPV4ADDRESS) || [];
22408
+ if (components.scheme !== undefined) {
22409
+ components.path = components.path.split('%3A').join(':');
22410
+ }
22411
+ } else {
22412
+ components.path = unescape(components.path);
22413
+ }
22414
+ }
22587
22415
 
22588
- var _matches = slicedToArray(matches, 2),
22589
- address = _matches[1];
22416
+ if (options.reference !== 'suffix' && components.scheme) {
22417
+ uriTokens.push(components.scheme);
22418
+ uriTokens.push(':');
22419
+ }
22590
22420
 
22591
- if (address) {
22592
- return address.split(".").map(_stripLeadingZeros).join(".");
22593
- } else {
22594
- return host;
22595
- }
22596
- }
22597
- function _normalizeIPv6(host, protocol) {
22598
- var matches = host.match(protocol.IPV6ADDRESS) || [];
22599
-
22600
- var _matches2 = slicedToArray(matches, 3),
22601
- address = _matches2[1],
22602
- zone = _matches2[2];
22603
-
22604
- if (address) {
22605
- var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),
22606
- _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),
22607
- last = _address$toLowerCase$2[0],
22608
- first = _address$toLowerCase$2[1];
22609
-
22610
- var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
22611
- var lastFields = last.split(":").map(_stripLeadingZeros);
22612
- var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
22613
- var fieldCount = isLastFieldIPv4Address ? 7 : 8;
22614
- var lastFieldsStart = lastFields.length - fieldCount;
22615
- var fields = Array(fieldCount);
22616
- for (var x = 0; x < fieldCount; ++x) {
22617
- fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
22618
- }
22619
- if (isLastFieldIPv4Address) {
22620
- fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
22621
- }
22622
- var allZeroFields = fields.reduce(function (acc, field, index) {
22623
- if (!field || field === "0") {
22624
- var lastLongest = acc[acc.length - 1];
22625
- if (lastLongest && lastLongest.index + lastLongest.length === index) {
22626
- lastLongest.length++;
22627
- } else {
22628
- acc.push({ index: index, length: 1 });
22629
- }
22630
- }
22631
- return acc;
22632
- }, []);
22633
- var longestZeroFields = allZeroFields.sort(function (a, b) {
22634
- return b.length - a.length;
22635
- })[0];
22636
- var newHost = void 0;
22637
- if (longestZeroFields && longestZeroFields.length > 1) {
22638
- var newFirst = fields.slice(0, longestZeroFields.index);
22639
- var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
22640
- newHost = newFirst.join(":") + "::" + newLast.join(":");
22641
- } else {
22642
- newHost = fields.join(":");
22643
- }
22644
- if (zone) {
22645
- newHost += "%" + zone;
22646
- }
22647
- return newHost;
22648
- } else {
22649
- return host;
22650
- }
22651
- }
22652
- var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
22653
- var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined;
22654
- function parse(uriString) {
22655
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22656
-
22657
- var components = {};
22658
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
22659
- if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
22660
- var matches = uriString.match(URI_PARSE);
22661
- if (matches) {
22662
- if (NO_MATCH_IS_UNDEFINED) {
22663
- //store each component
22664
- components.scheme = matches[1];
22665
- components.userinfo = matches[3];
22666
- components.host = matches[4];
22667
- components.port = parseInt(matches[5], 10);
22668
- components.path = matches[6] || "";
22669
- components.query = matches[7];
22670
- components.fragment = matches[8];
22671
- //fix port number
22672
- if (isNaN(components.port)) {
22673
- components.port = matches[5];
22674
- }
22675
- } else {
22676
- //IE FIX for improper RegExp matching
22677
- //store each component
22678
- components.scheme = matches[1] || undefined;
22679
- components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined;
22680
- components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined;
22681
- components.port = parseInt(matches[5], 10);
22682
- components.path = matches[6] || "";
22683
- components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined;
22684
- components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined;
22685
- //fix port number
22686
- if (isNaN(components.port)) {
22687
- components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined;
22688
- }
22689
- }
22690
- if (components.host) {
22691
- //normalize IP hosts
22692
- components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
22693
- }
22694
- //determine reference type
22695
- if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
22696
- components.reference = "same-document";
22697
- } else if (components.scheme === undefined) {
22698
- components.reference = "relative";
22699
- } else if (components.fragment === undefined) {
22700
- components.reference = "absolute";
22701
- } else {
22702
- components.reference = "uri";
22703
- }
22704
- //check for reference errors
22705
- if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
22706
- components.error = components.error || "URI is not a " + options.reference + " reference.";
22707
- }
22708
- //find scheme handler
22709
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
22710
- //check if scheme can't handle IRIs
22711
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
22712
- //if host component is a domain name
22713
- if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
22714
- //convert Unicode IDN -> ASCII IDN
22715
- try {
22716
- components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
22717
- } catch (e) {
22718
- components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
22719
- }
22720
- }
22721
- //convert IRI -> URI
22722
- _normalizeComponentEncoding(components, URI_PROTOCOL);
22723
- } else {
22724
- //normalize encodings
22725
- _normalizeComponentEncoding(components, protocol);
22726
- }
22727
- //perform scheme specific parsing
22728
- if (schemeHandler && schemeHandler.parse) {
22729
- schemeHandler.parse(components, options);
22730
- }
22731
- } else {
22732
- components.error = components.error || "URI can not be parsed.";
22733
- }
22734
- return components;
22735
- }
22736
-
22737
- function _recomposeAuthority(components, options) {
22738
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
22739
- var uriTokens = [];
22740
- if (components.userinfo !== undefined) {
22741
- uriTokens.push(components.userinfo);
22742
- uriTokens.push("@");
22743
- }
22744
- if (components.host !== undefined) {
22745
- //normalize IP hosts, add brackets and escape zone separator for IPv6
22746
- uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {
22747
- return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
22748
- }));
22749
- }
22750
- if (typeof components.port === "number" || typeof components.port === "string") {
22751
- uriTokens.push(":");
22752
- uriTokens.push(String(components.port));
22753
- }
22754
- return uriTokens.length ? uriTokens.join("") : undefined;
22755
- }
22756
-
22757
- var RDS1 = /^\.\.?\//;
22758
- var RDS2 = /^\/\.(\/|$)/;
22759
- var RDS3 = /^\/\.\.(\/|$)/;
22760
- var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
22761
- function removeDotSegments(input) {
22762
- var output = [];
22763
- while (input.length) {
22764
- if (input.match(RDS1)) {
22765
- input = input.replace(RDS1, "");
22766
- } else if (input.match(RDS2)) {
22767
- input = input.replace(RDS2, "/");
22768
- } else if (input.match(RDS3)) {
22769
- input = input.replace(RDS3, "/");
22770
- output.pop();
22771
- } else if (input === "." || input === "..") {
22772
- input = "";
22773
- } else {
22774
- var im = input.match(RDS5);
22775
- if (im) {
22776
- var s = im[0];
22777
- input = input.slice(s.length);
22778
- output.push(s);
22779
- } else {
22780
- throw new Error("Unexpected dot segment condition");
22781
- }
22782
- }
22783
- }
22784
- return output.join("");
22785
- }
22421
+ const authority = recomposeAuthority(components, options);
22422
+ if (authority !== undefined) {
22423
+ if (options.reference !== 'suffix') {
22424
+ uriTokens.push('//');
22425
+ }
22786
22426
 
22787
- function serialize(components) {
22788
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22427
+ uriTokens.push(authority);
22789
22428
 
22790
- var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
22791
- var uriTokens = [];
22792
- //find scheme handler
22793
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
22794
- //perform scheme specific serialization
22795
- if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
22796
- if (components.host) {
22797
- //if host component is an IPv6 address
22798
- if (protocol.IPV6ADDRESS.test(components.host)) ;
22799
- //TODO: normalize IPv6 address as per RFC 5952
22429
+ if (components.path && components.path.charAt(0) !== '/') {
22430
+ uriTokens.push('/');
22431
+ }
22432
+ }
22433
+ if (components.path !== undefined) {
22434
+ let s = components.path;
22800
22435
 
22801
- //if host component is a domain name
22802
- else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
22803
- //convert IDN via punycode
22804
- try {
22805
- components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
22806
- } catch (e) {
22807
- components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
22808
- }
22809
- }
22810
- }
22811
- //normalize encoding
22812
- _normalizeComponentEncoding(components, protocol);
22813
- if (options.reference !== "suffix" && components.scheme) {
22814
- uriTokens.push(components.scheme);
22815
- uriTokens.push(":");
22816
- }
22817
- var authority = _recomposeAuthority(components, options);
22818
- if (authority !== undefined) {
22819
- if (options.reference !== "suffix") {
22820
- uriTokens.push("//");
22821
- }
22822
- uriTokens.push(authority);
22823
- if (components.path && components.path.charAt(0) !== "/") {
22824
- uriTokens.push("/");
22825
- }
22826
- }
22827
- if (components.path !== undefined) {
22828
- var s = components.path;
22829
- if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
22830
- s = removeDotSegments(s);
22831
- }
22832
- if (authority === undefined) {
22833
- s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
22834
- }
22835
- uriTokens.push(s);
22836
- }
22837
- if (components.query !== undefined) {
22838
- uriTokens.push("?");
22839
- uriTokens.push(components.query);
22840
- }
22841
- if (components.fragment !== undefined) {
22842
- uriTokens.push("#");
22843
- uriTokens.push(components.fragment);
22844
- }
22845
- return uriTokens.join(""); //merge tokens into a string
22846
- }
22436
+ if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
22437
+ s = removeDotSegments(s);
22438
+ }
22847
22439
 
22848
- function resolveComponents(base, relative) {
22849
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
22850
- var skipNormalization = arguments[3];
22440
+ if (authority === undefined) {
22441
+ s = s.replace(/^\/\//u, '/%2F'); // don't allow the path to start with "//"
22442
+ }
22851
22443
 
22852
- var target = {};
22853
- if (!skipNormalization) {
22854
- base = parse(serialize(base, options), options); //normalize base components
22855
- relative = parse(serialize(relative, options), options); //normalize relative components
22856
- }
22857
- options = options || {};
22858
- if (!options.tolerant && relative.scheme) {
22859
- target.scheme = relative.scheme;
22860
- //target.authority = relative.authority;
22861
- target.userinfo = relative.userinfo;
22862
- target.host = relative.host;
22863
- target.port = relative.port;
22864
- target.path = removeDotSegments(relative.path || "");
22865
- target.query = relative.query;
22866
- } else {
22867
- if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
22868
- //target.authority = relative.authority;
22869
- target.userinfo = relative.userinfo;
22870
- target.host = relative.host;
22871
- target.port = relative.port;
22872
- target.path = removeDotSegments(relative.path || "");
22873
- target.query = relative.query;
22874
- } else {
22875
- if (!relative.path) {
22876
- target.path = base.path;
22877
- if (relative.query !== undefined) {
22878
- target.query = relative.query;
22879
- } else {
22880
- target.query = base.query;
22881
- }
22882
- } else {
22883
- if (relative.path.charAt(0) === "/") {
22884
- target.path = removeDotSegments(relative.path);
22885
- } else {
22886
- if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
22887
- target.path = "/" + relative.path;
22888
- } else if (!base.path) {
22889
- target.path = relative.path;
22890
- } else {
22891
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
22892
- }
22893
- target.path = removeDotSegments(target.path);
22894
- }
22895
- target.query = relative.query;
22896
- }
22897
- //target.authority = base.authority;
22898
- target.userinfo = base.userinfo;
22899
- target.host = base.host;
22900
- target.port = base.port;
22901
- }
22902
- target.scheme = base.scheme;
22903
- }
22904
- target.fragment = relative.fragment;
22905
- return target;
22906
- }
22444
+ uriTokens.push(s);
22445
+ }
22907
22446
 
22908
- function resolve(baseURI, relativeURI, options) {
22909
- var schemelessOptions = assign({ scheme: 'null' }, options);
22910
- return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
22911
- }
22447
+ if (components.query !== undefined) {
22448
+ uriTokens.push('?');
22449
+ uriTokens.push(components.query);
22450
+ }
22912
22451
 
22913
- function normalize(uri, options) {
22914
- if (typeof uri === "string") {
22915
- uri = serialize(parse(uri, options), options);
22916
- } else if (typeOf(uri) === "object") {
22917
- uri = parse(serialize(uri, options), options);
22918
- }
22919
- return uri;
22920
- }
22452
+ if (components.fragment !== undefined) {
22453
+ uriTokens.push('#');
22454
+ uriTokens.push(components.fragment);
22455
+ }
22456
+ return uriTokens.join('')
22457
+ }
22921
22458
 
22922
- function equal(uriA, uriB, options) {
22923
- if (typeof uriA === "string") {
22924
- uriA = serialize(parse(uriA, options), options);
22925
- } else if (typeOf(uriA) === "object") {
22926
- uriA = serialize(uriA, options);
22927
- }
22928
- if (typeof uriB === "string") {
22929
- uriB = serialize(parse(uriB, options), options);
22930
- } else if (typeOf(uriB) === "object") {
22931
- uriB = serialize(uriB, options);
22932
- }
22933
- return uriA === uriB;
22934
- }
22459
+ const hexLookUp = Array.from({ length: 127 }, (v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k)));
22935
22460
 
22936
- function escapeComponent(str, options) {
22937
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
22938
- }
22461
+ function nonSimpleDomain (value) {
22462
+ let code = 0;
22463
+ for (let i = 0, len = value.length; i < len; ++i) {
22464
+ code = value.charCodeAt(i);
22465
+ if (code > 126 || hexLookUp[code]) {
22466
+ return true
22467
+ }
22468
+ }
22469
+ return false
22470
+ }
22939
22471
 
22940
- function unescapeComponent(str, options) {
22941
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
22942
- }
22472
+ const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
22943
22473
 
22944
- var handler = {
22945
- scheme: "http",
22946
- domainHost: true,
22947
- parse: function parse(components, options) {
22948
- //report missing host
22949
- if (!components.host) {
22950
- components.error = components.error || "HTTP URIs must have a host.";
22951
- }
22952
- return components;
22953
- },
22954
- serialize: function serialize(components, options) {
22955
- var secure = String(components.scheme).toLowerCase() === "https";
22956
- //normalize the default port
22957
- if (components.port === (secure ? 443 : 80) || components.port === "") {
22958
- components.port = undefined;
22959
- }
22960
- //normalize the empty path
22961
- if (!components.path) {
22962
- components.path = "/";
22963
- }
22964
- //NOTE: We do not parse query strings for HTTP URIs
22965
- //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
22966
- //and not the HTTP spec.
22967
- return components;
22968
- }
22969
- };
22474
+ function parse$2 (uri, opts) {
22475
+ const options = Object.assign({}, opts);
22476
+ const parsed = {
22477
+ scheme: undefined,
22478
+ userinfo: undefined,
22479
+ host: '',
22480
+ port: undefined,
22481
+ path: '',
22482
+ query: undefined,
22483
+ fragment: undefined
22484
+ };
22485
+ const gotEncoding = uri.indexOf('%') !== -1;
22486
+ let isIP = false;
22487
+ if (options.reference === 'suffix') uri = (options.scheme ? options.scheme + ':' : '') + '//' + uri;
22488
+
22489
+ const matches = uri.match(URI_PARSE);
22490
+
22491
+ if (matches) {
22492
+ // store each component
22493
+ parsed.scheme = matches[1];
22494
+ parsed.userinfo = matches[3];
22495
+ parsed.host = matches[4];
22496
+ parsed.port = parseInt(matches[5], 10);
22497
+ parsed.path = matches[6] || '';
22498
+ parsed.query = matches[7];
22499
+ parsed.fragment = matches[8];
22500
+
22501
+ // fix port number
22502
+ if (isNaN(parsed.port)) {
22503
+ parsed.port = matches[5];
22504
+ }
22505
+ if (parsed.host) {
22506
+ const ipv4result = normalizeIPv4(parsed.host);
22507
+ if (ipv4result.isIPV4 === false) {
22508
+ const ipv6result = normalizeIPv6(ipv4result.host, { isIPV4: false });
22509
+ parsed.host = ipv6result.host.toLowerCase();
22510
+ isIP = ipv6result.isIPV6;
22511
+ } else {
22512
+ parsed.host = ipv4result.host;
22513
+ isIP = true;
22514
+ }
22515
+ }
22516
+ if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && !parsed.path && parsed.query === undefined) {
22517
+ parsed.reference = 'same-document';
22518
+ } else if (parsed.scheme === undefined) {
22519
+ parsed.reference = 'relative';
22520
+ } else if (parsed.fragment === undefined) {
22521
+ parsed.reference = 'absolute';
22522
+ } else {
22523
+ parsed.reference = 'uri';
22524
+ }
22970
22525
 
22971
- var handler$1 = {
22972
- scheme: "https",
22973
- domainHost: handler.domainHost,
22974
- parse: handler.parse,
22975
- serialize: handler.serialize
22976
- };
22526
+ // check for reference errors
22527
+ if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {
22528
+ parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.';
22529
+ }
22977
22530
 
22978
- function isSecure(wsComponents) {
22979
- return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
22980
- }
22981
- //RFC 6455
22982
- var handler$2 = {
22983
- scheme: "ws",
22984
- domainHost: true,
22985
- parse: function parse(components, options) {
22986
- var wsComponents = components;
22987
- //indicate if the secure flag is set
22988
- wsComponents.secure = isSecure(wsComponents);
22989
- //construct resouce name
22990
- wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
22991
- wsComponents.path = undefined;
22992
- wsComponents.query = undefined;
22993
- return wsComponents;
22994
- },
22995
- serialize: function serialize(wsComponents, options) {
22996
- //normalize the default port
22997
- if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
22998
- wsComponents.port = undefined;
22999
- }
23000
- //ensure scheme matches secure flag
23001
- if (typeof wsComponents.secure === 'boolean') {
23002
- wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';
23003
- wsComponents.secure = undefined;
23004
- }
23005
- //reconstruct path from resource name
23006
- if (wsComponents.resourceName) {
23007
- var _wsComponents$resourc = wsComponents.resourceName.split('?'),
23008
- _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
23009
- path = _wsComponents$resourc2[0],
23010
- query = _wsComponents$resourc2[1];
23011
-
23012
- wsComponents.path = path && path !== '/' ? path : undefined;
23013
- wsComponents.query = query;
23014
- wsComponents.resourceName = undefined;
23015
- }
23016
- //forbid fragment component
23017
- wsComponents.fragment = undefined;
23018
- return wsComponents;
23019
- }
23020
- };
22531
+ // find scheme handler
22532
+ const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || '').toLowerCase()];
23021
22533
 
23022
- var handler$3 = {
23023
- scheme: "wss",
23024
- domainHost: handler$2.domainHost,
23025
- parse: handler$2.parse,
23026
- serialize: handler$2.serialize
23027
- };
22534
+ // check if scheme can't handle IRIs
22535
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
22536
+ // if host component is a domain name
22537
+ if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {
22538
+ // convert Unicode IDN -> ASCII IDN
22539
+ try {
22540
+ parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
22541
+ } catch (e) {
22542
+ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
22543
+ }
22544
+ }
22545
+ // convert IRI -> URI
22546
+ }
23028
22547
 
23029
- var O = {};
23030
- //RFC 3986
23031
- var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + ("\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" ) + "]";
23032
- var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
23033
- var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
23034
- //RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
23035
- //const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]";
23036
- //const WSP$$ = "[\\x20\\x09]";
23037
- //const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127)
23038
- //const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext
23039
- //const VCHAR$$ = "[\\x21-\\x7E]";
23040
- //const WSP$$ = "[\\x20\\x09]";
23041
- //const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext
23042
- //const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+");
23043
- //const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$);
23044
- //const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"');
23045
- var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
23046
- var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
23047
- var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
23048
- var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
23049
- var UNRESERVED = new RegExp(UNRESERVED$$, "g");
23050
- var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
23051
- var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
23052
- var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
23053
- var NOT_HFVALUE = NOT_HFNAME;
23054
- function decodeUnreserved(str) {
23055
- var decStr = pctDecChars(str);
23056
- return !decStr.match(UNRESERVED) ? str : decStr;
23057
- }
23058
- var handler$4 = {
23059
- scheme: "mailto",
23060
- parse: function parse$$1(components, options) {
23061
- var mailtoComponents = components;
23062
- var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
23063
- mailtoComponents.path = undefined;
23064
- if (mailtoComponents.query) {
23065
- var unknownHeaders = false;
23066
- var headers = {};
23067
- var hfields = mailtoComponents.query.split("&");
23068
- for (var x = 0, xl = hfields.length; x < xl; ++x) {
23069
- var hfield = hfields[x].split("=");
23070
- switch (hfield[0]) {
23071
- case "to":
23072
- var toAddrs = hfield[1].split(",");
23073
- for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
23074
- to.push(toAddrs[_x]);
23075
- }
23076
- break;
23077
- case "subject":
23078
- mailtoComponents.subject = unescapeComponent(hfield[1], options);
23079
- break;
23080
- case "body":
23081
- mailtoComponents.body = unescapeComponent(hfield[1], options);
23082
- break;
23083
- default:
23084
- unknownHeaders = true;
23085
- headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
23086
- break;
23087
- }
23088
- }
23089
- if (unknownHeaders) mailtoComponents.headers = headers;
23090
- }
23091
- mailtoComponents.query = undefined;
23092
- for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
23093
- var addr = to[_x2].split("@");
23094
- addr[0] = unescapeComponent(addr[0]);
23095
- if (!options.unicodeSupport) {
23096
- //convert Unicode IDN -> ASCII IDN
23097
- try {
23098
- addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
23099
- } catch (e) {
23100
- mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
23101
- }
23102
- } else {
23103
- addr[1] = unescapeComponent(addr[1], options).toLowerCase();
23104
- }
23105
- to[_x2] = addr.join("@");
23106
- }
23107
- return mailtoComponents;
23108
- },
23109
- serialize: function serialize$$1(mailtoComponents, options) {
23110
- var components = mailtoComponents;
23111
- var to = toArray(mailtoComponents.to);
23112
- if (to) {
23113
- for (var x = 0, xl = to.length; x < xl; ++x) {
23114
- var toAddr = String(to[x]);
23115
- var atIdx = toAddr.lastIndexOf("@");
23116
- var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
23117
- var domain = toAddr.slice(atIdx + 1);
23118
- //convert IDN via punycode
23119
- try {
23120
- domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
23121
- } catch (e) {
23122
- components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
23123
- }
23124
- to[x] = localPart + "@" + domain;
23125
- }
23126
- components.path = to.join(",");
23127
- }
23128
- var headers = mailtoComponents.headers = mailtoComponents.headers || {};
23129
- if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
23130
- if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
23131
- var fields = [];
23132
- for (var name in headers) {
23133
- if (headers[name] !== O[name]) {
23134
- fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
23135
- }
23136
- }
23137
- if (fields.length) {
23138
- components.query = fields.join("&");
23139
- }
23140
- return components;
23141
- }
23142
- };
22548
+ if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {
22549
+ if (gotEncoding && parsed.scheme !== undefined) {
22550
+ parsed.scheme = unescape(parsed.scheme);
22551
+ }
22552
+ if (gotEncoding && parsed.userinfo !== undefined) {
22553
+ parsed.userinfo = unescape(parsed.userinfo);
22554
+ }
22555
+ if (gotEncoding && parsed.host !== undefined) {
22556
+ parsed.host = unescape(parsed.host);
22557
+ }
22558
+ if (parsed.path !== undefined && parsed.path.length) {
22559
+ parsed.path = escape(unescape(parsed.path));
22560
+ }
22561
+ if (parsed.fragment !== undefined && parsed.fragment.length) {
22562
+ parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
22563
+ }
22564
+ }
23143
22565
 
23144
- var URN_PARSE = /^([^\:]+)\:(.*)/;
23145
- //RFC 2141
23146
- var handler$5 = {
23147
- scheme: "urn",
23148
- parse: function parse$$1(components, options) {
23149
- var matches = components.path && components.path.match(URN_PARSE);
23150
- var urnComponents = components;
23151
- if (matches) {
23152
- var scheme = options.scheme || urnComponents.scheme || "urn";
23153
- var nid = matches[1].toLowerCase();
23154
- var nss = matches[2];
23155
- var urnScheme = scheme + ":" + (options.nid || nid);
23156
- var schemeHandler = SCHEMES[urnScheme];
23157
- urnComponents.nid = nid;
23158
- urnComponents.nss = nss;
23159
- urnComponents.path = undefined;
23160
- if (schemeHandler) {
23161
- urnComponents = schemeHandler.parse(urnComponents, options);
23162
- }
23163
- } else {
23164
- urnComponents.error = urnComponents.error || "URN can not be parsed.";
23165
- }
23166
- return urnComponents;
23167
- },
23168
- serialize: function serialize$$1(urnComponents, options) {
23169
- var scheme = options.scheme || urnComponents.scheme || "urn";
23170
- var nid = urnComponents.nid;
23171
- var urnScheme = scheme + ":" + (options.nid || nid);
23172
- var schemeHandler = SCHEMES[urnScheme];
23173
- if (schemeHandler) {
23174
- urnComponents = schemeHandler.serialize(urnComponents, options);
23175
- }
23176
- var uriComponents = urnComponents;
23177
- var nss = urnComponents.nss;
23178
- uriComponents.path = (nid || options.nid) + ":" + nss;
23179
- return uriComponents;
23180
- }
23181
- };
22566
+ // perform scheme specific parsing
22567
+ if (schemeHandler && schemeHandler.parse) {
22568
+ schemeHandler.parse(parsed, options);
22569
+ }
22570
+ } else {
22571
+ parsed.error = parsed.error || 'URI can not be parsed.';
22572
+ }
22573
+ return parsed
22574
+ }
23182
22575
 
23183
- var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
23184
- //RFC 4122
23185
- var handler$6 = {
23186
- scheme: "urn:uuid",
23187
- parse: function parse(urnComponents, options) {
23188
- var uuidComponents = urnComponents;
23189
- uuidComponents.uuid = uuidComponents.nss;
23190
- uuidComponents.nss = undefined;
23191
- if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
23192
- uuidComponents.error = uuidComponents.error || "UUID is not valid.";
23193
- }
23194
- return uuidComponents;
23195
- },
23196
- serialize: function serialize(uuidComponents, options) {
23197
- var urnComponents = uuidComponents;
23198
- //normalize UUID
23199
- urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
23200
- return urnComponents;
23201
- }
23202
- };
22576
+ const fastUri = {
22577
+ SCHEMES,
22578
+ normalize,
22579
+ resolve,
22580
+ resolveComponents,
22581
+ equal: equal$2,
22582
+ serialize,
22583
+ parse: parse$2
22584
+ };
23203
22585
 
23204
- SCHEMES[handler.scheme] = handler;
23205
- SCHEMES[handler$1.scheme] = handler$1;
23206
- SCHEMES[handler$2.scheme] = handler$2;
23207
- SCHEMES[handler$3.scheme] = handler$3;
23208
- SCHEMES[handler$4.scheme] = handler$4;
23209
- SCHEMES[handler$5.scheme] = handler$5;
23210
- SCHEMES[handler$6.scheme] = handler$6;
23211
-
23212
- exports.SCHEMES = SCHEMES;
23213
- exports.pctEncChar = pctEncChar;
23214
- exports.pctDecChars = pctDecChars;
23215
- exports.parse = parse;
23216
- exports.removeDotSegments = removeDotSegments;
23217
- exports.serialize = serialize;
23218
- exports.resolveComponents = resolveComponents;
23219
- exports.resolve = resolve;
23220
- exports.normalize = normalize;
23221
- exports.equal = equal;
23222
- exports.escapeComponent = escapeComponent;
23223
- exports.unescapeComponent = unescapeComponent;
23224
-
23225
- Object.defineProperty(exports, '__esModule', { value: true });
23226
-
23227
- })));
23228
-
23229
- } (uri_all, uri_all.exports));
22586
+ fastUri$1.exports = fastUri;
22587
+ fastUri$1.exports.default = fastUri;
22588
+ fastUri$1.exports.fastUri = fastUri;
23230
22589
 
23231
- var uri_allExports = uri_all.exports;
22590
+ var fastUriExports = fastUri$1.exports;
23232
22591
 
23233
22592
  Object.defineProperty(uri$1, "__esModule", { value: true });
23234
- const uri = uri_allExports;
22593
+ const uri = fastUriExports;
23235
22594
  uri.code = 'require("ajv/dist/runtime/uri").default';
23236
22595
  uri$1.default = uri;
23237
22596
 
@@ -23252,7 +22611,7 @@ uri$1.default = uri;
23252
22611
  const rules_1 = rules;
23253
22612
  const compile_1 = compile;
23254
22613
  const codegen_2 = codegen;
23255
- const resolve_1 = resolve$1;
22614
+ const resolve_1 = resolve$2;
23256
22615
  const dataType_1 = dataType;
23257
22616
  const util_1 = util;
23258
22617
  const $dataRefSchema = require$$9;
@@ -28209,7 +27568,7 @@ function parseJsonPointer(pointer) {
28209
27568
  if (pointer.charAt(0) !== "/") {
28210
27569
  compilerAssert(false, `Invalid JSON pointer: "${pointer}"`);
28211
27570
  }
28212
- return pointer.substring(1).split(/\//).map(unescape);
27571
+ return pointer.substring(1).split(/\//).map(unescape$1);
28213
27572
  }
28214
27573
  /**
28215
27574
  * Unescape a reference token
@@ -28217,7 +27576,7 @@ function parseJsonPointer(pointer) {
28217
27576
  * @param str
28218
27577
  * @returns {string}
28219
27578
  */
28220
- function unescape(str) {
27579
+ function unescape$1(str) {
28221
27580
  return str.replace(/~1/g, "/").replace(/~0/g, "~");
28222
27581
  }
28223
27582
 
@@ -28225,7 +27584,7 @@ let manifest;
28225
27584
  try {
28226
27585
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
28227
27586
  // @ts-ignore
28228
- manifest = (await import('../manifest-Bx5EZvxu.js')).default;
27587
+ manifest = (await import('../manifest-dq4u9tDK.js')).default;
28229
27588
  }
28230
27589
  catch {
28231
27590
  const name = "../dist/manifest.js";
@@ -29927,8 +29286,9 @@ function parse$1(original) {
29927
29286
  function stringify(value) {
29928
29287
  const n = value.n.toString();
29929
29288
  const sign = value.s === -1 ? "-" : "";
29930
- const decimal = value.e < n.length ? "." + n.slice(value.e) : "";
29931
- return sign + n.slice(0, value.e) + decimal;
29289
+ const int = value.e === 0 ? "0" : n.slice(0, value.e);
29290
+ const decimal = value.e < n.length ? "." + n.slice(value.e).padStart(value.d, "0") : "";
29291
+ return sign + int + decimal;
29932
29292
  }
29933
29293
  const equals = (a, b) => a.n === b.n && a.e === b.e;
29934
29294
  const compare = (a, b) => {
@@ -30033,40 +29393,41 @@ var Related;
30033
29393
  Related[Related["maybe"] = 2] = "maybe";
30034
29394
  })(Related || (Related = {}));
30035
29395
 
30036
- var Eu=Object.create;var $e=Object.defineProperty;var Cu=Object.getOwnPropertyDescriptor;var hu=Object.getOwnPropertyNames;var gu=Object.getPrototypeOf,yu=Object.prototype.hasOwnProperty;var or=e=>{throw TypeError(e)};var Au=(e,t)=>()=>(e&&(t=e(e=0)),t);var ye=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),We=(e,t)=>{for(var r in t)$e(e,r,{get:t[r],enumerable:!0});},ir=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of hu(t))!yu.call(e,o)&&o!==r&&$e(e,o,{get:()=>t[o],enumerable:!(n=Cu(t,o))||n.enumerable});return e};var Ae=(e,t,r)=>(r=e!=null?Eu(gu(e)):{},ir($e(r,"default",{value:e,enumerable:!0}),e)),Bu=e=>ir($e({},"__esModule",{value:!0}),e);var _u=(e,t,r)=>t.has(e)||or("Cannot "+r);var sr=(e,t,r)=>t.has(e)?or("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var fe=(e,t,r)=>(_u(e,t,"access private method"),r);var ar=ye(yt=>{Object.defineProperty(yt,"__esModule",{value:!0});yt.default=Dr;function Dr(){}Dr.prototype={diff:function(t,r){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=o.callback;typeof o=="function"&&(u=o,o={}),this.options=o;var i=this;function s(C){return u?(setTimeout(function(){u(void 0,C);},0),!0):C}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var D=r.length,a=t.length,c=1,p=D+a;o.maxEditLength&&(p=Math.min(p,o.maxEditLength));var f=(n=o.timeout)!==null&&n!==void 0?n:1/0,F=Date.now()+f,l=[{oldPos:-1,lastComponent:void 0}],d=this.extractCommon(l[0],r,t,0);if(l[0].oldPos+1>=a&&d+1>=D)return s([{value:this.join(r),count:r.length}]);var m=-1/0,E=1/0;function A(){for(var C=Math.max(m,-c);C<=Math.min(E,c);C+=2){var h=void 0,v=l[C-1],k=l[C+1];v&&(l[C-1]=void 0);var W=!1;if(k){var ge=k.oldPos-C;W=k&&0<=ge&&ge<D;}var gt=v&&v.oldPos+1<a;if(!W&&!gt){l[C]=void 0;continue}if(!gt||W&&v.oldPos+1<k.oldPos?h=i.addToPath(k,!0,void 0,0):h=i.addToPath(v,void 0,!0,1),d=i.extractCommon(h,r,t,C),h.oldPos+1>=a&&d+1>=D)return s(xu(i,h.lastComponent,r,t,i.useLongestToken));l[C]=h,h.oldPos+1>=a&&(E=Math.min(E,C-1)),d+1>=D&&(m=Math.max(m,C+1));}c++;}if(u)(function C(){setTimeout(function(){if(c>p||Date.now()>F)return u();A()||C();},0);})();else for(;c<=p&&Date.now()<=F;){var _=A();if(_)return _}},addToPath:function(t,r,n,o){var u=t.lastComponent;return u&&u.added===r&&u.removed===n?{oldPos:t.oldPos+o,lastComponent:{count:u.count+1,added:r,removed:n,previousComponent:u.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:r,removed:n,previousComponent:u}}},extractCommon:function(t,r,n,o){for(var u=r.length,i=n.length,s=t.oldPos,D=s-o,a=0;D+1<u&&s+1<i&&this.equals(r[D+1],n[s+1]);)D++,s++,a++;return a&&(t.lastComponent={count:a,previousComponent:t.lastComponent}),t.oldPos=s,D},equals:function(t,r){return this.options.comparator?this.options.comparator(t,r):t===r||this.options.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function xu(e,t,r,n,o){for(var u=[],i;t;)u.push(t),i=t.previousComponent,delete t.previousComponent,t=i;u.reverse();for(var s=0,D=u.length,a=0,c=0;s<D;s++){var p=u[s];if(p.removed){if(p.value=e.join(n.slice(c,c+p.count)),c+=p.count,s&&u[s-1].added){var F=u[s-1];u[s-1]=u[s],u[s]=F;}}else {if(!p.added&&o){var f=r.slice(a,a+p.count);f=f.map(function(d,m){var E=n[c+m];return E.length>d.length?E:d}),p.value=e.join(f);}else p.value=e.join(r.slice(a,a+p.count));a+=p.count,p.added||(c+=p.count);}}var l=u[D-1];return D>1&&typeof l.value=="string"&&(l.added||l.removed)&&e.equals("",l.value)&&(u[D-2].value+=l.value,u.pop()),u}});var cr=ye(_e=>{Object.defineProperty(_e,"__esModule",{value:!0});_e.diffArrays=Ou;_e.arrayDiff=void 0;var ku=wu(ar());function wu(e){return e&&e.__esModule?e:{default:e}}var Be=new ku.default;_e.arrayDiff=Be;Be.tokenize=function(e){return e.slice()};Be.join=Be.removeEmpty=function(e){return e};function Ou(e,t,r){return Be.diff(e,t,r)}});var ot=ye((tD,rn)=>{var tn=new Proxy(String,{get:()=>tn});rn.exports=tn;});var wn={};We(wn,{default:()=>Ao,shouldHighlight:()=>yo});var yo,Ao,On=Au(()=>{yo=()=>!1,Ao=String;});var Tn=ye((Ba,qt)=>{var g=String,Nn=function(){return {isColorSupported:!1,reset:g,bold:g,dim:g,italic:g,underline:g,inverse:g,hidden:g,strikethrough:g,black:g,red:g,green:g,yellow:g,blue:g,magenta:g,cyan:g,white:g,gray:g,bgBlack:g,bgRed:g,bgGreen:g,bgYellow:g,bgBlue:g,bgMagenta:g,bgCyan:g,bgWhite:g}};qt.exports=Nn();qt.exports.createColors=Nn;});var jn=ye(Ct=>{Object.defineProperty(Ct,"__esModule",{value:!0});Ct.codeFrameColumns=Yn;Ct.default=wo;var Sn=(On(),Bu(wn)),In=Bo(Tn(),!0);function Rn(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return (Rn=function(n){return n?r:t})(e)}function Bo(e,t){if(e===null||typeof e!="object"&&typeof e!="function")return {default:e};var r=Rn(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(u!=="default"&&{}.hasOwnProperty.call(e,u)){var i=o?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,r&&r.set(e,n),n}var _o=In.default,vn=(e,t)=>r=>e(t(r)),Jt;function bo(e){if(e){return (Jt)!=null||(Jt=(0, In.createColors)(!0)),Jt}return _o}var Pn=!1;function xo(e){return {gutter:e.gray,marker:vn(e.red,e.bold),message:vn(e.red,e.bold)}}var Ln=/\r\n|[\n\r\u2028\u2029]/;function ko(e,t,r){let n=Object.assign({column:0,line:-1},e.start),o=Object.assign({},n,e.end),{linesAbove:u=2,linesBelow:i=3}=r||{},s=n.line,D=n.column,a=o.line,c=o.column,p=Math.max(s-(u+1),0),f=Math.min(t.length,a+i);s===-1&&(p=0),a===-1&&(f=t.length);let F=a-s,l={};if(F)for(let d=0;d<=F;d++){let m=d+s;if(!D)l[m]=!0;else if(d===0){let E=t[m-1].length;l[m]=[D,E-D+1];}else if(d===F)l[m]=[0,c];else {let E=t[m-d].length;l[m]=[0,E];}}else D===c?D?l[s]=[D,0]:l[s]=!0:l[s]=[D,c-D];return {start:p,end:f,markerLines:l}}function Yn(e,t,r={}){let n=(r.highlightCode||r.forceColor)&&(0, Sn.shouldHighlight)(r),o=bo(r.forceColor),u=xo(o),i=(d,m)=>n?d(m):m,s=e.split(Ln),{start:D,end:a,markerLines:c}=ko(t,s,r),p=t.start&&typeof t.start.column=="number",f=String(a).length,l=(n?(0, Sn.default)(e,r):e).split(Ln,a).slice(D,a).map((d,m)=>{let E=D+1+m,_=` ${` ${E}`.slice(-f)} |`,C=c[E],h=!c[E+1];if(C){let v="";if(Array.isArray(C)){let k=d.slice(0,Math.max(C[0]-1,0)).replace(/[^\t]/g," "),W=C[1]||1;v=[`
30037
- `,i(u.gutter,_.replace(/\d/g," "))," ",k,i(u.marker,"^").repeat(W)].join(""),h&&r.message&&(v+=" "+i(u.message,r.message));}return [i(u.marker,">"),i(u.gutter,_),d.length>0?` ${d}`:"",v].join("")}else return ` ${i(u.gutter,_)}${d.length>0?` ${d}`:""}`}).join(`
30038
- `);return r.message&&!p&&(l=`${" ".repeat(f+1)}${r.message}
30039
- ${l}`),n?o.reset(l):l}function wo(e,t,r,n={}){if(!Pn){Pn=!0;let u="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";{let i=new Error(u);i.name="DeprecationWarning",console.warn(new Error(u));}}return r=Math.max(r,0),Yn(e,{start:{column:r,line:t}},n)}});var ur={};We(ur,{__debug:()=>ai,check:()=>si,doc:()=>tr,format:()=>mu,formatWithCursor:()=>du,getSupportInfo:()=>Di,util:()=>nr,version:()=>Du});var bu=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},re=bu;var Qn=Ae(cr());function lr(e){let t=e.indexOf("\r");return t>=0?e.charAt(t+1)===`
30040
- `?"crlf":"cr":"lf"}function be(e){switch(e){case"cr":return "\r";case"crlf":return `\r
29396
+ var yu=Object.create;var He=Object.defineProperty;var Au=Object.getOwnPropertyDescriptor;var Bu=Object.getOwnPropertyNames;var wu=Object.getPrototypeOf,xu=Object.prototype.hasOwnProperty;var sr=e=>{throw TypeError(e)};var _u=(e,t)=>()=>(e&&(t=e(e=0)),t);var At=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),We=(e,t)=>{for(var r in t)He(e,r,{get:t[r],enumerable:!0});},ar=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bu(t))!xu.call(e,o)&&o!==r&&He(e,o,{get:()=>t[o],enumerable:!(n=Au(t,o))||n.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?yu(wu(e)):{},ar(He(r,"default",{value:e,enumerable:!0}),e)),vu=e=>ar(He({},"__esModule",{value:!0}),e);var bu=(e,t,r)=>t.has(e)||sr("Cannot "+r);var Dr=(e,t,r)=>t.has(e)?sr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var pe=(e,t,r)=>(bu(e,t,"access private method"),r);var it=At((ia,sn)=>{var on=new Proxy(String,{get:()=>on});sn.exports=on;});var Tn={};We(Tn,{default:()=>_o,shouldHighlight:()=>xo});var xo,_o,kn=_u(()=>{xo=()=>!1,_o=String;});var Pn=At((bD,Xt)=>{var g=String,Ln=function(){return {isColorSupported:!1,reset:g,bold:g,dim:g,italic:g,underline:g,inverse:g,hidden:g,strikethrough:g,black:g,red:g,green:g,yellow:g,blue:g,magenta:g,cyan:g,white:g,gray:g,bgBlack:g,bgRed:g,bgGreen:g,bgYellow:g,bgBlue:g,bgMagenta:g,bgCyan:g,bgWhite:g}};Xt.exports=Ln();Xt.exports.createColors=Ln;});var $n=At(Ct=>{Object.defineProperty(Ct,"__esModule",{value:!0});Ct.codeFrameColumns=Mn;Ct.default=To;var In=(kn(),vu(Tn)),Hn=vo(Pn(),!0);function Wn(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return (Wn=function(n){return n?r:t})(e)}function vo(e,t){if(e===null||typeof e!="object"&&typeof e!="function")return {default:e};var r=Wn(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(u!=="default"&&{}.hasOwnProperty.call(e,u)){var i=o?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,r&&r.set(e,n),n}var bo=Hn.default,Rn=(e,t)=>r=>e(t(r)),Zt;function Oo(e){if(e){return (Zt)!=null||(Zt=(0, Hn.createColors)(!0)),Zt}return bo}var Yn=!1;function So(e){return {gutter:e.gray,marker:Rn(e.red,e.bold),message:Rn(e.red,e.bold)}}var jn=/\r\n|[\n\r\u2028\u2029]/;function No(e,t,r){let n=Object.assign({column:0,line:-1},e.start),o=Object.assign({},n,e.end),{linesAbove:u=2,linesBelow:i=3}=r||{},s=n.line,a=n.column,D=o.line,l=o.column,d=Math.max(s-(u+1),0),f=Math.min(t.length,D+i);s===-1&&(d=0),D===-1&&(f=t.length);let p=D-s,c={};if(p)for(let F=0;F<=p;F++){let m=F+s;if(!a)c[m]=!0;else if(F===0){let E=t[m-1].length;c[m]=[a,E-a+1];}else if(F===p)c[m]=[0,l];else {let E=t[m-F].length;c[m]=[0,E];}}else a===l?a?c[s]=[a,0]:c[s]=!0:c[s]=[a,l-a];return {start:d,end:f,markerLines:c}}function Mn(e,t,r={}){let n=(r.highlightCode||r.forceColor)&&(0, In.shouldHighlight)(r),o=Oo(r.forceColor),u=So(o),i=(F,m)=>n?F(m):m,s=e.split(jn),{start:a,end:D,markerLines:l}=No(t,s,r),d=t.start&&typeof t.start.column=="number",f=String(D).length,c=(n?(0, In.default)(e,r):e).split(jn,D).slice(a,D).map((F,m)=>{let E=a+1+m,w=` ${` ${E}`.slice(-f)} |`,h=l[E],C=!l[E+1];if(h){let k="";if(Array.isArray(h)){let v=F.slice(0,Math.max(h[0]-1,0)).replace(/[^\t]/g," "),$=h[1]||1;k=[`
29397
+ `,i(u.gutter,w.replace(/\d/g," "))," ",v,i(u.marker,"^").repeat($)].join(""),C&&r.message&&(k+=" "+i(u.message,r.message));}return [i(u.marker,">"),i(u.gutter,w),F.length>0?` ${F}`:"",k].join("")}else return ` ${i(u.gutter,w)}${F.length>0?` ${F}`:""}`}).join(`
29398
+ `);return r.message&&!d&&(c=`${" ".repeat(f+1)}${r.message}
29399
+ ${c}`),n?o.reset(c):c}function To(e,t,r,n={}){if(!Yn){Yn=!0;let u="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";{let i=new Error(u);i.name="DeprecationWarning",console.warn(new Error(u));}}return r=Math.max(r,0),Mn(e,{start:{column:r,line:t}},n)}});var ir={};We(ir,{__debug:()=>di,check:()=>fi,doc:()=>nr,format:()=>gu,formatWithCursor:()=>Cu,getSupportInfo:()=>pi,util:()=>or,version:()=>fu});var Ou=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},ne=Ou;function Z(){}Z.prototype={diff:function(t,r){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=o.callback;typeof o=="function"&&(u=o,o={}),this.options=o;var i=this;function s(h){return u?(setTimeout(function(){u(void 0,h);},0),!0):h}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var a=r.length,D=t.length,l=1,d=a+D;o.maxEditLength&&(d=Math.min(d,o.maxEditLength));var f=(n=o.timeout)!==null&&n!==void 0?n:1/0,p=Date.now()+f,c=[{oldPos:-1,lastComponent:void 0}],F=this.extractCommon(c[0],r,t,0);if(c[0].oldPos+1>=D&&F+1>=a)return s([{value:this.join(r),count:r.length}]);var m=-1/0,E=1/0;function A(){for(var h=Math.max(m,-l);h<=Math.min(E,l);h+=2){var C=void 0,k=c[h-1],v=c[h+1];k&&(c[h-1]=void 0);var $=!1;if(v){var ye=v.oldPos-h;$=v&&0<=ye&&ye<a;}var yt=k&&k.oldPos+1<D;if(!$&&!yt){c[h]=void 0;continue}if(!yt||$&&k.oldPos+1<v.oldPos?C=i.addToPath(v,!0,void 0,0):C=i.addToPath(k,void 0,!0,1),F=i.extractCommon(C,r,t,h),C.oldPos+1>=D&&F+1>=a)return s(Su(i,C.lastComponent,r,t,i.useLongestToken));c[h]=C,C.oldPos+1>=D&&(E=Math.min(E,h-1)),F+1>=a&&(m=Math.max(m,h+1));}l++;}if(u)(function h(){setTimeout(function(){if(l>d||Date.now()>p)return u();A()||h();},0);})();else for(;l<=d&&Date.now()<=p;){var w=A();if(w)return w}},addToPath:function(t,r,n,o){var u=t.lastComponent;return u&&u.added===r&&u.removed===n?{oldPos:t.oldPos+o,lastComponent:{count:u.count+1,added:r,removed:n,previousComponent:u.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:r,removed:n,previousComponent:u}}},extractCommon:function(t,r,n,o){for(var u=r.length,i=n.length,s=t.oldPos,a=s-o,D=0;a+1<u&&s+1<i&&this.equals(r[a+1],n[s+1]);)a++,s++,D++;return D&&(t.lastComponent={count:D,previousComponent:t.lastComponent}),t.oldPos=s,a},equals:function(t,r){return this.options.comparator?this.options.comparator(t,r):t===r||this.options.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function Su(e,t,r,n,o){for(var u=[],i;t;)u.push(t),i=t.previousComponent,delete t.previousComponent,t=i;u.reverse();for(var s=0,a=u.length,D=0,l=0;s<a;s++){var d=u[s];if(d.removed){if(d.value=e.join(n.slice(l,l+d.count)),l+=d.count,s&&u[s-1].added){var p=u[s-1];u[s-1]=u[s],u[s]=p;}}else {if(!d.added&&o){var f=r.slice(D,D+d.count);f=f.map(function(F,m){var E=n[l+m];return E.length>F.length?E:F}),d.value=e.join(f);}else d.value=e.join(r.slice(D,D+d.count));D+=d.count,d.added||(l+=d.count);}}var c=u[a-1];return a>1&&typeof c.value=="string"&&(c.added||c.removed)&&e.equals("",c.value)&&(u[a-2].value+=c.value,u.pop()),u}var lr=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,cr=/\S/,fr=new Z;fr.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!cr.test(e)&&!cr.test(t)};fr.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<t.length-1;r++)!t[r+1]&&t[r+2]&&lr.test(t[r])&&lr.test(t[r+2])&&(t[r]+=t[r+2],t.splice(r+1,2),r--);return t};var pr=new Z;pr.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
29400
+ `));var t=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;n<r.length;n++){var o=r[n];n%2&&!this.options.newlineIsToken?t[t.length-1]+=o:(this.options.ignoreWhitespace&&(o=o.trim()),t.push(o));}return t};var Nu=new Z;Nu.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Tu=new Z;Tu.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function $e(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$e=function(t){return typeof t}:$e=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$e(e)}var ku=Object.prototype.toString,Ae=new Z;Ae.useLongestToken=!0;Ae.tokenize=pr.tokenize;Ae.castInput=function(e){var t=this.options,r=t.undefinedReplacement,n=t.stringifyReplacer,o=n===void 0?function(u,i){return typeof i>"u"?r:i}:n;return typeof e=="string"?e:JSON.stringify(Bt(e,null,null,o),o," ")};Ae.equals=function(e,t){return Z.prototype.equals.call(Ae,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Bt(e,t,r,n,o){t=t||[],r=r||[],n&&(e=n(o,e));var u;for(u=0;u<t.length;u+=1)if(t[u]===e)return r[u];var i;if(ku.call(e)==="[object Array]"){for(t.push(e),i=new Array(e.length),r.push(i),u=0;u<e.length;u+=1)i[u]=Bt(e[u],t,r,n,o);return t.pop(),r.pop(),i}if(e&&e.toJSON&&(e=e.toJSON()),$e(e)==="object"&&e!==null){t.push(e),i={},r.push(i);var s=[],a;for(a in e)e.hasOwnProperty(a)&&s.push(a);for(s.sort(),u=0;u<s.length;u+=1)a=s[u],i[a]=Bt(e[a],t,r,n,a);t.pop(),r.pop();}else i=e;return i}var Ve=new Z;Ve.tokenize=function(e){return e.slice()};Ve.join=Ve.removeEmpty=function(e){return e};function dr(e,t,r){return Ve.diff(e,t,r)}function Fr(e){let t=e.indexOf("\r");return t>=0?e.charAt(t+1)===`
29401
+ `?"crlf":"cr":"lf"}function Be(e){switch(e){case"cr":return "\r";case"crlf":return `\r
30041
29402
  `;default:return `
30042
- `}}function At(e,t){let r;switch(t){case`
30043
- `:r=/\n/g;break;case"\r":r=/\r/g;break;case`\r
30044
- `:r=/\r\n/g;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let n=e.match(r);return n?n.length:0}function fr(e){return re(!1,e,/\r\n?/g,`
30045
- `)}var G="string",V="array",z="cursor",P="indent",L="align",I="trim",b="group",N="fill",x="if-break",R="indent-if-break",Y="line-suffix",j="line-suffix-boundary",B="line",T="label",w="break-parent",Ue=new Set([z,P,L,I,b,N,x,R,Y,j,B,T,w]);function Nu(e){if(typeof e=="string")return G;if(Array.isArray(e))return V;if(!e)return;let{type:t}=e;if(Ue.has(t))return t}var K=Nu;var Tu=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Su(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return `Unexpected doc '${t}',
30046
- Expected it to be 'string' or 'object'.`;if(K(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return `Unexpected doc '${r}'.`;let n=Tu([...Ue].map(o=>`'${o}'`));return `Unexpected doc.type '${e.type}'.
30047
- Expected it to be ${n}.`}var Bt=class extends Error{name="InvalidDocError";constructor(t){super(Su(t)),this.doc=t;}},Z=Bt;var Fr={};function vu(e,t,r,n){let o=[e];for(;o.length>0;){let u=o.pop();if(u===Fr){r(o.pop());continue}r&&o.push(u,Fr);let i=K(u);if(!i)throw new Z(u);if((t==null?void 0:t(u))!==!1)switch(i){case V:case N:{let s=i===V?u:u.parts;for(let D=s.length,a=D-1;a>=0;--a)o.push(s[a]);break}case x:o.push(u.flatContents,u.breakContents);break;case b:if(n&&u.expandedStates)for(let s=u.expandedStates.length,D=s-1;D>=0;--D)o.push(u.expandedStates[D]);else o.push(u.contents);break;case L:case P:case R:case T:case Y:o.push(u.contents);break;case G:case z:case I:case j:case B:case w:break;default:throw new Z(u)}}}var xe=vu;var pr=()=>{},Ge=pr;function De(e){return {type:P,contents:e}}function se(e,t){return {type:L,contents:t,n:e}}function _t(e,t={}){return Ge(t.expandedStates),{type:b,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function dr(e){return se(Number.NEGATIVE_INFINITY,e)}function mr(e){return se({type:"root"},e)}function Er(e){return se(-1,e)}function Cr(e,t){return _t(e[0],{...t,expandedStates:e})}function ze(e){return {type:N,parts:e}}function hr(e,t="",r={}){return {type:x,breakContents:e,flatContents:t,groupId:r.groupId}}function gr(e,t){return {type:R,contents:e,groupId:t.groupId,negate:t.negate}}function ke(e){return {type:Y,contents:e}}var yr={type:j},Fe={type:w},Ar={type:I},we={type:B,hard:!0},bt={type:B,hard:!0,literal:!0},Ke={type:B},Br={type:B,soft:!0},q=[we,Fe],He=[bt,Fe],Oe={type:z};function Ne(e,t){let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}function qe(e,t,r){let n=e;if(t>0){for(let o=0;o<Math.floor(t/r);++o)n=De(n);n=se(t%r,n),n=se(Number.NEGATIVE_INFINITY,n);}return n}function _r(e,t){return e?{type:T,label:e,contents:t}:t}function Q(e){var t;if(!e)return "";if(Array.isArray(e)){let r=[];for(let n of e)if(Array.isArray(n))r.push(...Q(n));else {let o=Q(n);o!==""&&r.push(o);}return r}return e.type===x?{...e,breakContents:Q(e.breakContents),flatContents:Q(e.flatContents)}:e.type===b?{...e,contents:Q(e.contents),expandedStates:(t=e.expandedStates)==null?void 0:t.map(Q)}:e.type===N?{type:"fill",parts:e.parts.map(Q)}:e.contents?{...e,contents:Q(e.contents)}:e}function br(e){let t=Object.create(null),r=new Set;return n(Q(e));function n(u,i,s){var D,a;if(typeof u=="string")return JSON.stringify(u);if(Array.isArray(u)){let c=u.map(n).filter(Boolean);return c.length===1?c[0]:`[${c.join(", ")}]`}if(u.type===B){let c=((D=s==null?void 0:s[i+1])==null?void 0:D.type)===w;return u.literal?c?"literalline":"literallineWithoutBreakParent":u.hard?c?"hardline":"hardlineWithoutBreakParent":u.soft?"softline":"line"}if(u.type===w)return ((a=s==null?void 0:s[i-1])==null?void 0:a.type)===B&&s[i-1].hard?void 0:"breakParent";if(u.type===I)return "trim";if(u.type===P)return "indent("+n(u.contents)+")";if(u.type===L)return u.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(u.contents)+")":u.n<0?"dedent("+n(u.contents)+")":u.n.type==="root"?"markAsRoot("+n(u.contents)+")":"align("+JSON.stringify(u.n)+", "+n(u.contents)+")";if(u.type===x)return "ifBreak("+n(u.breakContents)+(u.flatContents?", "+n(u.flatContents):"")+(u.groupId?(u.flatContents?"":', ""')+`, { groupId: ${o(u.groupId)} }`:"")+")";if(u.type===R){let c=[];u.negate&&c.push("negate: true"),u.groupId&&c.push(`groupId: ${o(u.groupId)}`);let p=c.length>0?`, { ${c.join(", ")} }`:"";return `indentIfBreak(${n(u.contents)}${p})`}if(u.type===b){let c=[];u.break&&u.break!=="propagated"&&c.push("shouldBreak: true"),u.id&&c.push(`id: ${o(u.id)}`);let p=c.length>0?`, { ${c.join(", ")} }`:"";return u.expandedStates?`conditionalGroup([${u.expandedStates.map(f=>n(f)).join(",")}]${p})`:`group(${n(u.contents)}${p})`}if(u.type===N)return `fill([${u.parts.map(c=>n(c)).join(", ")}])`;if(u.type===Y)return "lineSuffix("+n(u.contents)+")";if(u.type===j)return "lineSuffixBoundary";if(u.type===T)return `label(${JSON.stringify(u.label)}, ${n(u.contents)})`;throw new Error("Unknown doc type "+u.type)}function o(u){if(typeof u!="symbol")return JSON.stringify(String(u));if(u in t)return t[u];let i=u.description||"symbol";for(let s=0;;s++){let D=i+(s>0?` #${s}`:"");if(!r.has(D))return r.add(D),t[u]=`Symbol.for(${JSON.stringify(D)})`}}}var Pu=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},y=Pu;var xr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function kr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function wr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var Or=e=>!(kr(e)||wr(e));var Lu=/[^\x20-\x7F]/;function Iu(e){if(!e)return 0;if(!Lu.test(e))return e.length;e=e.replace(xr()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=Or(n)?1:2);}return t}var Te=Iu;function ve(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=o(u);return r.set(u,i),i}function o(u){switch(K(u)){case V:return t(u.map(n));case N:return t({...u,parts:u.parts.map(n)});case x:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case b:{let{expandedStates:i,contents:s}=u;return i?(i=i.map(n),s=i[0]):s=n(s),t({...u,contents:s,expandedStates:i})}case L:case P:case R:case T:case Y:return t({...u,contents:n(u.contents)});case G:case z:case I:case j:case B:case w:return t(u);default:throw new Z(u)}}}function Je(e,t,r){let n=r,o=!1;function u(i){if(o)return !1;let s=t(i);s!==void 0&&(o=!0,n=s);}return xe(e,u),n}function Ru(e){if(e.type===b&&e.break||e.type===B&&e.hard||e.type===w)return !0}function Sr(e){return Je(e,Ru,!1)}function Nr(e){if(e.length>0){let t=y(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated");}return null}function vr(e){let t=new Set,r=[];function n(u){if(u.type===w&&Nr(r),u.type===b){if(r.push(u),t.has(u))return !1;t.add(u);}}function o(u){u.type===b&&r.pop().break&&Nr(r);}xe(e,n,o,!0);}function Yu(e){return e.type===B&&!e.hard?e.soft?"":" ":e.type===x?e.flatContents:e}function Pr(e){return ve(e,Yu)}function Tr(e){for(e=[...e];e.length>=2&&y(!1,e,-2).type===B&&y(!1,e,-1).type===w;)e.length-=2;if(e.length>0){let t=Se(y(!1,e,-1));e[e.length-1]=t;}return e}function Se(e){switch(K(e)){case P:case R:case b:case Y:case T:{let t=Se(e.contents);return {...e,contents:t}}case x:return {...e,breakContents:Se(e.breakContents),flatContents:Se(e.flatContents)};case N:return {...e,parts:Tr(e.parts)};case V:return Tr(e);case G:return e.replace(/[\n\r]*$/,"");case L:case z:case I:case j:case B:case w:break;default:throw new Z(e)}return e}function Xe(e){return Se(Mu(e))}function ju(e){switch(K(e)){case N:if(e.parts.every(t=>t===""))return "";break;case b:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return "";if(e.contents.type===b&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case L:case P:case R:case Y:if(!e.contents)return "";break;case x:if(!e.flatContents&&!e.breakContents)return "";break;case V:{let t=[];for(let r of e){if(!r)continue;let[n,...o]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof y(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...o);}return t.length===0?"":t.length===1?t[0]:t}case G:case z:case I:case j:case B:case T:case w:break;default:throw new Z(e)}return e}function Mu(e){return ve(e,t=>ju(t))}function Lr(e,t=He){return ve(e,r=>typeof r=="string"?Ne(t,r.split(`
30048
- `)):r)}function Vu(e){if(e.type===B)return !0}function Ir(e){return Je(e,Vu,!1)}function Ze(e,t){return e.type===T?{...e,contents:t(e.contents)}:t(e)}var M=Symbol("MODE_BREAK"),J=Symbol("MODE_FLAT"),Pe=Symbol("cursor");function Rr(){return {value:"",length:0,queue:[]}}function $u(e,t){return xt(e,{type:"indent"},t)}function Wu(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Rr():t<0?xt(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:xt(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function xt(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],o="",u=0,i=0,s=0;for(let l of n)switch(l.type){case"indent":c(),r.useTabs?D(1):a(r.tabWidth);break;case"stringAlign":c(),o+=l.n,u+=l.n.length;break;case"numberAlign":i+=1,s+=l.n;break;default:throw new Error(`Unexpected type '${l.type}'`)}return f(),{...e,value:o,length:u,queue:n};function D(l){o+=" ".repeat(l),u+=r.tabWidth*l;}function a(l){o+=" ".repeat(l),u+=l;}function c(){r.useTabs?p():f();}function p(){i>0&&D(i),F();}function f(){s>0&&a(s),F();}function F(){i=0,s=0;}}function kt(e){let t=0,r=0,n=e.length;e:for(;n--;){let o=e[n];if(o===Pe){r++;continue}for(let u=o.length-1;u>=0;u--){let i=o[u];if(i===" "||i===" ")t++;else {e[n]=o.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Pe);return t}function Qe(e,t,r,n,o,u){if(r===Number.POSITIVE_INFINITY)return !0;let i=t.length,s=[e],D=[];for(;r>=0;){if(s.length===0){if(i===0)return !0;s.push(t[--i]);continue}let{mode:a,doc:c}=s.pop(),p=K(c);switch(p){case G:D.push(c),r-=Te(c);break;case V:case N:{let f=p===V?c:c.parts;for(let F=f.length-1;F>=0;F--)s.push({mode:a,doc:f[F]});break}case P:case L:case R:case T:s.push({mode:a,doc:c.contents});break;case I:r+=kt(D);break;case b:{if(u&&c.break)return !1;let f=c.break?M:a,F=c.expandedStates&&f===M?y(!1,c.expandedStates,-1):c.contents;s.push({mode:f,doc:F});break}case x:{let F=(c.groupId?o[c.groupId]||J:a)===M?c.breakContents:c.flatContents;F&&s.push({mode:a,doc:F});break}case B:if(a===M||c.hard)return !0;c.soft||(D.push(" "),r--);break;case Y:n=!0;break;case j:if(n)return !1;break}}return !1}function pe(e,t){let r={},n=t.printWidth,o=be(t.endOfLine),u=0,i=[{ind:Rr(),mode:M,doc:e}],s=[],D=!1,a=[],c=0;for(vr(e);i.length>0;){let{ind:f,mode:F,doc:l}=i.pop();switch(K(l)){case G:{let d=o!==`
30049
- `?re(!1,l,`
30050
- `,o):l;s.push(d),i.length>0&&(u+=Te(d));break}case V:for(let d=l.length-1;d>=0;d--)i.push({ind:f,mode:F,doc:l[d]});break;case z:if(c>=2)throw new Error("There are too many 'cursor' in doc.");s.push(Pe),c++;break;case P:i.push({ind:$u(f,t),mode:F,doc:l.contents});break;case L:i.push({ind:Wu(f,l.n,t),mode:F,doc:l.contents});break;case I:u-=kt(s);break;case b:switch(F){case J:if(!D){i.push({ind:f,mode:l.break?M:J,doc:l.contents});break}case M:{D=!1;let d={ind:f,mode:J,doc:l.contents},m=n-u,E=a.length>0;if(!l.break&&Qe(d,i,m,E,r))i.push(d);else if(l.expandedStates){let A=y(!1,l.expandedStates,-1);if(l.break){i.push({ind:f,mode:M,doc:A});break}else for(let _=1;_<l.expandedStates.length+1;_++)if(_>=l.expandedStates.length){i.push({ind:f,mode:M,doc:A});break}else {let C=l.expandedStates[_],h={ind:f,mode:J,doc:C};if(Qe(h,i,m,E,r)){i.push(h);break}}}else i.push({ind:f,mode:M,doc:l.contents});break}}l.id&&(r[l.id]=y(!1,i,-1).mode);break;case N:{let d=n-u,{parts:m}=l;if(m.length===0)break;let[E,A]=m,_={ind:f,mode:J,doc:E},C={ind:f,mode:M,doc:E},h=Qe(_,[],d,a.length>0,r,!0);if(m.length===1){h?i.push(_):i.push(C);break}let v={ind:f,mode:J,doc:A},k={ind:f,mode:M,doc:A};if(m.length===2){h?i.push(v,_):i.push(k,C);break}m.splice(0,2);let W={ind:f,mode:F,doc:ze(m)},ge=m[0];Qe({ind:f,mode:J,doc:[E,A,ge]},[],d,a.length>0,r,!0)?i.push(W,v,_):h?i.push(W,k,_):i.push(W,k,C);break}case x:case R:{let d=l.groupId?r[l.groupId]:F;if(d===M){let m=l.type===x?l.breakContents:l.negate?l.contents:De(l.contents);m&&i.push({ind:f,mode:F,doc:m});}if(d===J){let m=l.type===x?l.flatContents:l.negate?De(l.contents):l.contents;m&&i.push({ind:f,mode:F,doc:m});}break}case Y:a.push({ind:f,mode:F,doc:l.contents});break;case j:a.length>0&&i.push({ind:f,mode:F,doc:we});break;case B:switch(F){case J:if(l.hard)D=!0;else {l.soft||(s.push(" "),u+=1);break}case M:if(a.length>0){i.push({ind:f,mode:F,doc:l},...a.reverse()),a.length=0;break}l.literal?f.root?(s.push(o,f.root.value),u=f.root.length):(s.push(o),u=0):(u-=kt(s),s.push(o+f.value),u=f.length);break}break;case T:i.push({ind:f,mode:F,doc:l.contents});break;case w:break;default:throw new Z(l)}i.length===0&&a.length>0&&(i.push(...a.reverse()),a.length=0);}let p=s.indexOf(Pe);if(p!==-1){let f=s.indexOf(Pe,p+1),F=s.slice(0,p).join(""),l=s.slice(p+1,f).join(""),d=s.slice(f+1).join("");return {formatted:F+l+d,cursorNodeStart:F.length,cursorNodeText:l}}return {formatted:s.join("")}}function Uu(e,t,r=0){let n=0;for(let o=r;o<e.length;++o)e[o]===" "?n=n+t-n%t:n++;return n}var de=Uu;var ee,Ot,et,wt=class{constructor(t){sr(this,ee);this.stack=[t];}get key(){let{stack:t,siblings:r}=this;return y(!1,t,r===null?-2:-4)??null}get index(){return this.siblings===null?null:y(!1,this.stack,-2)}get node(){return y(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:t}=this,r=y(!1,t,-3);return Array.isArray(r)?r:null}get next(){let{siblings:t}=this;return t===null?null:t[this.index+1]}get previous(){let{siblings:t}=this;return t===null?null:t[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:t,index:r}=this;return t!==null&&r===t.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return [...fe(this,ee,et).call(this)]}getName(){let{stack:t}=this,{length:r}=t;return r>1?y(!1,t,-2):null}getValue(){return y(!1,this.stack,-1)}getNode(t=0){let r=fe(this,ee,Ot).call(this,t);return r===-1?null:this.stack[r]}getParentNode(t=0){return this.getNode(t+1)}call(t,...r){let{stack:n}=this,{length:o}=n,u=y(!1,n,-1);for(let i of r)u=u[i],n.push(i,u);try{return t(this)}finally{n.length=o;}}callParent(t,r=0){let n=fe(this,ee,Ot).call(this,r+1),o=this.stack.splice(n+1);try{return t(this)}finally{this.stack.push(...o);}}each(t,...r){let{stack:n}=this,{length:o}=n,u=y(!1,n,-1);for(let i of r)u=u[i],n.push(i,u);try{for(let i=0;i<u.length;++i)n.push(i,u[i]),t(this,i,u),n.length-=2;}finally{n.length=o;}}map(t,...r){let n=[];return this.each((o,u,i)=>{n[u]=t(o,u,i);},...r),n}match(...t){let r=this.stack.length-1,n=null,o=this.stack[r--];for(let u of t){if(o===void 0)return !1;let i=null;if(typeof n=="number"&&(i=n,n=this.stack[r--],o=this.stack[r--]),u&&!u(o,n,i))return !1;n=this.stack[r--],o=this.stack[r--];}return !0}findAncestor(t){for(let r of fe(this,ee,et).call(this))if(t(r))return r}hasAncestor(t){for(let r of fe(this,ee,et).call(this))if(t(r))return !0;return !1}};ee=new WeakSet,Ot=function(t){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--t<0)return n;return -1},et=function*(){let{stack:t}=this;for(let r=t.length-3;r>=0;r-=2){let n=t[r];Array.isArray(n)||(yield n);}};var Yr=wt;var jr=new Proxy(()=>{},{get:()=>jr}),Le=jr;function Gu(e){return e!==null&&typeof e=="object"}var Mr=Gu;function*Nt(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,o=u=>Mr(u)&&n(u);for(let u of r(e)){let i=e[u];if(Array.isArray(i))for(let s of i)o(s)&&(yield s);else o(i)&&(yield i);}}function*Vr(e,t){let r=[e];for(let n=0;n<r.length;n++){let o=r[n];for(let u of Nt(o,t))yield u,r.push(u);}}function me(e){return (t,r,n)=>{let o=!!(n!=null&&n.backwards);if(r===!1)return !1;let{length:u}=t,i=r;for(;i>=0&&i<u;){let s=t.charAt(i);if(e instanceof RegExp){if(!e.test(s))return i}else if(!e.includes(s))return i;o?i--:i++;}return i===-1||i===u?i:!1}}var $r=me(/\s/),S=me(" "),tt=me(",; "),rt=me(/[^\n\r]/);function zu(e,t,r){let n=!!(r!=null&&r.backwards);if(t===!1)return !1;let o=e.charAt(t);if(n){if(e.charAt(t-1)==="\r"&&o===`
29403
+ `}}function wt(e,t){let r;switch(t){case`
29404
+ `:r=/\n/gu;break;case"\r":r=/\r/gu;break;case`\r
29405
+ `:r=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let n=e.match(r);return n?n.length:0}function mr(e){return ne(!1,e,/\r\n?/gu,`
29406
+ `)}var U="string",W="array",z="cursor",L="indent",P="align",I="trim",x="group",S="fill",_="if-break",R="indent-if-break",Y="line-suffix",j="line-suffix-boundary",B="line",N="label",b="break-parent",Ue=new Set([z,L,P,I,x,S,_,R,Y,j,B,N,b]);function Lu(e){if(typeof e=="string")return U;if(Array.isArray(e))return W;if(!e)return;let{type:t}=e;if(Ue.has(t))return t}var G=Lu;var Pu=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Iu(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return `Unexpected doc '${t}',
29407
+ Expected it to be 'string' or 'object'.`;if(G(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return `Unexpected doc '${r}'.`;let n=Pu([...Ue].map(o=>`'${o}'`));return `Unexpected doc.type '${e.type}'.
29408
+ Expected it to be ${n}.`}var xt=class extends Error{name="InvalidDocError";constructor(t){super(Iu(t)),this.doc=t;}},Q=xt;var Er={};function Ru(e,t,r,n){let o=[e];for(;o.length>0;){let u=o.pop();if(u===Er){r(o.pop());continue}r&&o.push(u,Er);let i=G(u);if(!i)throw new Q(u);if((t==null?void 0:t(u))!==!1)switch(i){case W:case S:{let s=i===W?u:u.parts;for(let a=s.length,D=a-1;D>=0;--D)o.push(s[D]);break}case _:o.push(u.flatContents,u.breakContents);break;case x:if(n&&u.expandedStates)for(let s=u.expandedStates.length,a=s-1;a>=0;--a)o.push(u.expandedStates[a]);else o.push(u.contents);break;case P:case L:case R:case N:case Y:o.push(u.contents);break;case U:case z:case I:case j:case B:case b:break;default:throw new Q(u)}}}var we=Ru;var hr=()=>{},ze=hr;function De(e){return {type:L,contents:e}}function ae(e,t){return {type:P,contents:t,n:e}}function _t(e,t={}){return ze(t.expandedStates),{type:x,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Cr(e){return ae(Number.NEGATIVE_INFINITY,e)}function gr(e){return ae({type:"root"},e)}function yr(e){return ae(-1,e)}function Ar(e,t){return _t(e[0],{...t,expandedStates:e})}function Ge(e){return {type:S,parts:e}}function Br(e,t="",r={}){return {type:_,breakContents:e,flatContents:t,groupId:r.groupId}}function wr(e,t){return {type:R,contents:e,groupId:t.groupId,negate:t.negate}}function xe(e){return {type:Y,contents:e}}var xr={type:j},de={type:b},_r={type:I},_e={type:B,hard:!0},vt={type:B,hard:!0,literal:!0},Ke={type:B},vr={type:B,soft:!0},q=[_e,de],qe=[vt,de],ve={type:z};function be(e,t){let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}function Je(e,t,r){let n=e;if(t>0){for(let o=0;o<Math.floor(t/r);++o)n=De(n);n=ae(t%r,n),n=ae(Number.NEGATIVE_INFINITY,n);}return n}function br(e,t){return e?{type:N,label:e,contents:t}:t}function ee(e){var t;if(!e)return "";if(Array.isArray(e)){let r=[];for(let n of e)if(Array.isArray(n))r.push(...ee(n));else {let o=ee(n);o!==""&&r.push(o);}return r}return e.type===_?{...e,breakContents:ee(e.breakContents),flatContents:ee(e.flatContents)}:e.type===x?{...e,contents:ee(e.contents),expandedStates:(t=e.expandedStates)==null?void 0:t.map(ee)}:e.type===S?{type:"fill",parts:e.parts.map(ee)}:e.contents?{...e,contents:ee(e.contents)}:e}function Or(e){let t=Object.create(null),r=new Set;return n(ee(e));function n(u,i,s){var a,D;if(typeof u=="string")return JSON.stringify(u);if(Array.isArray(u)){let l=u.map(n).filter(Boolean);return l.length===1?l[0]:`[${l.join(", ")}]`}if(u.type===B){let l=((a=s==null?void 0:s[i+1])==null?void 0:a.type)===b;return u.literal?l?"literalline":"literallineWithoutBreakParent":u.hard?l?"hardline":"hardlineWithoutBreakParent":u.soft?"softline":"line"}if(u.type===b)return ((D=s==null?void 0:s[i-1])==null?void 0:D.type)===B&&s[i-1].hard?void 0:"breakParent";if(u.type===I)return "trim";if(u.type===L)return "indent("+n(u.contents)+")";if(u.type===P)return u.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(u.contents)+")":u.n<0?"dedent("+n(u.contents)+")":u.n.type==="root"?"markAsRoot("+n(u.contents)+")":"align("+JSON.stringify(u.n)+", "+n(u.contents)+")";if(u.type===_)return "ifBreak("+n(u.breakContents)+(u.flatContents?", "+n(u.flatContents):"")+(u.groupId?(u.flatContents?"":', ""')+`, { groupId: ${o(u.groupId)} }`:"")+")";if(u.type===R){let l=[];u.negate&&l.push("negate: true"),u.groupId&&l.push(`groupId: ${o(u.groupId)}`);let d=l.length>0?`, { ${l.join(", ")} }`:"";return `indentIfBreak(${n(u.contents)}${d})`}if(u.type===x){let l=[];u.break&&u.break!=="propagated"&&l.push("shouldBreak: true"),u.id&&l.push(`id: ${o(u.id)}`);let d=l.length>0?`, { ${l.join(", ")} }`:"";return u.expandedStates?`conditionalGroup([${u.expandedStates.map(f=>n(f)).join(",")}]${d})`:`group(${n(u.contents)}${d})`}if(u.type===S)return `fill([${u.parts.map(l=>n(l)).join(", ")}])`;if(u.type===Y)return "lineSuffix("+n(u.contents)+")";if(u.type===j)return "lineSuffixBoundary";if(u.type===N)return `label(${JSON.stringify(u.label)}, ${n(u.contents)})`;throw new Error("Unknown doc type "+u.type)}function o(u){if(typeof u!="symbol")return JSON.stringify(String(u));if(u in t)return t[u];let i=u.description||"symbol";for(let s=0;;s++){let a=i+(s>0?` #${s}`:"");if(!r.has(a))return r.add(a),t[u]=`Symbol.for(${JSON.stringify(a)})`}}}var Yu=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},y=Yu;var Sr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Nr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Tr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var kr=e=>!(Nr(e)||Tr(e));var ju=/[^\x20-\x7F]/u;function Hu(e){if(!e)return 0;if(!ju.test(e))return e.length;e=e.replace(Sr()," ");let t=0;for(let r of e){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(t+=kr(n)?1:2);}return t}var Oe=Hu;function Ne(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=o(u);return r.set(u,i),i}function o(u){switch(G(u)){case W:return t(u.map(n));case S:return t({...u,parts:u.parts.map(n)});case _:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case x:{let{expandedStates:i,contents:s}=u;return i?(i=i.map(n),s=i[0]):s=n(s),t({...u,contents:s,expandedStates:i})}case P:case L:case R:case N:case Y:return t({...u,contents:n(u.contents)});case U:case z:case I:case j:case B:case b:return t(u);default:throw new Q(u)}}}function Xe(e,t,r){let n=r,o=!1;function u(i){if(o)return !1;let s=t(i);s!==void 0&&(o=!0,n=s);}return we(e,u),n}function Wu(e){if(e.type===x&&e.break||e.type===B&&e.hard||e.type===b)return !0}function Ir(e){return Xe(e,Wu,!1)}function Lr(e){if(e.length>0){let t=y(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated");}return null}function Rr(e){let t=new Set,r=[];function n(u){if(u.type===b&&Lr(r),u.type===x){if(r.push(u),t.has(u))return !1;t.add(u);}}function o(u){u.type===x&&r.pop().break&&Lr(r);}we(e,n,o,!0);}function Mu(e){return e.type===B&&!e.hard?e.soft?"":" ":e.type===_?e.flatContents:e}function Yr(e){return Ne(e,Mu)}function Pr(e){for(e=[...e];e.length>=2&&y(!1,e,-2).type===B&&y(!1,e,-1).type===b;)e.length-=2;if(e.length>0){let t=Se(y(!1,e,-1));e[e.length-1]=t;}return e}function Se(e){switch(G(e)){case L:case R:case x:case Y:case N:{let t=Se(e.contents);return {...e,contents:t}}case _:return {...e,breakContents:Se(e.breakContents),flatContents:Se(e.flatContents)};case S:return {...e,parts:Pr(e.parts)};case W:return Pr(e);case U:return e.replace(/[\n\r]*$/u,"");case P:case z:case I:case j:case B:case b:break;default:throw new Q(e)}return e}function Ze(e){return Se(Vu(e))}function $u(e){switch(G(e)){case S:if(e.parts.every(t=>t===""))return "";break;case x:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return "";if(e.contents.type===x&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case P:case L:case R:case Y:if(!e.contents)return "";break;case _:if(!e.flatContents&&!e.breakContents)return "";break;case W:{let t=[];for(let r of e){if(!r)continue;let[n,...o]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof y(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...o);}return t.length===0?"":t.length===1?t[0]:t}case U:case z:case I:case j:case B:case N:case b:break;default:throw new Q(e)}return e}function Vu(e){return Ne(e,t=>$u(t))}function jr(e,t=qe){return Ne(e,r=>typeof r=="string"?be(t,r.split(`
29409
+ `)):r)}function Uu(e){if(e.type===B)return !0}function Hr(e){return Xe(e,Uu,!1)}function Qe(e,t){return e.type===N?{...e,contents:t(e.contents)}:t(e)}var H=Symbol("MODE_BREAK"),J=Symbol("MODE_FLAT"),Te=Symbol("cursor");function Wr(){return {value:"",length:0,queue:[]}}function zu(e,t){return bt(e,{type:"indent"},t)}function Gu(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Wr():t<0?bt(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:bt(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function bt(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],o="",u=0,i=0,s=0;for(let c of n)switch(c.type){case"indent":l(),r.useTabs?a(1):D(r.tabWidth);break;case"stringAlign":l(),o+=c.n,u+=c.n.length;break;case"numberAlign":i+=1,s+=c.n;break;default:throw new Error(`Unexpected type '${c.type}'`)}return f(),{...e,value:o,length:u,queue:n};function a(c){o+=" ".repeat(c),u+=r.tabWidth*c;}function D(c){o+=" ".repeat(c),u+=c;}function l(){r.useTabs?d():f();}function d(){i>0&&a(i),p();}function f(){s>0&&D(s),p();}function p(){i=0,s=0;}}function Ot(e){let t=0,r=0,n=e.length;e:for(;n--;){let o=e[n];if(o===Te){r++;continue}for(let u=o.length-1;u>=0;u--){let i=o[u];if(i===" "||i===" ")t++;else {e[n]=o.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Te);return t}function et(e,t,r,n,o,u){if(r===Number.POSITIVE_INFINITY)return !0;let i=t.length,s=[e],a=[];for(;r>=0;){if(s.length===0){if(i===0)return !0;s.push(t[--i]);continue}let{mode:D,doc:l}=s.pop(),d=G(l);switch(d){case U:a.push(l),r-=Oe(l);break;case W:case S:{let f=d===W?l:l.parts;for(let p=f.length-1;p>=0;p--)s.push({mode:D,doc:f[p]});break}case L:case P:case R:case N:s.push({mode:D,doc:l.contents});break;case I:r+=Ot(a);break;case x:{if(u&&l.break)return !1;let f=l.break?H:D,p=l.expandedStates&&f===H?y(!1,l.expandedStates,-1):l.contents;s.push({mode:f,doc:p});break}case _:{let p=(l.groupId?o[l.groupId]||J:D)===H?l.breakContents:l.flatContents;p&&s.push({mode:D,doc:p});break}case B:if(D===H||l.hard)return !0;l.soft||(a.push(" "),r--);break;case Y:n=!0;break;case j:if(n)return !1;break}}return !1}function Fe(e,t){let r={},n=t.printWidth,o=Be(t.endOfLine),u=0,i=[{ind:Wr(),mode:H,doc:e}],s=[],a=!1,D=[],l=0;for(Rr(e);i.length>0;){let{ind:f,mode:p,doc:c}=i.pop();switch(G(c)){case U:{let F=o!==`
29410
+ `?ne(!1,c,`
29411
+ `,o):c;s.push(F),i.length>0&&(u+=Oe(F));break}case W:for(let F=c.length-1;F>=0;F--)i.push({ind:f,mode:p,doc:c[F]});break;case z:if(l>=2)throw new Error("There are too many 'cursor' in doc.");s.push(Te),l++;break;case L:i.push({ind:zu(f,t),mode:p,doc:c.contents});break;case P:i.push({ind:Gu(f,c.n,t),mode:p,doc:c.contents});break;case I:u-=Ot(s);break;case x:switch(p){case J:if(!a){i.push({ind:f,mode:c.break?H:J,doc:c.contents});break}case H:{a=!1;let F={ind:f,mode:J,doc:c.contents},m=n-u,E=D.length>0;if(!c.break&&et(F,i,m,E,r))i.push(F);else if(c.expandedStates){let A=y(!1,c.expandedStates,-1);if(c.break){i.push({ind:f,mode:H,doc:A});break}else for(let w=1;w<c.expandedStates.length+1;w++)if(w>=c.expandedStates.length){i.push({ind:f,mode:H,doc:A});break}else {let h=c.expandedStates[w],C={ind:f,mode:J,doc:h};if(et(C,i,m,E,r)){i.push(C);break}}}else i.push({ind:f,mode:H,doc:c.contents});break}}c.id&&(r[c.id]=y(!1,i,-1).mode);break;case S:{let F=n-u,{parts:m}=c;if(m.length===0)break;let[E,A]=m,w={ind:f,mode:J,doc:E},h={ind:f,mode:H,doc:E},C=et(w,[],F,D.length>0,r,!0);if(m.length===1){C?i.push(w):i.push(h);break}let k={ind:f,mode:J,doc:A},v={ind:f,mode:H,doc:A};if(m.length===2){C?i.push(k,w):i.push(v,h);break}m.splice(0,2);let $={ind:f,mode:p,doc:Ge(m)},ye=m[0];et({ind:f,mode:J,doc:[E,A,ye]},[],F,D.length>0,r,!0)?i.push($,k,w):C?i.push($,v,w):i.push($,v,h);break}case _:case R:{let F=c.groupId?r[c.groupId]:p;if(F===H){let m=c.type===_?c.breakContents:c.negate?c.contents:De(c.contents);m&&i.push({ind:f,mode:p,doc:m});}if(F===J){let m=c.type===_?c.flatContents:c.negate?De(c.contents):c.contents;m&&i.push({ind:f,mode:p,doc:m});}break}case Y:D.push({ind:f,mode:p,doc:c.contents});break;case j:D.length>0&&i.push({ind:f,mode:p,doc:_e});break;case B:switch(p){case J:if(c.hard)a=!0;else {c.soft||(s.push(" "),u+=1);break}case H:if(D.length>0){i.push({ind:f,mode:p,doc:c},...D.reverse()),D.length=0;break}c.literal?f.root?(s.push(o,f.root.value),u=f.root.length):(s.push(o),u=0):(u-=Ot(s),s.push(o+f.value),u=f.length);break}break;case N:i.push({ind:f,mode:p,doc:c.contents});break;case b:break;default:throw new Q(c)}i.length===0&&D.length>0&&(i.push(...D.reverse()),D.length=0);}let d=s.indexOf(Te);if(d!==-1){let f=s.indexOf(Te,d+1),p=s.slice(0,d).join(""),c=s.slice(d+1,f).join(""),F=s.slice(f+1).join("");return {formatted:p+c+F,cursorNodeStart:p.length,cursorNodeText:c}}return {formatted:s.join("")}}function Ku(e,t,r=0){let n=0;for(let o=r;o<e.length;++o)e[o]===" "?n=n+t-n%t:n++;return n}var me=Ku;var te,Nt,tt,St=class{constructor(t){Dr(this,te);this.stack=[t];}get key(){let{stack:t,siblings:r}=this;return y(!1,t,r===null?-2:-4)??null}get index(){return this.siblings===null?null:y(!1,this.stack,-2)}get node(){return y(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:t}=this,r=y(!1,t,-3);return Array.isArray(r)?r:null}get next(){let{siblings:t}=this;return t===null?null:t[this.index+1]}get previous(){let{siblings:t}=this;return t===null?null:t[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:t,index:r}=this;return t!==null&&r===t.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return [...pe(this,te,tt).call(this)]}getName(){let{stack:t}=this,{length:r}=t;return r>1?y(!1,t,-2):null}getValue(){return y(!1,this.stack,-1)}getNode(t=0){let r=pe(this,te,Nt).call(this,t);return r===-1?null:this.stack[r]}getParentNode(t=0){return this.getNode(t+1)}call(t,...r){let{stack:n}=this,{length:o}=n,u=y(!1,n,-1);for(let i of r)u=u[i],n.push(i,u);try{return t(this)}finally{n.length=o;}}callParent(t,r=0){let n=pe(this,te,Nt).call(this,r+1),o=this.stack.splice(n+1);try{return t(this)}finally{this.stack.push(...o);}}each(t,...r){let{stack:n}=this,{length:o}=n,u=y(!1,n,-1);for(let i of r)u=u[i],n.push(i,u);try{for(let i=0;i<u.length;++i)n.push(i,u[i]),t(this,i,u),n.length-=2;}finally{n.length=o;}}map(t,...r){let n=[];return this.each((o,u,i)=>{n[u]=t(o,u,i);},...r),n}match(...t){let r=this.stack.length-1,n=null,o=this.stack[r--];for(let u of t){if(o===void 0)return !1;let i=null;if(typeof n=="number"&&(i=n,n=this.stack[r--],o=this.stack[r--]),u&&!u(o,n,i))return !1;n=this.stack[r--],o=this.stack[r--];}return !0}findAncestor(t){for(let r of pe(this,te,tt).call(this))if(t(r))return r}hasAncestor(t){for(let r of pe(this,te,tt).call(this))if(t(r))return !0;return !1}};te=new WeakSet,Nt=function(t){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--t<0)return n;return -1},tt=function*(){let{stack:t}=this;for(let r=t.length-3;r>=0;r-=2){let n=t[r];Array.isArray(n)||(yield n);}};var Mr=St;var $r=new Proxy(()=>{},{get:()=>$r}),ke=$r;function qu(e){return e!==null&&typeof e=="object"}var Vr=qu;function*Tt(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,o=u=>Vr(u)&&n(u);for(let u of r(e)){let i=e[u];if(Array.isArray(i))for(let s of i)o(s)&&(yield s);else o(i)&&(yield i);}}function*Ur(e,t){let r=[e];for(let n=0;n<r.length;n++){let o=r[n];for(let u of Tt(o,t))yield u,r.push(u);}}function Ee(e){return (t,r,n)=>{let o=!!(n!=null&&n.backwards);if(r===!1)return !1;let{length:u}=t,i=r;for(;i>=0&&i<u;){let s=t.charAt(i);if(e instanceof RegExp){if(!e.test(s))return i}else if(!e.includes(s))return i;o?i--:i++;}return i===-1||i===u?i:!1}}var zr=Ee(/\s/u),T=Ee(" "),rt=Ee(",; "),nt=Ee(/[^\n\r]/u);function Ju(e,t,r){let n=!!(r!=null&&r.backwards);if(t===!1)return !1;let o=e.charAt(t);if(n){if(e.charAt(t-1)==="\r"&&o===`
30051
29412
  `)return t-2;if(o===`
30052
29413
  `||o==="\r"||o==="\u2028"||o==="\u2029")return t-1}else {if(o==="\r"&&e.charAt(t+1)===`
30053
29414
  `)return t+2;if(o===`
30054
- `||o==="\r"||o==="\u2028"||o==="\u2029")return t+1}return t}var $=zu;function Ku(e,t,r={}){let n=S(e,r.backwards?t-1:t,r),o=$(e,n,r);return n!==o}var U=Ku;function Hu(e){return Array.isArray(e)&&e.length>0}var Tt=Hu;var Wr=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),qu=e=>Object.keys(e).filter(t=>!Wr.has(t));function Ju(e){return e?t=>e(t,Wr):qu}var X=Ju;function Xu(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function St(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Xu(e);}function ne(e,t){t.leading=!0,t.trailing=!1,St(e,t);}function te(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),St(e,t);}function ue(e,t){t.leading=!1,t.trailing=!0,St(e,t);}var vt=new WeakMap;function nt(e,t){if(vt.has(e))return vt.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:o},locStart:u,locEnd:i}=t;if(!n)return [];let s=((r==null?void 0:r(e,t))??[...Nt(e,{getVisitorKeys:X(o)})]).flatMap(D=>n(D)?[D]:nt(D,t));return s.sort((D,a)=>u(D)-u(a)||i(D)-i(a)),vt.set(e,s),s}function Gr(e,t,r,n){let{locStart:o,locEnd:u}=r,i=o(t),s=u(t),D=nt(e,r),a,c,p=0,f=D.length;for(;p<f;){let F=p+f>>1,l=D[F],d=o(l),m=u(l);if(d<=i&&s<=m)return Gr(l,t,r,l);if(m<=i){a=l,p=F+1;continue}if(s<=d){c=l,f=F;continue}throw new Error("Comment location overlaps with node location")}if((n==null?void 0:n.type)==="TemplateLiteral"){let{quasis:F}=n,l=Lt(F,t,r);a&&Lt(F,a,r)!==l&&(a=null),c&&Lt(F,c,r)!==l&&(c=null);}return {enclosingNode:n,precedingNode:a,followingNode:c}}var Pt=()=>!1;function zr(e,t){let{comments:r}=e;if(delete e.comments,!Tt(r)||!t.printer.canAttachComment)return;let n=[],{locStart:o,locEnd:u,printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:D}=t,{ownLine:a=Pt,endOfLine:c=Pt,remaining:p=Pt}=s,f=r.map((F,l)=>({...Gr(e,F,t),comment:F,text:D,options:t,ast:e,isLastComment:r.length-1===l}));for(let[F,l]of f.entries()){let{comment:d,precedingNode:m,enclosingNode:E,followingNode:A,text:_,options:C,ast:h,isLastComment:v}=l;if(C.parser==="json"||C.parser==="json5"||C.parser==="jsonc"||C.parser==="__js_expression"||C.parser==="__ts_expression"||C.parser==="__vue_expression"||C.parser==="__vue_ts_expression"){if(o(d)-o(h)<=0){ne(h,d);continue}if(u(d)-u(h)>=0){ue(h,d);continue}}let k;if(i?k=[l]:(d.enclosingNode=E,d.precedingNode=m,d.followingNode=A,k=[d,_,C,h,v]),Zu(_,C,f,F))d.placement="ownLine",a(...k)||(A?ne(A,d):m?ue(m,d):E?te(E,d):te(h,d));else if(Qu(_,C,f,F))d.placement="endOfLine",c(...k)||(m?ue(m,d):A?ne(A,d):E?te(E,d):te(h,d));else if(d.placement="remaining",!p(...k))if(m&&A){let W=n.length;W>0&&n[W-1].followingNode!==A&&Ur(n,C),n.push(l);}else m?ue(m,d):A?ne(A,d):E?te(E,d):te(h,d);}if(Ur(n,t),!i)for(let F of r)delete F.precedingNode,delete F.enclosingNode,delete F.followingNode;}var Kr=e=>!/[\S\n\u2028\u2029]/.test(e);function Zu(e,t,r,n){let{comment:o,precedingNode:u}=r[n],{locStart:i,locEnd:s}=t,D=i(o);if(u)for(let a=n-1;a>=0;a--){let{comment:c,precedingNode:p}=r[a];if(p!==u||!Kr(e.slice(s(c),D)))break;D=i(c);}return U(e,D,{backwards:!0})}function Qu(e,t,r,n){let{comment:o,followingNode:u}=r[n],{locStart:i,locEnd:s}=t,D=s(o);if(u)for(let a=n+1;a<r.length;a++){let{comment:c,followingNode:p}=r[a];if(p!==u||!Kr(e.slice(D,i(c))))break;D=s(c);}return U(e,D)}function Ur(e,t){var s,D;let r=e.length;if(r===0)return;let{precedingNode:n,followingNode:o}=e[0],u=t.locStart(o),i;for(i=r;i>0;--i){let{comment:a,precedingNode:c,followingNode:p}=e[i-1];Le.strictEqual(c,n),Le.strictEqual(p,o);let f=t.originalText.slice(t.locEnd(a),u);if(((D=(s=t.printer).isGap)==null?void 0:D.call(s,f,t))??/^[\s(]*$/.test(f))u=t.locStart(a);else break}for(let[a,{comment:c}]of e.entries())a<i?ue(n,c):ne(o,c);for(let a of [n,o])a.comments&&a.comments.length>1&&a.comments.sort((c,p)=>t.locStart(c)-t.locStart(p));e.length=0;}function Lt(e,t,r){let n=r.locStart(t)-1;for(let o=1;o<e.length;++o)if(n<r.locStart(e[o]))return o-1;return 0}function eo(e,t){let r=t-1;r=S(e,r,{backwards:!0}),r=$(e,r,{backwards:!0}),r=S(e,r,{backwards:!0});let n=$(e,r,{backwards:!0});return r!==n}var Ie=eo;function Hr(e,t){let r=e.node;return r.printed=!0,t.printer.printComment(e,t)}function to(e,t){var c;let r=e.node,n=[Hr(e,t)],{printer:o,originalText:u,locStart:i,locEnd:s}=t;if((c=o.isBlockComment)==null?void 0:c.call(o,r)){let p=U(u,s(r))?U(u,i(r),{backwards:!0})?q:Ke:" ";n.push(p);}else n.push(q);let a=$(u,S(u,s(r)));return a!==!1&&U(u,a)&&n.push(q),n}function ro(e,t,r){var a;let n=e.node,o=Hr(e,t),{printer:u,originalText:i,locStart:s}=t,D=(a=u.isBlockComment)==null?void 0:a.call(u,n);if(r!=null&&r.hasLineSuffix&&!(r!=null&&r.isBlock)||U(i,s(n),{backwards:!0})){let c=Ie(i,s(n));return {doc:ke([q,c?q:"",o]),isBlock:D,hasLineSuffix:!0}}return !D||r!=null&&r.hasLineSuffix?{doc:[ke([" ",o]),Fe],isBlock:D,hasLineSuffix:!0}:{doc:[" ",o],isBlock:D,hasLineSuffix:!1}}function no(e,t){let r=e.node;if(!r)return {};let n=t[Symbol.for("printedComments")];if((r.comments||[]).filter(D=>!n.has(D)).length===0)return {leading:"",trailing:""};let u=[],i=[],s;return e.each(()=>{let D=e.node;if(n!=null&&n.has(D))return;let{leading:a,trailing:c}=D;a?u.push(to(e,t)):c&&(s=ro(e,t,s),i.push(s.doc));},"comments"),{leading:u,trailing:i}}function qr(e,t,r){let{leading:n,trailing:o}=no(e,r);return !n&&!o?t:Ze(t,u=>[n,u,o])}function Jr(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:r}=e;for(let n of t){if(!n.printed&&!r.has(n))throw new Error('Comment "'+n.value.trim()+'" was not printed. Please report this error!');delete n.printed;}}var Re=class extends Error{name="ConfigError"},Ye=class extends Error{name="UndefinedParserError"};var Zr={cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing
29415
+ `||o==="\r"||o==="\u2028"||o==="\u2029")return t+1}return t}var M=Ju;function Xu(e,t,r={}){let n=T(e,r.backwards?t-1:t,r),o=M(e,n,r);return n!==o}var V=Xu;function Zu(e){return Array.isArray(e)&&e.length>0}var kt=Zu;var Gr=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),Qu=e=>Object.keys(e).filter(t=>!Gr.has(t));function eo(e){return e?t=>e(t,Gr):Qu}var X=eo;function to(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Lt(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=to(e);}function ue(e,t){t.leading=!0,t.trailing=!1,Lt(e,t);}function re(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Lt(e,t);}function oe(e,t){t.leading=!1,t.trailing=!0,Lt(e,t);}var Pt=new WeakMap;function ut(e,t){if(Pt.has(e))return Pt.get(e);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:o},locStart:u,locEnd:i}=t;if(!n)return [];let s=((r==null?void 0:r(e,t))??[...Tt(e,{getVisitorKeys:X(o)})]).flatMap(a=>n(a)?[a]:ut(a,t));return s.sort((a,D)=>u(a)-u(D)||i(a)-i(D)),Pt.set(e,s),s}function qr(e,t,r,n){let{locStart:o,locEnd:u}=r,i=o(t),s=u(t),a=ut(e,r),D,l,d=0,f=a.length;for(;d<f;){let p=d+f>>1,c=a[p],F=o(c),m=u(c);if(F<=i&&s<=m)return qr(c,t,r,c);if(m<=i){D=c,d=p+1;continue}if(s<=F){l=c,f=p;continue}throw new Error("Comment location overlaps with node location")}if((n==null?void 0:n.type)==="TemplateLiteral"){let{quasis:p}=n,c=Rt(p,t,r);D&&Rt(p,D,r)!==c&&(D=null),l&&Rt(p,l,r)!==c&&(l=null);}return {enclosingNode:n,precedingNode:D,followingNode:l}}var It=()=>!1;function Jr(e,t){let{comments:r}=e;if(delete e.comments,!kt(r)||!t.printer.canAttachComment)return;let n=[],{locStart:o,locEnd:u,printer:{experimentalFeatures:{avoidAstMutation:i=!1}={},handleComments:s={}},originalText:a}=t,{ownLine:D=It,endOfLine:l=It,remaining:d=It}=s,f=r.map((p,c)=>({...qr(e,p,t),comment:p,text:a,options:t,ast:e,isLastComment:r.length-1===c}));for(let[p,c]of f.entries()){let{comment:F,precedingNode:m,enclosingNode:E,followingNode:A,text:w,options:h,ast:C,isLastComment:k}=c;if(h.parser==="json"||h.parser==="json5"||h.parser==="jsonc"||h.parser==="__js_expression"||h.parser==="__ts_expression"||h.parser==="__vue_expression"||h.parser==="__vue_ts_expression"){if(o(F)-o(C)<=0){ue(C,F);continue}if(u(F)-u(C)>=0){oe(C,F);continue}}let v;if(i?v=[c]:(F.enclosingNode=E,F.precedingNode=m,F.followingNode=A,v=[F,w,h,C,k]),ro(w,h,f,p))F.placement="ownLine",D(...v)||(A?ue(A,F):m?oe(m,F):E?re(E,F):re(C,F));else if(no(w,h,f,p))F.placement="endOfLine",l(...v)||(m?oe(m,F):A?ue(A,F):E?re(E,F):re(C,F));else if(F.placement="remaining",!d(...v))if(m&&A){let $=n.length;$>0&&n[$-1].followingNode!==A&&Kr(n,h),n.push(c);}else m?oe(m,F):A?ue(A,F):E?re(E,F):re(C,F);}if(Kr(n,t),!i)for(let p of r)delete p.precedingNode,delete p.enclosingNode,delete p.followingNode;}var Xr=e=>!/[\S\n\u2028\u2029]/u.test(e);function ro(e,t,r,n){let{comment:o,precedingNode:u}=r[n],{locStart:i,locEnd:s}=t,a=i(o);if(u)for(let D=n-1;D>=0;D--){let{comment:l,precedingNode:d}=r[D];if(d!==u||!Xr(e.slice(s(l),a)))break;a=i(l);}return V(e,a,{backwards:!0})}function no(e,t,r,n){let{comment:o,followingNode:u}=r[n],{locStart:i,locEnd:s}=t,a=s(o);if(u)for(let D=n+1;D<r.length;D++){let{comment:l,followingNode:d}=r[D];if(d!==u||!Xr(e.slice(a,i(l))))break;a=s(l);}return V(e,a)}function Kr(e,t){var s,a;let r=e.length;if(r===0)return;let{precedingNode:n,followingNode:o}=e[0],u=t.locStart(o),i;for(i=r;i>0;--i){let{comment:D,precedingNode:l,followingNode:d}=e[i-1];ke.strictEqual(l,n),ke.strictEqual(d,o);let f=t.originalText.slice(t.locEnd(D),u);if(((a=(s=t.printer).isGap)==null?void 0:a.call(s,f,t))??/^[\s(]*$/u.test(f))u=t.locStart(D);else break}for(let[D,{comment:l}]of e.entries())D<i?oe(n,l):ue(o,l);for(let D of [n,o])D.comments&&D.comments.length>1&&D.comments.sort((l,d)=>t.locStart(l)-t.locStart(d));e.length=0;}function Rt(e,t,r){let n=r.locStart(t)-1;for(let o=1;o<e.length;++o)if(n<r.locStart(e[o]))return o-1;return 0}function uo(e,t){let r=t-1;r=T(e,r,{backwards:!0}),r=M(e,r,{backwards:!0}),r=T(e,r,{backwards:!0});let n=M(e,r,{backwards:!0});return r!==n}var Le=uo;function Zr(e,t){let r=e.node;return r.printed=!0,t.printer.printComment(e,t)}function oo(e,t){var l;let r=e.node,n=[Zr(e,t)],{printer:o,originalText:u,locStart:i,locEnd:s}=t;if((l=o.isBlockComment)==null?void 0:l.call(o,r)){let d=V(u,s(r))?V(u,i(r),{backwards:!0})?q:Ke:" ";n.push(d);}else n.push(q);let D=M(u,T(u,s(r)));return D!==!1&&V(u,D)&&n.push(q),n}function io(e,t,r){var D;let n=e.node,o=Zr(e,t),{printer:u,originalText:i,locStart:s}=t,a=(D=u.isBlockComment)==null?void 0:D.call(u,n);if(r!=null&&r.hasLineSuffix&&!(r!=null&&r.isBlock)||V(i,s(n),{backwards:!0})){let l=Le(i,s(n));return {doc:xe([q,l?q:"",o]),isBlock:a,hasLineSuffix:!0}}return !a||r!=null&&r.hasLineSuffix?{doc:[xe([" ",o]),de],isBlock:a,hasLineSuffix:!0}:{doc:[" ",o],isBlock:a,hasLineSuffix:!1}}function so(e,t){let r=e.node;if(!r)return {};let n=t[Symbol.for("printedComments")];if((r.comments||[]).filter(a=>!n.has(a)).length===0)return {leading:"",trailing:""};let u=[],i=[],s;return e.each(()=>{let a=e.node;if(n!=null&&n.has(a))return;let{leading:D,trailing:l}=a;D?u.push(oo(e,t)):l&&(s=io(e,t,s),i.push(s.doc));},"comments"),{leading:u,trailing:i}}function Qr(e,t,r){let{leading:n,trailing:o}=so(e,r);return !n&&!o?t:Qe(t,u=>[n,u,o])}function en(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:r}=e;for(let n of t){if(!n.printed&&!r.has(n))throw new Error('Comment "'+n.value.trim()+'" was not printed. Please report this error!');delete n.printed;}}var Pe=class extends Error{name="ConfigError"},Ie=class extends Error{name="UndefinedParserError"};var rn={cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing
30055
29416
  (mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
30056
29417
  The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
30057
29418
  The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment
30058
- in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function ut({plugins:e=[],showDeprecated:t=!1}={}){let r=e.flatMap(o=>o.languages??[]),n=[];for(let o of io(Object.assign({},...e.map(({options:u})=>u),Zr)))!t&&o.deprecated||(Array.isArray(o.choices)&&(t||(o.choices=o.choices.filter(u=>!u.deprecated)),o.name==="parser"&&(o.choices=[...o.choices,...oo(o.choices,r,e)])),o.pluginDefaults=Object.fromEntries(e.filter(u=>{var i;return ((i=u.defaultOptions)==null?void 0:i[o.name])!==void 0}).map(u=>[u.name,u.defaultOptions[o.name]])),n.push(o));return {languages:r,options:n}}function*oo(e,t,r){let n=new Set(e.map(o=>o.value));for(let o of t)if(o.parsers){for(let u of o.parsers)if(!n.has(u)){n.add(u);let i=r.find(D=>D.parsers&&Object.prototype.hasOwnProperty.call(D.parsers,u)),s=o.name;i!=null&&i.name&&(s+=` (plugin: ${i.name})`),yield {value:u,description:s};}}}function io(e){let t=[];for(let[r,n]of Object.entries(e)){let o={name:r,...n};Array.isArray(o.default)&&(o.default=y(!1,o.default,-1).value),t.push(o);}return t}var so=e=>String(e).split(/[/\\]/).pop();function Qr(e,t){if(!t)return;let r=so(t).toLowerCase();return e.find(({filenames:n})=>n==null?void 0:n.some(o=>o.toLowerCase()===r))??e.find(({extensions:n})=>n==null?void 0:n.some(o=>r.endsWith(o)))}function Do(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r==null?void 0:r.includes(t))??e.find(({extensions:r})=>r==null?void 0:r.includes(`.${t}`))}function ao(e,t){let r=e.plugins.flatMap(o=>o.languages??[]),n=Do(r,t.language)??Qr(r,t.physicalFile)??Qr(r,t.file)??(t.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var en=ao;var oe={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return `[${e.map(r=>oe.value(r)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(r=>`${oe.key(r)}: ${oe.value(e[r])}`).join(", ")} }`},pair:({key:e,value:t})=>oe.value({[e]:t})};var It=Ae(ot()),nn=(e,t,{descriptor:r})=>{let n=[`${It.default.yellow(typeof e=="string"?r.key(e):r.pair(e))} is deprecated`];return t&&n.push(`we now treat it as ${It.default.blue(typeof t=="string"?r.key(t):r.pair(t))}`),n.join("; ")+"."};var ae=Ae(ot());var it=Symbol.for("vnopts.VALUE_NOT_EXIST"),Ee=Symbol.for("vnopts.VALUE_UNCHANGED");var un=" ".repeat(2),sn=(e,t,r)=>{let{text:n,list:o}=r.normalizeExpectedResult(r.schemas[e].expected(r)),u=[];return n&&u.push(on(e,t,n,r.descriptor)),o&&u.push([on(e,t,o.title,r.descriptor)].concat(o.values.map(i=>Dn(i,r.loggerPrintWidth))).join(`
30059
- `)),an(u,r.loggerPrintWidth)};function on(e,t,r,n){return [`Invalid ${ae.default.red(n.key(e))} value.`,`Expected ${ae.default.blue(r)},`,`but received ${t===it?ae.default.gray("nothing"):ae.default.red(n.value(t))}.`].join(" ")}function Dn({text:e,list:t},r){let n=[];return e&&n.push(`- ${ae.default.blue(e)}`),t&&n.push([`- ${ae.default.blue(t.title)}:`].concat(t.values.map(o=>Dn(o,r-un.length).replace(/^|\n/g,`$&${un}`))).join(`
30060
- `)),an(n,r)}function an(e,t){if(e.length===1)return e[0];let[r,n]=e,[o,u]=e.map(i=>i.split(`
30061
- `,1)[0].length);return o>t&&o>u?n:r}var jt=Ae(ot());var Rt=[],cn=[];function Yt(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let u=0;for(;u<n&&e.charCodeAt(u)===t.charCodeAt(u);)u++;if(n-=u,o-=u,n===0)return o;let i,s,D,a,c=0,p=0;for(;c<n;)cn[c]=e.charCodeAt(u+c),Rt[c]=++c;for(;p<o;)for(i=t.charCodeAt(u+p),D=p++,s=p,c=0;c<n;c++)a=i===cn[c]?D:D+1,D=Rt[c],s=Rt[c]=D>s?a>s?s+1:a:a>D?D+1:a;return s}var st=(e,t,{descriptor:r,logger:n,schemas:o})=>{let u=[`Ignored unknown option ${jt.default.yellow(r.pair({key:e,value:t}))}.`],i=Object.keys(o).sort().find(s=>Yt(e,s)<3);i&&u.push(`Did you mean ${jt.default.blue(r.key(i))}?`),n.warn(u.join(" "));};var co=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function lo(e,t){let r=new e(t),n=Object.create(r);for(let o of co)o in t&&(n[o]=fo(t[o],r,O.prototype[o].length));return n}var O=class{static create(t){return lo(this,t)}constructor(t){this.name=t.name;}default(t){}expected(t){return "nothing"}validate(t,r){return !1}deprecated(t,r){return !1}forward(t,r){}redirect(t,r){}overlap(t,r,n){return t}preprocess(t,r){return t}postprocess(t,r){return Ee}};function fo(e,t,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t,...n.slice(r-1)):()=>e}var Dt=class extends O{constructor(t){super(t),this._sourceName=t.sourceName;}expected(t){return t.schemas[this._sourceName].expected(t)}validate(t,r){return r.schemas[this._sourceName].validate(t,r)}redirect(t,r){return this._sourceName}};var at$1=class at extends O{expected(){return "anything"}validate(){return !0}};var ct=class extends O{constructor({valueSchema:t,name:r=t.name,...n}){super({...n,name:r}),this._valueSchema=t;}expected(t){let{text:r,list:n}=t.normalizeExpectedResult(this._valueSchema.expected(t));return {text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(t,r){if(!Array.isArray(t))return !1;let n=[];for(let o of t){let u=r.normalizeValidateResult(this._valueSchema.validate(o,r),o);u!==!0&&n.push(u.value);}return n.length===0?!0:{value:n}}deprecated(t,r){let n=[];for(let o of t){let u=r.normalizeDeprecatedResult(this._valueSchema.deprecated(o,r),o);u!==!1&&n.push(...u.map(({value:i})=>({value:[i]})));}return n}forward(t,r){let n=[];for(let o of t){let u=r.normalizeForwardResult(this._valueSchema.forward(o,r),o);n.push(...u.map(ln));}return n}redirect(t,r){let n=[],o=[];for(let u of t){let i=r.normalizeRedirectResult(this._valueSchema.redirect(u,r),u);"remain"in i&&n.push(i.remain),o.push(...i.redirect.map(ln));}return n.length===0?{redirect:o}:{redirect:o,remain:n}}overlap(t,r){return t.concat(r)}};function ln({from:e,to:t}){return {from:[e],to:t}}var lt=class extends O{expected(){return "true or false"}validate(t){return typeof t=="boolean"}};function Fn(e,t){let r=Object.create(null);for(let n of e){let o=n[t];if(r[o])throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);r[o]=n;}return r}function pn(e,t){let r=new Map;for(let n of e){let o=n[t];if(r.has(o))throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);r.set(o,n);}return r}function dn(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return e[r]?!0:(e[r]=!0,!1)}}function mn(e,t){let r=[],n=[];for(let o of e)t(o)?r.push(o):n.push(o);return [r,n]}function En(e){return e===Math.floor(e)}function Cn(e,t){if(e===t)return 0;let r=typeof e,n=typeof t,o=["undefined","object","boolean","number","string"];return r!==n?o.indexOf(r)-o.indexOf(n):r!=="string"?Number(e)-Number(t):e.localeCompare(t)}function hn(e){return (...t)=>{let r=e(...t);return typeof r=="string"?new Error(r):r}}function Mt(e){return e===void 0?{}:e}function Vt(e){if(typeof e=="string")return {text:e};let{text:t,list:r}=e;return Fo((t||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map(Vt)}}:{text:t}}function $t(e,t){return e===!0?!0:e===!1?{value:t}:e}function Wt(e,t,r=!1){return e===!1?!1:e===!0?r?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function fn(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function ft(e,t){return e===void 0?[]:Array.isArray(e)?e.map(r=>fn(r,t)):[fn(e,t)]}function Ut(e,t){let r=ft(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return r.length===0?{remain:t,redirect:r}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}function Fo(e,t){if(!e)throw new Error(t)}var Ft=class extends O{constructor(t){super(t),this._choices=pn(t.choices.map(r=>r&&typeof r=="object"?r:{value:r}),"value");}expected({descriptor:t}){let r=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(Cn).map(t.value),n=r.slice(0,-2),o=r.slice(-2);return {text:n.concat(o.join(" or ")).join(", "),list:{title:"one of the following values",values:r}}}validate(t){return this._choices.has(t)}deprecated(t){let r=this._choices.get(t);return r&&r.deprecated?{value:t}:!1}forward(t){let r=this._choices.get(t);return r?r.forward:void 0}redirect(t){let r=this._choices.get(t);return r?r.redirect:void 0}};var pt=class extends O{expected(){return "a number"}validate(t,r){return typeof t=="number"}};var dt=class extends pt{expected(){return "an integer"}validate(t,r){return r.normalizeValidateResult(super.validate(t,r),t)===!0&&En(t)}};var je=class extends O{expected(){return "a string"}validate(t){return typeof t=="string"}};var gn=oe,yn=st,An=sn,Bn=nn;var mt=class{constructor(t,r){let{logger:n=console,loggerPrintWidth:o=80,descriptor:u=gn,unknown:i=yn,invalid:s=An,deprecated:D=Bn,missing:a=()=>!1,required:c=()=>!1,preprocess:p=F=>F,postprocess:f=()=>Ee}=r||{};this._utils={descriptor:u,logger:n||{warn:()=>{}},loggerPrintWidth:o,schemas:Fn(t,"name"),normalizeDefaultResult:Mt,normalizeExpectedResult:Vt,normalizeDeprecatedResult:Wt,normalizeForwardResult:ft,normalizeRedirectResult:Ut,normalizeValidateResult:$t},this._unknownHandler=i,this._invalidHandler=hn(s),this._deprecatedHandler=D,this._identifyMissing=(F,l)=>!(F in l)||a(F,l),this._identifyRequired=c,this._preprocess=p,this._postprocess=f,this.cleanHistory();}cleanHistory(){this._hasDeprecationWarned=dn();}normalize(t){let r={},o=[this._preprocess(t,this._utils)],u=()=>{for(;o.length!==0;){let i=o.shift(),s=this._applyNormalization(i,r);o.push(...s);}};u();for(let i of Object.keys(this._utils.schemas)){let s=this._utils.schemas[i];if(!(i in r)){let D=Mt(s.default(this._utils));"value"in D&&o.push({[i]:D.value});}}u();for(let i of Object.keys(this._utils.schemas)){if(!(i in r))continue;let s=this._utils.schemas[i],D=r[i],a=s.postprocess(D,this._utils);a!==Ee&&(this._applyValidation(a,i,s),r[i]=a);}return this._applyPostprocess(r),this._applyRequiredCheck(r),r}_applyNormalization(t,r){let n=[],{knownKeys:o,unknownKeys:u}=this._partitionOptionKeys(t);for(let i of o){let s=this._utils.schemas[i],D=s.preprocess(t[i],this._utils);this._applyValidation(D,i,s);let a=({from:F,to:l})=>{n.push(typeof l=="string"?{[l]:F}:{[l.key]:l.value});},c=({value:F,redirectTo:l})=>{let d=Wt(s.deprecated(F,this._utils),D,!0);if(d!==!1)if(d===!0)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,l,this._utils));else for(let{value:m}of d){let E={key:i,value:m};if(!this._hasDeprecationWarned(E)){let A=typeof l=="string"?{key:l,value:m}:l;this._utils.logger.warn(this._deprecatedHandler(E,A,this._utils));}}};ft(s.forward(D,this._utils),D).forEach(a);let f=Ut(s.redirect(D,this._utils),D);if(f.redirect.forEach(a),"remain"in f){let F=f.remain;r[i]=i in r?s.overlap(r[i],F,this._utils):F,c({value:F});}for(let{from:F,to:l}of f.redirect)c({value:F,redirectTo:l});}for(let i of u){let s=t[i];this._applyUnknownHandler(i,s,r,(D,a)=>{n.push({[D]:a});});}return n}_applyRequiredCheck(t){for(let r of Object.keys(this._utils.schemas))if(this._identifyMissing(r,t)&&this._identifyRequired(r))throw this._invalidHandler(r,it,this._utils)}_partitionOptionKeys(t){let[r,n]=mn(Object.keys(t).filter(o=>!this._identifyMissing(o,t)),o=>o in this._utils.schemas);return {knownKeys:r,unknownKeys:n}}_applyValidation(t,r,n){let o=$t(n.validate(t,this._utils),t);if(o!==!0)throw this._invalidHandler(r,o.value,this._utils)}_applyUnknownHandler(t,r,n,o){let u=this._unknownHandler(t,r,this._utils);if(u)for(let i of Object.keys(u)){if(this._identifyMissing(i,u))continue;let s=u[i];i in this._utils.schemas?o(i,s):n[i]=s;}}_applyPostprocess(t){let r=this._postprocess(t,this._utils);if(r!==Ee){if(r.delete)for(let n of r.delete)delete t[n];if(r.override){let{knownKeys:n,unknownKeys:o}=this._partitionOptionKeys(r.override);for(let u of n){let i=r.override[u];this._applyValidation(i,u,this._utils.schemas[u]),t[u]=i;}for(let u of o){let i=r.override[u];this._applyUnknownHandler(u,i,t,(s,D)=>{let a=this._utils.schemas[s];this._applyValidation(D,s,a),t[s]=D;});}}}}};var Gt;function mo(e,t,{logger:r=!1,isCLI:n=!1,passThrough:o=!1,FlagSchema:u,descriptor:i}={}){if(n){if(!u)throw new Error("'FlagSchema' option is required.");if(!i)throw new Error("'descriptor' option is required.")}else i=oe;let s=o?Array.isArray(o)?(f,F)=>o.includes(f)?{[f]:F}:void 0:(f,F)=>({[f]:F}):(f,F,l)=>{let{_:d,...m}=l.schemas;return st(f,F,{...l,schemas:m})},D=Eo(t,{isCLI:n,FlagSchema:u}),a=new mt(D,{logger:r,unknown:s,descriptor:i}),c=r!==!1;c&&Gt&&(a._hasDeprecationWarned=Gt);let p=a.normalize(e);return c&&(Gt=a._hasDeprecationWarned),p}function Eo(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(at$1.create({name:"_"}));for(let o of e)n.push(Co(o,{isCLI:t,optionInfos:e,FlagSchema:r})),o.alias&&t&&n.push(Dt.create({name:o.alias,sourceName:o.name}));return n}function Co(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:o}=e,u={name:o},i,s={};switch(e.type){case"int":i=dt,t&&(u.preprocess=Number);break;case"string":i=je;break;case"choice":i=Ft,u.choices=e.choices.map(D=>D!=null&&D.redirect?{...D,redirect:{to:{key:e.name,value:D.redirect}}}:D);break;case"boolean":i=lt;break;case"flag":i=n,u.flags=r.flatMap(D=>[D.alias,D.description&&D.name,D.oppositeDescription&&`no-${D.name}`].filter(Boolean));break;case"path":i=je;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?u.validate=(D,a,c)=>e.exception(D)||a.validate(D,c):u.validate=(D,a,c)=>D===void 0||a.validate(D,c),e.redirect&&(s.redirect=D=>D?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let D=u.preprocess||(a=>a);u.preprocess=(a,c,p)=>c.preprocess(D(Array.isArray(a)?y(!1,a,-1):a),p);}return e.array?ct.create({...t?{preprocess:D=>Array.isArray(D)?D:[D]}:{},...s,valueSchema:i.create(u)}):i.create({...u,...s})}var _n=mo;var ho=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let o=t[n];if(r(o,n,t))return o}}},zt=ho;function Kt(e,t){if(!t)throw new Error("parserName is required.");let r=zt(!1,e,o=>o.parsers&&Object.prototype.hasOwnProperty.call(o.parsers,t));if(r)return r;let n=`Couldn't resolve parser "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Re(n)}function bn(e,t){if(!t)throw new Error("astFormat is required.");let r=zt(!1,e,o=>o.printers&&Object.prototype.hasOwnProperty.call(o.printers,t));if(r)return r;let n=`Couldn't find plugin for AST format "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Re(n)}function Et({plugins:e,parser:t}){let r=Kt(e,t);return Ht(r,t)}function Ht(e,t){let r=e.parsers[t];return typeof r=="function"?r():r}function xn(e,t){let r=e.printers[t];return typeof r=="function"?r():r}var kn={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function go(e,t={}){var p;let r={...e};if(!r.parser)if(r.filepath){if(r.parser=en(r,{physicalFile:r.filepath}),!r.parser)throw new Ye(`No parser could be inferred for file "${r.filepath}".`)}else throw new Ye("No parser and no file path given, couldn't infer a parser.");let n=ut({plugins:e.plugins,showDeprecated:!0}).options,o={...kn,...Object.fromEntries(n.filter(f=>f.default!==void 0).map(f=>[f.name,f.default]))},u=Kt(r.plugins,r.parser),i=await Ht(u,r.parser);r.astFormat=i.astFormat,r.locEnd=i.locEnd,r.locStart=i.locStart;let s=(p=u.printers)!=null&&p[i.astFormat]?u:bn(r.plugins,i.astFormat),D=await xn(s,i.astFormat);r.printer=D;let a=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,f])=>f!==void 0)):{},c={...o,...a};for(let[f,F]of Object.entries(c))(r[f]===null||r[f]===void 0)&&(r[f]=F);return r.parser==="json"&&(r.trailingComma="none"),_n(r,n,{passThrough:Object.keys(kn),...t})}var ie=go;var Mn=Ae(jn());async function Oo(e,t){let r=await Et(t),n=r.preprocess?r.preprocess(e,t):e;t.originalText=n;let o;try{o=await r.parse(n,t,t);}catch(u){No(u,e);}return {text:n,ast:o}}function No(e,t){let{loc:r}=e;if(r){let n=(0, Mn.codeFrameColumns)(t,r,{highlightCode:!0});throw e.message+=`
30062
- `+n,e.codeFrame=n,e}throw e}var ce=Oo;async function Vn(e,t,r,n,o){let{embeddedLanguageFormatting:u,printer:{embed:i,hasPrettierIgnore:s=()=>!1,getVisitorKeys:D}}=r;if(!i||u!=="auto")return;if(i.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed");let a=X(i.getVisitorKeys??D),c=[];F();let p=e.stack;for(let{print:l,node:d,pathStack:m}of c)try{e.stack=m;let E=await l(f,t,e,r);E&&o.set(d,E);}catch(E){if(globalThis.PRETTIER_DEBUG)throw E}e.stack=p;function f(l,d){return To(l,d,r,n)}function F(){let{node:l}=e;if(l===null||typeof l!="object"||s(e))return;for(let m of a(l))Array.isArray(l[m])?e.each(F,m):e.call(F,m);let d=i(e,r);if(d){if(typeof d=="function"){c.push({print:d,node:l,pathStack:[...e.stack]});return}o.set(l,d);}}}async function To(e,t,r,n){let o=await ie({...r,...t,parentParser:r.parser,originalText:e},{passThrough:!0}),{ast:u}=await ce(e,o),i=await n(u,o);return Xe(i)}function So(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:o,locEnd:u,[Symbol.for("printedComments")]:i}=t,{node:s}=e,D=o(s),a=u(s);for(let c of n)o(c)>=D&&u(c)<=a&&i.add(c);return r.slice(D,a)}var $n=So;async function Me(e,t){({ast:e}=await Xt(e,t));let r=new Map,n=new Yr(e),u=new Map;await Vn(n,s,t,Me,u);let i=await Wn(n,t,s,void 0,u);return Jr(t),i;function s(a,c){return a===void 0||a===n?D(c):Array.isArray(a)?n.call(()=>D(c),...a):n.call(()=>D(c),a)}function D(a){let c=n.node;if(c==null)return "";let p=c&&typeof c=="object"&&a===void 0;if(p&&r.has(c))return r.get(c);let f=Wn(n,t,s,a,u);return p&&r.set(c,f),f}}function Wn(e,t,r,n,o){var D;let{node:u}=e,{printer:i}=t,s;return (D=i.hasPrettierIgnore)!=null&&D.call(i,e)?s=$n(e,t):o.has(u)?s=o.get(u):s=i.print(e,t,r,n),u===t.cursorNode&&(s=Ze(s,a=>[Oe,a,Oe])),i.printComment&&(!i.willPrintOwnComments||!i.willPrintOwnComments(e,t))&&(s=qr(e,s,t)),s}async function Xt(e,t){let r=e.comments??[];t[Symbol.for("comments")]=r,t[Symbol.for("tokens")]=e.tokens??[],t[Symbol.for("printedComments")]=new Set,zr(e,t);let{printer:{preprocess:n}}=t;return e=n?await n(e,t):e,{ast:e,comments:r}}function vo(e,t){let{cursorOffset:r,locStart:n,locEnd:o}=t,u=X(t.printer.getVisitorKeys),i=D=>n(D)<=r&&o(D)>=r,s=e;for(let D of Vr(e,{getVisitorKeys:u,filter:i}))s=D;return s}var Un=vo;function Po(e,t){let{printer:{massageAstNode:r,getVisitorKeys:n}}=t;if(!r)return e;let o=X(n),u=r.ignoredProperties??new Set;return i(e);function i(s,D){if(!(s!==null&&typeof s=="object"))return s;if(Array.isArray(s))return s.map(f=>i(f,D)).filter(Boolean);let a={},c=new Set(o(s));for(let f in s)!Object.prototype.hasOwnProperty.call(s,f)||u.has(f)||(c.has(f)?a[f]=i(s[f],s):a[f]=s[f]);let p=r(s,a,D);if(p!==null)return p??a}}var Gn=Po;var Lo=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function Io(e,t){let r=[e.node,...e.parentNodes],n=new Set([t.node,...t.parentNodes]);return r.find(o=>Hn.has(o.type)&&n.has(o))}function zn(e){let t=e.length-1;for(;;){let r=e[t];if((r==null?void 0:r.type)==="Program"||(r==null?void 0:r.type)==="File")t--;else break}return e.slice(0,t+1)}function Ro(e,t,{locStart:r,locEnd:n}){let o=e.node,u=t.node;if(o===u)return {startNode:o,endNode:u};let i=r(e.node);for(let D of zn(t.parentNodes))if(r(D)>=i)u=D;else break;let s=n(t.node);for(let D of zn(e.parentNodes)){if(n(D)<=s)o=D;else break;if(o===u)break}return {startNode:o,endNode:u}}function Zt(e,t,r,n,o=[],u){let{locStart:i,locEnd:s}=r,D=i(e),a=s(e);if(!(t>a||t<D||u==="rangeEnd"&&t===D||u==="rangeStart"&&t===a)){for(let c of nt(e,r)){let p=Zt(c,t,r,n,[e,...o],u);if(p)return p}if(!n||n(e,o[0]))return {node:e,parentNodes:o}}}function Yo(e,t){return t!=="DeclareExportDeclaration"&&e!=="TypeParameterDeclaration"&&(e==="Directive"||e==="TypeAlias"||e==="TSExportAssignment"||e.startsWith("Declare")||e.startsWith("TSDeclare")||e.endsWith("Statement")||e.endsWith("Declaration"))}var Hn=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),jo=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDefinition","UnionTypeDefinition","ScalarTypeDefinition"]);function Kn(e,t,r){if(!t)return !1;switch(e.parser){case"flow":case"babel":case"babel-flow":case"babel-ts":case"typescript":case"acorn":case"espree":case"meriyah":case"__babel_estree":return Yo(t.type,r==null?void 0:r.type);case"json":case"json5":case"jsonc":case"json-stringify":return Hn.has(t.type);case"graphql":return jo.has(t.kind);case"vue":return t.tag!=="root"}return !1}function qn(e,t,r){let{rangeStart:n,rangeEnd:o,locStart:u,locEnd:i}=t;Le.ok(o>n);let s=e.slice(n,o).search(/\S/),D=s===-1;if(!D)for(n+=s;o>n&&!/\S/.test(e[o-1]);--o);let a=Zt(r,n,t,(F,l)=>Kn(t,F,l),[],"rangeStart"),c=D?a:Zt(r,o,t,F=>Kn(t,F),[],"rangeEnd");if(!a||!c)return {rangeStart:0,rangeEnd:0};let p,f;if(Lo(t)){let F=Io(a,c);p=F,f=F;}else ({startNode:p,endNode:f}=Ro(a,c,t));return {rangeStart:Math.min(u(p),u(f)),rangeEnd:Math.max(i(p),i(f))}}var eu="\uFEFF",Jn=Symbol("cursor");async function tu(e,t,r=0){if(!e||e.trim().length===0)return {formatted:"",cursorOffset:-1,comments:[]};let{ast:n,text:o}=await ce(e,t);t.cursorOffset>=0&&(t.cursorNode=Un(n,t));let u=await Me(n,t);r>0&&(u=qe([q,u],r,t.tabWidth));let i=pe(u,t);if(r>0){let D=i.formatted.trim();i.cursorNodeStart!==void 0&&(i.cursorNodeStart-=i.formatted.indexOf(D)),i.formatted=D+be(t.endOfLine);}let s=t[Symbol.for("comments")];if(t.cursorOffset>=0){let D,a,c,p,f;if(t.cursorNode&&i.cursorNodeText?(D=t.locStart(t.cursorNode),a=o.slice(D,t.locEnd(t.cursorNode)),c=t.cursorOffset-D,p=i.cursorNodeStart,f=i.cursorNodeText):(D=0,a=o,c=t.cursorOffset,p=0,f=i.formatted),a===f)return {formatted:i.formatted,cursorOffset:p+c,comments:s};let F=a.split("");F.splice(c,0,Jn);let l=f.split(""),d=(0, Qn.diffArrays)(F,l),m=p;for(let E of d)if(E.removed){if(E.value.includes(Jn))break}else m+=E.count;return {formatted:i.formatted,cursorOffset:m,comments:s}}return {formatted:i.formatted,cursorOffset:-1,comments:s}}async function Mo(e,t){let{ast:r,text:n}=await ce(e,t),{rangeStart:o,rangeEnd:u}=qn(n,t,r),i=n.slice(o,u),s=Math.min(o,n.lastIndexOf(`
30063
- `,o)+1),D=n.slice(s,o).match(/^\s*/)[0],a=de(D,t.tabWidth),c=await tu(i,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>o&&t.cursorOffset<=u?t.cursorOffset-o:-1,endOfLine:"lf"},a),p=c.formatted.trimEnd(),{cursorOffset:f}=t;f>u?f+=p.length-i.length:c.cursorOffset>=0&&(f=c.cursorOffset+o);let F=n.slice(0,o)+p+n.slice(u);if(t.endOfLine!=="lf"){let l=be(t.endOfLine);f>=0&&l===`\r
30064
- `&&(f+=At(F.slice(0,f),`
30065
- `)),F=re(!1,F,`
30066
- `,l);}return {formatted:F,cursorOffset:f,comments:c.comments}}function Qt(e,t,r){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?r:t}function Xn(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:o}=t;return r=Qt(e,r,-1),n=Qt(e,n,0),o=Qt(e,o,e.length),{...t,cursorOffset:r,rangeStart:n,rangeEnd:o}}function ru(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:o,endOfLine:u}=Xn(e,t),i=e.charAt(0)===eu;if(i&&(e=e.slice(1),r--,n--,o--),u==="auto"&&(u=lr(e)),e.includes("\r")){let s=D=>At(e.slice(0,Math.max(D,0)),`\r
30067
- `);r-=s(r),n-=s(n),o-=s(o),e=fr(e);}return {hasBOM:i,text:e,options:Xn(e,{...t,cursorOffset:r,rangeStart:n,rangeEnd:o,endOfLine:u})}}async function Zn(e,t){let r=await Et(t);return !r.hasPragma||r.hasPragma(e)}async function er(e,t){let{hasBOM:r,text:n,options:o}=ru(e,await ie(t));if(o.rangeStart>=o.rangeEnd&&n!==""||o.requirePragma&&!await Zn(n,o))return {formatted:e,cursorOffset:t.cursorOffset,comments:[]};let u;return o.rangeStart>0||o.rangeEnd<n.length?u=await Mo(n,o):(!o.requirePragma&&o.insertPragma&&o.printer.insertPragma&&!await Zn(n,o)&&(n=o.printer.insertPragma(n)),u=await tu(n,o)),r&&(u.formatted=eu+u.formatted,u.cursorOffset>=0&&u.cursorOffset++),u}async function nu(e,t,r){let{text:n,options:o}=ru(e,await ie(t)),u=await ce(n,o);return r&&(r.preprocessForPrint&&(u.ast=await Xt(u.ast,o)),r.massage&&(u.ast=Gn(u.ast,o))),u}async function uu(e,t){t=await ie(t);let r=await Me(e,t);return pe(r,t)}async function ou(e,t){let r=br(e),{formatted:n}=await er(r,{...t,parser:"__js_expression"});return n}async function iu(e,t){t=await ie(t);let{ast:r}=await ce(e,t);return Me(r,t)}async function su(e,t){return pe(e,await ie(t))}var tr={};We(tr,{builders:()=>$o,printer:()=>Wo,utils:()=>Uo});var $o={join:Ne,line:Ke,softline:Br,hardline:q,literalline:He,group:_t,conditionalGroup:Cr,fill:ze,lineSuffix:ke,lineSuffixBoundary:yr,cursor:Oe,breakParent:Fe,ifBreak:hr,trim:Ar,indent:De,indentIfBreak:gr,align:se,addAlignmentToDoc:qe,markAsRoot:mr,dedentToRoot:dr,dedent:Er,hardlineWithoutBreakParent:we,literallineWithoutBreakParent:bt,label:_r,concat:e=>e},Wo={printDocToString:pe},Uo={willBreak:Sr,traverseDoc:xe,findInDoc:Je,mapDoc:ve,removeLines:Pr,stripTrailingHardline:Xe,replaceEndOfLine:Lr,canBreak:Ir};var Du="3.3.2";var nr={};We(nr,{addDanglingComment:()=>te,addLeadingComment:()=>ne,addTrailingComment:()=>ue,getAlignmentSize:()=>de,getIndentSize:()=>au,getMaxContinuousCount:()=>cu,getNextNonSpaceNonCommentCharacter:()=>lu,getNextNonSpaceNonCommentCharacterIndex:()=>ri,getStringWidth:()=>Te,hasNewline:()=>U,hasNewlineInRange:()=>fu,hasSpaces:()=>Fu,isNextLineEmpty:()=>ii,isNextLineEmptyAfterIndex:()=>ht,isPreviousLineEmpty:()=>ui,makeString:()=>pu,skip:()=>me,skipEverythingButNewLine:()=>rt,skipInlineComment:()=>Ce,skipNewline:()=>$,skipSpaces:()=>S,skipToLineEnd:()=>tt,skipTrailingComment:()=>he,skipWhitespace:()=>$r});function Go(e,t){if(t===!1)return !1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var Ce=Go;function zo(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?rt(e,t):t}var he=zo;function Ko(e,t){let r=null,n=t;for(;n!==r;)r=n,n=S(e,n),n=Ce(e,n),n=he(e,n),n=$(e,n);return n}var Ve=Ko;function Ho(e,t){let r=null,n=t;for(;n!==r;)r=n,n=tt(e,n),n=Ce(e,n),n=S(e,n);return n=he(e,n),n=$(e,n),n!==!1&&U(e,n)}var ht=Ho;function qo(e,t){let r=e.lastIndexOf(`
30068
- `);return r===-1?0:de(e.slice(r+1).match(/^[\t ]*/)[0],t)}var au=qo;function rr(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Jo(e,t){let r=e.match(new RegExp(`(${rr(t)})+`,"g"));return r===null?0:r.reduce((n,o)=>Math.max(n,o.length/t.length),0)}var cu=Jo;function Xo(e,t){let r=Ve(e,t);return r===!1?"":e.charAt(r)}var lu=Xo;function Zo(e,t,r){for(let n=t;n<r;++n)if(e.charAt(n)===`
30069
- `)return !0;return !1}var fu=Zo;function Qo(e,t,r={}){return S(e,r.backwards?t-1:t,r)!==t}var Fu=Qo;function ei(e,t,r){let n=t==='"'?"'":'"',u=re(!1,e,/\\(.)|(["'])/gs,(i,s,D)=>s===n?s:D===t?"\\"+D:D||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(s)?s:"\\"+s));return t+u+t}var pu=ei;function ti(e,t,r){return Ve(e,r(t))}function ri(e,t){return arguments.length===2||typeof t=="number"?Ve(e,t):ti(...arguments)}function ni(e,t,r){return Ie(e,r(t))}function ui(e,t){return arguments.length===2||typeof t=="number"?Ie(e,t):ni(...arguments)}function oi(e,t,r){return ht(e,r(t))}function ii(e,t){return arguments.length===2||typeof t=="number"?ht(e,t):oi(...arguments)}function le(e,t=1){return async(...r)=>{let n=r[t]??{},o=n.plugins??[];return r[t]={...n,plugins:Array.isArray(o)?o:Object.values(o)},e(...r)}}var du=le(er);async function mu(e,t){let{formatted:r}=await du(e,{...t,cursorOffset:-1});return r}async function si(e,t){return await mu(e,t)===e}var Di=le(ut,0),ai={parse:le(nu),formatAST:le(uu),formatDoc:le(ou),printToDoc:le(iu),printDocToString:le(su)};
29419
+ in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function ot({plugins:e=[],showDeprecated:t=!1}={}){let r=e.flatMap(o=>o.languages??[]),n=[];for(let o of lo(Object.assign({},...e.map(({options:u})=>u),rn)))!t&&o.deprecated||(Array.isArray(o.choices)&&(t||(o.choices=o.choices.filter(u=>!u.deprecated)),o.name==="parser"&&(o.choices=[...o.choices,...Do(o.choices,r,e)])),o.pluginDefaults=Object.fromEntries(e.filter(u=>{var i;return ((i=u.defaultOptions)==null?void 0:i[o.name])!==void 0}).map(u=>[u.name,u.defaultOptions[o.name]])),n.push(o));return {languages:r,options:n}}function*Do(e,t,r){let n=new Set(e.map(o=>o.value));for(let o of t)if(o.parsers){for(let u of o.parsers)if(!n.has(u)){n.add(u);let i=r.find(a=>a.parsers&&Object.prototype.hasOwnProperty.call(a.parsers,u)),s=o.name;i!=null&&i.name&&(s+=` (plugin: ${i.name})`),yield {value:u,description:s};}}}function lo(e){let t=[];for(let[r,n]of Object.entries(e)){let o={name:r,...n};Array.isArray(o.default)&&(o.default=y(!1,o.default,-1).value),t.push(o);}return t}var co=e=>String(e).split(/[/\\]/u).pop();function nn(e,t){if(!t)return;let r=co(t).toLowerCase();return e.find(({filenames:n})=>n==null?void 0:n.some(o=>o.toLowerCase()===r))??e.find(({extensions:n})=>n==null?void 0:n.some(o=>r.endsWith(o)))}function fo(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r==null?void 0:r.includes(t))??e.find(({extensions:r})=>r==null?void 0:r.includes(`.${t}`))}function po(e,t){let r=e.plugins.flatMap(o=>o.languages??[]),n=fo(r,t.language)??nn(r,t.physicalFile)??nn(r,t.file)??(t.physicalFile,void 0);return n==null?void 0:n.parsers[0]}var un=po;var ie={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return `[${e.map(r=>ie.value(r)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(r=>`${ie.key(r)}: ${ie.value(e[r])}`).join(", ")} }`},pair:({key:e,value:t})=>ie.value({[e]:t})};var Yt=Me(it()),an=(e,t,{descriptor:r})=>{let n=[`${Yt.default.yellow(typeof e=="string"?r.key(e):r.pair(e))} is deprecated`];return t&&n.push(`we now treat it as ${Yt.default.blue(typeof t=="string"?r.key(t):r.pair(t))}`),n.join("; ")+"."};var le=Me(it());var st=Symbol.for("vnopts.VALUE_NOT_EXIST"),he=Symbol.for("vnopts.VALUE_UNCHANGED");var Dn=" ".repeat(2),cn=(e,t,r)=>{let{text:n,list:o}=r.normalizeExpectedResult(r.schemas[e].expected(r)),u=[];return n&&u.push(ln(e,t,n,r.descriptor)),o&&u.push([ln(e,t,o.title,r.descriptor)].concat(o.values.map(i=>fn(i,r.loggerPrintWidth))).join(`
29420
+ `)),pn(u,r.loggerPrintWidth)};function ln(e,t,r,n){return [`Invalid ${le.default.red(n.key(e))} value.`,`Expected ${le.default.blue(r)},`,`but received ${t===st?le.default.gray("nothing"):le.default.red(n.value(t))}.`].join(" ")}function fn({text:e,list:t},r){let n=[];return e&&n.push(`- ${le.default.blue(e)}`),t&&n.push([`- ${le.default.blue(t.title)}:`].concat(t.values.map(o=>fn(o,r-Dn.length).replace(/^|\n/g,`$&${Dn}`))).join(`
29421
+ `)),pn(n,r)}function pn(e,t){if(e.length===1)return e[0];let[r,n]=e,[o,u]=e.map(i=>i.split(`
29422
+ `,1)[0].length);return o>t&&o>u?n:r}var Wt=Me(it());var jt=[],dn=[];function Ht(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let u=0;for(;u<n&&e.charCodeAt(u)===t.charCodeAt(u);)u++;if(n-=u,o-=u,n===0)return o;let i,s,a,D,l=0,d=0;for(;l<n;)dn[l]=e.charCodeAt(u+l),jt[l]=++l;for(;d<o;)for(i=t.charCodeAt(u+d),a=d++,s=d,l=0;l<n;l++)D=i===dn[l]?a:a+1,a=jt[l],s=jt[l]=a>s?D>s?s+1:D:D>a?a+1:D;return s}var at$1=(e,t,{descriptor:r,logger:n,schemas:o})=>{let u=[`Ignored unknown option ${Wt.default.yellow(r.pair({key:e,value:t}))}.`],i=Object.keys(o).sort().find(s=>Ht(e,s)<3);i&&u.push(`Did you mean ${Wt.default.blue(r.key(i))}?`),n.warn(u.join(" "));};var Fo=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function mo(e,t){let r=new e(t),n=Object.create(r);for(let o of Fo)o in t&&(n[o]=Eo(t[o],r,O.prototype[o].length));return n}var O=class{static create(t){return mo(this,t)}constructor(t){this.name=t.name;}default(t){}expected(t){return "nothing"}validate(t,r){return !1}deprecated(t,r){return !1}forward(t,r){}redirect(t,r){}overlap(t,r,n){return t}preprocess(t,r){return t}postprocess(t,r){return he}};function Eo(e,t,r){return typeof e=="function"?(...n)=>e(...n.slice(0,r-1),t,...n.slice(r-1)):()=>e}var Dt=class extends O{constructor(t){super(t),this._sourceName=t.sourceName;}expected(t){return t.schemas[this._sourceName].expected(t)}validate(t,r){return r.schemas[this._sourceName].validate(t,r)}redirect(t,r){return this._sourceName}};var lt=class extends O{expected(){return "anything"}validate(){return !0}};var ct=class extends O{constructor({valueSchema:t,name:r=t.name,...n}){super({...n,name:r}),this._valueSchema=t;}expected(t){let{text:r,list:n}=t.normalizeExpectedResult(this._valueSchema.expected(t));return {text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(t,r){if(!Array.isArray(t))return !1;let n=[];for(let o of t){let u=r.normalizeValidateResult(this._valueSchema.validate(o,r),o);u!==!0&&n.push(u.value);}return n.length===0?!0:{value:n}}deprecated(t,r){let n=[];for(let o of t){let u=r.normalizeDeprecatedResult(this._valueSchema.deprecated(o,r),o);u!==!1&&n.push(...u.map(({value:i})=>({value:[i]})));}return n}forward(t,r){let n=[];for(let o of t){let u=r.normalizeForwardResult(this._valueSchema.forward(o,r),o);n.push(...u.map(Fn));}return n}redirect(t,r){let n=[],o=[];for(let u of t){let i=r.normalizeRedirectResult(this._valueSchema.redirect(u,r),u);"remain"in i&&n.push(i.remain),o.push(...i.redirect.map(Fn));}return n.length===0?{redirect:o}:{redirect:o,remain:n}}overlap(t,r){return t.concat(r)}};function Fn({from:e,to:t}){return {from:[e],to:t}}var ft=class extends O{expected(){return "true or false"}validate(t){return typeof t=="boolean"}};function En(e,t){let r=Object.create(null);for(let n of e){let o=n[t];if(r[o])throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);r[o]=n;}return r}function hn(e,t){let r=new Map;for(let n of e){let o=n[t];if(r.has(o))throw new Error(`Duplicate ${t} ${JSON.stringify(o)}`);r.set(o,n);}return r}function Cn(){let e=Object.create(null);return t=>{let r=JSON.stringify(t);return e[r]?!0:(e[r]=!0,!1)}}function gn(e,t){let r=[],n=[];for(let o of e)t(o)?r.push(o):n.push(o);return [r,n]}function yn(e){return e===Math.floor(e)}function An(e,t){if(e===t)return 0;let r=typeof e,n=typeof t,o=["undefined","object","boolean","number","string"];return r!==n?o.indexOf(r)-o.indexOf(n):r!=="string"?Number(e)-Number(t):e.localeCompare(t)}function Bn(e){return (...t)=>{let r=e(...t);return typeof r=="string"?new Error(r):r}}function Mt(e){return e===void 0?{}:e}function $t(e){if(typeof e=="string")return {text:e};let{text:t,list:r}=e;return ho((t||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:t,list:{title:r.title,values:r.values.map($t)}}:{text:t}}function Vt(e,t){return e===!0?!0:e===!1?{value:t}:e}function Ut(e,t,r=!1){return e===!1?!1:e===!0?r?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function mn(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function pt(e,t){return e===void 0?[]:Array.isArray(e)?e.map(r=>mn(r,t)):[mn(e,t)]}function zt(e,t){let r=pt(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return r.length===0?{remain:t,redirect:r}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:r}:{redirect:r}}function ho(e,t){if(!e)throw new Error(t)}var dt=class extends O{constructor(t){super(t),this._choices=hn(t.choices.map(r=>r&&typeof r=="object"?r:{value:r}),"value");}expected({descriptor:t}){let r=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(An).map(t.value),n=r.slice(0,-2),o=r.slice(-2);return {text:n.concat(o.join(" or ")).join(", "),list:{title:"one of the following values",values:r}}}validate(t){return this._choices.has(t)}deprecated(t){let r=this._choices.get(t);return r&&r.deprecated?{value:t}:!1}forward(t){let r=this._choices.get(t);return r?r.forward:void 0}redirect(t){let r=this._choices.get(t);return r?r.redirect:void 0}};var Ft=class extends O{expected(){return "a number"}validate(t,r){return typeof t=="number"}};var mt=class extends Ft{expected(){return "an integer"}validate(t,r){return r.normalizeValidateResult(super.validate(t,r),t)===!0&&yn(t)}};var Re=class extends O{expected(){return "a string"}validate(t){return typeof t=="string"}};var wn=ie,xn=at$1,_n=cn,vn=an;var Et=class{constructor(t,r){let{logger:n=console,loggerPrintWidth:o=80,descriptor:u=wn,unknown:i=xn,invalid:s=_n,deprecated:a=vn,missing:D=()=>!1,required:l=()=>!1,preprocess:d=p=>p,postprocess:f=()=>he}=r||{};this._utils={descriptor:u,logger:n||{warn:()=>{}},loggerPrintWidth:o,schemas:En(t,"name"),normalizeDefaultResult:Mt,normalizeExpectedResult:$t,normalizeDeprecatedResult:Ut,normalizeForwardResult:pt,normalizeRedirectResult:zt,normalizeValidateResult:Vt},this._unknownHandler=i,this._invalidHandler=Bn(s),this._deprecatedHandler=a,this._identifyMissing=(p,c)=>!(p in c)||D(p,c),this._identifyRequired=l,this._preprocess=d,this._postprocess=f,this.cleanHistory();}cleanHistory(){this._hasDeprecationWarned=Cn();}normalize(t){let r={},o=[this._preprocess(t,this._utils)],u=()=>{for(;o.length!==0;){let i=o.shift(),s=this._applyNormalization(i,r);o.push(...s);}};u();for(let i of Object.keys(this._utils.schemas)){let s=this._utils.schemas[i];if(!(i in r)){let a=Mt(s.default(this._utils));"value"in a&&o.push({[i]:a.value});}}u();for(let i of Object.keys(this._utils.schemas)){if(!(i in r))continue;let s=this._utils.schemas[i],a=r[i],D=s.postprocess(a,this._utils);D!==he&&(this._applyValidation(D,i,s),r[i]=D);}return this._applyPostprocess(r),this._applyRequiredCheck(r),r}_applyNormalization(t,r){let n=[],{knownKeys:o,unknownKeys:u}=this._partitionOptionKeys(t);for(let i of o){let s=this._utils.schemas[i],a=s.preprocess(t[i],this._utils);this._applyValidation(a,i,s);let D=({from:p,to:c})=>{n.push(typeof c=="string"?{[c]:p}:{[c.key]:c.value});},l=({value:p,redirectTo:c})=>{let F=Ut(s.deprecated(p,this._utils),a,!0);if(F!==!1)if(F===!0)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,c,this._utils));else for(let{value:m}of F){let E={key:i,value:m};if(!this._hasDeprecationWarned(E)){let A=typeof c=="string"?{key:c,value:m}:c;this._utils.logger.warn(this._deprecatedHandler(E,A,this._utils));}}};pt(s.forward(a,this._utils),a).forEach(D);let f=zt(s.redirect(a,this._utils),a);if(f.redirect.forEach(D),"remain"in f){let p=f.remain;r[i]=i in r?s.overlap(r[i],p,this._utils):p,l({value:p});}for(let{from:p,to:c}of f.redirect)l({value:p,redirectTo:c});}for(let i of u){let s=t[i];this._applyUnknownHandler(i,s,r,(a,D)=>{n.push({[a]:D});});}return n}_applyRequiredCheck(t){for(let r of Object.keys(this._utils.schemas))if(this._identifyMissing(r,t)&&this._identifyRequired(r))throw this._invalidHandler(r,st,this._utils)}_partitionOptionKeys(t){let[r,n]=gn(Object.keys(t).filter(o=>!this._identifyMissing(o,t)),o=>o in this._utils.schemas);return {knownKeys:r,unknownKeys:n}}_applyValidation(t,r,n){let o=Vt(n.validate(t,this._utils),t);if(o!==!0)throw this._invalidHandler(r,o.value,this._utils)}_applyUnknownHandler(t,r,n,o){let u=this._unknownHandler(t,r,this._utils);if(u)for(let i of Object.keys(u)){if(this._identifyMissing(i,u))continue;let s=u[i];i in this._utils.schemas?o(i,s):n[i]=s;}}_applyPostprocess(t){let r=this._postprocess(t,this._utils);if(r!==he){if(r.delete)for(let n of r.delete)delete t[n];if(r.override){let{knownKeys:n,unknownKeys:o}=this._partitionOptionKeys(r.override);for(let u of n){let i=r.override[u];this._applyValidation(i,u,this._utils.schemas[u]),t[u]=i;}for(let u of o){let i=r.override[u];this._applyUnknownHandler(u,i,t,(s,a)=>{let D=this._utils.schemas[s];this._applyValidation(a,s,D),t[s]=a;});}}}}};var Gt;function go(e,t,{logger:r=!1,isCLI:n=!1,passThrough:o=!1,FlagSchema:u,descriptor:i}={}){if(n){if(!u)throw new Error("'FlagSchema' option is required.");if(!i)throw new Error("'descriptor' option is required.")}else i=ie;let s=o?Array.isArray(o)?(f,p)=>o.includes(f)?{[f]:p}:void 0:(f,p)=>({[f]:p}):(f,p,c)=>{let{_:F,...m}=c.schemas;return at$1(f,p,{...c,schemas:m})},a=yo(t,{isCLI:n,FlagSchema:u}),D=new Et(a,{logger:r,unknown:s,descriptor:i}),l=r!==!1;l&&Gt&&(D._hasDeprecationWarned=Gt);let d=D.normalize(e);return l&&(Gt=D._hasDeprecationWarned),d}function yo(e,{isCLI:t,FlagSchema:r}){let n=[];t&&n.push(lt.create({name:"_"}));for(let o of e)n.push(Ao(o,{isCLI:t,optionInfos:e,FlagSchema:r})),o.alias&&t&&n.push(Dt.create({name:o.alias,sourceName:o.name}));return n}function Ao(e,{isCLI:t,optionInfos:r,FlagSchema:n}){let{name:o}=e,u={name:o},i,s={};switch(e.type){case"int":i=mt,t&&(u.preprocess=Number);break;case"string":i=Re;break;case"choice":i=dt,u.choices=e.choices.map(a=>a!=null&&a.redirect?{...a,redirect:{to:{key:e.name,value:a.redirect}}}:a);break;case"boolean":i=ft;break;case"flag":i=n,u.flags=r.flatMap(a=>[a.alias,a.description&&a.name,a.oppositeDescription&&`no-${a.name}`].filter(Boolean));break;case"path":i=Re;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?u.validate=(a,D,l)=>e.exception(a)||D.validate(a,l):u.validate=(a,D,l)=>a===void 0||D.validate(a,l),e.redirect&&(s.redirect=a=>a?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let a=u.preprocess||(D=>D);u.preprocess=(D,l,d)=>l.preprocess(a(Array.isArray(D)?y(!1,D,-1):D),d);}return e.array?ct.create({...t?{preprocess:a=>Array.isArray(a)?a:[a]}:{},...s,valueSchema:i.create(u)}):i.create({...u,...s})}var bn=go;var Bo=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let o=t[n];if(r(o,n,t))return o}}},Kt=Bo;function qt(e,t){if(!t)throw new Error("parserName is required.");let r=Kt(!1,e,o=>o.parsers&&Object.prototype.hasOwnProperty.call(o.parsers,t));if(r)return r;let n=`Couldn't resolve parser "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Pe(n)}function On(e,t){if(!t)throw new Error("astFormat is required.");let r=Kt(!1,e,o=>o.printers&&Object.prototype.hasOwnProperty.call(o.printers,t));if(r)return r;let n=`Couldn't find plugin for AST format "${t}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Pe(n)}function ht({plugins:e,parser:t}){let r=qt(e,t);return Jt(r,t)}function Jt(e,t){let r=e.parsers[t];return typeof r=="function"?r():r}function Sn(e,t){let r=e.printers[t];return typeof r=="function"?r():r}var Nn={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function wo(e,t={}){var d;let r={...e};if(!r.parser)if(r.filepath){if(r.parser=un(r,{physicalFile:r.filepath}),!r.parser)throw new Ie(`No parser could be inferred for file "${r.filepath}".`)}else throw new Ie("No parser and no file path given, couldn't infer a parser.");let n=ot({plugins:e.plugins,showDeprecated:!0}).options,o={...Nn,...Object.fromEntries(n.filter(f=>f.default!==void 0).map(f=>[f.name,f.default]))},u=qt(r.plugins,r.parser),i=await Jt(u,r.parser);r.astFormat=i.astFormat,r.locEnd=i.locEnd,r.locStart=i.locStart;let s=(d=u.printers)!=null&&d[i.astFormat]?u:On(r.plugins,i.astFormat),a=await Sn(s,i.astFormat);r.printer=a;let D=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,f])=>f!==void 0)):{},l={...o,...D};for(let[f,p]of Object.entries(l))(r[f]===null||r[f]===void 0)&&(r[f]=p);return r.parser==="json"&&(r.trailingComma="none"),bn(r,n,{passThrough:Object.keys(Nn),...t})}var se=wo;var Vn=Me($n());async function ko(e,t){let r=await ht(t),n=r.preprocess?r.preprocess(e,t):e;t.originalText=n;let o;try{o=await r.parse(n,t,t);}catch(u){Lo(u,e);}return {text:n,ast:o}}function Lo(e,t){let{loc:r}=e;if(r){let n=(0, Vn.codeFrameColumns)(t,r,{highlightCode:!0});throw e.message+=`
29423
+ `+n,e.codeFrame=n,e}throw e}var ce=ko;async function Un(e,t,r,n,o){let{embeddedLanguageFormatting:u,printer:{embed:i,hasPrettierIgnore:s=()=>!1,getVisitorKeys:a}}=r;if(!i||u!=="auto")return;if(i.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed");let D=X(i.getVisitorKeys??a),l=[];p();let d=e.stack;for(let{print:c,node:F,pathStack:m}of l)try{e.stack=m;let E=await c(f,t,e,r);E&&o.set(F,E);}catch(E){if(globalThis.PRETTIER_DEBUG)throw E}e.stack=d;function f(c,F){return Po(c,F,r,n)}function p(){let{node:c}=e;if(c===null||typeof c!="object"||s(e))return;for(let m of D(c))Array.isArray(c[m])?e.each(p,m):e.call(p,m);let F=i(e,r);if(F){if(typeof F=="function"){l.push({print:F,node:c,pathStack:[...e.stack]});return}o.set(c,F);}}}async function Po(e,t,r,n){let o=await se({...r,...t,parentParser:r.parser,originalText:e},{passThrough:!0}),{ast:u}=await ce(e,o),i=await n(u,o);return Ze(i)}function Io(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:o,locEnd:u,[Symbol.for("printedComments")]:i}=t,{node:s}=e,a=o(s),D=u(s);for(let l of n)o(l)>=a&&u(l)<=D&&i.add(l);return r.slice(a,D)}var zn=Io;async function Ye(e,t){({ast:e}=await Qt(e,t));let r=new Map,n=new Mr(e),u=new Map;await Un(n,s,t,Ye,u);let i=await Gn(n,t,s,void 0,u);return en(t),i;function s(D,l){return D===void 0||D===n?a(l):Array.isArray(D)?n.call(()=>a(l),...D):n.call(()=>a(l),D)}function a(D){let l=n.node;if(l==null)return "";let d=l&&typeof l=="object"&&D===void 0;if(d&&r.has(l))return r.get(l);let f=Gn(n,t,s,D,u);return d&&r.set(l,f),f}}function Gn(e,t,r,n,o){var a;let{node:u}=e,{printer:i}=t,s;return (a=i.hasPrettierIgnore)!=null&&a.call(i,e)?s=zn(e,t):o.has(u)?s=o.get(u):s=i.print(e,t,r,n),u===t.cursorNode&&(s=Qe(s,D=>[ve,D,ve])),i.printComment&&(!i.willPrintOwnComments||!i.willPrintOwnComments(e,t))&&(s=Qr(e,s,t)),s}async function Qt(e,t){let r=e.comments??[];t[Symbol.for("comments")]=r,t[Symbol.for("tokens")]=e.tokens??[],t[Symbol.for("printedComments")]=new Set,Jr(e,t);let{printer:{preprocess:n}}=t;return e=n?await n(e,t):e,{ast:e,comments:r}}function Ro(e,t){let{cursorOffset:r,locStart:n,locEnd:o}=t,u=X(t.printer.getVisitorKeys),i=a=>n(a)<=r&&o(a)>=r,s=e;for(let a of Ur(e,{getVisitorKeys:u,filter:i}))s=a;return s}var Kn=Ro;function Yo(e,t){let{printer:{massageAstNode:r,getVisitorKeys:n}}=t;if(!r)return e;let o=X(n),u=r.ignoredProperties??new Set;return i(e);function i(s,a){if(!(s!==null&&typeof s=="object"))return s;if(Array.isArray(s))return s.map(f=>i(f,a)).filter(Boolean);let D={},l=new Set(o(s));for(let f in s)!Object.prototype.hasOwnProperty.call(s,f)||u.has(f)||(l.has(f)?D[f]=i(s[f],s):D[f]=s[f]);let d=r(s,D,a);if(d!==null)return d??D}}var qn=Yo;var jo=(e,t,r)=>{if(!(e&&t==null)){if(t.findLastIndex)return t.findLastIndex(r);for(let n=t.length-1;n>=0;n--){let o=t[n];if(r(o,n,t))return n}return -1}},Jn=jo;var Ho=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function Wo(e,t){let r=[e.node,...e.parentNodes],n=new Set([t.node,...t.parentNodes]);return r.find(o=>Qn.has(o.type)&&n.has(o))}function Xn(e){let t=Jn(!1,e,r=>r.type!=="Program"&&r.type!=="File");return t===-1?e:e.slice(0,t+1)}function Mo(e,t,{locStart:r,locEnd:n}){let o=e.node,u=t.node;if(o===u)return {startNode:o,endNode:u};let i=r(e.node);for(let a of Xn(t.parentNodes))if(r(a)>=i)u=a;else break;let s=n(t.node);for(let a of Xn(e.parentNodes)){if(n(a)<=s)o=a;else break;if(o===u)break}return {startNode:o,endNode:u}}function er(e,t,r,n,o=[],u){let{locStart:i,locEnd:s}=r,a=i(e),D=s(e);if(!(t>D||t<a||u==="rangeEnd"&&t===a||u==="rangeStart"&&t===D)){for(let l of ut(e,r)){let d=er(l,t,r,n,[e,...o],u);if(d)return d}if(!n||n(e,o[0]))return {node:e,parentNodes:o}}}function $o(e,t){return t!=="DeclareExportDeclaration"&&e!=="TypeParameterDeclaration"&&(e==="Directive"||e==="TypeAlias"||e==="TSExportAssignment"||e.startsWith("Declare")||e.startsWith("TSDeclare")||e.endsWith("Statement")||e.endsWith("Declaration"))}var Qn=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),Vo=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDefinition","UnionTypeDefinition","ScalarTypeDefinition"]);function Zn(e,t,r){if(!t)return !1;switch(e.parser){case"flow":case"babel":case"babel-flow":case"babel-ts":case"typescript":case"acorn":case"espree":case"meriyah":case"__babel_estree":return $o(t.type,r==null?void 0:r.type);case"json":case"json5":case"jsonc":case"json-stringify":return Qn.has(t.type);case"graphql":return Vo.has(t.kind);case"vue":return t.tag!=="root"}return !1}function eu(e,t,r){let{rangeStart:n,rangeEnd:o,locStart:u,locEnd:i}=t;ke.ok(o>n);let s=e.slice(n,o).search(/\S/u),a=s===-1;if(!a)for(n+=s;o>n&&!/\S/u.test(e[o-1]);--o);let D=er(r,n,t,(p,c)=>Zn(t,p,c),[],"rangeStart"),l=a?D:er(r,o,t,p=>Zn(t,p),[],"rangeEnd");if(!D||!l)return {rangeStart:0,rangeEnd:0};let d,f;if(Ho(t)){let p=Wo(D,l);d=p,f=p;}else ({startNode:d,endNode:f}=Mo(D,l,t));return {rangeStart:Math.min(u(d),u(f)),rangeEnd:Math.max(i(d),i(f))}}var uu="\uFEFF",tu=Symbol("cursor");async function ou(e,t,r=0){if(!e||e.trim().length===0)return {formatted:"",cursorOffset:-1,comments:[]};let{ast:n,text:o}=await ce(e,t);t.cursorOffset>=0&&(t.cursorNode=Kn(n,t));let u=await Ye(n,t);r>0&&(u=Je([q,u],r,t.tabWidth));let i=Fe(u,t);if(r>0){let a=i.formatted.trim();i.cursorNodeStart!==void 0&&(i.cursorNodeStart-=i.formatted.indexOf(a)),i.formatted=a+Be(t.endOfLine);}let s=t[Symbol.for("comments")];if(t.cursorOffset>=0){let a,D,l,d,f;if(t.cursorNode&&i.cursorNodeText?(a=t.locStart(t.cursorNode),D=o.slice(a,t.locEnd(t.cursorNode)),l=t.cursorOffset-a,d=i.cursorNodeStart,f=i.cursorNodeText):(a=0,D=o,l=t.cursorOffset,d=0,f=i.formatted),D===f)return {formatted:i.formatted,cursorOffset:d+l,comments:s};let p=D.split("");p.splice(l,0,tu);let c=f.split(""),F=dr(p,c),m=d;for(let E of F)if(E.removed){if(E.value.includes(tu))break}else m+=E.count;return {formatted:i.formatted,cursorOffset:m,comments:s}}return {formatted:i.formatted,cursorOffset:-1,comments:s}}async function Uo(e,t){let{ast:r,text:n}=await ce(e,t),{rangeStart:o,rangeEnd:u}=eu(n,t,r),i=n.slice(o,u),s=Math.min(o,n.lastIndexOf(`
29424
+ `,o)+1),a=n.slice(s,o).match(/^\s*/u)[0],D=me(a,t.tabWidth),l=await ou(i,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>o&&t.cursorOffset<=u?t.cursorOffset-o:-1,endOfLine:"lf"},D),d=l.formatted.trimEnd(),{cursorOffset:f}=t;f>u?f+=d.length-i.length:l.cursorOffset>=0&&(f=l.cursorOffset+o);let p=n.slice(0,o)+d+n.slice(u);if(t.endOfLine!=="lf"){let c=Be(t.endOfLine);f>=0&&c===`\r
29425
+ `&&(f+=wt(p.slice(0,f),`
29426
+ `)),p=ne(!1,p,`
29427
+ `,c);}return {formatted:p,cursorOffset:f,comments:l.comments}}function tr(e,t,r){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?r:t}function ru(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:o}=t;return r=tr(e,r,-1),n=tr(e,n,0),o=tr(e,o,e.length),{...t,cursorOffset:r,rangeStart:n,rangeEnd:o}}function iu(e,t){let{cursorOffset:r,rangeStart:n,rangeEnd:o,endOfLine:u}=ru(e,t),i=e.charAt(0)===uu;if(i&&(e=e.slice(1),r--,n--,o--),u==="auto"&&(u=Fr(e)),e.includes("\r")){let s=a=>wt(e.slice(0,Math.max(a,0)),`\r
29428
+ `);r-=s(r),n-=s(n),o-=s(o),e=mr(e);}return {hasBOM:i,text:e,options:ru(e,{...t,cursorOffset:r,rangeStart:n,rangeEnd:o,endOfLine:u})}}async function nu(e,t){let r=await ht(t);return !r.hasPragma||r.hasPragma(e)}async function rr(e,t){let{hasBOM:r,text:n,options:o}=iu(e,await se(t));if(o.rangeStart>=o.rangeEnd&&n!==""||o.requirePragma&&!await nu(n,o))return {formatted:e,cursorOffset:t.cursorOffset,comments:[]};let u;return o.rangeStart>0||o.rangeEnd<n.length?u=await Uo(n,o):(!o.requirePragma&&o.insertPragma&&o.printer.insertPragma&&!await nu(n,o)&&(n=o.printer.insertPragma(n)),u=await ou(n,o)),r&&(u.formatted=uu+u.formatted,u.cursorOffset>=0&&u.cursorOffset++),u}async function su(e,t,r){let{text:n,options:o}=iu(e,await se(t)),u=await ce(n,o);return r&&(r.preprocessForPrint&&(u.ast=await Qt(u.ast,o)),r.massage&&(u.ast=qn(u.ast,o))),u}async function au(e,t){t=await se(t);let r=await Ye(e,t);return Fe(r,t)}async function Du(e,t){let r=Or(e),{formatted:n}=await rr(r,{...t,parser:"__js_expression"});return n}async function lu(e,t){t=await se(t);let{ast:r}=await ce(e,t);return Ye(r,t)}async function cu(e,t){return Fe(e,await se(t))}var nr={};We(nr,{builders:()=>Go,printer:()=>Ko,utils:()=>qo});var Go={join:be,line:Ke,softline:vr,hardline:q,literalline:qe,group:_t,conditionalGroup:Ar,fill:Ge,lineSuffix:xe,lineSuffixBoundary:xr,cursor:ve,breakParent:de,ifBreak:Br,trim:_r,indent:De,indentIfBreak:wr,align:ae,addAlignmentToDoc:Je,markAsRoot:gr,dedentToRoot:Cr,dedent:yr,hardlineWithoutBreakParent:_e,literallineWithoutBreakParent:vt,label:br,concat:e=>e},Ko={printDocToString:Fe},qo={willBreak:Ir,traverseDoc:we,findInDoc:Xe,mapDoc:Ne,removeLines:Yr,stripTrailingHardline:Ze,replaceEndOfLine:jr,canBreak:Hr};var fu="3.3.3";var or={};We(or,{addDanglingComment:()=>re,addLeadingComment:()=>ue,addTrailingComment:()=>oe,getAlignmentSize:()=>me,getIndentSize:()=>pu,getMaxContinuousCount:()=>du,getNextNonSpaceNonCommentCharacter:()=>Fu,getNextNonSpaceNonCommentCharacterIndex:()=>si,getStringWidth:()=>Oe,hasNewline:()=>V,hasNewlineInRange:()=>mu,hasSpaces:()=>Eu,isNextLineEmpty:()=>ci,isNextLineEmptyAfterIndex:()=>gt,isPreviousLineEmpty:()=>Di,makeString:()=>hu,skip:()=>Ee,skipEverythingButNewLine:()=>nt,skipInlineComment:()=>Ce,skipNewline:()=>M,skipSpaces:()=>T,skipToLineEnd:()=>rt,skipTrailingComment:()=>ge,skipWhitespace:()=>zr});function Jo(e,t){if(t===!1)return !1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var Ce=Jo;function Xo(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?nt(e,t):t}var ge=Xo;function Zo(e,t){let r=null,n=t;for(;n!==r;)r=n,n=T(e,n),n=Ce(e,n),n=ge(e,n),n=M(e,n);return n}var je=Zo;function Qo(e,t){let r=null,n=t;for(;n!==r;)r=n,n=rt(e,n),n=Ce(e,n),n=T(e,n);return n=ge(e,n),n=M(e,n),n!==!1&&V(e,n)}var gt=Qo;function ei(e,t){let r=e.lastIndexOf(`
29429
+ `);return r===-1?0:me(e.slice(r+1).match(/^[\t ]*/u)[0],t)}var pu=ei;function ur(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ti(e,t){let r=e.match(new RegExp(`(${ur(t)})+`,"gu"));return r===null?0:r.reduce((n,o)=>Math.max(n,o.length/t.length),0)}var du=ti;function ri(e,t){let r=je(e,t);return r===!1?"":e.charAt(r)}var Fu=ri;function ni(e,t,r){for(let n=t;n<r;++n)if(e.charAt(n)===`
29430
+ `)return !0;return !1}var mu=ni;function ui(e,t,r={}){return T(e,r.backwards?t-1:t,r)!==t}var Eu=ui;function oi(e,t,r){let n=t==='"'?"'":'"',u=ne(!1,e,/\\(.)|(["'])/gsu,(i,s,a)=>s===n?s:a===t?"\\"+a:a||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s)?s:"\\"+s));return t+u+t}var hu=oi;function ii(e,t,r){return je(e,r(t))}function si(e,t){return arguments.length===2||typeof t=="number"?je(e,t):ii(...arguments)}function ai(e,t,r){return Le(e,r(t))}function Di(e,t){return arguments.length===2||typeof t=="number"?Le(e,t):ai(...arguments)}function li(e,t,r){return gt(e,r(t))}function ci(e,t){return arguments.length===2||typeof t=="number"?gt(e,t):li(...arguments)}function fe(e,t=1){return async(...r)=>{let n=r[t]??{},o=n.plugins??[];return r[t]={...n,plugins:Array.isArray(o)?o:Object.values(o)},e(...r)}}var Cu=fe(rr);async function gu(e,t){let{formatted:r}=await Cu(e,{...t,cursorOffset:-1});return r}async function fi(e,t){return await gu(e,t)===e}var pi=fe(ot,0),di={parse:fe(su),formatAST:fe(au),formatDoc:fe(Du),printToDoc:fe(lu),printDocToString:fe(cu)};
30070
29431
 
30071
29432
  var __defProp = Object.defineProperty;
30072
29433
  var __export = (target, all) => {
@@ -30376,7 +29737,7 @@ function isWide(x) {
30376
29737
  var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint));
30377
29738
 
30378
29739
  // src/utils/get-string-width.js
30379
- var notAsciiRegex = /[^\x20-\x7F]/;
29740
+ var notAsciiRegex = /[^\x20-\x7F]/u;
30380
29741
  function getStringWidth(text) {
30381
29742
  if (!text) {
30382
29743
  return 0;
@@ -30608,7 +29969,7 @@ function stripTrailingHardlineFromDoc(doc) {
30608
29969
  case DOC_TYPE_ARRAY:
30609
29970
  return stripTrailingHardlineFromParts(doc);
30610
29971
  case DOC_TYPE_STRING:
30611
- return doc.replace(/[\n\r]*$/, "");
29972
+ return doc.replace(/[\n\r]*$/u, "");
30612
29973
  case DOC_TYPE_ALIGN:
30613
29974
  case DOC_TYPE_CURSOR:
30614
29975
  case DOC_TYPE_TRIM: