PageSourceSearch

https://wiapy.com/_nuxt/onnyGr--.js

js wiapy.com collected 2026-10-01 15:19:44 UTC 9,772 bytes, 1 lines download raw bytes

1import{_ as u}from"./Bbf2A_VU.js";import{q as n,n as i,x as c,bc as p,v as d,aS as h,p as l,F as m,bf as f,bd as g,b5 as w,a_ as y,aA as r}from"./DY9uiTjd.js";import{_ as k}from"./DAwwk0kK.js";import{_ as v}from"./COsGjY5g.js";import{d as b}from"./BSAyYz-O.js";import{k as x,i as C}from"./C_P9wO55.js";import{s as T}from"./fBNEgODu.js";import{f as A}from"./DElLD_xN.js";import"./wzCOPK40.js";const z={class:"relative min-h-screen"},S={class:"absolute top-4 right-4"},M={key:0,class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},_={key:1,class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},$={class:"flex min-h-screen flex-col justify-center px-4 py-12 sm:px-6 lg:px-8"},L={class:"mt-10 sm:mx-auto sm:w-full sm:max-w-lg"},V={class:"rounded-2xl bg-white dark:bg-primary-900 p-6 shadow-custom"},N={class:"mt-4 text-sm text-primary dark:text-primary-200"},E={key:0},I={key:2},U={class:"flex flex-col gap-2"},B=["disabled"],j={key:0,class:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},q={class:"flex justify-center"},D=["disabled"],R=b({setup(){y({title:"Wiapy - Verificar dispositivo",htmlAttrs:{lang:"pt-BR"},meta:[{charset:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{hid:"description",name:"description",content:"Um ecossistema completo para vender seu infoproduto com a menor taxa do mercado."}],link:[{rel:"icon",type:"image/x-icon",href:"/img/favicon.ico"}]})},data(){return{load:!0,sending:!1,code:"",token:null,name:"Usuário",channels:{},resendCountdown:0,countdownTimer:null,theme:"light"}},mounted(){this.restoreFirebaseSession();let o=null;if(window.localStorage){const t=window.localStorage.getItem("site-theme");if(typeof t=="string"){const s=t.trim().toLowerCase();o=s==="dark"||s==="light"?s:null}}if(!o){const t=this.cookieGet("site-theme");if(typeof t=="string"){const s=t.trim().toLowerCase();o=s==="dark"||s==="light"?s:null}}const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;this.theme=o||(e?"dark":"light"),document.documentElement.classList.toggle("dark",this.theme==="dark"),document.documentElement.setAttribute("data-theme",this.theme),window.localStorage&&window.localStorage.setItem("site-theme",this.theme)},beforeUnmount(){this.countdownTimer&&clearInterval(this.countdownTimer)},methods:{toggleTheme(){this.theme=this.theme==="light"?"dark":"light",this.cookieSet("site-theme",this.theme,{expires:"365d"}),document.documentElement.classList.toggle("dark",this.theme==="dark"),document.documentElement.setAttribute("data-theme",this.theme),window.localStorage&&window.localStorage.setItem("site-theme",this.theme)},restoreFirebaseSession(){if(!this.$firebaseAuth||typeof this.$firebaseAuth.onAuthStateChanged!="function")return this.fallbackToAuthTokenCookie();const o=this.$firebaseAuth.onAuthStateChanged(e=>{if(o(),!e)return this.fallbackToAuthTokenCookie();e.getIdToken(!0).then(t=>{this.token=t,this.name=e.displayName||"Usuário",this.cookieSet("auth-token",t,{expires:"1h"}),this.requestCode()}).catch(()=>{this.fallbackToAuthTokenCookie()})})},fallbackToAuthTokenCookie(){const o=this.cookieGet("auth-token");return o&&!C(o)?(this.token=o,this.requestCode()):this.$router.push("/login")},startCountdown(o){this.countdownTimer&&clearInterval(this.countdownTimer),this.resendCountdown=o,this.countdownTimer=T(()=>{this.resendCountdown-=1,this.resendCountdown<=0&&(clearInterval(this.countdownTimer),this.countdownTimer=null)},1e3)},async requestCode(o=!1){if(this.token){this.load=!o;try{const e=await this.httpPost(this.$config.public.baseURL+"/login/device/request",{},{headers:{Authorization:this.token}});if(this.load=!1,e.body.already_verified)return this.finish();e.body.channels&&(this.channels=e.body.channels),this.startCountdown(e.body.resend_in||60),o&&notification("Um novo código foi enviado!","success",null)}catch(e){if(this.load=!1,e.status===429&&e.body?.code==="RESEND_COOLDOWN"){this.startCountdown(e.body.retry_after||60),o&&notification("Aguarde para reenviar um novo código.","warning",null);return}return e.status===429?notification("Muitos códigos solicitados. Tente novamente mais tarde.","danger",null):e.status===401?this.$router.push("/login"):notification("Não foi possível enviar o código, tente novamente!","danger",null)}}},async sendCode(){if(!/^\d{6}$/.test(this.code))return notification("Informe o código de 6 dígitos!","danger",null);this.sending=!0;try{const o=await this.httpPost(this.$config.public.baseURL+"/login/device/verify",{code:this.code},{headers:{Authorization:this.token}});return x(o.body.device_token),this.finish()}catch(o){return this.sending=!1,this.code="",o.status===429?notification("Muitas tentativas. Solicite um novo código.","danger",null):o.status===401?this.$router.push("/login"):notification("Código inválido ou expirado, tente novamente!","danger",null)}},async finish(){this.load=!0;try{const o=await this.httpGet(this.$config.public.baseURL+"/login/status",{headers:{Authorization:this.token,token:""}});A(this,this.token,this.name,o.body)}catch{return this.load=!1,this.sending=!1,notification("Não foi possível concluir o login, tente novamente!","danger",null)}}}},"$yub7XuI-4D"),Q=Object.assign(R,{__name:"verify",setup(o){return(e,t)=>{const s=u;return r(),n("div",z,[i("div",S,[i("button",{type:"button",onClick:t[0]||(t[0]=(...a)=>e.toggleTheme&&e.toggleTheme(...a)),class:"inline-flex items-center justify-center rounded-lg border border-gray-300 dark:border-primary-600 p-2 text-gray-500 dark:text-gray-300 transition-colors hover:text-primary hover:bg-gray-50 dark:hover:bg-primary-800 dark:hover:text-secondary focus:outline-none focus:ring-0"},[e.theme==="dark"?(r(),n("svg",M,[...t[4]||(t[4]=[i("path",{d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 7h1a1 1 0 110 2h-1a1 1 0 110-2zm-8 0a1 1 0 110 2H5a1 1 0 110-2h1zm9.071-4.071a1 1 0 010 1.414l-.707.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM6.05 6.464a1 1 0 01-1.414 0l-.707-.707A1 1 0 115.343 4.343l.707.707a1 1 0 010 1.414zM11 16a1 1 0 10-2 0v1a1 1 0 102 0v-1zm4.657-1.657a1 1 0 10-1.414 1.414l.707.707a1 1 0 001.414-1.414l-.707-.707zM6.757 14.243a1 1 0 00-1.414 0l-.707.707a1 1 0 001.414 1.414l.707-.707a1 1 0 000-1.414zM13 10a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])])):(r(),n("svg",_,[...t[5]||(t[5]=[i("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"},null,-1)])]))])]),i("div",$,[t[12]||(t[12]=i("div",{class:"sm:mx-auto sm:w-full sm:max-w-md"},[i("a",{href:"/",class:"flex justify-center"},[i("img",{src:k,class:"dark:hidden w-[220px]",style:{"max-width":"220px"}}),i("img",{src:v,class:"hidden dark:block w-[220px]",style:{"max-width":"220px"}})])],-1)),i("div",L,[i("div",V,[c(s,{to:"/login",class:"flex gap-2 text-primary-500"},{default:p(()=>[...t[6]||(t[6]=[i("svg",{class:"w-6 h-6 text-primary-500 dark:text-primary-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[i("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12l4-4m-4 4 4 4"})],-1),d(" Voltar para login ",-1)])]),_:1}),t[11]||(t[11]=i("h4",{class:"text-xl font-semibold text-primary dark:text-primary-200 mt-4"},"Verificar dispositivo",-1)),i("p",N,[t[7]||(t[7]=d(" Este dispositivo ainda não é reconhecido. Enviamos um código de verificação para ",-1)),e.channels.email?(r(
1),n("strong",E,h(e.channels.email),1)):l("",!0),e.channels.email&&e.channels.whatsapp?(r(),n(m,{key:1},[d(" e ")],64)):l("",!0),e.channels.whatsapp?(r(),n("strong",I,h(e.channels.whatsapp),1)):l("",!0),!e.channels.email&&!e.channels.whatsapp?(r(),n(m,{key:3},[d("o seu e-mail e whatsapp")],64)):l("",!0),t[8]||(t[8]=d(". ",-1))]),i("form",{class:"mt-8 space-y-6",onSubmit:t[3]||(t[3]=f((...a)=>e.sendCode&&e.sendCode(...a),["prevent"]))},[i("div",U,[t[9]||(t[9]=i("label",{for:"code",class:"text-sm font-medium text-primary dark:text-primary-200"},"Código de verificação",-1)),g(i("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>e.code=a),name:"code",id:"code",type:"text",inputmode:"numeric",autocomplete:"one-time-code",maxlength:"6",pattern:"\\d{6}",class:"w-full px-3 py-2 h-[48px] bg-white border border-gray-300 rounded-lg dark:bg-primary-950 dark:border-primary-800 focus:outline-none focus:ring-1 focus:ring-secondary focus:border-secondary text-center text-2xl tracking-[0.5em]",placeholder:"000000",required:""},null,512),[[w,e.code]])]),i("div",null,[i("button",{type:"submit",disabled:e.sending||e.code.length!==6,class:"w-full px-3 py-2 h-[40px] bg-white border border-gray-300 rounded-lg hover:border-secondary hover:border-2 dark:bg-primary-950 dark:border-primary-800 dark:hover:border-secondary disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:border-gray-300 dark:disabled:hover:border-primary-800 flex items-center justify-center gap-2"},[e.sending?(r(),n("svg",j,[...t[10]||(t[10]=[i("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),i("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):l("",!0),d(" "+h(e.sending?"Verificando...":"Verificar"),1)],8,B)]),i("div",q,[i("button",{type:"button",disabled:e.resendCountdown>0,onClick:t[2]||(t[2]=a=>e.requestCode(!0)),class:"text-sm font-medium text-primary hover:text-primary-light dark:text-primary-200 hover:dark:text-primary-300 disabled:opacity-50 disabled:cursor-not-allowed"},h(e.resendCountdown>0?`Reenviar código em ${e.resendCountdown}s`:"Reenviar código"),9,D)])],32)])])])])}}});export{Q 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.