1import{aJ as _,$ as D,l as L,e as x,q as y,h as A,c as i,o as r,i as g,a as s,w as F,Q as P,C as E,b as f,t as h,u as o,F as v}from"./Bs53RqoL.js";const W=new class{constructor(){this.endpoint="/api/reset-session"}async reset(){const{backendUrl:m}=_().public;return $fetch(this.endpoint,{baseURL:m,credentials:"include",method:"GET",timeout:1e4})}},G=new class{constructor(){this.repo=W}async reset(){return this.repo.reset()}},M={class:"min-h-screen bg-white"},V={class:"mx-auto flex min-h-screen max-w-xl flex-col justify-center px-6 py-20"},J={class:"mb-8 flex h-12 w-12 items-center justify-center rounded-full bg-beventi/10 text-beventi"},O={class:"font-display text-4xl font-semibold text-gray-950 sm:text-5xl"},Y={class:"mt-5 space-y-4 text-base leading-7 text-gray-600"},q={key:0,class:"mt-6 text-sm text-gray-500","data-test":"reset-status"},K={key:1,class:"mt-6 text-sm font-medium text-emerald-700","data-test":"reset-success"},Q={key:2,class:"mt-6 text-sm text-orange-700","data-test":"reset-warning"},X={class:"mt-8 flex flex-col gap-3 sm:flex-row"},z=["disabled"],H={key:1,href:"/login",class:"inline-flex h-11 items-center justify-center rounded-lg bg-gray-950 px-5 text-sm font-semibold text-white transition hover:bg-gray-800"},se=D({__name:"reset-session",setup(w){L({title:"Reset Beventi Session",description:"Reset Beventi browser session data and sign in again."});const m=_(),a=x("idle"),d=x(""),k=["XSRF-TOKEN","beventi_session","laravel_session","previouslyLoggedIn","isLoggedIn","sess_id","tb_uid","tb_session","_fbc","_fbp"],S=["/","/api","/sanctum"],p=y(()=>a.value==="running"),u=y(()=>a.value==="complete"||a.value==="partial"),B=async()=>{a.value="running",d.value="",R();const e=C();try{await G.reset(),a.value="complete"}catch(t){console.error("Unable to complete server session reset",t),d.value="Some server-side cleanup could not be confirmed, but browser data on this tab was cleared.",a.value="partial"}await e},C=async()=>{try{window.localStorage.clear()}catch(e){console.warn("Unable to clear localStorage",e)}try{window.sessionStorage.clear()}catch(e){console.warn("Unable to clear sessionStorage",e)}await Promise.all([T(),j()])},R=()=>{for(const e of U())N(e)},U=()=>Array.from(new Set([...k,...I()])),I=()=>document.cookie?document.cookie.split(";").map(e=>e.trim().split("=")[0]).filter(e=>e!==""):[],N=e=>{const t="Thu, 01 Jan 1970 00:00:00 GMT",l=window.location.protocol==="https:"?"; Secure":"";for(const c of S)for(const n of $())document.cookie=[`${encodeURIComponent(e)}=`,"Max-Age=0",`expires=${t}`,`path=${c}`,"SameSite=Lax",n?`domain=${n}`:""].filter(Boolean).join("; ")+l},$=()=>{const e=window.location.hostname,t=String(m.public.baseDomain||"").trim().split(":")[0],l=[e,t,b(e),b(t)].filter(n=>n!==""),c=[null];for(const n of l)c.push(n,`.${n}`);return Array.from(new Set(c))},b=e=>{const t=e.split(".").filter(Boolean);return t.length<2||e==="localhost"?"":t.slice(-2).join(".")},T=async()=>{if("serviceWorker"in navigator)try{const e=await navigator.serviceWorker.getRegistrations();await Promise.all(e.map(t=>t.unregister()))}catch(e){console.warn("Unable to unregister service workers",e)}},j=async()=>{if("caches"in window)try{const e=await window.caches.keys();await Promise.all(e.map(t=>window.caches.delete(t)))}catch(e){console.warn("Unable to clear browser caches",e)}};return(e,t)=>{const l=P,c=E,n=A("font-awesome-icon");return r(),i("div",M,[g(c,{to:"/",class:"absolute left-4 top-4 inline-flex items-center"},{default:F(()=>[g(l,{class:"h-6 w-auto",type:"logo-dark-text"})]),_:1}),s("main",V,[s("div",J,[g(n,{icon:["far","shield-check"],class:"text-xl"})]),t[4]||(t[4]=s("p",{class:"mb-3 text-sm font-semibold uppercase tracking-wide text-beventi"}," Session reset ",-1)),s("h1",O,h(o(u)?"Your Beventi session has been reset.":"Reset your Beventi session."),1),s("div",Y,[o(u)?(r(),i(v,{key:0},[t[0]||(t[0]=s("p",null,"Please close this tab, reopen Beventi, and log in again.",-1)),t[1]||(t[1]=s("p",null,"This only resets Beventi session data on this browser. It does not affect your Beventi account, orders, products, settings, or carts.",-1))],64)):(r(),i(v,{key:1},[t[2]||(t[2]=s("p",null,"Use this if Beventi is stuck, keeps redirecting, or will not let you log in.",-1)),t[3]||(t[3]=s("p",null,"This will sign you out and clear Beventi cookies, local storage, session storage, caches, and service workers on this browser. It will not delete your Beventi account, orders, products, settings, or carts.",-1))],64))]),o(p
1)?(r(),i("p",q," Clearing browser session data... ")):o(a)==="complete"?(r(),i("p",K," Success. Your Beventi session data was cleared on this browser. ")):o(d)?(r(),i("p",Q,h(o(d)),1)):f("",!0),s("div",X,[o(u)?f("",!0):(r(),i("button",{key:0,type:"button",class:"inline-flex h-11 items-center justify-center rounded-lg bg-gray-950 px-5 text-sm font-semibold text-white transition hover:bg-gray-800 disabled:cursor-not-allowed disabled:opacity-60",disabled:o(p),"data-test":"confirm-reset-session",onClick:B},h(o(p)?"Resetting session...":"Reset session"),9,z)),o(u)?(r(),i("a",H," Go to login ")):f("",!0)]),t[5]||(t[5]=s("p",{class:"mt-8 text-sm leading-6 text-gray-500"},' Still having trouble? If you are viewing this inside the Facebook or Instagram app, tap the three-dot menu and choose "Open in external browser", then run this reset again from there. In a normal browser, clear cookies and site data for beventi.co in your browser settings, then try logging in again. ',-1))])])}}});export{se 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.