coc-pyright 1.1.220 → 1.1.229

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
7
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
8
  var __getProtoOf = Object.getPrototypeOf;
@@ -18,6 +20,7 @@ var __spreadValues = (a, b) => {
18
20
  }
19
21
  return a;
20
22
  };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
24
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
22
25
  var __commonJS = (cb, mod) => function __require() {
23
26
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
@@ -3444,6 +3447,22 @@ var require_mkdirs = __commonJS({
3444
3447
  }
3445
3448
  });
3446
3449
 
3450
+ // node_modules/fs-extra/lib/path-exists/index.js
3451
+ var require_path_exists = __commonJS({
3452
+ "node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
3453
+ "use strict";
3454
+ var u = require_universalify().fromPromise;
3455
+ var fs6 = require_fs();
3456
+ function pathExists(path10) {
3457
+ return fs6.access(path10).then(() => true).catch(() => false);
3458
+ }
3459
+ module2.exports = {
3460
+ pathExists: u(pathExists),
3461
+ pathExistsSync: fs6.existsSync
3462
+ };
3463
+ }
3464
+ });
3465
+
3447
3466
  // node_modules/fs-extra/lib/util/utimes.js
3448
3467
  var require_utimes = __commonJS({
3449
3468
  "node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
@@ -3611,177 +3630,6 @@ var require_stat = __commonJS({
3611
3630
  }
3612
3631
  });
3613
3632
 
3614
- // node_modules/fs-extra/lib/copy-sync/copy-sync.js
3615
- var require_copy_sync = __commonJS({
3616
- "node_modules/fs-extra/lib/copy-sync/copy-sync.js"(exports, module2) {
3617
- "use strict";
3618
- var fs6 = require_graceful_fs();
3619
- var path10 = require("path");
3620
- var mkdirsSync = require_mkdirs().mkdirsSync;
3621
- var utimesMillisSync = require_utimes().utimesMillisSync;
3622
- var stat = require_stat();
3623
- function copySync(src, dest, opts) {
3624
- if (typeof opts === "function") {
3625
- opts = { filter: opts };
3626
- }
3627
- opts = opts || {};
3628
- opts.clobber = "clobber" in opts ? !!opts.clobber : true;
3629
- opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
3630
- if (opts.preserveTimestamps && process.arch === "ia32") {
3631
- console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
3632
-
3633
- see https://github.com/jprichardson/node-fs-extra/issues/269`);
3634
- }
3635
- const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
3636
- stat.checkParentPathsSync(src, srcStat, dest, "copy");
3637
- return handleFilterAndCopy(destStat, src, dest, opts);
3638
- }
3639
- function handleFilterAndCopy(destStat, src, dest, opts) {
3640
- if (opts.filter && !opts.filter(src, dest))
3641
- return;
3642
- const destParent = path10.dirname(dest);
3643
- if (!fs6.existsSync(destParent))
3644
- mkdirsSync(destParent);
3645
- return getStats(destStat, src, dest, opts);
3646
- }
3647
- function startCopy(destStat, src, dest, opts) {
3648
- if (opts.filter && !opts.filter(src, dest))
3649
- return;
3650
- return getStats(destStat, src, dest, opts);
3651
- }
3652
- function getStats(destStat, src, dest, opts) {
3653
- const statSync = opts.dereference ? fs6.statSync : fs6.lstatSync;
3654
- const srcStat = statSync(src);
3655
- if (srcStat.isDirectory())
3656
- return onDir(srcStat, destStat, src, dest, opts);
3657
- else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
3658
- return onFile(srcStat, destStat, src, dest, opts);
3659
- else if (srcStat.isSymbolicLink())
3660
- return onLink(destStat, src, dest, opts);
3661
- else if (srcStat.isSocket())
3662
- throw new Error(`Cannot copy a socket file: ${src}`);
3663
- else if (srcStat.isFIFO())
3664
- throw new Error(`Cannot copy a FIFO pipe: ${src}`);
3665
- throw new Error(`Unknown file: ${src}`);
3666
- }
3667
- function onFile(srcStat, destStat, src, dest, opts) {
3668
- if (!destStat)
3669
- return copyFile(srcStat, src, dest, opts);
3670
- return mayCopyFile(srcStat, src, dest, opts);
3671
- }
3672
- function mayCopyFile(srcStat, src, dest, opts) {
3673
- if (opts.overwrite) {
3674
- fs6.unlinkSync(dest);
3675
- return copyFile(srcStat, src, dest, opts);
3676
- } else if (opts.errorOnExist) {
3677
- throw new Error(`'${dest}' already exists`);
3678
- }
3679
- }
3680
- function copyFile(srcStat, src, dest, opts) {
3681
- fs6.copyFileSync(src, dest);
3682
- if (opts.preserveTimestamps)
3683
- handleTimestamps(srcStat.mode, src, dest);
3684
- return setDestMode(dest, srcStat.mode);
3685
- }
3686
- function handleTimestamps(srcMode, src, dest) {
3687
- if (fileIsNotWritable(srcMode))
3688
- makeFileWritable(dest, srcMode);
3689
- return setDestTimestamps(src, dest);
3690
- }
3691
- function fileIsNotWritable(srcMode) {
3692
- return (srcMode & 128) === 0;
3693
- }
3694
- function makeFileWritable(dest, srcMode) {
3695
- return setDestMode(dest, srcMode | 128);
3696
- }
3697
- function setDestMode(dest, srcMode) {
3698
- return fs6.chmodSync(dest, srcMode);
3699
- }
3700
- function setDestTimestamps(src, dest) {
3701
- const updatedSrcStat = fs6.statSync(src);
3702
- return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
3703
- }
3704
- function onDir(srcStat, destStat, src, dest, opts) {
3705
- if (!destStat)
3706
- return mkDirAndCopy(srcStat.mode, src, dest, opts);
3707
- return copyDir(src, dest, opts);
3708
- }
3709
- function mkDirAndCopy(srcMode, src, dest, opts) {
3710
- fs6.mkdirSync(dest);
3711
- copyDir(src, dest, opts);
3712
- return setDestMode(dest, srcMode);
3713
- }
3714
- function copyDir(src, dest, opts) {
3715
- fs6.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
3716
- }
3717
- function copyDirItem(item, src, dest, opts) {
3718
- const srcItem = path10.join(src, item);
3719
- const destItem = path10.join(dest, item);
3720
- const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
3721
- return startCopy(destStat, srcItem, destItem, opts);
3722
- }
3723
- function onLink(destStat, src, dest, opts) {
3724
- let resolvedSrc = fs6.readlinkSync(src);
3725
- if (opts.dereference) {
3726
- resolvedSrc = path10.resolve(process.cwd(), resolvedSrc);
3727
- }
3728
- if (!destStat) {
3729
- return fs6.symlinkSync(resolvedSrc, dest);
3730
- } else {
3731
- let resolvedDest;
3732
- try {
3733
- resolvedDest = fs6.readlinkSync(dest);
3734
- } catch (err) {
3735
- if (err.code === "EINVAL" || err.code === "UNKNOWN")
3736
- return fs6.symlinkSync(resolvedSrc, dest);
3737
- throw err;
3738
- }
3739
- if (opts.dereference) {
3740
- resolvedDest = path10.resolve(process.cwd(), resolvedDest);
3741
- }
3742
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
3743
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
3744
- }
3745
- if (fs6.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
3746
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
3747
- }
3748
- return copyLink(resolvedSrc, dest);
3749
- }
3750
- }
3751
- function copyLink(resolvedSrc, dest) {
3752
- fs6.unlinkSync(dest);
3753
- return fs6.symlinkSync(resolvedSrc, dest);
3754
- }
3755
- module2.exports = copySync;
3756
- }
3757
- });
3758
-
3759
- // node_modules/fs-extra/lib/copy-sync/index.js
3760
- var require_copy_sync2 = __commonJS({
3761
- "node_modules/fs-extra/lib/copy-sync/index.js"(exports, module2) {
3762
- "use strict";
3763
- module2.exports = {
3764
- copySync: require_copy_sync()
3765
- };
3766
- }
3767
- });
3768
-
3769
- // node_modules/fs-extra/lib/path-exists/index.js
3770
- var require_path_exists = __commonJS({
3771
- "node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
3772
- "use strict";
3773
- var u = require_universalify().fromPromise;
3774
- var fs6 = require_fs();
3775
- function pathExists(path10) {
3776
- return fs6.access(path10).then(() => true).catch(() => false);
3777
- }
3778
- module2.exports = {
3779
- pathExists: u(pathExists),
3780
- pathExistsSync: fs6.existsSync
3781
- };
3782
- }
3783
- });
3784
-
3785
3633
  // node_modules/fs-extra/lib/copy/copy.js
