@wix/cli-app 1.1.50 → 1.1.52

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 (96) hide show
  1. package/build/CreateVersionCommand-HVC5JTAL.js +4 -0
  2. package/build/{CreateVersionCommand-G4JMAUB5.js.map → CreateVersionCommand-HVC5JTAL.js.map} +1 -1
  3. package/build/DevCommand-RTZ66W3P.js +4 -0
  4. package/build/DevCommand-RTZ66W3P.js.map +1 -0
  5. package/build/GenerateCommand-J4FYPLSB.js +128 -0
  6. package/build/GenerateCommand-J4FYPLSB.js.map +1 -0
  7. package/build/LogsCommand-J3PHRUGE.js +4 -0
  8. package/build/{LogsCommand-7CMV7VDA.js.map → LogsCommand-J3PHRUGE.js.map} +1 -1
  9. package/build/PreviewCommand-JYIGS25E.js +4 -0
  10. package/build/ServeCommand-LEJRJ2CR.js +4 -0
  11. package/build/ServeCommand-LEJRJ2CR.js.map +1 -0
  12. package/build/build-YPC7VLOB.js +4 -0
  13. package/build/build-YPC7VLOB.js.map +1 -0
  14. package/build/{chunk-U3X4QFEY.js → chunk-2LPICRGU.js} +2 -2
  15. package/build/chunk-2R6WOCA4.js +4 -0
  16. package/build/chunk-2R6WOCA4.js.map +1 -0
  17. package/build/{chunk-LUN6J4D4.js → chunk-2YXY5Y3Z.js} +2 -2
  18. package/build/chunk-522ULCVX.js +100 -0
  19. package/build/chunk-522ULCVX.js.map +1 -0
  20. package/build/{chunk-JTFBYI5Z.js → chunk-6ZJVIMV7.js} +2 -2
  21. package/build/{chunk-AT67JTKR.js → chunk-ATQCL6AZ.js} +59 -59
  22. package/build/{chunk-AT67JTKR.js.map → chunk-ATQCL6AZ.js.map} +1 -1
  23. package/build/chunk-CMBEPCWL.js +4 -0
  24. package/build/chunk-CMBEPCWL.js.map +1 -0
  25. package/build/chunk-EWA6OFAF.js +5 -0
  26. package/build/chunk-EWA6OFAF.js.map +1 -0
  27. package/build/chunk-FMTROGFZ.js +4 -0
  28. package/build/chunk-FMTROGFZ.js.map +1 -0
  29. package/build/chunk-KNH7RNAZ.js +11 -0
  30. package/build/chunk-KNH7RNAZ.js.map +1 -0
  31. package/build/chunk-MXLCRTVZ.js +4 -0
  32. package/build/{chunk-VMPGY3XD.js → chunk-NEWE3FX5.js} +2 -2
  33. package/build/chunk-RWTMPGYF.js +4 -0
  34. package/build/chunk-RWTMPGYF.js.map +1 -0
  35. package/build/{chunk-PZBAQL52.js → chunk-UKELYG5A.js} +2 -2
  36. package/build/chunk-WJTPY35F.js +9 -0
  37. package/build/chunk-WJTPY35F.js.map +1 -0
  38. package/build/{chunk-SUKF3ONU.js → chunk-WLHVYK7Z.js} +2 -2
  39. package/build/{chunk-QPGCBW5R.js → chunk-WRYRVOZP.js} +2 -2
  40. package/build/chunk-X3ZYER2U.js +115 -0
  41. package/build/chunk-X3ZYER2U.js.map +1 -0
  42. package/build/{chunk-RSCSYMHP.js → chunk-ZCIEKIRM.js} +2 -2
  43. package/build/index.js +2 -2
  44. package/build/index.js.map +1 -1
  45. package/build/platform-sdk/editor.js +6 -6
  46. package/build/platform-sdk/editor.js.map +1 -1
  47. package/build/preview-VAP5AF4W.js +4 -0
  48. package/build/{preview-CLW3KECJ.js.map → preview-VAP5AF4W.js.map} +1 -1
  49. package/build/render-command-NE2QILSS.js +4 -0
  50. package/build/render-command-NE2QILSS.js.map +1 -0
  51. package/package.json +5 -4
  52. package/schemas/wix-config.json +1 -1
  53. package/templates/custom-element/dependencies.json +1 -1
  54. package/templates/dashboard-modal/files/modal.tsx.ejs +2 -2
  55. package/templates/dashboard-plugin/files/plugin.tsx.ejs +1 -1
  56. package/templates/site-plugin/dependencies.json +1 -1
  57. package/templates/site-plugin/files/plugin.tsx.ejs +1 -0
  58. package/build/CreateVersionCommand-G4JMAUB5.js +0 -4
  59. package/build/DevCommand-ICJ7HWGE.js +0 -4
  60. package/build/DevCommand-ICJ7HWGE.js.map +0 -1
  61. package/build/GenerateCommand-IGBPVFUN.js +0 -99
  62. package/build/GenerateCommand-IGBPVFUN.js.map +0 -1
  63. package/build/LogsCommand-7CMV7VDA.js +0 -4
  64. package/build/PreviewCommand-4JOWYN2H.js +0 -4
  65. package/build/ServeCommand-I5CZCTC2.js +0 -4
  66. package/build/ServeCommand-I5CZCTC2.js.map +0 -1
  67. package/build/build-F7QA4DJU.js +0 -4
  68. package/build/build-F7QA4DJU.js.map +0 -1
  69. package/build/chunk-AKOLPD6V.js +0 -4
  70. package/build/chunk-AKOLPD6V.js.map +0 -1
  71. package/build/chunk-AODPLKHZ.js +0 -4
  72. package/build/chunk-AODPLKHZ.js.map +0 -1
  73. package/build/chunk-AQLOAQFB.js +0 -4
  74. package/build/chunk-AQLOAQFB.js.map +0 -1
  75. package/build/chunk-PWIPMRWY.js +0 -4
  76. package/build/chunk-TT7ANJ37.js +0 -115
  77. package/build/chunk-TT7ANJ37.js.map +0 -1
  78. package/build/chunk-WPDKHYDX.js +0 -10
  79. package/build/chunk-WPDKHYDX.js.map +0 -1
  80. package/build/chunk-Z6KGERGI.js +0 -100
  81. package/build/chunk-Z6KGERGI.js.map +0 -1
  82. package/build/chunk-ZN6WU4UI.js +0 -11
  83. package/build/chunk-ZN6WU4UI.js.map +0 -1
  84. package/build/preview-CLW3KECJ.js +0 -4
  85. package/build/render-command-MDMVZZWK.js +0 -4
  86. package/build/render-command-MDMVZZWK.js.map +0 -1
  87. /package/build/{PreviewCommand-4JOWYN2H.js.map → PreviewCommand-JYIGS25E.js.map} +0 -0
  88. /package/build/{chunk-U3X4QFEY.js.map → chunk-2LPICRGU.js.map} +0 -0
  89. /package/build/{chunk-LUN6J4D4.js.map → chunk-2YXY5Y3Z.js.map} +0 -0
  90. /package/build/{chunk-JTFBYI5Z.js.map → chunk-6ZJVIMV7.js.map} +0 -0
  91. /package/build/{chunk-PWIPMRWY.js.map → chunk-MXLCRTVZ.js.map} +0 -0
  92. /package/build/{chunk-VMPGY3XD.js.map → chunk-NEWE3FX5.js.map} +0 -0
  93. /package/build/{chunk-PZBAQL52.js.map → chunk-UKELYG5A.js.map} +0 -0
  94. /package/build/{chunk-SUKF3ONU.js.map → chunk-WLHVYK7Z.js.map} +0 -0
  95. /package/build/{chunk-QPGCBW5R.js.map → chunk-WRYRVOZP.js.map} +0 -0
  96. /package/build/{chunk-RSCSYMHP.js.map → chunk-ZCIEKIRM.js.map} +0 -0
