PageSourceSearch

https://shift.ms/_next/static/chunks/pages/username-13c6d8a8780d2e8f.js

js shift.ms collected 2026-09-25 23:00:32 UTC 5,808 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8063],{32067:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/username",function(){return a(8263)}])},10708:function(e,s,a){"use strict";var i=a(85893);a(67294);let n=e=>{let{error:s,showPasswordError:a=!1}=e;return!s||!a&&"code"in s&&("auth/user-not-found"===s.code||"auth/wrong-password"===s.code)?null:(0,i.jsx)("div",{className:"is-size-6 py-5",children:(0,i.jsx)("div",{className:"notification auth-message is-warning is-light",children:"code"in s&&("auth/user-not-found"===s.code||"auth/wrong-password"===s.code)?"Sorry, you entered an incorrect password.":s.message})})};s.Z=n},85007:function(e,s,a){"use strict";var i=a(39828),n=a(67294),t=a(74630);let r=e=>{let s=0,[a,r]=(0,n.useState)(e||""),[l,c]=(0,n.useState)(!1),[u,o]=(0,n.useState)(!!e),[d,m]=(0,n.useState)(!!e),[h,p]=(0,n.useState)(!1),[x,f]=(0,n.useState)(!1),[j,b]=(0,n.useState)(!1),g=e=>!(e.length<4)&&!(e.length>15)&&!!e.match(/^\d*[a-z\-_][a-z\-_\d]*$/i),v=async e=>{let s=await (0,i.PL)((0,i.IO)((0,i.hJ)(t.db,"users"),(0,i.ar)("usernameLowercase","==",e.toLowerCase()),(0,i.b9)(1))).then(e=>!e.empty).catch(()=>!1);return s};(0,n.useEffect)(()=>{u&&d?f(!1):f(!0)},[u,d]);let N=a=>{s&&clearTimeout(s),j||b(!0);let i=a.currentTarget.value,n=g(i);r(i),o(n),""!==i?p(!0):p(!1),e===i?m(!0):n&&(s=setTimeout(async()=>{c(!0),await v(i)?m(!1):m(!0),c(!1)},500))},w=e=>{r(e),o(g(e))};return{username:a,setUsername:r,presetUsername:w,validateUsername:g,isChecking:l,isAvailable:d,isValid:u,isDirty:h,setIsDirty:p,showError:x,reset:()=>r(""),touched:j,bind:{value:a,onChange:N}}};s.Z=r},8263:function(e,s,a){"use strict";a.r(s);var i=a(85893),n=a(55317),t=a(8849),r=a.n(t),l=a(39828),c=a(9008),u=a.n(c),o=a(41664),d=a.n(o),m=a(11163),h=a(67294),p=a(44856),x=a(85007),f=a(94454),j=a(83759),b=a(9554),g=a(10708),v=a(18990);let N=()=>{let{authLoaded:e,isLoggedIn:s,uid:a,user:t,auth:c}=(0,j.a)(),o=(0,m.useRouter)(),[N,w]=(0,h.useState)(null),{username:y,isAvailable:S,isChecking:_,isValid:E,bind:z,touched:T}=(0,x.Z)(""),[C,Z]=(0,h.useState)(!1);(0,h.useEffect)(()=>{e&&(!s||(null==t?void 0:t.username))&&o.push("/home")},[e,s,o,null==t?void 0:t.username]);let L=async e=>{a&&await (0,b.N)(a,{...e,isActivated:!0,isDeleted:!1,created:(0,l.Bt)()}).then(s=>{s&&(s.success?(a&&(null==c?void 0:c.email)&&(f.B({action:"profile.username",params:{name:"Set username",uid:a}}),(0,v.Z)({uid:a,eventType:"USER:SET_USERNAME",eventSource:"USER",eventSourceId:a,meta:{username:e.username},email:c.email,platform:"web"})),o.push("/welcome")):w(s.error))})},P=e=>{if(e.preventDefault(),!E||!S)return!1;Z(!0);let s={username:y,usernameLowercase:y.toLowerCase()};return L(s),!0};return e?e&&!s?(0,i.jsx)("div",{className:"hero is-fullheight",children:(0,i.jsx)("div",{className:"hero-body",children:(0,i.jsxs)("div",{className:"container is-narrow has-text-centered",children:[(0,i.jsx)("div",{children:(0,i.jsx)(r(),{path:n.jZI,size:3})}),(0,i.jsx)("p",{className:"is-font-brand is-size-3 mb-4",children:"Sorry, you have been logged out"}),(0,i.jsx)("p",{className:"is-font-brand mb-4",children:"This usually happens if time has elapsed between you submitting this page and logging in. Please try logging in again."}),(0,i.jsx)("div",{children:(0,i.jsx)(d(),{href:"/signin",legacyBehavior:!0,children:(0,i.jsxs)("a",{className:"button is-primary is-rounded",children:[(0,i.jsx)("span",{className:"icon",children:(0,i.jsx)(r(),{path:n.fOx,size:1})}),(0,i.jsx)("span",{children:"Login"})]})})})]})})}):(0,i.jsxs)("div",{className:"username-page",children:[(0,i.jsx)(u(),{children:(0,i.jsx)("title",{children:"Welcome to Shift.ms"})}),(0,i.jsx)("div",{className:"container is-narrow",children:(0,i.jsx)("div",{className:"username-box",children:(0,i.jsx)("div",{className:"content",children:(0,i.jsxs)("div",{className:"join-form is-clearfix",children:[(0,i.jsx)(g.Z,{error:N}),(0,i.jsxs)("form",{onSubmit:P,children:[(0,i.jsxs)("div",{className:"field",children:[(0,i.jsx)("label",{htmlFor:"username",className:"label title is-size-3 is-size-5-mobile",children:"Please choose a username"}),(0,i.jsxs)("div",{className:"control has-icons-left has-icons-right".concat(_?" is-loading":""),children:[(0,i.jsx)("input",{id:"username",className:"input",type:"text",placeholder:"Enter a username",...z}),(0,i.jsx)("span",{className:"icon is-small is-left",children:(0,i.jsx)(r(),{path:n.bn2,size:1})}),!_&&E&&S?(0,i.jsx)("span",{className:"icon is-small is-right has-text-success",children:(0,i.jsx)(r(),{path:n.OE9,size:1})}):null]}),(0,i.jsx)("p",{className:"help",children:"You can use any combination of letters and numbers, but not solely numbers. Minimum four characters, maximum 15 characters."}),!_&&y!==(null==t?void 0:t.username)&&E&&S?(0,i.jsx)("p",{className:"help is-alt-green",children:"Great! This username is available."}):"",T&&!_&&E&&!S?(0,i.jsx)("p",{className:"help is-danger",children:"Sorry, this username is not available."}):"",T&&!E?(0,i.jsx)("p",{className:"help is-danger",children:"Please ensure your username has a minimum of four characters, a maxmimum of 15 characters and only use letters and numbers."}):""]}),(0,i.jsx)("div",{className:"form-buttons",children:(0,i.jsx)("div",{className:"field submit-field",children:(0,i.jsx)("div",{className:"control",children:!_&&E&&S?(0,i.jsx)("button",{type:"submit",className:"button is-rounded is-medium is-fullwidth is-primary".concat(C?" is-loading":""),disabled:!1,children:"Complete signup"}):(0,i.jsx)("button",{type:"submit",className:"button is-rounded is-medium is-fullwidth is-primary",disabled:!0,children:"Complete signup"})})})})]})]})})})})]}):(0,i.jsx)(p.Z,{})};s.default=N}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=32067)}),_N_E=e.O()}]);
2//# sourceMappingURL=username-13c6d8a8780d2e8f.js.map

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.