PageSourceSearch

https://poslovnenovine.ba/_nuxt/Dll8AakE.js

js poslovnenovine.ba collected 2026-10-02 19:23:20 UTC 7,089 bytes, 1 lines download raw bytes

1import{ak as I,n,r as T,ae as $,a5 as E,a4 as N,aY as i,bg as s,aT as c,bs as x,bt as b,aX as f,aS as A,bc as y,ai as w,aW as P,aZ as D,aR as H,a_ as J,bd as Z,bu as F,aQ as u}from"./B1IWrSUX.js";const O={class:"max-w-md mx-auto my-10 p-6 bg-white shadow-md"},Q={key:0,class:"mt-1 text-sm text-red-600"},W={key:0,class:"mt-1 text-sm text-red-600"},X={key:0,class:"mt-1 text-sm text-red-600"},Y={key:0,class:"mt-1 text-sm text-red-600"},G={class:"mt-2"},K={class:"flex items-center"},ee={class:"flex-1 h-2 bg-gray-200 rounded"},se={class:"text-xs ml-2"},ae={class:"text-xs mt-1 text-gray-600"},te={key:0,class:"mt-1 text-sm text-red-600"},re={key:1,class:"mt-1 text-sm text-red-600"},le={key:2,class:"mt-1 text-sm text-green-600"},oe={key:0,class:"p-3 bg-red-100 text-red-700"},ne={key:1,class:"p-3 bg-green-100 text-green-700"},ie=["disabled"],ue={key:0,class:"mr-2"},de={class:"text-center mt-4"},me={class:"text-sm text-gray-600"},ve=I({__name:"register",setup(ce){const p=n(""),g=n(""),m=n(""),r=n(""),l=n(""),z=n(!1),o=n(0),a=T({firstName:"",lastName:"",email:"",password:"",confirmPassword:""}),k=n(!1),h=n(!1),j=n(!1),S=n(!1),v=$(),V=F();E({title:"Registracija"});const C=()=>{let t=0;const e=r.value;if(k.value=!1,h.value=!1,j.value=!1,S.value=!1,!e){o.value=0;return}e.length>=8&&(t+=25,k.value=!0),/[A-Z]/.test(e)&&(t+=25,h.value=!0),/\d/.test(e)&&(t+=25,j.value=!0),/[!@#$%^&*]/.test(e)&&(t+=25,S.value=!0),o.value=t},L=()=>{a.confirmPassword="",l.value&&r.value!==l.value&&(a.confirmPassword="Lozinke se ne podudaraju")},M=N(()=>o.value===0?"Nema":o.value<=25?"Slaba":o.value<=50?"Srednja":o.value<=75?"Dobra":"Jaka"),R=N(()=>o.value===0?"bg-gray-300":o.value<=25?"bg-red-500":o.value<=50?"bg-orange-500":o.value<=75?"bg-yellow-500":"bg-green-500"),B=N(()=>o.value>=75),U=N(()=>!!p.value&&!!g.value&&!!m.value&&/^\S+@\S+\.\S+$/.test(m.value)&&!!r.value&&!!l.value&&r.value===l.value),q=async()=>{Object.keys(a).forEach(_=>a[_]=""),z.value=!1;let t=!0;if(p.value||(a.firstName="Ime je obavezno",t=!1),g.value||(a.lastName="Prezime je obavezno",t=!1),m.value?/^\S+@\S+\.\S+$/.test(m.value)||(a.email="Molimo unesite validnu email adresu",t=!1):(a.email="Email je obavezan",t=!1),r.value?r.value.length<8&&(a.password="Lozinka mora imati najmanje 8 znakova",t=!1):(a.password="Lozinka je obavezna",t=!1),l.value?r.value!==l.value&&(a.confirmPassword="Lozinke se ne podudaraju",t=!1):(a.confirmPassword="Molimo potvrdite lozinku",t=!1),!t)return;await v.register({firstName:p.value,lastName:g.value,email:m.value,password:r.value,confirmPassword:l.value})&&(z.value=!0,setTimeout(async()=>{await v.login({email:m.value,password:r.value})&&V.push("/")},1e3))};return(t,e)=>{const _=Z;return u(),i("div",O,[e[14]||(e[14]=s("h1",{class:"text-2xl font-bold text-center text-gray-800 mb-6"},"Registracija",-1)),s("form",{onSubmit:J(q,["prevent"]),class:"space-y-4"},[s("div",null,[e[5]||(e[5]=s("label",{for:"firstName",class:"block text-sm font-medium text-gray-700 mb-1"},"Ime",-1)),x(s("input",{id:"firstName","onUpdate:modelValue":e[0]||(e[0]=d=>p.value=d),type:"text",required:"",class:"w-full px-3 py-2 border border-gray-300 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Ime"},null,512),[[b,p.value]]),a.firstName?(u(),i("p",Q,f(a.firstName),1)):c("",!0)]),s("div",null,[e[6]||(e[6]=s("label",{for:"lastName",class:"block text-sm font-medium text-gray-700 mb-1"},"Prezime",-1)),x(s("input",{id:"lastName","onUpdate:modelValue":e[1]||(e[1]=d=>g.value=d),type:"text",required:"",class:"w-full px-3 py-2 border border-gray-300 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Prezime"},null,512),[[b,g.value]]),a.lastName?(u(),i("p",W,f(a.lastName),1)):c("",!0)]),s("div",null,[e[7]||(e[7]=s("label",{for:"email",class:"block text-sm font-medium text-gray-700 mb-1"},"Email",-1)),x(s("input",{id:"email","onUpdate:modelValue":e[2]||(e[2]=d=>m.value=d),type:"email",required:"",class:"w-full px-3 py-2 border border-gray-300 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"[email protected]"},null,512),[[b,m.value]]),a.email?(u(),i("p",X,f(a.email),1)):c("",!0)]),s("div",null,[e[9]||(e[9]=s("label",{for:"password",class:"block text-sm font-medium text-gray-700 mb-1"},"Lozinka",-1)),x(s("input",{id:"password","onUpdate:modelValue":e[3]||(e[3]=d=>r.value=d),type:"password",required:"",class:"w-full px-3 py-2 border border-gray-300 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"••••••••",onInput:C},null,544),[[b,r.value]]),a.password?(u(),i("p",Y,f(a.password),1)):c("",!0),s("div",G,[s("div",K,[e[8]||(e[8]=s("span",{class:"text-xs mr-2"},"Jačina lozinke:",-1)),s("div",ee,[s("div",{class:y(["h-full rounded",R.value]),style:A({width:`${o.value}%`})},null,6)]),s("span",se,f(M.value),1)]),s("div",ae,[s("ul",null,[s("li",{class:y({"text-green-600":k.value,"text-red-600":!k.value})}," ✓ Minimalno 8 karaktera ",2),s("li",{class:y({"text-green-600":S.value,"text-red-600":!S.value})}," ✓ Barem jedan specijalni karakter (!@#$%^&*) ",2),s("li",{class:y({"text-green-600":h.value,"text-red-600":!h.value})}," ✓ Barem jedno veliko slovo ",2),s("li",{class:y({"text-green-600":j.value,"text-red-600":!j.value})}," ✓ Barem jedan broj ",2)])])])]),s("div",null,[e[10]||(e[10]=s("label",{for:"confirmPassword",class:"block text-sm font-medium text-gray-700 mb-1"},"Potvrdi lozinku",-1)),x(s("input",{id:"confirmPassword","onUpdate:modelValue":e[4]||(e[4]=d=>l.value=d),type:"password",required:"",class:"w-full px-3 py-2 border border-gray-300 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"••••••••",onInput:L},null,544),[[b,l.value]]),a.confirmPassword?(u(),i("p",te,f(a.confirmPassword),1)):l.value&&r.value!==l.value?(u(),i("p",re," Lozinke se ne podudaraju ")):l.value&&r.value===l.value?(u(),i("p",le," Lozinke se podudaraju ")):c("",!0)]),w(v).error?(u(),i("div",oe,f(w(v).error),1)):c("",!0),z.value?(u(),i("div",ne," Registracija uspjeÅ¡na! Sigurno vas prijavljujemo... ")):c("",!0),s("button",{type:"submit",class:"w-full bg-primary hover:bg-primary/90 text-white font-bold py-2 px-4 transition duration-300 flex justify-center items-center",disabled:w(v).loading||!B.value||!U.value},[w(v).loading?(u(),i("span",ue,[...e[11]||(e[11]=[s("svg",{class:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),s("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"})],-1)])])):c("",!0),P(" "+f(w(v).loading?"Registracija...":"Registracija"),1)],8,ie),s("div",de,[s("p",me,[e[13]||(e[13]=P(" Već imate nalog? ",-1)),D(_,{to:"/login",class:"text-primary hover:underline"},{default:H(()=>[...e[12]||(e[12]=[P("Prijava",-1)])]),_:1})])])],32)])}}});
1export{ve 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.