@rsdoctor/sdk 1.2.3 → 1.2.4-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/compiled/cors/index.d.ts +56 -0
  2. package/compiled/cors/index.js +550 -0
  3. package/compiled/cors/license +22 -0
  4. package/compiled/cors/package.json +1 -0
  5. package/compiled/dayjs/index.d.ts +428 -0
  6. package/compiled/dayjs/index.js +57 -0
  7. package/compiled/dayjs/license +21 -0
  8. package/compiled/dayjs/package.json +1 -0
  9. package/compiled/fs-extra/index.d.ts +1064 -0
  10. package/compiled/fs-extra/index.js +2839 -0
  11. package/compiled/fs-extra/license +15 -0
  12. package/compiled/fs-extra/package.json +1 -0
  13. package/compiled/json-cycle/index.d.ts +1 -0
  14. package/compiled/json-cycle/index.js +218 -0
  15. package/compiled/json-cycle/license +22 -0
  16. package/compiled/json-cycle/package.json +1 -0
  17. package/dist/336.cjs +351 -0
  18. package/dist/795.js +357 -0
  19. package/dist/index.cjs +7068 -0
  20. package/dist/index.cjs.LICENSE.txt +111 -0
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +6952 -0
  23. package/dist/index.js.LICENSE.txt +111 -0
  24. package/dist/{type/sdk → sdk}/index.d.ts +0 -1
  25. package/dist/{type/sdk → sdk}/multiple/controller.d.ts +0 -1
  26. package/dist/{type/sdk → sdk}/multiple/index.d.ts +0 -1
  27. package/dist/{type/sdk → sdk}/multiple/primary.d.ts +1 -2
  28. package/dist/{type/sdk → sdk}/multiple/server.d.ts +0 -1
  29. package/dist/{type/sdk → sdk}/sdk/core.d.ts +1 -2
  30. package/dist/{type/sdk → sdk}/sdk/index.d.ts +1 -2
  31. package/dist/{type/sdk → sdk}/sdk/types.d.ts +0 -1
  32. package/dist/{type/sdk → sdk}/server/apis/alerts.d.ts +0 -1
  33. package/dist/{type/sdk → sdk}/server/apis/base.d.ts +0 -1
  34. package/dist/{type/sdk → sdk}/server/apis/bundle-diff.d.ts +0 -1
  35. package/dist/{type/sdk → sdk}/server/apis/data.d.ts +0 -1
  36. package/dist/{type/sdk → sdk}/server/apis/fs.d.ts +0 -1
  37. package/dist/{type/sdk → sdk}/server/apis/graph.d.ts +0 -1
  38. package/dist/{type/sdk → sdk}/server/apis/index.d.ts +0 -1
  39. package/dist/{type/sdk → sdk}/server/apis/loader.d.ts +0 -1
  40. package/dist/{type/sdk → sdk}/server/apis/plugin.d.ts +0 -1
  41. package/dist/{type/sdk → sdk}/server/apis/project.d.ts +0 -1
  42. package/dist/{type/sdk → sdk}/server/apis/renderer.d.ts +0 -1
  43. package/dist/{type/sdk → sdk}/server/apis/resolver.d.ts +0 -1
  44. package/dist/{type/sdk → sdk}/server/fakeServer.d.ts +0 -1
  45. package/dist/{type/sdk → sdk}/server/index.d.ts +0 -1
  46. package/dist/{type/sdk → sdk}/server/router.d.ts +0 -1
  47. package/dist/{type/sdk → sdk}/server/socket/api.d.ts +1 -2
  48. package/dist/{type/sdk → sdk}/server/socket/index.d.ts +0 -1
  49. package/dist/{type/sdk → sdk}/server/utils.d.ts +0 -1
  50. package/dist/{type/sdk → sdk}/utils/base.d.ts +0 -1
  51. package/dist/{type/sdk → sdk}/utils/constant.d.ts +0 -1
  52. package/dist/{type/sdk → sdk}/utils/index.d.ts +0 -1
  53. package/dist/{type/sdk → sdk}/utils/openBrowser.d.ts +0 -1
  54. package/dist/{type/sdk → sdk}/utils/upload.d.ts +0 -1
  55. package/package.json +32 -21
  56. package/dist/cjs/index.js +0 -60
  57. package/dist/cjs/sdk/index.js +0 -69
  58. package/dist/cjs/sdk/multiple/controller.js +0 -75
  59. package/dist/cjs/sdk/multiple/index.js +0 -69
  60. package/dist/cjs/sdk/multiple/primary.js +0 -107
  61. package/dist/cjs/sdk/multiple/server.js +0 -47
  62. package/dist/cjs/sdk/sdk/core.js +0 -220
  63. package/dist/cjs/sdk/sdk/index.js +0 -510
  64. package/dist/cjs/sdk/sdk/types.js +0 -18
  65. package/dist/cjs/sdk/server/apis/alerts.js +0 -63
  66. package/dist/cjs/sdk/server/apis/base.js +0 -55
  67. package/dist/cjs/sdk/server/apis/bundle-diff.js +0 -87
  68. package/dist/cjs/sdk/server/apis/data.js +0 -77
  69. package/dist/cjs/sdk/server/apis/fs.js +0 -61
  70. package/dist/cjs/sdk/server/apis/graph.js +0 -149
  71. package/dist/cjs/sdk/server/apis/index.js +0 -132
  72. package/dist/cjs/sdk/server/apis/loader.js +0 -153
  73. package/dist/cjs/sdk/server/apis/plugin.js +0 -72
  74. package/dist/cjs/sdk/server/apis/project.js +0 -92
  75. package/dist/cjs/sdk/server/apis/renderer.js +0 -64
  76. package/dist/cjs/sdk/server/apis/resolver.js +0 -71
  77. package/dist/cjs/sdk/server/fakeServer.js +0 -44
  78. package/dist/cjs/sdk/server/index.js +0 -283
  79. package/dist/cjs/sdk/server/router.js +0 -114
  80. package/dist/cjs/sdk/server/socket/api.js +0 -55
  81. package/dist/cjs/sdk/server/socket/index.js +0 -105
  82. package/dist/cjs/sdk/server/utils.js +0 -65
  83. package/dist/cjs/sdk/utils/base.js +0 -66
  84. package/dist/cjs/sdk/utils/constant.js +0 -47
  85. package/dist/cjs/sdk/utils/index.js +0 -78
  86. package/dist/cjs/sdk/utils/openBrowser.js +0 -102
  87. package/dist/cjs/sdk/utils/upload.js +0 -39
  88. package/dist/esm/index.mjs +0 -1
  89. package/dist/esm/sdk/index.mjs +0 -2
  90. package/dist/esm/sdk/multiple/controller.mjs +0 -41
  91. package/dist/esm/sdk/multiple/index.mjs +0 -2
  92. package/dist/esm/sdk/multiple/primary.mjs +0 -63
  93. package/dist/esm/sdk/multiple/server.mjs +0 -13
  94. package/dist/esm/sdk/sdk/core.mjs +0 -175
  95. package/dist/esm/sdk/sdk/index.mjs +0 -460
  96. package/dist/esm/sdk/sdk/types.mjs +0 -0
  97. package/dist/esm/sdk/server/apis/alerts.mjs +0 -29
  98. package/dist/esm/sdk/server/apis/base.mjs +0 -21
  99. package/dist/esm/sdk/server/apis/bundle-diff.mjs +0 -53
  100. package/dist/esm/sdk/server/apis/data.mjs +0 -43
  101. package/dist/esm/sdk/server/apis/fs.mjs +0 -27
  102. package/dist/esm/sdk/server/apis/graph.mjs +0 -115
  103. package/dist/esm/sdk/server/apis/index.mjs +0 -9
  104. package/dist/esm/sdk/server/apis/loader.mjs +0 -119
  105. package/dist/esm/sdk/server/apis/plugin.mjs +0 -38
  106. package/dist/esm/sdk/server/apis/project.mjs +0 -58
  107. package/dist/esm/sdk/server/apis/renderer.mjs +0 -30
  108. package/dist/esm/sdk/server/apis/resolver.mjs +0 -37
  109. package/dist/esm/sdk/server/fakeServer.mjs +0 -10
  110. package/dist/esm/sdk/server/index.mjs +0 -170
  111. package/dist/esm/sdk/server/router.mjs +0 -80
  112. package/dist/esm/sdk/server/socket/api.mjs +0 -21
  113. package/dist/esm/sdk/server/socket/index.mjs +0 -71
  114. package/dist/esm/sdk/server/utils.mjs +0 -18
  115. package/dist/esm/sdk/utils/base.mjs +0 -21
  116. package/dist/esm/sdk/utils/constant.mjs +0 -3
  117. package/dist/esm/sdk/utils/index.mjs +0 -3
  118. package/dist/esm/sdk/utils/openBrowser.mjs +0 -50
  119. package/dist/esm/sdk/utils/upload.mjs +0 -5
  120. package/dist/type/index.d.ts +0 -2
  121. package/dist/type/index.d.ts.map +0 -1
  122. package/dist/type/sdk/index.d.ts.map +0 -1
  123. package/dist/type/sdk/multiple/controller.d.ts.map +0 -1
  124. package/dist/type/sdk/multiple/index.d.ts.map +0 -1
  125. package/dist/type/sdk/multiple/primary.d.ts.map +0 -1
  126. package/dist/type/sdk/multiple/server.d.ts.map +0 -1
  127. package/dist/type/sdk/sdk/core.d.ts.map +0 -1
  128. package/dist/type/sdk/sdk/index.d.ts.map +0 -1
  129. package/dist/type/sdk/sdk/types.d.ts.map +0 -1
  130. package/dist/type/sdk/server/apis/alerts.d.ts.map +0 -1
  131. package/dist/type/sdk/server/apis/base.d.ts.map +0 -1
  132. package/dist/type/sdk/server/apis/bundle-diff.d.ts.map +0 -1
  133. package/dist/type/sdk/server/apis/data.d.ts.map +0 -1
  134. package/dist/type/sdk/server/apis/fs.d.ts.map +0 -1
  135. package/dist/type/sdk/server/apis/graph.d.ts.map +0 -1
  136. package/dist/type/sdk/server/apis/index.d.ts.map +0 -1
  137. package/dist/type/sdk/server/apis/loader.d.ts.map +0 -1
  138. package/dist/type/sdk/server/apis/plugin.d.ts.map +0 -1
  139. package/dist/type/sdk/server/apis/project.d.ts.map +0 -1
  140. package/dist/type/sdk/server/apis/renderer.d.ts.map +0 -1
  141. package/dist/type/sdk/server/apis/resolver.d.ts.map +0 -1
  142. package/dist/type/sdk/server/fakeServer.d.ts.map +0 -1
  143. package/dist/type/sdk/server/index.d.ts.map +0 -1
  144. package/dist/type/sdk/server/router.d.ts.map +0 -1
  145. package/dist/type/sdk/server/socket/api.d.ts.map +0 -1
  146. package/dist/type/sdk/server/socket/index.d.ts.map +0 -1
  147. package/dist/type/sdk/server/utils.d.ts.map +0 -1
  148. package/dist/type/sdk/utils/base.d.ts.map +0 -1
  149. package/dist/type/sdk/utils/constant.d.ts.map +0 -1
  150. package/dist/type/sdk/utils/index.d.ts.map +0 -1
  151. package/dist/type/sdk/utils/openBrowser.d.ts.map +0 -1
  152. package/dist/type/sdk/utils/upload.d.ts.map +0 -1
