@wix/cli-app 1.1.33 → 1.1.34

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 (75) hide show
  1. package/build/CreateVersionCommand-3ECZI65A.js +4 -0
  2. package/build/{CreateVersionCommand-DYEPGQUL.js.map → CreateVersionCommand-3ECZI65A.js.map} +1 -1
  3. package/build/DevCommand-B7WYY2UQ.js +4 -0
  4. package/build/DevCommand-B7WYY2UQ.js.map +1 -0
  5. package/build/{GenerateCommand-HAREJGST.js → GenerateCommand-CIO77YCS.js} +2 -2
  6. package/build/LogsCommand-VJ64MYDN.js +4 -0
  7. package/build/LogsCommand-VJ64MYDN.js.map +1 -0
  8. package/build/PreviewCommand-BZY2XOZN.js +4 -0
  9. package/build/ServeCommand-AEELDVFH.js +4 -0
  10. package/build/ServeCommand-AEELDVFH.js.map +1 -0
  11. package/build/{build-57Q22ZQB.js → build-JVHXDZDD.js} +2 -2
  12. package/build/{chunk-QPAM4OF5.js → chunk-2KPKOJPE.js} +2 -2
  13. package/build/chunk-35SQ77PW.js +4 -0
  14. package/build/chunk-35SQ77PW.js.map +1 -0
  15. package/build/{chunk-TBNJFVSI.js → chunk-COIDN4V4.js} +2 -2
  16. package/build/{chunk-LBMDBGQY.js → chunk-E6MYDYCH.js} +2 -2
  17. package/build/{chunk-5QHRKYZO.js → chunk-F4LXYTO3.js} +2 -2
  18. package/build/{chunk-KJMWKJXC.js → chunk-F4YTZ6XA.js} +12 -12
  19. package/build/{chunk-KJMWKJXC.js.map → chunk-F4YTZ6XA.js.map} +1 -1
  20. package/build/{chunk-QF5IXGT3.js → chunk-F55KYUXJ.js} +2 -2
  21. package/build/{chunk-2P6DNBHW.js → chunk-FBYP5GID.js} +2 -2
  22. package/build/{chunk-CAFL5PGF.js → chunk-HTO6ALNX.js} +2 -2
  23. package/build/{chunk-AA74H3TG.js → chunk-HTY6QIPX.js} +2 -2
  24. package/build/{chunk-NIFVIO6B.js → chunk-JAY5356K.js} +2 -2
  25. package/build/{chunk-BQUJNTD3.js → chunk-JKG4PFVP.js} +2 -2
  26. package/build/{chunk-DRRMAC33.js → chunk-MB65UVFQ.js} +28 -28
  27. package/build/chunk-MB65UVFQ.js.map +1 -0
  28. package/build/chunk-MKVAJTCF.js +4 -0
  29. package/build/chunk-MKVAJTCF.js.map +1 -0
  30. package/build/{chunk-CH25SGQ6.js → chunk-MON4UIEH.js} +2 -2
  31. package/build/chunk-QTYWYBN3.js +4 -0
  32. package/build/chunk-QTYWYBN3.js.map +1 -0
  33. package/build/{chunk-TUMP3O53.js → chunk-ROZV4SHP.js} +2 -2
  34. package/build/{chunk-ASR5T2EG.js → chunk-X62VPDUS.js} +2 -2
  35. package/build/{chunk-OVY3XD7N.js → chunk-XUF2HJAT.js} +2 -2
  36. package/build/{chunk-OVY3XD7N.js.map → chunk-XUF2HJAT.js.map} +1 -1
  37. package/build/index.js +2 -2
  38. package/build/{preview-AHK3W3S5.js → preview-L5LDZK2L.js} +2 -2
  39. package/build/{render-command-QU4TUTXB.js → render-command-IA3LLA3F.js} +2 -2
  40. package/package.json +4 -4
  41. package/build/CreateVersionCommand-DYEPGQUL.js +0 -4
  42. package/build/DevCommand-MHQH5RZI.js +0 -4
  43. package/build/DevCommand-MHQH5RZI.js.map +0 -1
  44. package/build/LogsCommand-JTLDKERL.js +0 -4
  45. package/build/LogsCommand-JTLDKERL.js.map +0 -1
  46. package/build/PreviewCommand-BR4CC5HU.js +0 -4
  47. package/build/ServeCommand-DXYE4RDW.js +0 -4
  48. package/build/ServeCommand-DXYE4RDW.js.map +0 -1
  49. package/build/chunk-DRRMAC33.js.map +0 -1
  50. package/build/chunk-FHI3B5GR.js +0 -4
  51. package/build/chunk-FHI3B5GR.js.map +0 -1
  52. package/build/chunk-QZS4ARDD.js +0 -4
  53. package/build/chunk-QZS4ARDD.js.map +0 -1
  54. package/build/chunk-SUDVHU7A.js +0 -4
  55. package/build/chunk-SUDVHU7A.js.map +0 -1
  56. package/build/chunk-VYJSZFOO.js +0 -4
  57. package/build/chunk-VYJSZFOO.js.map +0 -1
  58. /package/build/{GenerateCommand-HAREJGST.js.map → GenerateCommand-CIO77YCS.js.map} +0 -0
  59. /package/build/{PreviewCommand-BR4CC5HU.js.map → PreviewCommand-BZY2XOZN.js.map} +0 -0
  60. /package/build/{build-57Q22ZQB.js.map → build-JVHXDZDD.js.map} +0 -0
  61. /package/build/{chunk-QPAM4OF5.js.map → chunk-2KPKOJPE.js.map} +0 -0
  62. /package/build/{chunk-TBNJFVSI.js.map → chunk-COIDN4V4.js.map} +0 -0
  63. /package/build/{chunk-LBMDBGQY.js.map → chunk-E6MYDYCH.js.map} +0 -0
  64. /package/build/{chunk-5QHRKYZO.js.map → chunk-F4LXYTO3.js.map} +0 -0
  65. /package/build/{chunk-QF5IXGT3.js.map → chunk-F55KYUXJ.js.map} +0 -0
  66. /package/build/{chunk-2P6DNBHW.js.map → chunk-FBYP5GID.js.map} +0 -0
  67. /package/build/{chunk-CAFL5PGF.js.map → chunk-HTO6ALNX.js.map} +0 -0
  68. /package/build/{chunk-AA74H3TG.js.map → chunk-HTY6QIPX.js.map} +0 -0
  69. /package/build/{chunk-NIFVIO6B.js.map → chunk-JAY5356K.js.map} +0 -0
  70. /package/build/{chunk-BQUJNTD3.js.map → chunk-JKG4PFVP.js.map} +0 -0
  71. /package/build/{chunk-CH25SGQ6.js.map → chunk-MON4UIEH.js.map} +0 -0
  72. /package/build/{chunk-TUMP3O53.js.map → chunk-ROZV4SHP.js.map} +0 -0
  73. /package/build/{chunk-ASR5T2EG.js.map → chunk-X62VPDUS.js.map} +0 -0
  74. /package/build/{preview-AHK3W3S5.js.map → preview-L5LDZK2L.js.map} +0 -0
  75. /package/build/{render-command-QU4TUTXB.js.map → render-command-IA3LLA3F.js.map} +0 -0
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{H as o,I as u,J as h,K as m,L as p,M as N,P as f,Q as E}from"./chunk-KJMWKJXC.js";import{l as e}from"./chunk-DRRMAC33.js";import{h as S}from"./chunk-V4TR6DCM.js";S();import C from"node:fs/promises";var g=e.object({errorReporting:e.object({url:e.string().optional(),artifact:e.object({fullArtifactId:e.string().max(255).min(1),version:e.string().max(255).min(1)}).optional()}).optional()}),d=e.object({iframeUrl:e.string().optional(),scriptAsset:e.object({exportedName:e.string(),containerId:e.string(),url:e.string(),scriptType:e.string().optional()}).optional()}),_=e.object({hostingPlatform:e.string(),fullPage:e.boolean().nullish(),hideInSidebar:e.boolean().nullish(),priority:e.number().nullish(),routePath:e.string().nullish(),title:e.string(),pageCategoryId:e.string().uuid().nullish(),activeSidebarPageId:e.string().nullish(),requiredPermission:e.string().nullish(),previousRoutePaths:e.array(e.string()).nullish()}).merge(g).merge(d).passthrough(),j=e.object({width:e.number().nullish(),height:e.number().nullish()}).merge(d).passthrough(),b=e.object({appId:e.string(),componentId:e.string().uuid(),spec:e.string().min(1),variantValue:e.string()}).passthrough().optional(),y=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_PAGE),compData:e.object({backOfficePage:_}),compName:e.string().optional(),experiment:b}).passthrough(),A=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION),compData:e.object({backOfficeExtension:e.object({hostingPlatform:e.string(),extends:e.string(),title:e.string().nullish(),extensionType:e.literal(N.BACK_OFFICE_EXTENSION_WIDGET),requiredPermission:e.string().nullish(),widget:j}).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),D=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_WIDGET),compData:e.object({backOfficeExtensionWidget:e.object({hostingPlatform:e.string(),extends:e.string(),title:e.string().nullish(),description:e.string().optional(),requiredPermission:e.string().nullish(),width:e.number().nullish(),height:e.number().nullish()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),v=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_MENU_ITEM),compData:e.object({backOfficeExtensionMenuItem:e.object({id:e.string().uuid(),title:e.string().min(1),subtitle:e.string().max(200).optional(),iconKey:e.string().min(3).max(50).optional(),extends:e.string().uuid(),action:e.object({navigateToPage:e.object({pageId:e.string().uuid(),relativeUrl:e.string().optional()}),openModal:e.object({componentId:e.string().uuid(),componentParams:e.record(e.string().min(1),e.string().min(1)).optional()})}).partial().superRefine((r,i)=>{!r.navigateToPage&&!r.openModal&&i.addIssue({code:e.ZodIssueCode.custom,message:"action must have either navigateToPage or openModal"})}),sentryDSN:e.string().optional(),requiredPermission:e.string().optional()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),k=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_MODAL),compData:e.object({backOfficeModal:e.object({hostingPlatform:e.string(),title:e.string().nullish(),requiredPermission:e.string().nullish(),width:e.number().nullish(),height:e.number().nullish()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),P=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_SIDEBAR_CATEGORY),compData:e.object({backOfficeSidebarCategory:e.object({hostingPlatform:e.string(),title:e.string(),priority:e.number().nullish()})}),compName:e.string().optional()}).passthrough(),F=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_WIDGET),compName:e.string().optional()}).passthrough(),x=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_CONTAINER),compName:e.string().optional()}).passthrough(),T=e.object({packageName:e.string().min(2).max(100),version:e.number().int().min(0)}),M=e.object({template:e.string(),name:e.string(),pages:e.enum([h.NONE_PAGES,h.ONCE,h.SPECIFIC_PAGES]),placement:e.enum([m.HEAD,m.BODY_START,m.BODY_END,m.NONE_PLACEMENT]),connectArticleUrl:e.string(),embedCategory:e.enum([p.UNKNOWN,p.FUNCTIONAL,p.ESSENTIAL,p.ANALYTICS,p.ADVERTISING]),loadOnce:e.boolean(),allowedForFreeSite:e.boolean(),dependencies:e.array(T)}),W=e.object({compId:e.string(),compType:e.literal(o.EMBEDDED_SCRIPT),compName:e.string().optional(),compData:e.object({embeddedScriptComponentData:M})}).passthrough(),U=e.object({base:e.object({id:e.string().optional(),name:e.string()}),installation:e.object({base:e.object({autoAdd:e.boolean().optional(),essential:e.boolean().optional(),maxInstances:e.number().optional()}).optional(),widget:e.object({default_preset:e.object({desktop_preset_id:e.string().optional(),tablet_preset_id:e.string().optional(),mobile_preset_id:e.string().optional()}).optional(),region:e.enum([u.BODY,u.FOOTER,u.HEADER])}).optional()}).optional(),widgetData:e.object({tagName:e.string(),scriptUrl:e.string(),scriptType:e.enum([f.NONE,f.COMMON_JS,f.ES_MODULE])}),behaviors:e.object({settings:e.object({settingsUrl:e.string()}).optional(),dashboard:e.object({dashboardPageComponentId:e.string()}).optional()}),size:e.object({width:e.object({allowStretch:e.boolean().optional(),defaultWidth:e.number().optional(),stretchByDefault:e.boolean().optional()}),height:e.object({defaultHeight:e.number(),heightMode:e.enum([E.AUTO,E.FIXED,E.UNKNOWN]).optional()})}),dependencies:e.array(T)}),w=e.object({compId:e.string(),compType:e.literal(o.CUSTOM_ELEMENT_WIDGET),compName:e.string().optional(),compData:e.object({customElementWidget:U})}).passthrough(),B=e.object({compId:e.string().uuid(),compType:e.literal(o.WEBHOOK),compName:e.string().optional(),compData:e.object({webhook:e.object({webhookSlug:e.string(),callbackUrl:e.string()})})}).passthrough(),R=e.object({compType:e.literal(o.TOPOLOGY),compId:e.string(),compName:e.string().optional(),compData:e.object({topology:e.object({topology:e.object({backendApiUrl:e.string().url()})})})}).passthrough(),K=e.object({appId:e.string(),components:e.array(e.discriminatedUnion("compType",[y,A,D,v,k,P,F,x,W,w,B,R]))});async function $(r){try{let i=await C.readFile(r,"utf-8");return K.parse(JSON.parse(i))}catch(i){let n=i instanceof Error?i.toString():JSON.stringify(i);throw new Error(`Failed to read App Manifest at ${r}: ${n}`)}}var I=(r,i)=>new URL(r,i).href,O=(r,i)=>{let{scriptAsset:n,iframeUrl:s}=r;return n?{scriptAsset:{...n,url:I(n.url,i)}}:s?{iframeUrl:I(s,i)}:r},L=(r,i)=>({template:r.template.replaceAll("__STATICS_BASE_URL_PLACEHOLDER__",i)}),z=(r,i,n)=>{let s=JSON.parse(JSON.stringify(r)),a=i.endsWith("/")?i:`${i}/`;return s.components.forEach(l=>{let{compData:t,compType:c}=l;c===o.BACK_OFFICE_PAGE&&(t.backOfficePage={...t.backOfficePage,...O(t.backOfficePage,a)}),c===o.BACK_OFFICE_EXTENSION&&(t.backOfficeExtension.widget={...t.backOfficeExtension.widget,...O(t.backOfficeExtension.widget,a)}),c===o.BACK_OFFICE_EXTENSION_WIDGET&&(t.backOfficeExtensionWidget={...t.backOfficeExtensionWidget,...O(t.backOfficeExtensionWidget,a)}),c===o.BACK_OFFICE_MODAL&&(t.backOfficeModal={...t.backOfficeModal,...O(t.backOfficeModal,a)}),c===o.EMBEDDED_SCRIPT&&(t.embeddedScriptComponentData={...t.embeddedScriptComponentData,...L(t.embeddedScriptComponentData,a)}),c===o.CUSTOM_ELEMENT_WIDGET&&(t.customElementWidget={...t.customElementWidget,widgetData:{...t.customElementWidget.widgetData,scriptUrl:I(t.customElementWidget.widgetData.scriptUrl,a)},behaviors:{...t.customElementWidget.behaviors,...t.customElementWidget.behaviors.settings?{settings:{settingsUrl:I(t.customElementWidget.behaviors.settings.settingsUrl,a)}}:{}}}),c===o.WEBHOOK&&n&&(t.webhook={...t.webhook,callbackUrl:`${n}/webhooks`})}),s},Z=(r,i)=>{let{baseApiUrl:n,id:s}=i;if(!s&&!n)return r;let a=JSON.parse(JSON.stringify(r));return a.components.forEach(l=>{l.compType===o.TOPOLOGY&&(s&&(l.compId=s),n&&(l.compData.topology.topology.backendApiUrl=n))}),a};export{$ as a,z as b,Z as c};
4
- //# sourceMappingURL=chunk-QF5IXGT3.js.map
3
+ import{H as o,I as u,J as h,K as m,L as p,M as N,P as f,Q as E}from"./chunk-F4YTZ6XA.js";import{l as e}from"./chunk-MB65UVFQ.js";import{h as S}from"./chunk-V4TR6DCM.js";S();import C from"node:fs/promises";var g=e.object({errorReporting:e.object({url:e.string().optional(),artifact:e.object({fullArtifactId:e.string().max(255).min(1),version:e.string().max(255).min(1)}).optional()}).optional()}),d=e.object({iframeUrl:e.string().optional(),scriptAsset:e.object({exportedName:e.string(),containerId:e.string(),url:e.string(),scriptType:e.string().optional()}).optional()}),_=e.object({hostingPlatform:e.string(),fullPage:e.boolean().nullish(),hideInSidebar:e.boolean().nullish(),priority:e.number().nullish(),routePath:e.string().nullish(),title:e.string(),pageCategoryId:e.string().uuid().nullish(),activeSidebarPageId:e.string().nullish(),requiredPermission:e.string().nullish(),previousRoutePaths:e.array(e.string()).nullish()}).merge(g).merge(d).passthrough(),j=e.object({width:e.number().nullish(),height:e.number().nullish()}).merge(d).passthrough(),b=e.object({appId:e.string(),componentId:e.string().uuid(),spec:e.string().min(1),variantValue:e.string()}).passthrough().optional(),y=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_PAGE),compData:e.object({backOfficePage:_}),compName:e.string().optional(),experiment:b}).passthrough(),A=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION),compData:e.object({backOfficeExtension:e.object({hostingPlatform:e.string(),extends:e.string(),title:e.string().nullish(),extensionType:e.literal(N.BACK_OFFICE_EXTENSION_WIDGET),requiredPermission:e.string().nullish(),widget:j}).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),D=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_WIDGET),compData:e.object({backOfficeExtensionWidget:e.object({hostingPlatform:e.string(),extends:e.string(),title:e.string().nullish(),description:e.string().optional(),requiredPermission:e.string().nullish(),width:e.number().nullish(),height:e.number().nullish()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),v=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_MENU_ITEM),compData:e.object({backOfficeExtensionMenuItem:e.object({id:e.string().uuid(),title:e.string().min(1),subtitle:e.string().max(200).optional(),iconKey:e.string().min(3).max(50).optional(),extends:e.string().uuid(),action:e.object({navigateToPage:e.object({pageId:e.string().uuid(),relativeUrl:e.string().optional()}),openModal:e.object({componentId:e.string().uuid(),componentParams:e.record(e.string().min(1),e.string().min(1)).optional()})}).partial().superRefine((r,i)=>{!r.navigateToPage&&!r.openModal&&i.addIssue({code:e.ZodIssueCode.custom,message:"action must have either navigateToPage or openModal"})}),sentryDSN:e.string().optional(),requiredPermission:e.string().optional()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),k=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_MODAL),compData:e.object({backOfficeModal:e.object({hostingPlatform:e.string(),title:e.string().nullish(),requiredPermission:e.string().nullish(),width:e.number().nullish(),height:e.number().nullish()}).merge(d).merge(g).passthrough()}),compName:e.string().optional(),experiment:b}).passthrough(),P=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_SIDEBAR_CATEGORY),compData:e.object({backOfficeSidebarCategory:e.object({hostingPlatform:e.string(),title:e.string(),priority:e.number().nullish()})}),compName:e.string().optional()}).passthrough(),F=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_WIDGET),compName:e.string().optional()}).passthrough(),x=e.object({compId:e.string(),compType:e.literal(o.BACK_OFFICE_EXTENSION_CONTAINER),compName:e.string().optional()}).passthrough(),T=e.object({packageName:e.string().min(2).max(100),version:e.number().int().min(0)}),M=e.object({template:e.string(),name:e.string(),pages:e.enum([h.NONE_PAGES,h.ONCE,h.SPECIFIC_PAGES]),placement:e.enum([m.HEAD,m.BODY_START,m.BODY_END,m.NONE_PLACEMENT]),connectArticleUrl:e.string(),embedCategory:e.enum([p.UNKNOWN,p.FUNCTIONAL,p.ESSENTIAL,p.ANALYTICS,p.ADVERTISING]),loadOnce:e.boolean(),allowedForFreeSite:e.boolean(),dependencies:e.array(T)}),W=e.object({compId:e.string(),compType:e.literal(o.EMBEDDED_SCRIPT),compName:e.string().optional(),compData:e.object({embeddedScriptComponentData:M})}).passthrough(),U=e.object({base:e.object({id:e.string().optional(),name:e.string()}),installation:e.object({base:e.object({autoAdd:e.boolean().optional(),essential:e.boolean().optional(),maxInstances:e.number().optional()}).optional(),widget:e.object({default_preset:e.object({desktop_preset_id:e.string().optional(),tablet_preset_id:e.string().optional(),mobile_preset_id:e.string().optional()}).optional(),region:e.enum([u.BODY,u.FOOTER,u.HEADER])}).optional()}).optional(),widgetData:e.object({tagName:e.string(),scriptUrl:e.string(),scriptType:e.enum([f.NONE,f.COMMON_JS,f.ES_MODULE])}),behaviors:e.object({settings:e.object({settingsUrl:e.string()}).optional(),dashboard:e.object({dashboardPageComponentId:e.string()}).optional()}),size:e.object({width:e.object({allowStretch:e.boolean().optional(),defaultWidth:e.number().optional(),stretchByDefault:e.boolean().optional()}),height:e.object({defaultHeight:e.number(),heightMode:e.enum([E.AUTO,E.FIXED,E.UNKNOWN]).optional()})}),dependencies:e.array(T)}),w=e.object({compId:e.string(),compType:e.literal(o.CUSTOM_ELEMENT_WIDGET),compName:e.string().optional(),compData:e.object({customElementWidget:U})}).passthrough(),B=e.object({compId:e.string().uuid(),compType:e.literal(o.WEBHOOK),compName:e.string().optional(),compData:e.object({webhook:e.object({webhookSlug:e.string(),callbackUrl:e.string()})})}).passthrough(),R=e.object({compType:e.literal(o.TOPOLOGY),compId:e.string(),compName:e.string().optional(),compData:e.object({topology:e.object({topology:e.object({backendApiUrl:e.string().url()})})})}).passthrough(),K=e.object({appId:e.string(),components:e.array(e.discriminatedUnion("compType",[y,A,D,v,k,P,F,x,W,w,B,R]))});async function $(r){try{let i=await C.readFile(r,"utf-8");return K.parse(JSON.parse(i))}catch(i){let n=i instanceof Error?i.toString():JSON.stringify(i);throw new Error(`Failed to read App Manifest at ${r}: ${n}`)}}var I=(r,i)=>new URL(r,i).href,O=(r,i)=>{let{scriptAsset:n,iframeUrl:s}=r;return n?{scriptAsset:{...n,url:I(n.url,i)}}:s?{iframeUrl:I(s,i)}:r},L=(r,i)=>({template:r.template.replaceAll("__STATICS_BASE_URL_PLACEHOLDER__",i)}),z=(r,i,n)=>{let s=JSON.parse(JSON.stringify(r)),a=i.endsWith("/")?i:`${i}/`;return s.components.forEach(l=>{let{compData:t,compType:c}=l;c===o.BACK_OFFICE_PAGE&&(t.backOfficePage={...t.backOfficePage,...O(t.backOfficePage,a)}),c===o.BACK_OFFICE_EXTENSION&&(t.backOfficeExtension.widget={...t.backOfficeExtension.widget,...O(t.backOfficeExtension.widget,a)}),c===o.BACK_OFFICE_EXTENSION_WIDGET&&(t.backOfficeExtensionWidget={...t.backOfficeExtensionWidget,...O(t.backOfficeExtensionWidget,a)}),c===o.BACK_OFFICE_MODAL&&(t.backOfficeModal={...t.backOfficeModal,...O(t.backOfficeModal,a)}),c===o.EMBEDDED_SCRIPT&&(t.embeddedScriptComponentData={...t.embeddedScriptComponentData,...L(t.embeddedScriptComponentData,a)}),c===o.CUSTOM_ELEMENT_WIDGET&&(t.customElementWidget={...t.customElementWidget,widgetData:{...t.customElementWidget.widgetData,scriptUrl:I(t.customElementWidget.widgetData.scriptUrl,a)},behaviors:{...t.customElementWidget.behaviors,...t.customElementWidget.behaviors.settings?{settings:{settingsUrl:I(t.customElementWidget.behaviors.settings.settingsUrl,a)}}:{}}}),c===o.WEBHOOK&&n&&(t.webhook={...t.webhook,callbackUrl:`${n}/webhooks`})}),s},Z=(r,i)=>{let{baseApiUrl:n,id:s}=i;if(!s&&!n)return r;let a=JSON.parse(JSON.stringify(r));return a.components.forEach(l=>{l.compType===o.TOPOLOGY&&(s&&(l.compId=s),n&&(l.compData.topology.topology.backendApiUrl=n))}),a};export{$ as a,z as b,Z as c};
4
+ //# sourceMappingURL=chunk-F55KYUXJ.js.map
@@ -1,10 +1,10 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{Ca as Te,Da as Ce,Fa as Ot,Ja as Pt,a as ve,b as wt,c as bt,d as G,m as Et,u as vt}from"./chunk-KJMWKJXC.js";import{a as Vn,d as Oe,e as Pe,l as F,m as te}from"./chunk-DRRMAC33.js";import{a as x,c as _,e as ee,g as f,h as s}from"./chunk-V4TR6DCM.js";var $t=_((ba,jt)=>{"use strict";s();jt.exports=Nt;Nt.sync=Kn;var Rt=x("fs");function Xn(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Lt(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Xn(t,r)}function Nt(e,t,r){Rt.stat(e,function(n,o){r(n,n?!1:Lt(o,e,t))})}function Kn(e,t){return Lt(Rt.statSync(e),e,t)}});var Gt=_((va,Bt)=>{"use strict";s();Bt.exports=kt;kt.sync=Yn;var Dt=x("fs");function kt(e,t,r){Dt.stat(e,function(n,o){r(n,n?!1:Ut(o,t))})}function Yn(e,t){return Ut(Dt.statSync(e),t)}function Ut(e,t){return e.isFile()&&Zn(e,t)}function Zn(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),c=parseInt("100",8),l=parseInt("010",8),p=parseInt("001",8),u=c|l,h=r&p||r&l&&o===a||r&c&&n===i||r&u&&i===0;return h}});var Mt=_((Ta,Ft)=>{"use strict";s();var Pa=x("fs"),ne;process.platform==="win32"||global.TESTING_WINDOWS?ne=$t():ne=Gt();Ft.exports=Ie;Ie.sync=Qn;function Ie(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Ie(e,t||{},function(i,a){i?o(i):n(a)})})}ne(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Qn(e,t){try{return ne.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Xt=_((Ia,Jt)=>{"use strict";s();var j=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",qt=x("path"),eo=j?";":":",Vt=Mt(),zt=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Ht=(e,t)=>{let r=t.colon||eo,n=e.match(/\//)||j&&e.match(/\\/)?[""]:[...j?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=j?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=j?o.split(r):[""];return j&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Wt=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Ht(e,t),a=[],c=p=>new Promise((u,h)=>{if(p===n.length)return t.all&&a.length?u(a):h(zt(e));let m=n[p],g=/^".*"$/.test(m)?m.slice(1,-1):m,y=qt.join(g,e),b=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;u(l(b,p,0))}),l=(p,u,h)=>new Promise((m,g)=>{if(h===o.length)return m(c(u+1));let y=o[h];Vt(p+y,{pathExt:i},(b,E)=>{if(!b&&E)if(t.all)a.push(p+y);else return m(p+y);return m(l(p,u,h+1))})});return r?c(0).then(p=>r(null,p),r):c(0)},to=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Ht(e,t),i=[];for(let a=0;a<r.length;a++){let c=r[a],l=/^".*"$/.test(c)?c.slice(1,-1):c,p=qt.join(l,e),u=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;for(let h=0;h<n.length;h++){let m=u+n[h];try{if(Vt.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw zt(e)};Jt.exports=Wt;Wt.sync=to});var Yt=_((Ra,Ae)=>{"use strict";s();var Kt=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Ae.exports=Kt;Ae.exports.default=Kt});var tr=_((Na,er)=>{"use strict";s();var Zt=x("path"),ro=Xt(),no=Yt();function Qt(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let a;try{a=ro.sync(e.command,{path:r[no({env:r})],pathExt:t?Zt.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return a&&(a=Zt.resolve(o?e.options.cwd:"",a)),a}function oo(e){return Qt(e)||Qt(e,!0)}er.exports=oo});var rr=_(($a,Le)=>{"use strict";s();var Re=/([()\][%!^"`<>&|;, *?])/g;function io(e){return e=e.replace(Re,"^$1"),e}function so(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Re,"^$1"),t&&(e=e.replace(Re,"^$1")),e}Le.exports.command=io;Le.exports.argument=so});var or=_((ka,nr)=>{"use strict";s();nr.exports=/^#!(.*)/});var sr=_((Ba,ir)=>{"use strict";s();var ao=or();ir.exports=(e="")=>{let t=e.match(ao);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var cr=_((Fa,ar)=>{"use strict";s();var Ne=x("fs"),co=sr();function lo(e){let r=Buffer.alloc(150),n;try{n=Ne.openSync(e,"r"),Ne.readSync(n,r,0,150,0),Ne.closeSync(n)}catch{}return co(r.toString())}ar.exports=lo});var dr=_((qa,fr)=>{"use strict";s();var uo=x("path"),lr=tr(),ur=rr(),fo=cr(),po=process.platform==="win32",mo=/\.(?:com|exe)$/i,ho=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function go(e){e.file=lr(e);let t=e.file&&fo(e.file);return t?(e.args.unshift(e.file),e.command=t,lr(e)):e.file}function yo(e){if(!po)return e;let t=go(e),r=!mo.test(t);if(e.options.forceShell||r){let n=ho.test(t);e.command=uo.normalize(e.command),e.command=ur.command(e.command),e.args=e.args.map(i=>ur.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function _o(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:yo(n)}fr.exports=_o});var hr=_((za,mr)=>{"use strict";s();var je=process.platform==="win32";function $e(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function xo(e,t){if(!je)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=pr(o,t,"spawn");if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function pr(e,t){return je&&e===1&&!t.file?$e(t.original,"spawn"):null}function So(e,t){return je&&e===1&&!t.file?$e(t.original,"spawnSync"):null}mr.exports={hookChildProcess:xo,verifyENOENT:pr,verifyENOENTSync:So,notFoundError:$e}});var _r=_((Wa,$)=>{"use strict";s();var gr=x("child_process"),De=dr(),ke=hr();function yr(e,t,r){let n=De(e,t,r),o=gr.spawn(n.command,n.args,n.options);return ke.hookChildProcess(o,n),o}function wo(e,t,r){let n=De(e,t,r),o=gr.spawnSync(n.command,n.args,n.options);return o.error=o.error||ke.verifyENOENTSync(o.status,n),o}$.exports=yr;$.exports.spawn=yr;$.exports.sync=wo;$.exports._parse=De;$.exports._enoent=ke});var zr=_((xl,Vr)=>{"use strict";s();var{PassThrough:_i}=x("stream");Vr.exports=function(){var e=[],t=new _i({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(r),t;function r(i){return Array.isArray(i)?(i.forEach(r),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function n(){return e.length==0}function o(i){e=e.filter(function(a){return a!==i}),!e.length&&t.readable&&t.end()}}});var H=_((nu,dn)=>{"use strict";s();var Mi=Object.create,_e=Object.defineProperty,qi=Object.getOwnPropertyDescriptor,Vi=Object.getOwnPropertyNames,zi=Object.getPrototypeOf,Hi=Object.prototype.hasOwnProperty,Wi=(e,t)=>{for(var r in t)_e(e,r,{get:t[r],enumerable:!0})},cn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vi(t))!Hi.call(e,o)&&o!==r&&_e(e,o,{get:()=>t[o],enumerable:!(n=qi(t,o))||n.enumerable});return e},Ji=(e,t,r)=>(r=e!=null?Mi(zi(e)):{},cn(t||!e||!e.__esModule?_e(r,"default",{value:e,enumerable:!0}):r,e)),Xi=e=>cn(_e({},"__esModule",{value:!0}),e),ln={};Wi(ln,{CLOUDFLARED_VERSION:()=>Zi,DEFAULT_CLOUDFLARED_BIN:()=>un,RELEASE_BASE:()=>Qi,bin:()=>fn,use:()=>Yi});dn.exports=Xi(ln);var Ki=Ji(x("node:path")),un=Ki.default.join(f,"..","bin",process.platform==="win32"?"cloudflared.exe":"cloudflared"),fn=process.env.CLOUDFLARED_BIN||un;function Yi(e){fn=e}var Zi=process.env.CLOUDFLARED_VERSION||"latest",Qi="https://github.com/cloudflare/cloudflared/releases/"});var hn=_((iu,mn)=>{"use strict";s();var ct=Object.defineProperty,es=Object.getOwnPropertyDescriptor,ts=Object.getOwnPropertyNames,rs=Object.prototype.hasOwnProperty,ns=(e,t)=>{for(var r in t)ct(e,r,{get:t[r],enumerable:!0})},os=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ts(t))!rs.call(e,o)&&o!==r&&ct(e,o,{get:()=>t[o],enumerable:!(n=es(t,o))||n.enumerable});return e},is=e=>os(ct({},"__esModule",{value:!0}),e),pn={};ns(pn,{UnsupportedError:()=>at});mn.exports=is(pn);var at=class extends Error{constructor(t){super(t)}}});var bn=_((au,wn)=>{"use strict";s();var ss=Object.create,xe=Object.defineProperty,as=Object.getOwnPropertyDescriptor,cs=Object.getOwnPropertyNames,ls=Object.getPrototypeOf,us=Object.prototype.hasOwnProperty,fs=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})},gn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of cs(t))!us.call(e,o)&&o!==r&&xe(e,o,{get:()=>t[o],enumerable:!(n=as(t,o))||n.enumerable});return e},lt=(e,t,r)=>(r=e!=null?ss(ls(e)):{},gn(t||!e||!e.__esModule?xe(r,"default",{value:e,enumerable:!0}):r,e)),ds=e=>gn(xe({},"__esModule",{value:!0}),e),yn={};fs(yn,{install:()=>_s,install_linux:()=>_n,install_macos:()=>xn,install_windows:()=>Sn});wn.exports=ds(yn);var A=lt(x("node:fs")),W=lt(x("node:path")),ps=lt(x("node:https")),ms=x("node:child_process"),D=H(),Se=hn(),hs={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},gs={arm64:"cloudflared-darwin-amd64.tgz",x64:"cloudflared-darwin-amd64.tgz"},ys={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe"};function ut(e){return e==="latest"?`${D.RELEASE_BASE}latest/download/`:`${D.RELEASE_BASE}download/${e}/`}async function _s(e,t=D.CLOUDFLARED_VERSION){if(process.platform==="linux")return _n(e,t);if(process.platform==="darwin")return xn(e,t);if(process.platform==="win32")return Sn(e,t);throw new Se.UnsupportedError("Unsupported platform: "+process.platform)}async function _n(e,t=D.CLOUDFLARED_VERSION){let r=hs[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,e),A.default.chmodSync(e,"755"),e}async function xn(e,t=D.CLOUDFLARED_VERSION){let r=gs[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,`${e}.tgz`),process.env.VERBOSE&&console.log(`Extracting to ${e}`),(0,ms.execSync)(`tar -xzf ${W.default.basename(`${e}.tgz`)}`,{cwd:W.default.dirname(e)}),A.default.unlinkSync(`${e}.tgz`),A.default.renameSync(`${W.default.dirname(e)}/cloudflared`,e),e}async function Sn(e,t=D.CLOUDFLARED_VERSION){let r=ys[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,e),e}function we(e,t,r=0){return r===0?process.env.VERBOSE&&console.log(`Downloading ${e} to ${t}`):process.env.VERBOSE&&console.log(`Redirecting to ${e}`),A.default.existsSync(W.default.dirname(t))||A.default.mkdirSync(W.default.dirname(t),{recursive:!0}),new Promise((n,o)=>{let i=ps.default.get(e,a=>{if([301,302,303,307,308].includes(a.statusCode)&&a.headers.location!==void 0){i.destroy();let l=a.headers.location;n(we(l,t,r+1));return}if(a.statusCode&&a.statusCode>=200&&a.statusCode<300){let l=A.default.createWriteStream(t);l.on("finish",()=>{l.close(()=>n(t))}),l.on("error",p=>{A.default.unlink(t,()=>o(p))}),a.pipe(l)}else i.destroy(),o(new Error(`HTTP response with status code: ${a.statusCode}`))});i.on("error",a=>{o(a)}),i.end()})}});var dt=_((lu,vn)=>{"use strict";s();var ft=Object.defineProperty,xs=Object.getOwnPropertyDescriptor,Ss=Object.getOwnPropertyNames,ws=Object.prototype.hasOwnProperty,bs=(e,t)=>{for(var r in t)ft(e,r,{get:t[r],enumerable:!0})},Es=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ss(t))!ws.call(e,o)&&o!==r&&ft(e,o,{get:()=>t[o],enumerable:!(n=xs(t,o))||n.enumerable});return e},vs=e=>Es(ft({},"__esModule",{value:!0}),e),En={};bs(En,{config_regex:()=>Ns,conn_regex:()=>Os,connectorID_regex:()=>Rs,disconnect_regex:()=>Is,index_regex:()=>Cs,ip_regex:()=>Ps,location_regex:()=>Ts,metrics_regex:()=>Ls,tunnelID_regex:()=>As});vn.exports=vs(En);var Os=/connection[= ]([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Ps=/ip=([0-9.]+)/,Ts=/location=([A-Za-z0-9]+)/,Cs=/connIndex=(\d)/,Is=/Unregistered tunnel connection connIndex=(\d)/i,As=/tunnelID=([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Rs=/Connector ID: ([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Ls=/metrics server on ([0-9.:]+\/metrics)/,Ns=/config="(.+[^\\])"/});var Tn=_((fu,Pn)=>{"use strict";s();var pt=Object.defineProperty,js=Object.getOwnPropertyDescriptor,$s=Object.getOwnPropertyNames,Ds=Object.prototype.hasOwnProperty,ks=(e,t)=>{for(var r in t)pt(e,r,{get:t[r],enumerable:!0})},Us=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $s(t))!Ds.call(e,o)&&o!==r&&pt(e,o,{get:()=>t[o],enumerable:!(n=js(t,o))||n.enumerable});return e},Bs=e=>Us(pt({},"__esModule",{value:!0}),e),On={};ks(On,{tunnel:()=>Ms});Pn.exports=Bs(On);var Gs=x("node:child_process"),Fs=H(),be=dt();function Ms(e={}){let t=["tunnel"];for(let[m,g]of Object.entries(e))typeof g=="string"?t.push(`${m}`,g):typeof g=="number"?t.push(`${m}`,g.toString()):g===null&&t.push(`${m}`);t.length===1&&t.push("--url","localhost:8080");let r=(0,Gs.spawn)(Fs.bin,t,{stdio:["ignore","pipe","pipe"]});process.env.VERBOSE&&(r.stdout.pipe(process.stdout),r.stderr.pipe(process.stderr));let n=/\|\s+(https?:\/\/[^\s]+)/,o=()=>{},i=()=>{},a=new Promise((...m)=>[o,i]=m),c=[],l=[],p=[];for(let m=0;m<1;m++)p.push(new Promise((...g)=>[c[m],l[m]]=g));let u=m=>{var g;let y=m.toString(),b=y.match(n);b&&o(b[1]);let E=y.match(be.conn_regex),P=y.match(be.ip_regex),T=y.match(be.location_regex),C=y.match(be.index_regex);if(E&&P&&T&&C){let[,K]=E,[,Y]=P,[,Z]=T,[,Q]=C;(g=c[+Q])==null||g.call(c,{id:K,ip:Y,location:Z})}};return r.stdout.on("data",u).on("error",i),r.stderr.on("data",u).on("error",i),{url:a,connections:p,child:r,stop:()=>r.kill("SIGINT")}}});var Un=_((pu,kn)=>{"use strict";s();var qs=Object.create,Ee=Object.defineProperty,Vs=Object.getOwnPropertyDescriptor,zs=Object.getOwnPropertyNames,Hs=Object.getPrototypeOf,Ws=Object.prototype.hasOwnProperty,Js=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},Cn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zs(t))!Ws.call(e,o)&&o!==r&&Ee(e,o,{get:()=>t[o],enumerable:!(n=Vs(t,o))||n.enumerable});return e},In=(e,t,r)=>(r=e!=null?qs(Hs(e)):{},Cn(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),Xs=e=>Cn(Ee({},"__esModule",{value:!0}),e),An={};Js(An,{AlreadyInstalledError:()=>J,LINUX_SERVICE_PATH:()=>L,MACOS_SERVICE_PATH:()=>v,NotInstalledError:()=>N,clean:()=>Dn,current:()=>$n,err:()=>_t,exists:()=>O,identifier:()=>R,install:()=>Ln,journal:()=>xt,log:()=>jn,service:()=>Ks,service_name:()=>yt,uninstall:()=>Nn});kn.exports=Xs(An);var mt=In(x("node:os")),w=In(x("node:fs")),gt=x("node:child_process"),Rn=H(),S=dt(),R="com.cloudflare.cloudflared",yt="cloudflared.service",v={PLIST:ht()?`/Library/LaunchDaemons/${R}.plist`:`${mt.default.homedir()}/Library/LaunchAgents/${R}.plist`,OUT:ht()?`/Library/Logs/${R}.out.log`:`${mt.default.homedir()}/Library/Logs/${R}.out.log`,ERR:ht()?`/Library/Logs/${R}.err.log`:`${mt.default.homedir()}/Library/Logs/${R}.err.log`},L={SYSTEMD:`/etc/systemd/system/${yt}`,SERVICE:"/etc/init.d/cloudflared",SERVICE_OUT:"/var/log/cloudflared.log",SERVICE_ERR:"/var/log/cloudflared.err"},Ks={install:Ln,uninstall:Nn,exists:O,log:jn,err:_t,current:$n,clean:Dn,journal:xt},J=class extends Error{constructor(){super("service is already installed")}},N=class extends Error{constructor(){super("service is not installed")}};function Ln(e){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(O())throw new J;let t=["service","install"];e&&t.push(e);let r=(0,gt.spawnSync)(Rn.bin,t);if(r.status!==0)throw new Error(`service install failed: ${r.stderr.toString()}`)}function Nn(){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!O())throw new N;let e=(0,gt.spawnSync)(Rn.bin,["service","uninstall"]);if(e.status!==0)throw new Error(`service uninstall failed: ${e.stderr.toString()}`);process.platform==="darwin"?(w.default.rmSync(v.OUT),w.default.rmSync(v.ERR)):process.platform==="linux"&&!k()&&(w.default.rmSync(L.SERVICE_OUT),w.default.rmSync(L.SERVICE_ERR))}function jn(){if(!O())throw new N;if(process.platform==="darwin")return w.default.readFileSync(v.OUT,"utf8");if(process.platform==="linux"&&!k())return w.default.readFileSync(L.SERVICE_OUT,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function _t(){if(!O())throw new N;if(process.platform==="darwin")return w.default.readFileSync(v.ERR,"utf8");if(process.platform==="linux"&&!k())return w.default.readFileSync(L.SERVICE_ERR,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function xt(e=300){if(process.platform==="linux"&&k()){let t=["-u",yt,"-o","cat","-n",e.toString()];return(0,gt.spawnSync)("journalctl",t).stdout.toString()}throw new Error(`Not Implemented on platform ${process.platform}`)}function $n(){var e,t,r,n;if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!O())throw new N;let o=k()?xt():_t(),i="",a="",c=[],l="",p={};for(let u of o.split(`
3
+ import{Ca as Te,Da as Ce,Fa as Ot,Ja as Pt,a as ve,b as wt,c as bt,d as G,m as Et,u as vt}from"./chunk-F4YTZ6XA.js";import{a as Vn,d as Oe,e as Pe,l as F,m as te}from"./chunk-MB65UVFQ.js";import{a as x,c as _,e as ee,g as f,h as s}from"./chunk-V4TR6DCM.js";var $t=_((ba,jt)=>{"use strict";s();jt.exports=Nt;Nt.sync=Kn;var Rt=x("fs");function Xn(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Lt(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Xn(t,r)}function Nt(e,t,r){Rt.stat(e,function(n,o){r(n,n?!1:Lt(o,e,t))})}function Kn(e,t){return Lt(Rt.statSync(e),e,t)}});var Gt=_((va,Bt)=>{"use strict";s();Bt.exports=kt;kt.sync=Yn;var Dt=x("fs");function kt(e,t,r){Dt.stat(e,function(n,o){r(n,n?!1:Ut(o,t))})}function Yn(e,t){return Ut(Dt.statSync(e),t)}function Ut(e,t){return e.isFile()&&Zn(e,t)}function Zn(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),c=parseInt("100",8),l=parseInt("010",8),p=parseInt("001",8),u=c|l,h=r&p||r&l&&o===a||r&c&&n===i||r&u&&i===0;return h}});var Mt=_((Ta,Ft)=>{"use strict";s();var Pa=x("fs"),ne;process.platform==="win32"||global.TESTING_WINDOWS?ne=$t():ne=Gt();Ft.exports=Ie;Ie.sync=Qn;function Ie(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Ie(e,t||{},function(i,a){i?o(i):n(a)})})}ne(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Qn(e,t){try{return ne.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Xt=_((Ia,Jt)=>{"use strict";s();var j=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",qt=x("path"),eo=j?";":":",Vt=Mt(),zt=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Ht=(e,t)=>{let r=t.colon||eo,n=e.match(/\//)||j&&e.match(/\\/)?[""]:[...j?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=j?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=j?o.split(r):[""];return j&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Wt=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Ht(e,t),a=[],c=p=>new Promise((u,h)=>{if(p===n.length)return t.all&&a.length?u(a):h(zt(e));let m=n[p],g=/^".*"$/.test(m)?m.slice(1,-1):m,y=qt.join(g,e),b=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;u(l(b,p,0))}),l=(p,u,h)=>new Promise((m,g)=>{if(h===o.length)return m(c(u+1));let y=o[h];Vt(p+y,{pathExt:i},(b,E)=>{if(!b&&E)if(t.all)a.push(p+y);else return m(p+y);return m(l(p,u,h+1))})});return r?c(0).then(p=>r(null,p),r):c(0)},to=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Ht(e,t),i=[];for(let a=0;a<r.length;a++){let c=r[a],l=/^".*"$/.test(c)?c.slice(1,-1):c,p=qt.join(l,e),u=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;for(let h=0;h<n.length;h++){let m=u+n[h];try{if(Vt.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw zt(e)};Jt.exports=Wt;Wt.sync=to});var Yt=_((Ra,Ae)=>{"use strict";s();var Kt=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Ae.exports=Kt;Ae.exports.default=Kt});var tr=_((Na,er)=>{"use strict";s();var Zt=x("path"),ro=Xt(),no=Yt();function Qt(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let a;try{a=ro.sync(e.command,{path:r[no({env:r})],pathExt:t?Zt.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return a&&(a=Zt.resolve(o?e.options.cwd:"",a)),a}function oo(e){return Qt(e)||Qt(e,!0)}er.exports=oo});var rr=_(($a,Le)=>{"use strict";s();var Re=/([()\][%!^"`<>&|;, *?])/g;function io(e){return e=e.replace(Re,"^$1"),e}function so(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Re,"^$1"),t&&(e=e.replace(Re,"^$1")),e}Le.exports.command=io;Le.exports.argument=so});var or=_((ka,nr)=>{"use strict";s();nr.exports=/^#!(.*)/});var sr=_((Ba,ir)=>{"use strict";s();var ao=or();ir.exports=(e="")=>{let t=e.match(ao);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var cr=_((Fa,ar)=>{"use strict";s();var Ne=x("fs"),co=sr();function lo(e){let r=Buffer.alloc(150),n;try{n=Ne.openSync(e,"r"),Ne.readSync(n,r,0,150,0),Ne.closeSync(n)}catch{}return co(r.toString())}ar.exports=lo});var dr=_((qa,fr)=>{"use strict";s();var uo=x("path"),lr=tr(),ur=rr(),fo=cr(),po=process.platform==="win32",mo=/\.(?:com|exe)$/i,ho=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function go(e){e.file=lr(e);let t=e.file&&fo(e.file);return t?(e.args.unshift(e.file),e.command=t,lr(e)):e.file}function yo(e){if(!po)return e;let t=go(e),r=!mo.test(t);if(e.options.forceShell||r){let n=ho.test(t);e.command=uo.normalize(e.command),e.command=ur.command(e.command),e.args=e.args.map(i=>ur.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function _o(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:yo(n)}fr.exports=_o});var hr=_((za,mr)=>{"use strict";s();var je=process.platform==="win32";function $e(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function xo(e,t){if(!je)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=pr(o,t,"spawn");if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function pr(e,t){return je&&e===1&&!t.file?$e(t.original,"spawn"):null}function So(e,t){return je&&e===1&&!t.file?$e(t.original,"spawnSync"):null}mr.exports={hookChildProcess:xo,verifyENOENT:pr,verifyENOENTSync:So,notFoundError:$e}});var _r=_((Wa,$)=>{"use strict";s();var gr=x("child_process"),De=dr(),ke=hr();function yr(e,t,r){let n=De(e,t,r),o=gr.spawn(n.command,n.args,n.options);return ke.hookChildProcess(o,n),o}function wo(e,t,r){let n=De(e,t,r),o=gr.spawnSync(n.command,n.args,n.options);return o.error=o.error||ke.verifyENOENTSync(o.status,n),o}$.exports=yr;$.exports.spawn=yr;$.exports.sync=wo;$.exports._parse=De;$.exports._enoent=ke});var zr=_((xl,Vr)=>{"use strict";s();var{PassThrough:_i}=x("stream");Vr.exports=function(){var e=[],t=new _i({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(r),t;function r(i){return Array.isArray(i)?(i.forEach(r),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function n(){return e.length==0}function o(i){e=e.filter(function(a){return a!==i}),!e.length&&t.readable&&t.end()}}});var H=_((nu,dn)=>{"use strict";s();var Mi=Object.create,_e=Object.defineProperty,qi=Object.getOwnPropertyDescriptor,Vi=Object.getOwnPropertyNames,zi=Object.getPrototypeOf,Hi=Object.prototype.hasOwnProperty,Wi=(e,t)=>{for(var r in t)_e(e,r,{get:t[r],enumerable:!0})},cn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vi(t))!Hi.call(e,o)&&o!==r&&_e(e,o,{get:()=>t[o],enumerable:!(n=qi(t,o))||n.enumerable});return e},Ji=(e,t,r)=>(r=e!=null?Mi(zi(e)):{},cn(t||!e||!e.__esModule?_e(r,"default",{value:e,enumerable:!0}):r,e)),Xi=e=>cn(_e({},"__esModule",{value:!0}),e),ln={};Wi(ln,{CLOUDFLARED_VERSION:()=>Zi,DEFAULT_CLOUDFLARED_BIN:()=>un,RELEASE_BASE:()=>Qi,bin:()=>fn,use:()=>Yi});dn.exports=Xi(ln);var Ki=Ji(x("node:path")),un=Ki.default.join(f,"..","bin",process.platform==="win32"?"cloudflared.exe":"cloudflared"),fn=process.env.CLOUDFLARED_BIN||un;function Yi(e){fn=e}var Zi=process.env.CLOUDFLARED_VERSION||"latest",Qi="https://github.com/cloudflare/cloudflared/releases/"});var hn=_((iu,mn)=>{"use strict";s();var ct=Object.defineProperty,es=Object.getOwnPropertyDescriptor,ts=Object.getOwnPropertyNames,rs=Object.prototype.hasOwnProperty,ns=(e,t)=>{for(var r in t)ct(e,r,{get:t[r],enumerable:!0})},os=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ts(t))!rs.call(e,o)&&o!==r&&ct(e,o,{get:()=>t[o],enumerable:!(n=es(t,o))||n.enumerable});return e},is=e=>os(ct({},"__esModule",{value:!0}),e),pn={};ns(pn,{UnsupportedError:()=>at});mn.exports=is(pn);var at=class extends Error{constructor(t){super(t)}}});var bn=_((au,wn)=>{"use strict";s();var ss=Object.create,xe=Object.defineProperty,as=Object.getOwnPropertyDescriptor,cs=Object.getOwnPropertyNames,ls=Object.getPrototypeOf,us=Object.prototype.hasOwnProperty,fs=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})},gn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of cs(t))!us.call(e,o)&&o!==r&&xe(e,o,{get:()=>t[o],enumerable:!(n=as(t,o))||n.enumerable});return e},lt=(e,t,r)=>(r=e!=null?ss(ls(e)):{},gn(t||!e||!e.__esModule?xe(r,"default",{value:e,enumerable:!0}):r,e)),ds=e=>gn(xe({},"__esModule",{value:!0}),e),yn={};fs(yn,{install:()=>_s,install_linux:()=>_n,install_macos:()=>xn,install_windows:()=>Sn});wn.exports=ds(yn);var A=lt(x("node:fs")),W=lt(x("node:path")),ps=lt(x("node:https")),ms=x("node:child_process"),D=H(),Se=hn(),hs={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},gs={arm64:"cloudflared-darwin-amd64.tgz",x64:"cloudflared-darwin-amd64.tgz"},ys={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe"};function ut(e){return e==="latest"?`${D.RELEASE_BASE}latest/download/`:`${D.RELEASE_BASE}download/${e}/`}async function _s(e,t=D.CLOUDFLARED_VERSION){if(process.platform==="linux")return _n(e,t);if(process.platform==="darwin")return xn(e,t);if(process.platform==="win32")return Sn(e,t);throw new Se.UnsupportedError("Unsupported platform: "+process.platform)}async function _n(e,t=D.CLOUDFLARED_VERSION){let r=hs[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,e),A.default.chmodSync(e,"755"),e}async function xn(e,t=D.CLOUDFLARED_VERSION){let r=gs[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,`${e}.tgz`),process.env.VERBOSE&&console.log(`Extracting to ${e}`),(0,ms.execSync)(`tar -xzf ${W.default.basename(`${e}.tgz`)}`,{cwd:W.default.dirname(e)}),A.default.unlinkSync(`${e}.tgz`),A.default.renameSync(`${W.default.dirname(e)}/cloudflared`,e),e}async function Sn(e,t=D.CLOUDFLARED_VERSION){let r=ys[process.arch];if(r===void 0)throw new Se.UnsupportedError("Unsupported architecture: "+process.arch);return await we(ut(t)+r,e),e}function we(e,t,r=0){return r===0?process.env.VERBOSE&&console.log(`Downloading ${e} to ${t}`):process.env.VERBOSE&&console.log(`Redirecting to ${e}`),A.default.existsSync(W.default.dirname(t))||A.default.mkdirSync(W.default.dirname(t),{recursive:!0}),new Promise((n,o)=>{let i=ps.default.get(e,a=>{if([301,302,303,307,308].includes(a.statusCode)&&a.headers.location!==void 0){i.destroy();let l=a.headers.location;n(we(l,t,r+1));return}if(a.statusCode&&a.statusCode>=200&&a.statusCode<300){let l=A.default.createWriteStream(t);l.on("finish",()=>{l.close(()=>n(t))}),l.on("error",p=>{A.default.unlink(t,()=>o(p))}),a.pipe(l)}else i.destroy(),o(new Error(`HTTP response with status code: ${a.statusCode}`))});i.on("error",a=>{o(a)}),i.end()})}});var dt=_((lu,vn)=>{"use strict";s();var ft=Object.defineProperty,xs=Object.getOwnPropertyDescriptor,Ss=Object.getOwnPropertyNames,ws=Object.prototype.hasOwnProperty,bs=(e,t)=>{for(var r in t)ft(e,r,{get:t[r],enumerable:!0})},Es=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ss(t))!ws.call(e,o)&&o!==r&&ft(e,o,{get:()=>t[o],enumerable:!(n=xs(t,o))||n.enumerable});return e},vs=e=>Es(ft({},"__esModule",{value:!0}),e),En={};bs(En,{config_regex:()=>Ns,conn_regex:()=>Os,connectorID_regex:()=>Rs,disconnect_regex:()=>Is,index_regex:()=>Cs,ip_regex:()=>Ps,location_regex:()=>Ts,metrics_regex:()=>Ls,tunnelID_regex:()=>As});vn.exports=vs(En);var Os=/connection[= ]([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Ps=/ip=([0-9.]+)/,Ts=/location=([A-Za-z0-9]+)/,Cs=/connIndex=(\d)/,Is=/Unregistered tunnel connection connIndex=(\d)/i,As=/tunnelID=([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Rs=/Connector ID: ([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i,Ls=/metrics server on ([0-9.:]+\/metrics)/,Ns=/config="(.+[^\\])"/});var Tn=_((fu,Pn)=>{"use strict";s();var pt=Object.defineProperty,js=Object.getOwnPropertyDescriptor,$s=Object.getOwnPropertyNames,Ds=Object.prototype.hasOwnProperty,ks=(e,t)=>{for(var r in t)pt(e,r,{get:t[r],enumerable:!0})},Us=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $s(t))!Ds.call(e,o)&&o!==r&&pt(e,o,{get:()=>t[o],enumerable:!(n=js(t,o))||n.enumerable});return e},Bs=e=>Us(pt({},"__esModule",{value:!0}),e),On={};ks(On,{tunnel:()=>Ms});Pn.exports=Bs(On);var Gs=x("node:child_process"),Fs=H(),be=dt();function Ms(e={}){let t=["tunnel"];for(let[m,g]of Object.entries(e))typeof g=="string"?t.push(`${m}`,g):typeof g=="number"?t.push(`${m}`,g.toString()):g===null&&t.push(`${m}`);t.length===1&&t.push("--url","localhost:8080");let r=(0,Gs.spawn)(Fs.bin,t,{stdio:["ignore","pipe","pipe"]});process.env.VERBOSE&&(r.stdout.pipe(process.stdout),r.stderr.pipe(process.stderr));let n=/\|\s+(https?:\/\/[^\s]+)/,o=()=>{},i=()=>{},a=new Promise((...m)=>[o,i]=m),c=[],l=[],p=[];for(let m=0;m<1;m++)p.push(new Promise((...g)=>[c[m],l[m]]=g));let u=m=>{var g;let y=m.toString(),b=y.match(n);b&&o(b[1]);let E=y.match(be.conn_regex),P=y.match(be.ip_regex),T=y.match(be.location_regex),C=y.match(be.index_regex);if(E&&P&&T&&C){let[,K]=E,[,Y]=P,[,Z]=T,[,Q]=C;(g=c[+Q])==null||g.call(c,{id:K,ip:Y,location:Z})}};return r.stdout.on("data",u).on("error",i),r.stderr.on("data",u).on("error",i),{url:a,connections:p,child:r,stop:()=>r.kill("SIGINT")}}});var Un=_((pu,kn)=>{"use strict";s();var qs=Object.create,Ee=Object.defineProperty,Vs=Object.getOwnPropertyDescriptor,zs=Object.getOwnPropertyNames,Hs=Object.getPrototypeOf,Ws=Object.prototype.hasOwnProperty,Js=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},Cn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zs(t))!Ws.call(e,o)&&o!==r&&Ee(e,o,{get:()=>t[o],enumerable:!(n=Vs(t,o))||n.enumerable});return e},In=(e,t,r)=>(r=e!=null?qs(Hs(e)):{},Cn(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),Xs=e=>Cn(Ee({},"__esModule",{value:!0}),e),An={};Js(An,{AlreadyInstalledError:()=>J,LINUX_SERVICE_PATH:()=>L,MACOS_SERVICE_PATH:()=>v,NotInstalledError:()=>N,clean:()=>Dn,current:()=>$n,err:()=>_t,exists:()=>O,identifier:()=>R,install:()=>Ln,journal:()=>xt,log:()=>jn,service:()=>Ks,service_name:()=>yt,uninstall:()=>Nn});kn.exports=Xs(An);var mt=In(x("node:os")),w=In(x("node:fs")),gt=x("node:child_process"),Rn=H(),S=dt(),R="com.cloudflare.cloudflared",yt="cloudflared.service",v={PLIST:ht()?`/Library/LaunchDaemons/${R}.plist`:`${mt.default.homedir()}/Library/LaunchAgents/${R}.plist`,OUT:ht()?`/Library/Logs/${R}.out.log`:`${mt.default.homedir()}/Library/Logs/${R}.out.log`,ERR:ht()?`/Library/Logs/${R}.err.log`:`${mt.default.homedir()}/Library/Logs/${R}.err.log`},L={SYSTEMD:`/etc/systemd/system/${yt}`,SERVICE:"/etc/init.d/cloudflared",SERVICE_OUT:"/var/log/cloudflared.log",SERVICE_ERR:"/var/log/cloudflared.err"},Ks={install:Ln,uninstall:Nn,exists:O,log:jn,err:_t,current:$n,clean:Dn,journal:xt},J=class extends Error{constructor(){super("service is already installed")}},N=class extends Error{constructor(){super("service is not installed")}};function Ln(e){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(O())throw new J;let t=["service","install"];e&&t.push(e);let r=(0,gt.spawnSync)(Rn.bin,t);if(r.status!==0)throw new Error(`service install failed: ${r.stderr.toString()}`)}function Nn(){if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!O())throw new N;let e=(0,gt.spawnSync)(Rn.bin,["service","uninstall"]);if(e.status!==0)throw new Error(`service uninstall failed: ${e.stderr.toString()}`);process.platform==="darwin"?(w.default.rmSync(v.OUT),w.default.rmSync(v.ERR)):process.platform==="linux"&&!k()&&(w.default.rmSync(L.SERVICE_OUT),w.default.rmSync(L.SERVICE_ERR))}function jn(){if(!O())throw new N;if(process.platform==="darwin")return w.default.readFileSync(v.OUT,"utf8");if(process.platform==="linux"&&!k())return w.default.readFileSync(L.SERVICE_OUT,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function _t(){if(!O())throw new N;if(process.platform==="darwin")return w.default.readFileSync(v.ERR,"utf8");if(process.platform==="linux"&&!k())return w.default.readFileSync(L.SERVICE_ERR,"utf8");throw new Error(`Not Implemented on platform ${process.platform}`)}function xt(e=300){if(process.platform==="linux"&&k()){let t=["-u",yt,"-o","cat","-n",e.toString()];return(0,gt.spawnSync)("journalctl",t).stdout.toString()}throw new Error(`Not Implemented on platform ${process.platform}`)}function $n(){var e,t,r,n;if(!["darwin","linux"].includes(process.platform))throw new Error(`Not Implemented on platform ${process.platform}`);if(!O())throw new N;let o=k()?xt():_t(),i="",a="",c=[],l="",p={};for(let u of o.split(`
4
4
  `))try{if(u.match(S.tunnelID_regex))i=((e=u.match(S.tunnelID_regex))==null?void 0:e[1])??"";else if(u.match(S.connectorID_regex))a=((t=u.match(S.connectorID_regex))==null?void 0:t[1])??"";else if(u.match(S.conn_regex)&&u.match(S.location_regex)&&u.match(S.ip_regex)&&u.match(S.index_regex)){let[,h]=u.match(S.conn_regex)??[],[,m]=u.match(S.location_regex)??[],[,g]=u.match(S.ip_regex)??[],[,y]=u.match(S.index_regex)??[];c[parseInt(y)]={id:h,ip:g,location:m}}else if(u.match(S.disconnect_regex)){let[,h]=u.match(S.disconnect_regex)??[];parseInt(h)in c&&(c[parseInt(h)]={id:"",ip:"",location:""})}else u.match(S.metrics_regex)?l=((r=u.match(S.metrics_regex))==null?void 0:r[1])??"":u.match(S.config_regex)&&(p=JSON.parse(((n=u.match(S.config_regex))==null?void 0:n[1].replace(/\\/g,""))??"{}"))}catch(h){process.env.VERBOSE&&console.error("log parsing failed",h)}return{tunnelID:i,connectorID:a,connections:c,metrics:l,config:p}}function Dn(){if(process.platform!=="darwin")throw new Error(`Not Implemented on platform ${process.platform}`);if(O())throw new J;w.default.rmSync(v.OUT,{force:!0}),w.default.rmSync(v.ERR,{force:!0})}function O(){if(process.platform==="darwin")return w.default.existsSync(v.PLIST);if(process.platform==="linux")return k()?w.default.existsSync(L.SYSTEMD):w.default.existsSync(L.SERVICE);throw new Error(`Not Implemented on platform ${process.platform}`)}function ht(){var e;return((e=process.getuid)==null?void 0:e.call(process))===0}function k(){return process.platform==="linux"&&w.default.existsSync("/run/systemd/system")}});var Fn=_((hu,Gn)=>{"use strict";s();var St=Object.defineProperty,Ys=Object.getOwnPropertyDescriptor,Zs=Object.getOwnPropertyNames,Qs=Object.prototype.hasOwnProperty,ea=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:!0})},ta=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zs(t))!Qs.call(e,o)&&o!==r&&St(e,o,{get:()=>t[o],enumerable:!(n=Ys(t,o))||n.enumerable});return e},ra=e=>ta(St({},"__esModule",{value:!0}),e),Bn={};ea(Bn,{AlreadyInstalledError:()=>X.AlreadyInstalledError,MACOS_SERVICE_PATH:()=>X.MACOS_SERVICE_PATH,NotInstalledError:()=>X.NotInstalledError,bin:()=>na.bin,identifier:()=>X.identifier,install:()=>oa.install,service:()=>X.service,tunnel:()=>ia.tunnel});Gn.exports=ra(Bn);var na=H(),oa=bn(),ia=Tn(),X=Un()});s();var B=ee(Vn(),1);s();s();var zn={},Hn={},Wn={},Jn={};function Tt(e){var t={"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 wt(Object.assign(e,{domainToMappings:t}))}function Ct(e){var t=G(zn,{}),r=t.toJSON,n=t.fromJSON,o=G(Hn,{}).fromJSON;function i(a){var c=a.host,l=r(e),p={entityFqdn:"wix.apps.hosting.v1.deployment",method:"POST",methodFqn:"wix.apps.hosting.v1.BackendService.CreateTunnel",url:Tt({protoPath:"/v1/tunnel",data:l,host:c}),data:l,transformResponse:o};return p}return i.fromReq=n,i.__isAmbassador=!0,i}function It(e){var t=G(Wn,{}),r=t.toJSON,n=t.fromJSON,o=G(Jn,{}).fromJSON;function i(a){var c=a.host,l=r(e),p={entityFqdn:"wix.apps.hosting.v1.deployment",method:"DELETE",methodFqn:"wix.apps.hosting.v1.BackendService.DeleteTunnel",url:Tt({protoPath:"/v1/tunnel",data:l,host:c}),params:bt(l),transformResponse:o};return p}return i.fromReq=n,i.__isAmbassador=!0,i}s();var At=F.object({id:F.string(),token:F.string(),domain:F.string()});var re=class{constructor(t){this.httpClient=t;let{minRetryTimeout:r}=te();this.retryOptions={retries:3,minTimeout:r,maxTimeout:3*1e3}}retryOptions;createTunnel=async({port:t})=>{try{let{data:r}=await ve(()=>this.httpClient.request(Ct({port:t})),this.retryOptions);return At.parse(r)}catch(r){throw new Oe({code:Pe.FailedToCreateTunnel(),cause:r})}};deleteTunnel=async t=>{try{await ve(()=>this.httpClient.request(It({id:t})),this.retryOptions)}catch(r){throw new Oe({code:Pe.FailedToDeleteTunnel(),cause:r})}}};s();s();var on=ee(_r(),1);import{Buffer as Di}from"node:buffer";import ki from"node:path";import st from"node:child_process";import ge from"node:process";s();function Ue(e){let t=typeof e=="string"?`
5
5
  `:10,r=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e}s();import ie from"node:process";import M from"node:path";import bo from"node:url";s();function oe(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}function Eo(e={}){let{cwd:t=ie.cwd(),path:r=ie.env[oe()],execPath:n=ie.execPath}=e,o,i=t instanceof URL?bo.fileURLToPath(t):t,a=M.resolve(i),c=[];for(;o!==a;)c.push(M.join(a,"node_modules/.bin")),o=a,a=M.resolve(a,"..");return c.push(M.resolve(i,n,"..")),[...c,r].join(M.delimiter)}function xr({env:e=ie.env,...t}={}){e={...e};let r=oe({env:e});return t.path=e[r],e[r]=Eo(t),e}s();s();var vo=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let o=Object.getOwnPropertyDescriptor(e,r),i=Object.getOwnPropertyDescriptor(t,r);!Oo(o,i)&&n||Object.defineProperty(e,r,i)},Oo=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Po=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},To=(e,t)=>`/* Wrapped ${e}*/
6
6
  ${t}`,Co=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Io=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ao=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=To.bind(null,n,t.toString());Object.defineProperty(o,"name",Io),Object.defineProperty(e,"toString",{...Co,value:o})};function Be(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let o of Reflect.ownKeys(t))vo(e,t,o,r);return Po(e,t),Ao(e,t,n),e}var se=new WeakMap,Sr=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,o=e.displayName||e.name||"<anonymous>",i=function(...a){if(se.set(i,++n),n===1)r=e.apply(this,a),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return r};return Be(i,e),se.set(i,n),i};Sr.callCount=e=>{if(!se.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return se.get(e)};var wr=Sr;s();import Go from"node:process";s();import{constants as jo}from"node:os";s();var br=()=>{let e=vr-Er+1;return Array.from({length:e},Ro)},Ro=(e,t)=>({name:`SIGRT${t+1}`,number:Er+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Er=34,vr=64;s();import{constants as Lo}from"node:os";s();var Or=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Ge=()=>{let e=br();return[...Or,...e].map(No)},No=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{let{signals:{[e]:a}}=Lo,c=a!==void 0;return{name:e,number:c?a:t,description:r,supported:c,action:n,forced:o,standard:i}};var $o=()=>{let e=Ge();return Object.fromEntries(e.map(Do))},Do=({name:e,number:t,description:r,supported:n,action:o,forced:i,standard:a})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:i,standard:a}],Pr=$o(),ko=()=>{let e=Ge(),t=65,r=Array.from({length:t},(n,o)=>Uo(o,e));return Object.assign({},...r)},Uo=(e,t)=>{let r=Bo(e,t);if(r===void 0)return{};let{name:n,description:o,supported:i,action:a,forced:c,standard:l}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:a,forced:c,standard:l}}},Bo=(e,t)=>{let r=t.find(({name:n})=>jo.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},wc=ko();var Fo=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:o,exitCode:i,isCanceled:a})=>e?`timed out after ${t} milliseconds`:a?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${o})`:i!==void 0?`failed with exit code ${i}`:"failed",q=({stdout:e,stderr:t,all:r,error:n,signal:o,exitCode:i,command:a,escapedCommand:c,timedOut:l,isCanceled:p,killed:u,parsed:{options:{timeout:h,cwd:m=Go.cwd()}}})=>{i=i===null?void 0:i,o=o===null?void 0:o;let g=o===void 0?void 0:Pr[o].description,y=n&&n.code,E=`Command ${Fo({timedOut:l,timeout:h,errorCode:y,signal:o,signalDescription:g,exitCode:i,isCanceled:p})}: ${a}`,P=Object.prototype.toString.call(n)==="[object Error]",T=P?`${E}
7
7
  ${n.message}`:E,C=[T,t,e].filter(Boolean).join(`
8
8
  `);return P?(n.originalMessage=n.message,n.message=C):n=new Error(C),n.shortMessage=T,n.command=a,n.escapedCommand=c,n.exitCode=i,n.signal=o,n.signalDescription=g,n.stdout=e,n.stderr=t,n.cwd=m,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=p,n.killed=u&&!l,n};s();var ae=["stdin","stdout","stderr"],Mo=e=>ae.some(t=>e[t]!==void 0),Tr=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return ae.map(n=>e[n]);if(Mo(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ae.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,ae.length);return Array.from({length:r},(n,o)=>t[o])};s();import zo from"node:os";s();s();var I=[];I.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&I.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&I.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var ce=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Fe=Symbol.for("signal-exit emitter"),Me=globalThis,qo=Object.defineProperty.bind(Object),qe=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Me[Fe])return Me[Fe];qo(Me,Fe,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},le=class{},Vo=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ve=class extends le{onExit(){return()=>{}}load(){}unload(){}},ze=class extends le{#s=He.platform==="win32"?"SIGINT":"SIGHUP";#t=new qe;#e;#o;#i;#n={};#r=!1;constructor(t){super(),this.#e=t,this.#n={};for(let r of I)this.#n[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#t,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let a=this.#t.emit("exit",null,r),c=r==="SIGHUP"?this.#s:r;a||t.kill(t.pid,c)}};this.#i=t.reallyExit,this.#o=t.emit}onExit(t,r){if(!ce(this.#e))return()=>{};this.#r===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#t.on(n,t),()=>{this.#t.removeListener(n,t),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#r){this.#r=!0,this.#t.count+=1;for(let t of I)try{let r=this.#n[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#r&&(this.#r=!1,I.forEach(t=>{let r=this.#n[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#i,this.#t.count-=1)}#a(t){return ce(this.#e)?(this.#e.exitCode=t||0,this.#t.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#o;if(t==="exit"&&ce(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#t.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},He=globalThis.process,{onExit:Cr,load:Nc,unload:jc}=Vo(ce(He)?new ze(He):new Ve);var Ho=1e3*5,Ir=(e,t="SIGTERM",r={})=>{let n=e(t);return Wo(e,t,r,n),n},Wo=(e,t,r,n)=>{if(!Jo(t,r,n))return;let o=Ko(r),i=setTimeout(()=>{e("SIGKILL")},o);i.unref&&i.unref()},Jo=(e,{forceKillAfterTimeout:t},r)=>Xo(e)&&t!==!1&&r,Xo=e=>e===zo.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Ko=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Ho;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Ar=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Yo=(e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Rr=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let o,i=new Promise((c,l)=>{o=setTimeout(()=>{Yo(e,r,l)},t)}),a=n.finally(()=>{clearTimeout(o)});return Promise.race([i,a])},Lr=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Nr=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let o=Cr(()=>{e.kill()});return n.finally(()=>{o()})};s();import{createWriteStream as Zo}from"node:fs";import{ChildProcess as Qo}from"node:child_process";var ei=e=>e instanceof Qo&&typeof e.then=="function",We=(e,t,r)=>{if(typeof r=="string")return e[t].pipe(Zo(r)),e;if(Ce(r))return e[t].pipe(r),e;if(!ei(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Ce(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r},jr=e=>{e.stdout!==null&&(e.pipeStdout=We.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=We.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=We.bind(void 0,e,"all"))};s();import{createReadStream as xi,readFileSync as Si}from"node:fs";import{setTimeout as wi}from"node:timers/promises";s();s();s();var V=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:a,finalize:c},{maxBuffer:l=Number.POSITIVE_INFINITY}={})=>{if(!ri(e))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");let p=t();p.length=0;try{for await(let u of e){let h=ni(u),m=r[h](u,p);kr({convertedChunk:m,state:p,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:l})}return ti({state:p,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:a,maxBuffer:l}),c(p)}catch(u){throw u.bufferedData=c(p),u}},ti=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{let a=o(e);a!==void 0&&kr({convertedChunk:a,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},kr=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{let a=r(e),c=t.length+a;if(c<=i){$r(e,t,o,c);return}let l=n(e,i-t.length);throw l!==void 0&&$r(l,t,o,i),new ue},$r=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},ri=e=>typeof e=="object"&&e!==null&&typeof e[Symbol.asyncIterator]=="function",ni=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=Dr.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Dr.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Dr}=Object.prototype,ue=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};s();var Je=e=>e,Xe=()=>{},Ke=({contents:e})=>e,fe=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},de=e=>e.length;s();async function Ye(e,t){return V(e,di,t)}var oi=()=>({contents:new ArrayBuffer(0)}),ii=e=>si.encode(e),si=new TextEncoder,Ur=e=>new Uint8Array(e),Br=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ai=(e,t)=>e.slice(0,t),ci=(e,{contents:t,length:r},n)=>{let o=Mr()?ui(t,n):li(t,n);return new Uint8Array(o).set(e,r),o},li=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(Fr(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},ui=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:Fr(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},Fr=e=>Gr**Math.ceil(Math.log(e)/Math.log(Gr)),Gr=2,fi=({contents:e,length:t})=>Mr()?e:e.slice(0,t),Mr=()=>"resize"in ArrayBuffer.prototype,di={init:oi,convertChunk:{string:ii,buffer:Ur,arrayBuffer:Ur,dataView:Br,typedArray:Br,others:fe},getSize:de,truncateChunk:ai,addChunk:ci,getFinalChunk:Xe,finalize:fi};s();async function pe(e,t){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return qr(await Ye(e,t))}catch(r){throw r.bufferedData!==void 0&&(r.bufferedData=qr(r.bufferedData)),r}}var qr=e=>globalThis.Buffer.from(e);s();async function Ze(e,t){return V(e,yi,t)}var pi=()=>({contents:"",textDecoder:new TextDecoder}),me=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),mi=(e,{contents:t})=>t+e,hi=(e,t)=>e.slice(0,t),gi=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},yi={init:pi,convertChunk:{string:Je,buffer:me,arrayBuffer:me,dataView:me,typedArray:me,others:fe},getSize:de,truncateChunk:hi,addChunk:mi,getFinalChunk:gi,finalize:Ke};var Hr=ee(zr(),1),Wr=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},bi=({input:e,inputFile:t})=>typeof t!="string"?e:(Wr(e),Si(t)),Jr=e=>{let t=bi(e);if(Te(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},Ei=({input:e,inputFile:t})=>typeof t!="string"?e:(Wr(e),xi(t)),Xr=(e,t)=>{let r=Ei(t);r!==void 0&&(Te(r)?r.pipe(e.stdin):e.stdin.end(r))},Kr=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=(0,Hr.default)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},Qe=async(e,t)=>{if(!(!e||t===void 0)){await wi(0),e.destroy();try{return await t}catch(r){return r.bufferedData}}},et=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!(!e||!r))return t==="utf8"||t==="utf-8"?Ze(e,{maxBuffer:n}):t===null||t==="buffer"?pe(e,{maxBuffer:n}):vi(e,n,t)},vi=async(e,t,r)=>(await pe(e,{maxBuffer:t})).toString(r),Yr=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:o,maxBuffer:i},a)=>{let c=et(e,{encoding:n,buffer:o,maxBuffer:i}),l=et(t,{encoding:n,buffer:o,maxBuffer:i}),p=et(r,{encoding:n,buffer:o,maxBuffer:i*2});try{return await Promise.all([a,c,l,p])}catch(u){return Promise.all([{error:u,signal:u.signal,timedOut:u.timedOut},Qe(e,c),Qe(t,l),Qe(r,p)])}};s();var Oi=(async()=>{})().constructor.prototype,Pi=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Oi,e)]),tt=(e,t)=>{for(let[r,n]of Pi){let o=typeof t=="function"?(...i)=>Reflect.apply(n.value,t(),i):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}},Zr=e=>new Promise((t,r)=>{e.on("exit",(n,o)=>{t({exitCode:n,signal:o})}),e.on("error",n=>{r(n)}),e.stdin&&e.stdin.on("error",n=>{r(n)})});s();import{Buffer as Ti}from"node:buffer";import{ChildProcess as Ci}from"node:child_process";var tn=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Ii=/^[\w.-]+$/,Ai=e=>typeof e!="string"||Ii.test(e)?e:`"${e.replaceAll('"','\\"')}"`,rt=(e,t)=>tn(e,t).join(" "),nt=(e,t)=>tn(e,t).map(r=>Ai(r)).join(" "),Ri=/ +/g;var Qr=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(t==="object"&&e!==null&&!(e instanceof Ci)&&"stdout"in e){let r=typeof e.stdout;if(r==="string")return e.stdout;if(Ti.isBuffer(e.stdout))return e.stdout.toString();throw new TypeError(`Unexpected "${r}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)},en=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Li=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{let i=o??e.raw[n],a=i.split(Ri).filter(Boolean),c=en(r,a,i.startsWith(" "));if(n===t.length)return c;let l=t[n],p=Array.isArray(l)?l.map(u=>Qr(u)):[Qr(l)];return en(c,p,i.endsWith(" "))},ot=(e,t)=>{let r=[];for(let[n,o]of e.entries())r=Li({templates:e,expressions:t,tokens:r,index:n,template:o});return r};s();import{debuglog as Ni}from"node:util";import ji from"node:process";var rn=Ni("execa").enabled,he=(e,t)=>String(e).padStart(t,"0"),$i=()=>{let e=new Date;return`${he(e.getHours(),2)}:${he(e.getMinutes(),2)}:${he(e.getSeconds(),2)}.${he(e.getMilliseconds(),3)}`},it=(e,{verbose:t})=>{t&&ji.stderr.write(`[${$i()}] ${e}
9
9
  `)};var Ui=1e3*1e3*100,Bi=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:o})=>{let i=t?{...ge.env,...e}:e;return r?xr({env:i,cwd:n,execPath:o}):i},sn=(e,t,r={})=>{let n=on.default._parse(e,t,r);return e=n.command,t=n.args,r=n.options,r={maxBuffer:Ui,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||ge.cwd(),execPath:ge.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:rn,...r},r.env=Bi(r),r.stdio=Tr(r),ge.platform==="win32"&&ki.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},z=(e,t,r)=>typeof t!="string"&&!Di.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?Ue(t):t;function ye(e,t,r){let n=sn(e,t,r),o=rt(e,t),i=nt(e,t);it(i,n.options),Lr(n.options);let a;try{a=st.spawn(n.file,n.args,n.options)}catch(g){let y=new st.ChildProcess,b=Promise.reject(q({error:g,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return tt(y,b),y}let c=Zr(a),l=Rr(a,n.options,c),p=Nr(a,n.options,l),u={isCanceled:!1};a.kill=Ir.bind(null,a.kill.bind(a)),a.cancel=Ar.bind(null,a,u);let m=wr(async()=>{let[{error:g,exitCode:y,signal:b,timedOut:E},P,T,C]=await Yr(a,n.options,p),K=z(n.options,P),Y=z(n.options,T),Z=z(n.options,C);if(g||y!==0||b!==null){let Q=q({error:g,exitCode:y,signal:b,stdout:K,stderr:Y,all:Z,command:o,escapedCommand:i,parsed:n,timedOut:E,isCanceled:u.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:a.killed});if(!n.options.reject)return Q;throw Q}return{command:o,escapedCommand:i,exitCode:0,stdout:K,stderr:Y,all:Z,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Xr(a,n.options),a.all=Kr(a,n.options),jr(a),tt(a,m),a}function Gi(e,t,r){let n=sn(e,t,r),o=rt(e,t),i=nt(e,t);it(i,n.options);let a=Jr(n.options),c;try{c=st.spawnSync(n.file,n.args,{...n.options,input:a})}catch(u){throw q({error:u,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let l=z(n.options,c.stdout,c.error),p=z(n.options,c.stderr,c.error);if(c.error||c.status!==0||c.signal!==null){let u=q({stdout:l,stderr:p,error:c.error,signal:c.signal,exitCode:c.status,command:o,escapedCommand:i,parsed:n,timedOut:c.error&&c.error.code==="ETIMEDOUT",isCanceled:!1,killed:c.signal!==null});if(!n.options.reject)return u;throw u}return{command:o,escapedCommand:i,exitCode:0,stdout:l,stderr:p,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var Fi=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},nn=(e={})=>({preferLocal:!0,...Fi(e),...e});function an(e){function t(r,...n){if(!Array.isArray(r))return an({...e,...r});let[o,...i]=ot(r,n);return ye(o,i,nn(e))}return t.sync=(r,...n)=>{if(!Array.isArray(r))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[o,...i]=ot(r,n);return Gi(o,i,nn(e))},t}var eu=an();var U=ee(Fn(),1);async function Mn(e,t){let{localTunnel:r}=te();!r&&!await Et(U.bin)&&await(0,U.install)(U.bin);let n=await t.createTunnel({port:e}),o=`http${r?"":"s"}://${n.domain}`,i=new Promise((a,c)=>{let l=r?ye("echo",[n.domain,n.token],{detached:!0}):ye(U.bin,["tunnel","run","--token",n.token]),p=()=>{l.kill()},u=async h=>{h.toString().match(n.domain)?.[0]&&a({domain:o,close:p})};l.stderr?.on("data",u),l.stdout?.on("data",u),l.on("error",h=>{c(h)})});return{domain:o,close:async()=>(await i).close()}}s();var qn=e=>({tunnel:()=>{let t=Date.now();return{finish:({isSuccess:r,failureReason:n})=>e.report(Pt({isSuccess:r,failureReason:n,tunnelCreationTime:Date.now()-t}))}}});function sa(){let e=(0,B.useRef)(),t=Ot({type:"backoffice"}),r=vt();return(0,B.useEffect)(()=>()=>{e.current?.close()},[]),(0,B.useCallback)(async n=>{let o=new re(t),a=qn(r).tunnel();try{let c=await Mn(n,o);return e.current=c,a.finish({isSuccess:!0}),{url:c.domain}}catch(c){throw a.finish({isSuccess:!1,failureReason:c instanceof Error?c.message:"Unknown error"}),c}},[t,r])}s();export{sa as a};
10
- //# sourceMappingURL=chunk-2P6DNBHW.js.map
10
+ //# sourceMappingURL=chunk-FBYP5GID.js.map
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{D as P,H as p,I as B,J as M,N as g,O as A,P as I,Q as w,Ta as O,Va as U,da as T,la as N,ma as h,na as f,oa as x,qa as k}from"./chunk-KJMWKJXC.js";import{b as y,d as u,e as c}from"./chunk-DRRMAC33.js";import{e as E,h as l}from"./chunk-V4TR6DCM.js";l();var C=E(y(),1);import{randomUUID as V}from"node:crypto";var _=t=>{let r=new Map;[...t.filter(i=>!(0,C.isType)(i,h.Api)&&!(0,C.isType)(i,h.Event)&&!(0,C.isType)(i,h.ServicePlugin))].sort((i,d)=>i.id.localeCompare(d.id)).forEach(i=>{let d=r.get(i.id)??[];d.push(i),r.set(i.id,d)});let e=new Map;if(r.forEach((i,d)=>{i.length>1&&e.set(d,i)}),e.size)throw new u({code:c.DuplicateComponentIdsError({issues:Array.from(e.entries()).map(([i,d])=>({id:i,components:d.map(n=>(0,C.match)(n,{DashboardPage:({title:s,relativePath:m})=>({name:s,type:"page",path:f(m,"json")}),DashboardPlugin:({title:s,relativePath:m})=>({name:s,type:"plugin",path:f(m,"json")}),DashboardMenuPlugin:({title:s,relativePath:m})=>({name:s,type:"menu-plugin",path:m}),DashboardModal:({title:s,relativePath:m})=>({name:s,type:"modal",path:f(m,"json")}),DashboardSidebarCategory:({label:s})=>({name:s,type:"sidebar-category",path:P}),EmbeddedScript:({relativePath:s})=>({name:s,type:"embedded-script",path:f(s,"json")}),CustomElement:({name:s,relativePath:m})=>({name:s,type:"custom-element",path:f(m,"json")}),Topology:({name:s})=>({name:s,type:"topology",path:""})})).sort((n,s)=>n.name.localeCompare(s.name)),suggestedId:V()}))})})};l();var R=E(y(),1);import{randomUUID as G}from"node:crypto";function L(t){return t!=null&&t!==!1}var H=(t,r)=>{if(t.experiments)return{appId:r,componentId:t.id,spec:t.experiments.enabledBy,variantValue:"true"}},K=t=>({compId:t.id,compType:p.CUSTOM_ELEMENT_WIDGET,compName:t.name,compData:{customElementWidget:{base:{name:t.name},widgetData:{tagName:t.tagName,scriptType:I.ES_MODULE,scriptUrl:"https://dummy.web.com"},size:{width:{defaultWidth:t.width.defaultWidth,allowStretch:t.width.allowStretch,stretchByDefault:t.width.stretchByDefault},height:{defaultHeight:t.height.defaultHeight,heightMode:w.FIXED}},installation:{base:{autoAdd:t.installation?.autoAddToSite,essential:t.installation?.essential,maxInstances:t.installation?.essential?1:0},widget:{region:B.BODY}},behaviors:{},dependencies:t.dependencies}}});async function pe({appId:t,components:r,sentryDSN:a,componentSourceBuilder:o}){return _(r),{appId:t,components:(await Promise.all(r.map((0,R.match)({DashboardPage:async e=>{let i=e.sentryDSN??a;return{compId:e.id,compType:p.BACK_OFFICE_PAGE,compData:{backOfficePage:{hostingPlatform:g.BUSINESS_MANAGER,fullPage:e.sidebar?.whenActive?.hideSidebar,hideInSidebar:e.sidebar?.disabled,priority:e.sidebar?.priority,routePath:e.route.slice(1),title:e.title,pageCategoryId:e.sidebar?.categoryId,activeSidebarPageId:e.sidebar?.whenActive?.selectedPageId,requiredPermission:e.requiredPermission,previousRoutePaths:e.additionalRoutes,...i?{errorReporting:{url:i}}:void 0,...await o(e)}},compName:e.title,experiment:H(e,t)}},DashboardPlugin:async e=>({compId:e.id,compType:p.BACK_OFFICE_EXTENSION_WIDGET,compData:{backOfficeExtensionWidget:{hostingPlatform:g.BUSINESS_MANAGER,extends:e.extends,title:e.title,requiredPermission:e.requiredPermission,width:e.width,height:e.height,...await o(e),...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardMenuPlugin:async e=>({compId:e.id,compType:p.BACK_OFFICE_EXTENSION_MENU_ITEM,compData:{backOfficeExtensionMenuItem:{hostingPlatform:g.BUSINESS_MANAGER,id:e.id,title:e.title,subtitle:e.subtitle,iconKey:e.iconKey,extends:e.extends,action:e.action,requiredPermission:e.requiredPermission,...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardModal:async e=>({compId:e.id,compType:p.BACK_OFFICE_MODAL,compData:{backOfficeModal:{hostingPlatform:g.BUSINESS_MANAGER,title:e.title,requiredPermission:e.requiredPermission,width:e.width,height:e.height,...await o(e),...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardSidebarCategory:async e=>({compId:e.id,compType:p.BACK_OFFICE_SIDEBAR_CATEGORY,compData:{backOfficeSidebarCategory:{hostingPlatform:g.BUSINESS_MANAGER,title:e.label,priority:e.priority}},compName:e.label}),EmbeddedScript:async e=>({compId:e.id,compType:p.EMBEDDED_SCRIPT,compName:e.name,compData:{embeddedScriptComponentData:{name:e.name,pages:M.NONE_PAGES,placement:e.placement,connectArticleUrl:"",embedCategory:e.scriptType,dependencies:e.dependencies,loadOnce:!0,allowedForFreeSite:!0,...await o(e)}}}),CustomElement:async e=>{let{scriptUrl:i,settingsUrl:d}=await o(e),n=K(e);return{...n,compData:{customElementWidget:{...n.compData.customElementWidget,widgetData:{...n.compData.customElementWidget.widgetData,scriptUrl:i},behaviors:{...n.compData.customElementWidget.behaviors,...e.relativePanelPath?{settings:{settingsUrl:d}}:{}}}}}},Topology:async e=>({compId:e.id,compType:p.TOPOLOGY,compName:e.name,compData:{topology:{topology:{backendApiUrl:e.backendApiUrl}}}}),Api:()=>null,Event:async e=>(await o(e)).map(({webhookSlug:d})=>({compName:d,compId:G(),compType:p.WEBHOOK,compData:{webhook:{callbackUrl:"__WEBHOOKS_URL_PLACEHOLDER__",webhookSlug:d}}})),ServicePlugin:()=>null})))).filter(L).flat()}}l();var W=E(y(),1);import{join as q}from"node:path";l();function F(t){if(!("output"in t||Array.isArray(t)))throw new u({code:c.InvalidViteBuildOutput()});return Array.isArray(t)?t.flatMap(o=>o.output):t.output}function v(t,r){let o=F(t).find(e=>e.type==="chunk"&&e.facadeModuleId===r);if(!o)throw new u({code:c.ViteModuleBundleNotFound()});return o.fileName}function j(t,r){let o=F(t).find(e=>e.fileName===r);if(!o||!("source"in o))throw new u({code:c.ViteFileNotFoundInOutput({fileName:r})});return o.source.toString()}async function $(t,r){let a=new URL(t.relativePath,r).href;return await fetch(a).then(e=>e.text())}async function X(t,r){let a=new URL("__get-registered-events",r).href,o=await fetch(a);return o.ok?(await o.json())[`/${t.relativePath}`]??[]:[]}async function Y(t,r){let a=T(r.projectFolder),o=q(a,"getRegisteredEvents.mjs"),{getRegisteredEvents:e}=await import(o);return(await e())[`/${t.relativePath}`]}var b=(t,r,a)=>{if(!r.config.trusted)return{iframeUrl:x(t.id)};let o=k(t.id),e=a?v(a,o):`/@id/${o}?import`;return{scriptAsset:{exportedName:t.id,containerId:r.config.appId,url:e,scriptType:A.MODULE}}},z=async(t,r,a)=>({template:r?j(r,t.relativePath):await $(t,a)}),J=async(t,r,a,o)=>{let e=a?await Y(t,r):await X(t,o);return(e?await Promise.all(e.map(N)):[]).map(d=>({webhookSlug:d}))},Q=(t,r)=>{let a=U(t.id);return{scriptUrl:r?v(r,a):`/@id/${a}?import`,settingsUrl:O(t.id)}};function ve({model:t,clientBuildOutput:r,backendBuildOutput:a,clientDevServerUrl:o,backendDevServerUrl:e}){return async i=>(0,W.match)(i,{EmbeddedScript:n=>z(n,r,o),DashboardSidebarCategory:()=>{},CustomElement:n=>Q(n,r),DashboardPage:n=>b(n,t,r),DashboardPlugin:n=>b(n,t,r),DashboardModal:n=>b(n,t,r),DashboardMenuPlugin:()=>{},Topology:()=>{},Api:()=>{},Event:n=>J(n,t,a,e),ServicePlugin:()=>{}})}export{_ as a,K as b,pe as c,ve as d};
4
- //# sourceMappingURL=chunk-CAFL5PGF.js.map
3
+ import{D as P,H as p,I as B,J as M,N as g,O as A,P as I,Q as w,Ta as O,Va as U,da as T,la as N,ma as h,na as f,oa as x,qa as k}from"./chunk-F4YTZ6XA.js";import{b as y,d as u,e as c}from"./chunk-MB65UVFQ.js";import{e as E,h as l}from"./chunk-V4TR6DCM.js";l();var C=E(y(),1);import{randomUUID as V}from"node:crypto";var _=t=>{let r=new Map;[...t.filter(i=>!(0,C.isType)(i,h.Api)&&!(0,C.isType)(i,h.Event)&&!(0,C.isType)(i,h.ServicePlugin))].sort((i,d)=>i.id.localeCompare(d.id)).forEach(i=>{let d=r.get(i.id)??[];d.push(i),r.set(i.id,d)});let e=new Map;if(r.forEach((i,d)=>{i.length>1&&e.set(d,i)}),e.size)throw new u({code:c.DuplicateComponentIdsError({issues:Array.from(e.entries()).map(([i,d])=>({id:i,components:d.map(n=>(0,C.match)(n,{DashboardPage:({title:s,relativePath:m})=>({name:s,type:"page",path:f(m,"json")}),DashboardPlugin:({title:s,relativePath:m})=>({name:s,type:"plugin",path:f(m,"json")}),DashboardMenuPlugin:({title:s,relativePath:m})=>({name:s,type:"menu-plugin",path:m}),DashboardModal:({title:s,relativePath:m})=>({name:s,type:"modal",path:f(m,"json")}),DashboardSidebarCategory:({label:s})=>({name:s,type:"sidebar-category",path:P}),EmbeddedScript:({relativePath:s})=>({name:s,type:"embedded-script",path:f(s,"json")}),CustomElement:({name:s,relativePath:m})=>({name:s,type:"custom-element",path:f(m,"json")}),Topology:({name:s})=>({name:s,type:"topology",path:""})})).sort((n,s)=>n.name.localeCompare(s.name)),suggestedId:V()}))})})};l();var R=E(y(),1);import{randomUUID as G}from"node:crypto";function L(t){return t!=null&&t!==!1}var H=(t,r)=>{if(t.experiments)return{appId:r,componentId:t.id,spec:t.experiments.enabledBy,variantValue:"true"}},K=t=>({compId:t.id,compType:p.CUSTOM_ELEMENT_WIDGET,compName:t.name,compData:{customElementWidget:{base:{name:t.name},widgetData:{tagName:t.tagName,scriptType:I.ES_MODULE,scriptUrl:"https://dummy.web.com"},size:{width:{defaultWidth:t.width.defaultWidth,allowStretch:t.width.allowStretch,stretchByDefault:t.width.stretchByDefault},height:{defaultHeight:t.height.defaultHeight,heightMode:w.FIXED}},installation:{base:{autoAdd:t.installation?.autoAddToSite,essential:t.installation?.essential,maxInstances:t.installation?.essential?1:0},widget:{region:B.BODY}},behaviors:{},dependencies:t.dependencies}}});async function pe({appId:t,components:r,sentryDSN:a,componentSourceBuilder:o}){return _(r),{appId:t,components:(await Promise.all(r.map((0,R.match)({DashboardPage:async e=>{let i=e.sentryDSN??a;return{compId:e.id,compType:p.BACK_OFFICE_PAGE,compData:{backOfficePage:{hostingPlatform:g.BUSINESS_MANAGER,fullPage:e.sidebar?.whenActive?.hideSidebar,hideInSidebar:e.sidebar?.disabled,priority:e.sidebar?.priority,routePath:e.route.slice(1),title:e.title,pageCategoryId:e.sidebar?.categoryId,activeSidebarPageId:e.sidebar?.whenActive?.selectedPageId,requiredPermission:e.requiredPermission,previousRoutePaths:e.additionalRoutes,...i?{errorReporting:{url:i}}:void 0,...await o(e)}},compName:e.title,experiment:H(e,t)}},DashboardPlugin:async e=>({compId:e.id,compType:p.BACK_OFFICE_EXTENSION_WIDGET,compData:{backOfficeExtensionWidget:{hostingPlatform:g.BUSINESS_MANAGER,extends:e.extends,title:e.title,requiredPermission:e.requiredPermission,width:e.width,height:e.height,...await o(e),...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardMenuPlugin:async e=>({compId:e.id,compType:p.BACK_OFFICE_EXTENSION_MENU_ITEM,compData:{backOfficeExtensionMenuItem:{hostingPlatform:g.BUSINESS_MANAGER,id:e.id,title:e.title,subtitle:e.subtitle,iconKey:e.iconKey,extends:e.extends,action:e.action,requiredPermission:e.requiredPermission,...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardModal:async e=>({compId:e.id,compType:p.BACK_OFFICE_MODAL,compData:{backOfficeModal:{hostingPlatform:g.BUSINESS_MANAGER,title:e.title,requiredPermission:e.requiredPermission,width:e.width,height:e.height,...await o(e),...e.sentryDSN?{errorReporting:{url:e.sentryDSN}}:void 0}},compName:e.title}),DashboardSidebarCategory:async e=>({compId:e.id,compType:p.BACK_OFFICE_SIDEBAR_CATEGORY,compData:{backOfficeSidebarCategory:{hostingPlatform:g.BUSINESS_MANAGER,title:e.label,priority:e.priority}},compName:e.label}),EmbeddedScript:async e=>({compId:e.id,compType:p.EMBEDDED_SCRIPT,compName:e.name,compData:{embeddedScriptComponentData:{name:e.name,pages:M.NONE_PAGES,placement:e.placement,connectArticleUrl:"",embedCategory:e.scriptType,dependencies:e.dependencies,loadOnce:!0,allowedForFreeSite:!0,...await o(e)}}}),CustomElement:async e=>{let{scriptUrl:i,settingsUrl:d}=await o(e),n=K(e);return{...n,compData:{customElementWidget:{...n.compData.customElementWidget,widgetData:{...n.compData.customElementWidget.widgetData,scriptUrl:i},behaviors:{...n.compData.customElementWidget.behaviors,...e.relativePanelPath?{settings:{settingsUrl:d}}:{}}}}}},Topology:async e=>({compId:e.id,compType:p.TOPOLOGY,compName:e.name,compData:{topology:{topology:{backendApiUrl:e.backendApiUrl}}}}),Api:()=>null,Event:async e=>(await o(e)).map(({webhookSlug:d})=>({compName:d,compId:G(),compType:p.WEBHOOK,compData:{webhook:{callbackUrl:"__WEBHOOKS_URL_PLACEHOLDER__",webhookSlug:d}}})),ServicePlugin:()=>null})))).filter(L).flat()}}l();var W=E(y(),1);import{join as q}from"node:path";l();function F(t){if(!("output"in t||Array.isArray(t)))throw new u({code:c.InvalidViteBuildOutput()});return Array.isArray(t)?t.flatMap(o=>o.output):t.output}function v(t,r){let o=F(t).find(e=>e.type==="chunk"&&e.facadeModuleId===r);if(!o)throw new u({code:c.ViteModuleBundleNotFound()});return o.fileName}function j(t,r){let o=F(t).find(e=>e.fileName===r);if(!o||!("source"in o))throw new u({code:c.ViteFileNotFoundInOutput({fileName:r})});return o.source.toString()}async function $(t,r){let a=new URL(t.relativePath,r).href;return await fetch(a).then(e=>e.text())}async function X(t,r){let a=new URL("__get-registered-events",r).href,o=await fetch(a);return o.ok?(await o.json())[`/${t.relativePath}`]??[]:[]}async function Y(t,r){let a=T(r.projectFolder),o=q(a,"getRegisteredEvents.mjs"),{getRegisteredEvents:e}=await import(o);return(await e())[`/${t.relativePath}`]}var b=(t,r,a)=>{if(!r.config.trusted)return{iframeUrl:x(t.id)};let o=k(t.id),e=a?v(a,o):`/@id/${o}?import`;return{scriptAsset:{exportedName:t.id,containerId:r.config.appId,url:e,scriptType:A.MODULE}}},z=async(t,r,a)=>({template:r?j(r,t.relativePath):await $(t,a)}),J=async(t,r,a,o)=>{let e=a?await Y(t,r):await X(t,o);return(e?await Promise.all(e.map(N)):[]).map(d=>({webhookSlug:d}))},Q=(t,r)=>{let a=U(t.id);return{scriptUrl:r?v(r,a):`/@id/${a}?import`,settingsUrl:O(t.id)}};function ve({model:t,clientBuildOutput:r,backendBuildOutput:a,clientDevServerUrl:o,backendDevServerUrl:e}){return async i=>(0,W.match)(i,{EmbeddedScript:n=>z(n,r,o),DashboardSidebarCategory:()=>{},CustomElement:n=>Q(n,r),DashboardPage:n=>b(n,t,r),DashboardPlugin:n=>b(n,t,r),DashboardModal:n=>b(n,t,r),DashboardMenuPlugin:()=>{},Topology:()=>{},Api:()=>{},Event:n=>J(n,t,a,e),ServicePlugin:()=>{}})}export{_ as a,K as b,pe as c,ve as d};
4
+ //# sourceMappingURL=chunk-HTO6ALNX.js.map
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{v as f,w as m}from"./chunk-KJMWKJXC.js";import{f as l,g as d,v as U}from"./chunk-DRRMAC33.js";import{e as O,h as o}from"./chunk-V4TR6DCM.js";o();import{randomUUID as k}from"node:crypto";function L(r,t){r.updateDefaults(N(t))}function N(r){return r?{_client_id:r,_uuid:r,logged_user_id:r,logged_account_id:r,target_account_id:r}:{_client_id:k()}}o();import{uptime as h}from"node:process";o();var u=O(U(),1);import V from"node:os";import{platform as b,version as B}from"node:process";function w({cliVersion:r,flow:t}){return{...t?{flow:t}:{},cliVersion:r,isCI:u.default,nodeVersion:B,osName:F(),osVersion:V.release()}}function F(){switch(b){case"darwin":return"mac";case"win32":return"windows";default:return"linux"}}var x=()=>Math.round(h()*1e3);function j({biLogger:r,command:t,flow:y,cliVersion:E,projectId:p,extensions:n}){let S=t.opts(),C=t.args,_=new Set(["apiKey"]),c=Object.fromEntries(Object.entries(S).map(([e,s])=>{let v=_.has(e)?"<censored>":s;return[e,v]})),i={command:t.name(),arguments:C.join(","),flags:Object.keys(c).length?JSON.stringify(c):""};return r.report(f({...w({cliVersion:E,flow:y}),...i,...p?{projectId:p}:{},isValid:!0})),{succeed(){r.report(m({...i,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!0,isValid:!0}))},failed(e){let s=l(e)?{errorType:d(e)?"SystemError":"UserError",errorName:e.name,errorMessage:e.message}:e instanceof Error?{errorType:"UnknownError",errorName:e.name,errorMessage:e.message}:{errorType:"UnknownError",errorMessage:JSON.stringify(e)};r.report(m({...i,...s,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!1,isValid:!0}))}}}o();export{L as a,j as b};
4
- //# sourceMappingURL=chunk-AA74H3TG.js.map
3
+ import{v as f,w as m}from"./chunk-F4YTZ6XA.js";import{f as l,g as d,v as U}from"./chunk-MB65UVFQ.js";import{e as O,h as o}from"./chunk-V4TR6DCM.js";o();import{randomUUID as k}from"node:crypto";function L(r,t){r.updateDefaults(N(t))}function N(r){return r?{_client_id:r,_uuid:r,logged_user_id:r,logged_account_id:r,target_account_id:r}:{_client_id:k()}}o();import{uptime as h}from"node:process";o();var u=O(U(),1);import V from"node:os";import{platform as b,version as B}from"node:process";function w({cliVersion:r,flow:t}){return{...t?{flow:t}:{},cliVersion:r,isCI:u.default,nodeVersion:B,osName:F(),osVersion:V.release()}}function F(){switch(b){case"darwin":return"mac";case"win32":return"windows";default:return"linux"}}var x=()=>Math.round(h()*1e3);function j({biLogger:r,command:t,flow:y,cliVersion:E,projectId:p,extensions:n}){let S=t.opts(),C=t.args,_=new Set(["apiKey"]),c=Object.fromEntries(Object.entries(S).map(([e,s])=>{let v=_.has(e)?"<censored>":s;return[e,v]})),i={command:t.name(),arguments:C.join(","),flags:Object.keys(c).length?JSON.stringify(c):""};return r.report(f({...w({cliVersion:E,flow:y}),...i,...p?{projectId:p}:{},isValid:!0})),{succeed(){r.report(m({...i,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!0,isValid:!0}))},failed(e){let s=l(e)?{errorType:d(e)?"SystemError":"UserError",errorName:e.name,errorMessage:e.message}:e instanceof Error?{errorType:"UnknownError",errorName:e.name,errorMessage:e.message}:{errorType:"UnknownError",errorMessage:JSON.stringify(e)};r.report(m({...i,...s,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!1,isValid:!0}))}}}o();export{L as a,j as b};
4
+ //# sourceMappingURL=chunk-HTY6QIPX.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-KJMWKJXC.js";import{a as b,c as a}from"./chunk-DRRMAC33.js";import{e as s,h as n}from"./chunk-V4TR6DCM.js";n();var r=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 f=s(x(),1),l=s(a(),1);function u(e){if(f.HttpClient.isHttpError(e))return e;let o=e instanceof Error?l.default.cause(e):null;return o?u(o):null}n();function d(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 y(e,o){try{let t=`----- CLI crash report at ${new Date().toISOString()}
3
+ import{e as x}from"./chunk-F4YTZ6XA.js";import{a as b,c as a}from"./chunk-MB65UVFQ.js";import{e as s,h as n}from"./chunk-V4TR6DCM.js";n();var r=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 f=s(x(),1),l=s(a(),1);function u(e){if(f.HttpClient.isHttpError(e))return e;let o=e instanceof Error?l.default.cause(e):null;return o?u(o):null}n();function d(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 y(e,o){try{let t=`----- CLI crash report at ${new Date().toISOString()}
4
4
  `;if(o instanceof Error){t+=`Error Trace
5
5
  `,t+=`${c.default.fullStack(o)}
6
6
  `,t+=`Error Info
@@ -8,4 +8,4 @@ import{e as x}from"./chunk-KJMWKJXC.js";import{a as b,c as a}from"./chunk-DRRMAC
8
8
  `;let i=u(o);i&&(t+=`Request Info
9
9
  `,t+=`${JSON.stringify(d(i),null,2)}
10
10
  `)}w(L(e),{recursive:!0}),D(e,t)}catch{}}var m=(0,r.createContext)(null),k=({filePath:e,children:o})=>{let t=(0,r.useCallback)(i=>y(e,i),[e]);return r.default.createElement(m.Provider,{value:t},o)},R=()=>{let e=(0,r.useContext)(m);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-NIFVIO6B.js.map
11
+ //# sourceMappingURL=chunk-JAY5356K.js.map
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{Ka as e,u as r}from"./chunk-KJMWKJXC.js";import{a as m}from"./chunk-DRRMAC33.js";import{e as t,h as i}from"./chunk-V4TR6DCM.js";i();var p=t(m(),1);function f(){let o=r();return(0,p.useMemo)(()=>e(o),[o])}i();export{f as a};
4
- //# sourceMappingURL=chunk-BQUJNTD3.js.map
3
+ import{Ka as e,u as r}from"./chunk-F4YTZ6XA.js";import{a as m}from"./chunk-MB65UVFQ.js";import{e as t,h as i}from"./chunk-V4TR6DCM.js";i();var p=t(m(),1);function f(){let o=r();return(0,p.useMemo)(()=>e(o),[o])}i();export{f as a};
4
+ //# sourceMappingURL=chunk-JKG4PFVP.js.map