1import{_ as v,k as u,l as g,m as e,d as T,z as $,B as C,C as c,D as p,E as b,t as k,q as y}from"./entry.ccdb7f1d.js";class d extends Error{}d.prototype.name="InvalidTokenError";function I(o){return decodeURIComponent(atob(o).replace(/(.)/g,(t,n)=>{let s=n.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function S(o){let t=o.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return I(t)}catch{return atob(t)}}function V(o,t){if(typeof o!="string")throw new d("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,s=o.split(".")[n];if(typeof s!="string")throw new d(`Invalid token specified: missing part #${n+1}`);let a;try{a=S(s)}catch(r){throw new d(`Invalid token specified: invalid base64 for part #${n+1} (${r.message})`)}try{return JSON.parse(a)}catch(r){throw new d(`Invalid token specified: invalid json for part #${n+1} (${r.message})`)}}const E={name:"TokenComponent",props:{user:Object},methods:{stringifyToken(o){return JSON.stringify(V(o),null,2)}}},N={class:"mt-4 text-left"},U={class:"mt-2"},D=e("label",{htmlFor:"accessToken",class:"block text-sm font-semibold leading-6 text-gray-900"}," Access Token ",-1),A=["defaultValue"],B={class:"mt-2"},O=e("label",{htmlFor:"idToken",class:"block text-sm font-semibold leading-6 text-gray-900"}," Id Token ",-1),j=["defaultValue"],F={class:"mt-2"},R=e("label",{htmlFor:"refreshToken",class:"block text-sm font-semibold leading-6 text-gray-900"}," Refresh Token ",-1),z=["defaultValue"];function J(o,t,n,s,a,r){var f,i,l;return u(),g("div",null,[e("div",N,[e("div",U,[D,e("textarea",{rows:"6",name:"accessToken",id:"accessToken",class:"block w-full rounded-md border-0 py-1.5 px-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 bg-purple-200/50",defaultValue:r.stringifyToken((f=n.user)==null?void 0:f.access_token)},null,8,A)]),e("div",B,[O,e("textarea",{rows:"6",name:"idToken",id:"idToken",class:"block w-full rounded-md border-0 py-1.5 px-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 bg-purple-200/50",defaultValue:r.stringifyToken((i=n.user)==null?void 0:i.id_token)},null,8,j)]),e("div",F,[R,e("textarea",{rows:"6",name:"refreshToken",id:"refreshToken",class:"block w-full rounded-md border-0 py-1.5 px-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 bg-purple-200/50",defaultValue:r.stringifyToken((l=n.user)==null?void 0:l.refresh_token)},null,8,z)])])])}const q=v(E,[["render",J]]),Y=e("div",{class:"text-xl pb-8 italic"},"Your current status is:",-1),G={key:0},H=e("div",{class:"mb-6 text-p2blue-700 text-2xl"},"Not authenticated.",-1),K={key:1},L=e("div",{class:"mb-2 text-p2blue-700 text-2xl"},"Authenticated",-1),M={class:"mb-6 text-p2blue-700 text-md"},x="rounded-md bg-indigo-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",P=T({__name:"User",setup(o){const t=$(),s=C().user;console.log("ð ~ user:",s);const a=()=>t.$auth.signInRedirect(),r=()=>t.$auth.logout();return(f,i)=>{var l,m,_,h;return u(),g("div",null,[Y,c(s)?b("",!0):(u(),g("div",G,[H,e("button",{class:p(x),onClick:i[0]||(i[0]=w=>a())},"Sign in")])),c(s)?(u(),g("div",K,[L,e("div",M,[e("div",null,k((m=(l=c(s))==null?void 0:l.profile)==null?void 0:m.email),1),e("div",null,k((h=(_=c(s))==null?void 0:_.profile)==null?void 0:h.name),1)]),e("button",{class:p(x),onClick:i[1]||(i[1]=w=>r())},"Sign out"),y(q,{user:c(s)},null,8,["user"])])):b("",!0)])}}}),Q={};function W(o,t){const n=P;return u(),g("div",null,[y(n)])}const Z=v(Q,[["render",W]]);export{Z 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.