PageSourceSearch

https://app.webbu.ai/assets/Site-DbwyEzAJ.js

js webbu.ai collected 2026-10-02 01:12:22 UTC 3,764 bytes, 1 lines download raw bytes

1import{r as a,j as e,t as s}from"./index-CDSr5FHz.js";import{b as R,c as T,S as F,o as D}from"./state-BLdWpU_r.js";import{H as L,a as P}from"./HelpModal-UIaUI-ma.js";import"./refresh-cw-B5jk7kJ4.js";import"./check-3puB4c5W.js";function W(){const t=R("site"),[l,m]=a.useState(""),[c,h]=a.useState(""),[u,y]=a.useState(!1),[d,i]=a.useState(null),[S,r]=a.useState(null),[C,b]=a.useState(!1),[j,g]=a.useState(null),[x,E]=a.useState(!1),O=t.ready?t.state.site.id:null;if(a.useEffect(()=>{if(!t.ready)return;m(t.state.site.name);const n=t.state.site.productionDomain||t.state.site.shopifyStoreDomain||"";h(n),t.state.site.shopifyStoreDomain&&i({myshopifyDomain:t.state.site.shopifyStoreDomain,liveDomain:t.state.site.productionDomain??null})},[O]),!t.ready)return t.element;const f=l.trim().length>0;async function v(n){const o=n.trim();if(!o)return i(null),r(null),null;y(!0),r(null);try{const p=await D("/api/onboarding/resolve-shopify-domain",{method:"POST",body:JSON.stringify({url:o})});if(p.ok){const N={myshopifyDomain:p.myshopifyDomain,liveDomain:p.liveDomain};return i(N),r(null),N}return i(null),r(p.message),null}catch{return i(null),r(s("We couldn't check that address. Try again.")),null}finally{y(!1)}}async function H(){if(E(!0),!t.ready||!f)return;g(null);let n=d;n||(n=await v(c)),n&&t.submit(D("/api/onboarding/steps/site/complete",{method:"POST",body:JSON.stringify({data:{name:l.trim(),...n.liveDomain?{productionDomain:n.liveDomain}:{},kind:"shopify",shopifyStoreDomain:n.myshopifyDomain}})}).catch(o=>{throw g(o instanceof Error?o.message:s("Could not save.")),o}))}return e.jsxs(T,{steps:t.state.steps,currentStepKey:"site",children:[e.jsxs(F,{title:s("Your store"),subtitle:s("Tell us your store's name and web address, and we'll find your Shopify store automatically."),footer:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:H,disabled:u,className:"button-primary disabled:opacity-60",children:u?s("Checking…"):s("Continue")}),e.jsx(L,{onOpen:()=>b(!0)})]}),children:[e.jsxs(w,{label:s("Site name"),required:!0,children:[e.jsx("input",{value:l,onChange:n=>m(n.target.value),className:"input-base w-full",placeholder:s("My store"),"aria-invalid":x&&!f}),e.jsx(k,{children:s("The label we use when we refer to your site.")}),x&&!f&&e.jsx("p",{className:"text-xs text-danger",children:s("Pick a site name.")})]}),e.jsxs(w,{label:s("Store URL"),required:!0,children:[e.jsx("input",{value:c,onChange:n=>{h(n.target.value),i(null),r(null)},onBlur:()=>{c.trim()&&!d&&v(c)},className:"input-base w-full",placeholder:s("yourstore.com"),"aria-invalid":x&&!d}),e.jsx(k,{children:s("Your store's web address - the one you'd give a customer. We'll find your Shopify store from it.")}),u&&e.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted",children:[e.jsx(U,{}),s("Finding your Shopify store…")]}),!u&&d&&e.jsxs("p",{className:"text-xs text-text",children:[e.jsx("span",{className:"text-accent",children:"✓"})," ",s("Found your store: "),e.jsx("code",{className:"text-text",children:d.myshopifyDomain})]}),!u&&S&&e.jsx("p",{className:"text-xs text-danger",children:S})]}),j&&e.jsx("p",{className:"mt-4 text-xs text-danger",children:j})]}),e.jsx(P,{stepKey:"site",open:C,onClose:()=>b(!1),onSent:()=>t.advance()})]})}function U(){return e.jsx("span",{className:"inline-block size-3 animate-spin rounded-full border-[1.5px] border-muted border-t-transparent","aria-hidden":!0})}function w({label:t,required:l,children:m}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"block text-sm font-medium",children:[t,l&&e.jsx("span",{className:"ml-1 text-danger",children:"*"})]}),m]})}function k({children:t}){return e.jsx("p",{className:"text-xs text-muted",children:t})}export{W as SiteStep};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.