@forsakringskassan/docs-generator 2.23.0 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/compile-example.js +2 -2
  2. package/dist/{create-markdown-renderer-BSbHc8U0.js → create-markdown-renderer-CoJjMIzN.js} +3 -3
  3. package/dist/{create-markdown-renderer-BSbHc8U0.js.map → create-markdown-renderer-CoJjMIzN.js.map} +1 -1
  4. package/dist/index.d.ts +5 -0
  5. package/dist/index.js +386 -58
  6. package/dist/index.js.map +1 -1
  7. package/dist/markdown.d.ts +5 -0
  8. package/dist/markdown.js +3 -3
  9. package/dist/runtime.js +57 -16
  10. package/dist/style/core.css +89 -0
  11. package/dist/style/index.css +91 -0
  12. package/dist/style/site.css +2 -0
  13. package/dist/tsdoc-metadata.json +1 -1
  14. package/dist/{vendor-BxO3IPg6.js → vendor-y4sQkzVC.js} +2777 -63
  15. package/dist/vendor-y4sQkzVC.js.map +1 -0
  16. package/dist/{vue3-CZnjnYGV.js → vue3-DXIVBodU.js} +2 -2
  17. package/dist/{vue3-CZnjnYGV.js.map → vue3-DXIVBodU.js.map} +1 -1
  18. package/package.json +3 -1
  19. package/templates/api.class.template.html +1 -0
  20. package/templates/api.composable.template.html +1 -0
  21. package/templates/api.constant.template.html +1 -0
  22. package/templates/api.enum.template.html +1 -0
  23. package/templates/api.function.template.html +1 -0
  24. package/templates/api.interface.template.html +1 -0
  25. package/templates/api.method.template.html +1 -0
  26. package/templates/api.template.html +1 -0
  27. package/templates/api.type.template.html +1 -0
  28. package/templates/base.template.html +2 -2
  29. package/templates/component.template.html +16 -13
  30. package/templates/partials/search-dialog.html +3 -3
  31. package/templates/partials/search-toolbar.html +1 -1
  32. package/dist/vendor-BxO3IPg6.js.map +0 -1
@@ -2,37 +2,37 @@
2
2
 
3
3
  var node_url = require('node:url');
4
4
  var path$1 = require('node:path');
5
- var require$$0 = require('fs');
5
+ var require$$0$1 = require('fs');
6
6
  var fs$2 = require('node:fs');
7
7
  var fs$1 = require('node:fs/promises');
8
8
  var node_events = require('node:events');
9
9
  var Stream = require('node:stream');
10
10
  var node_string_decoder = require('node:string_decoder');
11
- var require$$0$1 = require('@vue/compiler-sfc');
11
+ var require$$0$2 = require('@vue/compiler-sfc');
12
12
  var require$$1 = require('typescript');
13
- var require$$0$2 = require('constants');
14
- var require$$0$3 = require('stream');
13
+ var require$$0$3 = require('constants');
14
+ var require$$0$4 = require('stream');
15
15
  var require$$1$1 = require('util');
16
16
  var require$$5 = require('assert');
17
17
  var sysPath = require('path');
18
18
  var node_module = require('node:module');
19
- var require$$0$4 = require('readline');
19
+ var require$$0$5 = require('readline');
20
20
  var require$$3 = require('events');
21
21
  var process$1 = require('node:process');
22
22
  var util = require('node:util');
23
23
  var node_child_process = require('node:child_process');
24
24
  var promises = require('node:stream/promises');
25
25
  var promises$1 = require('fs/promises');
26
- var require$$0$5 = require('os');
26
+ var require$$0$6 = require('os');
27
27
  var require$$1$5 = require('http');
28
28
  var require$$2$2 = require('https');
29
29
  var require$$2 = require('url');
30
- var require$$0$6 = require('buffer');
30
+ var require$$0$7 = require('buffer');
31
31
  var require$$1$2 = require('crypto');
32
32
  var require$$1$3 = require('net');
33
33
  var require$$2$1 = require('tls');
34
34
  var require$$1$4 = require('tty');
35
- var require$$0$7 = require('querystring');
35
+ var require$$0$8 = require('querystring');
36
36
 
