PageSourceSearch

https://sklep.mindhealth.pl/_nuxt/CH22cEWA.js

js mindhealth.pl collected 2026-10-02 18:59:32 UTC 3,083 bytes, 1 lines download raw bytes

1import{_ as P}from"./tK8RIqFN.js";import{_ as x,a as B}from"./DCPr7C1G.js";import{_ as T}from"./wiuLEmgH.js";import{t as C,hA as $,hB as E,hC as S,hD as G,e as b,$ as k,hg as y,b as A,a as q,gQ as w,gP as L,hE as D,h1 as I,hF as H,he as R,hG as N,gU as v,f as U,gV as V,gY as F}from"#entry";import{u as M}from"./CZzedpsj.js";import{u as j}from"./B1RYJYu9.js";import{n as O,m as Q,A as Y,C as z,H as g,bi as J,G as K,ba as W,b2 as X,b4 as Z}from"./Bp1wWSz3.js";import"./54Ox3paH.js";import"./DJI65dep.js";import"./CoaDwLwU.js";import"./CEyBkMFL.js";import"./DlAUqK2U.js";function ee(){const{notify:i,notifyError:n}=C(),r=$(),u=E(),a=S(),t=G(),l=O(()=>a.value?.itemsCount),s=()=>{t.value&&(r.value=t.value,i({content:b().$i18n.t("Something went wrong. Please add the products to your cart again"),variant:"error"}))};return{itemsInCart:l,mergeCarts:async()=>b().$queuePromise(async()=>{try{const o=t.value;u.value+=1;const e=await k("/api/basket/get/customer");if(o&&e?.basketId!==o)try{a.value=await k("/api/basket/merge",{method:"post",body:{guestBasketId:o,customerBasketId:e?.basketId}}),t.value=a.value?.basketId}catch(m){y(m)||n(m),s(),t.value=e?.basketId??null,a.value=e}else t.value=e?.basketId??null,a.value=e}catch(o){const e=o?.statusCode;if(y(o)||e===401)return;n(o),e&&e<500&&(s(),t.value=null,a.value=null)}finally{u.value-=1}})}}function te(){const{notify:i}=C(),{t:n}=A(),r=q(),u=w(),a=L(),t=U();return{onLoggedIn:async(s,c)=>{if(!s)return i({content:n("Incorrect username or password or the account has been deactivated"),variant:"error"});const{isSupported:o,post:e}=D(),{mergeCarts:m,itemsInCart:d}=ee(),h=I("user-token",{path:"/",maxAge:c?15768e3:void 0,secure:!0});if(h.value=s,!t.public.basketApi){const _=I("apollo-token",{path:"/",maxAge:c?15768e3:void 0,secure:!0});_.value=s}if(o.value&&e({token:s,rememberMe:c}),H("user-token"),await new Promise(_=>setTimeout(_,100)),await R(),N(),await m(),i({content:n("Login successful. Hello name",{name:r.value?.firstname}),variant:"success"}),d.value&&!t.public.basketApi){window.location.href="/checkout";return}const f=a.query.final_redirect?decodeURIComponent(a.query.final_redirect):void 0,p=d.value&&!t.public.basketApi?"/checkout":f??"/customer";if(p.includes("checkout")&&!t.public.basketApi){window.location.href=p;return}await v(u(p))}}}const ge=Q({__name:"login-sso",setup(i){const{t:n}=A(),r=L(),{notify:u}=C(),{oauthStateStorage:a,getCustomerToken:t}=M(),l=w(),s=j(),{onLoggedIn:c}=te();V({title:n("Login to mediclub")}),F(n("Login to mediclub")),Y(()=>{if(r.query.code&&r.query.state===a.value)o();else return u({variant:"error",content:n("An unexpected error occurred, please log in again")}),v(l("/auth/login"))});const o=async()=>{try{const e=await t();await c(e,!1)}catch(e){return s(e),v(l("/auth/login"))}};return(e,m)=>{const d=P,h=B,f=T,p=x;return W(),z(K,null,[g(d,{name:e.$t("Login to mediclub")},null,8,["name"]),g(p,null,{default:J(()=>[g(h,{header:e.$t("Enjoy exclusive MediClub benefits")},null,8,["header"]),g(f),X("p",null,Z(e.$t("Please wait")),1)]),_:1})],64)}}});export{ge 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.