import{d as e,f as t,p as n,u as r}from"./event-DwD2dXm_.js";import{t as i}from"./logger-m2skRwRe.js";var a=async t=>{if(typeof e!=`function`)return[];try{return(await e({url:t})||[]).map(e=>({...e,key:e.name}))}catch(e){return i.error({msg:`GET_ALL_COOKIES_ERROR`,url:t,error:e}),[]}},o=async(e,t)=>{if(typeof r!=`function`)return``;try{let n=await r({url:t,name:e});return n&&n.value?n.value:``}catch(n){return i.error({msg:`GET_KEY_COOKIES_ERROR`,name:e,url:t,error:n}),``}},s=async(e,t,r,i,a=0)=>{if(typeof n!=`function`)return!1;let o={name:e,value:t};if(a){let e=Math.ceil(new Date().getTime()/1e3)+31536e3;o.expirationDate=Number(a)||e}return r&&(o.url=r),i&&(o.domain=i),n(o)},c=async(e,n)=>typeof t==`function`?t({url:n,name:e}):!1,l=e=>{let t=`; ${document.cookie}`.split(`; ${e}=`);return t.length===2?t.pop().split(`;`).shift():``};export{s as a,c as i,o as n,l as r,a as t};