@@ -0,0 +1,15 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2011-2024 JP Richardson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
6
+ (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
7
+ merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
15
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ {"name":"fs-extra","author":"JP Richardson <jprichardson@gmail.com>","version":"11.3.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -0,0 +1 @@
1
+ export = any;
@@ -0,0 +1,218 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 200:
6
+ /***/ (function(module) {
7
+
8
+
9
+
10
+ /*
11
+ cycle.js
12
+ 2015-02-25
13
+
14
+ Public Domain.
15
+
16
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
17
+
18
+ This code should be minified before deployment.
19
+ See http://javascript.crockford.com/jsmin.html
20
+
21
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
22
+ NOT CONTROL.
23
+ */
24
+
25
+ /*jslint eval, for */
26
+
27
+ /*property
28
+ $ref, apply, call, decycle, hasOwnProperty, length, prototype, push,
29
+ retrocycle, stringify, test, toString
30
+ */
31
+
32
+ /**
33
+ * Universal module definition https://github.com/umdjs/umd
34
+ */
35
+
36
+ (function (global, factory) {
37
+ typeof define === 'function' && define.amd
38
+ ? define(factory)
39
+ : true && module.exports
40
+ ? (module.exports = factory)
41
+ : (global.json = factory)
42
+ })(this, function () {
43
+ function decycle(object) {
44
+ var objects = [], // Keep a reference to each unique object or array
45
+ paths = []; // Keep the path to each unique object or array
46
+
47
+ return (function derez(value, path) {
48
+ // The derez recurses through the object, producing the deep copy.
49
+
50
+ var i, // The loop counter
51
+ name, // Property name
52
+ nu; // The new object or array
53
+
54
+ var _value = value
55
+
56
+ try {
57
+ _value = value.toJSON()
58
+ } catch (error) {}
59
+
60
+ // typeof null === 'object', so go on if this value is really an object but not
61
+ // one of the weird builtin objects.
62
+
63
+ if (typeof _value === 'object' && _value) {
64
+ // If the value is an object or array, look to see if we have already
65
+ // encountered it. If so, return a $ref/path object. This is a hard way,
66
+ // linear search that will get slower as the number of unique objects grows.
67
+
68
+ for (i = 0; i < objects.length; i += 1) {
69
+ if (objects[i] === _value) {
70
+ return {$ref: paths[i]};
71
+ }
72
+ }
73
+
74
+ // Otherwise, accumulate the unique value and its path.
75
+
76
+ objects.push(_value);
77
+ paths.push(path);
78
+
79
+ // If it is an array, replicate the array.
80
+
81
+ if (Object.prototype.toString.apply(_value) === '[object Array]') {
82
+ nu = [];
83
+
84
+ for (i = 0; i < _value.length; i += 1) {
85
+ nu[i] = derez(_value[i], path + '[' + i + ']');
86
+ }
87
+ } else {
88
+
89
+ // If it is an object, replicate the object.
90
+
91
+ nu = {};
92
+
93
+ for (name in _value) {
94
+ if (Object.prototype.hasOwnProperty.call(_value, name)) {
95
+ nu[name] = derez(_value[name],
96
+ path + '[' + JSON.stringify(name) + ']');
97
+ }
98
+ }
99
+ }
100
+
101
+ return nu;
102
+ }
103
+
104
+ return _value;
105
+ }(object, '$'));
106
+ }
107
+
108
+ function retrocycle($) {
109
+ var px = /^\$(?:\[(?:\d+|\"(?:[^\\\"\u0000-\u001f]|\\([\\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\])*$/;
110
+
111
+ (function rez(value) {
112
+ // The rez function walks recursively through the object looking for $ref
113
+ // properties. When it finds one that has a value that is a path, then it
114
+ // replaces the $ref object with a reference to the value that is found by
115
+ // the path.
116
+
117
+ var i, item, name, path;
118
+
119
+ if (value && typeof value === 'object') {
120
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
121
+ for (i = 0; i < value.length; i += 1) {
122
+ item = value[i];
123
+
124
+ if (item && typeof item === 'object') {
125
+ path = item.$ref;
126
+
127
+ if (typeof path === 'string' && px.test(path)) {
128
+ value[i] = eval(path);
129
+ } else {
130
+ rez(item);
131
+ }
132
+ }
133
+ }
134
+ } else {
135
+ for (name in value) {
136
+ if (typeof value[name] === 'object') {
137
+ item = value[name];
138
+
139
+ if (item) {
140
+ path = item.$ref;
141
+
142
+ if (typeof path === 'string' && px.test(path)) {
143
+ value[name] = eval(path);
144
+ } else {
145
+ rez(item);
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ }($));
153
+
154
+ return $;
155
+ }
156
+
157
+ return {
158
+ decycle : decycle,
159
+ retrocycle : retrocycle,
160
+ stringify : function (object, replacer, space) {
161
+ return JSON.stringify(decycle(object), replacer, space)
162
+ },
163
+ parse : function ($, reviver) {
164
+ return retrocycle(JSON.parse($, reviver))
165
+ }
166
+ }
167
+ }())
168
+
169
+
170
+ /***/ })
171
+
172
+ /******/ });
173
+ /************************************************************************/
174
+ /******/ // The module cache
175
+ /******/ var __webpack_module_cache__ = {};
176
+ /******/
177
+ /******/ // The require function
178
+ /******/ function __nccwpck_require__(moduleId) {
179
+ /******/ // Check if module is in cache
180
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
181
+ /******/ if (cachedModule !== undefined) {
182
+ /******/ return cachedModule.exports;
183
+ /******/ }
184
+ /******/ // Create a new module (and put it into the cache)
185
+ /******/ var module = __webpack_module_cache__[moduleId] = {
186
+ /******/ // no module.id needed
187
+ /******/ // no module.loaded needed
188
+ /******/ exports: {}
189
+ /******/ };
190
+ /******/
191
+ /******/ // Execute the module function
192
+ /******/ var threw = true;
193
+ /******/ try {
194
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
195
+ /******/ threw = false;
196
+ /******/ } finally {
197
+ /******/ if(threw) delete __webpack_module_cache__[moduleId];
198
+ /******/ }
199
+ /******/
200
+ /******/ // Return the exports of the module
201
+ /******/ return module.exports;
202
+ /******/ }
203
+ /******/
204
+ /************************************************************************/
205
+ /******/ /* webpack/runtime/compat */
206
+ /******/
207
+ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
208
+ /******/
209
+ /************************************************************************/
210
+ /******/
211
+ /******/ // startup
212
+ /******/ // Load entry module and return exports
213
+ /******/ // This entry module is referenced by other modules so it can't be inlined
214
+ /******/ var __webpack_exports__ = __nccwpck_require__(200);
215
+ /******/ module.exports = __webpack_exports__;
216
+ /******/
217
+ /******/ })()
218
+ ;
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Valery Barysok
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1 @@
1
+ {"name":"json-cycle","author":"Valery Barysok <valery.barysok@gmail.com>","version":"1.5.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
package/dist/336.cjs ADDED
@@ -0,0 +1,351 @@
1
+ "use strict";
2
+ exports.ids = [
3
+ "336"
4
+ ], exports.modules = {
5
+ "../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
6
+ let isDockerCached, cachedResult;
7
+ __webpack_require__.d(__webpack_exports__, {
8
+ default: ()=>node_modules_open
9
+ });
10
+ var external_node_process_ = __webpack_require__("node:process"), external_node_buffer_ = __webpack_require__("node:buffer"), external_node_path_ = __webpack_require__("node:path"), external_node_url_ = __webpack_require__("node:url"), external_node_util_ = __webpack_require__("node:util"), external_node_child_process_ = __webpack_require__("node:child_process"), promises_ = __webpack_require__("node:fs/promises"), external_node_os_ = __webpack_require__("node:os"), external_node_fs_ = __webpack_require__("node:fs");
11
+ function isInsideContainer() {
12
+ return void 0 === cachedResult && (cachedResult = (()=>{
13
+ try {
14
+ return external_node_fs_.statSync('/run/.containerenv'), !0;
15
+ } catch {
16
+ return !1;
17
+ }
18
+ })() || (void 0 === isDockerCached && (isDockerCached = function() {
19
+ try {
20
+ return external_node_fs_.statSync('/.dockerenv'), !0;
21
+ } catch {
22
+ return !1;
23
+ }
24
+ }() || function() {
25
+ try {
26
+ return external_node_fs_.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
27
+ } catch {
28
+ return !1;
29
+ }
30
+ }()), isDockerCached)), cachedResult;
31
+ }
32
+ let isWsl = ()=>{
33
+ if ('linux' !== external_node_process_.platform) return !1;
34
+ if (external_node_os_.release().toLowerCase().includes('microsoft')) return !isInsideContainer();
35
+ try {
36
+ return !!external_node_fs_.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') && !isInsideContainer();
37
+ } catch {
38
+ return !1;
39
+ }
40
+ }, is_wsl = external_node_process_.env.__IS_WSL_TEST__ ? isWsl : isWsl(), wslDrivesMountPoint = (()=>{
41
+ let mountPoint, defaultMountPoint = '/mnt/';
42
+ return async function() {
43
+ if (mountPoint) return mountPoint;
44
+ let configFilePath = '/etc/wsl.conf', isConfigFileExists = !1;
45
+ try {
46
+ await promises_.access(configFilePath, promises_.constants.F_OK), isConfigFileExists = !0;
47
+ } catch {}
48
+ if (!isConfigFileExists) return defaultMountPoint;
49
+ let configContent = await promises_.readFile(configFilePath, {
50
+ encoding: 'utf8'
51
+ }), configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
52
+ return configMountPoint ? mountPoint = (mountPoint = configMountPoint.groups.mountPoint.trim()).endsWith('/') ? mountPoint : `${mountPoint}/` : defaultMountPoint;
53
+ };
54
+ })(), powerShellPathFromWsl = async ()=>{
55
+ let mountPoint = await wslDrivesMountPoint();
56
+ return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
57
+ }, powerShellPath = async ()=>is_wsl ? powerShellPathFromWsl() : `${external_node_process_.env.SYSTEMROOT || external_node_process_.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
58
+ function defineLazyProperty(object, propertyName, valueGetter) {
59
+ let define = (value)=>Object.defineProperty(object, propertyName, {
60
+ value,
61
+ enumerable: !0,
62
+ writable: !0
63
+ });
64
+ return Object.defineProperty(object, propertyName, {
65
+ configurable: !0,
66
+ enumerable: !0,
67
+ get () {
68
+ let result = valueGetter();
69
+ return define(result), result;
70
+ },
71
+ set (value) {
72
+ define(value);
73
+ }
74
+ }), object;
75
+ }
76
+ let execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile);
77
+ async function defaultBrowserId() {
78
+ if ('darwin' !== external_node_process_.platform) throw Error('macOS only');
79
+ let { stdout } = await execFileAsync('defaults', [
80
+ 'read',
81
+ 'com.apple.LaunchServices/com.apple.launchservices.secure',
82
+ 'LSHandlers'
83
+ ]), match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
84
+ return match?.groups.id ?? 'com.apple.Safari';
85
+ }
86
+ let run_applescript_execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile);
87
+ async function runAppleScript(script, { humanReadableOutput = !0 } = {}) {
88
+ if ('darwin' !== external_node_process_.platform) throw Error('macOS only');
89
+ let { stdout } = await run_applescript_execFileAsync("osascript", [
90
+ '-e',
91
+ script,
92
+ humanReadableOutput ? [] : [
93
+ '-ss'
94
+ ]
95
+ ]);
96
+ return stdout.trim();
97
+ }
98
+ async function bundleName(bundleId) {
99
+ return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
100
+ }
101
+ let windows_execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile), windowsBrowserProgIds = {
102
+ AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {
103
+ name: 'Edge',
104
+ id: 'com.microsoft.edge.old'
105
+ },
106
+ MSEdgeDHTML: {
107
+ name: 'Edge',
108
+ id: 'com.microsoft.edge'
109
+ },
110
+ MSEdgeHTM: {
111
+ name: 'Edge',
112
+ id: 'com.microsoft.edge'
113
+ },
114
+ 'IE.HTTP': {
115
+ name: 'Internet Explorer',
116
+ id: 'com.microsoft.ie'
117
+ },
118
+ FirefoxURL: {
119
+ name: 'Firefox',
120
+ id: 'org.mozilla.firefox'
121
+ },
122
+ ChromeHTML: {
123
+ name: 'Chrome',
124
+ id: 'com.google.chrome'
125
+ },
126
+ BraveHTML: {
127
+ name: 'Brave',
128
+ id: 'com.brave.Browser'
129
+ },
130
+ BraveBHTML: {
131
+ name: 'Brave Beta',
132
+ id: 'com.brave.Browser.beta'
133
+ },
134
+ BraveSSHTM: {
135
+ name: 'Brave Nightly',
136
+ id: 'com.brave.Browser.nightly'
137
+ }
138
+ };
139
+ class UnknownBrowserError extends Error {
140
+ }
141
+ async function defaultBrowser(_execFileAsync = windows_execFileAsync) {
142
+ let { stdout } = await _execFileAsync('reg', [
143
+ 'QUERY',
144
+ ' HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice',
145
+ '/v',
146
+ 'ProgId'
147
+ ]), match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
148
+ if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
149
+ let { id } = match.groups, browser = windowsBrowserProgIds[id];
150
+ if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
151
+ return browser;
152
+ }
153
+ let default_browser_execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile);
154
+ async function default_browser_defaultBrowser() {
155
+ if ('darwin' === external_node_process_.platform) {
156
+ let id = await defaultBrowserId();
157
+ return {
158
+ name: await bundleName(id),
159
+ id
160
+ };
161
+ }
162
+ if ('linux' === external_node_process_.platform) {
163
+ let { stdout } = await default_browser_execFileAsync('xdg-mime', [
164
+ 'query',
165
+ 'default',
166
+ 'x-scheme-handler/http'
167
+ ]), id = stdout.trim();
168
+ return {
169
+ name: id.replace(/.desktop$/, '').replace('-', ' ').toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x)=>x.toUpperCase()),
170
+ id
171
+ };
172
+ }
173
+ if ('win32' === external_node_process_.platform) return defaultBrowser();
174
+ throw Error('Only macOS, Linux, and Windows are supported');
175
+ }
176
+ let execFile = (0, external_node_util_.promisify)(external_node_child_process_.execFile), open_dirname = external_node_path_.dirname((0, external_node_url_.fileURLToPath)(__rslib_import_meta_url__)), localXdgOpenPath = external_node_path_.join(open_dirname, 'xdg-open'), { platform, arch } = external_node_process_;
177
+ async function getWindowsDefaultBrowserFromWsl() {
178
+ let powershellPath = await powerShellPath(), rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, encodedCommand = external_node_buffer_.Buffer.from(rawCommand, 'utf16le').toString('base64'), { stdout } = await execFile(powershellPath, [
179
+ '-NoProfile',
180
+ '-NonInteractive',
181
+ '-ExecutionPolicy',
182
+ 'Bypass',
183
+ '-EncodedCommand',
184
+ encodedCommand
185
+ ], {
186
+ encoding: 'utf8'
187
+ }), progId = stdout.trim(), browserMap = {
188
+ ChromeHTML: 'com.google.chrome',
189
+ BraveHTML: 'com.brave.Browser',
190
+ MSEdgeHTM: 'com.microsoft.edge',
191
+ FirefoxURL: 'org.mozilla.firefox'
192
+ };
193
+ return browserMap[progId] ? {
194
+ id: browserMap[progId]
195
+ } : {};
196
+ }
197
+ let pTryEach = async (array, mapper)=>{
198
+ let latestError;
199
+ for (let item of array)try {
200
+ return await mapper(item);
201
+ } catch (error) {
202
+ latestError = error;
203
+ }
204
+ throw latestError;
205
+ }, baseOpen = async (options)=>{
206
+ let command;
207
+ if (Array.isArray((options = {
208
+ wait: !1,
209
+ background: !1,
210
+ newInstance: !1,
211
+ allowNonzeroExitCode: !1,
212
+ ...options
213
+ }).app)) return pTryEach(options.app, (singleApp)=>baseOpen({
214
+ ...options,
215
+ app: singleApp
216
+ }));
217
+ let { name: app, arguments: appArguments = [] } = options.app ?? {};
218
+ if (appArguments = [
219
+ ...appArguments
220
+ ], Array.isArray(app)) return pTryEach(app, (appName)=>baseOpen({
221
+ ...options,
222
+ app: {
223
+ name: appName,
224
+ arguments: appArguments
225
+ }
226
+ }));
227
+ if ('browser' === app || 'browserPrivate' === app) {
228
+ let ids = {
229
+ 'com.google.chrome': 'chrome',
230
+ 'google-chrome.desktop': 'chrome',
231
+ 'com.brave.Browser': 'brave',
232
+ 'org.mozilla.firefox': 'firefox',
233
+ 'firefox.desktop': 'firefox',
234
+ 'com.microsoft.msedge': 'edge',
235
+ 'com.microsoft.edge': 'edge',
236
+ 'com.microsoft.edgemac': 'edge',
237
+ 'microsoft-edge.desktop': 'edge'
238
+ }, browser = is_wsl ? await getWindowsDefaultBrowserFromWsl() : await default_browser_defaultBrowser();
239
+ if (browser.id in ids) {
240
+ let browserName = ids[browser.id];
241
+ return 'browserPrivate' === app && appArguments.push({
242
+ chrome: '--incognito',
243
+ brave: '--incognito',
244
+ firefox: '--private-window',
245
+ edge: '--inPrivate'
246
+ }[browserName]), baseOpen({
247
+ ...options,
248
+ app: {
249
+ name: apps[browserName],
250
+ arguments: appArguments
251
+ }
252
+ });
253
+ }
254
+ throw Error(`${browser.name} is not supported as a default browser`);
255
+ }
256
+ let cliArguments = [], childProcessOptions = {};
257
+ if ('darwin' === platform) command = 'open', options.wait && cliArguments.push('--wait-apps'), options.background && cliArguments.push('--background'), options.newInstance && cliArguments.push('--new'), app && cliArguments.push('-a', app);
258
+ else if ('win32' !== platform && (!is_wsl || isInsideContainer() || app)) {
259
+ if (app) command = app;
260
+ else {
261
+ let exeLocalXdgOpen = !1;
262
+ try {
263
+ await promises_.access(localXdgOpenPath, promises_.constants.X_OK), exeLocalXdgOpen = !0;
264
+ } catch {}
265
+ command = external_node_process_.versions.electron ?? ('android' === platform || !open_dirname || '/' === open_dirname || !exeLocalXdgOpen) ? 'xdg-open' : localXdgOpenPath;
266
+ }
267
+ appArguments.length > 0 && cliArguments.push(...appArguments), options.wait || (childProcessOptions.stdio = 'ignore', childProcessOptions.detached = !0);
268
+ } else {
269
+ command = await powerShellPath(), cliArguments.push('-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand'), is_wsl || (childProcessOptions.windowsVerbatimArguments = !0);
270
+ let encodedArguments = [
271
+ 'Start'
272
+ ];
273
+ options.wait && encodedArguments.push('-Wait'), app ? (encodedArguments.push(`"\`"${app}\`""`), options.target && appArguments.push(options.target)) : options.target && encodedArguments.push(`"${options.target}"`), appArguments.length > 0 && encodedArguments.push('-ArgumentList', (appArguments = appArguments.map((argument)=>`"\`"${argument}\`""`)).join(',')), options.target = external_node_buffer_.Buffer.from(encodedArguments.join(' '), 'utf16le').toString('base64');
274
+ }
275
+ 'darwin' === platform && appArguments.length > 0 && cliArguments.push('--args', ...appArguments), options.target && cliArguments.push(options.target);
276
+ let subprocess = external_node_child_process_.spawn(command, cliArguments, childProcessOptions);
277
+ return options.wait ? new Promise((resolve, reject)=>{
278
+ subprocess.once('error', reject), subprocess.once('close', (exitCode)=>{
279
+ if (!options.allowNonzeroExitCode && exitCode > 0) return void reject(Error(`Exited with code ${exitCode}`));
280
+ resolve(subprocess);
281
+ });
282
+ }) : (subprocess.unref(), subprocess);
283
+ };
284
+ function detectArchBinary(binary) {
285
+ if ('string' == typeof binary || Array.isArray(binary)) return binary;
286
+ let { [arch]: archBinary } = binary;
287
+ if (!archBinary) throw Error(`${arch} is not supported`);
288
+ return archBinary;
289
+ }
290
+ function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
291
+ if (wsl && is_wsl) return detectArchBinary(wsl);
292
+ if (!platformBinary) throw Error(`${platform} is not supported`);
293
+ return detectArchBinary(platformBinary);
294
+ }
295
+ let apps = {};
296
+ defineLazyProperty(apps, 'chrome', ()=>detectPlatformBinary({
297
+ darwin: 'google chrome',
298
+ win32: 'chrome',
299
+ linux: [
300
+ 'google-chrome',
301
+ 'google-chrome-stable',
302
+ 'chromium'
303
+ ]
304
+ }, {
305
+ wsl: {
306
+ ia32: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe',
307
+ x64: [
308
+ '/mnt/c/Program Files/Google/Chrome/Application/chrome.exe',
309
+ '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'
310
+ ]
311
+ }
312
+ })), defineLazyProperty(apps, 'brave', ()=>detectPlatformBinary({
313
+ darwin: 'brave browser',
314
+ win32: 'brave',
315
+ linux: [
316
+ 'brave-browser',
317
+ 'brave'
318
+ ]
319
+ }, {
320
+ wsl: {
321
+ ia32: '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe',
322
+ x64: [
323
+ '/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe',
324
+ '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'
325
+ ]
326
+ }
327
+ })), defineLazyProperty(apps, 'firefox', ()=>detectPlatformBinary({
328
+ darwin: 'firefox',
329
+ win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
330
+ linux: 'firefox'
331
+ }, {
332
+ wsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe'
333
+ })), defineLazyProperty(apps, 'edge', ()=>detectPlatformBinary({
334
+ darwin: 'microsoft edge',
335
+ win32: 'msedge',
336
+ linux: [
337
+ 'microsoft-edge',
338
+ 'microsoft-edge-dev'
339
+ ]
340
+ }, {
341
+ wsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
342
+ })), defineLazyProperty(apps, 'browser', ()=>'browser'), defineLazyProperty(apps, 'browserPrivate', ()=>'browserPrivate');
343
+ let node_modules_open = (target, options)=>{
344
+ if ('string' != typeof target) throw TypeError('Expected a `target`');
345
+ return baseOpen({
346
+ ...options,
347
+ target
348
+ });
349
+ };
350
+ }
351
+ };