diff --git a/lovelace-card-templater.js b/lovelace-card-templater.js index 0a0af55..4983215 100644 --- a/lovelace-card-templater.js +++ b/lovelace-card-templater.js @@ -1,10 +1,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),a=n(3),o=n.n(a),s=n(5),u=n.n(s),c=n(0),l=n(18),f=n(8),h=function(){function t(e,n,r){o()(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 a=t[e+1],o=t[e+2];if(a!==r||o!==r)return!1;var s=t[e+3];return!s||"\n"===s||"\t"===s||" "===s}},{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 a=t.endOfWhiteSpace(e,i),o=e[a];return o&&"\n"!==o?null:a}},{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,a=!1,o="",s=e[n+1];" "===s||"\t"===s||"\n"===s;){switch(s){case"\n":i=0,n+=1,o+="\n";break;case"\t":i<=r&&(a=!0),n=t.endOfWhiteSpace(e,n+2)-1;break;case" ":i+=1,n+=1}s=e[n+1]}return o||(o=" "),s&&i<=r&&(a=!0),{fold:o,offset:n,error:a}}}]),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;t0?t.join("\n"):null}},{key:"hasComment",get:function(){if(this.context)for(var t=this.context.src,e=0;en);)++i;this.origStart=n+i;for(var a=i;i=r);)++i;return this.origEnd=r+i,a}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return s}));var r=n(0),i={defaultType:r.b.BLOCK_LITERAL,lineWidth:76},a={trueStr:"true",falseStr:"false"},o={nullStr:"null"},s={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,a){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 a=Object.getOwnPropertyDescriptor(i,e);return a.get?a.get.call(n):a.value}},i(e,n,a||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),a=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 o(t,e,n,r){var i=r.indentAtStart,o=r.lineWidth,s=void 0===o?80:o,u=r.minContentWidth,c=void 0===u?20:u,l=r.onFold,f=r.onOverflow;if(!s||s<0)return t;var h=Math.max(1+c,1+s-e.length);if(t.length<=h)return t;var p,d=[],v={},g=s-("number"==typeof i?i:e.length),y=void 0,m=void 0,b=!1,w=-1;for("block"===n&&-1!==(w=a(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=a(t,w)),g=w+h,y=void 0;else{if(" "===p&&m&&" "!==m&&"\n"!==m&&"\t"!==m){var E=t[w+1];E&&" "!==E&&"\n"!==E&&"\t"!==E&&(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 k=t.slice(0,d[0]),O=0;O0;)a+="0"}return a}function l(t,e){var n=e.implicitKey,r=e.indent,i=s.d.doubleQuoted,a=i.jsonEncoding,c=i.minMultiLineLength,l=JSON.stringify(t);if(a)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.lengthe)return!0;if(n-(i=r+1)<=e)return!1}return!0}(c,s.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))),a&&(d+=" #"+a.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=o("".concat(v).concat(c).concat(g),f,"block",s.d.fold);return"".concat(d,"\n").concat(f).concat(y)}function p(t,e,n,a){var c=s.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(s){switch(s){case i.b.BLOCK_FOLDED:case i.b.BLOCK_LITERAL:return h(t,e,n,a);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,a){var s=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,a);if(!v&&!y&&c!==i.b.PLAIN&&-1!==p.indexOf("\n"))return h(t,e,n,a);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:o(b,g,"flow",u(e));return!s||y||-1===w.indexOf("\n")&&-1===s.indexOf("\n")?w:(n&&n(),Object(r.a)(w,g,s))}(t,e,n,a);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),a=n(24);t.exports=function(t,e){return r(t)||i(t,e)||a()}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a}));var r=n(13),i=n(9),a=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:a,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 a(t,e){if("number"!=typeof t||t<0)return null;var n=i(e),r=n.lineStarts,a=n.src;if(!r||!a||t>a.length)return null;for(var o=0;o=1)||t>r.length)return null;for(var o=r[t-1],s=r[t];s&&s>o&&"\n"===a[s-1];)--s;return a.slice(o,s)}function s(t,e){var n=t.start,r=t.end,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:80,a=o(n.line,e);if(!a)return null;var s=n.col;if(a.length>i)if(s<=i-10)a=a.substr(0,i-1)+"…";else{var u=Math.round(i/2);a.length>s+u&&(a=a.substr(0,s+u-1)+"…"),s-=a.length-i,a="…"+a.substr(1-i)}var c=1,l="";r&&(r.line===n.line&&s+(r.col-n.col)<=i+1?c=r.col-n.col:(c=Math.min(a.length+1,i)-s,l="…"));var f=s>1?" ".repeat(s-1):"",h="^".repeat(c);return"".concat(a,"\n").concat(f).concat(h).concat(l)}n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}))},function(t,e,n){var r=n(23),i=n(32),a=n(24);t.exports=function(t){return r(t)||i(t)||a()}},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 a}));var i={};function a(e,n){if(!(t&&t._YAML_SILENCE_DEPRECATION_WARNINGS||i[e])){i[e]=!0;var a="The option '".concat(e,"' will be removed in a future release");r(a+=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),a=n(13),o=n(17),s=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(o.b)(e,n);return t.from(r,"base64")}if("function"==typeof atob){for(var a=atob(Object(o.b)(e,n)),s=new Uint8Array(a.length),u=0;u=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;t0?t.join("\n"):null}},{key:"hasComment",get:function(){if(this.context)for(var t=this.context.src,e=0;en);)++i;this.origStart=n+i;for(var s=i;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 S=t[w+1];S&&" "!==S&&"\n"!==S&&"\t"!==S&&(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 _=t.slice(0,d[0]),E=0;E0;)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.lengthe)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=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 * @license MIT */ -var r=n(34),i=n(35),a=n(36);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().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 Y(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 _(this,e,n);case"ascii":return N(this,e,n);case"latin1":case"binary":return x(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(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 a,o=1,s=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;o=2,s/=2,u/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var l=-1;for(a=n;as&&(n=s-u),a=n;a>=0;a--){for(var f=!0,h=0;hi&&(r=i):r=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function _(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?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&(a=t[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>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(;r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(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 a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(e>>>=0),s=Math.min(a,o),c=this.slice(r,i),l=t.slice(e,n),f=0;fi)&&(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 a=!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 E(this,t,e,n);case"latin1":case"binary":return k(this,t,e,n);case"base64":return O(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",a=e;an)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,r,i,a){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function I(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function P(t,e,n,r,i,a){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,a){return a||P(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,a){return a||P(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),e0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||M(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||M(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||M(t,e,this.length);for(var r=this[t],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=e,i=1,a=this[t+--r];r>0&&(i*=256);)a+=this[t+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},u.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||M(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||M(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||M(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||M(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||M(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||M(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)||C(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+i]=t/a&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||C(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||C(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||C(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):R(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||C(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):R(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);C(this,t,e,n,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&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);C(this,t,e,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||C(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||C(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||C(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):R(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||C(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):R(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=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=0;--i)t[i+e]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;a.push(n)}else if(n<2048){if((e-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;a.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;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Y(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,n,r){for(var i=0;i=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),o=r[0],s=r[1],u=new a(function(t,e,n){return 3*(e+n)/4-n}(0,o,s)),l=0,f=s>0?o-4:o;for(n=0;n>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===s&&(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,a=[],o=0,s=n-i;os?s:o+16383));1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s0)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,a,o=[],s=e;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var a,o,s=8*i-r-1,u=(1<>1,l=-7,f=n?i-1:0,h=n?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+t[e+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+t[e+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=c}return(p?-1:1)*o*Math.pow(2,a-r)},e.write=function(t,e,n,r,i,a){var o,s,u,c=8*a-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-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?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(e*u-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[n+p]=255&o,p+=d,o/=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),a=n(6),o=n.n(a),s=n(4),u=n.n(s),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),o()(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=o()(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,a=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 o=i?e-a:t.indent,s=y.a.endOfWhiteSpace(r,e+1),u=r[s],c="#"===u,l=[],f=null;"\n"===u||"#"===u;){if("#"===u){var h=y.a.endOfLine(r,s+1);l.push(new m.a(s,h)),s=h}else{i=!0,a=s+1,"\n"===r[y.a.endOfWhiteSpace(r,a)]&&0===l.length&&(a=(f=new b).parse({src:r},a)),s=y.a.endOfIndent(r,a)}u=r[s]}if(y.a.nextNodeIsIndented(u,s-(a+o),this.type!==v.b.SEQ_ITEM)?this.node=n({atLineStart:i,inCollection:!1,indent:o,lineStart:a,parent:this},s):u&&a>e+1&&(s=a-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),s=this.node.range.end}else if(c){var d=l[0];this.props.push(d),s=d.end}else s=y.a.endOfLine(r,e+1);var w=this.node?this.node.valueRange.end:s;return this.valueRange=new m.a(e,w),s}},{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),E=function(t){function e(){return i()(this,e),o()(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 k(t){for(var e=t;e instanceof w;)e=e.node;if(!(e instanceof O))return null;for(var n=e.items.length,r=-1,i=n-1;i>=0;--i){var a=e.items[i];if(a.type===v.b.COMMENT){var o=a.context,s=o.indent,u=o.lineStart;if(s>0&&a.range.start>=u+s)break;r=i}else{if(a.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 O=function(t){function e(t){var n;i()(this,e),n=o()(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=i+r||("#"===a||"\n"===a)&&e.nextContentHasIndent(t,n,r))}}]),d()(e,[{key:"parse",value:function(t,n){this.context=t;var r=t.parseNode,i=t.src,a=y.a.startOfLine(i,n),o=this.items[0];o.context.parent=this,this.valueRange=m.a.copy(o.valueRange);for(var s=o.range.start-o.context.lineStart,u=n,c=i[u=y.a.normalizeOffset(i,u)],l=y.a.endOfWhiteSpace(i,a)===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=i.length){c=null;break}}if(a=u+1,u=y.a.endOfIndent(i,a),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!==a+s&&(l||":"!==c)){a>n&&(u=a);break}if(o.type===v.b.SEQ_ITEM!=("-"===c)){var w=!0;if("-"===c){var O=i[u+1];w=!O||"\n"===O||"\t"===O||" "===O}if(w){a>n&&(u=a);break}}var S=r({atLineStart:l,inCollection:!0,indent:s,lineStart:a,parent:this},u);if(!S)return u;if(this.items.push(S),this.valueRange.end=S.valueRange.end,c=i[u=y.a.normalizeOffset(i,S.range.end)],l=!1,f=S.includesTrailingLines,c){for(var A=u-1,_=i[A];" "===_||"\t"===_;)_=i[--A];"\n"===_&&(a=A+1,l=!0)}var N=k(S);N&&Array.prototype.push.apply(this.items,N)}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]),a=1;a0}}]),e}(y.a),S=function(t){function e(){var t;return i()(this,e),(t=o()(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),A=function(t){function e(){var t;return i()(this,e),(t=o()(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,a=t;!y.a.atDocumentBoundary(n,a,v.a.DIRECTIVES_END);)switch(n[a=e.startCommentOrEndBlankLine(n,a)]){case"\n":if(r){var o=new b;(a=o.parse({src:n},a))0&&(this.contents=this.directives,this.directives=[]),a}return n[a]?(this.directivesEndMarker=new m.a(a,a+3),a+3):(i?this.error=new g.c(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),a)}},{key:"parseContents",value:function(t){var n=this.context,r=n.parseNode,i=n.src;this.contents||(this.contents=[]);for(var a=t;"-"===i[a-1];)a-=1;var o=y.a.endOfWhiteSpace(i,t),s=a===t;for(this.valueRange=new m.a(o);!y.a.atDocumentBoundary(i,o,v.a.DOCUMENT_END);){switch(i[o]){case"\n":if(s){var u=new b;(o=u.parse({src:i},o))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),_=n(10),N=n.n(_),x=function(t){function e(){return i()(this,e),o()(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",L="KEEP",M="STRIP",C=function(t){function e(t,n){var r;return i()(this,e),(r=o()(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=M;break;case"+":this.chomping=L;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,a=t,o=this.blockIndent?n+this.blockIndent-1:n,s=1,u=r[i];"\n"===u&&(i+=1,!y.a.atDocumentBoundary(r,i));u=r[i]){var c=y.a.endOfBlockIndent(r,o,i);if(null===c)break;if(!this.blockIndent){var l=c-(i+n);if("\n"!==r[c]){if(ls&&(s=l)}i="\n"===r[c]?c:a=y.a.endOfLine(r,c)}return this.chomping!==L&&(i=r[a]?a+1:a),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===L}},{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,a=r.src;if(this.valueRange.isEmpty())return"";for(var o=null,s=a[n-1];"\n"===s||"\t"===s||" "===s;){if((n-=1)<=e){if(this.chomping===L)break;return""}"\n"===s&&(o=n),s=a[n-1]}var u=n+1;o&&(this.chomping===L?(u=o,n=this.valueRange.end):n=o);for(var c=i+this.blockIndent,l=this.type===v.b.BLOCK_FOLDED,f=!0,h="",p="",d=!1,g=e;g0&&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,a=t.lineStart,o=r[e];this.items=[{char:o,offset:e}];var s=y.a.endOfWhiteSpace(r,e+1);for(o=r[s];o&&"]"!==o&&"}"!==o;){switch(o){case"\n":if(a=s+1,"\n"===r[y.a.endOfWhiteSpace(r,a)]){var u=new b;a=u.parse({src:r},a),this.items.push(u)}if((s=y.a.endOfIndent(r,a))<=a+i&&(o=r[s],se.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})),a="",o=n.start;return i.forEach((function(e){var n=t.slice(o,e.range.start);o=e.range.end,"\n"===(a+=n+String(e))[a.length-1]&&"\n"!==t[o-1]&&"\n"===t[o]&&(o+=1)})),a+=t.slice(o,n.end),y.a.addStringTerminator(t,n.end,a)}}]),e}(y.a),R=function(t){function e(){return i()(this,e),o()(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,a=n.src,o=t,s=t,u=a[o];"\n"===u&&!y.a.atDocumentBoundary(a,o+1);u=a[o]){var c=y.a.endOfBlockIndent(a,r,o+1);if(null===c||"#"===a[c])break;o="\n"===a[c]?c:s=e.endOfLine(a,c,i)}return this.valueRange.isEmpty()&&(this.valueRange.start=t),this.valueRange.end=s,s}},{key:"parse",value:function(t,n){this.context=t;var r=t.inFlow,i=t.src,a=n,o=i[a];return o&&"#"!==o&&"\n"!==o&&(a=e.endOfLine(i,n,r)),this.valueRange=new m.a(n,a),a=y.a.endOfWhiteSpace(i,a),a=this.parseComment(a),this.hasComment&&!this.valueRange.isEmpty()||(a=this.parseBlockValue(a)),a}},{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];ec?r.slice(c,o+1):s)}else a+=s}return a}}],[{key:"endOfLine",value:function(t,e,n){for(var r=t[e],i=e;r&&"\n"!==r&&(!n||"["!==r&&"]"!==r&&"{"!==r&&"}"!==r&&","!==r);){var a=t[i+1];if(":"===r&&(!a||"\n"===a||"\t"===a||" "===a||n&&","===a))break;if((" "===r||"\t"===r)&&"#"===a)break;i+=1,r=a}return i}}]),e}(y.a),P=function(t){function e(){return i()(this,e),o()(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),a=i.length===e&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;return isNaN(a)?(n.push(new g.d(this,"Invalid escape sequence ".concat(r.substr(t-2,e+2)))),r.substr(t-2,e+2)):String.fromCodePoint(a)}},{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,a=i.indent,o=i.src;'"'!==o[r-1]&&t.push(new g.d(this,'Missing closing "quote'));for(var s="",u=n+1;uf?o.slice(f,u+1):c)}else s+=c}return t.length>0?{errors:t,str:s}:s}}],[{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),o()(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,a=i.indent,o=i.src;"'"!==o[r-1]&&t.push(new g.d(this,"Missing closing 'quote"));for(var s="",u=n+1;uf?o.slice(f,u+1):c)}else s+=c}return t.length>0?{errors:t,str:s}:s}}],[{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 x(t,e);case v.b.BLOCK_FOLDED:case v.b.BLOCK_LITERAL:return new C(t,e);case v.b.FLOW_MAP:case v.b.FLOW_SEQ:return new I(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 R(t,e);case v.b.QUOTE_DOUBLE:return new P(t,e);case v.b.QUOTE_SINGLE:return new B(t,e);default:return null}}var D=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]:{},a=r.atLineStart,o=r.inCollection,s=r.inFlow,u=r.indent,c=r.lineStart,l=r.parent;i()(this,t),N()(this,"parseNode",(function(n,r){if(y.a.atDocumentBoundary(e.src,r))return null;var i=new t(e,n),a=i.parseProps(r),o=a.props,s=a.type,u=a.valueStart,c=j(s,o),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 O(c);return l=f.parse(new t(i),l),f.range=new m.a(r,l),f}return c})),this.atLineStart=null!=a?a:n.atLineStart||!1,this.inCollection=null!=o?o:n.inCollection||!1,this.inFlow=null!=s?s: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,a=[],o=!1,s=i[e=y.a.endOfWhiteSpace(i,e)];s===v.a.ANCHOR||s===v.a.COMMENT||s===v.a.TAG||"\n"===s;){if("\n"===s){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,o=!1,e=c}else if(s===v.a.COMMENT){var h=y.a.endOfLine(i,e+1);a.push(new m.a(e,h)),e=h}else{var p=y.a.endOfIdentifier(i,e+1);s===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)),a.push(new m.a(e,p)),o=!0,e=y.a.endOfWhiteSpace(i,p)}s=i[e]}return o&&":"===s&&y.a.atBlank(i,e+1,!0)&&(e-=1),{props:a,type:t.parseType(i,e,n),valueStart:e}}}]),t}();function U(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 A,a=new D({src:t});r=i.parse(a,r),n.push(i)}while(r1&&void 0!==arguments[1]?arguments[1]:null;return i()(this,e),(n=o()(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=$(this.key,"",t);if(e instanceof Map){var r=$(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 G&&n&&n.doc?t.toString({anchors:{},doc:n.doc,indent:"",inFlow:!0,inStringifyKey:!0}):JSON.stringify(e)}(this.key,n,t);e[i]=$(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,a=this.value,o=i instanceof G&&i.comment;if(r){if(o)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 s=!r&&(!i||o||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:!s,indent:l+" "});var f=!1,h=c.schema.stringify(i,t,(function(){return o=null}),(function(){return f=!0}));if(h=Object(W.b)(h,t.indent,o),t.allNullValues&&!r)return this.comment?(h=Object(W.b)(h,t.indent,this.comment),e&&e()):f&&!o&&n&&n(),t.inFlow?h:"? ".concat(h);h=s?"? ".concat(h,"\n").concat(l,":"):"".concat(h,":"),this.comment&&(h=Object(W.b)(h,t.indent,this.comment),e&&e());var p="",d=null;if(a instanceof G){if(a.spaceBefore&&(p="\n"),a.commentBefore){var g=a.commentBefore.replace(/^/gm,"".concat(t.indent,"#"));p+="\n".concat(g)}d=a.comment}else a&&"object"===H()(a)&&(a=c.schema.createNode(a,!0));t.implicitKey=!1,!s&&!this.comment&&a instanceof z&&(t.indentAtStart=h.length+1),f=!1;var y=c.schema.stringify(a,t,(function(){return d=null}),(function(){return f=!0})),m=" ";if(p||this.comment)m="".concat(p,"\n").concat(t.indent);else if(!s&&a instanceof et){("["===y[0]||"{"===y[0])&&!y.includes("\n")||(m="\n".concat(t.indent))}return f&&!d&&n&&n(),Object(W.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 z(null)),this.key.commentBefore=t}}]),e}(G);function X(t,e,n){for(var r=n,i=e.length-1;i>=0;--i){var a=e[i],o=Number.isInteger(a)&&a>=0?[]:{};o[a]=r,r=o}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=o()(this,u()(e).call(this)),N()(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],a=r.slice(1),o=this.get(i,!0);if(o instanceof e)o.addIn(a,n);else{if(void 0!==o||!this.schema)throw new Error("Expected YAML collection at ".concat(i,". Remaining path: ").concat(a));this.set(i,X(this.schema,a,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 a=this.get(r,!0);if(a instanceof e)return a.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],a=r.slice(1),o=this.get(i,!0);return 0===a.length?!n&&o instanceof z?o.value:o:o instanceof e?o.getIn(a,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 z&&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 a=this.get(r,!0);return a instanceof e&&a.hasIn(i)}},{key:"setIn",value:function(t,n){var r=Q()(t),i=r[0],a=r.slice(1);if(0===a.length)this.set(i,n);else{var o=this.get(i,!0);if(o instanceof e)o.setIn(a,n);else{if(void 0!==o||!this.schema)throw new Error("Expected YAML collection at ".concat(i,". Remaining path: ").concat(a));this.set(i,X(this.schema,a,n))}}}},{key:"toJSON",value:function(){return null}},{key:"toString",value:function(t,n,r,i){var a=this,o=n.blockItem,s=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 o=f.schema.stringify(n,t,(function(){return i=null}),(function(){return g=!0}));return p&&!y&&o.includes("\n")&&(y=!0),p&&re.maxFlowStringSingleLineLength){v=b;var k=!0,O=!1,S=void 0;try{for(var A,_=E[Symbol.iterator]();!(k=(A=_.next()).done);k=!0){var N=A.value;v+=N?"\n ".concat(h).concat(N):"\n"}}catch(t){O=!0,S=t}finally{try{k||null==_.return||_.return()}finally{if(O)throw S}}v+="\n".concat(h).concat(w)}else v="".concat(b," ").concat(E.join(" ")," ").concat(w)}else{var x=m.map(o);v=x.shift();var T=!0,L=!1,M=void 0;try{for(var C,I=x[Symbol.iterator]();!(T=(C=I.next()).done);T=!0){var R=C.value;v+=R?"\n".concat(h).concat(R):"\n"}}catch(t){L=!0,M=t}finally{try{T||null==I.return||I.return()}finally{if(L)throw M}}}return this.comment?(v+="\n"+this.comment.replace(/^/gm,"".concat(h,"#")),r&&r()):g&&i&&i(),v}}]),e}(G);N()(et,"maxFlowStringSingleLineLength",60);var nt=function(t){function e(t){var n;return i()(this,e),(n=o()(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,a=e.doc,o=e.implicitKey,s=e.inStringifyKey,u=Object.keys(i).find((function(t){return i[t]===r}));if(!u&&s&&(u=a.anchors.getName(r)||a.anchors.newName()),u)return"*".concat(u).concat(o?" ":"");var c=a.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 $(this.source,t,e);var r=e.anchors,i=e.maxAliasCount,a=r.find((function(t){return t.node===n.source}));if(!a||void 0===a.res){var o="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new g.b(this.cstNode,o):new ReferenceError(o)}if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.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,a=!0,o=!1,s=void 0;try{for(var u,c=e.items[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var l=t(u.value,n);l>i&&(i=l)}}catch(t){o=!0,s=t}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}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)),a.count*a.aliasCount>i)){var s="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new g.b(this.cstNode,s):new ReferenceError(s)}return a.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}(G);function rt(t,e){var n=e instanceof z?e.value:e,r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.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,a=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}}N()(nt,"default",!0);var it=function(t){function e(){return i()(this,e),o()(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 z?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,a=!1,o=void 0;try{for(var s,u=this.items[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){s.value.addToJSMap(e,r)}}catch(t){a=!0,o=t}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return r}},{key:"toString",value:function(t,n,r){if(!t)return JSON.stringify(this);var i=!0,a=!1,o=void 0;try{for(var s,c=this.items[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var l=s.value;if(!(l instanceof Z))throw new Error("Map items must all be pairs; found ".concat(JSON.stringify(l)," instead"))}}catch(t){a=!0,o=t}finally{try{i||null==c.return||c.return()}finally{if(a)throw o}}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 at(t){var e=t instanceof z?t.value:t;return e&&"string"==typeof e&&(e=Number(e)),Number.isInteger(e)&&e>=0?e:null}var ot=function(t){function e(){return i()(this,e),o()(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=at(t);return"number"==typeof e&&this.items.splice(e,1).length>0}},{key:"get",value:function(t,e){var n=at(t);if("number"==typeof n){var r=this.items[n];return!e&&r instanceof z?r.value:r}}},{key:"has",value:function(t){var e=at(t);return"number"==typeof e&&e1)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),N()(this,"map",{}),this.prefix=e}return d()(t,null,[{key:"validAnchorNode",value:function(t){return t instanceof z||t instanceof ot||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 st,n=arguments.length,r=new Array(n),i=0;i=0;--a){var o=e.items[a];if(!o||o.type!==v.b.COMMENT){i=o;break}}if(i&&i.char!==n){var s,u="Expected ".concat(r," to end with ").concat(n);"number"==typeof i.offset?(s=new g.c(e,u)).offset=i.offset+1:(s=new g.c(i,u),i.range&&i.range.end&&(s.offset=i.range.end-i.range.start)),t.push(s)}}function pt(t,e,n,r,i){if(r&&"number"==typeof i){var a=e.items[n],o=a&&a.range&&a.range.start;if(!o)for(var s=n-1;s>=0;--s){var u=e.items[s];if(u&&u.range){o=u.range.end+2*(n-s);break}}if(o>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 a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value,u=s.afterKey,c=s.before,l=s.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==o.return||o.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,a=null,o=!1,s="{",u=0;u0){(u=new R(v.b.PLAIN,[])).context={parent:s,src:s.context.src};var c=s.range.start+1;if(u.range={start:c,end:c},u.valueRange={start:c,end:c},"number"==typeof s.range.origStart){var l=s.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(s,f),r.push(f),pt(t.errors,e,o,i,a),i=void 0,a=null;break;default:void 0!==i&&r.push(new Z(i)),i=t.resolveNode(s),a=s.range.start,s.error&&t.errors.push(s.error);t:for(var h=o+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(s,"Implicit map keys need to be followed by map values"));break t}}if(s.valueRangeContainsNewline){t.errors.push(new g.c(s,"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,a=r.items,o=new it;o.items=a,dt(o,i);for(var s=!1,u=0;ur.valueRange.start)return!1;if(i[o]!==v.a.COMMENT)return!1;for(var s=n;s1){throw new g.c(e,"Each pair must have its own sequence indicator")}var a=i.items[0]||new Z;i.commentBefore&&(a.commentBefore=a.commentBefore?"".concat(i.commentBefore,"\n").concat(a.commentBefore):i.commentBefore),i.comment&&(a.comment=a.comment?"".concat(i.comment,"\n").concat(a.comment):i.comment),i=a}n.items[r]=i instanceof Z?i:new Z(i)}}return n}function Bt(t,e,n){var r=new ot(t);r.tag="tag:yaml.org,2002:pairs";var i=!0,a=!1,o=void 0;try{for(var s,u=e[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.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){a=!0,o=t}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return r}var jt={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Pt,createNode:Bt},Dt=function(t){function e(){var t;return i()(this,e),t=o()(this,u()(e).call(this)),N()(J()(t),"add",it.prototype.add.bind(J()(t))),N()(J()(t),"delete",it.prototype.delete.bind(J()(t))),N()(J()(t),"get",it.prototype.get.bind(J()(t))),N()(J()(t),"has",it.prototype.has.bind(J()(t))),N()(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,a=void 0;try{for(var o,s=this.items[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value,c=void 0,l=void 0;if(u instanceof Z?(c=$(u.key,"",e),l=$(u.value,c,e)):c=$(u,"",e),n.has(c))throw new Error("Ordered maps must not include duplicate keys");n.set(c,l)}}catch(t){i=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}}]),e}(ot);N()(Dt,"tag","tag:yaml.org,2002:omap");var Ut={identify:function(t){return t instanceof Map},nodeClass:Dt,default:!1,tag:"tag:yaml.org,2002:omap",resolve:function(t,e){var n=Pt(t,e),r=[],i=!0,a=!1,o=void 0;try{for(var s,u=n.items[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value.key;if(c instanceof z){if(r.includes(c.value)){throw new g.c(e,"Ordered maps must not include duplicate keys")}r.push(c.value)}}}catch(t){a=!0,o=t}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return Object.assign(new Dt,n)},createNode:function(t,e,n){var r=Bt(t,e,n),i=new Dt;return i.items=r.items,i}},Ft=function(t){function e(){var t;return i()(this,e),(t=o()(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 z?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);N()(Ft,"tag","tag:yaml.org,2002:set");var Yt={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,a=!1,o=void 0;try{for(var s,u=e[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;r.items.push(t.createPair(c,null,n))}}catch(t){a=!0,o=t}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return r}},Wt=function(t,e){var n=e.split(":").reduce((function(t,e){return 60*t+Number(e)}),0);return"-"===t?-n:n},$t=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*$/,"")},Kt={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 Wt(e,n.replace(/_/g,""))},stringify:$t},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 Wt(e,n.replace(/_/g,""))},stringify:$t},qt={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,a,o,s,u){s&&(s=(s+"00").substr(1,3));var c=Date.UTC(e,n-1,r,i||0,a||0,o||0,s||0);if(u&&"Z"!==u){var l=Wt(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?kt.b.trueStr:kt.b.falseStr},Vt=Et.concat([{identify:function(t){return null==t},createNode:function(t,e,n){return n.wrapScalars?new z(null):null},default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:function(){return null},options:kt.c,stringify:function(){return kt.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:kt.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:kt.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 z(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}],Rt.a,Ut,jt,Yt,Kt,Qt,qt),Ht={core:Mt,failsafe:Et,json:It,yaml11:Vt},Gt={binary:Rt.a,bool:St,float:Lt,floatExp:Tt,floatNaN:xt,floatTime:Qt,int:_t,intHex:Nt,intOct:At,intTime:Kt,map:yt,null:Ot,omap:Ut,pairs:jt,seq:bt,set:Yt,timestamp:qt},zt=function(){function t(e){var n=e.customTags,r=e.merge,a=e.schema,o=e.sortMapEntries,s=e.tags;if(i()(this,t),this.merge=!!r,this.name=a,this.sortMapEntries=!0===o?function(t,e){return t.keye.key?1:0}:o||null,this.tags=Ht[a.replace(/\W/g,"")],!this.tags){var u=Object.keys(Ht).map((function(t){return JSON.stringify(t)})).join(", ");throw new Error('Unknown schema "'.concat(a,'"; use one of ').concat(u))}if(!n&&s&&(n=s,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;v0&&(e.resolved=this.resolveScalar(o,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 a,o=(a=n.type)===v.b.FLOW_MAP||a===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(o){e.warnings.push(new g.e(n,"The tag ".concat(r," is unavailable, falling back to ").concat(o)));var s=this.resolveNode(e,n,o);return s.tag=r,s}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 z){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 a=r&&r.constructor?r.constructor.name:H()(r);throw new Error("Tag not resolved for ".concat(a," value"))}return n}},{key:"stringifyProps",value:function(t,e,n){var r=n.anchors,i=n.doc,a=[],o=i.anchors.getName(t);return o&&(r[o]=t,a.push("&".concat(o))),t.tag?a.push(i.stringifyTag(t.tag)):e.default||a.push(i.stringifyTag(e.tag)),a.join(" ")}},{key:"stringify",value:function(t,e,n,r){var i;if(!(t instanceof G)){var a={aliasNodes:[],onTagObj:function(t){return i=t},prevObjects:new Map};t=this.createNode(t,!0,null,a);var o=e.doc.anchors,s=!0,u=!1,c=void 0;try{for(var l,f=a.aliasNodes[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;h.source=h.source.node;var p=o.getName(h.source);p||(p=o.newName(),o.map[p]=h.source)}}catch(t){u=!0,c=t}finally{try{s||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}();N()(zt,"defaultPrefix","tag:yaml.org,2002:"),N()(zt,"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 z?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 zt(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,a=void 0===i?[]:i,o=t.directivesEndMarker,s=t.error,u=t.valueRange;if(s&&(s.source||(s.source=this),this.errors.push(s)),this.parseDirectives(r,e),o&&(this.directivesEndMarker=!0),this.range=u?[u.start,u.end]:null,this.setSchema(),this.anchors._cstAliases=[],this.parseContents(a),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 E=b.value;E instanceof g.a&&E.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,a=t.name;switch(a){case"TAG":n.resolveTagDirective(t),i=!0;break;case"YAML":case"YAML:1.0":n.resolveYamlDirective(t),i=!0;break;default:if(a){var o="YAML only supports %TAG and %YAML directives, and not %".concat(a);n.warnings.push(new g.e(t,o))}}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 a=e.resolveNode(t);i&&(a.spaceBefore=!0,i=!1),r.push(a)}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 a=n.before.join("\n")||null;if(a){var o=this.contents instanceof et&&this.contents.items[0]?this.contents.items[0]:this.contents;o.commentBefore=o.commentBefore?"".concat(a,"\n").concat(o.commentBefore):a}}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=Y()(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=Y()(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,a=e.suffix,o=e.verbatim;if(o){if("!"!==o&&"!!"!==o)return o;var s="Verbatim tags aren't resolved, so ".concat(o," is invalid.");this.errors.push(new g.c(t,s))}else if("!"!==i||a){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(a){if("!"===i&&"1.0"===(this.version||this.options.version)){if("^"===a[0])return a;if(/[:/]/.test(a)){var l=a.match(/^([a-z0-9-]+)\/(.*)/i);return l?"tag:".concat(l[1],".yaml.org,2002:").concat(l[2]):"tag:".concat(a)}}return u.prefix+decodeURIComponent(a)}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 zt.defaultTags.STR;case v.b.FLOW_MAP:case v.b.MAP:return zt.defaultTags.MAP;case v.b.FLOW_SEQ:case v.b.SEQ:return zt.defaultTags.SEQ;case v.b.PLAIN:return r?zt.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,a=!1,o=!1,s={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,E=t.valueRange;E&&(y>E.start||w&&y>w.start)?s.after.push(b):s.before.push(b);break;case v.a.ANCHOR:if(a){r.push(new g.c(t,"A node can have at most one anchor"))}a=!0;break;case v.a.TAG:if(o){r.push(new g.c(t,"A node can have at most one tag"))}o=!0}}}catch(t){l=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(l)throw f}}if(a){var k=t.anchor,O=n.getNode(k);O&&(n.map[n.newName(k)]=O),n.map[k]=t}if(t.type===v.b.ALIAS){if(a||o){r.push(new g.c(t,"An alias node must not specify any properties"))}var S=t.rawValue,A=n.getNode(S);if(!A){var _="Aliased anchor not found: ".concat(S);return r.push(new g.b(t,_)),null}e=new nt(A),n._cstAliases.push(e)}else{var N=this.resolveTagName(t);if(N)e=i.resolveNodeWithFallback(this,t,N);else{if(t.type!==v.b.PLAIN){var x="Failed to resolve ".concat(t.type," node here");return r.push(new g.d(t,x)),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=s.before.join("\n");T&&(e.commentBefore=e.commentBefore?"".concat(e.commentBefore,"\n").concat(T):T);var L=s.after.join("\n");L&&(e.comment=e.comment?"".concat(e.comment,"\n").concat(L):L)}return t.resolved=e}},{key:"listNonDefaultTags",value:function(){return ct(this.contents).filter((function(t){return 0!==t.indexOf(zt.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 a=t.substr(r.prefix.length).replace(/[!,[\]{}]/g,(function(t){return{"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"}[t]}));return r.handle+a}},{key:"toJSON",value:function(t){var e=this,n=this.options,r=n.keepBlobsInJSON,i=n.mapAsMap,a=n.maxAliasCount,o=r&&("string"!=typeof t||!(this.contents instanceof z)),s={doc:this,keep:o,mapAsMap:o&&!!i,maxAliasCount:a},u=Object.keys(this.anchors.map);return u.length>0&&(s.anchors=u.map((function(t){return{alias:[],aliasCount:0,count:1,node:e.anchors.map[t]}}))),$(this.contents,t,s)}},{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,a=n.prefix;r.some((function(t){return 0===t.indexOf(a)}))&&(t.push("%TAG ".concat(i," ").concat(a)),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:""},a=!1,o=null;if(this.contents){this.contents instanceof G&&(this.contents.spaceBefore&&(e||this.directivesEndMarker)&&t.push(""),this.contents.commentBefore&&t.push(this.contents.commentBefore.replace(/^/gm,"#")),i.forceBlockIndent=!!this.comment,o=this.contents.comment);var s=o?null:function(){return a=!0},u=this.schema.stringify(this.contents,i,(function(){return o=null}),s);t.push(Object(W.b)(u,"",o))}else void 0!==this.contents&&t.push(this.schema.stringify(this.contents,i));return this.comment&&(a&&!o||""===t[t.length-1]||t.push(""),t.push(this.comment.replace(/^/gm,"#"))),t.join("\n")+"\n"}}]),t}();N()(Zt,"defaults",{"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:zt.defaultPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:zt.defaultPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:zt.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),o()(this,u()(e).call(this,Object.assign({},Xt,t)))}return l()(e,t),e}(Zt);function ee(t,e){var n=U(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 zt(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,a=!1,o=void 0;try{for(var s,u=U(t)[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value,l=new te(e);l.parse(c,n),r.push(l),n=l}}catch(t){a=!0,o=t}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return r},parseCST:U,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);const r=customElements.get("home-assistant-main")?Object.getPrototypeOf(customElements.get("home-assistant-main")):Object.getPrototypeOf(customElements.get("hui-view")),i=r.prototype.html;r.prototype.css;function a(){return document.querySelector("hc-main")?document.querySelector("hc-main").hass:document.querySelector("home-assistant")?document.querySelector("home-assistant").hass:void 0}function o(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)}}let s=window.cardHelpers;const u=new Promise(async(t,e)=>{s&&t();const n=async()=>{s=await window.loadCardHelpers(),window.cardHelpers=s,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=a(),void 0===e.hass&&(await new Promise(t=>{window.addEventListener("connection-status",e=>{console.log(e),t()},{once:!0})}),e.hass=a()),e.panel={config:{mode:null}},e._fetchConfig()}(),window.loadCardHelpers&&n()})});function c(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)}),u.then(()=>{o("ll-rebuild",{},r)}),r}function l(t,e){if(!e||"object"!=typeof e||!e.type)return c(`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=c(t,e)}return u.then(()=>{o("ll-rebuild",{},n)}),n}(n,e);const r=c(`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),o("ll-rebuild",{},r)}),r}function f(t){return s?s.createCardElement(t):l("card",t)}const h="lovelace-player-device-id";function p(){if(!localStorage[h]){const t=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);window.fully&&"function"==typeof fully.getDeviceId?localStorage[h]=fully.getDeviceId():localStorage[h]=`${t()}${t()}-${t()}${t()}`}return localStorage[h]}let d=p();const v=new URLSearchParams(window.location.search);var g;v.get("deviceID")&&null!==(g=v.get("deviceID"))&&("clear"===g?localStorage.removeItem(h):localStorage[h]=g,d=p());const y=["entities","state_filter"],m=["entities","glance"];console.info("%c CARD-TEMPLATER \n%c Version 0.0.9 ","color: yellow; font-weight: bold; background: navy","color: white; font-weight: bold; background: black");customElements.define("card-templater",class extends r{setConfig(t){if(!t||!t.card&&!t.entity_row)throw new Error("Invalid configuration");this._config=t,this.refresh=!0,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.getCardConfigWithoutTemplates(t.card),this.card=f(this._cardConfig)):(this._cardConfig=this.getCardConfigWithoutTemplates(t.entity_row),this.card=function(t){if(s)return s.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 c("Invalid configuration given.",t);if("string"==typeof t&&(t={entity:t}),"object"!=typeof t||!t.entity&&!t.type)return c("Invalid configuration given.",t);const r=t.type||"default";return e.has(r)||r.startsWith("custom:")?l("row",t):l("entity-row",{type:n[t.entity?t.entity.split(".",1)[0]:"none"]||"text",...t})}(this._cardConfig)),this.yaml=n(27)}createRenderRoot(){return this}render(){return i` +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()=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 W(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;so&&(n=o-u),s=n;s>=0;s--){for(var f=!0,h=0;hi&&(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>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;i239?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(;r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(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;fi)&&(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 S(this,t,e,n);case"latin1":case"binary":return _(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;ir)&&(n=r);for(var i="",s=e;sn)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||et.length)throw new RangeError("Index out of range")}function M(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-n,4);i>>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),e0&&(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=(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=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):M(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):M(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):R(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):R(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>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):M(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):M(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):R(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):R(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=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=0;--i)t[i+e]=this[i+n];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&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 W(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 V(t,e,n,r){for(var i=0;i=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>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;ao?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;o0)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>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<>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<>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<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),S=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 _(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=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=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=_(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;s0}}]),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))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))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(lo&&(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;g0&&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],oe.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),R=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];ec?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;uf?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;uf?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 M(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 R(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(r1&&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=Y(this.key,"",t);if(e instanceof Map){var r=Y(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]=Y(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(V.b)(h,t.indent,a),t.allNullValues&&!r)return this.comment?(h=Object(V.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(V.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(V.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&&re.maxFlowStringSingleLineLength){v=b;var _=!0,E=!1,k=void 0;try{for(var O,A=S[Symbol.iterator]();!(_=(O=A.next()).done);_=!0){var x=O.value;v+=x?"\n ".concat(h).concat(x):"\n"}}catch(t){E=!0,k=t}finally{try{_||null==A.return||A.return()}finally{if(E)throw k}}v+="\n".concat(h).concat(w)}else v="".concat(b," ").concat(S.join(" ")," ").concat(w)}else{var N=m.map(a);v=N.shift();var T=!0,C=!1,P=void 0;try{for(var L,M=N[Symbol.iterator]();!(T=(L=M.next()).done);T=!0){var R=L.value;v+=R?"\n".concat(h).concat(R):"\n"}}catch(t){C=!0,P=t}finally{try{T||null==M.return||M.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 Y(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&&e1)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=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;u0){(u=new R(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;ur.valueRange.start)return!1;if(i[a]!==v.a.COMMENT)return!1;for(var o=n;o1){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=Y(u.key,"",e),l=Y(u.value,c,e)):c=Y(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 Wt={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}},Vt=function(t,e){var n=e.split(":").reduce((function(t,e){return 60*t+Number(e)}),0);return"-"===t?-n:n},Yt=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 Vt(e,n.replace(/_/g,""))},stringify:Yt},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 Vt(e,n.replace(/_/g,""))},stringify:Yt},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=Vt(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?_t.b.trueStr:_t.b.falseStr},Qt=St.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:_t.c,stringify:function(){return _t.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:_t.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:_t.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}],Rt.a,Dt,jt,Wt,$t,qt,Kt),Ht={core:Pt,failsafe:St,json:Mt,yaml11:Qt},zt={binary:Rt.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:Wt,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.keye.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;v0&&(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 S=b.value;S instanceof g.a&&S.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=W()(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=W()(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,S=t.valueRange;S&&(y>S.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 _=t.anchor,E=n.getNode(_);E&&(n.map[n.newName(_)]=E),n.map[_]=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]}}))),Y(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(V.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(;o0;){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{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-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),S=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class _{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;tthis.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 _(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=M.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},M.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 M=new Map,R=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}--${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/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),F=!1);const W=t=>e=>{const n=D(e.type,t);let r=M.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},M.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},V=["html","svg"],Y=new Set,$=(t,e,n)=>{Y.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{V.forEach(e=>{const n=M.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(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=R.has(e),s=F&&11===e.nodeType&&!!e.host,o=s&&!Y.has(r),u=o?document.createDocumentFragment():e;if(((t,e,n)=>{let r=R.get(e);void 0===r&&(a(e,e.firstChild),R.set(e,r=new k(Object.assign({templateFactory:L},n))),r.appendInto(e)),r.setValue(t),r.commit()})(t,u,Object.assign({templateFactory:W(r)},n)),o){const t=R.get(u);R.delete(u);const n=t.value instanceof y?t.value.template:void 0;$(r,u,n),a(e,e.firstChild),e.appendChild(u),R.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());const ft=["entities","state_filter"],ht=["entities","glance"];console.info("%c CARD-TEMPLATER \n%c Version 0.0.9 ","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,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.getCardConfigWithoutTemplates(t.card),this.card=st(this._cardConfig)):(this._cardConfig=this.getCardConfigWithoutTemplates(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.yaml=n(27)}createRenderRoot(){return this}render(){return I` ${this.card} - `}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})}haveEntitiesChanged(){for(const t of this.entities){let e=this.oldStates[t.entity];null==e&&(e={state:"undefined"});let n=this._hass.states[t.entity];if(null==n&&(n={state:"undefined"}),n!=e)return!0}return!1}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?await this.applyTemplate(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}}}set isPanel(t){this._isPanel=t}set hass(t){this.oldStates=null!=this._hass?this._hass.states:{},this._hass=t;let e=this._mockHass?this._mockHass.states:[];if(this._mockHass={},Object.assign(this._mockHass,t),this._mockHass.states=JSON.parse(JSON.stringify(this._hass.states)),this._templateVariables={user:{name:this._hass.user.name,is_admin:this._hass.user.is_admin,is_owner:this._hass.user.is_owner},page:{...location,path:location.pathname},theme:this._hass.selectedTheme?this._hass.selectedTheme:this._hass.themes.default_theme},this.card)if(this.haveEntitiesChanged())this.getCardConfig(this._config.card?this._config.card:this._config.entity_row).then(t=>{this.applyStateTemplates().then(()=>{this._cardConfig=t,this.card=f(this._cardConfig),setTimeout(()=>{this.card.isPanel=1==this._isPanel,this.card.hass=this._mockHass,this.requestUpdate()},100)})});else{var n=Object.keys(e);const t=Object.keys(this._mockHass.states).filter(t=>!n.includes(t)).reduce((t,e)=>(t[e]=this._mockHass.states[e],t),{});this._mockHass.states={...e,...t},this.card.isPanel=1==this._isPanel,this.card.hass=this._mockHass,this.requestUpdate()}}parseTemplate(t,e){return new Promise((n,r)=>{let i=function(t,e,n,r=!0){t||(t=a().connection);let i={user:a().user.name,browser:d,hash:location.hash.substr(1)||" ",...n.variables},o=n.template,s=n.entity_ids;return t.subscribeMessage(t=>{if(r){let n=String(t.result);const r=/_\([^)]*\)/g;n=n.replace(r,t=>a().localize(t.substring(2,t.length-1))||t),e(n)}else e(t.result)},{type:"render_template",template:o,variables:i,entity_ids:s})}(null,async t=>{n(t)},{template:t,variables:e,entity_ids:[]},!1),o=null;(async()=>{try{o=await i,await o()}catch(t){r(t.message)}})()})}async applyTemplate(t){try{return await this.parseTemplate(t,this._templateVariables)}catch(e){return console.error("Error parsing template.",e),console.log("Template",t),"Error!"}}getCardConfigWithoutTemplates(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=y.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.getCardConfigWithoutTemplates(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&&m.includes(n.type)&&!n.entities&&(n.entities=this.entities)),n}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=await this.applyTemplate(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:y.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":y.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&&m.includes(n.type)&&!n.entities&&(n.entities=this.entities)),n}})}]); \ No newline at end of file + `}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})}haveEntitiesChanged(){for(const t of this.entities){let e=this.oldStates[t.entity];null==e&&(e={state:"undefined"});let n=this._hass.states[t.entity];if(null==n&&(n={state:"undefined"}),n!=e)return!0}return!1}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?await this.applyTemplate(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}}}set isPanel(t){this._isPanel=t}set hass(t){this.oldStates=null!=this._hass?this._hass.states:{},this._hass=t;let e=this._mockHass?this._mockHass.states:[];if(this._mockHass={},Object.assign(this._mockHass,t),this._mockHass.states=JSON.parse(JSON.stringify(this._hass.states)),this._templateVariables={user:{name:this._hass.user.name,is_admin:this._hass.user.is_admin,is_owner:this._hass.user.is_owner},page:{...location,path:location.pathname},theme:this._hass.selectedTheme?this._hass.selectedTheme:this._hass.themes.default_theme},this.card)if(this.haveEntitiesChanged())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 n=Object.keys(e);const t=Object.keys(this._mockHass.states).filter(t=>!n.includes(t)).reduce((t,e)=>(t[e]=this._mockHass.states[e],t),{});this._mockHass.states={...e,...t},this.card.isPanel=1==this._isPanel,this.card.hass=this._mockHass,this.requestUpdate()}}parseTemplate(t,e){return new Promise((n,r)=>{let i=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})}(null,async t=>{n(t)},{template:t,variables:e,entity_ids:[]},!1),s=null;(async()=>{try{s=await i,await s()}catch(t){r(t.message)}})()})}async applyTemplate(t){try{return await this.parseTemplate(t,this._templateVariables)}catch(e){return console.error("Error parsing template.",e),console.log("Template",t),"Error!"}}getCardConfigWithoutTemplates(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=ft.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.getCardConfigWithoutTemplates(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&&ht.includes(n.type)&&!n.entities&&(n.entities=this.entities)),n}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=await this.applyTemplate(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:ft.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":ft.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&&ht.includes(n.type)&&!n.entities&&(n.entities=this.entities)),n}})}]); \ No newline at end of file diff --git a/src/main.js b/src/main.js index 39a1d08..5ea5f2b 100644 --- a/src/main.js +++ b/src/main.js @@ -3,7 +3,7 @@ const entityCards = ['entities', 'glance']; const TEMPLATER_CARD_VERSION = "0.0.9"; -import { LitElement, html, css } from "card-tools/src/lit-element"; +import { LitElement, html, css } from "lit-element"; import { createCard, createEntityRow } from "card-tools/src/lovelace-element"; import { subscribeRenderTemplate } from "card-tools/src/templates";