-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlovelace-card-templater.js
146 lines (146 loc) · 153 KB
/
lovelace-card-templater.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},i={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(16),i=n.n(r),s=n(3),a=n.n(s),o=n(5),u=n.n(o),c=n(0),l=n(18),f=n(8),h=function(){function t(e,n,r){a()(this,t),Object.defineProperty(this,"context",{value:r||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=n||[],this.type=e,this.value=null}return u()(t,null,[{key:"addStringTerminator",value:function(e,n,r){if("\n"===r[r.length-1])return r;var i=t.endOfWhiteSpace(e,n);return i>=e.length||"\n"===e[i]?r+"\n":r}},{key:"atDocumentBoundary",value:function(t,e,n){var r=t[e];if(!r)return!0;var i=t[e-1];if(i&&"\n"!==i)return!1;if(n){if(r!==n)return!1}else if(r!==c.a.DIRECTIVES_END&&r!==c.a.DOCUMENT_END)return!1;var s=t[e+1],a=t[e+2];if(s!==r||a!==r)return!1;var o=t[e+3];return!o||"\n"===o||"\t"===o||" "===o}},{key:"endOfIdentifier",value:function(t,e){for(var n=t[e],r="<"===n,i=r?["\n","\t"," ",">"]:["\n","\t"," ","[","]","{","}",","];n&&-1===i.indexOf(n);)n=t[e+=1];return r&&">"===n&&(e+=1),e}},{key:"endOfIndent",value:function(t,e){for(var n=t[e];" "===n;)n=t[e+=1];return e}},{key:"endOfLine",value:function(t,e){for(var n=t[e];n&&"\n"!==n;)n=t[e+=1];return e}},{key:"endOfWhiteSpace",value:function(t,e){for(var n=t[e];"\t"===n||" "===n;)n=t[e+=1];return e}},{key:"startOfLine",value:function(t,e){var n=t[e-1];if("\n"===n)return e;for(;n&&"\n"!==n;)n=t[e-=1];return e+1}},{key:"endOfBlockIndent",value:function(e,n,r){var i=t.endOfIndent(e,r);if(i>r+n)return i;var s=t.endOfWhiteSpace(e,i),a=e[s];return a&&"\n"!==a?null:s}},{key:"atBlank",value:function(t,e,n){var r=t[e];return"\n"===r||"\t"===r||" "===r||n&&!r}},{key:"nextNodeIsIndented",value:function(t,e,n){return!(!t||e<0)&&(e>0||n&&"-"===t)}},{key:"normalizeOffset",value:function(e,n){var r=e[n];return r?"\n"!==r&&"\n"===e[n-1]?n-1:t.endOfWhiteSpace(e,n):n}},{key:"foldNewline",value:function(e,n,r){for(var i=0,s=!1,a="",o=e[n+1];" "===o||"\t"===o||"\n"===o;){switch(o){case"\n":i=0,n+=1,a+="\n";break;case"\t":i<=r&&(s=!0),n=t.endOfWhiteSpace(e,n+2)-1;break;case" ":i+=1,n+=1}o=e[n+1]}return a||(a=" "),o&&i<=r&&(s=!0),{fold:a,offset:n,error:s}}}]),u()(t,[{key:"getPropValue",value:function(t,e,n){if(!this.context)return null;var r=this.context.src,i=this.props[t];return i&&r[i.start]===e?r.slice(i.start+(n?1:0),i.end):null}},{key:"commentHasRequiredWhitespace",value:function(e){var n=this.context.src;if(this.header&&e===this.header.end)return!1;if(!this.valueRange)return!1;var r=this.valueRange.end;return e!==r||t.atBlank(n,r-1)}},{key:"parseComment",value:function(e){var n=this.context.src;if(n[e]===c.a.COMMENT){var r=t.endOfLine(n,e+1),i=new f.a(e,r);return this.props.push(i),r}return e}},{key:"setOrigRanges",value:function(t,e){return this.range&&(e=this.range.setOrigRange(t,e)),this.valueRange&&this.valueRange.setOrigRange(t,e),this.props.forEach((function(n){return n.setOrigRange(t,e)})),e}},{key:"toString",value:function(){var e=this.context.src,n=this.range,r=this.value;if(null!=r)return r;var i=e.slice(n.start,n.end);return t.addStringTerminator(e,n.end,i)}},{key:"anchor",get:function(){for(var t=0;t<this.props.length;++t){var e=this.getPropValue(t,c.a.ANCHOR,!0);if(null!=e)return e}return null}},{key:"comment",get:function(){for(var t=[],e=0;e<this.props.length;++e){var n=this.getPropValue(e,c.a.COMMENT,!0);null!=n&&t.push(n)}return t.length>0?t.join("\n"):null}},{key:"hasComment",get:function(){if(this.context)for(var t=this.context.src,e=0;e<this.props.length;++e)if(t[this.props[e].start]===c.a.COMMENT)return!0;return!1}},{key:"hasProps",get:function(){if(this.context)for(var t=this.context.src,e=0;e<this.props.length;++e)if(t[this.props[e].start]!==c.a.COMMENT)return!0;return!1}},{key:"includesTrailingLines",get:function(){return!1}},{key:"jsonLike",get:function(){return-1!==[c.b.FLOW_MAP,c.b.FLOW_SEQ,c.b.QUOTE_DOUBLE,c.b.QUOTE_SINGLE].indexOf(this.type)}},{key:"rangeAsLinePos",get:function(){if(this.range&&this.context){var t=Object(l.a)(this.range.start,this.context.root);if(t)return{start:t,end:Object(l.a)(this.range.end,this.context.root)}}}},{key:"rawValue",get:function(){if(!this.valueRange||!this.context)return null;var t=this.valueRange,e=t.start,n=t.end;return this.context.src.slice(e,n)}},{key:"tag",get:function(){for(var t=0;t<this.props.length;++t){var e=this.getPropValue(t,c.a.TAG,!1);if(null!=e){if("<"===e[1])return{verbatim:e.slice(2,-1)};var n=e.match(/^(.*!)([^!]*)$/),r=i()(n,3);r[0];return{handle:r[1],suffix:r[2]}}}return null}},{key:"valueRangeContainsNewline",get:function(){if(!this.valueRange||!this.context)return!1;for(var t=this.valueRange,e=t.start,n=t.end,r=this.context.src,i=e;i<n;++i)if("\n"===r[i])return!0;return!1}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return m})),n.d(e,"b",(function(){return b})),n.d(e,"c",(function(){return w})),n.d(e,"d",(function(){return _})),n.d(e,"e",(function(){return S}));var r=n(3),i=n.n(r),s=n(5),a=n.n(s),o=n(6),u=n.n(o),c=n(4),l=n.n(c),f=n(7),h=n.n(f),p=n(26),d=n.n(p),v=n(1),g=n(18),y=n(8),m=function(t){function e(t,n,r){var s;if(i()(this,e),!(r&&n instanceof v.a))throw new Error("Invalid arguments for new ".concat(t));return(s=u()(this,l()(e).call(this))).name=t,s.message=r,s.source=n,s}return h()(e,t),a()(e,[{key:"makePretty",value:function(){if(this.source){this.nodeType=this.source.type;var t=this.source.context&&this.source.context.root;if("number"==typeof this.offset){this.range=new y.a(this.offset,this.offset+1);var e=t&&Object(g.a)(this.offset,t);if(e){var n={line:e.line,col:e.col+1};this.linePos={start:e,end:n}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){var r=this.linePos.start,i=r.line,s=r.col;this.message+=" at line ".concat(i,", column ").concat(s);var a=t&&Object(g.b)(this.linePos,t);a&&(this.message+=":\n\n".concat(a,"\n"))}delete this.source}}}]),e}(d()(Error)),b=function(t){function e(t,n){return i()(this,e),u()(this,l()(e).call(this,"YAMLReferenceError",t,n))}return h()(e,t),e}(m),w=function(t){function e(t,n){return i()(this,e),u()(this,l()(e).call(this,"YAMLSemanticError",t,n))}return h()(e,t),e}(m),_=function(t){function e(t,n){return i()(this,e),u()(this,l()(e).call(this,"YAMLSyntaxError",t,n))}return h()(e,t),e}(m),S=function(t){function e(t,n){return i()(this,e),u()(this,l()(e).call(this,"YAMLWarning",t,n))}return h()(e,t),e}(m)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){var r=n(12),i=n(14);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},function(t,e,n){var r=n(22);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n.n(r),s=n(5),a=n.n(s),o=function(){function t(e,n){i()(this,t),this.start=e,this.end=n||e}return a()(t,null,[{key:"copy",value:function(e){return new t(e.start,e.end)}}]),a()(t,[{key:"isEmpty",value:function(){return"number"!=typeof this.start||!this.end||this.end<=this.start}},{key:"setOrigRange",value:function(t,e){var n=this.start,r=this.end;if(0===t.length||r<=t[0])return this.origStart=n,this.origEnd=r,e;for(var i=e;i<t.length&&!(t[i]>n);)++i;this.origStart=n+i;for(var s=i;i<t.length&&!(t[i]>=r);)++i;return this.origEnd=r+i,s}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return o}));var r=n(0),i={defaultType:r.b.BLOCK_LITERAL,lineWidth:76},s={trueStr:"true",falseStr:"false"},a={nullStr:"null"},o={defaultType:r.b.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){var r=n(28);function i(e,n,s){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,n){var i=r(t,e);if(i){var s=Object.getOwnPropertyDescriptor(i,e);return s.get?s.get.call(n):s.value}},i(e,n,s||e)}t.exports=i},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return p}));var r=n(15),i=n(0),s=function(t,e){for(var n=t[e+1];" "===n||"\t"===n;){do{n=t[e+=1]}while(n&&"\n"!==n);n=t[e+1]}return e};function a(t,e,n,r){var i=r.indentAtStart,a=r.lineWidth,o=void 0===a?80:a,u=r.minContentWidth,c=void 0===u?20:u,l=r.onFold,f=r.onOverflow;if(!o||o<0)return t;var h=Math.max(1+c,1+o-e.length);if(t.length<=h)return t;var p,d=[],v={},g=o-("number"==typeof i?i:e.length),y=void 0,m=void 0,b=!1,w=-1;for("block"===n&&-1!==(w=s(t,w))&&(g=w+h);p=t[w+=1];){if("quoted"===n&&"\\"===p)switch(t[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}if("\n"===p)"block"===n&&(w=s(t,w)),g=w+h,y=void 0;else{if(" "===p&&m&&" "!==m&&"\n"!==m&&"\t"!==m){var _=t[w+1];_&&" "!==_&&"\n"!==_&&"\t"!==_&&(y=w)}if(w>=g)if(y)d.push(y),g=y+h,y=void 0;else if("quoted"===n){for(;" "===m||"\t"===m;)m=p,p=t[w+=1],b=!0;d.push(w-2),v[w-2]=!0,g=w-2+h,y=void 0}else b=!0}m=p}if(b&&f&&f(),0===d.length)return t;l&&l();for(var S=t.slice(0,d[0]),E=0;E<d.length;++E){var k=d[E],O=d[E+1]||t.length;"quoted"===n&&v[k]&&(S+="".concat(t[k],"\\")),S+="\n".concat(e).concat(t.slice(k+1,O))}return S}var o=n(9),u=function(t){var e=t.indentAtStart;return e?Object.assign({indentAtStart:e},o.d.fold):o.d.fold};function c(t){var e=t.format,n=t.minFractionDigits,r=t.tag,i=t.value;if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";var s=JSON.stringify(i);if(!e&&n&&(!r||"tag:yaml.org,2002:float"===r)&&/^\d/.test(s)){var a=s.indexOf(".");a<0&&(a=s.length,s+=".");for(var o=n-(s.length-a-1);o-- >0;)s+="0"}return s}function l(t,e){var n=e.implicitKey,r=e.indent,i=o.d.doubleQuoted,s=i.jsonEncoding,c=i.minMultiLineLength,l=JSON.stringify(t);if(s)return l;for(var f="",h=0,p=0,d=l[p];d;d=l[++p])if(" "===d&&"\\"===l[p+1]&&"n"===l[p+2]&&(f+=l.slice(h,p)+"\\ ",h=p+=1,d="\\"),"\\"===d)switch(l[p+1]){case"u":f+=l.slice(h,p);var v=l.substr(p+2,4);switch(v){case"0000":f+="\\0";break;case"0007":f+="\\a";break;case"000b":f+="\\v";break;case"001b":f+="\\e";break;case"0085":f+="\\N";break;case"00a0":f+="\\_";break;case"2028":f+="\\L";break;case"2029":f+="\\P";break;default:"00"===v.substr(0,2)?f+="\\x"+v.substr(2):f+=l.substr(p,6)}h=(p+=5)+1;break;case"n":if(n||'"'===l[p+2]||l.length<c)p+=1;else{for(f+=l.slice(h,p)+"\n\n";"\\"===l[p+2]&&"n"===l[p+3]&&'"'!==l[p+4];)f+="\n",p+=2;f+=r," "===l[p+2]&&(f+="\\"),h=(p+=1)+1}break;default:p+=1}return f=h?f+l.slice(h):l,n?f:a(f,r,"quoted",u(e))}function f(t,e){var n=e.indent,r=e.implicitKey;if(r){if(/\n/.test(t))return l(t,e)}else if(/[ \t]\n|\n[ \t]/.test(t))return l(t,e);var i="'"+t.replace(/'/g,"''").replace(/\n+/g,"$&\n".concat(n))+"'";return r?i:a(i,n,"flow",u(e))}function h(t,e,n,r){var s=t.comment,u=t.type,c=t.value;if(/\n[\t ]+$/.test(c)||/^\s*$/.test(c))return l(c,e);var f=e.indent||(e.forceBlockIndent?" ":""),h=f?"2":"1",p=u!==i.b.BLOCK_FOLDED&&(u===i.b.BLOCK_LITERAL||!function(t,e){var n=t.length;if(n<=e)return!1;for(var r=0,i=0;r<n;++r)if("\n"===t[r]){if(r-i>e)return!0;if(n-(i=r+1)<=e)return!1}return!0}(c,o.d.fold.lineWidth-f.length)),d=p?"|":">";if(!c)return d+"\n";var v="",g="";if(c=c.replace(/[\n\t ]*$/,(function(t){var e=t.indexOf("\n");return-1===e?d+="-":c!==t&&e===t.length-1||(d+="+",r&&r()),g=t.replace(/\n$/,""),""})).replace(/^[\n ]*/,(function(t){-1!==t.indexOf(" ")&&(d+=h);var e=t.match(/ +$/);return e?(v=t.slice(0,-e[0].length),e[0]):(v=t,"")})),g&&(g=g.replace(/\n+(?!\n|$)/g,"$&".concat(f))),v&&(v=v.replace(/\n+/g,"$&".concat(f))),s&&(d+=" #"+s.replace(/ ?[\r\n]+/g," "),n&&n()),!c)return"".concat(d).concat(h,"\n").concat(f).concat(g);if(p)return c=c.replace(/\n+/g,"$&".concat(f)),"".concat(d,"\n").concat(f).concat(v).concat(c).concat(g);c=c.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,"$&".concat(f));var y=a("".concat(v).concat(c).concat(g),f,"block",o.d.fold);return"".concat(d,"\n").concat(f).concat(y)}function p(t,e,n,s){var c=o.d.defaultType,p=e.implicitKey,d=e.inFlow,v=t,g=v.type,y=v.value;"string"!=typeof y&&(y=String(y),t=Object.assign({},t,{value:y}));var m=function(o){switch(o){case i.b.BLOCK_FOLDED:case i.b.BLOCK_LITERAL:return h(t,e,n,s);case i.b.QUOTE_DOUBLE:return l(y,e);case i.b.QUOTE_SINGLE:return f(y,e);case i.b.PLAIN:return function(t,e,n,s){var o=t.comment,c=t.type,p=t.value,d=e.actualString,v=e.implicitKey,g=e.indent,y=e.inFlow,m=e.tags;if(v&&/[\n[\]{},]/.test(p)||y&&/[[\]{},]/.test(p))return l(p,e);if(!p||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(p))return v||y||-1===p.indexOf("\n")?-1!==p.indexOf('"')&&-1===p.indexOf("'")?f(p,e):l(p,e):h(t,e,n,s);if(!v&&!y&&c!==i.b.PLAIN&&-1!==p.indexOf("\n"))return h(t,e,n,s);var b=p.replace(/\n+/g,"$&\n".concat(g));if(d&&"string"!=typeof m.resolveScalar(b).value)return l(p,e);var w=v?b:a(b,g,"flow",u(e));return!o||y||-1===w.indexOf("\n")&&-1===o.indexOf("\n")?w:(n&&n(),Object(r.a)(w,g,o))}(t,e,n,s);default:return null}};g!==i.b.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(y)?g=i.b.QUOTE_DOUBLE:!p&&!d||g!==i.b.BLOCK_FOLDED&&g!==i.b.BLOCK_LITERAL||(g=i.b.QUOTE_DOUBLE);var b=m(g);if(null===b&&null===(b=m(c)))throw new Error("Unsupported default string type ".concat(c));return b}},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){"use strict";function r(t,e,n){if(!n)return t;var r=n.replace(/[\s\S]^/gm,"$&".concat(e,"#"));return"#".concat(r,"\n").concat(e).concat(t)}function i(t,e,n){return n?-1===n.indexOf("\n")?"".concat(t," #").concat(n):"".concat(t,"\n")+n.replace(/^/gm,"".concat(e||"","#")):t}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}))},function(t,e,n){var r=n(23),i=n(31),s=n(24);t.exports=function(t,e){return r(t)||i(t,e)||s()}},function(t,e,n){"use strict";n.d(e,"b",(function(){return s}));var r=n(13),i=n(9),s=function(t,e){var n=e.strValue;return n?"string"==typeof n?n:(n.errors.forEach((function(n){n.source||(n.source=e),t.errors.push(n)})),n.str):""};e.a={identify:function(t){return"string"==typeof t},default:!0,tag:"tag:yaml.org,2002:str",resolve:s,stringify:function(t,e,n,i){return e=Object.assign({actualString:!0},e),Object(r.b)(t,e,n,i)},options:i.d}},function(t,e,n){"use strict";function r(t){for(var e=[0],n=t.indexOf("\n");-1!==n;)n+=1,e.push(n),n=t.indexOf("\n",n);return e}function i(t){var e,n;return"string"==typeof t?(e=r(t),n=t):(Array.isArray(t)&&(t=t[0]),t&&t.context&&(t.lineStarts||(t.lineStarts=r(t.context.src)),e=t.lineStarts,n=t.context.src)),{lineStarts:e,src:n}}function s(t,e){if("number"!=typeof t||t<0)return null;var n=i(e),r=n.lineStarts,s=n.src;if(!r||!s||t>s.length)return null;for(var a=0;a<r.length;++a){var o=r[a];if(t<o)return{line:a,col:t-r[a-1]+1};if(t===o)return{line:a+1,col:1}}var u=r.length;return{line:u,col:t-r[u-1]+1}}function a(t,e){var n=i(e),r=n.lineStarts,s=n.src;if(!r||!(t>=1)||t>r.length)return null;for(var a=r[t-1],o=r[t];o&&o>a&&"\n"===s[o-1];)--o;return s.slice(a,o)}function o(t,e){var n=t.start,r=t.end,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:80,s=a(n.line,e);if(!s)return null;var o=n.col;if(s.length>i)if(o<=i-10)s=s.substr(0,i-1)+"…";else{var u=Math.round(i/2);s.length>o+u&&(s=s.substr(0,o+u-1)+"…"),o-=s.length-i,s="…"+s.substr(1-i)}var c=1,l="";r&&(r.line===n.line&&o+(r.col-n.col)<=i+1?c=r.col-n.col:(c=Math.min(s.length+1,i)-o,l="…"));var f=o>1?" ".repeat(o-1):"",h="^".repeat(c);return"".concat(s,"\n").concat(f).concat(h).concat(l)}n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return o}))},function(t,e,n){var r=n(23),i=n(32),s=n(24);t.exports=function(t){return r(t)||i(t)||s()}},function(t,e,n){"use strict";(function(t){function r(e,n){if(!t||!t._YAML_SILENCE_WARNINGS){var r=(t&&t.process).emitWarning;r?r(e,n):console.warn(n?"".concat(n,": ").concat(e):e)}}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return s}));var i={};function s(e,n){if(!(t&&t._YAML_SILENCE_DEPRECATION_WARNINGS||i[e])){i[e]=!0;var s="The option '".concat(e,"' will be removed in a future release");r(s+=n?", use '".concat(n,"' instead."):".","DeprecationWarning")}}}).call(this,n(25))},function(t,e,n){"use strict";(function(t){var r=n(0),i=n(2),s=n(13),a=n(17),o=n(9);e.a={identify:function(t){return t instanceof Uint8Array},default:!1,tag:"tag:yaml.org,2002:binary",resolve:function(e,n){if("function"==typeof t){var r=Object(a.b)(e,n);return t.from(r,"base64")}if("function"==typeof atob){for(var s=atob(Object(a.b)(e,n)),o=new Uint8Array(s.length),u=0;u<s.length;++u)o[u]=s.charCodeAt(u);return o}return e.errors.push(new i.b(n,"This environment does not support reading binary tags; either Buffer or atob is required")),null},options:o.a,stringify:function(e,n,i,a){var u,c=e.comment,l=e.type,f=e.value;if("function"==typeof t)u=f instanceof t?f.toString("base64"):t.from(f.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");for(var h="",p=0;p<f.length;++p)h+=String.fromCharCode(f[p]);u=btoa(h)}if(l||(l=o.a.defaultType),l===r.b.QUOTE_DOUBLE)f=u;else{for(var d=o.a.lineWidth,v=Math.ceil(u.length/d),g=new Array(v),y=0,m=0;y<v;++y,m+=d)g[y]=u.substr(m,d);f=g.join(l===r.b.BLOCK_LITERAL?"\n":" ")}return Object(s.b)({comment:c,type:l,value:f},n,i,a)}}}).call(this,n(33).Buffer)},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(4),i=n(22),s=n(29),a=n(30);function o(e){var n="function"==typeof Map?new Map:void 0;return t.exports=o=function(t){if(null===t||!s(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return a(t,arguments,r(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},o(e)}t.exports=o},function(t,e,n){t.exports=n(37).default},function(t,e,n){var r=n(4);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}},function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}},function(t,e,n){var r=n(22);function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function s(e,n,a){return i()?t.exports=s=Reflect.construct:t.exports=s=function(t,e,n){var i=[null];i.push.apply(i,e);var s=new(Function.bind.apply(t,i));return n&&r(s,n.prototype),s},s.apply(null,arguments)}t.exports=s},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,i=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(r=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,s=t}finally{try{r||null==o.return||o.return()}finally{if(i)throw s}}return n}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e,n){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var r=n(34),i=n(35),s=n(36);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=o(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|p(e.length);return 0===(t=o(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?o(t,0):h(t,e);if("Buffer"===e.type&&s(e.data))return h(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(l(e),t=o(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e){var n=e.length<0?0:0|p(e.length);t=o(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(r)return F(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return x(this,e,n);case"latin1":case"binary":return N(this,e,n);case"base64":return O(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:m(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):m(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,n,r,i){var s,a=1,o=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,o/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(s=n;s<o;s++)if(c(t,s)===c(e,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===u)return l*a}else-1!==l&&(s-=s-l),l=-1}else for(n+u>o&&(n=o-u),s=n;s>=0;s--){for(var f=!0,h=0;h<u;h++)if(c(t,s+h)!==c(e,h)){f=!1;break}if(f)return s}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var a=0;a<r;++a){var o=parseInt(e.substr(2*a,2),16);if(isNaN(o))return a;t[n+a]=o}return a}function w(t,e,n,r){return Y(F(e,t.length-n),t,n,r)}function _(t,e,n,r){return Y(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function S(t,e,n,r){return _(t,e,n,r)}function E(t,e,n,r){return Y(V(e),t,n,r)}function k(t,e,n,r){return Y(function(t,e){for(var n,r,i,s=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(e,t.length-n),t,n,r)}function O(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function A(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var s,a,o,u,c=t[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(s=t[i+1]))&&(u=(31&c)<<6|63&s)>127&&(l=u);break;case 3:s=t[i+1],a=t[i+2],128==(192&s)&&128==(192&a)&&(u=(15&c)<<12|(63&s)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=t[i+1],a=t[i+2],o=t[i+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(u=(15&c)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?o(t,e):void 0!==n?"string"==typeof r?o(t,e).fill(n,r):o(t,e).fill(n):o(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return f(null,t)},u.allocUnsafeSlow=function(t){return f(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,s=Math.min(n,r);i<s;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!s(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var a=t[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):v.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),o=Math.min(s,a),c=this.slice(r,i),l=t.slice(e,n),f=0;f<o;++f)if(c[f]!==l[f]){s=c[f],a=l[f];break}return s<a?-1:a<s?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function N(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function T(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",s=e;s<n;++s)i+=D(t[s]);return i}function C(t,e,n){for(var r=t.slice(e,n),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+256*r[s+1]);return i}function P(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,r,i,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function R(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-n,2);i<s;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function M(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-n,4);i<s;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function I(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(t,e,n,r,s){return s||I(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,s){return s||I(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var s=0;s<i;++s)n[s]=this[s+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=e,i=1,s=this[t+--r];r>0&&(i*=256);)s+=this[t+--r]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,s=0;for(this[e]=255&t;++s<n&&(i*=256);)this[e+s]=t/i&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);L(this,t,e,n,i-1,-i)}var s=0,a=1,o=0;for(this[e]=255&t;++s<n&&(a*=256);)t<0&&0===o&&0!==this[e+s-1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);L(this,t,e,n,i-1,-i)}var s=n-1,a=1,o=0;for(this[e+s]=255&t;--s>=0&&(a*=256);)t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return B(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return B(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,s=r-n;if(this===t&&n<e&&e<r)for(i=s-1;i>=0;--i)t[i+e]=this[i+n];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var s;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var a=u.isBuffer(t)?t:F(new u(t,r).toString()),o=a.length;for(s=0;s<n-e;++s)this[s+e]=a[s%o]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var n;e=e||1/0;for(var r=t.length,i=null,s=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function V(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(25))},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),a=r[0],o=r[1],u=new s(function(t,e,n){return 3*(e+n)/4-n}(0,a,o)),l=0,f=o>0?a-4:a;for(n=0;n<f;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===o&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===o&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,s=[],a=0,o=n-i;a<o;a+=16383)s.push(l(t,a,a+16383>o?o:a+16383));1===i?(e=t[n-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return s.join("")};for(var r=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,u=a.length;o<u;++o)r[o]=a[o],i[a.charCodeAt(o)]=o;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,s,a=[],o=e;o<n;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),a.push(r[(s=i)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var s,a,o=8*i-r-1,u=(1<<o)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,p=t[e+f];for(f+=h,s=p&(1<<-l)-1,p>>=-l,l+=o;l>0;s=256*s+t[e+f],f+=h,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+t[e+f],f+=h,l-=8);if(0===s)s=1-c;else{if(s===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),s-=c}return(p?-1:1)*a*Math.pow(2,s-r)},e.write=function(t,e,n,r,i,s){var a,o,u,c=8*s-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,d=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(o=0,a=l):a+f>=1?(o=(e*u-1)*Math.pow(2,i),a+=f):(o=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&o,p+=d,o/=256,i-=8);for(a=a<<i|o,c+=i;c>0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*v}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),s=n(6),a=n.n(s),o=n(4),u=n.n(o),c=n(7),l=n.n(c),f=n(11),h=n.n(f),p=n(5),d=n.n(p),v=n(0),g=n(2),y=n(1),m=n(8),b=function(t){function e(){return i()(this,e),a()(this,u()(e).call(this,v.b.BLANK_LINE))}return l()(e,t),d()(e,[{key:"parse",value:function(t,e){this.context=t;for(var n=t.src,r=e+1;y.a.atBlank(n,r);){var i=y.a.endOfWhiteSpace(n,r);if("\n"!==i)break;r=i+1}return this.range=new m.a(e,r),r}},{key:"includesTrailingLines",get:function(){return!0}}]),e}(y.a),w=function(t){function e(t,n){var r;return i()(this,e),(r=a()(this,u()(e).call(this,t,n))).node=null,r}return l()(e,t),d()(e,[{key:"parse",value:function(t,e){this.context=t;var n=t.parseNode,r=t.src,i=t.atLineStart,s=t.lineStart;i||this.type!==v.b.SEQ_ITEM||(this.error=new g.c(this,"Sequence items must not have preceding content on the same line"));for(var a=i?e-s:t.indent,o=y.a.endOfWhiteSpace(r,e+1),u=r[o],c="#"===u,l=[],f=null;"\n"===u||"#"===u;){if("#"===u){var h=y.a.endOfLine(r,o+1);l.push(new m.a(o,h)),o=h}else{i=!0,s=o+1,"\n"===r[y.a.endOfWhiteSpace(r,s)]&&0===l.length&&(s=(f=new b).parse({src:r},s)),o=y.a.endOfIndent(r,s)}u=r[o]}if(y.a.nextNodeIsIndented(u,o-(s+a),this.type!==v.b.SEQ_ITEM)?this.node=n({atLineStart:i,inCollection:!1,indent:a,lineStart:s,parent:this},o):u&&s>e+1&&(o=s-1),this.node){if(f){var p=t.parent.items||t.parent.contents;p&&p.push(f)}l.length&&Array.prototype.push.apply(this.props,l),o=this.node.range.end}else if(c){var d=l[0];this.props.push(d),o=d.end}else o=y.a.endOfLine(r,e+1);var w=this.node?this.node.valueRange.end:o;return this.valueRange=new m.a(e,w),o}},{key:"setOrigRanges",value:function(t,n){return n=h()(u()(e.prototype),"setOrigRanges",this).call(this,t,n),this.node?this.node.setOrigRanges(t,n):n}},{key:"toString",value:function(){var t=this.context.src,e=this.node,n=this.range,r=this.value;if(null!=r)return r;var i=e?t.slice(n.start,e.range.start)+String(e):t.slice(n.start,n.end);return y.a.addStringTerminator(t,n.end,i)}},{key:"includesTrailingLines",get:function(){return!!this.node&&this.node.includesTrailingLines}}]),e}(y.a),_=function(t){function e(){return i()(this,e),a()(this,u()(e).call(this,v.b.COMMENT))}return l()(e,t),d()(e,[{key:"parse",value:function(t,e){this.context=t;var n=this.parseComment(e);return this.range=new m.a(e,n),n}}]),e}(y.a);function S(t){for(var e=t;e instanceof w;)e=e.node;if(!(e instanceof E))return null;for(var n=e.items.length,r=-1,i=n-1;i>=0;--i){var s=e.items[i];if(s.type===v.b.COMMENT){var a=s.context,o=a.indent,u=a.lineStart;if(o>0&&s.range.start>=u+o)break;r=i}else{if(s.type!==v.b.BLANK_LINE)break;r=i}}if(-1===r)return null;for(var c=e.items.splice(r,n-r),l=c[0].range.start;e.range.end=l,e.valueRange&&e.valueRange.end>l&&(e.valueRange.end=l),e!==t;)e=e.context.parent;return c}var E=function(t){function e(t){var n;i()(this,e),n=a()(this,u()(e).call(this,t.type===v.b.SEQ_ITEM?v.b.SEQ:v.b.MAP));for(var r=t.props.length-1;r>=0;--r)if(t.props[r].start<t.context.lineStart){n.props=t.props.slice(0,r+1),t.props=t.props.slice(r+1);var s=t.props[0]||t.valueRange;t.range.start=s.start;break}n.items=[t];var o=S(t);return o&&Array.prototype.push.apply(n.items,o),n}return l()(e,t),d()(e,null,[{key:"nextContentHasIndent",value:function(t,n,r){var i=y.a.endOfLine(t,n)+1,s=t[n=y.a.endOfWhiteSpace(t,i)];return!!s&&(n>=i+r||("#"===s||"\n"===s)&&e.nextContentHasIndent(t,n,r))}}]),d()(e,[{key:"parse",value:function(t,n){this.context=t;var r=t.parseNode,i=t.src,s=y.a.startOfLine(i,n),a=this.items[0];a.context.parent=this,this.valueRange=m.a.copy(a.valueRange);for(var o=a.range.start-a.context.lineStart,u=n,c=i[u=y.a.normalizeOffset(i,u)],l=y.a.endOfWhiteSpace(i,s)===u,f=!1;c;){for(;"\n"===c||"#"===c;){if(l&&"\n"===c&&!f){var h=new b;if(u=h.parse({src:i},u),this.valueRange.end=u,u>=i.length){c=null;break}this.items.push(h),u-=1}else if("#"===c){if(u<s+o&&!e.nextContentHasIndent(i,u,o))return u;var p=new _;if(u=p.parse({indent:o,lineStart:s,src:i},u),this.items.push(p),this.valueRange.end=u,u>=i.length){c=null;break}}if(s=u+1,u=y.a.endOfIndent(i,s),y.a.atBlank(i,u)){var d=y.a.endOfWhiteSpace(i,u),g=i[d];g&&"\n"!==g&&"#"!==g||(u=d)}c=i[u],l=!0}if(!c)break;if(u!==s+o&&(l||":"!==c)){s>n&&(u=s);break}if(a.type===v.b.SEQ_ITEM!=("-"===c)){var w=!0;if("-"===c){var E=i[u+1];w=!E||"\n"===E||"\t"===E||" "===E}if(w){s>n&&(u=s);break}}var k=r({atLineStart:l,inCollection:!0,indent:o,lineStart:s,parent:this},u);if(!k)return u;if(this.items.push(k),this.valueRange.end=k.valueRange.end,c=i[u=y.a.normalizeOffset(i,k.range.end)],l=!1,f=k.includesTrailingLines,c){for(var O=u-1,A=i[O];" "===A||"\t"===A;)A=i[--O];"\n"===A&&(s=O+1,l=!0)}var x=S(k);x&&Array.prototype.push.apply(this.items,x)}return u}},{key:"setOrigRanges",value:function(t,n){return n=h()(u()(e.prototype),"setOrigRanges",this).call(this,t,n),this.items.forEach((function(e){n=e.setOrigRanges(t,n)})),n}},{key:"toString",value:function(){var t=this.context.src,e=this.items,n=this.range,r=this.value;if(null!=r)return r;for(var i=t.slice(n.start,e[0].range.start)+String(e[0]),s=1;s<e.length;++s){var a=e[s],o=a.context,u=o.atLineStart,c=o.indent;if(u)for(var l=0;l<c;++l)i+=" ";i+=String(a)}return y.a.addStringTerminator(t,n.end,i)}},{key:"includesTrailingLines",get:function(){return this.items.length>0}}]),e}(y.a),k=function(t){function e(){var t;return i()(this,e),(t=a()(this,u()(e).call(this,v.b.DIRECTIVE))).name=null,t}return l()(e,t),d()(e,[{key:"parseName",value:function(t){for(var e=this.context.src,n=t,r=e[n];r&&"\n"!==r&&"\t"!==r&&" "!==r;)r=e[n+=1];return this.name=e.slice(t,n),n}},{key:"parseParameters",value:function(t){for(var e=this.context.src,n=t,r=e[n];r&&"\n"!==r&&"#"!==r;)r=e[n+=1];return this.valueRange=new m.a(t,n),n}},{key:"parse",value:function(t,e){this.context=t;var n=this.parseName(e+1);return n=this.parseParameters(n),n=this.parseComment(n),this.range=new m.a(e,n),n}},{key:"parameters",get:function(){var t=this.rawValue;return t?t.trim().split(/[ \t]+/):[]}}]),e}(y.a),O=function(t){function e(){var t;return i()(this,e),(t=a()(this,u()(e).call(this,v.b.DOCUMENT))).directives=null,t.contents=null,t.directivesEndMarker=null,t.documentEndMarker=null,t}return l()(e,t),d()(e,null,[{key:"startCommentOrEndBlankLine",value:function(t,e){var n=y.a.endOfWhiteSpace(t,e),r=t[n];return"#"===r||"\n"===r?n:e}}]),d()(e,[{key:"parseDirectives",value:function(t){var n=this.context.src;this.directives=[];for(var r=!0,i=!1,s=t;!y.a.atDocumentBoundary(n,s,v.a.DIRECTIVES_END);)switch(n[s=e.startCommentOrEndBlankLine(n,s)]){case"\n":if(r){var a=new b;(s=a.parse({src:n},s))<n.length&&this.directives.push(a)}else s+=1,r=!0;break;case"#":var o=new _;s=o.parse({src:n},s),this.directives.push(o),r=!1;break;case"%":var u=new k;s=u.parse({parent:this,src:n},s),this.directives.push(u),i=!0,r=!1;break;default:return i?this.error=new g.c(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),s}return n[s]?(this.directivesEndMarker=new m.a(s,s+3),s+3):(i?this.error=new g.c(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),s)}},{key:"parseContents",value:function(t){var n=this.context,r=n.parseNode,i=n.src;this.contents||(this.contents=[]);for(var s=t;"-"===i[s-1];)s-=1;var a=y.a.endOfWhiteSpace(i,t),o=s===t;for(this.valueRange=new m.a(a);!y.a.atDocumentBoundary(i,a,v.a.DOCUMENT_END);){switch(i[a]){case"\n":if(o){var u=new b;(a=u.parse({src:i},a))<i.length&&this.contents.push(u)}else a+=1,o=!0;s=a;break;case"#":var c=new _;a=c.parse({src:i},a),this.contents.push(c),o=!1;break;default:var l=y.a.endOfIndent(i,a),f=r({atLineStart:o,indent:-1,inFlow:!1,inCollection:!1,lineStart:s,parent:this},l);if(!f)return this.valueRange.end=l;this.contents.push(f),a=f.range.end,o=!1;var h=S(f);h&&Array.prototype.push.apply(this.contents,h)}a=e.startCommentOrEndBlankLine(i,a)}if(this.valueRange.end=a,i[a]&&(this.documentEndMarker=new m.a(a,a+3),i[a+=3])){if("#"===i[a=y.a.endOfWhiteSpace(i,a)]){var p=new _;a=p.parse({src:i},a),this.contents.push(p)}switch(i[a]){case"\n":a+=1;break;case void 0:break;default:this.error=new g.d(this,"Document end marker line cannot have a non-comment suffix")}}return a}},{key:"parse",value:function(t,e){t.root=this,this.context=t;var n=65279===t.src.charCodeAt(e)?e+1:e;return n=this.parseDirectives(n),n=this.parseContents(n)}},{key:"setOrigRanges",value:function(t,n){return n=h()(u()(e.prototype),"setOrigRanges",this).call(this,t,n),this.directives.forEach((function(e){n=e.setOrigRanges(t,n)})),this.directivesEndMarker&&(n=this.directivesEndMarker.setOrigRange(t,n)),this.contents.forEach((function(e){n=e.setOrigRanges(t,n)})),this.documentEndMarker&&(n=this.documentEndMarker.setOrigRange(t,n)),n}},{key:"toString",value:function(){var t=this.contents,e=this.directives,n=this.value;if(null!=n)return n;var r=e.join("");return t.length>0&&((e.length>0||t[0].type===v.b.COMMENT)&&(r+="---\n"),r+=t.join("")),"\n"!==r[r.length-1]&&(r+="\n"),r}}]),e}(y.a),A=n(10),x=n.n(A),N=function(t){function e(){return i()(this,e),a()(this,u()(e).apply(this,arguments))}return l()(e,t),d()(e,[{key:"parse",value:function(t,e){this.context=t;var n=t.src,r=y.a.endOfIdentifier(n,e+1);return this.valueRange=new m.a(e+1,r),r=y.a.endOfWhiteSpace(n,r),r=this.parseComment(r)}}]),e}(y.a),T="CLIP",C="KEEP",P="STRIP",L=function(t){function e(t,n){var r;return i()(this,e),(r=a()(this,u()(e).call(this,t,n))).blockIndent=null,r.chomping=T,r.header=null,r}return l()(e,t),d()(e,[{key:"parseBlockHeader",value:function(t){for(var e=this.context.src,n=t+1,r="";;){var i=e[n];switch(i){case"-":this.chomping=P;break;case"+":this.chomping=C;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r+=i;break;default:return this.blockIndent=Number(r)||null,this.header=new m.a(t,n),n}n+=1}}},{key:"parseBlockValue",value:function(t){for(var e=this.context,n=e.indent,r=e.src,i=t,s=t,a=this.blockIndent?n+this.blockIndent-1:n,o=1,u=r[i];"\n"===u&&(i+=1,!y.a.atDocumentBoundary(r,i));u=r[i]){var c=y.a.endOfBlockIndent(r,a,i);if(null===c)break;if(!this.blockIndent){var l=c-(i+n);if("\n"!==r[c]){if(l<o){i-=1;break}this.blockIndent=l,a=n+this.blockIndent-1}else l>o&&(o=l)}i="\n"===r[c]?c:s=y.a.endOfLine(r,c)}return this.chomping!==C&&(i=r[s]?s+1:s),this.valueRange=new m.a(t+1,i),i}},{key:"parse",value:function(t,e){this.context=t;var n=t.src,r=this.parseBlockHeader(e);return r=y.a.endOfWhiteSpace(n,r),r=this.parseComment(r),r=this.parseBlockValue(r)}},{key:"setOrigRanges",value:function(t,n){return n=h()(u()(e.prototype),"setOrigRanges",this).call(this,t,n),this.header?this.header.setOrigRange(t,n):n}},{key:"includesTrailingLines",get:function(){return this.chomping===C}},{key:"strValue",get:function(){if(!this.valueRange||!this.context)return null;var t=this.valueRange,e=t.start,n=t.end,r=this.context,i=r.indent,s=r.src;if(this.valueRange.isEmpty())return"";for(var a=null,o=s[n-1];"\n"===o||"\t"===o||" "===o;){if((n-=1)<=e){if(this.chomping===C)break;return""}"\n"===o&&(a=n),o=s[n-1]}var u=n+1;a&&(this.chomping===C?(u=a,n=this.valueRange.end):n=a);for(var c=i+this.blockIndent,l=this.type===v.b.BLOCK_FOLDED,f=!0,h="",p="",d=!1,g=e;g<n;++g){for(var m=0;m<c&&" "===s[g];++m)g+=1;var b=s[g];if("\n"===b)"\n"===p?h+="\n":p="\n";else{var w=y.a.endOfLine(s,g),_=s.slice(g,w);g=w,l&&(" "===b||"\t"===b)&&g<u?(" "===p?p="\n":d||f||"\n"!==p||(p="\n\n"),h+=p+_,p=w<n&&s[w]||"",d=!0):(h+=p+_,p=l&&g<u?" ":"\n",d=!1),f&&""!==_&&(f=!1)}}return this.chomping===P?h:h+"\n"}}]),e}(y.a),R=function(t){function e(t,n){var r;return i()(this,e),(r=a()(this,u()(e).call(this,t,n))).items=null,r}return l()(e,t),d()(e,[{key:"prevNodeIsJsonLike",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,e=this.items[t-1];return!!e&&(e.jsonLike||e.type===v.b.COMMENT&&this.nodeIsJsonLike(t-1))}},{key:"parse",value:function(t,e){this.context=t;var n=t.parseNode,r=t.src,i=t.indent,s=t.lineStart,a=r[e];this.items=[{char:a,offset:e}];var o=y.a.endOfWhiteSpace(r,e+1);for(a=r[o];a&&"]"!==a&&"}"!==a;){switch(a){case"\n":if(s=o+1,"\n"===r[y.a.endOfWhiteSpace(r,s)]){var u=new b;s=u.parse({src:r},s),this.items.push(u)}if((o=y.a.endOfIndent(r,s))<=s+i&&(a=r[o],o<s+i||"]"!==a&&"}"!==a)){this.error=new g.c(this,"Insufficient indentation in flow collection")}break;case",":this.items.push({char:a,offset:o}),o+=1;break;case"#":var c=new _;o=c.parse({src:r},o),this.items.push(c);break;case"?":case":":var l=r[o+1];if("\n"===l||"\t"===l||" "===l||","===l||":"===a&&this.prevNodeIsJsonLike()){this.items.push({char:a,offset:o}),o+=1;break}default:var f=n({atLineStart:!1,inCollection:!1,inFlow:!0,indent:-1,lineStart:s,parent:this},o);if(!f)return this.valueRange=new m.a(e,o),o;this.items.push(f),o=y.a.normalizeOffset(r,f.range.end)}a=r[o=y.a.endOfWhiteSpace(r,o)]}return this.valueRange=new m.a(e,o+1),a&&(this.items.push({char:a,offset:o}),o=y.a.endOfWhiteSpace(r,o+1),o=this.parseComment(o)),o}},{key:"setOrigRanges",value:function(t,n){return n=h()(u()(e.prototype),"setOrigRanges",this).call(this,t,n),this.items.forEach((function(e){if(e instanceof y.a)n=e.setOrigRanges(t,n);else if(0===t.length)e.origOffset=e.offset;else{for(var r=n;r<t.length&&!(t[r]>e.offset);)++r;e.origOffset=e.offset+r,n=r}})),n}},{key:"toString",value:function(){var t=this.context.src,e=this.items,n=this.range,r=this.value;if(null!=r)return r;var i=e.filter((function(t){return t instanceof y.a})),s="",a=n.start;return i.forEach((function(e){var n=t.slice(a,e.range.start);a=e.range.end,"\n"===(s+=n+String(e))[s.length-1]&&"\n"!==t[a-1]&&"\n"===t[a]&&(a+=1)})),s+=t.slice(a,n.end),y.a.addStringTerminator(t,n.end,s)}}]),e}(y.a),M=function(t){function e(){return i()(this,e),a()(this,u()(e).apply(this,arguments))}return l()(e,t),d()(e,[{key:"parseBlockValue",value:function(t){for(var n=this.context,r=n.indent,i=n.inFlow,s=n.src,a=t,o=t,u=s[a];"\n"===u&&!y.a.atDocumentBoundary(s,a+1);u=s[a]){var c=y.a.endOfBlockIndent(s,r,a+1);if(null===c||"#"===s[c])break;a="\n"===s[c]?c:o=e.endOfLine(s,c,i)}return this.valueRange.isEmpty()&&(this.valueRange.start=t),this.valueRange.end=o,o}},{key:"parse",value:function(t,n){this.context=t;var r=t.inFlow,i=t.src,s=n,a=i[s];return a&&"#"!==a&&"\n"!==a&&(s=e.endOfLine(i,n,r)),this.valueRange=new m.a(n,s),s=y.a.endOfWhiteSpace(i,s),s=this.parseComment(s),this.hasComment&&!this.valueRange.isEmpty()||(s=this.parseBlockValue(s)),s}},{key:"strValue",get:function(){if(!this.valueRange||!this.context)return null;for(var t=this.valueRange,e=t.start,n=t.end,r=this.context.src,i=r[n-1];e<n&&("\n"===i||"\t"===i||" "===i);)i=r[--n-1];for(i=r[e];e<n&&("\n"===i||"\t"===i||" "===i);)i=r[++e];for(var s="",a=e;a<n;++a){var o=r[a];if("\n"===o){var u=y.a.foldNewline(r,a,-1);s+=u.fold,a=u.offset}else if(" "===o||"\t"===o){for(var c=a,l=r[a+1];a<n&&(" "===l||"\t"===l);)l=r[(a+=1)+1];"\n"!==l&&(s+=a>c?r.slice(c,a+1):o)}else s+=o}return s}}],[{key:"endOfLine",value:function(t,e,n){for(var r=t[e],i=e;r&&"\n"!==r&&(!n||"["!==r&&"]"!==r&&"{"!==r&&"}"!==r&&","!==r);){var s=t[i+1];if(":"===r&&(!s||"\n"===s||"\t"===s||" "===s||n&&","===s))break;if((" "===r||"\t"===r)&&"#"===s)break;i+=1,r=s}return i}}]),e}(y.a),I=function(t){function e(){return i()(this,e),a()(this,u()(e).apply(this,arguments))}return l()(e,t),d()(e,[{key:"parseCharCode",value:function(t,e,n){var r=this.context.src,i=r.substr(t,e),s=i.length===e&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;return isNaN(s)?(n.push(new g.d(this,"Invalid escape sequence ".concat(r.substr(t-2,e+2)))),r.substr(t-2,e+2)):String.fromCodePoint(s)}},{key:"parse",value:function(t,n){this.context=t;var r=t.src,i=e.endOfQuote(r,n+1);return this.valueRange=new m.a(n,i),i=y.a.endOfWhiteSpace(r,i),i=this.parseComment(i)}},{key:"strValue",get:function(){if(!this.valueRange||!this.context)return null;var t=[],e=this.valueRange,n=e.start,r=e.end,i=this.context,s=i.indent,a=i.src;'"'!==a[r-1]&&t.push(new g.d(this,'Missing closing "quote'));for(var o="",u=n+1;u<r-1;++u){var c=a[u];if("\n"===c){y.a.atDocumentBoundary(a,u+1)&&t.push(new g.c(this,"Document boundary indicators are not allowed within string values"));var l=y.a.foldNewline(a,u,s);o+=l.fold,u=l.offset,l.error&&t.push(new g.c(this,"Multi-line double-quoted string needs to be sufficiently indented"))}else if("\\"===c)switch(a[u+=1]){case"0":o+="\0";break;case"a":o+="";break;case"b":o+="\b";break;case"e":o+="";break;case"f":o+="\f";break;case"n":o+="\n";break;case"r":o+="\r";break;case"t":o+="\t";break;case"v":o+="\v";break;case"N":o+="
";break;case"_":o+=" ";break;case"L":o+="\u2028";break;case"P":o+="\u2029";break;case" ":o+=" ";break;case'"':o+='"';break;case"/":o+="/";break;case"\\":o+="\\";break;case"\t":o+="\t";break;case"x":o+=this.parseCharCode(u+1,2,t),u+=2;break;case"u":o+=this.parseCharCode(u+1,4,t),u+=4;break;case"U":o+=this.parseCharCode(u+1,8,t),u+=8;break;case"\n":for(;" "===a[u+1]||"\t"===a[u+1];)u+=1;break;default:t.push(new g.d(this,"Invalid escape sequence ".concat(a.substr(u-1,2)))),o+="\\"+a[u]}else if(" "===c||"\t"===c){for(var f=u,h=a[u+1];" "===h||"\t"===h;)h=a[(u+=1)+1];"\n"!==h&&(o+=u>f?a.slice(f,u+1):c)}else o+=c}return t.length>0?{errors:t,str:o}:o}}],[{key:"endOfQuote",value:function(t,e){for(var n=t[e];n&&'"'!==n;)n=t[e+="\\"===n?2:1];return e+1}}]),e}(y.a),B=function(t){function e(){return i()(this,e),a()(this,u()(e).apply(this,arguments))}return l()(e,t),d()(e,[{key:"parse",value:function(t,n){this.context=t;var r=t.src,i=e.endOfQuote(r,n+1);return this.valueRange=new m.a(n,i),i=y.a.endOfWhiteSpace(r,i),i=this.parseComment(i)}},{key:"strValue",get:function(){if(!this.valueRange||!this.context)return null;var t=[],e=this.valueRange,n=e.start,r=e.end,i=this.context,s=i.indent,a=i.src;"'"!==a[r-1]&&t.push(new g.d(this,"Missing closing 'quote"));for(var o="",u=n+1;u<r-1;++u){var c=a[u];if("\n"===c){y.a.atDocumentBoundary(a,u+1)&&t.push(new g.c(this,"Document boundary indicators are not allowed within string values"));var l=y.a.foldNewline(a,u,s);o+=l.fold,u=l.offset,l.error&&t.push(new g.c(this,"Multi-line single-quoted string needs to be sufficiently indented"))}else if("'"===c)o+=c,"'"!==a[u+=1]&&t.push(new g.d(this,"Unescaped single quote? This should not happen."));else if(" "===c||"\t"===c){for(var f=u,h=a[u+1];" "===h||"\t"===h;)h=a[(u+=1)+1];"\n"!==h&&(o+=u>f?a.slice(f,u+1):c)}else o+=c}return t.length>0?{errors:t,str:o}:o}}],[{key:"endOfQuote",value:function(t,e){for(var n=t[e];n;)if("'"===n){if("'"!==t[e+1])break;n=t[e+=2]}else n=t[e+=1];return e+1}}]),e}(y.a);function j(t,e){switch(t){case v.b.ALIAS:return new N(t,e);case v.b.BLOCK_FOLDED:case v.b.BLOCK_LITERAL:return new L(t,e);case v.b.FLOW_MAP:case v.b.FLOW_SEQ:return new R(t,e);case v.b.MAP_KEY:case v.b.MAP_VALUE:case v.b.SEQ_ITEM:return new w(t,e);case v.b.COMMENT:case v.b.PLAIN:return new M(t,e);case v.b.QUOTE_DOUBLE:return new I(t,e);case v.b.QUOTE_SINGLE:return new B(t,e);default:return null}}var U=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=r.atLineStart,a=r.inCollection,o=r.inFlow,u=r.indent,c=r.lineStart,l=r.parent;i()(this,t),x()(this,"parseNode",(function(n,r){if(y.a.atDocumentBoundary(e.src,r))return null;var i=new t(e,n),s=i.parseProps(r),a=s.props,o=s.type,u=s.valueStart,c=j(o,a),l=c.parse(i,u);if(c.range=new m.a(r,l),l<=r&&(c.error=new Error("Node#parse consumed no characters"),c.error.parseEnd=l,c.error.source=c,c.range.end=r+1),i.nodeStartsCollection(c)){c.error||i.atLineStart||i.parent.type!==v.b.DOCUMENT||(c.error=new g.d(c,"Block collection must not have preceding content here (e.g. directives-end indicator)"));var f=new E(c);return l=f.parse(new t(i),l),f.range=new m.a(r,l),f}return c})),this.atLineStart=null!=s?s:n.atLineStart||!1,this.inCollection=null!=a?a:n.inCollection||!1,this.inFlow=null!=o?o:n.inFlow||!1,this.indent=null!=u?u:n.indent,this.lineStart=null!=c?c:n.lineStart,this.parent=null!=l?l:n.parent||{},this.root=n.root,this.src=n.src}return d()(t,null,[{key:"parseType",value:function(t,e,n){switch(t[e]){case"*":return v.b.ALIAS;case">":return v.b.BLOCK_FOLDED;case"|":return v.b.BLOCK_LITERAL;case"{":return v.b.FLOW_MAP;case"[":return v.b.FLOW_SEQ;case"?":return!n&&y.a.atBlank(t,e+1,!0)?v.b.MAP_KEY:v.b.PLAIN;case":":return!n&&y.a.atBlank(t,e+1,!0)?v.b.MAP_VALUE:v.b.PLAIN;case"-":return!n&&y.a.atBlank(t,e+1,!0)?v.b.SEQ_ITEM:v.b.PLAIN;case'"':return v.b.QUOTE_DOUBLE;case"'":return v.b.QUOTE_SINGLE;default:return v.b.PLAIN}}}]),d()(t,[{key:"nodeStartsCollection",value:function(t){var e=this.inCollection,n=this.inFlow,r=this.src;if(e||n)return!1;if(t instanceof w)return!0;var i=t.range.end;return"\n"!==r[i]&&"\n"!==r[i-1]&&":"===r[i=y.a.endOfWhiteSpace(r,i)]}},{key:"parseProps",value:function(e){for(var n=this.inFlow,r=this.parent,i=this.src,s=[],a=!1,o=i[e=y.a.endOfWhiteSpace(i,e)];o===v.a.ANCHOR||o===v.a.COMMENT||o===v.a.TAG||"\n"===o;){if("\n"===o){var u=e+1,c=y.a.endOfIndent(i,u),l=c-(u+this.indent),f=r.type===v.b.SEQ_ITEM&&r.context.atLineStart;if(!y.a.nextNodeIsIndented(i[c],l,!f))break;this.atLineStart=!0,this.lineStart=u,a=!1,e=c}else if(o===v.a.COMMENT){var h=y.a.endOfLine(i,e+1);s.push(new m.a(e,h)),e=h}else{var p=y.a.endOfIdentifier(i,e+1);o===v.a.TAG&&","===i[p]&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(i.slice(e+1,p+13))&&(p=y.a.endOfIdentifier(i,p+5)),s.push(new m.a(e,p)),a=!0,e=y.a.endOfWhiteSpace(i,p)}o=i[e]}return a&&":"===o&&y.a.atBlank(i,e+1,!0)&&(e-=1),{props:s,type:t.parseType(i,e,n),valueStart:e}}}]),t}();function D(t){var e=[];-1!==t.indexOf("\r")&&(t=t.replace(/\r\n?/g,(function(t,n){return t.length>1&&e.push(n),"\n"})));var n=[],r=0;do{var i=new O,s=new U({src:t});r=i.parse(s,r),n.push(i)}while(r<t.length);return n.setOrigRanges=function(){if(0===e.length)return!1;for(var t=1;t<e.length;++t)e[t]-=t;for(var r=0,i=0;i<n.length;++i)r=n[i].setOrigRanges(e,r);return e.splice(0,e.length),!0},n.toString=function(){return n.join("...\n")},n}var F=n(16),V=n.n(F),Y=n(15);function W(t,e,n){if(Array.isArray(t))return t.map((function(t,e){return W(t,String(e),n)}));if(t&&"function"==typeof t.toJSON){var r=n&&n.anchors&&n.anchors.find((function(e){return e.node===t}));r&&(n.onCreate=function(t){r.res=t,delete n.onCreate});var i=t.toJSON(e,n);return r&&n.onCreate&&n.onCreate(i),i}return t}var $=n(19),q=n.n($),K=n(14),J=n.n(K),Q=n(12),H=n.n(Q),z=function t(){i()(this,t)},G=function(t){function e(t){var n;return i()(this,e),(n=a()(this,u()(e).call(this))).value=t,n}return l()(e,t),d()(e,[{key:"toJSON",value:function(t,e){return e&&e.keep?this.value:W(this.value,t,e)}},{key:"toString",value:function(){return String(this.value)}}]),e}(z),Z=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return i()(this,e),(n=a()(this,u()(e).call(this))).key=t,n.value=r,n.type="PAIR",n}return l()(e,t),d()(e,[{key:"addToJSMap",value:function(t,e){var n=W(this.key,"",t);if(e instanceof Map){var r=W(this.value,n,t);e.set(n,r)}else if(e instanceof Set)e.add(n);else{var i=function(t,e,n){return null===e?"":"object"!==H()(e)?String(e):t instanceof z&&n&&n.doc?t.toString({anchors:{},doc:n.doc,indent:"",inFlow:!0,inStringifyKey:!0}):JSON.stringify(e)}(this.key,n,t);e[i]=W(this.value,i,t)}return e}},{key:"toJSON",value:function(t,e){var n=e&&e.mapAsMap?new Map:{};return this.addToJSMap(e,n)}},{key:"toString",value:function(t,e,n){if(!t||!t.doc)return JSON.stringify(this);var r=t.doc.options.simpleKeys,i=this.key,s=this.value,a=i instanceof z&&i.comment;if(r){if(a)throw new Error("With simple keys, key nodes cannot have comments");if(i instanceof et){throw new Error("With simple keys, collection cannot be used as a key value")}}var o=!r&&(!i||a||i instanceof et||i.type===v.b.BLOCK_FOLDED||i.type===v.b.BLOCK_LITERAL),u=t,c=u.doc,l=u.indent;t=Object.assign({},t,{implicitKey:!o,indent:l+" "});var f=!1,h=c.schema.stringify(i,t,(function(){return a=null}),(function(){return f=!0}));if(h=Object(Y.b)(h,t.indent,a),t.allNullValues&&!r)return this.comment?(h=Object(Y.b)(h,t.indent,this.comment),e&&e()):f&&!a&&n&&n(),t.inFlow?h:"? ".concat(h);h=o?"? ".concat(h,"\n").concat(l,":"):"".concat(h,":"),this.comment&&(h=Object(Y.b)(h,t.indent,this.comment),e&&e());var p="",d=null;if(s instanceof z){if(s.spaceBefore&&(p="\n"),s.commentBefore){var g=s.commentBefore.replace(/^/gm,"".concat(t.indent,"#"));p+="\n".concat(g)}d=s.comment}else s&&"object"===H()(s)&&(s=c.schema.createNode(s,!0));t.implicitKey=!1,!o&&!this.comment&&s instanceof G&&(t.indentAtStart=h.length+1),f=!1;var y=c.schema.stringify(s,t,(function(){return d=null}),(function(){return f=!0})),m=" ";if(p||this.comment)m="".concat(p,"\n").concat(t.indent);else if(!o&&s instanceof et){("["===y[0]||"{"===y[0])&&!y.includes("\n")||(m="\n".concat(t.indent))}return f&&!d&&n&&n(),Object(Y.b)(h+m+y,t.indent,d)}},{key:"commentBefore",get:function(){return this.key&&this.key.commentBefore},set:function(t){null==this.key&&(this.key=new G(null)),this.key.commentBefore=t}}]),e}(z);function X(t,e,n){for(var r=n,i=e.length-1;i>=0;--i){var s=e[i],a=Number.isInteger(s)&&s>=0?[]:{};a[s]=r,r=a}return t.createNode(r,!1)}var tt=function(t){return null==t||"object"===H()(t)&&t[Symbol.iterator]().next().done},et=function(t){function e(t){var n;return i()(this,e),n=a()(this,u()(e).call(this)),x()(J()(n),"items",[]),n.schema=t,n}return l()(e,t),d()(e,[{key:"addIn",value:function(t,n){if(tt(t))this.add(n);else{var r=q()(t),i=r[0],s=r.slice(1),a=this.get(i,!0);if(a instanceof e)a.addIn(s,n);else{if(void 0!==a||!this.schema)throw new Error("Expected YAML collection at ".concat(i,". Remaining path: ").concat(s));this.set(i,X(this.schema,s,n))}}}},{key:"deleteIn",value:function(t){var n=q()(t),r=n[0],i=n.slice(1);if(0===i.length)return this.delete(r);var s=this.get(r,!0);if(s instanceof e)return s.deleteIn(i);throw new Error("Expected YAML collection at ".concat(r,". Remaining path: ").concat(i))}},{key:"getIn",value:function(t,n){var r=q()(t),i=r[0],s=r.slice(1),a=this.get(i,!0);return 0===s.length?!n&&a instanceof G?a.value:a:a instanceof e?a.getIn(s,n):void 0}},{key:"hasAllNullValues",value:function(){return this.items.every((function(t){if(!(t instanceof Z))return!1;var e=t.value;return null==e||e instanceof G&&null==e.value&&!e.commentBefore&&!e.comment&&!e.tag}))}},{key:"hasIn",value:function(t){var n=q()(t),r=n[0],i=n.slice(1);if(0===i.length)return this.has(r);var s=this.get(r,!0);return s instanceof e&&s.hasIn(i)}},{key:"setIn",value:function(t,n){var r=q()(t),i=r[0],s=r.slice(1);if(0===s.length)this.set(i,n);else{var a=this.get(i,!0);if(a instanceof e)a.setIn(s,n);else{if(void 0!==a||!this.schema)throw new Error("Expected YAML collection at ".concat(i,". Remaining path: ").concat(s));this.set(i,X(this.schema,s,n))}}}},{key:"toJSON",value:function(){return null}},{key:"toString",value:function(t,n,r,i){var s=this,a=n.blockItem,o=n.flowChars,u=n.isMap,c=n.itemIndent,l=t,f=l.doc,h=l.indent,p=this.type&&"FLOW"===this.type.substr(0,4)||t.inFlow;p&&(c+=" ");var d=u&&this.hasAllNullValues();t=Object.assign({},t,{allNullValues:d,indent:c,inFlow:p,type:null});var v,g=!1,y=!1,m=this.items.reduce((function(e,n,r){var i;n&&(!g&&n.spaceBefore&&e.push({type:"comment",str:""}),n.commentBefore&&n.commentBefore.match(/^.*$/gm).forEach((function(t){e.push({type:"comment",str:"#".concat(t)})})),n.comment&&(i=n.comment),p&&(!g&&n.spaceBefore||n.commentBefore||n.comment||n.key&&(n.key.commentBefore||n.key.comment)||n.value&&(n.value.commentBefore||n.value.comment))&&(y=!0)),g=!1;var a=f.schema.stringify(n,t,(function(){return i=null}),(function(){return g=!0}));return p&&!y&&a.includes("\n")&&(y=!0),p&&r<s.items.length-1&&(a+=","),a=Object(Y.b)(a,c,i),g&&(i||p)&&(g=!1),e.push({type:"item",str:a}),e}),[]);if(0===m.length)v=o.start+o.end;else if(p){var b=o.start,w=o.end,_=m.map((function(t){return t.str}));if(y||_.reduce((function(t,e){return t+e.length+2}),2)>e.maxFlowStringSingleLineLength){v=b;var S=!0,E=!1,k=void 0;try{for(var O,A=_[Symbol.iterator]();!(S=(O=A.next()).done);S=!0){var x=O.value;v+=x?"\n ".concat(h).concat(x):"\n"}}catch(t){E=!0,k=t}finally{try{S||null==A.return||A.return()}finally{if(E)throw k}}v+="\n".concat(h).concat(w)}else v="".concat(b," ").concat(_.join(" ")," ").concat(w)}else{var N=m.map(a);v=N.shift();var T=!0,C=!1,P=void 0;try{for(var L,R=N[Symbol.iterator]();!(T=(L=R.next()).done);T=!0){var M=L.value;v+=M?"\n".concat(h).concat(M):"\n"}}catch(t){C=!0,P=t}finally{try{T||null==R.return||R.return()}finally{if(C)throw P}}}return this.comment?(v+="\n"+this.comment.replace(/^/gm,"".concat(h,"#")),r&&r()):g&&i&&i(),v}}]),e}(z);x()(et,"maxFlowStringSingleLineLength",60);var nt=function(t){function e(t){var n;return i()(this,e),(n=a()(this,u()(e).call(this))).source=t,n.type=v.b.ALIAS,n}return l()(e,t),d()(e,null,[{key:"stringify",value:function(t,e){var n=t.range,r=t.source,i=e.anchors,s=e.doc,a=e.implicitKey,o=e.inStringifyKey,u=Object.keys(i).find((function(t){return i[t]===r}));if(!u&&o&&(u=s.anchors.getName(r)||s.anchors.newName()),u)return"*".concat(u).concat(a?" ":"");var c=s.anchors.getName(r)?"Alias node must be after source node":"Source node not found for alias node";throw new Error("".concat(c," [").concat(n,"]"))}}]),d()(e,[{key:"toJSON",value:function(t,e){var n=this;if(!e)return W(this.source,t,e);var r=e.anchors,i=e.maxAliasCount,s=r.find((function(t){return t.node===n.source}));if(!s||void 0===s.res){var a="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new g.b(this.cstNode,a):new ReferenceError(a)}if(i>=0&&(s.count+=1,0===s.aliasCount&&(s.aliasCount=function t(e,n){if(e instanceof nt){var r=n.find((function(t){return t.node===e.source}));return r.count*r.aliasCount}if(e instanceof et){var i=0,s=!0,a=!1,o=void 0;try{for(var u,c=e.items[Symbol.iterator]();!(s=(u=c.next()).done);s=!0){var l=t(u.value,n);l>i&&(i=l)}}catch(t){a=!0,o=t}finally{try{s||null==c.return||c.return()}finally{if(a)throw o}}return i}if(e instanceof Z){var f=t(e.key,n),h=t(e.value,n);return Math.max(f,h)}return 1}(this.source,r)),s.count*s.aliasCount>i)){var o="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new g.b(this.cstNode,o):new ReferenceError(o)}return s.res}},{key:"toString",value:function(t){return e.stringify(this,t)}},{key:"tag",set:function(t){throw new Error("Alias nodes cannot have tags")}}]),e}(z);function rt(t,e){var n=e instanceof G?e.value:e,r=!0,i=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var u=a.value;if(u instanceof Z){if(u.key===e||u.key===n)return u;if(u.key&&u.key.value===n)return u}}}catch(t){i=!0,s=t}finally{try{r||null==o.return||o.return()}finally{if(i)throw s}}}x()(nt,"default",!0);var it=function(t){function e(){return i()(this,e),a()(this,u()(e).apply(this,arguments))}return l()(e,t),d()(e,[{key:"add",value:function(t,e){t?t instanceof Z||(t=new Z(t.key||t,t.value)):t=new Z(t);var n=rt(this.items,t.key),r=this.schema&&this.schema.sortMapEntries;if(n){if(!e)throw new Error("Key ".concat(t.key," already set"));n.value=t.value}else if(r){var i=this.items.findIndex((function(e){return r(t,e)<0}));-1===i?this.items.push(t):this.items.splice(i,0,t)}else this.items.push(t)}},{key:"delete",value:function(t){var e=rt(this.items,t);return!!e&&this.items.splice(this.items.indexOf(e),1).length>0}},{key:"get",value:function(t,e){var n=rt(this.items,t),r=n&&n.value;return!e&&r instanceof G?r.value:r}},{key:"has",value:function(t){return!!rt(this.items,t)}},{key:"set",value:function(t,e){this.add(new Z(t,e),!0)}},{key:"toJSON",value:function(t,e,n){var r=n?new n:e&&e.mapAsMap?new Map:{};e&&e.onCreate&&e.onCreate(r);var i=!0,s=!1,a=void 0;try{for(var o,u=this.items[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){o.value.addToJSMap(e,r)}}catch(t){s=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(s)throw a}}return r}},{key:"toString",value:function(t,n,r){if(!t)return JSON.stringify(this);var i=!0,s=!1,a=void 0;try{for(var o,c=this.items[Symbol.iterator]();!(i=(o=c.next()).done);i=!0){var l=o.value;if(!(l instanceof Z))throw new Error("Map items must all be pairs; found ".concat(JSON.stringify(l)," instead"))}}catch(t){s=!0,a=t}finally{try{i||null==c.return||c.return()}finally{if(s)throw a}}return h()(u()(e.prototype),"toString",this).call(this,t,{blockItem:function(t){return t.str},flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:t.indent||""},n,r)}}]),e}(et);function st(t){var e=t instanceof G?t.value:t;return e&&"string"==typeof e&&(e=Number(e)),Number.isInteger(e)&&e>=0?e:null}var at=function(t){function e(){return i()(this,e),a()(this,u()(e).apply(this,arguments))}return l()(e,t),d()(e,[{key:"add",value:function(t){this.items.push(t)}},{key:"delete",value:function(t){var e=st(t);return"number"==typeof e&&this.items.splice(e,1).length>0}},{key:"get",value:function(t,e){var n=st(t);if("number"==typeof n){var r=this.items[n];return!e&&r instanceof G?r.value:r}}},{key:"has",value:function(t){var e=st(t);return"number"==typeof e&&e<this.items.length}},{key:"set",value:function(t,e){var n=st(t);if("number"!=typeof n)throw new Error("Expected a valid index, not ".concat(t,"."));this.items[n]=e}},{key:"toJSON",value:function(t,e){var n=[];e&&e.onCreate&&e.onCreate(n);var r=0,i=!0,s=!1,a=void 0;try{for(var o,u=this.items[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var c=o.value;n.push(W(c,String(r++),e))}}catch(t){s=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(s)throw a}}return n}},{key:"toString",value:function(t,n,r){return t?h()(u()(e.prototype),"toString",this).call(this,t,{blockItem:function(t){return"comment"===t.type?t.str:"- ".concat(t.str)},flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(t.indent||"")+" "},n,r):JSON.stringify(this)}}]),e}(et),ot=function(t){function e(t){var n;if(i()(this,e),t instanceof Z){var r=t.value;r instanceof at||((r=new at).items.push(t.value),r.range=t.value.range),(n=a()(this,u()(e).call(this,t.key,r))).range=t.range}else n=a()(this,u()(e).call(this,new G("<<"),new at));return n.type="MERGE_PAIR",a()(n)}return l()(e,t),d()(e,[{key:"addToJSMap",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var s,a=this.value.items[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var o=s.value.source;if(!(o instanceof it))throw new Error("Merge sources must be maps");var u=o.toJSON(null,t,Map),c=!0,l=!1,f=void 0;try{for(var h,p=u[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var d=V()(h.value,2),v=d[0],g=d[1];e instanceof Map?e.has(v)||e.set(v,g):e instanceof Set?e.add(v):Object.prototype.hasOwnProperty.call(e,v)||(e[v]=g)}}catch(t){l=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(l)throw f}}}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return e}},{key:"toString",value:function(t,n){var r=this.value;if(r.items.length>1)return h()(u()(e.prototype),"toString",this).call(this,t,n);this.value=r.items[0];var i=h()(u()(e.prototype),"toString",this).call(this,t,n);return this.value=r,i}}]),e}(Z),ut=function(){function t(e){i()(this,t),x()(this,"map",{}),this.prefix=e}return d()(t,null,[{key:"validAnchorNode",value:function(t){return t instanceof G||t instanceof at||t instanceof it}}]),d()(t,[{key:"createAlias",value:function(t,e){return this.setAnchor(t,e),new nt(t)}},{key:"createMergePair",value:function(){for(var t=this,e=new ot,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.value.items=r.map((function(e){if(e instanceof nt){if(e.source instanceof it)return e}else if(e instanceof it)return t.createAlias(e);throw new Error("Merge sources must be Map nodes or their Aliases")})),e}},{key:"getName",value:function(t){var e=this.map;return Object.keys(e).find((function(n){return e[n]===t}))}},{key:"getNode",value:function(t){return this.map[t]}},{key:"newName",value:function(t){t||(t=this.prefix);for(var e=Object.keys(this.map),n=1;;++n){var r="".concat(t).concat(n);if(!e.includes(r))return r}}},{key:"resolveNodes",value:function(){var t=this.map,e=this._cstAliases;Object.keys(t).forEach((function(e){t[e]=t[e].resolved})),e.forEach((function(t){t.source=t.source.resolved})),delete this._cstAliases}},{key:"setAnchor",value:function(e,n){if(null!=e&&!t.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw new Error("Anchor names must not contain whitespace or control characters");var r=this.map,i=e&&Object.keys(r).find((function(t){return r[t]===e}));if(i){if(!n)return i;i!==n&&(delete r[i],r[n]=e)}else{if(!n){if(!e)return null;n=this.newName()}r[n]=e}return n}}]),t}(),ct=function(t){return Object.keys(function t(e,n){if(e&&"object"===H()(e)){var r=e.tag;e instanceof et?(r&&(n[r]=!0),e.items.forEach((function(e){return t(e,n)}))):e instanceof Z?(t(e.key,n),t(e.value,n)):e instanceof G&&r&&(n[r]=!0)}return n}(t,{}))},lt=n(20),ft=n(13);function ht(t,e){var n,r,i;switch(e.type){case v.b.FLOW_MAP:n="}",r="flow map";break;case v.b.FLOW_SEQ:n="]",r="flow sequence";break;default:return void t.push(new g.c(e,"Not a flow collection!?"))}for(var s=e.items.length-1;s>=0;--s){var a=e.items[s];if(!a||a.type!==v.b.COMMENT){i=a;break}}if(i&&i.char!==n){var o,u="Expected ".concat(r," to end with ").concat(n);"number"==typeof i.offset?(o=new g.c(e,u)).offset=i.offset+1:(o=new g.c(i,u),i.range&&i.range.end&&(o.offset=i.range.end-i.range.start)),t.push(o)}}function pt(t,e,n,r,i){if(r&&"number"==typeof i){var s=e.items[n],a=s&&s.range&&s.range.start;if(!a)for(var o=n-1;o>=0;--o){var u=e.items[o];if(u&&u.range){a=u.range.end+2*(n-o);break}}if(a>i+1024){var c=String(r).substr(0,8)+"..."+String(r).substr(-8);t.push(new g.c(e,'The "'.concat(c,'" key is too long')))}}}function dt(t,e){var n=!0,r=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var o=s.value,u=o.afterKey,c=o.before,l=o.comment,f=t.items[c];f?(u&&f.value&&(f=f.value),void 0===l?!u&&f.commentBefore||(f.spaceBefore=!0):f.commentBefore?f.commentBefore+="\n"+l:f.commentBefore=l):void 0!==l&&(t.comment?t.comment+="\n"+l:t.comment=l)}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}function vt(t,e){if(e.type!==v.b.MAP&&e.type!==v.b.FLOW_MAP){var n="A ".concat(e.type," node cannot be resolved as a mapping");return t.errors.push(new g.d(e,n)),null}var r=e.type===v.b.FLOW_MAP?function(t,e){for(var n=[],r=[],i=void 0,s=null,a=!1,o="{",u=0;u<e.items.length;++u){pt(t.errors,e,u,i,s);var c=e.items[u];if("string"==typeof c.char){var l=c.char,f=c.offset;if("?"===l&&void 0===i&&!a){a=!0,o=":";continue}if(":"===l){if(void 0===i&&(i=null),":"===o){o=",";continue}}else if(a&&(void 0===i&&","!==l&&(i=null),a=!1),void 0!==i&&(r.push(new Z(i)),i=void 0,s=null,","===l)){o=":";continue}if("}"===l){if(u===e.items.length-1)continue}else if(l===o){o=":";continue}var h="Flow map contains an unexpected ".concat(l),p=new g.d(e,h);p.offset=f,t.errors.push(p)}else c.type===v.b.BLANK_LINE?n.push({afterKey:!!i,before:r.length}):c.type===v.b.COMMENT?n.push({afterKey:!!i,before:r.length,comment:c.comment}):void 0===i?(","===o&&t.errors.push(new g.c(c,"Separator , missing in flow map")),i=t.resolveNode(c),s=a?null:c.range.start):(","!==o&&t.errors.push(new g.c(c,"Indicator : missing in flow map entry")),r.push(new Z(i,t.resolveNode(c))),i=void 0,a=!1)}ht(t.errors,e),void 0!==i&&r.push(new Z(i));return{comments:n,items:r}}(t,e):function(t,e){for(var n=[],r=[],i=void 0,s=null,a=0;a<e.items.length;++a){var o=e.items[a];switch(o.type){case v.b.BLANK_LINE:n.push({afterKey:!!i,before:r.length});break;case v.b.COMMENT:n.push({afterKey:!!i,before:r.length,comment:o.comment});break;case v.b.MAP_KEY:void 0!==i&&r.push(new Z(i)),o.error&&t.errors.push(o.error),i=t.resolveNode(o.node),s=null;break;case v.b.MAP_VALUE:if(void 0===i&&(i=null),o.error&&t.errors.push(o.error),!o.context.atLineStart&&o.node&&o.node.type===v.b.MAP&&!o.node.context.atLineStart){t.errors.push(new g.c(o.node,"Nested mappings are not allowed in compact mappings"))}var u=o.node;if(!u&&o.props.length>0){(u=new M(v.b.PLAIN,[])).context={parent:o,src:o.context.src};var c=o.range.start+1;if(u.range={start:c,end:c},u.valueRange={start:c,end:c},"number"==typeof o.range.origStart){var l=o.range.origStart+1;u.range.origStart=u.range.origEnd=l,u.valueRange.origStart=u.valueRange.origEnd=l}}var f=new Z(i,t.resolveNode(u));gt(o,f),r.push(f),pt(t.errors,e,a,i,s),i=void 0,s=null;break;default:void 0!==i&&r.push(new Z(i)),i=t.resolveNode(o),s=o.range.start,o.error&&t.errors.push(o.error);t:for(var h=a+1;;++h){var p=e.items[h];switch(p&&p.type){case v.b.BLANK_LINE:case v.b.COMMENT:continue t;case v.b.MAP_VALUE:break t;default:t.errors.push(new g.c(o,"Implicit map keys need to be followed by map values"));break t}}if(o.valueRangeContainsNewline){t.errors.push(new g.c(o,"Implicit map keys need to be on a single line"))}}}void 0!==i&&r.push(new Z(i));return{comments:n,items:r}}(t,e),i=r.comments,s=r.items,a=new it;a.items=s,dt(a,i);for(var o=!1,u=0;u<s.length;++u){var c=s[u].key;if(c instanceof et&&(o=!0),t.schema.merge&&c&&"<<"===c.value){s[u]=new ot(s[u]);var l=s[u].value.items,f=null;l.some((function(t){if(t instanceof nt){var e=t.source.type;return e!==v.b.MAP&&e!==v.b.FLOW_MAP&&(f="Merge nodes aliases can only point to maps")}return f="Merge nodes can only have Alias nodes as values"})),f&&t.errors.push(new g.c(e,f))}else for(var h=u+1;h<s.length;++h){var p=s[h].key;if(c===p||c&&p&&Object.prototype.hasOwnProperty.call(c,"value")&&c.value===p.value){var d='Map keys must be unique; "'.concat(c,'" is repeated');t.errors.push(new g.c(e,d));break}}}if(o&&!t.options.mapAsMap){t.warnings.push(new g.e(e,"Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this."))}return e.resolved=a,a}function gt(t,e){if(function(t){var e=t.context,n=e.lineStart,r=e.node,i=e.src,s=t.props;if(0===s.length)return!1;var a=s[0].start;if(r&&a>r.valueRange.start)return!1;if(i[a]!==v.a.COMMENT)return!1;for(var o=n;o<a;++o)if("\n"===i[o])return!1;return!0}(t)){var n=t.getPropValue(0,v.a.COMMENT,!0),r=!1,i=e.value.commentBefore;if(i&&i.startsWith(n))e.value.commentBefore=i.substr(n.length+1),r=!0;else{var s=e.value.comment;!t.node&&s&&s.startsWith(n)&&(e.value.comment=s.substr(n.length+1),r=!0)}r&&(e.comment=n)}}var yt={createNode:function(t,e,n){var r=new it(t);if(e instanceof Map){var i=!0,s=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var c=V()(o.value,2),l=c[0],f=c[1];r.items.push(t.createPair(l,f,n))}}catch(t){s=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(s)throw a}}}else if(e&&"object"===H()(e))for(var h=0,p=Object.keys(e);h<p.length;h++){var d=p[h];r.items.push(t.createPair(d,e[d],n))}return"function"==typeof t.sortMapEntries&&r.items.sort(t.sortMapEntries),r},default:!0,nodeClass:it,tag:"tag:yaml.org,2002:map",resolve:vt};function mt(t,e){if(e.type!==v.b.SEQ&&e.type!==v.b.FLOW_SEQ){var n="A ".concat(e.type," node cannot be resolved as a sequence");return t.errors.push(new g.d(e,n)),null}var r=e.type===v.b.FLOW_SEQ?function(t,e){for(var n=[],r=[],i=!1,s=void 0,a=null,o="[",u=0;u<e.items.length;++u){var c=e.items[u];if("string"==typeof c.char){var l=c.char,f=c.offset;if(":"===l||!i&&void 0===s||(i&&void 0===s&&(s=o?r.pop():null),r.push(new Z(s)),i=!1,s=void 0,a=null),l===o)o=null;else if(o||"?"!==l){if("["!==o&&":"===l&&void 0===s){if(","===o){if((s=r.pop())instanceof Z){var h=new g.c(e,"Chaining flow sequence pairs is invalid");h.offset=f,t.errors.push(h)}i||pt(t.errors,e,u,s,a)}else s=null;a=null,i=!1,o=null}else if("["===o||"]"!==l||u<e.items.length-1){var p="Flow sequence contains an unexpected ".concat(l),d=new g.d(e,p);d.offset=f,t.errors.push(d)}}else i=!0}else if(c.type===v.b.BLANK_LINE)n.push({before:r.length});else if(c.type===v.b.COMMENT)n.push({comment:c.comment,before:r.length});else{if(o){var y="Expected a ".concat(o," in flow sequence");t.errors.push(new g.c(c,y))}var m=t.resolveNode(c);void 0===s?r.push(m):(r.push(new Z(s,m)),s=void 0),a=c.range.start,o=","}}ht(t.errors,e),void 0!==s&&r.push(new Z(s));return{comments:n,items:r}}(t,e):function(t,e){for(var n=[],r=[],i=0;i<e.items.length;++i){var s=e.items[i];switch(s.type){case v.b.BLANK_LINE:n.push({before:r.length});break;case v.b.COMMENT:n.push({comment:s.comment,before:r.length});break;case v.b.SEQ_ITEM:if(s.error&&t.errors.push(s.error),r.push(t.resolveNode(s.node)),s.hasProps){t.errors.push(new g.c(s,"Sequence items cannot have tags or anchors before the - indicator"))}break;default:s.error&&t.errors.push(s.error),t.errors.push(new g.d(s,"Unexpected ".concat(s.type," node in sequence")))}}return{comments:n,items:r}}(t,e),i=r.comments,s=r.items,a=new at;if(a.items=s,dt(a,i),!t.options.mapAsMap&&s.some((function(t){return t instanceof Z&&t.key instanceof et}))){t.warnings.push(new g.e(e,"Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this."))}return e.resolved=a,a}var bt={createNode:function(t,e,n){var r=new at(t);if(e&&e[Symbol.iterator]){var i=!0,s=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var c=o.value,l=t.createNode(c,n.wrapScalars,null,n);r.items.push(l)}}catch(t){s=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(s)throw a}}}return r},default:!0,nodeClass:at,tag:"tag:yaml.org,2002:seq",resolve:mt},wt=n(17),_t=[yt,bt,wt.a],St=n(9),Et={identify:function(t){return null==t},createNode:function(t,e,n){return n.wrapScalars?new G(null):null},default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:function(){return null},options:St.c,stringify:function(){return St.c.nullStr}},kt={identify:function(t){return"boolean"==typeof t},default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:function(t){return"t"===t[0]||"T"===t[0]},options:St.b,stringify:function(t){return t.value?St.b.trueStr:St.b.falseStr}},Ot={identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:function(t,e){return parseInt(e,8)},stringify:function(t){return"0o"+t.value.toString(8)}},At={identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:function(t){return parseInt(t,10)},stringify:ft.a},xt={identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:function(t,e){return parseInt(e,16)},stringify:function(t){return"0x"+t.value.toString(16)}},Nt={identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:function(t,e){return e?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY},stringify:ft.a},Tt={identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:0|[1-9][0-9]*)(\.[0-9]*)?[eE][-+]?[0-9]+$/,resolve:function(t){return parseFloat(t)},stringify:function(t){var e=t.value;return Number(e).toExponential()}},Ct={identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:0|[1-9][0-9]*)\.([0-9]*)$/,resolve:function(t,e){var n=new G(parseFloat(t));return e&&"0"===e[e.length-1]&&(n.minFractionDigits=e.length),n},stringify:ft.a},Pt=_t.concat([Et,kt,Ot,At,xt,Nt,Tt,Ct]),Lt=[yt,bt,{identify:function(t){return"string"==typeof t},default:!0,tag:"tag:yaml.org,2002:str",resolve:wt.b,stringify:function(t){return JSON.stringify(t)}},{identify:function(t){return null==t},createNode:function(t,e,n){return n.wrapScalars?new G(null):null},default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:function(){return null},stringify:function(t){return JSON.stringify(t)}},{identify:function(t){return"boolean"==typeof t},default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:function(t){return"true"===t},stringify:function(t){return JSON.stringify(t)}},{identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:function(t){return parseInt(t,10)},stringify:function(t){return JSON.stringify(t)}},{identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:function(t){return parseFloat(t)},stringify:function(t){return JSON.stringify(t)}}];Lt.scalarFallback=function(t){throw new SyntaxError("Unresolved plain scalar ".concat(JSON.stringify(t)))};var Rt=Lt,Mt=n(21);function It(t,e){for(var n=mt(t,e),r=0;r<n.items.length;++r){var i=n.items[r];if(!(i instanceof Z)){if(i instanceof it){if(i.items.length>1){throw new g.c(e,"Each pair must have its own sequence indicator")}var s=i.items[0]||new Z;i.commentBefore&&(s.commentBefore=s.commentBefore?"".concat(i.commentBefore,"\n").concat(s.commentBefore):i.commentBefore),i.comment&&(s.comment=s.comment?"".concat(i.comment,"\n").concat(s.comment):i.comment),i=s}n.items[r]=i instanceof Z?i:new Z(i)}}return n}function Bt(t,e,n){var r=new at(t);r.tag="tag:yaml.org,2002:pairs";var i=!0,s=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var c=o.value,l=void 0,f=void 0;if(Array.isArray(c)){if(2!==c.length)throw new TypeError("Expected [key, value] tuple: ".concat(c));l=c[0],f=c[1]}else if(c&&c instanceof Object){var h=Object.keys(c);if(1!==h.length)throw new TypeError("Expected { key: value } tuple: ".concat(c));f=c[l=h[0]]}else l=c;var p=t.createPair(l,f,n);r.items.push(p)}}catch(t){s=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(s)throw a}}return r}var jt={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:It,createNode:Bt},Ut=function(t){function e(){var t;return i()(this,e),t=a()(this,u()(e).call(this)),x()(J()(t),"add",it.prototype.add.bind(J()(t))),x()(J()(t),"delete",it.prototype.delete.bind(J()(t))),x()(J()(t),"get",it.prototype.get.bind(J()(t))),x()(J()(t),"has",it.prototype.has.bind(J()(t))),x()(J()(t),"set",it.prototype.set.bind(J()(t))),t.tag=e.tag,t}return l()(e,t),d()(e,[{key:"toJSON",value:function(t,e){var n=new Map;e&&e.onCreate&&e.onCreate(n);var r=!0,i=!1,s=void 0;try{for(var a,o=this.items[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var u=a.value,c=void 0,l=void 0;if(u instanceof Z?(c=W(u.key,"",e),l=W(u.value,c,e)):c=W(u,"",e),n.has(c))throw new Error("Ordered maps must not include duplicate keys");n.set(c,l)}}catch(t){i=!0,s=t}finally{try{r||null==o.return||o.return()}finally{if(i)throw s}}return n}}]),e}(at);x()(Ut,"tag","tag:yaml.org,2002:omap");var Dt={identify:function(t){return t instanceof Map},nodeClass:Ut,default:!1,tag:"tag:yaml.org,2002:omap",resolve:function(t,e){var n=It(t,e),r=[],i=!0,s=!1,a=void 0;try{for(var o,u=n.items[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var c=o.value.key;if(c instanceof G){if(r.includes(c.value)){throw new g.c(e,"Ordered maps must not include duplicate keys")}r.push(c.value)}}}catch(t){s=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(s)throw a}}return Object.assign(new Ut,n)},createNode:function(t,e,n){var r=Bt(t,e,n),i=new Ut;return i.items=r.items,i}},Ft=function(t){function e(){var t;return i()(this,e),(t=a()(this,u()(e).call(this))).tag=e.tag,t}return l()(e,t),d()(e,[{key:"add",value:function(t){var e=t instanceof Z?t:new Z(t);rt(this.items,e.key)||this.items.push(e)}},{key:"get",value:function(t,e){var n=rt(this.items,t);return!e&&n instanceof Z?n.key instanceof G?n.key.value:n.key:n}},{key:"set",value:function(t,e){if("boolean"!=typeof e)throw new Error("Expected boolean value for set(key, value) in a YAML set, not ".concat(H()(e)));var n=rt(this.items,t);n&&!e?this.items.splice(this.items.indexOf(n),1):!n&&e&&this.items.push(new Z(t))}},{key:"toJSON",value:function(t,n){return h()(u()(e.prototype),"toJSON",this).call(this,t,n,Set)}},{key:"toString",value:function(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues())return h()(u()(e.prototype),"toString",this).call(this,t,n,r);throw new Error("Set items must all have null values")}}]),e}(it);x()(Ft,"tag","tag:yaml.org,2002:set");var Vt={identify:function(t){return t instanceof Set},nodeClass:Ft,default:!1,tag:"tag:yaml.org,2002:set",resolve:function(t,e){var n=vt(t,e);if(!n.hasAllNullValues())throw new g.c(e,"Set items must all have null values");return Object.assign(new Ft,n)},createNode:function(t,e,n){var r=new Ft,i=!0,s=!1,a=void 0;try{for(var o,u=e[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var c=o.value;r.items.push(t.createPair(c,null,n))}}catch(t){s=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(s)throw a}}return r}},Yt=function(t,e){var n=e.split(":").reduce((function(t,e){return 60*t+Number(e)}),0);return"-"===t?-n:n},Wt=function(t){var e=t.value;if(isNaN(e)||!isFinite(e))return Object(ft.a)(e);var n="";e<0&&(n="-",e=Math.abs(e));var r=[e%60];return e<60?r.unshift(0):(e=Math.round((e-r[0])/60),r.unshift(e%60),e>=60&&(e=Math.round((e-r[0])/60),r.unshift(e))),n+r.map((function(t){return t<10?"0"+String(t):String(t)})).join(":").replace(/000000\d*$/,"")},$t={identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:function(t,e,n){return Yt(e,n.replace(/_/g,""))},stringify:Wt},qt={identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:function(t,e,n){return Yt(e,n.replace(/_/g,""))},stringify:Wt},Kt={identify:function(t){return t instanceof Date},default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:function(t,e,n,r,i,s,a,o,u){o&&(o=(o+"00").substr(1,3));var c=Date.UTC(e,n-1,r,i||0,s||0,a||0,o||0);if(u&&"Z"!==u){var l=Yt(u[0],u.slice(1));Math.abs(l)<30&&(l*=60),c-=6e4*l}return new Date(c)},stringify:function(t){return t.value.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")}},Jt=function(t){return t.value?St.b.trueStr:St.b.falseStr},Qt=_t.concat([{identify:function(t){return null==t},createNode:function(t,e,n){return n.wrapScalars?new G(null):null},default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:function(){return null},options:St.c,stringify:function(){return St.c.nullStr}},{identify:function(t){return"boolean"==typeof t},default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:function(){return!0},options:St.b,stringify:Jt},{identify:function(t){return"boolean"==typeof t},default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:function(){return!1},options:St.b,stringify:Jt},{identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^0b([0-1_]+)$/,resolve:function(t,e){return parseInt(e.replace(/_/g,""),2)},stringify:function(t){return"0b"+t.value.toString(2)}},{identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0([0-7_]+)$/,resolve:function(t,e){return parseInt(e.replace(/_/g,""),8)},stringify:function(t){var e=t.value;return(e<0?"-0":"0")+e.toString(8)}},{identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:function(t){return parseInt(t.replace(/_/g,""),10)},stringify:ft.a},{identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F_]+)$/,resolve:function(t,e){return parseInt(e.replace(/_/g,""),16)},stringify:function(t){var e=t.value;return(e<0?"-0x":"0x")+e.toString(16)}},{identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:function(t,e){return e?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY},stringify:ft.a},{identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:function(t){return parseFloat(t.replace(/_/g,""))},stringify:function(t){var e=t.value;return Number(e).toExponential()}},{identify:function(t){return"number"==typeof t},default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve:function(t,e){var n=new G(parseFloat(t.replace(/_/g,"")));if(e){var r=e.replace(/_/g,"");"0"===r[r.length-1]&&(n.minFractionDigits=r.length)}return n},stringify:ft.a}],Mt.a,Dt,jt,Vt,$t,qt,Kt),Ht={core:Pt,failsafe:_t,json:Rt,yaml11:Qt},zt={binary:Mt.a,bool:kt,float:Ct,floatExp:Tt,floatNaN:Nt,floatTime:qt,int:At,intHex:xt,intOct:Ot,intTime:$t,map:yt,null:Et,omap:Dt,pairs:jt,seq:bt,set:Vt,timestamp:Kt},Gt=function(){function t(e){var n=e.customTags,r=e.merge,s=e.schema,a=e.sortMapEntries,o=e.tags;if(i()(this,t),this.merge=!!r,this.name=s,this.sortMapEntries=!0===a?function(t,e){return t.key<e.key?-1:t.key>e.key?1:0}:a||null,this.tags=Ht[s.replace(/\W/g,"")],!this.tags){var u=Object.keys(Ht).map((function(t){return JSON.stringify(t)})).join(", ");throw new Error('Unknown schema "'.concat(s,'"; use one of ').concat(u))}if(!n&&o&&(n=o,Object(lt.b)("tags","customTags")),Array.isArray(n)){var c=!0,l=!1,f=void 0;try{for(var h,p=n[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var d=h.value;this.tags=this.tags.concat(d)}}catch(t){l=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(l)throw f}}}else"function"==typeof n&&(this.tags=n(this.tags.slice()));for(var v=0;v<this.tags.length;++v){var g=this.tags[v];if("string"==typeof g){var y=zt[g];if(!y){var m=Object.keys(zt).map((function(t){return JSON.stringify(t)})).join(", ");throw new Error('Unknown custom tag "'.concat(g,'"; use one of ').concat(m))}this.tags[v]=y}}}return d()(t,[{key:"createNode",value:function(e,n,r,i){if(e instanceof z)return e;var s;if(r){r.startsWith("!!")&&(r=t.defaultPrefix+r.slice(2));var a=this.tags.filter((function(t){return t.tag===r}));if(!(s=a.find((function(t){return!t.format}))||a[0]))throw new Error("Tag ".concat(r," not found"))}else if(!(s=this.tags.find((function(t){return(t.identify&&t.identify(e)||t.class&&e instanceof t.class)&&!t.format})))){if("function"==typeof e.toJSON&&(e=e.toJSON()),"object"!==H()(e))return n?new G(e):e;s=e instanceof Map?zt.map:e[Symbol.iterator]?zt.seq:zt.map}i?i.wrapScalars=n:i={wrapScalars:n},i.onTagObj&&(i.onTagObj(s),delete i.onTagObj);var o={};if(e&&"object"===H()(e)&&i.prevObjects){var u=i.prevObjects.get(e);if(u){var c=new nt(u);return i.aliasNodes.push(c),c}o.value=e,i.prevObjects.set(e,o)}return o.node=s.createNode?s.createNode(this,e,i):n?new G(e):e,r&&o.node instanceof z&&(o.node.tag=r),o.node}},{key:"createPair",value:function(t,e,n){var r=this.createNode(t,n.wrapScalars,null,n),i=this.createNode(e,n.wrapScalars,null,n);return new Z(r,i)}},{key:"resolveScalar",value:function(t,e){e||(e=this.tags);for(var n=0;n<e.length;++n){var r=e[n],i=r.format,s=r.test,a=r.resolve;if(s){var o=t.match(s);if(o){var u=a.apply(null,o);return u instanceof G||(u=new G(u)),i&&(u.format=i),u}}}return this.tags.scalarFallback&&(t=this.tags.scalarFallback(t)),new G(t)}},{key:"resolveNode",value:function(t,e,n){var r=this.tags.filter((function(t){return t.tag===n})),i=r.find((function(t){return!t.test}));e.error&&t.errors.push(e.error);try{if(i){var s=i.resolve(t,e);s instanceof et||(s=new G(s)),e.resolved=s}else{var a=Object(wt.b)(t,e);"string"==typeof a&&r.length>0&&(e.resolved=this.resolveScalar(a,r))}}catch(n){n.source||(n.source=e),t.errors.push(n),e.resolved=null}return e.resolved?(n&&e.tag&&(e.resolved.tag=n),e.resolved):null}},{key:"resolveNodeWithFallback",value:function(e,n,r){var i=this.resolveNode(e,n,r);if(Object.prototype.hasOwnProperty.call(n,"resolved"))return i;var s,a=(s=n.type)===v.b.FLOW_MAP||s===v.b.MAP?t.defaultTags.MAP:function(t){var e=t.type;return e===v.b.FLOW_SEQ||e===v.b.SEQ}(n)?t.defaultTags.SEQ:t.defaultTags.STR;if(a){e.warnings.push(new g.e(n,"The tag ".concat(r," is unavailable, falling back to ").concat(a)));var o=this.resolveNode(e,n,a);return o.tag=r,o}return e.errors.push(new g.b(n,"The tag ".concat(r," is unavailable"))),null}},{key:"getTagObject",value:function(t){if(t instanceof nt)return nt;if(t.tag){var e=this.tags.filter((function(e){return e.tag===t.tag}));if(e.length>0)return e.find((function(e){return e.format===t.format}))||e[0]}var n,r;if(t instanceof G){r=t.value;var i=this.tags.filter((function(t){return t.identify&&t.identify(r)||t.class&&r instanceof t.class}));n=i.find((function(e){return e.format===t.format}))||i.find((function(t){return!t.format}))}else r=t,n=this.tags.find((function(t){return t.nodeClass&&r instanceof t.nodeClass}));if(!n){var s=r&&r.constructor?r.constructor.name:H()(r);throw new Error("Tag not resolved for ".concat(s," value"))}return n}},{key:"stringifyProps",value:function(t,e,n){var r=n.anchors,i=n.doc,s=[],a=i.anchors.getName(t);return a&&(r[a]=t,s.push("&".concat(a))),t.tag?s.push(i.stringifyTag(t.tag)):e.default||s.push(i.stringifyTag(e.tag)),s.join(" ")}},{key:"stringify",value:function(t,e,n,r){var i;if(!(t instanceof z)){var s={aliasNodes:[],onTagObj:function(t){return i=t},prevObjects:new Map};t=this.createNode(t,!0,null,s);var a=e.doc.anchors,o=!0,u=!1,c=void 0;try{for(var l,f=s.aliasNodes[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var h=l.value;h.source=h.source.node;var p=a.getName(h.source);p||(p=a.newName(),a.map[p]=h.source)}}catch(t){u=!0,c=t}finally{try{o||null==f.return||f.return()}finally{if(u)throw c}}}if(e.tags=this,t instanceof Z)return t.toString(e,n,r);i||(i=this.getTagObject(t));var d=this.stringifyProps(t,i,e);d.length>0&&(e.indentAtStart=(e.indentAtStart||0)+d.length+1);var v="function"==typeof i.stringify?i.stringify(t,e,n,r):t instanceof et?t.toString(e,n,r):Object(ft.b)(t,e,n,r);return d?t instanceof et&&"{"!==v[0]&&"["!==v[0]?"".concat(d,"\n").concat(e.indent).concat(v):"".concat(d," ").concat(v):v}}]),t}();x()(Gt,"defaultPrefix","tag:yaml.org,2002:"),x()(Gt,"defaultTags",{MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"});var Zt=function(){function t(e){i()(this,t),this.anchors=new ut(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}return d()(t,[{key:"assertCollectionContents",value:function(){if(this.contents instanceof et)return!0;throw new Error("Expected a YAML collection as document contents")}},{key:"add",value:function(t){return this.assertCollectionContents(),this.contents.add(t)}},{key:"addIn",value:function(t,e){this.assertCollectionContents(),this.contents.addIn(t,e)}},{key:"delete",value:function(t){return this.assertCollectionContents(),this.contents.delete(t)}},{key:"deleteIn",value:function(t){return tt(t)?null!=this.contents&&(this.contents=null,!0):(this.assertCollectionContents(),this.contents.deleteIn(t))}},{key:"getDefaults",value:function(){return t.defaults[this.version]||t.defaults[this.options.version]||{}}},{key:"get",value:function(t,e){return this.contents instanceof et?this.contents.get(t,e):void 0}},{key:"getIn",value:function(t,e){return tt(t)?!e&&this.contents instanceof G?this.contents.value:this.contents:this.contents instanceof et?this.contents.getIn(t,e):void 0}},{key:"has",value:function(t){return this.contents instanceof et&&this.contents.has(t)}},{key:"hasIn",value:function(t){return tt(t)?void 0!==this.contents:this.contents instanceof et&&this.contents.hasIn(t)}},{key:"set",value:function(t,e){this.assertCollectionContents(),this.contents.set(t,e)}},{key:"setIn",value:function(t,e){tt(t)?this.contents=e:(this.assertCollectionContents(),this.contents.setIn(t,e))}},{key:"setSchema",value:function(t,e){if(t||e||!this.schema){"number"==typeof t&&(t=t.toFixed(1)),"1.0"===t||"1.1"===t||"1.2"===t?(this.version?this.version=t:this.options.version=t,delete this.options.schema):t&&"string"==typeof t&&(this.options.schema=t),Array.isArray(e)&&(this.options.customTags=e);var n=Object.assign({},this.getDefaults(),this.options);this.schema=new Gt(n)}}},{key:"parse",value:function(t,e){this.options.keepCstNodes&&(this.cstNode=t),this.options.keepNodeTypes&&(this.type="DOCUMENT");var n=t.directives,r=void 0===n?[]:n,i=t.contents,s=void 0===i?[]:i,a=t.directivesEndMarker,o=t.error,u=t.valueRange;if(o&&(o.source||(o.source=this),this.errors.push(o)),this.parseDirectives(r,e),a&&(this.directivesEndMarker=!0),this.range=u?[u.start,u.end]:null,this.setSchema(),this.anchors._cstAliases=[],this.parseContents(s),this.anchors.resolveNodes(),this.options.prettyErrors){var c=!0,l=!1,f=void 0;try{for(var h,p=this.errors[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var d=h.value;d instanceof g.a&&d.makePretty()}}catch(t){l=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(l)throw f}}var v=!0,y=!1,m=void 0;try{for(var b,w=this.warnings[Symbol.iterator]();!(v=(b=w.next()).done);v=!0){var _=b.value;_ instanceof g.a&&_.makePretty()}}catch(t){y=!0,m=t}finally{try{v||null==w.return||w.return()}finally{if(y)throw m}}}return this}},{key:"parseDirectives",value:function(t,e){var n=this,r=[],i=!1;if(t.forEach((function(t){var e=t.comment,s=t.name;switch(s){case"TAG":n.resolveTagDirective(t),i=!0;break;case"YAML":case"YAML:1.0":n.resolveYamlDirective(t),i=!0;break;default:if(s){var a="YAML only supports %TAG and %YAML directives, and not %".concat(s);n.warnings.push(new g.e(t,a))}}e&&r.push(e)})),e&&!i&&"1.1"===(this.version||e.version||this.options.version)){this.tagPrefixes=e.tagPrefixes.map((function(t){return{handle:t.handle,prefix:t.prefix}})),this.version=e.version}this.commentBefore=r.join("\n")||null}},{key:"parseContents",value:function(t){var e=this,n={before:[],after:[]},r=[],i=!1;switch(t.forEach((function(t){if(t.valueRange){if(1===r.length){e.errors.push(new g.d(t,"Document is not valid YAML (bad indentation?)"))}var s=e.resolveNode(t);i&&(s.spaceBefore=!0,i=!1),r.push(s)}else if(null!==t.comment){(0===r.length?n.before:n.after).push(t.comment)}else t.type===v.b.BLANK_LINE&&(i=!0,0===r.length&&n.before.length>0&&!e.commentBefore&&(e.commentBefore=n.before.join("\n"),n.before=[]))})),r.length){case 0:this.contents=null,n.after=n.before;break;case 1:if(this.contents=r[0],this.contents){var s=n.before.join("\n")||null;if(s){var a=this.contents instanceof et&&this.contents.items[0]?this.contents.items[0]:this.contents;a.commentBefore=a.commentBefore?"".concat(s,"\n").concat(a.commentBefore):s}}else n.after=n.before.concat(n.after);break;default:this.contents=r,this.contents[0]?this.contents[0].commentBefore=n.before.join("\n")||null:n.after=n.before.concat(n.after)}this.comment=n.after.join("\n")||null}},{key:"resolveTagDirective",value:function(t){var e=V()(t.parameters,2),n=e[0],r=e[1];if(n&&r)if(this.tagPrefixes.every((function(t){return t.handle!==n})))this.tagPrefixes.push({handle:n,prefix:r});else{this.errors.push(new g.c(t,"The %TAG directive must only be given at most once per handle in the same document."))}else{this.errors.push(new g.c(t,"Insufficient parameters given for %TAG directive"))}}},{key:"resolveYamlDirective",value:function(e){var n=V()(e.parameters,1)[0];if("YAML:1.0"===e.name&&(n="1.0"),this.version){this.errors.push(new g.c(e,"The %YAML directive must only be given at most once per document."))}if(n){if(!t.defaults[n]){var r=this.version||this.options.version,i="Document will be parsed as YAML ".concat(r," rather than YAML ").concat(n);this.warnings.push(new g.e(e,i))}this.version=n}else{this.errors.push(new g.c(e,"Insufficient parameters given for %YAML directive"))}}},{key:"resolveTagName",value:function(t){var e=t.tag,n=t.type,r=!1;if(e){var i=e.handle,s=e.suffix,a=e.verbatim;if(a){if("!"!==a&&"!!"!==a)return a;var o="Verbatim tags aren't resolved, so ".concat(a," is invalid.");this.errors.push(new g.c(t,o))}else if("!"!==i||s){var u=this.tagPrefixes.find((function(t){return t.handle===i}));if(!u){var c=this.getDefaults().tagPrefixes;c&&(u=c.find((function(t){return t.handle===i})))}if(u){if(s){if("!"===i&&"1.0"===(this.version||this.options.version)){if("^"===s[0])return s;if(/[:/]/.test(s)){var l=s.match(/^([a-z0-9-]+)\/(.*)/i);return l?"tag:".concat(l[1],".yaml.org,2002:").concat(l[2]):"tag:".concat(s)}}return u.prefix+decodeURIComponent(s)}this.errors.push(new g.c(t,"The ".concat(i," tag has no suffix.")))}else{var f="The ".concat(i," tag handle is non-default and was not declared.");this.errors.push(new g.c(t,f))}}else r=!0}switch(n){case v.b.BLOCK_FOLDED:case v.b.BLOCK_LITERAL:case v.b.QUOTE_DOUBLE:case v.b.QUOTE_SINGLE:return Gt.defaultTags.STR;case v.b.FLOW_MAP:case v.b.MAP:return Gt.defaultTags.MAP;case v.b.FLOW_SEQ:case v.b.SEQ:return Gt.defaultTags.SEQ;case v.b.PLAIN:return r?Gt.defaultTags.STR:null;default:return null}}},{key:"resolveNode",value:function(t){if(!t)return null;var e,n=this.anchors,r=this.errors,i=this.schema,s=!1,a=!1,o={before:[],after:[]},u=function(t){return t&&[v.b.MAP_KEY,v.b.MAP_VALUE,v.b.SEQ_ITEM].includes(t.type)}(t.context.parent)?t.context.parent.props.concat(t.props):t.props,c=!0,l=!1,f=void 0;try{for(var h,p=u[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var d=h.value,y=d.start,m=d.end;switch(t.context.src[y]){case v.a.COMMENT:if(!t.commentHasRequiredWhitespace(y)){r.push(new g.c(t,"Comments must be separated from other tokens by white space characters"))}var b=t.context.src.slice(y+1,m),w=t.header,_=t.valueRange;_&&(y>_.start||w&&y>w.start)?o.after.push(b):o.before.push(b);break;case v.a.ANCHOR:if(s){r.push(new g.c(t,"A node can have at most one anchor"))}s=!0;break;case v.a.TAG:if(a){r.push(new g.c(t,"A node can have at most one tag"))}a=!0}}}catch(t){l=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(l)throw f}}if(s){var S=t.anchor,E=n.getNode(S);E&&(n.map[n.newName(S)]=E),n.map[S]=t}if(t.type===v.b.ALIAS){if(s||a){r.push(new g.c(t,"An alias node must not specify any properties"))}var k=t.rawValue,O=n.getNode(k);if(!O){var A="Aliased anchor not found: ".concat(k);return r.push(new g.b(t,A)),null}e=new nt(O),n._cstAliases.push(e)}else{var x=this.resolveTagName(t);if(x)e=i.resolveNodeWithFallback(this,t,x);else{if(t.type!==v.b.PLAIN){var N="Failed to resolve ".concat(t.type," node here");return r.push(new g.d(t,N)),null}try{e=i.resolveScalar(t.strValue||"")}catch(e){return e.source||(e.source=t),r.push(e),null}}}if(e){e.range=[t.range.start,t.range.end],this.options.keepCstNodes&&(e.cstNode=t),this.options.keepNodeTypes&&(e.type=t.type);var T=o.before.join("\n");T&&(e.commentBefore=e.commentBefore?"".concat(e.commentBefore,"\n").concat(T):T);var C=o.after.join("\n");C&&(e.comment=e.comment?"".concat(e.comment,"\n").concat(C):C)}return t.resolved=e}},{key:"listNonDefaultTags",value:function(){return ct(this.contents).filter((function(t){return 0!==t.indexOf(Gt.defaultPrefix)}))}},{key:"setTagPrefix",value:function(t,e){if("!"!==t[0]||"!"!==t[t.length-1])throw new Error("Handle must start and end with !");if(e){var n=this.tagPrefixes.find((function(e){return e.handle===t}));n?n.prefix=e:this.tagPrefixes.push({handle:t,prefix:e})}else this.tagPrefixes=this.tagPrefixes.filter((function(e){return e.handle!==t}))}},{key:"stringifyTag",value:function(t){if("1.0"===(this.version||this.options.version)){var e=t.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(e)return"!"+e[1];var n=t.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return n?"!".concat(n[1],"/").concat(n[2]):"!".concat(t.replace(/^tag:/,""))}var r=this.tagPrefixes.find((function(e){return 0===t.indexOf(e.prefix)}));if(!r){var i=this.getDefaults().tagPrefixes;r=i&&i.find((function(e){return 0===t.indexOf(e.prefix)}))}if(!r)return"!"===t[0]?t:"!<".concat(t,">");var s=t.substr(r.prefix.length).replace(/[!,[\]{}]/g,(function(t){return{"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"}[t]}));return r.handle+s}},{key:"toJSON",value:function(t){var e=this,n=this.options,r=n.keepBlobsInJSON,i=n.mapAsMap,s=n.maxAliasCount,a=r&&("string"!=typeof t||!(this.contents instanceof G)),o={doc:this,keep:a,mapAsMap:a&&!!i,maxAliasCount:s},u=Object.keys(this.anchors.map);return u.length>0&&(o.anchors=u.map((function(t){return{alias:[],aliasCount:0,count:1,node:e.anchors.map[t]}}))),W(this.contents,t,o)}},{key:"toString",value:function(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");this.setSchema();var t=[],e=!1;if(this.version){var n="%YAML 1.2";"yaml-1.1"===this.schema.name&&("1.0"===this.version?n="%YAML:1.0":"1.1"===this.version&&(n="%YAML 1.1")),t.push(n),e=!0}var r=this.listNonDefaultTags();this.tagPrefixes.forEach((function(n){var i=n.handle,s=n.prefix;r.some((function(t){return 0===t.indexOf(s)}))&&(t.push("%TAG ".concat(i," ").concat(s)),e=!0)})),(e||this.directivesEndMarker)&&t.push("---"),this.commentBefore&&(!e&&this.directivesEndMarker||t.unshift(""),t.unshift(this.commentBefore.replace(/^/gm,"#")));var i={anchors:{},doc:this,indent:""},s=!1,a=null;if(this.contents){this.contents instanceof z&&(this.contents.spaceBefore&&(e||this.directivesEndMarker)&&t.push(""),this.contents.commentBefore&&t.push(this.contents.commentBefore.replace(/^/gm,"#")),i.forceBlockIndent=!!this.comment,a=this.contents.comment);var o=a?null:function(){return s=!0},u=this.schema.stringify(this.contents,i,(function(){return a=null}),o);t.push(Object(Y.b)(u,"",a))}else void 0!==this.contents&&t.push(this.schema.stringify(this.contents,i));return this.comment&&(s&&!a||""===t[t.length-1]||t.push(""),t.push(this.comment.replace(/^/gm,"#"))),t.join("\n")+"\n"}}]),t}();x()(Zt,"defaults",{"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:Gt.defaultPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Gt.defaultPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:Gt.defaultPrefix}]}});var Xt={anchorPrefix:"a",customTags:null,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"};var te=function(t){function e(t){return i()(this,e),a()(this,u()(e).call(this,Object.assign({},Xt,t)))}return l()(e,t),e}(Zt);function ee(t,e){var n=D(t),r=new te(e).parse(n[0]);if(n.length>1){r.errors.unshift(new g.c(n[1],"Source contains multiple documents; please use YAML.parseAllDocuments()"))}return r}e.default={createNode:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;void 0===n&&"string"==typeof e&&(n=e,e=!0);var r=Object.assign({},Zt.defaults[Xt.version],Xt),i=new Gt(r);return i.createNode(t,e,n)},defaultOptions:Xt,Document:te,parse:function(t,e){var n=ee(t,e);if(n.warnings.forEach((function(t){return Object(lt.a)(t)})),n.errors.length>0)throw n.errors[0];return n.toJSON()},parseAllDocuments:function(t,e){var n,r=[],i=!0,s=!1,a=void 0;try{for(var o,u=D(t)[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var c=o.value,l=new te(e);l.parse(c,n),r.push(l),n=l}}catch(t){s=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(s)throw a}}return r},parseCST:D,parseDocument:ee,stringify:function(t,e){var n=new te(e);return n.contents=t,String(n)}}},function(t,e,n){"use strict";n.r(e);
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
const r=new WeakMap,i=t=>"function"==typeof t&&r.has(t),s=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,a=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},o={},u={},c=`{{lit-${String(Math.random()).slice(2)}}}`,l=`\x3c!--${c}--\x3e`,f=new RegExp(`${c}|${l}`);class h{constructor(t,e){this.parts=[],this.element=e;const n=[],r=[],i=document.createTreeWalker(e.content,133,null,!1);let s=0,a=-1,o=0;const{strings:u,values:{length:l}}=t;for(;o<l;){const t=i.nextNode();if(null!==t){if(a++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:n}=e;let r=0;for(let t=0;t<n;t++)p(e[t].name,"$lit$")&&r++;for(;r-- >0;){const e=u[o],n=g.exec(e)[2],r=n.toLowerCase()+"$lit$",i=t.getAttribute(r);t.removeAttribute(r);const s=i.split(f);this.parts.push({type:"attribute",index:a,name:n,strings:s}),o+=s.length-1}}"TEMPLATE"===t.tagName&&(r.push(t),i.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(c)>=0){const r=t.parentNode,i=e.split(f),s=i.length-1;for(let e=0;e<s;e++){let n,s=i[e];if(""===s)n=v();else{const t=g.exec(s);null!==t&&p(t[2],"$lit$")&&(s=s.slice(0,t.index)+t[1]+t[2].slice(0,-"$lit$".length)+t[3]),n=document.createTextNode(s)}r.insertBefore(n,t),this.parts.push({type:"node",index:++a})}""===i[s]?(r.insertBefore(v(),t),n.push(t)):t.data=i[s],o+=s}}else if(8===t.nodeType)if(t.data===c){const e=t.parentNode;null!==t.previousSibling&&a!==s||(a++,e.insertBefore(v(),t)),s=a,this.parts.push({type:"node",index:a}),null===t.nextSibling?t.data="":(n.push(t),a--),o++}else{let e=-1;for(;-1!==(e=t.data.indexOf(c,e+1));)this.parts.push({type:"node",index:-1}),o++}}else i.currentNode=r.pop()}for(const t of n)t.parentNode.removeChild(t)}}const p=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},d=t=>-1!==t.index,v=()=>document.createComment(""),g=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
class y{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=s?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,r=document.createTreeWalker(t,133,null,!1);let i,a=0,o=0,u=r.nextNode();for(;a<n.length;)if(i=n[a],d(i)){for(;o<i.index;)o++,"TEMPLATE"===u.nodeName&&(e.push(u),r.currentNode=u.content),null===(u=r.nextNode())&&(r.currentNode=e.pop(),u=r.nextNode());if("node"===i.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(u.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(u,i.name,i.strings,this.options));a++}else this.__parts.push(void 0),a++;return s&&(document.adoptNode(t),customElements.upgrade(t)),t}}
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const m=` ${c} `;class b{constructor(t,e,n,r){this.strings=t,this.values=e,this.type=n,this.processor=r}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let r=0;r<t;r++){const t=this.strings[r],i=t.lastIndexOf("\x3c!--");n=(i>-1||n)&&-1===t.indexOf("--\x3e",i+1);const s=g.exec(t);e+=null===s?t+(n?m:l):t.substr(0,s.index)+s[1]+s[2]+"$lit$"+s[3]+c}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
const w=t=>null===t||!("object"==typeof t||"function"==typeof t),_=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class S{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t<n.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new E(this)}_getValue(){const t=this.strings,e=t.length-1;let n="";for(let r=0;r<e;r++){n+=t[r];const e=this.parts[r];if(void 0!==e){const t=e.value;if(w(t)||!_(t))n+="string"==typeof t?t:String(t);else for(const e of t)n+="string"==typeof e?e:String(e)}}return n+=t[e],n}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class E{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===o||w(t)&&t===this.value||(this.value=t,i(t)||(this.committer.dirty=!0))}commit(){for(;i(this.value);){const t=this.value;this.value=o,t(this)}this.value!==o&&this.committer.commit()}}class k{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(v()),this.endNode=t.appendChild(v())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=v()),t.__insert(this.endNode=v())}insertAfterPart(t){t.__insert(this.startNode=v()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){for(;i(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=o,t(this)}const t=this.__pendingValue;t!==o&&(w(t)?t!==this.value&&this.__commitText(t):t instanceof b?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):_(t)?this.__commitIterable(t):t===u?(this.value=u,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,n="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=n:this.__commitNode(document.createTextNode(n)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof y&&this.value.template===e)this.value.update(t.values);else{const n=new y(e,t.processor,this.options),r=n._clone();n.update(t.values),this.__commitNode(r),this.value=n}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,r=0;for(const i of t)n=e[r],void 0===n&&(n=new k(this.options),e.push(n),0===r?n.appendIntoPart(this):n.insertAfterPart(e[r-1])),n.setValue(i),n.commit(),r++;r<e.length&&(e.length=r,this.clear(n&&n.endNode))}clear(t=this.startNode){a(this.startNode.parentNode,t.nextSibling,this.endNode)}}class O{constructor(t,e,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this.__pendingValue=t}commit(){for(;i(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=o,t(this)}if(this.__pendingValue===o)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=o}}class A extends S{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new x(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class x extends E{}let N=!1;try{const t={get capture(){return N=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class T{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;i(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=o,t(this)}if(this.__pendingValue===o)return;const t=this.__pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=C(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=o}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const C=t=>t&&(N?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/;const P=new class{handleAttributeExpressions(t,e,n,r){const i=e[0];if("."===i){return new A(t,e.slice(1),n).parts}if("@"===i)return[new T(t,e.slice(1),r.eventContext)];if("?"===i)return[new O(t,e.slice(1),n)];return new S(t,e,n).parts}handleTextExpression(t){return new k(t)}};
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/function L(t){let e=R.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},R.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const r=t.strings.join(c);return n=e.keyString.get(r),void 0===n&&(n=new h(t,t.getTemplateElement()),e.keyString.set(r,n)),e.stringsArray.set(t.strings,n),n}const R=new Map,M=new WeakMap;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.1.2");const I=(t,...e)=>new b(t,e,"html",P);function B(t,e){const{element:{content:n},parts:r}=t,i=document.createTreeWalker(n,133,null,!1);let s=U(r),a=r[s],o=-1,u=0;const c=[];let l=null;for(;i.nextNode();){o++;const t=i.currentNode;for(t.previousSibling===l&&(l=null),e.has(t)&&(c.push(t),null===l&&(l=t)),null!==l&&u++;void 0!==a&&a.index===o;)a.index=null!==l?-1:a.index-u,s=U(r,s),a=r[s]}c.forEach(t=>t.parentNode.removeChild(t))}const j=t=>{let e=11===t.nodeType?0:1;const n=document.createTreeWalker(t,133,null,!1);for(;n.nextNode();)e++;return e},U=(t,e=-1)=>{for(let n=e+1;n<t.length;n++){const e=t[n];if(d(e))return n}return-1};
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
const D=(t,e)=>`${t}--${e}`;let F=!0;void 0===window.ShadyCSS?F=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/[email protected] and @webcomponents/[email protected]."),F=!1);const V=t=>e=>{const n=D(e.type,t);let r=R.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},R.set(n,r));let i=r.stringsArray.get(e.strings);if(void 0!==i)return i;const s=e.strings.join(c);if(i=r.keyString.get(s),void 0===i){const n=e.getTemplateElement();F&&window.ShadyCSS.prepareTemplateDom(n,t),i=new h(e,n),r.keyString.set(s,i)}return r.stringsArray.set(e.strings,i),i},Y=["html","svg"],W=new Set,$=(t,e,n)=>{W.add(t);const r=n?n.element:document.createElement("template"),i=e.querySelectorAll("style"),{length:s}=i;if(0===s)return void window.ShadyCSS.prepareTemplateStyles(r,t);const a=document.createElement("style");for(let t=0;t<s;t++){const e=i[t];e.parentNode.removeChild(e),a.textContent+=e.textContent}(t=>{Y.forEach(e=>{const n=R.get(D(e,t));void 0!==n&&n.keyString.forEach(t=>{const{element:{content:e}}=t,n=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{n.add(t)}),B(t,n)})})})(t);const o=r.content;n?function(t,e,n=null){const{element:{content:r},parts:i}=t;if(null==n)return void r.appendChild(e);const s=document.createTreeWalker(r,133,null,!1);let a=U(i),o=0,u=-1;for(;s.nextNode();){u++;for(s.currentNode===n&&(o=j(e),n.parentNode.insertBefore(e,n));-1!==a&&i[a].index===u;){if(o>0){for(;-1!==a;)i[a].index+=o,a=U(i,a);return}a=U(i,a)}}}(n,a,o.firstChild):o.insertBefore(a,o.firstChild),window.ShadyCSS.prepareTemplateStyles(r,t);const u=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==u)e.insertBefore(u.cloneNode(!0),e.firstChild);else if(n){o.insertBefore(a,o.firstChild);const t=new Set;t.add(a),B(n,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const q={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},K=(t,e)=>e!==t&&(e==e||t==t),J={attribute:!0,type:String,converter:q,reflect:!1,hasChanged:K},Q=Promise.resolve(!0);class H extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=Q,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,n)=>{const r=this._attributeNameForProperty(n,e);void 0!==r&&(this._attributeToPropertyMap.set(r,n),t.push(r))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=J){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const n="symbol"==typeof t?Symbol():"__"+t;Object.defineProperty(this.prototype,t,{get(){return this[n]},set(e){const r=this[t];this[n]=e,this._requestUpdate(t,r)},configurable:!0,enumerable:!0})}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const n of e)this.createProperty(n,t[n])}}static _attributeNameForProperty(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,n=K){return n(t,e)}static _propertyValueFromAttribute(t,e){const n=e.type,r=e.converter||q,i="function"==typeof r?r:r.fromAttribute;return i?i(t,n):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const n=e.type,r=e.converter;return(r&&r.toAttribute||q.toAttribute)(t,n)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this._updateState=32|this._updateState,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,n){e!==n&&this._attributeToProperty(t,n)}_propertyToAttribute(t,e,n=J){const r=this.constructor,i=r._attributeNameForProperty(t,n);if(void 0!==i){const t=r._propertyValueToAttribute(e,n);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(i):this.setAttribute(i,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const n=this.constructor,r=n._attributeToPropertyMap.get(t);if(void 0!==r){const t=n._classProperties.get(r)||J;this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}_requestUpdate(t,e){let n=!0;if(void 0!==t){const r=this.constructor,i=r._classProperties.get(t)||J;r._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()}requestUpdate(t,e){return this._requestUpdate(t,e),this.updateComplete}async _enqueueUpdate(){let t,e;this._updateState=4|this._updateState;const n=this._updatePromise;this._updatePromise=new Promise((n,r)=>{t=n,e=r});try{await n}catch(t){}this._hasConnected||await new Promise(t=>this._hasConnectedResolver=t);try{const t=this.performUpdate();null!=t&&await t}catch(t){e(t)}t(!this._hasRequestedUpdate)}get _hasConnected(){return 32&this._updateState}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t&&this.update(e)}catch(e){throw t=!1,e}finally{this._markUpdated()}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0)}updated(t){}firstUpdated(t){}}H.finalized=!0;const z="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;Symbol();
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
(window.litElementVersions||(window.litElementVersions=[])).push("2.2.1");const G=t=>t.flat?t.flat(1/0):function t(e,n=[]){for(let r=0,i=e.length;r<i;r++){const i=e[r];Array.isArray(i)?t(i,n):n.push(i)}return n}(t);class Z extends H{static finalize(){super.finalize.call(this),this._styles=this.hasOwnProperty(JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]}static _getUniqueStyles(){const t=this.styles,e=[];if(Array.isArray(t)){G(t).reduceRight((t,e)=>(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?z?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof b&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}function X(){return document.querySelector("hc-main")?document.querySelector("hc-main").hass:document.querySelector("home-assistant")?document.querySelector("home-assistant").hass:void 0}function tt(t,e,n=null){if((t=new Event(t,{bubbles:!0,cancelable:!1,composed:!0})).detail=e||{},n)n.dispatchEvent(t);else{var r=function(){var t=document.querySelector("hc-main");return t=t?(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("hc-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-view")||t.querySelector("hui-panel-view"):(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=document.querySelector("home-assistant"))&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root"))&&t.shadowRoot)&&t.querySelector("ha-app-layout"))&&t.querySelector("#view"))&&t.firstElementChild}();r&&r.dispatchEvent(t)}}Z.finalized=!0,Z.render=(t,e,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const r=n.scopeName,i=M.has(e),s=F&&11===e.nodeType&&!!e.host,o=s&&!W.has(r),u=o?document.createDocumentFragment():e;if(((t,e,n)=>{let r=M.get(e);void 0===r&&(a(e,e.firstChild),M.set(e,r=new k(Object.assign({templateFactory:L},n))),r.appendInto(e)),r.setValue(t),r.commit()})(t,u,Object.assign({templateFactory:V(r)},n)),o){const t=M.get(u);M.delete(u);const n=t.value instanceof y?t.value.template:void 0;$(r,u,n),a(e,e.firstChild),e.appendChild(u),M.set(e,t)}!i&&s&&window.ShadyCSS.styleElement(e.host)};let et=window.cardHelpers;const nt=new Promise(async(t,e)=>{et&&t();const n=async()=>{et=await window.loadCardHelpers(),window.cardHelpers=et,t()};window.loadCardHelpers?n():window.addEventListener("load",async()=>{!async function(){if(customElements.get("hui-view"))return!0;await customElements.whenDefined("partial-panel-resolver");const t=document.createElement("partial-panel-resolver");if(t.hass={panels:[{url_path:"tmp",component_name:"lovelace"}]},t._updateRoutes(),await t.routerOptions.routes.tmp.load(),!customElements.get("ha-panel-lovelace"))return!1;const e=document.createElement("ha-panel-lovelace");e.hass=X(),void 0===e.hass&&(await new Promise(t=>{window.addEventListener("connection-status",e=>{console.log(e),t()},{once:!0})}),e.hass=X()),e.panel={config:{mode:null}},e._fetchConfig()}(),window.loadCardHelpers&&n()})});function rt(t,e){const n={type:"error",error:t,origConfig:e},r=document.createElement("hui-error-card");return customElements.whenDefined("hui-error-card").then(()=>{const t=document.createElement("hui-error-card");t.setConfig(n),r.parentElement&&r.parentElement.replaceChild(t,r)}),nt.then(()=>{tt("ll-rebuild",{},r)}),r}function it(t,e){if(!e||"object"!=typeof e||!e.type)return rt(`No ${t} type configured`,e);let n=e.type;if(n=n.startsWith("custom:")?n.substr("custom:".length):`hui-${n}-${t}`,customElements.get(n))return function(t,e){let n=document.createElement(t);try{n.setConfig(JSON.parse(JSON.stringify(e)))}catch(t){n=rt(t,e)}return nt.then(()=>{tt("ll-rebuild",{},n)}),n}(n,e);const r=rt(`Custom element doesn't exist: ${n}.`,e);r.style.display="None";const i=setTimeout(()=>{r.style.display=""},2e3);return customElements.whenDefined(n).then(()=>{clearTimeout(i),tt("ll-rebuild",{},r)}),r}function st(t){return et?et.createCardElement(t):it("card",t)}const at="lovelace-player-device-id";function ot(){if(!localStorage[at]){const t=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);window.fully&&"function"==typeof fully.getDeviceId?localStorage[at]=fully.getDeviceId():localStorage[at]=`${t()}${t()}-${t()}${t()}`}return localStorage[at]}let ut=ot();const ct=new URLSearchParams(window.location.search);var lt;ct.get("deviceID")&&null!==(lt=ct.get("deviceID"))&&("clear"===lt?localStorage.removeItem(at):localStorage[at]=lt,ut=ot());class ft{constructor(t,e,n,r,i){this.template=t,this.variables=e,this.entity_ids=n,this.subscribed=!1,this.callback=r,this.connection=i}subscribe(){try{this._unsubRenderTemplate=function(t,e,n,r=!0){t||(t=X().connection);let i={user:X().user.name,browser:ut,hash:location.hash.substr(1)||" ",...n.variables},s=n.template,a=n.entity_ids;return t.subscribeMessage(t=>{if(r){let n=String(t.result);const r=/_\([^)]*\)/g;n=n.replace(r,t=>X().localize(t.substring(2,t.length-1))||t),e(n)}else e(t.result)},{type:"render_template",template:s,variables:i,entity_ids:a})}(this.connection,t=>{this.templateResult=t,this.callback&&this.callback()},{template:this.template,entity_ids:this.entity_ids,variables:this.variables},!1),this.subscribed=!0}catch(t){this.templateResult=null,console.log("Error",this.template,t),this._unsubRenderTemplate=void 0}}async unsubscribe(){if(this._unsubRenderTemplate){try{(await this._unsubRenderTemplate)(),this._unsubRenderTemplate=void 0}catch(t){if("not_found"!==t.code)throw t}this.subscribed=!1}}}class ht{constructor(t){this.templates={},this.callback=t}registerTemplate(t,e,n,r,i){let s=this.templates[t];s||(s=new ft(t,e,n,r,i),this.templates[t]=s),s.subscribe()}async subscribe(){for(const[t,e]of Object.entries(this.templates))e.subscribed||e.subscribe()}async unsubscribe(){for(const[t,e]of Object.entries(this.templates))e.subscribed&&await e.unsubscribe()}getTemplateResult(t){let e=this.templates[t];return e&&e.templateResult}}const pt=["entities","state_filter","cards"],dt=["entities","glance"];console.info("%c CARD-TEMPLATER \n%c Version 0.1.0 ","color: yellow; font-weight: bold; background: navy","color: white; font-weight: bold; background: black");customElements.define("card-templater",class extends Z{setConfig(t){if(!t||!t.card&&!t.entity_row)throw new Error("Invalid configuration");this._config=t,this.refresh=!0,this.templateHandler=new ht,this.updatePending=!1,t.entity&&(this.entity=t.entity),t.entities?this.entities=this.processConfigEntities(t.entities):t.entity?this.entities=this.processConfigEntities([t.entity]):this.entities=[],this.isEntityRow=!!t.entity_row,t.card?(this._cardConfig=this.getCleanConfig(t.card),this.card=st(this._cardConfig)):(this._cardConfig=this.getCleanConfig(t.entity_row),this.card=function(t){if(et)return et.createRowElement(t);const e=new Set(["call-service","cast","conditional","divider","section","select","weblink"]),n={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime",none:void 0};if(!t)return rt("Invalid configuration given.",t);if("string"==typeof t&&(t={entity:t}),"object"!=typeof t||!t.entity&&!t.type)return rt("Invalid configuration given.",t);const r=t.type||"default";return e.has(r)||r.startsWith("custom:")?it("row",t):it("entity-row",{type:n[t.entity?t.entity.split(".",1)[0]:"none"]||"text",...t})}(this._cardConfig)),this.registeredTemplates=!1,this.templateVariables={user:{id:null,name:null,is_admin:!1,is_owner:!1},page:{...location,path:location.pathname},theme:null},this.yaml=n(27)}createRenderRoot(){return this}render(){return I`
${this.card}
`}static get properties(){return{config:{type:Object},_hass:{type:Object},templateHandler:{type:Object}}}updated(t){super.updated(t)}async connectedCallback(){super.connectedCallback(),this.templateHandler&&await this.templateHandler.subscribe()}async disconnectedCallback(){this.templateHandler&&await this.templateHandler.unsubscribe()}processConfigEntities(t){if(!t)return[];if(!Array.isArray(t))throw new Error("Entities need to be an array");return t.map((t,e)=>{if("object"==typeof t&&!Array.isArray(t)&&t.type)return t;if("string"==typeof t)t={entity:t};else{if("object"!=typeof t||Array.isArray(t))throw new Error(`Invalid entity specified at position ${e}.`);if(!t.entity)throw new Error(`Entity object at position ${e} is missing entity field.`)}return t})}getMockedState(t,e,n){var r={};return Object.assign(r,t),r.attributes={},Object.assign(r.attributes,t.attributes),e&&(r.state=e),n&&Object.assign(r.attributes,n),r}async applyStateTemplates(){if(this._mockHass)for(const t of this.entities)if(t.state_template||t.attributes){let e=this._hass.states[t.entity];if(e){let n=t.state_template?this.templateHandler.getTemplateResult(t.state_template):null,r=t.attributes?await this.getCardConfig(t.attributes):null,i=this.getMockedState(e,n,r);this._mockHass.states[t.entity]=i}}}async registerStateTemplates(t){let e=this.entities&&this.entities.map(t=>t.entity).join()||[];for(const n of this.entities)(n.state_template||n.attributes)&&(n.state_template&&this.templateHandler.registerTemplate(n.state_template,this.templateVariables,e,()=>{this.updatePending=!0},t.connection),n.attributes&&this.registerConfigTemplates(n.attributes,t))}set isPanel(t){this._isPanel=t}updateTemplateVariables(){this.templateVariables.user.id=this._hass.user.id,this.templateVariables.user.name=this._hass.user.name,this.templateVariables.user.is_admin=this._hass.user.is_admin,this.templateVariables.user.is_owner=this._hass.user.is_owner,Object.assign(this.templateVariables.page,location),this.templateVariables.page.path=location.pathname,this.templateVariables.theme=this._hass.selectedTheme?this._hass.selectedTheme:this._hass.themes.default_theme}set hass(t){this.oldStates=null!=this._hass?this._hass.states:{},this._hass=t;let e=this.entities&&this.entities.filter(t=>t.state_template||t.attributes).map(t=>t.entity).join()||[],n=this._mockHass?this._mockHass.states:[];if(this._mockHass={},Object.assign(this._mockHass,t),this._mockHass.states=JSON.parse(JSON.stringify(this._hass.states)),this.updateTemplateVariables(),!this.registeredTemplates){let e=this._config.card||this._config.entity_row;this.registerConfigTemplates(e,t),this.registerStateTemplates(t),this.registeredTemplates=!0}if(this.card)if(this.updatePending)this.updatePending=!1,this.getCardConfig(this._config.card?this._config.card:this._config.entity_row).then(t=>{this.applyStateTemplates().then(()=>{this._cardConfig=t,this.card=st(this._cardConfig),setTimeout(()=>{this.card.isPanel=1==this._isPanel,this.card.hass=this._mockHass,this.requestUpdate()},100)})});else{var r=Object.keys(n).filter(t=>e.includes(t));const t=Object.keys(this._mockHass.states).filter(t=>!r.includes(t)).reduce((t,e)=>(t[e]=this._mockHass.states[e],t),{});this._mockHass.states={...n,...t},this.card.isPanel=1==this._isPanel,this.card.hass=this._mockHass,this.requestUpdate()}}getCleanConfig(t,e=!0){var n=t instanceof Array?[]:{};for(const[e,r]of Object.entries(t)){let t=e,i=r;if(t.endsWith("_template")){if(t=t.replace(/^(.*)_template$/,"$1"),"entity"==t)return null;i=pt.includes(t)?[]:"type"==t?"entities":"-"}else t.endsWith("_template!")&&(t=t.replace(/^(.*_template)!$/,"$1"));if("object"==typeof i){let t=i instanceof Array;if(i=this.getCleanConfig(i,!1),t){let t=[];for(const[e,n]of Object.entries(i))n.string?t[e]=n.string:t[e]=n;i=t}}null!=i&&(n[t]=i)}return e&&(this.isEntityRow?n.entity||(n.entity=this.entity):n.type&&dt.includes(n.type)&&!n.entities&&(n.entities=this.entities)),n}registerConfigTemplates(t,e){let n=this.entities&&this.entities.map(t=>t.entity).join()||[];for(const[r,i]of Object.entries(t)){let t=i;r.endsWith("_template")&&this.templateHandler.registerTemplate(t,this.templateVariables,n,()=>{this.updatePending=!0},e.connection),"object"==typeof t&&this.registerConfigTemplates(t,e)}}async getCardConfig(t,e=!0){var n=t instanceof Array?[]:{};for(const[e,r]of Object.entries(t)){let t=e,i=r;if(t.endsWith("_template")){if(t=t.replace(/^(.*)_template$/,"$1"),this._hass&&i&&(i=this.templateHandler.getTemplateResult(i),"null"!=i&&"None"!=i||(i=null),null!=i&&("string"==typeof i||i instanceof String))){let e=i.toLowerCase();"true"==e||"false"==e?i="true"==e:pt.includes(t)?i=this.yaml?this.yaml.parse(i):null:/^[-]?\d+(\.\d+)?(e-?\d+)?$/.test(i)&&(i=parseFloat(i))}if(!this._hass||null==i){if("entity"==t)return null;i="type"==t?"entities":pt.includes(t)?[]:"-"}}else t.endsWith("_template!")&&(t=t.replace(/^(.*_template)!$/,"$1"));if("object"==typeof i){let t=i instanceof Array;if(i=await this.getCardConfig(i,!1),t){let t=[];for(const[e,n]of Object.entries(i))n.string?t[e]=n.string:t[e]=n;i=t}}null!=i&&(n[t]=i)}return e&&(this.isEntityRow?n.entity||(n.entity=this.entity):n.type&&dt.includes(n.type)&&!n.entities&&(n.entities=this.entities)),n}})}]);