function s(t){const a=t.domain.replace(/^\./,"");return`${t.secure?"https":"http"}://${a}${t.path}`}async function p(t){try{return await chrome.cookies.set({url:s(t),name:t.name,value:t.value,domain:t.domain,path:t.path,secure:t.secure,httpOnly:t.httpOnly,sameSite:t.sameSite,...t.expirationDate===void 0?{}:{expirationDate:t.expirationDate}}),{name:t.name,ok:!0}}catch(a){return{name:t.name,ok:!1,reason:a.message}}}async function u(t){const a=[];for(const e of t.cookies)a.push(await p(e));const r=a.filter(e=>e.ok).length,n=a.find(e=>!e.ok)?.reason;return{results:a,applied:r,total:a.length,...n===void 0?{}:{firstProblem:n}}}function l(t){return{name:t.name,value:t.value,domain:t.domain,path:t.path,secure:t.secure,httpOnly:t.httpOnly,sameSite:t.sameSite,...t.expirationDate===void 0?{}:{expirationDate:t.expirationDate},...t.storeId===void 0?{}:{storeId:t.storeId}}}export{u as a,l as t,s as u};
//# sourceMappingURL=chunk-SwRI5DNY.js.map
