@wix/cli-app 1.1.51 → 1.1.53

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 (100) hide show
  1. package/build/CreateVersionCommand-2W37YQW4.js +4 -0
  2. package/build/{CreateVersionCommand-6QSWW7PH.js.map → CreateVersionCommand-2W37YQW4.js.map} +1 -1
  3. package/build/DevCommand-JDHE7RQB.js +4 -0
  4. package/build/DevCommand-JDHE7RQB.js.map +1 -0
  5. package/build/GenerateCommand-3PPXF4B6.js +128 -0
  6. package/build/GenerateCommand-3PPXF4B6.js.map +1 -0
  7. package/build/LogsCommand-LQKTBY6D.js +4 -0
  8. package/build/LogsCommand-LQKTBY6D.js.map +1 -0
  9. package/build/PreviewCommand-H3HVD7DH.js +4 -0
  10. package/build/ServeCommand-RHONEHTF.js +4 -0
  11. package/build/{ServeCommand-BKLVSLW3.js.map → ServeCommand-RHONEHTF.js.map} +1 -1
  12. package/build/build-QN6TGE3Q.js +4 -0
  13. package/build/build-QN6TGE3Q.js.map +1 -0
  14. package/build/{chunk-GF6CV6CZ.js → chunk-2W2YJZP5.js} +29 -29
  15. package/build/chunk-2W2YJZP5.js.map +1 -0
  16. package/build/{chunk-5OKXHNO2.js → chunk-4CCKO52Z.js} +2 -2
  17. package/build/chunk-5OZZ7R6I.js +11 -0
  18. package/build/chunk-5OZZ7R6I.js.map +1 -0
  19. package/build/{chunk-NYC4UPCI.js → chunk-AXAJ7DJ4.js} +2 -2
  20. package/build/{chunk-MM7OD345.js → chunk-B5P4JHUW.js} +177 -128
  21. package/build/chunk-B5P4JHUW.js.map +1 -0
  22. package/build/{chunk-YXZSFVXG.js → chunk-C3O7WWDR.js} +2 -2
  23. package/build/{chunk-VOW75NWO.js → chunk-DLQYJEV6.js} +2 -2
  24. package/build/chunk-F6MVNSX2.js +4 -0
  25. package/build/chunk-F6MVNSX2.js.map +1 -0
  26. package/build/chunk-FVG3T57Z.js +4 -0
  27. package/build/{chunk-ZWY7YSYP.js → chunk-HILXNAWZ.js} +2 -2
  28. package/build/chunk-LDGXTJLC.js +4 -0
  29. package/build/chunk-LDGXTJLC.js.map +1 -0
  30. package/build/{chunk-7YIQAWRD.js → chunk-PSQ4AQFG.js} +2 -2
  31. package/build/{chunk-M7777RXR.js → chunk-QXIKCJLU.js} +3 -3
  32. package/build/{chunk-M7777RXR.js.map → chunk-QXIKCJLU.js.map} +1 -1
  33. package/build/{chunk-V3QQTT5C.js → chunk-SZ5JWJ4Q.js} +2 -2
  34. package/build/{chunk-IOW53RH7.js → chunk-TSAKYUDG.js} +2 -2
  35. package/build/{chunk-LYCV7HBR.js → chunk-WXOIL7LC.js} +2 -2
  36. package/build/chunk-YIGHU6O6.js +4 -0
  37. package/build/chunk-YIGHU6O6.js.map +1 -0
  38. package/build/chunk-YMRYABCG.js +115 -0
  39. package/build/chunk-YMRYABCG.js.map +1 -0
  40. package/build/cloudflare-runtime/entry.js +9 -2
  41. package/build/cloudflare-runtime/getRegisteredExtensions.js +9 -2
  42. package/build/index.js +2 -2
  43. package/build/index.js.map +1 -1
  44. package/build/platform-sdk/chunk-32RIHE6N.js +2 -0
  45. package/build/platform-sdk/{chunk-KEIVYRQX.js.map → chunk-32RIHE6N.js.map} +1 -1
  46. package/build/platform-sdk/dashboard.js +1 -1
  47. package/build/platform-sdk/editor.js +6 -6
  48. package/build/platform-sdk/editor.js.map +1 -1
  49. package/build/platform-sdk/site.js +1 -1
  50. package/build/preview-457BTAHF.js +4 -0
  51. package/build/preview-457BTAHF.js.map +1 -0
  52. package/build/render-command-W6CY3R4Q.js +4 -0
  53. package/build/render-command-W6CY3R4Q.js.map +1 -0
  54. package/internal/component-hmr-wrapper.tsx +9 -9
  55. package/package.json +5 -5
  56. package/templates/custom-element/dependencies.json +1 -1
  57. package/templates/dashboard-modal/files/modal.tsx.ejs +2 -2
  58. package/templates/dashboard-plugin/files/plugin.tsx.ejs +1 -1
  59. package/templates/site-plugin/dependencies.json +1 -1
  60. package/templates/site-plugin/files/plugin.tsx.ejs +1 -0
  61. package/build/CreateVersionCommand-6QSWW7PH.js +0 -4
  62. package/build/DevCommand-L3OC7OUZ.js +0 -4
  63. package/build/DevCommand-L3OC7OUZ.js.map +0 -1
  64. package/build/GenerateCommand-K5IS2QEG.js +0 -99
  65. package/build/GenerateCommand-K5IS2QEG.js.map +0 -1
  66. package/build/LogsCommand-5TTBMWFF.js +0 -4
  67. package/build/LogsCommand-5TTBMWFF.js.map +0 -1
  68. package/build/PreviewCommand-RCGDUERX.js +0 -4
  69. package/build/ServeCommand-BKLVSLW3.js +0 -4
  70. package/build/build-OSBBPACR.js +0 -4
  71. package/build/build-OSBBPACR.js.map +0 -1
  72. package/build/chunk-5UV5L6RZ.js +0 -4
  73. package/build/chunk-EUNKG7JY.js +0 -11
  74. package/build/chunk-EUNKG7JY.js.map +0 -1
  75. package/build/chunk-GF6CV6CZ.js.map +0 -1
  76. package/build/chunk-L2GYA6RW.js +0 -115
  77. package/build/chunk-L2GYA6RW.js.map +0 -1
  78. package/build/chunk-MM7OD345.js.map +0 -1
  79. package/build/chunk-VXMDSBPO.js +0 -4
  80. package/build/chunk-VXMDSBPO.js.map +0 -1
  81. package/build/chunk-YFYESJ2A.js +0 -4
  82. package/build/chunk-YFYESJ2A.js.map +0 -1
  83. package/build/chunk-YIQOAFCK.js +0 -4
  84. package/build/chunk-YIQOAFCK.js.map +0 -1
  85. package/build/platform-sdk/chunk-KEIVYRQX.js +0 -2
  86. package/build/preview-FY5YKH5Z.js +0 -4
  87. package/build/preview-FY5YKH5Z.js.map +0 -1
  88. package/build/render-command-4BGZ4KYD.js +0 -4
  89. package/build/render-command-4BGZ4KYD.js.map +0 -1
  90. /package/build/{PreviewCommand-RCGDUERX.js.map → PreviewCommand-H3HVD7DH.js.map} +0 -0
  91. /package/build/{chunk-5OKXHNO2.js.map → chunk-4CCKO52Z.js.map} +0 -0
  92. /package/build/{chunk-NYC4UPCI.js.map → chunk-AXAJ7DJ4.js.map} +0 -0
  93. /package/build/{chunk-YXZSFVXG.js.map → chunk-C3O7WWDR.js.map} +0 -0
  94. /package/build/{chunk-VOW75NWO.js.map → chunk-DLQYJEV6.js.map} +0 -0
  95. /package/build/{chunk-5UV5L6RZ.js.map → chunk-FVG3T57Z.js.map} +0 -0
  96. /package/build/{chunk-ZWY7YSYP.js.map → chunk-HILXNAWZ.js.map} +0 -0
  97. /package/build/{chunk-7YIQAWRD.js.map → chunk-PSQ4AQFG.js.map} +0 -0
  98. /package/build/{chunk-V3QQTT5C.js.map → chunk-SZ5JWJ4Q.js.map} +0 -0
  99. /package/build/{chunk-IOW53RH7.js.map → chunk-TSAKYUDG.js.map} +0 -0
  100. /package/build/{chunk-LYCV7HBR.js.map → chunk-WXOIL7LC.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/cloudflared/lib/constants.js","../../../node_modules/cloudflared/lib/error.js","../../../node_modules/cloudflared/lib/install.js","../../../node_modules/cloudflared/lib/regex.js","../../../node_modules/cloudflared/lib/tunnel.js","../../../node_modules/cloudflared/lib/service.js","../../../node_modules/cloudflared/lib/lib.js","../../cli-tunnel/src/useTunnel.ts","../../cli-tunnel/src/tunnel.ts","../../cli-tunnel/src/bi/events.ts","../../cli-tunnel/src/useTunnelClient.ts","../../cli-tunnel/src/client.ts","../../../node_modules/@wix/ambassador-apps-hosting-v1-deployment/http.impl.ts","../../cli-tunnel/src/schemas.ts","../../cli-tunnel/src/index.ts"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target, mod));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar constants_exports = {};\n__export(constants_exports, {\n CLOUDFLARED_VERSION: () => CLOUDFLARED_VERSION,\n DEFAULT_CLOUDFLARED_BIN: () => DEFAULT_CLOUDFLARED_BIN,\n RELEASE_BASE: () => RELEASE_BASE,\n bin: () => bin,\n use: () => use\n});\nmodule.exports = __toCommonJS(constants_exports);\nvar import_node_path = __toESM(require(\"node:path\"));\nconst DEFAULT_CLOUDFLARED_BIN = import_node_path.default.join(__dirname, \"..\", \"bin\", process.platform === \"win32\" ? \"cloudflared.exe\" : \"cloudflared\");\nlet bin = process.env.CLOUDFLARED_BIN || DEFAULT_CLOUDFLARED_BIN;\nfunction use(executable) {\n bin = executable;\n}\nconst CLOUDFLARED_VERSION = process.env.CLOUDFLARED_VERSION || \"latest\";\nconst RELEASE_BASE = \"https://github.com/cloudflare/cloudflared/releases/\";\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n CLOUDFLARED_VERSION,\n DEFAULT_CLOUDFLARED_BIN,\n RELEASE_BASE,\n bin,\n use\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar error_exports = {};\n__export(error_exports, {\n UnsupportedError: () => UnsupportedError\n});\nmodule.exports = __toCommonJS(error_exports);\nclass UnsupportedError extends Error {\n constructor(message) {\n super(message);\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n UnsupportedError\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target, mod));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar install_exports = {};\n__export(install_exports, {\n install: () => install,\n install_linux: () => install_linux,\n install_macos: () => install_macos,\n install_windows: () => install_windows\n});\nmodule.exports = __toCommonJS(install_exports);\nvar import_node_fs = __toESM(require(\"node:fs\"));\nvar import_node_path = __toESM(require(\"node:path\"));\nvar import_node_https = __toESM(require(\"node:https\"));\nvar import_node_child_process = require(\"node:child_process\");\nvar import_constants = require(\"./constants\");\nvar import_error = require(\"./error\");\nconst LINUX_URL = {\n arm64: \"cloudflared-linux-arm64\",\n arm: \"cloudflared-linux-arm\",\n x64: \"cloudflared-linux-amd64\",\n ia32: \"cloudflared-linux-386\"\n};\nconst MACOS_URL = {\n arm64: \"cloudflared-darwin-amd64.tgz\",\n x64: \"cloudflared-darwin-amd64.tgz\"\n};\nconst WINDOWS_URL = {\n x64: \"cloudflared-windows-amd64.exe\",\n ia32: \"cloudflared-windows-386.exe\"\n};\nfunction resolve_base(version) {\n if (version === \"latest\") {\n return `${import_constants.RELEASE_BASE}latest/download/`;\n }\n return `${import_constants.RELEASE_BASE}download/${version}/`;\n}\nasync function install(to, version = import_constants.CLOUDFLARED_VERSION) {\n if (process.platform === \"linux\") {\n return install_linux(to, version);\n } else if (process.platform === \"darwin\") {\n return install_macos(to, version);\n } else if (process.platform === \"win32\") {\n return install_windows(to, version);\n } else {\n throw new import_error.UnsupportedError(\"Unsupported platform: \" + process.platform);\n }\n}\nasync function install_linux(to, version = import_constants.CLOUDFLARED_VERSION) {\n const file = LINUX_URL[process.arch];\n if (file === void 0) {\n throw new import_error.UnsupportedError(\"Unsupported architecture: \" + process.arch);\n }\n await download(resolve_base(version) + file, to);\n import_node_fs.default.chmodSync(to, \"755\");\n return to;\n}\nasync function install_macos(to, version = import_constants.CLOUDFLARED_VERSION) {\n const file = MACOS_URL[process.arch];\n if (file === void 0) {\n throw new import_error.UnsupportedError(\"Unsupported architecture: \" + process.arch);\n }\n await download(resolve_base(version) + file, `${to}.tgz`);\n process.env.VERBOSE && console.log(`Extracting to ${to}`);\n (0, import_node_child_process.execSync)(`tar -xzf ${import_node_path.default.basename(`${to}.tgz`)}`, { cwd: import_node_path.default.dirname(to) });\n import_node_fs.default.unlinkSync(`${to}.tgz`);\n import_node_fs.default.renameSync(`${import_node_path.default.dirname(to)}/cloudflared`, to);\n return to;\n}\nasync function install_windows(to, version = import_constants.CLOUDFLARED_VERSION) {\n const file = WINDOWS_URL[process.arch];\n if (file === void 0) {\n throw new import_error.UnsupportedError(\"Unsupported architecture: \" + process.arch);\n }\n await download(resolve_base(version) + file, to);\n return to;\n}\nfunction download(url, to, redirect = 0) {\n if (redirect === 0) {\n process.env.VERBOSE && console.log(`Downloading ${url} to ${to}`);\n } else {\n process.env.VERBOSE && console.log(`Redirecting to ${url}`);\n }\n if (!import_node_fs.default.existsSync(import_node_path.default.dirname(to))) {\n import_node_fs.default.mkdirSync(import_node_path.default.dirname(to), { recursive: true });\n }\n return new Promise((resolve, reject) => {\n const request = import_node_https.default.get(url, (res) => {\n const redirect_code = [301, 302, 303, 307, 308];\n if (redirect_code.includes(res.statusCode) && res.headers.location !== void 0) {\n request.destroy();\n const redirection = res.headers.location;\n resolve(download(redirection, to, redirect + 1));\n return;\n }\n if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {\n const file = import_node_fs.default.createWriteStream(to);\n file.on(\"finish\", () => {\n file.close(() => resolve(to));\n });\n file.on(\"error\", (err) => {\n import_node_fs.default.unlink(to, () => reject(err));\n });\n res.pipe(file);\n } else {\n request.destroy();\n reject(new Error(`HTTP response with status code: ${res.statusCode}`));\n }\n });\n request.on(\"error\", (err) => {\n reject(err);\n });\n request.end();\n });\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n install,\n install_linux,\n install_macos,\n install_windows\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar regex_exports = {};\n__export(regex_exports, {\n config_regex: () => config_regex,\n conn_regex: () => conn_regex,\n connectorID_regex: () => connectorID_regex,\n disconnect_regex: () => disconnect_regex,\n index_regex: () => index_regex,\n ip_regex: () => ip_regex,\n location_regex: () => location_regex,\n metrics_regex: () => metrics_regex,\n tunnelID_regex: () => tunnelID_regex\n});\nmodule.exports = __toCommonJS(regex_exports);\nconst conn_regex = /connection[= ]([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;\nconst ip_regex = /ip=([0-9.]+)/;\nconst location_regex = /location=([A-Za-z0-9]+)/;\nconst index_regex = /connIndex=(\\d)/;\nconst disconnect_regex = /Unregistered tunnel connection connIndex=(\\d)/i;\nconst tunnelID_regex = /tunnelID=([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;\nconst connectorID_regex = /Connector ID: ([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;\nconst metrics_regex = /metrics server on ([0-9.:]+\\/metrics)/;\nconst config_regex = /config=\"(.+[^\\\\])\"/;\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n config_regex,\n conn_regex,\n connectorID_regex,\n disconnect_regex,\n index_regex,\n ip_regex,\n location_regex,\n metrics_regex,\n tunnelID_regex\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar tunnel_exports = {};\n__export(tunnel_exports, {\n tunnel: () => tunnel\n});\nmodule.exports = __toCommonJS(tunnel_exports);\nvar import_node_child_process = require(\"node:child_process\");\nvar import_constants = require(\"./constants.js\");\nvar import_regex = require(\"./regex.js\");\nfunction tunnel(options = {}) {\n const args = [\"tunnel\"];\n for (const [key, value] of Object.entries(options)) {\n if (typeof value === \"string\") {\n args.push(`${key}`, value);\n } else if (typeof value === \"number\") {\n args.push(`${key}`, value.toString());\n } else if (value === null) {\n args.push(`${key}`);\n }\n }\n if (args.length === 1) {\n args.push(\"--url\", \"localhost:8080\");\n }\n const child = (0, import_node_child_process.spawn)(import_constants.bin, args, { stdio: [\"ignore\", \"pipe\", \"pipe\"] });\n if (process.env.VERBOSE) {\n child.stdout.pipe(process.stdout);\n child.stderr.pipe(process.stderr);\n }\n const url_regex = /\\|\\s+(https?:\\/\\/[^\\s]+)/;\n let url_resolver = () => void 0;\n let url_rejector = () => void 0;\n const url = new Promise((...pair) => [url_resolver, url_rejector] = pair);\n const connection_resolvers = [];\n const connection_rejectors = [];\n const connections = [];\n for (let i = 0; i < 1; i++) {\n connections.push(new Promise((...pair) => [connection_resolvers[i], connection_rejectors[i]] = pair));\n }\n const parser = (data) => {\n var _a;\n const str = data.toString();\n const url_match = str.match(url_regex);\n url_match && url_resolver(url_match[1]);\n const conn_match = str.match(import_regex.conn_regex);\n const ip_match = str.match(import_regex.ip_regex);\n const location_match = str.match(import_regex.location_regex);\n const index_match = str.match(import_regex.index_regex);\n if (conn_match && ip_match && location_match && index_match) {\n const [, id] = conn_match;\n const [, ip] = ip_match;\n const [, location] = location_match;\n const [, idx] = index_match;\n (_a = connection_resolvers[+idx]) == null ? void 0 : _a.call(connection_resolvers, { id, ip, location });\n }\n };\n child.stdout.on(\"data\", parser).on(\"error\", url_rejector);\n child.stderr.on(\"data\", parser).on(\"error\", url_rejector);\n const stop = () => child.kill(\"SIGINT\");\n return { url, connections, child, stop };\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n tunnel\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target, mod));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar service_exports = {};\n__export(service_exports, {\n AlreadyInstalledError: () => AlreadyInstalledError,\n LINUX_SERVICE_PATH: () => LINUX_SERVICE_PATH,\n MACOS_SERVICE_PATH: () => MACOS_SERVICE_PATH,\n NotInstalledError: () => NotInstalledError,\n clean: () => clean,\n current: () => current,\n err: () => err,\n exists: () => exists,\n identifier: () => identifier,\n install: () => install,\n journal: () => journal,\n log: () => log,\n service: () => service,\n service_name: () => service_name,\n uninstall: () => uninstall\n});\nmodule.exports = __toCommonJS(service_exports);\nvar import_node_os = __toESM(require(\"node:os\"));\nvar import_node_fs = __toESM(require(\"node:fs\"));\nvar import_node_child_process = require(\"node:child_process\");\nvar import_constants = require(\"./constants.js\");\nvar import_regex = require(\"./regex.js\");\nconst identifier = \"com.cloudflare.cloudflared\";\nconst service_name = \"cloudflared.service\";\nconst MACOS_SERVICE_PATH = {\n PLIST: is_root() ? `/Library/LaunchDaemons/${identifier}.plist` : `${import_node_os.default.homedir()}/Library/LaunchAgents/${identifier}.plist`,\n OUT: is_root() ? `/Library/Logs/${identifier}.out.log` : `${import_node_os.default.homedir()}/Library/Logs/${identifier}.out.log`,\n ERR: is_root() ? `/Library/Logs/${identifier}.err.log` : `${import_node_os.default.homedir()}/Library/Logs/${identifier}.err.log`\n};\nconst LINUX_SERVICE_PATH = {\n SYSTEMD: `/etc/systemd/system/${service_name}`,\n SERVICE: \"/etc/init.d/cloudflared\",\n SERVICE_OUT: \"/var/log/cloudflared.log\",\n SERVICE_ERR: \"/var/log/cloudflared.err\"\n};\nconst service = { install, uninstall, exists, log, err, current, clean, journal };\nclass AlreadyInstalledError extends Error {\n constructor() {\n super(\"service is already installed\");\n }\n}\nclass NotInstalledError extends Error {\n constructor() {\n super(\"service is not installed\");\n }\n}\nfunction install(token) {\n if (![\"darwin\", \"linux\"].includes(process.platform)) {\n throw new Error(`Not Implemented on platform ${process.platform}`);\n }\n if (exists()) {\n throw new AlreadyInstalledError();\n }\n const args = [\"service\", \"install\"];\n if (token) {\n args.push(token);\n }\n const result = (0, import_node_child_process.spawnSync)(import_constants.bin, args);\n if (result.status !== 0) {\n throw new Error(`service install failed: ${result.stderr.toString()}`);\n }\n}\nfunction uninstall() {\n if (![\"darwin\", \"linux\"].includes(process.platform)) {\n throw new Error(`Not Implemented on platform ${process.platform}`);\n }\n if (!exists()) {\n throw new NotInstalledError();\n }\n const result = (0, import_node_child_process.spawnSync)(import_constants.bin, [\"service\", \"uninstall\"]);\n if (result.status !== 0) {\n throw new Error(`service uninstall failed: ${result.stderr.toString()}`);\n }\n if (process.platform === \"darwin\") {\n import_node_fs.default.rmSync(MACOS_SERVICE_PATH.OUT);\n import_node_fs.default.rmSync(MACOS_SERVICE_PATH.ERR);\n } else if (process.platform === \"linux\" && !is_systemd()) {\n import_node_fs.default.rmSync(LINUX_SERVICE_PATH.SERVICE_OUT);\n import_node_fs.default.rmSync(LINUX_SERVICE_PATH.SERVICE_ERR);\n }\n}\nfunction log() {\n if (!exists()) {\n throw new NotInstalledError();\n }\n if (process.platform === \"darwin\") {\n return import_node_fs.default.readFileSync(MACOS_SERVICE_PATH.OUT, \"utf8\");\n }\n if (process.platform === \"linux\" && !is_systemd()) {\n return import_node_fs.default.readFileSync(LINUX_SERVICE_PATH.SERVICE_OUT, \"utf8\");\n }\n throw new Error(`Not Implemented on platform ${process.platform}`);\n}\nfunction err() {\n if (!exists()) {\n throw new NotInstalledError();\n }\n if (process.platform === \"darwin\") {\n return import_node_fs.default.readFileSync(MACOS_SERVICE_PATH.ERR, \"utf8\");\n }\n if (process.platform === \"linux\" && !is_systemd()) {\n return import_node_fs.default.readFileSync(LINUX_SERVICE_PATH.SERVICE_ERR, \"utf8\");\n }\n throw new Error(`Not Implemented on platform ${process.platform}`);\n}\nfunction journal(n = 300) {\n if (process.platform === \"linux\" && is_systemd()) {\n const args = [\"-u\", service_name, \"-o\", \"cat\", \"-n\", n.toString()];\n return (0, import_node_child_process.spawnSync)(\"journalctl\", args).stdout.toString();\n }\n throw new Error(`Not Implemented on platform ${process.platform}`);\n}\nfunction current() {\n var _a, _b, _c, _d;\n if (![\"darwin\", \"linux\"].includes(process.platform)) {\n throw new Error(`Not Implemented on platform ${process.platform}`);\n }\n if (!exists()) {\n throw new NotInstalledError();\n }\n const log2 = is_systemd() ? journal() : err();\n let tunnelID = \"\";\n let connectorID = \"\";\n const connections = [];\n let metrics = \"\";\n let config = {};\n for (const line of log2.split(\"\\n\")) {\n try {\n if (line.match(import_regex.tunnelID_regex)) {\n tunnelID = ((_a = line.match(import_regex.tunnelID_regex)) == null ? void 0 : _a[1]) ?? \"\";\n } else if (line.match(import_regex.connectorID_regex)) {\n connectorID = ((_b = line.match(import_regex.connectorID_regex)) == null ? void 0 : _b[1]) ?? \"\";\n } else if (line.match(import_regex.conn_regex) && line.match(import_regex.location_regex) && line.match(import_regex.ip_regex) && line.match(import_regex.index_regex)) {\n const [, id] = line.match(import_regex.conn_regex) ?? [];\n const [, location] = line.match(import_regex.location_regex) ?? [];\n const [, ip] = line.match(import_regex.ip_regex) ?? [];\n const [, idx] = line.match(import_regex.index_regex) ?? [];\n connections[parseInt(idx)] = { id, ip, location };\n } else if (line.match(import_regex.disconnect_regex)) {\n const [, idx] = line.match(import_regex.disconnect_regex) ?? [];\n if (parseInt(idx) in connections) {\n connections[parseInt(idx)] = { id: \"\", ip: \"\", location: \"\" };\n }\n } else if (line.match(import_regex.metrics_regex)) {\n metrics = ((_c = line.match(import_regex.metrics_regex)) == null ? void 0 : _c[1]) ?? \"\";\n } else if (line.match(import_regex.config_regex)) {\n config = JSON.parse(((_d = line.match(import_regex.config_regex)) == null ? void 0 : _d[1].replace(/\\\\/g, \"\")) ?? \"{}\");\n }\n } catch (err2) {\n if (process.env.VERBOSE) {\n console.error(\"log parsing failed\", err2);\n }\n }\n }\n return { tunnelID, connectorID, connections, metrics, config };\n}\nfunction clean() {\n if (process.platform !== \"darwin\") {\n throw new Error(`Not Implemented on platform ${process.platform}`);\n }\n if (exists()) {\n throw new AlreadyInstalledError();\n }\n import_node_fs.default.rmSync(MACOS_SERVICE_PATH.OUT, { force: true });\n import_node_fs.default.rmSync(MACOS_SERVICE_PATH.ERR, { force: true });\n}\nfunction exists() {\n if (process.platform === \"darwin\") {\n return import_node_fs.default.existsSync(MACOS_SERVICE_PATH.PLIST);\n } else if (process.platform === \"linux\") {\n return is_systemd() ? import_node_fs.default.existsSync(LINUX_SERVICE_PATH.SYSTEMD) : import_node_fs.default.existsSync(LINUX_SERVICE_PATH.SERVICE);\n }\n throw new Error(`Not Implemented on platform ${process.platform}`);\n}\nfunction is_root() {\n var _a;\n return ((_a = process.getuid) == null ? void 0 : _a.call(process)) === 0;\n}\nfunction is_systemd() {\n return process.platform === \"linux\" && import_node_fs.default.existsSync(\"/run/systemd/system\");\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n AlreadyInstalledError,\n LINUX_SERVICE_PATH,\n MACOS_SERVICE_PATH,\n NotInstalledError,\n clean,\n current,\n err,\n exists,\n identifier,\n install,\n journal,\n log,\n service,\n service_name,\n uninstall\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar lib_exports = {};\n__export(lib_exports, {\n AlreadyInstalledError: () => import_service.AlreadyInstalledError,\n MACOS_SERVICE_PATH: () => import_service.MACOS_SERVICE_PATH,\n NotInstalledError: () => import_service.NotInstalledError,\n bin: () => import_constants.bin,\n identifier: () => import_service.identifier,\n install: () => import_install.install,\n service: () => import_service.service,\n tunnel: () => import_tunnel.tunnel\n});\nmodule.exports = __toCommonJS(lib_exports);\nvar import_constants = require(\"./constants.js\");\nvar import_install = require(\"./install.js\");\nvar import_tunnel = require(\"./tunnel.js\");\nvar import_service = require(\"./service.js\");\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n AlreadyInstalledError,\n MACOS_SERVICE_PATH,\n NotInstalledError,\n bin,\n identifier,\n install,\n service,\n tunnel\n});\n","import { useCallback, useEffect, useRef } from 'react';\nimport { useBiLogger } from '@wix/cli-telemetry-react';\nimport { launchTunnel } from './tunnel.js';\nimport type { Connection } from './tunnel.js';\nimport { wixCliTunnelBiEvents } from './bi/events.js';\nimport { useTunnelClient } from './useTunnelClient.js';\n\nexport function useTunnel() {\n const connectionRef = useRef<Connection>();\n const tunnelClient = useTunnelClient();\n const biLogger = useBiLogger();\n\n useEffect(() => {\n return () => {\n connectionRef.current?.close();\n };\n }, []);\n\n return useCallback(\n async (port: number) => {\n const biEvents = wixCliTunnelBiEvents(biLogger);\n const tunnelCreationBi = biEvents.tunnel();\n try {\n const tunnel = await launchTunnel(port, tunnelClient);\n connectionRef.current = tunnel;\n tunnelCreationBi.finish({ isSuccess: true });\n return { url: tunnel.domain };\n } catch (ex: unknown) {\n tunnelCreationBi.finish({\n isSuccess: false,\n failureReason: ex instanceof Error ? ex.message : 'Unknown error',\n });\n\n throw ex;\n }\n },\n [tunnelClient, biLogger]\n );\n}\n","import { execa } from 'execa';\nimport { pathExists } from '@wix/cli-fs';\nimport { dirname } from 'node:path';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport { bin, install } from 'cloudflared';\nimport type { TunnelClient } from './client.js';\n\nexport interface Connection {\n close: () => void;\n domain: string;\n}\n\nexport async function launchTunnel(\n port: number,\n tunnelClient: TunnelClient\n): Promise<Connection> {\n const { localTunnel } = getTestOverrides();\n\n if (!localTunnel && !(await pathExists(bin))) {\n try {\n await install(bin);\n } catch (e) {\n const err = e as NodeJS.ErrnoException;\n if (e instanceof Error && err.code === 'EACCES') {\n throw new CliError({\n code: CliErrorCode.FailedInstallCloudflareNoAccess({\n path: dirname(err.path!),\n }),\n });\n }\n throw e;\n }\n }\n\n const tunnel = await tunnelClient.createTunnel({ port });\n const domain = `http${localTunnel ? '' : 's'}://${tunnel.domain}`;\n\n const createTunnelPromise = new Promise<Connection>((resolve, reject) => {\n const tunnelProcess = localTunnel\n ? execa('echo', [tunnel.domain, tunnel.token], { detached: true })\n : execa(bin, ['tunnel', 'run', '--token', tunnel.token]);\n\n const close = () => {\n tunnelProcess.kill();\n };\n\n const listener = async (data: Buffer) => {\n const output = data.toString();\n const match = output.match(tunnel.domain)?.[0];\n\n if (match) {\n resolve({\n domain,\n close,\n });\n }\n };\n\n tunnelProcess.stderr?.on('data', listener);\n tunnelProcess.stdout?.on('data', listener);\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n tunnelProcess.on('error', (err) => {\n reject(err);\n });\n });\n\n return {\n domain,\n close: async () => {\n const tunnel = await createTunnelPromise;\n return tunnel.close();\n },\n };\n}\n","import { wixCliAppsFlowTunnelCreationStatusSrc11Evid5233 } from '@wix/bi-logger-dev-tools-data/v2';\nimport type { BiLogger } from '@wix/cli-telemetry';\n\nexport const wixCliTunnelBiEvents = (biLogger: BiLogger) => ({\n tunnel: () => {\n const startTimestamp = Date.now();\n return {\n finish: ({\n isSuccess,\n failureReason,\n }: {\n isSuccess: boolean;\n failureReason?: string;\n }) => {\n void biLogger.report(\n wixCliAppsFlowTunnelCreationStatusSrc11Evid5233({\n isSuccess,\n failureReason,\n tunnelCreationTime: Date.now() - startTimestamp,\n })\n );\n },\n };\n },\n});\n","import { useMemo } from 'react';\nimport { useHttpClient } from '@wix/cli-http-client-react';\nimport { TunnelClient } from './client.js';\n\nexport function useTunnelClient(): TunnelClient {\n const httpClient = useHttpClient({ type: 'backoffice' });\n return useMemo(() => new TunnelClient(httpClient), [httpClient]);\n}\n","import type { HttpClient } from '@wix/cli-http-client';\nimport type { Options } from 'p-retry';\nimport pRetry from 'p-retry';\nimport {\n createTunnel,\n deleteTunnel,\n} from '@wix/ambassador-apps-hosting-v1-deployment/http';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport { createTunnelSchema } from './schemas.js';\n\nexport class TunnelClient {\n private readonly retryOptions: Options;\n\n constructor(private readonly httpClient: HttpClient) {\n const { minRetryTimeout } = getTestOverrides();\n\n this.retryOptions = {\n retries: 3,\n minTimeout: minRetryTimeout,\n maxTimeout: 3 * 1000,\n };\n }\n\n public createTunnel = async ({ port }: { port: number }) => {\n try {\n const { data } = await pRetry(\n () => this.httpClient.request(createTunnel({ port })),\n this.retryOptions\n );\n\n return createTunnelSchema.parse(data);\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToCreateTunnel(),\n cause: error,\n });\n }\n };\n\n public deleteTunnel = async (tunnelId: string) => {\n try {\n await pRetry(\n () => this.httpClient.request(deleteTunnel({ id: tunnelId })),\n this.retryOptions\n );\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToDeleteTunnel(),\n cause: error,\n });\n }\n };\n}\n",null,"import { z } from 'zod';\n\nexport const createTunnelSchema = z.object({\n id: z.string(),\n token: z.string(),\n domain: z.string(),\n});\n","export { useTunnel } from './useTunnel.js';\n"],"mappings":";;kRAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,KAAA,cAAAC,IACA,IAAIC,GAAW,OAAO,OAClBC,EAAY,OAAO,eACnBC,GAAmB,OAAO,yBAC1BC,GAAoB,OAAO,oBAC3BC,GAAe,OAAO,eACtBC,GAAe,OAAO,UAAU,eAChCC,GAAW,CAACC,EAAQC,IAAQ,CAC9B,QAASC,KAAQD,EACfP,EAAUM,EAAQE,EAAM,CAAE,IAAKD,EAAIC,CAAI,EAAG,WAAY,EAAK,CAAC,CAChE,EACIC,GAAc,CAACC,EAAIC,EAAMC,EAAQC,IAAS,CAC5C,GAAIF,GAAQ,OAAOA,GAAS,UAAY,OAAOA,GAAS,WACtD,QAASG,KAAOZ,GAAkBS,CAAI,EAChC,CAACP,GAAa,KAAKM,EAAII,CAAG,GAAKA,IAAQF,GACzCZ,EAAUU,EAAII,EAAK,CAAE,IAAK,IAAMH,EAAKG,CAAG,EAAG,WAAY,EAAED,EAAOZ,GAAiBU,EAAMG,CAAG,IAAMD,EAAK,UAAW,CAAC,EAEvH,OAAOH,CACT,EACIK,GAAU,CAACC,EAAKC,EAAYX,KA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AAW,QAAQO,GAAa,CAAE,GAAID,CAAS,CAAC,CAAC,EAC5D,KAAK,YACP,CACF,OAASH,EAAO,CACd,MAAM,IAAIC,EAAS,CACjB,KAAMC,EAAa,qBAAqB,EACxC,MAAOF,CACT,CAAC,CACH,CACF,CACF,EDjDO,SAASK,IAAgC,CAC9C,IAAMC,EAAaC,GAAc,CAAE,KAAM,YAAa,CAAC,EACvD,SAAO,YAAQ,IAAM,IAAIC,EAAaF,CAAU,EAAG,CAACA,CAAU,CAAC,CACjE,CHAO,SAASG,IAAY,CAC1B,IAAMC,KAAgB,UAAmB,EACnCC,EAAeC,GAAgB,EAC/BC,EAAWC,GAAY,EAE7B,sBAAU,IACD,IAAM,CACXJ,EAAc,SAAS,MAAM,CAC/B,EACC,CAAC,CAAC,KAEE,eACL,MAAOK,GAAiB,CAEtB,IAAMC,EADWC,GAAqBJ,CAAQ,EACZ,OAAO,EACzC,GAAI,CACF,IAAMK,EAAS,MAAMC,GAAaJ,EAAMJ,CAAY,EACpD,OAAAD,EAAc,QAAUQ,EACxBF,EAAiB,OAAO,CAAE,UAAW,EAAK,CAAC,EACpC,CAAE,IAAKE,EAAO,MAAO,CAC9B,OAASE,EAAa,CACpB,MAAAJ,EAAiB,OAAO,CACtB,UAAW,GACX,cAAeI,aAAc,MAAQA,EAAG,QAAU,eACpD,CAAC,EAEKA,CACR,CACF,EACA,CAACT,EAAcE,CAAQ,CACzB,CACF,COtCAQ","names":["require_constants","__commonJSMin","exports","module","init_esm_shims","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toESM","mod","isNodeMode","__toCommonJS","constants_exports","CLOUDFLARED_VERSION","DEFAULT_CLOUDFLARED_BIN","RELEASE_BASE","bin","use","import_node_path","__dirname","executable","require_error","__commonJSMin","exports","module","init_esm_shims","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toCommonJS","mod","error_exports","UnsupportedError","message","require_install","__commonJSMin","exports","module","init_esm_shims","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toESM","mod","isNodeMode","__toCommonJS","install_exports","install","install_linux","install_macos","install_windows","import_node_fs","import_node_path","import_node_https","import_node_child_process","import_constants","import_error","LINUX_URL","MACOS_URL","WINDOWS_URL","resolve_base","version","file","download","url","redirect","resolve","reject","request","res","redirection","err","require_regex","__commonJSMin","exports","module","init_esm_shims","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toCommonJS","mod","regex_exports","config_regex","conn_regex","connectorID_regex","disconnect_regex","index_regex","ip_regex","location_regex","metrics_regex","tunnelID_regex","require_tunnel","__commonJSMin","exports","module","init_esm_shims","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toCommonJS","mod","tunnel_exports","tunnel","import_node_child_process","import_constants","import_regex","options","args","value","child","url_regex","url_resolver","url_rejector","url","pair","connection_resolvers","connection_rejectors","connections","i","parser","data","_a","str","url_match","conn_match","ip_match","location_match","index_match","id","ip","location","idx","require_service","__commonJSMin","exports","module","init_esm_shims","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toESM","mod","isNodeMode","__toCommonJS","service_exports","AlreadyInstalledError","LINUX_SERVICE_PATH","MACOS_SERVICE_PATH","NotInstalledError","clean","current","err","exists","identifier","install","journal","log","service","service_name","uninstall","import_node_os","import_node_fs","import_node_child_process","import_constants","import_regex","is_root","token","args","result","is_systemd","n","_a","_b","_c","_d","log2","tunnelID","connectorID","connections","metrics","config","line","id","location","ip","idx","err2","require_lib","__commonJSMin","exports","module","init_esm_shims","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toCommonJS","mod","lib_exports","import_service","import_constants","import_install","import_tunnel","init_esm_shims","import_react","init_esm_shims","dirname","import_cloudflared","launchTunnel","port","tunnelClient","localTunnel","getTestOverrides","pathExists","e","err","CliError","CliErrorCode","dirname","tunnel","domain","createTunnelPromise","resolve","reject","tunnelProcess","execa","close","listener","data","init_esm_shims","wixCliTunnelBiEvents","biLogger","startTimestamp","isSuccess","failureReason","wixCliAppsFlowTunnelCreationStatusSrc11Evid5233","init_esm_shims","import_react","init_esm_shims","init_esm_shims","_createTunnelRequest","_createTunnelResponse","_deleteTunnelRequest","_deleteTunnelResponse","resolveWixAppsHostingV1BackendServiceUrl","opts","domainToMappings","resolveUrl","createTunnel","payload","_a","serializer","_createTunnelRequest","toReq","fromReq","fromRes","_createTunnelResponse","__createTunnel","host","serializedData","metadata","deleteTunnel","_deleteTunnelRequest","_deleteTunnelResponse","__deleteTunnel","toURLSearchParams","init_esm_shims","createTunnelSchema","z","TunnelClient","httpClient","minRetryTimeout","getTestOverrides","port","data","pRetry","createTunnel","createTunnelSchema","error","CliError","CliErrorCode","tunnelId","deleteTunnel","useTunnelClient","httpClient","useHttpClient","TunnelClient","useTunnel","connectionRef","tunnelClient","useTunnelClient","biLogger","useBiLogger","port","tunnelCreationBi","wixCliTunnelBiEvents","tunnel","launchTunnel","ex","init_esm_shims"]}
