1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,73760,47346,e=>{"use strict";let t,r=new TextEncoder,n=new TextDecoder,o=new TextDecoder("utf-8",{fatal:!0}),a=/[^\x00-\x7f]/;function i(e){if("string"==typeof e&&e.length>=128){if(a.test(e))throw TypeError("non-ASCII string encountered in encode()");return r.encode(e)}let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}function s(e,t=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}let r=atob(e),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n}function l(e){try{return s("string"==typeof e?e:n.decode(e),!0)}catch(e){throw TypeError("The input to be decoded is not correctly encoded.",{cause:e})}}class c extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class u extends c{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.claim=r,this.reason=n,this.payload=t}}class d extends c{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.claim=r,this.reason=n,this.payload=t}}class f extends c{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"}class p extends c{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class y extends c{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class h extends c{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class m extends c{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(e="signature verification failed",t){super(e,t)}}function g(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function w(e,t,r){try{return l(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}let v={__proto__:null,b64:!0};async function S(e,r,n){let o,a,{alg:i,secret:s}=e,c="decrypt"===n||"sign"===n;if(s&&r instanceof Uint8Array)return r;if(g(r)){if("string"!=typeof(o=function(e){let t={__proto__:null,...e};if(void 0!==t.ext&&"boolean"!=typeof t.ext)throw TypeError('"ext" (Extractable) Parameter must be a boolean');if(void 0!==t.key_ops){let e=t.key_ops,r=Array.isArray(e)?[...e]:void 0;if(!r||r.some(e=>"string"!=typeof e)||new Set(r).size!==r.length)throw TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=r}return t}(r)).kty)throw _(i,r,s);if(!(s?"oct"===o.kty&&"string"==typeof o.k:"oct"!==o.kty&&(c?"AKP"===o.kty&&"string"==typeof o.priv||"string"==typeof o.d:void 0===o.d&&void 0===o.priv)))throw TypeError(s?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${c?"private":"public"} JWK`);if(((e,t,r)=>{let{alg:n}=e;if(void 0!==t.use){let e="sign"===r||"verify"===r?"sig":"enc";if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==n)throw TypeError(`Invalid key for this operation, its "alg" must be "${n}" when present`);if(Array.isArray(t.key_ops)){let n="encrypt"===r||"decrypt"===r?e.ops?.[+("encrypt"!==r)]:r;if(n&&!t.key_ops.includes(n))throw TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}})(e,o,n),"oct"===o.kty)return l(o.k);if(!Object.isFrozen(r)){let{key_ops:e}=r;Array.isArray(e)&&Object.freeze(e),Object.freeze(r)}}else{if(!A(r))throw _(i,r,s);let e=s?"secret":c?"private":"public";if(r.type!==e&&(s||["secret","public","private"].includes(r.type)))throw TypeError(`${r[Symbol.toStringTag]} instances must be of type "${e}" for the ${i} algorithm`);if(b(r))return r;if("secret"===(a=r).type)return a.export()}let u=(t||=new WeakMap).get(r);if(u?.[i])return u[i];if(u||t.set(r,u={}),a&&"function"==typeof a.toCryptoKey){let t="public"===a.type,r=E[a.asymmetricKeyDetails?.namedCurve],n=e.resolve?.({crv:r,asymmetricKeyType:a.asymmetricKeyType})??e.subtle;return u[i]=a.toCryptoKey(n,t,e.usages[+!t])}return(o??=a.export({format:"jwk"})).alg=i,u[i]=await T(e,o)}let E={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"},b=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},A=e=>b(e)||e?.[Symbol.toStringTag]==="KeyObject";function _(e,t,r){let n=["CryptoKey","KeyObject","JSON Web Key"];return r&&n.push("Uint8Array"),TypeError(function(e,t,...r){if(r.length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}(`Key for the ${e} algorithm must be `,t,...n))}let k=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);async function T(e,t,r){if(!e.kty.includes(t.kty))throw new p('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let n=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,o=!!(t.d||t.priv),a={...t,ext:r??t.ext};return"AKP"!==a.kty&&delete a.alg,delete a.use,crypto.subtle.importKey("jwk",a,n,a.ext??!o,t.key_ops??e.usages[+!!o])}async function P(e,t,r,n=!1){return e instanceof Uint8Array&&(e=await crypto.subtle.importKey("raw",e,t,n,[r])),function(e,t,r){let n=e.algorithm;if(n.name!==t.name)throw k(t.name);if(t.hash&&n.hash?.name!==t.hash)throw k(t.hash,"algorithm.hash");if(t.namedCurve&&n.namedCurve!==t.namedCurve)throw k(t.namedCurve,"algorithm.namedCurve");if(void 0!==t.length&&n.length!==t.length)throw k(t.length,"algorithm.length");if(r&&!e.usages.includes(r))throw TypeError(`CryptoKey does not support this operation, its usages must include ${r}.`)}(e,t,r),e}function C(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}let I=[["verify"],["sign"]];function O(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:I}}function x(e,t){let r={name:t?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${e}`};return{kty:["RSA"],subtle:r,signing:t?{...r,saltLength:t}:r,usages:I,minRsaBits:2048}}function R(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:`SHA-${t}`},usages:I}}function L(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:I}}function K(e){let t={name:`ML-DSA-${e}`};return{kty:["AKP"],subtle:t,signing:t,usages:I}}let W=C({HS256:O(256),HS384:O(384),HS512:O(512),RS256:x(256),RS384:x(384),RS512:x(512),PS256:x(256,32),PS384:x(384,48),PS512:x(512,64),ES256:R("P-256",256),ES384:R("P-384",384),ES512:R("P-521",512),EdDSA:L(),Ed25519:L(),"ML-DSA-44":K(44),"ML-DSA-65":K(65),"ML-DSA-87":K(87)}),U=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],D=[[],["deriveBits"]],j=[[],[]];function N(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:U,ops:["wrapKey","unwrapKey"]}}function $(e){return{kty:["EC","OKP"],mode:e,subtle:{name:"ECDH"},resolve:({kty:e,crv:t,asymmetricKeyType:r})=>{if("X25519"===t||"x25519"===r)return{name:"X25519"};
1if("OKP"===e)throw new p('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:t}},usages:D,ops:[void 0,"deriveBits"]}}function J(e,t=!1){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:j,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function H(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:j,ops:["deriveBits","deriveBits"]}}let B=C({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:j,ops:["encrypt","decrypt"]},"RSA-OAEP":N(1),"RSA-OAEP-256":N(256),"RSA-OAEP-384":N(384),"RSA-OAEP-512":N(512),"ECDH-ES":$("direct-key-agreement"),"ECDH-ES+A128KW":$("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":$("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":$("key-agreement-with-key-wrapping"),A128KW:J(128),A192KW:J(192),A256KW:J(256),A128GCMKW:J(128,!0),A192GCMKW:J(192,!0),A256GCMKW:J(256,!0),"PBES2-HS256+A128KW":H(),"PBES2-HS384+A192KW":H(),"PBES2-HS512+A256KW":H()}),M=["encrypt","decrypt"];function G(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:j,ops:M,cekBits:e,ivBits:t?128:96,cbc:t}}C({A128GCM:G(128),A192GCM:G(192),A256GCM:G(256),"A128CBC-HS256":G(256,!0),"A192CBC-HS384":G(384,!0),"A256CBC-HS512":G(512,!0)});let F='"alg" (Algorithm)';function z(e='JWK "alg" (Algorithm) Parameter'){throw new p(`Invalid or unsupported ${e} value`)}let V=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},X=e=>{let t=e.data[e.pos++];if(void 0===t)throw Error("Unexpected end of ASN.1 input");return t},q=e=>{let t=X(e);if(128&t){let r=127&t,n=0;for(let t=0;t<r;t++)n=n<<8|X(e);return n}return t},Y=(e,t,r)=>{if(X(e)!==t)throw Error(r)},Q=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},Z=async(e,t,r,n)=>{let o,a=function(e){if(void 0!==e&&"boolean"!=typeof e)throw TypeError('"extractable" option must be a boolean');return e}(n?.extractable),i=("string"==typeof r?W[r]??B[r]:void 0)??z(F);i.secret&&z(F);let s="spki"===e;if(i.resolve)try{let r={data:t,pos:0};(function(e,t){if(Y(e,48,`Invalid ${"spki"===t?"SPKI":"PKCS#8"} structure`),q(e),"pkcs8"===t){Y(e,2,"Expected version field");let t=q(e);e.pos+=t}Y(e,48,"Expected algorithm identifier"),q(e)})(r,e),o=i.resolve({crv:(e=>{let t,r=(Y(e,6,"Expected algorithm OID"),t=q(e),Q(e,t));if(V(r,[43,101,110]))return"X25519";if(!V(r,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");Y(e,6,"Expected curve OID");let n=q(e),o=Q(e,n);if(V(o,[42,134,72,206,61,3,1,7]))return"P-256";if(V(o,[43,129,4,0,34]))return"P-384";if(V(o,[43,129,4,0,35]))return"P-521";throw Error("Unsupported named curve")})(r)})}catch{throw new p("Invalid or unsupported key format")}else o=i.subtle;return crypto.subtle.importKey(e,t,o,a??s,i.usages[+!s])};async function ee(e,t,r){let n;if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw TypeError('"spki" must be SPKI formatted string');return Z("spki",(n=/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,s(e.replace(n,""))),t,r)}function et(e){try{return i(e)}catch{throw new y("JWS Compact Serialization payload must use only ASCII characters")}}async function er(e,t,r,n,a){let{protected:s,header:c,payload:u}=e,d=a??(void 0===s?{}:function(e,t,r){let n;try{n=JSON.parse(o.decode(l(e)))}catch{throw new t(r)}if(!g(n))throw new t(r);return n}(s,y,"JWS Protected Header is invalid"));if(!function(...e){let t=new Set;for(let r of e)if(r)for(let e of Object.keys(r)){if(t.has(e))return!1;t.add(e)}return!0}(d,c))throw new y("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let h={...d,...c},E=function(e,t){if(t.includes("b64")){let t=e.b64;if("boolean"!=typeof t)throw new y('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return t}return!0}(d,function(e,t,r,n,o){if(void 0!==o.crit&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return[];if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a=void 0===r?t:{__proto__:null,...r,...t};for(let t of n.crit){if(!(t in a))throw new p(`Extension Header Parameter "${t}" is not recognized`);if(!Object.hasOwn(o,t)||void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(a[t]&&(!Object.hasOwn(n,t)||void 0===n[t]))throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return n.crit}(y,v,t[1],d,h)),{alg:b}=h;if("string"!=typeof b||!b)throw new y('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t[0]&&!t[0].has(b))throw new f('"alg" (Algorithm) Header Parameter value not allowed');if(E){if("string"!=typeof u)throw new y("JWS Payload must be a string")}else if("string"!=typeof u&&!(u instanceof Uint8Array))throw new y("JWS Payload must be a string or an Uint8Array instance");let A=E||"string"!=typeof u?u:n(u),_=!1;"function"==typeof r&&(r=await r(d,e),_=!0);let k=function(e){let t="string"==typeof e?W[e]:void 0;if(!t)throw new p(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}(b),T=function(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(void 0!==s?i(s):new Uint8Array,i("."),"string"==typeof A?t[2]??=function(e,t,r){try{return i(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}(A,"payload",y):A),C=w(e.signature,"signature",y),I=await S(k,r,"verify"),O=await P(I,k.subtle,"verify");k.minRsaBits&&function(e,t){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e}
1 requires key modulusLength to be 2048 bits or larger`)}(k.alg,O);let x=!1;try{x=await crypto.subtle.verify(k.signing,O,C,T)}catch{}if(!x)throw new m;let R={payload:"string"==typeof A?w(A,"payload",y):A};return void 0!==s&&(R.protectedHeader=d),void 0!==c&&(R.unprotectedHeader=c),_?[{...R,key:I},E]:[R,E]}async function en(e,t,r){if(e instanceof Uint8Array&&(e=n.decode(e)),"string"!=typeof e)throw new y("Compact JWS must be a string or Uint8Array");let{0:o,1:a,2:i,length:s}=e.split(".");if(3!==s)throw new y("Invalid Compact JWS");return er({payload:a,protected:o,signature:i},t,r,et)}e.s(["importSPKI",0,ee],73760);let eo={s:1,m:60,h:3600,d:86400,w:604800,y:0x1e187e0},ea=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,ei="check_failed";function es(){throw TypeError("Invalid time period format")}function el(e){"string"!=typeof e&&es();let t=ea.exec(e);(!t||t[4]&&t[1])&&es();let r=Math.round(parseFloat(t[2])*eo[t[3][0].toLowerCase()]);return Number.isFinite(r)||es(),"-"===t[1]||"ago"===t[4]?-r:r}function ec(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}let eu=e=>{let t=e.toLowerCase();return e.includes("/")?t:`application/${t}`};function ed(e,t,r=!1){let n=e[t];if(!(void 0===n&&!r)){if("number"!=typeof n)throw new u(`"${t}
1" claim must be a number`,e,t,"invalid");return n}}function ef(e,t){throw new u(`unexpected "${t}" claim value`,e,t,ei)}async function ep(e,t,r){let[n,a]=await en(e,[r&&function(e,t){if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError(`"${e}" option must be an array of strings`);return void 0===t?void 0:new Set(t)}("algorithms",r.algorithms),r?.crit],t);if(!a)throw new h("JWTs MUST NOT use unencoded payload");let i=function(e,t,r={}){let n,a,i;try{n=JSON.parse(o.decode(t))}catch{}if(!g(n))throw new h("JWT Claims Set must be a top-level JSON object");let{typ:s}=r;if(void 0!==s&&("string"!=typeof e.typ||eu(e.typ)!==eu(s)))throw new u('unexpected "typ" JWT header value',n,"typ",ei);let{requiredClaims:l=[],issuer:c,subject:f,audience:p,maxTokenAge:y}=r,m=[...l];for(let e of(void 0!==y&&m.push("iat"),void 0!==p&&m.push("aud"),void 0!==f&&m.push("sub"),void 0!==c&&m.push("iss"),new Set(m.reverse())))if(!Object.hasOwn(n,e))throw new u(`missing required "${e}" claim`,n,e,"missing");void 0===c||(Array.isArray(c)?c:[c]).includes(n.iss)||ef(n,"iss"),void 0!==f&&n.sub!==f&&ef(n,"sub"),void 0===p||(a=n.aud,i="string"==typeof p?[p]:p,"string"==typeof a?i.includes(a):!!Array.isArray(a)&&i.some(e=>a.includes(e)))||ef(n,"aud");let{clockTolerance:w}=r,v=0;if("string"==typeof w)v=el(w);else if(void 0!==w){if("number"!=typeof w)throw TypeError("Invalid clockTolerance option type");v=w}ec("clockTolerance option",v);let{currentDate:S}=r,E=ec("currentDate option",Math.floor((void 0===S?new Date:S).getTime()/1e3)),b=ed(n,"iat",void 0!==y),A=ed(n,"nbf");if(void 0!==A&&A>E+v)throw new u('"nbf" claim timestamp check failed',n,"nbf",ei);let _=ed(n,"exp");if(void 0!==_&&_<=E-v)throw new d('"exp" claim timestamp check failed',n,"exp",ei);if(void 0!==y){let e=E-b;if(e-v>ec("maxTokenAge option","number"==typeof y?y:el(y)))throw new d('"iat" claim timestamp check failed (too far in the past)',n,"iat",ei);if(e<-v)throw new u('"iat" claim timestamp check failed (it should be in the past)',n,"iat",ei)}return n}(n.protectedHeader,n.payload,r);return{...n,payload:i}}e.s(["jwtVerify",0,ep],47346)},24262,e=>{e.v({articleCount:"styles-module__EefLiW__articleCount",dropdown:"styles-module__EefLiW__dropdown",dropdownContent:"styles-module__EefLiW__dropdownContent",dropdownItem:"styles-module__EefLiW__dropdownItem",loading:"styles-module__EefLiW__loading",pulse:"styles-module__EefLiW__pulse",userImage:"styles-module__EefLiW__userImage"})},44720,99704,e=>{"use strict";e.s(["clearUserStorage",()=>v,"default",()=>S],44720),e.s(["SavedArticlesContext",()=>d,"SavedArticlesProvider",()=>f],99704);var t=e.i(91398),r=e.i(86533),n=e.i(91788),o=e.i(60341),a=e.i(95841),i=e.i(6396),s=e.i(70580),l=e.i(41158),c=e.i(55975),u=e.i(49977);let d=(0,n.createContext)({articles:[],loading:!1,isFavorite:()=>null,getArticles:()=>null,saveArticle:()=>null,deleteArticle:()=>null}),f=({children:e})=>{let[o,a]=(0,n.useState)([]),[i,s]=(0,n.useState)(!1),[l,c]=(0,n.useState)(!1),{data:f}=(0,r.useSession)(),p=async(e,t)=>{c(!0),await (0,u.setUserSavedArticles)(e,t),c(!1)},y=async e=>{let t;a(t=e&&o.length?[...o,e]:[e]),f&&f.accessToken&&p(f.accessToken,t)},h=async e=>{let t=o?.filter(t=>t.slug!==e);a(t),f&&f.accessToken&&p(f.accessToken,t)},m=async()=>{if(f&&f.accessToken&&!i){c(!0);let e=await (0,u.getUserSavedArticles)(f.accessToken);Array.isArray(e)&&a(e),s(!0),c(!1)}};return(0,t.jsx)(d.Provider,{value:{loading:l,articles:o,getArticles:m,saveArticle:y,deleteArticle:h,isFavorite:e=>!!o&&0!==o.length&&o?.some(t=>t.slug===e)},children:e})};var p=e.i(32652),y=e.i(68391),h=e.i(47643),m=e.i(42436),g=e.i(36100),w=e.i(24262);let v=()=>{try{Object.keys(localStorage).forEach(e=>{(e.startsWith(u.storageSchemaPrefix)||"PPID"===e)&&localStorage.removeItem(e)})}catch{console.error("No localstorage access")}return null},S=()=>{let{t:e}=(0,m.useTranslate)(),{lang:u}=(0,p.default)(),{data:f,status:S}=(0,r.useSession)(),{isPremium:E}=(0,n.useContext)(h.UserContext),{articles:b,getArticles:A}=(0,n.useContext)(d),{brandName:_}
1=(0,p.default)(),[k,T]=(0,n.useState)(!1),P=_.toLowerCase();(0,n.useEffect)(()=>{(k||!(b.length>0))&&e();async function e(){await A()}},[k]);let C=(0,a.default)(function(){k&&T(!1)});return(0,t.jsxs)(t.Fragment,{children:["authenticated"===S&&f&&(0,t.jsx)("div",{ref:C,children:(0,t.jsxs)("button",{type:"button",className:w.default.dropdown,onClick:()=>{T(!k)},children:[(0,t.jsx)("img",{alt:f.user.name,className:w.default.userImage,src:f.user.image,width:1,height:1}),E&&(0,t.jsx)("div",{className:"flex items-center justify-center bg-white absolute -top-2 -left-2 p-[2px] rounded-full",children:(0,t.jsx)(s.default,{type:"general",icon:"crown-yellow",size:18})}),k&&(0,t.jsxs)("div",{className:w.default.dropdownContent,role:"listbox",children:[(0,t.jsx)("a",{className:w.default.dropdownItem,href:"https://account.infoplaza.com",target:"_blank",rel:"noreferrer",children:e("comp_account_my_profile")}),(0,t.jsx)(o.default,{}),(0,t.jsxs)(l.default,{className:w.default.dropdownItem,href:(0,y.getRelativeUrl)(u,"saved"),children:[(0,t.jsx)("span",{children:e("comp_account_saved_articles")}),b&&(0,t.jsx)("span",{className:w.default.articleCount,children:b.length})]}),(0,t.jsx)(o.default,{}),(0,t.jsx)(l.default,{className:w.default.dropdownItem,href:(0,c.getFotoloodsUserUrl)(f.user.name,f.user_id,u),children:(0,t.jsx)("span",{children:e("comp_account_my_weerflits")})}),(0,t.jsx)(o.default,{}),(0,t.jsx)("a",{className:w.default.dropdownItem,href:"#",onClick:()=>void((0,g.pushDataLayer)({event:"click",click_name:"logout"}),v(),T(!1),(0,r.signOut)()),children:e("comp_account_logout")})]})]})}),"loading"===S&&(0,t.jsx)("div",{className:w.default.loading}),!S||"unauthenticated"===S&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(i.default,{variant:"dark",rounded:"full",className:"relative z-20 !p-1 md:!p-2 md:px-1",onClick:e=>{e.preventDefault(),(0,g.pushDataLayer)({event:"login_button_clicked"});let t=encodeURI(window.location.pathname);(0,r.signIn)(P,{callbackUrl:`/account-redirect?redirectUrl=${t}`})},children:(0,t.jsx)(s.default,{className:"mr-0",type:"general",icon:"user",size:24})})})]})}},91309,e=>{"use strict";var t=e.i(91398),r=e.i(91788),n=e.i(86533),o=e.i(71956),a=e.i(49977),i=e.i(69647);let s="WOL_MyPlaces_V5",l={RecentLocations:[],SavedLocations:[]},c=async()=>{try{if("u">typeof localStorage){let e=localStorage.getItem(s);if(!e)return l;return JSON.parse(e)}return null}catch(e){return null}},u=async(e,t)=>{if(!t)return l;let r=await c();return r&&(0,a.setUserPlaces)(e?.accessToken,r),r},d=async(e,t)=>{let r=await (0,a.getUserPlaces)(e.accessToken);return r||u(e,t)},f=(e,t)=>e&&e.accessToken?d(e,t):t?c():Promise.resolve(l),p=(e,t,r)=>{if(t&&t.accessToken)(0,a.setUserPlaces)(t?.accessToken,e);else r&&(e=>{try{localStorage.setItem(s,JSON.stringify(e))}catch(e){o.default.error({err:e},"Could not set favorite places to LS")}})(e)},y=(0,r.createContext)({isLoading:!0,recentPlaces:[],savedPlaces:[],findItemIndex:()=>null,addSavedPlace:()=>null,removeSavedPlace:()=>null,addRecentPlace:()=>null,removeRecentPlaces:()=>null});e.s(["MyPlacesContext",0,y,"MyPlacesProvider",0,({children:e})=>{let{data:o,status:a}=(0,n.useSession)(),{consentTypes:s}=(0,r.useContext)(i.ConsentContext),u=s?.hasFunctionalConsent??!1,[h,m]=(0,r.useState)(null),[g,w]=(0,r.useState)([]),v=h?.SavedLocations?.slice()?.reverse(),S=h?.RecentLocations?.slice()?.reverse(),E=(e,t)=>{if("authenticated"===a||"unauthenticated"===a)return!0;let r={eventType:e};return t&&(r.eventData=t),w([...g,r]),!1},b=(e,t)=>t&&e?t?.findIndex(t=>t.tracking_id===e.tracking_id):null,A=(e,t)=>{if(!e)return null;let r=t??[],n=b(e,r);return n>=0?r.push(r.splice(n,1)[0]):r.push(e),r},_=async e=>{if(!e||!E("addSaved",e))return;let t=await f(o,u),r=A(e,t?.SavedLocations),n={...t,SavedLocations:r};p(n,o,u),m(n)},k=async e=>{if(!e||!E("removeSaved",e))return;let t=await f(o,u),r={...t,SavedLocations:((e,t)=>{if(!e)return null;let r=t??[],n=b(e,r);return n>=0&&r.splice(n,1),r})(e,t?.SavedLocations)};p(r,o,u),m(r)},T=async e=>{if(!e||!E("addRecent",e))return;let t=await f(o,u),r=A(e,t?.RecentLocations),n={...t,RecentLocations:r};
1n?.RecentLocations?.length>=10&&n.RecentLocations.shift(),p(n,o,u),m(n)},P=async()=>{if(!E("removeRecents",null))return;let e=await f(o,u);e.RecentLocations.length=0,p(e,o,u),m(e)};return(0,r.useEffect)(()=>{(async()=>{"loading"!==a&&("authenticated"===a&&o&&o.accessToken&&m(await d(o,u)),"unauthenticated"===a&&(u?m(await c()):m(l)),("authenticated"===a||"unauthenticated"===a)&&(g.forEach(e=>{switch(e.eventType){case"addSaved":_(e.eventData);break;case"removeSaved":k(e.eventData);break;case"addRecent":T(e.eventData);break;case"removeRecents":P();break;default:console.error("bad event type")}}),w([])))})()},[a,u]),(0,t.jsx)(y.Provider,{value:{recentPlaces:S,savedPlaces:v,isLoading:null===h,findItemIndex:b,addSavedPlace:_,removeSavedPlace:k,addRecentPlace:T,removeRecentPlaces:P},children:e})}])},49977,e=>{"use strict";e.s(["defaultDashboard",()=>i,"getUserDashboard",()=>f,"getUserLikedPhotos",()=>v,"getUserPlaces",()=>h,"getUserSavedArticles",()=>g,"getUserSettings",()=>E,"setUserDashboard",()=>y,"setUserDashboardDefault",()=>p,"setUserLikedPhotos",()=>S,"setUserPlaces",()=>m,"setUserSavedArticles",()=>w,"setUserSettings",()=>b,"storageSchemaPrefix",()=>s,"subscribe",()=>A,"verifyPayment",()=>_]),e.i(50461),e.i(73760),e.i(47346);var t=e.i(44720),r=e.i(81859),n=e.i(86533),o=e.i(46706);let{colors:a}=e.i(77138).default.theme.extend,i={background_color:a["blue-minus-4"],hide_dashboard:!1,places:{home:null,work:null,vacation:null},widgets:[]},s="WOL_STORAGE_",l=`${s}sessionTime`,c=()=>{Object.keys(sessionStorage).forEach(e=>{e.startsWith(s)&&sessionStorage.removeItem(e)})};async function u(e,r,a,i){try{(()=>{if(!(0,o.hasSessionStorage)())return;let e=sessionStorage.getItem(l);if(!e){let e=Date.now();sessionStorage.setItem(l,JSON.stringify(e));return}let t=parseInt(e,10);Date.now()-t>18e5&&c()})();let u=`${s}${a}`;if("GET"===r&&(0,o.hasSessionStorage)()){let e=JSON.parse(sessionStorage.getItem(u));if(e)return e}"POST"===r&&(0,o.hasSessionStorage)()&&sessionStorage.removeItem(u);let d={headers:{"Content-Type":"application/json",Authorization:e},method:r};i&&(d.body=JSON.stringify(i));let f=await fetch(`https://user-kv.infoplaza.io/v1/weeronline/${a}`,d);if(!f.ok)return(0,t.clearUserStorage)(),c(),(0,n.signOut)(),null;if("GET"===r){let e=await f.json();if(e&&(0,o.hasSessionStorage)()){let t=JSON.stringify(e);sessionStorage.setItem(u,t)}return e}}catch(e){return console.log(e),(0,t.clearUserStorage)(),c(),(0,n.signOut)(),null}}async function d(e,t){if(!e)throw Error("Invalid parameters");let r={method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify(t)},n=await fetch("https://billing.infoplaza.com/api/billing/createSubscription",r);return n.ok?await n.json():null}async function f(e){return u(e,"GET","dashboard")}async function p(e){return u(e,"POST","dashboard",i)}async function y(e,t){return u(e,"POST","dashboard",t)}async function h(e){return u(e,"GET","weeronline-places")}async function m(e,t){return u(e,"POST","weeronline-places",t)}async function g(e){return u(e,"GET","favorite-article")}async function w(e,t){return u(e,"POST","favorite-article",t)}async function v(e){return u(e,"GET","liked-photos")}async function S(e,t){return u(e,"POST","liked-photos",t)}async function E(e){return u(e,"GET","weeronline-settings")}async function b(e,t){return u(e,"POST","weeronline-settings",t)}async function A(e,t,n="nl"){let o=`${e}/verify-payment`,a="nl"===n?r.WEERONLINE_PLAN_ID:r.METEOVISTA_PLAN_ID;try{let e={name:t.name,email:t.email,appKey:"weeronline_web",planId:a,userId:t.user_id,redirectUrl:o,language:"nl"},r=await d(t.accessToken,e);if(r&&r&&r?.paymentLink)return window.location.href=r?.paymentLink,"true";return null}catch(e){return console.log(e),null}}async function _(e,t){if(!e||!t)return"fail";let r=`https://billing.infoplaza.com/api/billing/verifyPayment?userToken=${encodeURIComponent(t)}`,n={method:"GET",headers:{Authorization:`Bearer ${e.accessToken}`}};try{let e=await fetch(r,n);if(e.ok){let t=await e.json();if(t&&t?.success)return"ok";return"fail"}let t=await e.json();if(!t||t?.error!=="WEBHOOK DID NOT FULLY RUN")return"fail";return"half-ok"}catch(e){return"fail"}}}]);
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.