{"version":3,"sources":["jsdelivr-header.js","/npm/universal-cookie-express@8.1.0/cjs/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,IAAI,QAAU,QAAQ,oBAGtB,SAAS,4BACL,OAAO,SAAU,EAAK,EAAK,GACvB,EAAI,iBAAmB,IAAI,QAAQ,EAAI,QAAQ,QAAU,IACzD,EAAI,iBAAiB,mBAAmB,IACpC,GAAK,EAAI,SAAU,EAAI,YAGvB,QAAqB,IAAjB,EAAO,MACP,EAAI,YAAY,EAAO,KAAM,EAAO,aAEnC,CACD,MAAM,EAAa,OAAO,OAAO,CAAC,EAAG,EAAO,SACxC,EAAW,QAAU,EAAO,SAAW,EAAO,QAAQ,SAEtD,EAAW,OAAiC,IAAxB,EAAO,QAAQ,QAEvC,EAAI,OAAO,EAAO,KAAM,EAAO,MAAO,EAC1C,KAEJ,GACJ,CACJ,CAEA,OAAO,QAAU","file":"/npm/universal-cookie-express@8.1.0/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/universal-cookie-express@8.1.0/cjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nvar Cookies = require('universal-cookie');\n\n// @ts-ignore\nfunction universalCookieMiddleware() {\n    return function (req, res, next) {\n        req.universalCookies = new Cookies(req.headers.cookie || '');\n        req.universalCookies.addChangeListener((change) => {\n            if (!res.cookie || res.headersSent) {\n                return;\n            }\n            if (change.value === undefined) {\n                res.clearCookie(change.name, change.options);\n            }\n            else {\n                const expressOpt = Object.assign({}, change.options);\n                if (expressOpt.maxAge && change.options && change.options.maxAge) {\n                    // the standard for maxAge is seconds but express uses milliseconds\n                    expressOpt.maxAge = change.options.maxAge * 1000;\n                }\n                res.cookie(change.name, change.value, expressOpt);\n            }\n        });\n        next();\n    };\n}\n\nmodule.exports = universalCookieMiddleware;\n"]}