{"version":3,"sources":["jsdelivr-header.js","/npm/string-to-arraybuffer@1.0.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACFA,aAEA,IAAI,KAAO,QAAQ,aACf,SAAW,QAAQ,aAcvB,SAAS,OAAQ,GAEhB,IADA,IAAI,EAAQ,IAAI,WAAW,EAAI,QACvB,EAAI,EAAG,EAAI,EAAI,OAAQ,IAC9B,EAAM,GAAK,EAAI,WAAW,GAE3B,OAAO,EAAM,MACd,CAEA,SAAS,OAAO,GAKf,IAAI,GAHJ,EAAM,EAAI,QAAQ,SAAU,KAGP,QAAQ,KAC7B,IAAK,IAAM,GAAc,GAAc,EAAG,MAAM,IAAI,UAAU,sBAO9D,IAJA,IAAI,EAAO,EAAI,UAAU,EAAG,GAAY,MAAM,KAE1C,GAAS,EACT,EAAU,WACL,EAAI,EAAG,EAAI,EAAK,OAAQ,IAC5B,UAAY,EAAK,GACpB,GAAS,EACC,GAAK,EAAK,GAAG,QAAQ,cAC/B,EAAU,EAAK,GAAG,UAAU,IAK9B,IAAI,EAAO,SAAS,EAAI,UAAU,EAAa,IAE3C,IAAQ,EAAO,KAAK,IAExB,IAAI,EAAO,OAAO,GAKlB,OAHA,EAAK,KAAO,EAAK,IAAM,aACvB,EAAK,QAAU,EAER,CACR,CApDA,OAAO,QAAU,SAA8B,GAC9C,GAAmB,iBAAR,EAAkB,MAAM,MAAM,+BAGzC,MAAI,WAAW,KAAK,GAAa,OAAO,IAGpC,SAAS,KAAM,EAAM,KAAK,IAEvB,OAAO,GACf","file":"/npm/string-to-arraybuffer@1.0.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/string-to-arraybuffer@1.0.2/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","/**\r\n * @module  string-to-arraybuffer\r\n */\r\n\r\n'use strict'\r\n\r\nvar atob = require('atob-lite')\r\nvar isBase64 = require('is-base64')\r\n\r\nmodule.exports = function stringToArrayBuffer (arg) {\r\n\tif (typeof arg !== 'string') throw Error('Argument should be a string')\r\n\r\n\t//valid data uri\r\n\tif (/^data\\:/i.test(arg)) return decode(arg)\r\n\r\n\t//base64\r\n\tif (isBase64(arg)) arg = atob(arg)\r\n\r\n\treturn str2ab(arg)\r\n}\r\n\r\nfunction str2ab (str) {\r\n\tvar array = new Uint8Array(str.length);\r\n\tfor(var i = 0; i < str.length; i++) {\r\n\t\tarray[i] = str.charCodeAt(i);\r\n\t}\r\n\treturn array.buffer\r\n}\r\n\r\nfunction decode(uri) {\r\n\t// strip newlines\r\n\turi = uri.replace(/\\r?\\n/g, '');\r\n\r\n\t// split the URI up into the \"metadata\" and the \"data\" portions\r\n\tvar firstComma = uri.indexOf(',');\r\n\tif (-1 === firstComma || firstComma <= 4) throw new TypeError('malformed data-URI');\r\n\r\n\t// remove the \"data:\" scheme and parse the metadata\r\n\tvar meta = uri.substring(5, firstComma).split(';');\r\n\r\n\tvar base64 = false;\r\n\tvar charset = 'US-ASCII';\r\n\tfor (var i = 0; i < meta.length; i++) {\r\n\t\tif ('base64' == meta[i]) {\r\n\t\t\tbase64 = true;\r\n\t\t} else if (0 == meta[i].indexOf('charset=')) {\r\n\t\t\tcharset = meta[i].substring(8);\r\n\t\t}\r\n\t}\r\n\r\n\t// get the encoded data portion and decode URI-encoded chars\r\n\tvar data = unescape(uri.substring(firstComma + 1));\r\n\r\n\tif (base64) data = atob(data)\r\n\r\n\tvar abuf = str2ab(data)\r\n\r\n\tabuf.type = meta[0] || 'text/plain'\r\n\tabuf.charset = charset\r\n\r\n\treturn abuf\r\n}\r\n"]}