{"version":3,"sources":["jsdelivr-header.js","/npm/@protobufjs/fetch@1.1.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,OAAO,QAAU,MAEjB,IAAI,UAAY,QAAQ,yBACpB,QAAY,QAAQ,uBAEpB,GAAK,QAAQ,MA2BjB,SAAS,MAAM,EAAU,EAAS,GAO9B,MANuB,mBAAZ,GACP,EAAW,EACX,EAAU,CAAC,GACH,IACR,EAAU,CAAC,GAEV,GAIA,EAAQ,KAAO,IAAM,GAAG,SAClB,GAAG,SAAS,GAAU,SAA+B,EAAK,GAC7D,OAAO,GAAiC,oBAAnB,eACf,MAAM,IAAI,EAAU,EAAS,GAC7B,EACA,EAAS,GACT,EAAS,KAAM,EAAQ,OAAS,EAAW,EAAS,SAAS,QACvE,IAGG,MAAM,IAAI,EAAU,EAAS,GAbzB,UAAU,MAAO,KAAM,EAAU,EAchD,CAuBA,MAAM,IAAM,SAAmB,EAAU,EAAS,GAC9C,IAAI,EAAM,IAAI,eACd,EAAI,mBAA4C,WAE5C,GAAuB,IAAnB,EAAI,WAAR,CAMA,GAAmB,IAAf,EAAI,QAA+B,MAAf,EAAI,OACxB,OAAO,EAAS,MAAM,UAAY,EAAI,SAI1C,GAAI,EAAQ,OAAQ,CAChB,IAAI,EAAS,EAAI,SACjB,IAAK,EAAQ,CACT,EAAS,GACT,IAAK,IAAI,EAAI,EAAG,EAAI,EAAI,aAAa,SAAU,EAC3C,EAAO,KAAsC,IAAjC,EAAI,aAAa,WAAW,GAChD,CACA,OAAO,EAAS,KAA4B,oBAAf,WAA6B,IAAI,WAAW,GAAU,EACvF,CACA,OAAO,EAAS,KAAM,EAAI,aAnBN,CAoBxB,EAEI,EAAQ,SAEJ,qBAAsB,GACtB,EAAI,iBAAiB,sCACzB,EAAI,aAAe,eAGvB,EAAI,KAAK,MAAO,GAChB,EAAI,MACR","file":"/npm/@protobufjs/fetch@1.1.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@protobufjs/fetch@1.1.0/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\";\r\nmodule.exports = fetch;\r\n\r\nvar asPromise = require(\"@protobufjs/aspromise\"),\r\n    inquire   = require(\"@protobufjs/inquire\");\r\n\r\nvar fs = inquire(\"fs\");\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Options as used by {@link util.fetch}.\r\n * @typedef FetchOptions\r\n * @type {Object}\r\n * @property {boolean} [binary=false] Whether expecting a binary response\r\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} filename File path or url\r\n * @param {FetchOptions} options Fetch options\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction fetch(filename, options, callback) {\r\n    if (typeof options === \"function\") {\r\n        callback = options;\r\n        options = {};\r\n    } else if (!options)\r\n        options = {};\r\n\r\n    if (!callback)\r\n        return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r\n\r\n    // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r\n    if (!options.xhr && fs && fs.readFile)\r\n        return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r\n            return err && typeof XMLHttpRequest !== \"undefined\"\r\n                ? fetch.xhr(filename, options, callback)\r\n                : err\r\n                ? callback(err)\r\n                : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\r\n        });\r\n\r\n    // use the XHR version otherwise.\r\n    return fetch.xhr(filename, options, callback);\r\n}\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @name util.fetch\r\n * @function\r\n * @param {string} path File path or url\r\n * @param {FetchOptions} [options] Fetch options\r\n * @returns {Promise<string|Uint8Array>} Promise\r\n * @variation 3\r\n */\r\n\r\n/**/\r\nfetch.xhr = function fetch_xhr(filename, options, callback) {\r\n    var xhr = new XMLHttpRequest();\r\n    xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r\n\r\n        if (xhr.readyState !== 4)\r\n            return undefined;\r\n\r\n        // local cors security errors return status 0 / empty string, too. afaik this cannot be\r\n        // reliably distinguished from an actually empty file for security reasons. feel free\r\n        // to send a pull request if you are aware of a solution.\r\n        if (xhr.status !== 0 && xhr.status !== 200)\r\n            return callback(Error(\"status \" + xhr.status));\r\n\r\n        // if binary data is expected, make sure that some sort of array is returned, even if\r\n        // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r\n        if (options.binary) {\r\n            var buffer = xhr.response;\r\n            if (!buffer) {\r\n                buffer = [];\r\n                for (var i = 0; i < xhr.responseText.length; ++i)\r\n                    buffer.push(xhr.responseText.charCodeAt(i) & 255);\r\n            }\r\n            return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\r\n        }\r\n        return callback(null, xhr.responseText);\r\n    };\r\n\r\n    if (options.binary) {\r\n        // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r\n        if (\"overrideMimeType\" in xhr)\r\n            xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\r\n        xhr.responseType = \"arraybuffer\";\r\n    }\r\n\r\n    xhr.open(\"GET\", filename);\r\n    xhr.send();\r\n};\r\n"]}