function p(o,e){const i=typeof document<"u"?document.cookie:e,r=i?i.split("; "):[],n={};for(let t=0;t<r.length;t++){const d=r[t].split("="),s=d.slice(1).join("=");try{const c=f(d[0]);if(c in n||(n[c]=u(s)),o===c)break}catch{}}return n[o]}function f(o){try{return decodeURIComponent(o)}catch(e){return console.error(`Decoding failed: ${o}`,e),o}}function u(o){return o[0]==='"'&&(o=o.slice(1,-1)),o.replace(/(%[\dA-F]{2})+/gi,f)}export{p as getCookie};