3786
3634
  var require_copy = __commonJS({
3787
3635
  "node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
@@ -4009,13 +3857,159 @@ var require_copy = __commonJS({
4009
3857
  }
4010
3858
  });
4011
3859
 
3860
+ // node_modules/fs-extra/lib/copy/copy-sync.js
3861
+ var require_copy_sync = __commonJS({
3862
+ "node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
3863
+ "use strict";
3864
+ var fs6 = require_graceful_fs();
3865
+ var path10 = require("path");
3866
+ var mkdirsSync = require_mkdirs().mkdirsSync;
3867
+ var utimesMillisSync = require_utimes().utimesMillisSync;
3868
+ var stat = require_stat();
3869
+ function copySync(src, dest, opts) {
3870
+ if (typeof opts === "function") {
3871
+ opts = { filter: opts };
3872
+ }
3873
+ opts = opts || {};
3874
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
3875
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
3876
+ if (opts.preserveTimestamps && process.arch === "ia32") {
3877
+ console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
3878
+
3879
+ see https://github.com/jprichardson/node-fs-extra/issues/269`);
3880
+ }
3881
+ const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
3882
+ stat.checkParentPathsSync(src, srcStat, dest, "copy");
3883
+ return handleFilterAndCopy(destStat, src, dest, opts);
3884
+ }
3885
+ function handleFilterAndCopy(destStat, src, dest, opts) {
3886
+ if (opts.filter && !opts.filter(src, dest))
3887
+ return;
3888
+ const destParent = path10.dirname(dest);
3889
+ if (!fs6.existsSync(destParent))
3890
+ mkdirsSync(destParent);
3891
+ return getStats(destStat, src, dest, opts);
3892
+ }
3893
+ function startCopy(destStat, src, dest, opts) {
3894
+ if (opts.filter && !opts.filter(src, dest))
3895
+ return;
3896
+ return getStats(destStat, src, dest, opts);
3897
+ }
3898
+ function getStats(destStat, src, dest, opts) {
3899
+ const statSync = opts.dereference ? fs6.statSync : fs6.lstatSync;
3900
+ const srcStat = statSync(src);
3901
+ if (srcStat.isDirectory())
3902
+ return onDir(srcStat, destStat, src, dest, opts);
3903
+ else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
3904
+ return onFile(srcStat, destStat, src, dest, opts);
3905
+ else if (srcStat.isSymbolicLink())
3906
+ return onLink(destStat, src, dest, opts);
3907
+ else if (srcStat.isSocket())
3908
+ throw new Error(`Cannot copy a socket file: ${src}`);
3909
+ else if (srcStat.isFIFO())
3910
+ throw new Error(`Cannot copy a FIFO pipe: ${src}`);
3911
+ throw new Error(`Unknown file: ${src}`);
3912
+ }
3913
+ function onFile(srcStat, destStat, src, dest, opts) {
3914
+ if (!destStat)
3915
+ return copyFile(srcStat, src, dest, opts);
3916
+ return mayCopyFile(srcStat, src, dest, opts);
3917
+ }
3918
+ function mayCopyFile(srcStat, src, dest, opts) {
3919
+ if (opts.overwrite) {
3920
+ fs6.unlinkSync(dest);
3921
+ return copyFile(srcStat, src, dest, opts);
3922
+ } else if (opts.errorOnExist) {
3923
+ throw new Error(`'${dest}' already exists`);
3924
+ }
3925
+ }
3926
+ function copyFile(srcStat, src, dest, opts) {
3927
+ fs6.copyFileSync(src, dest);
3928
+ if (opts.preserveTimestamps)
3929
+ handleTimestamps(srcStat.mode, src, dest);
3930
+ return setDestMode(dest, srcStat.mode);
3931
+ }
3932
+ function handleTimestamps(srcMode, src, dest) {
3933
+ if (fileIsNotWritable(srcMode))
3934
+ makeFileWritable(dest, srcMode);
3935
+ return setDestTimestamps(src, dest);
3936
+ }
3937
+ function fileIsNotWritable(srcMode) {
3938
+ return (srcMode & 128) === 0;
3939
+ }
3940
+ function makeFileWritable(dest, srcMode) {
3941
+ return setDestMode(dest, srcMode | 128);
3942
+ }
3943
+ function setDestMode(dest, srcMode) {
3944
+ return fs6.chmodSync(dest, srcMode);
3945
+ }
3946
+ function setDestTimestamps(src, dest) {
3947
+ const updatedSrcStat = fs6.statSync(src);
3948
+ return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
3949
+ }
3950
+ function onDir(srcStat, destStat, src, dest, opts) {
3951
+ if (!destStat)
3952
+ return mkDirAndCopy(srcStat.mode, src, dest, opts);
3953
+ return copyDir(src, dest, opts);
3954
+ }
3955
+ function mkDirAndCopy(srcMode, src, dest, opts) {
3956
+ fs6.mkdirSync(dest);
3957
+ copyDir(src, dest, opts);
3958
+ return setDestMode(dest, srcMode);
3959
+ }
3960
+ function copyDir(src, dest, opts) {
3961
+ fs6.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
3962
+ }
3963
+ function copyDirItem(item, src, dest, opts) {
3964
+ const srcItem = path10.join(src, item);
3965
+ const destItem = path10.join(dest, item);
3966
+ const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
3967
+ return startCopy(destStat, srcItem, destItem, opts);
3968
+ }
3969
+ function onLink(destStat, src, dest, opts) {
3970
+ let resolvedSrc = fs6.readlinkSync(src);
3971
+ if (opts.dereference) {
3972
+ resolvedSrc = path10.resolve(process.cwd(), resolvedSrc);
3973
+ }
3974
+ if (!destStat) {
3975
+ return fs6.symlinkSync(resolvedSrc, dest);
3976
+ } else {
3977
+ let resolvedDest;
3978
+ try {
3979
+ resolvedDest = fs6.readlinkSync(dest);
3980
+ } catch (err) {
3981
+ if (err.code === "EINVAL" || err.code === "UNKNOWN")
3982
+ return fs6.symlinkSync(resolvedSrc, dest);
3983
+ throw err;
3984
+ }
3985
+ if (opts.dereference) {
3986
+ resolvedDest = path10.resolve(process.cwd(), resolvedDest);
3987
+ }
3988
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
3989
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
3990
+ }
3991
+ if (fs6.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
3992
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
3993
+ }
3994
+ return copyLink(resolvedSrc, dest);
3995
+ }
3996
+ }
3997
+ function copyLink(resolvedSrc, dest) {
3998
+ fs6.unlinkSync(dest);
3999
+ return fs6.symlinkSync(resolvedSrc, dest);
4000
+ }
4001
+ module2.exports = copySync;
4002
+ }
4003
+ });
4004
+
4012
4005
  // node_modules/fs-extra/lib/copy/index.js
4013
4006
  var require_copy2 = __commonJS({
4014
4007
  "node_modules/fs-extra/lib/copy/index.js"(exports, module2) {
4015
4008
  "use strict";
4016
4009
  var u = require_universalify().fromCallback;
4017
4010
  module2.exports = {
4018
- copy: u(require_copy())
4011
+ copy: u(require_copy()),
4012
+ copySync: require_copy_sync()
4019
4013
  };
4020
4014
  }
4021
4015
  });
