import{d as e,f as t,m as n,p as r}from"./event-B-4OIAbe.js";import{t as i}from"./logger-BTOOQRog.js";var a=async e=>{if(typeof t!=`function`)return[];try{return(await t({url:e})||[]).map(e=>({...e,key:e.name}))}catch(t){return i.error({msg:`GET_ALL_COOKIES_ERROR`,url:e,error:t}),[]}},o=async(t,n)=>{if(typeof e!=`function`)return``;try{let r=await e({url:n,name:t});return r&&r.value?r.value:``}catch(e){return i.error({msg:`GET_KEY_COOKIES_ERROR`,name:t,url:n,error:e}),``}},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,t)=>typeof r==`function`?r({url:t,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};