@engenty/wizards-runtime 0.11.6 → 0.11.7

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 (111) hide show
  1. package/apps/runtime/dist/agents/architect.js +37 -53
  2. package/apps/runtime/dist/agents/company.js +4 -12
  3. package/apps/runtime/dist/agents/studio-assistant.js +57 -70
  4. package/apps/runtime/dist/agents/subscription.js +3 -6
  5. package/apps/runtime/dist/assistant/knows.js +19 -19
  6. package/apps/runtime/dist/auth/account.js +51 -12
  7. package/apps/runtime/dist/authoring/guide.js +20 -447
  8. package/apps/runtime/dist/browser/fast/run.js +18 -12
  9. package/apps/runtime/dist/cli/account.js +127 -10
  10. package/apps/runtime/dist/cli/main.js +4 -2
  11. package/apps/runtime/dist/connectors/mail.js +4 -3
  12. package/apps/runtime/dist/documents/parse.js +5 -14
  13. package/apps/runtime/dist/engine/decide.js +2 -1
  14. package/apps/runtime/dist/engine/runner.js +4 -3
  15. package/apps/runtime/dist/engine/steps.js +82 -91
  16. package/apps/runtime/dist/engine/template.js +2 -3
  17. package/apps/runtime/dist/harness/antigravity.js +2 -2
  18. package/apps/runtime/dist/harness/apple.js +4 -6
  19. package/apps/runtime/dist/harness/codex.js +5 -6
  20. package/apps/runtime/dist/harness/prompt.js +8 -8
  21. package/apps/runtime/dist/mcp/handler.js +5 -7
  22. package/apps/runtime/dist/mcp/tools.js +33 -54
  23. package/apps/runtime/dist/media/conversation.js +18 -23
  24. package/apps/runtime/dist/media/generate.js +18 -3
  25. package/apps/runtime/dist/media/transcribe.js +5 -4
  26. package/apps/runtime/dist/motion-graphics/project.js +19 -53
  27. package/apps/runtime/dist/motion-graphics/sounds.js +2 -1
  28. package/apps/runtime/dist/motion-graphics/step.js +31 -16
  29. package/apps/runtime/dist/prompts/README.md +48 -0
  30. package/apps/runtime/dist/prompts/architect.md +89 -0
  31. package/apps/runtime/dist/prompts/authoring.md +503 -0
  32. package/apps/runtime/dist/prompts/goose.md +229 -0
  33. package/apps/runtime/dist/prompts/mcp.md +156 -0
  34. package/apps/runtime/dist/prompts/safety.md +23 -0
  35. package/apps/runtime/dist/prompts/services.md +151 -0
  36. package/apps/runtime/dist/prompts/step.md +334 -0
  37. package/apps/runtime/dist/prompts/tools.md +330 -0
  38. package/apps/runtime/dist/prompts/voice.md +53 -0
  39. package/apps/runtime/dist/prompts.js +50 -0
  40. package/apps/runtime/dist/routes/studio.js +19 -1
  41. package/apps/runtime/dist/safety.js +45 -0
  42. package/apps/runtime/dist/sandbox/index.js +8 -3
  43. package/apps/runtime/dist/services/assistant-chats.js +5 -8
  44. package/apps/runtime/dist/services/brand.js +2 -7
  45. package/apps/runtime/dist/services/cloud.js +8 -4
  46. package/apps/runtime/dist/services/knowledge-model.js +17 -8
  47. package/apps/runtime/dist/services/knowledge.js +5 -9
  48. package/apps/runtime/dist/services/project-files.js +3 -8
  49. package/apps/runtime/dist/services/relevance.js +4 -3
  50. package/apps/runtime/dist/services/runs.js +6 -7
  51. package/apps/runtime/dist/services/site.js +2 -2
  52. package/apps/runtime/dist/services/translations.js +17 -10
  53. package/apps/runtime/dist/sync/client.js +116 -1
  54. package/apps/runtime/dist/tools/browser.js +36 -33
  55. package/apps/runtime/dist/tools/code.js +20 -6
  56. package/apps/runtime/dist/tools/connector.js +23 -9
  57. package/apps/runtime/dist/tools/index.js +14 -11
  58. package/apps/runtime/dist/tools/mail.js +5 -5
  59. package/apps/runtime/dist/tools/net-guard.js +4 -4
  60. package/apps/runtime/dist/tools/pages.js +3 -2
  61. package/apps/runtime/dist/tools/project.js +7 -8
  62. package/apps/runtime/dist/tools/store.js +14 -10
  63. package/apps/web/dist/assets/{AboutDialog-30Mc1_N_.js → AboutDialog-J9rRhJTJ.js} +1 -1
  64. package/apps/web/dist/assets/{ChangelogDialog-Vjxg6JV8.js → ChangelogDialog-D9bBSuLQ.js} +1 -1
  65. package/apps/web/dist/assets/{CodeEditor-CmMRfVhS.js → CodeEditor-CiRJjYpm.js} +1 -1
  66. package/apps/web/dist/assets/{EditorPage-Di5KB-Ei.js → EditorPage-ChLV09jO.js} +1 -1
  67. package/apps/web/dist/assets/{FlowPreview-BkcO3iCf.js → FlowPreview-QRnLE4JM.js} +1 -1
  68. package/apps/web/dist/assets/{Harness-D_Hr80Fo.js → Harness-dM1CDgnx.js} +1 -1
  69. package/apps/web/dist/assets/Marketplace-8rU-MhWj.js +2 -0
  70. package/apps/web/dist/assets/{NewWizardChannels-BIzOtfc8.js → NewWizardChannels--JqgVT-t.js} +1 -1
  71. package/apps/web/dist/assets/{NewWizardPage-BenzMrPD.js → NewWizardPage-CNv5UuBn.js} +1 -1
  72. package/apps/web/dist/assets/{OnboardingPage-DuckyzQr.js → OnboardingPage-CDuhfBEI.js} +1 -1
  73. package/apps/web/dist/assets/{PreviewPane-D9hmriSm.js → PreviewPane-BsMrHW8b.js} +2 -2
  74. package/apps/web/dist/assets/{ProjectPage-A8Z8cS1E.js → ProjectPage-CoVMEoB1.js} +1 -1
  75. package/apps/web/dist/assets/{PublicRunner-QPvlEAxx.js → PublicRunner-Ckte5NnM.js} +1 -1
  76. package/apps/web/dist/assets/{ReadOnly-DFn32cvo.js → ReadOnly-Ch-ss9Mh.js} +1 -1
  77. package/apps/web/dist/assets/SettingsPage-CGp6G_fp.js +2 -0
  78. package/apps/web/dist/assets/{SetupPage-WNHH74hu.js → SetupPage-DgFT_646.js} +1 -1
  79. package/apps/web/dist/assets/{SharePage-Bw4TRWtv.js → SharePage-CEcFKE3b.js} +1 -1
  80. package/apps/web/dist/assets/changelog-DMhLfQmS.js +1 -0
  81. package/apps/web/dist/assets/{i18n-CLxuuhp_.js → i18n-AXoEWXfv.js} +1 -1
  82. package/apps/web/dist/assets/{index-Bha72INy.css → index-BYZBN0xx.css} +1 -1
  83. package/apps/web/dist/assets/index-Dx7qMiM3.js +34 -0
  84. package/apps/web/dist/assets/{oss-credits-CZT1KRIp.js → oss-credits-Da4KrYmP.js} +1 -1
  85. package/apps/web/dist/assets/{phone-DymZ7rLO.js → phone-De-HF0g7.js} +1 -1
  86. package/apps/web/dist/assets/{runners-UfKeoOe4.js → runners-UIPj9xyX.js} +1 -1
  87. package/apps/web/dist/assets/{session-COf_im0l.js → session-DUxZmhqy.js} +1 -1
  88. package/apps/web/dist/assets/{settings-menu-mtOjI15L.js → settings-menu-Bo1yXMGF.js} +1 -1
  89. package/apps/web/dist/assets/{theme-DWoTWDAG.js → theme-CSuPPxre.js} +1 -1
  90. package/apps/web/dist/assets/ui-CBDsXUoA.js +83 -0
  91. package/apps/web/dist/assets/{upload-BizIzwxa.js → upload-CZgdEF60.js} +1 -1
  92. package/apps/web/dist/assets/{useMutation-BJfRETsQ.js → useMutation-ZHWqRSPd.js} +1 -1
  93. package/apps/web/dist/assets/{volume-2-BGkyA8T9.js → volume-2-c641MxaU.js} +1 -1
  94. package/apps/web/dist/assets/{wrench-Be5zav03.js → wrench-DCEAyYuR.js} +1 -1
  95. package/apps/web/dist/index.html +8 -9
  96. package/apps/web/dist/mcp/flow.html +87 -87
  97. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +5 -0
  98. package/node_modules/@engenty/wizards-shared/dist/run.js +10 -0
  99. package/node_modules/@engenty/wizards-shared/dist/surface.d.ts +0 -2
  100. package/node_modules/@engenty/wizards-shared/dist/surface.js +0 -29
  101. package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +5 -0
  102. package/package.json +2 -2
  103. package/plugin/.claude-plugin/plugin.json +1 -1
  104. package/plugin/plugin.json +1 -1
  105. package/apps/runtime/dist/assistant/primer.js +0 -26
  106. package/apps/web/dist/assets/Marketplace-BxFBMUsi.js +0 -2
  107. package/apps/web/dist/assets/SettingsPage-ByP15ndy.js +0 -2
  108. package/apps/web/dist/assets/changelog-Dr9tAFY9.js +0 -1
  109. package/apps/web/dist/assets/coins-DTH3SKgZ.js +0 -1
  110. package/apps/web/dist/assets/index-HhslPV6N.js +0 -34
  111. package/apps/web/dist/assets/ui-D_0Xdrjh.js +0 -83
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{on as r}from"./ui-D_0Xdrjh.js";import{a as i,c as a,i as o,n as s,r as c,s as l,t as u}from"./esm-BdxDT9Km.js";var d=e(t(),1),f=e(n(),1),p=208,m=42,h=26,g=22,_=132;function v({data:e}){let t=e.icon;return(0,f.jsxs)(`div`,{style:{width:p,height:m},className:r(`flex cursor-default items-center gap-2.5 rounded-xl px-2.5`,e.optional?`border border-ink-4 border-dashed`:`bg-paper-2 ring-1 ring-border-soft`),children:[(0,f.jsx)(c,{type:`target`,position:a.Top}),(0,f.jsx)(c,{type:`target`,id:`in`,position:a.Right}),(0,f.jsx)(`span`,{className:r(`inline-flex size-6 shrink-0 items-center justify-center rounded-md`,e.tone),children:(0,f.jsx)(t,{className:`size-3.5`})}),(0,f.jsx)(`span`,{className:`truncate font-medium text-[0.8125rem] text-ink`,children:e.title}),(0,f.jsx)(c,{type:`source`,position:a.Bottom}),(0,f.jsx)(c,{type:`source`,id:`out`,position:a.Right})]})}function y({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,markerEnd:a}){let o=Math.max(e,n)+g,c=[`M ${e} ${t}`,`H ${o-8}`,`Q ${o} ${t} ${o} ${t+8}`,`V ${r-8}`,`Q ${o} ${r} ${o-8} ${r}`,`H ${n}`].join(` `);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u,{path:c,markerEnd:a,style:{strokeDasharray:`5 4`}}),(0,f.jsx)(s,{children:(0,f.jsx)(`div`,{style:{width:_,transform:`translate(${o+8}px, ${(t+r)/2}px) translateY(-50%)`},className:`absolute text-[0.6875rem] text-ink-2 leading-snug`,children:i})})]})}var b={step:v},x={branch:y};function S(e){let t={markerEnd:{type:l.ArrowClosed,width:14,height:14,color:`var(--ink-4)`}},n=e.map((e,t)=>({id:e.id,type:`step`,position:{x:0,y:t*68},data:{title:e.title,icon:e.icon,tone:e.tone,optional:e.optional},draggable:!1})),r=[],i=!1;return e.forEach((n,a)=>{let o=e[a+1];for(let[a,o]of(n.branches??[]).entries())e.some(e=>e.id===o.to)&&(i=!0,r.push({id:`b-${n.id}-${a}`,type:`branch`,source:n.id,sourceHandle:`out`,target:o.to,targetHandle:`in`,label:o.when,...t}));o&&r.push({id:`n-${n.id}`,type:`straight`,source:n.id,target:o.id,...t})}),{nodes:n,edges:r,width:p+(i?162:0),height:e.length*68-h}}function C({steps:e}){let{nodes:t,edges:n,width:r,height:a}=(0,d.useMemo)(()=>S(e),[e]);return e.length?(0,f.jsx)(`div`,{className:`max-w-full`,style:{width:r,height:a+4},children:(0,f.jsx)(o,{children:(0,f.jsx)(i,{nodes:t,edges:n,nodeTypes:b,edgeTypes:x,defaultViewport:{x:1,y:2,zoom:1},minZoom:1,maxZoom:1,nodesConnectable:!1,nodesDraggable:!1,nodesFocusable:!1,edgesFocusable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,proOptions:{hideAttribution:!0}})})}):null}export{C as default};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{on as r}from"./ui-CBDsXUoA.js";import{a as i,c as a,i as o,n as s,r as c,s as l,t as u}from"./esm-BdxDT9Km.js";var d=e(t(),1),f=e(n(),1),p=208,m=42,h=26,g=22,_=132;function v({data:e}){let t=e.icon;return(0,f.jsxs)(`div`,{style:{width:p,height:m},className:r(`flex cursor-default items-center gap-2.5 rounded-xl px-2.5`,e.optional?`border border-ink-4 border-dashed`:`bg-paper-2 ring-1 ring-border-soft`),children:[(0,f.jsx)(c,{type:`target`,position:a.Top}),(0,f.jsx)(c,{type:`target`,id:`in`,position:a.Right}),(0,f.jsx)(`span`,{className:r(`inline-flex size-6 shrink-0 items-center justify-center rounded-md`,e.tone),children:(0,f.jsx)(t,{className:`size-3.5`})}),(0,f.jsx)(`span`,{className:`truncate font-medium text-[0.8125rem] text-ink`,children:e.title}),(0,f.jsx)(c,{type:`source`,position:a.Bottom}),(0,f.jsx)(c,{type:`source`,id:`out`,position:a.Right})]})}function y({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,markerEnd:a}){let o=Math.max(e,n)+g,c=[`M ${e} ${t}`,`H ${o-8}`,`Q ${o} ${t} ${o} ${t+8}`,`V ${r-8}`,`Q ${o} ${r} ${o-8} ${r}`,`H ${n}`].join(` `);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u,{path:c,markerEnd:a,style:{strokeDasharray:`5 4`}}),(0,f.jsx)(s,{children:(0,f.jsx)(`div`,{style:{width:_,transform:`translate(${o+8}px, ${(t+r)/2}px) translateY(-50%)`},className:`absolute text-[0.6875rem] text-ink-2 leading-snug`,children:i})})]})}var b={step:v},x={branch:y};function S(e){let t={markerEnd:{type:l.ArrowClosed,width:14,height:14,color:`var(--ink-4)`}},n=e.map((e,t)=>({id:e.id,type:`step`,position:{x:0,y:t*68},data:{title:e.title,icon:e.icon,tone:e.tone,optional:e.optional},draggable:!1})),r=[],i=!1;return e.forEach((n,a)=>{let o=e[a+1];for(let[a,o]of(n.branches??[]).entries())e.some(e=>e.id===o.to)&&(i=!0,r.push({id:`b-${n.id}-${a}`,type:`branch`,source:n.id,sourceHandle:`out`,target:o.to,targetHandle:`in`,label:o.when,...t}));o&&r.push({id:`n-${n.id}`,type:`straight`,source:n.id,target:o.id,...t})}),{nodes:n,edges:r,width:p+(i?162:0),height:e.length*68-h}}function C({steps:e}){let{nodes:t,edges:n,width:r,height:a}=(0,d.useMemo)(()=>S(e),[e]);return e.length?(0,f.jsx)(`div`,{className:`max-w-full`,style:{width:r,height:a+4},children:(0,f.jsx)(o,{children:(0,f.jsx)(i,{nodes:t,edges:n,nodeTypes:b,edgeTypes:x,defaultViewport:{x:1,y:2,zoom:1},minZoom:1,maxZoom:1,nodesConnectable:!1,nodesDraggable:!1,nodesFocusable:!1,edgesFocusable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,proOptions:{hideAttribution:!0}})})}):null}export{C as default};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{G as r,Mr as i,Un as a,Wt as o,_n as s,on as c,ot as l}from"./ui-D_0Xdrjh.js";import{t as u}from"./useMutation-BJfRETsQ.js";import{s as d}from"./i18n-CLxuuhp_.js";import{z as f}from"./index-HhslPV6N.js";var p=e(t(),1),m=2,h=1,g=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(m,Math.floor(u/e.css.cell.width)),rows:Math.max(h,Math.floor(l/e.css.cell.height))}}},_=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=te.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function ee(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var te=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!ee(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),n.isWrapped&&o.indexOf(` `)===-1););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},ne=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function re(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var ie=class{constructor(e=re,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||ne;this._linkProvider=this._terminal.registerLinkProvider(new _(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},ae=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,se=(e,t)=>{for(var n in t)ae(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,r)=>{for(var i=r>1?void 0:r?oe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&ae(t,n,i),i},y=(e,t)=>(n,r)=>t(n,r,e),ce=`Terminal input`,b={get:()=>ce,set:e=>ce=e},le=`Too much output to announce, navigate to rows manually to read`,ue={get:()=>le,set:e=>le=e};function de(e){return e.replace(/\r?\n/g,`\r`)}function x(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function fe(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function pe(e,t,n,r){e.stopPropagation(),e.clipboardData&&me(e.clipboardData.getData(`text/plain`),t,n,r)}function me(e,t,n,r){e=de(e),e=x(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function he(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ge(e,t,n,r,i){he(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function S(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function _e(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var ve=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},ye=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},be=``,xe=` `,Se=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ce}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ce=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},C=class e extends Se{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ce,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?S(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},we=`di$target`,Te=`di$dependencies`,Ee=new Map;function De(e){return e[Te]||[]}function w(e){if(Ee.has(e))return Ee.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Oe(t,e,r)};return t._id=e,Ee.set(e,t),t}function Oe(e,t,n){t[we]===t?t[Te].push({id:e,index:n}):(t[Te]=[{id:e,index:n}],t[we]=t)}var T=w(`BufferService`),ke=w(`CoreMouseService`),Ae=w(`CoreService`),je=w(`CharsetService`),Me=w(`InstantiationService`),Ne=w(`LogService`),E=w(`OptionsService`),Pe=w(`OscLinkService`),Fe=w(`UnicodeService`),Ie=w(`DecorationService`),Le=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new C,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Re(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Le=v([y(0,T),y(1,E),y(2,Pe)],Le);function Re(e,t){if(confirm(`Do you want to navigate to ${t}?
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{G as r,Mr as i,Un as a,Wt as o,_n as s,on as c,ot as l}from"./ui-CBDsXUoA.js";import{t as u}from"./useMutation-ZHWqRSPd.js";import{s as d}from"./i18n-AXoEWXfv.js";import{z as f}from"./index-Dx7qMiM3.js";var p=e(t(),1),m=2,h=1,g=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(m,Math.floor(u/e.css.cell.width)),rows:Math.max(h,Math.floor(l/e.css.cell.height))}}},_=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=te.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function ee(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var te=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!ee(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),n.isWrapped&&o.indexOf(` `)===-1););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},ne=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function re(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var ie=class{constructor(e=re,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||ne;this._linkProvider=this._terminal.registerLinkProvider(new _(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},ae=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,se=(e,t)=>{for(var n in t)ae(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,r)=>{for(var i=r>1?void 0:r?oe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&ae(t,n,i),i},y=(e,t)=>(n,r)=>t(n,r,e),ce=`Terminal input`,b={get:()=>ce,set:e=>ce=e},le=`Too much output to announce, navigate to rows manually to read`,ue={get:()=>le,set:e=>le=e};function de(e){return e.replace(/\r?\n/g,`\r`)}function x(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function fe(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function pe(e,t,n,r){e.stopPropagation(),e.clipboardData&&me(e.clipboardData.getData(`text/plain`),t,n,r)}function me(e,t,n,r){e=de(e),e=x(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function he(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ge(e,t,n,r,i){he(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function S(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function _e(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var ve=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},ye=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},be=``,xe=` `,Se=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ce}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ce=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},C=class e extends Se{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ce,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?S(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},we=`di$target`,Te=`di$dependencies`,Ee=new Map;function De(e){return e[Te]||[]}function w(e){if(Ee.has(e))return Ee.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Oe(t,e,r)};return t._id=e,Ee.set(e,t),t}function Oe(e,t,n){t[we]===t?t[Te].push({id:e,index:n}):(t[Te]=[{id:e,index:n}],t[we]=t)}var T=w(`BufferService`),ke=w(`CoreMouseService`),Ae=w(`CoreService`),je=w(`CharsetService`),Me=w(`InstantiationService`),Ne=w(`LogService`),E=w(`OptionsService`),Pe=w(`OscLinkService`),Fe=w(`UnicodeService`),Ie=w(`DecorationService`),Le=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new C,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Re(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Le=v([y(0,T),y(1,E),y(2,Pe)],Le);function Re(e,t){if(confirm(`Do you want to navigate to ${t}?
2
2
 
3
3
  WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var ze=w(`CharSizeService`),Be=w(`CoreBrowserService`),Ve=w(`MouseService`),He=w(`RenderService`),Ue=w(`SelectionService`),We=w(`CharacterJoinerService`),Ge=w(`ThemeService`),Ke=w(`LinkProviderService`),qe=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?$e.isErrorNoTelemetry(e)?new $e(e.message+`
4
4
 
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FlowPreview-QRnLE4JM.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/ui-CBDsXUoA.js","assets/preload-helper-DpV6A1kQ.js","assets/i18n-AXoEWXfv.js","assets/esm-BdxDT9Km.js","assets/react-dom-hf6EcyAr.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{n,t as r}from"./jsx-runtime-BNakU3Ej.js";import{G as i,Gn as a,Gt as o,Hn as s,Kt as c,Mn as l,Mr as u,Sn as d,Sr as f,Tn as p,Un as m,W as h,Wt as g,Xn as _,cn as v,cr as y,dr as b,fr as x,hn as ee,ir as S,lr as C,on as w,qt as te,sn as T,sr as E,tn as D,wn as ne,zn as O}from"./ui-CBDsXUoA.js";import{t as k}from"./useMutation-ZHWqRSPd.js";import{t as A}from"./preload-helper-DpV6A1kQ.js";import{i as j,n as re,r as ie,t as ae}from"./volume-2-c641MxaU.js";import{d as oe,h as se,k as ce,x as le}from"./session-DUxZmhqy.js";import{c as ue,s as de}from"./engenty-CNjaZCVM.js";import{F as M,P as fe,U as pe,X as me,Y as he,g as ge,n as N,nt as _e,q as P,s as F}from"./i18n-AXoEWXfv.js";var ve=class extends C{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,n.data),hasPreviousPage:x(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function ye(e,t){return y(e,ve,t)}var be={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};be.node;var I=_(be),xe={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};xe.node;var L=_(xe),Se={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Se.node;var Ce=_(Se),we={name:`circle-euro`,size:24,node:[[`path`,{d:`M15 9.4a4 4 0 1 0 0 5.2`,key:`1makmb`}],[`path`,{d:`M7 12h5`,key:`gblrwe`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};we.node;var Te=_(we),Ee={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]};Ee.node;var R=_(Ee),De={name:`cloud-off`,size:24,node:[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};De.node;var Oe=_(De),ke={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};ke.node;var Ae=_(ke),je={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};je.node;var z=_(je),Me={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Me.node;var B=_(Me),Ne={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Ne.node;var V=_(Ne),Pe={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Pe.node;var Fe=_(Pe),Ie={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};Ie.node;var Le=_(Ie),Re={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Re.node;var ze=_(Re),Be={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};Be.node;var Ve=_(Be),He={name:`scan-text`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}]]};He.node;var Ue=_(He),We={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};We.node;var H=_(We),Ge={name:`table-2`,size:24,node:[[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]};Ge.node;var Ke=_(Ge),qe={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};qe.node;var Je=_(qe),Ye={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Ye.node;var Xe=_(Ye),Ze={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Ze.node;var Qe=_(Ze),$e=[`text`,`web`,`browser`,`documents`,`image`,`video`,`speech`,`listening`,`code`,`connectors`,`motion-graphics`],et=new Set([`html`,`md`,`txt`,`csv`,`json`]),tt=new Set([`code`]),nt=new Set([`web_search`,`browser`,`sandbox`,`image`]),rt=new Set([`web_fetch`,`http`]),it=/\{\{\s*memory\b/;function at(e){switch(e.type){case`agent`:return[e.instructions,e.call?JSON.stringify(e.call.input):``];case`generate`:return[e.prompt,e.options?.style??``];case`motion-graphics`:return[e.brief];case`widget`:case`surface`:return Object.values(e.data).map(e=>`{{${M(e)}}}`);default:return[]}}function ot(e,t){return e.steps.slice(t+1).some(e=>e.type===`agent`&&!e.call||e.type===`generate`||e.type===`motion-graphics`)}function st(e,t){let n=[],r=(t,r)=>{let i=n.find(e=>e.need===t);i?i.hard||=r:n.push({stepId:e.id,need:t,hard:r})},i=t.steps.indexOf(e);for(let t of at(e))it.test(t)&&r(`memory`,!0),_e(t).some(e=>e.startsWith(`lists.`))&&r(`lists`,!0);switch(e.type){case`page`:for(let n of e.fields){switch(n.kind){case`audio`:r(`field:audio`,!!n.required);break;case`connection`:r(`field:connection`,!0);break;case`slot`:r(`field:slot`,!0);break;case`list`:r(`lists`,!0);break;case`location`:r(`field:location`,!1);break;case`image`:r(`field:image`,!1);break;case`file`:ot(t,i)?r(`field:file-read`,!0):r(`field:file`,!1)}n.optionsFrom&&P(M(n.optionsFrom).split(`.`).slice(0,2).join(`.`))&&r(`lists`,!0)}break;case`agent`:{let t=e.call?[...e.tools,e.call.tool]:e.tools;for(let e of t){let t=he(e);t?r(`plugin:${t.plugin}`,!0):rt.has(e)||tt.has(e)||(nt.has(e)?r(`tool:${e}`,!0):r(`tool:${e}`,!1))}e.connections?.length&&r(`connections`,!0),e.each&&(P(M(e.each))?r(`lists`,!0):r(`each`,!1));break}case`generate`:e.asset!==`document`&&e.asset!==`dashboard`&&r(`asset:${e.asset}`,!0);break;case`motion-graphics`:r(`motion-graphics`,!0);break;case`widget`:r(e.video?`widget:video`:`widget`,!0);break;case`surface`:Object.values(e.data).some(e=>P(M(e)))&&r(`lists`,!0);break;case`review`:e.show.some(e=>P(e))&&r(`lists`,!0);break;case`result`:for(let n of e.deliverables){if(P(n.from)){r(`lists`,!0);continue}let e=t.steps.find(e=>e.id===n.from);if(e?.type!==`agent`&&(e?.type!==`generate`||e.asset!==`document`&&e.asset!==`dashboard`))continue;let i=n.formats.some(e=>et.has(e));for(let t of n.formats)et.has(t)||(t!==`pdf`||e?.type!==`agent`)&&r(`format:${t}`,t!==`pdf`&&!i)}}return n}function ct(e){let t=e.steps.flatMap(t=>st(t,e));e.lists?.length&&!t.some(e=>e.need===`lists`)&&t.push({stepId:e.steps[0]?.id??``,need:`lists`,hard:!0}),e.connections?.length&&!t.some(e=>e.need===`connections`)&&t.push({stepId:e.steps[0]?.id??``,need:`connections`,hard:!0});let n=dt(e);return{fit:t.some(e=>e.hard&&n.has(e.stepId))?`no`:t.length?`less`:`full`,notes:t}}function lt(e){switch(e){case`tool:web_search`:case`tool:web_fetch`:return`web`;case`tool:browser`:return`browser`;case`tool:sandbox`:return`code`;case`tool:image`:case`asset:image`:return`image`;case`asset:video`:case`motion-graphics`:case`widget:video`:return`video`;case`asset:voice`:return`speech`;case`field:audio`:return`listening`;case`tool:http`:case`connections`:case`field:connection`:return`connectors`;case`field:image`:case`field:file`:case`field:file-read`:return`documents`;default:return null}}function ut(e){let t=ct(e),n=dt(e),r=new Set,i=new Set,a=new Set,o=new Set;for(let e of t.notes){if(e.need.startsWith(`plugin:`)){a.add(e.need.slice(7));continue}if(e.need.startsWith(`format:`)){o.add(e.need.slice(7));continue}let t=lt(e.need);t&&(e.hard&&n.has(e.stepId)?r.add(t):i.add(t))}for(let e of r)i.delete(e);return{...t,missing:[...r],optional:[...i],needs:[...a].sort(),without:[...o]}}function dt(e){return e.steps.length?ft(e,e.steps[0].id,{}):new Set}function ft(e,t,n){let r=new Map(e.steps.map((e,t)=>[e.id,t])),i=r.get(t)??0,a=t=>{let i=[];for(let a of e.steps[t].next??[]){if(pe(a))continue;let t=a.goto===`end`?e.steps.length:r.get(a.goto)??-1;if(a.ask||!fe(a.when).every(e=>e.field in n)){t>=0&&i.push(t);continue}if(me(a,n))return t>=0?[...i,t]:i}return i.push(pt(e,t,r)),i},o=t=>{if(t===i)return!1;let n=new Set([i]),r=[i];for(;r.length;){let i=r.shift();if(i>=e.steps.length)return!0;for(let e of a(i))e!==t&&!n.has(e)&&(n.add(e),r.push(e))}return!1};return new Set(e.steps.filter((e,t)=>!o(t)).map(e=>e.id))}function pt(e,t,n){let r=e.steps[t].next?.find(pe)?.goto;return r===void 0?t+1:r===`end`?e.steps.length:n.get(r)??t+1}var mt=[`text`,`document`,`table`,`image`,`video`,`audio`,`dashboard`],ht=[`any`,`trades`,`gastronomy`,`hospitality`,`realEstate`,`retail`,`health`,`professional`,`agency`,`events`,`publicSector`],gt=[`marketing`,`sales`,`accounting`,`service`,`research`,`hr`,`operations`,`website`,`visuals`,`inquiries`,`advice`],_t=[`free`,`pro`],vt={"format.text":`Text`,"format.document":`Document (PDF, Word)`,"format.table":`Table`,"format.image":`Image`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Any industry`,"industry.trades":`Trades`,"industry.gastronomy":`Food service`,"industry.hospitality":`Hotels & tourism`,"industry.realEstate":`Real estate`,"industry.retail":`Retail`,"industry.health":`Health`,"industry.professional":`Professional services`,"industry.agency":`Agency & marketing`,"industry.events":`Events`,"industry.publicSector":`Associations & public sector`,"useCase.marketing":`Marketing & social media`,"useCase.sales":`Offers & sales`,"useCase.accounting":`Accounting & receipts`,"useCase.service":`Customer service`,"useCase.research":`Research & analysis`,"useCase.hr":`HR & applications`,"useCase.operations":`Planning & operations`,"useCase.website":`Website helpers`,"useCase.visuals":`Images & video`,"useCase.inquiries":`Inquiries & bookings`,"useCase.advice":`Advice & pricing`,"capability.text":`Writes text`,"capability.web":`Web search`,"capability.browser":`Drives a browser`,"capability.documents":`Reads documents & photos`,"capability.image":`Makes images`,"capability.video":`Makes video`,"capability.speech":`Speech output`,"capability.listening":`Understands voice notes`,"capability.code":`Runs code`,"capability.connectors":`Connected accounts & systems`,"capability.motion-graphics":`Motion graphics with Claude Code (on your subscription)`,"cost.low":`low cost`,"cost.medium":`medium cost`,"cost.high":`high cost`,"plan.free":`Free`,"plan.pro":`Pro`,"outline.otherwise":`otherwise`,"outline.and":`{first} and {second}`,"outline.with":`with {name}`,"outline.without":`without {name}`,"outline.contains":`{name} contains {value}`},yt={en:vt,de:{"format.text":`Text`,"format.document":`Dokument (PDF, Word)`,"format.table":`Tabelle`,"format.image":`Bild`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Jede Branche`,"industry.trades":`Handwerk`,"industry.gastronomy":`Gastronomie`,"industry.hospitality":`Hotel & Tourismus`,"industry.realEstate":`Immobilien`,"industry.retail":`Handel`,"industry.health":`Gesundheit`,"industry.professional":`Kanzlei & Beratung`,"industry.agency":`Agentur & Marketing`,"industry.events":`Veranstaltungen`,"industry.publicSector":`Vereine & Öffentliches`,"useCase.marketing":`Marketing & Social Media`,"useCase.sales":`Angebote & Verkauf`,"useCase.accounting":`Buchhaltung & Belege`,"useCase.service":`Kundenservice`,"useCase.research":`Recherche & Analyse`,"useCase.hr":`Personal & Bewerbungen`,"useCase.operations":`Planung & Abläufe`,"useCase.website":`Helfer für die Website`,"useCase.visuals":`Bilder & Video`,"useCase.inquiries":`Anfragen & Termine`,"useCase.advice":`Beratung & Preise`,"capability.text":`Text schreiben`,"capability.web":`Websuche`,"capability.browser":`Browser bedienen`,"capability.documents":`Dokumente & Fotos lesen`,"capability.image":`Bilder erzeugen`,"capability.video":`Videos erzeugen`,"capability.speech":`Sprachausgabe`,"capability.listening":`Sprachnotizen verstehen`,"capability.code":`Code ausführen`,"capability.connectors":`Verbundene Konten & Systeme`,"capability.motion-graphics":`Motion-Grafik mit Claude Code (auf deinem Abo)`,"cost.low":`günstig`,"cost.medium":`mittel`,"cost.high":`teuer`,"plan.free":`Kostenlos`,"plan.pro":`Pro`,"outline.otherwise":`sonst`,"outline.and":`{first} und {second}`,"outline.with":`mit {name}`,"outline.without":`ohne {name}`,"outline.contains":`{name} enthält {value}`}};function bt(e,t,n,r){let i=`${e}.${t}`;return i in vt?ge(yt,i,n,r):t}var U=t(n(),1);function xt(e){switch(e.type){case`page`:return ze;case`agent`:return j;case`generate`:return e.asset===`image`?V:e.asset===`video`?v:e.asset===`dashboard`?Fe:l;case`widget`:return I;case`surface`:return Le;case`motion-graphics`:return R;case`review`:return z;case`result`:return B}return Qe}var St={page:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,surface:`bg-ember-veil text-ember-strong`,"motion-graphics":`bg-amber-tint text-ink-2`,review:`bg-moss-tint text-moss`,result:`bg-paper-2 text-ink-2`};function Ct(e){return F(`type.${e.type}`)}var wt=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`,`code`];function Tt(e){return wt.includes(e)?F(`tool.${e}`):e}function Et(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:return e.tools.map(Tt).join(` · `)||e.instructions.slice(0,90);case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`surface`:return e.candidates?e.candidates.map(e=>e.id).join(` · `):Object.keys(e.data).join(`, `);case`motion-graphics`:return[e.format,e.seconds?`${e.seconds}s`:null,e.skills.join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?F(`editor.reviewEditable`):null,e.regenerate?F(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var Dt=e({EntryDialog:()=>Q,MarketplaceBrowser:()=>Xt,MarketplaceCards:()=>Yt,MarketplaceFit:()=>Jt,MarketplaceHits:()=>Kt,ProChip:()=>Lt,useFit:()=>qt,useSettled:()=>$}),W=t(r(),1),Ot=(0,U.lazy)(()=>A(()=>import(`./FlowPreview-QRnLE4JM.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])));function kt({level:e}){let t=e.next,n=t?Math.max(0,t.runs-e.progress.runs):0,r=t?Math.max(0,t.published-e.progress.published):0,i=t?Math.min(1,(Math.min(e.progress.runs/Math.max(1,t.runs),1)+Math.min(e.progress.published/Math.max(1,t.published||1),1))/2):1;return(0,W.jsxs)(`div`,{className:`mx-auto mt-3 flex max-w-md items-center gap-3 text-[0.78125rem] text-ink-3`,children:[(0,W.jsx)(`span`,{className:`shrink-0 font-medium text-ink-2`,children:F(`market.level`,{level:e.level,name:e.name})}),(0,W.jsx)(`span`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-paper-3`,children:(0,W.jsx)(`span`,{className:`block h-full rounded-full bg-primary`,style:{width:`${i*100}%`}})}),(0,W.jsx)(`span`,{className:`shrink-0`,children:t?F(r?`market.levelNextPublish`:`market.levelNext`,{runs:n,published:r,name:t.name}):F(`market.levelTop`)})]})}var At={useCase:``,industry:``,format:``,capability:``,plan:``},G=(e,t)=>bt(e,t,N),jt={en:Ce,de:Te};function Mt(e){if(e<1)return 1;let t=10**Math.floor(Math.log10(e));return Math.round(e/t)*t}function Nt(e){return e.credits?F(`market.credits`,{n:Mt(e.credits.credits)}):G(`cost`,e.costTier)}var Pt={text:Xe,document:l,table:Ke,image:V,video:v,audio:a,dashboard:L};function K({format:e,className:t}){let n=Pt[e],r=G(`format`,e);return(0,W.jsx)(`span`,{title:r,className:`inline-flex`,children:(0,W.jsx)(n,{className:t,"aria-label":r,role:`img`})})}var Ft=[`low`,`medium`,`high`];function It({entry:e}){let t=Ft.indexOf(e.costTier)+1,n=jt[N];return(0,W.jsxs)(`span`,{title:Nt(e),className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex shrink-0`,children:Ft.slice(0,t).map((e,t)=>(0,W.jsx)(`span`,{className:w(`rounded-full bg-(--coin-bg,var(--color-card))`,t>0&&`-ml-1.5`),children:(0,W.jsx)(n,{className:`size-4`})},e))}),G(`cost`,e.costTier)]})}function Lt(){return(0,W.jsx)(c,{tone:`ember`,title:F(`market.proHint`),children:F(`market.pro`)})}function Rt({plugin:e}){return(0,W.jsx)(c,{icon:(0,W.jsx)(Ve,{className:`size-3.5`}),title:F(`market.fromPlugin`,{name:e.name}),children:e.name})}function q({entry:e,onOpen:t,why:n}){return(0,W.jsxs)(o,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:w(`relative flex min-h-[124px] cursor-pointer flex-col gap-5 p-4 text-left transition sm:min-h-[136px] sm:p-5 hover:shadow-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,(!e.usable||e.missing.length>0||!!e.needs?.length)&&`opacity-60`),children:[(0,W.jsx)(`span`,{className:`-top-4 pointer-events-none absolute right-4`,children:(0,W.jsx)(le,{kind:e.avatar,costume:e.costume,size:68})}),(0,W.jsxs)(`div`,{className:`min-w-0 pr-20`,children:[(0,W.jsxs)(`div`,{className:`font-display font-semibold text-[0.9375rem]`,children:[e.title,e.plan===`pro`?(0,W.jsx)(`span`,{className:`ml-1.5 inline-flex align-middle`,children:(0,W.jsx)(Lt,{})}):null,e.starred?(0,W.jsx)(H,{className:`ml-1.5 inline size-3.5 fill-amber align-[-2px] text-amber`,"aria-label":F(`market.starred`)}):null]}),e.featured?(0,W.jsx)(`div`,{className:`mt-1`,children:(0,W.jsx)(c,{tone:`ember`,children:F(`market.recommended`)})}):null,(0,W.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:e.pitch})]}),(0,W.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-x-3 gap-y-1.5 text-[0.75rem] text-ink-3`,children:[n?(0,W.jsx)(c,{children:n}):null,e.plugin?(0,W.jsx)(Rt,{plugin:e.plugin}):null,e.needs?.length?(0,W.jsx)(c,{tone:`warn`,children:F(`market.needsPro`,{list:e.needs.join(`, `)})}):e.usable&&e.missing.length?(0,W.jsx)(c,{tone:`warn`,children:F(`market.missing`,{list:Y(e.missing)})}):e.usable?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(O,{className:`size-3.5`}),` `,F(`market.minutes`,{n:e.effort.minutes})]}),(0,W.jsx)(It,{entry:e}),e.optional?.length?(0,W.jsx)(c,{title:F(`market.optionalHint`,{list:Y(e.optional)}),children:F(`market.without`,{list:Y(e.optional)})}):null,(0,W.jsx)(`span`,{className:`ml-auto inline-flex items-center gap-1.5`,children:e.formats.map(e=>(0,W.jsx)(K,{format:e,className:`size-4`},e))})]}):(0,W.jsx)(c,{tone:`warn`,children:F(`market.needsUpdate`)})]})]})}function J({title:e,children:t}){return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:e}),t]})}var Y=e=>e.map(e=>G(`capability`,e)).join(`, `),zt={text:d,web:ie,browser:ne,documents:Ue,image:V,video:v,speech:ae,listening:p,code:Je,connectors:re,"motion-graphics":R};function Bt(e){switch(e.type){case`page`:return ze;case`agent`:return j;case`generate`:return e.asset===`image`?V:e.asset===`video`?v:e.asset===`voice`?ae:e.asset===`dashboard`?L:l;case`widget`:return e.video?R:I;case`surface`:return I;case`motion-graphics`:return R;case`review`:return z;case`result`:return B}return Qe}function Vt(e){let t=new Set;for(let[n,r]of e.entries())for(let i of r.branches??[]){let r=i.to===`end`?e.length:e.findIndex(e=>e.id===i.to);for(let i=n+1;i<r;i++)t.add(e[i].id)}return t}function Ht(e){let t=Vt(e);return e.map(e=>({id:e.id,title:e.title,icon:Bt(e),tone:St[e.type]??`bg-paper-2 text-ink-2`,optional:t.has(e.id),branches:e.branches}))}function X({title:e,children:t}){return(0,W.jsx)(`span`,{title:e,className:`inline-flex items-center gap-2 border-border border-l px-4 first:border-l-0 first:pl-0`,children:t})}function Z({icon:e,children:t,more:n}){return(0,W.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-[0.875rem] text-ink leading-snug`,children:t}),n?(0,W.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 leading-snug`,children:n}):null]})]})}function Ut({className:e,children:t}){let n=(0,U.useRef)(null),[r,i]=(0,U.useState)({above:!1,below:!1});(0,U.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let t=e.scrollTop>1,n=e.scrollTop+e.clientHeight<e.scrollHeight-1;i(e=>e.above===t&&e.below===n?e:{above:t,below:n})};t(),e.addEventListener(`scroll`,t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild),()=>{e.removeEventListener(`scroll`,t),r.disconnect()}},[]);let a=`linear-gradient(to bottom, ${r.above?`transparent`:`black`} 0, black 28px, black calc(100% - 44px), ${r.below?`transparent`:`black`} 100%)`;return(0,W.jsx)(`div`,{ref:n,className:e,style:{maskImage:a,WebkitMaskImage:a},children:(0,W.jsx)(`div`,{children:t})})}function Q({id:e,fallback:t,onClose:n,onUse:r,busy:a}){let o=u(),s=S(),c=E({queryKey:[`marketplace-entry`,e,N],queryFn:()=>i.get(`/api/studio/marketplace/${encodeURIComponent(e)}?lang=${N}`),enabled:!!e,retry:!1}),l=c.data??t,d=k({mutationFn:t=>{let n=`/api/studio/marketplace/${encodeURIComponent(e)}/star`;return t?i.put(n):i.del(n)},onSuccess:()=>Promise.all([o.invalidateQueries({queryKey:[`marketplace`]}),o.invalidateQueries({queryKey:[`marketplace-entry`,e]})])}),f=ce()===`dark`,p=de[ue[l?.avatar||`round`]],m=f?`var(--card)`:`color-mix(in oklch, ${p??`var(--ink-4)`} 14%, var(--paper-2))`;return(0,W.jsx)(te,{open:!!e,onClose:n,wide:!0,bare:!0,children:l?(0,W.jsxs)(`div`,{className:`relative flex max-h-[calc(100dvh-48px)] flex-col rounded-2xl bg-card shadow-overlay max-sm:h-dvh max-sm:max-h-none max-sm:rounded-none`,children:[(0,W.jsx)(`button`,{type:`button`,"aria-label":F(`common.close`),onClick:n,className:`sm:-top-3.5 sm:-right-3.5 absolute top-3 right-3 z-20 flex size-9 items-center justify-center rounded-full bg-card text-ink-2 shadow-elevated ring-1 ring-border-soft transition hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,children:(0,W.jsx)(T,{className:`size-4`})}),(0,W.jsxs)(`header`,{className:`relative shrink-0 border-border-soft border-b px-5 pt-5 pb-4 text-ink sm:rounded-t-2xl sm:px-7`,style:{background:m,"--coin-bg":m},children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 overflow-hidden sm:rounded-t-2xl`,children:(0,W.jsx)(`span`,{className:w(`-top-28 -right-10 absolute size-80 rounded-full bg-white blur-3xl`,f?`opacity-[0.14]`:`opacity-80`)})}),(0,W.jsx)(`div`,{className:`-bottom-5 absolute right-9 z-10 max-sm:hidden`,children:(0,W.jsx)(le,{kind:l.avatar,costume:l.costume,size:104})}),(0,W.jsxs)(`div`,{className:`relative sm:pr-36`,children:[(0,W.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight max-sm:pr-10`,children:l.title}),(0,W.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-snug`,children:c.data?.description||l.pitch})]}),l.usable?(0,W.jsxs)(`div`,{className:`-mx-5 sm:-mx-7 relative mt-3.5 flex flex-wrap items-center gap-y-2 border-border-soft border-t px-5 pt-3 font-medium text-[0.875rem] sm:px-7 sm:pr-40`,children:[(0,W.jsxs)(X,{title:F(`market.duration`),children:[(0,W.jsx)(O,{className:`size-4 text-ink-3`}),F(`market.minutes`,{n:l.effort.minutes})]}),(0,W.jsx)(X,{title:F(`market.cost`),children:(0,W.jsx)(It,{entry:l})}),(0,W.jsx)(X,{title:F(`market.result`),children:l.formats.map(e=>(0,W.jsx)(K,{format:e,className:`size-4`},e))})]}):null]}),l.usable?(0,W.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-7 gap-y-6 px-5 pt-6 max-sm:overflow-y-auto max-sm:pb-4 sm:grid-cols-[230px_minmax(0,1fr)] sm:grid-rows-[minmax(0,1fr)] sm:px-7`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-5 sm:min-h-0 sm:overflow-y-auto`,children:[(0,W.jsx)(J,{title:F(`market.duration`),children:(0,W.jsx)(Z,{icon:(0,W.jsx)(O,{className:`size-4 text-moss`}),more:F(`market.durationHint`,{n:l.effort.fields}),children:F(`market.minutes`,{n:l.effort.minutes})})}),(0,W.jsx)(J,{title:F(`market.cost`),children:(0,W.jsx)(Z,{icon:(0,W.jsx)(Ae,{className:`size-4 text-amber`}),more:l.credits?F(`market.creditsHint`):void 0,children:(0,W.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,W.jsx)(It,{entry:l}),l.credits?(0,W.jsx)(`span`,{className:`text-ink-2`,children:F(`market.creditsRange`,{n:Mt(l.credits.credits)})}):null]})})}),(0,W.jsx)(J,{title:F(`market.result`),children:(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:(c.data?.results??[]).map(e=>(0,W.jsx)(Z,{icon:(0,W.jsx)(K,{format:e.kind,className:`size-4 text-ember-strong`}),more:e.formats.map(e=>e.toUpperCase()).join(` · `),children:e.title},e.title))})}),(0,W.jsx)(J,{title:F(`market.needs`),children:(0,W.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.capabilities.map(e=>{let t=zt[e],n=l.missing.includes(e),r=l.optional?.includes(e);return(0,W.jsxs)(`li`,{className:w(`flex items-center gap-2.5 text-[0.875rem]`,n?`text-ink-3`:`text-ink-2`),children:[(0,W.jsx)(t,{className:w(`size-4 shrink-0`,n?`text-rose`:r?`text-amber`:`text-cobalt`)}),G(`capability`,e),n?(0,W.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:F(`market.unavailable`)}):r?(0,W.jsx)(`span`,{className:`text-[0.75rem] text-amber`,children:F(`market.optional`)}):null]},e)})})})]}),(0,W.jsxs)(`div`,{className:`flex flex-col sm:min-h-0`,children:[(0,W.jsx)(`div`,{className:`mb-1.5 shrink-0 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:F(`market.steps`)}),(0,W.jsx)(Ut,{className:`-mr-2 overscroll-contain pt-1 pr-2 pl-1 sm:min-h-0 sm:flex-1 sm:overflow-y-auto`,children:c.isLoading?(0,W.jsx)(D,{className:`size-5 text-ink-3`}):(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(D,{className:`size-5 text-ink-3`}),children:(0,W.jsx)(Ot,{steps:Ht(c.data?.outline??[])})})})]})]}):(0,W.jsx)(`div`,{className:`flex-1 px-5 pt-6 sm:px-7`,children:(0,W.jsx)(`p`,{className:`rounded-lg bg-amber-tint p-3 text-[0.875rem] text-ink-2`,children:F(`market.needsUpdateHint`)})}),(0,W.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 px-5 pt-4 pb-5 max-sm:border-border-soft max-sm:border-t sm:px-7 sm:pb-6`,children:[l.plugin?(0,W.jsx)(`span`,{className:`mr-auto flex items-center`,children:(0,W.jsx)(Rt,{plugin:l.plugin})}):(0,W.jsxs)(g,{variant:`ghost`,className:`mr-auto`,title:F(`market.starHint`),"aria-pressed":l.starred,busy:d.isPending,onClick:()=>d.mutate(!l.starred),children:[(0,W.jsx)(H,{className:w(`size-4`,l.starred&&`fill-amber text-amber`)}),(0,W.jsx)(`span`,{className:`max-sm:sr-only`,children:F(l.starred?`market.starred`:`market.star`)})]}),(0,W.jsx)(g,{variant:`secondary`,onClick:n,children:F(`common.close`)}),l.usable&&l.missing.length?(0,W.jsx)(g,{variant:`secondary`,onClick:()=>s(`/settings/models`),children:F(`editor.models.settings`)}):null,r?(0,W.jsx)(g,{disabled:!l.usable||l.missing.length>0||!!l.needs?.length,title:l.needs?.length?F(`market.needsProHint`,{list:l.needs.join(`, `)}):l.missing.length?F(`market.missingHint`,{list:Y(l.missing)}):l.optional?.length?F(`market.optionalHint`,{list:Y(l.optional)}):void 0,busy:a,onClick:()=>r(l),children:F(`market.use`)}):null]})]}):(0,W.jsx)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-3 rounded-2xl bg-card p-8 text-[0.875rem] text-ink-2 shadow-overlay`,children:c.isLoading?(0,W.jsx)(D,{className:`size-6 text-ink-3`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{children:F(`market.notFound`)}),(0,W.jsx)(g,{variant:`secondary`,onClick:n,children:F(`common.close`)})]})})})}function Wt({name:e,value:t,options:n,onChange:r}){let[i,a]=(0,U.useState)(!1),o=(0,U.useRef)(null);(0,U.useEffect)(()=>{if(!i)return;let e=e=>{o.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let c=n.find(e=>e.value===t);return(0,W.jsxs)(`div`,{ref:o,className:`relative`,children:[(0,W.jsxs)(`div`,{className:w(`flex h-8 items-center rounded-full text-[0.8125rem] transition`,c?`bg-ember-tint text-ink`:`text-ink-2 hover:bg-paper-2 hover:text-ink`,i&&!c&&`bg-paper-2 text-ink`),children:[(0,W.jsx)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":i,onClick:()=>a(!i),className:w(`flex h-full items-center gap-1.5 rounded-full pl-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,c?`pr-1`:`pr-2.5`),children:c?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,W.jsx)(`span`,{className:`font-medium`,children:c.label})]}):(0,W.jsxs)(W.Fragment,{children:[e,(0,W.jsx)(s,{className:w(`size-3.5 transition`,i&&`rotate-180`)})]})}),c?(0,W.jsx)(`button`,{type:`button`,"aria-label":`${e}: ${F(`market.reset`)}`,onClick:()=>r(``),className:`mr-1 flex size-6 items-center justify-center rounded-full text-ink-3 hover:bg-card hover:text-ink`,children:(0,W.jsx)(T,{className:`size-3.5`})}):null]}),i?(0,W.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`absolute top-full left-0 z-30 mt-1.5 max-h-80 min-w-60 overflow-y-auto rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:n.map(e=>(0,W.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.value===t,disabled:!e.count||e.unavailable,onClick:()=>{r(e.value===t?``:e.value),a(!1)},className:w(`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[0.875rem] transition coarse:py-2.5`,e.count&&!e.unavailable?`text-ink-2 hover:bg-paper-2 hover:text-ink`:`text-ink-4`,e.value===t&&`font-medium text-ink`),children:[e.icon,(0,W.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:e.label}),e.value===t?(0,W.jsx)(m,{className:`size-4 text-ember`}):e.unavailable?(0,W.jsx)(`span`,{className:`whitespace-nowrap text-[0.75rem] text-ink-4`,children:F(`market.unavailable`)}):(0,W.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:e.count})]},e.value))}):null]})}function $(e,t){let[n,r]=(0,U.useState)(e);return(0,U.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var Gt=60;function Kt({query:e,onUse:t,busy:n,limit:r=6}){let[a,o]=(0,U.useState)(null),s=$(e.trim(),250),c=E({queryKey:[`marketplace`,N,s,`hits`,r],queryFn:()=>i.get(`/api/studio/marketplace?${new URLSearchParams({lang:N,limit:String(r),offset:`0`,q:s})}`),enabled:!!s,placeholderData:f}),l=s?c.data?.entries??[]:[];return l.length?(0,W.jsxs)(`section`,{className:`mt-10`,children:[(0,W.jsxs)(`h2`,{className:`mb-5 flex items-center gap-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:[F(`market.hits`),c.isFetching?(0,W.jsx)(D,{className:`size-3.5`}):null]}),(0,W.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:l.map(e=>(0,W.jsx)(q,{entry:e,onOpen:()=>o(e.id)},e.id))}),(0,W.jsx)(Q,{id:a,fallback:l.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:t,busy:n})]}):null}function qt(){let e=E({queryKey:[`marketplace`,N,`fit`],queryFn:()=>i.get(`/api/studio/marketplace?${new URLSearchParams({lang:N,limit:`12`,offset:`0`,fit:`1`})}`)});return e.data?.context&&e.data.entries.some(e=>e.fit)?e.data:null}function Jt({page:e,organization:t,onUse:n,busy:r,onAll:i}){let[a,o]=(0,U.useState)(null),s=e.context??{sector:null,sectorName:null},c=e.entries,l=e=>e.fit===`sector`||e.fit===`industry`?s.sectorName:e.fit===`wish`?F(`market.fitWish`):null;return(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h2`,{className:`mt-16 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:F(`market.fitTitle`,{organization:t})}),(0,W.jsx)(`p`,{className:`mt-2 mb-5 text-center text-[0.875rem] text-ink-3`,children:s.sectorName?F(`market.fitLine`,{sector:s.sectorName}):F(`market.fitLinePlain`)}),(0,W.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:c.map((e,t)=>(0,W.jsx)(`div`,{className:w(`contents`,t>=4&&`max-sm:hidden`,t>=8&&`sm:max-lg:hidden`),children:(0,W.jsx)(q,{entry:e,why:l(e),onOpen:()=>o(e.id)})},e.id))}),(0,W.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,W.jsx)(g,{variant:`secondary`,onClick:i,children:F(`market.fitAll`,{n:e.all||e.total})})}),(0,W.jsx)(Q,{id:a,fallback:c.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:n,busy:r})]})}function Yt({entries:e}){let t=u(),n=S(),{project:r}=oe(),a=se()&&!!r&&!r?.readOnly,[o,s]=(0,U.useState)(null),c=k({mutationFn:e=>i.post(`/api/studio/wizards`,{projectId:r.id,starterId:e,lang:N}),onSuccess:async({id:e})=>{await t.invalidateQueries({queryKey:h.spaces()}),await t.invalidateQueries({queryKey:[`wizards`]}),s(null),n(`/edit/${e}`)}});return(0,W.jsxs)(`div`,{className:`@container mt-3`,children:[(0,W.jsx)(`div`,{className:`flex flex-col gap-4 @xl:grid @xl:grid-cols-2`,children:e.map(e=>(0,W.jsx)(q,{entry:e,onOpen:()=>s(e.id)},e.id))}),c.error?(0,W.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:c.error.message}):null,(0,W.jsx)(Q,{id:o,fallback:e.find(e=>e.id===o)??null,onClose:()=>s(null),onUse:a?e=>!c.isPending&&c.mutate(e.id):void 0,busy:c.isPending})]})}function Xt({onUse:e,busy:t,open:n,search:r,onGuestOpen:a}){let[o,s]=(0,U.useState)(``);(0,U.useEffect)(()=>{r&&s(r.text)},[r]);let[c,l]=(0,U.useState)(At),[u,d]=(0,U.useState)(!1),[p,m]=(0,U.useState)(n??null),h=$(o.trim(),250),_=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=_.current;h&&e&&window.matchMedia(`(max-width: 639px)`).matches&&e.scrollIntoView({behavior:`smooth`,block:`start`})},[h]);let v=ye({queryKey:[`marketplace`,N,h,c,u],queryFn:({pageParam:e})=>{let t=new URLSearchParams({lang:N,limit:String(Gt),offset:String(e)});h&&t.set(`q`,h);for(let[e,n]of Object.entries(c))n&&t.set(e,n);return u&&t.set(`starred`,`1`),i.get(`/api/${a?`guest`:`studio`}/marketplace?${t}`)},initialPageParam:0,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.entries.length,0);return n<e.total?n:void 0},placeholderData:f}),y=v.data?.pages[0],b=v.data?.pages.flatMap(e=>e.entries)??[],x=y?.all??0,S=o.trim()!==h||v.isFetching&&!v.isFetchingNextPage,C=(e,t,n,r)=>n.filter(t=>y?.facets[e]?.[t]!==void 0).map(n=>({value:n,label:G(t,n),icon:r?.(n),count:(y?.facets[e])[n]??0,unavailable:e===`capability`&&te.has(n)})),te=new Set(y?.unavailable??[]),E=C(`useCase`,`useCase`,gt),ne=[{key:`industry`,name:F(`market.industry`),options:C(`industry`,`industry`,ht)},{key:`format`,name:F(`market.format`),options:C(`format`,`format`,mt,e=>(0,W.jsx)(K,{format:e,className:`size-4 text-ink-3`}))},{key:`plan`,name:F(`market.plan`),options:C(`plan`,`plan`,_t)},{key:`capability`,name:F(`market.capability`),options:C(`capability`,`capability`,$e,e=>{let t=zt[e];return(0,W.jsx)(t,{className:`size-4 text-ink-3`})})}],O=!!o.trim()||u||Object.values(c).some(Boolean),k=()=>{l(At),s(``),d(!1)};if(v.isLoading)return(0,W.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,W.jsx)(D,{className:`size-6 text-ink-3`})});let A=y?.offline?(0,W.jsxs)(`p`,{className:`mt-4 flex items-center justify-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,W.jsx)(Oe,{className:`size-4 shrink-0`}),F(`market.offline`)]}):null;if(!x&&!O)return A;let j=o?(0,W.jsx)(`button`,{type:`button`,"aria-label":F(`market.reset`),onClick:()=>s(``),className:`-mr-1.5 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-3 hover:bg-paper-2 hover:text-ink`,children:(0,W.jsx)(T,{className:`size-4`})}):null,re=e=>w(`inline-flex h-7 shrink-0 items-center gap-1 whitespace-nowrap rounded-full px-2.5 text-[0.78125rem] transition`,e?`bg-card font-medium text-ink shadow-soft ring-1 ring-border-soft`:`text-ink-3 hover:bg-card/60 hover:text-ink`);return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`label`,{ref:_,className:`relative mx-auto flex h-10 max-w-md scroll-mt-4 items-center gap-2.5 rounded-full bg-card px-4 shadow-soft ring-1 ring-border-soft transition focus-within:ring-2 focus-within:ring-focus sm:h-11`,children:[S?(0,W.jsx)(D,{className:`size-4 shrink-0 text-ink-3`}):(0,W.jsx)(ee,{className:`size-4 shrink-0 text-ink-3`}),(0,W.jsx)(`input`,{type:`search`,value:o,onChange:e=>s(e.target.value),placeholder:F(`market.search`),"aria-label":F(`market.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),j]}),A,y?.level?(0,W.jsx)(kt,{level:y.level}):null,(0,W.jsxs)(`div`,{className:`max-sm:-mx-3 mt-4 flex gap-1 max-sm:overflow-x-auto max-sm:px-3 max-sm:[scrollbar-width:none] sm:flex-wrap sm:justify-center max-sm:[&::-webkit-scrollbar]:hidden`,children:[[{value:``,label:F(`market.all`)},...E].map(e=>(0,W.jsx)(`button`,{type:`button`,"aria-pressed":!u&&c.useCase===e.value,onClick:()=>{d(!1),l({...c,useCase:e.value})},className:re(!u&&c.useCase===e.value),children:e.label},e.value)),a?null:(0,W.jsxs)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>d(!u),className:re(u),children:[(0,W.jsx)(H,{className:w(`size-3.5`,u&&`fill-amber text-amber`)}),F(`market.starred`)]})]}),(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-1 gap-y-2 sm:mt-6`,children:[u?null:ne.map(e=>(0,W.jsx)(Wt,{name:e.name,value:c[e.key],options:e.options,onChange:t=>l({...c,[e.key]:t})},e.key)),(0,W.jsxs)(`span`,{className:`ml-auto flex items-center gap-3 whitespace-nowrap pl-2 text-[0.8125rem] text-ink-3`,children:[O?(0,W.jsxs)(`button`,{type:`button`,onClick:k,className:`inline-flex items-center gap-1 text-ember-strong underline-offset-2 hover:underline`,children:[(0,W.jsx)(T,{className:`size-3.5 max-sm:size-4`}),(0,W.jsx)(`span`,{className:`max-sm:sr-only`,children:F(`market.resetShort`)})]}):null,O?(0,W.jsx)(`span`,{className:`tabular-nums sm:hidden`,children:F(`market.countOfShort`,{n:y?.total??0,all:x})}):null,(0,W.jsx)(`span`,{className:w(`tabular-nums`,O&&`max-sm:hidden`),children:O?F(`market.countOf`,{n:y?.total??0,all:x}):F(`market.count`,{n:x})})]})]}),b.length?(0,W.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:b.map(e=>(0,W.jsx)(q,{entry:e,onOpen:()=>a?a(e):m(e.id)},e.id))}):(0,W.jsxs)(`div`,{className:`py-10 text-center text-[0.875rem] text-ink-3`,children:[(0,W.jsx)(`p`,{children:F(u?`market.noneStarred`:`market.none`)}),(0,W.jsx)(g,{variant:`ghost`,className:`mt-2`,onClick:k,children:F(`market.reset`)})]}),v.hasNextPage?(0,W.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,W.jsx)(g,{variant:`secondary`,busy:v.isFetchingNextPage,onClick:()=>void v.fetchNextPage(),children:F(`market.more`)})}):null,(0,W.jsx)(Q,{id:p,fallback:b.find(e=>e.id===p)??null,onClose:()=>m(null),onUse:e,busy:t})]})}export{L as A,Le as C,Ae as D,z as E,ye as M,Oe as O,ze as S,B as T,Qe as _,Dt as a,H as b,$ as c,Et as d,Tt as f,ut as g,lt as h,Kt as i,I as j,R as k,St as l,bt as m,Xt as n,Lt as o,Ct as p,Jt as r,qt as s,Q as t,xt as u,Xe as v,V as w,Ve as x,Ke as y};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Gn as r,Un as i,cn as a,on as o,yn as s}from"./ui-D_0Xdrjh.js";import{S as c}from"./Marketplace-BxFBMUsi.js";import{r as l}from"./volume-2-BGkyA8T9.js";import{t as u}from"./phone-DymZ7rLO.js";import{s as d}from"./i18n-CLxuuhp_.js";import{Mt as f,Nt as p,Pt as m}from"./index-HhslPV6N.js";import{t as h}from"./runners-UfKeoOe4.js";var g=e(t(),1),_=e(n(),1),v=[{id:`steps`,group:`web`,runner:`steps`,label:`new.ch.steps`,icon:c},{id:`chat`,group:`web`,runner:`chat`,label:`new.ch.chat`,icon:m},{id:`talk`,group:`web`,runner:`talk`,label:`new.ch.talk`,icon:r},{id:`video`,group:`web`,runner:`video`,label:`new.ch.video`,icon:a},{id:`call`,group:`phone`,runner:`call`,label:`new.ch.call`,icon:u},{id:`wacall`,group:`phone`,runner:`call`,label:`new.ch.whatsapp`,icon:null},{id:`sms`,group:`message`,runner:`sms`,label:`new.ch.sms`,icon:f},{id:`whatsapp`,group:`message`,runner:`whatsapp`,label:`new.ch.whatsapp`,icon:null}],y=[{id:`web`,label:`new.web`,icon:l},{id:`phone`,label:`new.phone`,icon:u},{id:`message`,label:`new.messages`,icon:p}],b=v.filter(e=>h.enabled.includes(e.id)).map(e=>e.id),x=e=>v.filter(t=>e.includes(t.id));function S(e){return e.length===b.length&&b.every(t=>e.includes(t))}function C(e){let t=x(e),n=[...new Set(t.map(e=>e.runner))];return{default:t.find(e=>e.group===`web`)?.runner??n[0]??h.default,enabled:n}}var w=e=>e.map(e=>d(e.label));function T(e){return v.find(t=>t.runner===e)}function E(e){return v.filter(t=>t.id!==`wacall`&&e.includes(t.runner)).map(e=>e.id)}function D(e){let t=x(e),n=y.flatMap(e=>{let n=w(t.filter(t=>t.group===e.id));return n.length?[e.id===`web`?n.join(`, `):`${d(e.label)}: ${n.join(`, `)}`]:[]});return`${d(`new.runsAs`)}: ${n.join(` · `)}`}function O(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function k({channel:e,className:t}){let n=e.icon;return n?(0,_.jsx)(n,{className:t??`size-4`}):(0,_.jsx)(`span`,{"aria-hidden":`true`,className:`font-semibold text-[0.625rem] tracking-wide`,children:`WA`})}function A(e){let t=new Set(e?.map(e=>e.id)??[`steps`,`chat`]);return v.filter(e=>t.has(e.runner))}function j({value:e,onChange:t,runners:n,without:r,disabled:a}){let s=A(n).filter(e=>!r?.includes(e.id)),c=t=>e.includes(t.id),l=n=>{a||c(n)&&e.length===1||t(c(n)?e.filter(e=>e!==n.id):[...e,n.id])},u=t=>{let n=y.find(e=>e.id===t),r=s.filter(e=>e.group===t);if(!(n&&r.length))return null;let u=n.icon;return(0,_.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,_.jsxs)(`legend`,{className:`flex items-center gap-1.5 px-2 pt-2 pb-1 text-[0.75rem] text-ink-3`,children:[(0,_.jsx)(u,{className:`size-3.5`}),` `,d(n.label)]}),r.map(t=>(0,_.jsxs)(`div`,{children:[(0,_.jsxs)(`label`,{className:o(`flex h-10 w-full cursor-pointer items-center gap-2.5 rounded-lg px-2 text-[0.875rem] transition hover:bg-accent has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus coarse:h-11`,c(t)&&`bg-paper-2`),children:[(0,_.jsx)(`span`,{className:`flex w-5 justify-center text-ink-3`,children:(0,_.jsx)(k,{channel:t})}),(0,_.jsx)(`span`,{className:`flex-1`,children:d(t.label)}),(0,_.jsx)(`input`,{type:`checkbox`,className:`sr-only`,"aria-label":d(t.label),checked:c(t),disabled:a,"aria-disabled":c(t)&&e.length===1,onChange:()=>l(t)}),(0,_.jsx)(`span`,{"aria-hidden":`true`,className:o(`flex size-[1.125rem] items-center justify-center rounded-md ring-1`,c(t)?`bg-ink text-paper ring-ink`:`ring-border`),children:c(t)?(0,_.jsx)(i,{className:`size-3`,strokeWidth:3}):null})]}),t.id===`call`&&c(t)?(0,_.jsx)(`p`,{className:`px-2 pb-1.5 pl-9 text-[0.75rem] text-ink-3`,children:d(`new.callHandoff`)}):null]},t.id))]})};return(0,_.jsxs)(`div`,{className:`grid gap-x-4 sm:grid-cols-2`,children:[u(`web`),(0,_.jsxs)(`div`,{className:`flex flex-col`,children:[u(`phone`),u(`message`)]})]})}function M({value:e,onChange:t,runners:n,className:r}){let[i,a]=(0,g.useState)(!1),[c,l]=(0,g.useState)(0),u=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(!i)return;let e=e=>{u.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i]);let f=A(n),p=y.filter(e=>f.some(t=>t.group===e.id)),m=t=>e.includes(t.id);return(0,_.jsxs)(`div`,{ref:u,className:o(`relative flex flex-wrap items-center gap-1.5`,r),children:[(0,_.jsx)(`span`,{className:`mr-0.5 px-1 text-[0.8125rem] text-ink-3`,children:d(`new.runsAs`)}),p.map(e=>{let t=w(f.filter(t=>t.group===e.id&&m(t))),n=e.icon;return(0,_.jsxs)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-label":`${d(e.label)}: ${t.length?t.join(`, `):d(`new.off`)}`,onClick:e=>{let t=e.currentTarget;l(t.offsetLeft+t.offsetWidth/2),a(e=>!e)},className:o(`inline-flex h-9 items-center justify-center gap-1.5 rounded-full font-medium text-[0.8125rem] transition coarse:h-11`,t.length?`bg-ink px-3 text-paper`:`w-9 text-ink-3 ring-1 ring-border hover:text-ink coarse:w-11`),children:[(0,_.jsx)(n,{className:`size-4 shrink-0`}),t.length?(0,_.jsx)(`span`,{className:`truncate`,children:O(t)}):null]},e.id)}),(0,_.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-label":d(`new.where`),onClick:e=>{let t=e.currentTarget;l(t.offsetLeft+t.offsetWidth/2),a(e=>!e)},className:`inline-flex size-9 items-center justify-center rounded-full text-ink-3 ring-1 ring-border transition hover:text-ink coarse:size-11`,children:(0,_.jsx)(s,{className:`size-4`})}),i?(0,_.jsxs)(`div`,{role:`dialog`,"aria-label":d(`new.where`),style:{transformOrigin:`${c}px top`},className:`absolute top-full left-0 z-20 mt-2 w-[min(32rem,calc(100vw-2rem))] animate-unfold rounded-2xl bg-card p-3 text-left shadow-overlay ring-1 ring-border`,children:[(0,_.jsx)(`p`,{className:`px-2 pt-1 font-semibold text-[0.9375rem]`,children:d(`new.where`)}),(0,_.jsx)(j,{value:e,onChange:t,runners:n})]}):null]})}export{D as a,S as c,M as i,C as l,k as n,T as o,j as r,E as s,y as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Gn as r,Un as i,cn as a,on as o,yn as s}from"./ui-CBDsXUoA.js";import{S as c}from"./Marketplace-8rU-MhWj.js";import{r as l}from"./volume-2-c641MxaU.js";import{t as u}from"./phone-De-HF0g7.js";import{s as d}from"./i18n-AXoEWXfv.js";import{Mt as f,Nt as p,Pt as m}from"./index-Dx7qMiM3.js";import{t as h}from"./runners-UIPj9xyX.js";var g=e(t(),1),_=e(n(),1),v=[{id:`steps`,group:`web`,runner:`steps`,label:`new.ch.steps`,icon:c},{id:`chat`,group:`web`,runner:`chat`,label:`new.ch.chat`,icon:m},{id:`talk`,group:`web`,runner:`talk`,label:`new.ch.talk`,icon:r},{id:`video`,group:`web`,runner:`video`,label:`new.ch.video`,icon:a},{id:`call`,group:`phone`,runner:`call`,label:`new.ch.call`,icon:u},{id:`wacall`,group:`phone`,runner:`call`,label:`new.ch.whatsapp`,icon:null},{id:`sms`,group:`message`,runner:`sms`,label:`new.ch.sms`,icon:f},{id:`whatsapp`,group:`message`,runner:`whatsapp`,label:`new.ch.whatsapp`,icon:null}],y=[{id:`web`,label:`new.web`,icon:l},{id:`phone`,label:`new.phone`,icon:u},{id:`message`,label:`new.messages`,icon:p}],b=v.filter(e=>h.enabled.includes(e.id)).map(e=>e.id),x=e=>v.filter(t=>e.includes(t.id));function S(e){return e.length===b.length&&b.every(t=>e.includes(t))}function C(e){let t=x(e),n=[...new Set(t.map(e=>e.runner))];return{default:t.find(e=>e.group===`web`)?.runner??n[0]??h.default,enabled:n}}var w=e=>e.map(e=>d(e.label));function T(e){return v.find(t=>t.runner===e)}function E(e){return v.filter(t=>t.id!==`wacall`&&e.includes(t.runner)).map(e=>e.id)}function D(e){let t=x(e),n=y.flatMap(e=>{let n=w(t.filter(t=>t.group===e.id));return n.length?[e.id===`web`?n.join(`, `):`${d(e.label)}: ${n.join(`, `)}`]:[]});return`${d(`new.runsAs`)}: ${n.join(` · `)}`}function O(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function k({channel:e,className:t}){let n=e.icon;return n?(0,_.jsx)(n,{className:t??`size-4`}):(0,_.jsx)(`span`,{"aria-hidden":`true`,className:`font-semibold text-[0.625rem] tracking-wide`,children:`WA`})}function A(e){let t=new Set(e?.map(e=>e.id)??[`steps`,`chat`]);return v.filter(e=>t.has(e.runner))}function j({value:e,onChange:t,runners:n,without:r,disabled:a}){let s=A(n).filter(e=>!r?.includes(e.id)),c=t=>e.includes(t.id),l=n=>{a||c(n)&&e.length===1||t(c(n)?e.filter(e=>e!==n.id):[...e,n.id])},u=t=>{let n=y.find(e=>e.id===t),r=s.filter(e=>e.group===t);if(!(n&&r.length))return null;let u=n.icon;return(0,_.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,_.jsxs)(`legend`,{className:`flex items-center gap-1.5 px-2 pt-2 pb-1 text-[0.75rem] text-ink-3`,children:[(0,_.jsx)(u,{className:`size-3.5`}),` `,d(n.label)]}),r.map(t=>(0,_.jsxs)(`div`,{children:[(0,_.jsxs)(`label`,{className:o(`flex h-10 w-full cursor-pointer items-center gap-2.5 rounded-lg px-2 text-[0.875rem] transition hover:bg-accent has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus coarse:h-11`,c(t)&&`bg-paper-2`),children:[(0,_.jsx)(`span`,{className:`flex w-5 justify-center text-ink-3`,children:(0,_.jsx)(k,{channel:t})}),(0,_.jsx)(`span`,{className:`flex-1`,children:d(t.label)}),(0,_.jsx)(`input`,{type:`checkbox`,className:`sr-only`,"aria-label":d(t.label),checked:c(t),disabled:a,"aria-disabled":c(t)&&e.length===1,onChange:()=>l(t)}),(0,_.jsx)(`span`,{"aria-hidden":`true`,className:o(`flex size-[1.125rem] items-center justify-center rounded-md ring-1`,c(t)?`bg-ink text-paper ring-ink`:`ring-border`),children:c(t)?(0,_.jsx)(i,{className:`size-3`,strokeWidth:3}):null})]}),t.id===`call`&&c(t)?(0,_.jsx)(`p`,{className:`px-2 pb-1.5 pl-9 text-[0.75rem] text-ink-3`,children:d(`new.callHandoff`)}):null]},t.id))]})};return(0,_.jsxs)(`div`,{className:`grid gap-x-4 sm:grid-cols-2`,children:[u(`web`),(0,_.jsxs)(`div`,{className:`flex flex-col`,children:[u(`phone`),u(`message`)]})]})}function M({value:e,onChange:t,runners:n,className:r}){let[i,a]=(0,g.useState)(!1),[c,l]=(0,g.useState)(0),u=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(!i)return;let e=e=>{u.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i]);let f=A(n),p=y.filter(e=>f.some(t=>t.group===e.id)),m=t=>e.includes(t.id);return(0,_.jsxs)(`div`,{ref:u,className:o(`relative flex flex-wrap items-center gap-1.5`,r),children:[(0,_.jsx)(`span`,{className:`mr-0.5 px-1 text-[0.8125rem] text-ink-3`,children:d(`new.runsAs`)}),p.map(e=>{let t=w(f.filter(t=>t.group===e.id&&m(t))),n=e.icon;return(0,_.jsxs)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-label":`${d(e.label)}: ${t.length?t.join(`, `):d(`new.off`)}`,onClick:e=>{let t=e.currentTarget;l(t.offsetLeft+t.offsetWidth/2),a(e=>!e)},className:o(`inline-flex h-9 items-center justify-center gap-1.5 rounded-full font-medium text-[0.8125rem] transition coarse:h-11`,t.length?`bg-ink px-3 text-paper`:`w-9 text-ink-3 ring-1 ring-border hover:text-ink coarse:w-11`),children:[(0,_.jsx)(n,{className:`size-4 shrink-0`}),t.length?(0,_.jsx)(`span`,{className:`truncate`,children:O(t)}):null]},e.id)}),(0,_.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-label":d(`new.where`),onClick:e=>{let t=e.currentTarget;l(t.offsetLeft+t.offsetWidth/2),a(e=>!e)},className:`inline-flex size-9 items-center justify-center rounded-full text-ink-3 ring-1 ring-border transition hover:text-ink coarse:size-11`,children:(0,_.jsx)(s,{className:`size-4`})}),i?(0,_.jsxs)(`div`,{role:`dialog`,"aria-label":d(`new.where`),style:{transformOrigin:`${c}px top`},className:`absolute top-full left-0 z-20 mt-2 w-[min(32rem,calc(100vw-2rem))] animate-unfold rounded-2xl bg-card p-3 text-left shadow-overlay ring-1 ring-border`,children:[(0,_.jsx)(`p`,{className:`px-2 pt-1 font-semibold text-[0.9375rem]`,children:d(`new.where`)}),(0,_.jsx)(j,{value:e,onChange:t,runners:n})]}):null]})}export{D as a,S as c,M as i,C as l,k as n,T as o,j as r,E as s,y as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Cn as r,G as i,Kt as a,Lt as o,Mr as s,Sr as c,W as l,Wt as u,an as d,c as f,er as p,i as m,ir as h,l as g,o as _,on as v,or as y,ot as b,qn as ee,qt as x,s as te,sn as S,sr as C,u as ne,yn as re}from"./ui-D_0Xdrjh.js";import{c as w,n as ie,o as T,r as ae,s as oe,t as E}from"./Marketplace-BxFBMUsi.js";import{t as D}from"./useMutation-BJfRETsQ.js";import{d as O,g as se,h as k,i as A,t as ce,x as le}from"./session-COf_im0l.js";import{t as j}from"./upload-BizIzwxa.js";import{n as M,s as N}from"./i18n-CLxuuhp_.js";import{a as ue,c as P,i as de,l as fe}from"./NewWizardChannels-BIzOtfc8.js";var F=[[`id`,8],[`toolId`,10],[`moduleId`,7],[`pluginId`,6],[`title`,6],[`description`,4],[`tags`,3],[`path`,3],[`inputSchema`,2],[`outputSchema`,2],[`request`,1],[`response`,1]];function I(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase()}function L(e){return I(e).split(/[^a-z0-9]+/).map(e=>e.trim()).filter(e=>e.length>1)}function R(e){return e==null?``:Array.isArray(e)?e.map(R).filter(Boolean).join(` `):typeof e==`object`?Object.values(e).map(R).filter(Boolean).join(` `):String(e)}function z(e,t){let n=t.map(([t,n])=>({text:R(e[t]),weight:n})).filter(e=>e.text.length>0);return{fields:n,tokens:n.flatMap(e=>L(e.text))}}function B(e){let t=[e];if(e.length<5)return t;if(e.endsWith(`ing`)){let n=e.slice(0,-3);n.length>=3&&t.push(n,`${n}e`)}else if(e.endsWith(`ies`)&&e.length>=6)t.push(`${e.slice(0,-3)}y`);else if(e.endsWith(`es`))t.push(e.slice(0,-2),e.slice(0,-1));else if(e.endsWith(`ed`)){let n=e.slice(0,-2);t.push(n,`${n}e`)}else e.endsWith(`s`)&&!e.endsWith(`ss`)&&t.push(e.slice(0,-1));return[...new Set(t)]}function V(e,t){if(e===t)return 1;let n=0;for(let r of B(e))for(let i of B(t)){if(r===i){n=Math.max(n,r===e&&i===t?1:.75);continue}r.length>=2&&i.startsWith(r)&&(n=Math.max(n,.55*(r.length/i.length))),i.length>=4&&r.startsWith(i)&&(n=Math.max(n,.4*(i.length/r.length)))}return n}function H(e,t){return e.reduce((e,n)=>e+V(t,n),0)}function U(e,t,n=F){if(!t?.trim())return 0;let r=L(t);if(r.length===0)return 0;let i=z(e,n);return i.tokens.length===0?0:r.reduce((e,t)=>H(i.tokens,t)===0?e:e+i.fields.reduce((e,n)=>{let r=L(n.text),i=H(r,t);if(i===0)return e;let a=i*2.2/(i+1.2+r.length/16);return e+n.weight*a},0),0)}var W=new Set(L(`aber als also am an auch auf aus bei bin bitte brauche brauchen braucht das dass dem den der
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Cn as r,G as i,Kt as a,Lt as o,Mr as s,Sr as c,W as l,Wt as u,an as d,c as f,er as p,i as m,ir as h,l as g,o as _,on as v,or as y,ot as b,qn as ee,qt as x,s as te,sn as S,sr as C,u as ne,yn as re}from"./ui-CBDsXUoA.js";import{c as w,n as ie,o as T,r as ae,s as oe,t as E}from"./Marketplace-8rU-MhWj.js";import{t as D}from"./useMutation-ZHWqRSPd.js";import{d as O,g as se,h as k,i as A,t as ce,x as le}from"./session-DUxZmhqy.js";import{t as j}from"./upload-CZgdEF60.js";import{n as M,s as N}from"./i18n-AXoEWXfv.js";import{a as ue,c as P,i as de,l as fe}from"./NewWizardChannels--JqgVT-t.js";var F=[[`id`,8],[`toolId`,10],[`moduleId`,7],[`pluginId`,6],[`title`,6],[`description`,4],[`tags`,3],[`path`,3],[`inputSchema`,2],[`outputSchema`,2],[`request`,1],[`response`,1]];function I(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase()}function L(e){return I(e).split(/[^a-z0-9]+/).map(e=>e.trim()).filter(e=>e.length>1)}function R(e){return e==null?``:Array.isArray(e)?e.map(R).filter(Boolean).join(` `):typeof e==`object`?Object.values(e).map(R).filter(Boolean).join(` `):String(e)}function z(e,t){let n=t.map(([t,n])=>({text:R(e[t]),weight:n})).filter(e=>e.text.length>0);return{fields:n,tokens:n.flatMap(e=>L(e.text))}}function B(e){let t=[e];if(e.length<5)return t;if(e.endsWith(`ing`)){let n=e.slice(0,-3);n.length>=3&&t.push(n,`${n}e`)}else if(e.endsWith(`ies`)&&e.length>=6)t.push(`${e.slice(0,-3)}y`);else if(e.endsWith(`es`))t.push(e.slice(0,-2),e.slice(0,-1));else if(e.endsWith(`ed`)){let n=e.slice(0,-2);t.push(n,`${n}e`)}else e.endsWith(`s`)&&!e.endsWith(`ss`)&&t.push(e.slice(0,-1));return[...new Set(t)]}function V(e,t){if(e===t)return 1;let n=0;for(let r of B(e))for(let i of B(t)){if(r===i){n=Math.max(n,r===e&&i===t?1:.75);continue}r.length>=2&&i.startsWith(r)&&(n=Math.max(n,.55*(r.length/i.length))),i.length>=4&&r.startsWith(i)&&(n=Math.max(n,.4*(i.length/r.length)))}return n}function H(e,t){return e.reduce((e,n)=>e+V(t,n),0)}function U(e,t,n=F){if(!t?.trim())return 0;let r=L(t);if(r.length===0)return 0;let i=z(e,n);return i.tokens.length===0?0:r.reduce((e,t)=>H(i.tokens,t)===0?e:e+i.fields.reduce((e,n)=>{let r=L(n.text),i=H(r,t);if(i===0)return e;let a=i*2.2/(i+1.2+r.length/16);return e+n.weight*a},0),0)}var W=new Set(L(`aber als also am an auch auf aus bei bin bitte brauche brauchen braucht das dass dem den der
2
2
  des die dies diese dieser doch du ein eine einem einen einer eines er es etwas fuer für gerne
3
3
  habe haben hat ich ihr im in ist kann können koennen mache machen mag mein meine meinem meinen
4
4
  meiner mich mir mit möchte moechte nach nicht noch nur oder sich sie sind soll suche suchen
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{G as r,Mn as i,Mr as a,Un as o,W as s,i as c,ir as ee,l,on as u,or as te,qn as d,sr as ne,u as f}from"./ui-D_0Xdrjh.js";import{t as p}from"./useMutation-BJfRETsQ.js";import{d as re,g as ie,i as ae,n as m,v as h,w as g,x as oe}from"./session-COf_im0l.js";import{t as se}from"./upload-BizIzwxa.js";import{t as _}from"./logo-CGNoptDg.js";import{n as v,s as y}from"./i18n-CLxuuhp_.js";import{tt as ce}from"./index-HhslPV6N.js";var b=new Set([`gmail.com`,`googlemail.com`,`gmx.at`,`gmx.de`,`gmx.net`,`web.de`,`outlook.com`,`hotmail.com`,`live.com`,`icloud.com`,`me.com`,`yahoo.com`,`yahoo.de`,`aon.at`,`a1.net`,`chello.at`,`t-online.de`,`proton.me`,`protonmail.com`]),le={website:`Website`,blog:`Blog`,linkedin:`LinkedIn`,instagram:`Instagram`,facebook:`Facebook`,youtube:`YouTube`,x:`X`,xing:`XING`,tiktok:`TikTok`},ue=[[`linkedin`,/(^|\.)linkedin\.com$/],[`instagram`,/(^|\.)instagram\.com$/],[`facebook`,/(^|\.)(facebook|fb)\.com$/],[`youtube`,/(^|\.)(youtube\.com|youtu\.be)$/],[`x`,/(^|\.)(x|twitter)\.com$/],[`xing`,/(^|\.)xing\.com$/],[`tiktok`,/(^|\.)tiktok\.com$/]];function x(e){let t=e.trim();if(!t||/\s/.test(t))return null;try{let e=new URL(/^https?:\/\//i.test(t)?t:`https://${t}`);return e.hostname.includes(`.`)?e.href:null}catch{return null}}function de(e){let t=x(e);if(!t)return`website`;let{hostname:n,pathname:r}=new URL(t),i=n.toLowerCase().replace(/^www\./,``);for(let[e,t]of ue)if(t.test(i))return e;return/^blog\./.test(i)||/^\/blog(\/|$)/.test(r)||/(^|\.)(medium|substack)\.com$/.test(i)?`blog`:`website`}var S=[{id:`bakeries`,industry:`gastronomy`,name:{de:`Bäckereien`,en:`Bakeries`},words:[`bäckerei`,`bäcker`,`backstube`,`brot`,`gebäck`,`konditorei`,`bakery`,`bread`,`pastry`]},{id:`cafes`,industry:`gastronomy`,name:{de:`Cafés`,en:`Cafés`},words:[`café`,`cafe`,`kaffeehaus`,`kaffee`,`coffee`,`espresso`]},{id:`restaurants`,industry:`gastronomy`,name:{de:`Restaurants`,en:`Restaurants`},words:[`restaurant`,`gasthaus`,`gasthof`,`wirtshaus`,`pizzeria`,`küche`,`speisekarte`,`menu`,`bistro`]},{id:`hotels`,industry:`hospitality`,name:{de:`Hotels und Pensionen`,en:`Hotels and guesthouses`},words:[`hotel`,`pension`,`zimmer`,`übernachtung`,`ferienwohnung`,`guesthouse`,`booking`,`rooms`]},{id:`architects`,industry:`professional`,name:{de:`Architekturbüros`,en:`Architects`},words:[`architekt`,`architektur`,`planung`,`entwurf`,`architect`,`architecture`]},{id:`lawFirms`,industry:`professional`,name:{de:`Kanzleien`,en:`Law firms`},words:[`rechtsanwalt`,`anwalt`,`kanzlei`,`recht`,`notar`,`law firm`,`lawyer`,`attorney`,`legal`]},{id:`taxAdvisors`,industry:`professional`,name:{de:`Steuerberatung`,en:`Tax advisors`},words:[`steuerberatung`,`steuerberater`,`steuer`,`buchhaltung`,`lohnverrechnung`,`bilanz`,`tax`,`accounting`,`bookkeeping`]},{id:`consultants`,industry:`professional`,name:{de:`Beratung`,en:`Consultants`},words:[`beratung`,`berater`,`consulting`,`coaching`,`consultant`]},{id:`physiotherapy`,industry:`health`,name:{de:`Physiotherapie`,en:`Physiotherapy`},words:[`physiotherapie`,`physio`,`massage`,`therapie`,`physiotherapy`]},{id:`practices`,industry:`health`,name:{de:`Arztpraxen`,en:`Doctors’ practices`},words:[`arzt`,`ärztin`,`praxis`,`ordination`,`zahnarzt`,`doctor`,`clinic`,`dentist`]},{id:`hairdressers`,industry:`retail`,name:{de:`Friseur und Kosmetik`,en:`Hair and beauty`},words:[`friseur`,`frisör`,`kosmetik`,`nagelstudio`,`beauty`,`hairdresser`,`salon`]},{id:`joiners`,industry:`trades`,name:{de:`Tischlereien`,en:`Joiners`},words:[`tischlerei`,`tischler`,`schreiner`,`möbel`,`holz`,`joinery`,`carpenter`,`furniture`]},{id:`electricians`,industry:`trades`,name:{de:`Elektrotechnik`,en:`Electricians`},words:[`elektriker`,`elektro`,`elektrotechnik`,`photovoltaik`,`electrician`,`electrical`]},{id:`plumbing`,industry:`trades`,name:{de:`Installateure`,en:`Plumbing and heating`},words:[`installateur`,`sanitär`,`heizung`,`klima`,`plumber`,`plumbing`,`heating`]},{id:`windows`,industry:`trades`,name:{de:`Fensterbau`,en:`Window makers`},words:[`fenster`,`türen`,`fensterbau`,`sonnenschutz`,`windows`,`doors`]},{id:`construction`,industry:`trades`,name:{de:`Bau und Handwerk`,en:`Building and trades`},words:[`bau`,`baumeister`,`maler`,`dachdecker`,`handwerk`,`construction`,`builder`,`painter`,`roofer`]},{id:`realEstate`,industry:`realEstate`,name:{de:`Immobilien`,en:`Real estate`},words:[`immobilien`,`makler`,`wohnung`,`miete`,`hausverwaltung`,`real estate`,`property`,`estate agent`]},{id:`onlineShops`,industry:`retail`,name:{de:`Online-Shops`,en:`Online shops`},words:[`online-shop`,`onlineshop`,`shop`,`versand`,`e-commerce`,`webshop`,`online store`]},{id:`retail`,industry:`retail`,name:{de:`Handel`,en:`Retail`},words:[`geschäft`,`handel`,`laden`,`boutique`,`retail`,`store`]},{id:`agencies`,industry:`agency`,name:{de:`Agenturen`,en:`Agencies`},words:[`agentur`,`werbung`,`marketing`,`design`,`kommunikation`,`agency`,`advertising`,`branding`]},{id:`photographers`,industry:`agency`,name:{de:`Fotografie`,en:`Photographers`},words:[`fotograf`,`fotografie`,`foto`,`photographer`,`photography`]},{id:`events`,industry:`events`,name:{de:`Veranstaltungen`,en:`Events`},words:[`event`,`veranstaltung`,`hochzeit`,`catering`,`konferenz`,`wedding`,`conference`]},{id:`itServices`,industry:`professional`,name:{de:`IT-Dienstleister`,en:`IT services`},words:[`it-dienstleister`,`it-service`,`software`,`webentwicklung`,`hosting`,`netzwerk`,`development`,`web design`]},{id:`cleaning`,industry:`trades`,name:{de:`Reinigung`,en:`Cleaning`},words:[`reinigung`,`gebäudereinigung`,`putz`,`cleaning`,`janitorial`]},{id:`footballClubs`,industry:`any`,name:{de:`Fußballvereine`,en:`Football clubs`},words:[`fußball`,`fussball`,`fc`,`sv`,`kicker`,`football`,`soccer`]},{id:`sportsClubs`,industry:`any`,name:{de:`Sportvereine`,en:`Sports clubs`},words:[`sportverein`,`verein`,`turnen`,`tennis`,`laufen`,`sport`,`club`]},{id:`musicClubs`,industry:`events`,name:{de:`Musikvereine und Chöre`,en:`Music clubs and choirs`},words:[`musikverein`,`blasmusik`,`chor`,`kapelle`,`orchester`,`band`,`choir`,`music`]},{id:`fireBrigades`,industry:`publicSector`,name:{de:`Feuerwehren`,en:`Fire brigades`},words:[`feuerwehr`,`rettung`,`rotes kreuz`,`fire brigade`,`rescue`]},{id:`schools`,industry:`publicSector`,name:{de:`Schulen und Bildung`,en:`Schools and education`},words:[`schule`,`kurs`,`weiterbildung`,`akademie`,`nachhilfe`,`school`,`course`,`training`]},{id:`municipalities`,industry:`publicSector`,name:{de:`Gemeinden`,en:`Municipalities`},words:[`gemeinde`,`stadt`,`bürgerservice`,`amt`,`municipality`,`council`,`town`]},{id:`associations`,industry:`any`,name:{de:`Vereine und Initiativen`,en:`Associations`},words:[`verein`,`initiative`,`ehrenamt`,`verband`,`association`,`nonprofit`,`charity`]}],C=e=>S.find(t=>t.id===e)??null;function fe(e,t=3){let n=` ${e.toLowerCase().normalize(`NFC`).replace(/[^\p{L}\p{N}-]+/gu,` `)} `;return S.map(e=>({id:e.id,score:e.words.reduce((e,t)=>e+(n.includes(` ${t}`)?Math.min(3,t.length/4):0),0)})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,t).map(e=>e.id)}var w=e(t(),1),T=e(n(),1),pe=`oklch(50% 0.2 262)`,E=`oklch(32% 0.15 262)`,D=`oklch(90% 0.1 80)`,me={"--on":`white`,"--dot":D,"--ink-2":`oklch(96% 0.02 262)`,"--ink-3":`oklch(90% 0.035 262)`,"--moss":`oklch(90% 0.14 150)`,"--rose":`oklch(89% 0.09 45)`},O={kind:1,organization:1,site:2,details:3,know:4,space:5},he=e=>e!==null&&Object.hasOwn(O,e),ge=`w-full rounded-[18px] border border-white/30 bg-white/15 px-6 py-5 text-[1.375rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function _e(){return(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,T.jsx)(_,{size:28}),(0,T.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight`,children:[`engenty`,(0,T.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-(color:--dot)`,children:`.`}),(0,T.jsx)(`span`,{className:`font-normal text-white/70`,children:`wizards`})]})]})}function k({children:e,busy:t,onClick:n,type:r=`button`}){return(0,T.jsxs)(`button`,{type:r,disabled:t,onClick:n,className:`inline-flex h-13 cursor-pointer items-center gap-2.5 rounded-full bg-white px-7 font-semibold text-[1rem] transition hover:bg-white/90 disabled:cursor-default disabled:opacity-70`,style:{color:E},children:[e,(0,T.jsx)(d,{className:`size-[18px]`})]})}function A({children:e,onClick:t}){return(0,T.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer font-semibold text-[0.9375rem] text-white/85 transition hover:text-white`,children:e})}function j({step:e,total:t=4}){return(0,T.jsx)(`span`,{className:`ml-auto inline-flex gap-1.5`,role:`img`,"aria-label":y(`onboard.step`,{n:e,total:t}),children:Array.from({length:t},(e,t)=>t+1).map(t=>(0,T.jsx)(`span`,{className:u(`size-2 rounded-full`,t===e?`bg-white`:`bg-white/40`)},t))})}var ve=[{kind:`personal`,label:`onboard.kindPersonal`,sub:`onboard.kindPersonalSub`},{kind:`club`,label:`onboard.kindClub`,sub:`onboard.kindClubSub`},{kind:`small`,label:`onboard.kindSmall`,sub:`onboard.kindSmallSub`},{kind:`corp`,label:`onboard.kindCorp`,sub:`onboard.kindCorpSub`}];function ye(e){let t=(e.split(`@`)[1]??``).trim().toLowerCase();return t?b.has(t)?{kind:`personal`,domain:t}:/(verein|club|klub|^sv-|^fc-|^ff-|feuerwehr|musik|chor)/.test(t)?{kind:`club`,domain:t}:{kind:`small`,domain:t}:{kind:null,domain:t}}var be={club:[`0-50`,`50-250`,`250-1000`,`1000+`],small:[`1`,`2-9`,`10-49`],corp:[`50-249`,`250-999`,`1000+`]},M=e=>Number(e).toLocaleString(v),xe=e=>{if(e===`1`)return y(`onboard.justMe`);if(e.endsWith(`+`))return`${M(e.slice(0,-1))}+`;let[t,n]=e.split(`-`);return t===`0`?`≤ ${M(n)}`:`${M(t)}–${M(n)}`},Se=[`sport`,`culture`,`social`,`education`,`environment`,`rescue`,`other`],Ce=[`chair`,`board`,`treasurer`,`secretary`,`member`],we=[`management`,`it`,`marketing`,`sales`,`operations`,`other`],Te=`w-full rounded-[14px] border border-white/30 bg-white/15 px-4 py-3 text-[1.0625rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function Ee({picked:e,label:t,sub:n,onClick:r}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:r,className:u(`flex cursor-pointer flex-col gap-1 rounded-[18px] border px-5 py-4 text-left transition`,e?`border-white bg-white/25`:`border-white/30 bg-white/10 hover:bg-white/15`),children:[(0,T.jsx)(`span`,{className:`font-display font-semibold text-[1.125rem]`,children:t}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:n})]})}function N({label:e,options:t,value:n,text:r,onChange:i}){return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:e}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":n===e,onClick:()=>i(e),className:u(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,n===e?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:n===e?{color:E}:void 0,children:r(e)},e))})]})}function P(e,t,n){let r=`${De}${e}:${t}`,[i,a]=(0,w.useState)(()=>{try{let e=sessionStorage.getItem(r);return e===null?n:JSON.parse(e)}catch{return n}});return(0,w.useEffect)(()=>{try{sessionStorage.setItem(r,JSON.stringify(i))}catch{}},[r,i]),[i,a]}var De=`wizards.onboarding:`;function Oe(){try{for(let e of Object.keys(sessionStorage))e.startsWith(De)&&sessionStorage.removeItem(e)}catch{}}function F(){return g(pe),ie().data?.onboarding===`welcome`?(0,T.jsx)(Me,{}):(0,T.jsx)(I,{})}function I(){let e=ie(),t=a(),n=ee(),{project:c}=re(),l=e.data?.user.id??``,d=e.data?.onboarding===`organization`,f=d?4:5,m=e.data?.startingName?null:e.data?.tenant.name??null,[h,g]=P(l,`organization`,``),[_,b]=P(l,`line`,null),[ue,S]=P(l,`ticked`,null),[C,O]=P(l,`own`,[``]),[M,De]=(0,w.useState)(null),[F,I]=(0,w.useState)([]),Me=(0,w.useRef)(null),[Pe]=(0,w.useState)(ae),[B]=(0,w.useState)(()=>d?{kind:null,domain:``}:ye(e.data?.user.email??``)),[V,Fe]=P(l,`profile`,{kind:B.kind,size:null,sector:``,role:null,need:``,questions:``,phone:``}),[Ie,Le]=te(),H=Ie.get(`page`),U=he(H)&&(H===`kind`||V.kind)&&!(d&&H===`space`)?H:`kind`,W=e=>Le(t=>{let n=new URLSearchParams(t);return n.set(`page`,e),n}),G=e=>Fe(t=>({...t,...e})),K=V.kind===`personal`,q=m??(h.trim()||null),J=ne({queryKey:[`onboarding`,`suggest`],queryFn:()=>r.get(`/api/studio/onboarding/suggest`),enabled:!d&&!m&&!!V.kind&&!K,staleTime:1/0}).data?.site??null;(0,w.useEffect)(()=>{J&&!h&&g(J.name)},[J,h,g]);let Re=ne({queryKey:[`onboarding`,`find`,q],queryFn:()=>r.post(`/api/studio/onboarding/find`,{name:q,lang:v}),enabled:U===`site`&&!K&&!!q,staleTime:1/0}),Y=Re.data?.addresses??[],X=ue??Y.filter((e,t)=>e.kind!==`website`||!Y.slice(0,t).some(e=>e.kind===`website`)).map(e=>e.url),ze=C.map(e=>e.trim()).filter(e=>x(e)),Z=[...X,...ze],Be=!K&&Re.isSuccess&&Y.length===0,[Ve,He]=P(l,`anyway`,!1),Ue=_!==null||Be&&!ze.length&&!Ve,We=p({mutationFn:()=>r.put(`/api/studio/organization/profile`,{kind:V.kind,size:V.size,sector:V.sector.trim()||null,role:V.role,need:V.need.trim()||null,questions:(V.questions??``).trim()||null,phone:V.phone.trim()||null,website:Z.find(e=>de(e)===`website`)??null,links:Z})}),Ge=p({mutationFn:e=>r.put(`/api/studio/organization`,{name:e})}),Ke=()=>{W(`site`),t.invalidateQueries({queryKey:[`organization`]}),t.invalidateQueries({queryKey:[`me`]})},Q=p({mutationFn:e=>r.post(`/api/studio/projects/${c?.id}/website`,{urls:e,lang:v}),onSuccess:async e=>{let n=e?.sectors?.[0];n&&Fe(e=>e.sector?e:{...e,sector:n}),De(e??{name:``,about:!1,colors:0,fonts:0,logo:!1,facts:0,assets:0}),await t.invalidateQueries({queryKey:s.spaces()})}}),qe=p({mutationFn:e=>r.patch(`/api/studio/projects/${c?.id}`,{brand:{about:e}}),onSuccess:()=>t.invalidateQueries({queryKey:s.spaces()})}),$=p({mutationFn:()=>r.post(`/api/studio/onboarding/done`),onSuccess:async()=>{Oe(),await t.invalidateQueries({queryKey:[`me`]}),n(`/new`,{replace:!0})}}),Je=e.data?.user.name??``,Ye=Je.includes(`@`)?``:Je.split(` `)[0],Xe=d&&m?y(`onboard.kickerNew`,{organization:m}):Ye?y(`onboard.kicker1`,{name:Ye}):y(`onboard.kicker1Anon`),Ze=(e,t)=>q&&!K?y(e,{organization:q}):y(t),Qe=async e=>{if(e&&c){for(let t of Array.from(e)){I(e=>[...e,{name:t.name,state:`uploading`}]);try{await r.upload(`/api/studio/projects/${c.id}/files?kind=document`,t),I(e=>e.map(e=>e.name===t.name?{...e,state:`done`}:e))}catch{I(e=>e.map(e=>e.name===t.name?{...e,state:`failed`}:e))}}await t.invalidateQueries({queryKey:s.spaces()})}},$e=M?[M.about?y(`onboard.readAbout`):``,M.colors?y(`onboard.readColors`,{n:M.colors}):``,M.fonts?y(`onboard.readFonts`,{n:M.fonts}):``,M.logo?y(`onboard.readLogo`):``,M.facts?y(`onboard.readFacts`,{n:M.facts}):``,M.assets?y(`onboard.readAssets`,{n:M.assets}):``].join(``):``,et=[...new Set([...M?.sectors??[],...fe(`${q??``} ${_??``} ${V.questions??``}`,4)])].slice(0,4),tt=e=>`${window.location.host}/studio/${je(e)}`;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(ce,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:[(0,T.jsx)(oe,{kind:`drop`,size:240,fluffy:!0,coat:`fur`}),Pe?(0,T.jsxs)(`figure`,{className:`w-full max-w-sm rounded-[18px] bg-white/15 px-5 py-4`,children:[(0,T.jsx)(`figcaption`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:y(`onboard.wish`)}),(0,T.jsx)(`blockquote`,{className:`mt-1.5 line-clamp-6 whitespace-pre-line break-words text-[1rem] leading-relaxed`,children:Pe}),(0,T.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-white/75`,children:y(`onboard.wishNext`)})]}):null]}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[U===`kind`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),V.kind&&W(V.kind===`personal`||m?`site`:`organization`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:y(`onboard.kind`)}),(0,T.jsx)(z,{children:d&&m?y(`onboard.kindSubOrganization`,{organization:m}):y(`onboard.kindSub`)}),B.kind?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:y(`onboard.guess`,{domain:B.domain,kind:y(ve.find(e=>e.kind===B.kind)?.label??`onboard.kindSmall`)})}):null,(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:ve.map(e=>(0,T.jsx)(Ee,{picked:V.kind===e.kind,label:y(e.label),sub:y(e.sub),onClick:()=>G({kind:e.kind,size:e.kind===V.kind?V.size:null})},e.kind))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,children:y(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:f})]})]}):null,U===`organization`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=h.trim();t?Ge.mutate(t,{onSuccess:Ke}):W(`site`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:y(`onboard.organization`)}),(0,T.jsx)(z,{children:y(`onboard.organizationSub`)}),(0,T.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),placeholder:y(`onboard.organizationPlaceholder`),maxLength:80,"aria-label":y(`onboard.organization`),className:ge}),h.trim()?(0,T.jsxs)(`p`,{className:`-mt-2 text-[0.9375rem] text-white/85`,children:[J&&h===J.name?`${y(`onboard.nameFrom`,{domain:new URL(J.url).host})} `:``,y(`onboard.address`),` `,(0,T.jsx)(`span`,{className:`font-mono text-[0.875rem]`,style:{color:D},children:tt(h)})]}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:Ge.isPending,children:y(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:f})]})]}):null,U===`site`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:K?y(`onboard.kicker2Personal`):Ze(`onboard.kicker2Named`,`onboard.kicker2`)}),(0,T.jsx)(R,{children:K?y(`onboard.linksPersonal`):Be&&!Ve&&q?y(`onboard.noneFound`,{name:q}):q?y(`onboard.siteNamed`,{organization:q}):y(`onboard.site`)}),(0,T.jsx)(z,{children:K?y(`onboard.linksPersonalSub`):Be&&!Ve&&q?y(`onboard.noneFoundSub`,{name:q}):Re.isPending?y(`onboard.searching`,{name:q??``}):y(`onboard.foundSub`)}),Ue?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=(_??``).trim();t?qe.mutate(t,{onSuccess:()=>W(`details`)}):W(`details`)},children:[(0,T.jsx)(ke,{value:_??``,onChange:b,rows:4,label:y(`onboard.line`),placeholder:y(K?`onboard.linePlaceholderPersonal`:`onboard.linePlaceholder`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>{b(null),He(!0),O(e=>e.length?e:[``])},className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,y(`onboard.addressAfterAll`)]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:qe.isPending,children:y(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:y(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:f})]})]}):(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),M?W(`details`):Z.length&&!Q.isPending&&Q.mutate(Z)},children:[Y.length?(0,T.jsx)(`div`,{className:`flex flex-col gap-2`,children:Y.map(e=>(0,T.jsx)(Ae,{address:e,picked:X.includes(e.url),onToggle:()=>S(X.includes(e.url)?X.filter(t=>t!==e.url):[...X,e.url])},e.url))}):null,!K&&Y.length?(0,T.jsx)(`p`,{className:`-mb-2 text-[0.9375rem] text-white/85`,children:y(`onboard.own`)}):null,C.map((e,t)=>(0,T.jsxs)(`div`,{className:`relative`,children:[(0,T.jsx)(`input`,{value:e,onChange:e=>O(n=>n.map((n,r)=>r===t?e.target.value:n)),placeholder:y(K?`onboard.linkPlaceholderPersonal`:`onboard.ownPlaceholder`),autoCapitalize:`none`,"aria-label":y(`onboard.own`),className:u(Te,`pr-28`)}),x(e)?(0,T.jsx)(`span`,{className:`-translate-y-1/2 absolute top-1/2 right-3 rounded-full bg-white/20 px-2.5 py-0.5 font-semibold text-[0.75rem]`,children:le[de(e)]}):null]},t)),C.length+Y.length<10?(0,T.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>[...e,``]),className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,y(`onboard.addAddress`)]}):null,M?(0,T.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.9375rem] text-(color:--moss)`,children:[(0,T.jsx)(o,{className:`size-4`}),M.name?y(`onboard.readDone`,{name:M.name,details:$e}):y(`onboard.readKept`,{n:Z.length})]}):Q.isError?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-(color:--rose)`,children:y(`onboard.readFailed`)}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[M?(0,T.jsx)(k,{type:`submit`,children:y(`onboard.continue`)}):(0,T.jsx)(k,{type:`submit`,busy:Q.isPending,children:Q.isPending?y(`onboard.reading`):y(`onboard.read`)}),(0,T.jsx)(A,{onClick:()=>b(``),children:y(`onboard.line`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:y(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:f})]})]})]}):null,U===`details`&&V.kind?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),We.mutate(),W(`know`)},children:[(0,T.jsx)(L,{children:K||!q?Xe:q}),(0,T.jsx)(R,{small:!0,children:K?y(`onboard.personalTitle`):q?y(`onboard.aboutOrganization`,{organization:q}):y(V.kind===`club`?`onboard.clubTitle`:`onboard.businessTitle`)}),K?(0,T.jsx)(ke,{value:V.need,onChange:e=>G({need:e}),rows:4,label:y(`onboard.personalTitle`),placeholder:y(`onboard.personalPlaceholder`)}):null,V.kind===`club`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:y(`onboard.clubKind`),options:Se,value:V.sector,text:e=>y(`onboard.club.${e}`),onChange:e=>G({sector:e})}),(0,T.jsx)(N,{label:y(`onboard.members`),options:be.club,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(N,{label:y(`onboard.yourRole`),options:Ce,value:V.role,text:e=>y(`onboard.role.${e}`),onChange:e=>G({role:e})})]}):null,V.kind===`small`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:y(`onboard.people`),options:be.small,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et})]}):null,V.kind===`corp`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:y(`onboard.people`),options:be.corp,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et}),(0,T.jsx)(N,{label:y(`onboard.yourRole`),options:we,value:V.role,text:e=>y(`onboard.role.${e}`),onChange:e=>G({role:e})}),(0,T.jsxs)(`label`,{className:`flex flex-col gap-2 text-[0.9375rem] text-white/85`,children:[(0,T.jsxs)(`span`,{children:[y(`onboard.phone`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:y(`onboard.phoneWhy`)})]}),(0,T.jsx)(`input`,{type:`tel`,value:V.phone,onChange:e=>G({phone:e.target.value.replace(/[^+0-9 ()/.-]/g,``)}),placeholder:`+43 …`,maxLength:40,autoComplete:`tel`,className:Te})]})]}):null,K?null:(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,T.jsxs)(`span`,{className:`text-[0.9375rem] text-white/85`,children:[y(`onboard.questions`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:y(`onboard.optional`)})]}),(0,T.jsx)(ke,{value:V.questions??``,onChange:e=>G({questions:e}),rows:3,label:y(`onboard.questions`),placeholder:y(`onboard.questionsPlaceholder`)}),(0,T.jsx)(`span`,{className:`text-[0.8125rem] text-white/70`,children:y(`onboard.questionsHint`)})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:We.isPending,children:y(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>window.history.state?.idx>0?n(-1):W(`site`),children:y(`onboard.back`)}),(0,T.jsx)(j,{step:3,total:f})]})]}):null,U===`know`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker3Named`,`onboard.kicker3`)}),(0,T.jsx)(R,{children:y(`onboard.know`)}),(0,T.jsx)(z,{children:y(`onboard.knowSub`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>Me.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),Qe(e.dataTransfer.files)},className:`flex cursor-pointer flex-col items-center gap-2 rounded-[18px] border-2 border-white/45 border-dashed bg-white/10 px-6 py-7 text-center transition hover:bg-white/15`,children:[(0,T.jsx)(se,{className:`size-7`}),(0,T.jsx)(`span`,{className:`font-semibold text-[1.0625rem]`,children:y(`onboard.drop`)}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:`PDF · Word · Excel · Markdown`}),(0,T.jsx)(`input`,{ref:Me,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{Qe(e.target.files),e.target.value=``}})]}),F.length?(0,T.jsx)(`ul`,{className:`flex flex-col gap-2`,children:F.map(e=>(0,T.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-xl bg-white/15 px-3.5 py-2.5 text-[0.875rem]`,children:[(0,T.jsx)(i,{className:`size-4 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,T.jsx)(`span`,{className:u(`text-white/80`,e.state===`failed`?`text-(color:--rose)`:``),children:e.state===`uploading`?y(`onboard.uploading`):e.state===`done`?y(`onboard.uploaded`):y(`onboard.uploadFailed`)})]},e.name))}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:F.some(e=>e.state===`uploading`)||$.isPending,onClick:()=>d?$.mutate():W(`space`),children:y(d?`onboard.buildFirst`:`onboard.continue`)}),F.length||d?null:(0,T.jsx)(A,{onClick:()=>W(`space`),children:y(`onboard.skip`)}),(0,T.jsx)(j,{step:4,total:f})]})]}):null,U===`space`&&!d?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker4Named`,`onboard.kicker4`)}),(0,T.jsx)(R,{children:q&&!K?y(`onboard.spaceNamed`,{organization:q}):y(`onboard.space`)}),(0,T.jsx)(z,{children:y(`onboard.spaceSub`,{space:c?.name??``})}),(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[[`partInfo`,`partInfoText`,!!(M||_)],[`partKnow`,`partKnowText`,F.some(e=>e.state===`done`)],[`partData`,`partDataText`,!1],[`partResults`,`partResultsText`,!1]].map(([e,t,n])=>(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-2xl border border-white/20 bg-white/10 px-4.5 py-4`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-2 font-semibold text-[1rem]`,children:[n?(0,T.jsx)(o,{className:`size-4 text-(color:--moss)`}):null,y(`onboard.${e}`)]}),(0,T.jsx)(`span`,{className:`text-[0.84375rem] text-white/85 leading-snug`,children:y(`onboard.${t}`)})]},e))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:$.isPending,onClick:()=>$.mutate(),children:y(`onboard.build`)}),(0,T.jsx)(j,{step:5,total:f})]})]}):null]},U)]}),(0,T.jsxs)(`footer`,{className:`mx-auto flex w-full max-w-6xl items-center justify-between pb-6 text-[0.75rem] text-white/55 sm:pb-8`,children:[(0,T.jsx)(`span`,{children:`engenty.wizards`}),(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px] bg-(color:--dot)`})]})]})}function L({children:e}){return(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:e})}function R({children:e,small:t}){return(0,T.jsx)(`h1`,{className:u(`font-display font-bold leading-[1.05] tracking-[-0.02em]`,t?`text-[2.25rem] sm:text-[2.75rem]`:`text-[2.5rem] sm:text-[3.25rem]`),children:e})}function z({children:e}){return(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:e})}function ke({value:e,onChange:t,rows:n,label:r,placeholder:i}){let[a]=f(),o=l(e,t,{deviceId:a.deviceId});return(0,T.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[18px] border border-white/30 bg-white/15 px-4 pt-3 pb-3 focus-within:border-white/60`,children:[(0,T.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),placeholder:o.listening?y(`editor.listening`):i,rows:n,maxLength:4e3,"aria-label":r,className:`w-full resize-none bg-transparent text-[1.0625rem] text-white leading-relaxed outline-none placeholder:text-white/55`}),o.supported?(0,T.jsx)(`div`,{className:`self-end`,style:{"--ink":`white`,"--border":`rgb(255 255 255 / 0.55)`},children:(0,T.jsx)(c,{speech:o,labelled:!0})}):null]})}function Ae({address:e,picked:t,onToggle:n}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":t,onClick:n,className:u(`flex cursor-pointer items-center gap-3.5 rounded-[14px] border px-4 py-2.5 text-left transition`,t?`border-white bg-white/22`:`border-white/30 bg-white/8 hover:bg-white/12`),children:[(0,T.jsx)(`span`,{className:u(`flex size-5 shrink-0 items-center justify-center rounded-md border-2`,t?`border-white bg-white`:`border-white/60`),style:t?{color:E}:void 0,children:t?(0,T.jsx)(o,{className:`size-3.5`,strokeWidth:3}):null}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`font-semibold text-[0.6875rem] text-white/70 uppercase tracking-[0.1em]`,children:le[e.kind]}),(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.9375rem]`,children:e.url.replace(/^https?:\/\/(www\.)?/,``).replace(/\/$/,``)}),(0,T.jsx)(`span`,{className:`truncate text-[0.8125rem] text-white/80`,children:e.title})]}),(0,T.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-white/70 max-sm:hidden`,children:y(e.source===`email`?`onboard.fromEmail`:`onboard.fromWeb`)})]})}function je(e){return e.toLowerCase().replace(/['’]/g,``).replace(/ä/g,`ae`).replace(/ö/g,`oe`).replace(/ü/g,`ue`).replace(/ß/g,`ss`).normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,35).replace(/-+$/,``)}function Me(){let e=ie(),t=a(),n=ee(),i=h(),o=e.data?.tenant,s=ne({queryKey:[`organization`,o?.id],queryFn:()=>r.get(`/api/studio/organization`),enabled:!!o}),c=p({mutationFn:()=>r.post(`/api/studio/onboarding/done`),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`me`]}),n(`/`,{replace:!0})}});if(!(e.data&&o))return null;let l=o.name??``,u=e.data.user.name,te=u.includes(`@`)?``:u.split(` `)[0],d=e.data.organizations.find(e=>e.id===o.id)?.invitedBy?.name,f=s.data?.members.find(t=>t.role===`owner`&&t.userId!==e.data?.user.id)?.name,re=o.role!==`member`,ae=o.slug?`${window.location.host}/studio/${o.slug}`:null;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(ce,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsx)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:(0,T.jsx)(oe,{kind:`drop`,size:240,fluffy:!0,coat:`fur`})}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:te?y(`onboard.kicker1`,{name:te}):y(`onboard.kicker1Anon`)}),(0,T.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:y(`welcome.title`,{organization:l})}),(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:d?y(`welcome.invited`,{name:d}):f?y(`welcome.setUp`,{name:f,organization:l}):y(`welcome.plain`)}),(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-[18px] bg-white/12 ring-1 ring-white/20`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3.5 px-4.5 py-3.5`,children:[(0,T.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl font-bold font-display`,style:{background:D,color:E},children:m(l)}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`truncate font-semibold text-[1.0625rem]`,children:l}),ae?(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.8125rem] text-white/75`,children:ae}):null]}),(0,T.jsx)(`span`,{className:`rounded-full bg-white/20 px-2.5 py-1 font-semibold text-[0.75rem]`,children:y(`organization.role.${o.role}`)})]}),i.data?.some(e=>e.wizardCount>0)?i.data.map(e=>(0,T.jsxs)(`div`,{className:`flex justify-between gap-3 border-white/15 border-t px-4.5 py-2.5 text-[0.9375rem]`,children:[(0,T.jsx)(`span`,{className:`truncate`,children:e.name}),(0,T.jsx)(`span`,{className:`shrink-0 text-white/75`,children:y(`welcome.wizards`,{n:e.wizardCount})})]},e.id)):(0,T.jsx)(`p`,{className:`border-white/15 border-t px-4.5 py-3 text-[0.9375rem] text-white/80`,children:y(`welcome.noWizards`)})]}),(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:y(re?`welcome.canBuild`:`welcome.canMember`)}),(0,T.jsx)(`div`,{className:`flex flex-wrap items-center gap-5`,children:(0,T.jsx)(k,{busy:c.isPending,onClick:()=>c.mutate(),children:y(`welcome.go`)})})]})]})]})}function Ne({value:e,onChange:t,suggested:n}){let[r,i]=(0,w.useState)(!1),a=C(e),o=[...new Set([...a?[a.id]:[],...n])].slice(0,4),s=e=>C(e)?.name[v===`de`?`de`:`en`]??e;return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:y(`onboard.sector`)}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.map(n=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":e===n,onClick:()=>t(n),className:u(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,e===n?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:e===n?{color:E}:void 0,children:s(n)},n)),(0,T.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>i(e=>!e),className:`cursor-pointer rounded-full border border-white/40 border-dashed px-4 py-2 text-[0.9375rem] hover:bg-white/15`,children:y(`onboard.sectorOther`)})]}),r?(0,T.jsxs)(`select`,{value:a?e:``,onChange:e=>{t(e.target.value),i(!1)},"aria-label":y(`onboard.sector`),className:u(Te,`[&>option]:text-black`),children:[(0,T.jsx)(`option`,{value:``,children:y(`onboard.sectorPick`)}),[...S].sort((e,t)=>s(e.id).localeCompare(s(t.id),v)).map(e=>(0,T.jsx)(`option`,{value:e.id,children:s(e.id)},e.id))]}):null,a?(0,T.jsxs)(`span`,{className:`text-[0.8125rem] text-white/75`,children:[y(`onboard.sectorHint`),` `,(0,T.jsx)(`b`,{style:{color:D},children:y(`onboard.catalog`,{sector:s(a.id)})})]}):null]})}export{F as OnboardingPage};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{G as r,Mn as i,Mr as a,Un as o,W as s,i as c,ir as ee,l,on as u,or as te,qn as d,sr as ne,u as f}from"./ui-CBDsXUoA.js";import{t as p}from"./useMutation-ZHWqRSPd.js";import{d as re,g as ie,i as ae,n as m,v as h,w as g,x as oe}from"./session-DUxZmhqy.js";import{t as se}from"./upload-CZgdEF60.js";import{t as _}from"./logo-CGNoptDg.js";import{n as v,s as y}from"./i18n-AXoEWXfv.js";import{tt as ce}from"./index-Dx7qMiM3.js";var b=new Set([`gmail.com`,`googlemail.com`,`gmx.at`,`gmx.de`,`gmx.net`,`web.de`,`outlook.com`,`hotmail.com`,`live.com`,`icloud.com`,`me.com`,`yahoo.com`,`yahoo.de`,`aon.at`,`a1.net`,`chello.at`,`t-online.de`,`proton.me`,`protonmail.com`]),le={website:`Website`,blog:`Blog`,linkedin:`LinkedIn`,instagram:`Instagram`,facebook:`Facebook`,youtube:`YouTube`,x:`X`,xing:`XING`,tiktok:`TikTok`},ue=[[`linkedin`,/(^|\.)linkedin\.com$/],[`instagram`,/(^|\.)instagram\.com$/],[`facebook`,/(^|\.)(facebook|fb)\.com$/],[`youtube`,/(^|\.)(youtube\.com|youtu\.be)$/],[`x`,/(^|\.)(x|twitter)\.com$/],[`xing`,/(^|\.)xing\.com$/],[`tiktok`,/(^|\.)tiktok\.com$/]];function x(e){let t=e.trim();if(!t||/\s/.test(t))return null;try{let e=new URL(/^https?:\/\//i.test(t)?t:`https://${t}`);return e.hostname.includes(`.`)?e.href:null}catch{return null}}function de(e){let t=x(e);if(!t)return`website`;let{hostname:n,pathname:r}=new URL(t),i=n.toLowerCase().replace(/^www\./,``);for(let[e,t]of ue)if(t.test(i))return e;return/^blog\./.test(i)||/^\/blog(\/|$)/.test(r)||/(^|\.)(medium|substack)\.com$/.test(i)?`blog`:`website`}var S=[{id:`bakeries`,industry:`gastronomy`,name:{de:`Bäckereien`,en:`Bakeries`},words:[`bäckerei`,`bäcker`,`backstube`,`brot`,`gebäck`,`konditorei`,`bakery`,`bread`,`pastry`]},{id:`cafes`,industry:`gastronomy`,name:{de:`Cafés`,en:`Cafés`},words:[`café`,`cafe`,`kaffeehaus`,`kaffee`,`coffee`,`espresso`]},{id:`restaurants`,industry:`gastronomy`,name:{de:`Restaurants`,en:`Restaurants`},words:[`restaurant`,`gasthaus`,`gasthof`,`wirtshaus`,`pizzeria`,`küche`,`speisekarte`,`menu`,`bistro`]},{id:`hotels`,industry:`hospitality`,name:{de:`Hotels und Pensionen`,en:`Hotels and guesthouses`},words:[`hotel`,`pension`,`zimmer`,`übernachtung`,`ferienwohnung`,`guesthouse`,`booking`,`rooms`]},{id:`architects`,industry:`professional`,name:{de:`Architekturbüros`,en:`Architects`},words:[`architekt`,`architektur`,`planung`,`entwurf`,`architect`,`architecture`]},{id:`lawFirms`,industry:`professional`,name:{de:`Kanzleien`,en:`Law firms`},words:[`rechtsanwalt`,`anwalt`,`kanzlei`,`recht`,`notar`,`law firm`,`lawyer`,`attorney`,`legal`]},{id:`taxAdvisors`,industry:`professional`,name:{de:`Steuerberatung`,en:`Tax advisors`},words:[`steuerberatung`,`steuerberater`,`steuer`,`buchhaltung`,`lohnverrechnung`,`bilanz`,`tax`,`accounting`,`bookkeeping`]},{id:`consultants`,industry:`professional`,name:{de:`Beratung`,en:`Consultants`},words:[`beratung`,`berater`,`consulting`,`coaching`,`consultant`]},{id:`physiotherapy`,industry:`health`,name:{de:`Physiotherapie`,en:`Physiotherapy`},words:[`physiotherapie`,`physio`,`massage`,`therapie`,`physiotherapy`]},{id:`practices`,industry:`health`,name:{de:`Arztpraxen`,en:`Doctors’ practices`},words:[`arzt`,`ärztin`,`praxis`,`ordination`,`zahnarzt`,`doctor`,`clinic`,`dentist`]},{id:`hairdressers`,industry:`retail`,name:{de:`Friseur und Kosmetik`,en:`Hair and beauty`},words:[`friseur`,`frisör`,`kosmetik`,`nagelstudio`,`beauty`,`hairdresser`,`salon`]},{id:`joiners`,industry:`trades`,name:{de:`Tischlereien`,en:`Joiners`},words:[`tischlerei`,`tischler`,`schreiner`,`möbel`,`holz`,`joinery`,`carpenter`,`furniture`]},{id:`electricians`,industry:`trades`,name:{de:`Elektrotechnik`,en:`Electricians`},words:[`elektriker`,`elektro`,`elektrotechnik`,`photovoltaik`,`electrician`,`electrical`]},{id:`plumbing`,industry:`trades`,name:{de:`Installateure`,en:`Plumbing and heating`},words:[`installateur`,`sanitär`,`heizung`,`klima`,`plumber`,`plumbing`,`heating`]},{id:`windows`,industry:`trades`,name:{de:`Fensterbau`,en:`Window makers`},words:[`fenster`,`türen`,`fensterbau`,`sonnenschutz`,`windows`,`doors`]},{id:`construction`,industry:`trades`,name:{de:`Bau und Handwerk`,en:`Building and trades`},words:[`bau`,`baumeister`,`maler`,`dachdecker`,`handwerk`,`construction`,`builder`,`painter`,`roofer`]},{id:`realEstate`,industry:`realEstate`,name:{de:`Immobilien`,en:`Real estate`},words:[`immobilien`,`makler`,`wohnung`,`miete`,`hausverwaltung`,`real estate`,`property`,`estate agent`]},{id:`onlineShops`,industry:`retail`,name:{de:`Online-Shops`,en:`Online shops`},words:[`online-shop`,`onlineshop`,`shop`,`versand`,`e-commerce`,`webshop`,`online store`]},{id:`retail`,industry:`retail`,name:{de:`Handel`,en:`Retail`},words:[`geschäft`,`handel`,`laden`,`boutique`,`retail`,`store`]},{id:`agencies`,industry:`agency`,name:{de:`Agenturen`,en:`Agencies`},words:[`agentur`,`werbung`,`marketing`,`design`,`kommunikation`,`agency`,`advertising`,`branding`]},{id:`photographers`,industry:`agency`,name:{de:`Fotografie`,en:`Photographers`},words:[`fotograf`,`fotografie`,`foto`,`photographer`,`photography`]},{id:`events`,industry:`events`,name:{de:`Veranstaltungen`,en:`Events`},words:[`event`,`veranstaltung`,`hochzeit`,`catering`,`konferenz`,`wedding`,`conference`]},{id:`itServices`,industry:`professional`,name:{de:`IT-Dienstleister`,en:`IT services`},words:[`it-dienstleister`,`it-service`,`software`,`webentwicklung`,`hosting`,`netzwerk`,`development`,`web design`]},{id:`cleaning`,industry:`trades`,name:{de:`Reinigung`,en:`Cleaning`},words:[`reinigung`,`gebäudereinigung`,`putz`,`cleaning`,`janitorial`]},{id:`footballClubs`,industry:`any`,name:{de:`Fußballvereine`,en:`Football clubs`},words:[`fußball`,`fussball`,`fc`,`sv`,`kicker`,`football`,`soccer`]},{id:`sportsClubs`,industry:`any`,name:{de:`Sportvereine`,en:`Sports clubs`},words:[`sportverein`,`verein`,`turnen`,`tennis`,`laufen`,`sport`,`club`]},{id:`musicClubs`,industry:`events`,name:{de:`Musikvereine und Chöre`,en:`Music clubs and choirs`},words:[`musikverein`,`blasmusik`,`chor`,`kapelle`,`orchester`,`band`,`choir`,`music`]},{id:`fireBrigades`,industry:`publicSector`,name:{de:`Feuerwehren`,en:`Fire brigades`},words:[`feuerwehr`,`rettung`,`rotes kreuz`,`fire brigade`,`rescue`]},{id:`schools`,industry:`publicSector`,name:{de:`Schulen und Bildung`,en:`Schools and education`},words:[`schule`,`kurs`,`weiterbildung`,`akademie`,`nachhilfe`,`school`,`course`,`training`]},{id:`municipalities`,industry:`publicSector`,name:{de:`Gemeinden`,en:`Municipalities`},words:[`gemeinde`,`stadt`,`bürgerservice`,`amt`,`municipality`,`council`,`town`]},{id:`associations`,industry:`any`,name:{de:`Vereine und Initiativen`,en:`Associations`},words:[`verein`,`initiative`,`ehrenamt`,`verband`,`association`,`nonprofit`,`charity`]}],C=e=>S.find(t=>t.id===e)??null;function fe(e,t=3){let n=` ${e.toLowerCase().normalize(`NFC`).replace(/[^\p{L}\p{N}-]+/gu,` `)} `;return S.map(e=>({id:e.id,score:e.words.reduce((e,t)=>e+(n.includes(` ${t}`)?Math.min(3,t.length/4):0),0)})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,t).map(e=>e.id)}var w=e(t(),1),T=e(n(),1),pe=`oklch(50% 0.2 262)`,E=`oklch(32% 0.15 262)`,D=`oklch(90% 0.1 80)`,me={"--on":`white`,"--dot":D,"--ink-2":`oklch(96% 0.02 262)`,"--ink-3":`oklch(90% 0.035 262)`,"--moss":`oklch(90% 0.14 150)`,"--rose":`oklch(89% 0.09 45)`},O={kind:1,organization:1,site:2,details:3,know:4,space:5},he=e=>e!==null&&Object.hasOwn(O,e),ge=`w-full rounded-[18px] border border-white/30 bg-white/15 px-6 py-5 text-[1.375rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function _e(){return(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,T.jsx)(_,{size:28}),(0,T.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight`,children:[`engenty`,(0,T.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-(color:--dot)`,children:`.`}),(0,T.jsx)(`span`,{className:`font-normal text-white/70`,children:`wizards`})]})]})}function k({children:e,busy:t,onClick:n,type:r=`button`}){return(0,T.jsxs)(`button`,{type:r,disabled:t,onClick:n,className:`inline-flex h-13 cursor-pointer items-center gap-2.5 rounded-full bg-white px-7 font-semibold text-[1rem] transition hover:bg-white/90 disabled:cursor-default disabled:opacity-70`,style:{color:E},children:[e,(0,T.jsx)(d,{className:`size-[18px]`})]})}function A({children:e,onClick:t}){return(0,T.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer font-semibold text-[0.9375rem] text-white/85 transition hover:text-white`,children:e})}function j({step:e,total:t=4}){return(0,T.jsx)(`span`,{className:`ml-auto inline-flex gap-1.5`,role:`img`,"aria-label":y(`onboard.step`,{n:e,total:t}),children:Array.from({length:t},(e,t)=>t+1).map(t=>(0,T.jsx)(`span`,{className:u(`size-2 rounded-full`,t===e?`bg-white`:`bg-white/40`)},t))})}var ve=[{kind:`personal`,label:`onboard.kindPersonal`,sub:`onboard.kindPersonalSub`},{kind:`club`,label:`onboard.kindClub`,sub:`onboard.kindClubSub`},{kind:`small`,label:`onboard.kindSmall`,sub:`onboard.kindSmallSub`},{kind:`corp`,label:`onboard.kindCorp`,sub:`onboard.kindCorpSub`}];function ye(e){let t=(e.split(`@`)[1]??``).trim().toLowerCase();return t?b.has(t)?{kind:`personal`,domain:t}:/(verein|club|klub|^sv-|^fc-|^ff-|feuerwehr|musik|chor)/.test(t)?{kind:`club`,domain:t}:{kind:`small`,domain:t}:{kind:null,domain:t}}var be={club:[`0-50`,`50-250`,`250-1000`,`1000+`],small:[`1`,`2-9`,`10-49`],corp:[`50-249`,`250-999`,`1000+`]},M=e=>Number(e).toLocaleString(v),xe=e=>{if(e===`1`)return y(`onboard.justMe`);if(e.endsWith(`+`))return`${M(e.slice(0,-1))}+`;let[t,n]=e.split(`-`);return t===`0`?`≤ ${M(n)}`:`${M(t)}–${M(n)}`},Se=[`sport`,`culture`,`social`,`education`,`environment`,`rescue`,`other`],Ce=[`chair`,`board`,`treasurer`,`secretary`,`member`],we=[`management`,`it`,`marketing`,`sales`,`operations`,`other`],Te=`w-full rounded-[14px] border border-white/30 bg-white/15 px-4 py-3 text-[1.0625rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function Ee({picked:e,label:t,sub:n,onClick:r}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:r,className:u(`flex cursor-pointer flex-col gap-1 rounded-[18px] border px-5 py-4 text-left transition`,e?`border-white bg-white/25`:`border-white/30 bg-white/10 hover:bg-white/15`),children:[(0,T.jsx)(`span`,{className:`font-display font-semibold text-[1.125rem]`,children:t}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:n})]})}function N({label:e,options:t,value:n,text:r,onChange:i}){return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:e}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":n===e,onClick:()=>i(e),className:u(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,n===e?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:n===e?{color:E}:void 0,children:r(e)},e))})]})}function P(e,t,n){let r=`${De}${e}:${t}`,[i,a]=(0,w.useState)(()=>{try{let e=sessionStorage.getItem(r);return e===null?n:JSON.parse(e)}catch{return n}});return(0,w.useEffect)(()=>{try{sessionStorage.setItem(r,JSON.stringify(i))}catch{}},[r,i]),[i,a]}var De=`wizards.onboarding:`;function Oe(){try{for(let e of Object.keys(sessionStorage))e.startsWith(De)&&sessionStorage.removeItem(e)}catch{}}function F(){return g(pe),ie().data?.onboarding===`welcome`?(0,T.jsx)(Me,{}):(0,T.jsx)(I,{})}function I(){let e=ie(),t=a(),n=ee(),{project:c}=re(),l=e.data?.user.id??``,d=e.data?.onboarding===`organization`,f=d?4:5,m=e.data?.startingName?null:e.data?.tenant.name??null,[h,g]=P(l,`organization`,``),[_,b]=P(l,`line`,null),[ue,S]=P(l,`ticked`,null),[C,O]=P(l,`own`,[``]),[M,De]=(0,w.useState)(null),[F,I]=(0,w.useState)([]),Me=(0,w.useRef)(null),[Pe]=(0,w.useState)(ae),[B]=(0,w.useState)(()=>d?{kind:null,domain:``}:ye(e.data?.user.email??``)),[V,Fe]=P(l,`profile`,{kind:B.kind,size:null,sector:``,role:null,need:``,questions:``,phone:``}),[Ie,Le]=te(),H=Ie.get(`page`),U=he(H)&&(H===`kind`||V.kind)&&!(d&&H===`space`)?H:`kind`,W=e=>Le(t=>{let n=new URLSearchParams(t);return n.set(`page`,e),n}),G=e=>Fe(t=>({...t,...e})),K=V.kind===`personal`,q=m??(h.trim()||null),J=ne({queryKey:[`onboarding`,`suggest`],queryFn:()=>r.get(`/api/studio/onboarding/suggest`),enabled:!d&&!m&&!!V.kind&&!K,staleTime:1/0}).data?.site??null;(0,w.useEffect)(()=>{J&&!h&&g(J.name)},[J,h,g]);let Re=ne({queryKey:[`onboarding`,`find`,q],queryFn:()=>r.post(`/api/studio/onboarding/find`,{name:q,lang:v}),enabled:U===`site`&&!K&&!!q,staleTime:1/0}),Y=Re.data?.addresses??[],X=ue??Y.filter((e,t)=>e.kind!==`website`||!Y.slice(0,t).some(e=>e.kind===`website`)).map(e=>e.url),ze=C.map(e=>e.trim()).filter(e=>x(e)),Z=[...X,...ze],Be=!K&&Re.isSuccess&&Y.length===0,[Ve,He]=P(l,`anyway`,!1),Ue=_!==null||Be&&!ze.length&&!Ve,We=p({mutationFn:()=>r.put(`/api/studio/organization/profile`,{kind:V.kind,size:V.size,sector:V.sector.trim()||null,role:V.role,need:V.need.trim()||null,questions:(V.questions??``).trim()||null,phone:V.phone.trim()||null,website:Z.find(e=>de(e)===`website`)??null,links:Z})}),Ge=p({mutationFn:e=>r.put(`/api/studio/organization`,{name:e})}),Ke=()=>{W(`site`),t.invalidateQueries({queryKey:[`organization`]}),t.invalidateQueries({queryKey:[`me`]})},Q=p({mutationFn:e=>r.post(`/api/studio/projects/${c?.id}/website`,{urls:e,lang:v}),onSuccess:async e=>{let n=e?.sectors?.[0];n&&Fe(e=>e.sector?e:{...e,sector:n}),De(e??{name:``,about:!1,colors:0,fonts:0,logo:!1,facts:0,assets:0}),await t.invalidateQueries({queryKey:s.spaces()})}}),qe=p({mutationFn:e=>r.patch(`/api/studio/projects/${c?.id}`,{brand:{about:e}}),onSuccess:()=>t.invalidateQueries({queryKey:s.spaces()})}),$=p({mutationFn:()=>r.post(`/api/studio/onboarding/done`),onSuccess:async()=>{Oe(),await t.invalidateQueries({queryKey:[`me`]}),n(`/new`,{replace:!0})}}),Je=e.data?.user.name??``,Ye=Je.includes(`@`)?``:Je.split(` `)[0],Xe=d&&m?y(`onboard.kickerNew`,{organization:m}):Ye?y(`onboard.kicker1`,{name:Ye}):y(`onboard.kicker1Anon`),Ze=(e,t)=>q&&!K?y(e,{organization:q}):y(t),Qe=async e=>{if(e&&c){for(let t of Array.from(e)){I(e=>[...e,{name:t.name,state:`uploading`}]);try{await r.upload(`/api/studio/projects/${c.id}/files?kind=document`,t),I(e=>e.map(e=>e.name===t.name?{...e,state:`done`}:e))}catch{I(e=>e.map(e=>e.name===t.name?{...e,state:`failed`}:e))}}await t.invalidateQueries({queryKey:s.spaces()})}},$e=M?[M.about?y(`onboard.readAbout`):``,M.colors?y(`onboard.readColors`,{n:M.colors}):``,M.fonts?y(`onboard.readFonts`,{n:M.fonts}):``,M.logo?y(`onboard.readLogo`):``,M.facts?y(`onboard.readFacts`,{n:M.facts}):``,M.assets?y(`onboard.readAssets`,{n:M.assets}):``].join(``):``,et=[...new Set([...M?.sectors??[],...fe(`${q??``} ${_??``} ${V.questions??``}`,4)])].slice(0,4),tt=e=>`${window.location.host}/studio/${je(e)}`;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(ce,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:[(0,T.jsx)(oe,{kind:`drop`,size:240,fluffy:!0,coat:`fur`}),Pe?(0,T.jsxs)(`figure`,{className:`w-full max-w-sm rounded-[18px] bg-white/15 px-5 py-4`,children:[(0,T.jsx)(`figcaption`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:y(`onboard.wish`)}),(0,T.jsx)(`blockquote`,{className:`mt-1.5 line-clamp-6 whitespace-pre-line break-words text-[1rem] leading-relaxed`,children:Pe}),(0,T.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-white/75`,children:y(`onboard.wishNext`)})]}):null]}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[U===`kind`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),V.kind&&W(V.kind===`personal`||m?`site`:`organization`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:y(`onboard.kind`)}),(0,T.jsx)(z,{children:d&&m?y(`onboard.kindSubOrganization`,{organization:m}):y(`onboard.kindSub`)}),B.kind?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:y(`onboard.guess`,{domain:B.domain,kind:y(ve.find(e=>e.kind===B.kind)?.label??`onboard.kindSmall`)})}):null,(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:ve.map(e=>(0,T.jsx)(Ee,{picked:V.kind===e.kind,label:y(e.label),sub:y(e.sub),onClick:()=>G({kind:e.kind,size:e.kind===V.kind?V.size:null})},e.kind))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,children:y(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:f})]})]}):null,U===`organization`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=h.trim();t?Ge.mutate(t,{onSuccess:Ke}):W(`site`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:y(`onboard.organization`)}),(0,T.jsx)(z,{children:y(`onboard.organizationSub`)}),(0,T.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),placeholder:y(`onboard.organizationPlaceholder`),maxLength:80,"aria-label":y(`onboard.organization`),className:ge}),h.trim()?(0,T.jsxs)(`p`,{className:`-mt-2 text-[0.9375rem] text-white/85`,children:[J&&h===J.name?`${y(`onboard.nameFrom`,{domain:new URL(J.url).host})} `:``,y(`onboard.address`),` `,(0,T.jsx)(`span`,{className:`font-mono text-[0.875rem]`,style:{color:D},children:tt(h)})]}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:Ge.isPending,children:y(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:f})]})]}):null,U===`site`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:K?y(`onboard.kicker2Personal`):Ze(`onboard.kicker2Named`,`onboard.kicker2`)}),(0,T.jsx)(R,{children:K?y(`onboard.linksPersonal`):Be&&!Ve&&q?y(`onboard.noneFound`,{name:q}):q?y(`onboard.siteNamed`,{organization:q}):y(`onboard.site`)}),(0,T.jsx)(z,{children:K?y(`onboard.linksPersonalSub`):Be&&!Ve&&q?y(`onboard.noneFoundSub`,{name:q}):Re.isPending?y(`onboard.searching`,{name:q??``}):y(`onboard.foundSub`)}),Ue?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=(_??``).trim();t?qe.mutate(t,{onSuccess:()=>W(`details`)}):W(`details`)},children:[(0,T.jsx)(ke,{value:_??``,onChange:b,rows:4,label:y(`onboard.line`),placeholder:y(K?`onboard.linePlaceholderPersonal`:`onboard.linePlaceholder`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>{b(null),He(!0),O(e=>e.length?e:[``])},className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,y(`onboard.addressAfterAll`)]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:qe.isPending,children:y(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:y(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:f})]})]}):(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),M?W(`details`):Z.length&&!Q.isPending&&Q.mutate(Z)},children:[Y.length?(0,T.jsx)(`div`,{className:`flex flex-col gap-2`,children:Y.map(e=>(0,T.jsx)(Ae,{address:e,picked:X.includes(e.url),onToggle:()=>S(X.includes(e.url)?X.filter(t=>t!==e.url):[...X,e.url])},e.url))}):null,!K&&Y.length?(0,T.jsx)(`p`,{className:`-mb-2 text-[0.9375rem] text-white/85`,children:y(`onboard.own`)}):null,C.map((e,t)=>(0,T.jsxs)(`div`,{className:`relative`,children:[(0,T.jsx)(`input`,{value:e,onChange:e=>O(n=>n.map((n,r)=>r===t?e.target.value:n)),placeholder:y(K?`onboard.linkPlaceholderPersonal`:`onboard.ownPlaceholder`),autoCapitalize:`none`,"aria-label":y(`onboard.own`),className:u(Te,`pr-28`)}),x(e)?(0,T.jsx)(`span`,{className:`-translate-y-1/2 absolute top-1/2 right-3 rounded-full bg-white/20 px-2.5 py-0.5 font-semibold text-[0.75rem]`,children:le[de(e)]}):null]},t)),C.length+Y.length<10?(0,T.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>[...e,``]),className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,y(`onboard.addAddress`)]}):null,M?(0,T.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.9375rem] text-(color:--moss)`,children:[(0,T.jsx)(o,{className:`size-4`}),M.name?y(`onboard.readDone`,{name:M.name,details:$e}):y(`onboard.readKept`,{n:Z.length})]}):Q.isError?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-(color:--rose)`,children:y(`onboard.readFailed`)}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[M?(0,T.jsx)(k,{type:`submit`,children:y(`onboard.continue`)}):(0,T.jsx)(k,{type:`submit`,busy:Q.isPending,children:Q.isPending?y(`onboard.reading`):y(`onboard.read`)}),(0,T.jsx)(A,{onClick:()=>b(``),children:y(`onboard.line`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:y(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:f})]})]})]}):null,U===`details`&&V.kind?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),We.mutate(),W(`know`)},children:[(0,T.jsx)(L,{children:K||!q?Xe:q}),(0,T.jsx)(R,{small:!0,children:K?y(`onboard.personalTitle`):q?y(`onboard.aboutOrganization`,{organization:q}):y(V.kind===`club`?`onboard.clubTitle`:`onboard.businessTitle`)}),K?(0,T.jsx)(ke,{value:V.need,onChange:e=>G({need:e}),rows:4,label:y(`onboard.personalTitle`),placeholder:y(`onboard.personalPlaceholder`)}):null,V.kind===`club`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:y(`onboard.clubKind`),options:Se,value:V.sector,text:e=>y(`onboard.club.${e}`),onChange:e=>G({sector:e})}),(0,T.jsx)(N,{label:y(`onboard.members`),options:be.club,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(N,{label:y(`onboard.yourRole`),options:Ce,value:V.role,text:e=>y(`onboard.role.${e}`),onChange:e=>G({role:e})})]}):null,V.kind===`small`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:y(`onboard.people`),options:be.small,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et})]}):null,V.kind===`corp`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:y(`onboard.people`),options:be.corp,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et}),(0,T.jsx)(N,{label:y(`onboard.yourRole`),options:we,value:V.role,text:e=>y(`onboard.role.${e}`),onChange:e=>G({role:e})}),(0,T.jsxs)(`label`,{className:`flex flex-col gap-2 text-[0.9375rem] text-white/85`,children:[(0,T.jsxs)(`span`,{children:[y(`onboard.phone`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:y(`onboard.phoneWhy`)})]}),(0,T.jsx)(`input`,{type:`tel`,value:V.phone,onChange:e=>G({phone:e.target.value.replace(/[^+0-9 ()/.-]/g,``)}),placeholder:`+43 …`,maxLength:40,autoComplete:`tel`,className:Te})]})]}):null,K?null:(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,T.jsxs)(`span`,{className:`text-[0.9375rem] text-white/85`,children:[y(`onboard.questions`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:y(`onboard.optional`)})]}),(0,T.jsx)(ke,{value:V.questions??``,onChange:e=>G({questions:e}),rows:3,label:y(`onboard.questions`),placeholder:y(`onboard.questionsPlaceholder`)}),(0,T.jsx)(`span`,{className:`text-[0.8125rem] text-white/70`,children:y(`onboard.questionsHint`)})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:We.isPending,children:y(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>window.history.state?.idx>0?n(-1):W(`site`),children:y(`onboard.back`)}),(0,T.jsx)(j,{step:3,total:f})]})]}):null,U===`know`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker3Named`,`onboard.kicker3`)}),(0,T.jsx)(R,{children:y(`onboard.know`)}),(0,T.jsx)(z,{children:y(`onboard.knowSub`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>Me.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),Qe(e.dataTransfer.files)},className:`flex cursor-pointer flex-col items-center gap-2 rounded-[18px] border-2 border-white/45 border-dashed bg-white/10 px-6 py-7 text-center transition hover:bg-white/15`,children:[(0,T.jsx)(se,{className:`size-7`}),(0,T.jsx)(`span`,{className:`font-semibold text-[1.0625rem]`,children:y(`onboard.drop`)}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:`PDF · Word · Excel · Markdown`}),(0,T.jsx)(`input`,{ref:Me,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{Qe(e.target.files),e.target.value=``}})]}),F.length?(0,T.jsx)(`ul`,{className:`flex flex-col gap-2`,children:F.map(e=>(0,T.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-xl bg-white/15 px-3.5 py-2.5 text-[0.875rem]`,children:[(0,T.jsx)(i,{className:`size-4 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,T.jsx)(`span`,{className:u(`text-white/80`,e.state===`failed`?`text-(color:--rose)`:``),children:e.state===`uploading`?y(`onboard.uploading`):e.state===`done`?y(`onboard.uploaded`):y(`onboard.uploadFailed`)})]},e.name))}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:F.some(e=>e.state===`uploading`)||$.isPending,onClick:()=>d?$.mutate():W(`space`),children:y(d?`onboard.buildFirst`:`onboard.continue`)}),F.length||d?null:(0,T.jsx)(A,{onClick:()=>W(`space`),children:y(`onboard.skip`)}),(0,T.jsx)(j,{step:4,total:f})]})]}):null,U===`space`&&!d?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker4Named`,`onboard.kicker4`)}),(0,T.jsx)(R,{children:q&&!K?y(`onboard.spaceNamed`,{organization:q}):y(`onboard.space`)}),(0,T.jsx)(z,{children:y(`onboard.spaceSub`,{space:c?.name??``})}),(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[[`partInfo`,`partInfoText`,!!(M||_)],[`partKnow`,`partKnowText`,F.some(e=>e.state===`done`)],[`partData`,`partDataText`,!1],[`partResults`,`partResultsText`,!1]].map(([e,t,n])=>(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-2xl border border-white/20 bg-white/10 px-4.5 py-4`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-2 font-semibold text-[1rem]`,children:[n?(0,T.jsx)(o,{className:`size-4 text-(color:--moss)`}):null,y(`onboard.${e}`)]}),(0,T.jsx)(`span`,{className:`text-[0.84375rem] text-white/85 leading-snug`,children:y(`onboard.${t}`)})]},e))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:$.isPending,onClick:()=>$.mutate(),children:y(`onboard.build`)}),(0,T.jsx)(j,{step:5,total:f})]})]}):null]},U)]}),(0,T.jsxs)(`footer`,{className:`mx-auto flex w-full max-w-6xl items-center justify-between pb-6 text-[0.75rem] text-white/55 sm:pb-8`,children:[(0,T.jsx)(`span`,{children:`engenty.wizards`}),(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px] bg-(color:--dot)`})]})]})}function L({children:e}){return(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:e})}function R({children:e,small:t}){return(0,T.jsx)(`h1`,{className:u(`font-display font-bold leading-[1.05] tracking-[-0.02em]`,t?`text-[2.25rem] sm:text-[2.75rem]`:`text-[2.5rem] sm:text-[3.25rem]`),children:e})}function z({children:e}){return(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:e})}function ke({value:e,onChange:t,rows:n,label:r,placeholder:i}){let[a]=f(),o=l(e,t,{deviceId:a.deviceId});return(0,T.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[18px] border border-white/30 bg-white/15 px-4 pt-3 pb-3 focus-within:border-white/60`,children:[(0,T.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),placeholder:o.listening?y(`editor.listening`):i,rows:n,maxLength:4e3,"aria-label":r,className:`w-full resize-none bg-transparent text-[1.0625rem] text-white leading-relaxed outline-none placeholder:text-white/55`}),o.supported?(0,T.jsx)(`div`,{className:`self-end`,style:{"--ink":`white`,"--border":`rgb(255 255 255 / 0.55)`},children:(0,T.jsx)(c,{speech:o,labelled:!0})}):null]})}function Ae({address:e,picked:t,onToggle:n}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":t,onClick:n,className:u(`flex cursor-pointer items-center gap-3.5 rounded-[14px] border px-4 py-2.5 text-left transition`,t?`border-white bg-white/22`:`border-white/30 bg-white/8 hover:bg-white/12`),children:[(0,T.jsx)(`span`,{className:u(`flex size-5 shrink-0 items-center justify-center rounded-md border-2`,t?`border-white bg-white`:`border-white/60`),style:t?{color:E}:void 0,children:t?(0,T.jsx)(o,{className:`size-3.5`,strokeWidth:3}):null}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`font-semibold text-[0.6875rem] text-white/70 uppercase tracking-[0.1em]`,children:le[e.kind]}),(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.9375rem]`,children:e.url.replace(/^https?:\/\/(www\.)?/,``).replace(/\/$/,``)}),(0,T.jsx)(`span`,{className:`truncate text-[0.8125rem] text-white/80`,children:e.title})]}),(0,T.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-white/70 max-sm:hidden`,children:y(e.source===`email`?`onboard.fromEmail`:`onboard.fromWeb`)})]})}function je(e){return e.toLowerCase().replace(/['’]/g,``).replace(/ä/g,`ae`).replace(/ö/g,`oe`).replace(/ü/g,`ue`).replace(/ß/g,`ss`).normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,35).replace(/-+$/,``)}function Me(){let e=ie(),t=a(),n=ee(),i=h(),o=e.data?.tenant,s=ne({queryKey:[`organization`,o?.id],queryFn:()=>r.get(`/api/studio/organization`),enabled:!!o}),c=p({mutationFn:()=>r.post(`/api/studio/onboarding/done`),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`me`]}),n(`/`,{replace:!0})}});if(!(e.data&&o))return null;let l=o.name??``,u=e.data.user.name,te=u.includes(`@`)?``:u.split(` `)[0],d=e.data.organizations.find(e=>e.id===o.id)?.invitedBy?.name,f=s.data?.members.find(t=>t.role===`owner`&&t.userId!==e.data?.user.id)?.name,re=o.role!==`member`,ae=o.slug?`${window.location.host}/studio/${o.slug}`:null;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(ce,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsx)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:(0,T.jsx)(oe,{kind:`drop`,size:240,fluffy:!0,coat:`fur`})}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:te?y(`onboard.kicker1`,{name:te}):y(`onboard.kicker1Anon`)}),(0,T.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:y(`welcome.title`,{organization:l})}),(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:d?y(`welcome.invited`,{name:d}):f?y(`welcome.setUp`,{name:f,organization:l}):y(`welcome.plain`)}),(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-[18px] bg-white/12 ring-1 ring-white/20`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3.5 px-4.5 py-3.5`,children:[(0,T.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl font-bold font-display`,style:{background:D,color:E},children:m(l)}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`truncate font-semibold text-[1.0625rem]`,children:l}),ae?(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.8125rem] text-white/75`,children:ae}):null]}),(0,T.jsx)(`span`,{className:`rounded-full bg-white/20 px-2.5 py-1 font-semibold text-[0.75rem]`,children:y(`organization.role.${o.role}`)})]}),i.data?.some(e=>e.wizardCount>0)?i.data.map(e=>(0,T.jsxs)(`div`,{className:`flex justify-between gap-3 border-white/15 border-t px-4.5 py-2.5 text-[0.9375rem]`,children:[(0,T.jsx)(`span`,{className:`truncate`,children:e.name}),(0,T.jsx)(`span`,{className:`shrink-0 text-white/75`,children:y(`welcome.wizards`,{n:e.wizardCount})})]},e.id)):(0,T.jsx)(`p`,{className:`border-white/15 border-t px-4.5 py-3 text-[0.9375rem] text-white/80`,children:y(`welcome.noWizards`)})]}),(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:y(re?`welcome.canBuild`:`welcome.canMember`)}),(0,T.jsx)(`div`,{className:`flex flex-wrap items-center gap-5`,children:(0,T.jsx)(k,{busy:c.isPending,onClick:()=>c.mutate(),children:y(`welcome.go`)})})]})]})]})}function Ne({value:e,onChange:t,suggested:n}){let[r,i]=(0,w.useState)(!1),a=C(e),o=[...new Set([...a?[a.id]:[],...n])].slice(0,4),s=e=>C(e)?.name[v===`de`?`de`:`en`]??e;return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:y(`onboard.sector`)}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.map(n=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":e===n,onClick:()=>t(n),className:u(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,e===n?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:e===n?{color:E}:void 0,children:s(n)},n)),(0,T.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>i(e=>!e),className:`cursor-pointer rounded-full border border-white/40 border-dashed px-4 py-2 text-[0.9375rem] hover:bg-white/15`,children:y(`onboard.sectorOther`)})]}),r?(0,T.jsxs)(`select`,{value:a?e:``,onChange:e=>{t(e.target.value),i(!1)},"aria-label":y(`onboard.sector`),className:u(Te,`[&>option]:text-black`),children:[(0,T.jsx)(`option`,{value:``,children:y(`onboard.sectorPick`)}),[...S].sort((e,t)=>s(e.id).localeCompare(s(t.id),v)).map(e=>(0,T.jsx)(`option`,{value:e.id,children:s(e.id)},e.id))]}):null,a?(0,T.jsxs)(`span`,{className:`text-[0.8125rem] text-white/75`,children:[y(`onboard.sectorHint`),` `,(0,T.jsx)(`b`,{style:{color:D},children:y(`onboard.catalog`,{sector:s(a.id)})})]}):null]})}export{F as OnboardingPage};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeEditor-CmMRfVhS.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/i18n-CLxuuhp_.js","assets/dist-DzdNG7Sf.js","assets/dist-DVpDdhG9.js","assets/markdown-DwdMW7q0.js","assets/dist-BwhPmMDu.js","assets/json-D2GVvTXK.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$t as r,B as i,Bn as a,Cn as o,Dn as s,En as c,G as l,Gt as u,Hn as d,Jn as f,Jt as p,Kt as m,Lt as h,Mn as g,Mr as _,Sr as v,Un as y,V as b,W as x,Wt as S,Xn as C,Xt as w,Yt as T,Zt as E,_n as D,_t as O,an as k,bn as ee,en as A,gn as te,ir as j,ln as M,m as N,mn as P,on as F,pt as ne,qt as I,rn as L,sn as R,sr as z,tn as B,un as V,v as H,y as U,yn as W,yt as G,z as re}from"./ui-D_0Xdrjh.js";import{E as ie,v as ae,y as oe}from"./Marketplace-BxFBMUsi.js";import{t as K}from"./useMutation-BJfRETsQ.js";import{t as q}from"./preload-helper-DpV6A1kQ.js";import{i as J}from"./volume-2-BGkyA8T9.js";import{b as se,d as ce,f as le,p as ue,r as de,t as fe}from"./theme-DWoTWDAG.js";import{M as pe,g as me,j as he,x as ge}from"./session-COf_im0l.js";import{t as _e}from"./upload-BizIzwxa.js";import{K as ve,V as ye,at as be,m as xe,n as Y,q as Se,rt as Ce,s as X}from"./i18n-CLxuuhp_.js";import{A as we,At as Te,C as Ee,D as De,Dt as Oe,E as ke,Ht as Ae,O as je,S as Me,St as Ne,T as Pe,a as Fe,ct as Ie,ht as Le,i as Re,k as ze,n as Be,o as Ve,r as He,w as Ue}from"./index-HhslPV6N.js";import{t as We}from"./runners-UfKeoOe4.js";var Ge={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Ge.node;var Ke=C(Ge),qe={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};qe.node;var Je=C(qe),Ye={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Ye.node;var Xe=C(Ye),Ze={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};Ze.node;var Qe=C(Ze),$e={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};$e.node;var et=C($e),tt={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};tt.node;var nt=C(tt),rt={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};rt.node;var it=C(rt),at={name:`panel-right-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]};at.node;var ot=C(at),st={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};st.node;var ct=C(st),lt={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};lt.node;var ut=C(lt),dt={name:`toggle-left`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};dt.node;var ft=C(dt),pt={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};pt.node;var mt=C(pt),Z=e(n(),1),Q=e(t(),1);function ht(e){return z({queryKey:[`share-targets`,e,Y],queryFn:()=>l.get(`/api/studio/wizards/${e}/share-targets?lang=${Y}`),enabled:!!e,staleTime:6e4})}var gt=(0,Q.createContext)(null);function _t(e){return e.share?e.share.length?`own`:`off`:`default`}var vt=e=>e.byDefault&&e.usable;function yt(e,t){let n=_t(e),r=e.share??[],i=new Map,a=e=>{let t=i.get(e)??0;return i.set(e,t+1),`${e}#${t}`},o=e=>({key:a(e.id),target:e.id,info:e,index:null,option:null,on:!1,name:e.name});if(n==="default")return{mode:n,rows:t.filter(vt).map(e=>({...o(e),on:!0})),unset:t.filter(e=>e.byDefault&&!e.usable)};let s=r.map((e,n)=>{let r=t.find(t=>t.id===e.target);return{key:a(e.target),target:e.target,info:r,index:n,option:e,on:!0,name:e.label||r?.name||e.target}}),c=new Set(r.map(e=>e.target));return s.push(...t.filter(e=>vt(e)&&!c.has(e.id)).map(o)),{mode:n,rows:s,unset:t.filter(e=>e.byDefault&&!e.usable&&!c.has(e.id))}}function bt(e,t){let n=t.filter(e=>e.on&&e.info?.usable);return{visitors:n.filter(t=>!(e==="default"&&t.info?.agent)),onlyYou:e==="default"?n.filter(e=>e.info?.agent):[],broken:t.filter(e=>e.on&&!e.info?.usable)}}function xt(e){return e.filter(e=>vt(e)&&!e.agent).map(e=>({target:e.id}))}function St(e,t){let n=_t(e);return n===`own`?e.share??[]:n==="default"?xt(t):[]}function Ct(e,t,n,r){let i=St(e,t);return r?[...i,{target:n.target}]:n.index===null?i.filter(e=>e.target!==n.target):i.filter((e,t)=>t!==n.index)}function wt(e,t,n,r){let i=St(e,t),a=n.index??i.findIndex(e=>e.target===n.target);return a===-1?[...i,r]:i.map((e,t)=>t===a?r:e)}function Tt(e,t,n){return[...St(e,t),{target:n}]}function Et(e,t){let n=new Set(e.map(e=>e.target));return t.filter(e=>e.usable&&!e.byDefault&&!n.has(e.id))}function Dt(e,t){let n=e.steps.slice(0,e.steps.indexOf(t));return[...n.flatMap(e=>e.type===`page`?e.fields.filter(e=>e.kind!==`image`&&e.kind!==`file`&&e.kind!==`signature`).map(e=>({ref:e.id,label:e.label})):[]),...n.flatMap(e=>e.type===`agent`&&e.output.format!==`json`?[{ref:`steps.${e.id}`,label:e.title}]:[]),{ref:`brand.name`,label:X(`shareEditor.brandName`)}]}function Ot(e){return new Intl.ListFormat(Y===`en`?`en-GB`:Y,{style:`long`,type:`conjunction`}).format(e)}var kt=(0,Q.lazy)(async()=>{let[{default:e},{markdownParts:t}]=await Promise.all([q(()=>import(`./CodeEditor-CmMRfVhS.js`),__vite__mapDeps([0,1,2,3,4,5])),q(()=>import(`./markdown-DwdMW7q0.js`),__vite__mapDeps([6,4,5,7]))]),n=t();return{default:t=>(0,Z.jsx)(e,{...t,languageParts:n})}}),At=(0,Q.lazy)(async()=>{let[{default:e},{jsonParts:t}]=await Promise.all([q(()=>import(`./CodeEditor-CmMRfVhS.js`),__vite__mapDeps([0,1,2,3,4,5])),q(()=>import(`./json-D2GVvTXK.js`),__vite__mapDeps([8,4,7]))]),n=t();return{default:t=>(0,Z.jsx)(e,{...t,languageParts:n})}});function jt(e){return(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`textarea`,{value:e.value,readOnly:e.readOnly,onChange:t=>e.onChange(t.target.value),"aria-label":e.ariaLabel,placeholder:e.placeholder,className:F(`field-sizing-content block w-full resize-none bg-transparent px-4 py-4 outline-none`,e.language===`json`?`font-mono text-[0.75rem]`:`text-[0.9375rem] leading-[1.65]`,e.className)}),children:e.language===`json`?(0,Z.jsx)(At,{...e}):(0,Z.jsx)(kt,{...e})})}var Mt=(e,t)=>`${e}/${t}`;function Nt(e,t,n){if(e.endsWith(`.localhost`)){let r=n&&URL.canParse(n)?new URL(n).port:``;return`http://${e}${r?`:${r}`:``}/${t}`}return`https://${e}/${t}`}var Pt=e=>e.lang===`en`?`en`:e.form===`sie`?`de-sie`:`de-du`;function Ft(e){return e===`en`?{lang:`en`}:{lang:`de`,form:e===`de-sie`?`sie`:`du`}}function It(e,t,n){let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;let o=[];for(let e=0;e<r;e++)o.push([e,e]);let s=i-r,c=a-r;if(s>0&&c>0){let i=s+c,a=i,l=new Int32Array(2*i+2),u=[],d=!1;for(let o=0;o<=i&&o<=n;o++){u.push(l.slice());for(let n=-o;n<=o;n+=2){let i=n===-o||n!==o&&l[a+n-1]<l[a+n+1]?l[a+n+1]:l[a+n-1]+1,u=i-n;for(;i<s&&u<c&&e[r+i]===t[r+u];)i++,u++;if(l[a+n]=i,i>=s&&u>=c){d=!0;break}}if(d)break}if(!d)return null;let f=[],p=s,m=c;for(let e=u.length-1;e>=0&&(p>0||m>0);e--){let t=u[e],n=p-m,i=n===-e||n!==e&&t[a+n-1]<t[a+n+1]?n+1:n-1,o=e===0?0:t[a+i],s=o-i;for(;p>o&&m>s;)p--,m--,f.push([r+p,r+m]);e>0&&(p=o,m=s)}o.push(...f.reverse())}for(let t=0;t<e.length-i;t++)o.push([i+t,a+t]);return o}var Lt=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),Rt=4e3;function zt(e,t,n){if(t===n||n===e)return{text:t,clean:!0,conflicts:0};if(t===e)return{text:n,clean:!0,conflicts:0};let r=e.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeEditor-CiRJjYpm.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/i18n-AXoEWXfv.js","assets/dist-DzdNG7Sf.js","assets/dist-DVpDdhG9.js","assets/markdown-DwdMW7q0.js","assets/dist-BwhPmMDu.js","assets/json-D2GVvTXK.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$t as r,B as i,Bn as a,Cn as o,Dn as s,En as c,G as l,Gt as u,Hn as d,Jn as f,Jt as p,Kt as m,Lt as h,Mn as g,Mr as _,Sr as v,Un as y,V as b,W as x,Wt as S,Xn as C,Xt as w,Yt as T,Zt as E,_n as D,_t as O,an as k,bn as ee,en as A,gn as te,ir as j,ln as M,m as N,mn as P,on as F,pt as ne,qt as I,rn as L,sn as R,sr as z,tn as B,un as V,v as H,y as U,yn as W,yt as G,z as re}from"./ui-CBDsXUoA.js";import{E as ie,v as ae,y as oe}from"./Marketplace-8rU-MhWj.js";import{t as K}from"./useMutation-ZHWqRSPd.js";import{t as q}from"./preload-helper-DpV6A1kQ.js";import{i as J}from"./volume-2-c641MxaU.js";import{b as se,d as ce,f as le,p as ue,r as de,t as fe}from"./theme-CSuPPxre.js";import{M as pe,g as me,j as he,x as ge}from"./session-DUxZmhqy.js";import{t as _e}from"./upload-CZgdEF60.js";import{K as ve,V as ye,at as be,m as xe,n as Y,q as Se,rt as Ce,s as X}from"./i18n-AXoEWXfv.js";import{A as we,At as Te,C as Ee,D as De,Dt as Oe,E as ke,Ht as Ae,O as je,S as Me,St as Ne,T as Pe,a as Fe,ct as Ie,ht as Le,i as Re,k as ze,n as Be,o as Ve,r as He,w as Ue}from"./index-Dx7qMiM3.js";import{t as We}from"./runners-UIPj9xyX.js";var Ge={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Ge.node;var Ke=C(Ge),qe={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};qe.node;var Je=C(qe),Ye={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Ye.node;var Xe=C(Ye),Ze={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};Ze.node;var Qe=C(Ze),$e={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};$e.node;var et=C($e),tt={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};tt.node;var nt=C(tt),rt={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};rt.node;var it=C(rt),at={name:`panel-right-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]};at.node;var ot=C(at),st={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};st.node;var ct=C(st),lt={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};lt.node;var ut=C(lt),dt={name:`toggle-left`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};dt.node;var ft=C(dt),pt={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};pt.node;var mt=C(pt),Z=e(n(),1),Q=e(t(),1);function ht(e){return z({queryKey:[`share-targets`,e,Y],queryFn:()=>l.get(`/api/studio/wizards/${e}/share-targets?lang=${Y}`),enabled:!!e,staleTime:6e4})}var gt=(0,Q.createContext)(null);function _t(e){return e.share?e.share.length?`own`:`off`:`default`}var vt=e=>e.byDefault&&e.usable;function yt(e,t){let n=_t(e),r=e.share??[],i=new Map,a=e=>{let t=i.get(e)??0;return i.set(e,t+1),`${e}#${t}`},o=e=>({key:a(e.id),target:e.id,info:e,index:null,option:null,on:!1,name:e.name});if(n==="default")return{mode:n,rows:t.filter(vt).map(e=>({...o(e),on:!0})),unset:t.filter(e=>e.byDefault&&!e.usable)};let s=r.map((e,n)=>{let r=t.find(t=>t.id===e.target);return{key:a(e.target),target:e.target,info:r,index:n,option:e,on:!0,name:e.label||r?.name||e.target}}),c=new Set(r.map(e=>e.target));return s.push(...t.filter(e=>vt(e)&&!c.has(e.id)).map(o)),{mode:n,rows:s,unset:t.filter(e=>e.byDefault&&!e.usable&&!c.has(e.id))}}function bt(e,t){let n=t.filter(e=>e.on&&e.info?.usable);return{visitors:n.filter(t=>!(e==="default"&&t.info?.agent)),onlyYou:e==="default"?n.filter(e=>e.info?.agent):[],broken:t.filter(e=>e.on&&!e.info?.usable)}}function xt(e){return e.filter(e=>vt(e)&&!e.agent).map(e=>({target:e.id}))}function St(e,t){let n=_t(e);return n===`own`?e.share??[]:n==="default"?xt(t):[]}function Ct(e,t,n,r){let i=St(e,t);return r?[...i,{target:n.target}]:n.index===null?i.filter(e=>e.target!==n.target):i.filter((e,t)=>t!==n.index)}function wt(e,t,n,r){let i=St(e,t),a=n.index??i.findIndex(e=>e.target===n.target);return a===-1?[...i,r]:i.map((e,t)=>t===a?r:e)}function Tt(e,t,n){return[...St(e,t),{target:n}]}function Et(e,t){let n=new Set(e.map(e=>e.target));return t.filter(e=>e.usable&&!e.byDefault&&!n.has(e.id))}function Dt(e,t){let n=e.steps.slice(0,e.steps.indexOf(t));return[...n.flatMap(e=>e.type===`page`?e.fields.filter(e=>e.kind!==`image`&&e.kind!==`file`&&e.kind!==`signature`).map(e=>({ref:e.id,label:e.label})):[]),...n.flatMap(e=>e.type===`agent`&&e.output.format!==`json`?[{ref:`steps.${e.id}`,label:e.title}]:[]),{ref:`brand.name`,label:X(`shareEditor.brandName`)}]}function Ot(e){return new Intl.ListFormat(Y===`en`?`en-GB`:Y,{style:`long`,type:`conjunction`}).format(e)}var kt=(0,Q.lazy)(async()=>{let[{default:e},{markdownParts:t}]=await Promise.all([q(()=>import(`./CodeEditor-CiRJjYpm.js`),__vite__mapDeps([0,1,2,3,4,5])),q(()=>import(`./markdown-DwdMW7q0.js`),__vite__mapDeps([6,4,5,7]))]),n=t();return{default:t=>(0,Z.jsx)(e,{...t,languageParts:n})}}),At=(0,Q.lazy)(async()=>{let[{default:e},{jsonParts:t}]=await Promise.all([q(()=>import(`./CodeEditor-CiRJjYpm.js`),__vite__mapDeps([0,1,2,3,4,5])),q(()=>import(`./json-D2GVvTXK.js`),__vite__mapDeps([8,4,7]))]),n=t();return{default:t=>(0,Z.jsx)(e,{...t,languageParts:n})}});function jt(e){return(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`textarea`,{value:e.value,readOnly:e.readOnly,onChange:t=>e.onChange(t.target.value),"aria-label":e.ariaLabel,placeholder:e.placeholder,className:F(`field-sizing-content block w-full resize-none bg-transparent px-4 py-4 outline-none`,e.language===`json`?`font-mono text-[0.75rem]`:`text-[0.9375rem] leading-[1.65]`,e.className)}),children:e.language===`json`?(0,Z.jsx)(At,{...e}):(0,Z.jsx)(kt,{...e})})}var Mt=(e,t)=>`${e}/${t}`;function Nt(e,t,n){if(e.endsWith(`.localhost`)){let r=n&&URL.canParse(n)?new URL(n).port:``;return`http://${e}${r?`:${r}`:``}/${t}`}return`https://${e}/${t}`}var Pt=e=>e.lang===`en`?`en`:e.form===`sie`?`de-sie`:`de-du`;function Ft(e){return e===`en`?{lang:`en`}:{lang:`de`,form:e===`de-sie`?`sie`:`du`}}function It(e,t,n){let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;let o=[];for(let e=0;e<r;e++)o.push([e,e]);let s=i-r,c=a-r;if(s>0&&c>0){let i=s+c,a=i,l=new Int32Array(2*i+2),u=[],d=!1;for(let o=0;o<=i&&o<=n;o++){u.push(l.slice());for(let n=-o;n<=o;n+=2){let i=n===-o||n!==o&&l[a+n-1]<l[a+n+1]?l[a+n+1]:l[a+n-1]+1,u=i-n;for(;i<s&&u<c&&e[r+i]===t[r+u];)i++,u++;if(l[a+n]=i,i>=s&&u>=c){d=!0;break}}if(d)break}if(!d)return null;let f=[],p=s,m=c;for(let e=u.length-1;e>=0&&(p>0||m>0);e--){let t=u[e],n=p-m,i=n===-e||n!==e&&t[a+n-1]<t[a+n+1]?n+1:n-1,o=e===0?0:t[a+i],s=o-i;for(;p>o&&m>s;)p--,m--,f.push([r+p,r+m]);e>0&&(p=o,m=s)}o.push(...f.reverse())}for(let t=0;t<e.length-i;t++)o.push([i+t,a+t]);return o}var Lt=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),Rt=4e3;function zt(e,t,n){if(t===n||n===e)return{text:t,clean:!0,conflicts:0};if(t===e)return{text:n,clean:!0,conflicts:0};let r=e.split(`
3
3
  `),i=t.split(`
4
4
  `),a=n.split(`
5
5
  `),o=It(r,i,Rt),s=It(r,a,Rt);if(!o||!s)return{text:t,clean:!1,conflicts:1};let c=new Map(o.map(([e,t])=>[e,t])),l=new Map(s.map(([e,t])=>[e,t])),u=[],d=0,f=0,p=0,m=0,h=(e,t,n)=>{let o=r.slice(f,e),s=i.slice(p,t),c=a.slice(m,n);Lt(s,o)?u.push(...c):(Lt(c,o)||Lt(s,c)||d++,u.push(...s))};for(let e=0;e<r.length;e++){let t=c.get(e),n=l.get(e);t===void 0||n===void 0||t<p||n<m||(h(e,t,n),u.push(r[e]),f=e+1,p=t+1,m=n+1)}return h(r.length,i.length,a.length),{text:u.join(`