PageSourceSearch

https://formbuilder.com/assets/PlatformConnectPage-DCPAeGWW.js

js formbuilder.com collected 2026-10-09 17:55:20 UTC 9,726 bytes, 1 lines download raw bytes

1import{r as a,j as e}from"./react-vendor-BffKvuxa.js";import{u as E,p as w,a as v,S as D,c as j}from"./index-CG52u5QT.js";import"./icons-BzjPoFvA.js";const V=n=>({session_expired:`This connection link has expired. Return to the ${n} app and choose Connect account again.`,already_connected:"This store is already connected to another FormBuilder account.",connection_not_available:`The connection could not be completed. Verify your email address, then reopen the app in ${n}.`,account_unavailable:"The connected account is unavailable. Contact support for help."});function B({provider:n="bigcommerce"}){const o=n==="shopify"?"Shopify":"BigCommerce",p=V(o),{user:r,loading:y,refreshUser:d}=E(),[s]=a.useState(w),[u,h]=a.useState(""),[f,c]=a.useState(""),[b,N]=a.useState(!1),[g,P]=a.useState(!1);a.useEffect(()=>{if(r||!s)return;const t=()=>{document.visibilityState==="visible"&&d()};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}},[r==null?void 0:r.id,s,d]),a.useEffect(()=>{window.history.replaceState(null,"",window.location.pathname)},[]),a.useEffect(()=>{if(!s){c(`Open FormBuilder in ${o} and choose Connect account to start.`);return}if(!r)return;let t=!0;return c(""),h(""),v.post(`/api/platforms/${n}/connect/info`,{token:s}).then(({data:i})=>{t&&h(i.store)}).catch(i=>{var l,m;t&&c(p[(m=(l=i.response)==null?void 0:l.data)==null?void 0:m.error]||`Could not load this connection. Reopen FormBuilder in ${o} to try again.`)}),()=>{t=!1}},[s,r==null?void 0:r.id]);async function C(){var t,i,l,m;N(!0),c("");try{await v.post(`/api/platforms/${n}/connect/confirm`,{token:s}),j(),P(!0)}catch(x){c((((i=(t=x.response)==null?void 0:t.data)==null?void 0:i.error)==="separate_shopify_billing_account_required"?"Use a separate free FormBuilder account. This account already has standalone billing or belongs to another Shopify store.":p[(m=(l=x.response)==null?void 0:l.data)==null?void 0:m.error])||`Could not connect your account. Reopen the app in ${o} to try again.`)}finally{N(!1)}}return e.jsxDEV("main",{className:"min-h-[70vh] bg-[#FBF9F4] px-4 py-12 sm:px-6",children:[e.jsxDEV(D,{title:`Connect ${o}`,description:`Connect your ${o} store to FormBuilder.`,noindex:!0},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:44,columnNumber:5},this),e.jsxDEV("div",{className:"mx-auto max-w-xl",children:[e.jsxDEV("p",{className:"text-xs font-semibold uppercase tracking-wider text-slate-600",children:["FormBuilder / ",o]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:46,columnNumber:7},this),e.jsxDEV("h1",{className:"mt-3 text-3xl font-bold tracking-tight text-slate-950",children:g?"Your store is connected":"Connect your store"},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:47,columnNumber:7},this),g?e.jsxDEV("p",{className:"mt-5 text-slate-600",role:"status",children:["Return to the FormBuilder app in ",o," and select Check connection. ",n==="shopify"?"Choose a form, enable its theme block and copy the connection ID into your Shopify theme editor.":"You can then choose a published form and add its widget to Page Builder."]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:48,columnNumber:13},this):e.jsxDEV(e.Fragment,{children:[e.jsxDEV("p",{className:"mt-4 text-slate-600",children:n==="shopify"?"Choose the FormBuilder account to manage in Shopify. Only public, published forms without payment fields can be placed on your storefront.":`Choose the FormBuilder account that will supply this store’s forms. Only published forms from this account will be available in ${o}.`},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:49,columnNumber:9},this),f&&e.jsxDEV("p",{role:"alert",className:"mt-5 rounded-md border border-red-200 bg-red-50 p-4 text-red-800",children:f},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:50,columnNumber:17},this),y?e.jsxDEV("p",{className:"mt-5",role:"status",children:"Checking your account…"},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:51,columnNumber:18},this):r?e.jsxDEV("div",{className:"mt-6 border-y border-stone-200 py-5",children:[e.jsxDEV("p",{className:"break-words text-slate-700",children:["Account: ",e.jsxDEV("strong",{children:r.email},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:57,columnNumber:62},this)]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:57,columnNumber:11},this),u&&e.jsxDEV("p",{className:"mt-2 text-slate-700",children:[o," store: ",e.jsxDEV("strong",{children:u},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:58,columnNumber:68},this)]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:58,columnNumber:19},this),n==="shopify"&&e.jsxDEV("p",{className:"mt-4 text-sm text-slate-600",children:"This account will manage its Free or Pro plan through Shopify. No charge is made by connecting. Use a separate account if you already have standalone billing or billing through another Shopify store."},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:59,columnNumber:38},this),e.jsxDEV("p",{className:"mt-4 text-sm text-slate-600",children:n==="shopify"?"This lets the Shopify store owner create, edit and publish non-payment forms, read and export their responses, download attachments, and delete forms or responses from this account inside Shopify. Forms and responses are stored in FormBuilder.":"This lets the store owner select and place your published forms. It does not grant access to your response inbox or private attachments. Existing forms and responses stay in FormBuilder."},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:60,columnNumber:11},this),e.jsxDEV("button",{disabled:b||!u||!!f,onClick:C,className:"mt-5 rounded-md bg-slate-950 px-5 py-3 font-semibold text-white disabled:opacity-50",children:b?"Connecting…":"Connect this account"},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:61,columnNumber:11},this)]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:56,columnNumber:16},this):e.jsxDEV("div",{className:"mt-6 flex flex-wrap gap-3",children:[e.jsxDEV("p",{className:"w-full text-sm text-slate-600",children:"Keep this tab open. After signing in with the emailed link, return here to finish connecting your store."},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:52,columnNumber:11},this),e.jsxDEV("button",{disabled:!s,onClick:()=>{var t;return(t=window.showAuthModal)==null?void 0:t.call(window,"login")},className:"rounded-md bg-slate-950 px-5 py-3 font-semibold text-white disabled:opacity-50",children:"Sign in to FormBuilder"},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:53,columnNumber:11},this),e.jsxDEV("button",{disabled:!s,onClick:()=>{var t;return(t=window.showAuthModal)==null?void 0:t.call(window,"register")},className:"rounded-md border border-stone-300 bg-white px-5 py-3 font-semibold disabled:opacity-50",children:"Create an account"},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:54,columnNumber:11},this),e.jsxDEV("button",{disabled:!s,onClick:()=>void d(),className:"rounded-md border border-stone-300 bg-white px-5 py-3 font-semibold disabled:opacity-50",children:"I’ve signed in — check again"},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:55,columnNumber:11},this)]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:51,columnNumber:85},this)]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:48,columnNumber:338},this),e.jsxDEV("p",{className:"mt-6 text-sm text-slate-600",children:["Need help? ",e.jsxDEV("a",{className:"underline",href:"/contact",children:"Contact support"},void 0,!1,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:64,columnNumber:61},this),"."]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:64,columnNumber:7},this)]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:45,columnNumber:5},this)]},void 0,!0,{fileName:"/private/tmp/formbuilder-search-content-20261007/frontend/src/pages/PlatformConnectPage.tsx",lineNumber:43,columnNumber:10},this)}export{B as default};

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.