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","//\n\nmodule.exports = function shallowEqual(objA, objB, compare, compareContext) {\n var ret = compare ? compare.call(compareContext, objA, objB) : void 0;\n\n if (ret !== void 0) {\n return !!ret;\n }\n\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== \"object\" || !objA || typeof objB !== \"object\" || !objB) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n\n // Test for A's keys different from B.\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key)) {\n return false;\n }\n\n var valueA = objA[key];\n var valueB = objB[key];\n\n ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\n\n if (ret === false || (ret === void 0 && valueA !== valueB)) {\n return false;\n }\n }\n\n return true;\n};\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","module.exports = require('./dist').YAML\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\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, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\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\n return obj;\n}\n\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\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _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\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (_isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nfunction _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !_isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _toArray(arr) {\n return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\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}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _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}\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) {\n var it;\n\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n\n var F = function () {};\n\n return {\n s: F,\n n: function () {\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) {\n throw e;\n },\n f: F\n };\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\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function () {\n it = o[Symbol.iterator]();\n },\n n: function () {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function (e) {\n didErr = true;\n err = e;\n },\n f: function () {\n try {\n if (!normalCompletion && it.return != null) it.return();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}\n\nvar Char = {\n ANCHOR: '&',\n COMMENT: '#',\n TAG: '!',\n DIRECTIVES_END: '-',\n DOCUMENT_END: '.'\n};\nvar Type = {\n ALIAS: 'ALIAS',\n BLANK_LINE: 'BLANK_LINE',\n BLOCK_FOLDED: 'BLOCK_FOLDED',\n BLOCK_LITERAL: 'BLOCK_LITERAL',\n COMMENT: 'COMMENT',\n DIRECTIVE: 'DIRECTIVE',\n DOCUMENT: 'DOCUMENT',\n FLOW_MAP: 'FLOW_MAP',\n FLOW_SEQ: 'FLOW_SEQ',\n MAP: 'MAP',\n MAP_KEY: 'MAP_KEY',\n MAP_VALUE: 'MAP_VALUE',\n PLAIN: 'PLAIN',\n QUOTE_DOUBLE: 'QUOTE_DOUBLE',\n QUOTE_SINGLE: 'QUOTE_SINGLE',\n SEQ: 'SEQ',\n SEQ_ITEM: 'SEQ_ITEM'\n};\nvar defaultTagPrefix = 'tag:yaml.org,2002:';\nvar defaultTags = {\n MAP: 'tag:yaml.org,2002:map',\n SEQ: 'tag:yaml.org,2002:seq',\n STR: 'tag:yaml.org,2002:str'\n};\n\nfunction findLineStarts(src) {\n var ls = [0];\n var offset = src.indexOf('\\n');\n\n while (offset !== -1) {\n offset += 1;\n ls.push(offset);\n offset = src.indexOf('\\n', offset);\n }\n\n return ls;\n}\n\nfunction getSrcInfo(cst) {\n var lineStarts, src;\n\n if (typeof cst === 'string') {\n lineStarts = findLineStarts(cst);\n src = cst;\n } else {\n if (Array.isArray(cst)) cst = cst[0];\n\n if (cst && cst.context) {\n if (!cst.lineStarts) cst.lineStarts = findLineStarts(cst.context.src);\n lineStarts = cst.lineStarts;\n src = cst.context.src;\n }\n }\n\n return {\n lineStarts: lineStarts,\n src: src\n };\n}\n/**\n * @typedef {Object} LinePos - One-indexed position in the source\n * @property {number} line\n * @property {number} col\n */\n\n/**\n * Determine the line/col position matching a character offset.\n *\n * Accepts a source string or a CST document as the second parameter. With\n * the latter, starting indices for lines are cached in the document as\n * `lineStarts: number[]`.\n *\n * Returns a one-indexed `{ line, col }` location if found, or\n * `undefined` otherwise.\n *\n * @param {number} offset\n * @param {string|Document|Document[]} cst\n * @returns {?LinePos}\n */\n\n\nfunction getLinePos(offset, cst) {\n if (typeof offset !== 'number' || offset < 0) return null;\n\n var _getSrcInfo = getSrcInfo(cst),\n lineStarts = _getSrcInfo.lineStarts,\n src = _getSrcInfo.src;\n\n if (!lineStarts || !src || offset > src.length) return null;\n\n for (var i = 0; i < lineStarts.length; ++i) {\n var start = lineStarts[i];\n\n if (offset < start) {\n return {\n line: i,\n col: offset - lineStarts[i - 1] + 1\n };\n }\n\n if (offset === start) return {\n line: i + 1,\n col: 1\n };\n }\n\n var line = lineStarts.length;\n return {\n line: line,\n col: offset - lineStarts[line - 1] + 1\n };\n}\n/**\n * Get a specified line from the source.\n *\n * Accepts a source string or a CST document as the second parameter. With\n * the latter, starting indices for lines are cached in the document as\n * `lineStarts: number[]`.\n *\n * Returns the line as a string if found, or `null` otherwise.\n *\n * @param {number} line One-indexed line number\n * @param {string|Document|Document[]} cst\n * @returns {?string}\n */\n\nfunction getLine(line, cst) {\n var _getSrcInfo2 = getSrcInfo(cst),\n lineStarts = _getSrcInfo2.lineStarts,\n src = _getSrcInfo2.src;\n\n if (!lineStarts || !(line >= 1) || line > lineStarts.length) return null;\n var start = lineStarts[line - 1];\n var end = lineStarts[line]; // undefined for last line; that's ok for slice()\n\n while (end && end > start && src[end - 1] === '\\n') {\n --end;\n }\n\n return src.slice(start, end);\n}\n/**\n * Pretty-print the starting line from the source indicated by the range `pos`\n *\n * Trims output to `maxWidth` chars while keeping the starting column visible,\n * using `…` at either end to indicate dropped characters.\n *\n * Returns a two-line string (or `null`) with `\\n` as separator; the second line\n * will hold appropriately indented `^` marks indicating the column range.\n *\n * @param {Object} pos\n * @param {LinePos} pos.start\n * @param {LinePos} [pos.end]\n * @param {string|Document|Document[]*} cst\n * @param {number} [maxWidth=80]\n * @returns {?string}\n */\n\nfunction getPrettyContext(_ref, cst) {\n var start = _ref.start,\n end = _ref.end;\n var maxWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 80;\n var src = getLine(start.line, cst);\n if (!src) return null;\n var col = start.col;\n\n if (src.length > maxWidth) {\n if (col <= maxWidth - 10) {\n src = src.substr(0, maxWidth - 1) + '…';\n } else {\n var halfWidth = Math.round(maxWidth / 2);\n if (src.length > col + halfWidth) src = src.substr(0, col + halfWidth - 1) + '…';\n col -= src.length - maxWidth;\n src = '…' + src.substr(1 - maxWidth);\n }\n }\n\n var errLen = 1;\n var errEnd = '';\n\n if (end) {\n if (end.line === start.line && col + (end.col - start.col) <= maxWidth + 1) {\n errLen = end.col - start.col;\n } else {\n errLen = Math.min(src.length + 1, maxWidth) - col;\n errEnd = '…';\n }\n }\n\n var offset = col > 1 ? ' '.repeat(col - 1) : '';\n var err = '^'.repeat(errLen);\n return \"\".concat(src, \"\\n\").concat(offset).concat(err).concat(errEnd);\n}\n\nvar Range = /*#__PURE__*/function () {\n function Range(start, end) {\n _classCallCheck(this, Range);\n\n this.start = start;\n this.end = end || start;\n }\n\n _createClass(Range, [{\n key: \"isEmpty\",\n value: function isEmpty() {\n return typeof this.start !== 'number' || !this.end || this.end <= this.start;\n }\n /**\n * Set `origStart` and `origEnd` to point to the original source range for\n * this node, which may differ due to dropped CR characters.\n *\n * @param {number[]} cr - Positions of dropped CR characters\n * @param {number} offset - Starting index of `cr` from the last call\n * @returns {number} - The next offset, matching the one found for `origStart`\n */\n\n }, {\n key: \"setOrigRange\",\n value: function setOrigRange(cr, offset) {\n var start = this.start,\n end = this.end;\n\n if (cr.length === 0 || end <= cr[0]) {\n this.origStart = start;\n this.origEnd = end;\n return offset;\n }\n\n var i = offset;\n\n while (i < cr.length) {\n if (cr[i] > start) break;else ++i;\n }\n\n this.origStart = start + i;\n var nextOffset = i;\n\n while (i < cr.length) {\n // if end was at \\n, it should now be at \\r\n if (cr[i] >= end) break;else ++i;\n }\n\n this.origEnd = end + i;\n return nextOffset;\n }\n }], [{\n key: \"copy\",\n value: function copy(orig) {\n return new Range(orig.start, orig.end);\n }\n }]);\n\n return Range;\n}();\n\n/** Root class of all nodes */\n\nvar Node = /*#__PURE__*/function () {\n function Node(type, props, context) {\n _classCallCheck(this, Node);\n\n Object.defineProperty(this, 'context', {\n value: context || null,\n writable: true\n });\n this.error = null;\n this.range = null;\n this.valueRange = null;\n this.props = props || [];\n this.type = type;\n this.value = null;\n }\n\n _createClass(Node, [{\n key: \"getPropValue\",\n value: function getPropValue(idx, key, skipKey) {\n if (!this.context) return null;\n var src = this.context.src;\n var prop = this.props[idx];\n return prop && src[prop.start] === key ? src.slice(prop.start + (skipKey ? 1 : 0), prop.end) : null;\n }\n }, {\n key: \"anchor\",\n get: function get() {\n for (var i = 0; i < this.props.length; ++i) {\n var anchor = this.getPropValue(i, Char.ANCHOR, true);\n if (anchor != null) return anchor;\n }\n\n return null;\n }\n }, {\n key: \"comment\",\n get: function get() {\n var comments = [];\n\n for (var i = 0; i < this.props.length; ++i) {\n var comment = this.getPropValue(i, Char.COMMENT, true);\n if (comment != null) comments.push(comment);\n }\n\n return comments.length > 0 ? comments.join('\\n') : null;\n }\n }, {\n key: \"commentHasRequiredWhitespace\",\n value: function commentHasRequiredWhitespace(start) {\n var src = this.context.src;\n if (this.header && start === this.header.end) return false;\n if (!this.valueRange) return false;\n var end = this.valueRange.end;\n return start !== end || Node.atBlank(src, end - 1);\n }\n }, {\n key: \"hasComment\",\n get: function get() {\n if (this.context) {\n var src = this.context.src;\n\n for (var i = 0; i < this.props.length; ++i) {\n if (src[this.props[i].start] === Char.COMMENT) return true;\n }\n }\n\n return false;\n }\n }, {\n key: \"hasProps\",\n get: function get() {\n if (this.context) {\n var src = this.context.src;\n\n for (var i = 0; i < this.props.length; ++i) {\n if (src[this.props[i].start] !== Char.COMMENT) return true;\n }\n }\n\n return false;\n }\n }, {\n key: \"includesTrailingLines\",\n get: function get() {\n return false;\n }\n }, {\n key: \"jsonLike\",\n get: function get() {\n var jsonLikeTypes = [Type.FLOW_MAP, Type.FLOW_SEQ, Type.QUOTE_DOUBLE, Type.QUOTE_SINGLE];\n return jsonLikeTypes.indexOf(this.type) !== -1;\n }\n }, {\n key: \"rangeAsLinePos\",\n get: function get() {\n if (!this.range || !this.context) return undefined;\n var start = getLinePos(this.range.start, this.context.root);\n if (!start) return undefined;\n var end = getLinePos(this.range.end, this.context.root);\n return {\n start: start,\n end: end\n };\n }\n }, {\n key: \"rawValue\",\n get: function get() {\n if (!this.valueRange || !this.context) return null;\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n return this.context.src.slice(start, end);\n }\n }, {\n key: \"tag\",\n get: function get() {\n for (var i = 0; i < this.props.length; ++i) {\n var tag = this.getPropValue(i, Char.TAG, false);\n\n if (tag != null) {\n if (tag[1] === '<') {\n return {\n verbatim: tag.slice(2, -1)\n };\n } else {\n // eslint-disable-next-line no-unused-vars\n var _tag$match = tag.match(/^(.*!)([^!]*)$/),\n _tag$match2 = _slicedToArray(_tag$match, 3);\n _tag$match2[0];\n var handle = _tag$match2[1],\n suffix = _tag$match2[2];\n\n return {\n handle: handle,\n suffix: suffix\n };\n }\n }\n }\n\n return null;\n }\n }, {\n key: \"valueRangeContainsNewline\",\n get: function get() {\n if (!this.valueRange || !this.context) return false;\n var _this$valueRange2 = this.valueRange,\n start = _this$valueRange2.start,\n end = _this$valueRange2.end;\n var src = this.context.src;\n\n for (var i = start; i < end; ++i) {\n if (src[i] === '\\n') return true;\n }\n\n return false;\n }\n }, {\n key: \"parseComment\",\n value: function parseComment(start) {\n var src = this.context.src;\n\n if (src[start] === Char.COMMENT) {\n var end = Node.endOfLine(src, start + 1);\n var commentRange = new Range(start, end);\n this.props.push(commentRange);\n return end;\n }\n\n return start;\n }\n /**\n * Populates the `origStart` and `origEnd` values of all ranges for this\n * node. Extended by child classes to handle descendant nodes.\n *\n * @param {number[]} cr - Positions of dropped CR characters\n * @param {number} offset - Starting index of `cr` from the last call\n * @returns {number} - The next offset, matching the one found for `origStart`\n */\n\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n if (this.range) offset = this.range.setOrigRange(cr, offset);\n if (this.valueRange) this.valueRange.setOrigRange(cr, offset);\n this.props.forEach(function (prop) {\n return prop.setOrigRange(cr, offset);\n });\n return offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var src = this.context.src,\n range = this.range,\n value = this.value;\n if (value != null) return value;\n var str = src.slice(range.start, range.end);\n return Node.addStringTerminator(src, range.end, str);\n }\n }], [{\n key: \"addStringTerminator\",\n value: function addStringTerminator(src, offset, str) {\n if (str[str.length - 1] === '\\n') return str;\n var next = Node.endOfWhiteSpace(src, offset);\n return next >= src.length || src[next] === '\\n' ? str + '\\n' : str;\n } // ^(---|...)\n\n }, {\n key: \"atDocumentBoundary\",\n value: function atDocumentBoundary(src, offset, sep) {\n var ch0 = src[offset];\n if (!ch0) return true;\n var prev = src[offset - 1];\n if (prev && prev !== '\\n') return false;\n\n if (sep) {\n if (ch0 !== sep) return false;\n } else {\n if (ch0 !== Char.DIRECTIVES_END && ch0 !== Char.DOCUMENT_END) return false;\n }\n\n var ch1 = src[offset + 1];\n var ch2 = src[offset + 2];\n if (ch1 !== ch0 || ch2 !== ch0) return false;\n var ch3 = src[offset + 3];\n return !ch3 || ch3 === '\\n' || ch3 === '\\t' || ch3 === ' ';\n }\n }, {\n key: \"endOfIdentifier\",\n value: function endOfIdentifier(src, offset) {\n var ch = src[offset];\n var isVerbatim = ch === '<';\n var notOk = isVerbatim ? ['\\n', '\\t', ' ', '>'] : ['\\n', '\\t', ' ', '[', ']', '{', '}', ','];\n\n while (ch && notOk.indexOf(ch) === -1) {\n ch = src[offset += 1];\n }\n\n if (isVerbatim && ch === '>') offset += 1;\n return offset;\n }\n }, {\n key: \"endOfIndent\",\n value: function endOfIndent(src, offset) {\n var ch = src[offset];\n\n while (ch === ' ') {\n ch = src[offset += 1];\n }\n\n return offset;\n }\n }, {\n key: \"endOfLine\",\n value: function endOfLine(src, offset) {\n var ch = src[offset];\n\n while (ch && ch !== '\\n') {\n ch = src[offset += 1];\n }\n\n return offset;\n }\n }, {\n key: \"endOfWhiteSpace\",\n value: function endOfWhiteSpace(src, offset) {\n var ch = src[offset];\n\n while (ch === '\\t' || ch === ' ') {\n ch = src[offset += 1];\n }\n\n return offset;\n }\n }, {\n key: \"startOfLine\",\n value: function startOfLine(src, offset) {\n var ch = src[offset - 1];\n if (ch === '\\n') return offset;\n\n while (ch && ch !== '\\n') {\n ch = src[offset -= 1];\n }\n\n return offset + 1;\n }\n /**\n * End of indentation, or null if the line's indent level is not more\n * than `indent`\n *\n * @param {string} src\n * @param {number} indent\n * @param {number} lineStart\n * @returns {?number}\n */\n\n }, {\n key: \"endOfBlockIndent\",\n value: function endOfBlockIndent(src, indent, lineStart) {\n var inEnd = Node.endOfIndent(src, lineStart);\n\n if (inEnd > lineStart + indent) {\n return inEnd;\n } else {\n var wsEnd = Node.endOfWhiteSpace(src, inEnd);\n var ch = src[wsEnd];\n if (!ch || ch === '\\n') return wsEnd;\n }\n\n return null;\n }\n }, {\n key: \"atBlank\",\n value: function atBlank(src, offset, endAsBlank) {\n var ch = src[offset];\n return ch === '\\n' || ch === '\\t' || ch === ' ' || endAsBlank && !ch;\n }\n }, {\n key: \"nextNodeIsIndented\",\n value: function nextNodeIsIndented(ch, indentDiff, indicatorAsIndent) {\n if (!ch || indentDiff < 0) return false;\n if (indentDiff > 0) return true;\n return indicatorAsIndent && ch === '-';\n } // should be at line or string end, or at next non-whitespace char\n\n }, {\n key: \"normalizeOffset\",\n value: function normalizeOffset(src, offset) {\n var ch = src[offset];\n return !ch ? offset : ch !== '\\n' && src[offset - 1] === '\\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);\n } // fold single newline into space, multiple newlines to N - 1 newlines\n // presumes src[offset] === '\\n'\n\n }, {\n key: \"foldNewline\",\n value: function foldNewline(src, offset, indent) {\n var inCount = 0;\n var error = false;\n var fold = '';\n var ch = src[offset + 1];\n\n while (ch === ' ' || ch === '\\t' || ch === '\\n') {\n switch (ch) {\n case '\\n':\n inCount = 0;\n offset += 1;\n fold += '\\n';\n break;\n\n case '\\t':\n if (inCount <= indent) error = true;\n offset = Node.endOfWhiteSpace(src, offset + 2) - 1;\n break;\n\n case ' ':\n inCount += 1;\n offset += 1;\n break;\n }\n\n ch = src[offset + 1];\n }\n\n if (!fold) fold = ' ';\n if (ch && inCount <= indent) error = true;\n return {\n fold: fold,\n offset: offset,\n error: error\n };\n }\n }]);\n\n return Node;\n}();\n\nvar YAMLError = /*#__PURE__*/function (_Error) {\n _inherits(YAMLError, _Error);\n\n var _super = _createSuper(YAMLError);\n\n function YAMLError(name, source, message) {\n var _this;\n\n _classCallCheck(this, YAMLError);\n\n if (!message || !(source instanceof Node)) throw new Error(\"Invalid arguments for new \".concat(name));\n _this = _super.call(this);\n _this.name = name;\n _this.message = message;\n _this.source = source;\n return _this;\n }\n\n _createClass(YAMLError, [{\n key: \"makePretty\",\n value: function makePretty() {\n if (!this.source) return;\n this.nodeType = this.source.type;\n var cst = this.source.context && this.source.context.root;\n\n if (typeof this.offset === 'number') {\n this.range = new Range(this.offset, this.offset + 1);\n var start = cst && getLinePos(this.offset, cst);\n\n if (start) {\n var end = {\n line: start.line,\n col: start.col + 1\n };\n this.linePos = {\n start: start,\n end: end\n };\n }\n\n delete this.offset;\n } else {\n this.range = this.source.range;\n this.linePos = this.source.rangeAsLinePos;\n }\n\n if (this.linePos) {\n var _this$linePos$start = this.linePos.start,\n line = _this$linePos$start.line,\n col = _this$linePos$start.col;\n this.message += \" at line \".concat(line, \", column \").concat(col);\n var ctx = cst && getPrettyContext(this.linePos, cst);\n if (ctx) this.message += \":\\n\\n\".concat(ctx, \"\\n\");\n }\n\n delete this.source;\n }\n }]);\n\n return YAMLError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\nvar YAMLReferenceError = /*#__PURE__*/function (_YAMLError) {\n _inherits(YAMLReferenceError, _YAMLError);\n\n var _super2 = _createSuper(YAMLReferenceError);\n\n function YAMLReferenceError(source, message) {\n _classCallCheck(this, YAMLReferenceError);\n\n return _super2.call(this, 'YAMLReferenceError', source, message);\n }\n\n return YAMLReferenceError;\n}(YAMLError);\nvar YAMLSemanticError = /*#__PURE__*/function (_YAMLError2) {\n _inherits(YAMLSemanticError, _YAMLError2);\n\n var _super3 = _createSuper(YAMLSemanticError);\n\n function YAMLSemanticError(source, message) {\n _classCallCheck(this, YAMLSemanticError);\n\n return _super3.call(this, 'YAMLSemanticError', source, message);\n }\n\n return YAMLSemanticError;\n}(YAMLError);\nvar YAMLSyntaxError = /*#__PURE__*/function (_YAMLError3) {\n _inherits(YAMLSyntaxError, _YAMLError3);\n\n var _super4 = _createSuper(YAMLSyntaxError);\n\n function YAMLSyntaxError(source, message) {\n _classCallCheck(this, YAMLSyntaxError);\n\n return _super4.call(this, 'YAMLSyntaxError', source, message);\n }\n\n return YAMLSyntaxError;\n}(YAMLError);\nvar YAMLWarning = /*#__PURE__*/function (_YAMLError4) {\n _inherits(YAMLWarning, _YAMLError4);\n\n var _super5 = _createSuper(YAMLWarning);\n\n function YAMLWarning(source, message) {\n _classCallCheck(this, YAMLWarning);\n\n return _super5.call(this, 'YAMLWarning', source, message);\n }\n\n return YAMLWarning;\n}(YAMLError);\n\nvar PlainValue = /*#__PURE__*/function (_Node) {\n _inherits(PlainValue, _Node);\n\n var _super = _createSuper(PlainValue);\n\n function PlainValue() {\n _classCallCheck(this, PlainValue);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(PlainValue, [{\n key: \"strValue\",\n get: function get() {\n if (!this.valueRange || !this.context) return null;\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n var src = this.context.src;\n var ch = src[end - 1];\n\n while (start < end && (ch === '\\n' || ch === '\\t' || ch === ' ')) {\n ch = src[--end - 1];\n }\n\n var str = '';\n\n for (var i = start; i < end; ++i) {\n var _ch = src[i];\n\n if (_ch === '\\n') {\n var _Node$foldNewline = Node.foldNewline(src, i, -1),\n fold = _Node$foldNewline.fold,\n offset = _Node$foldNewline.offset;\n\n str += fold;\n i = offset;\n } else if (_ch === ' ' || _ch === '\\t') {\n // trim trailing whitespace\n var wsStart = i;\n var next = src[i + 1];\n\n while (i < end && (next === ' ' || next === '\\t')) {\n i += 1;\n next = src[i + 1];\n }\n\n if (next !== '\\n') str += i > wsStart ? src.slice(wsStart, i + 1) : _ch;\n } else {\n str += _ch;\n }\n }\n\n var ch0 = src[start];\n\n switch (ch0) {\n case '\\t':\n {\n var msg = 'Plain value cannot start with a tab character';\n var errors = [new YAMLSemanticError(this, msg)];\n return {\n errors: errors,\n str: str\n };\n }\n\n case '@':\n case '`':\n {\n var _msg = \"Plain value cannot start with reserved character \".concat(ch0);\n\n var _errors = [new YAMLSemanticError(this, _msg)];\n return {\n errors: _errors,\n str: str\n };\n }\n\n default:\n return str;\n }\n }\n }, {\n key: \"parseBlockValue\",\n value: function parseBlockValue(start) {\n var _this$context = this.context,\n indent = _this$context.indent,\n inFlow = _this$context.inFlow,\n src = _this$context.src;\n var offset = start;\n var valueEnd = start;\n\n for (var ch = src[offset]; ch === '\\n'; ch = src[offset]) {\n if (Node.atDocumentBoundary(src, offset + 1)) break;\n var end = Node.endOfBlockIndent(src, indent, offset + 1);\n if (end === null || src[end] === '#') break;\n\n if (src[end] === '\\n') {\n offset = end;\n } else {\n valueEnd = PlainValue.endOfLine(src, end, inFlow);\n offset = valueEnd;\n }\n }\n\n if (this.valueRange.isEmpty()) this.valueRange.start = start;\n this.valueRange.end = valueEnd;\n return valueEnd;\n }\n /**\n * Parses a plain value from the source\n *\n * Accepted forms are:\n * ```\n * #comment\n *\n * first line\n *\n * first line #comment\n *\n * first line\n * block\n * lines\n *\n * #comment\n * block\n * lines\n * ```\n * where block lines are empty or have an indent level greater than `indent`.\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar, may be `\\n`\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var inFlow = context.inFlow,\n src = context.src;\n var offset = start;\n var ch = src[offset];\n\n if (ch && ch !== '#' && ch !== '\\n') {\n offset = PlainValue.endOfLine(src, start, inFlow);\n }\n\n this.valueRange = new Range(start, offset);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n\n if (!this.hasComment || this.valueRange.isEmpty()) {\n offset = this.parseBlockValue(offset);\n }\n\n return offset;\n }\n }], [{\n key: \"endOfLine\",\n value: function endOfLine(src, start, inFlow) {\n var ch = src[start];\n var offset = start;\n\n while (ch && ch !== '\\n') {\n if (inFlow && (ch === '[' || ch === ']' || ch === '{' || ch === '}' || ch === ',')) break;\n var next = src[offset + 1];\n if (ch === ':' && (!next || next === '\\n' || next === '\\t' || next === ' ' || inFlow && next === ',')) break;\n if ((ch === ' ' || ch === '\\t') && next === '#') break;\n offset += 1;\n ch = next;\n }\n\n return offset;\n }\n }]);\n\n return PlainValue;\n}(Node);\n\nexport { Char as C, Node as N, PlainValue as P, Range as R, Type as T, YAMLSyntaxError as Y, _createForOfIteratorHelper as _, _typeof as a, _createClass as b, _classCallCheck as c, defaultTagPrefix as d, _defineProperty as e, YAMLWarning as f, YAMLSemanticError as g, _slicedToArray as h, YAMLError as i, _inherits as j, _createSuper as k, _get as l, _getPrototypeOf as m, defaultTags as n, YAMLReferenceError as o, _assertThisInitialized as p, _toArray as q, _possibleConstructorReturn as r };\n","import { j as _inherits, k as _createSuper, c as _classCallCheck, T as Type, b as _createClass, R as Range, N as Node, g as YAMLSemanticError, l as _get, m as _getPrototypeOf, Y as YAMLSyntaxError, C as Char, e as _defineProperty, P as PlainValue } from './PlainValue-b8036b75.js';\n\nvar BlankLine = /*#__PURE__*/function (_Node) {\n _inherits(BlankLine, _Node);\n\n var _super = _createSuper(BlankLine);\n\n function BlankLine() {\n _classCallCheck(this, BlankLine);\n\n return _super.call(this, Type.BLANK_LINE);\n }\n /* istanbul ignore next */\n\n\n _createClass(BlankLine, [{\n key: \"includesTrailingLines\",\n get: function get() {\n // This is never called from anywhere, but if it were,\n // this is the value it should return.\n return true;\n }\n /**\n * Parses a blank line from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first \\n character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n this.range = new Range(start, start + 1);\n return start + 1;\n }\n }]);\n\n return BlankLine;\n}(Node);\n\nvar CollectionItem = /*#__PURE__*/function (_Node) {\n _inherits(CollectionItem, _Node);\n\n var _super = _createSuper(CollectionItem);\n\n function CollectionItem(type, props) {\n var _this;\n\n _classCallCheck(this, CollectionItem);\n\n _this = _super.call(this, type, props);\n _this.node = null;\n return _this;\n }\n\n _createClass(CollectionItem, [{\n key: \"includesTrailingLines\",\n get: function get() {\n return !!this.node && this.node.includesTrailingLines;\n }\n /**\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var parseNode = context.parseNode,\n src = context.src;\n var atLineStart = context.atLineStart,\n lineStart = context.lineStart;\n if (!atLineStart && this.type === Type.SEQ_ITEM) this.error = new YAMLSemanticError(this, 'Sequence items must not have preceding content on the same line');\n var indent = atLineStart ? start - lineStart : context.indent;\n var offset = Node.endOfWhiteSpace(src, start + 1);\n var ch = src[offset];\n var inlineComment = ch === '#';\n var comments = [];\n var blankLine = null;\n\n while (ch === '\\n' || ch === '#') {\n if (ch === '#') {\n var _end = Node.endOfLine(src, offset + 1);\n\n comments.push(new Range(offset, _end));\n offset = _end;\n } else {\n atLineStart = true;\n lineStart = offset + 1;\n var wsEnd = Node.endOfWhiteSpace(src, lineStart);\n\n if (src[wsEnd] === '\\n' && comments.length === 0) {\n blankLine = new BlankLine();\n lineStart = blankLine.parse({\n src: src\n }, lineStart);\n }\n\n offset = Node.endOfIndent(src, lineStart);\n }\n\n ch = src[offset];\n }\n\n if (Node.nextNodeIsIndented(ch, offset - (lineStart + indent), this.type !== Type.SEQ_ITEM)) {\n this.node = parseNode({\n atLineStart: atLineStart,\n inCollection: false,\n indent: indent,\n lineStart: lineStart,\n parent: this\n }, offset);\n } else if (ch && lineStart > start + 1) {\n offset = lineStart - 1;\n }\n\n if (this.node) {\n if (blankLine) {\n // Only blank lines preceding non-empty nodes are captured. Note that\n // this means that collection item range start indices do not always\n // increase monotonically. -- eemeli/yaml#126\n var items = context.parent.items || context.parent.contents;\n if (items) items.push(blankLine);\n }\n\n if (comments.length) Array.prototype.push.apply(this.props, comments);\n offset = this.node.range.end;\n } else {\n if (inlineComment) {\n var c = comments[0];\n this.props.push(c);\n offset = c.end;\n } else {\n offset = Node.endOfLine(src, start + 1);\n }\n }\n\n var end = this.node ? this.node.valueRange.end : offset;\n this.valueRange = new Range(start, end);\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(CollectionItem.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n return this.node ? this.node.setOrigRanges(cr, offset) : offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var src = this.context.src,\n node = this.node,\n range = this.range,\n value = this.value;\n if (value != null) return value;\n var str = node ? src.slice(range.start, node.range.start) + String(node) : src.slice(range.start, range.end);\n return Node.addStringTerminator(src, range.end, str);\n }\n }]);\n\n return CollectionItem;\n}(Node);\n\nvar Comment = /*#__PURE__*/function (_Node) {\n _inherits(Comment, _Node);\n\n var _super = _createSuper(Comment);\n\n function Comment() {\n _classCallCheck(this, Comment);\n\n return _super.call(this, Type.COMMENT);\n }\n /**\n * Parses a comment line from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar\n */\n\n\n _createClass(Comment, [{\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var offset = this.parseComment(start);\n this.range = new Range(start, offset);\n return offset;\n }\n }]);\n\n return Comment;\n}(Node);\n\nfunction grabCollectionEndComments(node) {\n var cnode = node;\n\n while (cnode instanceof CollectionItem) {\n cnode = cnode.node;\n }\n\n if (!(cnode instanceof Collection)) return null;\n var len = cnode.items.length;\n var ci = -1;\n\n for (var i = len - 1; i >= 0; --i) {\n var n = cnode.items[i];\n\n if (n.type === Type.COMMENT) {\n // Keep sufficiently indented comments with preceding node\n var _n$context = n.context,\n indent = _n$context.indent,\n lineStart = _n$context.lineStart;\n if (indent > 0 && n.range.start >= lineStart + indent) break;\n ci = i;\n } else if (n.type === Type.BLANK_LINE) ci = i;else break;\n }\n\n if (ci === -1) return null;\n var ca = cnode.items.splice(ci, len - ci);\n var prevEnd = ca[0].range.start;\n\n while (true) {\n cnode.range.end = prevEnd;\n if (cnode.valueRange && cnode.valueRange.end > prevEnd) cnode.valueRange.end = prevEnd;\n if (cnode === node) break;\n cnode = cnode.context.parent;\n }\n\n return ca;\n}\nvar Collection = /*#__PURE__*/function (_Node) {\n _inherits(Collection, _Node);\n\n var _super = _createSuper(Collection);\n\n function Collection(firstItem) {\n var _this;\n\n _classCallCheck(this, Collection);\n\n _this = _super.call(this, firstItem.type === Type.SEQ_ITEM ? Type.SEQ : Type.MAP);\n\n for (var i = firstItem.props.length - 1; i >= 0; --i) {\n if (firstItem.props[i].start < firstItem.context.lineStart) {\n // props on previous line are assumed by the collection\n _this.props = firstItem.props.slice(0, i + 1);\n firstItem.props = firstItem.props.slice(i + 1);\n var itemRange = firstItem.props[0] || firstItem.valueRange;\n firstItem.range.start = itemRange.start;\n break;\n }\n }\n\n _this.items = [firstItem];\n var ec = grabCollectionEndComments(firstItem);\n if (ec) Array.prototype.push.apply(_this.items, ec);\n return _this;\n }\n\n _createClass(Collection, [{\n key: \"includesTrailingLines\",\n get: function get() {\n return this.items.length > 0;\n }\n /**\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var parseNode = context.parseNode,\n src = context.src; // It's easier to recalculate lineStart here rather than tracking down the\n // last context from which to read it -- eemeli/yaml#2\n\n var lineStart = Node.startOfLine(src, start);\n var firstItem = this.items[0]; // First-item context needs to be correct for later comment handling\n // -- eemeli/yaml#17\n\n firstItem.context.parent = this;\n this.valueRange = Range.copy(firstItem.valueRange);\n var indent = firstItem.range.start - firstItem.context.lineStart;\n var offset = start;\n offset = Node.normalizeOffset(src, offset);\n var ch = src[offset];\n var atLineStart = Node.endOfWhiteSpace(src, lineStart) === offset;\n var prevIncludesTrailingLines = false;\n\n while (ch) {\n while (ch === '\\n' || ch === '#') {\n if (atLineStart && ch === '\\n' && !prevIncludesTrailingLines) {\n var blankLine = new BlankLine();\n offset = blankLine.parse({\n src: src\n }, offset);\n this.valueRange.end = offset;\n\n if (offset >= src.length) {\n ch = null;\n break;\n }\n\n this.items.push(blankLine);\n offset -= 1; // blankLine.parse() consumes terminal newline\n } else if (ch === '#') {\n if (offset < lineStart + indent && !Collection.nextContentHasIndent(src, offset, indent)) {\n return offset;\n }\n\n var comment = new Comment();\n offset = comment.parse({\n indent: indent,\n lineStart: lineStart,\n src: src\n }, offset);\n this.items.push(comment);\n this.valueRange.end = offset;\n\n if (offset >= src.length) {\n ch = null;\n break;\n }\n }\n\n lineStart = offset + 1;\n offset = Node.endOfIndent(src, lineStart);\n\n if (Node.atBlank(src, offset)) {\n var wsEnd = Node.endOfWhiteSpace(src, offset);\n var next = src[wsEnd];\n\n if (!next || next === '\\n' || next === '#') {\n offset = wsEnd;\n }\n }\n\n ch = src[offset];\n atLineStart = true;\n }\n\n if (!ch) {\n break;\n }\n\n if (offset !== lineStart + indent && (atLineStart || ch !== ':')) {\n if (offset < lineStart + indent) {\n if (lineStart > start) offset = lineStart;\n break;\n } else if (!this.error) {\n var msg = 'All collection items must start at the same column';\n this.error = new YAMLSyntaxError(this, msg);\n }\n }\n\n if (firstItem.type === Type.SEQ_ITEM) {\n if (ch !== '-') {\n if (lineStart > start) offset = lineStart;\n break;\n }\n } else if (ch === '-' && !this.error) {\n // map key may start with -, as long as it's followed by a non-whitespace char\n var _next = src[offset + 1];\n\n if (!_next || _next === '\\n' || _next === '\\t' || _next === ' ') {\n var _msg = 'A collection cannot be both a mapping and a sequence';\n this.error = new YAMLSyntaxError(this, _msg);\n }\n }\n\n var node = parseNode({\n atLineStart: atLineStart,\n inCollection: true,\n indent: indent,\n lineStart: lineStart,\n parent: this\n }, offset);\n if (!node) return offset; // at next document start\n\n this.items.push(node);\n this.valueRange.end = node.valueRange.end;\n offset = Node.normalizeOffset(src, node.range.end);\n ch = src[offset];\n atLineStart = false;\n prevIncludesTrailingLines = node.includesTrailingLines; // Need to reset lineStart and atLineStart here if preceding node's range\n // has advanced to check the current line's indentation level\n // -- eemeli/yaml#10 & eemeli/yaml#38\n\n if (ch) {\n var ls = offset - 1;\n var prev = src[ls];\n\n while (prev === ' ' || prev === '\\t') {\n prev = src[--ls];\n }\n\n if (prev === '\\n') {\n lineStart = ls + 1;\n atLineStart = true;\n }\n }\n\n var ec = grabCollectionEndComments(node);\n if (ec) Array.prototype.push.apply(this.items, ec);\n }\n\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(Collection.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n this.items.forEach(function (node) {\n offset = node.setOrigRanges(cr, offset);\n });\n return offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var src = this.context.src,\n items = this.items,\n range = this.range,\n value = this.value;\n if (value != null) return value;\n var str = src.slice(range.start, items[0].range.start) + String(items[0]);\n\n for (var i = 1; i < items.length; ++i) {\n var item = items[i];\n var _item$context = item.context,\n atLineStart = _item$context.atLineStart,\n indent = _item$context.indent;\n if (atLineStart) for (var _i = 0; _i < indent; ++_i) {\n str += ' ';\n }\n str += String(item);\n }\n\n return Node.addStringTerminator(src, range.end, str);\n }\n }], [{\n key: \"nextContentHasIndent\",\n value: function nextContentHasIndent(src, offset, indent) {\n var lineStart = Node.endOfLine(src, offset) + 1;\n offset = Node.endOfWhiteSpace(src, lineStart);\n var ch = src[offset];\n if (!ch) return false;\n if (offset >= lineStart + indent) return true;\n if (ch !== '#' && ch !== '\\n') return false;\n return Collection.nextContentHasIndent(src, offset, indent);\n }\n }]);\n\n return Collection;\n}(Node);\n\nvar Directive = /*#__PURE__*/function (_Node) {\n _inherits(Directive, _Node);\n\n var _super = _createSuper(Directive);\n\n function Directive() {\n var _this;\n\n _classCallCheck(this, Directive);\n\n _this = _super.call(this, Type.DIRECTIVE);\n _this.name = null;\n return _this;\n }\n\n _createClass(Directive, [{\n key: \"parameters\",\n get: function get() {\n var raw = this.rawValue;\n return raw ? raw.trim().split(/[ \\t]+/) : [];\n }\n }, {\n key: \"parseName\",\n value: function parseName(start) {\n var src = this.context.src;\n var offset = start;\n var ch = src[offset];\n\n while (ch && ch !== '\\n' && ch !== '\\t' && ch !== ' ') {\n ch = src[offset += 1];\n }\n\n this.name = src.slice(start, offset);\n return offset;\n }\n }, {\n key: \"parseParameters\",\n value: function parseParameters(start) {\n var src = this.context.src;\n var offset = start;\n var ch = src[offset];\n\n while (ch && ch !== '\\n' && ch !== '#') {\n ch = src[offset += 1];\n }\n\n this.valueRange = new Range(start, offset);\n return offset;\n }\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var offset = this.parseName(start + 1);\n offset = this.parseParameters(offset);\n offset = this.parseComment(offset);\n this.range = new Range(start, offset);\n return offset;\n }\n }]);\n\n return Directive;\n}(Node);\n\nvar Document = /*#__PURE__*/function (_Node) {\n _inherits(Document, _Node);\n\n var _super = _createSuper(Document);\n\n function Document() {\n var _this;\n\n _classCallCheck(this, Document);\n\n _this = _super.call(this, Type.DOCUMENT);\n _this.directives = null;\n _this.contents = null;\n _this.directivesEndMarker = null;\n _this.documentEndMarker = null;\n return _this;\n }\n\n _createClass(Document, [{\n key: \"parseDirectives\",\n value: function parseDirectives(start) {\n var src = this.context.src;\n this.directives = [];\n var atLineStart = true;\n var hasDirectives = false;\n var offset = start;\n\n while (!Node.atDocumentBoundary(src, offset, Char.DIRECTIVES_END)) {\n offset = Document.startCommentOrEndBlankLine(src, offset);\n\n switch (src[offset]) {\n case '\\n':\n if (atLineStart) {\n var blankLine = new BlankLine();\n offset = blankLine.parse({\n src: src\n }, offset);\n\n if (offset < src.length) {\n this.directives.push(blankLine);\n }\n } else {\n offset += 1;\n atLineStart = true;\n }\n\n break;\n\n case '#':\n {\n var comment = new Comment();\n offset = comment.parse({\n src: src\n }, offset);\n this.directives.push(comment);\n atLineStart = false;\n }\n break;\n\n case '%':\n {\n var directive = new Directive();\n offset = directive.parse({\n parent: this,\n src: src\n }, offset);\n this.directives.push(directive);\n hasDirectives = true;\n atLineStart = false;\n }\n break;\n\n default:\n if (hasDirectives) {\n this.error = new YAMLSemanticError(this, 'Missing directives-end indicator line');\n } else if (this.directives.length > 0) {\n this.contents = this.directives;\n this.directives = [];\n }\n\n return offset;\n }\n }\n\n if (src[offset]) {\n this.directivesEndMarker = new Range(offset, offset + 3);\n return offset + 3;\n }\n\n if (hasDirectives) {\n this.error = new YAMLSemanticError(this, 'Missing directives-end indicator line');\n } else if (this.directives.length > 0) {\n this.contents = this.directives;\n this.directives = [];\n }\n\n return offset;\n }\n }, {\n key: \"parseContents\",\n value: function parseContents(start) {\n var _this$context = this.context,\n parseNode = _this$context.parseNode,\n src = _this$context.src;\n if (!this.contents) this.contents = [];\n var lineStart = start;\n\n while (src[lineStart - 1] === '-') {\n lineStart -= 1;\n }\n\n var offset = Node.endOfWhiteSpace(src, start);\n var atLineStart = lineStart === start;\n this.valueRange = new Range(offset);\n\n while (!Node.atDocumentBoundary(src, offset, Char.DOCUMENT_END)) {\n switch (src[offset]) {\n case '\\n':\n if (atLineStart) {\n var blankLine = new BlankLine();\n offset = blankLine.parse({\n src: src\n }, offset);\n\n if (offset < src.length) {\n this.contents.push(blankLine);\n }\n } else {\n offset += 1;\n atLineStart = true;\n }\n\n lineStart = offset;\n break;\n\n case '#':\n {\n var comment = new Comment();\n offset = comment.parse({\n src: src\n }, offset);\n this.contents.push(comment);\n atLineStart = false;\n }\n break;\n\n default:\n {\n var iEnd = Node.endOfIndent(src, offset);\n var context = {\n atLineStart: atLineStart,\n indent: -1,\n inFlow: false,\n inCollection: false,\n lineStart: lineStart,\n parent: this\n };\n var node = parseNode(context, iEnd);\n if (!node) return this.valueRange.end = iEnd; // at next document start\n\n this.contents.push(node);\n offset = node.range.end;\n atLineStart = false;\n var ec = grabCollectionEndComments(node);\n if (ec) Array.prototype.push.apply(this.contents, ec);\n }\n }\n\n offset = Document.startCommentOrEndBlankLine(src, offset);\n }\n\n this.valueRange.end = offset;\n\n if (src[offset]) {\n this.documentEndMarker = new Range(offset, offset + 3);\n offset += 3;\n\n if (src[offset]) {\n offset = Node.endOfWhiteSpace(src, offset);\n\n if (src[offset] === '#') {\n var _comment = new Comment();\n\n offset = _comment.parse({\n src: src\n }, offset);\n this.contents.push(_comment);\n }\n\n switch (src[offset]) {\n case '\\n':\n offset += 1;\n break;\n\n case undefined:\n break;\n\n default:\n this.error = new YAMLSyntaxError(this, 'Document end marker line cannot have a non-comment suffix');\n }\n }\n }\n\n return offset;\n }\n /**\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n context.root = this;\n this.context = context;\n var src = context.src;\n var offset = src.charCodeAt(start) === 0xfeff ? start + 1 : start; // skip BOM\n\n offset = this.parseDirectives(offset);\n offset = this.parseContents(offset);\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(Document.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n this.directives.forEach(function (node) {\n offset = node.setOrigRanges(cr, offset);\n });\n if (this.directivesEndMarker) offset = this.directivesEndMarker.setOrigRange(cr, offset);\n this.contents.forEach(function (node) {\n offset = node.setOrigRanges(cr, offset);\n });\n if (this.documentEndMarker) offset = this.documentEndMarker.setOrigRange(cr, offset);\n return offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var contents = this.contents,\n directives = this.directives,\n value = this.value;\n if (value != null) return value;\n var str = directives.join('');\n\n if (contents.length > 0) {\n if (directives.length > 0 || contents[0].type === Type.COMMENT) str += '---\\n';\n str += contents.join('');\n }\n\n if (str[str.length - 1] !== '\\n') str += '\\n';\n return str;\n }\n }], [{\n key: \"startCommentOrEndBlankLine\",\n value: function startCommentOrEndBlankLine(src, start) {\n var offset = Node.endOfWhiteSpace(src, start);\n var ch = src[offset];\n return ch === '#' || ch === '\\n' ? offset : start;\n }\n }]);\n\n return Document;\n}(Node);\n\nvar Alias = /*#__PURE__*/function (_Node) {\n _inherits(Alias, _Node);\n\n var _super = _createSuper(Alias);\n\n function Alias() {\n _classCallCheck(this, Alias);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(Alias, [{\n key: \"parse\",\n value:\n /**\n * Parses an *alias from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar\n */\n function parse(context, start) {\n this.context = context;\n var src = context.src;\n var offset = Node.endOfIdentifier(src, start + 1);\n this.valueRange = new Range(start + 1, offset);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n return offset;\n }\n }]);\n\n return Alias;\n}(Node);\n\nvar Chomp = {\n CLIP: 'CLIP',\n KEEP: 'KEEP',\n STRIP: 'STRIP'\n};\nvar BlockValue = /*#__PURE__*/function (_Node) {\n _inherits(BlockValue, _Node);\n\n var _super = _createSuper(BlockValue);\n\n function BlockValue(type, props) {\n var _this;\n\n _classCallCheck(this, BlockValue);\n\n _this = _super.call(this, type, props);\n _this.blockIndent = null;\n _this.chomping = Chomp.CLIP;\n _this.header = null;\n return _this;\n }\n\n _createClass(BlockValue, [{\n key: \"includesTrailingLines\",\n get: function get() {\n return this.chomping === Chomp.KEEP;\n }\n }, {\n key: \"strValue\",\n get: function get() {\n if (!this.valueRange || !this.context) return null;\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n var _this$context = this.context,\n indent = _this$context.indent,\n src = _this$context.src;\n if (this.valueRange.isEmpty()) return '';\n var lastNewLine = null;\n var ch = src[end - 1];\n\n while (ch === '\\n' || ch === '\\t' || ch === ' ') {\n end -= 1;\n\n if (end <= start) {\n if (this.chomping === Chomp.KEEP) break;else return ''; // probably never happens\n }\n\n if (ch === '\\n') lastNewLine = end;\n ch = src[end - 1];\n }\n\n var keepStart = end + 1;\n\n if (lastNewLine) {\n if (this.chomping === Chomp.KEEP) {\n keepStart = lastNewLine;\n end = this.valueRange.end;\n } else {\n end = lastNewLine;\n }\n }\n\n var bi = indent + this.blockIndent;\n var folded = this.type === Type.BLOCK_FOLDED;\n var atStart = true;\n var str = '';\n var sep = '';\n var prevMoreIndented = false;\n\n for (var i = start; i < end; ++i) {\n for (var j = 0; j < bi; ++j) {\n if (src[i] !== ' ') break;\n i += 1;\n }\n\n var _ch = src[i];\n\n if (_ch === '\\n') {\n if (sep === '\\n') str += '\\n';else sep = '\\n';\n } else {\n var lineEnd = Node.endOfLine(src, i);\n var line = src.slice(i, lineEnd);\n i = lineEnd;\n\n if (folded && (_ch === ' ' || _ch === '\\t') && i < keepStart) {\n if (sep === ' ') sep = '\\n';else if (!prevMoreIndented && !atStart && sep === '\\n') sep = '\\n\\n';\n str += sep + line; //+ ((lineEnd < end && src[lineEnd]) || '')\n\n sep = lineEnd < end && src[lineEnd] || '';\n prevMoreIndented = true;\n } else {\n str += sep + line;\n sep = folded && i < keepStart ? ' ' : '\\n';\n prevMoreIndented = false;\n }\n\n if (atStart && line !== '') atStart = false;\n }\n }\n\n return this.chomping === Chomp.STRIP ? str : str + '\\n';\n }\n }, {\n key: \"parseBlockHeader\",\n value: function parseBlockHeader(start) {\n var src = this.context.src;\n var offset = start + 1;\n var bi = '';\n\n while (true) {\n var ch = src[offset];\n\n switch (ch) {\n case '-':\n this.chomping = Chomp.STRIP;\n break;\n\n case '+':\n this.chomping = Chomp.KEEP;\n break;\n\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 case '8':\n case '9':\n bi += ch;\n break;\n\n default:\n this.blockIndent = Number(bi) || null;\n this.header = new Range(start, offset);\n return offset;\n }\n\n offset += 1;\n }\n }\n }, {\n key: \"parseBlockValue\",\n value: function parseBlockValue(start) {\n var _this$context2 = this.context,\n indent = _this$context2.indent,\n src = _this$context2.src;\n var explicit = !!this.blockIndent;\n var offset = start;\n var valueEnd = start;\n var minBlockIndent = 1;\n\n for (var ch = src[offset]; ch === '\\n'; ch = src[offset]) {\n offset += 1;\n if (Node.atDocumentBoundary(src, offset)) break;\n var end = Node.endOfBlockIndent(src, indent, offset); // should not include tab?\n\n if (end === null) break;\n var _ch2 = src[end];\n var lineIndent = end - (offset + indent);\n\n if (!this.blockIndent) {\n // no explicit block indent, none yet detected\n if (src[end] !== '\\n') {\n // first line with non-whitespace content\n if (lineIndent < minBlockIndent) {\n var msg = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator';\n this.error = new YAMLSemanticError(this, msg);\n }\n\n this.blockIndent = lineIndent;\n } else if (lineIndent > minBlockIndent) {\n // empty line with more whitespace\n minBlockIndent = lineIndent;\n }\n } else if (_ch2 && _ch2 !== '\\n' && lineIndent < this.blockIndent) {\n if (src[end] === '#') break;\n\n if (!this.error) {\n var _src = explicit ? 'explicit indentation indicator' : 'first line';\n\n var _msg = \"Block scalars must not be less indented than their \".concat(_src);\n\n this.error = new YAMLSemanticError(this, _msg);\n }\n }\n\n if (src[end] === '\\n') {\n offset = end;\n } else {\n offset = valueEnd = Node.endOfLine(src, end);\n }\n }\n\n if (this.chomping !== Chomp.KEEP) {\n offset = src[valueEnd] ? valueEnd + 1 : valueEnd;\n }\n\n this.valueRange = new Range(start + 1, offset);\n return offset;\n }\n /**\n * Parses a block value from the source\n *\n * Accepted forms are:\n * ```\n * BS\n * block\n * lines\n *\n * BS #comment\n * block\n * lines\n * ```\n * where the block style BS matches the regexp `[|>][-+1-9]*` and block lines\n * are empty or have an indent level greater than `indent`.\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this block\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var src = context.src;\n var offset = this.parseBlockHeader(start);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n offset = this.parseBlockValue(offset);\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(BlockValue.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n return this.header ? this.header.setOrigRange(cr, offset) : offset;\n }\n }]);\n\n return BlockValue;\n}(Node);\n\nvar FlowCollection = /*#__PURE__*/function (_Node) {\n _inherits(FlowCollection, _Node);\n\n var _super = _createSuper(FlowCollection);\n\n function FlowCollection(type, props) {\n var _this;\n\n _classCallCheck(this, FlowCollection);\n\n _this = _super.call(this, type, props);\n _this.items = null;\n return _this;\n }\n\n _createClass(FlowCollection, [{\n key: \"prevNodeIsJsonLike\",\n value: function prevNodeIsJsonLike() {\n var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.items.length;\n var node = this.items[idx - 1];\n return !!node && (node.jsonLike || node.type === Type.COMMENT && this.prevNodeIsJsonLike(idx - 1));\n }\n /**\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var parseNode = context.parseNode,\n src = context.src;\n var indent = context.indent,\n lineStart = context.lineStart;\n var char = src[start]; // { or [\n\n this.items = [{\n char: char,\n offset: start\n }];\n var offset = Node.endOfWhiteSpace(src, start + 1);\n char = src[offset];\n\n while (char && char !== ']' && char !== '}') {\n switch (char) {\n case '\\n':\n {\n lineStart = offset + 1;\n var wsEnd = Node.endOfWhiteSpace(src, lineStart);\n\n if (src[wsEnd] === '\\n') {\n var blankLine = new BlankLine();\n lineStart = blankLine.parse({\n src: src\n }, lineStart);\n this.items.push(blankLine);\n }\n\n offset = Node.endOfIndent(src, lineStart);\n\n if (offset <= lineStart + indent) {\n char = src[offset];\n\n if (offset < lineStart + indent || char !== ']' && char !== '}') {\n var msg = 'Insufficient indentation in flow collection';\n this.error = new YAMLSemanticError(this, msg);\n }\n }\n }\n break;\n\n case ',':\n {\n this.items.push({\n char: char,\n offset: offset\n });\n offset += 1;\n }\n break;\n\n case '#':\n {\n var comment = new Comment();\n offset = comment.parse({\n src: src\n }, offset);\n this.items.push(comment);\n }\n break;\n\n case '?':\n case ':':\n {\n var next = src[offset + 1];\n\n if (next === '\\n' || next === '\\t' || next === ' ' || next === ',' || // in-flow : after JSON-like key does not need to be followed by whitespace\n char === ':' && this.prevNodeIsJsonLike()) {\n this.items.push({\n char: char,\n offset: offset\n });\n offset += 1;\n break;\n }\n }\n // fallthrough\n\n default:\n {\n var node = parseNode({\n atLineStart: false,\n inCollection: false,\n inFlow: true,\n indent: -1,\n lineStart: lineStart,\n parent: this\n }, offset);\n\n if (!node) {\n // at next document start\n this.valueRange = new Range(start, offset);\n return offset;\n }\n\n this.items.push(node);\n offset = Node.normalizeOffset(src, node.range.end);\n }\n }\n\n offset = Node.endOfWhiteSpace(src, offset);\n char = src[offset];\n }\n\n this.valueRange = new Range(start, offset + 1);\n\n if (char) {\n this.items.push({\n char: char,\n offset: offset\n });\n offset = Node.endOfWhiteSpace(src, offset + 1);\n offset = this.parseComment(offset);\n }\n\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(FlowCollection.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n this.items.forEach(function (node) {\n if (node instanceof Node) {\n offset = node.setOrigRanges(cr, offset);\n } else if (cr.length === 0) {\n node.origOffset = node.offset;\n } else {\n var i = offset;\n\n while (i < cr.length) {\n if (cr[i] > node.offset) break;else ++i;\n }\n\n node.origOffset = node.offset + i;\n offset = i;\n }\n });\n return offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var src = this.context.src,\n items = this.items,\n range = this.range,\n value = this.value;\n if (value != null) return value;\n var nodes = items.filter(function (item) {\n return item instanceof Node;\n });\n var str = '';\n var prevEnd = range.start;\n nodes.forEach(function (node) {\n var prefix = src.slice(prevEnd, node.range.start);\n prevEnd = node.range.end;\n str += prefix + String(node);\n\n if (str[str.length - 1] === '\\n' && src[prevEnd - 1] !== '\\n' && src[prevEnd] === '\\n') {\n // Comment range does not include the terminal newline, but its\n // stringified value does. Without this fix, newlines at comment ends\n // get duplicated.\n prevEnd += 1;\n }\n });\n str += src.slice(prevEnd, range.end);\n return Node.addStringTerminator(src, range.end, str);\n }\n }]);\n\n return FlowCollection;\n}(Node);\n\nvar QuoteDouble = /*#__PURE__*/function (_Node) {\n _inherits(QuoteDouble, _Node);\n\n var _super = _createSuper(QuoteDouble);\n\n function QuoteDouble() {\n _classCallCheck(this, QuoteDouble);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(QuoteDouble, [{\n key: \"strValue\",\n get:\n /**\n * @returns {string | { str: string, errors: YAMLSyntaxError[] }}\n */\n function get() {\n if (!this.valueRange || !this.context) return null;\n var errors = [];\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n var _this$context = this.context,\n indent = _this$context.indent,\n src = _this$context.src;\n if (src[end - 1] !== '\"') errors.push(new YAMLSyntaxError(this, 'Missing closing \"quote')); // Using String#replace is too painful with escaped newlines preceded by\n // escaped backslashes; also, this should be faster.\n\n var str = '';\n\n for (var i = start + 1; i < end - 1; ++i) {\n var ch = src[i];\n\n if (ch === '\\n') {\n if (Node.atDocumentBoundary(src, i + 1)) errors.push(new YAMLSemanticError(this, 'Document boundary indicators are not allowed within string values'));\n\n var _Node$foldNewline = Node.foldNewline(src, i, indent),\n fold = _Node$foldNewline.fold,\n offset = _Node$foldNewline.offset,\n error = _Node$foldNewline.error;\n\n str += fold;\n i = offset;\n if (error) errors.push(new YAMLSemanticError(this, 'Multi-line double-quoted string needs to be sufficiently indented'));\n } else if (ch === '\\\\') {\n i += 1;\n\n switch (src[i]) {\n case '0':\n str += '\\0';\n break;\n // null character\n\n case 'a':\n str += '\\x07';\n break;\n // bell character\n\n case 'b':\n str += '\\b';\n break;\n // backspace\n\n case 'e':\n str += '\\x1b';\n break;\n // escape character\n\n case 'f':\n str += '\\f';\n break;\n // form feed\n\n case 'n':\n str += '\\n';\n break;\n // line feed\n\n case 'r':\n str += '\\r';\n break;\n // carriage return\n\n case 't':\n str += '\\t';\n break;\n // horizontal tab\n\n case 'v':\n str += '\\v';\n break;\n // vertical tab\n\n case 'N':\n str += \"\\x85\";\n break;\n // Unicode next line\n\n case '_':\n str += \"\\xA0\";\n break;\n // Unicode non-breaking space\n\n case 'L':\n str += \"\\u2028\";\n break;\n // Unicode line separator\n\n case 'P':\n str += \"\\u2029\";\n break;\n // Unicode paragraph separator\n\n case ' ':\n str += ' ';\n break;\n\n case '\"':\n str += '\"';\n break;\n\n case '/':\n str += '/';\n break;\n\n case '\\\\':\n str += '\\\\';\n break;\n\n case '\\t':\n str += '\\t';\n break;\n\n case 'x':\n str += this.parseCharCode(i + 1, 2, errors);\n i += 2;\n break;\n\n case 'u':\n str += this.parseCharCode(i + 1, 4, errors);\n i += 4;\n break;\n\n case 'U':\n str += this.parseCharCode(i + 1, 8, errors);\n i += 8;\n break;\n\n case '\\n':\n // skip escaped newlines, but still trim the following line\n while (src[i + 1] === ' ' || src[i + 1] === '\\t') {\n i += 1;\n }\n\n break;\n\n default:\n errors.push(new YAMLSyntaxError(this, \"Invalid escape sequence \".concat(src.substr(i - 1, 2))));\n str += '\\\\' + src[i];\n }\n } else if (ch === ' ' || ch === '\\t') {\n // trim trailing whitespace\n var wsStart = i;\n var next = src[i + 1];\n\n while (next === ' ' || next === '\\t') {\n i += 1;\n next = src[i + 1];\n }\n\n if (next !== '\\n') str += i > wsStart ? src.slice(wsStart, i + 1) : ch;\n } else {\n str += ch;\n }\n }\n\n return errors.length > 0 ? {\n errors: errors,\n str: str\n } : str;\n }\n }, {\n key: \"parseCharCode\",\n value: function parseCharCode(offset, length, errors) {\n var src = this.context.src;\n var cc = src.substr(offset, length);\n var ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);\n var code = ok ? parseInt(cc, 16) : NaN;\n\n if (isNaN(code)) {\n errors.push(new YAMLSyntaxError(this, \"Invalid escape sequence \".concat(src.substr(offset - 2, length + 2))));\n return src.substr(offset - 2, length + 2);\n }\n\n return String.fromCodePoint(code);\n }\n /**\n * Parses a \"double quoted\" value from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var src = context.src;\n var offset = QuoteDouble.endOfQuote(src, start + 1);\n this.valueRange = new Range(start, offset);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n return offset;\n }\n }], [{\n key: \"endOfQuote\",\n value: function endOfQuote(src, offset) {\n var ch = src[offset];\n\n while (ch && ch !== '\"') {\n offset += ch === '\\\\' ? 2 : 1;\n ch = src[offset];\n }\n\n return offset + 1;\n }\n }]);\n\n return QuoteDouble;\n}(Node);\n\nvar QuoteSingle = /*#__PURE__*/function (_Node) {\n _inherits(QuoteSingle, _Node);\n\n var _super = _createSuper(QuoteSingle);\n\n function QuoteSingle() {\n _classCallCheck(this, QuoteSingle);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(QuoteSingle, [{\n key: \"strValue\",\n get:\n /**\n * @returns {string | { str: string, errors: YAMLSyntaxError[] }}\n */\n function get() {\n if (!this.valueRange || !this.context) return null;\n var errors = [];\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n var _this$context = this.context,\n indent = _this$context.indent,\n src = _this$context.src;\n if (src[end - 1] !== \"'\") errors.push(new YAMLSyntaxError(this, \"Missing closing 'quote\"));\n var str = '';\n\n for (var i = start + 1; i < end - 1; ++i) {\n var ch = src[i];\n\n if (ch === '\\n') {\n if (Node.atDocumentBoundary(src, i + 1)) errors.push(new YAMLSemanticError(this, 'Document boundary indicators are not allowed within string values'));\n\n var _Node$foldNewline = Node.foldNewline(src, i, indent),\n fold = _Node$foldNewline.fold,\n offset = _Node$foldNewline.offset,\n error = _Node$foldNewline.error;\n\n str += fold;\n i = offset;\n if (error) errors.push(new YAMLSemanticError(this, 'Multi-line single-quoted string needs to be sufficiently indented'));\n } else if (ch === \"'\") {\n str += ch;\n i += 1;\n if (src[i] !== \"'\") errors.push(new YAMLSyntaxError(this, 'Unescaped single quote? This should not happen.'));\n } else if (ch === ' ' || ch === '\\t') {\n // trim trailing whitespace\n var wsStart = i;\n var next = src[i + 1];\n\n while (next === ' ' || next === '\\t') {\n i += 1;\n next = src[i + 1];\n }\n\n if (next !== '\\n') str += i > wsStart ? src.slice(wsStart, i + 1) : ch;\n } else {\n str += ch;\n }\n }\n\n return errors.length > 0 ? {\n errors: errors,\n str: str\n } : str;\n }\n /**\n * Parses a 'single quoted' value from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var src = context.src;\n var offset = QuoteSingle.endOfQuote(src, start + 1);\n this.valueRange = new Range(start, offset);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n return offset;\n }\n }], [{\n key: \"endOfQuote\",\n value: function endOfQuote(src, offset) {\n var ch = src[offset];\n\n while (ch) {\n if (ch === \"'\") {\n if (src[offset + 1] !== \"'\") break;\n ch = src[offset += 2];\n } else {\n ch = src[offset += 1];\n }\n }\n\n return offset + 1;\n }\n }]);\n\n return QuoteSingle;\n}(Node);\n\nfunction createNewNode(type, props) {\n switch (type) {\n case Type.ALIAS:\n return new Alias(type, props);\n\n case Type.BLOCK_FOLDED:\n case Type.BLOCK_LITERAL:\n return new BlockValue(type, props);\n\n case Type.FLOW_MAP:\n case Type.FLOW_SEQ:\n return new FlowCollection(type, props);\n\n case Type.MAP_KEY:\n case Type.MAP_VALUE:\n case Type.SEQ_ITEM:\n return new CollectionItem(type, props);\n\n case Type.COMMENT:\n case Type.PLAIN:\n return new PlainValue(type, props);\n\n case Type.QUOTE_DOUBLE:\n return new QuoteDouble(type, props);\n\n case Type.QUOTE_SINGLE:\n return new QuoteSingle(type, props);\n\n /* istanbul ignore next */\n\n default:\n return null;\n // should never happen\n }\n}\n/**\n * @param {boolean} atLineStart - Node starts at beginning of line\n * @param {boolean} inFlow - true if currently in a flow context\n * @param {boolean} inCollection - true if currently in a collection context\n * @param {number} indent - Current level of indentation\n * @param {number} lineStart - Start of the current line\n * @param {Node} parent - The parent of the node\n * @param {string} src - Source of the YAML document\n */\n\n\nvar ParseContext = /*#__PURE__*/function () {\n function ParseContext() {\n var _this = this;\n\n var orig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n atLineStart = _ref.atLineStart,\n inCollection = _ref.inCollection,\n inFlow = _ref.inFlow,\n indent = _ref.indent,\n lineStart = _ref.lineStart,\n parent = _ref.parent;\n\n _classCallCheck(this, ParseContext);\n\n _defineProperty(this, \"parseNode\", function (overlay, start) {\n if (Node.atDocumentBoundary(_this.src, start)) return null;\n var context = new ParseContext(_this, overlay);\n\n var _context$parseProps = context.parseProps(start),\n props = _context$parseProps.props,\n type = _context$parseProps.type,\n valueStart = _context$parseProps.valueStart;\n\n var node = createNewNode(type, props);\n var offset = node.parse(context, valueStart);\n node.range = new Range(start, offset);\n /* istanbul ignore if */\n\n if (offset <= start) {\n // This should never happen, but if it does, let's make sure to at least\n // step one character forward to avoid a busy loop.\n node.error = new Error(\"Node#parse consumed no characters\");\n node.error.parseEnd = offset;\n node.error.source = node;\n node.range.end = start + 1;\n }\n\n if (context.nodeStartsCollection(node)) {\n if (!node.error && !context.atLineStart && context.parent.type === Type.DOCUMENT) {\n node.error = new YAMLSyntaxError(node, 'Block collection must not have preceding content here (e.g. directives-end indicator)');\n }\n\n var collection = new Collection(node);\n offset = collection.parse(new ParseContext(context), offset);\n collection.range = new Range(start, offset);\n return collection;\n }\n\n return node;\n });\n\n this.atLineStart = atLineStart != null ? atLineStart : orig.atLineStart || false;\n this.inCollection = inCollection != null ? inCollection : orig.inCollection || false;\n this.inFlow = inFlow != null ? inFlow : orig.inFlow || false;\n this.indent = indent != null ? indent : orig.indent;\n this.lineStart = lineStart != null ? lineStart : orig.lineStart;\n this.parent = parent != null ? parent : orig.parent || {};\n this.root = orig.root;\n this.src = orig.src;\n }\n\n _createClass(ParseContext, [{\n key: \"nodeStartsCollection\",\n value: function nodeStartsCollection(node) {\n var inCollection = this.inCollection,\n inFlow = this.inFlow,\n src = this.src;\n if (inCollection || inFlow) return false;\n if (node instanceof CollectionItem) return true; // check for implicit key\n\n var offset = node.range.end;\n if (src[offset] === '\\n' || src[offset - 1] === '\\n') return false;\n offset = Node.endOfWhiteSpace(src, offset);\n return src[offset] === ':';\n } // Anchor and tag are before type, which determines the node implementation\n // class; hence this intermediate step.\n\n }, {\n key: \"parseProps\",\n value: function parseProps(offset) {\n var inFlow = this.inFlow,\n parent = this.parent,\n src = this.src;\n var props = [];\n var lineHasProps = false;\n offset = this.atLineStart ? Node.endOfIndent(src, offset) : Node.endOfWhiteSpace(src, offset);\n var ch = src[offset];\n\n while (ch === Char.ANCHOR || ch === Char.COMMENT || ch === Char.TAG || ch === '\\n') {\n if (ch === '\\n') {\n var inEnd = offset;\n var lineStart = void 0;\n\n do {\n lineStart = inEnd + 1;\n inEnd = Node.endOfIndent(src, lineStart);\n } while (src[inEnd] === '\\n');\n\n var indentDiff = inEnd - (lineStart + this.indent);\n var noIndicatorAsIndent = parent.type === Type.SEQ_ITEM && parent.context.atLineStart;\n if (src[inEnd] !== '#' && !Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;\n this.atLineStart = true;\n this.lineStart = lineStart;\n lineHasProps = false;\n offset = inEnd;\n } else if (ch === Char.COMMENT) {\n var end = Node.endOfLine(src, offset + 1);\n props.push(new Range(offset, end));\n offset = end;\n } else {\n var _end = Node.endOfIdentifier(src, offset + 1);\n\n if (ch === Char.TAG && src[_end] === ',' && /^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+,\\d\\d\\d\\d(-\\d\\d){0,2}\\/\\S/.test(src.slice(offset + 1, _end + 13))) {\n // Let's presume we're dealing with a YAML 1.0 domain tag here, rather\n // than an empty but 'foo.bar' private-tagged node in a flow collection\n // followed without whitespace by a plain string starting with a year\n // or date divided by something.\n _end = Node.endOfIdentifier(src, _end + 5);\n }\n\n props.push(new Range(offset, _end));\n lineHasProps = true;\n offset = Node.endOfWhiteSpace(src, _end);\n }\n\n ch = src[offset];\n } // '- &a : b' has an anchor on an empty node\n\n\n if (lineHasProps && ch === ':' && Node.atBlank(src, offset + 1, true)) offset -= 1;\n var type = ParseContext.parseType(src, offset, inFlow);\n return {\n props: props,\n type: type,\n valueStart: offset\n };\n }\n /**\n * Parses a node from the source\n * @param {ParseContext} overlay\n * @param {number} start - Index of first non-whitespace character for the node\n * @returns {?Node} - null if at a document boundary\n */\n\n }], [{\n key: \"parseType\",\n value: function parseType(src, offset, inFlow) {\n switch (src[offset]) {\n case '*':\n return Type.ALIAS;\n\n case '>':\n return Type.BLOCK_FOLDED;\n\n case '|':\n return Type.BLOCK_LITERAL;\n\n case '{':\n return Type.FLOW_MAP;\n\n case '[':\n return Type.FLOW_SEQ;\n\n case '?':\n return !inFlow && Node.atBlank(src, offset + 1, true) ? Type.MAP_KEY : Type.PLAIN;\n\n case ':':\n return !inFlow && Node.atBlank(src, offset + 1, true) ? Type.MAP_VALUE : Type.PLAIN;\n\n case '-':\n return !inFlow && Node.atBlank(src, offset + 1, true) ? Type.SEQ_ITEM : Type.PLAIN;\n\n case '\"':\n return Type.QUOTE_DOUBLE;\n\n case \"'\":\n return Type.QUOTE_SINGLE;\n\n default:\n return Type.PLAIN;\n }\n }\n }]);\n\n return ParseContext;\n}();\n\n// Published as 'yaml/parse-cst'\nfunction parse(src) {\n var cr = [];\n\n if (src.indexOf('\\r') !== -1) {\n src = src.replace(/\\r\\n?/g, function (match, offset) {\n if (match.length > 1) cr.push(offset);\n return '\\n';\n });\n }\n\n var documents = [];\n var offset = 0;\n\n do {\n var doc = new Document();\n var context = new ParseContext({\n src: src\n });\n offset = doc.parse(context, offset);\n documents.push(doc);\n } while (offset < src.length);\n\n documents.setOrigRanges = function () {\n if (cr.length === 0) return false;\n\n for (var i = 1; i < cr.length; ++i) {\n cr[i] -= i;\n }\n\n var crOffset = 0;\n\n for (var _i = 0; _i < documents.length; ++_i) {\n crOffset = documents[_i].setOrigRanges(cr, crOffset);\n }\n\n cr.splice(0, cr.length);\n return true;\n };\n\n documents.toString = function () {\n return documents.join('...\\n');\n };\n\n return documents;\n}\n\nexport { parse };\n","import { c as _classCallCheck, j as _inherits, k as _createSuper, b as _createClass, e as _defineProperty, p as _assertThisInitialized, a as _typeof, q as _toArray, T as Type, _ as _createForOfIteratorHelper, l as _get, m as _getPrototypeOf, o as YAMLReferenceError, r as _possibleConstructorReturn, h as _slicedToArray, g as YAMLSemanticError, n as defaultTags, f as YAMLWarning, C as Char, Y as YAMLSyntaxError, P as PlainValue } from './PlainValue-b8036b75.js';\n\nfunction addCommentBefore(str, indent, comment) {\n if (!comment) return str;\n var cc = comment.replace(/[\\s\\S]^/gm, \"$&\".concat(indent, \"#\"));\n return \"#\".concat(cc, \"\\n\").concat(indent).concat(str);\n}\nfunction addComment(str, indent, comment) {\n return !comment ? str : comment.indexOf('\\n') === -1 ? \"\".concat(str, \" #\").concat(comment) : \"\".concat(str, \"\\n\") + comment.replace(/^/gm, \"\".concat(indent || '', \"#\"));\n}\n\nvar Node = function Node() {\n _classCallCheck(this, Node);\n};\n\nfunction toJSON(value, arg, ctx) {\n if (Array.isArray(value)) return value.map(function (v, i) {\n return toJSON(v, String(i), ctx);\n });\n\n if (value && typeof value.toJSON === 'function') {\n var anchor = ctx && ctx.anchors && ctx.anchors.get(value);\n if (anchor) ctx.onCreate = function (res) {\n anchor.res = res;\n delete ctx.onCreate;\n };\n var res = value.toJSON(arg, ctx);\n if (anchor && ctx.onCreate) ctx.onCreate(res);\n return res;\n }\n\n if ((!ctx || !ctx.keep) && typeof value === 'bigint') return Number(value);\n return value;\n}\n\nvar Scalar = /*#__PURE__*/function (_Node) {\n _inherits(Scalar, _Node);\n\n var _super = _createSuper(Scalar);\n\n function Scalar(value) {\n var _this;\n\n _classCallCheck(this, Scalar);\n\n _this = _super.call(this);\n _this.value = value;\n return _this;\n }\n\n _createClass(Scalar, [{\n key: \"toJSON\",\n value: function toJSON$1(arg, ctx) {\n return ctx && ctx.keep ? this.value : toJSON(this.value, arg, ctx);\n }\n }, {\n key: \"toString\",\n value: function toString() {\n return String(this.value);\n }\n }]);\n\n return Scalar;\n}(Node);\n\nfunction collectionFromPath(schema, path, value) {\n var v = value;\n\n for (var i = path.length - 1; i >= 0; --i) {\n var k = path[i];\n\n if (Number.isInteger(k) && k >= 0) {\n var a = [];\n a[k] = v;\n v = a;\n } else {\n var o = {};\n Object.defineProperty(o, k, {\n value: v,\n writable: true,\n enumerable: true,\n configurable: true\n });\n v = o;\n }\n }\n\n return schema.createNode(v, false);\n} // null, undefined, or an empty non-string iterable (e.g. [])\n\n\nvar isEmptyPath = function isEmptyPath(path) {\n return path == null || _typeof(path) === 'object' && path[Symbol.iterator]().next().done;\n};\nvar Collection = /*#__PURE__*/function (_Node) {\n _inherits(Collection, _Node);\n\n var _super = _createSuper(Collection);\n\n function Collection(schema) {\n var _this;\n\n _classCallCheck(this, Collection);\n\n _this = _super.call(this);\n\n _defineProperty(_assertThisInitialized(_this), \"items\", []);\n\n _this.schema = schema;\n return _this;\n }\n\n _createClass(Collection, [{\n key: \"addIn\",\n value: function addIn(path, value) {\n if (isEmptyPath(path)) this.add(value);else {\n var _path = _toArray(path),\n key = _path[0],\n rest = _path.slice(1);\n\n var node = this.get(key, true);\n if (node instanceof Collection) node.addIn(rest, value);else if (node === undefined && this.schema) this.set(key, collectionFromPath(this.schema, rest, value));else throw new Error(\"Expected YAML collection at \".concat(key, \". Remaining path: \").concat(rest));\n }\n }\n }, {\n key: \"deleteIn\",\n value: function deleteIn(_ref) {\n var _ref2 = _toArray(_ref),\n key = _ref2[0],\n rest = _ref2.slice(1);\n\n if (rest.length === 0) return this.delete(key);\n var node = this.get(key, true);\n if (node instanceof Collection) return node.deleteIn(rest);else throw new Error(\"Expected YAML collection at \".concat(key, \". Remaining path: \").concat(rest));\n }\n }, {\n key: \"getIn\",\n value: function getIn(_ref3, keepScalar) {\n var _ref4 = _toArray(_ref3),\n key = _ref4[0],\n rest = _ref4.slice(1);\n\n var node = this.get(key, true);\n if (rest.length === 0) return !keepScalar && node instanceof Scalar ? node.value : node;else return node instanceof Collection ? node.getIn(rest, keepScalar) : undefined;\n }\n }, {\n key: \"hasAllNullValues\",\n value: function hasAllNullValues() {\n return this.items.every(function (node) {\n if (!node || node.type !== 'PAIR') return false;\n var n = node.value;\n return n == null || n instanceof Scalar && n.value == null && !n.commentBefore && !n.comment && !n.tag;\n });\n }\n }, {\n key: \"hasIn\",\n value: function hasIn(_ref5) {\n var _ref6 = _toArray(_ref5),\n key = _ref6[0],\n rest = _ref6.slice(1);\n\n if (rest.length === 0) return this.has(key);\n var node = this.get(key, true);\n return node instanceof Collection ? node.hasIn(rest) : false;\n }\n }, {\n key: \"setIn\",\n value: function setIn(_ref7, value) {\n var _ref8 = _toArray(_ref7),\n key = _ref8[0],\n rest = _ref8.slice(1);\n\n if (rest.length === 0) {\n this.set(key, value);\n } else {\n var node = this.get(key, true);\n if (node instanceof Collection) node.setIn(rest, value);else if (node === undefined && this.schema) this.set(key, collectionFromPath(this.schema, rest, value));else throw new Error(\"Expected YAML collection at \".concat(key, \". Remaining path: \").concat(rest));\n }\n } // overridden in implementations\n\n /* istanbul ignore next */\n\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return null;\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, _ref9, onComment, onChompKeep) {\n var _this2 = this;\n\n var blockItem = _ref9.blockItem,\n flowChars = _ref9.flowChars,\n isMap = _ref9.isMap,\n itemIndent = _ref9.itemIndent;\n var _ctx = ctx,\n indent = _ctx.indent,\n indentStep = _ctx.indentStep,\n stringify = _ctx.stringify;\n var inFlow = this.type === Type.FLOW_MAP || this.type === Type.FLOW_SEQ || ctx.inFlow;\n if (inFlow) itemIndent += indentStep;\n var allNullValues = isMap && this.hasAllNullValues();\n ctx = Object.assign({}, ctx, {\n allNullValues: allNullValues,\n indent: itemIndent,\n inFlow: inFlow,\n type: null\n });\n var chompKeep = false;\n var hasItemWithNewLine = false;\n var nodes = this.items.reduce(function (nodes, item, i) {\n var comment;\n\n if (item) {\n if (!chompKeep && item.spaceBefore) nodes.push({\n type: 'comment',\n str: ''\n });\n if (item.commentBefore) item.commentBefore.match(/^.*$/gm).forEach(function (line) {\n nodes.push({\n type: 'comment',\n str: \"#\".concat(line)\n });\n });\n if (item.comment) comment = item.comment;\n if (inFlow && (!chompKeep && item.spaceBefore || item.commentBefore || item.comment || item.key && (item.key.commentBefore || item.key.comment) || item.value && (item.value.commentBefore || item.value.comment))) hasItemWithNewLine = true;\n }\n\n chompKeep = false;\n var str = stringify(item, ctx, function () {\n return comment = null;\n }, function () {\n return chompKeep = true;\n });\n if (inFlow && !hasItemWithNewLine && str.includes('\\n')) hasItemWithNewLine = true;\n if (inFlow && i < _this2.items.length - 1) str += ',';\n str = addComment(str, itemIndent, comment);\n if (chompKeep && (comment || inFlow)) chompKeep = false;\n nodes.push({\n type: 'item',\n str: str\n });\n return nodes;\n }, []);\n var str;\n\n if (nodes.length === 0) {\n str = flowChars.start + flowChars.end;\n } else if (inFlow) {\n var start = flowChars.start,\n end = flowChars.end;\n var strings = nodes.map(function (n) {\n return n.str;\n });\n\n if (hasItemWithNewLine || strings.reduce(function (sum, str) {\n return sum + str.length + 2;\n }, 2) > Collection.maxFlowStringSingleLineLength) {\n str = start;\n\n var _iterator = _createForOfIteratorHelper(strings),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var s = _step.value;\n str += s ? \"\\n\".concat(indentStep).concat(indent).concat(s) : '\\n';\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n str += \"\\n\".concat(indent).concat(end);\n } else {\n str = \"\".concat(start, \" \").concat(strings.join(' '), \" \").concat(end);\n }\n } else {\n var _strings = nodes.map(blockItem);\n\n str = _strings.shift();\n\n var _iterator2 = _createForOfIteratorHelper(_strings),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _s = _step2.value;\n str += _s ? \"\\n\".concat(indent).concat(_s) : '\\n';\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n\n if (this.comment) {\n str += '\\n' + this.comment.replace(/^/gm, \"\".concat(indent, \"#\"));\n if (onComment) onComment();\n } else if (chompKeep && onChompKeep) onChompKeep();\n\n return str;\n }\n }]);\n\n return Collection;\n}(Node);\n\n_defineProperty(Collection, \"maxFlowStringSingleLineLength\", 60);\n\nfunction asItemIndex(key) {\n var idx = key instanceof Scalar ? key.value : key;\n if (idx && typeof idx === 'string') idx = Number(idx);\n return Number.isInteger(idx) && idx >= 0 ? idx : null;\n}\n\nvar YAMLSeq = /*#__PURE__*/function (_Collection) {\n _inherits(YAMLSeq, _Collection);\n\n var _super = _createSuper(YAMLSeq);\n\n function YAMLSeq() {\n _classCallCheck(this, YAMLSeq);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(YAMLSeq, [{\n key: \"add\",\n value: function add(value) {\n this.items.push(value);\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n var idx = asItemIndex(key);\n if (typeof idx !== 'number') return false;\n var del = this.items.splice(idx, 1);\n return del.length > 0;\n }\n }, {\n key: \"get\",\n value: function get(key, keepScalar) {\n var idx = asItemIndex(key);\n if (typeof idx !== 'number') return undefined;\n var it = this.items[idx];\n return !keepScalar && it instanceof Scalar ? it.value : it;\n }\n }, {\n key: \"has\",\n value: function has(key) {\n var idx = asItemIndex(key);\n return typeof idx === 'number' && idx < this.items.length;\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n var idx = asItemIndex(key);\n if (typeof idx !== 'number') throw new Error(\"Expected a valid index, not \".concat(key, \".\"));\n this.items[idx] = value;\n }\n }, {\n key: \"toJSON\",\n value: function toJSON$1(_, ctx) {\n var seq = [];\n if (ctx && ctx.onCreate) ctx.onCreate(seq);\n var i = 0;\n\n var _iterator = _createForOfIteratorHelper(this.items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n seq.push(toJSON(item, String(i++), ctx));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return seq;\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment, onChompKeep) {\n if (!ctx) return JSON.stringify(this);\n return _get(_getPrototypeOf(YAMLSeq.prototype), \"toString\", this).call(this, ctx, {\n blockItem: function blockItem(n) {\n return n.type === 'comment' ? n.str : \"- \".concat(n.str);\n },\n flowChars: {\n start: '[',\n end: ']'\n },\n isMap: false,\n itemIndent: (ctx.indent || '') + ' '\n }, onComment, onChompKeep);\n }\n }]);\n\n return YAMLSeq;\n}(Collection);\n\nvar stringifyKey = function stringifyKey(key, jsKey, ctx) {\n if (jsKey === null) return '';\n if (_typeof(jsKey) !== 'object') return String(jsKey);\n if (key instanceof Node && ctx && ctx.doc) return key.toString({\n anchors: Object.create(null),\n doc: ctx.doc,\n indent: '',\n indentStep: ctx.indentStep,\n inFlow: true,\n inStringifyKey: true,\n stringify: ctx.stringify\n });\n return JSON.stringify(jsKey);\n};\n\nvar Pair = /*#__PURE__*/function (_Node) {\n _inherits(Pair, _Node);\n\n var _super = _createSuper(Pair);\n\n function Pair(key) {\n var _this;\n\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck(this, Pair);\n\n _this = _super.call(this);\n _this.key = key;\n _this.value = value;\n _this.type = Pair.Type.PAIR;\n return _this;\n }\n\n _createClass(Pair, [{\n key: \"commentBefore\",\n get: function get() {\n return this.key instanceof Node ? this.key.commentBefore : undefined;\n },\n set: function set(cb) {\n if (this.key == null) this.key = new Scalar(null);\n if (this.key instanceof Node) this.key.commentBefore = cb;else {\n var msg = 'Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.';\n throw new Error(msg);\n }\n }\n }, {\n key: \"addToJSMap\",\n value: function addToJSMap(ctx, map) {\n var key = toJSON(this.key, '', ctx);\n\n if (map instanceof Map) {\n var value = toJSON(this.value, key, ctx);\n map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else {\n var stringKey = stringifyKey(this.key, key, ctx);\n\n var _value = toJSON(this.value, stringKey, ctx);\n\n if (stringKey in map) Object.defineProperty(map, stringKey, {\n value: _value,\n writable: true,\n enumerable: true,\n configurable: true\n });else map[stringKey] = _value;\n }\n\n return map;\n }\n }, {\n key: \"toJSON\",\n value: function toJSON(_, ctx) {\n var pair = ctx && ctx.mapAsMap ? new Map() : {};\n return this.addToJSMap(ctx, pair);\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment, onChompKeep) {\n if (!ctx || !ctx.doc) return JSON.stringify(this);\n var _ctx$doc$options = ctx.doc.options,\n indentSize = _ctx$doc$options.indent,\n indentSeq = _ctx$doc$options.indentSeq,\n simpleKeys = _ctx$doc$options.simpleKeys;\n var key = this.key,\n value = this.value;\n var keyComment = key instanceof Node && key.comment;\n\n if (simpleKeys) {\n if (keyComment) {\n throw new Error('With simple keys, key nodes cannot have comments');\n }\n\n if (key instanceof Collection) {\n var msg = 'With simple keys, collection cannot be used as a key value';\n throw new Error(msg);\n }\n }\n\n var explicitKey = !simpleKeys && (!key || keyComment || (key instanceof Node ? key instanceof Collection || key.type === Type.BLOCK_FOLDED || key.type === Type.BLOCK_LITERAL : _typeof(key) === 'object'));\n var _ctx = ctx,\n doc = _ctx.doc,\n indent = _ctx.indent,\n indentStep = _ctx.indentStep,\n stringify = _ctx.stringify;\n ctx = Object.assign({}, ctx, {\n implicitKey: !explicitKey,\n indent: indent + indentStep\n });\n var chompKeep = false;\n var str = stringify(key, ctx, function () {\n return keyComment = null;\n }, function () {\n return chompKeep = true;\n });\n str = addComment(str, ctx.indent, keyComment);\n\n if (!explicitKey && str.length > 1024) {\n if (simpleKeys) throw new Error('With simple keys, single line scalar must not span more than 1024 characters');\n explicitKey = true;\n }\n\n if (ctx.allNullValues && !simpleKeys) {\n if (this.comment) {\n str = addComment(str, ctx.indent, this.comment);\n if (onComment) onComment();\n } else if (chompKeep && !keyComment && onChompKeep) onChompKeep();\n\n return ctx.inFlow && !explicitKey ? str : \"? \".concat(str);\n }\n\n str = explicitKey ? \"? \".concat(str, \"\\n\").concat(indent, \":\") : \"\".concat(str, \":\");\n\n if (this.comment) {\n // expected (but not strictly required) to be a single-line comment\n str = addComment(str, ctx.indent, this.comment);\n if (onComment) onComment();\n }\n\n var vcb = '';\n var valueComment = null;\n\n if (value instanceof Node) {\n if (value.spaceBefore) vcb = '\\n';\n\n if (value.commentBefore) {\n var cs = value.commentBefore.replace(/^/gm, \"\".concat(ctx.indent, \"#\"));\n vcb += \"\\n\".concat(cs);\n }\n\n valueComment = value.comment;\n } else if (value && _typeof(value) === 'object') {\n value = doc.schema.createNode(value, true);\n }\n\n ctx.implicitKey = false;\n if (!explicitKey && !this.comment && value instanceof Scalar) ctx.indentAtStart = str.length + 1;\n chompKeep = false;\n\n if (!indentSeq && indentSize >= 2 && !ctx.inFlow && !explicitKey && value instanceof YAMLSeq && value.type !== Type.FLOW_SEQ && !value.tag && !doc.anchors.getName(value)) {\n // If indentSeq === false, consider '- ' as part of indentation where possible\n ctx.indent = ctx.indent.substr(2);\n }\n\n var valueStr = stringify(value, ctx, function () {\n return valueComment = null;\n }, function () {\n return chompKeep = true;\n });\n var ws = ' ';\n\n if (vcb || this.comment) {\n ws = \"\".concat(vcb, \"\\n\").concat(ctx.indent);\n } else if (!explicitKey && value instanceof Collection) {\n var flow = valueStr[0] === '[' || valueStr[0] === '{';\n if (!flow || valueStr.includes('\\n')) ws = \"\\n\".concat(ctx.indent);\n } else if (valueStr[0] === '\\n') ws = '';\n\n if (chompKeep && !valueComment && onChompKeep) onChompKeep();\n return addComment(str + ws + valueStr, ctx.indent, valueComment);\n }\n }]);\n\n return Pair;\n}(Node);\n\n_defineProperty(Pair, \"Type\", {\n PAIR: 'PAIR',\n MERGE_PAIR: 'MERGE_PAIR'\n});\n\nvar getAliasCount = function getAliasCount(node, anchors) {\n if (node instanceof Alias) {\n var anchor = anchors.get(node.source);\n return anchor.count * anchor.aliasCount;\n } else if (node instanceof Collection) {\n var count = 0;\n\n var _iterator = _createForOfIteratorHelper(node.items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n var c = getAliasCount(item, anchors);\n if (c > count) count = c;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return count;\n } else if (node instanceof Pair) {\n var kc = getAliasCount(node.key, anchors);\n var vc = getAliasCount(node.value, anchors);\n return Math.max(kc, vc);\n }\n\n return 1;\n};\n\nvar Alias = /*#__PURE__*/function (_Node) {\n _inherits(Alias, _Node);\n\n var _super = _createSuper(Alias);\n\n function Alias(source) {\n var _this;\n\n _classCallCheck(this, Alias);\n\n _this = _super.call(this);\n _this.source = source;\n _this.type = Type.ALIAS;\n return _this;\n }\n\n _createClass(Alias, [{\n key: \"tag\",\n set: function set(t) {\n throw new Error('Alias nodes cannot have tags');\n }\n }, {\n key: \"toJSON\",\n value: function toJSON$1(arg, ctx) {\n if (!ctx) return toJSON(this.source, arg, ctx);\n var anchors = ctx.anchors,\n maxAliasCount = ctx.maxAliasCount;\n var anchor = anchors.get(this.source);\n /* istanbul ignore if */\n\n if (!anchor || anchor.res === undefined) {\n var msg = 'This should not happen: Alias anchor was not resolved?';\n if (this.cstNode) throw new YAMLReferenceError(this.cstNode, msg);else throw new ReferenceError(msg);\n }\n\n if (maxAliasCount >= 0) {\n anchor.count += 1;\n if (anchor.aliasCount === 0) anchor.aliasCount = getAliasCount(this.source, anchors);\n\n if (anchor.count * anchor.aliasCount > maxAliasCount) {\n var _msg = 'Excessive alias count indicates a resource exhaustion attack';\n if (this.cstNode) throw new YAMLReferenceError(this.cstNode, _msg);else throw new ReferenceError(_msg);\n }\n }\n\n return anchor.res;\n } // Only called when stringifying an alias mapping key while constructing\n // Object output.\n\n }, {\n key: \"toString\",\n value: function toString(ctx) {\n return Alias.stringify(this, ctx);\n }\n }], [{\n key: \"stringify\",\n value: function stringify(_ref, _ref2) {\n var range = _ref.range,\n source = _ref.source;\n var anchors = _ref2.anchors,\n doc = _ref2.doc,\n implicitKey = _ref2.implicitKey,\n inStringifyKey = _ref2.inStringifyKey;\n var anchor = Object.keys(anchors).find(function (a) {\n return anchors[a] === source;\n });\n if (!anchor && inStringifyKey) anchor = doc.anchors.getName(source) || doc.anchors.newName();\n if (anchor) return \"*\".concat(anchor).concat(implicitKey ? ' ' : '');\n var msg = doc.anchors.getName(source) ? 'Alias node must be after source node' : 'Source node not found for alias node';\n throw new Error(\"\".concat(msg, \" [\").concat(range, \"]\"));\n }\n }]);\n\n return Alias;\n}(Node);\n\n_defineProperty(Alias, \"default\", true);\n\nfunction findPair(items, key) {\n var k = key instanceof Scalar ? key.value : key;\n\n var _iterator = _createForOfIteratorHelper(items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var it = _step.value;\n\n if (it instanceof Pair) {\n if (it.key === key || it.key === k) return it;\n if (it.key && it.key.value === k) return it;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return undefined;\n}\nvar YAMLMap = /*#__PURE__*/function (_Collection) {\n _inherits(YAMLMap, _Collection);\n\n var _super = _createSuper(YAMLMap);\n\n function YAMLMap() {\n _classCallCheck(this, YAMLMap);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(YAMLMap, [{\n key: \"add\",\n value: function add(pair, overwrite) {\n if (!pair) pair = new Pair(pair);else if (!(pair instanceof Pair)) pair = new Pair(pair.key || pair, pair.value);\n var prev = findPair(this.items, pair.key);\n var sortEntries = this.schema && this.schema.sortMapEntries;\n\n if (prev) {\n if (overwrite) prev.value = pair.value;else throw new Error(\"Key \".concat(pair.key, \" already set\"));\n } else if (sortEntries) {\n var i = this.items.findIndex(function (item) {\n return sortEntries(pair, item) < 0;\n });\n if (i === -1) this.items.push(pair);else this.items.splice(i, 0, pair);\n } else {\n this.items.push(pair);\n }\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n var it = findPair(this.items, key);\n if (!it) return false;\n var del = this.items.splice(this.items.indexOf(it), 1);\n return del.length > 0;\n }\n }, {\n key: \"get\",\n value: function get(key, keepScalar) {\n var it = findPair(this.items, key);\n var node = it && it.value;\n return !keepScalar && node instanceof Scalar ? node.value : node;\n }\n }, {\n key: \"has\",\n value: function has(key) {\n return !!findPair(this.items, key);\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n this.add(new Pair(key, value), true);\n }\n /**\n * @param {*} arg ignored\n * @param {*} ctx Conversion context, originally set in Document#toJSON()\n * @param {Class} Type If set, forces the returned collection type\n * @returns {*} Instance of Type, Map, or Object\n */\n\n }, {\n key: \"toJSON\",\n value: function toJSON(_, ctx, Type) {\n var map = Type ? new Type() : ctx && ctx.mapAsMap ? new Map() : {};\n if (ctx && ctx.onCreate) ctx.onCreate(map);\n\n var _iterator2 = _createForOfIteratorHelper(this.items),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var item = _step2.value;\n item.addToJSMap(ctx, map);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return map;\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment, onChompKeep) {\n if (!ctx) return JSON.stringify(this);\n\n var _iterator3 = _createForOfIteratorHelper(this.items),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var item = _step3.value;\n if (!(item instanceof Pair)) throw new Error(\"Map items must all be pairs; found \".concat(JSON.stringify(item), \" instead\"));\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n return _get(_getPrototypeOf(YAMLMap.prototype), \"toString\", this).call(this, ctx, {\n blockItem: function blockItem(n) {\n return n.str;\n },\n flowChars: {\n start: '{',\n end: '}'\n },\n isMap: true,\n itemIndent: ctx.indent || ''\n }, onComment, onChompKeep);\n }\n }]);\n\n return YAMLMap;\n}(Collection);\n\nvar MERGE_KEY = '<<';\nvar Merge = /*#__PURE__*/function (_Pair) {\n _inherits(Merge, _Pair);\n\n var _super = _createSuper(Merge);\n\n function Merge(pair) {\n var _this;\n\n _classCallCheck(this, Merge);\n\n if (pair instanceof Pair) {\n var seq = pair.value;\n\n if (!(seq instanceof YAMLSeq)) {\n seq = new YAMLSeq();\n seq.items.push(pair.value);\n seq.range = pair.value.range;\n }\n\n _this = _super.call(this, pair.key, seq);\n _this.range = pair.range;\n } else {\n _this = _super.call(this, new Scalar(MERGE_KEY), new YAMLSeq());\n }\n\n _this.type = Pair.Type.MERGE_PAIR;\n return _possibleConstructorReturn(_this);\n } // If the value associated with a merge key is a single mapping node, each of\n // its key/value pairs is inserted into the current mapping, unless the key\n // already exists in it. If the value associated with the merge key is a\n // sequence, then this sequence is expected to contain mapping nodes and each\n // of these nodes is merged in turn according to its order in the sequence.\n // Keys in mapping nodes earlier in the sequence override keys specified in\n // later mapping nodes. -- http://yaml.org/type/merge.html\n\n\n _createClass(Merge, [{\n key: \"addToJSMap\",\n value: function addToJSMap(ctx, map) {\n var _iterator = _createForOfIteratorHelper(this.value.items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var source = _step.value.source;\n if (!(source instanceof YAMLMap)) throw new Error('Merge sources must be maps');\n var srcMap = source.toJSON(null, ctx, Map);\n\n var _iterator2 = _createForOfIteratorHelper(srcMap),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _step2$value = _slicedToArray(_step2.value, 2),\n key = _step2$value[0],\n value = _step2$value[1];\n\n if (map instanceof Map) {\n if (!map.has(key)) map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else if (!Object.prototype.hasOwnProperty.call(map, key)) {\n Object.defineProperty(map, key, {\n value: value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return map;\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment) {\n var seq = this.value;\n if (seq.items.length > 1) return _get(_getPrototypeOf(Merge.prototype), \"toString\", this).call(this, ctx, onComment);\n this.value = seq.items[0];\n\n var str = _get(_getPrototypeOf(Merge.prototype), \"toString\", this).call(this, ctx, onComment);\n\n this.value = seq;\n return str;\n }\n }]);\n\n return Merge;\n}(Pair);\n\nvar binaryOptions = {\n defaultType: Type.BLOCK_LITERAL,\n lineWidth: 76\n};\nvar boolOptions = {\n trueStr: 'true',\n falseStr: 'false'\n};\nvar intOptions = {\n asBigInt: false\n};\nvar nullOptions = {\n nullStr: 'null'\n};\nvar strOptions = {\n defaultType: Type.PLAIN,\n doubleQuoted: {\n jsonEncoding: false,\n minMultiLineLength: 40\n },\n fold: {\n lineWidth: 80,\n minContentWidth: 20\n }\n};\n\nfunction resolveScalar(str, tags, scalarFallback) {\n var _iterator = _createForOfIteratorHelper(tags),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _step.value,\n format = _step$value.format,\n test = _step$value.test,\n resolve = _step$value.resolve;\n\n if (test) {\n var match = str.match(test);\n\n if (match) {\n var res = resolve.apply(null, match);\n if (!(res instanceof Scalar)) res = new Scalar(res);\n if (format) res.format = format;\n return res;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (scalarFallback) str = scalarFallback(str);\n return new Scalar(str);\n}\n\nvar FOLD_FLOW = 'flow';\nvar FOLD_BLOCK = 'block';\nvar FOLD_QUOTED = 'quoted'; // presumes i+1 is at the start of a line\n// returns index of last newline in more-indented block\n\nvar consumeMoreIndentedLines = function consumeMoreIndentedLines(text, i) {\n var ch = text[i + 1];\n\n while (ch === ' ' || ch === '\\t') {\n do {\n ch = text[i += 1];\n } while (ch && ch !== '\\n');\n\n ch = text[i + 1];\n }\n\n return i;\n};\n/**\n * Tries to keep input at up to `lineWidth` characters, splitting only on spaces\n * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are\n * terminated with `\\n` and started with `indent`.\n *\n * @param {string} text\n * @param {string} indent\n * @param {string} [mode='flow'] `'block'` prevents more-indented lines\n * from being folded; `'quoted'` allows for `\\` escapes, including escaped\n * newlines\n * @param {Object} options\n * @param {number} [options.indentAtStart] Accounts for leading contents on\n * the first line, defaulting to `indent.length`\n * @param {number} [options.lineWidth=80]\n * @param {number} [options.minContentWidth=20] Allow highly indented lines to\n * stretch the line width or indent content from the start\n * @param {function} options.onFold Called once if the text is folded\n * @param {function} options.onFold Called once if any line of text exceeds\n * lineWidth characters\n */\n\n\nfunction foldFlowLines(text, indent, mode, _ref) {\n var indentAtStart = _ref.indentAtStart,\n _ref$lineWidth = _ref.lineWidth,\n lineWidth = _ref$lineWidth === void 0 ? 80 : _ref$lineWidth,\n _ref$minContentWidth = _ref.minContentWidth,\n minContentWidth = _ref$minContentWidth === void 0 ? 20 : _ref$minContentWidth,\n onFold = _ref.onFold,\n onOverflow = _ref.onOverflow;\n if (!lineWidth || lineWidth < 0) return text;\n var endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);\n if (text.length <= endStep) return text;\n var folds = [];\n var escapedFolds = {};\n var end = lineWidth - indent.length;\n\n if (typeof indentAtStart === 'number') {\n if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0);else end = lineWidth - indentAtStart;\n }\n\n var split = undefined;\n var prev = undefined;\n var overflow = false;\n var i = -1;\n var escStart = -1;\n var escEnd = -1;\n\n if (mode === FOLD_BLOCK) {\n i = consumeMoreIndentedLines(text, i);\n if (i !== -1) end = i + endStep;\n }\n\n for (var ch; ch = text[i += 1];) {\n if (mode === FOLD_QUOTED && ch === '\\\\') {\n escStart = i;\n\n switch (text[i + 1]) {\n case 'x':\n i += 3;\n break;\n\n case 'u':\n i += 5;\n break;\n\n case 'U':\n i += 9;\n break;\n\n default:\n i += 1;\n }\n\n escEnd = i;\n }\n\n if (ch === '\\n') {\n if (mode === FOLD_BLOCK) i = consumeMoreIndentedLines(text, i);\n end = i + endStep;\n split = undefined;\n } else {\n if (ch === ' ' && prev && prev !== ' ' && prev !== '\\n' && prev !== '\\t') {\n // space surrounded by non-space can be replaced with newline + indent\n var next = text[i + 1];\n if (next && next !== ' ' && next !== '\\n' && next !== '\\t') split = i;\n }\n\n if (i >= end) {\n if (split) {\n folds.push(split);\n end = split + endStep;\n split = undefined;\n } else if (mode === FOLD_QUOTED) {\n // white-space collected at end may stretch past lineWidth\n while (prev === ' ' || prev === '\\t') {\n prev = ch;\n ch = text[i += 1];\n overflow = true;\n } // Account for newline escape, but don't break preceding escape\n\n\n var j = i > escEnd + 1 ? i - 2 : escStart - 1; // Bail out if lineWidth & minContentWidth are shorter than an escape string\n\n if (escapedFolds[j]) return text;\n folds.push(j);\n escapedFolds[j] = true;\n end = j + endStep;\n split = undefined;\n } else {\n overflow = true;\n }\n }\n }\n\n prev = ch;\n }\n\n if (overflow && onOverflow) onOverflow();\n if (folds.length === 0) return text;\n if (onFold) onFold();\n var res = text.slice(0, folds[0]);\n\n for (var _i = 0; _i < folds.length; ++_i) {\n var fold = folds[_i];\n\n var _end = folds[_i + 1] || text.length;\n\n if (fold === 0) res = \"\\n\".concat(indent).concat(text.slice(0, _end));else {\n if (mode === FOLD_QUOTED && escapedFolds[fold]) res += \"\".concat(text[fold], \"\\\\\");\n res += \"\\n\".concat(indent).concat(text.slice(fold + 1, _end));\n }\n }\n\n return res;\n}\n\nvar getFoldOptions = function getFoldOptions(_ref) {\n var indentAtStart = _ref.indentAtStart;\n return indentAtStart ? Object.assign({\n indentAtStart: indentAtStart\n }, strOptions.fold) : strOptions.fold;\n}; // Also checks for lines starting with %, as parsing the output as YAML 1.1 will\n// presume that's starting a new document.\n\n\nvar containsDocumentMarker = function containsDocumentMarker(str) {\n return /^(%|---|\\.\\.\\.)/m.test(str);\n};\n\nfunction lineLengthOverLimit(str, lineWidth, indentLength) {\n if (!lineWidth || lineWidth < 0) return false;\n var limit = lineWidth - indentLength;\n var strLen = str.length;\n if (strLen <= limit) return false;\n\n for (var i = 0, start = 0; i < strLen; ++i) {\n if (str[i] === '\\n') {\n if (i - start > limit) return true;\n start = i + 1;\n if (strLen - start <= limit) return false;\n }\n }\n\n return true;\n}\n\nfunction doubleQuotedString(value, ctx) {\n var implicitKey = ctx.implicitKey;\n var _strOptions$doubleQuo = strOptions.doubleQuoted,\n jsonEncoding = _strOptions$doubleQuo.jsonEncoding,\n minMultiLineLength = _strOptions$doubleQuo.minMultiLineLength;\n var json = JSON.stringify(value);\n if (jsonEncoding) return json;\n var indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n var str = '';\n var start = 0;\n\n for (var i = 0, ch = json[i]; ch; ch = json[++i]) {\n if (ch === ' ' && json[i + 1] === '\\\\' && json[i + 2] === 'n') {\n // space before newline needs to be escaped to not be folded\n str += json.slice(start, i) + '\\\\ ';\n i += 1;\n start = i;\n ch = '\\\\';\n }\n\n if (ch === '\\\\') switch (json[i + 1]) {\n case 'u':\n {\n str += json.slice(start, i);\n var code = json.substr(i + 2, 4);\n\n switch (code) {\n case '0000':\n str += '\\\\0';\n break;\n\n case '0007':\n str += '\\\\a';\n break;\n\n case '000b':\n str += '\\\\v';\n break;\n\n case '001b':\n str += '\\\\e';\n break;\n\n case '0085':\n str += '\\\\N';\n break;\n\n case '00a0':\n str += '\\\\_';\n break;\n\n case '2028':\n str += '\\\\L';\n break;\n\n case '2029':\n str += '\\\\P';\n break;\n\n default:\n if (code.substr(0, 2) === '00') str += '\\\\x' + code.substr(2);else str += json.substr(i, 6);\n }\n\n i += 5;\n start = i + 1;\n }\n break;\n\n case 'n':\n if (implicitKey || json[i + 2] === '\"' || json.length < minMultiLineLength) {\n i += 1;\n } else {\n // folding will eat first newline\n str += json.slice(start, i) + '\\n\\n';\n\n while (json[i + 2] === '\\\\' && json[i + 3] === 'n' && json[i + 4] !== '\"') {\n str += '\\n';\n i += 2;\n }\n\n str += indent; // space after newline needs to be escaped to not be folded\n\n if (json[i + 2] === ' ') str += '\\\\';\n i += 1;\n start = i + 1;\n }\n\n break;\n\n default:\n i += 1;\n }\n }\n\n str = start ? str + json.slice(start) : json;\n return implicitKey ? str : foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx));\n}\n\nfunction singleQuotedString(value, ctx) {\n if (ctx.implicitKey) {\n if (/\\n/.test(value)) return doubleQuotedString(value, ctx);\n } else {\n // single quoted string can't have leading or trailing whitespace around newline\n if (/[ \\t]\\n|\\n[ \\t]/.test(value)) return doubleQuotedString(value, ctx);\n }\n\n var indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n var res = \"'\" + value.replace(/'/g, \"''\").replace(/\\n+/g, \"$&\\n\".concat(indent)) + \"'\";\n return ctx.implicitKey ? res : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx));\n}\n\nfunction blockString(_ref2, ctx, onComment, onChompKeep) {\n var comment = _ref2.comment,\n type = _ref2.type,\n value = _ref2.value;\n\n // 1. Block can't end in whitespace unless the last line is non-empty.\n // 2. Strings consisting of only whitespace are best rendered explicitly.\n if (/\\n[\\t ]+$/.test(value) || /^\\s*$/.test(value)) {\n return doubleQuotedString(value, ctx);\n }\n\n var indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : '');\n var indentSize = indent ? '2' : '1'; // root is at -1\n\n var literal = type === Type.BLOCK_FOLDED ? false : type === Type.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, strOptions.fold.lineWidth, indent.length);\n var header = literal ? '|' : '>';\n if (!value) return header + '\\n';\n var wsStart = '';\n var wsEnd = '';\n value = value.replace(/[\\n\\t ]*$/, function (ws) {\n var n = ws.indexOf('\\n');\n\n if (n === -1) {\n header += '-'; // strip\n } else if (value === ws || n !== ws.length - 1) {\n header += '+'; // keep\n\n if (onChompKeep) onChompKeep();\n }\n\n wsEnd = ws.replace(/\\n$/, '');\n return '';\n }).replace(/^[\\n ]*/, function (ws) {\n if (ws.indexOf(' ') !== -1) header += indentSize;\n var m = ws.match(/ +$/);\n\n if (m) {\n wsStart = ws.slice(0, -m[0].length);\n return m[0];\n } else {\n wsStart = ws;\n return '';\n }\n });\n if (wsEnd) wsEnd = wsEnd.replace(/\\n+(?!\\n|$)/g, \"$&\".concat(indent));\n if (wsStart) wsStart = wsStart.replace(/\\n+/g, \"$&\".concat(indent));\n\n if (comment) {\n header += ' #' + comment.replace(/ ?[\\r\\n]+/g, ' ');\n if (onComment) onComment();\n }\n\n if (!value) return \"\".concat(header).concat(indentSize, \"\\n\").concat(indent).concat(wsEnd);\n\n if (literal) {\n value = value.replace(/\\n+/g, \"$&\".concat(indent));\n return \"\".concat(header, \"\\n\").concat(indent).concat(wsStart).concat(value).concat(wsEnd);\n }\n\n value = value.replace(/\\n+/g, '\\n$&').replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g, '$1$2') // more-indented lines aren't folded\n // ^ ind.line ^ empty ^ capture next empty lines only at end of indent\n .replace(/\\n+/g, \"$&\".concat(indent));\n var body = foldFlowLines(\"\".concat(wsStart).concat(value).concat(wsEnd), indent, FOLD_BLOCK, strOptions.fold);\n return \"\".concat(header, \"\\n\").concat(indent).concat(body);\n}\n\nfunction plainString(item, ctx, onComment, onChompKeep) {\n var comment = item.comment,\n type = item.type,\n value = item.value;\n var actualString = ctx.actualString,\n implicitKey = ctx.implicitKey,\n indent = ctx.indent,\n inFlow = ctx.inFlow;\n\n if (implicitKey && /[\\n[\\]{},]/.test(value) || inFlow && /[[\\]{},]/.test(value)) {\n return doubleQuotedString(value, ctx);\n }\n\n if (!value || /^[\\n\\t ,[\\]{}#&*!|>'\"%@`]|^[?-]$|^[?-][ \\t]|[\\n:][ \\t]|[ \\t]\\n|[\\n\\t ]#|[\\n\\t :]$/.test(value)) {\n // not allowed:\n // - empty string, '-' or '?'\n // - start with an indicator character (except [?:-]) or /[?-] /\n // - '\\n ', ': ' or ' \\n' anywhere\n // - '#' not preceded by a non-space char\n // - end with ' ' or ':'\n return implicitKey || inFlow || value.indexOf('\\n') === -1 ? value.indexOf('\"') !== -1 && value.indexOf(\"'\") === -1 ? singleQuotedString(value, ctx) : doubleQuotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);\n }\n\n if (!implicitKey && !inFlow && type !== Type.PLAIN && value.indexOf('\\n') !== -1) {\n // Where allowed & type not set explicitly, prefer block style for multiline strings\n return blockString(item, ctx, onComment, onChompKeep);\n }\n\n if (indent === '' && containsDocumentMarker(value)) {\n ctx.forceBlockIndent = true;\n return blockString(item, ctx, onComment, onChompKeep);\n }\n\n var str = value.replace(/\\n+/g, \"$&\\n\".concat(indent)); // Verify that output will be parsed as a string, as e.g. plain numbers and\n // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),\n // and others in v1.1.\n\n if (actualString) {\n var tags = ctx.doc.schema.tags;\n var resolved = resolveScalar(str, tags, tags.scalarFallback).value;\n if (typeof resolved !== 'string') return doubleQuotedString(value, ctx);\n }\n\n var body = implicitKey ? str : foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx));\n\n if (comment && !inFlow && (body.indexOf('\\n') !== -1 || comment.indexOf('\\n') !== -1)) {\n if (onComment) onComment();\n return addCommentBefore(body, indent, comment);\n }\n\n return body;\n}\n\nfunction stringifyString(item, ctx, onComment, onChompKeep) {\n var defaultType = strOptions.defaultType;\n var implicitKey = ctx.implicitKey,\n inFlow = ctx.inFlow;\n var _item = item,\n type = _item.type,\n value = _item.value;\n\n if (typeof value !== 'string') {\n value = String(value);\n item = Object.assign({}, item, {\n value: value\n });\n }\n\n var _stringify = function _stringify(_type) {\n switch (_type) {\n case Type.BLOCK_FOLDED:\n case Type.BLOCK_LITERAL:\n return blockString(item, ctx, onComment, onChompKeep);\n\n case Type.QUOTE_DOUBLE:\n return doubleQuotedString(value, ctx);\n\n case Type.QUOTE_SINGLE:\n return singleQuotedString(value, ctx);\n\n case Type.PLAIN:\n return plainString(item, ctx, onComment, onChompKeep);\n\n default:\n return null;\n }\n };\n\n if (type !== Type.QUOTE_DOUBLE && /[\\x00-\\x08\\x0b-\\x1f\\x7f-\\x9f]/.test(value)) {\n // force double quotes on control characters\n type = Type.QUOTE_DOUBLE;\n } else if ((implicitKey || inFlow) && (type === Type.BLOCK_FOLDED || type === Type.BLOCK_LITERAL)) {\n // should not happen; blocks are not valid inside flow containers\n type = Type.QUOTE_DOUBLE;\n }\n\n var res = _stringify(type);\n\n if (res === null) {\n res = _stringify(defaultType);\n if (res === null) throw new Error(\"Unsupported default string type \".concat(defaultType));\n }\n\n return res;\n}\n\nfunction stringifyNumber(_ref) {\n var format = _ref.format,\n minFractionDigits = _ref.minFractionDigits,\n tag = _ref.tag,\n value = _ref.value;\n if (typeof value === 'bigint') return String(value);\n if (!isFinite(value)) return isNaN(value) ? '.nan' : value < 0 ? '-.inf' : '.inf';\n var n = JSON.stringify(value);\n\n if (!format && minFractionDigits && (!tag || tag === 'tag:yaml.org,2002:float') && /^\\d/.test(n)) {\n var i = n.indexOf('.');\n\n if (i < 0) {\n i = n.length;\n n += '.';\n }\n\n var d = minFractionDigits - (n.length - i - 1);\n\n while (d-- > 0) {\n n += '0';\n }\n }\n\n return n;\n}\n\nfunction checkFlowCollectionEnd(errors, cst) {\n var char, name;\n\n switch (cst.type) {\n case Type.FLOW_MAP:\n char = '}';\n name = 'flow map';\n break;\n\n case Type.FLOW_SEQ:\n char = ']';\n name = 'flow sequence';\n break;\n\n default:\n errors.push(new YAMLSemanticError(cst, 'Not a flow collection!?'));\n return;\n }\n\n var lastItem;\n\n for (var i = cst.items.length - 1; i >= 0; --i) {\n var item = cst.items[i];\n\n if (!item || item.type !== Type.COMMENT) {\n lastItem = item;\n break;\n }\n }\n\n if (lastItem && lastItem.char !== char) {\n var msg = \"Expected \".concat(name, \" to end with \").concat(char);\n var err;\n\n if (typeof lastItem.offset === 'number') {\n err = new YAMLSemanticError(cst, msg);\n err.offset = lastItem.offset + 1;\n } else {\n err = new YAMLSemanticError(lastItem, msg);\n if (lastItem.range && lastItem.range.end) err.offset = lastItem.range.end - lastItem.range.start;\n }\n\n errors.push(err);\n }\n}\nfunction checkFlowCommentSpace(errors, comment) {\n var prev = comment.context.src[comment.range.start - 1];\n\n if (prev !== '\\n' && prev !== '\\t' && prev !== ' ') {\n var msg = 'Comments must be separated from other tokens by white space characters';\n errors.push(new YAMLSemanticError(comment, msg));\n }\n}\nfunction getLongKeyError(source, key) {\n var sk = String(key);\n var k = sk.substr(0, 8) + '...' + sk.substr(-8);\n return new YAMLSemanticError(source, \"The \\\"\".concat(k, \"\\\" key is too long\"));\n}\nfunction resolveComments(collection, comments) {\n var _iterator = _createForOfIteratorHelper(comments),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _step.value,\n afterKey = _step$value.afterKey,\n before = _step$value.before,\n comment = _step$value.comment;\n var item = collection.items[before];\n\n if (!item) {\n if (comment !== undefined) {\n if (collection.comment) collection.comment += '\\n' + comment;else collection.comment = comment;\n }\n } else {\n if (afterKey && item.value) item = item.value;\n\n if (comment === undefined) {\n if (afterKey || !item.commentBefore) item.spaceBefore = true;\n } else {\n if (item.commentBefore) item.commentBefore += '\\n' + comment;else item.commentBefore = comment;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n}\n\n// on error, will return { str: string, errors: Error[] }\nfunction resolveString(doc, node) {\n var res = node.strValue;\n if (!res) return '';\n if (typeof res === 'string') return res;\n res.errors.forEach(function (error) {\n if (!error.source) error.source = node;\n doc.errors.push(error);\n });\n return res.str;\n}\n\nfunction resolveTagHandle(doc, node) {\n var _node$tag = node.tag,\n handle = _node$tag.handle,\n suffix = _node$tag.suffix;\n var prefix = doc.tagPrefixes.find(function (p) {\n return p.handle === handle;\n });\n\n if (!prefix) {\n var dtp = doc.getDefaults().tagPrefixes;\n if (dtp) prefix = dtp.find(function (p) {\n return p.handle === handle;\n });\n if (!prefix) throw new YAMLSemanticError(node, \"The \".concat(handle, \" tag handle is non-default and was not declared.\"));\n }\n\n if (!suffix) throw new YAMLSemanticError(node, \"The \".concat(handle, \" tag has no suffix.\"));\n\n if (handle === '!' && (doc.version || doc.options.version) === '1.0') {\n if (suffix[0] === '^') {\n doc.warnings.push(new YAMLWarning(node, 'YAML 1.0 ^ tag expansion is not supported'));\n return suffix;\n }\n\n if (/[:/]/.test(suffix)) {\n // word/foo -> tag:word.yaml.org,2002:foo\n var vocab = suffix.match(/^([a-z0-9-]+)\\/(.*)/i);\n return vocab ? \"tag:\".concat(vocab[1], \".yaml.org,2002:\").concat(vocab[2]) : \"tag:\".concat(suffix);\n }\n }\n\n return prefix.prefix + decodeURIComponent(suffix);\n}\n\nfunction resolveTagName(doc, node) {\n var tag = node.tag,\n type = node.type;\n var nonSpecific = false;\n\n if (tag) {\n var handle = tag.handle,\n suffix = tag.suffix,\n verbatim = tag.verbatim;\n\n if (verbatim) {\n if (verbatim !== '!' && verbatim !== '!!') return verbatim;\n var msg = \"Verbatim tags aren't resolved, so \".concat(verbatim, \" is invalid.\");\n doc.errors.push(new YAMLSemanticError(node, msg));\n } else if (handle === '!' && !suffix) {\n nonSpecific = true;\n } else {\n try {\n return resolveTagHandle(doc, node);\n } catch (error) {\n doc.errors.push(error);\n }\n }\n }\n\n switch (type) {\n case Type.BLOCK_FOLDED:\n case Type.BLOCK_LITERAL:\n case Type.QUOTE_DOUBLE:\n case Type.QUOTE_SINGLE:\n return defaultTags.STR;\n\n case Type.FLOW_MAP:\n case Type.MAP:\n return defaultTags.MAP;\n\n case Type.FLOW_SEQ:\n case Type.SEQ:\n return defaultTags.SEQ;\n\n case Type.PLAIN:\n return nonSpecific ? defaultTags.STR : null;\n\n default:\n return null;\n }\n}\n\nfunction resolveByTagName(doc, node, tagName) {\n var tags = doc.schema.tags;\n var matchWithTest = [];\n\n var _iterator = _createForOfIteratorHelper(tags),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var tag = _step.value;\n\n if (tag.tag === tagName) {\n if (tag.test) matchWithTest.push(tag);else {\n var res = tag.resolve(doc, node);\n return res instanceof Collection ? res : new Scalar(res);\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var str = resolveString(doc, node);\n if (typeof str === 'string' && matchWithTest.length > 0) return resolveScalar(str, matchWithTest, tags.scalarFallback);\n return null;\n}\n\nfunction getFallbackTagName(_ref) {\n var type = _ref.type;\n\n switch (type) {\n case Type.FLOW_MAP:\n case Type.MAP:\n return defaultTags.MAP;\n\n case Type.FLOW_SEQ:\n case Type.SEQ:\n return defaultTags.SEQ;\n\n default:\n return defaultTags.STR;\n }\n}\n\nfunction resolveTag(doc, node, tagName) {\n try {\n var res = resolveByTagName(doc, node, tagName);\n\n if (res) {\n if (tagName && node.tag) res.tag = tagName;\n return res;\n }\n } catch (error) {\n /* istanbul ignore if */\n if (!error.source) error.source = node;\n doc.errors.push(error);\n return null;\n }\n\n try {\n var fallback = getFallbackTagName(node);\n if (!fallback) throw new Error(\"The tag \".concat(tagName, \" is unavailable\"));\n var msg = \"The tag \".concat(tagName, \" is unavailable, falling back to \").concat(fallback);\n doc.warnings.push(new YAMLWarning(node, msg));\n\n var _res = resolveByTagName(doc, node, fallback);\n\n _res.tag = tagName;\n return _res;\n } catch (error) {\n var refError = new YAMLReferenceError(node, error.message);\n refError.stack = error.stack;\n doc.errors.push(refError);\n return null;\n }\n}\n\nvar isCollectionItem = function isCollectionItem(node) {\n if (!node) return false;\n var type = node.type;\n return type === Type.MAP_KEY || type === Type.MAP_VALUE || type === Type.SEQ_ITEM;\n};\n\nfunction resolveNodeProps(errors, node) {\n var comments = {\n before: [],\n after: []\n };\n var hasAnchor = false;\n var hasTag = false;\n var props = isCollectionItem(node.context.parent) ? node.context.parent.props.concat(node.props) : node.props;\n\n var _iterator = _createForOfIteratorHelper(props),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _step.value,\n start = _step$value.start,\n end = _step$value.end;\n\n switch (node.context.src[start]) {\n case Char.COMMENT:\n {\n if (!node.commentHasRequiredWhitespace(start)) {\n var msg = 'Comments must be separated from other tokens by white space characters';\n errors.push(new YAMLSemanticError(node, msg));\n }\n\n var header = node.header,\n valueRange = node.valueRange;\n var cc = valueRange && (start > valueRange.start || header && start > header.start) ? comments.after : comments.before;\n cc.push(node.context.src.slice(start + 1, end));\n break;\n }\n // Actual anchor & tag resolution is handled by schema, here we just complain\n\n case Char.ANCHOR:\n if (hasAnchor) {\n var _msg = 'A node can have at most one anchor';\n errors.push(new YAMLSemanticError(node, _msg));\n }\n\n hasAnchor = true;\n break;\n\n case Char.TAG:\n if (hasTag) {\n var _msg2 = 'A node can have at most one tag';\n errors.push(new YAMLSemanticError(node, _msg2));\n }\n\n hasTag = true;\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return {\n comments: comments,\n hasAnchor: hasAnchor,\n hasTag: hasTag\n };\n}\n\nfunction resolveNodeValue(doc, node) {\n var anchors = doc.anchors,\n errors = doc.errors,\n schema = doc.schema;\n\n if (node.type === Type.ALIAS) {\n var name = node.rawValue;\n var src = anchors.getNode(name);\n\n if (!src) {\n var msg = \"Aliased anchor not found: \".concat(name);\n errors.push(new YAMLReferenceError(node, msg));\n return null;\n } // Lazy resolution for circular references\n\n\n var res = new Alias(src);\n\n anchors._cstAliases.push(res);\n\n return res;\n }\n\n var tagName = resolveTagName(doc, node);\n if (tagName) return resolveTag(doc, node, tagName);\n\n if (node.type !== Type.PLAIN) {\n var _msg3 = \"Failed to resolve \".concat(node.type, \" node here\");\n\n errors.push(new YAMLSyntaxError(node, _msg3));\n return null;\n }\n\n try {\n var str = resolveString(doc, node);\n return resolveScalar(str, schema.tags, schema.tags.scalarFallback);\n } catch (error) {\n if (!error.source) error.source = node;\n errors.push(error);\n return null;\n }\n} // sets node.resolved on success\n\n\nfunction resolveNode(doc, node) {\n if (!node) return null;\n if (node.error) doc.errors.push(node.error);\n\n var _resolveNodeProps = resolveNodeProps(doc.errors, node),\n comments = _resolveNodeProps.comments,\n hasAnchor = _resolveNodeProps.hasAnchor,\n hasTag = _resolveNodeProps.hasTag;\n\n if (hasAnchor) {\n var anchors = doc.anchors;\n var name = node.anchor;\n var prev = anchors.getNode(name); // At this point, aliases for any preceding node with the same anchor\n // name have already been resolved, so it may safely be renamed.\n\n if (prev) anchors.map[anchors.newName(name)] = prev; // During parsing, we need to store the CST node in anchors.map as\n // anchors need to be available during resolution to allow for\n // circular references.\n\n anchors.map[name] = node;\n }\n\n if (node.type === Type.ALIAS && (hasAnchor || hasTag)) {\n var msg = 'An alias node must not specify any properties';\n doc.errors.push(new YAMLSemanticError(node, msg));\n }\n\n var res = resolveNodeValue(doc, node);\n\n if (res) {\n res.range = [node.range.start, node.range.end];\n if (doc.options.keepCstNodes) res.cstNode = node;\n if (doc.options.keepNodeTypes) res.type = node.type;\n var cb = comments.before.join('\\n');\n\n if (cb) {\n res.commentBefore = res.commentBefore ? \"\".concat(res.commentBefore, \"\\n\").concat(cb) : cb;\n }\n\n var ca = comments.after.join('\\n');\n if (ca) res.comment = res.comment ? \"\".concat(res.comment, \"\\n\").concat(ca) : ca;\n }\n\n return node.resolved = res;\n}\n\nfunction resolveMap(doc, cst) {\n if (cst.type !== Type.MAP && cst.type !== Type.FLOW_MAP) {\n var msg = \"A \".concat(cst.type, \" node cannot be resolved as a mapping\");\n doc.errors.push(new YAMLSyntaxError(cst, msg));\n return null;\n }\n\n var _ref = cst.type === Type.FLOW_MAP ? resolveFlowMapItems(doc, cst) : resolveBlockMapItems(doc, cst),\n comments = _ref.comments,\n items = _ref.items;\n\n var map = new YAMLMap();\n map.items = items;\n resolveComments(map, comments);\n var hasCollectionKey = false;\n\n for (var i = 0; i < items.length; ++i) {\n var iKey = items[i].key;\n if (iKey instanceof Collection) hasCollectionKey = true;\n\n if (doc.schema.merge && iKey && iKey.value === MERGE_KEY) {\n items[i] = new Merge(items[i]);\n var sources = items[i].value.items;\n var error = null;\n sources.some(function (node) {\n if (node instanceof Alias) {\n // During parsing, alias sources are CST nodes; to account for\n // circular references their resolved values can't be used here.\n var type = node.source.type;\n if (type === Type.MAP || type === Type.FLOW_MAP) return false;\n return error = 'Merge nodes aliases can only point to maps';\n }\n\n return error = 'Merge nodes can only have Alias nodes as values';\n });\n if (error) doc.errors.push(new YAMLSemanticError(cst, error));\n } else {\n for (var j = i + 1; j < items.length; ++j) {\n var jKey = items[j].key;\n\n if (iKey === jKey || iKey && jKey && Object.prototype.hasOwnProperty.call(iKey, 'value') && iKey.value === jKey.value) {\n var _msg = \"Map keys must be unique; \\\"\".concat(iKey, \"\\\" is repeated\");\n\n doc.errors.push(new YAMLSemanticError(cst, _msg));\n break;\n }\n }\n }\n }\n\n if (hasCollectionKey && !doc.options.mapAsMap) {\n var warn = 'Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.';\n doc.warnings.push(new YAMLWarning(cst, warn));\n }\n\n cst.resolved = map;\n return map;\n}\n\nvar valueHasPairComment = function valueHasPairComment(_ref2) {\n var _ref2$context = _ref2.context,\n lineStart = _ref2$context.lineStart,\n node = _ref2$context.node,\n src = _ref2$context.src,\n props = _ref2.props;\n if (props.length === 0) return false;\n var start = props[0].start;\n if (node && start > node.valueRange.start) return false;\n if (src[start] !== Char.COMMENT) return false;\n\n for (var i = lineStart; i < start; ++i) {\n if (src[i] === '\\n') return false;\n }\n\n return true;\n};\n\nfunction resolvePairComment(item, pair) {\n if (!valueHasPairComment(item)) return;\n var comment = item.getPropValue(0, Char.COMMENT, true);\n var found = false;\n var cb = pair.value.commentBefore;\n\n if (cb && cb.startsWith(comment)) {\n pair.value.commentBefore = cb.substr(comment.length + 1);\n found = true;\n } else {\n var cc = pair.value.comment;\n\n if (!item.node && cc && cc.startsWith(comment)) {\n pair.value.comment = cc.substr(comment.length + 1);\n found = true;\n }\n }\n\n if (found) pair.comment = comment;\n}\n\nfunction resolveBlockMapItems(doc, cst) {\n var comments = [];\n var items = [];\n var key = undefined;\n var keyStart = null;\n\n for (var i = 0; i < cst.items.length; ++i) {\n var item = cst.items[i];\n\n switch (item.type) {\n case Type.BLANK_LINE:\n comments.push({\n afterKey: !!key,\n before: items.length\n });\n break;\n\n case Type.COMMENT:\n comments.push({\n afterKey: !!key,\n before: items.length,\n comment: item.comment\n });\n break;\n\n case Type.MAP_KEY:\n if (key !== undefined) items.push(new Pair(key));\n if (item.error) doc.errors.push(item.error);\n key = resolveNode(doc, item.node);\n keyStart = null;\n break;\n\n case Type.MAP_VALUE:\n {\n if (key === undefined) key = null;\n if (item.error) doc.errors.push(item.error);\n\n if (!item.context.atLineStart && item.node && item.node.type === Type.MAP && !item.node.context.atLineStart) {\n var msg = 'Nested mappings are not allowed in compact mappings';\n doc.errors.push(new YAMLSemanticError(item.node, msg));\n }\n\n var valueNode = item.node;\n\n if (!valueNode && item.props.length > 0) {\n // Comments on an empty mapping value need to be preserved, so we\n // need to construct a minimal empty node here to use instead of the\n // missing `item.node`. -- eemeli/yaml#19\n valueNode = new PlainValue(Type.PLAIN, []);\n valueNode.context = {\n parent: item,\n src: item.context.src\n };\n var pos = item.range.start + 1;\n valueNode.range = {\n start: pos,\n end: pos\n };\n valueNode.valueRange = {\n start: pos,\n end: pos\n };\n\n if (typeof item.range.origStart === 'number') {\n var origPos = item.range.origStart + 1;\n valueNode.range.origStart = valueNode.range.origEnd = origPos;\n valueNode.valueRange.origStart = valueNode.valueRange.origEnd = origPos;\n }\n }\n\n var pair = new Pair(key, resolveNode(doc, valueNode));\n resolvePairComment(item, pair);\n items.push(pair);\n\n if (key && typeof keyStart === 'number') {\n if (item.range.start > keyStart + 1024) doc.errors.push(getLongKeyError(cst, key));\n }\n\n key = undefined;\n keyStart = null;\n }\n break;\n\n default:\n if (key !== undefined) items.push(new Pair(key));\n key = resolveNode(doc, item);\n keyStart = item.range.start;\n if (item.error) doc.errors.push(item.error);\n\n next: for (var j = i + 1;; ++j) {\n var nextItem = cst.items[j];\n\n switch (nextItem && nextItem.type) {\n case Type.BLANK_LINE:\n case Type.COMMENT:\n continue next;\n\n case Type.MAP_VALUE:\n break next;\n\n default:\n {\n var _msg2 = 'Implicit map keys need to be followed by map values';\n doc.errors.push(new YAMLSemanticError(item, _msg2));\n break next;\n }\n }\n }\n\n if (item.valueRangeContainsNewline) {\n var _msg3 = 'Implicit map keys need to be on a single line';\n doc.errors.push(new YAMLSemanticError(item, _msg3));\n }\n\n }\n }\n\n if (key !== undefined) items.push(new Pair(key));\n return {\n comments: comments,\n items: items\n };\n}\n\nfunction resolveFlowMapItems(doc, cst) {\n var comments = [];\n var items = [];\n var key = undefined;\n var explicitKey = false;\n var next = '{';\n\n for (var i = 0; i < cst.items.length; ++i) {\n var item = cst.items[i];\n\n if (typeof item.char === 'string') {\n var char = item.char,\n offset = item.offset;\n\n if (char === '?' && key === undefined && !explicitKey) {\n explicitKey = true;\n next = ':';\n continue;\n }\n\n if (char === ':') {\n if (key === undefined) key = null;\n\n if (next === ':') {\n next = ',';\n continue;\n }\n } else {\n if (explicitKey) {\n if (key === undefined && char !== ',') key = null;\n explicitKey = false;\n }\n\n if (key !== undefined) {\n items.push(new Pair(key));\n key = undefined;\n\n if (char === ',') {\n next = ':';\n continue;\n }\n }\n }\n\n if (char === '}') {\n if (i === cst.items.length - 1) continue;\n } else if (char === next) {\n next = ':';\n continue;\n }\n\n var msg = \"Flow map contains an unexpected \".concat(char);\n var err = new YAMLSyntaxError(cst, msg);\n err.offset = offset;\n doc.errors.push(err);\n } else if (item.type === Type.BLANK_LINE) {\n comments.push({\n afterKey: !!key,\n before: items.length\n });\n } else if (item.type === Type.COMMENT) {\n checkFlowCommentSpace(doc.errors, item);\n comments.push({\n afterKey: !!key,\n before: items.length,\n comment: item.comment\n });\n } else if (key === undefined) {\n if (next === ',') doc.errors.push(new YAMLSemanticError(item, 'Separator , missing in flow map'));\n key = resolveNode(doc, item);\n } else {\n if (next !== ',') doc.errors.push(new YAMLSemanticError(item, 'Indicator : missing in flow map entry'));\n items.push(new Pair(key, resolveNode(doc, item)));\n key = undefined;\n explicitKey = false;\n }\n }\n\n checkFlowCollectionEnd(doc.errors, cst);\n if (key !== undefined) items.push(new Pair(key));\n return {\n comments: comments,\n items: items\n };\n}\n\nfunction resolveSeq(doc, cst) {\n if (cst.type !== Type.SEQ && cst.type !== Type.FLOW_SEQ) {\n var msg = \"A \".concat(cst.type, \" node cannot be resolved as a sequence\");\n doc.errors.push(new YAMLSyntaxError(cst, msg));\n return null;\n }\n\n var _ref = cst.type === Type.FLOW_SEQ ? resolveFlowSeqItems(doc, cst) : resolveBlockSeqItems(doc, cst),\n comments = _ref.comments,\n items = _ref.items;\n\n var seq = new YAMLSeq();\n seq.items = items;\n resolveComments(seq, comments);\n\n if (!doc.options.mapAsMap && items.some(function (it) {\n return it instanceof Pair && it.key instanceof Collection;\n })) {\n var warn = 'Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.';\n doc.warnings.push(new YAMLWarning(cst, warn));\n }\n\n cst.resolved = seq;\n return seq;\n}\n\nfunction resolveBlockSeqItems(doc, cst) {\n var comments = [];\n var items = [];\n\n for (var i = 0; i < cst.items.length; ++i) {\n var item = cst.items[i];\n\n switch (item.type) {\n case Type.BLANK_LINE:\n comments.push({\n before: items.length\n });\n break;\n\n case Type.COMMENT:\n comments.push({\n comment: item.comment,\n before: items.length\n });\n break;\n\n case Type.SEQ_ITEM:\n if (item.error) doc.errors.push(item.error);\n items.push(resolveNode(doc, item.node));\n\n if (item.hasProps) {\n var msg = 'Sequence items cannot have tags or anchors before the - indicator';\n doc.errors.push(new YAMLSemanticError(item, msg));\n }\n\n break;\n\n default:\n if (item.error) doc.errors.push(item.error);\n doc.errors.push(new YAMLSyntaxError(item, \"Unexpected \".concat(item.type, \" node in sequence\")));\n }\n }\n\n return {\n comments: comments,\n items: items\n };\n}\n\nfunction resolveFlowSeqItems(doc, cst) {\n var comments = [];\n var items = [];\n var explicitKey = false;\n var key = undefined;\n var keyStart = null;\n var next = '[';\n var prevItem = null;\n\n for (var i = 0; i < cst.items.length; ++i) {\n var item = cst.items[i];\n\n if (typeof item.char === 'string') {\n var char = item.char,\n offset = item.offset;\n\n if (char !== ':' && (explicitKey || key !== undefined)) {\n if (explicitKey && key === undefined) key = next ? items.pop() : null;\n items.push(new Pair(key));\n explicitKey = false;\n key = undefined;\n keyStart = null;\n }\n\n if (char === next) {\n next = null;\n } else if (!next && char === '?') {\n explicitKey = true;\n } else if (next !== '[' && char === ':' && key === undefined) {\n if (next === ',') {\n key = items.pop();\n\n if (key instanceof Pair) {\n var msg = 'Chaining flow sequence pairs is invalid';\n var err = new YAMLSemanticError(cst, msg);\n err.offset = offset;\n doc.errors.push(err);\n }\n\n if (!explicitKey && typeof keyStart === 'number') {\n var keyEnd = item.range ? item.range.start : item.offset;\n if (keyEnd > keyStart + 1024) doc.errors.push(getLongKeyError(cst, key));\n var src = prevItem.context.src;\n\n for (var _i = keyStart; _i < keyEnd; ++_i) {\n if (src[_i] === '\\n') {\n var _msg = 'Implicit keys of flow sequence pairs need to be on a single line';\n doc.errors.push(new YAMLSemanticError(prevItem, _msg));\n break;\n }\n }\n }\n } else {\n key = null;\n }\n\n keyStart = null;\n explicitKey = false;\n next = null;\n } else if (next === '[' || char !== ']' || i < cst.items.length - 1) {\n var _msg2 = \"Flow sequence contains an unexpected \".concat(char);\n\n var _err = new YAMLSyntaxError(cst, _msg2);\n\n _err.offset = offset;\n doc.errors.push(_err);\n }\n } else if (item.type === Type.BLANK_LINE) {\n comments.push({\n before: items.length\n });\n } else if (item.type === Type.COMMENT) {\n checkFlowCommentSpace(doc.errors, item);\n comments.push({\n comment: item.comment,\n before: items.length\n });\n } else {\n if (next) {\n var _msg3 = \"Expected a \".concat(next, \" in flow sequence\");\n\n doc.errors.push(new YAMLSemanticError(item, _msg3));\n }\n\n var value = resolveNode(doc, item);\n\n if (key === undefined) {\n items.push(value);\n prevItem = item;\n } else {\n items.push(new Pair(key, value));\n key = undefined;\n }\n\n keyStart = item.range.start;\n next = ',';\n }\n }\n\n checkFlowCollectionEnd(doc.errors, cst);\n if (key !== undefined) items.push(new Pair(key));\n return {\n comments: comments,\n items: items\n };\n}\n\nexport { Alias as A, Collection as C, Merge as M, Node as N, Pair as P, Scalar as S, YAMLSeq as Y, boolOptions as a, binaryOptions as b, stringifyString as c, YAMLMap as d, isEmptyPath as e, addComment as f, resolveMap as g, resolveSeq as h, intOptions as i, resolveString as j, stringifyNumber as k, findPair as l, nullOptions as n, resolveNode as r, strOptions as s, toJSON as t };\n","import { o as YAMLReferenceError, T as Type, g as YAMLSemanticError, _ as _createForOfIteratorHelper, e as _defineProperty, j as _inherits, k as _createSuper, c as _classCallCheck, p as _assertThisInitialized, b as _createClass, a as _typeof, l as _get, m as _getPrototypeOf } from './PlainValue-b8036b75.js';\nimport { j as resolveString, b as binaryOptions, c as stringifyString, h as resolveSeq, P as Pair, d as YAMLMap, Y as YAMLSeq, t as toJSON, S as Scalar, l as findPair, g as resolveMap, k as stringifyNumber } from './resolveSeq-492ab440.js';\n\n/* global atob, btoa, Buffer */\nvar binary = {\n identify: function identify(value) {\n return value instanceof Uint8Array;\n },\n // Buffer inherits from Uint8Array\n default: false,\n tag: 'tag:yaml.org,2002:binary',\n\n /**\n * Returns a Buffer in node and an Uint8Array in browsers\n *\n * To use the resulting buffer as an image, you'll want to do something like:\n *\n * const blob = new Blob([buffer], { type: 'image/jpeg' })\n * document.querySelector('#photo').src = URL.createObjectURL(blob)\n */\n resolve: function resolve(doc, node) {\n var src = resolveString(doc, node);\n\n if (typeof Buffer === 'function') {\n return Buffer.from(src, 'base64');\n } else if (typeof atob === 'function') {\n // On IE 11, atob() can't handle newlines\n var str = atob(src.replace(/[\\n\\r]/g, ''));\n var buffer = new Uint8Array(str.length);\n\n for (var i = 0; i < str.length; ++i) {\n buffer[i] = str.charCodeAt(i);\n }\n\n return buffer;\n } else {\n var msg = 'This environment does not support reading binary tags; either Buffer or atob is required';\n doc.errors.push(new YAMLReferenceError(node, msg));\n return null;\n }\n },\n options: binaryOptions,\n stringify: function stringify(_ref, ctx, onComment, onChompKeep) {\n var comment = _ref.comment,\n type = _ref.type,\n value = _ref.value;\n var src;\n\n if (typeof Buffer === 'function') {\n src = value instanceof Buffer ? value.toString('base64') : Buffer.from(value.buffer).toString('base64');\n } else if (typeof btoa === 'function') {\n var s = '';\n\n for (var i = 0; i < value.length; ++i) {\n s += String.fromCharCode(value[i]);\n }\n\n src = btoa(s);\n } else {\n throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');\n }\n\n if (!type) type = binaryOptions.defaultType;\n\n if (type === Type.QUOTE_DOUBLE) {\n value = src;\n } else {\n var lineWidth = binaryOptions.lineWidth;\n var n = Math.ceil(src.length / lineWidth);\n var lines = new Array(n);\n\n for (var _i = 0, o = 0; _i < n; ++_i, o += lineWidth) {\n lines[_i] = src.substr(o, lineWidth);\n }\n\n value = lines.join(type === Type.BLOCK_LITERAL ? '\\n' : ' ');\n }\n\n return stringifyString({\n comment: comment,\n type: type,\n value: value\n }, ctx, onComment, onChompKeep);\n }\n};\n\nfunction parsePairs(doc, cst) {\n var seq = resolveSeq(doc, cst);\n\n for (var i = 0; i < seq.items.length; ++i) {\n var item = seq.items[i];\n if (item instanceof Pair) continue;else if (item instanceof YAMLMap) {\n if (item.items.length > 1) {\n var msg = 'Each pair must have its own sequence indicator';\n throw new YAMLSemanticError(cst, msg);\n }\n\n var pair = item.items[0] || new Pair();\n if (item.commentBefore) pair.commentBefore = pair.commentBefore ? \"\".concat(item.commentBefore, \"\\n\").concat(pair.commentBefore) : item.commentBefore;\n if (item.comment) pair.comment = pair.comment ? \"\".concat(item.comment, \"\\n\").concat(pair.comment) : item.comment;\n item = pair;\n }\n seq.items[i] = item instanceof Pair ? item : new Pair(item);\n }\n\n return seq;\n}\nfunction createPairs(schema, iterable, ctx) {\n var pairs = new YAMLSeq(schema);\n pairs.tag = 'tag:yaml.org,2002:pairs';\n\n var _iterator = _createForOfIteratorHelper(iterable),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var it = _step.value;\n var key = void 0,\n value = void 0;\n\n if (Array.isArray(it)) {\n if (it.length === 2) {\n key = it[0];\n value = it[1];\n } else throw new TypeError(\"Expected [key, value] tuple: \".concat(it));\n } else if (it && it instanceof Object) {\n var keys = Object.keys(it);\n\n if (keys.length === 1) {\n key = keys[0];\n value = it[key];\n } else throw new TypeError(\"Expected { key: value } tuple: \".concat(it));\n } else {\n key = it;\n }\n\n var pair = schema.createPair(key, value, ctx);\n pairs.items.push(pair);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return pairs;\n}\nvar pairs = {\n default: false,\n tag: 'tag:yaml.org,2002:pairs',\n resolve: parsePairs,\n createNode: createPairs\n};\n\nvar YAMLOMap = /*#__PURE__*/function (_YAMLSeq) {\n _inherits(YAMLOMap, _YAMLSeq);\n\n var _super = _createSuper(YAMLOMap);\n\n function YAMLOMap() {\n var _this;\n\n _classCallCheck(this, YAMLOMap);\n\n _this = _super.call(this);\n\n _defineProperty(_assertThisInitialized(_this), \"add\", YAMLMap.prototype.add.bind(_assertThisInitialized(_this)));\n\n _defineProperty(_assertThisInitialized(_this), \"delete\", YAMLMap.prototype.delete.bind(_assertThisInitialized(_this)));\n\n _defineProperty(_assertThisInitialized(_this), \"get\", YAMLMap.prototype.get.bind(_assertThisInitialized(_this)));\n\n _defineProperty(_assertThisInitialized(_this), \"has\", YAMLMap.prototype.has.bind(_assertThisInitialized(_this)));\n\n _defineProperty(_assertThisInitialized(_this), \"set\", YAMLMap.prototype.set.bind(_assertThisInitialized(_this)));\n\n _this.tag = YAMLOMap.tag;\n return _this;\n }\n\n _createClass(YAMLOMap, [{\n key: \"toJSON\",\n value: function toJSON$1(_, ctx) {\n var map = new Map();\n if (ctx && ctx.onCreate) ctx.onCreate(map);\n\n var _iterator = _createForOfIteratorHelper(this.items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var pair = _step.value;\n var key = void 0,\n value = void 0;\n\n if (pair instanceof Pair) {\n key = toJSON(pair.key, '', ctx);\n value = toJSON(pair.value, key, ctx);\n } else {\n key = toJSON(pair, '', ctx);\n }\n\n if (map.has(key)) throw new Error('Ordered maps must not include duplicate keys');\n map.set(key, value);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return map;\n }\n }]);\n\n return YAMLOMap;\n}(YAMLSeq);\n\n_defineProperty(YAMLOMap, \"tag\", 'tag:yaml.org,2002:omap');\n\nfunction parseOMap(doc, cst) {\n var pairs = parsePairs(doc, cst);\n var seenKeys = [];\n\n var _iterator2 = _createForOfIteratorHelper(pairs.items),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var key = _step2.value.key;\n\n if (key instanceof Scalar) {\n if (seenKeys.includes(key.value)) {\n var msg = 'Ordered maps must not include duplicate keys';\n throw new YAMLSemanticError(cst, msg);\n } else {\n seenKeys.push(key.value);\n }\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return Object.assign(new YAMLOMap(), pairs);\n}\n\nfunction createOMap(schema, iterable, ctx) {\n var pairs = createPairs(schema, iterable, ctx);\n var omap = new YAMLOMap();\n omap.items = pairs.items;\n return omap;\n}\n\nvar omap = {\n identify: function identify(value) {\n return value instanceof Map;\n },\n nodeClass: YAMLOMap,\n default: false,\n tag: 'tag:yaml.org,2002:omap',\n resolve: parseOMap,\n createNode: createOMap\n};\n\nvar YAMLSet = /*#__PURE__*/function (_YAMLMap) {\n _inherits(YAMLSet, _YAMLMap);\n\n var _super = _createSuper(YAMLSet);\n\n function YAMLSet() {\n var _this;\n\n _classCallCheck(this, YAMLSet);\n\n _this = _super.call(this);\n _this.tag = YAMLSet.tag;\n return _this;\n }\n\n _createClass(YAMLSet, [{\n key: \"add\",\n value: function add(key) {\n var pair = key instanceof Pair ? key : new Pair(key);\n var prev = findPair(this.items, pair.key);\n if (!prev) this.items.push(pair);\n }\n }, {\n key: \"get\",\n value: function get(key, keepPair) {\n var pair = findPair(this.items, key);\n return !keepPair && pair instanceof Pair ? pair.key instanceof Scalar ? pair.key.value : pair.key : pair;\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n if (typeof value !== 'boolean') throw new Error(\"Expected boolean value for set(key, value) in a YAML set, not \".concat(_typeof(value)));\n var prev = findPair(this.items, key);\n\n if (prev && !value) {\n this.items.splice(this.items.indexOf(prev), 1);\n } else if (!prev && value) {\n this.items.push(new Pair(key));\n }\n }\n }, {\n key: \"toJSON\",\n value: function toJSON(_, ctx) {\n return _get(_getPrototypeOf(YAMLSet.prototype), \"toJSON\", this).call(this, _, ctx, Set);\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment, onChompKeep) {\n if (!ctx) return JSON.stringify(this);\n if (this.hasAllNullValues()) return _get(_getPrototypeOf(YAMLSet.prototype), \"toString\", this).call(this, ctx, onComment, onChompKeep);else throw new Error('Set items must all have null values');\n }\n }]);\n\n return YAMLSet;\n}(YAMLMap);\n\n_defineProperty(YAMLSet, \"tag\", 'tag:yaml.org,2002:set');\n\nfunction parseSet(doc, cst) {\n var map = resolveMap(doc, cst);\n if (!map.hasAllNullValues()) throw new YAMLSemanticError(cst, 'Set items must all have null values');\n return Object.assign(new YAMLSet(), map);\n}\n\nfunction createSet(schema, iterable, ctx) {\n var set = new YAMLSet();\n\n var _iterator = _createForOfIteratorHelper(iterable),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var value = _step.value;\n set.items.push(schema.createPair(value, null, ctx));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return set;\n}\n\nvar set = {\n identify: function identify(value) {\n return value instanceof Set;\n },\n nodeClass: YAMLSet,\n default: false,\n tag: 'tag:yaml.org,2002:set',\n resolve: parseSet,\n createNode: createSet\n};\n\nvar parseSexagesimal = function parseSexagesimal(sign, parts) {\n var n = parts.split(':').reduce(function (n, p) {\n return n * 60 + Number(p);\n }, 0);\n return sign === '-' ? -n : n;\n}; // hhhh:mm:ss.sss\n\n\nvar stringifySexagesimal = function stringifySexagesimal(_ref) {\n var value = _ref.value;\n if (isNaN(value) || !isFinite(value)) return stringifyNumber(value);\n var sign = '';\n\n if (value < 0) {\n sign = '-';\n value = Math.abs(value);\n }\n\n var parts = [value % 60]; // seconds, including ms\n\n if (value < 60) {\n parts.unshift(0); // at least one : is required\n } else {\n value = Math.round((value - parts[0]) / 60);\n parts.unshift(value % 60); // minutes\n\n if (value >= 60) {\n value = Math.round((value - parts[0]) / 60);\n parts.unshift(value); // hours\n }\n }\n\n return sign + parts.map(function (n) {\n return n < 10 ? '0' + String(n) : String(n);\n }).join(':').replace(/000000\\d*$/, '') // % 60 may introduce error\n ;\n};\n\nvar intTime = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'TIME',\n test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,\n resolve: function resolve(str, sign, parts) {\n return parseSexagesimal(sign, parts.replace(/_/g, ''));\n },\n stringify: stringifySexagesimal\n};\nvar floatTime = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'TIME',\n test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*)$/,\n resolve: function resolve(str, sign, parts) {\n return parseSexagesimal(sign, parts.replace(/_/g, ''));\n },\n stringify: stringifySexagesimal\n};\nvar timestamp = {\n identify: function identify(value) {\n return value instanceof Date;\n },\n default: true,\n tag: 'tag:yaml.org,2002:timestamp',\n // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part\n // may be omitted altogether, resulting in a date format. In such a case, the time part is\n // assumed to be 00:00:00Z (start of day, UTC).\n test: RegExp('^(?:' + '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd\n '(?:(?:t|T|[ \\\\t]+)' + // t | T | whitespace\n '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?\n '(?:[ \\\\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30\n ')?' + ')$'),\n resolve: function resolve(str, year, month, day, hour, minute, second, millisec, tz) {\n if (millisec) millisec = (millisec + '00').substr(1, 3);\n var date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec || 0);\n\n if (tz && tz !== 'Z') {\n var d = parseSexagesimal(tz[0], tz.slice(1));\n if (Math.abs(d) < 30) d *= 60;\n date -= 60000 * d;\n }\n\n return new Date(date);\n },\n stringify: function stringify(_ref2) {\n var value = _ref2.value;\n return value.toISOString().replace(/((T00:00)?:00)?\\.000Z$/, '');\n }\n};\n\n/* global console, process, YAML_SILENCE_DEPRECATION_WARNINGS, YAML_SILENCE_WARNINGS */\nfunction shouldWarn(deprecation) {\n var env = typeof process !== 'undefined' && process.env || {};\n\n if (deprecation) {\n if (typeof YAML_SILENCE_DEPRECATION_WARNINGS !== 'undefined') return !YAML_SILENCE_DEPRECATION_WARNINGS;\n return !env.YAML_SILENCE_DEPRECATION_WARNINGS;\n }\n\n if (typeof YAML_SILENCE_WARNINGS !== 'undefined') return !YAML_SILENCE_WARNINGS;\n return !env.YAML_SILENCE_WARNINGS;\n}\n\nfunction warn(warning, type) {\n if (shouldWarn(false)) {\n var emit = typeof process !== 'undefined' && process.emitWarning; // This will throw in Jest if `warning` is an Error instance due to\n // https://github.com/facebook/jest/issues/2549\n\n if (emit) emit(warning, type);else {\n // eslint-disable-next-line no-console\n console.warn(type ? \"\".concat(type, \": \").concat(warning) : warning);\n }\n }\n}\nfunction warnFileDeprecation(filename) {\n if (shouldWarn(true)) {\n var path = filename.replace(/.*yaml[/\\\\]/i, '').replace(/\\.js$/, '').replace(/\\\\/g, '/');\n warn(\"The endpoint 'yaml/\".concat(path, \"' will be removed in a future release.\"), 'DeprecationWarning');\n }\n}\nvar warned = {};\nfunction warnOptionDeprecation(name, alternative) {\n if (!warned[name] && shouldWarn(true)) {\n warned[name] = true;\n var msg = \"The option '\".concat(name, \"' will be removed in a future release\");\n msg += alternative ? \", use '\".concat(alternative, \"' instead.\") : '.';\n warn(msg, 'DeprecationWarning');\n }\n}\n\nexport { warnOptionDeprecation as a, binary as b, warnFileDeprecation as c, floatTime as f, intTime as i, omap as o, pairs as p, set as s, timestamp as t, warn as w };\n","import { _ as _createForOfIteratorHelper, h as _slicedToArray, a as _typeof, b as _createClass, e as _defineProperty, c as _classCallCheck, d as defaultTagPrefix, n as defaultTags } from './PlainValue-b8036b75.js';\nimport { d as YAMLMap, g as resolveMap, Y as YAMLSeq, h as resolveSeq, j as resolveString, c as stringifyString, s as strOptions, S as Scalar, n as nullOptions, a as boolOptions, i as intOptions, k as stringifyNumber, N as Node, A as Alias, P as Pair } from './resolveSeq-492ab440.js';\nimport { b as binary, o as omap, p as pairs, s as set, i as intTime, f as floatTime, t as timestamp, a as warnOptionDeprecation } from './warnings-df54cb69.js';\n\nfunction createMap(schema, obj, ctx) {\n var map = new YAMLMap(schema);\n\n if (obj instanceof Map) {\n var _iterator = _createForOfIteratorHelper(obj),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 2),\n key = _step$value[0],\n value = _step$value[1];\n\n map.items.push(schema.createPair(key, value, ctx));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n } else if (obj && _typeof(obj) === 'object') {\n for (var _i = 0, _Object$keys = Object.keys(obj); _i < _Object$keys.length; _i++) {\n var _key = _Object$keys[_i];\n map.items.push(schema.createPair(_key, obj[_key], ctx));\n }\n }\n\n if (typeof schema.sortMapEntries === 'function') {\n map.items.sort(schema.sortMapEntries);\n }\n\n return map;\n}\n\nvar map = {\n createNode: createMap,\n default: true,\n nodeClass: YAMLMap,\n tag: 'tag:yaml.org,2002:map',\n resolve: resolveMap\n};\n\nfunction createSeq(schema, obj, ctx) {\n var seq = new YAMLSeq(schema);\n\n if (obj && obj[Symbol.iterator]) {\n var _iterator = _createForOfIteratorHelper(obj),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var it = _step.value;\n var v = schema.createNode(it, ctx.wrapScalars, null, ctx);\n seq.items.push(v);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n return seq;\n}\n\nvar seq = {\n createNode: createSeq,\n default: true,\n nodeClass: YAMLSeq,\n tag: 'tag:yaml.org,2002:seq',\n resolve: resolveSeq\n};\n\nvar string = {\n identify: function identify(value) {\n return typeof value === 'string';\n },\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: resolveString,\n stringify: function stringify(item, ctx, onComment, onChompKeep) {\n ctx = Object.assign({\n actualString: true\n }, ctx);\n return stringifyString(item, ctx, onComment, onChompKeep);\n },\n options: strOptions\n};\n\nvar failsafe = [map, seq, string];\n\n/* global BigInt */\n\nvar intIdentify$2 = function intIdentify(value) {\n return typeof value === 'bigint' || Number.isInteger(value);\n};\n\nvar intResolve$1 = function intResolve(src, part, radix) {\n return intOptions.asBigInt ? BigInt(src) : parseInt(part, radix);\n};\n\nfunction intStringify$1(node, radix, prefix) {\n var value = node.value;\n if (intIdentify$2(value) && value >= 0) return prefix + value.toString(radix);\n return stringifyNumber(node);\n}\n\nvar nullObj = {\n identify: function identify(value) {\n return value == null;\n },\n createNode: function createNode(schema, value, ctx) {\n return ctx.wrapScalars ? new Scalar(null) : null;\n },\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^(?:~|[Nn]ull|NULL)?$/,\n resolve: function resolve() {\n return null;\n },\n options: nullOptions,\n stringify: function stringify() {\n return nullOptions.nullStr;\n }\n};\nvar boolObj = {\n identify: function identify(value) {\n return typeof value === 'boolean';\n },\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,\n resolve: function resolve(str) {\n return str[0] === 't' || str[0] === 'T';\n },\n options: boolOptions,\n stringify: function stringify(_ref) {\n var value = _ref.value;\n return value ? boolOptions.trueStr : boolOptions.falseStr;\n }\n};\nvar octObj = {\n identify: function identify(value) {\n return intIdentify$2(value) && value >= 0;\n },\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^0o([0-7]+)$/,\n resolve: function resolve(str, oct) {\n return intResolve$1(str, oct, 8);\n },\n options: intOptions,\n stringify: function stringify(node) {\n return intStringify$1(node, 8, '0o');\n }\n};\nvar intObj = {\n identify: intIdentify$2,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^[-+]?[0-9]+$/,\n resolve: function resolve(str) {\n return intResolve$1(str, str, 10);\n },\n options: intOptions,\n stringify: stringifyNumber\n};\nvar hexObj = {\n identify: function identify(value) {\n return intIdentify$2(value) && value >= 0;\n },\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^0x([0-9a-fA-F]+)$/,\n resolve: function resolve(str, hex) {\n return intResolve$1(str, hex, 16);\n },\n options: intOptions,\n stringify: function stringify(node) {\n return intStringify$1(node, 16, '0x');\n }\n};\nvar nanObj = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.inf|(\\.nan))$/i,\n resolve: function resolve(str, nan) {\n return nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY;\n },\n stringify: stringifyNumber\n};\nvar expObj = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)[eE][-+]?[0-9]+$/,\n resolve: function resolve(str) {\n return parseFloat(str);\n },\n stringify: function stringify(_ref2) {\n var value = _ref2.value;\n return Number(value).toExponential();\n }\n};\nvar floatObj = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:\\.([0-9]+)|[0-9]+\\.([0-9]*))$/,\n resolve: function resolve(str, frac1, frac2) {\n var frac = frac1 || frac2;\n var node = new Scalar(parseFloat(str));\n if (frac && frac[frac.length - 1] === '0') node.minFractionDigits = frac.length;\n return node;\n },\n stringify: stringifyNumber\n};\nvar core = failsafe.concat([nullObj, boolObj, octObj, intObj, hexObj, nanObj, expObj, floatObj]);\n\n/* global BigInt */\n\nvar intIdentify$1 = function intIdentify(value) {\n return typeof value === 'bigint' || Number.isInteger(value);\n};\n\nvar stringifyJSON = function stringifyJSON(_ref) {\n var value = _ref.value;\n return JSON.stringify(value);\n};\n\nvar json = [map, seq, {\n identify: function identify(value) {\n return typeof value === 'string';\n },\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: resolveString,\n stringify: stringifyJSON\n}, {\n identify: function identify(value) {\n return value == null;\n },\n createNode: function createNode(schema, value, ctx) {\n return ctx.wrapScalars ? new Scalar(null) : null;\n },\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^null$/,\n resolve: function resolve() {\n return null;\n },\n stringify: stringifyJSON\n}, {\n identify: function identify(value) {\n return typeof value === 'boolean';\n },\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^true|false$/,\n resolve: function resolve(str) {\n return str === 'true';\n },\n stringify: stringifyJSON\n}, {\n identify: intIdentify$1,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^-?(?:0|[1-9][0-9]*)$/,\n resolve: function resolve(str) {\n return intOptions.asBigInt ? BigInt(str) : parseInt(str, 10);\n },\n stringify: function stringify(_ref2) {\n var value = _ref2.value;\n return intIdentify$1(value) ? value.toString() : JSON.stringify(value);\n }\n}, {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,\n resolve: function resolve(str) {\n return parseFloat(str);\n },\n stringify: stringifyJSON\n}];\n\njson.scalarFallback = function (str) {\n throw new SyntaxError(\"Unresolved plain scalar \".concat(JSON.stringify(str)));\n};\n\n/* global BigInt */\n\nvar boolStringify = function boolStringify(_ref) {\n var value = _ref.value;\n return value ? boolOptions.trueStr : boolOptions.falseStr;\n};\n\nvar intIdentify = function intIdentify(value) {\n return typeof value === 'bigint' || Number.isInteger(value);\n};\n\nfunction intResolve(sign, src, radix) {\n var str = src.replace(/_/g, '');\n\n if (intOptions.asBigInt) {\n switch (radix) {\n case 2:\n str = \"0b\".concat(str);\n break;\n\n case 8:\n str = \"0o\".concat(str);\n break;\n\n case 16:\n str = \"0x\".concat(str);\n break;\n }\n\n var _n = BigInt(str);\n\n return sign === '-' ? BigInt(-1) * _n : _n;\n }\n\n var n = parseInt(str, radix);\n return sign === '-' ? -1 * n : n;\n}\n\nfunction intStringify(node, radix, prefix) {\n var value = node.value;\n\n if (intIdentify(value)) {\n var str = value.toString(radix);\n return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;\n }\n\n return stringifyNumber(node);\n}\n\nvar yaml11 = failsafe.concat([{\n identify: function identify(value) {\n return value == null;\n },\n createNode: function createNode(schema, value, ctx) {\n return ctx.wrapScalars ? new Scalar(null) : null;\n },\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^(?:~|[Nn]ull|NULL)?$/,\n resolve: function resolve() {\n return null;\n },\n options: nullOptions,\n stringify: function stringify() {\n return nullOptions.nullStr;\n }\n}, {\n identify: function identify(value) {\n return typeof value === 'boolean';\n },\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,\n resolve: function resolve() {\n return true;\n },\n options: boolOptions,\n stringify: boolStringify\n}, {\n identify: function identify(value) {\n return typeof value === 'boolean';\n },\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,\n resolve: function resolve() {\n return false;\n },\n options: boolOptions,\n stringify: boolStringify\n}, {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'BIN',\n test: /^([-+]?)0b([0-1_]+)$/,\n resolve: function resolve(str, sign, bin) {\n return intResolve(sign, bin, 2);\n },\n stringify: function stringify(node) {\n return intStringify(node, 2, '0b');\n }\n}, {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^([-+]?)0([0-7_]+)$/,\n resolve: function resolve(str, sign, oct) {\n return intResolve(sign, oct, 8);\n },\n stringify: function stringify(node) {\n return intStringify(node, 8, '0');\n }\n}, {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^([-+]?)([0-9][0-9_]*)$/,\n resolve: function resolve(str, sign, abs) {\n return intResolve(sign, abs, 10);\n },\n stringify: stringifyNumber\n}, {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^([-+]?)0x([0-9a-fA-F_]+)$/,\n resolve: function resolve(str, sign, hex) {\n return intResolve(sign, hex, 16);\n },\n stringify: function stringify(node) {\n return intStringify(node, 16, '0x');\n }\n}, {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.inf|(\\.nan))$/i,\n resolve: function resolve(str, nan) {\n return nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY;\n },\n stringify: stringifyNumber\n}, {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?([0-9][0-9_]*)?(\\.[0-9_]*)?[eE][-+]?[0-9]+$/,\n resolve: function resolve(str) {\n return parseFloat(str.replace(/_/g, ''));\n },\n stringify: function stringify(_ref2) {\n var value = _ref2.value;\n return Number(value).toExponential();\n }\n}, {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:[0-9][0-9_]*)?\\.([0-9_]*)$/,\n resolve: function resolve(str, frac) {\n var node = new Scalar(parseFloat(str.replace(/_/g, '')));\n\n if (frac) {\n var f = frac.replace(/_/g, '');\n if (f[f.length - 1] === '0') node.minFractionDigits = f.length;\n }\n\n return node;\n },\n stringify: stringifyNumber\n}], binary, omap, pairs, set, intTime, floatTime, timestamp);\n\nvar schemas = {\n core: core,\n failsafe: failsafe,\n json: json,\n yaml11: yaml11\n};\nvar tags = {\n binary: binary,\n bool: boolObj,\n float: floatObj,\n floatExp: expObj,\n floatNaN: nanObj,\n floatTime: floatTime,\n int: intObj,\n intHex: hexObj,\n intOct: octObj,\n intTime: intTime,\n map: map,\n null: nullObj,\n omap: omap,\n pairs: pairs,\n seq: seq,\n set: set,\n timestamp: timestamp\n};\n\nfunction findTagObject(value, tagName, tags) {\n if (tagName) {\n var match = tags.filter(function (t) {\n return t.tag === tagName;\n });\n var tagObj = match.find(function (t) {\n return !t.format;\n }) || match[0];\n if (!tagObj) throw new Error(\"Tag \".concat(tagName, \" not found\"));\n return tagObj;\n } // TODO: deprecate/remove class check\n\n\n return tags.find(function (t) {\n return (t.identify && t.identify(value) || t.class && value instanceof t.class) && !t.format;\n });\n}\n\nfunction createNode(value, tagName, ctx) {\n if (value instanceof Node) return value;\n var defaultPrefix = ctx.defaultPrefix,\n onTagObj = ctx.onTagObj,\n prevObjects = ctx.prevObjects,\n schema = ctx.schema,\n wrapScalars = ctx.wrapScalars;\n if (tagName && tagName.startsWith('!!')) tagName = defaultPrefix + tagName.slice(2);\n var tagObj = findTagObject(value, tagName, schema.tags);\n\n if (!tagObj) {\n if (typeof value.toJSON === 'function') value = value.toJSON();\n if (!value || _typeof(value) !== 'object') return wrapScalars ? new Scalar(value) : value;\n tagObj = value instanceof Map ? map : value[Symbol.iterator] ? seq : map;\n }\n\n if (onTagObj) {\n onTagObj(tagObj);\n delete ctx.onTagObj;\n } // Detect duplicate references to the same object & use Alias nodes for all\n // after first. The `obj` wrapper allows for circular references to resolve.\n\n\n var obj = {\n value: undefined,\n node: undefined\n };\n\n if (value && _typeof(value) === 'object' && prevObjects) {\n var prev = prevObjects.get(value);\n\n if (prev) {\n var alias = new Alias(prev); // leaves source dirty; must be cleaned by caller\n\n ctx.aliasNodes.push(alias); // defined along with prevObjects\n\n return alias;\n }\n\n obj.value = value;\n prevObjects.set(value, obj);\n }\n\n obj.node = tagObj.createNode ? tagObj.createNode(ctx.schema, value, ctx) : wrapScalars ? new Scalar(value) : value;\n if (tagName && obj.node instanceof Node) obj.node.tag = tagName;\n return obj.node;\n}\n\nfunction getSchemaTags(schemas, knownTags, customTags, schemaId) {\n var tags = schemas[schemaId.replace(/\\W/g, '')]; // 'yaml-1.1' -> 'yaml11'\n\n if (!tags) {\n var keys = Object.keys(schemas).map(function (key) {\n return JSON.stringify(key);\n }).join(', ');\n throw new Error(\"Unknown schema \\\"\".concat(schemaId, \"\\\"; use one of \").concat(keys));\n }\n\n if (Array.isArray(customTags)) {\n var _iterator = _createForOfIteratorHelper(customTags),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var tag = _step.value;\n tags = tags.concat(tag);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n } else if (typeof customTags === 'function') {\n tags = customTags(tags.slice());\n }\n\n for (var i = 0; i < tags.length; ++i) {\n var _tag = tags[i];\n\n if (typeof _tag === 'string') {\n var tagObj = knownTags[_tag];\n\n if (!tagObj) {\n var _keys = Object.keys(knownTags).map(function (key) {\n return JSON.stringify(key);\n }).join(', ');\n\n throw new Error(\"Unknown custom tag \\\"\".concat(_tag, \"\\\"; use one of \").concat(_keys));\n }\n\n tags[i] = tagObj;\n }\n }\n\n return tags;\n}\n\nvar sortMapEntriesByKey = function sortMapEntriesByKey(a, b) {\n return a.key < b.key ? -1 : a.key > b.key ? 1 : 0;\n};\n\nvar Schema = /*#__PURE__*/function () {\n // TODO: remove in v2\n // TODO: remove in v2\n function Schema(_ref) {\n var customTags = _ref.customTags,\n merge = _ref.merge,\n schema = _ref.schema,\n sortMapEntries = _ref.sortMapEntries,\n deprecatedCustomTags = _ref.tags;\n\n _classCallCheck(this, Schema);\n\n this.merge = !!merge;\n this.name = schema;\n this.sortMapEntries = sortMapEntries === true ? sortMapEntriesByKey : sortMapEntries || null;\n if (!customTags && deprecatedCustomTags) warnOptionDeprecation('tags', 'customTags');\n this.tags = getSchemaTags(schemas, tags, customTags || deprecatedCustomTags, schema);\n }\n\n _createClass(Schema, [{\n key: \"createNode\",\n value: function createNode$1(value, wrapScalars, tagName, ctx) {\n var baseCtx = {\n defaultPrefix: Schema.defaultPrefix,\n schema: this,\n wrapScalars: wrapScalars\n };\n var createCtx = ctx ? Object.assign(ctx, baseCtx) : baseCtx;\n return createNode(value, tagName, createCtx);\n }\n }, {\n key: \"createPair\",\n value: function createPair(key, value, ctx) {\n if (!ctx) ctx = {\n wrapScalars: true\n };\n var k = this.createNode(key, ctx.wrapScalars, null, ctx);\n var v = this.createNode(value, ctx.wrapScalars, null, ctx);\n return new Pair(k, v);\n }\n }]);\n\n return Schema;\n}();\n\n_defineProperty(Schema, \"defaultPrefix\", defaultTagPrefix);\n\n_defineProperty(Schema, \"defaultTags\", defaultTags);\n\nexport { Schema as S };\n","import { d as defaultTagPrefix, _ as _createForOfIteratorHelper, a as _typeof, b as _createClass, c as _classCallCheck, e as _defineProperty, Y as YAMLSyntaxError, T as Type, f as YAMLWarning, g as YAMLSemanticError, h as _slicedToArray, i as YAMLError, j as _inherits, k as _createSuper } from './PlainValue-b8036b75.js';\nimport { parse as parse$1 } from './parse-cst.js';\nimport { b as binaryOptions, a as boolOptions, i as intOptions, n as nullOptions, s as strOptions, N as Node, P as Pair, S as Scalar, c as stringifyString, A as Alias, Y as YAMLSeq, d as YAMLMap, M as Merge, C as Collection, r as resolveNode, e as isEmptyPath, t as toJSON, f as addComment } from './resolveSeq-492ab440.js';\nimport { S as Schema } from './Schema-e94716c8.js';\nimport { w as warn } from './warnings-df54cb69.js';\n\nvar defaultOptions = {\n anchorPrefix: 'a',\n customTags: null,\n indent: 2,\n indentSeq: true,\n keepCstNodes: false,\n keepNodeTypes: true,\n keepBlobsInJSON: true,\n mapAsMap: false,\n maxAliasCount: 100,\n prettyErrors: false,\n // TODO Set true in v2\n simpleKeys: false,\n version: '1.2'\n};\nvar scalarOptions = {\n get binary() {\n return binaryOptions;\n },\n\n set binary(opt) {\n Object.assign(binaryOptions, opt);\n },\n\n get bool() {\n return boolOptions;\n },\n\n set bool(opt) {\n Object.assign(boolOptions, opt);\n },\n\n get int() {\n return intOptions;\n },\n\n set int(opt) {\n Object.assign(intOptions, opt);\n },\n\n get null() {\n return nullOptions;\n },\n\n set null(opt) {\n Object.assign(nullOptions, opt);\n },\n\n get str() {\n return strOptions;\n },\n\n set str(opt) {\n Object.assign(strOptions, opt);\n }\n\n};\nvar documentOptions = {\n '1.0': {\n schema: 'yaml-1.1',\n merge: true,\n tagPrefixes: [{\n handle: '!',\n prefix: defaultTagPrefix\n }, {\n handle: '!!',\n prefix: 'tag:private.yaml.org,2002:'\n }]\n },\n 1.1: {\n schema: 'yaml-1.1',\n merge: true,\n tagPrefixes: [{\n handle: '!',\n prefix: '!'\n }, {\n handle: '!!',\n prefix: defaultTagPrefix\n }]\n },\n 1.2: {\n schema: 'core',\n merge: false,\n tagPrefixes: [{\n handle: '!',\n prefix: '!'\n }, {\n handle: '!!',\n prefix: defaultTagPrefix\n }]\n }\n};\n\nfunction stringifyTag(doc, tag) {\n if ((doc.version || doc.options.version) === '1.0') {\n var priv = tag.match(/^tag:private\\.yaml\\.org,2002:([^:/]+)$/);\n if (priv) return '!' + priv[1];\n var vocab = tag.match(/^tag:([a-zA-Z0-9-]+)\\.yaml\\.org,2002:(.*)/);\n return vocab ? \"!\".concat(vocab[1], \"/\").concat(vocab[2]) : \"!\".concat(tag.replace(/^tag:/, ''));\n }\n\n var p = doc.tagPrefixes.find(function (p) {\n return tag.indexOf(p.prefix) === 0;\n });\n\n if (!p) {\n var dtp = doc.getDefaults().tagPrefixes;\n p = dtp && dtp.find(function (p) {\n return tag.indexOf(p.prefix) === 0;\n });\n }\n\n if (!p) return tag[0] === '!' ? tag : \"!<\".concat(tag, \">\");\n var suffix = tag.substr(p.prefix.length).replace(/[!,[\\]{}]/g, function (ch) {\n return {\n '!': '%21',\n ',': '%2C',\n '[': '%5B',\n ']': '%5D',\n '{': '%7B',\n '}': '%7D'\n }[ch];\n });\n return p.handle + suffix;\n}\n\nfunction getTagObject(tags, item) {\n if (item instanceof Alias) return Alias;\n\n if (item.tag) {\n var match = tags.filter(function (t) {\n return t.tag === item.tag;\n });\n if (match.length > 0) return match.find(function (t) {\n return t.format === item.format;\n }) || match[0];\n }\n\n var tagObj, obj;\n\n if (item instanceof Scalar) {\n obj = item.value; // TODO: deprecate/remove class check\n\n var _match = tags.filter(function (t) {\n return t.identify && t.identify(obj) || t.class && obj instanceof t.class;\n });\n\n tagObj = _match.find(function (t) {\n return t.format === item.format;\n }) || _match.find(function (t) {\n return !t.format;\n });\n } else {\n obj = item;\n tagObj = tags.find(function (t) {\n return t.nodeClass && obj instanceof t.nodeClass;\n });\n }\n\n if (!tagObj) {\n var name = obj && obj.constructor ? obj.constructor.name : _typeof(obj);\n throw new Error(\"Tag not resolved for \".concat(name, \" value\"));\n }\n\n return tagObj;\n} // needs to be called before value stringifier to allow for circular anchor refs\n\n\nfunction stringifyProps(node, tagObj, _ref) {\n var anchors = _ref.anchors,\n doc = _ref.doc;\n var props = [];\n var anchor = doc.anchors.getName(node);\n\n if (anchor) {\n anchors[anchor] = node;\n props.push(\"&\".concat(anchor));\n }\n\n if (node.tag) {\n props.push(stringifyTag(doc, node.tag));\n } else if (!tagObj.default) {\n props.push(stringifyTag(doc, tagObj.tag));\n }\n\n return props.join(' ');\n}\n\nfunction stringify$1(item, ctx, onComment, onChompKeep) {\n var _ctx$doc = ctx.doc,\n anchors = _ctx$doc.anchors,\n schema = _ctx$doc.schema;\n var tagObj;\n\n if (!(item instanceof Node)) {\n var createCtx = {\n aliasNodes: [],\n onTagObj: function onTagObj(o) {\n return tagObj = o;\n },\n prevObjects: new Map()\n };\n item = schema.createNode(item, true, null, createCtx);\n\n var _iterator = _createForOfIteratorHelper(createCtx.aliasNodes),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var alias = _step.value;\n alias.source = alias.source.node;\n var name = anchors.getName(alias.source);\n\n if (!name) {\n name = anchors.newName();\n anchors.map[name] = alias.source;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n if (item instanceof Pair) return item.toString(ctx, onComment, onChompKeep);\n if (!tagObj) tagObj = getTagObject(schema.tags, item);\n var props = stringifyProps(item, tagObj, ctx);\n if (props.length > 0) ctx.indentAtStart = (ctx.indentAtStart || 0) + props.length + 1;\n var str = typeof tagObj.stringify === 'function' ? tagObj.stringify(item, ctx, onComment, onChompKeep) : item instanceof Scalar ? stringifyString(item, ctx, onComment, onChompKeep) : item.toString(ctx, onComment, onChompKeep);\n if (!props) return str;\n return item instanceof Scalar || str[0] === '{' || str[0] === '[' ? \"\".concat(props, \" \").concat(str) : \"\".concat(props, \"\\n\").concat(ctx.indent).concat(str);\n}\n\nvar Anchors = /*#__PURE__*/function () {\n function Anchors(prefix) {\n _classCallCheck(this, Anchors);\n\n _defineProperty(this, \"map\", Object.create(null));\n\n this.prefix = prefix;\n }\n\n _createClass(Anchors, [{\n key: \"createAlias\",\n value: function createAlias(node, name) {\n this.setAnchor(node, name);\n return new Alias(node);\n }\n }, {\n key: \"createMergePair\",\n value: function createMergePair() {\n var _this = this;\n\n var merge = new Merge();\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n merge.value.items = sources.map(function (s) {\n if (s instanceof Alias) {\n if (s.source instanceof YAMLMap) return s;\n } else if (s instanceof YAMLMap) {\n return _this.createAlias(s);\n }\n\n throw new Error('Merge sources must be Map nodes or their Aliases');\n });\n return merge;\n }\n }, {\n key: \"getName\",\n value: function getName(node) {\n var map = this.map;\n return Object.keys(map).find(function (a) {\n return map[a] === node;\n });\n }\n }, {\n key: \"getNames\",\n value: function getNames() {\n return Object.keys(this.map);\n }\n }, {\n key: \"getNode\",\n value: function getNode(name) {\n return this.map[name];\n }\n }, {\n key: \"newName\",\n value: function newName(prefix) {\n if (!prefix) prefix = this.prefix;\n var names = Object.keys(this.map);\n\n for (var i = 1; true; ++i) {\n var name = \"\".concat(prefix).concat(i);\n if (!names.includes(name)) return name;\n }\n } // During parsing, map & aliases contain CST nodes\n\n }, {\n key: \"resolveNodes\",\n value: function resolveNodes() {\n var map = this.map,\n _cstAliases = this._cstAliases;\n Object.keys(map).forEach(function (a) {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(function (a) {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }\n }, {\n key: \"setAnchor\",\n value: function setAnchor(node, name) {\n if (node != null && !Anchors.validAnchorNode(node)) {\n throw new Error('Anchors may only be set for Scalar, Seq and Map nodes');\n }\n\n if (name && /[\\x00-\\x19\\s,[\\]{}]/.test(name)) {\n throw new Error('Anchor names must not contain whitespace or control characters');\n }\n\n var map = this.map;\n var prev = node && Object.keys(map).find(function (a) {\n return map[a] === node;\n });\n\n if (prev) {\n if (!name) {\n return prev;\n } else if (prev !== name) {\n delete map[prev];\n map[name] = node;\n }\n } else {\n if (!name) {\n if (!node) return null;\n name = this.newName();\n }\n\n map[name] = node;\n }\n\n return name;\n }\n }], [{\n key: \"validAnchorNode\",\n value: function validAnchorNode(node) {\n return node instanceof Scalar || node instanceof YAMLSeq || node instanceof YAMLMap;\n }\n }]);\n\n return Anchors;\n}();\n\nvar visit = function visit(node, tags) {\n if (node && _typeof(node) === 'object') {\n var tag = node.tag;\n\n if (node instanceof Collection) {\n if (tag) tags[tag] = true;\n node.items.forEach(function (n) {\n return visit(n, tags);\n });\n } else if (node instanceof Pair) {\n visit(node.key, tags);\n visit(node.value, tags);\n } else if (node instanceof Scalar) {\n if (tag) tags[tag] = true;\n }\n }\n\n return tags;\n};\n\nvar listTagNames = function listTagNames(node) {\n return Object.keys(visit(node, {}));\n};\n\nfunction parseContents(doc, contents) {\n var comments = {\n before: [],\n after: []\n };\n var body = undefined;\n var spaceBefore = false;\n\n var _iterator = _createForOfIteratorHelper(contents),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var node = _step.value;\n\n if (node.valueRange) {\n if (body !== undefined) {\n var msg = 'Document contains trailing content not separated by a ... or --- line';\n doc.errors.push(new YAMLSyntaxError(node, msg));\n break;\n }\n\n var res = resolveNode(doc, node);\n\n if (spaceBefore) {\n res.spaceBefore = true;\n spaceBefore = false;\n }\n\n body = res;\n } else if (node.comment !== null) {\n var cc = body === undefined ? comments.before : comments.after;\n cc.push(node.comment);\n } else if (node.type === Type.BLANK_LINE) {\n spaceBefore = true;\n\n if (body === undefined && comments.before.length > 0 && !doc.commentBefore) {\n // space-separated comments at start are parsed as document comments\n doc.commentBefore = comments.before.join('\\n');\n comments.before = [];\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n doc.contents = body || null;\n\n if (!body) {\n doc.comment = comments.before.concat(comments.after).join('\\n') || null;\n } else {\n var cb = comments.before.join('\\n');\n\n if (cb) {\n var cbNode = body instanceof Collection && body.items[0] ? body.items[0] : body;\n cbNode.commentBefore = cbNode.commentBefore ? \"\".concat(cb, \"\\n\").concat(cbNode.commentBefore) : cb;\n }\n\n doc.comment = comments.after.join('\\n') || null;\n }\n}\n\nfunction resolveTagDirective(_ref, directive) {\n var tagPrefixes = _ref.tagPrefixes;\n\n var _directive$parameters = _slicedToArray(directive.parameters, 2),\n handle = _directive$parameters[0],\n prefix = _directive$parameters[1];\n\n if (!handle || !prefix) {\n var msg = 'Insufficient parameters given for %TAG directive';\n throw new YAMLSemanticError(directive, msg);\n }\n\n if (tagPrefixes.some(function (p) {\n return p.handle === handle;\n })) {\n var _msg = 'The %TAG directive must only be given at most once per handle in the same document.';\n throw new YAMLSemanticError(directive, _msg);\n }\n\n return {\n handle: handle,\n prefix: prefix\n };\n}\n\nfunction resolveYamlDirective(doc, directive) {\n var _directive$parameters2 = _slicedToArray(directive.parameters, 1),\n version = _directive$parameters2[0];\n\n if (directive.name === 'YAML:1.0') version = '1.0';\n\n if (!version) {\n var msg = 'Insufficient parameters given for %YAML directive';\n throw new YAMLSemanticError(directive, msg);\n }\n\n if (!documentOptions[version]) {\n var v0 = doc.version || doc.options.version;\n\n var _msg2 = \"Document will be parsed as YAML \".concat(v0, \" rather than YAML \").concat(version);\n\n doc.warnings.push(new YAMLWarning(directive, _msg2));\n }\n\n return version;\n}\n\nfunction parseDirectives(doc, directives, prevDoc) {\n var directiveComments = [];\n var hasDirectives = false;\n\n var _iterator = _createForOfIteratorHelper(directives),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var directive = _step.value;\n var comment = directive.comment,\n name = directive.name;\n\n switch (name) {\n case 'TAG':\n try {\n doc.tagPrefixes.push(resolveTagDirective(doc, directive));\n } catch (error) {\n doc.errors.push(error);\n }\n\n hasDirectives = true;\n break;\n\n case 'YAML':\n case 'YAML:1.0':\n if (doc.version) {\n var msg = 'The %YAML directive must only be given at most once per document.';\n doc.errors.push(new YAMLSemanticError(directive, msg));\n }\n\n try {\n doc.version = resolveYamlDirective(doc, directive);\n } catch (error) {\n doc.errors.push(error);\n }\n\n hasDirectives = true;\n break;\n\n default:\n if (name) {\n var _msg3 = \"YAML only supports %TAG and %YAML directives, and not %\".concat(name);\n\n doc.warnings.push(new YAMLWarning(directive, _msg3));\n }\n\n }\n\n if (comment) directiveComments.push(comment);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (prevDoc && !hasDirectives && '1.1' === (doc.version || prevDoc.version || doc.options.version)) {\n var copyTagPrefix = function copyTagPrefix(_ref2) {\n var handle = _ref2.handle,\n prefix = _ref2.prefix;\n return {\n handle: handle,\n prefix: prefix\n };\n };\n\n doc.tagPrefixes = prevDoc.tagPrefixes.map(copyTagPrefix);\n doc.version = prevDoc.version;\n }\n\n doc.commentBefore = directiveComments.join('\\n') || null;\n}\n\nfunction assertCollection(contents) {\n if (contents instanceof Collection) return true;\n throw new Error('Expected a YAML collection as document contents');\n}\n\nvar Document$1 = /*#__PURE__*/function () {\n function Document(options) {\n _classCallCheck(this, Document);\n\n this.anchors = new Anchors(options.anchorPrefix);\n this.commentBefore = null;\n this.comment = null;\n this.contents = null;\n this.directivesEndMarker = null;\n this.errors = [];\n this.options = options;\n this.schema = null;\n this.tagPrefixes = [];\n this.version = null;\n this.warnings = [];\n }\n\n _createClass(Document, [{\n key: \"add\",\n value: function add(value) {\n assertCollection(this.contents);\n return this.contents.add(value);\n }\n }, {\n key: \"addIn\",\n value: function addIn(path, value) {\n assertCollection(this.contents);\n this.contents.addIn(path, value);\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n assertCollection(this.contents);\n return this.contents.delete(key);\n }\n }, {\n key: \"deleteIn\",\n value: function deleteIn(path) {\n if (isEmptyPath(path)) {\n if (this.contents == null) return false;\n this.contents = null;\n return true;\n }\n\n assertCollection(this.contents);\n return this.contents.deleteIn(path);\n }\n }, {\n key: \"getDefaults\",\n value: function getDefaults() {\n return Document.defaults[this.version] || Document.defaults[this.options.version] || {};\n }\n }, {\n key: \"get\",\n value: function get(key, keepScalar) {\n return this.contents instanceof Collection ? this.contents.get(key, keepScalar) : undefined;\n }\n }, {\n key: \"getIn\",\n value: function getIn(path, keepScalar) {\n if (isEmptyPath(path)) return !keepScalar && this.contents instanceof Scalar ? this.contents.value : this.contents;\n return this.contents instanceof Collection ? this.contents.getIn(path, keepScalar) : undefined;\n }\n }, {\n key: \"has\",\n value: function has(key) {\n return this.contents instanceof Collection ? this.contents.has(key) : false;\n }\n }, {\n key: \"hasIn\",\n value: function hasIn(path) {\n if (isEmptyPath(path)) return this.contents !== undefined;\n return this.contents instanceof Collection ? this.contents.hasIn(path) : false;\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n assertCollection(this.contents);\n this.contents.set(key, value);\n }\n }, {\n key: \"setIn\",\n value: function setIn(path, value) {\n if (isEmptyPath(path)) this.contents = value;else {\n assertCollection(this.contents);\n this.contents.setIn(path, value);\n }\n }\n }, {\n key: \"setSchema\",\n value: function setSchema(id, customTags) {\n if (!id && !customTags && this.schema) return;\n if (typeof id === 'number') id = id.toFixed(1);\n\n if (id === '1.0' || id === '1.1' || id === '1.2') {\n if (this.version) this.version = id;else this.options.version = id;\n delete this.options.schema;\n } else if (id && typeof id === 'string') {\n this.options.schema = id;\n }\n\n if (Array.isArray(customTags)) this.options.customTags = customTags;\n var opt = Object.assign({}, this.getDefaults(), this.options);\n this.schema = new Schema(opt);\n }\n }, {\n key: \"parse\",\n value: function parse(node, prevDoc) {\n if (this.options.keepCstNodes) this.cstNode = node;\n if (this.options.keepNodeTypes) this.type = 'DOCUMENT';\n var _node$directives = node.directives,\n directives = _node$directives === void 0 ? [] : _node$directives,\n _node$contents = node.contents,\n contents = _node$contents === void 0 ? [] : _node$contents,\n directivesEndMarker = node.directivesEndMarker,\n error = node.error,\n valueRange = node.valueRange;\n\n if (error) {\n if (!error.source) error.source = this;\n this.errors.push(error);\n }\n\n parseDirectives(this, directives, prevDoc);\n if (directivesEndMarker) this.directivesEndMarker = true;\n this.range = valueRange ? [valueRange.start, valueRange.end] : null;\n this.setSchema();\n this.anchors._cstAliases = [];\n parseContents(this, contents);\n this.anchors.resolveNodes();\n\n if (this.options.prettyErrors) {\n var _iterator = _createForOfIteratorHelper(this.errors),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _error = _step.value;\n if (_error instanceof YAMLError) _error.makePretty();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var _iterator2 = _createForOfIteratorHelper(this.warnings),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var warn = _step2.value;\n if (warn instanceof YAMLError) warn.makePretty();\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n\n return this;\n }\n }, {\n key: \"listNonDefaultTags\",\n value: function listNonDefaultTags() {\n return listTagNames(this.contents).filter(function (t) {\n return t.indexOf(Schema.defaultPrefix) !== 0;\n });\n }\n }, {\n key: \"setTagPrefix\",\n value: function setTagPrefix(handle, prefix) {\n if (handle[0] !== '!' || handle[handle.length - 1] !== '!') throw new Error('Handle must start and end with !');\n\n if (prefix) {\n var prev = this.tagPrefixes.find(function (p) {\n return p.handle === handle;\n });\n if (prev) prev.prefix = prefix;else this.tagPrefixes.push({\n handle: handle,\n prefix: prefix\n });\n } else {\n this.tagPrefixes = this.tagPrefixes.filter(function (p) {\n return p.handle !== handle;\n });\n }\n }\n }, {\n key: \"toJSON\",\n value: function toJSON$1(arg, onAnchor) {\n var _this = this;\n\n var _this$options = this.options,\n keepBlobsInJSON = _this$options.keepBlobsInJSON,\n mapAsMap = _this$options.mapAsMap,\n maxAliasCount = _this$options.maxAliasCount;\n var keep = keepBlobsInJSON && (typeof arg !== 'string' || !(this.contents instanceof Scalar));\n var ctx = {\n doc: this,\n indentStep: ' ',\n keep: keep,\n mapAsMap: keep && !!mapAsMap,\n maxAliasCount: maxAliasCount,\n stringify: stringify$1 // Requiring directly in Pair would create circular dependencies\n\n };\n var anchorNames = Object.keys(this.anchors.map);\n if (anchorNames.length > 0) ctx.anchors = new Map(anchorNames.map(function (name) {\n return [_this.anchors.map[name], {\n alias: [],\n aliasCount: 0,\n count: 1\n }];\n }));\n\n var res = toJSON(this.contents, arg, ctx);\n\n if (typeof onAnchor === 'function' && ctx.anchors) {\n var _iterator3 = _createForOfIteratorHelper(ctx.anchors.values()),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _step3$value = _step3.value,\n count = _step3$value.count,\n _res = _step3$value.res;\n onAnchor(_res, count);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n\n return res;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n if (this.errors.length > 0) throw new Error('Document with errors cannot be stringified');\n var indentSize = this.options.indent;\n\n if (!Number.isInteger(indentSize) || indentSize <= 0) {\n var s = JSON.stringify(indentSize);\n throw new Error(\"\\\"indent\\\" option must be a positive integer, not \".concat(s));\n }\n\n this.setSchema();\n var lines = [];\n var hasDirectives = false;\n\n if (this.version) {\n var vd = '%YAML 1.2';\n\n if (this.schema.name === 'yaml-1.1') {\n if (this.version === '1.0') vd = '%YAML:1.0';else if (this.version === '1.1') vd = '%YAML 1.1';\n }\n\n lines.push(vd);\n hasDirectives = true;\n }\n\n var tagNames = this.listNonDefaultTags();\n this.tagPrefixes.forEach(function (_ref) {\n var handle = _ref.handle,\n prefix = _ref.prefix;\n\n if (tagNames.some(function (t) {\n return t.indexOf(prefix) === 0;\n })) {\n lines.push(\"%TAG \".concat(handle, \" \").concat(prefix));\n hasDirectives = true;\n }\n });\n if (hasDirectives || this.directivesEndMarker) lines.push('---');\n\n if (this.commentBefore) {\n if (hasDirectives || !this.directivesEndMarker) lines.unshift('');\n lines.unshift(this.commentBefore.replace(/^/gm, '#'));\n }\n\n var ctx = {\n anchors: Object.create(null),\n doc: this,\n indent: '',\n indentStep: ' '.repeat(indentSize),\n stringify: stringify$1 // Requiring directly in nodes would create circular dependencies\n\n };\n var chompKeep = false;\n var contentComment = null;\n\n if (this.contents) {\n if (this.contents instanceof Node) {\n if (this.contents.spaceBefore && (hasDirectives || this.directivesEndMarker)) lines.push('');\n if (this.contents.commentBefore) lines.push(this.contents.commentBefore.replace(/^/gm, '#')); // top-level block scalars need to be indented if followed by a comment\n\n ctx.forceBlockIndent = !!this.comment;\n contentComment = this.contents.comment;\n }\n\n var onChompKeep = contentComment ? null : function () {\n return chompKeep = true;\n };\n var body = stringify$1(this.contents, ctx, function () {\n return contentComment = null;\n }, onChompKeep);\n lines.push(addComment(body, '', contentComment));\n } else if (this.contents !== undefined) {\n lines.push(stringify$1(this.contents, ctx));\n }\n\n if (this.comment) {\n if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '') lines.push('');\n lines.push(this.comment.replace(/^/gm, '#'));\n }\n\n return lines.join('\\n') + '\\n';\n }\n }]);\n\n return Document;\n}();\n\n_defineProperty(Document$1, \"defaults\", documentOptions);\n\nfunction createNode(value) {\n var wrapScalars = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var tag = arguments.length > 2 ? arguments[2] : undefined;\n\n if (tag === undefined && typeof wrapScalars === 'string') {\n tag = wrapScalars;\n wrapScalars = true;\n }\n\n var options = Object.assign({}, Document$1.defaults[defaultOptions.version], defaultOptions);\n var schema = new Schema(options);\n return schema.createNode(value, wrapScalars, tag);\n}\n\nvar Document = /*#__PURE__*/function (_YAMLDocument) {\n _inherits(Document, _YAMLDocument);\n\n var _super = _createSuper(Document);\n\n function Document(options) {\n _classCallCheck(this, Document);\n\n return _super.call(this, Object.assign({}, defaultOptions, options));\n }\n\n return Document;\n}(Document$1);\n\nfunction parseAllDocuments(src, options) {\n var stream = [];\n var prev;\n\n var _iterator = _createForOfIteratorHelper(parse$1(src)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var cstDoc = _step.value;\n var doc = new Document(options);\n doc.parse(cstDoc, prev);\n stream.push(doc);\n prev = doc;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return stream;\n}\n\nfunction parseDocument(src, options) {\n var cst = parse$1(src);\n var doc = new Document(options).parse(cst[0]);\n\n if (cst.length > 1) {\n var errMsg = 'Source contains multiple documents; please use YAML.parseAllDocuments()';\n doc.errors.unshift(new YAMLSemanticError(cst[1], errMsg));\n }\n\n return doc;\n}\n\nfunction parse(src, options) {\n var doc = parseDocument(src, options);\n doc.warnings.forEach(function (warning) {\n return warn(warning);\n });\n if (doc.errors.length > 0) throw doc.errors[0];\n return doc.toJSON();\n}\n\nfunction stringify(value, options) {\n var doc = new Document(options);\n doc.contents = value;\n return String(doc);\n}\n\nvar YAML = {\n createNode: createNode,\n defaultOptions: defaultOptions,\n Document: Document,\n parse: parse,\n parseAllDocuments: parseAllDocuments,\n parseCST: parse$1,\n parseDocument: parseDocument,\n scalarOptions: scalarOptions,\n stringify: stringify\n};\n\nexport { YAML };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"/\";","__webpack_require__.nc = undefined;","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\nexport var SCOPE = '@scope'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @param {number} position\n * @return {number}\n */\nexport function indexof (value, search, position) {\n\treturn value.indexOf(search, position)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n\n/**\n * @param {string[]} array\n * @param {RegExp} pattern\n * @return {string[]}\n */\nexport function filter (array, pattern) {\n\treturn array.filter(function (value) { return !match(value, pattern) })\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {object[]} siblings\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length, siblings) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: '', siblings: siblings}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0, root.siblings), root, {length: -root.length}, props)\n}\n\n/**\n * @param {object} root\n */\nexport function lift (root) {\n\twhile (root.root)\n\t\troot = copy(root.root, {children: [root]})\n\n\tappend(root, root.siblings)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\n\tfor (var i = 0; i < children.length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: if (!strlen(element.value = element.props.join(','))) return ''\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {MS, MOZ, WEBKIT} from './Enum.js'\nimport {hash, charat, strlen, indexof, replace, substr, match} from './Utility.js'\n\n/**\n * @param {string} value\n * @param {number} length\n * @param {object[]} children\n * @return {string}\n */\nexport function prefix (value, length, children) {\n\tswitch (hash(value, length)) {\n\t\t// color-adjust\n\t\tcase 5103:\n\t\t\treturn WEBKIT + 'print-' + value + value\n\t\t// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\t\tcase 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921:\n\t\t// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\t\tcase 5572: case 6356: case 5844: case 3191: case 6645: case 3005:\n\t\t// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\t\tcase 6391: case 5879: case 5623: case 6135: case 4599: case 4855:\n\t\t// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\t\tcase 4215: case 6389: case 5109: case 5365: case 5621: case 3829:\n\t\t\treturn WEBKIT + value + value\n\t\t// tab-size\n\t\tcase 4789:\n\t\t\treturn MOZ + value + value\n\t\t// appearance, user-select, transform, hyphens, text-size-adjust\n\t\tcase 5349: case 4246: case 4810: case 6968: case 2756:\n\t\t\treturn WEBKIT + value + MOZ + value + MS + value + value\n\t\t// writing-mode\n\t\tcase 5936:\n\t\t\tswitch (charat(value, length + 11)) {\n\t\t\t\t// vertical-l(r)\n\t\t\t\tcase 114:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value\n\t\t\t\t// vertical-r(l)\n\t\t\t\tcase 108:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value\n\t\t\t\t// horizontal(-)tb\n\t\t\t\tcase 45:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value\n\t\t\t\t// default: fallthrough to below\n\t\t\t}\n\t\t// flex, flex-direction, scroll-snap-type, writing-mode\n\t\tcase 6828: case 4268: case 2903:\n\t\t\treturn WEBKIT + value + MS + value + value\n\t\t// order\n\t\tcase 6165:\n\t\t\treturn WEBKIT + value + MS + 'flex-' + value + value\n\t\t// align-items\n\t\tcase 5187:\n\t\t\treturn WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value\n\t\t// align-self\n\t\tcase 5443:\n\t\t\treturn WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/g, '') + (!match(value, /flex-|baseline/) ? MS + 'grid-row-' + replace(value, /flex-|-self/g, '') : '') + value\n\t\t// align-content\n\t\tcase 4675:\n\t\t\treturn WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/g, '') + value\n\t\t// flex-shrink\n\t\tcase 5548:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value\n\t\t// flex-basis\n\t\tcase 5292:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value\n\t\t// flex-grow\n\t\tcase 6060:\n\t\t\treturn WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value\n\t\t// transition\n\t\tcase 4554:\n\t\t\treturn WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value\n\t\t// cursor\n\t\tcase 6187:\n\t\t\treturn replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value\n\t\t// background, background-image\n\t\tcase 5495: case 3959:\n\t\t\treturn replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1')\n\t\t// justify-content\n\t\tcase 4968:\n\t\t\treturn replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value\n\t\t// justify-self\n\t\tcase 4200:\n\t\t\tif (!match(value, /flex-|baseline/)) return MS + 'grid-column-align' + substr(value, length) + value\n\t\t\tbreak\n\t\t// grid-template-(columns|rows)\n\t\tcase 2592: case 3360:\n\t\t\treturn MS + replace(value, 'template-', '') + value\n\t\t// grid-(row|column)-start\n\t\tcase 4384: case 3616:\n\t\t\tif (children && children.some(function (element, index) { return length = index, match(element.props, /grid-\\w+-end/) })) {\n\t\t\t\treturn ~indexof(value + (children = children[length].value), 'span', 0) ? value : (MS + replace(value, '-start', '') + value + MS + 'grid-row-span:' + (~indexof(children, 'span', 0) ? match(children, /\\d+/) : +match(children, /\\d+/) - +match(value, /\\d+/)) + ';')\n\t\t\t}\n\t\t\treturn MS + replace(value, '-start', '') + value\n\t\t// grid-(row|column)-end\n\t\tcase 4896: case 4128:\n\t\t\treturn (children && children.some(function (element) { return match(element.props, /grid-\\w+-start/) })) ? value : MS + replace(replace(value, '-end', '-span'), 'span ', '') + value\n\t\t// (margin|padding)-inline-(start|end)\n\t\tcase 4095: case 3583: case 4068: case 2532:\n\t\t\treturn replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value\n\t\t// (min|max)?(width|height|inline-size|block-size)\n\t\tcase 8116: case 7059: case 5753: case 5535:\n\t\tcase 5445: case 5701: case 4933: case 4677:\n\t\tcase 5533: case 5789: case 5021: case 4765:\n\t\t\t// stretch, max-content, min-content, fill-available\n\t\t\tif (strlen(value) - 1 - length > 6)\n\t\t\t\tswitch (charat(value, length + 1)) {\n\t\t\t\t\t// (m)ax-content, (m)in-content\n\t\t\t\t\tcase 109:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (charat(value, length + 4) !== 45)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t// (f)ill-available, (f)it-content\n\t\t\t\t\tcase 102:\n\t\t\t\t\t\treturn replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value\n\t\t\t\t\t// (s)tretch\n\t\t\t\t\tcase 115:\n\t\t\t\t\t\treturn ~indexof(value, 'stretch', 0) ? prefix(replace(value, 'stretch', 'fill-available'), length, children) + value : value\n\t\t\t\t}\n\t\t\tbreak\n\t\t// grid-(column|row)\n\t\tcase 5152: case 5920:\n\t\t\treturn replace(value, /(.+?):(\\d+)(\\s*\\/\\s*(span)?\\s*(\\d+))?(.*)/, function (_, a, b, c, d, e, f) { return (MS + a + ':' + b + f) + (c ? (MS + a + '-span:' + (d ? e : +e - +b)) + f : '') + value })\n\t\t// position: sticky\n\t\tcase 4949:\n\t\t\t// stick(y)?\n\t\t\tif (charat(value, length + 6) === 121)\n\t\t\t\treturn replace(value, ':', ':' + WEBKIT) + value\n\t\t\tbreak\n\t\t// display: (flex|inline-flex|grid|inline-grid)\n\t\tcase 6444:\n\t\t\tswitch (charat(value, charat(value, 14) === 45 ? 18 : 11)) {\n\t\t\t\t// (inline-)?fle(x)\n\t\t\t\tcase 120:\n\t\t\t\t\treturn replace(value, /(.+:)([^;\\s!]+)(;|(\\s+)?!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value\n\t\t\t\t// (inline-)?gri(d)\n\t\t\t\tcase 100:\n\t\t\t\t\treturn replace(value, ':', ':' + MS) + value\n\t\t\t}\n\t\t\tbreak\n\t\t// scroll-margin, scroll-margin-(top|right|bottom|left)\n\t\tcase 5719: case 2647: case 2135: case 3927: case 2391:\n\t\t\treturn replace(value, 'scroll-', 'scroll-snap-') + value\n\t}\n\n\treturn value\n}\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine, filter, assign} from './Utility.js'\nimport {copy, lift, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(children = element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, callback = /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]}))\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [value]}))\n\t\t\t\t\t\t\t\t\tassign(element, {props: filter(children, callback)})\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}))\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}))\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]}))\n\t\t\t\t\t\t\t\t\tlift(copy(element, {props: [value]}))\n\t\t\t\t\t\t\t\t\tassign(element, {props: filter(children, callback)})\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f', abs(index ? points[index - 1] : 0)) != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent, declarations), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1, declarations) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2, declarations), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @param {object[]} siblings\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length, siblings) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @param {object[]} siblings\n * @return {object}\n */\nexport function comment (value, root, parent, siblings) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @param {object[]} siblings\n * @return {object}\n */\nexport function declaration (value, root, parent, length, siblings) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings)\n}\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","declare let SC_DISABLE_SPEEDY: boolean | null | undefined;\ndeclare let __VERSION__: string;\n\nexport const SC_ATTR: string =\n (typeof process !== 'undefined' &&\n typeof process.env !== 'undefined' &&\n (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR)) ||\n 'data-styled';\n\nexport const SC_ATTR_ACTIVE = 'active';\nexport const SC_ATTR_VERSION = 'data-styled-version';\nexport const SC_VERSION = __VERSION__;\nexport const SPLITTER = '/*!sc*/\\n';\n\nexport const IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;\n\nexport const DISABLE_SPEEDY = Boolean(\n typeof SC_DISABLE_SPEEDY === 'boolean'\n ? SC_DISABLE_SPEEDY\n : typeof process !== 'undefined' &&\n typeof process.env !== 'undefined' &&\n typeof process.env.REACT_APP_SC_DISABLE_SPEEDY !== 'undefined' &&\n process.env.REACT_APP_SC_DISABLE_SPEEDY !== ''\n ? process.env.REACT_APP_SC_DISABLE_SPEEDY === 'false'\n ? false\n : process.env.REACT_APP_SC_DISABLE_SPEEDY\n : typeof process !== 'undefined' &&\n typeof process.env !== 'undefined' &&\n typeof process.env.SC_DISABLE_SPEEDY !== 'undefined' &&\n process.env.SC_DISABLE_SPEEDY !== ''\n ? process.env.SC_DISABLE_SPEEDY === 'false'\n ? false\n : process.env.SC_DISABLE_SPEEDY\n : process.env.NODE_ENV !== 'production'\n);\n\n// Shared empty execution context when generating static styles\nexport const STATIC_EXECUTION_CONTEXT = {};\n","import { Dict } from '../types';\n\nexport const EMPTY_ARRAY = Object.freeze([]) as Readonly;\nexport const EMPTY_OBJECT = Object.freeze({}) as Readonly>;\n","import { useRef } from 'react';\n\nconst invalidHookCallRe = /invalid hook call/i;\nconst seen = new Set();\n\nexport const checkDynamicCreation = (displayName: string, componentId?: string | undefined) => {\n if (process.env.NODE_ENV !== 'production') {\n const parsedIdString = componentId ? ` with the id of \"${componentId}\"` : '';\n const message =\n `The component ${displayName}${parsedIdString} has been created dynamically.\\n` +\n \"You may see this warning because you've called styled inside another component.\\n\" +\n 'To resolve this only create new StyledComponents outside of any render method and function component.';\n\n // If a hook is called outside of a component:\n // React 17 and earlier throw an error\n // React 18 and above use console.error\n\n const originalConsoleError = console.error;\n try {\n let didNotCallInvalidHook = true;\n console.error = (consoleErrorMessage, ...consoleErrorArgs) => {\n // The error here is expected, since we're expecting anything that uses `checkDynamicCreation` to\n // be called outside of a React component.\n if (invalidHookCallRe.test(consoleErrorMessage)) {\n didNotCallInvalidHook = false;\n // This shouldn't happen, but resets `warningSeen` if we had this error happen intermittently\n seen.delete(message);\n } else {\n originalConsoleError(consoleErrorMessage, ...consoleErrorArgs);\n }\n };\n // We purposefully call `useRef` outside of a component and expect it to throw\n // If it doesn't, then we're inside another component.\n useRef();\n\n if (didNotCallInvalidHook && !seen.has(message)) {\n console.warn(message);\n seen.add(message);\n }\n } catch (error) {\n // The error here is expected, since we're expecting anything that uses `checkDynamicCreation` to\n // be called outside of a React component.\n if (invalidHookCallRe.test((error as Error).message)) {\n // This shouldn't happen, but resets `warningSeen` if we had this error happen intermittently\n seen.delete(message);\n }\n } finally {\n console.error = originalConsoleError;\n }\n }\n};\n","import { DefaultTheme, ExecutionProps } from '../types';\nimport { EMPTY_OBJECT } from './empties';\n\nexport default function determineTheme(\n props: ExecutionProps,\n providedTheme?: DefaultTheme | undefined,\n defaultProps: { theme?: DefaultTheme | undefined } = EMPTY_OBJECT\n): DefaultTheme | undefined {\n return (props.theme !== defaultProps.theme && props.theme) || providedTheme || defaultProps.theme;\n}\n","// Thanks to ReactDOMFactories for this handy list!\n\nconst elements = [\n 'a',\n 'abbr',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'base',\n 'bdi',\n 'bdo',\n 'big',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'keygen',\n 'label',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'map',\n 'mark',\n 'menu',\n 'menuitem',\n 'meta',\n 'meter',\n 'nav',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'param',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'script',\n 'section',\n 'select',\n 'small',\n 'source',\n 'span',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'u',\n 'ul',\n 'use',\n 'var',\n 'video',\n 'wbr', // SVG\n 'circle',\n 'clipPath',\n 'defs',\n 'ellipse',\n 'foreignObject',\n 'g',\n 'image',\n 'line',\n 'linearGradient',\n 'marker',\n 'mask',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialGradient',\n 'rect',\n 'stop',\n 'svg',\n 'text',\n 'tspan',\n] as const;\n\nexport default new Set(elements);\nexport type SupportedHTMLElements = (typeof elements)[number];\n","// Source: https://www.w3.org/TR/cssom-1/#serialize-an-identifier\n// Control characters and non-letter first symbols are not supported\nconst escapeRegex = /[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~-]+/g;\n\nconst dashesAtEnds = /(^-|-$)/g;\n\n/**\n * TODO: Explore using CSS.escape when it becomes more available\n * in evergreen browsers.\n */\nexport default function escape(str: string) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}\n","const AD_REPLACER_R = /(a)(d)/gi;\n\n/* This is the \"capacity\" of our alphabet i.e. 2x26 for all letters plus their capitalised\n * counterparts */\nconst charsLength = 52;\n\n/* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */\nconst getAlphabeticChar = (code: number) => String.fromCharCode(code + (code > 25 ? 39 : 97));\n\n/* input a number, usually a hash and convert it to base-52 */\nexport default function generateAlphabeticName(code: number) {\n let name = '';\n let x;\n\n /* get a char and divide by alphabet-length */\n for (x = Math.abs(code); x > charsLength; x = (x / charsLength) | 0) {\n name = getAlphabeticChar(x % charsLength) + name;\n }\n\n return (getAlphabeticChar(x % charsLength) + name).replace(AD_REPLACER_R, '$1-$2');\n}\n","export const SEED = 5381;\n\n// When we have separate strings it's useful to run a progressive\n// version of djb2 where we pretend that we're still looping over\n// the same string\nexport const phash = (h: number, x: string) => {\n let i = x.length;\n\n while (i) {\n h = (h * 33) ^ x.charCodeAt(--i);\n }\n\n return h;\n};\n\n// This is a djb2 hashing function\nexport const hash = (x: string) => {\n return phash(SEED, x);\n};\n","import generateAlphabeticName from './generateAlphabeticName';\nimport { hash } from './hash';\n\nexport default function generateComponentId(str: string) {\n return generateAlphabeticName(hash(str) >>> 0);\n}\n","import { StyledTarget } from '../types';\n\nexport default function getComponentName(target: StyledTarget) {\n return (\n (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) ||\n (target as Exclude, string>).displayName ||\n (target as Function).name ||\n 'Component'\n );\n}\n","import { StyledTarget } from '../types';\n\nexport default function isTag(target: StyledTarget<'web'>): target is string {\n return (\n typeof target === 'string' &&\n (process.env.NODE_ENV !== 'production'\n ? target.charAt(0) === target.charAt(0).toLowerCase()\n : true)\n );\n}\n","import React from 'react';\nimport { AnyComponent } from '../types';\n\nconst hasSymbol = typeof Symbol === 'function' && Symbol.for;\n\n// copied from react-is\nconst REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nconst REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\n\n/**\n * Adapted from hoist-non-react-statics to avoid the react-is dependency.\n */\nconst REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true,\n};\n\nconst KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true,\n};\n\nconst FORWARD_REF_STATICS = {\n $$typeof: true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n};\n\nconst MEMO_STATICS = {\n $$typeof: true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true,\n};\n\nconst TYPE_STATICS = {\n [REACT_FORWARD_REF_TYPE]: FORWARD_REF_STATICS,\n [REACT_MEMO_TYPE]: MEMO_STATICS,\n};\n\ntype OmniComponent = AnyComponent;\n\n// adapted from react-is\nfunction isMemo(\n object: OmniComponent | React.MemoExoticComponent\n): object is React.MemoExoticComponent {\n const $$typeofType = 'type' in object && object.type.$$typeof;\n\n return $$typeofType === REACT_MEMO_TYPE;\n}\n\nfunction getStatics(component: OmniComponent) {\n // React v16.11 and below\n if (isMemo(component)) {\n return MEMO_STATICS;\n }\n\n // React v16.12 and above\n return '$$typeof' in component\n ? TYPE_STATICS[component['$$typeof'] as unknown as string]\n : REACT_STATICS;\n}\n\nconst defineProperty = Object.defineProperty;\nconst getOwnPropertyNames = Object.getOwnPropertyNames;\nconst getOwnPropertySymbols = Object.getOwnPropertySymbols;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst objectPrototype = Object.prototype;\n\ntype ExcludeList = {\n [key: string]: true;\n};\n\ntype NonReactStatics = {\n [key in Exclude<\n keyof S,\n S extends React.MemoExoticComponent\n ? keyof typeof MEMO_STATICS | keyof C\n : S extends React.ForwardRefExoticComponent\n ? keyof typeof FORWARD_REF_STATICS | keyof C\n : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C\n >]: S[key];\n};\n\nexport default function hoistNonReactStatics<\n T extends OmniComponent,\n S extends OmniComponent,\n C extends ExcludeList = {},\n>(targetComponent: T, sourceComponent: S, excludelist?: C | undefined) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n\n if (objectPrototype) {\n const inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, excludelist);\n }\n }\n\n let keys: (String | Symbol)[] = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n const targetStatics = getStatics(targetComponent);\n const sourceStatics = getStatics(sourceComponent);\n\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i] as unknown as string;\n if (\n !(key in KNOWN_STATICS) &&\n !(excludelist && excludelist[key]) &&\n !(sourceStatics && key in sourceStatics) &&\n !(targetStatics && key in targetStatics)\n ) {\n const descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor!);\n } catch (e) {\n /* ignore */\n }\n }\n }\n }\n\n return targetComponent as T & NonReactStatics;\n}\n","export default function isFunction(test: any): test is Function {\n return typeof test === 'function';\n}\n","import { StyledComponentBrand } from '../types';\n\nexport default function isStyledComponent(target: any): target is StyledComponentBrand {\n return typeof target === 'object' && 'styledComponentId' in target;\n}\n","/**\n * Convenience function for joining strings to form className chains\n */\nexport function joinStrings(a?: string | undefined, b?: string | undefined): string {\n return a && b ? `${a} ${b}` : a || b || '';\n}\n\nexport function joinStringArray(arr: string[], sep?: string | undefined): string {\n if (arr.length === 0) {\n return '';\n }\n\n let result = arr[0];\n for (let i = 1; i < arr.length; i++) {\n result += sep ? sep + arr[i] : arr[i];\n }\n return result;\n}\n","export default function isPlainObject(x: any): x is Record {\n return (\n x !== null &&\n typeof x === 'object' &&\n x.constructor.name === Object.name &&\n /* check for reasonable markers that the object isn't an element for react & preact/compat */\n !('props' in x && x.$$typeof)\n );\n}\n","import isPlainObject from './isPlainObject';\n\nfunction mixinRecursively(target: any, source: any, forceMerge = false) {\n /* only merge into POJOs, Arrays, but for top level objects only\n * allow to merge into anything by passing forceMerge = true */\n if (!forceMerge && !isPlainObject(target) && !Array.isArray(target)) {\n return source;\n }\n\n if (Array.isArray(source)) {\n for (let key = 0; key < source.length; key++) {\n target[key] = mixinRecursively(target[key], source[key]);\n }\n } else if (isPlainObject(source)) {\n for (const key in source) {\n target[key] = mixinRecursively(target[key], source[key]);\n }\n }\n\n return target;\n}\n\n/**\n * Arrays & POJOs merged recursively, other objects and value types are overridden\n * If target is not a POJO or an Array, it will get source properties injected via shallow merge\n * Source objects applied left to right. Mutates & returns target. Similar to lodash merge.\n */\nexport default function mixinDeep(target: any, ...sources: any[]) {\n for (const source of sources) {\n mixinRecursively(target, source, true);\n }\n\n return target;\n}\n","/**\n * If the Object prototype is frozen, the \"toString\" property is non-writable. This means that any objects which inherit this property\n * cannot have the property changed using a \"=\" assignment operator. If using strict mode, attempting that will cause an error. If not using\n * strict mode, attempting that will be silently ignored.\n *\n * If the Object prototype is frozen, inherited non-writable properties can still be shadowed using one of two mechanisms:\n *\n * 1. ES6 class methods: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#methods\n * 2. Using the `Object.defineProperty()` static method:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n *\n * However, this project uses Babel to transpile ES6 classes, and transforms ES6 class methods to use the assignment operator instead:\n * https://babeljs.io/docs/babel-plugin-transform-class-properties#options\n *\n * Therefore, the most compatible way to shadow the prototype's \"toString\" property is to define a new \"toString\" property on this object.\n */\nexport function setToString(object: object, toStringFn: () => string) {\n Object.defineProperty(object, 'toString', { value: toStringFn });\n}\n","import { Dict } from '../types';\nimport errorMap from './errors';\n\nconst ERRORS: Dict = process.env.NODE_ENV !== 'production' ? errorMap : {};\n\n/**\n * super basic version of sprintf\n */\nfunction format(...args: [string, ...any]) {\n let a = args[0];\n const b = [];\n\n for (let c = 1, len = args.length; c < len; c += 1) {\n b.push(args[c]);\n }\n\n b.forEach(d => {\n a = a.replace(/%[a-z]/, d);\n });\n\n return a;\n}\n\n/**\n * Create an error file out of errors.md for development and a simple web link to the full errors\n * in production mode.\n */\nexport default function throwStyledComponentsError(\n code: string | number,\n ...interpolations: any[]\n) {\n if (process.env.NODE_ENV === 'production') {\n return new Error(\n `An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${code} for more information.${\n interpolations.length > 0 ? ` Args: ${interpolations.join(', ')}` : ''\n }`\n );\n } else {\n return new Error(format(ERRORS[code], ...interpolations).trim());\n }\n}\n","import { SPLITTER } from '../constants';\nimport styledError from '../utils/error';\nimport { GroupedTag, Tag } from './types';\n\n/** Create a GroupedTag with an underlying Tag implementation */\nexport const makeGroupedTag = (tag: Tag) => {\n return new DefaultGroupedTag(tag);\n};\n\nconst BASE_SIZE = 1 << 9;\n\nconst DefaultGroupedTag = class DefaultGroupedTag implements GroupedTag {\n groupSizes: Uint32Array;\n length: number;\n tag: Tag;\n\n constructor(tag: Tag) {\n this.groupSizes = new Uint32Array(BASE_SIZE);\n this.length = BASE_SIZE;\n this.tag = tag;\n }\n\n indexOfGroup(group: number) {\n let index = 0;\n for (let i = 0; i < group; i++) {\n index += this.groupSizes[i];\n }\n\n return index;\n }\n\n insertRules(group: number, rules: string[]) {\n if (group >= this.groupSizes.length) {\n const oldBuffer = this.groupSizes;\n const oldSize = oldBuffer.length;\n\n let newSize = oldSize;\n while (group >= newSize) {\n newSize <<= 1;\n if (newSize < 0) {\n throw styledError(16, `${group}`);\n }\n }\n\n this.groupSizes = new Uint32Array(newSize);\n this.groupSizes.set(oldBuffer);\n this.length = newSize;\n\n for (let i = oldSize; i < newSize; i++) {\n this.groupSizes[i] = 0;\n }\n }\n\n let ruleIndex = this.indexOfGroup(group + 1);\n\n for (let i = 0, l = rules.length; i < l; i++) {\n if (this.tag.insertRule(ruleIndex, rules[i])) {\n this.groupSizes[group]++;\n ruleIndex++;\n }\n }\n }\n\n clearGroup(group: number) {\n if (group < this.length) {\n const length = this.groupSizes[group];\n const startIndex = this.indexOfGroup(group);\n const endIndex = startIndex + length;\n\n this.groupSizes[group] = 0;\n\n for (let i = startIndex; i < endIndex; i++) {\n this.tag.deleteRule(startIndex);\n }\n }\n }\n\n getGroup(group: number) {\n let css = '';\n if (group >= this.length || this.groupSizes[group] === 0) {\n return css;\n }\n\n const length = this.groupSizes[group];\n const startIndex = this.indexOfGroup(group);\n const endIndex = startIndex + length;\n\n for (let i = startIndex; i < endIndex; i++) {\n css += `${this.tag.getRule(i)}${SPLITTER}`;\n }\n\n return css;\n }\n};\n","import styledError from '../utils/error';\n\nconst MAX_SMI = 1 << (31 - 1);\n\nlet groupIDRegister: Map = new Map();\nlet reverseRegister: Map = new Map();\nlet nextFreeGroup = 1;\n\nexport const resetGroupIds = () => {\n groupIDRegister = new Map();\n reverseRegister = new Map();\n nextFreeGroup = 1;\n};\n\nexport const getGroupForId = (id: string): number => {\n if (groupIDRegister.has(id)) {\n return groupIDRegister.get(id) as any;\n }\n\n while (reverseRegister.has(nextFreeGroup)) {\n nextFreeGroup++;\n }\n\n const group = nextFreeGroup++;\n\n if (process.env.NODE_ENV !== 'production' && ((group | 0) < 0 || group > MAX_SMI)) {\n throw styledError(16, `${group}`);\n }\n\n groupIDRegister.set(id, group);\n reverseRegister.set(group, id);\n return group;\n};\n\nexport const getIdForGroup = (group: number): void | string => {\n return reverseRegister.get(group);\n};\n\nexport const setGroupForId = (id: string, group: number) => {\n // move pointer\n nextFreeGroup = group + 1;\n\n groupIDRegister.set(id, group);\n reverseRegister.set(group, id);\n};\n","import { SC_ATTR, SC_ATTR_ACTIVE, SC_ATTR_VERSION, SC_VERSION, SPLITTER } from '../constants';\nimport { getIdForGroup, setGroupForId } from './GroupIDAllocator';\nimport { Sheet } from './types';\n\nconst SELECTOR = `style[${SC_ATTR}][${SC_ATTR_VERSION}=\"${SC_VERSION}\"]`;\nconst MARKER_RE = new RegExp(`^${SC_ATTR}\\\\.g(\\\\d+)\\\\[id=\"([\\\\w\\\\d-]+)\"\\\\].*?\"([^\"]*)`);\n\nexport const outputSheet = (sheet: Sheet) => {\n const tag = sheet.getTag();\n const { length } = tag;\n\n let css = '';\n for (let group = 0; group < length; group++) {\n const id = getIdForGroup(group);\n if (id === undefined) continue;\n\n const names = sheet.names.get(id);\n const rules = tag.getGroup(group);\n if (names === undefined || !names.size || rules.length === 0) continue;\n\n const selector = `${SC_ATTR}.g${group}[id=\"${id}\"]`;\n\n let content = '';\n if (names !== undefined) {\n names.forEach(name => {\n if (name.length > 0) {\n content += `${name},`;\n }\n });\n }\n\n // NOTE: It's easier to collect rules and have the marker\n // after the actual rules to simplify the rehydration\n css += `${rules}${selector}{content:\"${content}\"}${SPLITTER}`;\n }\n\n return css;\n};\n\nconst rehydrateNamesFromContent = (sheet: Sheet, id: string, content: string) => {\n const names = content.split(',');\n let name;\n\n for (let i = 0, l = names.length; i < l; i++) {\n if ((name = names[i])) {\n sheet.registerName(id, name);\n }\n }\n};\n\nconst rehydrateSheetFromTag = (sheet: Sheet, style: HTMLStyleElement) => {\n const parts = (style.textContent ?? '').split(SPLITTER);\n const rules: string[] = [];\n\n for (let i = 0, l = parts.length; i < l; i++) {\n const part = parts[i].trim();\n if (!part) continue;\n\n const marker = part.match(MARKER_RE);\n\n if (marker) {\n const group = parseInt(marker[1], 10) | 0;\n const id = marker[2];\n\n if (group !== 0) {\n // Rehydrate componentId to group index mapping\n setGroupForId(id, group);\n // Rehydrate names and rules\n // looks like: data-styled.g11[id=\"idA\"]{content:\"nameA,\"}\n rehydrateNamesFromContent(sheet, id, marker[3]);\n sheet.getTag().insertRules(group, rules);\n }\n\n rules.length = 0;\n } else {\n rules.push(part);\n }\n }\n};\n\nexport const rehydrateSheet = (sheet: Sheet) => {\n const nodes = document.querySelectorAll(SELECTOR);\n\n for (let i = 0, l = nodes.length; i < l; i++) {\n const node = nodes[i] as any as HTMLStyleElement;\n if (node && node.getAttribute(SC_ATTR) !== SC_ATTR_ACTIVE) {\n rehydrateSheetFromTag(sheet, node);\n\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }\n }\n};\n","declare let __webpack_nonce__: string;\n\nexport default function getNonce() {\n return typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n}\n","import { SC_ATTR, SC_ATTR_ACTIVE, SC_ATTR_VERSION, SC_VERSION } from '../constants';\nimport { InsertionTarget } from '../types';\nimport styledError from '../utils/error';\nimport getNonce from '../utils/nonce';\n\n/** Find last style element if any inside target */\nconst findLastStyleTag = (target: InsertionTarget): void | HTMLStyleElement => {\n const arr = Array.from(target.querySelectorAll(`style[${SC_ATTR}]`));\n\n return arr[arr.length - 1];\n};\n\n/** Create a style element inside `target` or after the last */\nexport const makeStyleTag = (target?: InsertionTarget | undefined): HTMLStyleElement => {\n const head = document.head;\n const parent = target || head;\n const style = document.createElement('style');\n const prevStyle = findLastStyleTag(parent);\n const nextSibling = prevStyle !== undefined ? prevStyle.nextSibling : null;\n\n style.setAttribute(SC_ATTR, SC_ATTR_ACTIVE);\n style.setAttribute(SC_ATTR_VERSION, SC_VERSION);\n\n const nonce = getNonce();\n\n if (nonce) style.setAttribute('nonce', nonce);\n\n parent.insertBefore(style, nextSibling);\n\n return style;\n};\n\n/** Get the CSSStyleSheet instance for a given style element */\nexport const getSheet = (tag: HTMLStyleElement): CSSStyleSheet => {\n if (tag.sheet) {\n return tag.sheet as any as CSSStyleSheet;\n }\n\n // Avoid Firefox quirk where the style element might not have a sheet property\n const { styleSheets } = document;\n for (let i = 0, l = styleSheets.length; i < l; i++) {\n const sheet = styleSheets[i];\n if (sheet.ownerNode === tag) {\n return sheet as any as CSSStyleSheet;\n }\n }\n\n throw styledError(17);\n};\n","import { InsertionTarget } from '../types';\nimport { getSheet, makeStyleTag } from './dom';\nimport { SheetOptions, Tag } from './types';\n\n/** Create a CSSStyleSheet-like tag depending on the environment */\nexport const makeTag = ({ isServer, useCSSOMInjection, target }: SheetOptions) => {\n if (isServer) {\n return new VirtualTag(target);\n } else if (useCSSOMInjection) {\n return new CSSOMTag(target);\n } else {\n return new TextTag(target);\n }\n};\n\nexport const CSSOMTag = class CSSOMTag implements Tag {\n element: HTMLStyleElement;\n\n sheet: CSSStyleSheet;\n\n length: number;\n\n constructor(target?: InsertionTarget | undefined) {\n this.element = makeStyleTag(target);\n\n // Avoid Edge bug where empty style elements don't create sheets\n this.element.appendChild(document.createTextNode(''));\n\n this.sheet = getSheet(this.element);\n this.length = 0;\n }\n\n insertRule(index: number, rule: string): boolean {\n try {\n this.sheet.insertRule(rule, index);\n this.length++;\n return true;\n } catch (_error) {\n return false;\n }\n }\n\n deleteRule(index: number): void {\n this.sheet.deleteRule(index);\n this.length--;\n }\n\n getRule(index: number): string {\n const rule = this.sheet.cssRules[index];\n\n // Avoid IE11 quirk where cssText is inaccessible on some invalid rules\n if (rule && rule.cssText) {\n return rule.cssText;\n } else {\n return '';\n }\n }\n};\n\n/** A Tag that emulates the CSSStyleSheet API but uses text nodes */\nexport const TextTag = class TextTag implements Tag {\n element: HTMLStyleElement;\n nodes: NodeListOf;\n length: number;\n\n constructor(target?: InsertionTarget | undefined) {\n this.element = makeStyleTag(target);\n this.nodes = this.element.childNodes;\n this.length = 0;\n }\n\n insertRule(index: number, rule: string) {\n if (index <= this.length && index >= 0) {\n const node = document.createTextNode(rule);\n const refNode = this.nodes[index];\n this.element.insertBefore(node, refNode || null);\n this.length++;\n return true;\n } else {\n return false;\n }\n }\n\n deleteRule(index: number) {\n this.element.removeChild(this.nodes[index]);\n this.length--;\n }\n\n getRule(index: number) {\n if (index < this.length) {\n return this.nodes[index].textContent as string;\n } else {\n return '';\n }\n }\n};\n\n/** A completely virtual (server-side) Tag that doesn't manipulate the DOM */\nexport const VirtualTag = class VirtualTag implements Tag {\n rules: string[];\n\n length: number;\n\n constructor(_target?: InsertionTarget | undefined) {\n this.rules = [];\n this.length = 0;\n }\n\n insertRule(index: number, rule: string) {\n if (index <= this.length) {\n this.rules.splice(index, 0, rule);\n this.length++;\n return true;\n } else {\n return false;\n }\n }\n\n deleteRule(index: number) {\n this.rules.splice(index, 1);\n this.length--;\n }\n\n getRule(index: number) {\n if (index < this.length) {\n return this.rules[index];\n } else {\n return '';\n }\n }\n};\n","import { DISABLE_SPEEDY, IS_BROWSER } from '../constants';\nimport { InsertionTarget } from '../types';\nimport { EMPTY_OBJECT } from '../utils/empties';\nimport { setToString } from '../utils/setToString';\nimport { makeGroupedTag } from './GroupedTag';\nimport { getGroupForId } from './GroupIDAllocator';\nimport { outputSheet, rehydrateSheet } from './Rehydration';\nimport { makeTag } from './Tag';\nimport { GroupedTag, Sheet, SheetOptions } from './types';\n\nlet SHOULD_REHYDRATE = IS_BROWSER;\n\ntype SheetConstructorArgs = {\n isServer?: boolean;\n useCSSOMInjection?: boolean;\n target?: InsertionTarget | undefined;\n};\n\ntype GlobalStylesAllocationMap = {\n [key: string]: number;\n};\ntype NamesAllocationMap = Map>;\n\nconst defaultOptions: SheetOptions = {\n isServer: !IS_BROWSER,\n useCSSOMInjection: !DISABLE_SPEEDY,\n};\n\n/** Contains the main stylesheet logic for stringification and caching */\nexport default class StyleSheet implements Sheet {\n gs: GlobalStylesAllocationMap;\n names: NamesAllocationMap;\n options: SheetOptions;\n server: boolean;\n tag?: GroupedTag | undefined;\n\n /** Register a group ID to give it an index */\n static registerId(id: string): number {\n return getGroupForId(id);\n }\n\n constructor(\n options: SheetConstructorArgs = EMPTY_OBJECT as Object,\n globalStyles: GlobalStylesAllocationMap = {},\n names?: NamesAllocationMap | undefined\n ) {\n this.options = {\n ...defaultOptions,\n ...options,\n };\n\n this.gs = globalStyles;\n this.names = new Map(names as NamesAllocationMap);\n this.server = !!options.isServer;\n\n // We rehydrate only once and use the sheet that is created first\n if (!this.server && IS_BROWSER && SHOULD_REHYDRATE) {\n SHOULD_REHYDRATE = false;\n rehydrateSheet(this);\n }\n\n setToString(this, () => outputSheet(this));\n }\n\n rehydrate(): void {\n if (!this.server && IS_BROWSER) {\n rehydrateSheet(this);\n }\n }\n\n reconstructWithOptions(options: SheetConstructorArgs, withNames = true) {\n return new StyleSheet(\n { ...this.options, ...options },\n this.gs,\n (withNames && this.names) || undefined\n );\n }\n\n allocateGSInstance(id: string) {\n return (this.gs[id] = (this.gs[id] || 0) + 1);\n }\n\n /** Lazily initialises a GroupedTag for when it's actually needed */\n getTag() {\n return this.tag || (this.tag = makeGroupedTag(makeTag(this.options)));\n }\n\n /** Check whether a name is known for caching */\n hasNameForId(id: string, name: string): boolean {\n return this.names.has(id) && (this.names.get(id) as any).has(name);\n }\n\n /** Mark a group's name as known for caching */\n registerName(id: string, name: string) {\n getGroupForId(id);\n\n if (!this.names.has(id)) {\n const groupNames = new Set();\n groupNames.add(name);\n this.names.set(id, groupNames);\n } else {\n (this.names.get(id) as any).add(name);\n }\n }\n\n /** Insert new rules which also marks the name as known */\n insertRules(id: string, name: string, rules: string | string[]) {\n this.registerName(id, name);\n this.getTag().insertRules(getGroupForId(id), rules);\n }\n\n /** Clears all cached names for a given group ID */\n clearNames(id: string) {\n if (this.names.has(id)) {\n (this.names.get(id) as any).clear();\n }\n }\n\n /** Clears all rules for a given group ID */\n clearRules(id: string) {\n this.getTag().clearGroup(getGroupForId(id));\n this.clearNames(id);\n }\n\n /** Clears the entire tag which deletes all rules but not its names */\n clearTag() {\n // NOTE: This does not clear the names, since it's only used during SSR\n // so that we can continuously output only new rules\n this.tag = undefined;\n }\n}\n","import * as stylis from 'stylis';\nimport { Stringifier } from '../types';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from './empties';\nimport throwStyledError from './error';\nimport { SEED, phash } from './hash';\n\nconst AMP_REGEX = /&/g;\nconst COMMENT_REGEX = /^\\s*\\/\\/.*$/gm;\n\nexport type ICreateStylisInstance = {\n options?: { namespace?: string | undefined; prefix?: boolean | undefined } | undefined;\n plugins?: stylis.Middleware[] | undefined;\n};\n\n/**\n * Takes an element and recurses through it's rules added the namespace to the start of each selector.\n * Takes into account media queries by recursing through child rules if they are present.\n */\nfunction recursivelySetNamepace(compiled: stylis.Element[], namespace: String): stylis.Element[] {\n return compiled.map(rule => {\n if (rule.type === 'rule') {\n // add the namespace to the start\n rule.value = `${namespace} ${rule.value}`;\n // add the namespace after each comma for subsequent selectors.\n rule.value = rule.value.replaceAll(',', `,${namespace} `);\n rule.props = (rule.props as string[]).map(prop => {\n return `${namespace} ${prop}`;\n });\n }\n\n if (Array.isArray(rule.children) && rule.type !== '@keyframes') {\n rule.children = recursivelySetNamepace(rule.children, namespace);\n }\n return rule;\n });\n}\n\nexport default function createStylisInstance(\n {\n options = EMPTY_OBJECT as object,\n plugins = EMPTY_ARRAY as unknown as stylis.Middleware[],\n }: ICreateStylisInstance = EMPTY_OBJECT as object\n) {\n let _componentId: string;\n let _selector: string;\n let _selectorRegexp: RegExp;\n\n const selfReferenceReplacer = (match: string, offset: number, string: string) => {\n if (\n /**\n * We only want to refer to the static class directly if the selector is part of a\n * self-reference selector `& + & { color: red; }`\n */\n string.startsWith(_selector) &&\n string.endsWith(_selector) &&\n string.replaceAll(_selector, '').length > 0\n ) {\n return `.${_componentId}`;\n }\n\n return match;\n };\n\n /**\n * When writing a style like\n *\n * & + & {\n * color: red;\n * }\n *\n * The second ampersand should be a reference to the static component class. stylis\n * has no knowledge of static class so we have to intelligently replace the base selector.\n *\n * https://github.com/thysultan/stylis.js/tree/v4.0.2#abstract-syntax-structure\n */\n const selfReferenceReplacementPlugin: stylis.Middleware = element => {\n if (element.type === stylis.RULESET && element.value.includes('&')) {\n (element.props as string[])[0] = element.props[0]\n // catch any hanging references that stylis missed\n .replace(AMP_REGEX, _selector)\n .replace(_selectorRegexp, selfReferenceReplacer);\n }\n };\n\n const middlewares = plugins.slice();\n\n middlewares.push(selfReferenceReplacementPlugin);\n\n /**\n * Enables automatic vendor-prefixing for styles.\n */\n if (options.prefix) {\n middlewares.push(stylis.prefixer);\n }\n\n middlewares.push(stylis.stringify);\n\n const stringifyRules: Stringifier = (\n css: string,\n selector = '',\n /**\n * This \"prefix\" referes to a _selector_ prefix.\n */\n prefix = '',\n componentId = '&'\n ) => {\n // stylis has no concept of state to be passed to plugins\n // but since JS is single-threaded, we can rely on that to ensure\n // these properties stay in sync with the current stylis run\n _componentId = componentId;\n _selector = selector;\n _selectorRegexp = new RegExp(`\\\\${_selector}\\\\b`, 'g');\n\n const flatCSS = css.replace(COMMENT_REGEX, '');\n let compiled = stylis.compile(\n prefix || selector ? `${prefix} ${selector} { ${flatCSS} }` : flatCSS\n );\n\n if (options.namespace) {\n compiled = recursivelySetNamepace(compiled, options.namespace);\n }\n\n const stack: string[] = [];\n\n stylis.serialize(\n compiled,\n stylis.middleware(middlewares.concat(stylis.rulesheet(value => stack.push(value))))\n );\n\n return stack;\n };\n\n stringifyRules.hash = plugins.length\n ? plugins\n .reduce((acc, plugin) => {\n if (!plugin.name) {\n throwStyledError(15);\n }\n\n return phash(acc, plugin.name);\n }, SEED)\n .toString()\n : '';\n\n return stringifyRules;\n}\n","import React, { useContext, useEffect, useMemo, useState } from 'react';\nimport shallowequal from 'shallowequal';\nimport type stylis from 'stylis';\nimport StyleSheet from '../sheet';\nimport { InsertionTarget, ShouldForwardProp, Stringifier } from '../types';\nimport createStylisInstance from '../utils/stylis';\n\nexport const mainSheet: StyleSheet = new StyleSheet();\nexport const mainStylis: Stringifier = createStylisInstance();\n\nexport type IStyleSheetContext = {\n shouldForwardProp?: ShouldForwardProp<'web'> | undefined;\n styleSheet: StyleSheet;\n stylis: Stringifier;\n};\n\nexport const StyleSheetContext = React.createContext({\n shouldForwardProp: undefined,\n styleSheet: mainSheet,\n stylis: mainStylis,\n});\n\nexport const StyleSheetConsumer = StyleSheetContext.Consumer;\n\nexport type IStylisContext = Stringifier | void;\nexport const StylisContext = React.createContext(undefined);\nexport const StylisConsumer = StylisContext.Consumer;\n\nexport function useStyleSheetContext() {\n return useContext(StyleSheetContext);\n}\n\nexport type IStyleSheetManager = React.PropsWithChildren<{\n /**\n * If desired, you can pass this prop to disable \"speedy\" insertion mode, which\n * uses the browser [CSSOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet).\n * When disabled, rules are inserted as simple text into style blocks.\n */\n disableCSSOMInjection?: undefined | boolean;\n /**\n * If you are working exclusively with modern browsers, vendor prefixes can often be omitted\n * to reduce the weight of CSS on the page.\n */\n enableVendorPrefixes?: undefined | boolean;\n /**\n * Provide an optional selector to be prepended to all generated style rules.\n */\n namespace?: undefined | string;\n /**\n * Create and provide your own `StyleSheet` if necessary for advanced SSR scenarios.\n */\n sheet?: undefined | StyleSheet;\n /**\n * Starting in v6, styled-components no longer does its own prop validation\n * and recommends use of transient props \"$prop\" to pass style-only props to\n * components. If for some reason you are not able to use transient props, a\n * prop validation function can be provided via `StyleSheetManager`, such as\n * `@emotion/is-prop-valid`.\n *\n * When the return value is `true`, props will be forwarded to the DOM/underlying\n * component. If return value is `false`, the prop will be discarded after styles\n * are calculated.\n *\n * Manually composing `styled.{element}.withConfig({shouldForwardProp})` will\n * override this default.\n */\n shouldForwardProp?: undefined | IStyleSheetContext['shouldForwardProp'];\n /**\n * An array of plugins to be run by stylis (style processor) during compilation.\n * Check out [what's available on npm*](https://www.npmjs.com/search?q=keywords%3Astylis).\n *\n * \\* The plugin(s) must be compatible with stylis v4 or above.\n */\n stylisPlugins?: undefined | stylis.Middleware[];\n /**\n * Provide an alternate DOM node to host generated styles; useful for iframes.\n */\n target?: undefined | InsertionTarget;\n}>;\n\nexport function StyleSheetManager(props: IStyleSheetManager): React.JSX.Element {\n const [plugins, setPlugins] = useState(props.stylisPlugins);\n const { styleSheet } = useStyleSheetContext();\n\n const resolvedStyleSheet = useMemo(() => {\n let sheet = styleSheet;\n\n if (props.sheet) {\n sheet = props.sheet;\n } else if (props.target) {\n sheet = sheet.reconstructWithOptions({ target: props.target }, false);\n }\n\n if (props.disableCSSOMInjection) {\n sheet = sheet.reconstructWithOptions({ useCSSOMInjection: false });\n }\n\n return sheet;\n }, [props.disableCSSOMInjection, props.sheet, props.target, styleSheet]);\n\n const stylis = useMemo(\n () =>\n createStylisInstance({\n options: { namespace: props.namespace, prefix: props.enableVendorPrefixes },\n plugins,\n }),\n [props.enableVendorPrefixes, props.namespace, plugins]\n );\n\n useEffect(() => {\n if (!shallowequal(plugins, props.stylisPlugins)) setPlugins(props.stylisPlugins);\n }, [props.stylisPlugins]);\n\n const styleSheetContextValue = useMemo(\n () => ({\n shouldForwardProp: props.shouldForwardProp,\n styleSheet: resolvedStyleSheet,\n stylis,\n }),\n [props.shouldForwardProp, resolvedStyleSheet, stylis]\n );\n\n return (\n \n {props.children} \n \n );\n}\n","import StyleSheet from '../sheet';\nimport { Keyframes as KeyframesType, Stringifier } from '../types';\nimport styledError from '../utils/error';\nimport { setToString } from '../utils/setToString';\nimport { mainStylis } from './StyleSheetManager';\n\nexport default class Keyframes implements KeyframesType {\n id: string;\n name: string;\n rules: string;\n\n constructor(name: string, rules: string) {\n this.name = name;\n this.id = `sc-keyframes-${name}`;\n this.rules = rules;\n\n setToString(this, () => {\n throw styledError(12, String(this.name));\n });\n }\n\n inject = (styleSheet: StyleSheet, stylisInstance: Stringifier = mainStylis): void => {\n const resolvedName = this.name + stylisInstance.hash;\n\n if (!styleSheet.hasNameForId(this.id, resolvedName)) {\n styleSheet.insertRules(\n this.id,\n resolvedName,\n stylisInstance(this.rules, resolvedName, '@keyframes')\n );\n }\n };\n\n getName(stylisInstance: Stringifier = mainStylis): string {\n return this.name + stylisInstance.hash;\n }\n}\n","const isUpper = (c: string) => c >= 'A' && c <= 'Z';\n\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n */\nexport default function hyphenateStyleName(string: string): string {\n let output = '';\n\n for (let i = 0; i < string.length; i++) {\n const c = string[i];\n // Check for CSS variable prefix\n if (i === 1 && c === '-' && string[0] === '-') {\n return string;\n }\n\n if (isUpper(c)) {\n output += '-' + c.toLowerCase();\n } else {\n output += c;\n }\n }\n\n return output.startsWith('ms-') ? '-' + output : output;\n}\n","import Keyframes from '../models/Keyframes';\nimport StyleSheet from '../sheet';\nimport {\n AnyComponent,\n Dict,\n ExecutionContext,\n Interpolation,\n IStyledComponent,\n RuleSet,\n Stringifier,\n StyledObject,\n} from '../types';\nimport addUnitIfNeeded from './addUnitIfNeeded';\nimport { EMPTY_ARRAY } from './empties';\nimport getComponentName from './getComponentName';\nimport hyphenate from './hyphenateStyleName';\nimport isFunction from './isFunction';\nimport isPlainObject from './isPlainObject';\nimport isStatelessFunction from './isStatelessFunction';\nimport isStyledComponent from './isStyledComponent';\n\n/**\n * It's falsish not falsy because 0 is allowed.\n */\nconst isFalsish = (chunk: any): chunk is undefined | null | false | '' =>\n chunk === undefined || chunk === null || chunk === false || chunk === '';\n\nexport const objToCssArray = (obj: Dict): string[] => {\n const rules = [];\n\n for (const key in obj) {\n const val = obj[key];\n if (!obj.hasOwnProperty(key) || isFalsish(val)) continue;\n\n // @ts-expect-error Property 'isCss' does not exist on type 'any[]'\n if ((Array.isArray(val) && val.isCss) || isFunction(val)) {\n rules.push(`${hyphenate(key)}:`, val, ';');\n } else if (isPlainObject(val)) {\n rules.push(`${key} {`, ...objToCssArray(val), '}');\n } else {\n rules.push(`${hyphenate(key)}: ${addUnitIfNeeded(key, val)};`);\n }\n }\n\n return rules;\n};\n\nexport default function flatten(\n chunk: Interpolation,\n executionContext?: (ExecutionContext & Props) | undefined,\n styleSheet?: StyleSheet | undefined,\n stylisInstance?: Stringifier | undefined\n): RuleSet {\n if (isFalsish(chunk)) {\n return [];\n }\n\n /* Handle other components */\n if (isStyledComponent(chunk)) {\n return [`.${(chunk as unknown as IStyledComponent<'web', any>).styledComponentId}`];\n }\n\n /* Either execute or defer the function */\n if (isFunction(chunk)) {\n if (isStatelessFunction(chunk) && executionContext) {\n const result = chunk(executionContext);\n\n if (\n process.env.NODE_ENV !== 'production' &&\n typeof result === 'object' &&\n !Array.isArray(result) &&\n !(result instanceof Keyframes) &&\n !isPlainObject(result) &&\n result !== null\n ) {\n console.error(\n `${getComponentName(\n chunk as AnyComponent\n )} is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.`\n );\n }\n\n return flatten(result, executionContext, styleSheet, stylisInstance);\n } else {\n return [chunk as unknown as IStyledComponent<'web'>];\n }\n }\n\n if (chunk instanceof Keyframes) {\n if (styleSheet) {\n chunk.inject(styleSheet, stylisInstance);\n return [chunk.getName(stylisInstance)];\n } else {\n return [chunk];\n }\n }\n\n /* Handle objects */\n if (isPlainObject(chunk)) {\n return objToCssArray(chunk as StyledObject);\n }\n\n if (!Array.isArray(chunk)) {\n return [chunk.toString()];\n }\n\n return flatMap(chunk, chunklet =>\n flatten(chunklet, executionContext, styleSheet, stylisInstance)\n );\n}\n\nfunction flatMap(array: T[], transform: (value: T, index: number, array: T[]) => U[]): U[] {\n return Array.prototype.concat.apply(EMPTY_ARRAY, array.map(transform));\n}\n","import unitless from '@emotion/unitless';\n\n// Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js\nexport default function addUnitIfNeeded(name: string, value: any) {\n // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133\n if (value == null || typeof value === 'boolean' || value === '') {\n return '';\n }\n\n if (typeof value === 'number' && value !== 0 && !(name in unitless) && !name.startsWith('--')) {\n return `${value}px`; // Presumes implicit 'px' suffix for unitless numbers except for CSS variables\n }\n\n return String(value).trim();\n}\n","import isFunction from './isFunction';\n\nexport default function isStatelessFunction(test: any): test is Function {\n return isFunction(test) && !(test.prototype && test.prototype.isReactComponent);\n}\n","import { RuleSet } from '../types';\nimport isFunction from './isFunction';\nimport isStyledComponent from './isStyledComponent';\n\nexport default function isStaticRules(rules: RuleSet) {\n for (let i = 0; i < rules.length; i += 1) {\n const rule = rules[i];\n\n if (isFunction(rule) && !isStyledComponent(rule)) {\n // functions are allowed to be static if they're just being\n // used to get the classname of a nested styled component\n return false;\n }\n }\n\n return true;\n}\n","import { SC_VERSION } from '../constants';\nimport StyleSheet from '../sheet';\nimport { ExecutionContext, RuleSet, Stringifier } from '../types';\nimport flatten from '../utils/flatten';\nimport generateName from '../utils/generateAlphabeticName';\nimport { hash, phash } from '../utils/hash';\nimport isStaticRules from '../utils/isStaticRules';\nimport { joinStringArray, joinStrings } from '../utils/joinStrings';\n\nconst SEED = hash(SC_VERSION);\n\n/**\n * ComponentStyle is all the CSS-specific stuff, not the React-specific stuff.\n */\nexport default class ComponentStyle {\n baseHash: number;\n baseStyle: ComponentStyle | null | undefined;\n componentId: string;\n isStatic: boolean;\n rules: RuleSet;\n staticRulesId: string;\n\n constructor(rules: RuleSet, componentId: string, baseStyle?: ComponentStyle | undefined) {\n this.rules = rules;\n this.staticRulesId = '';\n this.isStatic =\n process.env.NODE_ENV === 'production' &&\n (baseStyle === undefined || baseStyle.isStatic) &&\n isStaticRules(rules);\n this.componentId = componentId;\n this.baseHash = phash(SEED, componentId);\n this.baseStyle = baseStyle;\n\n // NOTE: This registers the componentId, which ensures a consistent order\n // for this component's styles compared to others\n StyleSheet.registerId(componentId);\n }\n\n generateAndInjectStyles(\n executionContext: ExecutionContext,\n styleSheet: StyleSheet,\n stylis: Stringifier\n ): string {\n let names = this.baseStyle\n ? this.baseStyle.generateAndInjectStyles(executionContext, styleSheet, stylis)\n : '';\n\n // force dynamic classnames if user-supplied stylis plugins are in use\n if (this.isStatic && !stylis.hash) {\n if (this.staticRulesId && styleSheet.hasNameForId(this.componentId, this.staticRulesId)) {\n names = joinStrings(names, this.staticRulesId);\n } else {\n const cssStatic = joinStringArray(\n flatten(this.rules, executionContext, styleSheet, stylis) as string[]\n );\n const name = generateName(phash(this.baseHash, cssStatic) >>> 0);\n\n if (!styleSheet.hasNameForId(this.componentId, name)) {\n const cssStaticFormatted = stylis(cssStatic, `.${name}`, undefined, this.componentId);\n styleSheet.insertRules(this.componentId, name, cssStaticFormatted);\n }\n\n names = joinStrings(names, name);\n this.staticRulesId = name;\n }\n } else {\n let dynamicHash = phash(this.baseHash, stylis.hash);\n let css = '';\n\n for (let i = 0; i < this.rules.length; i++) {\n const partRule = this.rules[i];\n\n if (typeof partRule === 'string') {\n css += partRule;\n\n if (process.env.NODE_ENV !== 'production') dynamicHash = phash(dynamicHash, partRule);\n } else if (partRule) {\n const partString = joinStringArray(\n flatten(partRule, executionContext, styleSheet, stylis) as string[]\n );\n // The same value can switch positions in the array, so we include \"i\" in the hash.\n dynamicHash = phash(dynamicHash, partString + i);\n css += partString;\n }\n }\n\n if (css) {\n const name = generateName(dynamicHash >>> 0);\n\n if (!styleSheet.hasNameForId(this.componentId, name)) {\n styleSheet.insertRules(\n this.componentId,\n name,\n stylis(css, `.${name}`, undefined, this.componentId)\n );\n }\n\n names = joinStrings(names, name);\n }\n }\n\n return names;\n }\n}\n","import React, { useContext, useMemo } from 'react';\nimport styledError from '../utils/error';\nimport isFunction from '../utils/isFunction';\n\n/**\n * Override DefaultTheme to get accurate typings for your project.\n *\n * ```\n * // create styled-components.d.ts in your project source\n * // if it isn't being picked up, check tsconfig compilerOptions.types\n * import type { CSSProp } from \"styled-components\";\n * import Theme from './theme';\n *\n * type ThemeType = typeof Theme;\n *\n * declare module \"styled-components\" {\n * export interface DefaultTheme extends ThemeType {}\n * }\n *\n * declare module \"react\" {\n * interface DOMAttributes {\n * css?: CSSProp;\n * }\n * }\n * ```\n */\nexport interface DefaultTheme {\n [key: string]: any;\n}\n\ntype ThemeFn = (outerTheme?: DefaultTheme | undefined) => DefaultTheme;\ntype ThemeArgument = DefaultTheme | ThemeFn;\n\ntype Props = {\n children?: React.ReactNode;\n theme: ThemeArgument;\n};\n\nexport const ThemeContext = React.createContext(undefined);\n\nexport const ThemeConsumer = ThemeContext.Consumer;\n\nfunction mergeTheme(theme: ThemeArgument, outerTheme?: DefaultTheme | undefined): DefaultTheme {\n if (!theme) {\n throw styledError(14);\n }\n\n if (isFunction(theme)) {\n const themeFn = theme as ThemeFn;\n const mergedTheme = themeFn(outerTheme);\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (mergedTheme === null || Array.isArray(mergedTheme) || typeof mergedTheme !== 'object')\n ) {\n throw styledError(7);\n }\n\n return mergedTheme;\n }\n\n if (Array.isArray(theme) || typeof theme !== 'object') {\n throw styledError(8);\n }\n\n return outerTheme ? { ...outerTheme, ...theme } : theme;\n}\n\n/**\n * Returns the current theme (as provided by the closest ancestor `ThemeProvider`.)\n *\n * If no `ThemeProvider` is found, the function will error. If you need access to the theme in an\n * uncertain composition scenario, `React.useContext(ThemeContext)` will not emit an error if there\n * is no `ThemeProvider` ancestor.\n */\nexport function useTheme(): DefaultTheme {\n const theme = useContext(ThemeContext);\n\n if (!theme) {\n throw styledError(18);\n }\n\n return theme;\n}\n\n/**\n * Provide a theme to an entire react component tree via context\n */\nexport default function ThemeProvider(props: Props): React.JSX.Element | null {\n const outerTheme = React.useContext(ThemeContext);\n const themeContext = useMemo(\n () => mergeTheme(props.theme, outerTheme),\n [props.theme, outerTheme]\n );\n\n if (!props.children) {\n return null;\n }\n\n return {props.children} ;\n}\n","import isPropValid from '@emotion/is-prop-valid';\nimport React, { createElement, Ref, useDebugValue } from 'react';\nimport { SC_VERSION } from '../constants';\nimport type {\n AnyComponent,\n Attrs,\n BaseObject,\n Dict,\n ExecutionContext,\n ExecutionProps,\n IStyledComponent,\n IStyledComponentFactory,\n IStyledStatics,\n OmitNever,\n RuleSet,\n StyledOptions,\n WebTarget,\n} from '../types';\nimport { checkDynamicCreation } from '../utils/checkDynamicCreation';\nimport createWarnTooManyClasses from '../utils/createWarnTooManyClasses';\nimport determineTheme from '../utils/determineTheme';\nimport domElements from '../utils/domElements';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '../utils/empties';\nimport escape from '../utils/escape';\nimport generateComponentId from '../utils/generateComponentId';\nimport generateDisplayName from '../utils/generateDisplayName';\nimport hoist from '../utils/hoist';\nimport isFunction from '../utils/isFunction';\nimport isStyledComponent from '../utils/isStyledComponent';\nimport isTag from '../utils/isTag';\nimport { joinStrings } from '../utils/joinStrings';\nimport merge from '../utils/mixinDeep';\nimport { setToString } from '../utils/setToString';\nimport ComponentStyle from './ComponentStyle';\nimport { useStyleSheetContext } from './StyleSheetManager';\nimport { DefaultTheme, ThemeContext } from './ThemeProvider';\n\nconst identifiers: { [key: string]: number } = {};\n\n/* We depend on components having unique IDs */\nfunction generateId(\n displayName?: string | undefined,\n parentComponentId?: string | undefined\n): string {\n const name = typeof displayName !== 'string' ? 'sc' : escape(displayName);\n // Ensure that no displayName can lead to duplicate componentIds\n identifiers[name] = (identifiers[name] || 0) + 1;\n\n const componentId = `${name}-${generateComponentId(\n // SC_VERSION gives us isolation between multiple runtimes on the page at once\n // this is improved further with use of the babel plugin \"namespace\" feature\n SC_VERSION + name + identifiers[name]\n )}`;\n\n return parentComponentId ? `${parentComponentId}-${componentId}` : componentId;\n}\n\nfunction useInjectedStyle(\n componentStyle: ComponentStyle,\n resolvedAttrs: T\n) {\n const ssc = useStyleSheetContext();\n\n const className = componentStyle.generateAndInjectStyles(\n resolvedAttrs,\n ssc.styleSheet,\n ssc.stylis\n );\n\n if (process.env.NODE_ENV !== 'production') useDebugValue(className);\n\n return className;\n}\n\nfunction resolveContext(\n attrs: Attrs & Props>[],\n props: React.HTMLAttributes & ExecutionProps & Props,\n theme: DefaultTheme\n) {\n const context: React.HTMLAttributes &\n ExecutionContext &\n Props & { [key: string]: any; class?: string; ref?: React.Ref } = {\n ...props,\n // unset, add `props.className` back at the end so props always \"wins\"\n className: undefined,\n theme,\n };\n let attrDef;\n\n for (let i = 0; i < attrs.length; i += 1) {\n attrDef = attrs[i];\n const resolvedAttrDef = isFunction(attrDef) ? attrDef(context) : attrDef;\n\n for (const key in resolvedAttrDef) {\n context[key as keyof typeof context] =\n key === 'className'\n ? joinStrings(context[key] as string | undefined, resolvedAttrDef[key] as string)\n : key === 'style'\n ? { ...context[key], ...resolvedAttrDef[key] }\n : resolvedAttrDef[key as keyof typeof resolvedAttrDef];\n }\n }\n\n if (props.className) {\n context.className = joinStrings(context.className, props.className);\n }\n\n return context;\n}\n\nlet seenUnknownProps = new Set();\n\nfunction useStyledComponentImpl(\n forwardedComponent: IStyledComponent<'web', Props>,\n props: ExecutionProps & Props,\n forwardedRef: Ref\n) {\n const {\n attrs: componentAttrs,\n componentStyle,\n defaultProps,\n foldedComponentIds,\n styledComponentId,\n target,\n } = forwardedComponent;\n\n const contextTheme = React.useContext(ThemeContext);\n const ssc = useStyleSheetContext();\n const shouldForwardProp = forwardedComponent.shouldForwardProp || ssc.shouldForwardProp;\n\n if (process.env.NODE_ENV !== 'production') useDebugValue(styledComponentId);\n\n // NOTE: the non-hooks version only subscribes to this when !componentStyle.isStatic,\n // but that'd be against the rules-of-hooks. We could be naughty and do it anyway as it\n // should be an immutable value, but behave for now.\n const theme = determineTheme(props, contextTheme, defaultProps) || EMPTY_OBJECT;\n\n const context = resolveContext(componentAttrs, props, theme);\n const elementToBeCreated: WebTarget = context.as || target;\n const propsForElement: Dict = {};\n\n for (const key in context) {\n if (context[key] === undefined) {\n // Omit undefined values from props passed to wrapped element.\n // This enables using .attrs() to remove props, for example.\n } else if (key[0] === '$' || key === 'as' || (key === 'theme' && context.theme === theme)) {\n // Omit transient props and execution props.\n } else if (key === 'forwardedAs') {\n propsForElement.as = context.forwardedAs;\n } else if (!shouldForwardProp || shouldForwardProp(key, elementToBeCreated)) {\n propsForElement[key] = context[key];\n\n if (\n !shouldForwardProp &&\n process.env.NODE_ENV === 'development' &&\n !isPropValid(key) &&\n !seenUnknownProps.has(key) &&\n // Only warn on DOM Element.\n domElements.has(elementToBeCreated as any)\n ) {\n seenUnknownProps.add(key);\n console.warn(\n `styled-components: it looks like an unknown prop \"${key}\" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via \\`\\` (connect an API like \\`@emotion/is-prop-valid\\`) or consider using transient props (\\`$\\` prefix for automatic filtering.)`\n );\n }\n }\n }\n\n const generatedClassName = useInjectedStyle(componentStyle, context);\n\n if (process.env.NODE_ENV !== 'production' && forwardedComponent.warnTooManyClasses) {\n forwardedComponent.warnTooManyClasses(generatedClassName);\n }\n\n let classString = joinStrings(foldedComponentIds, styledComponentId);\n if (generatedClassName) {\n classString += ' ' + generatedClassName;\n }\n if (context.className) {\n classString += ' ' + context.className;\n }\n\n propsForElement[\n // handle custom elements which React doesn't properly alias\n isTag(elementToBeCreated) &&\n !domElements.has(elementToBeCreated as Extract)\n ? 'class'\n : 'className'\n ] = classString;\n\n propsForElement.ref = forwardedRef;\n\n return createElement(elementToBeCreated, propsForElement);\n}\n\nfunction createStyledComponent<\n Target extends WebTarget,\n OuterProps extends object,\n Statics extends object = BaseObject,\n>(\n target: Target,\n options: StyledOptions<'web', OuterProps>,\n rules: RuleSet\n): ReturnType> {\n const isTargetStyledComp = isStyledComponent(target);\n const styledComponentTarget = target as IStyledComponent<'web', OuterProps>;\n const isCompositeComponent = !isTag(target);\n\n const {\n attrs = EMPTY_ARRAY,\n componentId = generateId(options.displayName, options.parentComponentId),\n displayName = generateDisplayName(target),\n } = options;\n\n const styledComponentId =\n options.displayName && options.componentId\n ? `${escape(options.displayName)}-${options.componentId}`\n : options.componentId || componentId;\n\n // fold the underlying StyledComponent attrs up (implicit extend)\n const finalAttrs =\n isTargetStyledComp && styledComponentTarget.attrs\n ? styledComponentTarget.attrs.concat(attrs as unknown as Attrs[]).filter(Boolean)\n : (attrs as Attrs[]);\n\n let { shouldForwardProp } = options;\n\n if (isTargetStyledComp && styledComponentTarget.shouldForwardProp) {\n const shouldForwardPropFn = styledComponentTarget.shouldForwardProp;\n\n if (options.shouldForwardProp) {\n const passedShouldForwardPropFn = options.shouldForwardProp;\n\n // compose nested shouldForwardProp calls\n shouldForwardProp = (prop, elementToBeCreated) =>\n shouldForwardPropFn(prop, elementToBeCreated) &&\n passedShouldForwardPropFn(prop, elementToBeCreated);\n } else {\n shouldForwardProp = shouldForwardPropFn;\n }\n }\n\n const componentStyle = new ComponentStyle(\n rules,\n styledComponentId,\n isTargetStyledComp ? (styledComponentTarget.componentStyle as ComponentStyle) : undefined\n );\n\n function forwardRefRender(props: ExecutionProps & OuterProps, ref: Ref) {\n return useStyledComponentImpl(WrappedStyledComponent, props, ref);\n }\n\n forwardRefRender.displayName = displayName;\n\n /**\n * forwardRef creates a new interim component, which we'll take advantage of\n * instead of extending ParentComponent to create _another_ interim class\n */\n let WrappedStyledComponent = React.forwardRef(forwardRefRender) as unknown as IStyledComponent<\n 'web',\n any\n > &\n Statics;\n WrappedStyledComponent.attrs = finalAttrs;\n WrappedStyledComponent.componentStyle = componentStyle;\n WrappedStyledComponent.displayName = displayName;\n WrappedStyledComponent.shouldForwardProp = shouldForwardProp;\n\n // this static is used to preserve the cascade of static classes for component selector\n // purposes; this is especially important with usage of the css prop\n WrappedStyledComponent.foldedComponentIds = isTargetStyledComp\n ? joinStrings(styledComponentTarget.foldedComponentIds, styledComponentTarget.styledComponentId)\n : '';\n\n WrappedStyledComponent.styledComponentId = styledComponentId;\n\n // fold the underlying StyledComponent target up since we folded the styles\n WrappedStyledComponent.target = isTargetStyledComp ? styledComponentTarget.target : target;\n\n Object.defineProperty(WrappedStyledComponent, 'defaultProps', {\n get() {\n return this._foldedDefaultProps;\n },\n\n set(obj) {\n this._foldedDefaultProps = isTargetStyledComp\n ? merge({}, styledComponentTarget.defaultProps, obj)\n : obj;\n },\n });\n\n if (process.env.NODE_ENV !== 'production') {\n checkDynamicCreation(displayName, styledComponentId);\n\n WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(\n displayName,\n styledComponentId\n );\n }\n\n setToString(WrappedStyledComponent, () => `.${WrappedStyledComponent.styledComponentId}`);\n\n if (isCompositeComponent) {\n const compositeComponentTarget = target as AnyComponent;\n\n hoist(\n WrappedStyledComponent,\n compositeComponentTarget,\n {\n // all SC-specific things should not be hoisted\n attrs: true,\n componentStyle: true,\n displayName: true,\n foldedComponentIds: true,\n shouldForwardProp: true,\n styledComponentId: true,\n target: true,\n } as { [key in keyof OmitNever>]: true }\n );\n }\n\n return WrappedStyledComponent;\n}\n\nexport default createStyledComponent;\n","import { StyledTarget } from '../types';\nimport getComponentName from './getComponentName';\nimport isTag from './isTag';\n\nexport default function generateDisplayName(target: StyledTarget) {\n return isTag(target) ? `styled.${target}` : `Styled(${getComponentName(target)})`;\n}\n","import { Interpolation } from '../types';\n\nexport default function interleave(\n strings: readonly string[],\n interpolations: Interpolation[]\n): Interpolation[] {\n const result: Interpolation[] = [strings[0]];\n\n for (let i = 0, len = interpolations.length; i < len; i += 1) {\n result.push(interpolations[i], strings[i + 1]);\n }\n\n return result;\n}\n","import {\n BaseObject,\n Interpolation,\n NoInfer,\n RuleSet,\n StyledObject,\n StyleFunction,\n Styles,\n} from '../types';\nimport { EMPTY_ARRAY } from '../utils/empties';\nimport flatten from '../utils/flatten';\nimport interleave from '../utils/interleave';\nimport isFunction from '../utils/isFunction';\nimport isPlainObject from '../utils/isPlainObject';\n\n/**\n * Used when flattening object styles to determine if we should\n * expand an array of styles.\n */\nconst addTag = >(arg: T): T & { isCss: true } =>\n Object.assign(arg, { isCss: true } as const);\n\nfunction css(styles: Styles, ...interpolations: Interpolation[]): RuleSet;\nfunction css(\n styles: Styles>,\n ...interpolations: Interpolation>[]\n): RuleSet>;\nfunction css(\n styles: Styles>,\n ...interpolations: Interpolation>[]\n): RuleSet> {\n if (isFunction(styles) || isPlainObject(styles)) {\n const styleFunctionOrObject = styles as StyleFunction | StyledObject;\n\n return addTag(\n flatten(\n interleave(EMPTY_ARRAY, [\n styleFunctionOrObject,\n ...interpolations,\n ]) as Interpolation\n )\n );\n }\n\n const styleStringArray = styles as TemplateStringsArray;\n\n if (\n interpolations.length === 0 &&\n styleStringArray.length === 1 &&\n typeof styleStringArray[0] === 'string'\n ) {\n return flatten(styleStringArray);\n }\n\n return addTag(\n flatten(interleave(styleStringArray, interpolations) as Interpolation)\n );\n}\n\nexport default css;\n","import {\n Attrs,\n BaseObject,\n ExecutionProps,\n Interpolation,\n IStyledComponent,\n IStyledComponentFactory,\n KnownTarget,\n NoInfer,\n Runtime,\n StyledOptions,\n StyledTarget,\n Styles,\n Substitute,\n} from '../types';\nimport { EMPTY_OBJECT } from '../utils/empties';\nimport styledError from '../utils/error';\nimport css from './css';\n\ntype AttrsResult> = T extends (...args: any) => infer P\n ? P extends object\n ? P\n : never\n : T extends object\n ? T\n : never;\n\n/**\n * Based on Attrs being a simple object or function that returns\n * a prop object, inspect the attrs result and attempt to extract\n * any \"as\" prop usage to modify the runtime target.\n */\ntype AttrsTarget<\n R extends Runtime,\n T extends Attrs,\n FallbackTarget extends StyledTarget,\n Result extends ExecutionProps = AttrsResult,\n> = Result extends { as: infer RuntimeTarget }\n ? RuntimeTarget extends KnownTarget\n ? RuntimeTarget\n : FallbackTarget\n : FallbackTarget;\n\nexport interface Styled<\n R extends Runtime,\n Target extends StyledTarget,\n OuterProps extends object,\n OuterStatics extends object = BaseObject,\n> {\n (\n initialStyles: Styles>>,\n ...interpolations: Interpolation>>[]\n ): IStyledComponent> &\n OuterStatics &\n Statics &\n (R extends 'web'\n ? Target extends string\n ? {}\n : Omit