@@ -4669,22 +4663,22 @@ var require_symlink = __commonJS({
4669
4663
  var require_ensure = __commonJS({
4670
4664
  "node_modules/fs-extra/lib/ensure/index.js"(exports, module2) {
4671
4665
  "use strict";
4672
- var file = require_file();
4673
- var link = require_link();
4674
- var symlink = require_symlink();
4666
+ var { createFile, createFileSync } = require_file();
4667
+ var { createLink, createLinkSync } = require_link();
4668
+ var { createSymlink, createSymlinkSync } = require_symlink();
4675
4669
  module2.exports = {
4676
- createFile: file.createFile,
4677
- createFileSync: file.createFileSync,
4678
- ensureFile: file.createFile,
4679
- ensureFileSync: file.createFileSync,
4680
- createLink: link.createLink,
4681
- createLinkSync: link.createLinkSync,
4682
- ensureLink: link.createLink,
4683
- ensureLinkSync: link.createLinkSync,
4684
- createSymlink: symlink.createSymlink,
4685
- createSymlinkSync: symlink.createSymlinkSync,
4686
- ensureSymlink: symlink.createSymlink,
4687
- ensureSymlinkSync: symlink.createSymlinkSync
4670
+ createFile,
4671
+ createFileSync,
4672
+ ensureFile: createFile,
4673
+ ensureFileSync: createFileSync,
4674
+ createLink,
4675
+ createLinkSync,
4676
+ ensureLink: createLink,
4677
+ ensureLinkSync: createLinkSync,
4678
+ createSymlink,
4679
+ createSymlinkSync,
4680
+ ensureSymlink: createSymlink,
4681
+ ensureSymlinkSync: createSymlinkSync
4688
4682
  };
4689
4683
  }
4690
4684
  });
@@ -4820,9 +4814,9 @@ var require_jsonfile2 = __commonJS({
4820
4814
  }
4821
4815
  });
4822
4816
 
4823
- // node_modules/fs-extra/lib/output/index.js
4824
- var require_output = __commonJS({
4825
- "node_modules/fs-extra/lib/output/index.js"(exports, module2) {
4817
+ // node_modules/fs-extra/lib/output-file/index.js
4818
+ var require_output_file = __commonJS({
4819
+ "node_modules/fs-extra/lib/output-file/index.js"(exports, module2) {
4826
4820
  "use strict";
4827
4821
  var u = require_universalify().fromCallback;
4828
4822
  var fs6 = require_graceful_fs();
@@ -4863,114 +4857,48 @@ var require_output = __commonJS({
4863
4857
  });
4864
4858
 
4865
4859
  // node_modules/fs-extra/lib/json/output-json.js
4866
- var require_output_json = __commonJS({
4867
- "node_modules/fs-extra/lib/json/output-json.js"(exports, module2) {
4868
- "use strict";
4869
- var { stringify } = require_utils2();
4870
- var { outputFile } = require_output();
4871
- async function outputJson(file, data, options = {}) {
4872
- const str = stringify(data, options);
4873
- await outputFile(file, str, options);
4874
- }
4875
- module2.exports = outputJson;
4876
- }
4877
- });
4878
-
4879
- // node_modules/fs-extra/lib/json/output-json-sync.js
4880
- var require_output_json_sync = __commonJS({
4881
- "node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
4882
- "use strict";
4883
- var { stringify } = require_utils2();
4884
- var { outputFileSync } = require_output();
4885
- function outputJsonSync(file, data, options) {
4886
- const str = stringify(data, options);
4887
- outputFileSync(file, str, options);
4888
- }
4889
- module2.exports = outputJsonSync;
4890
- }
4891
- });
4892
-
4893
- // node_modules/fs-extra/lib/json/index.js
4894
- var require_json = __commonJS({
4895
- "node_modules/fs-extra/lib/json/index.js"(exports, module2) {
4896
- "use strict";
4897
- var u = require_universalify().fromPromise;
4898
- var jsonFile = require_jsonfile2();
4899
- jsonFile.outputJson = u(require_output_json());
4900
- jsonFile.outputJsonSync = require_output_json_sync();
4901
- jsonFile.outputJSON = jsonFile.outputJson;
4902
- jsonFile.outputJSONSync = jsonFile.outputJsonSync;
4903
- jsonFile.writeJSON = jsonFile.writeJson;
4904
- jsonFile.writeJSONSync = jsonFile.writeJsonSync;
4905
- jsonFile.readJSON = jsonFile.readJson;
4906
- jsonFile.readJSONSync = jsonFile.readJsonSync;
4907
- module2.exports = jsonFile;
4908
- }
4909
- });
4910
-
4911
- // node_modules/fs-extra/lib/move-sync/move-sync.js
4912
- var require_move_sync = __commonJS({
4913
- "node_modules/fs-extra/lib/move-sync/move-sync.js"(exports, module2) {
4914
- "use strict";
4915
- var fs6 = require_graceful_fs();
4916
- var path10 = require("path");
4917
- var copySync = require_copy_sync2().copySync;
4918
- var removeSync = require_remove().removeSync;
4919
- var mkdirpSync = require_mkdirs().mkdirpSync;
4920
- var stat = require_stat();
4921
- function moveSync(src, dest, opts) {
4922
- opts = opts || {};
4923
- const overwrite = opts.overwrite || opts.clobber || false;
4924
- const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
4925
- stat.checkParentPathsSync(src, srcStat, dest, "move");
4926
- if (!isParentRoot(dest))
4927
- mkdirpSync(path10.dirname(dest));
4928
- return doRename(src, dest, overwrite, isChangingCase);
4929
- }
4930
- function isParentRoot(dest) {
4931
- const parent = path10.dirname(dest);
4932
- const parsedPath = path10.parse(parent);
4933
- return parsedPath.root === parent;
4934
- }
4935
- function doRename(src, dest, overwrite, isChangingCase) {
4936
- if (isChangingCase)
4937
- return rename(src, dest, overwrite);
4938
- if (overwrite) {
4939
- removeSync(dest);
4940
- return rename(src, dest, overwrite);
4941
- }
4942
- if (fs6.existsSync(dest))
4943
- throw new Error("dest already exists.");
4944
- return rename(src, dest, overwrite);
4945
- }
4946
- function rename(src, dest, overwrite) {
4947
- try {
4948
- fs6.renameSync(src, dest);
4949
- } catch (err) {
4950
- if (err.code !== "EXDEV")
4951
- throw err;
4952
- return moveAcrossDevice(src, dest, overwrite);
4953
- }
4860
+ var require_output_json = __commonJS({
4861
+ "node_modules/fs-extra/lib/json/output-json.js"(exports, module2) {
4862
+ "use strict";
4863
+ var { stringify } = require_utils2();
4864
+ var { outputFile } = require_output_file();
4865
+ async function outputJson(file, data, options = {}) {
4866
+ const str = stringify(data, options);
4867
+ await outputFile(file, str, options);
4954
4868
  }
4955
- function moveAcrossDevice(src, dest, overwrite) {
4956
- const opts = {
4957
- overwrite,
4958
- errorOnExist: true
4959
- };
4960
- copySync(src, dest, opts);
4961
- return removeSync(src);
4869
+ module2.exports = outputJson;
4870
+ }
4871
+ });
4872
+
4873
+ // node_modules/fs-extra/lib/json/output-json-sync.js
4874
+ var require_output_json_sync = __commonJS({
4875
+ "node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
4876
+ "use strict";
4877
+ var { stringify } = require_utils2();
4878
+ var { outputFileSync } = require_output_file();
4879
+ function outputJsonSync(file, data, options) {
4880
+ const str = stringify(data, options);
4881
+ outputFileSync(file, str, options);
4962
4882
  }
4963
- module2.exports = moveSync;
4883
+ module2.exports = outputJsonSync;
4964
4884
  }
4965
4885
  });
4966
4886
 
4967
- // node_modules/fs-extra/lib/move-sync/index.js
4968
- var require_move_sync2 = __commonJS({
4969
- "node_modules/fs-extra/lib/move-sync/index.js"(exports, module2) {
4887
+ // node_modules/fs-extra/lib/json/index.js
4888
+ var require_json = __commonJS({
4889
+ "node_modules/fs-extra/lib/json/index.js"(exports, module2) {
4970
4890
  "use strict";
4971
- module2.exports = {
4972
- moveSync: require_move_sync()
4973
- };
4891
+ var u = require_universalify().fromPromise;
4892
+ var jsonFile = require_jsonfile2();
4893
+ jsonFile.outputJson = u(require_output_json());
4894
+ jsonFile.outputJsonSync = require_output_json_sync();
4895
+ jsonFile.outputJSON = jsonFile.outputJson;
4896
+ jsonFile.outputJSONSync = jsonFile.outputJsonSync;
4897
+ jsonFile.writeJSON = jsonFile.writeJson;
4898
+ jsonFile.writeJSONSync = jsonFile.writeJsonSync;
4899
+ jsonFile.readJSON = jsonFile.readJson;
4900
+ jsonFile.readJSONSync = jsonFile.readJsonSync;
4901
+ module2.exports = jsonFile;
4974
4902
  }
4975
4903
  });
4976
4904
 
@@ -5055,13 +4983,70 @@ var require_move = __commonJS({
5055
4983
  }
5056
4984
  });
5057
4985
 
4986
+ // node_modules/fs-extra/lib/move/move-sync.js
4987
+ var require_move_sync = __commonJS({
4988
+ "node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
4989
+ "use strict";
4990
+ var fs6 = require_graceful_fs();
4991
+ var path10 = require("path");
4992
+ var copySync = require_copy2().copySync;
4993
+ var removeSync = require_remove().removeSync;
4994
+ var mkdirpSync = require_mkdirs().mkdirpSync;
4995
+ var stat = require_stat();
4996
+ function moveSync(src, dest, opts) {
4997
+ opts = opts || {};
4998
+ const overwrite = opts.overwrite || opts.clobber || false;
4999
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
5000
+ stat.checkParentPathsSync(src, srcStat, dest, "move");
5001
+ if (!isParentRoot(dest))
5002
+ mkdirpSync(path10.dirname(dest));
5003
+ return doRename(src, dest, overwrite, isChangingCase);
5004
+ }
5005
+ function isParentRoot(dest) {
5006
+ const parent = path10.dirname(dest);
5007
+ const parsedPath = path10.parse(parent);
5008
+ return parsedPath.root === parent;
5009
+ }
5010
+ function doRename(src, dest, overwrite, isChangingCase) {
5011
+ if (isChangingCase)
5012
+ return rename(src, dest, overwrite);
5013
+ if (overwrite) {
5014
+ removeSync(dest);
5015
+ return rename(src, dest, overwrite);
5016
+ }
5017
+ if (fs6.existsSync(dest))
5018
+ throw new Error("dest already exists.");
5019
+ return rename(src, dest, overwrite);
5020
+ }
5021
+ function rename(src, dest, overwrite) {
5022
+ try {
5023
+ fs6.renameSync(src, dest);
5024
+ } catch (err) {
5025
+ if (err.code !== "EXDEV")
5026
+ throw err;
5027
+ return moveAcrossDevice(src, dest, overwrite);
5028
+ }
5029
+ }
5030
+ function moveAcrossDevice(src, dest, overwrite) {
5031
+ const opts = {
5032
+ overwrite,
5033
+ errorOnExist: true
5034
+ };
5035
+ copySync(src, dest, opts);
5036
+ return removeSync(src);
5037
+ }
5038
+ module2.exports = moveSync;
5039
+ }
5040
+ });
5041
+
5058
5042
  // node_modules/fs-extra/lib/move/index.js
5059
5043
  var require_move2 = __commonJS({
5060
5044
  "node_modules/fs-extra/lib/move/index.js"(exports, module2) {
5061
5045
  "use strict";
5062
5046
  var u = require_universalify().fromCallback;
5063
5047
  module2.exports = {
5064
- move: u(require_move())
5048
+ move: u(require_move()),
5049
+ moveSync: require_move_sync()
5065
5050
  };
5066
5051
  }
5067
5052
  });
@@ -5070,7 +5055,7 @@ var require_move2 = __commonJS({
5070
5055
  var require_lib = __commonJS({
5071
5056
  "node_modules/fs-extra/lib/index.js"(exports, module2) {
5072
5057
  "use strict";
5073
- module2.exports = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, require_fs()), require_copy_sync2()), require_copy2()), require_empty()), require_ensure()), require_json()), require_mkdirs()), require_move_sync2()), require_move2()), require_output()), require_path_exists()), require_remove());
5058
+ module2.exports = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, require_fs()), require_copy2()), require_empty()), require_ensure()), require_json()), require_mkdirs()), require_move2()), require_output_file()), require_path_exists()), require_remove());
5074
5059
  }
5075
5060
  });
5076
5061
 