37
37
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
38
38
  function _interopNamespaceDefault(e) {
@@ -1157,7 +1157,7 @@ function decodeHTML(str, mode = DecodingMode.Legacy) {
1157
1157
 
1158
1158
  function _class$1 (obj) { return Object.prototype.toString.call(obj) }
1159
1159
 
1160
- function isString$1 (obj) { return _class$1(obj) === '[object String]' }
1160
+ function isString$2 (obj) { return _class$1(obj) === '[object String]' }
1161
1161
 
1162
1162
  const _hasOwnProperty = Object.prototype.hasOwnProperty;
1163
1163
 
@@ -1445,7 +1445,7 @@ var utils$3 = /*#__PURE__*/Object.freeze({
1445
1445
  isMdAsciiPunct: isMdAsciiPunct,
1446
1446
  isPunctChar: isPunctChar,
1447
1447
  isSpace: isSpace,
1448
- isString: isString$1,
1448
+ isString: isString$2,
1449
1449
  isValidEntityCode: isValidEntityCode,
1450
1450
  isWhiteSpace: isWhiteSpace,
1451
1451
  lib: lib$3,
@@ -5221,7 +5221,7 @@ for (let i = 0; i < 256; i++) { ESCAPED.push(0); }
5221
5221
  '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
5222
5222
  .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
5223
5223
 
5224
- function escape$2 (state, silent) {
5224
+ function escape$3 (state, silent) {
5225
5225
  let pos = state.pos;
5226
5226
  const max = state.posMax;
5227
5227
 
@@ -6220,7 +6220,7 @@ const _rules = [
6220
6220
  ['text', text],
6221
6221
  ['linkify', linkify],
6222
6222
  ['newline', newline],
6223
- ['escape', escape$2],
6223
+ ['escape', escape$3],
6224
6224
  ['backticks', backtick],
6225
6225
  ['strikethrough', r_strikethrough.tokenize],
6226
6226
  ['emphasis', r_emphasis.tokenize],
@@ -6594,7 +6594,7 @@ function assign (obj /* from1, from2, from3, ... */) {
6594
6594
  }
6595
6595
 
6596
6596
  function _class (obj) { return Object.prototype.toString.call(obj) }
6597
- function isString (obj) { return _class(obj) === '[object String]' }
6597
+ function isString$1 (obj) { return _class(obj) === '[object String]' }
6598
6598
  function isObject (obj) { return _class(obj) === '[object Object]' }
6599
6599
  function isRegExp (obj) { return _class(obj) === '[object RegExp]' }
6600
6600
  function isFunction (obj) { return _class(obj) === '[object Function]' }
@@ -6777,7 +6777,7 @@ function compile (self) {
6777
6777
  return
6778
6778
  }
6779
6779
 
6780
- if (isString(val)) {
6780
+ if (isString$1(val)) {
6781
6781
  aliases.push(name);
6782
6782
  return
6783
6783
  }
@@ -8069,7 +8069,7 @@ function MarkdownIt (presetName, options) {
8069
8069
  }
8070
8070
 
8071
8071
  if (!options) {
8072
- if (!isString$1(presetName)) {
8072
+ if (!isString$2(presetName)) {
8073
8073
  options = presetName || {};
8074
8074
  presetName = 'default';
8075
8075
  }
@@ -8227,7 +8227,7 @@ MarkdownIt.prototype.set = function (options) {
8227
8227
  MarkdownIt.prototype.configure = function (presets) {
8228
8228
  const self = this;
8229
8229
 
8230
- if (isString$1(presets)) {
8230
+ if (isString$2(presets)) {
8231
8231
  const presetName = presets;
8232
8232
  presets = config$1[presetName];
8233
8233
  if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name') }
@@ -9474,7 +9474,7 @@ class AST {
9474
9474
  * that exact character. In this mode, `\` is _not_ escaped, because it is
9475
9475
  * not interpreted as a magic character, but instead as a path separator.
9476
9476
  */
9477
- const escape$1 = (s, { windowsPathsNoEscape = false, } = {}) => {
9477
+ const escape$2 = (s, { windowsPathsNoEscape = false, } = {}) => {
9478
9478
  // don't need to escape +@! because we escape the parens
9479
9479
  // that make those magic, and escaping ! as [!] isn't valid,
9480
9480
  // because [!]] is a valid glob class meaning not ']'.
@@ -10472,7 +10472,7 @@ class Minimatch {
10472
10472
  /* c8 ignore stop */
10473
10473
  minimatch.AST = AST;
10474
10474
  minimatch.Minimatch = Minimatch;
10475
- minimatch.escape = escape$1;
10475
+ minimatch.escape = escape$2;
10476
10476
  minimatch.unescape = unescape$1;
10477
10477
 
10478
10478
  /**
@@ -12100,7 +12100,7 @@ const ABORTED = Symbol('aborted');
12100
12100
  const SIGNAL = Symbol('signal');
12101
12101
  const DATALISTENERS = Symbol('dataListeners');
12102
12102
  const DISCARDED = Symbol('discarded');
12103
- const defer = (fn) => Promise.resolve().then(fn);
12103
+ const defer$1 = (fn) => Promise.resolve().then(fn);
12104
12104
  const nodefer = (fn) => fn();
12105
12105
  const isEndish = (ev) => ev === 'end' || ev === 'finish' || ev === 'prefinish';
12106
12106
  const isArrayBufferLike = (b) => b instanceof ArrayBuffer ||
@@ -12336,7 +12336,7 @@ class Minipass extends node_events.EventEmitter {
12336
12336
  }
12337
12337
  if (!encoding)
12338
12338
  encoding = 'utf8';
12339
- const fn = this[ASYNC] ? defer : nodefer;
12339
+ const fn = this[ASYNC] ? defer$1 : nodefer;
12340
12340
  // convert array buffers and typed array views into buffers
12341
12341
  // at some point in the future, we may want to do the opposite!
12342
12342
  // leave strings and buffers as-is
@@ -12598,7 +12598,7 @@ class Minipass extends node_events.EventEmitter {
12598
12598
  ? new Pipe(this, dest, opts)
12599
12599
  : new PipeProxyErrors(this, dest, opts));
12600
12600
  if (this[ASYNC])
12601
- defer(() => this[RESUME]());
12601
+ defer$1(() => this[RESUME]());
12602
12602
  else
12603
12603
  this[RESUME]();
12604
12604
  }
@@ -12668,7 +12668,7 @@ class Minipass extends node_events.EventEmitter {
12668
12668
  else if (ev === 'error' && this[EMITTED_ERROR]) {
12669
12669
  const h = handler;
12670
12670
  if (this[ASYNC])
12671
- defer(() => h.call(this, this[EMITTED_ERROR]));
12671
+ defer$1(() => h.call(this, this[EMITTED_ERROR]));
12672
12672
  else
12673
12673
  h.call(this, this[EMITTED_ERROR]);
12674
12674
  }
@@ -12779,7 +12779,7 @@ class Minipass extends node_events.EventEmitter {
12779
12779
  return !this[OBJECTMODE] && !data
12780
12780
  ? false
12781
12781
  : this[ASYNC]
12782
- ? (defer(() => this[EMITDATA](data)), true)
12782
+ ? (defer$1(() => this[EMITDATA](data)), true)
12783
12783
  : this[EMITDATA](data);
12784
12784
  }
12785
12785
  else if (ev === 'end') {
@@ -12833,7 +12833,7 @@ class Minipass extends node_events.EventEmitter {
12833
12833
  this[EMITTED_END] = true;
12834
12834
  this.readable = false;
12835
12835
  return this[ASYNC]
12836
- ? (defer(() => this[EMITEND2]()), true)
12836
+ ? (defer$1(() => this[EMITEND2]()), true)
12837
12837
  : this[EMITEND2]();
12838
12838
  }
12839
12839
  [EMITEND2]() {
@@ -13049,12 +13049,12 @@ class Minipass extends node_events.EventEmitter {
13049
13049
  }
13050
13050
  }
13051
13051
 
13052
- const realpathSync = require$$0.realpathSync.native;
13052
+ const realpathSync = require$$0$1.realpathSync.native;
13053
13053
  const defaultFS = {
13054
- lstatSync: require$$0.lstatSync,
13055
- readdir: require$$0.readdir,
13056
- readdirSync: require$$0.readdirSync,
13057
- readlinkSync: require$$0.readlinkSync,
13054
+ lstatSync: require$$0$1.lstatSync,
13055
+ readdir: require$$0$1.readdir,
13056
+ readdirSync: require$$0$1.readdirSync,
13057
+ readlinkSync: require$$0$1.readlinkSync,
13058
13058
  realpathSync,
13059
13059
  promises: {
13060
13060
  lstat: fs$1.lstat,
@@ -16322,7 +16322,7 @@ const glob = Object.assign(glob_, {
16322
16322
  iterateSync,
16323
16323
  Glob,
16324
16324
  hasMagic,
16325
- escape: escape$1,
16325
+ escape: escape$2,
16326
16326
  unescape: unescape$1,
16327
16327
  });
16328
16328
  glob.glob = glob;
@@ -16339,7 +16339,7 @@ function requireRegisterTs () {
16339
16339
  if (hasRequiredRegisterTs) return registerTs;
16340
16340
  hasRequiredRegisterTs = 1;
16341
16341
  if (typeof commonjsRequire !== 'undefined') {
16342
- require$$0$1.registerTS(() => require$$1);
16342
+ require$$0$2.registerTS(() => require$$1);
16343
16343
  }
16344
16344
  return registerTs;
16345
16345
  }
@@ -20774,6 +20774,487 @@ const closest = (str, arr) => {
20774
20774
  return arr[min_index];
20775
20775
  };
20776
20776
 
20777
+ var ciInfo = {};
20778
+
20779
+ var require$$0 = [
20780
+ {
20781
+ name: "Agola CI",
20782
+ constant: "AGOLA",
20783
+ env: "AGOLA_GIT_REF",
20784
+ pr: "AGOLA_PULL_REQUEST_ID"
20785
+ },
20786
+ {
20787
+ name: "Appcircle",
20788
+ constant: "APPCIRCLE",
20789
+ env: "AC_APPCIRCLE",
20790
+ pr: {
20791
+ env: "AC_GIT_PR",
20792
+ ne: "false"
20793
+ }
20794
+ },
20795
+ {
20796
+ name: "AppVeyor",
20797
+ constant: "APPVEYOR",
20798
+ env: "APPVEYOR",
20799
+ pr: "APPVEYOR_PULL_REQUEST_NUMBER"
20800
+ },
20801
+ {
20802
+ name: "AWS CodeBuild",
20803
+ constant: "CODEBUILD",
20804
+ env: "CODEBUILD_BUILD_ARN",
20805
+ pr: {
20806
+ env: "CODEBUILD_WEBHOOK_EVENT",
20807
+ any: [
20808
+ "PULL_REQUEST_CREATED",
20809
+ "PULL_REQUEST_UPDATED",
20810
+ "PULL_REQUEST_REOPENED"
20811
+ ]
20812
+ }
20813
+ },
20814
+ {
20815
+ name: "Azure Pipelines",
20816
+ constant: "AZURE_PIPELINES",
20817
+ env: "TF_BUILD",
20818
+ pr: {
20819
+ BUILD_REASON: "PullRequest"
20820
+ }
20821
+ },
20822
+ {
20823
+ name: "Bamboo",
20824
+ constant: "BAMBOO",
20825
+ env: "bamboo_planKey"
20826
+ },
20827
+ {
20828
+ name: "Bitbucket Pipelines",
20829
+ constant: "BITBUCKET",
20830
+ env: "BITBUCKET_COMMIT",
20831
+ pr: "BITBUCKET_PR_ID"
20832
+ },
20833
+ {
20834
+ name: "Bitrise",
20835
+ constant: "BITRISE",
20836
+ env: "BITRISE_IO",
20837
+ pr: "BITRISE_PULL_REQUEST"
20838
+ },
20839
+ {
20840
+ name: "Buddy",
20841
+ constant: "BUDDY",
20842
+ env: "BUDDY_WORKSPACE_ID",
20843
+ pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
20844
+ },
20845
+ {
20846
+ name: "Buildkite",
20847
+ constant: "BUILDKITE",
20848
+ env: "BUILDKITE",
20849
+ pr: {
20850
+ env: "BUILDKITE_PULL_REQUEST",
20851
+ ne: "false"
20852
+ }
20853
+ },
20854
+ {
20855
+ name: "CircleCI",
20856
+ constant: "CIRCLE",
20857
+ env: "CIRCLECI",
20858
+ pr: "CIRCLE_PULL_REQUEST"
20859
+ },
20860
+ {
20861
+ name: "Cirrus CI",
20862
+ constant: "CIRRUS",
20863
+ env: "CIRRUS_CI",
20864
+ pr: "CIRRUS_PR"
20865
+ },
20866
+ {
20867
+ name: "Cloudflare Pages",
20868
+ constant: "CLOUDFLARE_PAGES",
20869
+ env: "CF_PAGES"
20870
+ },
20871
+ {
20872
+ name: "Codefresh",
20873
+ constant: "CODEFRESH",
20874
+ env: "CF_BUILD_ID",
20875
+ pr: {
20876
+ any: [
20877
+ "CF_PULL_REQUEST_NUMBER",
20878
+ "CF_PULL_REQUEST_ID"
20879
+ ]
20880
+ }
20881
+ },
20882
+ {
20883
+ name: "Codemagic",
20884
+ constant: "CODEMAGIC",
20885
+ env: "CM_BUILD_ID",
20886
+ pr: "CM_PULL_REQUEST"
20887
+ },
20888
+ {
20889
+ name: "Codeship",
20890
+ constant: "CODESHIP",
20891
+ env: {
20892
+ CI_NAME: "codeship"
20893
+ }
20894
+ },
20895
+ {
20896
+ name: "Drone",
20897
+ constant: "DRONE",
20898
+ env: "DRONE",
20899
+ pr: {
20900
+ DRONE_BUILD_EVENT: "pull_request"
20901
+ }
20902
+ },
20903
+ {
20904
+ name: "dsari",
20905
+ constant: "DSARI",
20906
+ env: "DSARI"
20907
+ },
20908
+ {
20909
+ name: "Earthly",
20910
+ constant: "EARTHLY",
20911
+ env: "EARTHLY_CI"
20912
+ },
20913
+ {
20914
+ name: "Expo Application Services",
20915
+ constant: "EAS",
20916
+ env: "EAS_BUILD"
20917
+ },
20918
+ {
20919
+ name: "Gerrit",
20920
+ constant: "GERRIT",
20921
+ env: "GERRIT_PROJECT"
20922
+ },
20923
+ {
20924
+ name: "Gitea Actions",
20925
+ constant: "GITEA_ACTIONS",
20926
+ env: "GITEA_ACTIONS"
20927
+ },
20928
+ {
20929
+ name: "GitHub Actions",
20930
+ constant: "GITHUB_ACTIONS",
20931
+ env: "GITHUB_ACTIONS",
20932
+ pr: {
20933
+ GITHUB_EVENT_NAME: "pull_request"
20934
+ }
20935
+ },
20936
+ {
20937
+ name: "GitLab CI",
20938
+ constant: "GITLAB",
20939
+ env: "GITLAB_CI",
20940
+ pr: "CI_MERGE_REQUEST_ID"
20941
+ },
20942
+ {
20943
+ name: "GoCD",
20944
+ constant: "GOCD",
20945
+ env: "GO_PIPELINE_LABEL"
20946
+ },
20947
+ {
20948
+ name: "Google Cloud Build",
20949
+ constant: "GOOGLE_CLOUD_BUILD",
20950
+ env: "BUILDER_OUTPUT"
20951
+ },
20952
+ {
20953
+ name: "Harness CI",
20954
+ constant: "HARNESS",
20955
+ env: "HARNESS_BUILD_ID"
20956
+ },
20957
+ {
20958
+ name: "Heroku",
20959
+ constant: "HEROKU",
20960
+ env: {
20961
+ env: "NODE",
20962
+ includes: "/app/.heroku/node/bin/node"
20963
+ }
20964
+ },
20965
+ {
20966
+ name: "Hudson",
20967
+ constant: "HUDSON",
20968
+ env: "HUDSON_URL"
20969
+ },
20970
+ {
20971
+ name: "Jenkins",
20972
+ constant: "JENKINS",
20973
+ env: [
20974
+ "JENKINS_URL",
20975
+ "BUILD_ID"
20976
+ ],
20977
+ pr: {
20978
+ any: [
20979
+ "ghprbPullId",
20980
+ "CHANGE_ID"
20981
+ ]
20982
+ }
20983
+ },
20984
+ {
20985
+ name: "LayerCI",
20986
+ constant: "LAYERCI",
20987
+ env: "LAYERCI",
20988
+ pr: "LAYERCI_PULL_REQUEST"
20989
+ },
20990
+ {
20991
+ name: "Magnum CI",
20992
+ constant: "MAGNUM",
20993
+ env: "MAGNUM"
20994
+ },
20995
+ {
20996
+ name: "Netlify CI",
20997
+ constant: "NETLIFY",
20998
+ env: "NETLIFY",
20999
+ pr: {
21000
+ env: "PULL_REQUEST",
21001
+ ne: "false"
21002
+ }
21003
+ },
21004
+ {
21005
+ name: "Nevercode",
21006
+ constant: "NEVERCODE",
21007
+ env: "NEVERCODE",
21008
+ pr: {
21009
+ env: "NEVERCODE_PULL_REQUEST",
21010
+ ne: "false"
21011
+ }
21012
+ },
21013
+ {
21014
+ name: "Prow",
21015
+ constant: "PROW",
21016
+ env: "PROW_JOB_ID"
21017
+ },
21018
+ {
21019
+ name: "ReleaseHub",
21020
+ constant: "RELEASEHUB",
21021
+ env: "RELEASE_BUILD_ID"
21022
+ },
21023
+ {
21024
+ name: "Render",
21025
+ constant: "RENDER",
21026
+ env: "RENDER",
21027
+ pr: {
21028
+ IS_PULL_REQUEST: "true"
21029
+ }
21030
+ },
21031
+ {
21032
+ name: "Sail CI",
21033
+ constant: "SAIL",
21034
+ env: "SAILCI",
21035
+ pr: "SAIL_PULL_REQUEST_NUMBER"
21036
+ },
21037
+ {
21038
+ name: "Screwdriver",
21039
+ constant: "SCREWDRIVER",
21040
+ env: "SCREWDRIVER",
21041
+ pr: {
21042
+ env: "SD_PULL_REQUEST",
21043
+ ne: "false"
21044
+ }
21045
+ },
21046
+ {
21047
+ name: "Semaphore",
21048
+ constant: "SEMAPHORE",
21049
+ env: "SEMAPHORE",
21050
+ pr: "PULL_REQUEST_NUMBER"
21051
+ },
21052
+ {
21053
+ name: "Sourcehut",
21054
+ constant: "SOURCEHUT",
21055
+ env: {
21056
+ CI_NAME: "sourcehut"
21057
+ }
21058
+ },
21059
+ {
21060
+ name: "Strider CD",
21061
+ constant: "STRIDER",
21062
+ env: "STRIDER"
21063
+ },
21064
+ {
21065
+ name: "TaskCluster",
21066
+ constant: "TASKCLUSTER",
21067
+ env: [
21068
+ "TASK_ID",
21069
+ "RUN_ID"
21070
+ ]
21071
+ },
21072
+ {
21073
+ name: "TeamCity",
21074
+ constant: "TEAMCITY",
21075
+ env: "TEAMCITY_VERSION"
21076
+ },
21077
+ {
21078
+ name: "Travis CI",
21079
+ constant: "TRAVIS",
21080
+ env: "TRAVIS",
21081
+ pr: {
21082
+ env: "TRAVIS_PULL_REQUEST",
21083
+ ne: "false"
21084
+ }
21085
+ },
21086
+ {
21087
+ name: "Vela",
21088
+ constant: "VELA",
21089
+ env: "VELA",
21090
+ pr: {
21091
+ VELA_PULL_REQUEST: "1"
21092
+ }
21093
+ },
21094
+ {
21095
+ name: "Vercel",
21096
+ constant: "VERCEL",
21097
+ env: {
21098
+ any: [
21099
+ "NOW_BUILDER",
21100
+ "VERCEL"
21101
+ ]
21102
+ },
21103
+ pr: "VERCEL_GIT_PULL_REQUEST_ID"
21104
+ },
21105
+ {
21106
+ name: "Visual Studio App Center",
21107
+ constant: "APPCENTER",
21108
+ env: "APPCENTER_BUILD_ID"
21109
+ },
21110
+ {
21111
+ name: "Woodpecker",
21112
+ constant: "WOODPECKER",
21113
+ env: {
21114
+ CI: "woodpecker"
21115
+ },
21116
+ pr: {
21117
+ CI_BUILD_EVENT: "pull_request"
21118
+ }
21119
+ },
21120
+ {
21121
+ name: "Xcode Cloud",
21122
+ constant: "XCODE_CLOUD",
21123
+ env: "CI_XCODE_PROJECT",
21124
+ pr: "CI_PULL_REQUEST_NUMBER"
21125
+ },
21126
+ {
21127
+ name: "Xcode Server",
21128
+ constant: "XCODE_SERVER",
21129
+ env: "XCS"
21130
+ }
21131
+ ];
21132
+
21133
+ var hasRequiredCiInfo;
21134
+
21135
+ function requireCiInfo () {
21136
+ if (hasRequiredCiInfo) return ciInfo;
21137
+ hasRequiredCiInfo = 1;
21138
+ (function (exports) {
21139
+
21140
+ const vendors = require$$0;
21141
+
21142
+ const env = process.env;
21143
+
21144
+ // Used for testing only
21145
+ Object.defineProperty(exports, '_vendors', {
21146
+ value: vendors.map(function (v) {
21147
+ return v.constant
21148
+ })
21149
+ });
21150
+
21151
+ exports.name = null;
21152
+ exports.isPR = null;
21153
+ exports.id = null;
21154
+
21155
+ vendors.forEach(function (vendor) {
21156
+ const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
21157
+ const isCI = envs.every(function (obj) {
21158
+ return checkEnv(obj)
21159
+ });
21160
+
21161
+ exports[vendor.constant] = isCI;
21162
+
21163
+ if (!isCI) {
21164
+ return
21165
+ }
21166
+
21167
+ exports.name = vendor.name;
21168
+ exports.isPR = checkPR(vendor);
21169
+ exports.id = vendor.constant;
21170
+ });
21171
+
21172
+ exports.isCI = !!(
21173
+ env.CI !== 'false' && // Bypass all checks if CI env is explicitly set to 'false'
21174
+ (env.BUILD_ID || // Jenkins, Cloudbees
21175
+ env.BUILD_NUMBER || // Jenkins, TeamCity
21176
+ env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages
21177
+ env.CI_APP_ID || // Appflow
21178
+ env.CI_BUILD_ID || // Appflow
21179
+ env.CI_BUILD_NUMBER || // Appflow
21180
+ env.CI_NAME || // Codeship and others
21181
+ env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
21182
+ env.RUN_ID || // TaskCluster, dsari
21183
+ exports.name ||
21184
+ false)
21185
+ );
21186
+
21187
+ function checkEnv (obj) {
21188
+ // "env": "CIRRUS"
21189
+ if (typeof obj === 'string') return !!env[obj]
21190
+
21191
+ // "env": { "env": "NODE", "includes": "/app/.heroku/node/bin/node" }
21192
+ if ('env' in obj) {
21193
+ // Currently there are no other types, uncomment when there are
21194
+ // if ('includes' in obj) {
21195
+ return env[obj.env] && env[obj.env].includes(obj.includes)
21196
+ // }
21197
+ }
21198
+
21199
+ if ('any' in obj) {
21200
+ return obj.any.some(function (k) {
21201
+ return !!env[k]
21202
+ })
21203
+ }
21204
+
21205
+ return Object.keys(obj).every(function (k) {
21206
+ return env[k] === obj[k]
21207
+ })
21208
+ }
21209
+
21210
+ function checkPR (vendor) {
21211
+ switch (typeof vendor.pr) {
21212
+ case 'string':
21213
+ // "pr": "CIRRUS_PR"
21214
+ return !!env[vendor.pr]
21215
+ case 'object':
21216
+ if ('env' in vendor.pr) {
21217
+ if ('any' in vendor.pr) {
21218
+ // "pr": { "env": "CODEBUILD_WEBHOOK_EVENT", "any": ["PULL_REQUEST_CREATED", "PULL_REQUEST_UPDATED"] }
21219
+ return vendor.pr.any.some(function (key) {
21220
+ return env[vendor.pr.env] === key
21221
+ })
21222
+ } else {
21223
+ // "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" }
21224
+ return vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne
21225
+ }
21226
+ } else if ('any' in vendor.pr) {
21227
+ // "pr": { "any": ["ghprbPullId", "CHANGE_ID"] }
21228
+ return vendor.pr.any.some(function (key) {
21229
+ return !!env[key]
21230
+ })
21231
+ } else {
21232
+ // "pr": { "DRONE_BUILD_EVENT": "pull_request" }
21233
+ return checkEnv(vendor.pr)
21234
+ }
21235
+ default:
21236
+ // PR detection not supported for this vendor
21237
+ return null
21238
+ }
21239
+ }
21240
+ } (ciInfo));
21241
+ return ciInfo;
21242
+ }
21243
+
21244
+ var isCi;
21245
+ var hasRequiredIsCi;
21246
+
21247
+ function requireIsCi () {
21248
+ if (hasRequiredIsCi) return isCi;
21249
+ hasRequiredIsCi = 1;
21250
+
21251
+ isCi = requireCiInfo().isCI;
21252
+ return isCi;
21253
+ }
21254
+
21255
+ var isCiExports = requireIsCi();
21256
+ var isCI = /*@__PURE__*/getDefaultExportFromCjs(isCiExports);
21257
+
20777
21258
  var fs = {};
20778
21259
 
20779
21260
  var universalify = {};
@@ -20815,7 +21296,7 @@ var hasRequiredPolyfills;
20815
21296
  function requirePolyfills () {
20816
21297
  if (hasRequiredPolyfills) return polyfills;
20817
21298
  hasRequiredPolyfills = 1;
20818
- var constants = require$$0$2;
21299
+ var constants = require$$0$3;
20819
21300
 
20820
21301
  var origCwd = process.cwd;
20821
21302
  var cwd = null;
@@ -21179,7 +21660,7 @@ var hasRequiredLegacyStreams;
21179
21660
  function requireLegacyStreams () {
21180
21661
  if (hasRequiredLegacyStreams) return legacyStreams;
21181
21662
  hasRequiredLegacyStreams = 1;
21182
- var Stream = require$$0$3.Stream;
21663
+ var Stream = require$$0$4.Stream;
21183
21664
 
21184
21665
  legacyStreams = legacy;
21185
21666
 
@@ -21337,7 +21818,7 @@ var hasRequiredGracefulFs;
21337
21818
  function requireGracefulFs () {
21338
21819
  if (hasRequiredGracefulFs) return gracefulFs;
21339
21820
  hasRequiredGracefulFs = 1;
21340
- var fs = require$$0;
21821
+ var fs = require$$0$1;
21341
21822
  var polyfills = requirePolyfills();
21342
21823
  var legacy = requireLegacyStreams();
21343
21824
  var clone = requireClone();
@@ -22625,19 +23106,19 @@ function requireCopySync () {
22625
23106
  return copySync_1;
22626
23107
  }
22627
23108
 
22628
- var copy;
23109
+ var copy$1;
22629
23110
  var hasRequiredCopy;
22630
23111
 
22631
23112
  function requireCopy () {
22632
- if (hasRequiredCopy) return copy;
23113
+ if (hasRequiredCopy) return copy$1;
22633
23114
  hasRequiredCopy = 1;
22634
23115
 
22635
23116
  const u = requireUniversalify().fromPromise;
22636
- copy = {
23117
+ copy$1 = {
22637
23118
  copy: u(requireCopy$1()),
22638
23119
  copySync: requireCopySync()
22639
23120
  };
22640
- return copy;
23121
+ return copy$1;
22641
23122
  }
22642
23123
 
22643
23124
  var remove_1;
@@ -23148,7 +23629,7 @@ function requireJsonfile$1 () {
23148
23629
  try {
23149
23630
  _fs = requireGracefulFs();
23150
23631
  } catch (_) {
23151
- _fs = require$$0;
23632
+ _fs = require$$0$1;
23152
23633
  }
23153
23634
  const universalify = requireUniversalify();
23154
23635
  const { stringify, stripBom } = requireUtils$1();
@@ -23529,6 +24010,2237 @@ function requireLib$2 () {
23529
24010
  var libExports$1 = /*@__PURE__*/ requireLib$2();
23530
24011
  var fse = /*@__PURE__*/getDefaultExportFromCjs(libExports$1);
23531
24012
 
24013
+ const isString = obj => typeof obj === 'string';
24014
+ const defer = () => {
24015
+ let res;
24016
+ let rej;
24017
+ const promise = new Promise((resolve, reject) => {
24018
+ res = resolve;
24019
+ rej = reject;
24020
+ });
24021
+ promise.resolve = res;
24022
+ promise.reject = rej;
24023
+ return promise;
24024
+ };
24025
+ const makeString = object => {
24026
+ if (object == null) return '';
24027
+ return '' + object;
24028
+ };
24029
+ const copy = (a, s, t) => {
24030
+ a.forEach(m => {
24031
+ if (s[m]) t[m] = s[m];
24032
+ });
24033
+ };
24034
+ const lastOfPathSeparatorRegExp = /###/g;
24035
+ const cleanKey = key => key && key.indexOf('###') > -1 ? key.replace(lastOfPathSeparatorRegExp, '.') : key;
24036
+ const canNotTraverseDeeper = object => !object || isString(object);
24037
+ const getLastOfPath = (object, path, Empty) => {
24038
+ const stack = !isString(path) ? path : path.split('.');
24039
+ let stackIndex = 0;
24040
+ while (stackIndex < stack.length - 1) {
24041
+ if (canNotTraverseDeeper(object)) return {};
24042
+ const key = cleanKey(stack[stackIndex]);
24043
+ if (!object[key] && Empty) object[key] = new Empty();
24044
+ if (Object.prototype.hasOwnProperty.call(object, key)) {
24045
+ object = object[key];
24046
+ } else {
24047
+ object = {};
24048
+ }
24049
+ ++stackIndex;
24050
+ }
24051
+ if (canNotTraverseDeeper(object)) return {};
24052
+ return {
24053
+ obj: object,
24054
+ k: cleanKey(stack[stackIndex])
24055
+ };
24056
+ };
24057
+ const setPath = (object, path, newValue) => {
24058
+ const {
24059
+ obj,
24060
+ k
24061
+ } = getLastOfPath(object, path, Object);
24062
+ if (obj !== undefined || path.length === 1) {
24063
+ obj[k] = newValue;
24064
+ return;
24065
+ }
24066
+ let e = path[path.length - 1];
24067
+ let p = path.slice(0, path.length - 1);
24068
+ let last = getLastOfPath(object, p, Object);
24069
+ while (last.obj === undefined && p.length) {
24070
+ e = `${p[p.length - 1]}.${e}`;
24071
+ p = p.slice(0, p.length - 1);
24072
+ last = getLastOfPath(object, p, Object);
24073
+ if (last?.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') {
24074
+ last.obj = undefined;
24075
+ }
24076
+ }
24077
+ last.obj[`${last.k}.${e}`] = newValue;
24078
+ };
24079
+ const pushPath = (object, path, newValue, concat) => {
24080
+ const {
24081
+ obj,
24082
+ k
24083
+ } = getLastOfPath(object, path, Object);
24084
+ obj[k] = obj[k] || [];
24085
+ obj[k].push(newValue);
24086
+ };
24087
+ const getPath = (object, path) => {
24088
+ const {
24089
+ obj,
24090
+ k
24091
+ } = getLastOfPath(object, path);
24092
+ if (!obj) return undefined;
24093
+ if (!Object.prototype.hasOwnProperty.call(obj, k)) return undefined;
24094
+ return obj[k];
24095
+ };
24096
+ const getPathWithDefaults = (data, defaultData, key) => {
24097
+ const value = getPath(data, key);
24098
+ if (value !== undefined) {
24099
+ return value;
24100
+ }
24101
+ return getPath(defaultData, key);
24102
+ };
24103
+ const deepExtend = (target, source, overwrite) => {
24104
+ for (const prop in source) {
24105
+ if (prop !== '__proto__' && prop !== 'constructor') {
24106
+ if (prop in target) {
24107
+ if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) {
24108
+ if (overwrite) target[prop] = source[prop];
24109
+ } else {
24110
+ deepExtend(target[prop], source[prop], overwrite);
24111
+ }
24112
+ } else {
24113
+ target[prop] = source[prop];
24114
+ }
24115
+ }
24116
+ }
24117
+ return target;
24118
+ };
24119
+ const regexEscape = str => str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
24120
+ var _entityMap = {
24121
+ '&': '&amp;',
24122
+ '<': '&lt;',
24123
+ '>': '&gt;',
24124
+ '"': '&quot;',
24125
+ "'": '&#39;',
24126
+ '/': '&#x2F;'
24127
+ };
24128
+ const escape$1 = data => {
24129
+ if (isString(data)) {
24130
+ return data.replace(/[&<>"'\/]/g, s => _entityMap[s]);
24131
+ }
24132
+ return data;
24133
+ };
24134
+ class RegExpCache {
24135
+ constructor(capacity) {
24136
+ this.capacity = capacity;
24137
+ this.regExpMap = new Map();
24138
+ this.regExpQueue = [];
24139
+ }
24140
+ getRegExp(pattern) {
24141
+ const regExpFromCache = this.regExpMap.get(pattern);
24142
+ if (regExpFromCache !== undefined) {
24143
+ return regExpFromCache;
24144
+ }
24145
+ const regExpNew = new RegExp(pattern);
24146
+ if (this.regExpQueue.length === this.capacity) {
24147
+ this.regExpMap.delete(this.regExpQueue.shift());
24148
+ }
24149
+ this.regExpMap.set(pattern, regExpNew);
24150
+ this.regExpQueue.push(pattern);
24151
+ return regExpNew;
24152
+ }
24153
+ }
24154
+ const chars = [' ', ',', '?', '!', ';'];
24155
+ const looksLikeObjectPathRegExpCache = new RegExpCache(20);
24156
+ const looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
24157
+ nsSeparator = nsSeparator || '';
24158
+ keySeparator = keySeparator || '';
24159
+ const possibleChars = chars.filter(c => nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0);
24160
+ if (possibleChars.length === 0) return true;
24161
+ const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map(c => c === '?' ? '\\?' : c).join('|')})`);
24162
+ let matched = !r.test(key);
24163
+ if (!matched) {
24164
+ const ki = key.indexOf(keySeparator);
24165
+ if (ki > 0 && !r.test(key.substring(0, ki))) {
24166
+ matched = true;
24167
+ }
24168
+ }
24169
+ return matched;
24170
+ };
24171
+ const deepFind = function (obj, path) {
24172
+ let keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
24173
+ if (!obj) return undefined;
24174
+ if (obj[path]) {
24175
+ if (!Object.prototype.hasOwnProperty.call(obj, path)) return undefined;
24176
+ return obj[path];
24177
+ }
24178
+ const tokens = path.split(keySeparator);
24179
+ let current = obj;
24180
+ for (let i = 0; i < tokens.length;) {
24181
+ if (!current || typeof current !== 'object') {
24182
+ return undefined;
24183
+ }
24184
+ let next;
24185
+ let nextPath = '';
24186
+ for (let j = i; j < tokens.length; ++j) {
24187
+ if (j !== i) {
24188
+ nextPath += keySeparator;
24189
+ }
24190
+ nextPath += tokens[j];
24191
+ next = current[nextPath];
24192
+ if (next !== undefined) {
24193
+ if (['string', 'number', 'boolean'].indexOf(typeof next) > -1 && j < tokens.length - 1) {
24194
+ continue;
24195
+ }
24196
+ i += j - i + 1;
24197
+ break;
24198
+ }
24199
+ }
24200
+ current = next;
24201
+ }
24202
+ return current;
24203
+ };
24204
+ const getCleanedCode = code => code?.replace('_', '-');
24205
+
24206
+ const consoleLogger = {
24207
+ type: 'logger',
24208
+ log(args) {
24209
+ this.output('log', args);
24210
+ },
24211
+ warn(args) {
24212
+ this.output('warn', args);
24213
+ },
24214
+ error(args) {
24215
+ this.output('error', args);
24216
+ },
24217
+ output(type, args) {
24218
+ console?.[type]?.apply?.(console, args);
24219
+ }
24220
+ };
24221
+ class Logger {
24222
+ constructor(concreteLogger) {
24223
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24224
+ this.init(concreteLogger, options);
24225
+ }
24226
+ init(concreteLogger) {
24227
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24228
+ this.prefix = options.prefix || 'i18next:';
24229
+ this.logger = concreteLogger || consoleLogger;
24230
+ this.options = options;
24231
+ this.debug = options.debug;
24232
+ }
24233
+ log() {
24234
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24235
+ args[_key] = arguments[_key];
24236
+ }
24237
+ return this.forward(args, 'log', '', true);
24238
+ }
24239
+ warn() {
24240
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
24241
+ args[_key2] = arguments[_key2];
24242
+ }
24243
+ return this.forward(args, 'warn', '', true);
24244
+ }
24245
+ error() {
24246
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
24247
+ args[_key3] = arguments[_key3];
24248
+ }
24249
+ return this.forward(args, 'error', '');
24250
+ }
24251
+ deprecate() {
24252
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
24253
+ args[_key4] = arguments[_key4];
24254
+ }
24255
+ return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
24256
+ }
24257
+ forward(args, lvl, prefix, debugOnly) {
24258
+ if (debugOnly && !this.debug) return null;
24259
+ if (isString(args[0])) args[0] = `${prefix}${this.prefix} ${args[0]}`;
24260
+ return this.logger[lvl](args);
24261
+ }
24262
+ create(moduleName) {
24263
+ return new Logger(this.logger, {
24264
+ ...{
24265
+ prefix: `${this.prefix}:${moduleName}:`
24266
+ },
24267
+ ...this.options
24268
+ });
24269
+ }
24270
+ clone(options) {
24271
+ options = options || this.options;
24272
+ options.prefix = options.prefix || this.prefix;
24273
+ return new Logger(this.logger, options);
24274
+ }
24275
+ }
24276
+ var baseLogger = new Logger();
24277
+
24278
+ class EventEmitter {
24279
+ constructor() {
24280
+ this.observers = {};
24281
+ }
24282
+ on(events, listener) {
24283
+ events.split(' ').forEach(event => {
24284
+ if (!this.observers[event]) this.observers[event] = new Map();
24285
+ const numListeners = this.observers[event].get(listener) || 0;
24286
+ this.observers[event].set(listener, numListeners + 1);
24287
+ });
24288
+ return this;
24289
+ }
24290
+ off(event, listener) {
24291
+ if (!this.observers[event]) return;
24292
+ if (!listener) {
24293
+ delete this.observers[event];
24294
+ return;
24295
+ }
24296
+ this.observers[event].delete(listener);
24297
+ }
24298
+ emit(event) {
24299
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
24300
+ args[_key - 1] = arguments[_key];
24301
+ }
24302
+ if (this.observers[event]) {
24303
+ const cloned = Array.from(this.observers[event].entries());
24304
+ cloned.forEach(_ref => {
24305
+ let [observer, numTimesAdded] = _ref;
24306
+ for (let i = 0; i < numTimesAdded; i++) {
24307
+ observer(...args);
24308
+ }
24309
+ });
24310
+ }
24311
+ if (this.observers['*']) {
24312
+ const cloned = Array.from(this.observers['*'].entries());
24313
+ cloned.forEach(_ref2 => {
24314
+ let [observer, numTimesAdded] = _ref2;
24315
+ for (let i = 0; i < numTimesAdded; i++) {
24316
+ observer.apply(observer, [event, ...args]);
24317
+ }
24318
+ });
24319
+ }
24320
+ }
24321
+ }
24322
+
24323
+ class ResourceStore extends EventEmitter {
24324
+ constructor(data) {
24325
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
24326
+ ns: ['translation'],
24327
+ defaultNS: 'translation'
24328
+ };
24329
+ super();
24330
+ this.data = data || {};
24331
+ this.options = options;
24332
+ if (this.options.keySeparator === undefined) {
24333
+ this.options.keySeparator = '.';
24334
+ }
24335
+ if (this.options.ignoreJSONStructure === undefined) {
24336
+ this.options.ignoreJSONStructure = true;
24337
+ }
24338
+ }
24339
+ addNamespaces(ns) {
24340
+ if (this.options.ns.indexOf(ns) < 0) {
24341
+ this.options.ns.push(ns);
24342
+ }
24343
+ }
24344
+ removeNamespaces(ns) {
24345
+ const index = this.options.ns.indexOf(ns);
24346
+ if (index > -1) {
24347
+ this.options.ns.splice(index, 1);
24348
+ }
24349
+ }
24350
+ getResource(lng, ns, key) {
24351
+ let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24352
+ const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
24353
+ const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
24354
+ let path;
24355
+ if (lng.indexOf('.') > -1) {
24356
+ path = lng.split('.');
24357
+ } else {
24358
+ path = [lng, ns];
24359
+ if (key) {
24360
+ if (Array.isArray(key)) {
24361
+ path.push(...key);
24362
+ } else if (isString(key) && keySeparator) {
24363
+ path.push(...key.split(keySeparator));
24364
+ } else {
24365
+ path.push(key);
24366
+ }
24367
+ }
24368
+ }
24369
+ const result = getPath(this.data, path);
24370
+ if (!result && !ns && !key && lng.indexOf('.') > -1) {
24371
+ lng = path[0];
24372
+ ns = path[1];
24373
+ key = path.slice(2).join('.');
24374
+ }
24375
+ if (result || !ignoreJSONStructure || !isString(key)) return result;
24376
+ return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
24377
+ }
24378
+ addResource(lng, ns, key, value) {
24379
+ let options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
24380
+ silent: false
24381
+ };
24382
+ const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
24383
+ let path = [lng, ns];
24384
+ if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
24385
+ if (lng.indexOf('.') > -1) {
24386
+ path = lng.split('.');
24387
+ value = ns;
24388
+ ns = path[1];
24389
+ }
24390
+ this.addNamespaces(ns);
24391
+ setPath(this.data, path, value);
24392
+ if (!options.silent) this.emit('added', lng, ns, key, value);
24393
+ }
24394
+ addResources(lng, ns, resources) {
24395
+ let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
24396
+ silent: false
24397
+ };
24398
+ for (const m in resources) {
24399
+ if (isString(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], {
24400
+ silent: true
24401
+ });
24402
+ }
24403
+ if (!options.silent) this.emit('added', lng, ns, resources);
24404
+ }
24405
+ addResourceBundle(lng, ns, resources, deep, overwrite) {
24406
+ let options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {
24407
+ silent: false,
24408
+ skipCopy: false
24409
+ };
24410
+ let path = [lng, ns];
24411
+ if (lng.indexOf('.') > -1) {
24412
+ path = lng.split('.');
24413
+ deep = resources;
24414
+ resources = ns;
24415
+ ns = path[1];
24416
+ }
24417
+ this.addNamespaces(ns);
24418
+ let pack = getPath(this.data, path) || {};
24419
+ if (!options.skipCopy) resources = JSON.parse(JSON.stringify(resources));
24420
+ if (deep) {
24421
+ deepExtend(pack, resources, overwrite);
24422
+ } else {
24423
+ pack = {
24424
+ ...pack,
24425
+ ...resources
24426
+ };
24427
+ }
24428
+ setPath(this.data, path, pack);
24429
+ if (!options.silent) this.emit('added', lng, ns, resources);
24430
+ }
24431
+ removeResourceBundle(lng, ns) {
24432
+ if (this.hasResourceBundle(lng, ns)) {
24433
+ delete this.data[lng][ns];
24434
+ }
24435
+ this.removeNamespaces(ns);
24436
+ this.emit('removed', lng, ns);
24437
+ }
24438
+ hasResourceBundle(lng, ns) {
24439
+ return this.getResource(lng, ns) !== undefined;
24440
+ }
24441
+ getResourceBundle(lng, ns) {
24442
+ if (!ns) ns = this.options.defaultNS;
24443
+ return this.getResource(lng, ns);
24444
+ }
24445
+ getDataByLanguage(lng) {
24446
+ return this.data[lng];
24447
+ }
24448
+ hasLanguageSomeTranslations(lng) {
24449
+ const data = this.getDataByLanguage(lng);
24450
+ const n = data && Object.keys(data) || [];
24451
+ return !!n.find(v => data[v] && Object.keys(data[v]).length > 0);
24452
+ }
24453
+ toJSON() {
24454
+ return this.data;
24455
+ }
24456
+ }
24457
+
24458
+ var postProcessor = {
24459
+ processors: {},
24460
+ addPostProcessor(module) {
24461
+ this.processors[module.name] = module;
24462
+ },
24463
+ handle(processors, value, key, options, translator) {
24464
+ processors.forEach(processor => {
24465
+ value = this.processors[processor]?.process(value, key, options, translator) ?? value;
24466
+ });
24467
+ return value;
24468
+ }
24469
+ };
24470
+
24471
+ const checkedLoadedFor = {};
24472
+ const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
24473
+ class Translator extends EventEmitter {
24474
+ constructor(services) {
24475
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24476
+ super();
24477
+ copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, this);
24478
+ this.options = options;
24479
+ if (this.options.keySeparator === undefined) {
24480
+ this.options.keySeparator = '.';
24481
+ }
24482
+ this.logger = baseLogger.create('translator');
24483
+ }
24484
+ changeLanguage(lng) {
24485
+ if (lng) this.language = lng;
24486
+ }
24487
+ exists(key) {
24488
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
24489
+ interpolation: {}
24490
+ };
24491
+ if (key == null) {
24492
+ return false;
24493
+ }
24494
+ const resolved = this.resolve(key, options);
24495
+ return resolved?.res !== undefined;
24496
+ }
24497
+ extractFromKey(key, opt) {
24498
+ let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;
24499
+ if (nsSeparator === undefined) nsSeparator = ':';
24500
+ const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
24501
+ let namespaces = opt.ns || this.options.defaultNS || [];
24502
+ const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
24503
+ const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
24504
+ if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
24505
+ const m = key.match(this.interpolator.nestingRegexp);
24506
+ if (m && m.length > 0) {
24507
+ return {
24508
+ key,
24509
+ namespaces: isString(namespaces) ? [namespaces] : namespaces
24510
+ };
24511
+ }
24512
+ const parts = key.split(nsSeparator);
24513
+ if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
24514
+ key = parts.join(keySeparator);
24515
+ }
24516
+ return {
24517
+ key,
24518
+ namespaces: isString(namespaces) ? [namespaces] : namespaces
24519
+ };
24520
+ }
24521
+ translate(keys, opt, lastKey) {
24522
+ if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
24523
+ opt = this.options.overloadTranslationOptionHandler(arguments);
24524
+ }
24525
+ if (typeof options === 'object') opt = {
24526
+ ...opt
24527
+ };
24528
+ if (!opt) opt = {};
24529
+ if (keys == null) return '';
24530
+ if (!Array.isArray(keys)) keys = [String(keys)];
24531
+ const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
24532
+ const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
24533
+ const {
24534
+ key,
24535
+ namespaces
24536
+ } = this.extractFromKey(keys[keys.length - 1], opt);
24537
+ const namespace = namespaces[namespaces.length - 1];
24538
+ const lng = opt.lng || this.language;
24539
+ const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
24540
+ if (lng?.toLowerCase() === 'cimode') {
24541
+ if (appendNamespaceToCIMode) {
24542
+ const nsSeparator = opt.nsSeparator || this.options.nsSeparator;
24543
+ if (returnDetails) {
24544
+ return {
24545
+ res: `${namespace}${nsSeparator}${key}`,
24546
+ usedKey: key,
24547
+ exactUsedKey: key,
24548
+ usedLng: lng,
24549
+ usedNS: namespace,
24550
+ usedParams: this.getUsedParamsDetails(opt)
24551
+ };
24552
+ }
24553
+ return `${namespace}${nsSeparator}${key}`;
24554
+ }
24555
+ if (returnDetails) {
24556
+ return {
24557
+ res: key,
24558
+ usedKey: key,
24559
+ exactUsedKey: key,
24560
+ usedLng: lng,
24561
+ usedNS: namespace,
24562
+ usedParams: this.getUsedParamsDetails(opt)
24563
+ };
24564
+ }
24565
+ return key;
24566
+ }
24567
+ const resolved = this.resolve(keys, opt);
24568
+ let res = resolved?.res;
24569
+ const resUsedKey = resolved?.usedKey || key;
24570
+ const resExactUsedKey = resolved?.exactUsedKey || key;
24571
+ const noObject = ['[object Number]', '[object Function]', '[object RegExp]'];
24572
+ const joinArrays = opt.joinArrays !== undefined ? opt.joinArrays : this.options.joinArrays;
24573
+ const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
24574
+ const needsPluralHandling = opt.count !== undefined && !isString(opt.count);
24575
+ const hasDefaultValue = Translator.hasDefaultValue(opt);
24576
+ const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : '';
24577
+ const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, {
24578
+ ordinal: false
24579
+ }) : '';
24580
+ const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
24581
+ const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue;
24582
+ let resForObjHndl = res;
24583
+ if (handleAsObjectInI18nFormat && !res && hasDefaultValue) {
24584
+ resForObjHndl = defaultValue;
24585
+ }
24586
+ const handleAsObject = shouldHandleAsObject(resForObjHndl);
24587
+ const resType = Object.prototype.toString.apply(resForObjHndl);
24588
+ if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {
24589
+ if (!opt.returnObjects && !this.options.returnObjects) {
24590
+ if (!this.options.returnedObjectHandler) {
24591
+ this.logger.warn('accessing an object - but returnObjects options is not enabled!');
24592
+ }
24593
+ const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, {
24594
+ ...opt,
24595
+ ns: namespaces
24596
+ }) : `key '${key} (${this.language})' returned an object instead of string.`;
24597
+ if (returnDetails) {
24598
+ resolved.res = r;
24599
+ resolved.usedParams = this.getUsedParamsDetails(opt);
24600
+ return resolved;
24601
+ }
24602
+ return r;
24603
+ }
24604
+ if (keySeparator) {
24605
+ const resTypeIsArray = Array.isArray(resForObjHndl);
24606
+ const copy = resTypeIsArray ? [] : {};
24607
+ const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
24608
+ for (const m in resForObjHndl) {
24609
+ if (Object.prototype.hasOwnProperty.call(resForObjHndl, m)) {
24610
+ const deepKey = `${newKeyToUse}${keySeparator}${m}`;
24611
+ if (hasDefaultValue && !res) {
24612
+ copy[m] = this.translate(deepKey, {
24613
+ ...opt,
24614
+ defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m] : undefined,
24615
+ ...{
24616
+ joinArrays: false,
24617
+ ns: namespaces
24618
+ }
24619
+ });
24620
+ } else {
24621
+ copy[m] = this.translate(deepKey, {
24622
+ ...opt,
24623
+ ...{
24624
+ joinArrays: false,
24625
+ ns: namespaces
24626
+ }
24627
+ });
24628
+ }
24629
+ if (copy[m] === deepKey) copy[m] = resForObjHndl[m];
24630
+ }
24631
+ }
24632
+ res = copy;
24633
+ }
24634
+ } else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) {
24635
+ res = res.join(joinArrays);
24636
+ if (res) res = this.extendTranslation(res, keys, opt, lastKey);
24637
+ } else {
24638
+ let usedDefault = false;
24639
+ let usedKey = false;
24640
+ if (!this.isValidLookup(res) && hasDefaultValue) {
24641
+ usedDefault = true;
24642
+ res = defaultValue;
24643
+ }
24644
+ if (!this.isValidLookup(res)) {
24645
+ usedKey = true;
24646
+ res = key;
24647
+ }
24648
+ const missingKeyNoValueFallbackToKey = opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
24649
+ const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;
24650
+ const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
24651
+ if (usedKey || usedDefault || updateMissing) {
24652
+ this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);
24653
+ if (keySeparator) {
24654
+ const fk = this.resolve(key, {
24655
+ ...opt,
24656
+ keySeparator: false
24657
+ });
24658
+ if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');
24659
+ }
24660
+ let lngs = [];
24661
+ const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language);
24662
+ if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {
24663
+ for (let i = 0; i < fallbackLngs.length; i++) {
24664
+ lngs.push(fallbackLngs[i]);
24665
+ }
24666
+ } else if (this.options.saveMissingTo === 'all') {
24667
+ lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language);
24668
+ } else {
24669
+ lngs.push(opt.lng || this.language);
24670
+ }
24671
+ const send = (l, k, specificDefaultValue) => {
24672
+ const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
24673
+ if (this.options.missingKeyHandler) {
24674
+ this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, opt);
24675
+ } else if (this.backendConnector?.saveMissing) {
24676
+ this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, opt);
24677
+ }
24678
+ this.emit('missingKey', l, namespace, k, res);
24679
+ };
24680
+ if (this.options.saveMissing) {
24681
+ if (this.options.saveMissingPlurals && needsPluralHandling) {
24682
+ lngs.forEach(language => {
24683
+ const suffixes = this.pluralResolver.getSuffixes(language, opt);
24684
+ if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) {
24685
+ suffixes.push(`${this.options.pluralSeparator}zero`);
24686
+ }
24687
+ suffixes.forEach(suffix => {
24688
+ send([language], key + suffix, opt[`defaultValue${suffix}`] || defaultValue);
24689
+ });
24690
+ });
24691
+ } else {
24692
+ send(lngs, key, defaultValue);
24693
+ }
24694
+ }
24695
+ }
24696
+ res = this.extendTranslation(res, keys, opt, resolved, lastKey);
24697
+ if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = `${namespace}:${key}`;
24698
+ if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
24699
+ res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : undefined);
24700
+ }
24701
+ }
24702
+ if (returnDetails) {
24703
+ resolved.res = res;
24704
+ resolved.usedParams = this.getUsedParamsDetails(opt);
24705
+ return resolved;
24706
+ }
24707
+ return res;
24708
+ }
24709
+ extendTranslation(res, key, opt, resolved, lastKey) {
24710
+ var _this = this;
24711
+ if (this.i18nFormat?.parse) {
24712
+ res = this.i18nFormat.parse(res, {
24713
+ ...this.options.interpolation.defaultVariables,
24714
+ ...opt
24715
+ }, opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, {
24716
+ resolved
24717
+ });
24718
+ } else if (!opt.skipInterpolation) {
24719
+ if (opt.interpolation) this.interpolator.init({
24720
+ ...opt,
24721
+ ...{
24722
+ interpolation: {
24723
+ ...this.options.interpolation,
24724
+ ...opt.interpolation
24725
+ }
24726
+ }
24727
+ });
24728
+ const skipOnVariables = isString(res) && (opt?.interpolation?.skipOnVariables !== undefined ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
24729
+ let nestBef;
24730
+ if (skipOnVariables) {
24731
+ const nb = res.match(this.interpolator.nestingRegexp);
24732
+ nestBef = nb && nb.length;
24733
+ }
24734
+ let data = opt.replace && !isString(opt.replace) ? opt.replace : opt;
24735
+ if (this.options.interpolation.defaultVariables) data = {
24736
+ ...this.options.interpolation.defaultVariables,
24737
+ ...data
24738
+ };
24739
+ res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt);
24740
+ if (skipOnVariables) {
24741
+ const na = res.match(this.interpolator.nestingRegexp);
24742
+ const nestAft = na && na.length;
24743
+ if (nestBef < nestAft) opt.nest = false;
24744
+ }
24745
+ if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng;
24746
+ if (opt.nest !== false) res = this.interpolator.nest(res, function () {
24747
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
24748
+ args[_key] = arguments[_key];
24749
+ }
24750
+ if (lastKey?.[0] === args[0] && !opt.context) {
24751
+ _this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
24752
+ return null;
24753
+ }
24754
+ return _this.translate(...args, key);
24755
+ }, opt);
24756
+ if (opt.interpolation) this.interpolator.reset();
24757
+ }
24758
+ const postProcess = opt.postProcess || this.options.postProcess;
24759
+ const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;
24760
+ if (res != null && postProcessorNames?.length && opt.applyPostProcessor !== false) {
24761
+ res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
24762
+ i18nResolved: {
24763
+ ...resolved,
24764
+ usedParams: this.getUsedParamsDetails(opt)
24765
+ },
24766
+ ...opt
24767
+ } : opt, this);
24768
+ }
24769
+ return res;
24770
+ }
24771
+ resolve(keys) {
24772
+ let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24773
+ let found;
24774
+ let usedKey;
24775
+ let exactUsedKey;
24776
+ let usedLng;
24777
+ let usedNS;
24778
+ if (isString(keys)) keys = [keys];
24779
+ keys.forEach(k => {
24780
+ if (this.isValidLookup(found)) return;
24781
+ const extracted = this.extractFromKey(k, opt);
24782
+ const key = extracted.key;
24783
+ usedKey = key;
24784
+ let namespaces = extracted.namespaces;
24785
+ if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
24786
+ const needsPluralHandling = opt.count !== undefined && !isString(opt.count);
24787
+ const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
24788
+ const needsContextHandling = opt.context !== undefined && (isString(opt.context) || typeof opt.context === 'number') && opt.context !== '';
24789
+ const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng);
24790
+ namespaces.forEach(ns => {
24791
+ if (this.isValidLookup(found)) return;
24792
+ usedNS = ns;
24793
+ if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
24794
+ checkedLoadedFor[`${codes[0]}-${ns}`] = true;
24795
+ this.logger.warn(`key "${usedKey}" for languages "${codes.join(', ')}" won't get resolved as namespace "${usedNS}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
24796
+ }
24797
+ codes.forEach(code => {
24798
+ if (this.isValidLookup(found)) return;
24799
+ usedLng = code;
24800
+ const finalKeys = [key];
24801
+ if (this.i18nFormat?.addLookupKeys) {
24802
+ this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt);
24803
+ } else {
24804
+ let pluralSuffix;
24805
+ if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt);
24806
+ const zeroSuffix = `${this.options.pluralSeparator}zero`;
24807
+ const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
24808
+ if (needsPluralHandling) {
24809
+ finalKeys.push(key + pluralSuffix);
24810
+ if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
24811
+ finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
24812
+ }
24813
+ if (needsZeroSuffixLookup) {
24814
+ finalKeys.push(key + zeroSuffix);
24815
+ }
24816
+ }
24817
+ if (needsContextHandling) {
24818
+ const contextKey = `${key}${this.options.contextSeparator}${opt.context}`;
24819
+ finalKeys.push(contextKey);
24820
+ if (needsPluralHandling) {
24821
+ finalKeys.push(contextKey + pluralSuffix);
24822
+ if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
24823
+ finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
24824
+ }
24825
+ if (needsZeroSuffixLookup) {
24826
+ finalKeys.push(contextKey + zeroSuffix);
24827
+ }
24828
+ }
24829
+ }
24830
+ }
24831
+ let possibleKey;
24832
+ while (possibleKey = finalKeys.pop()) {
24833
+ if (!this.isValidLookup(found)) {
24834
+ exactUsedKey = possibleKey;
24835
+ found = this.getResource(code, ns, possibleKey, opt);
24836
+ }
24837
+ }
24838
+ });
24839
+ });
24840
+ });
24841
+ return {
24842
+ res: found,
24843
+ usedKey,
24844
+ exactUsedKey,
24845
+ usedLng,
24846
+ usedNS
24847
+ };
24848
+ }
24849
+ isValidLookup(res) {
24850
+ return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');
24851
+ }
24852
+ getResource(code, ns, key) {
24853
+ let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
24854
+ if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
24855
+ return this.resourceStore.getResource(code, ns, key, options);
24856
+ }
24857
+ getUsedParamsDetails() {
24858
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
24859
+ const optionsKeys = ['defaultValue', 'ordinal', 'context', 'replace', 'lng', 'lngs', 'fallbackLng', 'ns', 'keySeparator', 'nsSeparator', 'returnObjects', 'returnDetails', 'joinArrays', 'postProcess', 'interpolation'];
24860
+ const useOptionsReplaceForData = options.replace && !isString(options.replace);
24861
+ let data = useOptionsReplaceForData ? options.replace : options;
24862
+ if (useOptionsReplaceForData && typeof options.count !== 'undefined') {
24863
+ data.count = options.count;
24864
+ }
24865
+ if (this.options.interpolation.defaultVariables) {
24866
+ data = {
24867
+ ...this.options.interpolation.defaultVariables,
24868
+ ...data
24869
+ };
24870
+ }
24871
+ if (!useOptionsReplaceForData) {
24872
+ data = {
24873
+ ...data
24874
+ };
24875
+ for (const key of optionsKeys) {
24876
+ delete data[key];
24877
+ }
24878
+ }
24879
+ return data;
24880
+ }
24881
+ static hasDefaultValue(options) {
24882
+ const prefix = 'defaultValue';
24883
+ for (const option in options) {
24884
+ if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {
24885
+ return true;
24886
+ }
24887
+ }
24888
+ return false;
24889
+ }
24890
+ }
24891
+
24892
+ class LanguageUtil {
24893
+ constructor(options) {
24894
+ this.options = options;
24895
+ this.supportedLngs = this.options.supportedLngs || false;
24896
+ this.logger = baseLogger.create('languageUtils');
24897
+ }
24898
+ getScriptPartFromCode(code) {
24899
+ code = getCleanedCode(code);
24900
+ if (!code || code.indexOf('-') < 0) return null;
24901
+ const p = code.split('-');
24902
+ if (p.length === 2) return null;
24903
+ p.pop();
24904
+ if (p[p.length - 1].toLowerCase() === 'x') return null;
24905
+ return this.formatLanguageCode(p.join('-'));
24906
+ }
24907
+ getLanguagePartFromCode(code) {
24908
+ code = getCleanedCode(code);
24909
+ if (!code || code.indexOf('-') < 0) return code;
24910
+ const p = code.split('-');
24911
+ return this.formatLanguageCode(p[0]);
24912
+ }
24913
+ formatLanguageCode(code) {
24914
+ if (isString(code) && code.indexOf('-') > -1) {
24915
+ let formattedCode;
24916
+ try {
24917
+ formattedCode = Intl.getCanonicalLocales(code)[0];
24918
+ } catch (e) {}
24919
+ if (formattedCode && this.options.lowerCaseLng) {
24920
+ formattedCode = formattedCode.toLowerCase();
24921
+ }
24922
+ if (formattedCode) return formattedCode;
24923
+ if (this.options.lowerCaseLng) {
24924
+ return code.toLowerCase();
24925
+ }
24926
+ return code;
24927
+ }
24928
+ return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
24929
+ }
24930
+ isSupportedCode(code) {
24931
+ if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {
24932
+ code = this.getLanguagePartFromCode(code);
24933
+ }
24934
+ return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
24935
+ }
24936
+ getBestMatchFromCodes(codes) {
24937
+ if (!codes) return null;
24938
+ let found;
24939
+ codes.forEach(code => {
24940
+ if (found) return;
24941
+ const cleanedLng = this.formatLanguageCode(code);
24942
+ if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng;
24943
+ });
24944
+ if (!found && this.options.supportedLngs) {
24945
+ codes.forEach(code => {
24946
+ if (found) return;
24947
+ const lngScOnly = this.getScriptPartFromCode(code);
24948
+ if (this.isSupportedCode(lngScOnly)) return found = lngScOnly;
24949
+ const lngOnly = this.getLanguagePartFromCode(code);
24950
+ if (this.isSupportedCode(lngOnly)) return found = lngOnly;
24951
+ found = this.options.supportedLngs.find(supportedLng => {
24952
+ if (supportedLng === lngOnly) return supportedLng;
24953
+ if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;
24954
+ if (supportedLng.indexOf('-') > 0 && lngOnly.indexOf('-') < 0 && supportedLng.substring(0, supportedLng.indexOf('-')) === lngOnly) return supportedLng;
24955
+ if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng;
24956
+ });
24957
+ });
24958
+ }
24959
+ if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
24960
+ return found;
24961
+ }
24962
+ getFallbackCodes(fallbacks, code) {
24963
+ if (!fallbacks) return [];
24964
+ if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
24965
+ if (isString(fallbacks)) fallbacks = [fallbacks];
24966
+ if (Array.isArray(fallbacks)) return fallbacks;
24967
+ if (!code) return fallbacks.default || [];
24968
+ let found = fallbacks[code];
24969
+ if (!found) found = fallbacks[this.getScriptPartFromCode(code)];
24970
+ if (!found) found = fallbacks[this.formatLanguageCode(code)];
24971
+ if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];
24972
+ if (!found) found = fallbacks.default;
24973
+ return found || [];
24974
+ }
24975
+ toResolveHierarchy(code, fallbackCode) {
24976
+ const fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);
24977
+ const codes = [];
24978
+ const addCode = c => {
24979
+ if (!c) return;
24980
+ if (this.isSupportedCode(c)) {
24981
+ codes.push(c);
24982
+ } else {
24983
+ this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`);
24984
+ }
24985
+ };
24986
+ if (isString(code) && (code.indexOf('-') > -1 || code.indexOf('_') > -1)) {
24987
+ if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));
24988
+ if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));
24989
+ if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));
24990
+ } else if (isString(code)) {
24991
+ addCode(this.formatLanguageCode(code));
24992
+ }
24993
+ fallbackCodes.forEach(fc => {
24994
+ if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc));
24995
+ });
24996
+ return codes;
24997
+ }
24998
+ }
24999
+
25000
+ const suffixesOrder = {
25001
+ zero: 0,
25002
+ one: 1,
25003
+ two: 2,
25004
+ few: 3,
25005
+ many: 4,
25006
+ other: 5
25007
+ };
25008
+ const dummyRule = {
25009
+ select: count => count === 1 ? 'one' : 'other',
25010
+ resolvedOptions: () => ({
25011
+ pluralCategories: ['one', 'other']
25012
+ })
25013
+ };
25014
+ class PluralResolver {
25015
+ constructor(languageUtils) {
25016
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25017
+ this.languageUtils = languageUtils;
25018
+ this.options = options;
25019
+ this.logger = baseLogger.create('pluralResolver');
25020
+ this.pluralRulesCache = {};
25021
+ }
25022
+ addRule(lng, obj) {
25023
+ this.rules[lng] = obj;
25024
+ }
25025
+ clearCache() {
25026
+ this.pluralRulesCache = {};
25027
+ }
25028
+ getRule(code) {
25029
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25030
+ const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);
25031
+ const type = options.ordinal ? 'ordinal' : 'cardinal';
25032
+ const cacheKey = JSON.stringify({
25033
+ cleanedCode,
25034
+ type
25035
+ });
25036
+ if (cacheKey in this.pluralRulesCache) {
25037
+ return this.pluralRulesCache[cacheKey];
25038
+ }
25039
+ let rule;
25040
+ try {
25041
+ rule = new Intl.PluralRules(cleanedCode, {
25042
+ type
25043
+ });
25044
+ } catch (err) {
25045
+ if (!Intl) {
25046
+ this.logger.error('No Intl support, please use an Intl polyfill!');
25047
+ return dummyRule;
25048
+ }
25049
+ if (!code.match(/-|_/)) return dummyRule;
25050
+ const lngPart = this.languageUtils.getLanguagePartFromCode(code);
25051
+ rule = this.getRule(lngPart, options);
25052
+ }
25053
+ this.pluralRulesCache[cacheKey] = rule;
25054
+ return rule;
25055
+ }
25056
+ needsPlural(code) {
25057
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25058
+ let rule = this.getRule(code, options);
25059
+ if (!rule) rule = this.getRule('dev', options);
25060
+ return rule?.resolvedOptions().pluralCategories.length > 1;
25061
+ }
25062
+ getPluralFormsOfKey(code, key) {
25063
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
25064
+ return this.getSuffixes(code, options).map(suffix => `${key}${suffix}`);
25065
+ }
25066
+ getSuffixes(code) {
25067
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25068
+ let rule = this.getRule(code, options);
25069
+ if (!rule) rule = this.getRule('dev', options);
25070
+ if (!rule) return [];
25071
+ return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
25072
+ }
25073
+ getSuffix(code, count) {
25074
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
25075
+ const rule = this.getRule(code, options);
25076
+ if (rule) {
25077
+ return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
25078
+ }
25079
+ this.logger.warn(`no plural rule found for: ${code}`);
25080
+ return this.getSuffix('dev', count, options);
25081
+ }
25082
+ }
25083
+
25084
+ const deepFindWithDefaults = function (data, defaultData, key) {
25085
+ let keySeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';
25086
+ let ignoreJSONStructure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
25087
+ let path = getPathWithDefaults(data, defaultData, key);
25088
+ if (!path && ignoreJSONStructure && isString(key)) {
25089
+ path = deepFind(data, key, keySeparator);
25090
+ if (path === undefined) path = deepFind(defaultData, key, keySeparator);
25091
+ }
25092
+ return path;
25093
+ };
25094
+ const regexSafe = val => val.replace(/\$/g, '$$$$');
25095
+ class Interpolator {
25096
+ constructor() {
25097
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25098
+ this.logger = baseLogger.create('interpolator');
25099
+ this.options = options;
25100
+ this.format = options?.interpolation?.format || (value => value);
25101
+ this.init(options);
25102
+ }
25103
+ init() {
25104
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25105
+ if (!options.interpolation) options.interpolation = {
25106
+ escapeValue: true
25107
+ };
25108
+ const {
25109
+ escape: escape$1$1,
25110
+ escapeValue,
25111
+ useRawValueToEscape,
25112
+ prefix,
25113
+ prefixEscaped,
25114
+ suffix,
25115
+ suffixEscaped,
25116
+ formatSeparator,
25117
+ unescapeSuffix,
25118
+ unescapePrefix,
25119
+ nestingPrefix,
25120
+ nestingPrefixEscaped,
25121
+ nestingSuffix,
25122
+ nestingSuffixEscaped,
25123
+ nestingOptionsSeparator,
25124
+ maxReplaces,
25125
+ alwaysFormat
25126
+ } = options.interpolation;
25127
+ this.escape = escape$1$1 !== undefined ? escape$1$1 : escape$1;
25128
+ this.escapeValue = escapeValue !== undefined ? escapeValue : true;
25129
+ this.useRawValueToEscape = useRawValueToEscape !== undefined ? useRawValueToEscape : false;
25130
+ this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || '{{';
25131
+ this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || '}}';
25132
+ this.formatSeparator = formatSeparator || ',';
25133
+ this.unescapePrefix = unescapeSuffix ? '' : unescapePrefix || '-';
25134
+ this.unescapeSuffix = this.unescapePrefix ? '' : unescapeSuffix || '';
25135
+ this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape('$t(');
25136
+ this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(')');
25137
+ this.nestingOptionsSeparator = nestingOptionsSeparator || ',';
25138
+ this.maxReplaces = maxReplaces || 1000;
25139
+ this.alwaysFormat = alwaysFormat !== undefined ? alwaysFormat : false;
25140
+ this.resetRegExp();
25141
+ }
25142
+ reset() {
25143
+ if (this.options) this.init(this.options);
25144
+ }
25145
+ resetRegExp() {
25146
+ const getOrResetRegExp = (existingRegExp, pattern) => {
25147
+ if (existingRegExp?.source === pattern) {
25148
+ existingRegExp.lastIndex = 0;
25149
+ return existingRegExp;
25150
+ }
25151
+ return new RegExp(pattern, 'g');
25152
+ };
25153
+ this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
25154
+ this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
25155
+ this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
25156
+ }
25157
+ interpolate(str, data, lng, options) {
25158
+ let match;
25159
+ let value;
25160
+ let replaces;
25161
+ const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
25162
+ const handleFormat = key => {
25163
+ if (key.indexOf(this.formatSeparator) < 0) {
25164
+ const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);
25165
+ return this.alwaysFormat ? this.format(path, undefined, lng, {
25166
+ ...options,
25167
+ ...data,
25168
+ interpolationkey: key
25169
+ }) : path;
25170
+ }
25171
+ const p = key.split(this.formatSeparator);
25172
+ const k = p.shift().trim();
25173
+ const f = p.join(this.formatSeparator).trim();
25174
+ return this.format(deepFindWithDefaults(data, defaultData, k, this.options.keySeparator, this.options.ignoreJSONStructure), f, lng, {
25175
+ ...options,
25176
+ ...data,
25177
+ interpolationkey: k
25178
+ });
25179
+ };
25180
+ this.resetRegExp();
25181
+ const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
25182
+ const skipOnVariables = options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
25183
+ const todos = [{
25184
+ regex: this.regexpUnescape,
25185
+ safeValue: val => regexSafe(val)
25186
+ }, {
25187
+ regex: this.regexp,
25188
+ safeValue: val => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val)
25189
+ }];
25190
+ todos.forEach(todo => {
25191
+ replaces = 0;
25192
+ while (match = todo.regex.exec(str)) {
25193
+ const matchedVar = match[1].trim();
25194
+ value = handleFormat(matchedVar);
25195
+ if (value === undefined) {
25196
+ if (typeof missingInterpolationHandler === 'function') {
25197
+ const temp = missingInterpolationHandler(str, match, options);
25198
+ value = isString(temp) ? temp : '';
25199
+ } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
25200
+ value = '';
25201
+ } else if (skipOnVariables) {
25202
+ value = match[0];
25203
+ continue;
25204
+ } else {
25205
+ this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);
25206
+ value = '';
25207
+ }
25208
+ } else if (!isString(value) && !this.useRawValueToEscape) {
25209
+ value = makeString(value);
25210
+ }
25211
+ const safeValue = todo.safeValue(value);
25212
+ str = str.replace(match[0], safeValue);
25213
+ if (skipOnVariables) {
25214
+ todo.regex.lastIndex += value.length;
25215
+ todo.regex.lastIndex -= match[0].length;
25216
+ } else {
25217
+ todo.regex.lastIndex = 0;
25218
+ }
25219
+ replaces++;
25220
+ if (replaces >= this.maxReplaces) {
25221
+ break;
25222
+ }
25223
+ }
25224
+ });
25225
+ return str;
25226
+ }
25227
+ nest(str, fc) {
25228
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
25229
+ let match;
25230
+ let value;
25231
+ let clonedOptions;
25232
+ const handleHasOptions = (key, inheritedOptions) => {
25233
+ const sep = this.nestingOptionsSeparator;
25234
+ if (key.indexOf(sep) < 0) return key;
25235
+ const c = key.split(new RegExp(`${sep}[ ]*{`));
25236
+ let optionsString = `{${c[1]}`;
25237
+ key = c[0];
25238
+ optionsString = this.interpolate(optionsString, clonedOptions);
25239
+ const matchedSingleQuotes = optionsString.match(/'/g);
25240
+ const matchedDoubleQuotes = optionsString.match(/"/g);
25241
+ if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
25242
+ optionsString = optionsString.replace(/'/g, '"');
25243
+ }
25244
+ try {
25245
+ clonedOptions = JSON.parse(optionsString);
25246
+ if (inheritedOptions) clonedOptions = {
25247
+ ...inheritedOptions,
25248
+ ...clonedOptions
25249
+ };
25250
+ } catch (e) {
25251
+ this.logger.warn(`failed parsing options string in nesting for key ${key}`, e);
25252
+ return `${key}${sep}${optionsString}`;
25253
+ }
25254
+ if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue;
25255
+ return key;
25256
+ };
25257
+ while (match = this.nestingRegexp.exec(str)) {
25258
+ let formatters = [];
25259
+ clonedOptions = {
25260
+ ...options
25261
+ };
25262
+ clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;
25263
+ clonedOptions.applyPostProcessor = false;
25264
+ delete clonedOptions.defaultValue;
25265
+ let doReduce = false;
25266
+ if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) {
25267
+ const r = match[1].split(this.formatSeparator).map(elem => elem.trim());
25268
+ match[1] = r.shift();
25269
+ formatters = r;
25270
+ doReduce = true;
25271
+ }
25272
+ value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
25273
+ if (value && match[0] === str && !isString(value)) return value;
25274
+ if (!isString(value)) value = makeString(value);
25275
+ if (!value) {
25276
+ this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);
25277
+ value = '';
25278
+ }
25279
+ if (doReduce) {
25280
+ value = formatters.reduce((v, f) => this.format(v, f, options.lng, {
25281
+ ...options,
25282
+ interpolationkey: match[1].trim()
25283
+ }), value.trim());
25284
+ }
25285
+ str = str.replace(match[0], value);
25286
+ this.regexp.lastIndex = 0;
25287
+ }
25288
+ return str;
25289
+ }
25290
+ }
25291
+
25292
+ const parseFormatStr = formatStr => {
25293
+ let formatName = formatStr.toLowerCase().trim();
25294
+ const formatOptions = {};
25295
+ if (formatStr.indexOf('(') > -1) {
25296
+ const p = formatStr.split('(');
25297
+ formatName = p[0].toLowerCase().trim();
25298
+ const optStr = p[1].substring(0, p[1].length - 1);
25299
+ if (formatName === 'currency' && optStr.indexOf(':') < 0) {
25300
+ if (!formatOptions.currency) formatOptions.currency = optStr.trim();
25301
+ } else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {
25302
+ if (!formatOptions.range) formatOptions.range = optStr.trim();
25303
+ } else {
25304
+ const opts = optStr.split(';');
25305
+ opts.forEach(opt => {
25306
+ if (opt) {
25307
+ const [key, ...rest] = opt.split(':');
25308
+ const val = rest.join(':').trim().replace(/^'+|'+$/g, '');
25309
+ const trimmedKey = key.trim();
25310
+ if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val;
25311
+ if (val === 'false') formatOptions[trimmedKey] = false;
25312
+ if (val === 'true') formatOptions[trimmedKey] = true;
25313
+ if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10);
25314
+ }
25315
+ });
25316
+ }
25317
+ }
25318
+ return {
25319
+ formatName,
25320
+ formatOptions
25321
+ };
25322
+ };
25323
+ const createCachedFormatter = fn => {
25324
+ const cache = {};
25325
+ return (val, lng, options) => {
25326
+ let optForCache = options;
25327
+ if (options && options.interpolationkey && options.formatParams && options.formatParams[options.interpolationkey] && options[options.interpolationkey]) {
25328
+ optForCache = {
25329
+ ...optForCache,
25330
+ [options.interpolationkey]: undefined
25331
+ };
25332
+ }
25333
+ const key = lng + JSON.stringify(optForCache);
25334
+ let formatter = cache[key];
25335
+ if (!formatter) {
25336
+ formatter = fn(getCleanedCode(lng), options);
25337
+ cache[key] = formatter;
25338
+ }
25339
+ return formatter(val);
25340
+ };
25341
+ };
25342
+ class Formatter {
25343
+ constructor() {
25344
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25345
+ this.logger = baseLogger.create('formatter');
25346
+ this.options = options;
25347
+ this.formats = {
25348
+ number: createCachedFormatter((lng, opt) => {
25349
+ const formatter = new Intl.NumberFormat(lng, {
25350
+ ...opt
25351
+ });
25352
+ return val => formatter.format(val);
25353
+ }),
25354
+ currency: createCachedFormatter((lng, opt) => {
25355
+ const formatter = new Intl.NumberFormat(lng, {
25356
+ ...opt,
25357
+ style: 'currency'
25358
+ });
25359
+ return val => formatter.format(val);
25360
+ }),
25361
+ datetime: createCachedFormatter((lng, opt) => {
25362
+ const formatter = new Intl.DateTimeFormat(lng, {
25363
+ ...opt
25364
+ });
25365
+ return val => formatter.format(val);
25366
+ }),
25367
+ relativetime: createCachedFormatter((lng, opt) => {
25368
+ const formatter = new Intl.RelativeTimeFormat(lng, {
25369
+ ...opt
25370
+ });
25371
+ return val => formatter.format(val, opt.range || 'day');
25372
+ }),
25373
+ list: createCachedFormatter((lng, opt) => {
25374
+ const formatter = new Intl.ListFormat(lng, {
25375
+ ...opt
25376
+ });
25377
+ return val => formatter.format(val);
25378
+ })
25379
+ };
25380
+ this.init(options);
25381
+ }
25382
+ init(services) {
25383
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
25384
+ interpolation: {}
25385
+ };
25386
+ this.formatSeparator = options.interpolation.formatSeparator || ',';
25387
+ }
25388
+ add(name, fc) {
25389
+ this.formats[name.toLowerCase().trim()] = fc;
25390
+ }
25391
+ addCached(name, fc) {
25392
+ this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
25393
+ }
25394
+ format(value, format, lng) {
25395
+ let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
25396
+ const formats = format.split(this.formatSeparator);
25397
+ if (formats.length > 1 && formats[0].indexOf('(') > 1 && formats[0].indexOf(')') < 0 && formats.find(f => f.indexOf(')') > -1)) {
25398
+ const lastIndex = formats.findIndex(f => f.indexOf(')') > -1);
25399
+ formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
25400
+ }
25401
+ const result = formats.reduce((mem, f) => {
25402
+ const {
25403
+ formatName,
25404
+ formatOptions
25405
+ } = parseFormatStr(f);
25406
+ if (this.formats[formatName]) {
25407
+ let formatted = mem;
25408
+ try {
25409
+ const valOptions = options?.formatParams?.[options.interpolationkey] || {};
25410
+ const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
25411
+ formatted = this.formats[formatName](mem, l, {
25412
+ ...formatOptions,
25413
+ ...options,
25414
+ ...valOptions
25415
+ });
25416
+ } catch (error) {
25417
+ this.logger.warn(error);
25418
+ }
25419
+ return formatted;
25420
+ } else {
25421
+ this.logger.warn(`there was no format function for ${formatName}`);
25422
+ }
25423
+ return mem;
25424
+ }, value);
25425
+ return result;
25426
+ }
25427
+ }
25428
+
25429
+ const removePending = (q, name) => {
25430
+ if (q.pending[name] !== undefined) {
25431
+ delete q.pending[name];
25432
+ q.pendingCount--;
25433
+ }
25434
+ };
25435
+ class Connector extends EventEmitter {
25436
+ constructor(backend, store, services) {
25437
+ let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
25438
+ super();
25439
+ this.backend = backend;
25440
+ this.store = store;
25441
+ this.services = services;
25442
+ this.languageUtils = services.languageUtils;
25443
+ this.options = options;
25444
+ this.logger = baseLogger.create('backendConnector');
25445
+ this.waitingReads = [];
25446
+ this.maxParallelReads = options.maxParallelReads || 10;
25447
+ this.readingCalls = 0;
25448
+ this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;
25449
+ this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
25450
+ this.state = {};
25451
+ this.queue = [];
25452
+ this.backend?.init?.(services, options.backend, options);
25453
+ }
25454
+ queueLoad(languages, namespaces, options, callback) {
25455
+ const toLoad = {};
25456
+ const pending = {};
25457
+ const toLoadLanguages = {};
25458
+ const toLoadNamespaces = {};
25459
+ languages.forEach(lng => {
25460
+ let hasAllNamespaces = true;
25461
+ namespaces.forEach(ns => {
25462
+ const name = `${lng}|${ns}`;
25463
+ if (!options.reload && this.store.hasResourceBundle(lng, ns)) {
25464
+ this.state[name] = 2;
25465
+ } else if (this.state[name] < 0) ; else if (this.state[name] === 1) {
25466
+ if (pending[name] === undefined) pending[name] = true;
25467
+ } else {
25468
+ this.state[name] = 1;
25469
+ hasAllNamespaces = false;
25470
+ if (pending[name] === undefined) pending[name] = true;
25471
+ if (toLoad[name] === undefined) toLoad[name] = true;
25472
+ if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;
25473
+ }
25474
+ });
25475
+ if (!hasAllNamespaces) toLoadLanguages[lng] = true;
25476
+ });
25477
+ if (Object.keys(toLoad).length || Object.keys(pending).length) {
25478
+ this.queue.push({
25479
+ pending,
25480
+ pendingCount: Object.keys(pending).length,
25481
+ loaded: {},
25482
+ errors: [],
25483
+ callback
25484
+ });
25485
+ }
25486
+ return {
25487
+ toLoad: Object.keys(toLoad),
25488
+ pending: Object.keys(pending),
25489
+ toLoadLanguages: Object.keys(toLoadLanguages),
25490
+ toLoadNamespaces: Object.keys(toLoadNamespaces)
25491
+ };
25492
+ }
25493
+ loaded(name, err, data) {
25494
+ const s = name.split('|');
25495
+ const lng = s[0];
25496
+ const ns = s[1];
25497
+ if (err) this.emit('failedLoading', lng, ns, err);
25498
+ if (!err && data) {
25499
+ this.store.addResourceBundle(lng, ns, data, undefined, undefined, {
25500
+ skipCopy: true
25501
+ });
25502
+ }
25503
+ this.state[name] = err ? -1 : 2;
25504
+ if (err && data) this.state[name] = 0;
25505
+ const loaded = {};
25506
+ this.queue.forEach(q => {
25507
+ pushPath(q.loaded, [lng], ns);
25508
+ removePending(q, name);
25509
+ if (err) q.errors.push(err);
25510
+ if (q.pendingCount === 0 && !q.done) {
25511
+ Object.keys(q.loaded).forEach(l => {
25512
+ if (!loaded[l]) loaded[l] = {};
25513
+ const loadedKeys = q.loaded[l];
25514
+ if (loadedKeys.length) {
25515
+ loadedKeys.forEach(n => {
25516
+ if (loaded[l][n] === undefined) loaded[l][n] = true;
25517
+ });
25518
+ }
25519
+ });
25520
+ q.done = true;
25521
+ if (q.errors.length) {
25522
+ q.callback(q.errors);
25523
+ } else {
25524
+ q.callback();
25525
+ }
25526
+ }
25527
+ });
25528
+ this.emit('loaded', loaded);
25529
+ this.queue = this.queue.filter(q => !q.done);
25530
+ }
25531
+ read(lng, ns, fcName) {
25532
+ let tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
25533
+ let wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.retryTimeout;
25534
+ let callback = arguments.length > 5 ? arguments[5] : undefined;
25535
+ if (!lng.length) return callback(null, {});
25536
+ if (this.readingCalls >= this.maxParallelReads) {
25537
+ this.waitingReads.push({
25538
+ lng,
25539
+ ns,
25540
+ fcName,
25541
+ tried,
25542
+ wait,
25543
+ callback
25544
+ });
25545
+ return;
25546
+ }
25547
+ this.readingCalls++;
25548
+ const resolver = (err, data) => {
25549
+ this.readingCalls--;
25550
+ if (this.waitingReads.length > 0) {
25551
+ const next = this.waitingReads.shift();
25552
+ this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
25553
+ }
25554
+ if (err && data && tried < this.maxRetries) {
25555
+ setTimeout(() => {
25556
+ this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);
25557
+ }, wait);
25558
+ return;
25559
+ }
25560
+ callback(err, data);
25561
+ };
25562
+ const fc = this.backend[fcName].bind(this.backend);
25563
+ if (fc.length === 2) {
25564
+ try {
25565
+ const r = fc(lng, ns);
25566
+ if (r && typeof r.then === 'function') {
25567
+ r.then(data => resolver(null, data)).catch(resolver);
25568
+ } else {
25569
+ resolver(null, r);
25570
+ }
25571
+ } catch (err) {
25572
+ resolver(err);
25573
+ }
25574
+ return;
25575
+ }
25576
+ return fc(lng, ns, resolver);
25577
+ }
25578
+ prepareLoading(languages, namespaces) {
25579
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
25580
+ let callback = arguments.length > 3 ? arguments[3] : undefined;
25581
+ if (!this.backend) {
25582
+ this.logger.warn('No backend was added via i18next.use. Will not load resources.');
25583
+ return callback && callback();
25584
+ }
25585
+ if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages);
25586
+ if (isString(namespaces)) namespaces = [namespaces];
25587
+ const toLoad = this.queueLoad(languages, namespaces, options, callback);
25588
+ if (!toLoad.toLoad.length) {
25589
+ if (!toLoad.pending.length) callback();
25590
+ return null;
25591
+ }
25592
+ toLoad.toLoad.forEach(name => {
25593
+ this.loadOne(name);
25594
+ });
25595
+ }
25596
+ load(languages, namespaces, callback) {
25597
+ this.prepareLoading(languages, namespaces, {}, callback);
25598
+ }
25599
+ reload(languages, namespaces, callback) {
25600
+ this.prepareLoading(languages, namespaces, {
25601
+ reload: true
25602
+ }, callback);
25603
+ }
25604
+ loadOne(name) {
25605
+ let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
25606
+ const s = name.split('|');
25607
+ const lng = s[0];
25608
+ const ns = s[1];
25609
+ this.read(lng, ns, 'read', undefined, undefined, (err, data) => {
25610
+ if (err) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err);
25611
+ if (!err && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data);
25612
+ this.loaded(name, err, data);
25613
+ });
25614
+ }
25615
+ saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
25616
+ let options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
25617
+ let clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : () => {};
25618
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
25619
+ this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
25620
+ return;
25621
+ }
25622
+ if (key === undefined || key === null || key === '') return;
25623
+ if (this.backend?.create) {
25624
+ const opts = {
25625
+ ...options,
25626
+ isUpdate
25627
+ };
25628
+ const fc = this.backend.create.bind(this.backend);
25629
+ if (fc.length < 6) {
25630
+ try {
25631
+ let r;
25632
+ if (fc.length === 5) {
25633
+ r = fc(languages, namespace, key, fallbackValue, opts);
25634
+ } else {
25635
+ r = fc(languages, namespace, key, fallbackValue);
25636
+ }
25637
+ if (r && typeof r.then === 'function') {
25638
+ r.then(data => clb(null, data)).catch(clb);
25639
+ } else {
25640
+ clb(null, r);
25641
+ }
25642
+ } catch (err) {
25643
+ clb(err);
25644
+ }
25645
+ } else {
25646
+ fc(languages, namespace, key, fallbackValue, clb, opts);
25647
+ }
25648
+ }
25649
+ if (!languages || !languages[0]) return;
25650
+ this.store.addResource(languages[0], namespace, key, fallbackValue);
25651
+ }
25652
+ }
25653
+
25654
+ const get$1 = () => ({
25655
+ debug: false,
25656
+ initAsync: true,
25657
+ ns: ['translation'],
25658
+ defaultNS: ['translation'],
25659
+ fallbackLng: ['dev'],
25660
+ fallbackNS: false,
25661
+ supportedLngs: false,
25662
+ nonExplicitSupportedLngs: false,
25663
+ load: 'all',
25664
+ preload: false,
25665
+ simplifyPluralSuffix: true,
25666
+ keySeparator: '.',
25667
+ nsSeparator: ':',
25668
+ pluralSeparator: '_',
25669
+ contextSeparator: '_',
25670
+ partialBundledLanguages: false,
25671
+ saveMissing: false,
25672
+ updateMissing: false,
25673
+ saveMissingTo: 'fallback',
25674
+ saveMissingPlurals: true,
25675
+ missingKeyHandler: false,
25676
+ missingInterpolationHandler: false,
25677
+ postProcess: false,
25678
+ postProcessPassResolved: false,
25679
+ returnNull: false,
25680
+ returnEmptyString: true,
25681
+ returnObjects: false,
25682
+ joinArrays: false,
25683
+ returnedObjectHandler: false,
25684
+ parseMissingKeyHandler: false,
25685
+ appendNamespaceToMissingKey: false,
25686
+ appendNamespaceToCIMode: false,
25687
+ overloadTranslationOptionHandler: args => {
25688
+ let ret = {};
25689
+ if (typeof args[1] === 'object') ret = args[1];
25690
+ if (isString(args[1])) ret.defaultValue = args[1];
25691
+ if (isString(args[2])) ret.tDescription = args[2];
25692
+ if (typeof args[2] === 'object' || typeof args[3] === 'object') {
25693
+ const options = args[3] || args[2];
25694
+ Object.keys(options).forEach(key => {
25695
+ ret[key] = options[key];
25696
+ });
25697
+ }
25698
+ return ret;
25699
+ },
25700
+ interpolation: {
25701
+ escapeValue: true,
25702
+ format: value => value,
25703
+ prefix: '{{',
25704
+ suffix: '}}',
25705
+ formatSeparator: ',',
25706
+ unescapePrefix: '-',
25707
+ nestingPrefix: '$t(',
25708
+ nestingSuffix: ')',
25709
+ nestingOptionsSeparator: ',',
25710
+ maxReplaces: 1000,
25711
+ skipOnVariables: true
25712
+ }
25713
+ });
25714
+ const transformOptions = options => {
25715
+ if (isString(options.ns)) options.ns = [options.ns];
25716
+ if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
25717
+ if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
25718
+ if (options.supportedLngs?.indexOf?.('cimode') < 0) {
25719
+ options.supportedLngs = options.supportedLngs.concat(['cimode']);
25720
+ }
25721
+ if (typeof options.initImmediate === 'boolean') options.initAsync = options.initImmediate;
25722
+ return options;
25723
+ };
25724
+
25725
+ const noop = () => {};
25726
+ const bindMemberFunctions = inst => {
25727
+ const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
25728
+ mems.forEach(mem => {
25729
+ if (typeof inst[mem] === 'function') {
25730
+ inst[mem] = inst[mem].bind(inst);
25731
+ }
25732
+ });
25733
+ };
25734
+ class I18n extends EventEmitter {
25735
+ constructor() {
25736
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25737
+ let callback = arguments.length > 1 ? arguments[1] : undefined;
25738
+ super();
25739
+ this.options = transformOptions(options);
25740
+ this.services = {};
25741
+ this.logger = baseLogger;
25742
+ this.modules = {
25743
+ external: []
25744
+ };
25745
+ bindMemberFunctions(this);
25746
+ if (callback && !this.isInitialized && !options.isClone) {
25747
+ if (!this.options.initAsync) {
25748
+ this.init(options, callback);
25749
+ return this;
25750
+ }
25751
+ setTimeout(() => {
25752
+ this.init(options, callback);
25753
+ }, 0);
25754
+ }
25755
+ }
25756
+ init() {
25757
+ var _this = this;
25758
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25759
+ let callback = arguments.length > 1 ? arguments[1] : undefined;
25760
+ this.isInitializing = true;
25761
+ if (typeof options === 'function') {
25762
+ callback = options;
25763
+ options = {};
25764
+ }
25765
+ if (options.defaultNS == null && options.ns) {
25766
+ if (isString(options.ns)) {
25767
+ options.defaultNS = options.ns;
25768
+ } else if (options.ns.indexOf('translation') < 0) {
25769
+ options.defaultNS = options.ns[0];
25770
+ }
25771
+ }
25772
+ const defOpts = get$1();
25773
+ this.options = {
25774
+ ...defOpts,
25775
+ ...this.options,
25776
+ ...transformOptions(options)
25777
+ };
25778
+ this.options.interpolation = {
25779
+ ...defOpts.interpolation,
25780
+ ...this.options.interpolation
25781
+ };
25782
+ if (options.keySeparator !== undefined) {
25783
+ this.options.userDefinedKeySeparator = options.keySeparator;
25784
+ }
25785
+ if (options.nsSeparator !== undefined) {
25786
+ this.options.userDefinedNsSeparator = options.nsSeparator;
25787
+ }
25788
+ const createClassOnDemand = ClassOrObject => {
25789
+ if (!ClassOrObject) return null;
25790
+ if (typeof ClassOrObject === 'function') return new ClassOrObject();
25791
+ return ClassOrObject;
25792
+ };
25793
+ if (!this.options.isClone) {
25794
+ if (this.modules.logger) {
25795
+ baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
25796
+ } else {
25797
+ baseLogger.init(null, this.options);
25798
+ }
25799
+ let formatter;
25800
+ if (this.modules.formatter) {
25801
+ formatter = this.modules.formatter;
25802
+ } else {
25803
+ formatter = Formatter;
25804
+ }
25805
+ const lu = new LanguageUtil(this.options);
25806
+ this.store = new ResourceStore(this.options.resources, this.options);
25807
+ const s = this.services;
25808
+ s.logger = baseLogger;
25809
+ s.resourceStore = this.store;
25810
+ s.languageUtils = lu;
25811
+ s.pluralResolver = new PluralResolver(lu, {
25812
+ prepend: this.options.pluralSeparator,
25813
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
25814
+ });
25815
+ if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
25816
+ s.formatter = createClassOnDemand(formatter);
25817
+ s.formatter.init(s, this.options);
25818
+ this.options.interpolation.format = s.formatter.format.bind(s.formatter);
25819
+ }
25820
+ s.interpolator = new Interpolator(this.options);
25821
+ s.utils = {
25822
+ hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
25823
+ };
25824
+ s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);
25825
+ s.backendConnector.on('*', function (event) {
25826
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
25827
+ args[_key - 1] = arguments[_key];
25828
+ }
25829
+ _this.emit(event, ...args);
25830
+ });
25831
+ if (this.modules.languageDetector) {
25832
+ s.languageDetector = createClassOnDemand(this.modules.languageDetector);
25833
+ if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);
25834
+ }
25835
+ if (this.modules.i18nFormat) {
25836
+ s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
25837
+ if (s.i18nFormat.init) s.i18nFormat.init(this);
25838
+ }
25839
+ this.translator = new Translator(this.services, this.options);
25840
+ this.translator.on('*', function (event) {
25841
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
25842
+ args[_key2 - 1] = arguments[_key2];
25843
+ }
25844
+ _this.emit(event, ...args);
25845
+ });
25846
+ this.modules.external.forEach(m => {
25847
+ if (m.init) m.init(this);
25848
+ });
25849
+ }
25850
+ this.format = this.options.interpolation.format;
25851
+ if (!callback) callback = noop;
25852
+ if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
25853
+ const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
25854
+ if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];
25855
+ }
25856
+ if (!this.services.languageDetector && !this.options.lng) {
25857
+ this.logger.warn('init: no languageDetector is used and no lng is defined');
25858
+ }
25859
+ const storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
25860
+ storeApi.forEach(fcName => {
25861
+ this[fcName] = function () {
25862
+ return _this.store[fcName](...arguments);
25863
+ };
25864
+ });
25865
+ const storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
25866
+ storeApiChained.forEach(fcName => {
25867
+ this[fcName] = function () {
25868
+ _this.store[fcName](...arguments);
25869
+ return _this;
25870
+ };
25871
+ });
25872
+ const deferred = defer();
25873
+ const load = () => {
25874
+ const finish = (err, t) => {
25875
+ this.isInitializing = false;
25876
+ if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn('init: i18next is already initialized. You should call init just once!');
25877
+ this.isInitialized = true;
25878
+ if (!this.options.isClone) this.logger.log('initialized', this.options);
25879
+ this.emit('initialized', this.options);
25880
+ deferred.resolve(t);
25881
+ callback(err, t);
25882
+ };
25883
+ if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
25884
+ this.changeLanguage(this.options.lng, finish);
25885
+ };
25886
+ if (this.options.resources || !this.options.initAsync) {
25887
+ load();
25888
+ } else {
25889
+ setTimeout(load, 0);
25890
+ }
25891
+ return deferred;
25892
+ }
25893
+ loadResources(language) {
25894
+ let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
25895
+ let usedCallback = callback;
25896
+ const usedLng = isString(language) ? language : this.language;
25897
+ if (typeof language === 'function') usedCallback = language;
25898
+ if (!this.options.resources || this.options.partialBundledLanguages) {
25899
+ if (usedLng?.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
25900
+ const toLoad = [];
25901
+ const append = lng => {
25902
+ if (!lng) return;
25903
+ if (lng === 'cimode') return;
25904
+ const lngs = this.services.languageUtils.toResolveHierarchy(lng);
25905
+ lngs.forEach(l => {
25906
+ if (l === 'cimode') return;
25907
+ if (toLoad.indexOf(l) < 0) toLoad.push(l);
25908
+ });
25909
+ };
25910
+ if (!usedLng) {
25911
+ const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
25912
+ fallbacks.forEach(l => append(l));
25913
+ } else {
25914
+ append(usedLng);
25915
+ }
25916
+ this.options.preload?.forEach?.(l => append(l));
25917
+ this.services.backendConnector.load(toLoad, this.options.ns, e => {
25918
+ if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
25919
+ usedCallback(e);
25920
+ });
25921
+ } else {
25922
+ usedCallback(null);
25923
+ }
25924
+ }
25925
+ reloadResources(lngs, ns, callback) {
25926
+ const deferred = defer();
25927
+ if (typeof lngs === 'function') {
25928
+ callback = lngs;
25929
+ lngs = undefined;
25930
+ }
25931
+ if (typeof ns === 'function') {
25932
+ callback = ns;
25933
+ ns = undefined;
25934
+ }
25935
+ if (!lngs) lngs = this.languages;
25936
+ if (!ns) ns = this.options.ns;
25937
+ if (!callback) callback = noop;
25938
+ this.services.backendConnector.reload(lngs, ns, err => {
25939
+ deferred.resolve();
25940
+ callback(err);
25941
+ });
25942
+ return deferred;
25943
+ }
25944
+ use(module) {
25945
+ if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');
25946
+ if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');
25947
+ if (module.type === 'backend') {
25948
+ this.modules.backend = module;
25949
+ }
25950
+ if (module.type === 'logger' || module.log && module.warn && module.error) {
25951
+ this.modules.logger = module;
25952
+ }
25953
+ if (module.type === 'languageDetector') {
25954
+ this.modules.languageDetector = module;
25955
+ }
25956
+ if (module.type === 'i18nFormat') {
25957
+ this.modules.i18nFormat = module;
25958
+ }
25959
+ if (module.type === 'postProcessor') {
25960
+ postProcessor.addPostProcessor(module);
25961
+ }
25962
+ if (module.type === 'formatter') {
25963
+ this.modules.formatter = module;
25964
+ }
25965
+ if (module.type === '3rdParty') {
25966
+ this.modules.external.push(module);
25967
+ }
25968
+ return this;
25969
+ }
25970
+ setResolvedLanguage(l) {
25971
+ if (!l || !this.languages) return;
25972
+ if (['cimode', 'dev'].indexOf(l) > -1) return;
25973
+ for (let li = 0; li < this.languages.length; li++) {
25974
+ const lngInLngs = this.languages[li];
25975
+ if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;
25976
+ if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
25977
+ this.resolvedLanguage = lngInLngs;
25978
+ break;
25979
+ }
25980
+ }
25981
+ }
25982
+ changeLanguage(lng, callback) {
25983
+ var _this2 = this;
25984
+ this.isLanguageChangingTo = lng;
25985
+ const deferred = defer();
25986
+ this.emit('languageChanging', lng);
25987
+ const setLngProps = l => {
25988
+ this.language = l;
25989
+ this.languages = this.services.languageUtils.toResolveHierarchy(l);
25990
+ this.resolvedLanguage = undefined;
25991
+ this.setResolvedLanguage(l);
25992
+ };
25993
+ const done = (err, l) => {
25994
+ if (l) {
25995
+ if (this.isLanguageChangingTo === lng) {
25996
+ setLngProps(l);
25997
+ this.translator.changeLanguage(l);
25998
+ this.isLanguageChangingTo = undefined;
25999
+ this.emit('languageChanged', l);
26000
+ this.logger.log('languageChanged', l);
26001
+ }
26002
+ } else {
26003
+ this.isLanguageChangingTo = undefined;
26004
+ }
26005
+ deferred.resolve(function () {
26006
+ return _this2.t(...arguments);
26007
+ });
26008
+ if (callback) callback(err, function () {
26009
+ return _this2.t(...arguments);
26010
+ });
26011
+ };
26012
+ const setLng = lngs => {
26013
+ if (!lng && !lngs && this.services.languageDetector) lngs = [];
26014
+ const l = this.services.languageUtils.getBestMatchFromCodes(isString(lngs) ? [lngs] : lngs);
26015
+ if (l) {
26016
+ if (!this.language) {
26017
+ setLngProps(l);
26018
+ }
26019
+ if (!this.translator.language) this.translator.changeLanguage(l);
26020
+ this.services.languageDetector?.cacheUserLanguage?.(l);
26021
+ }
26022
+ this.loadResources(l, err => {
26023
+ done(err, l);
26024
+ });
26025
+ };
26026
+ if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
26027
+ setLng(this.services.languageDetector.detect());
26028
+ } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
26029
+ if (this.services.languageDetector.detect.length === 0) {
26030
+ this.services.languageDetector.detect().then(setLng);
26031
+ } else {
26032
+ this.services.languageDetector.detect(setLng);
26033
+ }
26034
+ } else {
26035
+ setLng(lng);
26036
+ }
26037
+ return deferred;
26038
+ }
26039
+ getFixedT(lng, ns, keyPrefix) {
26040
+ var _this3 = this;
26041
+ const fixedT = function (key, opts) {
26042
+ let o;
26043
+ if (typeof opts !== 'object') {
26044
+ for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
26045
+ rest[_key3 - 2] = arguments[_key3];
26046
+ }
26047
+ o = _this3.options.overloadTranslationOptionHandler([key, opts].concat(rest));
26048
+ } else {
26049
+ o = {
26050
+ ...opts
26051
+ };
26052
+ }
26053
+ o.lng = o.lng || fixedT.lng;
26054
+ o.lngs = o.lngs || fixedT.lngs;
26055
+ o.ns = o.ns || fixedT.ns;
26056
+ if (o.keyPrefix !== '') o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;
26057
+ const keySeparator = _this3.options.keySeparator || '.';
26058
+ let resultKey;
26059
+ if (o.keyPrefix && Array.isArray(key)) {
26060
+ resultKey = key.map(k => `${o.keyPrefix}${keySeparator}${k}`);
26061
+ } else {
26062
+ resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
26063
+ }
26064
+ return _this3.t(resultKey, o);
26065
+ };
26066
+ if (isString(lng)) {
26067
+ fixedT.lng = lng;
26068
+ } else {
26069
+ fixedT.lngs = lng;
26070
+ }
26071
+ fixedT.ns = ns;
26072
+ fixedT.keyPrefix = keyPrefix;
26073
+ return fixedT;
26074
+ }
26075
+ t() {
26076
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
26077
+ args[_key4] = arguments[_key4];
26078
+ }
26079
+ return this.translator?.translate(...args);
26080
+ }
26081
+ exists() {
26082
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
26083
+ args[_key5] = arguments[_key5];
26084
+ }
26085
+ return this.translator?.exists(...args);
26086
+ }
26087
+ setDefaultNamespace(ns) {
26088
+ this.options.defaultNS = ns;
26089
+ }
26090
+ hasLoadedNamespace(ns) {
26091
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
26092
+ if (!this.isInitialized) {
26093
+ this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
26094
+ return false;
26095
+ }
26096
+ if (!this.languages || !this.languages.length) {
26097
+ this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);
26098
+ return false;
26099
+ }
26100
+ const lng = options.lng || this.resolvedLanguage || this.languages[0];
26101
+ const fallbackLng = this.options ? this.options.fallbackLng : false;
26102
+ const lastLng = this.languages[this.languages.length - 1];
26103
+ if (lng.toLowerCase() === 'cimode') return true;
26104
+ const loadNotPending = (l, n) => {
26105
+ const loadState = this.services.backendConnector.state[`${l}|${n}`];
26106
+ return loadState === -1 || loadState === 0 || loadState === 2;
26107
+ };
26108
+ if (options.precheck) {
26109
+ const preResult = options.precheck(this, loadNotPending);
26110
+ if (preResult !== undefined) return preResult;
26111
+ }
26112
+ if (this.hasResourceBundle(lng, ns)) return true;
26113
+ if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
26114
+ if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
26115
+ return false;
26116
+ }
26117
+ loadNamespaces(ns, callback) {
26118
+ const deferred = defer();
26119
+ if (!this.options.ns) {
26120
+ if (callback) callback();
26121
+ return Promise.resolve();
26122
+ }
26123
+ if (isString(ns)) ns = [ns];
26124
+ ns.forEach(n => {
26125
+ if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
26126
+ });
26127
+ this.loadResources(err => {
26128
+ deferred.resolve();
26129
+ if (callback) callback(err);
26130
+ });
26131
+ return deferred;
26132
+ }
26133
+ loadLanguages(lngs, callback) {
26134
+ const deferred = defer();
26135
+ if (isString(lngs)) lngs = [lngs];
26136
+ const preloaded = this.options.preload || [];
26137
+ const newLngs = lngs.filter(lng => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
26138
+ if (!newLngs.length) {
26139
+ if (callback) callback();
26140
+ return Promise.resolve();
26141
+ }
26142
+ this.options.preload = preloaded.concat(newLngs);
26143
+ this.loadResources(err => {
26144
+ deferred.resolve();
26145
+ if (callback) callback(err);
26146
+ });
26147
+ return deferred;
26148
+ }
26149
+ dir(lng) {
26150
+ if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);
26151
+ if (!lng) return 'rtl';
26152
+ const rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];
26153
+ const languageUtils = this.services?.languageUtils || new LanguageUtil(get$1());
26154
+ return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
26155
+ }
26156
+ static createInstance() {
26157
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26158
+ let callback = arguments.length > 1 ? arguments[1] : undefined;
26159
+ return new I18n(options, callback);
26160
+ }
26161
+ cloneInstance() {
26162
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26163
+ let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
26164
+ const forkResourceStore = options.forkResourceStore;
26165
+ if (forkResourceStore) delete options.forkResourceStore;
26166
+ const mergedOptions = {
26167
+ ...this.options,
26168
+ ...options,
26169
+ ...{
26170
+ isClone: true
26171
+ }
26172
+ };
26173
+ const clone = new I18n(mergedOptions);
26174
+ if (options.debug !== undefined || options.prefix !== undefined) {
26175
+ clone.logger = clone.logger.clone(options);
26176
+ }
26177
+ const membersToCopy = ['store', 'services', 'language'];
26178
+ membersToCopy.forEach(m => {
26179
+ clone[m] = this[m];
26180
+ });
26181
+ clone.services = {
26182
+ ...this.services
26183
+ };
26184
+ clone.services.utils = {
26185
+ hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
26186
+ };
26187
+ if (forkResourceStore) {
26188
+ const clonedData = Object.keys(this.store.data).reduce((prev, l) => {
26189
+ prev[l] = {
26190
+ ...this.store.data[l]
26191
+ };
26192
+ return Object.keys(prev[l]).reduce((acc, n) => {
26193
+ acc[n] = {
26194
+ ...prev[l][n]
26195
+ };
26196
+ return acc;
26197
+ }, {});
26198
+ }, {});
26199
+ clone.store = new ResourceStore(clonedData, mergedOptions);
26200
+ clone.services.resourceStore = clone.store;
26201
+ }
26202
+ clone.translator = new Translator(clone.services, mergedOptions);
26203
+ clone.translator.on('*', function (event) {
26204
+ for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
26205
+ args[_key6 - 1] = arguments[_key6];
26206
+ }
26207
+ clone.emit(event, ...args);
26208
+ });
26209
+ clone.init(mergedOptions, callback);
26210
+ clone.translator.options = mergedOptions;
26211
+ clone.translator.backendConnector.services.utils = {
26212
+ hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
26213
+ };
26214
+ return clone;
26215
+ }
26216
+ toJSON() {
26217
+ return {
26218
+ options: this.options,
26219
+ store: this.store,
26220
+ language: this.language,
26221
+ languages: this.languages,
26222
+ resolvedLanguage: this.resolvedLanguage
26223
+ };
26224
+ }
26225
+ }
26226
+ const instance = I18n.createInstance();
26227
+ instance.createInstance = I18n.createInstance;
26228
+
26229
+ const createInstance = instance.createInstance;
26230
+ instance.dir;
26231
+ instance.init;
26232
+ instance.loadResources;
26233
+ instance.reloadResources;
26234
+ instance.use;
26235
+ instance.changeLanguage;
26236
+ instance.getFixedT;
26237
+ instance.t;
26238
+ instance.exists;
26239
+ instance.setDefaultNamespace;
26240
+ instance.hasLoadedNamespace;
26241
+ instance.loadNamespaces;
26242
+ instance.loadLanguages;
26243
+
23532
26244
  /*!
23533
26245
  * path-root-regex <https://github.com/jonschlinkert/path-root-regex>
23534
26246
  *
@@ -23636,7 +26348,7 @@ function requireResolvePackagePath () {
23636
26348
  // credit goes to https://github.com/davecombs
23637
26349
  // extracted in part from: https://github.com/stefanpenner/hash-for-dep/blob/15b2ebcf22024ceb2eb7907f8c412ae40f87b15e/lib/resolve-package-path.js#L1
23638
26350
  //
23639
- const fs = require$$0;
26351
+ const fs = require$$0$1;
23640
26352
  const path = sysPath;
23641
26353
  const pathRoot = requirePathRoot();
23642
26354
  const rethrow_unless_code_1 = __importDefault(requireRethrowUnlessCode());
@@ -24094,7 +26806,7 @@ function getPackageNameFromPath(input) {
24094
26806
 
24095
26807
  // src/importer.js
24096
26808
  var { findUpPackagePath } = resolvePackagePath;
24097
- var require2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vendor-BxO3IPg6.js', document.baseURI).href)));
26809
+ var require2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vendor-y4sQkzVC.js', document.baseURI).href)));
24098
26810
  var WEBPACK_NODE_MODULE_PREFIX = "~";
24099
26811
  var selfPackageJson = null;
24100
26812
  var selfPackageJsonPath = null;
@@ -24263,7 +26975,7 @@ var hasRequiredTerminal;
24263
26975
  function requireTerminal () {
24264
26976
  if (hasRequiredTerminal) return terminal;
24265
26977
  hasRequiredTerminal = 1;
24266
- const _readline = require$$0$4;
26978
+ const _readline = require$$0$5;
24267
26979
 
24268
26980
  // low-level terminal interactions
24269
26981
  class Terminal{
@@ -24766,11 +27478,11 @@ function requireFormatter () {
24766
27478
  return formatter;
24767
27479
  }
24768
27480
 
24769
- var options;
27481
+ var options$1;
24770
27482
  var hasRequiredOptions;
24771
27483
 
24772
27484
  function requireOptions () {
24773
- if (hasRequiredOptions) return options;
27485
+ if (hasRequiredOptions) return options$1;
24774
27486
  hasRequiredOptions = 1;
24775
27487
  // utility to merge defaults
24776
27488
  function mergeOption(v, defaultValue){
@@ -24781,7 +27493,7 @@ function requireOptions () {
24781
27493
  }
24782
27494
  }
24783
27495
 
24784
- options = {
27496
+ options$1 = {
24785
27497
  // set global options
24786
27498
  parse: function parse(rawOptions, preset){
24787
27499
 
@@ -24882,7 +27594,7 @@ function requireOptions () {
24882
27594
  return options;
24883
27595
  }
24884
27596
  };
24885
- return options;
27597
+ return options$1;
24886
27598
  }
24887
27599
 
24888
27600
  var genericBar;
@@ -43526,7 +46238,7 @@ const normalizeFilter = (filter) => {
43526
46238
  }
43527
46239
  return emptyFn;
43528
46240
  };
43529
- class ReaddirpStream extends require$$0$3.Readable {
46241
+ class ReaddirpStream extends require$$0$4.Readable {
43530
46242
  constructor(options = {}) {
43531
46243
  super({
43532
46244
  objectMode: true,
@@ -43722,7 +46434,7 @@ const isWindows = pl === 'win32';
43722
46434
  const isMacos = pl === 'darwin';
43723
46435
  const isLinux = pl === 'linux';
43724
46436
  const isFreeBSD = pl === 'freebsd';
43725
- const isIBMi = require$$0$5.type() === 'OS400';
46437
+ const isIBMi = require$$0$6.type() === 'OS400';
43726
46438
  const EVENTS = {
43727
46439
  ALL: 'all',
43728
46440
  READY: 'ready',
@@ -43833,7 +46545,7 @@ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
43833
46545
  }
43834
46546
  };
43835
46547
  try {
43836
- return require$$0.watch(path, {
46548
+ return require$$0$1.watch(path, {
43837
46549
  persistent: options.persistent,
43838
46550
  }, handleEvent);
43839
46551
  }
@@ -43955,7 +46667,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
43955
46667
  // doesn't seem worthwhile for the added complexity.
43956
46668
  // listeners = cont.listeners;
43957
46669
  // rawEmitters = cont.rawEmitters;
43958
- require$$0.unwatchFile(fullPath);
46670
+ require$$0$1.unwatchFile(fullPath);
43959
46671
  cont = undefined;
43960
46672
  }
43961
46673
  if (cont) {
@@ -43970,7 +46682,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
43970
46682
  listeners: listener,
43971
46683
  rawEmitters: rawEmitter,
43972
46684
  options,
43973
- watcher: require$$0.watchFile(fullPath, options, (curr, prev) => {
46685
+ watcher: require$$0$1.watchFile(fullPath, options, (curr, prev) => {
43974
46686
  foreach(cont.rawEmitters, (rawEmitter) => {
43975
46687
  rawEmitter(EV.CHANGE, fullPath, { curr, prev });
43976
46688
  });
@@ -43990,7 +46702,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
43990
46702
  delFromSet(cont, KEY_RAW, rawEmitter);
43991
46703
  if (isEmptySet(cont.listeners)) {
43992
46704
  FsWatchFileInstances.delete(fullPath);
43993
- require$$0.unwatchFile(fullPath);
46705
+ require$$0$1.unwatchFile(fullPath);
43994
46706
  cont.options = cont.watcher = undefined;
43995
46707
  Object.freeze(cont);
43996
46708
  }
@@ -44927,7 +47639,7 @@ class FSWatcher extends require$$3.EventEmitter {
44927
47639
  const now = new Date();
44928
47640
  const writes = this._pendingWrites;
44929
47641
  function awaitWriteFinishFn(prevStat) {
44930
- require$$0.stat(fullPath, (err, curStat) => {
47642
+ require$$0$1.stat(fullPath, (err, curStat) => {
44931
47643
  if (err || !writes.has(path)) {
44932
47644
  if (err && err.code !== 'ENOENT')
44933
47645
  awfEmit(err);
@@ -45146,7 +47858,7 @@ function requireSafeBuffer () {
45146
47858
  hasRequiredSafeBuffer = 1;
45147
47859
  (function (module, exports) {
45148
47860
  /* eslint-disable node/no-deprecated-api */
