{
  "version": 3,
  "sources": ["../../src/web/lib/cookies.ts"],
  "sourcesContent": ["export const getCookie = (name: string) => {\n\tconst v = document.cookie.match(\"(^|;) ?\" + name + \"=([^;]*)(;|$)\")\n\treturn v ? v[2] : null\n}\n\ninterface CookieOptions {\n\tsecure?: boolean\n\tsamesite?: \"lax\" | \"strict\"\n\tdocument?: { cookie: Document[\"cookie\"] }\n}\n\nexport const setCookie = (\n\tname: string,\n\tvalue: string,\n\tdays: number,\n\t{ secure, samesite, document = window.document }: CookieOptions = {},\n) => {\n\tconst d = new Date(Date.now() + 24 * 60 * 60 * 1000 * days)\n\tconst params: [string, string | null][] = []\n\tparams.push([encodeURIComponent(name), encodeURIComponent(value)])\n\tparams.push([\"path\", \"/\"])\n\tparams.push([\"expires\", d.toUTCString()])\n\tif (secure) {\n\t\tparams.push([\"secure\", null])\n\t}\n\tif (samesite) {\n\t\tparams.push([\"samesite\", samesite])\n\t}\n\tdocument.cookie = params.map(([k, v]) => (v === null ? k : `${k}=${v}`)).join(\";\")\n}\n"],
  "mappings": ";AAAO,IAAM,YAAY,CAAC,SAAiB;AAC1C,QAAM,IAAI,SAAS,OAAO,MAAM,YAAY,OAAO,eAAe;AAClE,SAAO,IAAI,EAAE,CAAC,IAAI;AACnB;AAQO,IAAM,YAAY,CACxB,MACA,OACA,MACA,EAAE,QAAQ,UAAU,UAAAA,YAAW,OAAO,SAAS,IAAmB,CAAC,MAC/D;AACJ,QAAM,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,MAAO,IAAI;AAC1D,QAAM,SAAoC,CAAC;AAC3C,SAAO,KAAK,CAAC,mBAAmB,IAAI,GAAG,mBAAmB,KAAK,CAAC,CAAC;AACjE,SAAO,KAAK,CAAC,QAAQ,GAAG,CAAC;AACzB,SAAO,KAAK,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AACxC,MAAI,QAAQ;AACX,WAAO,KAAK,CAAC,UAAU,IAAI,CAAC;AAAA,EAC7B;AACA,MAAI,UAAU;AACb,WAAO,KAAK,CAAC,YAAY,QAAQ,CAAC;AAAA,EACnC;AACA,EAAAA,UAAS,SAAS,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,MAAO,MAAM,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,EAAG,EAAE,KAAK,GAAG;AAClF;",
  "names": ["document"]
}