@@ -5078,8 +5063,8 @@ var require_lib = __commonJS({
5078
5063
  var require_untildify = __commonJS({
5079
5064
  "node_modules/untildify/index.js"(exports, module2) {
5080
5065
  "use strict";
5081
- var os = require("os");
5082
- var homeDirectory = os.homedir();
5066
+ var os2 = require("os");
5067
+ var homeDirectory = os2.homedir();
5083
5068
  module2.exports = (pathWithTilde) => {
5084
5069
  if (typeof pathWithTilde !== "string") {
5085
5070
  throw new TypeError(`Expected a string, got ${typeof pathWithTilde}`);
@@ -10735,32 +10720,6 @@ var require_Subscriber = __commonJS({
10735
10720
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10736
10721
  };
10737
10722
  }();
10738
- var __read = exports && exports.__read || function(o, n) {
10739
- var m = typeof Symbol === "function" && o[Symbol.iterator];
10740
- if (!m)
10741
- return o;
10742
- var i = m.call(o), r, ar = [], e;
10743
- try {
10744
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
10745
- ar.push(r.value);
10746
- } catch (error) {
10747
- e = { error };
10748
- } finally {
10749
- try {
10750
- if (r && !r.done && (m = i["return"]))
10751
- m.call(i);
10752
- } finally {
10753
- if (e)
10754
- throw e.error;
10755
- }
10756
- }
10757
- return ar;
10758
- };
10759
- var __spreadArray = exports && exports.__spreadArray || function(to, from) {
10760
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
10761
- to[j] = from[i];
10762
- return to;
10763
- };
10764
10723
  Object.defineProperty(exports, "__esModule", { value: true });
10765
10724
  exports.EMPTY_OBSERVER = exports.SafeSubscriber = exports.Subscriber = void 0;
10766
10725
  var isFunction_1 = require_isFunction();
@@ -10839,54 +10798,87 @@ var require_Subscriber = __commonJS({
10839
10798
  return Subscriber2;
10840
10799
  }(Subscription_1.Subscription);
10841
10800
  exports.Subscriber = Subscriber;
10801
+ var _bind = Function.prototype.bind;
10802
+ function bind(fn, thisArg) {
10803
+ return _bind.call(fn, thisArg);
10804
+ }
10805
+ var ConsumerObserver = function() {
10806
+ function ConsumerObserver2(partialObserver) {
10807
+ this.partialObserver = partialObserver;
10808
+ }
10809
+ ConsumerObserver2.prototype.next = function(value) {
10810
+ var partialObserver = this.partialObserver;
10811
+ if (partialObserver.next) {
10812
+ try {
10813
+ partialObserver.next(value);
10814
+ } catch (error) {
10815
+ handleUnhandledError(error);
10816
+ }
10817
+ }
10818
+ };
10819
+ ConsumerObserver2.prototype.error = function(err) {
10820
+ var partialObserver = this.partialObserver;
10821
+ if (partialObserver.error) {
10822
+ try {
10823
+ partialObserver.error(err);
10824
+ } catch (error) {
10825
+ handleUnhandledError(error);
10826
+ }
10827
+ } else {
10828
+ handleUnhandledError(err);
10829
+ }
10830
+ };
10831
+ ConsumerObserver2.prototype.complete = function() {
10832
+ var partialObserver = this.partialObserver;
10833
+ if (partialObserver.complete) {
10834
+ try {
10835
+ partialObserver.complete();
10836
+ } catch (error) {
10837
+ handleUnhandledError(error);
10838
+ }
10839
+ }
10840
+ };
10841
+ return ConsumerObserver2;
10842
+ }();
10842
10843
  var SafeSubscriber = function(_super) {
10843
10844
  __extends(SafeSubscriber2, _super);
10844
10845
  function SafeSubscriber2(observerOrNext, error, complete) {
10845
10846
  var _this = _super.call(this) || this;
10846
- var next;
10847
- if (isFunction_1.isFunction(observerOrNext)) {
10848
- next = observerOrNext;
10849
- } else if (observerOrNext) {
10850
- next = observerOrNext.next, error = observerOrNext.error, complete = observerOrNext.complete;
10847
+ var partialObserver;
10848
+ if (isFunction_1.isFunction(observerOrNext) || !observerOrNext) {
10849
+ partialObserver = {
10850
+ next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : void 0,
10851
+ error: error !== null && error !== void 0 ? error : void 0,
10852
+ complete: complete !== null && complete !== void 0 ? complete : void 0
10853
+ };
10854
+ } else {
10851
10855
  var context_1;
10852
10856
  if (_this && config_1.config.useDeprecatedNextContext) {
10853
10857
  context_1 = Object.create(observerOrNext);
10854
10858
  context_1.unsubscribe = function() {
10855
10859
  return _this.unsubscribe();
10856
10860
  };
10861
+ partialObserver = {
10862
+ next: observerOrNext.next && bind(observerOrNext.next, context_1),
10863
+ error: observerOrNext.error && bind(observerOrNext.error, context_1),
10864
+ complete: observerOrNext.complete && bind(observerOrNext.complete, context_1)
10865
+ };
10857
10866
  } else {
10858
- context_1 = observerOrNext;
10867
+ partialObserver = observerOrNext;
10859
10868
  }
10860
- next = next === null || next === void 0 ? void 0 : next.bind(context_1);
10861
- error = error === null || error === void 0 ? void 0 : error.bind(context_1);
10862
- complete = complete === null || complete === void 0 ? void 0 : complete.bind(context_1);
10863
10869
  }
10864
- _this.destination = {
10865
- next: next ? wrapForErrorHandling(next, _this) : noop_1.noop,
10866
- error: wrapForErrorHandling(error !== null && error !== void 0 ? error : defaultErrorHandler, _this),
10867
- complete: complete ? wrapForErrorHandling(complete, _this) : noop_1.noop
10868
- };
10870
+ _this.destination = new ConsumerObserver(partialObserver);
10869
10871
  return _this;
10870
10872
  }
10871
10873
  return SafeSubscriber2;
10872
10874
  }(Subscriber);
10873
10875
  exports.SafeSubscriber = SafeSubscriber;
10874
- function wrapForErrorHandling(handler, instance) {
10875
- return function() {
10876
- var args = [];
10877
- for (var _i = 0; _i < arguments.length; _i++) {
10878
- args[_i] = arguments[_i];
10879
- }
10880
- try {
10881
- handler.apply(void 0, __spreadArray([], __read(args)));
10882
- } catch (err) {
10883
- if (config_1.config.useDeprecatedSynchronousErrorHandling) {
10884
- errorContext_1.captureError(err);
10885
- } else {
10886
- reportUnhandledError_1.reportUnhandledError(err);
10887
- }
10888
- }
10889
- };
10876
+ function handleUnhandledError(error) {
10877
+ if (config_1.config.useDeprecatedSynchronousErrorHandling) {
10878
+ errorContext_1.captureError(error);
10879
+ } else {
10880
+ reportUnhandledError_1.reportUnhandledError(error);
10881
+ }
10890
10882
  }
10891
10883
  function defaultErrorHandler(err) {
10892
10884
  throw err;
@@ -11125,13 +11117,18 @@ var require_OperatorSubscriber = __commonJS({
11125
11117
  };
11126
11118
  }();
11127
11119
  Object.defineProperty(exports, "__esModule", { value: true });
11128
- exports.OperatorSubscriber = void 0;
11120
+ exports.OperatorSubscriber = exports.createOperatorSubscriber = void 0;
11129
11121
  var Subscriber_1 = require_Subscriber();
11122
+ function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
11123
+ return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
11124
+ }
11125
+ exports.createOperatorSubscriber = createOperatorSubscriber;
11130
11126
  var OperatorSubscriber = function(_super) {
11131
11127
  __extends(OperatorSubscriber2, _super);
11132
- function OperatorSubscriber2(destination, onNext, onComplete, onError, onFinalize) {
11128
+ function OperatorSubscriber2(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
11133
11129
  var _this = _super.call(this, destination) || this;
11134
11130
  _this.onFinalize = onFinalize;
11131
+ _this.shouldUnsubscribe = shouldUnsubscribe;
11135
11132
  _this._next = onNext ? function(value) {
11136
11133
  try {
11137
11134
  onNext(value);
@@ -11161,9 +11158,11 @@ var require_OperatorSubscriber = __commonJS({
11161
11158
  }
11162
11159
  OperatorSubscriber2.prototype.unsubscribe = function() {
11163
11160
  var _a;
11164
- var closed = this.closed;
11165
- _super.prototype.unsubscribe.call(this);
11166
- !closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
11161
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
11162
+ var closed_1 = this.closed;
11163
+ _super.prototype.unsubscribe.call(this);
11164
+ !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
11165
+ }
11167
11166
  };
11168
11167
  return OperatorSubscriber2;
11169
11168
  }(Subscriber_1.Subscriber);
@@ -11183,7 +11182,7 @@ var require_refCount = __commonJS({
11183
11182
  return lift_1.operate(function(source, subscriber) {
11184
11183
  var connection = null;
11185
11184
  source._refCount++;
11186
- var refCounter = new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, void 0, void 0, function() {
11185
+ var refCounter = OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, void 0, void 0, function() {
11187
11186
  if (!source || source._refCount <= 0 || 0 < --source._refCount) {
11188
11187
  connection = null;
11189
11188
  return;
@@ -11274,7 +11273,7 @@ var require_ConnectableObservable = __commonJS({
11274
11273
  if (!connection) {
11275
11274
  connection = this._connection = new Subscription_1.Subscription();
11276
11275
  var subject_1 = this.getSubject();
11277
- connection.add(this.source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subject_1, void 0, function() {
11276
+ connection.add(this.source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subject_1, void 0, function() {
11278
11277
  _this._teardown();
11279
11278
  subject_1.complete();
11280
11279
  }, function(err) {
@@ -13514,7 +13513,7 @@ var require_observeOn = __commonJS({
13514
13513
  delay = 0;
13515
13514
  }
13516
13515
  return lift_1.operate(function(source, subscriber) {
13517
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
13516
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
13518
13517
  return executeSchedule_1.executeSchedule(subscriber, scheduler, function() {
13519
13518
  return subscriber.next(value);
13520
13519
  }, delay);
@@ -14082,7 +14081,7 @@ var require_timeout = __commonJS({
14082
14081
  }
14083
14082
  }, delay);
14084
14083
  };
14085
- originalSourceSubscription = source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
14084
+ originalSourceSubscription = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
14086
14085
  timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();
14087
14086
  seen++;
14088
14087
  subscriber.next(lastValue = value);
@@ -14114,7 +14113,7 @@ var require_map = __commonJS({
14114
14113
  function map(project, thisArg) {
14115
14114
  return lift_1.operate(function(source, subscriber) {
14116
14115
  var index = 0;
14117
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
14116
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
14118
14117
  subscriber.next(project.call(thisArg, value, index++));
14119
14118
  }));
14120
14119
  });
@@ -14401,7 +14400,7 @@ var require_combineLatest = __commonJS({
14401
14400
  maybeSchedule(scheduler, function() {
14402
14401
  var source = from_1.from(observables[i2], scheduler);
14403
14402
  var hasFirstValue = false;
14404
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
14403
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
14405
14404
  values[i2] = value;
14406
14405
  if (!hasFirstValue) {
14407
14406
  hasFirstValue = true;
@@ -14460,7 +14459,7 @@ var require_mergeInternals = __commonJS({
14460
14459
  expand && subscriber.next(value);
14461
14460
  active++;
14462
14461
  var innerComplete = false;
14463
- innerFrom_1.innerFrom(project(value, index++)).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(innerValue) {
14462
+ innerFrom_1.innerFrom(project(value, index++)).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(innerValue) {
14464
14463
  onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);
14465
14464
  if (expand) {
14466
14465
  outerNext(innerValue);
@@ -14493,7 +14492,7 @@ var require_mergeInternals = __commonJS({
14493
14492
  }
14494
14493
  }));
14495
14494
  };
14496
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, outerNext, function() {
14495
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, outerNext, function() {
14497
14496
  isComplete = true;
14498
14497
  checkComplete();
14499
14498
  }));
@@ -14681,7 +14680,7 @@ var require_forkJoin = __commonJS({
14681
14680
  var remainingEmissions = length;
14682
14681
  var _loop_1 = function(sourceIndex2) {
14683
14682
  var hasValue = false;
14684
- innerFrom_1.innerFrom(sources2[sourceIndex2]).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
14683
+ innerFrom_1.innerFrom(sources2[sourceIndex2]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
14685
14684
  if (!hasValue) {
14686
14685
  hasValue = true;
14687
14686
  remainingEmissions--;
@@ -15034,7 +15033,7 @@ var require_interval = __commonJS({
15034
15033
  exports.interval = void 0;
15035
15034
  var async_1 = require_async();
15036
15035
  var timer_1 = require_timer();
15037
- function interval(period, scheduler) {
15036
+ function interval2(period, scheduler) {
15038
15037
  if (period === void 0) {
15039
15038
  period = 0;
15040
15039
  }
@@ -15046,7 +15045,7 @@ var require_interval = __commonJS({
15046
15045
  }
15047
15046
  return timer_1.timer(period, period, scheduler);
15048
15047
  }
15049
- exports.interval = interval;
15048
+ exports.interval = interval2;
15050
15049
  }
15051
15050
  });
15052
15051
 
@@ -15160,8 +15159,8 @@ var require_onErrorResumeNext = __commonJS({
15160
15159
  subscribeNext();
15161
15160
  return;
15162
15161
  }
15163
- var innerSub = new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, noop_1.noop, noop_1.noop);
15164
- subscriber.add(nextSource.subscribe(innerSub));
15162
+ var innerSub = OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, noop_1.noop, noop_1.noop);
15163
+ nextSource.subscribe(innerSub);
15165
15164
  innerSub.add(subscribeNext);
15166
15165
  } else {
15167
15166
  subscriber.complete();
@@ -15235,7 +15234,7 @@ var require_filter = __commonJS({
15235
15234
  function filter(predicate, thisArg) {
15236
15235
  return lift_1.operate(function(source, subscriber) {
15237
15236
  var index = 0;
15238
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15237
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15239
15238
  return predicate.call(thisArg, value, index++) && subscriber.next(value);
15240
15239
  }));
15241
15240
  });
@@ -15283,7 +15282,7 @@ var require_race = __commonJS({
15283
15282
  return function(subscriber) {
15284
15283
  var subscriptions = [];
15285
15284
  var _loop_1 = function(i2) {
15286
- subscriptions.push(innerFrom_1.innerFrom(sources2[i2]).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15285
+ subscriptions.push(innerFrom_1.innerFrom(sources2[i2]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15287
15286
  if (subscriptions) {
15288
15287
  for (var s = 0; s < subscriptions.length; s++) {
15289
15288
  s !== i2 && subscriptions[s].unsubscribe();
@@ -15423,7 +15422,7 @@ var require_zip = __commonJS({
15423
15422
  buffers = completed = null;
15424
15423
  });
15425
15424
  var _loop_1 = function(sourceIndex2) {
15426
- innerFrom_1.innerFrom(sources2[sourceIndex2]).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15425
+ innerFrom_1.innerFrom(sources2[sourceIndex2]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15427
15426
  buffers[sourceIndex2].push(value);
15428
15427
  if (buffers.every(function(buffer) {
15429
15428
  return buffer.length;
@@ -15493,11 +15492,11 @@ var require_audit = __commonJS({
15493
15492
  durationSubscriber = null;
15494
15493
  isComplete && subscriber.complete();
15495
15494
  };
15496
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15495
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15497
15496
  hasValue = true;
15498
15497
  lastValue = value;
15499
15498
  if (!durationSubscriber) {
15500
- innerFrom_1.innerFrom(durationSelector(value)).subscribe(durationSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, endDuration, cleanupDuration));
15499
+ innerFrom_1.innerFrom(durationSelector(value)).subscribe(durationSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, endDuration, cleanupDuration));
15501
15500
  }
15502
15501
  }, function() {
15503
15502
  isComplete = true;
@@ -15542,13 +15541,13 @@ var require_buffer = __commonJS({
15542
15541
  function buffer(closingNotifier) {
15543
15542
  return lift_1.operate(function(source, subscriber) {
15544
15543
  var currentBuffer = [];
15545
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15544
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15546
15545
  return currentBuffer.push(value);
15547
15546
  }, function() {
15548
15547
  subscriber.next(currentBuffer);
15549
15548
  subscriber.complete();
15550
15549
  }));
15551
- closingNotifier.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
15550
+ closingNotifier.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
15552
15551
  var b = currentBuffer;
15553
15552
  currentBuffer = [];
15554
15553
  subscriber.next(b);
@@ -15593,7 +15592,7 @@ var require_bufferCount = __commonJS({
15593
15592
  return lift_1.operate(function(source, subscriber) {
15594
15593
  var buffers = [];
15595
15594
  var count = 0;
15596
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15595
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15597
15596
  var e_1, _a, e_2, _b;
15598
15597
  var toEmit = null;
15599
15598
  if (count++ % startBufferEvery === 0) {
@@ -15733,7 +15732,7 @@ var require_bufferTime = __commonJS({
15733
15732
  restartOnEmit = true;
15734
15733
  }
15735
15734
  startBuffer();
15736
- var bufferTimeSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15735
+ var bufferTimeSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15737
15736
  var e_1, _a2;
15738
15737
  var recordsCopy = bufferRecords.slice();
15739
15738
  try {
@@ -15800,7 +15799,7 @@ var require_bufferToggle = __commonJS({
15800
15799
  function bufferToggle(openings, closingSelector) {
15801
15800
  return lift_1.operate(function(source, subscriber) {
15802
15801
  var buffers = [];
15803
- innerFrom_1.innerFrom(openings).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(openValue) {
15802
+ innerFrom_1.innerFrom(openings).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(openValue) {
15804
15803
  var buffer = [];
15805
15804
  buffers.push(buffer);
15806
15805
  var closingSubscription = new Subscription_1.Subscription();
@@ -15809,9 +15808,9 @@ var require_bufferToggle = __commonJS({
15809
15808
  subscriber.next(buffer);
15810
15809
  closingSubscription.unsubscribe();
15811
15810
  };
15812
- closingSubscription.add(innerFrom_1.innerFrom(closingSelector(openValue)).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, emitBuffer, noop_1.noop)));
15811
+ closingSubscription.add(innerFrom_1.innerFrom(closingSelector(openValue)).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, emitBuffer, noop_1.noop)));
15813
15812
  }, noop_1.noop));
15814
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15813
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15815
15814
  var e_1, _a;
15816
15815
  try {
15817
15816
  for (var buffers_1 = __values(buffers), buffers_1_1 = buffers_1.next(); !buffers_1_1.done; buffers_1_1 = buffers_1.next()) {
@@ -15860,10 +15859,10 @@ var require_bufferWhen = __commonJS({
15860
15859
  var b = buffer;
15861
15860
  buffer = [];
15862
15861
  b && subscriber.next(b);
15863
- innerFrom_1.innerFrom(closingSelector()).subscribe(closingSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, openBuffer, noop_1.noop));
15862
+ innerFrom_1.innerFrom(closingSelector()).subscribe(closingSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, openBuffer, noop_1.noop));
15864
15863
  };
15865
15864
  openBuffer();
15866
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15865
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15867
15866
  return buffer === null || buffer === void 0 ? void 0 : buffer.push(value);
15868
15867
  }, function() {
15869
15868
  buffer && subscriber.next(buffer);
@@ -15891,7 +15890,7 @@ var require_catchError = __commonJS({
15891
15890
  var innerSub = null;
15892
15891
  var syncUnsub = false;
15893
15892
  var handledResult;
15894
- innerSub = source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, void 0, function(err) {
15893
+ innerSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, void 0, function(err) {
15895
15894
  handledResult = innerFrom_1.innerFrom(selector(err, catchError(selector)(source)));
15896
15895
  if (innerSub) {
15897
15896
  innerSub.unsubscribe();
@@ -15924,7 +15923,7 @@ var require_scanInternals = __commonJS({
15924
15923
  var hasState = hasSeed;
15925
15924
  var state = seed;
15926
15925
  var index = 0;
15927
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
15926
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
15928
15927
  var i = index++;
15929
15928
  state = hasState ? accumulator(state, value, i) : (hasState = true, value);
15930
15929
  emitOnNext && subscriber.next(state);
@@ -16330,11 +16329,11 @@ var require_debounce = __commonJS({
16330
16329
  subscriber.next(value);
16331
16330
  }
16332
16331
  };
16333
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16332
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
16334
16333
  durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
16335
16334
  hasValue = true;
16336
16335
  lastValue = value;
16337
- durationSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, emit, noop_1.noop);
16336
+ durationSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, emit, noop_1.noop);
16338
16337
  innerFrom_1.innerFrom(durationSelector(value)).subscribe(durationSubscriber);
16339
16338
  }, function() {
16340
16339
  emit();
@@ -16384,7 +16383,7 @@ var require_debounceTime = __commonJS({
16384
16383
  }
16385
16384
  emit();
16386
16385
  }
16387
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16386
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
16388
16387
  lastValue = value;
16389
16388
  lastTime = scheduler.now();
16390
16389
  if (!activeTask) {
@@ -16414,7 +16413,7 @@ var require_defaultIfEmpty = __commonJS({
16414
16413
  function defaultIfEmpty(defaultValue) {
16415
16414
  return lift_1.operate(function(source, subscriber) {
16416
16415
  var hasValue = false;
16417
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16416
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
16418
16417
  hasValue = true;
16419
16418
  subscriber.next(value);
16420
16419
  }, function() {
@@ -16443,7 +16442,7 @@ var require_take = __commonJS({
16443
16442
  return empty_1.EMPTY;
16444
16443
  } : lift_1.operate(function(source, subscriber) {
16445
16444
  var seen = 0;
16446
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16445
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
16447
16446
  if (++seen <= count) {
16448
16447
  subscriber.next(value);
16449
16448
  if (count <= seen) {
@@ -16468,7 +16467,7 @@ var require_ignoreElements = __commonJS({
16468
16467
  var noop_1 = require_noop();
16469
16468
  function ignoreElements() {
16470
16469
  return lift_1.operate(function(source, subscriber) {
16471
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, noop_1.noop));
16470
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, noop_1.noop));
16472
16471
  });
16473
16472
  }
16474
16473
  exports.ignoreElements = ignoreElements;
@@ -16549,7 +16548,7 @@ var require_dematerialize = __commonJS({
16549
16548
  var OperatorSubscriber_1 = require_OperatorSubscriber();
16550
16549
  function dematerialize() {
16551
16550
  return lift_1.operate(function(source, subscriber) {
16552
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(notification) {
16551
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(notification) {
16553
16552
  return Notification_1.observeNotification(notification, subscriber);
16554
16553
  }));
16555
16554
  });
@@ -16570,14 +16569,14 @@ var require_distinct = __commonJS({
16570
16569
  function distinct(keySelector, flushes) {
16571
16570
  return lift_1.operate(function(source, subscriber) {
16572
16571
  var distinctKeys = /* @__PURE__ */ new Set();
16573
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16572
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
16574
16573
  var key = keySelector ? keySelector(value) : value;
16575
16574
  if (!distinctKeys.has(key)) {
16576
16575
  distinctKeys.add(key);
16577
16576
  subscriber.next(value);
16578
16577
  }
16579
16578
  }));
16580
- flushes === null || flushes === void 0 ? void 0 : flushes.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
16579
+ flushes === null || flushes === void 0 ? void 0 : flushes.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
16581
16580
  return distinctKeys.clear();
16582
16581
  }, noop_1.noop));
16583
16582
  });
@@ -16603,7 +16602,7 @@ var require_distinctUntilChanged = __commonJS({
16603
16602
  return lift_1.operate(function(source, subscriber) {
16604
16603
  var previousKey;
16605
16604
  var first = true;
16606
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16605
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
16607
16606
  var currentKey = keySelector(value);
16608
16607
  if (first || !comparator(previousKey, currentKey)) {
16609
16608
  first = false;
@@ -16651,7 +16650,7 @@ var require_throwIfEmpty = __commonJS({
16651
16650
  }
16652
16651
  return lift_1.operate(function(source, subscriber) {
16653
16652
  var hasValue = false;
16654
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16653
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
16655
16654
  hasValue = true;
16656
16655
  subscriber.next(value);
16657
16656
  }, function() {
@@ -16752,7 +16751,7 @@ var require_every = __commonJS({
16752
16751
  function every(predicate, thisArg) {
16753
16752
  return lift_1.operate(function(source, subscriber) {
16754
16753
  var index = 0;
16755
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16754
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
16756
16755
  if (!predicate.call(thisArg, value, index++, source)) {
16757
16756
  subscriber.next(false);
16758
16757
  subscriber.complete();
@@ -16780,9 +16779,9 @@ var require_exhaustAll = __commonJS({
16780
16779
  return lift_1.operate(function(source, subscriber) {
16781
16780
  var isComplete = false;
16782
16781
  var innerSub = null;
16783
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(inner) {
16782
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(inner) {
16784
16783
  if (!innerSub) {
16785
- innerSub = innerFrom_1.innerFrom(inner).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, function() {
16784
+ innerSub = innerFrom_1.innerFrom(inner).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, function() {
16786
16785
  innerSub = null;
16787
16786
  isComplete && subscriber.complete();
16788
16787
  }));
@@ -16832,9 +16831,9 @@ var require_exhaustMap = __commonJS({
16832
16831
  var index = 0;
16833
16832
  var innerSub = null;
16834
16833
  var isComplete = false;
16835
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(outerValue) {
16834
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(outerValue) {
16836
16835
  if (!innerSub) {
16837
- innerSub = new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, function() {
16836
+ innerSub = OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, function() {
16838
16837
  innerSub = null;
16839
16838
  isComplete && subscriber.complete();
16840
16839
  });
@@ -16907,7 +16906,7 @@ var require_find = __commonJS({
16907
16906
  var findIndex = emit === "index";
16908
16907
  return function(source, subscriber) {
16909
16908
  var index = 0;
16910
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16909
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
16911
16910
  var i = index++;
16912
16911
  if (predicate.call(thisArg, value, i, source)) {
16913
16912
  subscriber.next(findIndex ? i : value);
@@ -16968,27 +16967,6 @@ var require_first = __commonJS({
16968
16967
  var require_groupBy = __commonJS({
16969
16968
  "node_modules/rxjs/dist/cjs/internal/operators/groupBy.js"(exports) {
16970
16969
  "use strict";
16971
- var __extends = exports && exports.__extends || function() {
16972
- var extendStatics = function(d, b) {
16973
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
16974
- d2.__proto__ = b2;
16975
- } || function(d2, b2) {
16976
- for (var p in b2)
16977
- if (Object.prototype.hasOwnProperty.call(b2, p))
16978
- d2[p] = b2[p];
16979
- };
16980
- return extendStatics(d, b);
16981
- };
16982
- return function(d, b) {
16983
- if (typeof b !== "function" && b !== null)
16984
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
16985
- extendStatics(d, b);
16986
- function __() {
16987
- this.constructor = d;
16988
- }
16989
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
16990
- };
16991
- }();
16992
16970
  Object.defineProperty(exports, "__esModule", { value: true });
16993
16971
  exports.groupBy = void 0;
16994
16972
  var Observable_1 = require_Observable();
@@ -17014,7 +16992,9 @@ var require_groupBy = __commonJS({
17014
16992
  return consumer.error(err);
17015
16993
  });
17016
16994
  };
17017
- var groupBySourceSubscriber = new GroupBySubscriber(subscriber, function(value) {
16995
+ var activeGroups = 0;
16996
+ var teardownAttempted = false;
16997
+ var groupBySourceSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
17018
16998
  try {
17019
16999
  var key_1 = keySelector(value);
17020
17000
  var group_1 = groups.get(key_1);
@@ -17023,7 +17003,7 @@ var require_groupBy = __commonJS({
17023
17003
  var grouped = createGroupedObservable(key_1, group_1);
17024
17004
  subscriber.next(grouped);
17025
17005
  if (duration) {
17026
- var durationSubscriber_1 = new OperatorSubscriber_1.OperatorSubscriber(group_1, function() {
17006
+ var durationSubscriber_1 = OperatorSubscriber_1.createOperatorSubscriber(group_1, function() {
17027
17007
  group_1.complete();
17028
17008
  durationSubscriber_1 === null || durationSubscriber_1 === void 0 ? void 0 : durationSubscriber_1.unsubscribe();
17029
17009
  }, void 0, void 0, function() {
@@ -17042,15 +17022,18 @@ var require_groupBy = __commonJS({
17042
17022
  });
17043
17023
  }, handleError, function() {
17044
17024
  return groups.clear();
17025
+ }, function() {
17026
+ teardownAttempted = true;
17027
+ return activeGroups === 0;
17045
17028
  });
17046
17029
  source.subscribe(groupBySourceSubscriber);
17047
17030
  function createGroupedObservable(key, groupSubject) {
17048
17031
  var result = new Observable_1.Observable(function(groupSubscriber) {
17049
- groupBySourceSubscriber.activeGroups++;
17032
+ activeGroups++;
17050
17033
  var innerSub = groupSubject.subscribe(groupSubscriber);
17051
17034
  return function() {
17052
17035
  innerSub.unsubscribe();
17053
- --groupBySourceSubscriber.activeGroups === 0 && groupBySourceSubscriber.teardownAttempted && groupBySourceSubscriber.unsubscribe();
17036
+ --activeGroups === 0 && teardownAttempted && groupBySourceSubscriber.unsubscribe();
17054
17037
  };
17055
17038
  });
17056
17039
  result.key = key;
@@ -17059,20 +17042,6 @@ var require_groupBy = __commonJS({
17059
17042
  });
17060
17043
  }
17061
17044
  exports.groupBy = groupBy;
17062
- var GroupBySubscriber = function(_super) {
17063
- __extends(GroupBySubscriber2, _super);
17064
- function GroupBySubscriber2() {
17065
- var _this = _super !== null && _super.apply(this, arguments) || this;
17066
- _this.activeGroups = 0;
17067
- _this.teardownAttempted = false;
17068
- return _this;
17069
- }
17070
- GroupBySubscriber2.prototype.unsubscribe = function() {
17071
- this.teardownAttempted = true;
17072
- this.activeGroups === 0 && _super.prototype.unsubscribe.call(this);
17073
- };
17074
- return GroupBySubscriber2;
17075
- }(OperatorSubscriber_1.OperatorSubscriber);
17076
17045
  }
17077
17046
  });
17078
17047
 
@@ -17086,7 +17055,7 @@ var require_isEmpty = __commonJS({
17086
17055
  var OperatorSubscriber_1 = require_OperatorSubscriber();
17087
17056
  function isEmpty() {
17088
17057
  return lift_1.operate(function(source, subscriber) {
17089
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
17058
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
17090
17059
  subscriber.next(false);
17091
17060
  subscriber.complete();
17092
17061
  }, function() {
@@ -17127,7 +17096,7 @@ var require_takeLast = __commonJS({
17127
17096
  return empty_1.EMPTY;
17128
17097
  } : lift_1.operate(function(source, subscriber) {
17129
17098
  var buffer = [];
17130
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
17099
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
17131
17100
  buffer.push(value);
17132
17101
  count < buffer.length && buffer.shift();
17133
17102
  }, function() {
@@ -17195,7 +17164,7 @@ var require_materialize = __commonJS({
17195
17164
  var OperatorSubscriber_1 = require_OperatorSubscriber();
17196
17165
  function materialize() {
17197
17166
  return lift_1.operate(function(source, subscriber) {
17198
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
17167
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
17199
17168
  subscriber.next(Notification_1.Notification.createNext(value));
17200
17169
  }, function() {
17201
17170
  subscriber.next(Notification_1.Notification.createComplete());
@@ -17449,7 +17418,7 @@ var require_pairwise = __commonJS({
17449
17418
  return lift_1.operate(function(source, subscriber) {
17450
17419
  var prev;
17451
17420
  var hasPrev = false;
17452
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
17421
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
17453
17422
  var p = prev;
17454
17423
  prev = value;
17455
17424
  hasPrev && subscriber.next([p, value]);
@@ -17656,7 +17625,7 @@ var require_repeat = __commonJS({
17656
17625
  sourceSub = null;
17657
17626
  if (delay != null) {
17658
17627
  var notifier = typeof delay === "number" ? timer_1.timer(delay) : innerFrom_1.innerFrom(delay(soFar));
17659
- var notifierSubscriber_1 = new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
17628
+ var notifierSubscriber_1 = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
17660
17629
  notifierSubscriber_1.unsubscribe();
17661
17630
  subscribeToSource();
17662
17631
  });
@@ -17667,7 +17636,7 @@ var require_repeat = __commonJS({
17667
17636
  };
17668
17637
  var subscribeToSource = function() {
17669
17638
  var syncUnsub = false;
17670
- sourceSub = source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, function() {
17639
+ sourceSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, function() {
17671
17640
  if (++soFar < count) {
17672
17641
  if (sourceSub) {
17673
17642
  resubscribe();
@@ -17711,7 +17680,7 @@ var require_repeatWhen = __commonJS({
17711
17680
  var getCompletionSubject = function() {
17712
17681
  if (!completions$) {
17713
17682
  completions$ = new Subject_1.Subject();
17714
- notifier(completions$).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
17683
+ notifier(completions$).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
17715
17684
  if (innerSub) {
17716
17685
  subscribeForRepeatWhen();
17717
17686
  } else {
@@ -17726,7 +17695,7 @@ var require_repeatWhen = __commonJS({
17726
17695
  };
17727
17696
  var subscribeForRepeatWhen = function() {
17728
17697
  isMainComplete = false;
17729
- innerSub = source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, function() {
17698
+ innerSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, function() {
17730
17699
  isMainComplete = true;
17731
17700
  !checkComplete() && getCompletionSubject().next();
17732
17701
  }));
@@ -17773,7 +17742,7 @@ var require_retry = __commonJS({
17773
17742
  var innerSub;
17774
17743
  var subscribeForRetry = function() {
17775
17744
  var syncUnsub = false;
17776
- innerSub = source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
17745
+ innerSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
17777
17746
  if (resetOnSuccess) {
17778
17747
  soFar = 0;
17779
17748
  }
@@ -17791,7 +17760,7 @@ var require_retry = __commonJS({
17791
17760
  };
17792
17761
  if (delay != null) {
17793
17762
  var notifier = typeof delay === "number" ? timer_1.timer(delay) : innerFrom_1.innerFrom(delay(err, soFar));
17794
- var notifierSubscriber_1 = new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
17763
+ var notifierSubscriber_1 = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
17795
17764
  notifierSubscriber_1.unsubscribe();
17796
17765
  resub_1();
17797
17766
  }, function() {
@@ -17833,10 +17802,10 @@ var require_retryWhen = __commonJS({
17833
17802
  var syncResub = false;
17834
17803
  var errors$;
17835
17804
  var subscribeForRetryWhen = function() {
17836
- innerSub = source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, void 0, function(err) {
17805
+ innerSub = source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, void 0, function(err) {
17837
17806
  if (!errors$) {
17838
17807
  errors$ = new Subject_1.Subject();
17839
- notifier(errors$).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
17808
+ notifier(errors$).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
17840
17809
  return innerSub ? subscribeForRetryWhen() : syncResub = true;
17841
17810
  }));
17842
17811
  }
@@ -17871,19 +17840,18 @@ var require_sample = __commonJS({
17871
17840
  return lift_1.operate(function(source, subscriber) {
17872
17841
  var hasValue = false;
17873
17842
  var lastValue = null;
17874
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
17843
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
17875
17844
  hasValue = true;
17876
17845
  lastValue = value;
17877
17846
  }));
17878
- var emit = function() {
17847
+ notifier.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
17879
17848
  if (hasValue) {
17880
17849
  hasValue = false;
17881
17850
  var value = lastValue;
17882
17851
  lastValue = null;
17883
17852
  subscriber.next(value);
17884
17853
  }
17885
- };
17886
- notifier.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, emit, noop_1.noop));
17854
+ }, noop_1.noop));
17887
17855
  });
17888
17856
  }
17889
17857
  exports.sample = sample;
@@ -17946,7 +17914,7 @@ var require_sequenceEqual = __commonJS({
17946
17914
  subscriber.complete();
17947
17915
  };
17948
17916
  var createSubscriber = function(selfState, otherState) {
17949
- var sequenceEqualSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(a) {
17917
+ var sequenceEqualSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(a) {
17950
17918
  var buffer = otherState.buffer, complete = otherState.complete;
17951
17919
  if (buffer.length === 0) {
17952
17920
  complete ? emit(false) : selfState.buffer.push(a);
@@ -18146,7 +18114,7 @@ var require_single = __commonJS({
18146
18114
  var singleValue;
18147
18115
  var seenValue = false;
18148
18116
  var index = 0;
18149
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18117
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18150
18118
  seenValue = true;
18151
18119
  if (!predicate || predicate(value, index++, source)) {
18152
18120
  hasValue && subscriber.error(new SequenceError_1.SequenceError("Too many matching values"));
@@ -18196,7 +18164,7 @@ var require_skipLast = __commonJS({
18196
18164
  return skipCount <= 0 ? identity_1.identity : lift_1.operate(function(source, subscriber) {
18197
18165
  var ring = new Array(skipCount);
18198
18166
  var seen = 0;
18199
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18167
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18200
18168
  var valueIndex = seen++;
18201
18169
  if (valueIndex < skipCount) {
18202
18170
  ring[valueIndex] = value;
@@ -18229,12 +18197,12 @@ var require_skipUntil = __commonJS({
18229
18197
  function skipUntil(notifier) {
18230
18198
  return lift_1.operate(function(source, subscriber) {
18231
18199
  var taking = false;
18232
- var skipSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
18200
+ var skipSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
18233
18201
  skipSubscriber === null || skipSubscriber === void 0 ? void 0 : skipSubscriber.unsubscribe();
18234
18202
  taking = true;
18235
18203
  }, noop_1.noop);
18236
18204
  innerFrom_1.innerFrom(notifier).subscribe(skipSubscriber);
18237
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18205
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18238
18206
  return taking && subscriber.next(value);
18239
18207
  }));
18240
18208
  });
@@ -18255,7 +18223,7 @@ var require_skipWhile = __commonJS({
18255
18223
  return lift_1.operate(function(source, subscriber) {
18256
18224
  var taking = false;
18257
18225
  var index = 0;
18258
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18226
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18259
18227
  return (taking || (taking = !predicate(value, index++))) && subscriber.next(value);
18260
18228
  }));
18261
18229
  });
@@ -18304,11 +18272,11 @@ var require_switchMap = __commonJS({
18304
18272
  var checkComplete = function() {
18305
18273
  return isComplete && !innerSubscriber && subscriber.complete();
18306
18274
  };
18307
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18275
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18308
18276
  innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();
18309
18277
  var innerIndex = 0;
18310
18278
  var outerIndex = index++;
18311
- innerFrom_1.innerFrom(project(value, outerIndex)).subscribe(innerSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(innerValue) {
18279
+ innerFrom_1.innerFrom(project(value, outerIndex)).subscribe(innerSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(innerValue) {
18312
18280
  return subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue);
18313
18281
  }, function() {
18314
18282
  innerSubscriber = null;
@@ -18395,7 +18363,7 @@ var require_takeUntil = __commonJS({
18395
18363
  var noop_1 = require_noop();
18396
18364
  function takeUntil(notifier) {
18397
18365
  return lift_1.operate(function(source, subscriber) {
18398
- innerFrom_1.innerFrom(notifier).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
18366
+ innerFrom_1.innerFrom(notifier).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
18399
18367
  return subscriber.complete();
18400
18368
  }, noop_1.noop));
18401
18369
  !subscriber.closed && source.subscribe(subscriber);
@@ -18419,7 +18387,7 @@ var require_takeWhile = __commonJS({
18419
18387
  }
18420
18388
  return lift_1.operate(function(source, subscriber) {
18421
18389
  var index = 0;
18422
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18390
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18423
18391
  var result = predicate(value, index++);
18424
18392
  (result || inclusive) && subscriber.next(value);
18425
18393
  !result && subscriber.complete();
@@ -18446,7 +18414,7 @@ var require_tap = __commonJS({
18446
18414
  var _a;
18447
18415
  (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
18448
18416
  var isUnsub = true;
18449
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18417
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18450
18418
  var _a2;
18451
18419
  (_a2 = tapObserver.next) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver, value);
18452
18420
  subscriber.next(value);
@@ -18509,7 +18477,7 @@ var require_throttle = __commonJS({
18509
18477
  isComplete && subscriber.complete();
18510
18478
  };
18511
18479
  var startThrottle = function(value) {
18512
- return throttled = innerFrom_1.innerFrom(durationSelector(value)).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, endThrottling, cleanupThrottling));
18480
+ return throttled = innerFrom_1.innerFrom(durationSelector(value)).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, endThrottling, cleanupThrottling));
18513
18481
  };
18514
18482
  var send = function() {
18515
18483
  if (hasValue) {
@@ -18520,7 +18488,7 @@ var require_throttle = __commonJS({
18520
18488
  !isComplete && startThrottle(value);
18521
18489
  }
18522
18490
  };
18523
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18491
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18524
18492
  hasValue = true;
18525
18493
  sendValue = value;
18526
18494
  !(throttled && !throttled.closed) && (leading ? send() : startThrottle(value));
@@ -18566,34 +18534,27 @@ var require_timeInterval = __commonJS({
18566
18534
  Object.defineProperty(exports, "__esModule", { value: true });
18567
18535
  exports.TimeInterval = exports.timeInterval = void 0;
18568
18536
  var async_1 = require_async();
18569
- var scan_1 = require_scan();
18570
- var defer_1 = require_defer();
18571
- var map_1 = require_map();
18537
+ var lift_1 = require_lift();
18538
+ var OperatorSubscriber_1 = require_OperatorSubscriber();
18572
18539
  function timeInterval(scheduler) {
18573
18540
  if (scheduler === void 0) {
18574
18541
  scheduler = async_1.asyncScheduler;
18575
18542
  }
18576
- return function(source) {
18577
- return defer_1.defer(function() {
18578
- return source.pipe(scan_1.scan(function(_a, value) {
18579
- var current = _a.current;
18580
- return { value, current: scheduler.now(), last: current };
18581
- }, {
18582
- current: scheduler.now(),
18583
- value: void 0,
18584
- last: void 0
18585
- }), map_1.map(function(_a) {
18586
- var current = _a.current, last = _a.last, value = _a.value;
18587
- return new TimeInterval(value, current - last);
18588
- }));
18589
- });
18590
- };
18543
+ return lift_1.operate(function(source, subscriber) {
18544
+ var last = scheduler.now();
18545
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18546
+ var now = scheduler.now();
18547
+ var interval2 = now - last;
18548
+ last = now;
18549
+ subscriber.next(new TimeInterval(value, interval2));
18550
+ }));
18551
+ });
18591
18552
  }
18592
18553
  exports.timeInterval = timeInterval;
18593
18554
  var TimeInterval = function() {
18594
- function TimeInterval2(value, interval) {
18555
+ function TimeInterval2(value, interval2) {
18595
18556
  this.value = value;
18596
- this.interval = interval;
18557
+ this.interval = interval2;
18597
18558
  }
18598
18559
  return TimeInterval2;
18599
18560
  }();
@@ -18679,13 +18640,13 @@ var require_window = __commonJS({
18679
18640
  windowSubject.error(err);
18680
18641
  subscriber.error(err);
18681
18642
  };
18682
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18643
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18683
18644
  return windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.next(value);
18684
18645
  }, function() {
18685
18646
  windowSubject.complete();
18686
18647
  subscriber.complete();
18687
18648
  }, errorHandler));
18688
- windowBoundaries.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
18649
+ windowBoundaries.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function() {
18689
18650
  windowSubject.complete();
18690
18651
  subscriber.next(windowSubject = new Subject_1.Subject());
18691
18652
  }, noop_1.noop, errorHandler));
@@ -18732,7 +18693,7 @@ var require_windowCount = __commonJS({
18732
18693
  var starts = [];
18733
18694
  var count = 0;
18734
18695
  subscriber.next(windows[0].asObservable());
18735
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18696
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18736
18697
  var e_1, _a;
18737
18698
  try {
18738
18699
  for (var windows_1 = __values(windows), windows_1_1 = windows_1.next(); !windows_1_1.done; windows_1_1 = windows_1.next()) {
@@ -18846,7 +18807,7 @@ var require_windowTime = __commonJS({
18846
18807
  cb(subscriber);
18847
18808
  subscriber.unsubscribe();
18848
18809
  };
18849
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18810
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18850
18811
  loop(function(record) {
18851
18812
  record.window.next(value);
18852
18813
  maxWindowSize <= ++record.seen && closeWindow(record);
@@ -18905,7 +18866,7 @@ var require_windowToggle = __commonJS({
18905
18866
  }
18906
18867
  subscriber.error(err);
18907
18868
  };
18908
- innerFrom_1.innerFrom(openings).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(openValue) {
18869
+ innerFrom_1.innerFrom(openings).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(openValue) {
18909
18870
  var window10 = new Subject_1.Subject();
18910
18871
  windows.push(window10);
18911
18872
  var closingSubscription = new Subscription_1.Subscription();
@@ -18922,9 +18883,9 @@ var require_windowToggle = __commonJS({
18922
18883
  return;
18923
18884
  }
18924
18885
  subscriber.next(window10.asObservable());
18925
- closingSubscription.add(closingNotifier.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, closeWindow, noop_1.noop, handleError)));
18886
+ closingSubscription.add(closingNotifier.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, closeWindow, noop_1.noop, handleError)));
18926
18887
  }, noop_1.noop));
18927
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18888
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18928
18889
  var e_1, _a;
18929
18890
  var windowsCopy = windows.slice();
18930
18891
  try {
@@ -18989,10 +18950,10 @@ var require_windowWhen = __commonJS({
18989
18950
  handleError(err);
18990
18951
  return;
18991
18952
  }
18992
- closingNotifier.subscribe(closingSubscriber = new OperatorSubscriber_1.OperatorSubscriber(subscriber, openWindow, openWindow, handleError));
18953
+ closingNotifier.subscribe(closingSubscriber = OperatorSubscriber_1.createOperatorSubscriber(subscriber, openWindow, openWindow, handleError));
18993
18954
  };
18994
18955
  openWindow();
18995
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
18956
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
18996
18957
  return window10.next(value);
18997
18958
  }, function() {
18998
18959
  window10.complete();
@@ -19059,7 +19020,7 @@ var require_withLatestFrom = __commonJS({
19059
19020
  });
19060
19021
  var ready = false;
19061
19022
  var _loop_1 = function(i2) {
19062
- innerFrom_1.innerFrom(inputs[i2]).subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
19023
+ innerFrom_1.innerFrom(inputs[i2]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
19063
19024
  otherValues[i2] = value;
19064
19025
  if (!ready && !hasValue[i2]) {
19065
19026
  hasValue[i2] = true;
@@ -19070,7 +19031,7 @@ var require_withLatestFrom = __commonJS({
19070
19031
  for (var i = 0; i < len; i++) {
19071
19032
  _loop_1(i);
19072
19033
  }
19073
- source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
19034
+ source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
19074
19035
  if (ready) {
19075
19036
  var values = __spreadArray([value], __read(otherValues));
19076
19037
  subscriber.next(project ? project.apply(void 0, __spreadArray([], __read(values))) : values);
@@ -21245,8 +21206,7 @@ var _PythonSettings = class {
21245
21206
  }
21246
21207
  static getInstance() {
21247
21208
  const workspaceFolder = import_coc2.workspace.workspaceFolders.length > 0 ? import_coc2.workspace.workspaceFolders[0] : void 0;
21248
- const workspaceFolderUri = workspaceFolder ? import_coc2.Uri.parse(workspaceFolder.uri) : void 0;
21249
- const workspaceFolderKey = workspaceFolderUri ? workspaceFolderUri.fsPath : "";
21209
+ const workspaceFolderKey = workspaceFolder ? workspaceFolder.name : "unknown";
21250
21210
  if (!_PythonSettings.pythonSettings.has(workspaceFolderKey)) {
21251
21211
  const settings = new _PythonSettings();
21252
21212
  _PythonSettings.pythonSettings.set(workspaceFolderKey, settings);
@@ -22055,32 +22015,152 @@ var DarkerFormatter = class extends BaseFormatter {
22055
22015
  };
22056
22016
 
22057
22017
  // src/formatters/blackd.ts
22058
- var import_coc7 = require("coc.nvim");
22059
22018
  var import_child_process2 = require("child_process");
22019
+ var import_coc7 = require("coc.nvim");
22020
+
22021
+ // node_modules/get-port/index.js
22022
+ var import_node_net = __toESM(require("net"), 1);
22023
+ var import_node_os = __toESM(require("os"), 1);
22024
+ var Locked = class extends Error {
22025
+ constructor(port) {
22026
+ super(`${port} is locked`);
22027
+ }
22028
+ };
22029
+ var lockedPorts = {
22030
+ old: /* @__PURE__ */ new Set(),
22031
+ young: /* @__PURE__ */ new Set()
22032
+ };
22033
+ var releaseOldLockedPortsIntervalMs = 1e3 * 15;
22034
+ var interval;
22035
+ var getLocalHosts = () => {
22036
+ const interfaces = import_node_os.default.networkInterfaces();
22037
+ const results = /* @__PURE__ */ new Set([void 0, "0.0.0.0"]);
22038
+ for (const _interface of Object.values(interfaces)) {
22039
+ for (const config of _interface) {
22040
+ results.add(config.address);
22041
+ }
22042
+ }
22043
+ return results;
22044
+ };
22045
+ var checkAvailablePort = (options) => new Promise((resolve, reject) => {
22046
+ const server = import_node_net.default.createServer();
22047
+ server.unref();
22048
+ server.on("error", reject);
22049
+ server.listen(options, () => {
22050
+ const { port } = server.address();
22051
+ server.close(() => {
22052
+ resolve(port);
22053
+ });
22054
+ });
22055
+ });
22056
+ var getAvailablePort = async (options, hosts) => {
22057
+ if (options.host || options.port === 0) {
22058
+ return checkAvailablePort(options);
22059
+ }
22060
+ for (const host of hosts) {
22061
+ try {
22062
+ await checkAvailablePort({ port: options.port, host });
22063
+ } catch (error) {
22064
+ if (!["EADDRNOTAVAIL", "EINVAL"].includes(error.code)) {
22065
+ throw error;
22066
+ }
22067
+ }
22068
+ }
22069
+ return options.port;
22070
+ };
22071
+ var portCheckSequence = function* (ports) {
22072
+ if (ports) {
22073
+ yield* ports;
22074
+ }
22075
+ yield 0;
22076
+ };
22077
+ async function getPorts(options) {
22078
+ let ports;
22079
+ let exclude = /* @__PURE__ */ new Set();
22080
+ if (options) {
22081
+ if (options.port) {
22082
+ ports = typeof options.port === "number" ? [options.port] : options.port;
22083
+ }
22084
+ if (options.exclude) {
22085
+ const excludeIterable = options.exclude;
22086
+ if (typeof excludeIterable[Symbol.iterator] !== "function") {
22087
+ throw new TypeError("The `exclude` option must be an iterable.");
22088
+ }
22089
+ for (const element of excludeIterable) {
22090
+ if (typeof element !== "number") {
22091
+ throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");
22092
+ }
22093
+ if (!Number.isSafeInteger(element)) {
22094
+ throw new TypeError(`Number ${element} in the exclude option is not a safe integer and can't be used`);
22095
+ }
22096
+ }
22097
+ exclude = new Set(excludeIterable);
22098
+ }
22099
+ }
22100
+ if (interval === void 0) {
22101
+ interval = setInterval(() => {
22102
+ lockedPorts.old = lockedPorts.young;
22103
+ lockedPorts.young = /* @__PURE__ */ new Set();
22104
+ }, releaseOldLockedPortsIntervalMs);
22105
+ if (interval.unref) {
22106
+ interval.unref();
22107
+ }
22108
+ }
22109
+ const hosts = getLocalHosts();
22110
+ for (const port of portCheckSequence(ports)) {
22111
+ try {
22112
+ if (exclude.has(port)) {
22113
+ continue;
22114
+ }
22115
+ let availablePort = await getAvailablePort(__spreadProps(__spreadValues({}, options), { port }), hosts);
22116
+ while (lockedPorts.old.has(availablePort) || lockedPorts.young.has(availablePort)) {
22117
+ if (port !== 0) {
22118
+ throw new Locked(port);
22119
+ }
22120
+ availablePort = await getAvailablePort(__spreadProps(__spreadValues({}, options), { port }), hosts);
22121
+ }
22122
+ lockedPorts.young.add(availablePort);
22123
+ return availablePort;
22124
+ } catch (error) {
22125
+ if (!["EADDRINUSE", "EACCES"].includes(error.code) && !(error instanceof Locked)) {
22126
+ throw error;
22127
+ }
22128
+ }
22129
+ }
22130
+ throw new Error("No available ports found");
22131
+ }
22132
+
22133
+ // src/formatters/blackd.ts
22060
22134
  var BlackdFormatter = class extends BaseFormatter {
22061
22135
  constructor(pythonSettings, outputChannel) {
22062
22136
  super("blackd", pythonSettings, outputChannel);
22063
22137
  this.pythonSettings = pythonSettings;
22064
22138
  this.outputChannel = outputChannel;
22065
- this.blackdServer = null;
22066
22139
  this.blackdHTTPURL = "";
22067
22140
  this.blackdHTTPURL = this.pythonSettings.formatting.blackdHTTPURL;
22068
22141
  if (!this.blackdHTTPURL.length) {
22069
- const blackdPath = this.pythonSettings.formatting.blackdPath;
22070
- this.blackdServer = (0, import_child_process2.spawn)(blackdPath).on("error", (e) => {
22071
- this.outputChannel.appendLine("");
22072
- this.outputChannel.appendLine("spawn blackd HTTP server error");
22073
- this.outputChannel.appendLine(e.message);
22074
- this.outputChannel.appendLine('make sure you have installed blackd by `pip install "black[d]"`');
22075
- this.blackdServer = null;
22076
- });
22142
+ this.lauchServer();
22077
22143
  }
22078
22144
  }
22145
+ async lauchServer() {
22146
+ const port = await getPorts({ port: 45484 });
22147
+ this.blackdHTTPURL = `http://127.0.0.1:${port}`;
22148
+ const blackdPath = this.pythonSettings.formatting.blackdPath;
22149
+ (0, import_child_process2.spawn)(blackdPath, ["--bind-port", String(port)]).on("error", (e) => {
22150
+ this.outputChannel.appendLine("");
22151
+ this.outputChannel.appendLine("spawn blackd HTTP server error");
22152
+ this.outputChannel.appendLine(e.message);
22153
+ this.outputChannel.appendLine('make sure you have installed blackd by `pip install "black[d]"`');
22154
+ this.blackdHTTPURL = "";
22155
+ });
22156
+ }
22079
22157
  async handle(document) {
22158
+ if (!this.blackdHTTPURL.length) {
22159
+ return Promise.resolve([]);
22160
+ }
22080
22161
  try {
22081
- const _url = this.blackdHTTPURL || "http://127.0.0.1:45484";
22082
22162
  const headers = Object.assign({ "X-Diff": 1 }, this.pythonSettings.formatting.blackdHTTPHeaders);
22083
- const patch = await (0, import_coc7.fetch)(_url, { method: "POST", data: document.getText(), headers });
22163
+ const patch = await (0, import_coc7.fetch)(this.blackdHTTPURL, { method: "POST", data: document.getText(), headers });
22084
22164
  this.outputChannel.appendLine("");
22085
22165
  this.outputChannel.appendLine(`${"#".repeat(10)} ${this.Id} output:`);
22086
22166
  this.outputChannel.appendLine(patch.toString());
@@ -22098,15 +22178,11 @@ var BlackdFormatter = class extends BaseFormatter {
22098
22178
  }
22099
22179
  }
22100
22180
  formatDocument(document, _options, _token, range) {
22101
- const errorMessage = async (msg) => {
22181
+ if (range) {
22182
+ const msg = "blackd does not support range formatting";
22102
22183
  this.outputChannel.appendLine(msg);
22103
22184
  import_coc7.window.showErrorMessage(msg);
22104
- return [];
22105
- };
22106
- if (range)
22107
- return errorMessage('Black does not support the "Format Selection" command');
22108
- if (!this.blackdServer && !this.blackdHTTPURL) {
22109
- return errorMessage("blackd server error");
22185
+ return Promise.resolve([]);
22110
22186
  }
22111
22187
  return this.handle(document);
22112
22188
  }
@@ -23301,6 +23377,7 @@ ${errorMessage}`);
23301
23377
  }
23302
23378
 
23303
23379
  // src/index.ts
23380
+ var defaultHeapSize = 3072;
23304
23381
  var method = "workspace/executeCommand";
23305
23382
  var documentSelector = [
23306
23383
  {
@@ -23436,9 +23513,11 @@ async function activate(context) {
23436
23513
  import_coc24.window.showMessage(`Pyright langserver doesn't exist, please reinstall coc-pyright`, "error");
23437
23514
  return;
23438
23515
  }
23516
+ const runOptions = { execArgv: [`--max-old-space-size=${defaultHeapSize}`] };
23517
+ const debugOptions = { execArgv: ["--nolazy", "--inspect=6600", `--max-old-space-size=${defaultHeapSize}`] };
23439
23518
  const serverOptions = {
23440
- module: module2,
23441
- transport: import_coc24.TransportKind.ipc
23519
+ run: { module: module2, transport: import_coc24.TransportKind.ipc, options: runOptions },
23520
+ debug: { module: module2, transport: import_coc24.TransportKind.ipc, options: debugOptions }
23442
23521
  };
23443
23522
  const disabledFeatures = [];
23444
23523
  if (pyrightCfg.get("disableCompletion")) {