45149
- var buffer = require$$0$6;
47861
+ var buffer = require$$0$7;
45150
47862
  var Buffer = buffer.Buffer;
45151
47863
 
45152
47864
  // alternative to using Object.keys for old browsers
@@ -45264,7 +47976,7 @@ function requireStreams () {
45264
47976
  **/
45265
47977
 
45266
47978
 
45267
- var Stream = require$$0$3.Stream,
47979
+ var Stream = require$$0$4.Stream,
45268
47980
  util = require$$1$1;
45269
47981
 
45270
47982
 
@@ -47476,7 +50188,7 @@ function requireProxy () {
47476
50188
  hasRequiredProxy = 1;
47477
50189
 
47478
50190
  var Buffer = requireSafeBuffer().Buffer,
47479
- Stream = require$$0$3.Stream,
50191
+ Stream = require$$0$4.Stream,
47480
50192
  url = require$$2,
47481
50193
  util = require$$1$1,
47482
50194
  Base = requireBase(),
@@ -48227,7 +50939,7 @@ function requireApi () {
48227
50939
  if (hasRequiredApi) return api;
48228
50940
  hasRequiredApi = 1;
48229
50941
 
48230
- var Stream = require$$0$3.Stream,
50942
+ var Stream = require$$0$4.Stream,
48231
50943
  util = require$$1$1,
48232
50944
  driver = requireDriver(),
48233
50945
  EventTarget = requireEvent_target(),
@@ -48532,7 +51244,7 @@ function requireEventsource () {
48532
51244
  if (hasRequiredEventsource) return eventsource;
48533
51245
  hasRequiredEventsource = 1;
48534
51246
 
48535
- var Stream = require$$0$3.Stream,
51247
+ var Stream = require$$0$4.Stream,
48536
51248
  util = require$$1$1,
48537
51249
  driver = requireDriver(),
48538
51250
  Headers = requireHeaders(),
@@ -49456,7 +52168,7 @@ var hasRequiredSupportsColor;
49456
52168
  function requireSupportsColor () {
49457
52169
  if (hasRequiredSupportsColor) return supportsColor_1;
49458
52170
  hasRequiredSupportsColor = 1;
49459
- const os = require$$0$5;
52171
+ const os = require$$0$6;
49460
52172
  const tty = require$$1$4;
49461
52173
  const hasFlag = requireHasFlag();
49462
52174
 
@@ -50322,7 +53034,7 @@ function requireString_decoder () {
50322
53034
  // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
50323
53035
  // USE OR OTHER DEALINGS IN THE SOFTWARE.
50324
53036
 
50325
- var Buffer = require$$0$6.Buffer;
53037
+ var Buffer = require$$0$7.Buffer;
50326
53038
 
50327
53039
  var isBufferEncoding = Buffer.isEncoding
50328
53040
  || function(encoding) {
@@ -50823,7 +53535,7 @@ var hasRequiredForm;
50823
53535
  function requireForm () {
50824
53536
  if (hasRequiredForm) return form;
50825
53537
  hasRequiredForm = 1;
50826
- var querystringParse = require$$0$7.parse;
53538
+ var querystringParse = require$$0$8.parse;
50827
53539
 
50828
53540
  var body = requireBody();
50829
53541
  var parseArguments = requireParseArguments();
@@ -53891,7 +56603,7 @@ function requireServer () {
53891
56603
 
53892
56604
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
53893
56605
 
53894
- var _fs = require$$0;
56606
+ var _fs = require$$0$1;
53895
56607
 
53896
56608
  var _fs2 = _interopRequireDefault(_fs);
53897
56609
 
@@ -54360,6 +57072,7 @@ exports.HighlightJS = HighlightJS;
54360
57072
  exports.MarkdownIt = MarkdownIt;
54361
57073
  exports.cliProgress = cliProgress;
54362
57074
  exports.closest = closest;
57075
+ exports.createInstance = createInstance;
54363
57076
  exports.createTwoFilesPatch = createTwoFilesPatch;
54364
57077
  exports.dedent = dedent;
54365
57078
  exports.deflist_plugin = deflist_plugin;
@@ -54368,9 +57081,10 @@ exports.fm = fm;
54368
57081
  exports.fse = fse;
54369
57082
  exports.glob = glob;
54370
57083
  exports.globSync = globSync;
57084
+ exports.isCI = isCI;
54371
57085
  exports.minimatch = minimatch;
54372
57086
  exports.moduleImporter = moduleImporter;
54373
57087
  exports.spawn = spawn;
54374
57088
  exports.tinylr = tinylr;
54375
57089
  exports.watch = watch$1;
54376
- //# sourceMappingURL=vendor-BxO3IPg6.js.map
57090
+ //# sourceMappingURL=vendor-y4sQkzVC.js.map