1
+ {"version":3,"sources":["../../../node_modules/cloudflared/lib/constants.js","../../../node_modules/cloudflared/lib/error.js","../../../node_modules/cloudflared/lib/install.js","../../../node_modules/cloudflared/lib/regex.js","../../../node_modules/cloudflared/lib/tunnel.js","../../../node_modules/cloudflared/lib/service.js","../../../node_modules/cloudflared/lib/lib.js","../../cli-tunnel/src/useTunnel.ts","../../cli-tunnel/src/tunnel.ts","../../cli-tunnel/src/bi/events.ts","../../cli-tunnel/src/useTunnelClient.ts","../../cli-tunnel/src/client.ts","../../../node_modules/@wix/ambassador-apps-hosting-v1-deployment/http.impl.ts","../../cli-tunnel/src/schemas.ts","../../cli-tunnel/src/index.ts"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target, mod));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar constants_exports = {};\n__export(constants_exports, {\n CLOUDFLARED_VERSION: () => CLOUDFLARED_VERSION,\n DEFAULT_CLOUDFLARED_BIN: () => DEFAULT_CLOUDFLARED_BIN,\n RELEASE_BASE: () => RELEASE_BASE,\n bin: () => bin,\n use: () => use\n});\nmodule.exports = __toCommonJS(constants_exports);\nvar import_node_path = __toESM(require(\"node:path\"));\nconst DEFAULT_CLOUDFLARED_BIN = import_node_path.default.join(__dirname, \"..\", \"bin\", process.platform === \"win32\" ? \"cloudflared.exe\" : \"cloudflared\");\nlet bin = process.env.CLOUDFLARED_BIN || DEFAULT_CLOUDFLARED_BIN;\nfunction use(executable) {\n bin = executable;\n}\nconst CLOUDFLARED_VERSION = process.env.CLOUDFLARED_VERSION || \"latest\";\nconst RELEASE_BASE = \"https://github.com/cloudflare/cloudflared/releases/\";\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n CLOUDFLARED_VERSION,\n DEFAULT_CLOUDFLARED_BIN,\n RELEASE_BASE,\n bin,\n use\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar error_exports = {};\n__export(error_exports, {\n UnsupportedError: () => UnsupportedError\n});\nmodule.exports = __toCommonJS(error_exports);\nclass UnsupportedError extends Error {\n constructor(message) {\n super(message);\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n UnsupportedError\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target, mod));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar install_exports = {};\n__export(install_exports, {\n install: () => install,\n install_linux: () => install_linux,\n install_macos: () => install_macos,\n install_windows: () => install_windows\n});\nmodule.exports = __toCommonJS(install_exports);\nvar import_node_fs = __toESM(require(\"node:fs\"));\nvar import_node_path = __toESM(require(\"node:path\"));\nvar import_node_https = __toESM(require(\"node:https\"));\nvar import_node_child_process = require(\"node:child_process\");\nvar import_constants = require(\"./constants\");\nvar import_error = require(\"./error\");\nconst LINUX_URL = {\n arm64: \"cloudflared-linux-arm64\",\n arm: \"cloudflared-linux-arm\",\n x64: \"cloudflared-linux-amd64\",\n ia32: \"cloudflared-linux-386\"\n};\nconst MACOS_URL = {\n arm64: \"cloudflared-darwin-amd64.tgz\",\n x64: \"cloudflared-darwin-amd64.tgz\"\n};\nconst WINDOWS_URL = {\n x64: \"cloudflared-windows-amd64.exe\",\n ia32: \"cloudflared-windows-386.exe\"\n};\nfunction resolve_base(version) {\n if (version === \"latest\") {\n return `${import_constants.RELEASE_BASE}latest/download/`;\n }\n return `${import_constants.RELEASE_BASE}download/${version}/`;\n}\nasync function install(to, version = import_constants.CLOUDFLARED_VERSION) {\n if (process.platform === \"linux\") {\n return install_linux(to, version);\n } else if (process.platform === \"darwin\") {\n return install_macos(to, version);\n } else if (process.platform === \"win32\") {\n return install_windows(to, version);\n } else {\n throw new import_error.UnsupportedError(\"Unsupported platform: \" + process.platform);\n }\n}\nasync function install_linux(to, version = import_constants.CLOUDFLARED_VERSION) {\n const file = LINUX_URL[process.arch];\n if (file === void 0) {\n throw new import_error.UnsupportedError(\"Unsupported architecture: \" + process.arch);\n }\n await download(resolve_base(version) + file, to);\n import_node_fs.default.chmodSync(to, \"755\");\n return to;\n}\nasync function install_macos(to, version = import_constants.CLOUDFLARED_VERSION) {\n const file = MACOS_URL[process.arch];\n if (file === void 0) {\n throw new import_error.UnsupportedError(\"Unsupported architecture: \" + process.arch);\n }\n await download(resolve_base(version) + file, `${to}.tgz`);\n process.env.VERBOSE && console.log(`Extracting to ${to}`);\n (0, import_node_child_process.execSync)(`tar -xzf ${import_node_path.default.basename(`${to}.tgz`)}`, { cwd: import_node_path.default.dirname(to) });\n import_node_fs.default.unlinkSync(`${to}.tgz`);\n import_node_fs.default.renameSync(`${import_node_path.default.dirname(to)}/cloudflared`, to);\n return to;\n}\nasync function install_windows(to, version = import_constants.CLOUDFLARED_VERSION) {\n const file = WINDOWS_URL[process.arch];\n if (file === void 0) {\n throw new import_error.UnsupportedError(\"Unsupported architecture: \" + process.arch);\n }\n await download(resolve_base(version) + file, to);\n return to;\n}\nfunction download(url, to, redirect = 0) {\n if (redirect === 0) {\n process.env.VERBOSE && console.log(`Downloading ${url} to ${to}`);\n } else {\n process.env.VERBOSE && console.log(`Redirecting to ${url}`);\n }\n if (!import_node_fs.default.existsSync(import_node_path.default.dirname(to))) {\n import_node_fs.default.mkdirSync(import_node_path.default.dirname(to), { recursive: true });\n }\n return new Promise((resolve, reject) => {\n const request = import_node_https.default.get(url, (res) => {\n const redirect_code = [301, 302, 303, 307, 308];\n if (redirect_code.includes(res.statusCode) && res.headers.location !== void 0) {\n request.destroy();\n const redirection = res.headers.location;\n resolve(download(redirection, to, redirect + 1));\n return;\n }\n if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {\n const file = import_node_fs.default.createWriteStream(to);\n file.on(\"finish\", () => {\n file.close(() => resolve(to));\n });\n file.on(\"error\", (err) => {\n import_node_fs.default.unlink(to, () => reject(err));\n });\n res.pipe(file);\n } else {\n request.destroy();\n reject(new Error(`HTTP response with status code: ${res.statusCode}`));\n }\n });\n request.on(\"error\", (err) => {\n reject(err);\n });\n request.end();\n });\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n install,\n install_linux,\n install_macos,\n install_windows\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar regex_exports = {};\n__export(regex_exports, {\n config_regex: () => config_regex,\n conn_regex: () => conn_regex,\n connectorID_regex: () => connectorID_regex,\n disconnect_regex: () => disconnect_regex,\n index_regex: () => index_regex,\n ip_regex: () => ip_regex,\n location_regex: () => location_regex,\n metrics_regex: () => metrics_regex,\n tunnelID_regex: () => tunnelID_regex\n});\nmodule.exports = __toCommonJS(regex_exports);\nconst conn_regex = /connection[= ]([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;\nconst ip_regex = /ip=([0-9.]+)/;\nconst location_regex = /location=([A-Za-z0-9]+)/;\nconst index_regex = /connIndex=(\\d)/;\nconst disconnect_regex = /Unregistered tunnel connection connIndex=(\\d)/i;\nconst tunnelID_regex = /tunnelID=([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;\nconst connectorID_regex = /Connector ID: ([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;\nconst metrics_regex = /metrics server on ([0-9.:]+\\/metrics)/;\nconst config_regex = /config=\"(.+[^\\\\])\"/;\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n config_regex,\n conn_regex,\n connectorID_regex,\n disconnect_regex,\n index_regex,\n ip_regex,\n location_regex,\n metrics_regex,\n tunnelID_regex\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar tunnel_exports = {};\n__export(tunnel_exports, {\n tunnel: () => tunnel\n});\nmodule.exports = __toCommonJS(tunnel_exports);\nvar import_node_child_process = require(\"node:child_process\");\nvar import_constants = require(\"./constants.js\");\nvar import_regex = require(\"./regex.js\");\nfunction tunnel(options = {}) {\n const args = [\"tunnel\"];\n for (const [key, value] of Object.entries(options)) {\n if (typeof value === \"string\") {\n args.push(`${key}`, value);\n } else if (typeof value === \"number\") {\n args.push(`${key}`, value.toString());\n } else if (value === null) {\n args.push(`${key}`);\n }\n }\n if (args.length === 1) {\n args.push(\"--url\", \"localhost:8080\");\n }\n const child = (0, import_node_child_process.spawn)(import_constants.bin, args, { stdio: [\"ignore\", \"pipe\", \"pipe\"] });\n if (process.env.VERBOSE) {\n child.stdout.pipe(process.stdout);\n child.stderr.pipe(process.stderr);\n }\n const url_regex = /\\|\\s+(https?:\\/\\/[^\\s]+)/;\n let url_resolver = () => void 0;\n let url_rejector = () => void 0;\n const url = new Promise((...pair) => [url_resolver, url_rejector] = pair);\n const connection_resolvers = [];\n const connection_rejectors = [];\n const connections = [];\n for (let i = 0; i < 1; i++) {\n connections.push(new Promise((...pair) => [connection_resolvers[i], connection_rejectors[i]] = pair));\n }\n const parser = (data) => {\n var _a;\n const str = data.toString();\n const url_match = str.match(url_regex);\n url_match && url_resolver(url_match[1]);\n const conn_match = str.match(import_regex.conn_regex);\n const ip_match = str.match(import_regex.ip_regex);\n const location_match = str.match(import_regex.location_regex);\n const index_match = str.match(import_regex.index_regex);\n if (conn_match && ip_match && location_match && index_match) {\n const [, id] = conn_match;\n const [, ip] = ip_match;\n const [, location] = location_match;\n const [, idx] = index_match;\n (_a = connection_resolvers[+idx]) == null ? void 0 : _a.call(connection_resolvers, { id, ip, location });\n }\n };\n child.stdout.on(\"data\", parser).on(\"error\", url_rejector);\n child.stderr.on(\"data\", parser).on(\"error\", url_rejector);\n const stop = () => child.kill(\"SIGINT\");\n return { url, connections, child, stop };\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n tunnel\n});\n","\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target, mod));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar service_exports = {};\n__export(service_exports, {\n AlreadyInstalledError: () => AlreadyInstalledError,\n LINUX_SERVICE_PATH: () => LINUX_SERVICE_PATH,\n MACOS_SERVICE_PATH: () => MACOS_SERVICE_PATH,\n NotInstalledError: () => NotInstalledError,\n clean: () => clean,\n current: () => current,\n err: () => err,\n exists: () => exists,\n identifier: () => identifier,\n install: () => install,\n journal: () => journal,\n log: () => log,\n service: () => service,\n service_name: () => service_name,\n uninstall: () => uninstall\n});\nmodule.exports = __toCommonJS(service_exports);\nvar import_node_os = __toESM(require(\"node:os\"));\nvar import_node_fs = __toESM(require(\"node:fs\"));\nvar import_node_child_process = require(\"node:child_process\");\nvar import_constants = require(\"./constants.js\");\nvar import_regex = require(\"./regex.js\");\nconst identifier = \"com.cloudflare.cloudflared\";\nconst service_name = \"cloudflared.service\";\nconst MACOS_SERVICE_PATH = {\n PLIST: is_root() ? `/Library/LaunchDaemons/${identifier}.plist` : `${import_node_os.default.homedir()}/Library/LaunchAgents/${identifier}.plist`,\n OUT: is_root() ? `/Library/Logs/${identifier}.out.log` : `${import_node_os.default.homedir()}/Library/Logs/${identifier}.out.log`,\n ERR: is_root() ? `/Library/Logs/${identifier}.err.log` : `${import_node_os.default.homedir()}/Library/Logs/${identifier}.err.log`\n};\nconst LINUX_SERVICE_PATH = {\n SYSTEMD: `/etc/systemd/system/${service_name}`,\n SERVICE: \"/etc/init.d/cloudflared\",\n SERVICE_OUT: \"/var/log/cloudflared.log\",\n SERVICE_ERR: \"/var/log/cloudflared.err\"\n};\nconst service = { install, uninstall, exists, log, err, current, clean, journal };\nclass AlreadyInstalledError extends Error {\n constructor() {\n super(\"service is already installed\");\n }\n}\nclass NotInstalledError extends Error {\n constructor() {\n super(\"service is not installed\");\n }\n}\nfunction install(token) {\n if (![\"darwin\", \"linux\"].includes(process.platform)) {\n throw new Error(`Not Implemented on platform ${process.platform}`);\n }\n if (exists()) {\n throw new AlreadyInstalledError();\n }\n const args = [\"service\", \"install\"];\n if (token) {\n args.push(token);\n }\n const result = (0, import_node_child_process.spawnSync)(import_constants.bin, args);\n if (result.status !== 0) {\n throw new Error(`service install failed: ${result.stderr.toString()}`);\n }\n}\nfunction uninstall() {\n if (![\"darwin\", \"linux\"].includes(process.platform)) {\n throw new Error(`Not Implemented on platform ${process.platform}`);\n }\n if (!exists()) {\n throw new NotInstalledError();\n }\n const result = (0, import_node_child_process.spawnSync)(import_constants.bin, [\"service\", \"uninstall\"]);\n if (result.status !== 0) {\n throw new Error(`service uninstall failed: ${result.stderr.toString()}`);\n }\n if (process.platform === \"darwin\") {\n import_node_fs.default.rmSync(MACOS_SERVICE_PATH.OUT);\n import_node_fs.default.rmSync(MACOS_SERVICE_PATH.ERR);\n } else if (process.platform === \"linux\" && !is_systemd()) {\n import_node_fs.default.rmSync(LINUX_SERVICE_PATH.SERVICE_OUT);\n import_node_fs.default.rmSync(LINUX_SERVICE_PATH.SERVICE_ERR);\n }\n}\nfunction log() {\n if (!exists()) {\n throw new NotInstalledError();\n }\n if (process.platform === \"darwin\") {\n return import_node_fs.default.readFileSync(MACOS_SERVICE_PATH.OUT, \"utf8\");\n }\n if (process.platform === \"linux\" && !is_systemd()) {\n return import_node_fs.default.readFileSync(LINUX_SERVICE_PATH.SERVICE_OUT, \"utf8\");\n }\n throw new Error(`Not Implemented on platform ${process.platform}`);\n}\nfunction err() {\n if (!exists()) {\n throw new NotInstalledError();\n }\n if (process.platform === \"darwin\") {\n return import_node_fs.default.readFileSync(MACOS_SERVICE_PATH.ERR, \"utf8\");\n }\n if (process.platform === \"linux\" && !is_systemd()) {\n return import_node_fs.default.readFileSync(LINUX_SERVICE_PATH.SERVICE_ERR, \"utf8\");\n }\n throw new Error(`Not Implemented on platform ${process.platform}`);\n}\nfunction journal(n = 300) {\n if (process.platform === \"linux\" && is_systemd()) {\n const args = [\"-u\", service_name, \"-o\", \"cat\", \"-n\", n.toString()];\n return (0, import_node_child_process.spawnSync)(\"journalctl\", args).stdout.toString();\n }\n throw new Error(`Not Implemented on platform ${process.platform}`);\n}\nfunction current() {\n var _a, _b, _c, _d;\n if (![\"darwin\", \"linux\"].includes(process.platform)) {\n throw new Error(`Not Implemented on platform ${process.platform}`);\n }\n if (!exists()) {\n throw new NotInstalledError();\n }\n const log2 = is_systemd() ? journal() : err();\n let tunnelID = \"\";\n let connectorID = \"\";\n const connections = [];\n let metrics = \"\";\n let config = {};\n for (const line of log2.split(\"\\n\")) {\n try {\n if (line.match(import_regex.tunnelID_regex)) {\n tunnelID = ((_a = line.match(import_regex.tunnelID_regex)) == null ? void 0 : _a[1]) ?? \"\";\n } else if (line.match(import_regex.connectorID_regex)) {\n connectorID = ((_b = line.match(import_regex.connectorID_regex)) == null ? void 0 : _b[1]) ?? \"\";\n } else if (line.match(import_regex.conn_regex) && line.match(import_regex.location_regex) && line.match(import_regex.ip_regex) && line.match(import_regex.index_regex)) {\n const [, id] = line.match(import_regex.conn_regex) ?? [];\n const [, location] = line.match(import_regex.location_regex) ?? [];\n const [, ip] = line.match(import_regex.ip_regex) ?? [];\n const [, idx] = line.match(import_regex.index_regex) ?? [];\n connections[parseInt(idx)] = { id, ip, location };\n } else if (line.match(import_regex.disconnect_regex)) {\n const [, idx] = line.match(import_regex.disconnect_regex) ?? [];\n if (parseInt(idx) in connections) {\n connections[parseInt(idx)] = { id: \"\", ip: \"\", location: \"\" };\n }\n } else if (line.match(import_regex.metrics_regex)) {\n metrics = ((_c = line.match(import_regex.metrics_regex)) == null ? void 0 : _c[1]) ?? \"\";\n } else if (line.match(import_regex.config_regex)) {\n config = JSON.parse(((_d = line.match(import_regex.config_regex)) == null ? void 0 : _d[1].replace(/\\\\/g, \"\")) ?? \"{}\");\n }\n } catch (err2) {\n if (process.env.VERBOSE) {\n console.error(\"log parsing failed\", err2);\n }\n }\n }\n return { tunnelID, connectorID, connections, metrics, config };\n}\nfunction clean() {\n if (process.platform !== \"darwin\") {\n throw new Error(`Not Implemented on platform ${process.platform}`);\n }\n if (exists()) {\n throw new AlreadyInstalledError();\n }\n import_node_fs.default.rmSync(MACOS_SERVICE_PATH.OUT, { force: true });\n import_node_fs.default.rmSync(MACOS_SERVICE_PATH.ERR, { force: true });\n}\nfunction exists() {\n if (process.platform === \"darwin\") {\n return import_node_fs.default.existsSync(MACOS_SERVICE_PATH.PLIST);\n } else if (process.platform === \"linux\") {\n return is_systemd() ? import_node_fs.default.existsSync(LINUX_SERVICE_PATH.SYSTEMD) : import_node_fs.default.existsSync(LINUX_SERVICE_PATH.SERVICE);\n }\n throw new Error(`Not Implemented on platform ${process.platform}`);\n}\nfunction is_root() {\n var _a;\n return ((_a = process.getuid) == null ? void 0 : _a.call(process)) === 0;\n}\nfunction is_systemd() {\n return process.platform === \"linux\" && import_node_fs.default.existsSync(\"/run/systemd/system\");\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n AlreadyInstalledError,\n LINUX_SERVICE_PATH,\n MACOS_SERVICE_PATH,\n NotInstalledError,\n clean,\n current,\n err,\n exists,\n identifier,\n install,\n journal,\n log,\n service,\n service_name,\n uninstall\n});\n","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar lib_exports = {};\n__export(lib_exports, {\n AlreadyInstalledError: () => import_service.AlreadyInstalledError,\n MACOS_SERVICE_PATH: () => import_service.MACOS_SERVICE_PATH,\n NotInstalledError: () => import_service.NotInstalledError,\n bin: () => import_constants.bin,\n identifier: () => import_service.identifier,\n install: () => import_install.install,\n service: () => import_service.service,\n tunnel: () => import_tunnel.tunnel\n});\nmodule.exports = __toCommonJS(lib_exports);\nvar import_constants = require(\"./constants.js\");\nvar import_install = require(\"./install.js\");\nvar import_tunnel = require(\"./tunnel.js\");\nvar import_service = require(\"./service.js\");\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n AlreadyInstalledError,\n MACOS_SERVICE_PATH,\n NotInstalledError,\n bin,\n identifier,\n install,\n service,\n tunnel\n});\n","import { useCallback, useEffect, useRef } from 'react';\nimport { useBiLogger } from '@wix/cli-telemetry-react';\nimport { launchTunnel } from './tunnel.js';\nimport type { Connection } from './tunnel.js';\nimport { wixCliTunnelBiEvents } from './bi/events.js';\nimport { useTunnelClient } from './useTunnelClient.js';\n\nexport function useTunnel() {\n const connectionRef = useRef<Connection>();\n const tunnelClient = useTunnelClient();\n const biLogger = useBiLogger();\n\n useEffect(() => {\n return () => {\n connectionRef.current?.close();\n };\n }, []);\n\n return useCallback(\n async (port: number) => {\n const biEvents = wixCliTunnelBiEvents(biLogger);\n const tunnelCreationBi = biEvents.tunnel();\n try {\n const tunnel = await launchTunnel(port, tunnelClient);\n connectionRef.current = tunnel;\n tunnelCreationBi.finish({ isSuccess: true });\n return { url: tunnel.domain };\n } catch (ex: unknown) {\n tunnelCreationBi.finish({\n isSuccess: false,\n failureReason: ex instanceof Error ? ex.message : 'Unknown error',\n });\n\n throw ex;\n }\n },\n [tunnelClient, biLogger]\n );\n}\n","import { execa } from 'execa';\nimport { pathExists } from '@wix/cli-fs';\nimport { dirname } from 'node:path';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport { bin, install } from 'cloudflared';\nimport type { TunnelClient } from './client.js';\n\nexport interface Connection {\n close: () => void;\n domain: string;\n}\n\nexport async function launchTunnel(\n port: number,\n tunnelClient: TunnelClient\n): Promise<Connection> {\n const { localTunnel } = getTestOverrides();\n\n if (!localTunnel && !(await pathExists(bin))) {\n try {\n await install(bin);\n } catch (e) {\n const err = e as NodeJS.ErrnoException;\n if (e instanceof Error && err.code === 'EACCES') {\n throw new CliError({\n code: CliErrorCode.FailedInstallCloudflareNoAccess({\n path: dirname(err.path!),\n }),\n cause: e,\n });\n }\n throw e;\n }\n }\n\n const tunnel = await tunnelClient.createTunnel({ port });\n const domain = `http${localTunnel ? '' : 's'}://${tunnel.domain}`;\n\n const createTunnelPromise = new Promise<Connection>((resolve, reject) => {\n const tunnelProcess = localTunnel\n ? execa('echo', [tunnel.domain, tunnel.token], { detached: true })\n : execa(bin, ['tunnel', 'run', '--token', tunnel.token]);\n\n const close = () => {\n tunnelProcess.kill();\n };\n\n const listener = async (data: Buffer) => {\n const output = data.toString();\n const match = output.match(tunnel.domain)?.[0];\n\n if (match) {\n resolve({\n domain,\n close,\n });\n }\n };\n\n tunnelProcess.stderr?.on('data', listener);\n tunnelProcess.stdout?.on('data', listener);\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n tunnelProcess.on('error', (err) => {\n reject(err);\n });\n });\n\n return {\n domain,\n close: async () => {\n const tunnel = await createTunnelPromise;\n return tunnel.close();\n },\n };\n}\n","import { wixCliAppsFlowTunnelCreationStatusSrc11Evid5233 } from '@wix/bi-logger-dev-tools-data/v2';\nimport type { BiLogger } from '@wix/cli-telemetry';\n\nexport const wixCliTunnelBiEvents = (biLogger: BiLogger) => ({\n tunnel: () => {\n const startTimestamp = Date.now();\n return {\n finish: ({\n isSuccess,\n failureReason,\n }: {\n isSuccess: boolean;\n failureReason?: string;\n }) => {\n void biLogger.report(\n wixCliAppsFlowTunnelCreationStatusSrc11Evid5233({\n isSuccess,\n failureReason,\n tunnelCreationTime: Date.now() - startTimestamp,\n })\n );\n },\n };\n },\n});\n","import { useMemo } from 'react';\nimport { useHttpClient } from '@wix/cli-http-client-react';\nimport { TunnelClient } from './client.js';\n\nexport function useTunnelClient(): TunnelClient {\n const httpClient = useHttpClient({ type: 'backoffice' });\n return useMemo(() => new TunnelClient(httpClient), [httpClient]);\n}\n","import type { HttpClient } from '@wix/cli-http-client';\nimport type { Options } from 'p-retry';\nimport pRetry from 'p-retry';\nimport {\n createTunnel,\n deleteTunnel,\n} from '@wix/ambassador-apps-hosting-v1-deployment/http';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport { createTunnelSchema } from './schemas.js';\n\nexport class TunnelClient {\n private readonly retryOptions: Options;\n\n constructor(private readonly httpClient: HttpClient) {\n const { minRetryTimeout } = getTestOverrides();\n\n this.retryOptions = {\n retries: 3,\n minTimeout: minRetryTimeout,\n maxTimeout: 3 * 1000,\n };\n }\n\n public createTunnel = async ({ port }: { port: number }) => {\n try {\n const { data } = await pRetry(\n () => this.httpClient.request(createTunnel({ port })),\n this.retryOptions\n );\n\n return createTunnelSchema.parse(data);\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToCreateTunnel(),\n cause: error,\n });\n }\n };\n\n public deleteTunnel = async (tunnelId: string) => {\n try {\n await pRetry(\n () => this.httpClient.request(deleteTunnel({ id: tunnelId })),\n this.retryOptions\n );\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedToDeleteTunnel(),\n cause: error,\n });\n }\n };\n}\n",null,"import { z } from 'zod';\n\nexport const createTunnelSchema = z.object({\n id: z.string(),\n token: z.string(),\n domain: z.string(),\n});\n","export { useTunnel } from './useTunnel.js';\n"],"mappings":";;kRAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,KAAA,cAAAC,IACA,IAAIC,GAAW,OAAO,OAClBC,EAAY,OAAO,eACnBC,GAAmB,OAAO,yBAC1BC,GAAoB,OAAO,oBAC3BC,GAAe,OAAO,eACtBC,GAAe,OAAO,UAAU,eAChCC,GAAW,CAACC,EAAQC,IAAQ,CAC9B,QAASC,KAAQD,EACfP,EAAUM,EAAQE,EAAM,CAAE,IAAKD,EAAIC,CAAI,EAAG,WAAY,EAAK,CAAC,CAChE,EACIC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ACA,CAACT,EAAcE,CAAQ,CACzB,CACF,COtCAQ","names":["require_constants","__commonJSMin","exports","module","init_esm_shims","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toESM","mod","isNodeMode","__toCommonJS","constants_exports","CLOUDFLARED_VERSION","DEFAULT_CLOUDFLARED_BIN","RELEASE_BASE","bin","use","import_node_path","__dirname","executable","require_error","__commonJSMin","exports","module","init_esm_shims","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toCommonJS","mod","error_exports","UnsupportedError","message","require_install","__commonJSMin","exports","module","init_esm_shims","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toESM","mod","isNodeMode","__toCommonJS","install_exports","install","install_linux","install_macos","install_windows","import_node_fs","import_node_path","import_node_https","import_node_child_process","import_constants","import_error","LINUX_URL","MACOS_URL","WINDOWS_URL","resolve_base","version","file","download","url","redirect","resolve","reject","request","res","redirection","err","require_regex","__commonJSMin","exports","module","init_esm_shims","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toCommonJS","mod","regex_exports","config_regex","conn_regex","connectorID_regex","disconnect_regex","index_regex","ip_regex","location_regex","metrics_regex","tunnelID_regex","require_tunnel","__commonJSMin","exports","module","init_esm_shims","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toCommonJS","mod","tunnel_exports","tunnel","import_node_child_process","import_constants","import_regex","options","args","value","child","url_regex","url_resolver","url_rejector","url","pair","connection_resolvers","connection_rejectors","connections","i","parser","data","_a","str","url_match","conn_match","ip_match","location_match","index_match","id","ip","location","idx","require_service","__commonJSMin","exports","module","init_esm_shims","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toESM","mod","isNodeMode","__toCommonJS","service_exports","AlreadyInstalledError","LINUX_SERVICE_PATH","MACOS_SERVICE_PATH","NotInstalledError","clean","current","err","exists","identifier","install","journal","log","service","service_name","uninstall","import_node_os","import_node_fs","import_node_child_process","import_constants","import_regex","is_root","token","args","result","is_systemd","n","_a","_b","_c","_d","log2","tunnelID","connectorID","connections","metrics","config","line","id","location","ip","idx","err2","require_lib","__commonJSMin","exports","module","init_esm_shims","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__toCommonJS","mod","lib_exports","import_service","import_constants","import_install","import_tunnel","init_esm_shims","import_react","init_esm_shims","dirname","import_cloudflared","launchTunnel","port","tunnelClient","localTunnel","getTestOverrides","pathExists","e","err","CliError","CliErrorCode","dirname","tunnel","domain","createTunnelPromise","resolve","reject","tunnelProcess","execa","close","listener","data","init_esm_shims","wixCliTunnelBiEvents","biLogger","startTimestamp","isSuccess","failureReason","wixCliAppsFlowTunnelCreationStatusSrc11Evid5233","init_esm_shims","import_react","init_esm_shims","init_esm_shims","_createTunnelRequest","_createTunnelResponse","_deleteTunnelRequest","_deleteTunnelResponse","resolveWixAppsHostingV1BackendServiceUrl","opts","domainToMappings","resolveUrl","createTunnel","payload","_a","serializer","_createTunnelRequest","toReq","fromReq","fromRes","_createTunnelResponse","__createTunnel","host","serializedData","metadata","deleteTunnel","_deleteTunnelRequest","_deleteTunnelResponse","__deleteTunnel","toURLSearchParams","init_esm_shims","createTunnelSchema","z","TunnelClient","httpClient","minRetryTimeout","getTestOverrides","port","data","pRetry","createTunnel","createTunnelSchema","error","CliError","CliErrorCode","tunnelId","deleteTunnel","useTunnelClient","httpClient","useHttpClient","TunnelClient","useTunnel","connectionRef","tunnelClient","useTunnelClient","biLogger","useBiLogger","port","tunnelCreationBi","wixCliTunnelBiEvents","tunnel","launchTunnel","ex","init_esm_shims"]}
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{U as a}from"./chunk-GF6CV6CZ.js";import{h as g}from"./chunk-V4TR6DCM.js";g();import{createLogger as f}from"vite";function m(t){return[/Port \d{1,5} is in use, trying another one/].some(n=>n.test(t))}function u({timestamp:t}={}){let n=a({stripAnsi:!1}),i=f("info",{allowClearScreen:!1,prefix:""}),p={timestamp:t},o=(r,e,c)=>{let s={...c,...p};return typeof e=="string"?m(e)?null:i[r](e,s):setTimeout(()=>i[r](n.render(e),s))};return{...i,info:(r,e)=>o("info",r,e),error:(r,e)=>o("error",r,e),warn:(r,e)=>o("warn",r,e),warnOnce:(r,e)=>o("warnOnce",r,e)}}export{u as a};
4
- //# sourceMappingURL=chunk-V3QQTT5C.js.map
3
+ import{V as a}from"./chunk-2W2YJZP5.js";import{h as g}from"./chunk-V4TR6DCM.js";g();import{createLogger as f}from"vite";function m(t){return[/Port \d{1,5} is in use, trying another one/].some(n=>n.test(t))}function u({timestamp:t}={}){let n=a({stripAnsi:!1}),i=f("info",{allowClearScreen:!1,prefix:""}),p={timestamp:t},o=(r,e,c)=>{let s={...c,...p};return typeof e=="string"?m(e)?null:i[r](e,s):setTimeout(()=>i[r](n.render(e),s))};return{...i,info:(r,e)=>o("info",r,e),error:(r,e)=>o("error",r,e),warn:(r,e)=>o("warn",r,e),warnOnce:(r,e)=>o("warnOnce",r,e)}}export{u as a};
4
+ //# sourceMappingURL=chunk-SZ5JWJ4Q.js.map
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{b as p}from"./chunk-NYC4UPCI.js";import{e as i,f as r,g as n}from"./chunk-MM7OD345.js";import{h as e}from"./chunk-V4TR6DCM.js";e();var j=async({model:t,arm:a,serveUrl:m,backendServerUrl:o,topologyComponentId:s,monitoringData:d,monitoringComponentId:g})=>{let l=await p(t.projectFolder),c=r(n(i(l,m,o),{id:s,baseApiUrl:o}),{id:g,monitoring:d});return a.createAppRelease(c,t.config.projectId)};export{j as a};
4
- //# sourceMappingURL=chunk-IOW53RH7.js.map
3
+ import{b as p}from"./chunk-AXAJ7DJ4.js";import{e as i,f as r,g as n}from"./chunk-B5P4JHUW.js";import{h as e}from"./chunk-V4TR6DCM.js";e();var j=async({model:t,arm:a,serveUrl:m,backendServerUrl:o,topologyComponentId:s,monitoringData:d,monitoringComponentId:g})=>{let l=await p(t.projectFolder),c=r(n(i(l,m,o),{id:s,baseApiUrl:o}),{id:g,monitoring:d});return a.createAppRelease(c,t.config.projectId)};export{j as a};
4
+ //# sourceMappingURL=chunk-TSAKYUDG.js.map
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{Aa as r,ub as p}from"./chunk-L2GYA6RW.js";import{b as v,c as f}from"./chunk-GF6CV6CZ.js";import{e as m,h as c}from"./chunk-V4TR6DCM.js";c();var s=m(v(),1),i=m(f(),1);function k(){let{model:t}=p(),n=(0,s.useMemo)(()=>{let l=t.components.filter((0,i.isType)(r.Api)).sort((e,o)=>e.title.localeCompare(o.title)),a=t.components.filter((0,i.isType)(r.Event)).sort((e,o)=>e.title.localeCompare(o.title)),u=t.components.filter((0,i.isType)(r.ServicePlugin)).sort((e,o)=>e.servicePlugin.name.localeCompare(o.servicePlugin.name));return{Api:l,Event:a,ServicePlugin:u}},[t.components]);return{backendComponents:[...n.Api,...n.Event,...n.ServicePlugin],backendComponentsByType:n}}export{k as a};
4
- //# sourceMappingURL=chunk-LYCV7HBR.js.map
3
+ import{Aa as r,zb as p}from"./chunk-YMRYABCG.js";import{b as v,c as f}from"./chunk-2W2YJZP5.js";import{e as m,h as c}from"./chunk-V4TR6DCM.js";c();var s=m(v(),1),i=m(f(),1);function k(){let{model:t}=p(),n=(0,s.useMemo)(()=>{let l=t.components.filter((0,i.isType)(r.Api)).sort((e,o)=>e.title.localeCompare(o.title)),a=t.components.filter((0,i.isType)(r.Event)).sort((e,o)=>e.title.localeCompare(o.title)),u=t.components.filter((0,i.isType)(r.ServicePlugin)).sort((e,o)=>e.servicePlugin.name.localeCompare(o.servicePlugin.name));return{Api:l,Event:a,ServicePlugin:u}},[t.components]);return{backendComponents:[...n.Api,...n.Event,...n.ServicePlugin],backendComponentsByType:n}}export{k as a};
4
+ //# sourceMappingURL=chunk-WXOIL7LC.js.map
@@ -0,0 +1,4 @@
1
+ import { createRequire as _createRequire } from 'node:module';
2
+ const require = _createRequire(import.meta.url);
3
+ import{b as $,c as _e,d as ve,e as we}from"./chunk-LDGXTJLC.js";import{b as ue}from"./chunk-4CCKO52Z.js";import{Ra as Se,Ta as fe,U as de,Ua as G,Va as ye,Wa as ge,r as oe,s as re,t as ae,u as W,x as ce,zb as k}from"./chunk-YMRYABCG.js";import{A as ne,H as N,I as q,L as O,M as pe,N as le,P as v,Q as K,S as h,T as H,W as w,X as d,Z as me,b as y,c as I,e as b,f as x,m as F,n as ie,z as se}from"./chunk-2W2YJZP5.js";import{e as p,h as o}from"./chunk-V4TR6DCM.js";o();var A=p(y(),1),R=p(I(),1);o();var B=p(y(),1),U=p(I(),1);o();o();var g=p(y(),1),Le=p(I(),1);o();var Q=p(y(),1),Ie=p(I(),1);o();var Ce=p(y(),1);function Me(t){return{cliAction:({question:r,action:i,key:e,additionalInfo:s})=>{t.report(ge({question:r,action:i,key:e,additionalInfo:JSON.stringify(s)}))},cliFlowStepAnswered:({question:r,answer:i,additionalInfo:e})=>{t.report(ye({question:r,answer:i,additionalInfo:JSON.stringify(e)}))}}}function E(){let t=W();return(0,Ce.useMemo)(()=>Me(t),[t])}var be=({onSubmit:t,onError:r,sites:i})=>{let e=E(),{t:s}=d(),{getDevSitesCount:n,getDevSitesLimit:c}=G(),{status:C}=h(()=>Promise.all([n(),c()]),[],{onError:r}),u=S=>{e.cliFlowStepAnswered({question:s("site_type_select.label"),answer:S.title}),t(S.value)};return(0,Ie.match)(C,{Error:()=>null,Loading:()=>Q.default.createElement(v,{text:s("general.loading")}),Success:({result:[S,f]})=>{let l=S>=f,_=i.length===0;return Q.default.createElement(q,{label:s("site_type_select.label"),options:[{availability:_?N.Disabled({reason:s("site_type_select.no_sites")}):N.Enabled(),title:s("site_type_select.pick_existing_site"),value:"select-existing-site"},{title:s("site_type_select.create_new_dev_site"),value:"create-dev-site",availability:l?N.Disabled({reason:s("site_type_select.create_new_dev_site.disabled",{limit:f})}):N.Enabled()}],onSubmit:u})}})};o();var P=p(y(),1),Ae=p(I(),1);o();var L=p(y(),1);o();o();var he=p(y(),1);o();o();var xe=F.record(F.object({appDefinitionId:F.string().optional(),permissions:F.object({revoked:F.boolean()}).optional()}));var J=class{constructor(r){this.httpClient=r}getClientSpecMap=async r=>{try{let{data:i}=await this.httpClient.request({url:`/_api/msm/v1/meta-site/editor-client-spec-map/${r}`});return xe.parse(i)}catch(i){throw new b({code:x.FailedToGetClientSpecMap(),cause:i})}};getSiteInstalledApps=async r=>{try{let i=await this.getClientSpecMap(r);return Object.values(i).filter(e=>e.appDefinitionId&&!e.permissions?.revoked).map(e=>e.appDefinitionId)}catch(i){throw new b({code:x.FailedToGetSiteInstalledApps(),cause:i})}};isAppInstalled=async({metaSiteId:r,appId:i})=>{try{let e=await this.getClientSpecMap(r);return Object.values(e).some(n=>n.appDefinitionId===i&&!n.permissions?.revoked)}catch(e){throw new b({code:x.FailedToCheckIfAppInstalled(),cause:e})}}};function j(){let t=fe({type:"general"});return(0,he.useMemo)(()=>new J(t),[t])}var M=p(I(),1);o();var D=p(y(),1);var Te=({siteId:t,appId:r})=>{let{t:i}=d(),e=E();return se(async(s,n)=>{n.return&&(e.cliAction({question:i("install_app_on_site.warning.instructions"),key:"enter",action:"install_app_on_site"}),await ce(`https://manage.wix.com/installer/install?metaSiteId=${t}&appId=${r}&platform=cli&version=latest`))}),D.default.createElement(D.default.Fragment,null,D.default.createElement(w,{i18nKey:"install_app_on_site.warning"}),D.default.createElement(w,{i18nKey:"install_app_on_site.warning.instructions",components:[D.default.createElement(le,{value:"Enter"})]}))};var V=(0,M.variant)({Success:{},Canceled:{}});function Be(t){return t&&typeof t=="object"&&"name"in t&&t.name==="AbortError"}var Y=({appId:t,site:r,onSubmit:i,onError:e})=>{let{isAppInstalled:s}=j(),{status:n}=h(async({signal:c})=>{let{appInstallationPollInterval:C}=ie();try{return await re(()=>s({metaSiteId:r.id,appId:t}),{interval:C??2e3,timeout:{milliseconds:60*1e3*2,signal:c}}),V.Success()}catch(u){if(u instanceof oe)throw new b({code:x.SiteSelectorTimedout(),cause:u});if(Be(u))return V.Canceled();throw u}},[],{onError:e,onSuccess:c=>{(0,M.isType)(c,V.Success)&&i()}});return(0,M.match)(n,{Error:()=>null,Loading:()=>L.default.createElement(Te,{siteId:r.id,appId:t}),Success:()=>L.default.createElement(O,{type:"success"},L.default.createElement(pe,{skin:"success"},L.default.createElement(w,{i18nKey:"general.success"}))," ",L.default.createElement(w,{i18nKey:"install_app_on_site.finished_successfully"}))})};var Pe=({status:t,appId:r,onSubmit:i,onError:e})=>{let{t:s}=d();return(0,Ae.match)(t,{NotRequested:()=>null,Error:()=>null,Loading:()=>P.default.createElement(v,{text:s("create_dev_site.loading")}),Success:({result:n})=>P.default.createElement(P.default.Fragment,null,P.default.createElement(w,{i18nKey:"create_dev_site.success",components:[P.default.createElement(ne,{skin:"success",bold:!0})],values:{name:n.displayName}}),P.default.createElement(Y,{appId:r,site:n,onSubmit:()=>i(n),onError:e}))})};var Fe={"general.loading":"Loading...","general.success":"Success","site_type_select.label":"Select Development Site","site_type_select.create_new_dev_site":"Create a new Development Site","site_type_select.create_new_dev_site.disabled":"You have reached the maximum number of {limit} Development Sites","site_type_select.pick_existing_site":"Pick an existing site","site_type_select.no_sites":"No sites found","create_dev_site.loading":"Creating your new Development Site...","create_dev_site.success":"Development Site <0>{name}</0> created successfully! \u{1F680}","site_list_select.label":"Select Site","install_app_on_site.warning":"Your new application needs to be installed on the selected Development Site","install_app_on_site.warning.instructions":"Press <0/> to install the application in your browser","install_app_on_site.finished_successfully":"App installed on Development Site."};o();var T=p(y(),1);var Ee=p(I(),1);o();var z=p(y(),1);var ke=({onSubmit:t,sites:r})=>{let{t:i}=d(),e=E(),s=(0,z.useCallback)(n=>{e.cliFlowStepAnswered({question:i("site_list_select.label"),answer:n.title}),t(n.value)},[e,t,i]);return z.default.createElement(q,{label:i("site_list_select.label"),options:r.map(n=>({key:n.id,title:n.displayName,description:n.viewUrl,value:n})),onSubmit:s})};var De=({sites:t,appId:r,onSubmit:i,onError:e})=>{let{t:s}=d(),{isAppInstalled:n}=j(),[c,C]=(0,T.useState)(null),u=H((f,l)=>n({metaSiteId:l.id,appId:r}),{onError:e});async function S(f){await u.execute(f)?i(f):C(f)}return T.default.createElement(T.default.Fragment,null,T.default.createElement(ke,{onSubmit:S,sites:t}),(0,Ee.isType)(u.status,"Loading")&&T.default.createElement(v,{text:s("general.loading")}),c&&T.default.createElement(Y,{appId:r,site:c,onSubmit:()=>i(c),onError:e}))};var X=({appId:t,biLogger:r,onSubmit:i,onError:e})=>{let[s,n]=(0,g.useState)(null),{createDevSite:c}=G(),C=$(),{status:u}=h(()=>C.querySites({query:{cursorPaging:{limit:100}}}),[],{onError:e}),S=H(()=>c(),{onError:e});function f(l){n(l),l==="create-dev-site"&&S.execute()}return g.default.createElement(ae,{value:r},g.default.createElement(me,{messages:Fe},(0,Le.match)(u,{Error:()=>null,Loading:()=>g.default.createElement(v,{text:g.default.createElement(w,{i18nKey:"general.loading"})}),Success:({result:l})=>g.default.createElement(g.default.Fragment,null,g.default.createElement(be,{onSubmit:f,onError:e,sites:l}),s==="create-dev-site"&&g.default.createElement(Pe,{status:S.status,appId:t,onSubmit:i,onError:e}),s==="select-existing-site"&&g.default.createElement(De,{sites:l,appId:t,onSubmit:i,onError:e}))})))};var Z=({state:t,onSubmit:r})=>{let i=K(),{t:e}=d(),{model:s}=k(),n=W();return B.default.createElement(B.default.Fragment,null,(0,U.match)(t,{NotConfigured:(0,U.constant)(B.default.createElement(O,{type:"insight"},e("general.no_site_id_configured"))),NotFound:({id:c})=>B.default.createElement(O,{type:"error"},e("general.site_id_not_found",{id:c}))}),B.default.createElement(X,{appId:s.config.appId,biLogger:n,onSubmit:r,onError:i}))};var Oe=({children:t,siteId:r})=>{let i=K(),{model:{projectFolder:e}}=k(),s=ue(),n=$(),{t:c}=d(),{status:C,merge:u}=h(async()=>we({projectFolder:e,siteListClient:n,siteId:r,writeDebugLog:s}),[]),S=(0,A.useCallback)(async l=>{try{await Se(e,{siteId:l.id}),u({result:ve.Resolved({site:l})})}catch(_){throw new b({code:x.FailedToSaveDevelopmentSite({path:de}),cause:_})}},[u,e]),f=(0,A.useCallback)(l=>S(l).catch(i),[i,S]);return(0,R.match)(C,{Error:()=>null,Loading:()=>A.default.createElement(v,{text:c("dev_command.site_provider.loading")}),Success:({result:l})=>(0,R.match)(l,{NotConfigured:_=>A.default.createElement(Z,{state:_,onSubmit:f}),NotFound:_=>A.default.createElement(Z,{state:_,onSubmit:f}),Resolved:({site:_})=>A.default.createElement(_e.Provider,{value:{site:_,setSite:S}},typeof t=="function"?t(_):t)})})};o();o();var ee=p(y(),1),te=p(I(),1);function Pi(){let{model:t}=k(),r=(0,ee.useCallback)(e=>t.components.some(s=>s.platforms.some((0,te.isType)(e.type))),[t.components]),i=(0,ee.useCallback)(e=>t.components.every(s=>s.platforms.some((0,te.isType)(e.type))||s.platforms.length===0),[t.components]);return{isPlatformExists:r,hasSinglePlatform:i}}export{j as a,X as b,Oe as c,Pi as d};
4
+ //# sourceMappingURL=chunk-YIGHU6O6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/site-id/SiteIdProvider.tsx","../src/site-id/ResolveSiteId.tsx","../../cli-site-selector/src/index.ts","../../cli-site-selector/src/SiteSelector.tsx","../../cli-site-selector/src/SiteTypeSelect.tsx","../../cli-site-selector/src/bi.ts","../../cli-site-selector/src/CreateDevSite.tsx","../../cli-site-selector/src/WaitForAppToBeInstalled.tsx","../../metasite-manager-client/src/index.ts","../../metasite-manager-client/src/useMetasiteManagerClient.ts","../../metasite-manager-client/src/metasite-manager-client.ts","../../metasite-manager-client/src/schemas.ts","../../cli-site-selector/src/OpenBrowser.tsx","../../cli-site-selector/src/messages.json","../../cli-site-selector/src/SelectExistingSite.tsx","../../cli-site-selector/src/SiteListSelect.tsx","../src/site-id/index.ts","../src/components/Platform/usePlatform.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport type { FC, ReactNode } from 'react';\nimport { match } from 'variant';\nimport { useDebugLog } from '@wix/cli-debug-log';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { APP_CONFIG_PATH } from '@wix/cli-app-definitions';\nimport { useAsync, useExit, Spinner } from '@wix/cli-ui-kit';\nimport { useSiteListClient } from '@wix/site-list-client';\nimport type { Site } from '@wix/site-list-client';\nimport { useTranslation } from '@wix/cli-i18n';\nimport { saveAppConfig } from '../files/app.config.js';\nimport { useProjectModel } from '../model.js';\nimport { ResolveSiteId } from './ResolveSiteId.js';\nimport { SiteIdContext } from './context.js';\nimport { SiteIdState } from './site-id-state.js';\nimport { resolveConfiguredSite } from './resolve-configured-site.js';\n\nexport const SiteIdProvider: FC<{\n siteId?: string;\n children: ReactNode | ((site: Site) => ReactNode);\n}> = ({ children, siteId }) => {\n const exit = useExit();\n const {\n model: { projectFolder },\n } = useProjectModel();\n const writeDebugLog = useDebugLog();\n const siteListClient = useSiteListClient();\n const { t } = useTranslation();\n\n const { status, merge } = useAsync(\n async () =>\n resolveConfiguredSite({\n projectFolder,\n siteListClient,\n siteId,\n writeDebugLog,\n }),\n []\n );\n\n const setSite = useCallback(\n async (site: Site) => {\n try {\n await saveAppConfig(projectFolder, { siteId: site.id });\n merge({ result: SiteIdState.Resolved({ site }) });\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToSaveDevelopmentSite({\n path: APP_CONFIG_PATH,\n }),\n cause: e,\n });\n }\n },\n [merge, projectFolder]\n );\n\n const handleResolveSiteId = useCallback(\n (site: Site) => setSite(site).catch(exit),\n [exit, setSite]\n );\n\n return match(status, {\n Error: () => null,\n Loading: () => <Spinner text={t('dev_command.site_provider.loading')} />,\n Success: ({ result: state }) => {\n return match(state, {\n NotConfigured: (variant) => (\n <ResolveSiteId state={variant} onSubmit={handleResolveSiteId} />\n ),\n NotFound: (variant) => (\n <ResolveSiteId state={variant} onSubmit={handleResolveSiteId} />\n ),\n Resolved: ({ site }) => (\n <SiteIdContext.Provider\n value={{\n site,\n setSite,\n }}\n >\n {typeof children === 'function' ? children(site) : children}\n </SiteIdContext.Provider>\n ),\n });\n },\n });\n};\n","import React from 'react';\nimport type { FC } from 'react';\nimport { match, constant } from 'variant';\nimport type { Site } from '@wix/site-list-client';\nimport { Alert, useExit } from '@wix/cli-ui-kit';\nimport { useTranslation } from '@wix/cli-i18n';\nimport { SiteSelector } from '@wix/cli-site-selector';\nimport { useBiLogger } from '@wix/cli-telemetry-react';\nimport { useProjectModel } from '../model.js';\nimport type { SiteIdState } from './site-id-state.js';\n\ninterface Props {\n state: SiteIdState<'NotConfigured' | 'NotFound'>;\n onSubmit: (site: Site) => void;\n}\n\nexport const ResolveSiteId: FC<Props> = ({ state, onSubmit }) => {\n const exit = useExit();\n const { t } = useTranslation();\n const { model } = useProjectModel();\n const biLogger = useBiLogger();\n\n return (\n <>\n {match(state, {\n NotConfigured: constant(\n <Alert type=\"insight\">{t('general.no_site_id_configured')}</Alert>\n ),\n NotFound: ({ id }) => (\n <Alert type=\"error\">{t('general.site_id_not_found', { id })}</Alert>\n ),\n })}\n <SiteSelector\n appId={model.config.appId}\n biLogger={biLogger}\n onSubmit={onSubmit}\n onError={exit}\n />\n </>\n );\n};\n","export { SiteSelector } from './SiteSelector.js';\n","import React, { useState } from 'react';\nimport type { FC } from 'react';\nimport { match } from 'variant';\nimport { I18nProvider, Trans } from '@wix/cli-i18n';\nimport type { Site } from '@wix/site-list-client';\nimport { Spinner, useAsync, useAsyncCallback } from '@wix/cli-ui-kit';\nimport { useDevCenterClient } from '@wix/dev-center-client';\nimport { useSiteListClient } from '@wix/site-list-client';\nimport type { BiLogger } from '@wix/cli-telemetry';\nimport { BiProvider } from '@wix/cli-telemetry-react';\nimport { SiteTypeSelect } from './SiteTypeSelect.js';\nimport type { SiteType } from './SiteTypeSelect.js';\nimport { CreateDevSite } from './CreateDevSite.js';\nimport messages from './messages.json';\nimport { SelectExistingSite } from './SelectExistingSite.js';\n\ninterface Props {\n appId: string;\n biLogger: BiLogger;\n onSubmit: (site: Site) => void;\n onError: (error: unknown) => void;\n}\n\nexport const SiteSelector: FC<Props> = ({\n appId,\n biLogger,\n onSubmit,\n onError,\n}) => {\n const [siteType, setSiteType] = useState<SiteType | null>(null);\n const { createDevSite } = useDevCenterClient();\n const siteListClient = useSiteListClient();\n\n const { status } = useAsync(\n () =>\n siteListClient.querySites({\n query: {\n cursorPaging: {\n limit: 100,\n },\n },\n }),\n [],\n {\n onError,\n }\n );\n\n const createSite = useAsyncCallback(() => createDevSite(), {\n onError,\n });\n\n function handleSelectSiteType(siteType: SiteType) {\n setSiteType(siteType);\n if (siteType === 'create-dev-site') {\n void createSite.execute();\n }\n }\n\n return (\n <BiProvider value={biLogger}>\n <I18nProvider messages={messages}>\n {match(status, {\n Error: () => null,\n Loading: () => <Spinner text={<Trans i18nKey=\"general.loading\" />} />,\n Success: ({ result: sites }) => (\n <>\n <SiteTypeSelect\n onSubmit={handleSelectSiteType}\n onError={onError}\n sites={sites}\n />\n {siteType === 'create-dev-site' && (\n <CreateDevSite\n status={createSite.status}\n appId={appId}\n onSubmit={onSubmit}\n onError={onError}\n />\n )}\n {siteType === 'select-existing-site' && (\n <SelectExistingSite\n sites={sites}\n appId={appId}\n onSubmit={onSubmit}\n onError={onError}\n />\n )}\n </>\n ),\n })}\n </I18nProvider>\n </BiProvider>\n );\n};\n","import React from 'react';\nimport type { FC } from 'react';\nimport { match } from 'variant';\nimport { useTranslation } from '@wix/cli-i18n';\nimport type { SelectOption } from '@wix/cli-ui-kit';\nimport {\n Spinner,\n SelectInput,\n useAsync,\n SelectOptionAvailability,\n} from '@wix/cli-ui-kit';\nimport { useDevCenterClient } from '@wix/dev-center-client';\nimport type { Site } from '@wix/site-list-client';\nimport { useSiteSelectorBi } from './bi.js';\n\nexport type SiteType = 'create-dev-site' | 'select-existing-site';\ninterface Props {\n onSubmit: (siteType: SiteType) => void;\n onError: (error: unknown) => void;\n sites: Site[];\n}\n\nexport const SiteTypeSelect: FC<Props> = ({ onSubmit, onError, sites }) => {\n const bi = useSiteSelectorBi();\n const { t } = useTranslation();\n const { getDevSitesCount, getDevSitesLimit } = useDevCenterClient();\n const { status } = useAsync(\n () => Promise.all([getDevSitesCount(), getDevSitesLimit()]),\n [],\n { onError }\n );\n\n const handleSubmit = (option: SelectOption<SiteType>) => {\n void bi.cliFlowStepAnswered({\n question: t('site_type_select.label'),\n answer: option.title,\n });\n onSubmit(option.value);\n };\n\n return match(status, {\n Error: () => null,\n Loading: () => <Spinner text={t('general.loading')} />,\n Success: ({ result: [devSitesCount, devSitesLimit] }) => {\n const isDevSitesLimitReached = devSitesCount >= devSitesLimit;\n const userHasNoSites = sites.length === 0;\n\n return (\n <SelectInput<SiteType>\n label={t('site_type_select.label')}\n options={[\n {\n availability: userHasNoSites\n ? SelectOptionAvailability.Disabled({\n reason: t('site_type_select.no_sites'),\n })\n : SelectOptionAvailability.Enabled(),\n title: t('site_type_select.pick_existing_site'),\n value: 'select-existing-site',\n },\n {\n title: t('site_type_select.create_new_dev_site'),\n value: 'create-dev-site',\n availability: isDevSitesLimitReached\n ? SelectOptionAvailability.Disabled({\n reason: t('site_type_select.create_new_dev_site.disabled', {\n limit: devSitesLimit,\n }),\n })\n : SelectOptionAvailability.Enabled(),\n },\n ]}\n onSubmit={handleSubmit}\n />\n );\n },\n });\n};\n","import { useMemo } from 'react';\nimport type { BiLogger } from '@wix/cli-telemetry';\nimport { useBiLogger } from '@wix/cli-telemetry-react';\nimport {\n wixCliAction,\n wixCliAppFlowStepsAnswers,\n} from '@wix/bi-logger-dev-tools-data/v2';\n\nfunction siteSelectorBiEvents(biLogger: BiLogger) {\n return {\n cliAction: ({\n question,\n action,\n key,\n additionalInfo,\n }: {\n question: string;\n action: string;\n key: string;\n additionalInfo?: Record<string, unknown>;\n }) => {\n void biLogger.report(\n wixCliAction({\n question,\n action,\n key,\n additionalInfo: JSON.stringify(additionalInfo),\n })\n );\n },\n cliFlowStepAnswered: ({\n question,\n answer,\n additionalInfo,\n }: {\n question: string;\n answer: string;\n additionalInfo?: Record<string, unknown>;\n }) => {\n void biLogger.report(\n wixCliAppFlowStepsAnswers({\n question,\n answer,\n additionalInfo: JSON.stringify(additionalInfo),\n })\n );\n },\n };\n}\n\nexport function useSiteSelectorBi() {\n const biLogger = useBiLogger();\n return useMemo(() => siteSelectorBiEvents(biLogger), [biLogger]);\n}\n","import React from 'react';\nimport type { FC } from 'react';\nimport { match } from 'variant';\nimport { Trans, useTranslation } from '@wix/cli-i18n';\nimport type { AsyncCallbackStatus } from '@wix/cli-ui-kit';\nimport { Text, Spinner } from '@wix/cli-ui-kit';\nimport type { Site } from '@wix/site-list-client';\nimport { WaitForAppToBeInstalled } from './WaitForAppToBeInstalled.js';\n\ninterface Props {\n status: AsyncCallbackStatus<Site>;\n appId: string;\n onSubmit: (site: Site) => void;\n onError: (error: unknown) => void;\n}\n\nexport const CreateDevSite: FC<Props> = ({\n status,\n appId,\n onSubmit,\n onError,\n}) => {\n const { t } = useTranslation();\n\n return match(status, {\n NotRequested: () => null,\n Error: () => null,\n Loading: () => <Spinner text={t('create_dev_site.loading')} />,\n Success: ({ result }) => (\n <>\n <Trans\n i18nKey=\"create_dev_site.success\"\n components={[<Text skin=\"success\" bold />]}\n values={{ name: result.displayName }}\n />\n <WaitForAppToBeInstalled\n appId={appId}\n site={result}\n onSubmit={() => onSubmit(result)}\n onError={onError}\n />\n </>\n ),\n });\n};\n","import pWaitFor, { TimeoutError } from 'p-wait-for';\nimport React from 'react';\nimport type { FC } from 'react';\nimport { Trans } from '@wix/cli-i18n';\nimport { Alert, Badge, useAsync } from '@wix/cli-ui-kit';\nimport { useMetasiteManagerClient } from '@wix/metasite-manager-client';\nimport { isType, match, variant } from 'variant';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { Site } from '@wix/site-list-client';\nimport { OpenBrowser } from './OpenBrowser.js';\n\ninterface Props {\n site: Site;\n appId: string;\n onSubmit: () => void;\n onError: (error: unknown) => void;\n}\n\nconst AppInstallData = variant({\n Success: {},\n Canceled: {},\n});\n\nfunction isAbortError(error: unknown) {\n return (\n error &&\n typeof error === 'object' &&\n 'name' in error &&\n error.name === 'AbortError'\n );\n}\n\nexport const WaitForAppToBeInstalled: FC<Props> = ({\n appId,\n site,\n onSubmit,\n onError,\n}) => {\n const { isAppInstalled } = useMetasiteManagerClient();\n\n const { status } = useAsync(\n async ({ signal }) => {\n const { appInstallationPollInterval } = getTestOverrides();\n\n try {\n await pWaitFor(() => isAppInstalled({ metaSiteId: site.id, appId }), {\n interval: appInstallationPollInterval ?? 2000,\n timeout: {\n milliseconds: 60 * 1000 * 2,\n signal,\n },\n });\n\n return AppInstallData.Success();\n } catch (error) {\n if (error instanceof TimeoutError) {\n throw new CliError({\n code: CliErrorCode.SiteSelectorTimedout(),\n cause: error,\n });\n }\n\n if (isAbortError(error)) {\n return AppInstallData.Canceled();\n }\n\n throw error;\n }\n },\n [],\n {\n onError,\n onSuccess: (result) => {\n if (isType(result, AppInstallData.Success)) {\n onSubmit();\n }\n },\n }\n );\n\n return match(status, {\n Error: () => null,\n Loading: () => <OpenBrowser siteId={site.id} appId={appId} />,\n Success: () => (\n <Alert type=\"success\">\n <Badge skin=\"success\">\n <Trans i18nKey=\"general.success\" />\n </Badge>{' '}\n <Trans i18nKey=\"install_app_on_site.finished_successfully\" />\n </Alert>\n ),\n });\n};\n","export { useMetasiteManagerClient } from './useMetasiteManagerClient.js';\n","import { useMemo } from 'react';\nimport { useHttpClient } from '@wix/cli-http-client-react';\nimport { MetasiteManagerClient } from './metasite-manager-client.js';\n\nexport function useMetasiteManagerClient(): MetasiteManagerClient {\n const httpClient = useHttpClient({ type: 'general' });\n return useMemo(() => new MetasiteManagerClient(httpClient), [httpClient]);\n}\n","import { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { HttpClient } from '@wix/cli-http-client';\nimport { clientSpecMapSchema } from './schemas.js';\n\nexport class MetasiteManagerClient {\n constructor(private readonly httpClient: HttpClient) {}\n\n private getClientSpecMap = async (metaSiteId: string) => {\n try {\n const { data } = await this.httpClient.request({\n url: `/_api/msm/v1/meta-site/editor-client-spec-map/${metaSiteId}`,\n });\n\n return clientSpecMapSchema.parse(data);\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToGetClientSpecMap(),\n cause: e,\n });\n }\n };\n\n public getSiteInstalledApps = async (metaSiteId: string) => {\n try {\n const clientSpecMap = await this.getClientSpecMap(metaSiteId);\n\n return Object.values(clientSpecMap)\n .filter((spec) => spec.appDefinitionId && !spec.permissions?.revoked)\n .map((spec) => spec.appDefinitionId!);\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToGetSiteInstalledApps(),\n cause: e,\n });\n }\n };\n\n public isAppInstalled = async ({\n metaSiteId,\n appId,\n }: {\n metaSiteId: string;\n appId: string;\n }) => {\n try {\n const clientSpecMap = await this.getClientSpecMap(metaSiteId);\n\n const isInstalled = Object.values(clientSpecMap).some(\n (spec) => spec.appDefinitionId === appId && !spec.permissions?.revoked\n );\n\n return isInstalled;\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToCheckIfAppInstalled(),\n cause: e,\n });\n }\n };\n}\n","import { z } from 'zod';\n\nexport const clientSpecMapSchema = z.record(\n z.object({\n appDefinitionId: z.string().optional(),\n permissions: z.object({ revoked: z.boolean() }).optional(),\n })\n);\n","import React from 'react';\nimport type { FC } from 'react';\nimport { Key, useInput } from '@wix/cli-ui-kit';\nimport { Trans, useTranslation } from '@wix/cli-i18n';\nimport { openBrowser } from '@wix/user-browser';\nimport { useSiteSelectorBi } from './bi.js';\n\ninterface Props {\n siteId: string;\n appId: string;\n}\n\nexport const OpenBrowser: FC<Props> = ({ siteId, appId }) => {\n const { t } = useTranslation();\n const bi = useSiteSelectorBi();\n\n useInput(async (input, key) => {\n if (key.return) {\n bi.cliAction({\n question: t('install_app_on_site.warning.instructions'),\n key: 'enter',\n action: 'install_app_on_site',\n });\n await openBrowser(\n `https://manage.wix.com/installer/install?metaSiteId=${siteId}&appId=${appId}&platform=cli&version=latest`\n );\n }\n });\n\n return (\n <>\n <Trans i18nKey=\"install_app_on_site.warning\" />\n <Trans\n i18nKey=\"install_app_on_site.warning.instructions\"\n components={[<Key value=\"Enter\" />]}\n />\n </>\n );\n};\n","{\n \"general.loading\": \"Loading...\",\n \"general.success\": \"Success\",\n \"site_type_select.label\": \"Select Development Site\",\n \"site_type_select.create_new_dev_site\": \"Create a new Development Site\",\n \"site_type_select.create_new_dev_site.disabled\": \"You have reached the maximum number of {limit} Development Sites\",\n \"site_type_select.pick_existing_site\": \"Pick an existing site\",\n \"site_type_select.no_sites\": \"No sites found\",\n \"create_dev_site.loading\": \"Creating your new Development Site...\",\n \"create_dev_site.success\": \"Development Site <0>{name}</0> created successfully! 🚀\",\n \"site_list_select.label\": \"Select Site\",\n \"install_app_on_site.warning\": \"Your new application needs to be installed on the selected Development Site\",\n \"install_app_on_site.warning.instructions\": \"Press <0/> to install the application in your browser\",\n \"install_app_on_site.finished_successfully\": \"App installed on Development Site.\"\n}\n","import React, { useState } from 'react';\nimport { Spinner, useAsyncCallback } from '@wix/cli-ui-kit';\nimport { useMetasiteManagerClient } from '@wix/metasite-manager-client';\nimport type { Site } from '@wix/site-list-client';\nimport { isType } from 'variant';\nimport { useTranslation } from '@wix/cli-i18n';\nimport { WaitForAppToBeInstalled } from './WaitForAppToBeInstalled.js';\nimport { SiteListSelect } from './SiteListSelect.js';\n\ninterface Props {\n sites: Site[];\n appId: string;\n onSubmit: (site: Site) => void;\n onError: (error: unknown) => void;\n}\n\nexport const SelectExistingSite = ({\n sites,\n appId,\n onSubmit,\n onError,\n}: Props) => {\n const { t } = useTranslation();\n const { isAppInstalled } = useMetasiteManagerClient();\n const [siteToInstallAppOn, setSiteToInstallAppOn] = useState<Site | null>(\n null\n );\n const checkAppInstalled = useAsyncCallback(\n (_, site: Site) => isAppInstalled({ metaSiteId: site.id, appId }),\n {\n onError,\n }\n );\n\n async function handleSelectSite(site: Site) {\n const isInstalled = await checkAppInstalled.execute(site);\n if (isInstalled) {\n onSubmit(site);\n } else {\n setSiteToInstallAppOn(site);\n }\n }\n\n return (\n <>\n <SiteListSelect onSubmit={handleSelectSite} sites={sites} />\n {isType(checkAppInstalled.status, 'Loading') && (\n <Spinner text={t('general.loading')} />\n )}\n {siteToInstallAppOn && (\n <WaitForAppToBeInstalled\n appId={appId}\n site={siteToInstallAppOn}\n onSubmit={() => onSubmit(siteToInstallAppOn)}\n onError={onError}\n />\n )}\n </>\n );\n};\n","import React, { useCallback } from 'react';\nimport type { FC } from 'react';\nimport { useTranslation } from '@wix/cli-i18n';\nimport type { SelectOption } from '@wix/cli-ui-kit';\nimport { SelectInput } from '@wix/cli-ui-kit';\nimport type { Site } from '@wix/site-list-client';\nimport { useSiteSelectorBi } from './bi.js';\n\ninterface Props {\n onSubmit: (site: Site) => void;\n sites: Site[];\n}\n\nexport const SiteListSelect: FC<Props> = ({ onSubmit, sites }) => {\n const { t } = useTranslation();\n const bi = useSiteSelectorBi();\n\n const handleSubmit = useCallback(\n (option: SelectOption<Site>) => {\n bi.cliFlowStepAnswered({\n question: t('site_list_select.label'),\n answer: option.title,\n });\n onSubmit(option.value);\n },\n [bi, onSubmit, t]\n );\n\n return (\n <SelectInput<Site>\n label={t('site_list_select.label')}\n options={sites.map((site) => ({\n key: site.id,\n title: site.displayName,\n description: site.viewUrl,\n value: site,\n }))}\n onSubmit={handleSubmit}\n />\n );\n};\n","export { SiteIdProvider } from './SiteIdProvider.js';\nexport { useSiteId } from './useSiteId.js';\n","import { useCallback } from 'react';\nimport { isType } from 'variant';\nimport type { PlatformType } from '@wix/cli-app-definitions';\nimport { useProjectModel } from '../../model.js';\n\nexport function usePlatform() {\n const { model } = useProjectModel();\n\n const isPlatformExists = useCallback(\n (platformType: PlatformType) =>\n model.components.some((component) =>\n component.platforms.some(isType(platformType.type))\n ),\n [model.components]\n );\n\n const hasSinglePlatform = useCallback(\n (platformType: PlatformType) =>\n model.components.every(\n (component) =>\n component.platforms.some(isType(platformType.type)) ||\n component.platforms.length === 0\n ),\n [model.components]\n );\n\n return {\n isPlatformExists,\n hasSinglePlatform,\n };\n}\n"],"mappings":";;+cAAAA,IAAA,IAAAC,EAAmC,SAEnCC,EAAsB,SCFtBC,IAAA,IAAAC,EAAkB,SAElBC,EAAgC,SCFhCC,ICAAC,IAAA,IAAAC,EAAgC,SAEhCC,GAAsB,SCFtBC,IAAA,IAAAC,EAAkB,SAElBC,GAAsB,SCFtBC,IAAA,IAAAC,GAAwB,SAQxB,SAASC,GAAqBC,EAAoB,CAChD,MAAO,CACL,UAAW,CAAC,CACV,SAAAC,EACA,OAAAC,EACA,IAAAC,EACA,eAAAC,CACF,IAKM,CACCJ,EAAS,OACZK,GAAa,CACX,SAAAJ,EACA,OAAAC,EACA,IAAAC,EACA,eAAgB,KAAK,UAAUC,CAAc,CAC/C,CAAC,CACH,CACF,EACA,oBAAqB,CAAC,CACpB,SAAAH,EACA,OAAAK,EACA,eAAAF,CACF,IAIM,CACCJ,EAAS,OACZO,GAA0B,CACxB,SAAAN,EACA,OAAAK,EACA,eAAgB,KAAK,UAAUF,CAAc,CAC/C,CAAC,CACH,CACF,CACF,CACF,CAEO,SAASI,GAAoB,CAClC,IAAMR,EAAWS,EAAY,EAC7B,SAAO,YAAQ,IAAMV,GAAqBC,CAAQ,EAAG,CAACA,CAAQ,CAAC,CACjE,CD/BO,IAAMU,GAA4B,CAAC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C,IAAc,CAC5B,GAAM,CAAE,MAAAC,CAAM,EAAIC,EAAgB,EAE5BC,KAAmB,gBACtBC,GACCH,EAAM,WAAW,KAAMI,GACrBA,EAAU,UAAU,QAAK,WAAOD,EAAa,IAAI,CAAC,CACpD,EACF,CAACH,EAAM,UAAU,CACnB,EAEMK,KAAoB,gBACvBF,GACCH,EAAM,WAAW,MACdI,GACCA,EAAU,UAAU,QAAK,WAAOD,EAAa,IAAI,CAAC,GAClDC,EAAU,UAAU,SAAW,CACnC,EACF,CAACJ,EAAM,UAAU,CACnB,EAEA,MAAO,CACL,iBAAAE,EACA,kBAAAG,CACF,CACF","names":["init_esm_shims","import_react","import_variant","init_esm_shims","import_react","import_variant","init_esm_shims","init_esm_shims","import_react","import_variant","init_esm_shims","import_react","import_variant","init_esm_shims","import_react","siteSelectorBiEvents","biLogger","question","action","key","additionalInfo","wixCliAction","answer","wixCliAppFlowStepsAnswers","useSiteSelectorBi","useBiLogger","SiteTypeSelect","onSubmit","onError","sites","bi","useSiteSelectorBi","t","useTranslation","getDevSitesCount","getDevSitesLimit","useDevCenterClient","status","useAsync","handleSubmit","option","React","Spinner","devSitesCount","devSitesLimit","isDevSitesLimitReached","userHasNoSites","SelectInput","SelectOptionAvailability","init_esm_shims","import_react","import_variant","init_esm_shims","import_react","init_esm_shims","init_esm_shims","import_react","init_esm_shims","init_esm_shims","clientSpecMapSchema","z","MetasiteManagerClient","httpClient","metaSiteId","data","clientSpecMapSchema","e","CliError","CliErrorCode","clientSpecMap","spec","appId","useMetasiteManagerClient","httpClient","useHttpClient","MetasiteManagerClient","import_variant","init_esm_shims","import_react","OpenBrowser","siteId","appId","t","useTranslation","bi","useSiteSelectorBi","use_input_default","input","key","openBrowser","React","Trans","Key","AppInstallData","isAbortError","error","WaitForAppToBeInstalled","appId","site","onSubmit","onError","isAppInstalled","useMetasiteManagerClient","status","useAsync","signal","appInstallationPollInterval","getTestOverrides","pWaitFor","TimeoutError","CliError","CliErrorCode","result","React","OpenBrowser","Alert","Badge","Trans","CreateDevSite","status","appId","onSubmit","onError","t","useTranslation","React","Spinner","result","Trans","Text","WaitForAppToBeInstalled","messages_default","init_esm_shims","import_react","import_variant","init_esm_shims","import_react","SiteListSelect","onSubmit","sites","t","useTranslation","bi","useSiteSelectorBi","handleSubmit","option","React","SelectInput","site","SelectExistingSite","sites","appId","onSubmit","onError","t","useTranslation","isAppInstalled","useMetasiteManagerClient","siteToInstallAppOn","setSiteToInstallAppOn","checkAppInstalled","useAsyncCallback","_","site","handleSelectSite","React","SiteListSelect","Spinner","WaitForAppToBeInstalled","SiteSelector","appId","biLogger","onSubmit","onError","siteType","setSiteType","createDevSite","useDevCenterClient","siteListClient","useSiteListClient","status","useAsync","createSite","useAsyncCallback","handleSelectSiteType","React","BiProvider","I18nProvider","messages_default","Spinner","Trans","sites","SiteTypeSelect","CreateDevSite","SelectExistingSite","ResolveSiteId","state","onSubmit","exit","useExit","t","useTranslation","model","useProjectModel","biLogger","useBiLogger","React","Alert","id","SiteSelector","SiteIdProvider","children","siteId","exit","useExit","projectFolder","useProjectModel","writeDebugLog","useDebugLog","siteListClient","useSiteListClient","t","useTranslation","status","merge","useAsync","resolveConfiguredSite","setSite","site","saveAppConfig","SiteIdState","e","CliError","CliErrorCode","APP_CONFIG_PATH","handleResolveSiteId","React","Spinner","state","variant","ResolveSiteId","SiteIdContext","init_esm_shims","init_esm_shims","import_react","import_variant","usePlatform","model","useProjectModel","isPlatformExists","platformType","component","hasSinglePlatform"]}