g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","var parse = require('inline-style-parser');\n\n/**\n * Parses inline style to object.\n *\n * @example\n * // returns { 'line-height': '42' }\n * StyleToObject('line-height: 42;');\n *\n * @param {String} style - The inline style.\n * @param {Function} [iterator] - The iterator function.\n * @return {null|Object}\n */\nfunction StyleToObject(style, iterator) {\n var output = null;\n if (!style || typeof style !== 'string') {\n return output;\n }\n\n var declaration;\n var declarations = parse(style);\n var hasIterator = typeof iterator === 'function';\n var property;\n var value;\n\n for (var i = 0, len = declarations.length; i < len; i++) {\n declaration = declarations[i];\n property = declaration.property;\n value = declaration.value;\n\n if (hasIterator) {\n iterator(property, value, declaration);\n } else if (value) {\n output || (output = {});\n output[property] = value;\n }\n }\n\n return output;\n}\n\nmodule.exports = StyleToObject;\nmodule.exports.default = StyleToObject; // ESM support\n","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nfunction _createForOfIteratorHelper(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (!it) {\n if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n var F = function F() {};\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}\nmodule.exports = _createForOfIteratorHelper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var getPrototypeOf = require(\"./getPrototypeOf.js\");\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct.js\");\nvar possibleConstructorReturn = require(\"./possibleConstructorReturn.js\");\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n if (hasNativeReflectConstruct) {\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return possibleConstructorReturn(this, result);\n };\n}\nmodule.exports = _createSuper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nmodule.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithHoles = require(\"./arrayWithHoles.js\");\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableRest = require(\"./nonIterableRest.js\");\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\nvar iterableToArray = require(\"./iterableToArray.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\n// Copyright 2021-2023 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BinaryReader = exports.BinaryWriter = exports.WireType = void 0;\nconst varint_js_1 = require(\"./google/varint.js\");\nconst assert_js_1 = require(\"./private/assert.js\");\nconst proto_int64_js_1 = require(\"./proto-int64.js\");\n/* eslint-disable prefer-const,no-case-declarations,@typescript-eslint/restrict-plus-operands */\n/**\n * Protobuf binary format wire types.\n *\n * A wire type provides just enough information to find the length of the\n * following value.\n *\n * See https://developers.google.com/protocol-buffers/docs/encoding#structure\n */\nvar WireType;\n(function (WireType) {\n /**\n * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum\n */\n WireType[WireType[\"Varint\"] = 0] = \"Varint\";\n /**\n * Used for fixed64, sfixed64, double.\n * Always 8 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit64\"] = 1] = \"Bit64\";\n /**\n * Used for string, bytes, embedded messages, packed repeated fields\n *\n * Only repeated numeric types (types which use the varint, 32-bit,\n * or 64-bit wire types) can be packed. In proto3, such fields are\n * packed by default.\n */\n WireType[WireType[\"LengthDelimited\"] = 2] = \"LengthDelimited\";\n /**\n * Used for groups\n * @deprecated\n */\n WireType[WireType[\"StartGroup\"] = 3] = \"StartGroup\";\n /**\n * Used for groups\n * @deprecated\n */\n WireType[WireType[\"EndGroup\"] = 4] = \"EndGroup\";\n /**\n * Used for fixed32, sfixed32, float.\n * Always 4 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit32\"] = 5] = \"Bit32\";\n})(WireType || (exports.WireType = WireType = {}));\nclass BinaryWriter {\n constructor(textEncoder) {\n /**\n * Previous fork states.\n */\n this.stack = [];\n this.textEncoder = textEncoder !== null && textEncoder !== void 0 ? textEncoder : new TextEncoder();\n this.chunks = [];\n this.buf = [];\n }\n /**\n * Return all bytes written and reset this writer.\n */\n finish() {\n this.chunks.push(new Uint8Array(this.buf)); // flush the buffer\n let len = 0;\n for (let i = 0; i < this.chunks.length; i++)\n len += this.chunks[i].length;\n let bytes = new Uint8Array(len);\n let offset = 0;\n for (let i = 0; i < this.chunks.length; i++) {\n bytes.set(this.chunks[i], offset);\n offset += this.chunks[i].length;\n }\n this.chunks = [];\n return bytes;\n }\n /**\n * Start a new fork for length-delimited data like a message\n * or a packed repeated field.\n *\n * Must be joined later with `join()`.\n */\n fork() {\n this.stack.push({ chunks: this.chunks, buf: this.buf });\n this.chunks = [];\n this.buf = [];\n return this;\n }\n /**\n * Join the last fork. Write its length and bytes, then\n * return to the previous state.\n */\n join() {\n // get chunk of fork\n let chunk = this.finish();\n // restore previous state\n let prev = this.stack.pop();\n if (!prev)\n throw new Error(\"invalid state, fork stack empty\");\n this.chunks = prev.chunks;\n this.buf = prev.buf;\n // write length of chunk as varint\n this.uint32(chunk.byteLength);\n return this.raw(chunk);\n }\n /**\n * Writes a tag (field number and wire type).\n *\n * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`.\n *\n * Generated code should compute the tag ahead of time and call `uint32()`.\n */\n tag(fieldNo, type) {\n return this.uint32(((fieldNo << 3) | type) >>> 0);\n }\n /**\n * Write a chunk of raw bytes.\n */\n raw(chunk) {\n if (this.buf.length) {\n this.chunks.push(new Uint8Array(this.buf));\n this.buf = [];\n }\n this.chunks.push(chunk);\n return this;\n }\n /**\n * Write a `uint32` value, an unsigned 32 bit varint.\n */\n uint32(value) {\n (0, assert_js_1.assertUInt32)(value);\n // write value as varint 32, inlined for speed\n while (value > 0x7f) {\n this.buf.push((value & 0x7f) | 0x80);\n value = value >>> 7;\n }\n this.buf.push(value);\n return this;\n }\n /**\n * Write a `int32` value, a signed 32 bit varint.\n */\n int32(value) {\n (0, assert_js_1.assertInt32)(value);\n (0, varint_js_1.varint32write)(value, this.buf);\n return this;\n }\n /**\n * Write a `bool` value, a variant.\n */\n bool(value) {\n this.buf.push(value ? 1 : 0);\n return this;\n }\n /**\n * Write a `bytes` value, length-delimited arbitrary data.\n */\n bytes(value) {\n this.uint32(value.byteLength); // write length of chunk as varint\n return this.raw(value);\n }\n /**\n * Write a `string` value, length-delimited data converted to UTF-8 text.\n */\n string(value) {\n let chunk = this.textEncoder.encode(value);\n this.uint32(chunk.byteLength); // write length of chunk as varint\n return this.raw(chunk);\n }\n /**\n * Write a `float` value, 32-bit floating point number.\n */\n float(value) {\n (0, assert_js_1.assertFloat32)(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setFloat32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `double` value, a 64-bit floating point number.\n */\n double(value) {\n let chunk = new Uint8Array(8);\n new DataView(chunk.buffer).setFloat64(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.\n */\n fixed32(value) {\n (0, assert_js_1.assertUInt32)(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setUint32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sfixed32` value, a signed, fixed-length 32-bit integer.\n */\n sfixed32(value) {\n (0, assert_js_1.assertInt32)(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setInt32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.\n */\n sint32(value) {\n (0, assert_js_1.assertInt32)(value);\n // zigzag encode\n value = ((value << 1) ^ (value >> 31)) >>> 0;\n (0, varint_js_1.varint32write)(value, this.buf);\n return this;\n }\n /**\n * Write a `fixed64` value, a signed, fixed-length 64-bit integer.\n */\n sfixed64(value) {\n let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = proto_int64_js_1.protoInt64.enc(value);\n view.setInt32(0, tc.lo, true);\n view.setInt32(4, tc.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.\n */\n fixed64(value) {\n let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = proto_int64_js_1.protoInt64.uEnc(value);\n view.setInt32(0, tc.lo, true);\n view.setInt32(4, tc.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `int64` value, a signed 64-bit varint.\n */\n int64(value) {\n let tc = proto_int64_js_1.protoInt64.enc(value);\n (0, varint_js_1.varint64write)(tc.lo, tc.hi, this.buf);\n return this;\n }\n /**\n * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64(value) {\n let tc = proto_int64_js_1.protoInt64.enc(value), \n // zigzag encode\n sign = tc.hi >> 31, lo = (tc.lo << 1) ^ sign, hi = ((tc.hi << 1) | (tc.lo >>> 31)) ^ sign;\n (0, varint_js_1.varint64write)(lo, hi, this.buf);\n return this;\n }\n /**\n * Write a `uint64` value, an unsigned 64-bit varint.\n */\n uint64(value) {\n let tc = proto_int64_js_1.protoInt64.uEnc(value);\n (0, varint_js_1.varint64write)(tc.lo, tc.hi, this.buf);\n return this;\n }\n}\nexports.BinaryWriter = BinaryWriter;\nclass BinaryReader {\n constructor(buf, textDecoder) {\n this.varint64 = varint_js_1.varint64read; // dirty cast for `this`\n /**\n * Read a `uint32` field, an unsigned 32 bit varint.\n */\n this.uint32 = varint_js_1.varint32read; // dirty cast for `this` and access to protected `buf`\n this.buf = buf;\n this.len = buf.length;\n this.pos = 0;\n this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);\n this.textDecoder = textDecoder !== null && textDecoder !== void 0 ? textDecoder : new TextDecoder();\n }\n /**\n * Reads a tag - field number and wire type.\n */\n tag() {\n let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7;\n if (fieldNo <= 0 || wireType < 0 || wireType > 5)\n throw new Error(\"illegal tag: field no \" + fieldNo + \" wire type \" + wireType);\n return [fieldNo, wireType];\n }\n /**\n * Skip one element on the wire and return the skipped data.\n * Supports WireType.StartGroup since v2.0.0-alpha.23.\n */\n skip(wireType) {\n let start = this.pos;\n switch (wireType) {\n case WireType.Varint:\n while (this.buf[this.pos++] & 0x80) {\n // ignore\n }\n break;\n // eslint-disable-next-line\n // @ts-ignore TS7029: Fallthrough case in switch\n case WireType.Bit64:\n this.pos += 4;\n // eslint-disable-next-line\n // @ts-ignore TS7029: Fallthrough case in switch\n case WireType.Bit32:\n this.pos += 4;\n break;\n case WireType.LengthDelimited:\n let len = this.uint32();\n this.pos += len;\n break;\n case WireType.StartGroup:\n // From descriptor.proto: Group type is deprecated, not supported in proto3.\n // But we must still be able to parse and treat as unknown.\n let t;\n while ((t = this.tag()[1]) !== WireType.EndGroup) {\n this.skip(t);\n }\n break;\n default:\n throw new Error(\"cant skip wire type \" + wireType);\n }\n this.assertBounds();\n return this.buf.subarray(start, this.pos);\n }\n /**\n * Throws error if position in byte array is out of range.\n */\n assertBounds() {\n if (this.pos > this.len)\n throw new RangeError(\"premature EOF\");\n }\n /**\n * Read a `int32` field, a signed 32 bit varint.\n */\n int32() {\n return this.uint32() | 0;\n }\n /**\n * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint.\n */\n sint32() {\n let zze = this.uint32();\n // decode zigzag\n return (zze >>> 1) ^ -(zze & 1);\n }\n /**\n * Read a `int64` field, a signed 64-bit varint.\n */\n int64() {\n return proto_int64_js_1.protoInt64.dec(...this.varint64());\n }\n /**\n * Read a `uint64` field, an unsigned 64-bit varint.\n */\n uint64() {\n return proto_int64_js_1.protoInt64.uDec(...this.varint64());\n }\n /**\n * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64() {\n let [lo, hi] = this.varint64();\n // decode zig zag\n let s = -(lo & 1);\n lo = ((lo >>> 1) | ((hi & 1) << 31)) ^ s;\n hi = (hi >>> 1) ^ s;\n return proto_int64_js_1.protoInt64.dec(lo, hi);\n }\n /**\n * Read a `bool` field, a variant.\n */\n bool() {\n let [lo, hi] = this.varint64();\n return lo !== 0 || hi !== 0;\n }\n /**\n * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.\n */\n fixed32() {\n return this.view.getUint32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `sfixed32` field, a signed, fixed-length 32-bit integer.\n */\n sfixed32() {\n return this.view.getInt32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.\n */\n fixed64() {\n return proto_int64_js_1.protoInt64.uDec(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `fixed64` field, a signed, fixed-length 64-bit integer.\n */\n sfixed64() {\n return proto_int64_js_1.protoInt64.dec(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `float` field, 32-bit floating point number.\n */\n float() {\n return this.view.getFloat32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `double` field, a 64-bit floating point number.\n */\n double() {\n return this.view.getFloat64((this.pos += 8) - 8, true);\n }\n /**\n * Read a `bytes` field, length-delimited arbitrary data.\n */\n bytes() {\n let len = this.uint32(), start = this.pos;\n this.pos += len;\n this.assertBounds();\n return this.buf.subarray(start, start + len);\n }\n /**\n * Read a `string` field, length-delimited data converted to UTF-8 text.\n */\n string() {\n return this.textDecoder.decode(this.bytes());\n }\n}\nexports.BinaryReader = BinaryReader;\n","\"use strict\";\n// Copyright 2021-2023 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.codegenInfo = void 0;\nconst names_js_1 = require(\"./private/names.js\");\nconst field_wrapper_js_1 = require(\"./private/field-wrapper.js\");\nconst scalars_js_1 = require(\"./private/scalars.js\");\nconst reify_wkt_js_1 = require(\"./private/reify-wkt.js\");\nconst packageName = \"@bufbuild/protobuf\";\nexports.codegenInfo = {\n packageName,\n localName: names_js_1.localName,\n reifyWkt: reify_wkt_js_1.reifyWkt,\n getUnwrappedFieldType: field_wrapper_js_1.getUnwrappedFieldType,\n scalarDefaultValue: scalars_js_1.scalarDefaultValue,\n safeIdentifier: names_js_1.safeIdentifier,\n safeObjectProperty: names_js_1.safeObjectProperty,\n // prettier-ignore\n symbols: {\n proto2: { typeOnly: false, privateImportPath: \"./proto2.js\", publicImportPath: packageName },\n proto3: { typeOnly: false, privateImportPath: \"./proto3.js\", publicImportPath: packageName },\n Message: { typeOnly: false, privateImportPath: \"./message.js\", publicImportPath: packageName },\n PartialMessage: { typeOnly: true, privateImportPath: \"./message.js\", publicImportPath: packageName },\n PlainMessage: { typeOnly: true, privateImportPath: \"./message.js\", publicImportPath: packageName },\n FieldList: { typeOnly: true, privateImportPath: \"./field-list.js\", publicImportPath: packageName },\n MessageType: { typeOnly: true, privateImportPath: \"./message-type.js\", publicImportPath: packageName },\n BinaryReadOptions: { typeOnly: true, privateImportPath: \"./binary-format.js\", publicImportPath: packageName },\n BinaryWriteOptions: { typeOnly: true, privateImportPath: \"./binary-format.js\", publicImportPath: packageName },\n JsonReadOptions: { typeOnly: true, privateImportPath: \"./json-format.js\", publicImportPath: packageName },\n JsonWriteOptions: { typeOnly: true, privateImportPath: \"./json-format.js\", publicImportPath: packageName },\n JsonValue: { typeOnly: true, privateImportPath: \"./json-format.js\", publicImportPath: packageName },\n JsonObject: { typeOnly: true, privateImportPath: \"./json-format.js\", publicImportPath: packageName },\n protoDouble: { typeOnly: false, privateImportPath: \"./proto-double.js\", publicImportPath: packageName },\n protoInt64: { typeOnly: false, privateImportPath: \"./proto-int64.js\", publicImportPath: packageName },\n ScalarType: { typeOnly: false, privateImportPath: \"./field.js\", publicImportPath: packageName },\n MethodKind: { typeOnly: false, privateImportPath: \"./service-type.js\", publicImportPath: packageName },\n MethodIdempotency: { typeOnly: false, privateImportPath: \"./service-type.js\", publicImportPath: packageName },\n IMessageTypeRegistry: { typeOnly: true, privateImportPath: \"./type-registry.js\", publicImportPath: packageName },\n },\n wktSourceFiles: [\n \"google/protobuf/compiler/plugin.proto\",\n \"google/protobuf/any.proto\",\n \"google/protobuf/api.proto\",\n \"google/protobuf/descriptor.proto\",\n \"google/protobuf/duration.proto\",\n \"google/protobuf/empty.proto\",\n \"google/protobuf/field_mask.proto\",\n \"google/protobuf/source_context.proto\",\n \"google/protobuf/struct.proto\",\n \"google/protobuf/timestamp.proto\",\n \"google/protobuf/type.proto\",\n \"google/protobuf/wrappers.proto\",\n ],\n};\n","\"use strict\";\n// Copyright 2021-2023 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isPackedFieldByDefault = exports.createDescriptorSet = void 0;\nconst descriptor_pb_js_1 = require(\"./google/protobuf/descriptor_pb.js\");\nconst assert_js_1 = require(\"./private/assert.js\");\nconst field_js_1 = require(\"./field.js\");\nconst service_type_js_1 = require(\"./service-type.js\");\nconst names_js_1 = require(\"./private/names.js\");\nconst proto_int64_js_1 = require(\"./proto-int64.js\");\n/**\n * Create a DescriptorSet, a convenient interface for working with a set of\n * google.protobuf.FileDescriptorProto.\n *\n * Note that files must be given in topological order, so each file appears\n * before any file that imports it. Protocol buffer compilers always produce\n * files in topological order.\n */\nfunction createDescriptorSet(input) {\n const cart = {\n enums: new Map(),\n messages: new Map(),\n services: new Map(),\n extensions: new Map(),\n mapEntries: new Map(),\n };\n const fileDescriptors = input instanceof descriptor_pb_js_1.FileDescriptorSet\n ? input.file\n : input instanceof Uint8Array\n ? descriptor_pb_js_1.FileDescriptorSet.fromBinary(input).file\n : input;\n const files = fileDescriptors.map((proto) => newFile(proto, cart));\n return Object.assign({ files }, cart);\n}\nexports.createDescriptorSet = createDescriptorSet;\n/**\n * Create a descriptor for a file.\n */\nfunction newFile(proto, cart) {\n var _a, _b, _c;\n (0, assert_js_1.assert)(proto.name, `invalid FileDescriptorProto: missing name`);\n (0, assert_js_1.assert)(proto.syntax === undefined || proto.syntax === \"proto3\", `invalid FileDescriptorProto: unsupported syntax: ${(_a = proto.syntax) !== null && _a !== void 0 ? _a : \"undefined\"}`);\n const file = {\n kind: \"file\",\n proto,\n deprecated: (_c = (_b = proto.options) === null || _b === void 0 ? void 0 : _b.deprecated) !== null && _c !== void 0 ? _c : false,\n syntax: proto.syntax === \"proto3\" ? \"proto3\" : \"proto2\",\n name: proto.name.replace(/\\.proto/, \"\"),\n enums: [],\n messages: [],\n extensions: [],\n services: [],\n toString() {\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- we asserted above\n return `file ${this.proto.name}`;\n },\n getSyntaxComments() {\n return findComments(this.proto.sourceCodeInfo, [\n FieldNumber.FileDescriptorProto_Syntax,\n ]);\n },\n getPackageComments() {\n return findComments(this.proto.sourceCodeInfo, [\n FieldNumber.FileDescriptorProto_Package,\n ]);\n },\n };\n cart.mapEntries.clear(); // map entries are local to the file, we can safely discard\n for (const enumProto of proto.enumType) {\n addEnum(enumProto, file, undefined, cart);\n }\n for (const messageProto of proto.messageType) {\n addMessage(messageProto, file, undefined, cart);\n }\n for (const serviceProto of proto.service) {\n addService(serviceProto, file, cart);\n }\n addExtensions(file, cart);\n for (const mapEntry of cart.mapEntries.values()) {\n addFields(mapEntry, cart);\n }\n for (const message of file.messages) {\n addFields(message, cart);\n addExtensions(message, cart);\n }\n cart.mapEntries.clear(); // map entries are local to the file, we can safely discard\n return file;\n}\n/**\n * Create descriptors for extensions, and add them to the message / file,\n * and to our cart.\n * Recurses into nested types.\n */\nfunction addExtensions(desc, cart) {\n switch (desc.kind) {\n case \"file\":\n for (const proto of desc.proto.extension) {\n const ext = newExtension(proto, desc, undefined, cart);\n desc.extensions.push(ext);\n cart.extensions.set(ext.typeName, ext);\n }\n break;\n case \"message\":\n for (const proto of desc.proto.extension) {\n const ext = newExtension(proto, desc.file, desc, cart);\n desc.nestedExtensions.push(ext);\n cart.extensions.set(ext.typeName, ext);\n }\n for (const message of desc.nestedMessages) {\n addExtensions(message, cart);\n }\n break;\n }\n}\n/**\n * Create descriptors for fields and oneof groups, and add them to the message.\n * Recurses into nested types.\n */\nfunction addFields(message, cart) {\n const allOneofs = message.proto.oneofDecl.map((proto) => newOneof(proto, message));\n const oneofsSeen = new Set();\n for (const proto of message.proto.field) {\n const oneof = findOneof(proto, allOneofs);\n const field = newField(proto, message.file, message, oneof, cart);\n message.fields.push(field);\n if (oneof === undefined) {\n message.members.push(field);\n }\n else {\n oneof.fields.push(field);\n if (!oneofsSeen.has(oneof)) {\n oneofsSeen.add(oneof);\n message.members.push(oneof);\n }\n }\n }\n for (const oneof of allOneofs.filter((o) => oneofsSeen.has(o))) {\n message.oneofs.push(oneof);\n }\n for (const child of message.nestedMessages) {\n addFields(child, cart);\n }\n}\n/**\n * Create a descriptor for an enumeration, and add it our cart and to the\n * parent type, if any.\n */\nfunction addEnum(proto, file, parent, cart) {\n var _a, _b, _c;\n (0, assert_js_1.assert)(proto.name, `invalid EnumDescriptorProto: missing name`);\n const desc = {\n kind: \"enum\",\n proto,\n deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,\n file,\n parent,\n name: proto.name,\n typeName: makeTypeName(proto, parent, file),\n values: [],\n sharedPrefix: (0, names_js_1.findEnumSharedPrefix)(proto.name, proto.value.map((v) => { var _a; return (_a = v.name) !== null && _a !== void 0 ? _a : \"\"; })),\n toString() {\n return `enum ${this.typeName}`;\n },\n getComments() {\n const path = this.parent\n ? [\n ...this.parent.getComments().sourcePath,\n FieldNumber.DescriptorProto_EnumType,\n this.parent.proto.enumType.indexOf(this.proto),\n ]\n : [\n FieldNumber.FileDescriptorProto_EnumType,\n this.file.proto.enumType.indexOf(this.proto),\n ];\n return findComments(file.proto.sourceCodeInfo, path);\n },\n };\n cart.enums.set(desc.typeName, desc);\n proto.value.forEach((proto) => {\n var _a, _b;\n (0, assert_js_1.assert)(proto.name, `invalid EnumValueDescriptorProto: missing name`);\n (0, assert_js_1.assert)(proto.number !== undefined, `invalid EnumValueDescriptorProto: missing number`);\n desc.values.push({\n kind: \"enum_value\",\n proto,\n deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,\n parent: desc,\n name: proto.name,\n number: proto.number,\n toString() {\n return `enum value ${desc.typeName}.${this.name}`;\n },\n declarationString() {\n var _a;\n let str = `${this.name} = ${this.number}`;\n if (((_a = this.proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) === true) {\n str += \" [deprecated = true]\";\n }\n return str;\n },\n getComments() {\n const path = [\n ...this.parent.getComments().sourcePath,\n FieldNumber.EnumDescriptorProto_Value,\n this.parent.proto.value.indexOf(this.proto),\n ];\n return findComments(file.proto.sourceCodeInfo, path);\n },\n });\n });\n ((_c = parent === null || parent === void 0 ? void 0 : parent.nestedEnums) !== null && _c !== void 0 ? _c : file.enums).push(desc);\n}\n/**\n * Create a descriptor for a message, including nested types, and add it to our\n * cart. Note that this does not create descriptors fields.\n */\nfunction addMessage(proto, file, parent, cart) {\n var _a, _b, _c, _d;\n (0, assert_js_1.assert)(proto.name, `invalid DescriptorProto: missing name`);\n const desc = {\n kind: \"message\",\n proto,\n deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,\n file,\n parent,\n name: proto.name,\n typeName: makeTypeName(proto, parent, file),\n fields: [],\n oneofs: [],\n members: [],\n nestedEnums: [],\n nestedMessages: [],\n nestedExtensions: [],\n toString() {\n return `message ${this.typeName}`;\n },\n getComments() {\n const path = this.parent\n ? [\n ...this.parent.getComments().sourcePath,\n FieldNumber.DescriptorProto_NestedType,\n this.parent.proto.nestedType.indexOf(this.proto),\n ]\n : [\n FieldNumber.FileDescriptorProto_MessageType,\n this.file.proto.messageType.indexOf(this.proto),\n ];\n return findComments(file.proto.sourceCodeInfo, path);\n },\n };\n if (((_c = proto.options) === null || _c === void 0 ? void 0 : _c.mapEntry) === true) {\n cart.mapEntries.set(desc.typeName, desc);\n }\n else {\n ((_d = parent === null || parent === void 0 ? void 0 : parent.nestedMessages) !== null && _d !== void 0 ? _d : file.messages).push(desc);\n cart.messages.set(desc.typeName, desc);\n }\n for (const enumProto of proto.enumType) {\n addEnum(enumProto, file, desc, cart);\n }\n for (const messageProto of proto.nestedType) {\n addMessage(messageProto, file, desc, cart);\n }\n}\n/**\n * Create a descriptor for a service, including methods, and add it to our\n * cart.\n */\nfunction addService(proto, file, cart) {\n var _a, _b;\n (0, assert_js_1.assert)(proto.name, `invalid ServiceDescriptorProto: missing name`);\n const desc = {\n kind: \"service\",\n proto,\n deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,\n file,\n name: proto.name,\n typeName: makeTypeName(proto, undefined, file),\n methods: [],\n toString() {\n return `service ${this.typeName}`;\n },\n getComments() {\n const path = [\n FieldNumber.FileDescriptorProto_Service,\n this.file.proto.service.indexOf(this.proto),\n ];\n return findComments(file.proto.sourceCodeInfo, path);\n },\n };\n file.services.push(desc);\n cart.services.set(desc.typeName, desc);\n for (const methodProto of proto.method) {\n desc.methods.push(newMethod(methodProto, desc, cart));\n }\n}\n/**\n * Create a descriptor for a method.\n */\nfunction newMethod(proto, parent, cart) {\n var _a, _b, _c;\n (0, assert_js_1.assert)(proto.name, `invalid MethodDescriptorProto: missing name`);\n (0, assert_js_1.assert)(proto.inputType, `invalid MethodDescriptorProto: missing input_type`);\n (0, assert_js_1.assert)(proto.outputType, `invalid MethodDescriptorProto: missing output_type`);\n let methodKind;\n if (proto.clientStreaming === true && proto.serverStreaming === true) {\n methodKind = service_type_js_1.MethodKind.BiDiStreaming;\n }\n else if (proto.clientStreaming === true) {\n methodKind = service_type_js_1.MethodKind.ClientStreaming;\n }\n else if (proto.serverStreaming === true) {\n methodKind = service_type_js_1.MethodKind.ServerStreaming;\n }\n else {\n methodKind = service_type_js_1.MethodKind.Unary;\n }\n let idempotency;\n switch ((_a = proto.options) === null || _a === void 0 ? void 0 : _a.idempotencyLevel) {\n case descriptor_pb_js_1.MethodOptions_IdempotencyLevel.IDEMPOTENT:\n idempotency = service_type_js_1.MethodIdempotency.Idempotent;\n break;\n case descriptor_pb_js_1.MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS:\n idempotency = service_type_js_1.MethodIdempotency.NoSideEffects;\n break;\n case descriptor_pb_js_1.MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN:\n case undefined:\n idempotency = undefined;\n break;\n }\n const input = cart.messages.get(trimLeadingDot(proto.inputType));\n const output = cart.messages.get(trimLeadingDot(proto.outputType));\n (0, assert_js_1.assert)(input, `invalid MethodDescriptorProto: input_type ${proto.inputType} not found`);\n (0, assert_js_1.assert)(output, `invalid MethodDescriptorProto: output_type ${proto.inputType} not found`);\n const name = proto.name;\n return {\n kind: \"rpc\",\n proto,\n deprecated: (_c = (_b = proto.options) === null || _b === void 0 ? void 0 : _b.deprecated) !== null && _c !== void 0 ? _c : false,\n parent,\n name,\n methodKind,\n input,\n output,\n idempotency,\n toString() {\n return `rpc ${parent.typeName}.${name}`;\n },\n getComments() {\n const path = [\n ...this.parent.getComments().sourcePath,\n FieldNumber.ServiceDescriptorProto_Method,\n this.parent.proto.method.indexOf(this.proto),\n ];\n return findComments(parent.file.proto.sourceCodeInfo, path);\n },\n };\n}\n/**\n * Create a descriptor for a oneof group.\n */\nfunction newOneof(proto, parent) {\n (0, assert_js_1.assert)(proto.name, `invalid OneofDescriptorProto: missing name`);\n return {\n kind: \"oneof\",\n proto,\n deprecated: false,\n parent,\n fields: [],\n name: proto.name,\n toString() {\n return `oneof ${parent.typeName}.${this.name}`;\n },\n getComments() {\n const path = [\n ...this.parent.getComments().sourcePath,\n FieldNumber.DescriptorProto_OneofDecl,\n this.parent.proto.oneofDecl.indexOf(this.proto),\n ];\n return findComments(parent.file.proto.sourceCodeInfo, path);\n },\n };\n}\n/**\n * Create a descriptor for a field.\n */\nfunction newField(proto, file, parent, oneof, cart) {\n var _a, _b, _c, _d;\n (0, assert_js_1.assert)(proto.name, `invalid FieldDescriptorProto: missing name`);\n (0, assert_js_1.assert)(proto.number, `invalid FieldDescriptorProto: missing number`);\n (0, assert_js_1.assert)(proto.type, `invalid FieldDescriptorProto: missing type`);\n const packedByDefault = isPackedFieldByDefault(proto, file.syntax);\n const common = {\n proto,\n deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,\n name: proto.name,\n number: proto.number,\n parent,\n oneof,\n optional: isOptionalField(proto, file.syntax),\n packed: (_d = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.packed) !== null && _d !== void 0 ? _d : packedByDefault,\n packedByDefault,\n jsonName: proto.jsonName === (0, names_js_1.fieldJsonName)(proto.name) ? undefined : proto.jsonName,\n scalar: undefined,\n message: undefined,\n enum: undefined,\n mapKey: undefined,\n mapValue: undefined,\n toString() {\n // note that newExtension() calls us with parent = null\n return `field ${this.parent.typeName}.${this.name}`;\n },\n declarationString,\n getComments() {\n const path = [\n ...this.parent.getComments().sourcePath,\n FieldNumber.DescriptorProto_Field,\n this.parent.proto.field.indexOf(this.proto),\n ];\n return findComments(file.proto.sourceCodeInfo, path);\n },\n };\n const repeated = proto.label === descriptor_pb_js_1.FieldDescriptorProto_Label.REPEATED;\n switch (proto.type) {\n case descriptor_pb_js_1.FieldDescriptorProto_Type.MESSAGE:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.GROUP: {\n (0, assert_js_1.assert)(proto.typeName, `invalid FieldDescriptorProto: missing type_name`);\n const mapEntry = cart.mapEntries.get(trimLeadingDot(proto.typeName));\n if (mapEntry !== undefined) {\n (0, assert_js_1.assert)(repeated, `invalid FieldDescriptorProto: expected map entry to be repeated`);\n return Object.assign(Object.assign(Object.assign({}, common), { kind: \"field\", fieldKind: \"map\", repeated: false }), getMapFieldTypes(mapEntry));\n }\n const message = cart.messages.get(trimLeadingDot(proto.typeName));\n (0, assert_js_1.assert)(message !== undefined, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`);\n return Object.assign(Object.assign({}, common), { kind: \"field\", fieldKind: \"message\", repeated,\n message });\n }\n case descriptor_pb_js_1.FieldDescriptorProto_Type.ENUM: {\n (0, assert_js_1.assert)(proto.typeName, `invalid FieldDescriptorProto: missing type_name`);\n const e = cart.enums.get(trimLeadingDot(proto.typeName));\n (0, assert_js_1.assert)(e !== undefined, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`);\n return Object.assign(Object.assign({}, common), { kind: \"field\", fieldKind: \"enum\", getDefaultValue,\n repeated, enum: e });\n }\n default: {\n const scalar = fieldTypeToScalarType[proto.type];\n (0, assert_js_1.assert)(scalar, `invalid FieldDescriptorProto: unknown type ${proto.type}`);\n return Object.assign(Object.assign({}, common), { kind: \"field\", fieldKind: \"scalar\", getDefaultValue,\n repeated,\n scalar });\n }\n }\n}\n/**\n * Create a descriptor for an extension field.\n */\nfunction newExtension(proto, file, parent, cart) {\n (0, assert_js_1.assert)(proto.extendee, `invalid FieldDescriptorProto: missing extendee`);\n const field = newField(proto, file, null, // to safe us many lines of duplicated code, we trick the type system\n undefined, cart);\n const extendee = cart.messages.get(trimLeadingDot(proto.extendee));\n (0, assert_js_1.assert)(extendee, `invalid FieldDescriptorProto: extendee ${proto.extendee} not found`);\n return Object.assign(Object.assign({}, field), { kind: \"extension\", typeName: makeTypeName(proto, parent, file), parent,\n file,\n extendee,\n toString() {\n return `extension ${this.typeName}`;\n },\n getComments() {\n const path = this.parent\n ? [\n ...this.parent.getComments().sourcePath,\n FieldNumber.DescriptorProto_Extension,\n this.parent.proto.extension.indexOf(proto),\n ]\n : [\n FieldNumber.FileDescriptorProto_Extension,\n this.file.proto.extension.indexOf(proto),\n ];\n return findComments(file.proto.sourceCodeInfo, path);\n } });\n}\n/**\n * Create a fully qualified name for a protobuf type or extension field.\n *\n * The fully qualified name for messages, enumerations, and services is\n * constructed by concatenating the package name (if present), parent\n * message names (for nested types), and the type name. We omit the leading\n * dot added by protobuf compilers. Examples:\n * - mypackage.MyMessage\n * - mypackage.MyMessage.NestedMessage\n *\n * The fully qualified name for extension fields is constructed by\n * concatenating the package name (if present), parent message names (for\n * extensions declared within a message), and the field name. Examples:\n * - mypackage.extfield\n * - mypackage.MyMessage.extfield\n */\nfunction makeTypeName(proto, parent, file) {\n (0, assert_js_1.assert)(proto.name, `invalid ${proto.getType().typeName}: missing name`);\n let typeName;\n if (parent) {\n typeName = `${parent.typeName}.${proto.name}`;\n }\n else if (file.proto.package !== undefined) {\n typeName = `${file.proto.package}.${proto.name}`;\n }\n else {\n typeName = `${proto.name}`;\n }\n return typeName;\n}\n/**\n * Remove the leading dot from a fully qualified type name.\n */\nfunction trimLeadingDot(typeName) {\n return typeName.startsWith(\".\") ? typeName.substring(1) : typeName;\n}\nfunction getMapFieldTypes(mapEntry) {\n var _a, _b;\n (0, assert_js_1.assert)((_a = mapEntry.proto.options) === null || _a === void 0 ? void 0 : _a.mapEntry, `invalid DescriptorProto: expected ${mapEntry.toString()} to be a map entry`);\n (0, assert_js_1.assert)(mapEntry.fields.length === 2, `invalid DescriptorProto: map entry ${mapEntry.toString()} has ${mapEntry.fields.length} fields`);\n const keyField = mapEntry.fields.find((f) => f.proto.number === 1);\n (0, assert_js_1.assert)(keyField, `invalid DescriptorProto: map entry ${mapEntry.toString()} is missing key field`);\n const mapKey = keyField.scalar;\n (0, assert_js_1.assert)(mapKey !== undefined &&\n mapKey !== field_js_1.ScalarType.BYTES &&\n mapKey !== field_js_1.ScalarType.FLOAT &&\n mapKey !== field_js_1.ScalarType.DOUBLE, `invalid DescriptorProto: map entry ${mapEntry.toString()} has unexpected key type ${(_b = keyField.proto.type) !== null && _b !== void 0 ? _b : -1}`);\n const valueField = mapEntry.fields.find((f) => f.proto.number === 2);\n (0, assert_js_1.assert)(valueField, `invalid DescriptorProto: map entry ${mapEntry.toString()} is missing value field`);\n switch (valueField.fieldKind) {\n case \"scalar\":\n return {\n mapKey,\n mapValue: Object.assign(Object.assign({}, valueField), { kind: \"scalar\" }),\n };\n case \"message\":\n return {\n mapKey,\n mapValue: Object.assign(Object.assign({}, valueField), { kind: \"message\" }),\n };\n case \"enum\":\n return {\n mapKey,\n mapValue: Object.assign(Object.assign({}, valueField), { kind: \"enum\" }),\n };\n default:\n throw new Error(\"invalid DescriptorProto: unsupported map entry value field\");\n }\n}\n/**\n * Did the user put the field in a oneof group?\n * This handles proto3 optionals.\n */\nfunction findOneof(proto, allOneofs) {\n var _a;\n const oneofIndex = proto.oneofIndex;\n if (oneofIndex === undefined) {\n return undefined;\n }\n let oneof;\n if (proto.proto3Optional !== true) {\n oneof = allOneofs[oneofIndex];\n (0, assert_js_1.assert)(oneof, `invalid FieldDescriptorProto: oneof #${oneofIndex} for field #${(_a = proto.number) !== null && _a !== void 0 ? _a : -1} not found`);\n }\n return oneof;\n}\n/**\n * Did the user use the `optional` keyword?\n * This handles proto3 optionals.\n */\nfunction isOptionalField(proto, syntax) {\n switch (syntax) {\n case \"proto2\":\n return (proto.oneofIndex === undefined &&\n proto.label === descriptor_pb_js_1.FieldDescriptorProto_Label.OPTIONAL);\n case \"proto3\":\n return proto.proto3Optional === true;\n }\n}\n/**\n * Get the default `packed` state of a repeated field.\n */\nfunction isPackedFieldByDefault(proto, syntax) {\n (0, assert_js_1.assert)(proto.type, `invalid FieldDescriptorProto: missing type`);\n if (syntax === \"proto3\") {\n switch (proto.type) {\n case descriptor_pb_js_1.FieldDescriptorProto_Type.DOUBLE:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.FLOAT:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.INT64:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.UINT64:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.INT32:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.FIXED64:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.FIXED32:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.UINT32:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.SFIXED32:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.SFIXED64:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.SINT32:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.SINT64:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.BOOL:\n case descriptor_pb_js_1.FieldDescriptorProto_Type.ENUM:\n // From the proto3 language guide:\n // > In proto3, repeated fields of scalar numeric types are packed by default.\n // This information is incomplete - according to the conformance tests, BOOL\n // and ENUM are packed by default as well. This means only STRING and BYTES\n // are not packed by default, which makes sense because they are length-delimited.\n return true;\n default:\n return false;\n }\n }\n return false;\n}\nexports.isPackedFieldByDefault = isPackedFieldByDefault;\n/**\n * Map from a compiler-generated field type to our ScalarType, which is a\n * subset of field types declared by protobuf enum google.protobuf.FieldDescriptorProto.\n */\nconst fieldTypeToScalarType = {\n [descriptor_pb_js_1.FieldDescriptorProto_Type.DOUBLE]: field_js_1.ScalarType.DOUBLE,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.FLOAT]: field_js_1.ScalarType.FLOAT,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.INT64]: field_js_1.ScalarType.INT64,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.UINT64]: field_js_1.ScalarType.UINT64,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.INT32]: field_js_1.ScalarType.INT32,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.FIXED64]: field_js_1.ScalarType.FIXED64,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.FIXED32]: field_js_1.ScalarType.FIXED32,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.BOOL]: field_js_1.ScalarType.BOOL,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.STRING]: field_js_1.ScalarType.STRING,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.GROUP]: undefined,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.MESSAGE]: undefined,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.BYTES]: field_js_1.ScalarType.BYTES,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.UINT32]: field_js_1.ScalarType.UINT32,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.ENUM]: undefined,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.SFIXED32]: field_js_1.ScalarType.SFIXED32,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.SFIXED64]: field_js_1.ScalarType.SFIXED64,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.SINT32]: field_js_1.ScalarType.SINT32,\n [descriptor_pb_js_1.FieldDescriptorProto_Type.SINT64]: field_js_1.ScalarType.SINT64,\n};\n/**\n * Find comments.\n */\nfunction findComments(sourceCodeInfo, sourcePath) {\n if (!sourceCodeInfo) {\n return {\n leadingDetached: [],\n sourcePath,\n };\n }\n for (const location of sourceCodeInfo.location) {\n if (location.path.length !== sourcePath.length) {\n continue;\n }\n if (location.path.some((value, index) => sourcePath[index] !== value)) {\n continue;\n }\n return {\n leadingDetached: location.leadingDetachedComments,\n leading: location.leadingComments,\n trailing: location.trailingComments,\n sourcePath,\n };\n }\n return {\n leadingDetached: [],\n sourcePath,\n };\n}\n/**\n * The following field numbers are used to find comments in\n * google.protobuf.SourceCodeInfo.\n */\nvar FieldNumber;\n(function (FieldNumber) {\n FieldNumber[FieldNumber[\"FileDescriptorProto_Package\"] = 2] = \"FileDescriptorProto_Package\";\n FieldNumber[FieldNumber[\"FileDescriptorProto_MessageType\"] = 4] = \"FileDescriptorProto_MessageType\";\n FieldNumber[FieldNumber[\"FileDescriptorProto_EnumType\"] = 5] = \"FileDescriptorProto_EnumType\";\n FieldNumber[FieldNumber[\"FileDescriptorProto_Service\"] = 6] = \"FileDescriptorProto_Service\";\n FieldNumber[FieldNumber[\"FileDescriptorProto_Extension\"] = 7] = \"FileDescriptorProto_Extension\";\n FieldNumber[FieldNumber[\"FileDescriptorProto_Syntax\"] = 12] = \"FileDescriptorProto_Syntax\";\n FieldNumber[FieldNumber[\"DescriptorProto_Field\"] = 2] = \"DescriptorProto_Field\";\n FieldNumber[FieldNumber[\"DescriptorProto_NestedType\"] = 3] = \"DescriptorProto_NestedType\";\n FieldNumber[FieldNumber[\"DescriptorProto_EnumType\"] = 4] = \"DescriptorProto_EnumType\";\n FieldNumber[FieldNumber[\"DescriptorProto_Extension\"] = 6] = \"DescriptorProto_Extension\";\n FieldNumber[FieldNumber[\"DescriptorProto_OneofDecl\"] = 8] = \"DescriptorProto_OneofDecl\";\n FieldNumber[FieldNumber[\"EnumDescriptorProto_Value\"] = 2] = \"EnumDescriptorProto_Value\";\n FieldNumber[FieldNumber[\"ServiceDescriptorProto_Method\"] = 2] = \"ServiceDescriptorProto_Method\";\n})(FieldNumber || (FieldNumber = {}));\n/**\n * Return a string that matches the definition of a field in the protobuf\n * source. Does not take custom options into account.\n */\nfunction declarationString() {\n var _a, _b;\n const parts = [];\n if (this.repeated) {\n parts.push(\"repeated\");\n }\n if (this.optional) {\n parts.push(\"optional\");\n }\n const file = this.kind === \"extension\" ? this.file : this.parent.file;\n if (file.syntax == \"proto2\" &&\n this.proto.label === descriptor_pb_js_1.FieldDescriptorProto_Label.REQUIRED) {\n parts.push(\"required\");\n }\n let type;\n switch (this.fieldKind) {\n case \"scalar\":\n type = field_js_1.ScalarType[this.scalar].toLowerCase();\n break;\n case \"enum\":\n type = this.enum.typeName;\n break;\n case \"message\":\n type = this.message.typeName;\n break;\n case \"map\": {\n const k = field_js_1.ScalarType[this.mapKey].toLowerCase();\n let v;\n switch (this.mapValue.kind) {\n case \"scalar\":\n v = field_js_1.ScalarType[this.mapValue.scalar].toLowerCase();\n break;\n case \"enum\":\n v = this.mapValue.enum.typeName;\n break;\n case \"message\":\n v = this.mapValue.message.typeName;\n break;\n }\n type = `map<${k}, ${v}>`;\n break;\n }\n }\n parts.push(`${type} ${this.name} = ${this.number}`);\n const options = [];\n if (((_a = this.proto.options) === null || _a === void 0 ? void 0 : _a.packed) !== undefined) {\n options.push(`packed = ${this.proto.options.packed.toString()}`);\n }\n let defaultValue = this.proto.defaultValue;\n if (defaultValue !== undefined) {\n if (this.proto.type == descriptor_pb_js_1.FieldDescriptorProto_Type.BYTES ||\n this.proto.type == descriptor_pb_js_1.FieldDescriptorProto_Type.STRING) {\n defaultValue = '\"' + defaultValue.replace('\"', '\\\\\"') + '\"';\n }\n options.push(`default = ${defaultValue}`);\n }\n if (this.jsonName !== undefined) {\n options.push(`json_name = \"${this.jsonName}\"`);\n }\n if (((_b = this.proto.options) === null || _b === void 0 ? void 0 : _b.deprecated) === true) {\n options.push(`deprecated = true`);\n }\n if (options.length > 0) {\n parts.push(\"[\" + options.join(\", \") + \"]\");\n }\n return parts.join(\" \");\n}\n/**\n * Parses a text-encoded default value (proto2) of a scalar or enum field.\n */\nfunction getDefaultValue() {\n const d = this.proto.defaultValue;\n if (d === undefined) {\n return undefined;\n }\n switch (this.fieldKind) {\n case \"enum\": {\n const enumValue = this.enum.values.find((v) => v.name === d);\n (0, assert_js_1.assert)(enumValue, `cannot parse ${this.toString()} default value: ${d}`);\n return enumValue.number;\n }\n case \"scalar\":\n switch (this.scalar) {\n case field_js_1.ScalarType.STRING:\n return d;\n case field_js_1.ScalarType.BYTES: {\n const u = unescapeBytesDefaultValue(d);\n if (u === false) {\n throw new Error(`cannot parse ${this.toString()} default value: ${d}`);\n }\n return u;\n }\n case field_js_1.ScalarType.INT64:\n case field_js_1.ScalarType.SFIXED64:\n case field_js_1.ScalarType.SINT64:\n return proto_int64_js_1.protoInt64.parse(d);\n case field_js_1.ScalarType.UINT64:\n case field_js_1.ScalarType.FIXED64:\n return proto_int64_js_1.protoInt64.uParse(d);\n case field_js_1.ScalarType.DOUBLE:\n case field_js_1.ScalarType.FLOAT:\n switch (d) {\n case \"inf\":\n return Number.POSITIVE_INFINITY;\n case \"-inf\":\n return Number.NEGATIVE_INFINITY;\n case \"nan\":\n return Number.NaN;\n default:\n return parseFloat(d);\n }\n case field_js_1.ScalarType.BOOL:\n return d === \"true\";\n case field_js_1.ScalarType.INT32:\n case field_js_1.ScalarType.UINT32:\n case field_js_1.ScalarType.SINT32:\n case field_js_1.ScalarType.FIXED32:\n case field_js_1.ScalarType.SFIXED32:\n return parseInt(d, 10);\n }\n break;\n default:\n return undefined;\n }\n}\n/**\n * Parses a text-encoded default value (proto2) of a BYTES field.\n */\nfunction unescapeBytesDefaultValue(str) {\n const b = [];\n const input = {\n tail: str,\n c: \"\",\n next() {\n if (this.tail.length == 0) {\n return false;\n }\n this.c = this.tail[0];\n this.tail = this.tail.substring(1);\n return true;\n },\n take(n) {\n if (this.tail.length >= n) {\n const r = this.tail.substring(0, n);\n this.tail = this.tail.substring(n);\n return r;\n }\n return false;\n },\n };\n while (input.next()) {\n switch (input.c) {\n case \"\\\\\":\n if (input.next()) {\n switch (input.c) {\n case \"\\\\\":\n b.push(input.c.charCodeAt(0));\n break;\n case \"b\":\n b.push(0x08);\n break;\n case \"f\":\n b.push(0x0c);\n break;\n case \"n\":\n b.push(0x0a);\n break;\n case \"r\":\n b.push(0x0d);\n break;\n case \"t\":\n b.push(0x09);\n break;\n case \"v\":\n b.push(0x0b);\n break;\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\": {\n const s = input.c;\n const t = input.take(2);\n if (t === false) {\n return false;\n }\n const n = parseInt(s + t, 8);\n if (isNaN(n)) {\n return false;\n }\n b.push(n);\n break;\n }\n case \"x\": {\n const s = input.c;\n const t = input.take(2);\n if (t === false) {\n return false;\n }\n const n = parseInt(s + t, 16);\n if (isNaN(n)) {\n return false;\n }\n b.push(n);\n break;\n }\n case \"u\": {\n const s = input.c;\n const t = input.take(4);\n if (t === false) {\n return false;\n }\n const n = parseInt(s + t, 16);\n if (isNaN(n)) {\n return false;\n }\n const chunk = new Uint8Array(4);\n const view = new DataView(chunk.buffer);\n view.setInt32(0, n, true);\n b.push(chunk[0], chunk[1], chunk[2], chunk[3]);\n break;\n }\n case \"U\": {\n const s = input.c;\n const t = input.take(8);\n if (t === false) {\n return false;\n }\n const tc = proto_int64_js_1.protoInt64.uEnc(s + t);\n const chunk = new Uint8Array(8);\n const view = new DataView(chunk.buffer);\n view.setInt32(0, tc.lo, true);\n view.setInt32(4, tc.hi, true);\n b.push(chunk[0], chunk[1], chunk[2], chunk[3], chunk[4], chunk[5], chunk[6], chunk[7]);\n break;\n }\n }\n }\n break;\n default:\n b.push(input.c.charCodeAt(0));\n }\n }\n return new Uint8Array(b);\n}\n","\"use strict\";\n// Copyright 2021-2023 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createRegistryFromDescriptors = void 0;\nconst assert_js_1 = require(\"./private/assert.js\");\nconst proto3_js_1 = require(\"./proto3.js\");\nconst proto2_js_1 = require(\"./proto2.js\");\nconst names_js_1 = require(\"./private/names.js\");\nconst timestamp_pb_js_1 = require(\"./google/protobuf/timestamp_pb.js\");\nconst duration_pb_js_1 = require(\"./google/protobuf/duration_pb.js\");\nconst any_pb_js_1 = require(\"./google/protobuf/any_pb.js\");\nconst empty_pb_js_1 = require(\"./google/protobuf/empty_pb.js\");\nconst field_mask_pb_js_1 = require(\"./google/protobuf/field_mask_pb.js\");\nconst struct_pb_js_1 = require(\"./google/protobuf/struct_pb.js\");\nconst enum_js_1 = require(\"./private/enum.js\");\nconst wrappers_pb_js_1 = require(\"./google/protobuf/wrappers_pb.js\");\nconst descriptor_pb_js_1 = require(\"./google/protobuf/descriptor_pb.js\");\nconst create_descriptor_set_js_1 = require(\"./create-descriptor-set.js\");\n// well-known message types with specialized JSON representation\nconst wkMessages = [\n any_pb_js_1.Any,\n duration_pb_js_1.Duration,\n empty_pb_js_1.Empty,\n field_mask_pb_js_1.FieldMask,\n struct_pb_js_1.Struct,\n struct_pb_js_1.Value,\n struct_pb_js_1.ListValue,\n timestamp_pb_js_1.Timestamp,\n duration_pb_js_1.Duration,\n wrappers_pb_js_1.DoubleValue,\n wrappers_pb_js_1.FloatValue,\n wrappers_pb_js_1.Int64Value,\n wrappers_pb_js_1.Int32Value,\n wrappers_pb_js_1.UInt32Value,\n wrappers_pb_js_1.UInt64Value,\n wrappers_pb_js_1.BoolValue,\n wrappers_pb_js_1.StringValue,\n wrappers_pb_js_1.BytesValue,\n];\n// well-known enum types with specialized JSON representation\nconst wkEnums = [(0, enum_js_1.getEnumType)(struct_pb_js_1.NullValue)];\n/**\n * Create a registry from a set of descriptors. The types returned by this\n * registry behave exactly like types from generated code.\n *\n * This function accepts google.protobuf.FileDescriptorSet in serialized or\n * deserialized form. Alternatively, it also accepts a DescriptorSet (see\n * createDescriptorSet()).\n *\n * By default, all well-known types with a specialized JSON representation\n * are replaced with their generated counterpart in this package.\n */\nfunction createRegistryFromDescriptors(input, replaceWkt = true) {\n const set = input instanceof Uint8Array || input instanceof descriptor_pb_js_1.FileDescriptorSet\n ? (0, create_descriptor_set_js_1.createDescriptorSet)(input)\n : input;\n const enums = {};\n const messages = {};\n const services = {};\n if (replaceWkt) {\n for (const mt of wkMessages) {\n messages[mt.typeName] = mt;\n }\n for (const et of wkEnums) {\n enums[et.typeName] = et;\n }\n }\n return {\n /**\n * May raise an error on invalid descriptors.\n */\n findEnum(typeName) {\n const existing = enums[typeName];\n if (existing) {\n return existing;\n }\n const desc = set.enums.get(typeName);\n if (!desc) {\n return undefined;\n }\n const runtime = desc.file.syntax == \"proto3\" ? proto3_js_1.proto3 : proto2_js_1.proto2;\n const type = runtime.makeEnumType(typeName, desc.values.map((u) => ({\n no: u.number,\n name: u.name,\n localName: (0, names_js_1.localName)(u),\n })), {});\n enums[typeName] = type;\n return type;\n },\n /**\n * May raise an error on invalid descriptors.\n */\n findMessage(typeName) {\n const existing = messages[typeName];\n if (existing) {\n return existing;\n }\n const desc = set.messages.get(typeName);\n if (!desc) {\n return undefined;\n }\n const runtime = desc.file.syntax == \"proto3\" ? proto3_js_1.proto3 : proto2_js_1.proto2;\n const fields = [];\n const type = runtime.makeMessageType(typeName, () => fields, {\n localName: (0, names_js_1.localName)(desc),\n });\n messages[typeName] = type;\n for (const field of desc.fields) {\n const fieldInfo = makeFieldInfo(field, this);\n fields.push(fieldInfo);\n }\n return type;\n },\n /**\n * May raise an error on invalid descriptors.\n */\n findService(typeName) {\n const existing = services[typeName];\n if (existing) {\n return existing;\n }\n const desc = set.services.get(typeName);\n if (!desc) {\n return undefined;\n }\n const methods = {};\n for (const method of desc.methods) {\n const I = this.findMessage(method.input.typeName);\n const O = this.findMessage(method.output.typeName);\n (0, assert_js_1.assert)(I, `message \"${method.input.typeName}\" for ${method.toString()} not found`);\n (0, assert_js_1.assert)(O, `output message \"${method.output.typeName}\" for ${method.toString()} not found`);\n methods[(0, names_js_1.localName)(method)] = {\n name: method.name,\n I,\n O,\n kind: method.methodKind,\n idempotency: method.idempotency,\n // We do not surface options at this time\n // options: {},\n };\n }\n return (services[typeName] = {\n typeName: desc.typeName,\n methods,\n });\n },\n };\n}\nexports.createRegistryFromDescriptors = createRegistryFromDescriptors;\nfunction makeFieldInfo(desc, resolver) {\n switch (desc.fieldKind) {\n case \"map\":\n return makeMapFieldInfo(desc, resolver);\n case \"message\":\n return makeMessageFieldInfo(desc, resolver);\n case \"enum\": {\n const fi = makeEnumFieldInfo(desc, resolver);\n fi.default = desc.getDefaultValue();\n return fi;\n }\n case \"scalar\": {\n const fi = makeScalarFieldInfo(desc);\n fi.default = desc.getDefaultValue();\n return fi;\n }\n }\n}\nfunction makeMapFieldInfo(field, resolver) {\n const base = {\n kind: \"map\",\n no: field.number,\n name: field.name,\n jsonName: field.jsonName,\n K: field.mapKey,\n };\n if (field.mapValue.message) {\n const messageType = resolver.findMessage(field.mapValue.message.typeName);\n (0, assert_js_1.assert)(messageType, `message \"${field.mapValue.message.typeName}\" for ${field.toString()} not found`);\n return Object.assign(Object.assign({}, base), { V: {\n kind: \"message\",\n T: messageType,\n } });\n }\n if (field.mapValue.enum) {\n const enumType = resolver.findEnum(field.mapValue.enum.typeName);\n (0, assert_js_1.assert)(enumType, `enum \"${field.mapValue.enum.typeName}\" for ${field.toString()} not found`);\n return Object.assign(Object.assign({}, base), { V: {\n kind: \"enum\",\n T: enumType,\n } });\n }\n return Object.assign(Object.assign({}, base), { V: {\n kind: \"scalar\",\n T: field.mapValue.scalar,\n } });\n}\nfunction makeScalarFieldInfo(field) {\n const base = {\n kind: \"scalar\",\n no: field.number,\n name: field.name,\n jsonName: field.jsonName,\n T: field.scalar,\n };\n if (field.repeated) {\n return Object.assign(Object.assign({}, base), { repeated: true, packed: field.packed, oneof: undefined, T: field.scalar });\n }\n if (field.oneof) {\n return Object.assign(Object.assign({}, base), { oneof: field.oneof.name });\n }\n if (field.optional) {\n return Object.assign(Object.assign({}, base), { opt: true });\n }\n return base;\n}\nfunction makeMessageFieldInfo(field, resolver) {\n const messageType = resolver.findMessage(field.message.typeName);\n (0, assert_js_1.assert)(messageType, `message \"${field.message.typeName}\" for ${field.toString()} not found`);\n const base = {\n kind: \"message\",\n no: field.number,\n name: field.name,\n jsonName: field.jsonName,\n T: messageType,\n };\n if (field.repeated) {\n return Object.assign(Object.assign({}, base), { repeated: true, packed: field.packed, oneof: undefined });\n }\n if (field.oneof) {\n return Object.assign(Object.assign({}, base), { oneof: field.oneof.name });\n }\n if (field.optional) {\n return Object.assign(Object.assign({}, base), { opt: true });\n }\n return base;\n}\nfunction makeEnumFieldInfo(field, resolver) {\n const enumType = resolver.findEnum(field.enum.typeName);\n (0, assert_js_1.assert)(enumType, `enum \"${field.enum.typeName}\" for ${field.toString()} not found`);\n const base = {\n kind: \"enum\",\n no: field.number,\n name: field.name,\n jsonName: field.jsonName,\n T: enumType,\n };\n if (field.repeated) {\n return Object.assign(Object.assign({}, base), { repeated: true, packed: field.packed, oneof: undefined });\n }\n if (field.oneof) {\n return Object.assign(Object.assign({}, base), { oneof: field.oneof.name });\n }\n if (field.optional) {\n return Object.assign(Object.assign({}, base), { opt: true });\n }\n return base;\n}\n","\"use strict\";\n// Copyright 2021-2023 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createRegistry = void 0;\n/**\n * Create a new registry from the given types.\n */\nfunction createRegistry(...types) {\n const messages = {};\n const enums = {};\n const services = {};\n const registry = {\n /**\n * Add a type to the registry. For messages, the types used in message\n * fields are added recursively. For services, the message types used\n * for requests and responses are added recursively.\n */\n add(type) {\n if (\"fields\" in type) {\n if (!this.findMessage(type.typeName)) {\n messages[type.typeName] = type;\n for (const field of type.fields.list()) {\n if (field.kind == \"message\") {\n this.add(field.T);\n }\n else if (field.kind == \"map\" && field.V.kind == \"message\") {\n this.add(field.V.T);\n }\n else if (field.kind == \"enum\") {\n this.add(field.T);\n }\n }\n }\n }\n else if (\"methods\" in type) {\n if (!this.findService(type.typeName)) {\n services[type.typeName] = type;\n for (const method of Object.values(type.methods)) {\n this.add(method.I);\n this.add(method.O);\n }\n }\n }\n else {\n enums[type.typeName] = type;\n }\n },\n findMessage(typeName) {\n return messages[typeName];\n },\n findEnum(typeName) {\n return enums[typeName];\n },\n findService(typeName) {\n return services[typeName];\n },\n };\n for (const type of types) {\n registry.add(type);\n }\n return registry;\n}\nexports.createRegistry = createRegistry;\n","\"use strict\";\n// Copyright 2021-2023 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ScalarType = void 0;\n/**\n * Scalar value types. This is a subset of field types declared by protobuf\n * enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE\n * are omitted, but the numerical values are identical.\n */\nvar ScalarType;\n(function (ScalarType) {\n // 0 is reserved for errors.\n // Order is weird for historical reasons.\n ScalarType[ScalarType[\"DOUBLE\"] = 1] = \"DOUBLE\";\n ScalarType[ScalarType[\"FLOAT\"] = 2] = \"FLOAT\";\n // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if\n // negative values are likely.\n ScalarType[ScalarType[\"INT64\"] = 3] = \"INT64\";\n ScalarType[ScalarType[\"UINT64\"] = 4] = \"UINT64\";\n // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if\n // negative values are likely.\n ScalarType[ScalarType[\"INT32\"] = 5] = \"INT32\";\n ScalarType[ScalarType[\"FIXED64\"] = 6] = \"FIXED64\";\n ScalarType[ScalarType[\"FIXED32\"] = 7] = \"FIXED32\";\n ScalarType[ScalarType[\"BOOL\"] = 8] = \"BOOL\";\n ScalarType[ScalarType[\"STRING\"] = 9] = \"STRING\";\n // Tag-delimited aggregate.\n // Group type is deprecated and not supported in proto3. However, Proto3\n // implementations should still be able to parse the group wire format and\n // treat group fields as unknown fields.\n // TYPE_GROUP = 10,\n // TYPE_MESSAGE = 11, // Length-delimited aggregate.\n // New in version 2.\n ScalarType[ScalarType[\"BYTES\"] = 12] = \"BYTES\";\n ScalarType[ScalarType[\"UINT32\"] = 13] = \"UINT32\";\n // TYPE_ENUM = 14,\n ScalarType[ScalarType[\"SFIXED32\"] = 15] = \"SFIXED32\";\n ScalarType[ScalarType[\"SFIXED64\"] = 16] = \"SFIXED64\";\n ScalarType[ScalarType[\"SINT32\"] = 17] = \"SINT32\";\n ScalarType[ScalarType[\"SINT64\"] = 18] = \"SINT64\";\n})(ScalarType || (exports.ScalarType = ScalarType = {}));\n","\"use strict\";\n// Copyright 2021-2023 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Any = void 0;\nconst message_js_1 = require(\"../../message.js\");\nconst proto3_js_1 = require(\"../../proto3.js\");\n/**\n * `Any` contains an arbitrary serialized protocol buffer message along with a\n * URL that describes the type of the serialized message.\n *\n * Protobuf library provides support to pack/unpack Any values in the form\n * of utility functions or additional generated methods of the Any type.\n *\n * Example 1: Pack and unpack a message in C++.\n *\n * Foo foo = ...;\n * Any any;\n * any.PackFrom(foo);\n * ...\n * if (any.UnpackTo(&foo)) {\n * ...\n * }\n *\n * Example 2: Pack and unpack a message in Java.\n *\n * Foo foo = ...;\n * Any any = Any.pack(foo);\n * ...\n * if (any.is(Foo.class)) {\n * foo = any.unpack(Foo.class);\n * }\n * // or ...\n * if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n * foo = any.unpack(Foo.getDefaultInstance());\n * }\n *\n * Example 3: Pack and unpack a message in Python.\n *\n * foo = Foo(...)\n * any = Any()\n * any.Pack(foo)\n * ...\n * if any.Is(Foo.DESCRIPTOR):\n * any.Unpack(foo)\n * ...\n *\n * Example 4: Pack and unpack a message in Go\n *\n * foo := &pb.Foo{...}\n * any, err := anypb.New(foo)\n * if err != nil {\n * ...\n * }\n * ...\n * foo := &pb.Foo{}\n * if err := any.UnmarshalTo(foo); err != nil {\n * ...\n * }\n *\n * The pack methods provided by protobuf library will by default use\n * 'type.googleapis.com/full.type.name' as the type URL and the unpack\n * methods only use the fully qualified type name after the last '/'\n * in the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n * name \"y.z\".\n *\n * JSON\n * ====\n * The JSON representation of an `Any` value uses the regular\n * representation of the deserialized, embedded message, with an\n * additional field `@type` which contains the type URL. Example:\n *\n * package google.profile;\n * message Person {\n * string first_name = 1;\n * string last_name = 2;\n * }\n *\n * {\n * \"@type\": \"type.googleapis.com/google.profile.Person\",\n * \"firstName\":