@@ -0,0 +1,4 @@
1
+ import { createRequire as _createRequire } from 'node:module';
2
+ const require = _createRequire(import.meta.url);
3
+ import{U as a}from"./chunk-522ULCVX.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-CMBEPCWL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vite/logger.tsx"],"sourcesContent":["import { createRendererToString } from '@wix/cli-ui-kit';\nimport type { ReactElement } from 'react';\nimport type { LogErrorOptions, LogOptions, Logger as ViteLogger } from 'vite';\nimport { createLogger as createViteLogger } from 'vite';\n\nfunction isInfoMessageFiltered(msg: string) {\n return [/Port \\d{1,5} is in use, trying another one/].some((x) =>\n x.test(msg)\n );\n}\n\nexport interface Logger extends ViteLogger {\n info: (msg: string | ReactElement, options?: LogOptions) => void;\n warn: (msg: string | ReactElement, options?: LogOptions) => void;\n warnOnce: (msg: string | ReactElement, options?: LogOptions) => void;\n error: (msg: string | ReactElement, options?: LogErrorOptions) => void;\n}\n\nexport function createLogger({\n timestamp,\n}: { timestamp?: boolean } = {}): Logger {\n const renderer = createRendererToString({ stripAnsi: false });\n\n const originalLogger = createViteLogger('info', {\n allowClearScreen: false,\n prefix: '',\n });\n\n const defaultOptions = { timestamp };\n\n const logMessage = (\n level: 'info' | 'warn' | 'warnOnce' | 'error',\n msg: string | ReactElement,\n options?: LogOptions | LogErrorOptions\n ) => {\n const logOptions = { ...options, ...defaultOptions };\n\n if (typeof msg === 'string') {\n if (!isInfoMessageFiltered(msg)) {\n return originalLogger[level](msg, logOptions);\n }\n\n return null;\n }\n\n // https://github.com/wix-private/wix-cli/pull/2745/files#r1826977936\n return setTimeout(() =>\n originalLogger[level](renderer.render(msg), logOptions)\n );\n };\n\n return {\n ...originalLogger,\n info: (msg, options?) => logMessage('info', msg, options),\n error: (msg, options?) => logMessage('error', msg, options),\n warn: (msg, options?) => logMessage('warn', msg, options),\n warnOnce: (msg, options?) => logMessage('warnOnce', msg, options),\n } satisfies Logger;\n}\n"],"mappings":";;gFAAAA,IAGA,OAAS,gBAAgBC,MAAwB,OAEjD,SAASC,EAAsBC,EAAa,CAC1C,MAAO,CAAC,4CAA4C,EAAE,KAAMC,GAC1DA,EAAE,KAAKD,CAAG,CACZ,CACF,CASO,SAASE,EAAa,CAC3B,UAAAC,CACF,EAA6B,CAAC,EAAW,CACvC,IAAMC,EAAWC,EAAuB,CAAE,UAAW,EAAM,CAAC,EAEtDC,EAAiBR,EAAiB,OAAQ,CAC9C,iBAAkB,GAClB,OAAQ,EACV,CAAC,EAEKS,EAAiB,CAAE,UAAAJ,CAAU,EAE7BK,EAAa,CACjBC,EACAT,EACAU,IACG,CACH,IAAMC,EAAa,CAAE,GAAGD,EAAS,GAAGH,CAAe,EAEnD,OAAI,OAAOP,GAAQ,SACZD,EAAsBC,CAAG,EAIvB,KAHEM,EAAeG,CAAK,EAAET,EAAKW,CAAU,EAOzC,WAAW,IAChBL,EAAeG,CAAK,EAAEL,EAAS,OAAOJ,CAAG,EAAGW,CAAU,CACxD,CACF,EAEA,MAAO,CACL,GAAGL,EACH,KAAM,CAACN,EAAKU,IAAaF,EAAW,OAAQR,EAAKU,CAAO,EACxD,MAAO,CAACV,EAAKU,IAAaF,EAAW,QAASR,EAAKU,CAAO,EAC1D,KAAM,CAACV,EAAKU,IAAaF,EAAW,OAAQR,EAAKU,CAAO,EACxD,SAAU,CAACV,EAAKU,IAAaF,EAAW,WAAYR,EAAKU,CAAO,CAClE,CACF","names":["init_esm_shims","createViteLogger","isInfoMessageFiltered","msg","x","createLogger","timestamp","renderer","createRendererToString","originalLogger","defaultOptions","logMessage","level","options","logOptions"]}
@@ -0,0 +1,5 @@
1
+ import { createRequire as _createRequire } from 'node:module';
2
+ const require = _createRequire(import.meta.url);
3
+ import{a as G}from"./chunk-WJTPY35F.js";import{Ta as Ee,Xa as ye,a as Y,b as ge,c as he,d as L,m as xe,u as we}from"./chunk-X3ZYER2U.js";import{b as ve,e as N,f as A,m as j,n as F}from"./chunk-522ULCVX.js";import{a as x,c as O,e as X,g as d,h as a}from"./chunk-V4TR6DCM.js";var U=O((Vt,Re)=>{"use strict";a();var mr=Object.create,k=Object.defineProperty,vr=Object.getOwnPropertyDescriptor,gr=Object.getOwnPropertyNames,hr=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty,wr=(e,r)=>{for(var t in r)k(e,t,{get:r[t],enumerable:!0})},Oe=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of gr(r))!xr.call(e,n)&&n!==t&&k(e,n,{get:()=>r[n],enumerable:!(o=vr(r,n))||o.enumerable});return e},Er=(e,r,t)=>(t=e!=null?mr(hr(e)):{},Oe(r||!e||!e.__esModule?k(t,"default",{value:e,enumerable:!0}):t,e)),yr=e=>Oe(k({},"__esModule",{value:!0}),e),Se={};wr(Se,{CLOUDFLARED_VERSION:()=>br,DEFAULT_CLOUDFLARED_BIN:()=>be,RELEASE_BASE:()=>Pr,bin:()=>Pe,use:()=>Sr});Re.exports=yr(Se);var Or=Er(x("node:path")),be=Or.default.join(d,"..","bin",process.platform==="win32"?"cloudflared.exe":"cloudflared"),Pe=process.env.CLOUDFLARED_BIN||be;function Sr(e){Pe=e}var br=process.env.CLOUDFLARED_VERSION||"latest",Pr="https://github.com/cloudflare/cloudflared/releases/"});var Ie=O((kt,Te)=>{"use strict";a();var K=Object.defineProperty,Rr=Object.getOwnPropertyDescriptor,Cr=Object.getOwnPropertyNames,Tr=Object.prototype.hasOwnProperty,Ir=(e,r)=>{for(var t in r)K(e,t,{get:r[t],enumerable:!0})},Dr=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Cr(r))!Tr.call(e,n)&&n!==t&&K(e,n,{get:()=>r[n],enumerable:!(o=Rr(r,n))||o.enumerable});return e},Lr=e=>Dr(K({},"__esModule",{value:!0}),e),Ce={};Ir(Ce,{UnsupportedError:()=>Z});Te.exports=Lr(Ce);var Z=class extends Error{constructor(r){super(r)}}});var qe=O((Mt,Ue)=>{"use strict";a();var Nr=Object.create,B=Object.defineProperty,Ar=Object.getOwnPropertyDescriptor,jr=Object.getOwnPropertyNames,Ur=Object.getPrototypeOf,qr=Object.prototype.hasOwnProperty,$r=(e,r)=>{for(var t in r)B(e,t,{get:r[t],enumerable:!0})},De=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of jr(r))!qr.call(e,n)&&n!==t&&B(e,n,{get:()=>r[n],enumerable:!(o=Ar(r,n))||o.enumerable});return e},Q=(e,r,t)=>(t=e!=null?Nr(Ur(e)):{},De(r||!e||!e.__esModule?B(t,"default",{value:e,enumerable:!0}):t,e)),Vr=e=>De(B({},"__esModule",{value:!0}),e),Le={};$r(Le,{install:()=>Hr,install_linux:()=>Ne,install_macos:()=>Ae,install_windows:()=>je});Ue.exports=Vr(Le);var S=Q(x("node:fs")),q=Q(x("node:path")),Fr=Q(x("node:https")),kr=x("node:child_process"),C=U(),M=Ie(),Br={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},Mr={arm64:"cloudflared-darwin-amd64.tgz",x64:"cloudflared-darwin-amd64.tgz"},Jr={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe"};function ee(e){return e==="latest"?`${C.RELEASE_BASE}latest/download/`:`${C.RELEASE_BASE}download/${e}/`}async function Hr(e,r=C.CLOUDFLARED_VERSION){if(process.platform==="linux")return Ne(e,r);if(process.platform==="darwin")return Ae(e,r);if(process.platform==="win32")return je(e,r);throw new M.UnsupportedError("Unsupported platform: "+process.platform)}async function Ne(e,r=C.CLOUDFLARED_VERSION){let t=Br[process.arch];if(t===void 0)throw new M.UnsupportedError("Unsupported architecture: "+process.arch);return await J(ee(r)+t,e),S.default.chmodSync(e,"755"),e}async function Ae(e,r=C.CLOUDFLARED_VERSION){let t=Mr[process.arch];if(t===void 0)throw new M.UnsupportedError("Unsupported architecture: "+process.arch);return await J(ee(r)+t,`${e}.tgz`),process.env.VERBOSE&&console.log(`Extracting to ${e}`),(0,kr.execSync)(`tar -xzf ${q.default.basename(`${e}.tgz`)}`,{cwd:q.default.dirname(e)}),S.default.unlinkSync(`${e}.tgz`),S.default.renameSync(`${q.default.dirname(e)}/cloudflared`,e),e}async function je(e,r=C.CLOUDFLARED_VERSION){let t=Jr[process.arch];if(t===void 0)throw new M.UnsupportedError("Unsupported architecture: "+process.arch);return await J(ee(r)+t,e),e}function J(e,r,t=0){return t===0?process.env.VERBOSE&&console.log(`Downloading ${e} to ${r}`):process.env.VERBOSE&&console.log(`Redirecting to ${e}`),S.default.existsSync(q.default.dirname(r))||S.default.mkdirSync(q.default.dirname(r),{recursive:!0}),new Promise((o,n)=>{let i=Fr.default.get(e,s=>{if([301,302,303,307,308].includes(s.statusCode)&&s.headers.location!==void 0){i.destroy();let l=s.headers.location;o(J(l,r,t+1));return}if(s.statusCode&&s.statusCode>=200&&s.statusCode<300){let l=S.default.createWriteStream(r);l.on("finish",()=>{l.close(()=>o(r))}),l.on("error",v=>{S.default.unlink(r,()=>n(v))}),s.pipe(l)}else i.destroy(),n(new Error(`HTTP response with status code: ${s.statusCode}`))});i.on("error",s=>{n(s)}),i.end()})}});var te=O((Ht,Ve)=>{"use strict";a();var re=Object.defineProperty,zr=Object.getOwnPropertyDescriptor,Wr=Object.getOwnPropertyNames,Xr=Object.prototype.hasOwnProperty,Yr=(e,r)=>{for(var t in r)re(e,t,{get:r[t],enumerable:!0})},Gr=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Wr(r))!Xr.call(e,n)&&n!==t&&re(e,n,{get:()=>r[n],enumerable:!(o=zr(r,n))||o.enumerable});return e},Zr=e=>Gr(re({},"__esModule",{value:!0}),e),$e={};Yr($e,{config_regex:()=>at,conn_regex:()=>Kr,connectorID_regex:()=>ot,disconnect_regex:()=>tt,index_regex:()=>rt,ip_regex:()=>Qr,location_regex:()=>et,metrics_regex:()=>st,tunnelID_regex:()=>nt});Ve.exports=Zr($e);var Kr=/connection[= ]([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Qr=/ip=([0-9.]+)/,et=/location=([A-Za-z0-9]+)/,rt=/connIndex=(\d)/,tt=/Unregistered tunnel connection connIndex=(\d)/i,nt=/tunnelID=([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,ot=/Connector ID: ([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,st=/metrics server on ([0-9.:]+\/metrics)/,at=/config="(.+[^\\])"/});var Be=O((Wt,ke)=>{"use strict";a();var ne=Object.defineProperty,it=Object.getOwnPropertyDescriptor,ct=Object.getOwnPropertyNames,lt=Object.prototype.hasOwnProperty,ut=(e,r)=>{for(var t in r)ne(e,t,{get:r[t],enumerable:!0})},pt=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ct(r))!lt.call(e,n)&&n!==t&&ne(e,n,{get:()=>r[n],enumerable:!(o=it(r,n))||o.enumerable});return e},dt=e=>pt(ne({},"__esModule",{value:!0}),e),Fe={};ut(Fe,{tunnel:()=>mt});ke.exports=dt(Fe);var _t=x("node:child_process"),ft=U(),H=te();function mt(e={}){let r=["tunnel"];for(let[_,g]of Object.entries(e))typeof g=="string"?r.push(`${_}`,g):typeof g=="number"?r.push(`${_}`,g.toString()):g===null&&r.push(`${_}`);r.length===1&&r.push("--url","localhost:8080");let t=(0,_t.spawn)(ft.bin,r,{stdio:["ignore","pipe","pipe"]});process.env.VERBOSE&&(t.stdout.pipe(process.stdout),t.stderr.pipe(process.stderr));let o=/\|\s+(https?:\/\/[^\s]+)/,n=()=>{},i=()=>{},s=new Promise((..._)=>[n,i]=_),u=[],l=[],v=[];for(let _=0;_<1;_++)v.push(new Promise((...g)=>[u[_],l[_]]=g));let c=_=>{var g;let y=_.toString(),pe=y.match(o);pe&&n(pe[1]);let de=y.match(H.conn_regex),_e=y.match(H.ip_regex),fe=y.match(H.location_regex),me=y.match(H.index_regex);if(de&&_e&&fe&&me){let[,pr]=de,[,dr]=_e,[,_r]=fe,[,fr]=me;(g=u[+fr])==null||g.call(u,{id:pr,ip:dr,location:_r})}};return t.stdout.on("data",c).on("error",i),t.stderr.on("data",c).on("error",i),{url:s,connections:v,child:t,stop:()=>t.kill("SIGINT")}}});var Qe=O((Yt,Ke)=>{"use strict";a();var vt=Object.create,z=Object.defineProperty,gt=Object.getOwnPropertyDescriptor,ht=Object.getOwnPropertyNames,xt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty,Et=(e,r)=>{for(var t in r)z(e,t,{get:r[t],enumerable:!0})},Me=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ht(r))!wt.call(e,n)&&n!==t&&z(e,n,{get:()=>r[n],enumerable:!(o=gt(r,n))||o.enumerable});return e},Je=(e,r,t)=>(t=e!=null?vt(xt(e)):{},Me(r||!e||!e.__esModule?z(t,"default",{value:e,enumerable:!0}):t,e)),yt=e=>Me(z({},"__esModule",{value:!0}),e),He={};Et(He,{AlreadyInstalledError:()=>$,LINUX_SERVICE_PATH:()=>P,MACOS_SERVICE_PATH:()=>w,NotInstalledError:()=>R,clean:()=>Ze,current:()=>Ge,err:()=>ce,exists:()=>E,identifier:()=>b,install:()=>We,journal:()=>le,log:()=>Ye,service:()=>Ot,service_name:()=>ie,uninstall:()=>Xe});Ke.exports=yt(He);var oe=Je(x("node:os")),m=Je(x("node:fs")),ae=x("node:child_process"),ze=U(),p=te(),b="com.cloudflare.cloudflared",ie="cloudflared.service",w={PLIST:se()?`/Library/LaunchDaemons/${b}.plist`:`${oe.default.homedir()}/Library/LaunchAgents/${b}.plist`,OUT:se()?`/Library/Logs/${b}.out.log`:`${oe.default.homedir()}/Library/Logs/${b}.out.log`,ERR:se()?`/Library/Logs/${b}.err.log`:`${oe.default.homedir()}/Library/Logs/${b}.err.log`},P={SYSTEMD:`/etc/systemd/system/${ie}`,SERVICE:"/etc/init.d/cloudflared",SERVICE_OUT:"/var/log/cloudflared.log",SERVICE_ERR:"/var/log/cloudflared.err"},Ot={install:We,uninstall:Xe,exists:E,log:Ye,err:ce,current:Ge,clean:Ze,journal:le},$=class extends Error{constructor(){super("service is already installed")}},R=class extends Error{constructor(){super("service is not installed")}};function We(e){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(E())throw new $;let r=["service","install"];e&&r.push(e);let t=(0,ae.spawnSync)(ze.bin,r);if(t.status!==0)throw new Error(`service install failed: ${t.stderr.toString()}`)}function Xe(){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!E())throw new R;let e=(0,ae.spawnSync)(ze.bin,["service","uninstall"]);if(e.status!==0)throw new Error(`service uninstall failed: ${e.stderr.toString()}`);process.platform==="darwin"?(m.default.rmSync(w.OUT),m.default.rmSync(w.ERR)):process.platform==="linux"&&!T()&&(m.default.rmSync(P.SERVICE_OUT),m.default.rmSync(P.SERVICE_ERR))}function Ye(){if(!E())throw new R;if(process.platform==="darwin")return m.default.readFileSync(w.OUT,"utf8");if(process.platform==="linux"&&!T())return m.default.readFileSync(P.SERVICE_OUT,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function ce(){if(!E())throw new R;if(process.platform==="darwin")return m.default.readFileSync(w.ERR,"utf8");if(process.platform==="linux"&&!T())return m.default.readFileSync(P.SERVICE_ERR,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function le(e=300){if(process.platform==="linux"&&T()){let r=["-u",ie,"-o","cat","-n",e.toString()];return(0,ae.spawnSync)("journalctl",r).stdout.toString()}throw new Error(`Not Implemented on platform ${process.platform}`)}function Ge(){var e,r,t,o;if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!E())throw new R;let n=T()?le():ce(),i="",s="",u=[],l="",v={};for(let c of n.split(`
4
+ `))try{if(c.match(p.tunnelID_regex))i=((e=c.match(p.tunnelID_regex))==null?void 0:e[1])??"";else if(c.match(p.connectorID_regex))s=((r=c.match(p.connectorID_regex))==null?void 0:r[1])??"";else if(c.match(p.conn_regex)&&c.match(p.location_regex)&&c.match(p.ip_regex)&&c.match(p.index_regex)){let[,h]=c.match(p.conn_regex)??[],[,_]=c.match(p.location_regex)??[],[,g]=c.match(p.ip_regex)??[],[,y]=c.match(p.index_regex)??[];u[parseInt(y)]={id:h,ip:g,location:_}}else if(c.match(p.disconnect_regex)){let[,h]=c.match(p.disconnect_regex)??[];parseInt(h)in u&&(u[parseInt(h)]={id:"",ip:"",location:""})}else c.match(p.metrics_regex)?l=((t=c.match(p.metrics_regex))==null?void 0:t[1])??"":c.match(p.config_regex)&&(v=JSON.parse(((o=c.match(p.config_regex))==null?void 0:o[1].replace(/\\/g,""))??"{}"))}catch(h){process.env.VERBOSE&&console.error("log parsing failed",h)}return{tunnelID:i,connectorID:s,connections:u,metrics:l,config:v}}function Ze(){if(process.platform!=="darwin")throw new Error(`Not Implemented on platform ${process.platform}`);if(E())throw new $;m.default.rmSync(w.OUT,{force:!0}),m.default.rmSync(w.ERR,{force:!0})}function E(){if(process.platform==="darwin")return m.default.existsSync(w.PLIST);if(process.platform==="linux")return T()?m.default.existsSync(P.SYSTEMD):m.default.existsSync(P.SERVICE);throw new Error(`Not Implemented on platform ${process.platform}`)}function se(){var e;return((e=process.getuid)==null?void 0:e.call(process))===0}function T(){return process.platform==="linux"&&m.default.existsSync("/run/systemd/system")}});var tr=O((Zt,rr)=>{"use strict";a();var ue=Object.defineProperty,St=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyNames,Pt=Object.prototype.hasOwnProperty,Rt=(e,r)=>{for(var t in r)ue(e,t,{get:r[t],enumerable:!0})},Ct=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of bt(r))!Pt.call(e,n)&&n!==t&&ue(e,n,{get:()=>r[n],enumerable:!(o=St(r,n))||o.enumerable});return e},Tt=e=>Ct(ue({},"__esModule",{value:!0}),e),er={};Rt(er,{AlreadyInstalledError:()=>V.AlreadyInstalledError,MACOS_SERVICE_PATH:()=>V.MACOS_SERVICE_PATH,NotInstalledError:()=>V.NotInstalledError,bin:()=>It.bin,identifier:()=>V.identifier,install:()=>Dt.install,service:()=>V.service,tunnel:()=>Lt.tunnel});rr.exports=Tt(er);var It=U(),Dt=qe(),Lt=Be(),V=Qe()});a();var D=X(ve(),1);a();import{dirname as Nt}from"node:path";var I=X(tr(),1);async function nr(e,r){let{localTunnel:t}=F();if(!t&&!await xe(I.bin))try{await(0,I.install)(I.bin)}catch(s){let u=s;throw s instanceof Error&&u.code==="EACCES"?new N({code:A.FailedInstallCloudflareNoAccess({path:Nt(u.path)})}):s}let o=await r.createTunnel({port:e}),n=`http${t?"":"s"}://${o.domain}`,i=new Promise((s,u)=>{let l=t?G("echo",[o.domain,o.token],{detached:!0}):G(I.bin,["tunnel","run","--token",o.token]),v=()=>{l.kill()},c=async h=>{h.toString().match(o.domain)?.[0]&&s({domain:n,close:v})};l.stderr?.on("data",c),l.stdout?.on("data",c),l.on("error",h=>{u(h)})});return{domain:n,close:async()=>(await i).close()}}a();var or=e=>({tunnel:()=>{let r=Date.now();return{finish:({isSuccess:t,failureReason:o})=>{e.report(ye({isSuccess:t,failureReason:o,tunnelCreationTime:Date.now()-r}))}}}});a();var lr=X(ve(),1);a();a();var At={},jt={},Ut={},qt={};function sr(e){var r={"bo._base_domain_":[{srcPath:"/_serverless/wix-app-backend-manager",destPath:""}],"wixbo.ai":[{srcPath:"/_serverless/wix-app-backend-manager",destPath:""}],"manage._base_domain_":[{srcPath:"/_serverless/wix-app-backend-manager",destPath:""}]};return ge(Object.assign(e,{domainToMappings:r}))}function ar(e){var r=L(At,{}),t=r.toJSON,o=r.fromJSON,n=L(jt,{}).fromJSON;function i(s){var u=s.host,l=t(e),v={entityFqdn:"wix.apps.hosting.v1.deployment",method:"POST",methodFqn:"wix.apps.hosting.v1.BackendService.CreateTunnel",url:sr({protoPath:"/v1/tunnel",data:l,host:u}),data:l,transformResponse:n};return v}return i.fromReq=o,i.__isAmbassador=!0,i}function ir(e){var r=L(Ut,{}),t=r.toJSON,o=r.fromJSON,n=L(qt,{}).fromJSON;function i(s){var u=s.host,l=t(e),v={entityFqdn:"wix.apps.hosting.v1.deployment",method:"DELETE",methodFqn:"wix.apps.hosting.v1.BackendService.DeleteTunnel",url:sr({protoPath:"/v1/tunnel",data:l,host:u}),params:he(l),transformResponse:n};return v}return i.fromReq=o,i.__isAmbassador=!0,i}a();var cr=j.object({id:j.string(),token:j.string(),domain:j.string()});var W=class{constructor(r){this.httpClient=r;let{minRetryTimeout:t}=F();this.retryOptions={retries:3,minTimeout:t,maxTimeout:3*1e3}}retryOptions;createTunnel=async({port:r})=>{try{let{data:t}=await Y(()=>this.httpClient.request(ar({port:r})),this.retryOptions);return cr.parse(t)}catch(t){throw new N({code:A.FailedToCreateTunnel(),cause:t})}};deleteTunnel=async r=>{try{await Y(()=>this.httpClient.request(ir({id:r})),this.retryOptions)}catch(t){throw new N({code:A.FailedToDeleteTunnel(),cause:t})}}};function ur(){let e=Ee({type:"backoffice"});return(0,lr.useMemo)(()=>new W(e),[e])}function $t(){let e=(0,D.useRef)(),r=ur(),t=we();return(0,D.useEffect)(()=>()=>{e.current?.close()},[]),(0,D.useCallback)(async o=>{let i=or(t).tunnel();try{let s=await nr(o,r);return e.current=s,i.finish({isSuccess:!0}),{url:s.domain}}catch(s){throw i.finish({isSuccess:!1,failureReason:s instanceof Error?s.message:"Unknown error"}),s}},[r,t])}a();export{$t as a};
5
+ //# sourceMappingURL=chunk-EWA6OFAF.js.map
@@ -0,0 +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,KAAYA,EAASU,GAAO,KAAOjB,GAASI,GAAaa,CAAG,CAAC,EAAI,CAAC,EAAGP,GAAYQ,GAAc,CAACD,GAAO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AAIC,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"]}
@@ -0,0 +1,4 @@
1
+ import { createRequire as _createRequire } from 'node:module';
2
+ const require = _createRequire(import.meta.url);
3
+ import{a as X,b as Z}from"./chunk-ZCIEKIRM.js";import{c as V}from"./chunk-WLHVYK7Z.js";import{a as W}from"./chunk-2R6WOCA4.js";import{g as Y,h as q,j as H,k as K,l as z,m as Q}from"./chunk-RWTMPGYF.js";import{a as J}from"./chunk-2LPICRGU.js";import{Ra as j,Sa as w,Ta as D,Ua as G,bb as N,u as U,ub as E}from"./chunk-X3ZYER2U.js";import{A as b,C as k,L as F,O as B,R as M,S as f,V as L,W as h,b as C,c as _,x as g}from"./chunk-522ULCVX.js";import{e as d,h as t}from"./chunk-V4TR6DCM.js";t();t();var P=d(C(),1);t();var e=d(C(),1),R=d(_(),1);t();var x=d(C(),1),$=d(_(),1),T=({status:n,loadingText:p,successText:s})=>(0,$.match)(n,{NotRequested:()=>null,Loading:()=>x.default.createElement(B,{text:p}),Error:()=>null,Success:()=>x.default.createElement(F,{type:"success"},s)});var ee=({baseUrl:n,onPreviewCreated:p})=>{let{site:s}=z(),{t:a}=h(),{model:o}=E(),{backendComponents:oe}=J(),re=Y(),te=U(),{getAppByVersion:ie}=G(),{createOverride:ne}=H(),se=D({type:"backoffice"}),S=f(()=>N(o.config.appId,o.projectFolder,te,se,oe.length>0)),me=f((c,r)=>ne({appId:o.config.appId,siteId:s.id,overrides:r})),A=f((c,r,l,m,i,u)=>W({model:o,arm:re,serveUrl:r,backendServerUrl:m,topologyComponentId:l,monitoringData:i,monitoringComponentId:u})),{status:pe}=M(async()=>{await X(o.projectFolder);let{serveUrl:c,backendServerUrl:r}=n?{serveUrl:n,backendServerUrl:void 0}:await S.execute(),{data:{components:l}}=await ie({appId:o.config.appId}),m=l.find(v=>v.compType===w.TOPOLOGY),i=l.find(v=>v.compType===w.MONITORING),u=K(o),{id:ae}=u?await me.execute(u):await Promise.resolve({id:void 0}),O=await A.execute(c,m?.compId,r,i?.compData.monitoring,i?.compId);return(m||i)&&await j(o.projectFolder,{...m?{topologyComponentId:m.compId}:{},...i?{monitoringComponentId:i.compId}:{}}),p?.(O,r),{armTag:O,siteOverrideId:ae}},[]);return e.default.createElement(e.default.Fragment,null,e.default.createElement(T,{status:S.status,loadingText:a("preview_command.uploading_files"),successText:a("preview_command.uploading_files_success")}),e.default.createElement(T,{status:A.status,loadingText:a("preview_command.creating_preview"),successText:a("preview_command.creating_preview_success")}),(0,R.match)(pe,{Error:()=>null,Loading:()=>null,Success:({result:{armTag:c,siteOverrideId:r}})=>e.default.createElement(Q,{siteOverrideId:r},e.default.createElement(q,{armTag:c},e.default.createElement(g,{rowGap:1,marginY:1,flexDirection:"column"},e.default.createElement(g,{gap:1},e.default.createElement(k,null),e.default.createElement(L,{i18nKey:"general.dev_site.current",values:{name:s.displayName}})),e.default.createElement(g,{rowGap:1},e.default.createElement(Z,null)),e.default.createElement(b,{skin:"info"},a("preview_command.note_about_temporary_backend")))))}))};var ce=({baseUrl:n,siteIdOverride:p,onPreviewCreated:s})=>P.default.createElement(V,{siteId:p},P.default.createElement(ee,{baseUrl:n,onPreviewCreated:s}));export{ce as a};
4
+ //# sourceMappingURL=chunk-FMTROGFZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/PreviewCommand/index.ts","../src/components/PreviewCommand/PreviewCommand.tsx","../src/components/PreviewCommand/Preview.tsx","../src/components/PreviewCommand/ActionStatus.tsx"],"sourcesContent":["export { PreviewCommand } from './PreviewCommand.js';\n","import React from 'react';\nimport type { FC } from 'react';\nimport { SiteIdProvider } from '../../site-id/index.js';\nimport { Preview } from './Preview.js';\n\nexport const PreviewCommand: FC<{\n baseUrl?: string;\n siteIdOverride?: string;\n onPreviewCreated?: (tag: string) => void;\n}> = ({ baseUrl, siteIdOverride, onPreviewCreated }) => {\n return (\n <SiteIdProvider siteId={siteIdOverride}>\n <Preview baseUrl={baseUrl} onPreviewCreated={onPreviewCreated} />\n </SiteIdProvider>\n );\n};\n","import React from 'react';\nimport type { FC } from 'react';\nimport { match } from 'variant';\nimport { useARMClient } from '@wix/arm-client';\nimport { Trans, useTranslation } from '@wix/cli-i18n';\nimport type { Monitoring } from '@wix/cli-app-manifest';\nimport { useBiLogger } from '@wix/cli-telemetry-react';\nimport { useHttpClient } from '@wix/cli-http-client-react';\nimport {\n Text,\n Box,\n PointerIcon,\n useAsync,\n useAsyncCallback,\n} from '@wix/cli-ui-kit';\nimport { useDevCenterClient, ComponentType } from '@wix/dev-center-client';\nimport type {\n TopologyComponent,\n MonitoringComponent,\n} from '@wix/dev-center-client';\nimport type { ComponentsForSiteOverride } from '@wix/site-override-client';\nimport { useSiteOverrideClient } from '@wix/site-override-client';\nimport { useProjectModel } from '../../model.js';\nimport { useSiteId } from '../../site-id/index.js';\nimport { ArmTagProvider } from '../../context/armTag.js';\nimport { createPreviewTag } from '../../preview/create-preview-tag.js';\nimport { uploadApplication } from '../../hosting/upload-application.js';\nimport { assertBuildOutputExists } from '../../files/assert-build-output-exists.js';\nimport { ActionStatus } from './ActionStatus.js';\nimport { PlatformViewer } from '../Platform/PlatformViewer.js';\nimport { saveAppConfig } from '../../files/app.config.js';\nimport { useBackendComponents } from '../../backend/useBackendComponents.js';\nimport { createSiteOverrides } from '../../site-override/createSiteOverrides.js';\nimport { SiteOverrideProvider } from '../../context/siteOverride.js';\n\nexport const Preview: FC<{\n baseUrl?: string;\n onPreviewCreated?: (tag: string, backendServerUrl?: string) => void;\n}> = ({ baseUrl, onPreviewCreated }) => {\n const { site } = useSiteId();\n const { t } = useTranslation();\n const { model } = useProjectModel();\n const { backendComponents } = useBackendComponents();\n const arm = useARMClient();\n const biLogger = useBiLogger();\n const { getAppByVersion } = useDevCenterClient();\n const { createOverride } = useSiteOverrideClient();\n const httpClient = useHttpClient({ type: 'backoffice' });\n\n const uploadApplicationAction = useAsyncCallback(() =>\n uploadApplication(\n model.config.appId,\n model.projectFolder,\n biLogger,\n httpClient,\n backendComponents.length > 0\n )\n );\n\n const createSiteOverrideIdAction = useAsyncCallback(\n (_, overrides: ComponentsForSiteOverride) =>\n createOverride({\n appId: model.config.appId,\n siteId: site.id,\n overrides,\n })\n );\n\n const createPreviewTagAction = useAsyncCallback(\n (\n _,\n serveUrl: string,\n topologyComponentId?: string,\n backendServerUrl?: string,\n monitoringData?: Monitoring['compData']['monitoring'],\n monitoringComponentId?: string\n ) =>\n createPreviewTag({\n model,\n arm,\n serveUrl,\n backendServerUrl,\n topologyComponentId,\n monitoringData,\n monitoringComponentId,\n })\n );\n\n const { status: createPreviewStatus } = useAsync(async () => {\n await assertBuildOutputExists(model.projectFolder);\n const { serveUrl, backendServerUrl } = baseUrl\n ? { serveUrl: baseUrl, backendServerUrl: undefined }\n : await uploadApplicationAction.execute();\n const {\n data: { components },\n } = await getAppByVersion({\n appId: model.config.appId,\n });\n const topologyComponent = components.find(\n (component): component is TopologyComponent => {\n return component.compType === ComponentType.TOPOLOGY;\n }\n );\n const monitoringComponent = components.find(\n (component): component is MonitoringComponent => {\n return component.compType === ComponentType.MONITORING;\n }\n );\n const overrides = createSiteOverrides(model);\n const { id: siteOverrideId } = overrides\n ? await createSiteOverrideIdAction.execute(overrides)\n : await Promise.resolve({ id: undefined });\n const armTag = await createPreviewTagAction.execute(\n serveUrl,\n topologyComponent?.compId,\n backendServerUrl,\n monitoringComponent?.compData.monitoring,\n monitoringComponent?.compId\n );\n\n if (topologyComponent || monitoringComponent) {\n // Once there is topology/monitoring in production I want to use the same id for dev as well,\n // to reduce confusion during debug.\n await saveAppConfig(model.projectFolder, {\n ...(topologyComponent\n ? { topologyComponentId: topologyComponent.compId }\n : {}),\n ...(monitoringComponent\n ? { monitoringComponentId: monitoringComponent.compId }\n : {}),\n });\n }\n\n onPreviewCreated?.(armTag, backendServerUrl);\n\n return { armTag, siteOverrideId };\n }, []);\n\n return (\n <>\n <ActionStatus\n status={uploadApplicationAction.status}\n loadingText={t('preview_command.uploading_files')}\n successText={t('preview_command.uploading_files_success')}\n />\n <ActionStatus\n status={createPreviewTagAction.status}\n loadingText={t('preview_command.creating_preview')}\n successText={t('preview_command.creating_preview_success')}\n />\n {match(createPreviewStatus, {\n Error: () => null,\n Loading: () => null,\n Success: ({ result: { armTag, siteOverrideId } }) => (\n <SiteOverrideProvider siteOverrideId={siteOverrideId}>\n <ArmTagProvider armTag={armTag}>\n <Box rowGap={1} marginY={1} flexDirection=\"column\">\n <Box gap={1}>\n <PointerIcon />\n <Trans\n i18nKey=\"general.dev_site.current\"\n values={{ name: site.displayName }}\n />\n </Box>\n <Box rowGap={1}>\n <PlatformViewer />\n </Box>\n <Text skin=\"info\">\n {t('preview_command.note_about_temporary_backend')}\n </Text>\n </Box>\n </ArmTagProvider>\n </SiteOverrideProvider>\n ),\n })}\n </>\n );\n};\n","import type { AsyncCallbackStatus } from '@wix/cli-ui-kit';\nimport { Alert, Spinner } from '@wix/cli-ui-kit';\nimport type { FC } from 'react';\nimport React from 'react';\nimport { match } from 'variant';\n\nexport const ActionStatus: FC<{\n status: AsyncCallbackStatus<unknown>;\n loadingText: string;\n successText: string;\n}> = ({ status, loadingText, successText }) =>\n match(status, {\n NotRequested: () => null,\n Loading: () => <Spinner text={loadingText} />,\n Error: () => null,\n Success: () => <Alert type=\"success\">{successText}</Alert>,\n });\n"],"mappings":";;ueAAAA,ICAAC,IAAA,IAAAC,EAAkB,SCAlBC,IAAA,IAAAC,EAAkB,SAElBC,EAAsB,SCFtBC,IAGA,IAAAC,EAAkB,SAClBC,EAAsB,SAETC,EAIR,CAAC,CAAE,OAAAC,EAAQ,YAAAC,EAAa,YAAAC,CAAY,OACvC,SAAMF,EAAQ,CACZ,aAAc,IAAM,KACpB,QAAS,IAAM,EAAAG,QAAA,cAACC,EAAA,CAAQ,KAAMH,EAAa,EAC3C,MAAO,IAAM,KACb,QAAS,IAAM,EAAAE,QAAA,cAACE,EAAA,CAAM,KAAK,WAAWH,CAAY,CACpD,CAAC,EDmBI,IAAMI,GAGR,CAAC,CAAE,QAAAC,EAAS,iBAAAC,CAAiB,IAAM,CACtC,GAAM,CAAE,KAAAC,CAAK,EAAIC,EAAU,EACrB,CAAE,EAAAC,CAAE,EAAIC,EAAe,EACvB,CAAE,MAAAC,CAAM,EAAIC,EAAgB,EAC5B,CAAE,kBAAAC,EAAkB,EAAIC,EAAqB,EAC7CC,GAAMC,EAAa,EACnBC,GAAWC,EAAY,EACvB,CAAE,gBAAAC,EAAgB,EAAIC,EAAmB,EACzC,CAAE,eAAAC,EAAe,EAAIC,EAAsB,EAC3CC,GAAaC,EAAc,CAAE,KAAM,YAAa,CAAC,EAEjDC,EAA0BC,EAAiB,IAC/CC,EACEhB,EAAM,OAAO,MACbA,EAAM,cACNM,GACAM,GACAV,GAAkB,OAAS,CAC7B,CACF,EAEMe,GAA6BF,EACjC,CAACG,E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C,EAEL,OACE,EAAAG,QAAA,gBAAAA,QAAA,cACE,EAAAA,QAAA,cAACC,EAAA,CACC,OAAQ1B,EAAwB,OAChC,YAAahB,EAAE,iCAAiC,EAChD,YAAaA,EAAE,yCAAyC,EAC1D,EACA,EAAAyC,QAAA,cAACC,EAAA,CACC,OAAQpB,EAAuB,OAC/B,YAAatB,EAAE,kCAAkC,EACjD,YAAaA,EAAE,0CAA0C,EAC3D,KACC,SAAM6B,GAAqB,CAC1B,MAAO,IAAM,KACb,QAAS,IAAM,KACf,QAAS,CAAC,CAAE,OAAQ,CAAE,OAAAU,EAAQ,eAAAD,CAAe,CAAE,IAC7C,EAAAG,QAAA,cAACE,EAAA,CAAqB,eAAgBL,GACpC,EAAAG,QAAA,cAACG,EAAA,CAAe,OAAQL,GACtB,EAAAE,QAAA,cAACI,EAAA,CAAI,OAAQ,EAAG,QAAS,EAAG,cAAc,UACxC,EAAAJ,QAAA,cAACI,EAAA,CAAI,IAAK,GACR,EAAAJ,QAAA,cAACK,EAAA,IAAY,EACb,EAAAL,QAAA,cAACM,EAAA,CACC,QAAQ,2BACR,OAAQ,CAAE,KAAMjD,EAAK,WAAY,EACnC,CACF,EACA,EAAA2C,QAAA,cAACI,EAAA,CAAI,OAAQ,GACX,EAAAJ,QAAA,cAACO,EAAA,IAAe,CAClB,EACA,EAAAP,QAAA,cAACQ,EAAA,CAAK,KAAK,QACRjD,EAAE,8CAA8C,CACnD,CACF,CACF,CACF,CAEJ,CAAC,CACH,CAEJ,ED5KO,IAAMkD,GAIR,CAAC,CAAE,QAAAC,EAAS,eAAAC,EAAgB,iBAAAC,CAAiB,IAE9C,EAAAC,QAAA,cAACC,EAAA,CAAe,OAAQH,GACtB,EAAAE,QAAA,cAACE,GAAA,CAAQ,QAASL,EAAS,iBAAkBE,EAAkB,CACjE","names":["init_esm_shims","init_esm_shims","import_react","init_esm_shims","import_react","import_variant","init_esm_shims","import_react","import_variant","ActionStatus","status","loadingText","successText","React","Spinner","Alert","Preview","baseUrl","onPreviewCreated","site","useSiteId","t","useTranslation","model","useProjectModel","backendComponents","useBackendComponents","arm","useARMClient","biLogger","useBiLogger","getAppByVersion","useDevCenterClient","createOverride","useSiteOverrideClient","httpClient","useHttpClient","uploadApplicationAction","useAsyncCallback","uploadApplication","createSiteOverrideIdAction","_","overrides","createPreviewTagAction","serveUrl","topologyComponentId","backendServerUrl","monitoringData","monitoringComponentId","createPreviewTag","createPreviewStatus","useAsync","assertBuildOutputExists","components","topologyComponent","component","ComponentType","monitoringComponent","createSiteOverrides","siteOverrideId","armTag","saveAppConfig","React","ActionStatus","SiteOverrideProvider","ArmTagProvider","Box_default","PointerIcon","Trans","PlatformViewer","Text","PreviewCommand","baseUrl","siteIdOverride","onPreviewCreated","React","SiteIdProvider","Preview"]}
@@ -0,0 +1,11 @@
1
+ import { createRequire as _createRequire } from 'node:module';
2
+ const require = _createRequire(import.meta.url);
3
+ var n={"create_version_command_def.option.version_type":"The type of version you would like to create","create_version_command_def.option.approve_preview":"Approve preview automatically","create_version_command_def.option.base_url":"The base url for when static files have been uploaded to an external cdn","create_version_command_def.option.site":"The site id to use for Application Preview urls, defaults to the current selected development site","dev_command_def.option.https":"Start local dev server on https","app_preview_command_def.option.site":"The site id to use for Application Preview urls, defaults to the current selected development site","app_preview_command_def.option.base_url":"The base url for when static files have been uploaded to an external cdn","app_preview_command_def.option.no_input":"Disable command interactivity","general.loading":"Loading...","general.no_site_id_configured":"You don't have a Development Site currently configured","general.site_id_not_found":`Your currently configured Development Site was not found ({id})
4
+ This may happen because the site was deleted or your access has been revoked.
5
+
6
+ Please select another Development Site to continue`,"general.dashboard_page_text":"<0>Click here</0> to open your application in the Wix Dashboard","general.dashboard_page_click_here":"Click here","general.close_screen":"Press <0/> to close","logs.backend.clear":"Press <0/> to clear","general.open_page_error":"Failed to open the browser for <0>{title}</0>, use the following URL to open it in your browser:","general.dashboard_pages_viewer.title":"Press a number key to open a dashboard page:","general.dashboard_plugins_viewer.title":"Press a number key to open a dashboard plugin:","general.dashboard_menu_plugins_viewer.title":"Press a number key to open a dashboard menu plugin:","general.backend_api_viewer.title":"Press a number key to trigger an api:","general.backend_plugin_viewer.title":"Press a number key to trigger an plugin:","general.backend_events_viewer.title":"Press a number key to trigger an event:","general.numeric_viewer.show_more":"View more...","general.platform.site":"Site","general.platform.unpublished_site":"Site (publish the site to enable site preview)","general.platform.editor":"Editor","general.platform.dashboard":"Dashboard","general.platform.backend":"Backend","general.platform.none":`Your project doesn't seem to have any extensions.
7
+
8
+ Extensions are the building blocks of your app.
9
+ Make sure it is configured properly, or read our <0>documentation</0> to start developing your first extension.`,"general.dev_site.current":"Current Development Site: {name}","general.view_changes":"View your local changes: <0>(Press a key to open)</0>","general.open_preview.title_single":"Open the preview on the","general.open_preview.title_multiple":"Open the preview on:","preview_command.creating_preview":"Creating a preview...","preview_command.creating_preview_success":"Preview created successfully!","preview_command.uploading_files":"Uploading your application files...","preview_command.uploading_files_success":"Uploaded successfully!","dev_command.site_provider.loading":"Resolving development site...","dev_command.custom_elements_migration.loading":"Checking site widgets installation...","preview_command.note_about_temporary_backend":"This preview URL will be available for three days. Afterward, you can create a new preview if you need to.","dev_command.dev_environment.loading":"Starting dev environment...","dev_command.dev_environment.started":"Development environment ready","dev_command.dev_site.change":"(Press <0/> to switch)","dev_command.dev_site.current":"Current Dev Site: <0>{siteName}</0>","dev_command.site_selector.error":"Failed to change Development Site!","dev_command.dashboard_pages_screen.select_label":"Select a dashboard page to open","dev_command.dashboard_menu_plugin_screen.select_label":"Select a dashboard menu plugin to open","dev_command.dashboard_page_plugin_screen.select_label":"Select a dashboard plugin to open","dev_command.dashboard_modal_screen.select_label":"Select a dashboard modal to open","dev_command.backend_apis_screen.select_label":"Select api to trigger","dev_command.backend_events_screen.select_label":"Select event to trigger","dev_command.backend_plugins_screen.select_label":"Select plugin to trigger","dev_command.required_apps.loading":"Checking required apps...","dev_command.required_apps.warning":"Make sure you have {requiredAppNames} installed on your site","dev_command.config_change":"Loading App Manifest changes...","dev_command.config_update":"App Manifest updated. Refresh existing browser tabs to view the latest changes.","dev_command.config_didnt_update":"No App Manifest update occurred","dev_command.tunneling.confirm":"To proceed, we'll set up a secure tunnel from your machine for development purposes","dev_command.tunneling.abort_dev":"Operation aborted. Tunneling is necessary to run your application.","dev_command.new_custom_element.warning":"New site widget detected. Press <0/> to open the Site Editor and complete the installation.","dev_command.new_custom_element.confirm_reinstall":"Press <0/> when you reinstalled app on your dev site","dev_command.new_custom_element.reinstall_error":"We had troubles with adding your new site widget. You can try to do it by yourself. Press <0/> to continue","serve_command.starting_serve_environment":"Starting serve environment...","serve_command.starting_serve_environment_success":"Serve environment started! <0/>","serve_command.production_build":"Application is using a production build","create_version_command.creating_version":"Creating a version...","create_version_command.creating_version_success":"Successfully created v{version}","create_version_command.current_version":"Your current version is: v{version}","create_version_command.confirm_version_events_warning":"Any configured events will be deployed to production and take effect once a new version of your app is created.","create_version_command.confirm_version_creation":"Continue with creating the new version?","create_version_command.confirm_version_creation_aborted":"Version creation aborted","create_version_command.version_type_question":"What type of version would you like to create?","create_version_command.version_type_question_minor":"Minor (v{version})","create_version_command.version_type_question_major":"Major (v{version})","create_version_command.check_preview_before_version_release":"Before creating a new version, let's create a preview of your app","create_version_command.checking_validation_status":"Checking if this version can be submitted\u2026","create_version_command.version_validation_ok":"This version can be submitted for review in the <0>App Dashboard</0>","create_version_command.version_validation_has_failures":`This version has blockers preventing it from being submitted for review.
10
+ Please fix them and submit your app in the <0>App Dashboard</0>.`,"embedded_script.type.essential":"Essential","embedded_script.type.essential.description":"Must load regardless of policy","embedded_script.type.functional":"Functional","embedded_script.type.functional.description":"Adds optional functionality to the site","embedded_script.type.analytics":"Analytics","embedded_script.type.analytics.description":"Adds analytics abilities to the site","embedded_script.type.advertising":"Advertising","embedded_script.type.advertising.description":"Adds advertising content or advertising tracking to the site","embedded_script.placement.head":"Head","embedded_script.placement.head.description":"In the document head","embedded_script.placement.body_start":"Body Start","embedded_script.placement.body_start.description":"Prepended in the body","embedded_script.placement.body_end":"Body End","embedded_script.placement.body_end.description":"Appended in the body","generate_command.description":"Add new extensions to your application","generate_command.flow.dashboard_category":"Dashboard","generate_command.flow.site_category":"Site","generate_command.flow.backend_category":"Backend","generate_command.flow.dashboard_page":"Dashboard Page","generate_command.flow.sidebar_category":"Sidebar Category","generate_command.flow.dashboard_plugin":"Dashboard Plugin","generate_command.flow.dashboard_menu_plugin":"Dashboard Menu Plugin","generate_command.flow.embedded_script":"Embedded Script","generate_command.flow.site_plugin":"Site Plugin","generate_command.flow.event":"Event","generate_command.flow.api.title":"API","generate_command.flow.dashboard_modal":"Dashboard Modal","generate_command.flow.custom_element":"Site Widget","generate_command.flow.service_plugin":"Service Plugin","generate_command.flow.choose_flow":"What kind of extension would you like to generate?","generate_command.generation.loading":"Generating {subject}...","generate_command.generation.done":"\u{1F680} The new {extensionType} has been generated successfully.","generate_command.generation.learn_more":"\u{1F4DA} Learn more about {extensionType}: <0/>","generate_command.generation.install_dependencies_question":"Would you like to install dependencies now?","generate_command.generation.new_dependencies":"\u26A0\uFE0F New app dependencies have been added. Please run <0>{pkgManagerName} install</0> before continuing to work.","generate_command.generation.dependencies_installed":"\u2705 Dependencies installed","generate_command.dashboard_page.choose_route":"Enter the route for the new page:","generate_command.dashboard_page.route_placeholder":"my-page","generate_command.dashboard_page.choose_title":"Page title:","generate_command.dashboard_page.title_placeholder":"My Page","generate_command.dashboard_page.add_to_category":"Add to a sidebar category?","generate_command.dashboard_page.choose_category":"Sidebar category:","generate_command.sidebar_category.choose_label":"Enter the label for the new category:","generate_command.sidebar_category.label_placeholder":"My App","generate_command.custom_element.validation.element_exists":"The custom element folders must be unique, please choose a name that has not been used yet in your application.","generate_command.custom_element.validation.element_invalid":"The custom element folder must be a valid path ([a-z-/]+) and must not start with a dot.","generate_command.custom_element.choose_folder":"Widget folder (relative to src/site/widgets/custom-elements):","generate_command.custom_element.folder_placeholder":"my-widget","generate_command.custom_element.choose_name":"Widget name:","generate_command.custom_element.choose_name.error":"Enter a name that is shorter than 30 characters.","generate_command.custom_element.name_placeholder":"My Widget","generate_command.site_plugin.choose_folder":"Site plugin folder (relative to src/site/plugins/custom-elements):","generate_command.site_plugin.folder_placeholder":"my-site-plugin","generate_command.site_plugin.choose_name":"Site plugin name:","generate_command.site_plugin.name_placeholder":"My Site Plugin","generate_command.site_plugin.plugin_app":"Select a Wix app to view its plugin slots","generate_command.site_plugin.plugin_app.description":"(<0>read more</0>)","generate_command.site_plugin.choose_placement":"Select the slot in which you\u2019d like to place your plugin","generate_command.site_plugin.widget_docs":"<0>read more</0>","generate_command.embedded_script.validation.script_exists":"The script folder must be unique, please choose a name that has not been used yet in your application.","generate_command.embedded_script.validation.script_invalid":"The script folder must be a valid path ([a-z0-9-/]+) and must not start with a dot.","generate_command.embedded_script.choose_folder":"Script folder (relative to src/site/embedded-scripts):","generate_command.embedded_script.folder_placeholder":"my-script","generate_command.embedded_script.choose_name":"Script name:","generate_command.embedded_script.name_placeholder":"My Script","generate_command.embedded_script.choose_type":"Script type:","generate_command.embedded_script.type_info":"Determine if site visitors' consent is needed to run the script, <0>read more</0>","generate_command.embedded_script.choose_placement":"Placement:","generate_command.embedded_script.placement_info":"Will determine where the script is embedded","generate_command.dashboard_modal.validation.folder_exists":"The modal folder must be unique, please choose a folder name that has not been used yet in your application.","generate_command.dashboard_modal.validation.folder_invalid":"The modal folder must be a valid path ([a-z0-9-/]+) and must not start with a dot.","generate_command.dashboard_modal.choose_folder":"Enter the folder name for the new modal:","generate_command.dashboard_modal.folder_placeholder":"my-modal","generate_command.dashboard_modal.choose_title":"Modal title:","generate_command.dashboard_modal.title_placeholder":"My Modal","generate_command.dashboard_plugin.what_to_extend":"What would you like to extend?","generate_command.dashboard_plugin.what_to_extend.description":"Plugins let you extend Wix apps by embedding your UI inside dedicated slots within a dashboard page (<0>read more</0>)","generate_command.dashboard_plugin.what_to_extend.item_description":"<0>read more</0>","generate_command.dashboard_plugin.choose_folder":"Plugin folder (relative to src/dashboard/plugins)","generate_command.dashboard_plugin.folder_placeholder":"my-plugin","generate_command.dashboard_plugin.choose_title":"Plugin title","generate_command.dashboard_plugin.title_placeholder":"My Plugin","generate_command.required_app":"Would you like to set {appsNames} as a requirement for your app?","generate_command.required_app.description":"This means sites must have {appsNames} installed before installing your app (<0>read more</0>)","generate_command.dashboard_menu_plugin.what_to_extend":"What would you like to extend?","generate_command.dashboard_menu_plugin.what_to_extend.description":"Menu Plugins let you extend Wix apps by adding a menu item in a pre-defined slot in a menu on a dashboard page (<0>read more</0>)","generate_command.dashboard_menu_plugin.what_to_extend.item_description":"<0>read more</0>","generate_command.dashboard_menu_plugin.what_to_do":"What action will happen after clicking on the menu item?","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page":"Navigate to a page","generate_command.dashboard_menu_plugin.what_to_do.open_modal":"Open a modal","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page":"Choose a page the menu item will navigate to:","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.info":"Choose from a list of available pages in your project or manually add a page from a different app","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other":"Use a page from a different app","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other.choose_page_id":"What is the unique id of the page?","generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other.page_id_invalid":"Page id has to be in the format of a uuid","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component":"Choose the modal to open:","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.info":"Choose from a list of available modals in your project or manually add a modal from a different app","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other":"Use a modal from a different app","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other.choose_component_id":"What is the unique id of the modal?","generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other.component_id_invalid":"Modal id has to be in the format of a uuid","generate_command.dashboard_menu_plugin.choose_folder":"Menu Plugin folder (relative to src/dashboard/menu-plugins)","generate_command.dashboard_menu_plugin.folder_placeholder":"my-plugin","generate_command.dashboard_menu_plugin.choose_title":"Menu Plugin title","generate_command.dashboard_menu_plugin.title_placeholder":"My Plugin","generate_command.api.api_placeholder":"my-api","generate_command.api.choose_api_name":"How would you like to name your API?","generate_command.api.choose_folder":"API folder (relative to src/backend/api):","generate_command.api.choose_api_name.error":"API name must be unique, can not include special characters or spaces, and must be shorter than 20 characters","generate_command.api.choose_method":"Choose an API method","generate_command.event.choose_folder":"Event folder (relative to src/backend/events):","generate_command.event.folder_placeholder":"my-event","generate_command.event.choose_folder.error":"Event name must be unique, can not include special characters or spaces, and must be shorter than 20 characters","generate_command.service_plugin.choose_type":"Which service plugin do you want to create","generate_command.service_plugin.choose_name":"How would you like to name your service plugin","generate_command.service_plugin.name_placeholder":"my-service-plugin","generate_command.service_plugin.groups.stores":"Stores","generate_command.service_plugin.ecom_additional_fees":"Ecom Additional Fees","generate_command.service_plugin.ecom_shipping_rates":"Ecom Shipping Rates","generate_command.service_plugin.ecom_discount_triggers":"Ecom Discount Triggers","generate_command.service_plugin.ecom_validations":"Ecom Validations","generate_command.service_plugin.ecom_payment_settings":"Ecom Payment Settings","generate_command.service_plugin.ecom_gift_cards_provider":"Ecom Gift Cards Provider","logs_command_def.option.version":"Specify the app version to fetch production logs from","logs_command.connecting":"Connecting to the log server...","logs_command.listening_to_logs":"Listening to logs from the server.","logs_command.prod_env_logs":"Prod Environment logs for the version: {version}"};export{n as a};
11
+ //# sourceMappingURL=chunk-KNH7RNAZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/messages.json"],"sourcesContent":["{\n \"create_version_command_def.option.version_type\": \"The type of version you would like to create\",\n \"create_version_command_def.option.approve_preview\": \"Approve preview automatically\",\n \"create_version_command_def.option.base_url\": \"The base url for when static files have been uploaded to an external cdn\",\n \"create_version_command_def.option.site\": \"The site id to use for Application Preview urls, defaults to the current selected development site\",\n \"dev_command_def.option.https\": \"Start local dev server on https\",\n \"app_preview_command_def.option.site\": \"The site id to use for Application Preview urls, defaults to the current selected development site\",\n \"app_preview_command_def.option.base_url\": \"The base url for when static files have been uploaded to an external cdn\",\n \"app_preview_command_def.option.no_input\": \"Disable command interactivity\",\n \"general.loading\": \"Loading...\",\n \"general.no_site_id_configured\": \"You don't have a Development Site currently configured\",\n \"general.site_id_not_found\": \"Your currently configured Development Site was not found ({id})\\nThis may happen because the site was deleted or your access has been revoked.\\n\\nPlease select another Development Site to continue\",\n \"general.dashboard_page_text\": \"<0>Click here</0> to open your application in the Wix Dashboard\",\n \"general.dashboard_page_click_here\": \"Click here\",\n \"general.close_screen\": \"Press <0/> to close\",\n \"logs.backend.clear\": \"Press <0/> to clear\",\n \"general.open_page_error\": \"Failed to open the browser for <0>{title}</0>, use the following URL to open it in your browser:\",\n \"general.dashboard_pages_viewer.title\": \"Press a number key to open a dashboard page:\",\n \"general.dashboard_plugins_viewer.title\": \"Press a number key to open a dashboard plugin:\",\n \"general.dashboard_menu_plugins_viewer.title\": \"Press a number key to open a dashboard menu plugin:\",\n \"general.backend_api_viewer.title\": \"Press a number key to trigger an api:\",\n \"general.backend_plugin_viewer.title\": \"Press a number key to trigger an plugin:\",\n \"general.backend_events_viewer.title\": \"Press a number key to trigger an event:\",\n \"general.numeric_viewer.show_more\": \"View more...\",\n \"general.platform.site\": \"Site\",\n \"general.platform.unpublished_site\": \"Site (publish the site to enable site preview)\",\n \"general.platform.editor\": \"Editor\",\n \"general.platform.dashboard\": \"Dashboard\",\n \"general.platform.backend\": \"Backend\",\n \"general.platform.none\": \"Your project doesn't seem to have any extensions.\\n\\nExtensions are the building blocks of your app.\\nMake sure it is configured properly, or read our <0>documentation</0> to start developing your first extension.\",\n \"general.dev_site.current\": \"Current Development Site: {name}\",\n \"general.view_changes\": \"View your local changes: <0>(Press a key to open)</0>\",\n \"general.open_preview.title_single\": \"Open the preview on the\",\n \"general.open_preview.title_multiple\": \"Open the preview on:\",\n \"preview_command.creating_preview\": \"Creating a preview...\",\n \"preview_command.creating_preview_success\": \"Preview created successfully!\",\n \"preview_command.uploading_files\": \"Uploading your application files...\",\n \"preview_command.uploading_files_success\": \"Uploaded successfully!\",\n \"dev_command.site_provider.loading\": \"Resolving development site...\",\n \"dev_command.custom_elements_migration.loading\": \"Checking site widgets installation...\",\n \"preview_command.note_about_temporary_backend\": \"This preview URL will be available for three days. Afterward, you can create a new preview if you need to.\",\n \"dev_command.dev_environment.loading\": \"Starting dev environment...\",\n \"dev_command.dev_environment.started\": \"Development environment ready\",\n \"dev_command.dev_site.change\": \"(Press <0/> to switch)\",\n \"dev_command.dev_site.current\": \"Current Dev Site: <0>{siteName}</0>\",\n \"dev_command.site_selector.error\": \"Failed to change Development Site!\",\n \"dev_command.dashboard_pages_screen.select_label\": \"Select a dashboard page to open\",\n \"dev_command.dashboard_menu_plugin_screen.select_label\": \"Select a dashboard menu plugin to open\",\n \"dev_command.dashboard_page_plugin_screen.select_label\": \"Select a dashboard plugin to open\",\n \"dev_command.dashboard_modal_screen.select_label\": \"Select a dashboard modal to open\",\n \"dev_command.backend_apis_screen.select_label\": \"Select api to trigger\",\n \"dev_command.backend_events_screen.select_label\": \"Select event to trigger\",\n \"dev_command.backend_plugins_screen.select_label\": \"Select plugin to trigger\",\n \"dev_command.required_apps.loading\": \"Checking required apps...\",\n \"dev_command.required_apps.warning\": \"Make sure you have {requiredAppNames} installed on your site\",\n \"dev_command.config_change\": \"Loading App Manifest changes...\",\n \"dev_command.config_update\": \"App Manifest updated. Refresh existing browser tabs to view the latest changes.\",\n \"dev_command.config_didnt_update\": \"No App Manifest update occurred\",\n \"dev_command.tunneling.confirm\": \"To proceed, we'll set up a secure tunnel from your machine for development purposes\",\n \"dev_command.tunneling.abort_dev\": \"Operation aborted. Tunneling is necessary to run your application.\",\n \"dev_command.new_custom_element.warning\": \"New site widget detected. Press <0/> to open the Site Editor and complete the installation.\",\n \"dev_command.new_custom_element.confirm_reinstall\": \"Press <0/> when you reinstalled app on your dev site\",\n \"dev_command.new_custom_element.reinstall_error\": \"We had troubles with adding your new site widget. You can try to do it by yourself. Press <0/> to continue\",\n \"serve_command.starting_serve_environment\": \"Starting serve environment...\",\n \"serve_command.starting_serve_environment_success\": \"Serve environment started! <0/>\",\n \"serve_command.production_build\": \"Application is using a production build\",\n \"create_version_command.creating_version\": \"Creating a version...\",\n \"create_version_command.creating_version_success\": \"Successfully created v{version}\",\n \"create_version_command.current_version\": \"Your current version is: v{version}\",\n \"create_version_command.confirm_version_events_warning\": \"Any configured events will be deployed to production and take effect once a new version of your app is created.\",\n \"create_version_command.confirm_version_creation\": \"Continue with creating the new version?\",\n \"create_version_command.confirm_version_creation_aborted\": \"Version creation aborted\",\n \"create_version_command.version_type_question\": \"What type of version would you like to create?\",\n \"create_version_command.version_type_question_minor\": \"Minor (v{version})\",\n \"create_version_command.version_type_question_major\": \"Major (v{version})\",\n \"create_version_command.check_preview_before_version_release\": \"Before creating a new version, let's create a preview of your app\",\n \"create_version_command.checking_validation_status\": \"Checking if this version can be submitted…\",\n \"create_version_command.version_validation_ok\": \"This version can be submitted for review in the <0>App Dashboard</0>\",\n \"create_version_command.version_validation_has_failures\": \"This version has blockers preventing it from being submitted for review.\\nPlease fix them and submit your app in the <0>App Dashboard</0>.\",\n \"embedded_script.type.essential\": \"Essential\",\n \"embedded_script.type.essential.description\": \"Must load regardless of policy\",\n \"embedded_script.type.functional\": \"Functional\",\n \"embedded_script.type.functional.description\": \"Adds optional functionality to the site\",\n \"embedded_script.type.analytics\": \"Analytics\",\n \"embedded_script.type.analytics.description\": \"Adds analytics abilities to the site\",\n \"embedded_script.type.advertising\": \"Advertising\",\n \"embedded_script.type.advertising.description\": \"Adds advertising content or advertising tracking to the site\",\n \"embedded_script.placement.head\": \"Head\",\n \"embedded_script.placement.head.description\": \"In the document head\",\n \"embedded_script.placement.body_start\": \"Body Start\",\n \"embedded_script.placement.body_start.description\": \"Prepended in the body\",\n \"embedded_script.placement.body_end\": \"Body End\",\n \"embedded_script.placement.body_end.description\": \"Appended in the body\",\n \"generate_command.description\": \"Add new extensions to your application\",\n \"generate_command.flow.dashboard_category\": \"Dashboard\",\n \"generate_command.flow.site_category\": \"Site\",\n \"generate_command.flow.backend_category\": \"Backend\",\n \"generate_command.flow.dashboard_page\": \"Dashboard Page\",\n \"generate_command.flow.sidebar_category\": \"Sidebar Category\",\n \"generate_command.flow.dashboard_plugin\": \"Dashboard Plugin\",\n \"generate_command.flow.dashboard_menu_plugin\": \"Dashboard Menu Plugin\",\n \"generate_command.flow.embedded_script\": \"Embedded Script\",\n \"generate_command.flow.site_plugin\": \"Site Plugin\",\n \"generate_command.flow.event\": \"Event\",\n \"generate_command.flow.api.title\": \"API\",\n \"generate_command.flow.dashboard_modal\": \"Dashboard Modal\",\n \"generate_command.flow.custom_element\": \"Site Widget\",\n \"generate_command.flow.service_plugin\": \"Service Plugin\",\n \"generate_command.flow.choose_flow\": \"What kind of extension would you like to generate?\",\n \"generate_command.generation.loading\": \"Generating {subject}...\",\n \"generate_command.generation.done\": \"🚀 The new {extensionType} has been generated successfully.\",\n \"generate_command.generation.learn_more\": \"📚 Learn more about {extensionType}: <0/>\",\n \"generate_command.generation.install_dependencies_question\": \"Would you like to install dependencies now?\",\n \"generate_command.generation.new_dependencies\": \"⚠️ New app dependencies have been added. Please run <0>{pkgManagerName} install</0> before continuing to work.\",\n \"generate_command.generation.dependencies_installed\": \"✅ Dependencies installed\",\n \"generate_command.dashboard_page.choose_route\": \"Enter the route for the new page:\",\n \"generate_command.dashboard_page.route_placeholder\": \"my-page\",\n \"generate_command.dashboard_page.choose_title\": \"Page title:\",\n \"generate_command.dashboard_page.title_placeholder\": \"My Page\",\n \"generate_command.dashboard_page.add_to_category\": \"Add to a sidebar category?\",\n \"generate_command.dashboard_page.choose_category\": \"Sidebar category:\",\n \"generate_command.sidebar_category.choose_label\": \"Enter the label for the new category:\",\n \"generate_command.sidebar_category.label_placeholder\": \"My App\",\n \"generate_command.custom_element.validation.element_exists\": \"The custom element folders must be unique, please choose a name that has not been used yet in your application.\",\n \"generate_command.custom_element.validation.element_invalid\": \"The custom element folder must be a valid path ([a-z-/]+) and must not start with a dot.\",\n \"generate_command.custom_element.choose_folder\": \"Widget folder (relative to src/site/widgets/custom-elements):\",\n \"generate_command.custom_element.folder_placeholder\": \"my-widget\",\n \"generate_command.custom_element.choose_name\": \"Widget name:\",\n \"generate_command.custom_element.choose_name.error\": \"Enter a name that is shorter than 30 characters.\",\n \"generate_command.custom_element.name_placeholder\": \"My Widget\",\n \"generate_command.site_plugin.choose_folder\": \"Site plugin folder (relative to src/site/plugins/custom-elements):\",\n \"generate_command.site_plugin.folder_placeholder\": \"my-site-plugin\",\n \"generate_command.site_plugin.choose_name\": \"Site plugin name:\",\n \"generate_command.site_plugin.name_placeholder\": \"My Site Plugin\",\n \"generate_command.site_plugin.plugin_app\": \"Select a Wix app to view its plugin slots\",\n \"generate_command.site_plugin.plugin_app.description\": \"(<0>read more</0>)\",\n \"generate_command.site_plugin.choose_placement\": \"Select the slot in which you’d like to place your plugin\",\n \"generate_command.site_plugin.widget_docs\": \"<0>read more</0>\",\n \"generate_command.embedded_script.validation.script_exists\": \"The script folder must be unique, please choose a name that has not been used yet in your application.\",\n \"generate_command.embedded_script.validation.script_invalid\": \"The script folder must be a valid path ([a-z0-9-/]+) and must not start with a dot.\",\n \"generate_command.embedded_script.choose_folder\": \"Script folder (relative to src/site/embedded-scripts):\",\n \"generate_command.embedded_script.folder_placeholder\": \"my-script\",\n \"generate_command.embedded_script.choose_name\": \"Script name:\",\n \"generate_command.embedded_script.name_placeholder\": \"My Script\",\n \"generate_command.embedded_script.choose_type\": \"Script type:\",\n \"generate_command.embedded_script.type_info\": \"Determine if site visitors' consent is needed to run the script, <0>read more</0>\",\n \"generate_command.embedded_script.choose_placement\": \"Placement:\",\n \"generate_command.embedded_script.placement_info\": \"Will determine where the script is embedded\",\n \"generate_command.dashboard_modal.validation.folder_exists\": \"The modal folder must be unique, please choose a folder name that has not been used yet in your application.\",\n \"generate_command.dashboard_modal.validation.folder_invalid\": \"The modal folder must be a valid path ([a-z0-9-/]+) and must not start with a dot.\",\n \"generate_command.dashboard_modal.choose_folder\": \"Enter the folder name for the new modal:\",\n \"generate_command.dashboard_modal.folder_placeholder\": \"my-modal\",\n \"generate_command.dashboard_modal.choose_title\": \"Modal title:\",\n \"generate_command.dashboard_modal.title_placeholder\": \"My Modal\",\n \"generate_command.dashboard_plugin.what_to_extend\": \"What would you like to extend?\",\n \"generate_command.dashboard_plugin.what_to_extend.description\": \"Plugins let you extend Wix apps by embedding your UI inside dedicated slots within a dashboard page (<0>read more</0>)\",\n \"generate_command.dashboard_plugin.what_to_extend.item_description\": \"<0>read more</0>\",\n \"generate_command.dashboard_plugin.choose_folder\": \"Plugin folder (relative to src/dashboard/plugins)\",\n \"generate_command.dashboard_plugin.folder_placeholder\": \"my-plugin\",\n \"generate_command.dashboard_plugin.choose_title\": \"Plugin title\",\n \"generate_command.dashboard_plugin.title_placeholder\": \"My Plugin\",\n \"generate_command.required_app\": \"Would you like to set {appsNames} as a requirement for your app?\",\n \"generate_command.required_app.description\": \"This means sites must have {appsNames} installed before installing your app (<0>read more</0>)\",\n \"generate_command.dashboard_menu_plugin.what_to_extend\": \"What would you like to extend?\",\n \"generate_command.dashboard_menu_plugin.what_to_extend.description\": \"Menu Plugins let you extend Wix apps by adding a menu item in a pre-defined slot in a menu on a dashboard page (<0>read more</0>)\",\n \"generate_command.dashboard_menu_plugin.what_to_extend.item_description\": \"<0>read more</0>\",\n \"generate_command.dashboard_menu_plugin.what_to_do\": \"What action will happen after clicking on the menu item?\",\n \"generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page\": \"Navigate to a page\",\n \"generate_command.dashboard_menu_plugin.what_to_do.open_modal\": \"Open a modal\",\n \"generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page\": \"Choose a page the menu item will navigate to:\",\n \"generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.info\": \"Choose from a list of available pages in your project or manually add a page from a different app\",\n \"generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other\": \"Use a page from a different app\",\n \"generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other.choose_page_id\": \"What is the unique id of the page?\",\n \"generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page.other.page_id_invalid\": \"Page id has to be in the format of a uuid\",\n \"generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component\": \"Choose the modal to open:\",\n \"generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.info\": \"Choose from a list of available modals in your project or manually add a modal from a different app\",\n \"generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other\": \"Use a modal from a different app\",\n \"generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other.choose_component_id\": \"What is the unique id of the modal?\",\n \"generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component.other.component_id_invalid\": \"Modal id has to be in the format of a uuid\",\n \"generate_command.dashboard_menu_plugin.choose_folder\": \"Menu Plugin folder (relative to src/dashboard/menu-plugins)\",\n \"generate_command.dashboard_menu_plugin.folder_placeholder\": \"my-plugin\",\n \"generate_command.dashboard_menu_plugin.choose_title\": \"Menu Plugin title\",\n \"generate_command.dashboard_menu_plugin.title_placeholder\": \"My Plugin\",\n \"generate_command.api.api_placeholder\": \"my-api\",\n \"generate_command.api.choose_api_name\": \"How would you like to name your API?\",\n \"generate_command.api.choose_folder\": \"API folder (relative to src/backend/api):\",\n \"generate_command.api.choose_api_name.error\": \"API name must be unique, can not include special characters or spaces, and must be shorter than 20 characters\",\n \"generate_command.api.choose_method\": \"Choose an API method\",\n \"generate_command.event.choose_folder\": \"Event folder (relative to src/backend/events):\",\n \"generate_command.event.folder_placeholder\": \"my-event\",\n \"generate_command.event.choose_folder.error\": \"Event name must be unique, can not include special characters or spaces, and must be shorter than 20 characters\",\n \"generate_command.service_plugin.choose_type\": \"Which service plugin do you want to create\",\n \"generate_command.service_plugin.choose_name\": \"How would you like to name your service plugin\",\n \"generate_command.service_plugin.name_placeholder\": \"my-service-plugin\",\n \"generate_command.service_plugin.groups.stores\": \"Stores\",\n \"generate_command.service_plugin.ecom_additional_fees\": \"Ecom Additional Fees\",\n \"generate_command.service_plugin.ecom_shipping_rates\": \"Ecom Shipping Rates\",\n \"generate_command.service_plugin.ecom_discount_triggers\": \"Ecom Discount Triggers\",\n \"generate_command.service_plugin.ecom_validations\": \"Ecom Validations\",\n \"generate_command.service_plugin.ecom_payment_settings\": \"Ecom Payment Settings\",\n \"generate_command.service_plugin.ecom_gift_cards_provider\": \"Ecom Gift Cards Provider\",\n \"logs_command_def.option.version\": \"Specify the app version to fetch production logs from\",\n \"logs_command.connecting\": \"Connecting to the log server...\",\n \"logs_command.listening_to_logs\": \"Listening to logs from the server.\",\n \"logs_command.prod_env_logs\": \"Prod Environment logs for the version: {version}\"\n}\n"],"mappings":";;AAAA,IAAAA,EAAA,CACE,iDAAkD,+CAClD,oDAAqD,gCACrD,6CAA8C,2EAC9C,yCAA0C,qGAC1C,+BAAgC,kCAChC,sCAAuC,qGACvC,0CAA2C,2EAC3C,0CAA2C,gCAC3C,kBAAmB,aACnB,gCAAiC,yDACjC,4BAA6B;AAAA;AAAA;AAAA,oDAC7B,8BAA+B,kEAC/B,oCAAqC,aACrC,uBAAwB,sBACxB,qBAAsB,sBACtB,0BAA2B,mGAC3B,uCAAwC,+CACxC,yCAA0C,iDAC1C,8CAA+C,sDAC/C,mCAAoC,wCACpC,sCAAuC,2CACvC,sCAAuC,0CACvC,mCAAoC,eACpC,wBAAyB,OACzB,oCAAqC,iDACrC,0BAA2B,SAC3B,6BAA8B,YAC9B,2BAA4B,UAC5B,wBAAyB;AAAA;AAAA;AAAA,iHACzB,2BAA4B,mCAC5B,uBAAwB,wDACxB,oCAAqC,0BACrC,sCAAuC,uBACvC,mCAAoC,wBACpC,2CAA4C,gCAC5C,kCAAmC,sCACnC,0CAA2C,yBAC3C,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SACjD,uDAAwD,uBACxD,sDAAuD,sBACvD,yDAA0D,yBAC1D,mDAAoD,mBACpD,wDAAyD,wBACzD,2DAA4D,2BAC5D,kCAAmC,wDACnC,0BAA2B,kCAC3B,iCAAkC,qCAClC,6BAA8B,kDAChC","names":["messages_default"]}
@@ -0,0 +1,4 @@
1
+ import { createRequire as _createRequire } from 'node:module';
2
+ const require = _createRequire(import.meta.url);
3
+ import{a as n}from"./chunk-KNH7RNAZ.js";import{X as t}from"./chunk-522ULCVX.js";import{h as r}from"./chunk-V4TR6DCM.js";r();function s(){let e=t(n);return e.t.bind(e)}export{s as a};
4
+ //# sourceMappingURL=chunk-MXLCRTVZ.js.map
@@ -1,6 +1,6 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{e as x}from"./chunk-TT7ANJ37.js";import{b,d as a}from"./chunk-Z6KGERGI.js";import{e as s,h as n}from"./chunk-V4TR6DCM.js";n();var o=s(b(),1),c=s(a(),1);import{dirname as L}from"node:path";import{appendFileSync as D,mkdirSync as w}from"node:fs";n();var p=s(x(),1),l=s(a(),1);function u(e){if(p.HttpClient.isHttpError(e))return e;let t=e instanceof Error?l.default.cause(e):null;return t?u(t):null}n();function m(e){return{request:{baseURL:e.config.baseURL,url:e.config.url,method:e.config.method,headers:e.config.headers,data:e.config.data},response:{code:e.code,message:e.message,status:e.response?.status,headers:e.response?.headers,data:e.response?.data}}}function C(e,t){try{let r=`----- CLI crash report at ${new Date().toISOString()}
3
+ import{e as x}from"./chunk-X3ZYER2U.js";import{b,d as a}from"./chunk-522ULCVX.js";import{e as s,h as n}from"./chunk-V4TR6DCM.js";n();var o=s(b(),1),c=s(a(),1);import{dirname as L}from"node:path";import{appendFileSync as D,mkdirSync as w}from"node:fs";n();var p=s(x(),1),l=s(a(),1);function u(e){if(p.HttpClient.isHttpError(e))return e;let t=e instanceof Error?l.default.cause(e):null;return t?u(t):null}n();function m(e){return{request:{baseURL:e.config.baseURL,url:e.config.url,method:e.config.method,headers:e.config.headers,data:e.config.data},response:{code:e.code,message:e.message,status:e.response?.status,headers:e.response?.headers,data:e.response?.data}}}function C(e,t){try{let r=`----- CLI crash report at ${new Date().toISOString()}
4
4
  `;if(t instanceof Error){r+=`Error Trace
5
5
  `,r+=`${c.default.fullStack(t)}
6
6
  `,r+=`Error Info
@@ -8,4 +8,4 @@ import{e as x}from"./chunk-TT7ANJ37.js";import{b,d as a}from"./chunk-Z6KGERGI.js
8
8
  `;let i=u(t);i&&(r+=`Request Info
9
9
  `,r+=`${JSON.stringify(m(i),null,2)}
10
10
  `)}w(L(e),{recursive:!0}),D(e,r)}catch{}}var d=(0,o.createContext)(null),k=({filePath:e,children:t})=>{let r=(0,o.useCallback)(i=>C(e,i),[e]);return o.default.createElement(d.Provider,{value:r},t)},R=()=>{let e=(0,o.useContext)(d);if(e===null)throw new Error("useDebugLog() cannot be used without an <DebugLogProvider>");return e};export{k as a,R as b};
11
- //# sourceMappingURL=chunk-VMPGY3XD.js.map
11
+ //# sourceMappingURL=chunk-NEWE3FX5.js.map
@@ -0,0 +1,4 @@
1
+ import { createRequire as _createRequire } from 'node:module';
2
+ const require = _createRequire(import.meta.url);
3
+ import{a as Ne}from"./chunk-2LPICRGU.js";import{a as qe}from"./chunk-EWA6OFAF.js";import{b as K}from"./chunk-NEWE3FX5.js";import{a as Te,b as Ae,c as De,e as Ie,j as Ue,k as Ee}from"./chunk-ATQCL6AZ.js";import{Aa as xe,C as Q,Qa as U,Ra as Y,Ta as L,Ua as be,a as x,b as M,d as g,f as j,na as G,rb as X,ub as w,x as ye,z as Re}from"./chunk-X3ZYER2U.js";import{A as ge,L as $,N as Se,O as _e,P as Ce,R as we,V as Oe,W as Pe,b as C,c as N,e as h,f as S,m as f,n as F,y as he}from"./chunk-522ULCVX.js";import{e as u,h as a}from"./chunk-V4TR6DCM.js";a();var y=u(C(),1),le=u(N(),1);a();var ze=u(C(),1),He=u(N(),1);a();a();a();var ft={},ht={},gt={},St={};var _t={},Ct={},wt={},Ot={};function Z(e){var t={"api._api_base_domain_":[{srcPath:"/apps-release-manager-service-web",destPath:""}],"bo._base_domain_":[{srcPath:"/apps-release-manager-service-web",destPath:""}],"wixbo.ai":[{srcPath:"/apps-release-manager-service-web",destPath:""}],"www._base_domain_":[{srcPath:"/apps-release-manager-service-web/artifacts-release-manager/app-releases",destPath:"/artifacts-release-manager/app-releases"},{srcPath:"/_api/apps-release-manager-service-web/artifacts-release-manager/app-releases",destPath:"/artifacts-release-manager/app-releases"},{srcPath:"/apps-release-manager-service-web/apps/create",destPath:"/apps/create"},{srcPath:"/apps-release-manager-service-web/apps/promote",destPath:"/apps/promote"},{srcPath:"/apps-release-manager-service-web/apps/tags",destPath:"/apps/tags"},{srcPath:"/apps-release-manager-service-web/apps/create-components",destPath:"/apps/create-components"}],"manage._base_domain_":[{srcPath:"/apps-release-manager-service-web/apps/promote",destPath:"/apps/promote"},{srcPath:"/apps-release-manager-service-web/apps/create",destPath:"/apps/create"},{srcPath:"/apps-release-manager-service-web/apps/tags",destPath:"/apps/tags"},{srcPath:"/apps-release-manager-service-web/apps/create-components",destPath:"/apps/create-components"}]};return M(Object.assign(e,{domainToMappings:t}))}function Me(e){var t=g(ft,{}),r=t.toJSON,o=t.fromJSON,s=g(ht,{}).fromJSON;function i(c){var l=c.host,m=r(e),d={entityFqdn:"wix.ctp.gradual_rollout.v1.app_config",method:"POST",methodFqn:"com.wix.ctp.AppsReleaseManagerService.CreateAppRelease",url:Z({protoPath:"/apps/create/{appId}",data:m,host:l}),data:m,transformResponse:s};return d}return i.fromReq=o,i.__isAmbassador=!0,i}function je(e){var t=g(wt,{}),r=t.toJSON,o=t.fromJSON,s=g(Ot,{}).fromJSON;function i(c){var l=c.host,m=r(e),d={entityFqdn:"wix.ctp.gradual_rollout.v1.app_config",method:"PUT",methodFqn:"com.wix.ctp.AppsReleaseManagerService.UpdateAppRelease",url:Z({protoPath:"/apps/tags/{tag}",data:m,host:l}),data:m,transformResponse:s};return d}return i.fromReq=o,i.__isAmbassador=!0,i}function Fe(e){var t=g(gt,{}),r=t.toJSON,o=t.fromJSON,s=g(St,{}).fromJSON;function i(c){var l=c.host,m=r(e),d={entityFqdn:"wix.ctp.gradual_rollout.v1.app_config",method:"POST",methodFqn:"com.wix.ctp.AppsReleaseManagerService.CreateComponents",url:Z({protoPath:"/apps/create-components/{appId}",data:m,host:l}),data:m,transformResponse:s};return d}return i.fromReq=o,i.__isAmbassador=!0,i}function Le(e){var t=g(_t,{}),r=t.toJSON,o=t.fromJSON,s=g(Ct,{}).fromJSON;function i(c){var l=c.host,m=r(e),d={entityFqdn:"wix.ctp.gradual_rollout.v1.app_config",method:"POST",methodFqn:"com.wix.ctp.AppsReleaseManagerService.PromoteAppReleaseToDevCenter",url:Z({protoPath:"/apps/promote/{appId}/{tag}",data:m,host:l}),data:m,transformResponse:s};return d}return i.fromReq=o,i.__isAmbassador=!0,i}var ee=u(N(),1);a();var Je=f.object({newVersion:f.string()}),ke=f.object({tag:f.string()});var{AppPermissionDenied:ne}=S,Be=(0,ee.variant)({TagUpdated:{},TagNotFound:(0,ee.fields)()}),V=class{constructor(t){this.httpClient=t;let{minRetryTimeout:r}=F();this.retryOptions={retries:3,minTimeout:r,maxTimeout:3*1e3}}retryOptions;createComponents=async(t,r,o)=>{try{await x(()=>this.httpClient.request(Fe({appId:t,componentConfigs:r,projectId:o})),this.retryOptions)}catch(s){throw j(s)&&s.response?.status===403?new h({code:ne({appId:t}),cause:s}):new h({code:S.FailedToCreateComponents(),cause:s})}};createAppRelease=async(t,r)=>{try{let{data:o}=await x(()=>this.httpClient.request(Me({appId:t.appId,componentConfigs:t.components,projectId:r})),this.retryOptions);return ke.parse(o).tag}catch(o){throw j(o)&&o.response?.status===403?new h({code:ne({appId:t.appId}),cause:o}):new h({code:S.FailedToCreateAppRelease(),cause:o})}};updateAppRelease=async(t,r)=>{try{return await x(()=>this.httpClient.request(je({appId:t.appId,componentConfigs:t.components,tag:r})),this.retryOptions),Be.TagUpdated()}catch(o){if(j(o)){if(o.response?.status===404)return Be.TagNotFound({cause:o});if(o.response?.status===403)throw new h({code:ne({appId:t.appId}),cause:o})}throw new h({code:S.FailedToUpdateAppRelease(),cause:o})}};promoteToDevCenter=async(t,r,o)=>{let{data:s}=await x(()=>this.httpClient.request(Le({appId:t,tag:r,versionType:o})),this.retryOptions);return Je.parse(s)}};a();var Ve=u(C(),1);function pe(){let e=L({type:"backoffice"});return(0,Ve.useMemo)(()=>new V(e),[e])}var We=async(e,t,r)=>{let o=await Ue({appId:e.config.appId,components:e.components,componentSourceBuilder:Ee(e,{clientDevServerUrl:t},{backendDevServerUrl:r?.localUrl})});return Ie(o,t,r?.tunnelUrl)};function $e(){let{model:e}=w(),t=K(),{createAppRelease:r,updateAppRelease:o}=pe();return(0,ze.useCallback)(async({backendServerUrl:s,devServerUrl:i,projectModelWatcher:c,onChange:l,onError:m})=>{let{projectId:d}=e.config,P=await We(e,i,s),_=await U(e.projectFolder,t),D=await(async v=>{if(v){let A=await o(P,v);return(0,He.match)(A,{TagUpdated:()=>v,TagNotFound:({cause:R})=>(t(R),r(P,d))})}return r(P,d)})(_?.devArmTag);return D!==_?.devArmTag&&await Y(e.projectFolder,{devArmTag:D}).catch(v=>t(v)),c.onChange(async(v,A)=>{try{if(A==="model-updated"){if(v.components.length===0)return;let R=await We(v,i,s);X(P,R)||await o(R,D)}l(A)}catch(R){m(R)}}).onError(m),D},[r,e,o,t])}a();var J=u(C(),1);import{createServer as Pt}from"vite";function Ke({createConfig:e}){let{reportError:t}=Q(),r=(0,J.useRef)();return(0,J.useEffect)(()=>()=>{r.current?.close().catch(t)},[t]),(0,J.useCallback)(async o=>{let s=await e(o),i=await Pt(s);return r.current=i,await i.listen(),{devServerUrl:Te(i),devServer:i}},[e])}function Qe({https:e}){let{model:t}=w();return Ke({createConfig:({projectModelWatcher:o,baseBackendUrl:s,customLogger:i})=>Ae(t,{type:"dev",https:e,projectModelWatcher:o,customLogger:i},{baseBackendUrl:s})})}function Ge({https:e}){let{model:t}=w(),{getAppSecret:r}=be();return Ke({createConfig:async({projectModelWatcher:s,customLogger:i})=>{let c=await r({appId:t.config.appId});return De(t,{type:"dev",https:e,customLogger:i,projectModelWatcher:s},c)}})}a();var k=u(C(),1),Ye=(0,k.createContext)(null),Xe=({children:e,armTag:t})=>k.default.createElement(Ye.Provider,{value:{armTag:t}},e),me=()=>{let e=(0,k.useContext)(Ye);if(e===null)throw new Error("useArmTag() cannot be used without an <ArmTagProvider>");return e};a();var E=u(C(),1);a();a();a();var yt={},Rt={};function xt(e){var t={"bo._base_domain_":[{srcPath:"/_serverless/site-override",destPath:""}],"wixbo.ai":[{srcPath:"/_serverless/site-override",destPath:""}],"wix-bo.com":[{srcPath:"/_serverless/site-override",destPath:""}],"manage._base_domain_":[{srcPath:"/_serverless/site-override",destPath:""}]};return M(Object.assign(e,{domainToMappings:t}))}function Ze(e){var t=g(yt,{}),r=t.toJSON,o=t.fromJSON,s=g(Rt,{}).fromJSON;function i(c){var l=c.host,m=r(e),d={entityFqdn:"wix.cli.site_override_service.v1.site_override",method:"POST",methodFqn:"wix.cli.v1.SiteOverrideService.CreateOverride",url:xt({protoPath:"/v1/site-overrides",data:m,host:l}),data:m,transformResponse:s};return d}return i.fromReq=o,i.__isAmbassador=!0,i}a();var et=f.object({siteOverride:f.object({id:f.string()})});var te=class{constructor(t){this.httpClient=t;let{minRetryTimeout:r}=F();this.retryOptions={retries:3,minTimeout:r,maxTimeout:3*1e3}}retryOptions;createOverride=async({appId:t,siteId:r,overrides:o,siteOverrideId:s})=>{try{let{data:i}=await x(()=>this.httpClient.request(Ze({siteOverride:{id:s,appId:t,siteId:r,overrides:o}})),this.retryOptions);return et.parse(i).siteOverride}catch(i){throw j(i)&&i.response?.status===403?i.response.data?.details?.applicationError?.code==="PERMISSION_DENIED_FOR_SITE"?new h({code:S.SitePermissionDenied({siteId:r}),cause:i}):new h({code:S.AppPermissionDenied({appId:t}),cause:i}):new h({code:S.FailedToCreateSiteOverride(),cause:i})}}};a();var tt=u(C(),1);function ce(){let e=L({type:"backoffice"});return(0,tt.useMemo)(()=>new te(e),[e])}a();var ot=u(N(),1);a();var re;(function(e){e.UNKNOWN_TYPE="UNKNOWN_TYPE",e.EMBEDDED_SCRIPT="EMBEDDED_SCRIPT"})(re||(re={}));var rt;(function(e){e.UNKNOWN="UNKNOWN",e.ANONYMOUS_VISITOR="ANONYMOUS_VISITOR",e.MEMBER="MEMBER",e.WIX_USER="WIX_USER",e.APP="APP"})(rt||(rt={}));function oe(e){let t=e.components.filter((0,ot.isType)(xe.EmbeddedScript));return t.length===0?null:t.reduce((r,o)=>{let s=o.paramsOverride??{};return{...r,[o.id]:{type:re.EMBEDDED_SCRIPT,componentId:o.id,embeddedScriptOptions:{parameters:s}}}},{})}a();var at=u(C(),1);a();var it=u(C(),1),st=(0,it.createContext)(null);function W(){let e=(0,at.useContext)(st);if(e===null)throw new Error("useSiteId() cannot be used without an <SiteIdProvider>");return e}function nt(){let{model:e}=w(),{site:t}=W(),r=Ce(),o=K(),{createOverride:s}=ce(),{appId:i}=e.config,c=(0,E.useRef)(t),l=(0,E.useRef)(!1);return(0,E.useEffect)(()=>{c.current=t;let m=async()=>{let d=oe(e)??{},_=(await U(e.projectFolder,o))?.devSiteOverrideId;if(!_)throw new h({code:S.InvalidSiteOverrideID()});await s({appId:i,siteId:t.id,overrides:d,siteOverrideId:_})};l.current&&m().catch(r)},[t]),(0,E.useCallback)(async({projectModelWatcher:m})=>{let d=await U(e.projectFolder,o),P=oe(e)??{},{id:_}=await s({appId:i,siteId:t.id,overrides:P,siteOverrideId:d?.devSiteOverrideId});return m.onChange(async(T,D)=>{if(D==="model-updated"){let v=oe(T)??{};X(P,v)||(await s({appId:i,siteId:c.current.id,overrides:v,siteOverrideId:_}),P=v)}}),_!==d?.devSiteOverrideId&&await Y(e.projectFolder,{devSiteOverrideId:_}).catch(T=>o(T)),l.current=!0,_},[e,o,s,i,t])}a();var B=u(C(),1),pt=(0,B.createContext)(null),mt=({children:e,siteOverrideId:t})=>B.default.createElement(pt.Provider,{value:{siteOverrideId:t}},e),de=()=>{let e=(0,B.useContext)(pt);if(e===null)throw new Error("useSiteOverrideId() cannot be used without an <SiteOverrideProvider>");return e};var ct=(0,y.createContext)(null),Eo=({https:e,logger:t,children:r})=>{let{t:o}=Pe(),{reportError:s}=Q(),{backendComponents:i,backendComponentsByType:c}=Ne(),l=Qe({https:e}),m=Ge({https:e}),d=qe(),P=$e(),_=nt(),{watcher:T}=w(),{status:D}=we(async()=>{let v;i.length>0&&(v=await m({projectModelWatcher:T,customLogger:t}).then(async({devServerUrl:I})=>{let fe;if(c.Event.length>0||c.ServicePlugin.length>0){let{url:ut}=await d(Number(new URL(I).port));fe=ut}return{localUrl:I,tunnelUrl:fe}}));let{devServerUrl:A,devServer:R}=await l({baseBackendUrl:v?.localUrl,projectModelWatcher:T,customLogger:t}),ae=await P({backendServerUrl:v,devServerUrl:A,projectModelWatcher:T,onChange(I){(0,le.match)(I,{"change-received":()=>{t.info(o("dev_command.config_change"))},"model-did-not-change":()=>{t.info(o("dev_command.config_didnt_update"))},"model-updated":()=>{R.ws.send({type:"full-reload"}),t.info(o("dev_command.config_update"))}})},onError(I){s(I),t.error(y.default.createElement(Re,{error:I})),t.info(o("dev_command.config_didnt_update"))}}),vt=await _({projectModelWatcher:T});return t.info(y.default.createElement($,{type:"success"},o("dev_command.dev_environment.started"))),{clientDevServerUrl:A,armTag:ae,siteOverrideId:vt,https:e}},[]);return(0,le.match)(D,{Error:()=>null,Loading:()=>y.default.createElement(_e,{text:o("dev_command.dev_environment.loading")}),Success:({result:{clientDevServerUrl:v,https:A,armTag:R,siteOverrideId:ae}})=>y.default.createElement(ct.Provider,{value:{clientDevServerUrl:v,https:A,logger:t}},y.default.createElement(mt,{siteOverrideId:ae},y.default.createElement(Xe,{armTag:R},r)))})};function ie(){let e=(0,y.useContext)(ct);if(e===null)throw new Error("useDevEnvironment() cannot be used without an <DevEnvironmentProvider>");return e}a();a();var bt={},Tt={sites:"_site"},At={createdDate:"google.protobuf.Timestamp",updatedDate:"google.protobuf.Timestamp",trashedDate:"google.protobuf.Timestamp"};function Dt(e){var t={"www._base_domain_":[{srcPath:"/_api/sites-list",destPath:"/api"},{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}],"feedback._base_domain_":[{srcPath:"/_api/sites-list",destPath:"/api"}],"manage._base_domain_":[{srcPath:"/_api/sites-list",destPath:"/api"},{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"},{srcPath:"/_api/sites-list-data",destPath:"/api/sites-list-data"}],"www.wixapis.com":[{srcPath:"/site-list/v2/sites",destPath:"/v2/sites"}],"api._api_base_domain_":[{srcPath:"/sites-list",destPath:""}],"bo._base_domain_":[{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}],"wixbo.ai":[{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}],"dev._base_domain_":[{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}],"editor._base_domain_":[{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}],"blocks._base_domain_":[{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}],"create.editorx":[{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}]};return M(Object.assign(e,{domainToMappings:t}))}function ve(e){var t=g(bt,{}),r=t.toJSON,o=t.fromJSON,s=g(Tt,{_site:At}).fromJSON;function i(c){var l=c.host,m=r(e),d={entityFqdn:"wix.site_list.v2.site",method:"POST",methodFqn:"com.wixpress.sitelist.api.SiteListServiceV2.QuerySites",url:Dt({protoPath:"/v2/sites/query",data:m,host:l}),data:m,transformResponse:s};return d}return i.fromReq=o,i.__isAmbassador=!0,i}a();var It=f.object({id:f.string(),displayName:f.string(),viewUrl:f.union([f.string().url(),f.literal("")]).optional()}),ue=f.object({sites:f.array(It)});var z=class{constructor(t){this.httpClient=t;let{minRetryTimeout:r}=F();this.retryOptions={retries:3,minTimeout:r,maxTimeout:3*1e3}}retryOptions;querySites=async(t={})=>{try{let{data:r}=await x(()=>this.httpClient.request(ve(t)),this.retryOptions);return ue.parse(r).sites}catch(r){throw new h({code:S.FailedToQuerySites(),cause:r,info:{...t}})}};getSite=async t=>{try{let{data:r}=await x(()=>this.httpClient.request(ve({query:{filter:{id:{$in:[t]}}}})),this.retryOptions),{sites:o}=ue.parse(r);return o.at(0)??null}catch(r){throw new h({code:S.FailedToGetSite(),cause:r,info:{id:t}})}}};a();var dt=u(C(),1);function Ut(){let e=L({type:"backoffice"});return(0,dt.useMemo)(()=>new z(e),[e])}a();a();var H=u(N(),1),se=(0,H.variant)({NotConfigured:{},NotFound:(0,H.fields)(),Resolved:(0,H.fields)()});a();async function pi({projectFolder:e,siteListClient:{getSite:t},siteId:r,writeDebugLog:o}){let s=r||(await U(e,o))?.siteId;if(!s)return se.NotConfigured();let i=await t(s);return i?se.Resolved({site:i}):se.NotFound({id:s})}a();var O=u(C(),1);var b=u(N(),1);import{URL as q}from"node:url";var Et=(e,t)=>{let r=(0,b.isType)(t,G.Site)?`${e.origin}/_api`:"https://apps.wix.com",o=new q(`${r}/elgar-server/redirect`);return["specs.UseAppsRuntimeCache","specs.ApplyQueryParamsOverrides"].forEach(i=>{o.searchParams.append("experiments",`${i}#true`)}),o.searchParams.append("redirectToUrl",e.toString()),o.searchParams.append("staticsVersions","{}"),o};function lt({url:e,clientDevServerUrl:t}){let r=new q("/redirect",t);return r.searchParams.append("url",e),r.href}function qt(){let{model:e}=w(),{site:t}=W(),{armTag:r}=me(),{siteOverrideId:o}=de();return(0,O.useCallback)(s=>Nt(s,{site:t,appId:e.config.appId,tag:r,siteOverrideId:o}),[t,e.config.appId,r,o])}function wi(){let e=qt(),{https:t,clientDevServerUrl:r}=ie();return(0,O.useCallback)(o=>{let s=e(o);return t&&(s=lt({url:s,clientDevServerUrl:r})),s},[e,t,r])}function Nt(e,t){let{site:r,tag:o,siteOverrideId:s}=t,i=(0,b.match)(e,{Dashboard:()=>new q(`dashboard/${r.id}`,"https://manage.wix.com/"),Editor:()=>new q(`https://wix.com/editor/${r.id}`),Site:()=>{let c=new q(r.viewUrl);return s&&c.searchParams.append("site-override",s),c}});return i.searchParams.append("apps-override",o),(0,b.isOfVariant)(e,(0,b.variantList)([G.Editor,G.Site]))?Et(i,e).toString():i.toString()}function Mt(){let{model:e}=w(),{site:t}=W(),{armTag:r}=me(),{siteOverrideId:o}=de();return(0,O.useCallback)(s=>jt(s,{site:t,appId:e.config.appId,tag:r,siteOverrideId:o}),[t,e.config.appId,r,o])}function Oi(){let e=Mt(),{https:t,clientDevServerUrl:r}=ie();return(0,O.useCallback)(o=>{let s=e(o);return t&&(s=lt({url:s,clientDevServerUrl:r})),s},[e,t,r])}function jt(e,t){let{appId:r,site:o,tag:s}=t,i=(0,b.matcher)(e).with({DashboardPage:()=>new q(`dashboard/${o.id}/app/${r}${e.route}`,"https://manage.wix.com/")}).when(["DashboardMenuPlugin","DashboardPlugin","DashboardModal"],()=>new q(`dashboard/${o.id}${e.route}`,"https://manage.wix.com/")).complete();return i.searchParams.append("apps-override",s),i.toString()}var Pi=()=>{let{logger:e}=ie();return(0,O.useCallback)(async({url:t,title:r})=>{try{await ye(t)}catch{e.error(O.default.createElement($,{type:"error"},O.default.createElement(Oe,{i18nKey:"general.open_page_error",components:[O.default.createElement(ge,{bold:!0})],values:{title:r}}),O.default.createElement(he,null),O.default.createElement(Se,{url:t})))}},[e])};export{z as a,Ut as b,st as c,se as d,pi as e,V as f,pe as g,Xe as h,me as i,ce as j,oe as k,W as l,mt as m,Eo as n,ie as o,Et as p,qt as q,wi as r,Nt as s,Mt as t,Oi as u,jt as v,Pi as w};
4
+ //# sourceMappingURL=chunk-RWTMPGYF.js.map