PageSourceSearch

https://app.backstagebaton.com/app/assets/SignUpPage-Dp6AMIBP.js

js backstagebaton.com collected 2026-10-07 08:50:46 UTC 11,564 bytes, 1 lines download raw bytes

1import{r as n,j as r,u as te,b as re,B as ae,L as ne,ai as se}from"./index-_aijvlUq.js";import{I as k}from"./Input-ysTyZFq5.js";var oe=n.forwardRef(({as:t="div",...c},l)=>r.jsx(t,{...c,ref:l}));const ie="https://challenges.cloudflare.com/turnstile/v0/api.js",le="cf-turnstile-script",Y="onloadTurnstileCallback",J=t=>!!document.getElementById(t),ce=({render:t="explicit",onLoadCallbackName:c=Y,scriptOptions:{nonce:l="",defer:e=!0,async:x=!0,id:y="",appendTo:d,onError:b,crossOrigin:h=""}={}})=>{let m=y||"cf-turnstile-script";if(J(m))return;let i=document.createElement("script");i.id=m,i.src=`${ie}?onload=${c}&render=${t}`,!document.querySelector(`script[src="${i.src}"]`)&&(i.defer=!!e,i.async=!!x,l&&i.setAttribute("nonce",l),h&&(i.crossOrigin=h),b&&(i.onerror=b,delete window[c]),(d==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(i))},T={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}};function ue(t){if(t!=="invisible"&&t!=="interactionOnly")return t}function de(t=le){let[c,l]=n.useState(!1);return n.useEffect(()=>{let e=()=>{J(t)&&l(!0)},x=new MutationObserver(e);return x.observe(document,{childList:!0,subtree:!0}),e(),()=>{x.disconnect()}},[t]),c}let L="unloaded",G;const me=new Promise((t,c)=>{G={resolve:t,reject:c},L==="ready"&&t(void 0)}),W=(t=Y)=>(L==="unloaded"&&(L="loading",window[t]=()=>{G.resolve(),L="ready",delete window[t]}),me),V=n.forwardRef((t,c)=>{let{scriptOptions:l,options:e={},siteKey:x,onWidgetLoad:y,onSuccess:d,onExpire:b,onError:h,onBeforeInteractive:m,onAfterInteractive:i,onUnsupported:C,onTimeout:p,onLoadScript:O,id:U,style:g,as:w="div",injectScript:f=!0,rerenderOnCallbackChange:o=!1,...$}=t,u=e.size,K=n.useCallback(()=>u===void 0?{}:e.execution==="execute"?T.invisible:e.appearance==="interaction-only"?T.interactionOnly:T[u],[e.execution,u,e.appearance]),[X,A]=n.useState(K()),v=n.useRef(null),[j,_]=n.useState(!1),s=n.useRef(void 0),R=n.useRef(!1),H=U||"cf-turnstile",N=n.useRef({onSuccess:d,onError:h,onExpire:b,onBeforeInteractive:m,onAfterInteractive:i,onUnsupported:C,onTimeout:p});n.useEffect(()=>{o||(N.current={onSuccess:d,onError:h,onExpire:b,onBeforeInteractive:m,onAfterInteractive:i,onUnsupported:C,onTimeout:p})});let z=l?.id||"cf-turnstile-script",F=de(z),B=l?.onLoadCallbackName||"onloadTurnstileCallback",Q=e.appearance||"always",q=n.useMemo(()=>({sitekey:x,action:e.action,cData:e.cData,theme:e.theme||"auto",language:e.language||"auto",tabindex:e.tabIndex,"response-field":e.responseField,"response-field-name":e.responseFieldName,size:ue(u),retry:e.retry||"auto","retry-interval":e.retryInterval||8e3,"refresh-expired":e.refreshExpired||"auto","refresh-timeout":e.refreshTimeout||"auto",execution:e.execution||"render",appearance:e.appearance||"always","feedback-enabled":e.feedbackEnabled??!0,callback:a=>{R.current=!0,o?d?.(a):N.current.onSuccess?.(a)},"error-callback":o?h:(...a)=>N.current.onError?.(...a),"expired-callback":o?b:(...a)=>N.current.onExpire?.(...a),"before-interactive-callback":o?m:(...a)=>N.current.onBeforeInteractive?.(...a),"after-interactive-callback":o?i:(...a)=>N.current.onAfterInteractive?.(...a),"unsupported-callback":o?C:(...a)=>N.current.onUnsupported?.(...a),"timeout-callback":o?p:(...a)=>N.current.onTimeout?.(...a)}),[e.action,e.appearance,e.cData,e.execution,e.language,e.refreshExpired,e.responseField,e.responseFieldName,e.retry,e.retryInterval,e.tabIndex,e.theme,e.feedbackEnabled,e.refreshTimeout,x,u,o,o?d:null,o?h:null,o?b:null,o?m:null,o?i:null,o?C:null,o?p:null]),E=n.useCallback(()=>typeof window<"u"&&!!window.turnstile,[]);return n.useEffect(function(){f&&!j&&(W(B),ce({onLoadCallbackName:B,scriptOptions:{...l,id:z}}))},[f,j,l,z,B]),n.useEffect(function(){L!=="ready"&&W(B).then(()=>_(!0)).catch(console.error)},[B]),n.useEffect(function(){if(!v.current||!j)return;let a=!1;return(async()=>a||!v.current||(s.current=window.turnstile.render(v.current,q),s.current&&y?.(s.current)))(),()=>{a=!0,s.current&&(window.turnstile.remove(s.current),R.current=!1)}},[H,j,q]),n.useImperativeHandle(c,()=>{let{turnstile:a}=window;return{getResponse(){if(!a?.getResponse||!s.current||!E()){console.warn("Turnstile has not been loaded");return}return a.getResponse(s.current)},async getResponsePromise(I=3e4,Z=100){return new Promise((ee,D)=>{let S,M=async()=>
1{if(R.current&&window.turnstile&&s.current)try{let P=window.turnstile.getResponse(s.current);return S&&clearTimeout(S),P?ee(P):D(Error("No response received"))}catch(P){return S&&clearTimeout(S),console.warn("Failed to get response",P),D(Error("Failed to get response"))}S||=setTimeout(()=>{S&&clearTimeout(S),D(Error("Timeout"))},I),await new Promise(P=>setTimeout(P,Z)),await M()};M()})},reset(){if(!a?.reset||!s.current||!E()){console.warn("Turnstile has not been loaded");return}e.execution==="execute"&&A(T.invisible);try{R.current=!1,a.reset(s.current)}catch(I){console.warn(`Failed to reset Turnstile widget ${s.current}`,I)}},remove(){if(!a?.remove||!s.current||!E()){console.warn("Turnstile has not been loaded");return}A(T.invisible),R.current=!1,a.remove(s.current),s.current=null},render(){if(!a?.render||!v.current||!E()||s.current){console.warn("Turnstile has not been loaded or container not found");return}let I=a.render(v.current,q);return s.current=I,s.current&&y?.(s.current),e.execution!=="execute"&&A(u?T[u]:{}),I},execute(){if(e.execution!=="execute"){console.warn('Execution mode is not set to "execute"');return}if(!a?.execute||!v.current||!s.current||!E()){console.warn("Turnstile has not been loaded or container not found");return}a.execute(v.current),A(u?T[u]:{})},isExpired(){return!a?.isExpired||!s.current||!E()?(console.warn("Turnstile has not been loaded"),!1):a.isExpired(s.current)}}},[s,e.execution,u,q,v,E,j,y]),n.useEffect(()=>{if(j||!F)return;if(window.turnstile){_(!0);return}let a=setInterval(()=>{window.turnstile&&(_(!0),clearInterval(a))},50);return()=>{clearInterval(a)}},[j,F]),n.useEffect(()=>{A(K())},[e.execution,u,Q]),n.useEffect(()=>{!F||typeof O!="function"||O()},[F]),r.jsx(oe,{ref:v,as:w,id:H,style:{...X,...g},...$})});V.displayName="Turnstile";const pe="/api/v1/auth",fe="0x4AAAAAAD8_4kN648CoKd-B";function xe(){const[t,c]=n.useState({firstName:"",lastName:"",email:"",password:"",confirmPassword:"",orgName:"",orgShortName:""}),[l,e]=n.useState(null),[x,y]=n.useState(!1),[d,b]=n.useState(!1),[h,m]=n.useState(null),i=te(),C=re.setState;function p(g){return w=>{const f=w.target.value;c(o=>{const $={...o,[g]:f};return g==="orgName"&&!o._shortEdited&&($.orgShortName=f.split(/\s+/).map(u=>u[0]||"").join("").toUpperCase().slice(0,6)),$})}}function O(g){c(w=>({...w,orgShortName:g.target.value,_shortEdited:!0}))}async function U(g){if(g.preventDefault(),e(null),t.password.length<8){e("Password must be at least 8 characters.");return}if(t.password!==t.confirmPassword){e("Passwords do not match.");return}if(!d){e("Please accept the Terms of Service and Privacy Policy.");return}if(!h){e("Please wait a moment for the verification to complete, then try again.");return}y(!0);try{const f=(await se.post(`${pe}/register`,{email:t.email,password:t.password,firstName:t.firstName.trim(),lastName:t.lastName.trim(),displayName:`${t.firstName} ${t.lastName}`.trim(),orgName:t.orgName,orgShortName:t.orgShortName,acceptedTerms:d,captchaToken:h||void 0},{withCredentials:!0})).data.data;if(typeof window.plausible=="function"&&window.plausible("Signup"),f.verificationRequired){i(`/check-email?email=${encodeURIComponent(f.email)}`,{replace:!0});return}const{user:o}=f;C({user:o,isAuthenticated:!0,isInitializing:!1}),i("/",{replace:!0})}catch(w){const f=w.response?.data?.error?.message||w.message||"Sign up failed";e(f)}finally{y(!1)}}return r.jsxs("div",{className:"min-h-screen flex",children:[r.jsxs("div",{className:"hidden lg:flex lg:w-1/2 relative bg-gradient-to-b from-slate-800 to-slate-900 flex-col items-center justify-center",children:[r.jsx("a",{href:"/",children:r.jsx("img",{src:"/app/brand/logo-primary-light.svg",alt:"Backstage Baton",className:"h-56 w-56 object-contain"})}),r.jsxs("div",{className:"mt-8 text-center px-8",children:[r.jsx("p",{className:"text-2xl font-bold tracking-tight text-white",children:"Your ensemble, organized."}),r.jsx("p",{className:"text-sm text-white/50 mt-2",children:"90-day free trial. No credit card required."})]})]}),r.jsx("div",{className:"flex-1 flex items-center justify-center bg-gray-50 lg:bg-white px-4",children:r.jsxs("div",{className:"w-full max-w-sm",children:[r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("a",{href:"/",children:r.jsx("img",{src:"/app/brand/logo-primary.svg",alt:"Backstage Baton",className:"h-24 mx-auto mb-4 object-contain lg:hidden"})}),r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Start your free trial"}),r.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"90 days of Complete plan features. No credit card."})]}),r.jsxs("form",{onSubmit:U,className:"bg-white rounded-xl shadow-sm border border-gray-200 p-6 space-y-4 lg:shadow-none lg:border-0 lg:p-0",children:[l&&r.jsx("div",{className:"rounded-md bg-red-50 border border-red-200 px-3 py-2 text-sm text-red-700",children:l}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(k,{label:"First Name",value:t.firstName,onChange:p("firstName"),required:!0,autoFocus:!0,autoComplete:"given-name",placeholder:"Jane"}),r.jsx(k,{label:"Last Name",value:t.lastName,onChange:p("lastName"),required:!0,autoComplete:"family-name",placeholder:"Smith"})]}),r.jsx(k,{label:"Email",type:"email",value:t.email,onChange:p("email"),required:!0,autoComplete:"email",placeholder:"[email protected]"}),r.jsx(k,{label:"Password",type:"password",value:t.password,onChange:p("password"),required:!0,autoComplete:"new-password",placeholder:"At least 8 characters"}),r.jsx(k,{label:"Confirm Password",type:"password",value:t.confirmPassword,onChange:p("confirmPassword"),required:!0,autoComplete:"new-password",placeholder:"Re-enter your password"}),r.jsx(k,{label:"Organization Name",value:t.orgName,onChange:p("orgName"),required:!0,placeholder:"Highlands Ranch Concert Band"}),r.jsx(k,{label:"Short Name / Abbreviation",value:t.orgShortName,onChange:O,placeholder:"HRCB"}),r.jsxs("label",{className:"flex items-start gap-2 text-sm text-gray-600",children:[r.jsx("input",{type:"checkbox",checked:d,onChange:g=>b(g.target.checked),className:"mt-0.5 h-4 w-4 shrink-0 rounded border-gray-300 text-band-600 focus:ring-2 focus:ring-band-500"}),r.jsxs("span",{children:["I agree to the"," ",r.jsx("a",{href:"https://app.backstagebaton.com/terms",target:"_blank",rel:"noopener noreferrer",className:"text-band-600 hover:text-band-700 font-medium",children:"Terms of Service"})," ","and"," ",r.jsx("a",{href:"https://app.backstagebaton.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"text-band-600 hover:text-band-700 font-medium",children:"Privacy Policy"}),"."]})]}),r.jsx(V,{siteKey:fe,onSuccess:m,onExpire:()=>m(null),onError:()=>m(null),options:{theme:"light"}}),r.jsx(ae,{type:"submit",isLoading:x,disabled:!t.firstName||!t.lastName||!t.email||!t.password||!t.orgName||!d,className:"w-full",children:"Start free trial"}),r.jsxs("p",{className:"text-center text-sm text-gray-500",children:["Already have an account?"," ",r.jsx(ne,{to:"/login",className:"text-band-600 hover:text-band-700 font-medium",children:"Sign in"})]})]})]})})]})}export{xe as SignUpPage};

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.