wizards 0.4.2 → 0.4.3
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.
- package/apps/runtime/dist/media/conversation.js +7 -1
- package/apps/web/dist/assets/{AboutDialog-CH1rQdia.js → AboutDialog-DWaBKvI6.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-78MQLHfA.js → ChangelogDialog-BcM1gXPM.js} +1 -1
- package/apps/web/dist/assets/{ChatView-DLJfy69U.js → ChatView-D0RRIl15.js} +2 -2
- package/apps/web/dist/assets/{EditorPage-BYrZokVk.js → EditorPage-DrJ6e_2q.js} +1 -1
- package/apps/web/dist/assets/{FlowPreview-xIWPdOCV.js → FlowPreview-S1s1yRaP.js} +1 -1
- package/apps/web/dist/assets/{Harness-CsDhNLSW.js → Harness-DILx5Edb.js} +1 -1
- package/apps/web/dist/assets/{NewWizardChannels-JB3V6DCL.js → NewWizardChannels-CEILDADp.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-Bkh-hjSe.js → NewWizardPage-DxOtK2E-.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-Diw1ILjC.js → OnboardingPage-xoGrKIJ-.js} +1 -1
- package/apps/web/dist/assets/{ProjectPage-FgoZDzPI.js → ProjectPage-6E5z4nZA.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-ClT6B7t5.js → PublicRunner-Cab2jUy6.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-DAwTEyjM.js → RunDrawer-B3FNYpgZ.js} +1 -1
- package/apps/web/dist/assets/{RunnerView-B_tJroFM.js → RunnerView-D6sGVnRy.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-BsMN-XQs.js → SettingsPage-DHtIqmOJ.js} +1 -1
- package/apps/web/dist/assets/{SetupPage-C7FuIpSt.js → SetupPage-Cn9iQbJx.js} +1 -1
- package/apps/web/dist/assets/{SharePage-CbFe83L9.js → SharePage-CMr72PeU.js} +1 -1
- package/apps/web/dist/assets/changelog-DfmWTlav.js +1 -0
- package/apps/web/dist/assets/{esm-BhIeKBJY.js → esm-BPfTI3lL.js} +1 -1
- package/apps/web/dist/assets/index-B-D8UvL9.js +14 -0
- package/apps/web/dist/assets/{settings-menu-C5Y8SOhG.js → settings-menu-BJm0CwOj.js} +1 -1
- package/apps/web/dist/index.html +1 -1
- package/package.json +1 -1
- package/apps/web/dist/assets/changelog-mYclku73.js +0 -1
- package/apps/web/dist/assets/index-fflYi8P1.js +0 -14
|
@@ -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{tn as r}from"./ui-DTuixH4y.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-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{tn as r}from"./ui-DTuixH4y.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-BPfTI3lL.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{Er as r,J as i,Rn as a,an as o,hn as s,tn as c,z as l,zt as u}from"./ui-DTuixH4y.js";import{Jt as d,z as f}from"./index-fflYi8P1.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{Er as r,J as i,Rn as a,an as o,hn as s,tn as c,z as l,zt as u}from"./ui-DTuixH4y.js";import{Jt as d,z as f}from"./index-B-D8UvL9.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
|
|
package/apps/web/dist/assets/{NewWizardChannels-JB3V6DCL.js → NewWizardChannels-CEILDADp.js}
RENAMED
|
@@ -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{Rn as r,Wn as i,an as a,cn as o,mt as s,tn as c,zn as l}from"./ui-DTuixH4y.js";import{t as u}from"./phone-BFD815nc.js";import{Ft as d,Mt as f,Nt as p,zt as m}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Rn as r,Wn as i,an as a,cn as o,mt as s,tn as c,zn as l}from"./ui-DTuixH4y.js";import{t as u}from"./phone-BFD815nc.js";import{Ft as d,Mt as f,Nt as p,zt as m}from"./index-B-D8UvL9.js";var h={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};h.node;var g=i(h),_=[`text`,`data`,`image`,`video`,`voice`,`document`,`dashboard`,`widget`,`film`,`surface`];[...s],[..._];var v={default:`steps`,enabled:[`steps`,`chat`]},y=e(t(),1),b=e(n(),1),x=[{id:`steps`,group:`web`,runner:`steps`,label:`new.ch.steps`,icon:d},{id:`chat`,group:`web`,runner:`chat`,label:`new.ch.chat`,icon:p},{id:`talk`,group:`web`,runner:`talk`,label:`new.ch.talk`,icon:l},{id:`video`,group:`web`,runner:`video`,label:`new.ch.video`,icon:o},{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:g},{id:`whatsapp`,group:`message`,runner:`whatsapp`,label:`new.ch.whatsapp`,icon:null}],S=[{id:`web`,label:`new.web`,icon:m},{id:`phone`,label:`new.phone`,icon:u},{id:`message`,label:`new.messages`,icon:f}],C=x.filter(e=>v.enabled.includes(e.id)).map(e=>e.id),w=e=>x.filter(t=>e.includes(t.id));function T(e){return e.length===C.length&&C.every(t=>e.includes(t))}function E(e){let t=w(e),n=[...new Set(t.map(e=>e.runner))];return{default:t.find(e=>e.group===`web`)?.runner??n[0]??v.default,enabled:n}}var D=e=>e.map(e=>a(e.label));function O(e){return x.find(t=>t.runner===e)}function k(e){return x.filter(t=>t.id!==`wacall`&&e.includes(t.runner)).map(e=>e.id)}function A(e){let t=w(e),n=S.flatMap(e=>{let n=D(t.filter(t=>t.group===e.id));return n.length?[e.id===`web`?n.join(`, `):`${a(e.label)}: ${n.join(`, `)}`]:[]});return`${a(`new.runsAs`)}: ${n.join(` · `)}`}function j(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function M({channel:e,className:t}){let n=e.icon;return n?(0,b.jsx)(n,{className:t??`size-4`}):(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`font-semibold text-[0.625rem] tracking-wide`,children:`WA`})}function N(e){let t=new Set(e?.map(e=>e.id)??[`steps`,`chat`,`talk`,`video`]);return x.filter(e=>t.has(e.runner))}function P({value:e,onChange:t,runners:n,without:i,disabled:o}){let s=N(n).filter(e=>!i?.includes(e.id)),l=t=>e.includes(t.id),u=n=>{o||l(n)&&e.length===1||t(l(n)?e.filter(e=>e!==n.id):[...e,n.id])},d=t=>{let n=S.find(e=>e.id===t),i=s.filter(e=>e.group===t);if(!(n&&i.length))return null;let d=n.icon;return(0,b.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col border-0 p-0`,children:[(0,b.jsxs)(`legend`,{className:`flex items-center gap-1.5 px-2 pt-2 pb-1 text-[0.75rem] text-ink-3`,children:[(0,b.jsx)(d,{className:`size-3.5`}),` `,a(n.label)]}),i.map(t=>(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`label`,{className:c(`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`,l(t)&&`bg-paper-2`),children:[(0,b.jsx)(`span`,{className:`flex w-5 justify-center text-ink-3`,children:(0,b.jsx)(M,{channel:t})}),(0,b.jsx)(`span`,{className:`flex-1`,children:a(t.label)}),(0,b.jsx)(`input`,{type:`checkbox`,className:`sr-only`,"aria-label":a(t.label),checked:l(t),disabled:o,"aria-disabled":l(t)&&e.length===1,onChange:()=>u(t)}),(0,b.jsx)(`span`,{"aria-hidden":`true`,className:c(`flex size-[1.125rem] items-center justify-center rounded-md ring-1`,l(t)?`bg-ink text-paper ring-ink`:`ring-border`),children:l(t)?(0,b.jsx)(r,{className:`size-3`,strokeWidth:3}):null})]}),t.id===`call`&&l(t)?(0,b.jsx)(`p`,{className:`px-2 pb-1.5 pl-9 text-[0.75rem] text-ink-3`,children:a(`new.callHandoff`)}):null]},t.id))]})};return(0,b.jsxs)(`div`,{className:`grid gap-x-4 sm:grid-cols-2`,children:[d(`web`),(0,b.jsxs)(`div`,{className:`flex flex-col`,children:[d(`phone`),d(`message`)]})]})}function F({value:e,onChange:t,runners:n,className:r}){let[i,o]=(0,y.useState)(!1),[s,l]=(0,y.useState)(0),u=(0,y.useRef)(null);(0,y.useEffect)(()=>{if(!i)return;let e=e=>{u.current?.contains(e.target)||o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i]);let d=N(n),f=S.filter(e=>d.some(t=>t.group===e.id)),p=t=>e.includes(t.id);return(0,b.jsxs)(`div`,{ref:u,className:c(`relative flex flex-wrap items-center gap-1.5`,r),children:[(0,b.jsx)(`span`,{className:`mr-0.5 px-1 text-[0.8125rem] text-ink-3`,children:a(`new.runsAs`)}),f.map(e=>{let t=D(d.filter(t=>t.group===e.id&&p(t))),n=e.icon;return(0,b.jsxs)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-label":`${a(e.label)}: ${t.length?t.join(`, `):a(`new.off`)}`,onClick:e=>{let t=e.currentTarget;l(t.offsetLeft+t.offsetWidth/2),o(e=>!e)},className:c(`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,b.jsx)(n,{className:`size-4 shrink-0`}),t.length?(0,b.jsx)(`span`,{className:`truncate`,children:j(t)}):null]},e.id)}),i?(0,b.jsxs)(`div`,{role:`dialog`,"aria-label":a(`new.where`),style:{transformOrigin:`${s}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,b.jsx)(`p`,{className:`px-2 pt-1 font-semibold text-[0.9375rem]`,children:a(`new.where`)}),(0,b.jsx)(P,{value:e,onChange:t,runners:n})]}):null]})}export{C as a,k as c,F as i,T as l,M as n,A as o,P as r,O as s,S as t,E as u};
|
|
@@ -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{Er as r,Ht as i,J as a,Jn as o,Lt as s,Qn as c,Vn as l,Vt as u,_n as d,a as f,an as p,c as m,en as h,er as g,gr as _,l as v,o as y,r as ee,rn as b,s as x,sn as S,tn as C,tr as w,xn as te,z as T,zt as E}from"./ui-DTuixH4y.js";import{a as ne,i as re,l as D,o as O,u as ie}from"./NewWizardChannels-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Er as r,Ht as i,J as a,Jn as o,Lt as s,Qn as c,Vn as l,Vt as u,_n as d,a as f,an as p,c as m,en as h,er as g,gr as _,l as v,o as y,r as ee,rn as b,s as x,sn as S,tn as C,tr as w,xn as te,z as T,zt as E}from"./ui-DTuixH4y.js";import{a as ne,i as re,l as D,o as O,u as ie}from"./NewWizardChannels-CEILDADp.js";import{t as k}from"./upload-BEf5-d6X.js";import{C as A,Jt as j,S as ae,dt as oe,ot as M,rt as N,w as P,x as F}from"./index-B-D8UvL9.js";var I=[[`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 L(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase()}function R(e){return L(e).split(/[^a-z0-9]+/).map(e=>e.trim()).filter(e=>e.length>1)}function z(e){return e==null?``:Array.isArray(e)?e.map(z).filter(Boolean).join(` `):typeof e==`object`?Object.values(e).map(z).filter(Boolean).join(` `):String(e)}function B(e,t){let n=t.map(([t,n])=>({text:z(e[t]),weight:n})).filter(e=>e.text.length>0);return{fields:n,tokens:n.flatMap(e=>R(e.text))}}function V(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 H(e,t){if(e===t)return 1;let n=0;for(let r of V(e))for(let i of V(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 U(e,t){return e.reduce((e,n)=>e+H(t,n),0)}function W(e,t,n=I){if(!t?.trim())return 0;let r=R(t);if(r.length===0)return 0;let i=B(e,n);return i.tokens.length===0?0:r.reduce((e,t)=>U(i.tokens,t)===0?e:e+i.fields.reduce((e,n)=>{let r=R(n.text),i=U(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 G=new Set(R(`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{Er as r,Qn as i,Rn as a,Vn as o,an as s,kn as c,tn as l,z as u}from"./ui-DTuixH4y.js";import{t as d}from"./upload-BEf5-d6X.js";import{B as f,Jt as p,dt as m,gt as h,pt as g,rt as _,st as v}from"./index-fflYi8P1.js";var y=e(t(),1),b=e(n(),1),x=`oklch(50% 0.2 262)`,S=`oklch(32% 0.15 262)`,C={"--on":`white`,"--dot":`oklch(90% 0.1 80)`,"--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)`},w=`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 T(){return(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,b.jsx)(h,{size:28}),(0,b.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight`,children:[`engenty`,(0,b.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-(color:--dot)`,children:`.`}),(0,b.jsx)(`span`,{className:`font-normal text-white/70`,children:`wizards`})]})]})}function E({children:e,busy:t,onClick:n,type:r=`button`}){return(0,b.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:S},children:[e,(0,b.jsx)(o,{className:`size-[18px]`})]})}function D({children:e,onClick:t}){return(0,b.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer font-semibold text-[0.9375rem] text-white/85 transition hover:text-white`,children:e})}function O({step:e}){return(0,b.jsx)(`span`,{className:`ml-auto inline-flex gap-1.5`,role:`img`,"aria-label":s(`onboard.step`,{n:e}),children:[1,2,3,4].map(t=>(0,b.jsx)(`span`,{className:l(`size-2 rounded-full`,t===e?`bg-white`:`bg-white/40`)},t))})}function k(){g(x);let e=v(),t=r(),n=i(),{project:o}=_(),[h,k]=(0,y.useState)(1),[A,j]=(0,y.useState)(``),[M,N]=(0,y.useState)(``),[P,F]=(0,y.useState)(null),[I,L]=(0,y.useState)(null),[R,z]=(0,y.useState)([]),B=(0,y.useRef)(null),V=p({mutationFn:e=>u.put(`/api/studio/team`,{name:e}),onSuccess:()=>t.invalidateQueries({queryKey:[`team`]})}),H=p({mutationFn:e=>u.post(`/api/studio/projects/${o?.id}/website`,{url:e}),onSuccess:async e=>{L(e),await t.invalidateQueries({queryKey:[`projects`]})}}),U=p({mutationFn:e=>u.patch(`/api/studio/projects/${o?.id}`,{brand:{about:e}}),onSuccess:()=>t.invalidateQueries({queryKey:[`projects`]})}),W=p({mutationFn:()=>u.post(`/api/studio/onboarding/done`),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`me`]}),n(`/new`,{replace:!0})}}),G=e.data?.user.name??``,K=G.includes(`@`)?``:G.split(` `)[0],q=async e=>{if(e&&o){for(let t of Array.from(e)){z(e=>[...e,{name:t.name,state:`uploading`}]);try{await u.upload(`/api/studio/projects/${o.id}/files?kind=document`,t),z(e=>e.map(e=>e.name===t.name?{...e,state:`done`}:e))}catch{z(e=>e.map(e=>e.name===t.name?{...e,state:`failed`}:e))}}await t.invalidateQueries({queryKey:[`projects`]})}},J=I?[I.about?s(`onboard.readAbout`):``,I.colors?s(`onboard.readColors`,{n:I.colors}):``,I.logo?s(`onboard.readLogo`):``].join(``):``;return(0,b.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...C,background:x},children:[(0,b.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,b.jsx)(T,{}),(0,b.jsx)(f,{tone:`ground`,ink:S})]}),(0,b.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,b.jsx)(`div`,{className:`flex justify-center max-lg:order-first`,children:(0,b.jsx)(m,{kind:`drop`,size:240,fluffy:!0,coat:`fur`})}),(0,b.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[h===1?(0,b.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=A.trim();t?V.mutate(t,{onSuccess:()=>k(2)}):k(2)},children:[(0,b.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:K?s(`onboard.kicker1`,{name:K}):s(`onboard.kicker1Anon`)}),(0,b.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.team`)}),(0,b.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.teamSub`)}),(0,b.jsx)(`input`,{value:A,onChange:e=>j(e.target.value),placeholder:s(`onboard.teamPlaceholder`),maxLength:80,"aria-label":s(`onboard.team`),className:w}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,b.jsx)(E,{type:`submit`,busy:V.isPending,children:s(`onboard.continue`)}),(0,b.jsx)(O,{step:1})]})]}):null,h===2?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.kicker2`)}),(0,b.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.site`)}),(0,b.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.siteSub`)}),P===null?(0,b.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),M.trim()&&!H.isPending&&H.mutate(M.trim())},children:[(0,b.jsx)(`input`,{value:M,onChange:e=>N(e.target.value),placeholder:s(`onboard.sitePlaceholder`),inputMode:`url`,autoCapitalize:`none`,"aria-label":s(`onboard.site`),className:w}),I?(0,b.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.9375rem] text-(color:--moss)`,children:[(0,b.jsx)(a,{className:`size-4`}),s(`onboard.readDone`,{name:I.name,details:J})]}):H.isError?(0,b.jsx)(`p`,{className:`text-[0.9375rem] text-(color:--rose)`,children:s(`onboard.readFailed`)}):null,(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[I?(0,b.jsx)(E,{onClick:()=>k(3),children:s(`onboard.continue`)}):(0,b.jsx)(E,{type:`submit`,busy:H.isPending,children:H.isPending?s(`onboard.reading`):s(`onboard.read`)}),(0,b.jsx)(D,{onClick:()=>F(``),children:s(`onboard.line`)}),(0,b.jsx)(D,{onClick:()=>k(3),children:s(`onboard.skip`)}),(0,b.jsx)(O,{step:2})]})]}):(0,b.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=P.trim();t?U.mutate(t,{onSuccess:()=>k(3)}):k(3)},children:[(0,b.jsx)(`textarea`,{value:P,onChange:e=>F(e.target.value),placeholder:s(`onboard.linePlaceholder`),rows:3,maxLength:8e3,"aria-label":s(`onboard.line`),className:l(w,`resize-none text-[1.125rem] leading-relaxed`)}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,b.jsx)(E,{type:`submit`,busy:U.isPending,children:s(`onboard.continue`)}),(0,b.jsx)(D,{onClick:()=>F(null),children:s(`onboard.site`)}),(0,b.jsx)(D,{onClick:()=>k(3),children:s(`onboard.skip`)}),(0,b.jsx)(O,{step:2})]})]})]}):null,h===3?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.kicker3`)}),(0,b.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.know`)}),(0,b.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.knowSub`)}),(0,b.jsxs)(`button`,{type:`button`,onClick:()=>B.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),q(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,b.jsx)(d,{className:`size-7`}),(0,b.jsx)(`span`,{className:`font-semibold text-[1.0625rem]`,children:s(`onboard.drop`)}),(0,b.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:`PDF · Word · Excel · Markdown`}),(0,b.jsx)(`input`,{ref:B,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{q(e.target.files),e.target.value=``}})]}),R.length?(0,b.jsx)(`ul`,{className:`flex flex-col gap-2`,children:R.map(e=>(0,b.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,b.jsx)(c,{className:`size-4 shrink-0`}),(0,b.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,b.jsx)(`span`,{className:l(`text-white/80`,e.state===`failed`?`text-(color:--rose)`:``),children:e.state===`uploading`?s(`onboard.uploading`):e.state===`done`?s(`onboard.uploaded`):s(`onboard.uploadFailed`)})]},e.name))}):null,(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,b.jsx)(E,{busy:R.some(e=>e.state===`uploading`),onClick:()=>k(4),children:s(`onboard.continue`)}),R.length?null:(0,b.jsx)(D,{onClick:()=>k(4),children:s(`onboard.skip`)}),(0,b.jsx)(O,{step:3})]})]}):null,h===4?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.kicker4`)}),(0,b.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.space`)}),(0,b.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.spaceSub`,{space:o?.name??``})}),(0,b.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[[`partInfo`,`partInfoText`,!!(I||P)],[`partKnow`,`partKnowText`,R.some(e=>e.state===`done`)],[`partData`,`partDataText`,!1],[`partResults`,`partResultsText`,!1]].map(([e,t,n])=>(0,b.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,b.jsxs)(`span`,{className:`flex items-center gap-2 font-semibold text-[1rem]`,children:[n?(0,b.jsx)(a,{className:`size-4 text-(color:--moss)`}):null,s(`onboard.${e}`)]}),(0,b.jsx)(`span`,{className:`text-[0.84375rem] text-white/85 leading-snug`,children:s(`onboard.${t}`)})]},e))}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,b.jsx)(E,{busy:W.isPending,onClick:()=>W.mutate(),children:s(`onboard.build`)}),(0,b.jsx)(O,{step:4})]})]}):null]},h)]}),(0,b.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,b.jsx)(`span`,{children:`engenty`}),(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px] bg-(color:--dot)`})]})]})}export{k 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{Er as r,Qn as i,Rn as a,Vn as o,an as s,kn as c,tn as l,z as u}from"./ui-DTuixH4y.js";import{t as d}from"./upload-BEf5-d6X.js";import{B as f,Jt as p,dt as m,gt as h,pt as g,rt as _,st as v}from"./index-B-D8UvL9.js";var y=e(t(),1),b=e(n(),1),x=`oklch(50% 0.2 262)`,S=`oklch(32% 0.15 262)`,C={"--on":`white`,"--dot":`oklch(90% 0.1 80)`,"--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)`},w=`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 T(){return(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,b.jsx)(h,{size:28}),(0,b.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight`,children:[`engenty`,(0,b.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-(color:--dot)`,children:`.`}),(0,b.jsx)(`span`,{className:`font-normal text-white/70`,children:`wizards`})]})]})}function E({children:e,busy:t,onClick:n,type:r=`button`}){return(0,b.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:S},children:[e,(0,b.jsx)(o,{className:`size-[18px]`})]})}function D({children:e,onClick:t}){return(0,b.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer font-semibold text-[0.9375rem] text-white/85 transition hover:text-white`,children:e})}function O({step:e}){return(0,b.jsx)(`span`,{className:`ml-auto inline-flex gap-1.5`,role:`img`,"aria-label":s(`onboard.step`,{n:e}),children:[1,2,3,4].map(t=>(0,b.jsx)(`span`,{className:l(`size-2 rounded-full`,t===e?`bg-white`:`bg-white/40`)},t))})}function k(){g(x);let e=v(),t=r(),n=i(),{project:o}=_(),[h,k]=(0,y.useState)(1),[A,j]=(0,y.useState)(``),[M,N]=(0,y.useState)(``),[P,F]=(0,y.useState)(null),[I,L]=(0,y.useState)(null),[R,z]=(0,y.useState)([]),B=(0,y.useRef)(null),V=p({mutationFn:e=>u.put(`/api/studio/team`,{name:e}),onSuccess:()=>t.invalidateQueries({queryKey:[`team`]})}),H=p({mutationFn:e=>u.post(`/api/studio/projects/${o?.id}/website`,{url:e}),onSuccess:async e=>{L(e),await t.invalidateQueries({queryKey:[`projects`]})}}),U=p({mutationFn:e=>u.patch(`/api/studio/projects/${o?.id}`,{brand:{about:e}}),onSuccess:()=>t.invalidateQueries({queryKey:[`projects`]})}),W=p({mutationFn:()=>u.post(`/api/studio/onboarding/done`),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`me`]}),n(`/new`,{replace:!0})}}),G=e.data?.user.name??``,K=G.includes(`@`)?``:G.split(` `)[0],q=async e=>{if(e&&o){for(let t of Array.from(e)){z(e=>[...e,{name:t.name,state:`uploading`}]);try{await u.upload(`/api/studio/projects/${o.id}/files?kind=document`,t),z(e=>e.map(e=>e.name===t.name?{...e,state:`done`}:e))}catch{z(e=>e.map(e=>e.name===t.name?{...e,state:`failed`}:e))}}await t.invalidateQueries({queryKey:[`projects`]})}},J=I?[I.about?s(`onboard.readAbout`):``,I.colors?s(`onboard.readColors`,{n:I.colors}):``,I.logo?s(`onboard.readLogo`):``].join(``):``;return(0,b.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...C,background:x},children:[(0,b.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,b.jsx)(T,{}),(0,b.jsx)(f,{tone:`ground`,ink:S})]}),(0,b.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,b.jsx)(`div`,{className:`flex justify-center max-lg:order-first`,children:(0,b.jsx)(m,{kind:`drop`,size:240,fluffy:!0,coat:`fur`})}),(0,b.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[h===1?(0,b.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=A.trim();t?V.mutate(t,{onSuccess:()=>k(2)}):k(2)},children:[(0,b.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:K?s(`onboard.kicker1`,{name:K}):s(`onboard.kicker1Anon`)}),(0,b.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.team`)}),(0,b.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.teamSub`)}),(0,b.jsx)(`input`,{value:A,onChange:e=>j(e.target.value),placeholder:s(`onboard.teamPlaceholder`),maxLength:80,"aria-label":s(`onboard.team`),className:w}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,b.jsx)(E,{type:`submit`,busy:V.isPending,children:s(`onboard.continue`)}),(0,b.jsx)(O,{step:1})]})]}):null,h===2?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.kicker2`)}),(0,b.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.site`)}),(0,b.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.siteSub`)}),P===null?(0,b.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),M.trim()&&!H.isPending&&H.mutate(M.trim())},children:[(0,b.jsx)(`input`,{value:M,onChange:e=>N(e.target.value),placeholder:s(`onboard.sitePlaceholder`),inputMode:`url`,autoCapitalize:`none`,"aria-label":s(`onboard.site`),className:w}),I?(0,b.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.9375rem] text-(color:--moss)`,children:[(0,b.jsx)(a,{className:`size-4`}),s(`onboard.readDone`,{name:I.name,details:J})]}):H.isError?(0,b.jsx)(`p`,{className:`text-[0.9375rem] text-(color:--rose)`,children:s(`onboard.readFailed`)}):null,(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[I?(0,b.jsx)(E,{onClick:()=>k(3),children:s(`onboard.continue`)}):(0,b.jsx)(E,{type:`submit`,busy:H.isPending,children:H.isPending?s(`onboard.reading`):s(`onboard.read`)}),(0,b.jsx)(D,{onClick:()=>F(``),children:s(`onboard.line`)}),(0,b.jsx)(D,{onClick:()=>k(3),children:s(`onboard.skip`)}),(0,b.jsx)(O,{step:2})]})]}):(0,b.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=P.trim();t?U.mutate(t,{onSuccess:()=>k(3)}):k(3)},children:[(0,b.jsx)(`textarea`,{value:P,onChange:e=>F(e.target.value),placeholder:s(`onboard.linePlaceholder`),rows:3,maxLength:8e3,"aria-label":s(`onboard.line`),className:l(w,`resize-none text-[1.125rem] leading-relaxed`)}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,b.jsx)(E,{type:`submit`,busy:U.isPending,children:s(`onboard.continue`)}),(0,b.jsx)(D,{onClick:()=>F(null),children:s(`onboard.site`)}),(0,b.jsx)(D,{onClick:()=>k(3),children:s(`onboard.skip`)}),(0,b.jsx)(O,{step:2})]})]})]}):null,h===3?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.kicker3`)}),(0,b.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.know`)}),(0,b.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.knowSub`)}),(0,b.jsxs)(`button`,{type:`button`,onClick:()=>B.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),q(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,b.jsx)(d,{className:`size-7`}),(0,b.jsx)(`span`,{className:`font-semibold text-[1.0625rem]`,children:s(`onboard.drop`)}),(0,b.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:`PDF · Word · Excel · Markdown`}),(0,b.jsx)(`input`,{ref:B,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{q(e.target.files),e.target.value=``}})]}),R.length?(0,b.jsx)(`ul`,{className:`flex flex-col gap-2`,children:R.map(e=>(0,b.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,b.jsx)(c,{className:`size-4 shrink-0`}),(0,b.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,b.jsx)(`span`,{className:l(`text-white/80`,e.state===`failed`?`text-(color:--rose)`:``),children:e.state===`uploading`?s(`onboard.uploading`):e.state===`done`?s(`onboard.uploaded`):s(`onboard.uploadFailed`)})]},e.name))}):null,(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,b.jsx)(E,{busy:R.some(e=>e.state===`uploading`),onClick:()=>k(4),children:s(`onboard.continue`)}),R.length?null:(0,b.jsx)(D,{onClick:()=>k(4),children:s(`onboard.skip`)}),(0,b.jsx)(O,{step:3})]})]}):null,h===4?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.kicker4`)}),(0,b.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.space`)}),(0,b.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.spaceSub`,{space:o?.name??``})}),(0,b.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[[`partInfo`,`partInfoText`,!!(I||P)],[`partKnow`,`partKnowText`,R.some(e=>e.state===`done`)],[`partData`,`partDataText`,!1],[`partResults`,`partResultsText`,!1]].map(([e,t,n])=>(0,b.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,b.jsxs)(`span`,{className:`flex items-center gap-2 font-semibold text-[1rem]`,children:[n?(0,b.jsx)(a,{className:`size-4 text-(color:--moss)`}):null,s(`onboard.${e}`)]}),(0,b.jsx)(`span`,{className:`text-[0.84375rem] text-white/85 leading-snug`,children:s(`onboard.${t}`)})]},e))}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,b.jsx)(E,{busy:W.isPending,onClick:()=>W.mutate(),children:s(`onboard.build`)}),(0,b.jsx)(O,{step:4})]})]}):null]},h)]}),(0,b.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,b.jsx)(`span`,{children:`engenty`}),(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px] bg-(color:--dot)`})]})]})}export{k as OnboardingPage};
|