PageSourceSearch

https://sociair.com/_nuxt/DRgeYGzB.js

js sociair.com collected 2026-10-02 00:56:16 UTC 26,770 bytes, 1 lines download raw bytes

1import{d as L,e as S,w as A,h as G,k as de,o as r,c as h,a as t,H as z,t as N,n as F,I as U,b as O,x as _,v as I,ar as te,g as ce,D as ne,R as oe,F as q,r as Q,y as T,p as R,m as me,_ as fe,G as H,z as pe,A as le,Q as be,at as Z,u as k,K as ge,ax as ve,W as xe,au as he}from"./BE4rzOWR.js";import{S as ye,O as we}from"./CZ9Qmvak.js";import{O as Y,u as ae,S as Ce,C as ee}from"./CMFLvF_a.js";import{_ as ie}from"./De7UrdYI.js";import{g as ke,a as $e}from"./Cyq0lUFz.js";import{r as Ve,u as Ne,P as Ee,S as Se}from"./cqW9u2tB.js";import{u as Oe}from"./D8WochWl.js";import"./BNUFXsid.js";import"./4Esb_FzN.js";import"./4_g7FhMI.js";import"./CF0fbT27.js";const Be={class:"flex flex-col gap-1.5"},De={class:"text-[#64748B] text-sm font-semibold"},je={class:"text-[17px] leading-none"},Fe={class:"text-[17px] text-gray-700 tabular-nums"},Pe=["value","placeholder"],Te={class:"p-2 border-b border-[#E2E8F0]"},Ie={class:"overflow-y-auto max-h-64"},Re=["onClick"],Le={class:"truncate"},Me={class:"text-gray-400 ml-auto tabular-nums"},_e={key:0,class:"text-sm text-red-500 ml-2"},ze=L({__name:"OnboardingPhoneInput",props:{modelValue:{},dialCode:{},countryCode:{},label:{default:"Mobile Number"},placeholder:{default:"98XXXXXXXX"},error:{},variant:{default:"pill"}},emits:["update:modelValue","update:dialCode","blur"],setup(e,{emit:p}){const n=e,v=p,u=new Intl.DisplayNames(["en"],{type:"region"});function b(c){return c.toUpperCase().split("").map(m=>String.fromCodePoint(127397+m.charCodeAt(0))).join("")}function w(){return ke().map(c=>({iso2:c,dialCode:"+"+$e(c),name:u.of(c)??c,flag:b(c)})).sort((c,m)=>c.name.localeCompare(m.name))}const l=w(),f=S(!1),i=S(""),s=S(null),g=S(null),E=S({width:"280px"}),y=S(l.find(c=>c.iso2==="NP")??l[0]);A([()=>n.dialCode,()=>n.countryCode],([c,m])=>{if(!c&&!m)return;const B=m&&l.find(D=>D.iso2===m)||c&&l.find(D=>D.dialCode===c);B&&B.iso2!==y.value.iso2&&(y.value=B)},{immediate:!0});const C=R(()=>{const c=i.value.toLowerCase().trim().replace(/^\+/,"");return c?l.filter(m=>m.name.toLowerCase().includes(c)||m.dialCode.replace("+","").includes(c)||m.iso2.toLowerCase().includes(c)):l});function o(){if(!s.value)return;const c=s.value.getBoundingClientRect();E.value={top:`${c.bottom+4}px`,left:`${c.left}px`,width:`${c.width}px`}}async function d(){f.value?f.value=!1:(o(),f.value=!0,i.value="",await me(),g.value?.focus())}function a(c){y.value=c,v("update:dialCode",c.dialCode),f.value=!1,i.value=""}function j(c){const m=c.target.value.replace(/\D/g,"");v("update:modelValue",m)}function P(c){const m=c.target,B=document.querySelector("[data-phone-dropdown]");s.value?.contains(m)||B?.contains(m)||(f.value=!1)}function M(){f.value&&o()}return G(()=>{n.dialCode||v("update:dialCode",y.value.dialCode),document.addEventListener("click",P),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M)}),de(()=>{document.removeEventListener("click",P),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}),(c,m)=>{const B=ie;return r(),h("div",Be,[t("label",De,[z(N(e.label)+" ",1),m[3]||(m[3]=t("span",{class:"text-red-500"},"*",-1))]),t("div",{ref_key:"dropdownRef",ref:s,class:"relative w-full"},[t("div",{class:F(["flex items-center border bg-white transition-all",[e.variant==="pill"?"rounded-full":"rounded-lg",e.error?"border-red-400 focus-within:border-red-400 focus-within:ring-1 focus-within:ring-red-400":"border-[#E2E8F0] focu
1s-within:border-primary-500 focus-within:ring-1 focus-within:ring-primary-500/30"]])},[t("button",{type:"button",class:F(["flex items-center gap-1.5 bg-gray-50 border-r border-[#E2E8F0] shrink-0 cursor-pointer transition-all",[e.variant==="pill"?"rounded-l-full px-6 py-4":"rounded-l-lg px-4 py-3"]]),onClick:U(d,["stop"])},[t("span",je,N(y.value.flag),1),t("span",Fe,N(y.value.dialCode),1),(r(),h("svg",{class:F(["w-3 h-3 text-gray-400 transition-transform duration-200",f.value?"rotate-180":""]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},[...m[4]||(m[4]=[t("path",{d:"M6 9l6 6 6-6","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))],2),t("input",{value:e.modelValue,type:"tel",placeholder:e.placeholder,maxlength:"10",class:F(["flex-1 phone-number-input text-[17px] outline-none bg-transparent",[e.variant==="pill"?"rounded-r-full px-6 py-4":"rounded-r-lg px-4 py-3"]]),onInput:j,onBlur:m[0]||(m[0]=D=>c.$emit("blur"))},null,42,Pe)],2),O(B,null,{default:_(()=>[(r(),I(te,{to:"body"},[f.value?(r(),h("div",{key:0,"data-phone-dropdown":"",class:"fixed z-[9999] bg-white border border-[#E2E8F0] rounded-xl shadow-xl overflow-hidden",style:ce(E.value)},[t("div",Te,[ne(t("input",{ref_key:"searchInputRef",ref:g,"onUpdate:modelValue":m[1]||(m[1]=D=>i.value=D),type:"text",placeholder:"Search country...",class:"w-full border border-[#E2E8F0] rounded-lg px-3 py-2 text-sm outline-none focus:border-blue-400",onClick:m[2]||(m[2]=U(()=>{},["stop"]))},null,512),[[oe,i.value]])]),t("div",Ie,[(r(!0),h(q,null,Q(C.value,D=>(r(),h("button",{key:D.iso2,type:"button",class:F(["w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-blue-50 text-left",D.iso2===y.value.iso2?"bg-blue-50 font-medium":""]),onClick:U(J=>a(D),["stop"])},[t("span",null,N(D.flag),1),t("span",Le,N(D.name),1),t("span",Me,N(D.dialCode),1)],10,Re))),128))])],4)):T("",!0)]))]),_:1})],512),e.error?(r(),h("p",_e,N(e.error),1)):T("",!0)])}}}),Ue=Object.assign(fe(ze,[["__scopeId","data-v-8673a445"]]),{__name:"V2OnboardingFormsOnboardingPhoneInput"}),Ae={class:"flex flex-col gap-4"},qe=["disabled"],Xe={class:"text-[17px] text-gray-500"},We=L({__name:"RegisterForm",props:{initialValues:{},loading:{type:Boolean,default:!1}},emits:["submit"],setup(e,{emit:p}){const n=e,v=p,{isFullName:u,isEmail:b,isMobileNumber:w}=ae(),l=S(n.initialValues?.dialCode||"+977"),f=S(n.initialValues?.countryCode??""),i=H({fullName:n.initialValues?.fullName??"",email:n.initialValues?.email??"",mobileNumber:n.initialValues?.mobileNumber??""}),s=H({fullName:"",email:"",mobileNumber:""});A(()=>n.initialValues,C=>{C&&(i.fullName=C.fullName??i.fullName,i.email=C.email??i.email,i.mobileNumber=C.mobileNumber??i.mobileNumber,C.dialCode&&(l.value=C.dialCode),C.countryCode&&(f.value=C.countryCode))},{deep:!0});function g(C){if(C==="fullName"){const o=u(i.fullName);return s.fullName=o===!0?"":o,o===!0}if(C==="email"){const o=b(i.email);return s.email=o===!0?"":o,o===!0}if(C==="mobileNumber"){const o=w(i.mobileNumber);return s.mobileNumber=o===!0?"":o,o===!0}return!0}function E(){return g("fullName")&&g("email")&&g("mobileNumber")}function y(){E()&&v("submit",{fullName:i.fullName,email:i.email,mobileNumber:i.mobileNumber,dialCode:l.value,password:""})}return(C,o)=>{const d=pe;return r(),h("form",{class:"w-full flex flex-col",onSubmit:U(y,["prevent"])},[O(d,{to:"/",class:"inline-block mb-7"},{default:_(()=>[O(ye,{"show-text":!1,size:"lg"})]),_:1}),o[9]||(o[9]=t("h1",{class:"text-[26px] xl:text-[28px] font-bold text-[#334155] mb-6"}," Your Business Deserves More. ",-1)),o[10]||(o[10]=t("p",{class:"text-[17px] text-gray-500"}," The easiest way to grow your business with social media. ",-1)),t("div",Ae,[O(Y,{modelValue:i.fullName,"onUpdate:modelValue":o[0]||(o[0]=a=>i.fullName=a),label:"Full Name",placeholder:"eg. Ram Thapa",error:s.fullName,required:"",variant:"pill",autocomplete:"name",onBlur:o[1]||(o[1]=a=>g("fullName"))},null,8,["modelValue","error"]),O(Y,{modelValue:i.email,"onUpdate:modelValue":o[2]||(o[2]=a=>i.email=a),label:"Email Address",type:"email",placeholder:"eg. [email protected]",error:s.email,required:"",variant:"pill",autocomplete:"email",onBlur:o[3]||(o[3]=a=>g("email"))},null,8,["modelValue","error"]),O(Ue,{modelValue:i.mobileNumber,"onUpdate:modelValue":o[4]||(o[4]=a=>i.mobileNumber=a),"dial-code":l.value,"onUpdate:dialCode":o[5]||(o[5]=a=>l.value=a),"country-code":f.value,error:s.mobileNumber,variant:"pill",onBlur:o[6]||(o[6]=a=>g("mobileNumber"))},null,8,["modelValue","dial-code","country-code","error"]),t("button",{type:"submit",class:"w-full rounded-full py-4 mt-1 text-[17px] font-semibold text-white bg-[#2374E1] hover:bg-[#1C5DB4] transition-colors disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer border-0",disabled:e.loading},N(e.loading?"Registering...":"Register"),9,qe),t("p",Xe,[o[8]||(o[8]=z(" Already have an account? ",-1)),O(d,{to:"/v2/login",class:"font-medium text-primary-500 hover:underline"},{default:_(()=>[...o[7]||(o[7]=[z(" Login ",-1)])]),_:1})])])],32)}}}),Ke=Object.assign(We,{__name:"V2OnboardingAuthRegisterForm"}),He={class:"flex items-center justify-center gap-2.5 sm:gap-3 relative"},Qe=["maxlength"],Ye=["onClick"],Ge=L({__name:"OtpInput",props:{modelValue:{default:""},length:{default:6}},emits:["update:modelValue","complete"],setup(e,{emit:p}){const n=e,v=p,u=R(()=>n.length),b=S([]),w=S(null),l=S(""),f=S(0),i=S(!1);function s(){b.value=Array(u.value).fill("")}function g(){const y=l.value.replace(/\D/g,"").slice(0,u.value);l.value=y,b.value=Array(u.value).fill(""),y.split("").forEach((o,d)=>{b.value[d]=o}),f.value=Math.min(y.length,u.value-1);const C=b.value.join("");v("update:modelValue",C),C.length===u.value&&v("complete",C)}function E(y){f.value=y,w.value?.focus(),i.value=!0}return A(()=>n.length,()=>{s(),l.value=""}),A(()=>n.modelValue,y=>{y||(s(),l.value="",f.value=0,i.value=!1)}),G(()=>{s(),w.value?.focus(),i.value=!0}),(y,C)=>(r(),h("div",He,[ne(t("input",{ref_key:"hiddenInput",ref:w,"onUpdate:modelValue":C[0]||(C[0]=o=>l.value=o),type:"text",class:"absolute opacity-0 w-px h-px pointer-events-none",maxlength:u.value,inputmode:"numeric",pattern:"[0-9]*",onInput:g,onBlur:C[1]||(C[1]=o=>i.value=!1)},null,40,Qe),[[oe,l.value]]),(r(!0),h(q,null,Q(b.value,(o,d)=>(r(),h("div",{key:d,class:F(["otp-box w-12 h-12 sm:w-[52px] sm:h-[52px] flex items-center justify-center text-lg sm:text-xl rounded-xl border bg-white cursor-text",[i.value&&f.value===d?"border-[#2374E1]":"border-[#DEEAFB]",o?"text-[#154687]":"text-[#CBD5E1]"]]),onClick:a=>E(d)},N(o||"-"),11,Ye))),128))]))}}),Je=Object.assign(Ge,{__name:"V2OnboardingModalsOtpInput"}),Ze={class:"relative bg-white rounded-2xl shadow-xl w-full max-w-[440px] p-8 flex flex-col gap-6"},et={class:"flex flex-col gap-2 text-center"},tt={class:"text-[14px] leading-relaxed text-[#94A3B8]"},nt={class:"font-medium text-[#64748B]"},ot={class:"text-[13px] text-center text-[#94A3B8]"},lt={key:1,class:"font-semibold text-[#475569] ml-1"},at=["disabled"],it=L({__name:"OTPModal",props:{open:{type:Boolean},mobileNumber:{},length:{default:6},loading:{type:Boolean,default:!1},resendCooldown:{default:60}},emits:["verify","resend","close","change-number"],setup(e,{emit:p}){const n=e,v=p,u=S(""),b=S(0);let w=null;const l=R(()=>u.value.length!==n.length),f=R(()=>b.value<=0),i=R(()=>{const d=n.mobileNumber?.trim()||"";if(d.length<=4)return d;const a=d.slice(-4);return`${d.startsWith("+")?d.slice(0,Math.min(4,d.length-4)):""}******${a}`}),s=R(()=>{const d=Math.max(0,b.value),a=Math.floor(d/60),j=d%60;return`${String(a).padStart(2,"0")}
1:${String(j).padStart(2,"0")}`});function g(){E(),b.value=Math.max(0,n.resendCooldown),b.value!==0&&(w=be(()=>{const d=b.value-1;b.value=Math.max(0,d),d<=0&&E()},1e3))}function E(){w&&(clearInterval(w),w=null)}function y(d){const a=d??u.value;a.length!==n.length||n.loading||v("verify",a)}function C(d){u.value=d,y(d)}function o(){f.value&&(u.value="",v("resend"),g())}return A(()=>n.open,d=>{d?(u.value="",g()):(E(),b.value=0)},{immediate:!0}),le(()=>{E()}),(d,a)=>{const j=ie;return r(),I(j,null,{default:_(()=>[(r(),I(te,{to:"body"},[e.open?(r(),h("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center px-4",onClick:a[3]||(a[3]=U(P=>d.$emit("close"),["self"]))},[a[8]||(a[8]=t("div",{class:"absolute inset-0 bg-black/40"},null,-1)),t("div",Ze,[t("div",et,[a[6]||(a[6]=t("h2",{class:"text-[22px] font-bold leading-tight text-[#2E353E]"}," Enter OTP Code ",-1)),t("p",tt,[a[4]||(a[4]=z(" We have sent you a 6-digit OTP code to your mobile number “",-1)),t("span",nt,N(i.value),1),a[5]||(a[5]=z("”. Enter the code below to continue. ",-1))]),t("button",{type:"button",class:"text-[13px] font-medium text-[#2374E1] hover:text-[#1C5DB4] self-center",onClick:a[0]||(a[0]=P=>v("change-number"))}," Change number ")]),O(Je,{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=P=>u.value=P),length:e.length,onComplete:C},null,8,["modelValue","length"]),t("p",ot,[a[7]||(a[7]=z(" Didn’t receive the code? ",-1)),f.value?(r(),h("button",{key:0,type:"button",class:"font-semibold text-[#2374E1] hover:text-[#1C5DB4] ml-1",onClick:o}," Resend Code ")):(r(),h("span",lt," Resend in "+N(s.value),1))]),t("button",{type:"button",class:F(["w-full h-[54px] text-[16px] font-semibold text-white rounded-full transition-colors disabled:cursor-not-allowed",l.value||e.loading?"bg-[#BFDBFE]":"bg-[#2374E1] hover:bg-[#1C5DB4]"]),disabled:l.value||e.loading,onClick:a[2]||(a[2]=P=>y())},N(e.loading?"Verifying...":"Verify"),11,at)])])):T("",!0)]))]),_:1})}}}),st=Object.assign(it,{__name:"V2OnboardingModalsOTPModal"}),rt=["aria-pressed"],ut={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"white","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},dt={class:"w-10 h-10 rounded-xl flex items-center justify-center mb-4 bg-[#EEF2F6]"},ct={class:"text-lg font-bold text-[#334155] mb-2 pr-8"},mt={class:"text-sm text-[#64748B] leading-relaxed pr-2"},ft={key:0,class:"relative mt-auto -mx-2 flex items-end justify-center min-h-[170px]"},pt=["src"],bt=L({__name:"ProjectCard",props:{id:{},title:{},description:{},iconName:{},illustration:{},selected:{type:Boolean}},emits:["toggle"],setup(e){const p=e,n=R(()=>p.id==="SociairConnect"?ve:Ve(p.title,p.description,p.iconName));return(v,u)=>(r(),h("div",{class:F(["relative flex flex-col w-full min-h-[360px] overflow-hidden text-left p-5 pb-0 rounded-2xl border bg-white transition-all cursor-pointer hover:shadow-[0_4px_24px_rgba(35,116,225,0.08)]",e.selected?"border-[#2374E1] shadow-[0_4px_24px_rgba(35,116,225,0.12)]":"border-[#E2E8F0]"]),role:"button",tabindex:"0","aria-pressed":e.selected,onClick:u[0]||(u[0]=b=>v.$emit("toggle",e.id)),onKeydown:[u[1]||(u[1]=Z(U(b=>v.$emit("toggle",e.id),["prevent"]),["enter"])),u[2]||(u[2]=Z(U(b=>v.$emit("toggle",e.id),["prevent"]),["space"]))]},[t("div",{class:F(["absolute top-5 right-5 w-5 h-5 rounded-full flex items-center justify-center",e.selected?"bg-[#2374E1]":"border-2 border-[#CBD5E1] bg-white"])},[e.selected?(r(),h("svg",ut,[...u[3]||(u[3]=[t("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):T("",!0)],2),t("div",dt,[O(k(ge),{icon:n.value,size:22,color:"#64748B"}
1,null,8,["icon"])]),t("h3",ct,N(e.title),1),t("p",mt,N(e.description),1),e.illustration?(r(),h("div",ft,[t("img",{src:e.illustration,alt:"",class:"w-full max-w-[340px] h-auto object-contain select-none pointer-events-none",draggable:"false"},null,8,pt)])):T("",!0)],42,rt))}}),gt=Object.assign(bt,{__name:"V2OnboardingCardsProjectCard"}),vt=""+new URL("project-connect.JtmtN5QK.png",import.meta.url).href,xt=""+new URL("project-commerce.W79JvYE-.png",import.meta.url).href,se=[{id:"SociairConnect",title:"Sociair Connect",description:"Run social media, chats, calls, CRM, tickets, and customer engagement seamlessly from one unified workspace.",iconName:"Globe02Icon",illustration:vt},{id:"SociairCommerce",title:"Sociair Commerce",description:"Turn your social channels into a sales engine with products, orders, delivery, POS, inventory, and accounting.",iconName:"ShoppingCart02Icon",illustration:xt}];function K(e){return typeof e=="string"?e.trim():""}function ht(e){const p=K(e?.value),n=K(e?.label);if(!p||!n)return null;const v=se.find(u=>u.id===p);return{id:p,title:n,description:K(e?.description)||v?.description||"",iconName:K(e?.icon)||v?.iconName||"",illustration:v?.illustration}}function yt(){const e=S(se),p=S(!1);async function n(){const{$api:v}=xe();p.value=!0;try{const w=((await v.get("/central/website/get-primary-products"))?.data?.data??[]).map(ht).filter(l=>l!==null);w.length&&(e.value=w)}catch{}finally{p.value=!1}}return G(n),{projects:e,isLoading:p,fetchProjects:n}}const wt={class:"flex flex-col w-full pb-28"},Ct={key:0,class:"text-sm text-red-500 mb-4"},kt={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"}
1,$t={class:"fixed bottom-0 left-0 right-0 z-20 bg-white border-t border-[#E2E8F0]"},Vt={class:"max-w-[1100px] mx-auto flex justify-end items-center gap-3 px-6 sm:px-10 py-4"},Nt=["disabled"],Et=["disabled"],St={key:0,class:"w-4 h-4 rounded-full border-2 border-white border-t-transparent animate-spin"},Ot=L({__name:"ProjectSelectionStep",props:{modelValue:{},loading:{type:Boolean,default:!1}},emits:["update:modelValue","next","back"],setup(e,{emit:p}){const n=e,v=p,{projects:u}=yt(),b=S(""),w=R(()=>new Set(n.modelValue));function l(i){const s=[...n.modelValue],g=s.indexOf(i);g===-1?s.push(i):s.splice(g,1),v("update:modelValue",s),b.value=""}function f(){if(!n.loading){if(!n.modelValue.length){b.value="Select at least one project to continue";return}v("next")}}return(i,s)=>(r(),h("div",wt,[s[1]||(s[1]=t("div",{class:"mb-8"},[t("h2",{class:"text-2xl font-bold text-[#334155] mb-2"}," Choose the projects you'd like to use! "),t("p",{class:"text-base text-gray-500"}," Your answer will help us to give you the best start. ")],-1)),b.value?(r(),h("p",Ct,N(b.value),1)):T("",!0),t("div",kt,[(r(!0),h(q,null,Q(k(u),g=>(r(),I(gt,{key:g.id,id:g.id,title:g.title,description:g.description,"icon-name":g.iconName,illustration:g.illustration,selected:w.value.has(g.id),onToggle:l},null,8,["id","title","description","icon-name","illustration","selected"]))),128))]),t("div",$t,[t("div",Vt,[t("button",{type:"button",class:"rounded-full px-7 py-2.5 text-sm font-semibold text-[#2374E1] bg-white border border-[#2374E1] hover:bg-[#f0f8fe] transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",disabled:e.loading,onClick:s[0]||(s[0]=g=>i.$emit("back"))}," Back ",8,Nt),t("button",{type:"button",class:"inline-flex items-center gap-2 rounded-full px-7 py-2.5 text-sm font-semibold text-white bg-[#2374E1] hover:bg-[#1C5DB4] transition-colors cursor-pointer border-0 disabled:opacity-70 disabled:cursor-not-allowed",disabled:e.loading,onClick:f},[e.loading?(r(),h("span",St)):T("",!0),z(" "+N(e.loading?"Finishing…":"Finish"),1)],8,Et)])])]))}}),Bt=Object.assign(Ot,{__name:"V2OnboardingStepsProjectSelectionStep"}),Dt={class:"flex flex-col gap-1.5"},jt={class:"text-[#64748B] text-sm font-semibold ml-1.5"},Ft={key:0,class:"text-red-500"},Pt=["value","placeholder","required"],Tt={key:0,class:"text-sm text-red-500 ml-2 mt-0.5"},It={key:1,class:"text-sm text-gray-400 ml-2 mt-0.5"},Rt={key:2,class:"text-sm text-emerald-600 ml-2 mt-0.5"},Lt={key:3,class:"text-sm text-red-500 ml-2 mt-0.5"},Mt={key:4,class:"text-sm text-red-500 ml-2 mt-0.5"},_t={key:5,class:"flex flex-wrap items-center gap-2 ml-2 mt-1"},zt=["onClick"],Ut=L({__name:"OnboardingDomainInput",props:{modelValue:{},label:{default:"Website Name"},placeholder:{default:"Enter a website name"},error:{},required:{type:Boolean,default:!0},variant:{default:"pill"},status:{default:"idle"},statusMessage:{default:""},suggestions:{default:()=>[]}},emits:["update:modelValue","blur"],setup(e,{emit:p}){const n=he().public.TENANT_DOMAIN_SUFFIX,v=p;function u(b){const w=b.target.value;v("update:modelValue",w.toLowerCase().replace(/[^a-z0-9-]/g,""))}return(b,w)=>(r(),h("div",Dt,[t("label",jt,[z(N(e.label)+" ",1),e.required?(r(),h("span",Ft,"*")):T("",!0)]),t("div",{class:F(["flex items-center border bg-white transition-all",[e.variant==="pill"?"rounded-full":"rounded-lg",e.error?"border-red-400 focus-within:border-red-400 focus-within:ring-1 focus-within:ring-red-400":"border-[#E2E8F0] focu
1s-within:border-primary-500 focus-within:ring-1 focus-within:ring-primary-500/30"]])},[t("input",{value:e.modelValue,type:"text",placeholder:e.placeholder,required:e.required,class:F(["flex-1 text-base outline-none bg-transparent text-neutral-800 min-w-0",e.variant==="pill"?"rounded-l-full px-5 py-3.5":"rounded-l-lg px-4 py-3"]),onInput:u,onBlur:w[0]||(w[0]=l=>b.$emit("blur"))},null,42,Pt),t("span",{class:F(["shrink-0 text-gray-400 text-base select-none",e.variant==="pill"?"pr-5":"pr-4"])}," ."+N(k(n)),3)],2),e.error?(r(),h("p",Tt,N(e.error),1)):e.status==="checking"?(r(),h("p",It," Checking availability... ")):e.status==="available"?(r(),h("p",Rt,N(e.modelValue)+"."+N(k(n))+" is available ",1)):e.status==="taken"?(r(),h("p",Lt,N(e.modelValue)+"."+N(k(n))+" is already taken ",1)):e.status==="policy"||e.status==="invalid"?(r(),h("p",Mt,N(e.statusMessage||"This website name cannot be used."),1)):T("",!0),e.status==="taken"&&e.suggestions.length?(r(),h("div",_t,[w[1]||(w[1]=t("span",{class:"text-sm text-[#64748B]"},"Try:",-1)),(r(!0),h(q,null,Q(e.suggestions,l=>(r(),h("button",{key:l,type:"button",class:"rounded-full border border-[#2374E1] px-3 py-1 text-sm font-semibold text-[#2374E1] bg-white hover:bg-[#f0f8fe] transition-colors cursor-pointer",onClick:f=>b.$emit("update:modelValue",l)},N(l),9,zt))),128))])):T("",!0)]))}}),At=Object.assign(Ut,{__name:"V2OnboardingFormsOnboardingDomainInput"}),qt={class:"flex flex-col w-full pb-28"},Xt={class:"flex flex-col gap-6"},Wt={class:"fixed bottom-0 left-0 right-0 z-20 bg-white border-t border-[#E2E8F0]"},Kt={class:"max-w-[1100px] mx-auto flex justify-end px-6 sm:px-10 py-4"},Ht=["disabled"],Qt=500,Yt=L({__name:"OrganizationSetupStep",props:{modelValue:{},checkDomain:{type:Function},initialErrors:{}},emits:["update:modelValue","next"],setup(e,{emit:p}){const n=e,v=p,{isRequired:u,isDomainSlug:b}=ae(),w=S(!1),l=H({...n.modelValue}),f=H({name:"",domain:""}),i=Oe(),s=S("idle"),g=S(""),E=S([]),y=S("");A(()=>n.initialErrors,x=>{x&&(x.name&&(y.value=x.name,f.name=x.name),x.domain&&(s.value="policy",g.value=x.domain,E.value=[]))},{immediate:!0});let C=0;async function o(x){const V=++C,$=await i.checkName(x);V===C&&(y.value=$&&!$.available?$.message||"This name isn't allowed by our policy.":"",f.name=y.value)}const d=S(!1);let a,j=0;function P(x){clearTimeout(a),a=setTimeout(x,Qt)}le(()=>clearTimeout(a));async function M(x){const V=++j,$=await i.suggestDomain(x);if(V!==j||d.value)return;if($?.reason==="policy"&&$.base){l.domain=$.base,s.value="policy",g.value=$.message||"",E.value=[];return}const W=$?$.available?$.base:$.suggestions[0]:"";if(!W){s.value="idle",E.value=[];return}l.domain=W,s.value="available",g.value="",E.value=[]}async function c(x){const V=++j;s.value="checking";const $=await i.suggestDomain(x);if(V===j){if(!$||!$.base&&$.reason!=="invalid"){s.value="idle",E.value=[];return}s.value=$.available?"available":$.reason??"taken",g.value=$.message||"",E.value=$.available?[]:$.suggestions.filter(W=>W!==$.base)}}function m(){j++,l.domain="",f.domain="",s.value="idle",g.value="",E.value=[]}function B(x){if(d.value=x.trim().length>0,s.value="idle",E.value=[],!x.trim()){clearTimeout(a),f.domain="";return}P(()=>{c(x)})}function D(x){if(y.value="",f.name="",x.trim()&&o(x),!d.value){if(!x.trim()){clearTimeout(a),m();return}s.value="checking",E.value=[],M(x)}}const J=R(()=>!w.value&&!["taken","policy","invalid"].includes(s.value)&&!f.name&&l.name.trim().length>0&&l.domain.trim().length>0);A(()=>n.modelValue,x=>{Object.assign(l,x)},{deep:!0});function X(x){if(x==="name"){const V=u(l.name);return f.name=V===!0?y.value:V,V===!0&&!y.value}if(x==="domain"){const V=b(l.domain);return f.domain=V===!0?"":V,V===!0}return!0}function re(){return X("name")&&X("domain")}async function ue(){if(re()){w.value=!0;try{const x=await i.checkName(l.name);if(x&&!x.available){y.value=x.message||"This name isn't allowed by our policy.",f.name=y.value;return}if(n.checkDomain){const V=await n.checkDomain(l.domain);if(!V.available){f.domain=V.message||"That domain is already taken.";return}}}finally{w.value=!1}v("update:modelValue",{...l}),v("next")}}return(x,V)=>(r(),h("div",qt,[V[4]||(V[4]=t("h2",{class:"text-2xl font-bold text-[#334155] mb-8"}
1," Tell us about your business ",-1)),t("div",Xt,[O(Y,{modelValue:l.name,"onUpdate:modelValue":V[0]||(V[0]=$=>l.name=$),label:"Business name",placeholder:"eg. Sociair",error:f.name,required:"",variant:"pill",debounce:500,onBlur:V[1]||(V[1]=$=>X("name")),onDebouncedUpdate:D},null,8,["modelValue","error"]),O(At,{modelValue:l.domain,"onUpdate:modelValue":[V[2]||(V[2]=$=>l.domain=$),B],error:f.domain,status:s.value,"status-message":g.value,suggestions:E.value,variant:"pill",onBlur:V[3]||(V[3]=$=>X("domain"))},null,8,["modelValue","error","status","status-message","suggestions"])]),t("div",Wt,[t("div",Kt,[t("button",{type:"button",class:"rounded-full px-7 py-2.5 text-sm font-semibold text-white bg-[#2374E1] hover:bg-[#1C5DB4] transition-colors cursor-pointer border-0 disabled:opacity-40 disabled:hover:bg-[#2374E1] disabled:cursor-not-allowed",disabled:!J.value,onClick:ue},N(w.value?"Checking...":"Next"),9,Ht)])])]))}}),Gt=Object.assign(Yt,{__name:"V2OnboardingStepsOrganizationSetupStep"}),Jt=60,cn=L({__name:"registration",setup(e){const{state:p,currentStep:n,isOtpOpen:v,isLoading:u,hydrateFromDraft:b,submitAuth:w,verifyOtp:l,resendOtp:f,checkDomain:i,organizationErrors:s,updateOrganization:g,setSelectedProjects:E,goNext:y,goBack:C,finalize:o,completeProcessing:d,goToDashboard:a}=Ne();b();async function j(c){await l(c)}function P(){g({...p.organization}),y()}async function M(){E([...p.selectedProjects]),await o()}return(c,m)=>(r(),I(we,{pattern:k(n)==="organization"?"cropped":"default"},{default:_(()=>[k(n)==="auth"?(r(),h(q,{key:0},[O(Ce,null,{form:_(()=>[O(Ke,{"initial-values":k(p).auth,loading:k(u),onSubmit:k(w)},null,8,["initial-values","loading","onSubmit"])]),_:1}),O(st,{open:k(v),"mobile-number":`${k(p).auth.dialCode??""}${k(p).auth.mobileNumber??""}`,loading:k(u),"resend-cooldown":Jt,onVerify:j,onResend:k(f),onClose:m[0]||(m[0]=B=>v.value=!1),onChangeNumber:m[1]||(m[1]=B=>v.value=!1)},null,8,["open","mobile-number","loading","onResend"])],64)):k(n)==="organization"?(r(),I(ee,{key:1,"active-step":1},{default:_(()=>[O(Gt,{modelValue:k(p).organization,"onUpdate:modelValue":m[2]||(m[2]=B=>k(p).organization=B),"check-domain":k(i),"initial-errors":k(s),onNext:P},null,8,["modelValue","check-domain","initial-errors"])]),_:1})):k(n)==="modules"?(r(),I(ee,{key:2,"max-width":"max-w-[960px]","active-step":2},{default:_(()=>[O(Bt,{modelValue:k(p).selectedProjects,"onUpdate:modelValue":m[3]||(m[3]=B=>k(p).selectedProjects=B),loading:k(u),onNext:M,onBack:k(C)},null,8,["modelValue","loading","onBack"])]),_:1})):k(n)==="processing"||k(n)==="success"?(r(),h(q,{key:3},[k(n)==="processing"?(r(),I(Ee,{key:0,onComplete:k(d)},null,8,["onComplete"])):(r(),I(Se,{key:1,onContinue:k(a)},null,8,["onContinue"]))],64)):T("",!0)]),_:1},8,["pattern"]))}});export{cn 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.