diff --git a/changelog.md b/changelog.md index 26dfc12..edf7cfd 100644 --- a/changelog.md +++ b/changelog.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) -## [Unrelease] +## [0.1.8] - 2023/01/16 ### Changed @@ -79,6 +79,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add renderer for terraform files - Import metadata instead of passing it through constructor in TerraformMetadata +[0.1.8]: https://github.com/ditrit/terrator-plugin/blob/0.1.8/changelog.md [0.1.7]: https://github.com/ditrit/terrator-plugin/blob/0.1.7/changelog.md [0.1.6]: https://github.com/ditrit/terrator-plugin/blob/0.1.6/changelog.md [0.1.5]: https://github.com/ditrit/terrator-plugin/blob/0.1.5/changelog.md diff --git a/dist/terrator-plugin.js b/dist/terrator-plugin.js index 1fbc2a9..bf4ed6b 100644 --- a/dist/terrator-plugin.js +++ b/dist/terrator-plugin.js @@ -1,2 +1,2 @@ /*! For license information please see terrator-plugin.js.LICENSE.txt */ -(()=>{var t={96:(t,e,n)=>{"use strict";var r=n(153),i=n(610),o=n(531),s=n(22),a=n(35),l=n(516),u=n(753),c=n(978),h=n(889);t.exports=y,y.prototype.validate=function(t,e){var n;if("string"==typeof t){if(!(n=this.getSchema(t)))throw new Error('no schema with key or ref "'+t+'"')}else{var r=this._addSchema(t);n=r.validate||this._compile(r)}var i=n(e);return!0!==n.$async&&(this.errors=n.errors),i},y.prototype.compile=function(t,e){var n=this._addSchema(t,void 0,e);return n.validate||this._compile(n)},y.prototype.addSchema=function(t,e,n,r){if(Array.isArray(t)){for(var o=0;o{"use strict";var e=t.exports=function(){this._cache={}};e.prototype.put=function(t,e){this._cache[t]=e},e.prototype.get=function(t){return this._cache[t]},e.prototype.del=function(t){delete this._cache[t]},e.prototype.clear=function(){this._cache={}}},931:(t,e,n)=>{"use strict";var r=n(802).MissingRef;t.exports=function t(e,n,i){var o=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof n&&(i=n,n=void 0);var s=a(e).then((function(){var t=o._addSchema(e,void 0,n);return t.validate||l(t)}));return i&&s.then((function(t){i(null,t)}),i),s;function a(e){var n=e.$schema;return n&&!o.getSchema(n)?t.call(o,{$ref:n},!0):Promise.resolve()}function l(t){try{return o._compile(t)}catch(e){if(e instanceof r)return function(e){var r=e.missingSchema;if(u(r))throw new Error("Schema "+r+" is loaded but "+e.missingRef+" cannot be resolved");var i=o._loadingSchemas[r];return i||(i=o._loadingSchemas[r]=o._opts.loadSchema(r)).then(s,s),i.then((function(t){if(!u(r))return a(t).then((function(){u(r)||o.addSchema(t,r,void 0,n)}))})).then((function(){return l(t)}));function s(){delete o._loadingSchemas[r]}function u(t){return o._refs[t]||o._schemas[t]}}(e);throw e}}}},802:(t,e,n)=>{"use strict";var r=n(610);function i(t,e,n){this.message=n||i.message(t,e),this.missingRef=r.url(t,e),this.missingSchema=r.normalizeId(r.fullPath(this.missingRef))}function o(t){return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}t.exports={Validation:o((function(t){this.message="validation failed",this.errors=t,this.ajv=this.validation=!0})),MissingRef:o(i)},i.message=function(t,e){return"can't resolve reference "+e+" from id "+t}},516:(t,e,n)=>{"use strict";var r=n(889),i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31],s=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,a=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,l=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,u=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,f=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(t){return t="full"==t?"full":"fast",r.copy(m[t])}function v(t){var e=t.match(i);if(!e)return!1;var n=+e[1],r=+e[2],s=+e[3];return r>=1&&r<=12&&s>=1&&s<=(2==r&&function(t){return t%4==0&&(t%100!=0||t%400==0)}(n)?29:o[r])}function y(t,e){var n=t.match(s);if(!n)return!1;var r=n[1],i=n[2],o=n[3],a=n[5];return(r<=23&&i<=59&&o<=59||23==r&&59==i&&60==o)&&(!e||a)}t.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:b,uuid:h,"json-pointer":f,"json-pointer-uri-fragment":p,"relative-json-pointer":d},m.full={date:v,time:y,"date-time":function(t){var e=t.split(g);return 2==e.length&&v(e[0])&&y(e[1],!0)},uri:function(t){return _.test(t)&&l.test(t)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:b,uuid:h,"json-pointer":f,"json-pointer-uri-fragment":p,"relative-json-pointer":d};var g=/t|\s/i,_=/\/|:/,E=/[^\\]\\Z/;function b(t){if(E.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}}},153:(t,e,n)=>{"use strict";var r=n(610),i=n(889),o=n(802),s=n(35),a=n(508),l=i.ucs2length,u=n(63),c=o.Validation;function h(t,e,n){var r=p.call(this,t,e,n);return r>=0?{index:r,compiling:!0}:(r=this._compilations.length,this._compilations[r]={schema:t,root:e,baseId:n},{index:r,compiling:!1})}function f(t,e,n){var r=p.call(this,t,e,n);r>=0&&this._compilations.splice(r,1)}function p(t,e,n){for(var r=0;r{"use strict";var r=n(540),i=n(63),o=n(889),s=n(22),a=n(461);function l(t,e,n){var r=this._refs[n];if("string"==typeof r){if(!this._refs[r])return l.call(this,t,e,r);r=this._refs[r]}if((r=r||this._schemas[n])instanceof s)return d(r.schema,this._opts.inlineRefs)?r.schema:r.validate||this._compile(r);var i,o,a,c=u.call(this,e,n);return c&&(i=c.schema,e=c.root,a=c.baseId),i instanceof s?o=i.validate||t.call(this,i.schema,e,void 0,a):void 0!==i&&(o=d(i,this._opts.inlineRefs)?i:t.call(this,i,e,void 0,a)),o}function u(t,e){var n=r.parse(e),i=g(n),o=y(this._getId(t.schema));if(0===Object.keys(t.schema).length||i!==o){var a=E(i),l=this._refs[a];if("string"==typeof l)return c.call(this,t,l,n);if(l instanceof s)l.validate||this._compile(l),t=l;else{if(!((l=this._schemas[a])instanceof s))return;if(l.validate||this._compile(l),a==E(e))return{schema:l,root:t,baseId:o};t=l}if(!t.schema)return;o=y(this._getId(t.schema))}return f.call(this,n,o,t.schema,t)}function c(t,e,n){var r=u.call(this,t,e);if(r){var i=r.schema,o=r.baseId;t=r.root;var s=this._getId(i);return s&&(o=b(o,s)),f.call(this,n,o,i,t)}}t.exports=l,l.normalizeId=E,l.fullPath=y,l.url=b,l.ids=function(t){var e=E(this._getId(t)),n={"":e},s={"":y(e,!1)},l={},u=this;return a(t,{allKeys:!0},(function(t,e,a,c,h,f,p){if(""!==e){var d=u._getId(t),m=n[c],v=s[c]+"/"+h;if(void 0!==p&&(v+="/"+("number"==typeof p?p:o.escapeFragment(p))),"string"==typeof d){d=m=E(m?r.resolve(m,d):d);var y=u._refs[d];if("string"==typeof y&&(y=u._refs[y]),y&&y.schema){if(!i(t,y.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=E(v))if("#"==d[0]){if(l[d]&&!i(t,l[d]))throw new Error('id "'+d+'" resolves to more than one schema');l[d]=t}else u._refs[d]=v}n[e]=m,s[e]=v}})),l},l.inlineRef=d,l.schema=u;var h=o.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function f(t,e,n,r){if(t.fragment=t.fragment||"","/"==t.fragment.slice(0,1)){for(var i=t.fragment.split("/"),s=1;s{"use strict";var r=n(674),i=n(889).toHash;t.exports=function(){var t=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],e=["type","$comment"];return t.all=i(e),t.types=i(["number","integer","string","array","object","boolean","null"]),t.forEach((function(n){n.rules=n.rules.map((function(n){var i;if("object"==typeof n){var o=Object.keys(n)[0];i=n[o],n=o,i.forEach((function(n){e.push(n),t.all[n]=!0}))}return e.push(n),t.all[n]={keyword:n,code:r[n],implements:i}})),t.all.$comment={keyword:"$comment",code:r.$comment},n.type&&(t.types[n.type]=n)})),t.keywords=i(e.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),t.custom={},t}},22:(t,e,n)=>{"use strict";var r=n(889);t.exports=function(t){r.copy(t,this)}},442:t=>{"use strict";t.exports=function(t){for(var e,n=0,r=t.length,i=0;i=55296&&e<=56319&&i{"use strict";function r(t,e,n,r){var i=r?" !== ":" === ",o=r?" || ":" && ",s=r?"!":"",a=r?"":"!";switch(t){case"null":return e+i+"null";case"array":return s+"Array.isArray("+e+")";case"object":return"("+s+e+o+"typeof "+e+i+'"object"'+o+a+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+i+'"number"'+o+a+"("+e+" % 1)"+o+e+i+e+(n?o+s+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+i+'"'+t+'"'+(n?o+s+"isFinite("+e+")":"")+")";default:return"typeof "+e+i+'"'+t+'"'}}t.exports={copy:function(t,e){for(var n in e=e||{},t)e[n]=t[n];return e},checkDataType:r,checkDataTypes:function(t,e,n){if(1===t.length)return r(t[0],e,n,!0);var i="",s=o(t);for(var a in s.array&&s.object&&(i=s.null?"(":"(!"+e+" || ",i+="typeof "+e+' !== "object")',delete s.null,delete s.array,delete s.object),s.number&&delete s.integer,s)i+=(i?" && ":"")+r(a,e,n,!0);return i},coerceToTypes:function(t,e){if(Array.isArray(e)){for(var n=[],r=0;r=e)throw new Error("Cannot access property/index "+r+" levels up, current level is "+e);return n[e-r]}if(r>e)throw new Error("Cannot access data "+r+" levels up, current level is "+e);if(o="data"+(e-r||""),!i)return o}for(var a=o,u=i.split("/"),c=0;c{"use strict";var e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];t.exports=function(t,n){for(var r=0;r{"use strict";var r=n(680);t.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:r.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:r.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},210:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a;var p="maximum"==e,d=p?"exclusiveMaximum":"exclusiveMinimum",m=t.schema[d],v=t.opts.$data&&m&&m.$data,y=p?"<":">",g=p?">":"<",_=void 0;if(!f&&"number"!=typeof a&&void 0!==a)throw new Error(e+" must be number");if(!v&&void 0!==m&&"number"!=typeof m&&"boolean"!=typeof m)throw new Error(d+" must be number or boolean");if(v){var E,b=t.util.getData(m.$data,s,t.dataPathArr),x="exclusive"+o,w="exclType"+o,k="exclIsNumber"+o,T="' + "+(O="op"+o)+" + '";i+=" var schemaExcl"+o+" = "+b+"; ",i+=" var "+x+"; var "+w+" = typeof "+(b="schemaExcl"+o)+"; if ("+w+" != 'boolean' && "+w+" != 'undefined' && "+w+" != 'number') { ",_=d,(E=E||[]).push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: {} ",!1!==t.opts.messages&&(i+=" , message: '"+d+" should be boolean' "),t.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var S=i;i=E.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+w+" == 'number' ? ( ("+x+" = "+r+" === undefined || "+b+" "+y+"= "+r+") ? "+h+" "+g+"= "+b+" : "+h+" "+g+" "+r+" ) : ( ("+x+" = "+b+" === true) ? "+h+" "+g+"= "+r+" : "+h+" "+g+" "+r+" ) || "+h+" !== "+h+") { var op"+o+" = "+x+" ? '"+y+"' : '"+y+"='; ",void 0===a&&(_=d,u=t.errSchemaPath+"/"+d,r=b,f=v)}else if(T=y,(k="number"==typeof m)&&f){var O="'"+T+"'";i+=" if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" ( "+r+" === undefined || "+m+" "+y+"= "+r+" ? "+h+" "+g+"= "+m+" : "+h+" "+g+" "+r+" ) || "+h+" !== "+h+") { "}else k&&void 0===a?(x=!0,_=d,u=t.errSchemaPath+"/"+d,r=m,g+="="):(k&&(r=Math[p?"min":"max"](m,a)),m===(!k||r)?(x=!0,_=d,u=t.errSchemaPath+"/"+d,g+="="):(x=!1,T+="=")),O="'"+T+"'",i+=" if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+h+" "+g+" "+r+" || "+h+" !== "+h+") { ";return _=_||e,(E=E||[]).push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { comparison: "+O+", limit: "+r+", exclusive: "+x+" } ",!1!==t.opts.messages&&(i+=" , message: 'should be "+T+" ",i+=f?"' + "+r:r+"'"),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ",S=i,i=E.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { "),i}},38:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;if(f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,!f&&"number"!=typeof a)throw new Error(e+" must be number");i+="if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+h+".length "+("maxItems"==e?">":"<")+" "+r+") { ";var p=e,d=d||[];d.push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { limit: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxItems"==e?"more":"fewer",i+=" than ",i+=f?"' + "+r+" + '":""+a,i+=" items' "),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var m=i;return i=d.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},425:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;if(f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,!f&&"number"!=typeof a)throw new Error(e+" must be number");var p="maxLength"==e?">":"<";i+="if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),!1===t.opts.unicode?i+=" "+h+".length ":i+=" ucs2length("+h+") ",i+=" "+p+" "+r+") { ";var d=e,m=m||[];m.push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { limit: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT be ",i+="maxLength"==e?"longer":"shorter",i+=" than ",i+=f?"' + "+r+" + '":""+a,i+=" characters' "),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var v=i;return i=m.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},204:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;if(f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,!f&&"number"!=typeof a)throw new Error(e+" must be number");i+="if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" Object.keys("+h+").length "+("maxProperties"==e?">":"<")+" "+r+") { ";var p=e,d=d||[];d.push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { limit: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxProperties"==e?"more":"fewer",i+=" than ",i+=f?"' + "+r+" + '":""+a,i+=" properties' "),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var m=i;return i=d.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},988:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.schema[e],o=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,a=!t.opts.allErrors,l=t.util.copy(t),u="";l.level++;var c="valid"+l.level,h=l.baseId,f=!0,p=i;if(p)for(var d,m=-1,v=p.length-1;m0||!1===d:t.util.schemaHasRules(d,t.RULES.all))&&(f=!1,l.schema=d,l.schemaPath=o+"["+m+"]",l.errSchemaPath=s+"/"+m,r+=" "+t.validate(l)+" ",l.baseId=h,a&&(r+=" if ("+c+") { ",u+="}"));return a&&(r+=f?" if (true) { ":" "+u.slice(0,-1)+" "),r}},996:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t),d="";p.level++;var m="valid"+p.level,v=s.every((function(e){return t.opts.strictKeywords?"object"==typeof e&&Object.keys(e).length>0||!1===e:t.util.schemaHasRules(e,t.RULES.all)}));if(v){var y=p.baseId;r+=" var "+f+" = errors; var "+h+" = false; ";var g=t.compositeRule;t.compositeRule=p.compositeRule=!0;var _=s;if(_)for(var E,b=-1,x=_.length-1;b{"use strict";t.exports=function(t,e,n){var r=" ",i=t.schema[e],o=t.errSchemaPath+"/"+e,s=(t.opts.allErrors,t.util.toQuotedString(i));return!0===t.opts.$comment?r+=" console.log("+s+");":"function"==typeof t.opts.$comment&&(r+=" self._opts.$comment("+s+", "+t.util.toQuotedString(o)+", validate.root.schema);"),r}},306:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f=t.opts.$data&&s&&s.$data;f&&(r+=" var schema"+i+" = "+t.util.getData(s.$data,o,t.dataPathArr)+"; "),f||(r+=" var schema"+i+" = validate.schema"+a+";"),r+="var "+h+" = equal("+c+", schema"+i+"); if (!"+h+") { ";var p=p||[];p.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { allowedValue: schema"+i+" } ",!1!==t.opts.messages&&(r+=" , message: 'should be equal to constant' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var d=r;return r=p.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+d+"]); ":r+=" validate.errors = ["+d+"]; return false; ":r+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",u&&(r+=" else { "),r}},840:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t);p.level++;var d="valid"+p.level,m="i"+i,v=p.dataLevel=t.dataLevel+1,y="data"+v,g=t.baseId,_=t.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:t.util.schemaHasRules(s,t.RULES.all);if(r+="var "+f+" = errors;var "+h+";",_){var E=t.compositeRule;t.compositeRule=p.compositeRule=!0,p.schema=s,p.schemaPath=a,p.errSchemaPath=l,r+=" var "+d+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",p.errorPath=t.util.getPathExpr(t.errorPath,m,t.opts.jsonPointers,!0);var b=c+"["+m+"]";p.dataPathArr[v]=m;var x=t.validate(p);p.baseId=g,t.util.varOccurences(x,y)<2?r+=" "+t.util.varReplace(x,y,b)+" ":r+=" var "+y+" = "+b+"; "+x+" ",r+=" if ("+d+") break; } ",t.compositeRule=p.compositeRule=E,r+=" if (!"+d+") {"}else r+=" if ("+c+".length == 0) {";var w=w||[];w.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should contain a valid item' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var k=r;return r=w.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+k+"]); ":r+=" validate.errors = ["+k+"]; return false; ":r+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",_&&(r+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } "),t.opts.allErrors&&(r+=" } "),r}},165:t=>{"use strict";t.exports=function(t,e,n){var r,i,o=" ",s=t.level,a=t.dataLevel,l=t.schema[e],u=t.schemaPath+t.util.getProperty(e),c=t.errSchemaPath+"/"+e,h=!t.opts.allErrors,f="data"+(a||""),p="valid"+s,d="errs__"+s,m=t.opts.$data&&l&&l.$data;m?(o+=" var schema"+s+" = "+t.util.getData(l.$data,a,t.dataPathArr)+"; ",i="schema"+s):i=l;var v,y,g,_,E,b=this,x="definition"+s,w=b.definition,k="";if(m&&w.$data){E="keywordValidate"+s;var T=w.validateSchema;o+=" var "+x+" = RULES.custom['"+e+"'].definition; var "+E+" = "+x+".validate;"}else{if(!(_=t.useCustomRule(b,l,t.schema,t)))return;i="validate.schema"+u,E=_.code,v=w.compile,y=w.inline,g=w.macro}var S=E+".errors",O="i"+s,A="ruleErr"+s,C=w.async;if(C&&!t.async)throw new Error("async keyword in sync schema");if(y||g||(o+=S+" = null;"),o+="var "+d+" = errors;var "+p+";",m&&w.$data&&(k+="}",o+=" if ("+i+" === undefined) { "+p+" = true; } else { ",T&&(k+="}",o+=" "+p+" = "+x+".validateSchema("+i+"); if ("+p+") { ")),y)w.statements?o+=" "+_.validate+" ":o+=" "+p+" = "+_.validate+"; ";else if(g){var R=t.util.copy(t);k="",R.level++;var L="valid"+R.level;R.schema=_.validate,R.schemaPath="";var P=t.compositeRule;t.compositeRule=R.compositeRule=!0;var N=t.validate(R).replace(/validate\.schema/g,E);t.compositeRule=R.compositeRule=P,o+=" "+N}else{(j=j||[]).push(o),o="",o+=" "+E+".call( ",t.opts.passContext?o+="this":o+="self",v||!1===w.schema?o+=" , "+f+" ":o+=" , "+i+" , "+f+" , validate.schema"+t.schemaPath+" ",o+=" , (dataPath || '')",'""'!=t.errorPath&&(o+=" + "+t.errorPath);var I=a?"data"+(a-1||""):"parentData",F=a?t.dataPathArr[a]:"parentDataProperty",D=o+=" , "+I+" , "+F+" , rootData ) ";o=j.pop(),!1===w.errors?(o+=" "+p+" = ",C&&(o+="await "),o+=D+"; "):o+=C?" var "+(S="customErrors"+s)+" = null; try { "+p+" = await "+D+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+S+" = e.errors; else throw e; } ":" "+S+" = null; "+p+" = "+D+"; "}if(w.modifying&&(o+=" if ("+I+") "+f+" = "+I+"["+F+"];"),o+=""+k,w.valid)h&&(o+=" if (true) { ");else{var j;o+=" if ( ",void 0===w.valid?(o+=" !",o+=g?""+L:""+p):o+=" "+!w.valid+" ",o+=") { ",r=b.keyword,(j=j||[]).push(o),o="",(j=j||[]).push(o),o="",!1!==t.createErrors?(o+=" { keyword: '"+(r||"custom")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { keyword: '"+b.keyword+"' } ",!1!==t.opts.messages&&(o+=" , message: 'should pass \""+b.keyword+"\" keyword validation' "),t.opts.verbose&&(o+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),o+=" } "):o+=" {} ";var M=o;o=j.pop(),!t.compositeRule&&h?t.async?o+=" throw new ValidationError(["+M+"]); ":o+=" validate.errors = ["+M+"]; return false; ":o+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var B=o;o=j.pop(),y?w.errors?"full"!=w.errors&&(o+=" for (var "+O+"="+d+"; "+O+"{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="errs__"+i,f=t.util.copy(t),p="";f.level++;var d="valid"+f.level,m={},v={},y=t.opts.ownProperties;for(b in s)if("__proto__"!=b){var g=s[b],_=Array.isArray(g)?v:m;_[b]=g}r+="var "+h+" = errors;";var E=t.errorPath;for(var b in r+="var missing"+i+";",v)if((_=v[b]).length){if(r+=" if ( "+c+t.util.getProperty(b)+" !== undefined ",y&&(r+=" && Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(b)+"') "),u){r+=" && ( ";var x=_;if(x)for(var w=-1,k=x.length-1;w0||!1===g:t.util.schemaHasRules(g,t.RULES.all))&&(r+=" "+d+" = true; if ( "+c+t.util.getProperty(b)+" !== undefined ",y&&(r+=" && Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(b)+"') "),r+=") { ",f.schema=g,f.schemaPath=a+t.util.getProperty(b),f.errSchemaPath=l+"/"+t.util.escapeFragment(b),r+=" "+t.validate(f)+" ",f.baseId=F,r+=" } ",u&&(r+=" if ("+d+") { ",p+="}"));return u&&(r+=" "+p+" if ("+h+" == errors) {"),r}},740:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f=t.opts.$data&&s&&s.$data;f&&(r+=" var schema"+i+" = "+t.util.getData(s.$data,o,t.dataPathArr)+"; ");var p="i"+i,d="schema"+i;f||(r+=" var "+d+" = validate.schema"+a+";"),r+="var "+h+";",f&&(r+=" if (schema"+i+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+i+")) "+h+" = false; else {"),r+=h+" = false;for (var "+p+"=0; "+p+"<"+d+".length; "+p+"++) if (equal("+c+", "+d+"["+p+"])) { "+h+" = true; break; }",f&&(r+=" } "),r+=" if (!"+h+") { ";var m=m||[];m.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { allowedValues: schema"+i+" } ",!1!==t.opts.messages&&(r+=" , message: 'should be equal to one of the allowed values' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var v=r;return r=m.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",u&&(r+=" else { "),r}},14:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||"");if(!1===t.opts.format)return u&&(r+=" if (true) { "),r;var h,f=t.opts.$data&&s&&s.$data;f?(r+=" var schema"+i+" = "+t.util.getData(s.$data,o,t.dataPathArr)+"; ",h="schema"+i):h=s;var p=t.opts.unknownFormats,d=Array.isArray(p);if(f)r+=" var "+(m="format"+i)+" = formats["+h+"]; var "+(v="isObject"+i)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(y="formatType"+i)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",t.async&&(r+=" var async"+i+" = "+m+".async; "),r+=" "+m+" = "+m+".validate; } if ( ",f&&(r+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),r+=" (","ignore"!=p&&(r+=" ("+h+" && !"+m+" ",d&&(r+=" && self._opts.unknownFormats.indexOf("+h+") == -1 "),r+=") || "),r+=" ("+m+" && "+y+" == '"+n+"' && !(typeof "+m+" == 'function' ? ",t.async?r+=" (async"+i+" ? await "+m+"("+c+") : "+m+"("+c+")) ":r+=" "+m+"("+c+") ",r+=" : "+m+".test("+c+"))))) {";else{var m;if(!(m=t.formats[s])){if("ignore"==p)return t.logger.warn('unknown format "'+s+'" ignored in schema at path "'+t.errSchemaPath+'"'),u&&(r+=" if (true) { "),r;if(d&&p.indexOf(s)>=0)return u&&(r+=" if (true) { "),r;throw new Error('unknown format "'+s+'" is used in schema at path "'+t.errSchemaPath+'"')}var v,y=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var g=!0===m.async;m=m.validate}if(y!=n)return u&&(r+=" if (true) { "),r;if(g){if(!t.async)throw new Error("async format in sync schema");r+=" if (!(await "+(_="formats"+t.util.getProperty(s)+".validate")+"("+c+"))) { "}else{r+=" if (! ";var _="formats"+t.util.getProperty(s);v&&(_+=".validate"),r+="function"==typeof m?" "+_+"("+c+") ":" "+_+".test("+c+") ",r+=") { "}}var E=E||[];E.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { format: ",r+=f?""+h:""+t.util.toQuotedString(s),r+=" } ",!1!==t.opts.messages&&(r+=" , message: 'should match format \"",r+=f?"' + "+h+" + '":""+t.util.escapeQuotes(s),r+="\"' "),t.opts.verbose&&(r+=" , schema: ",r+=f?"validate.schema"+a:""+t.util.toQuotedString(s),r+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var b=r;return r=E.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+b+"]); ":r+=" validate.errors = ["+b+"]; return false; ":r+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",u&&(r+=" else { "),r}},231:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t);p.level++;var d="valid"+p.level,m=t.schema.then,v=t.schema.else,y=void 0!==m&&(t.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:t.util.schemaHasRules(m,t.RULES.all)),g=void 0!==v&&(t.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:t.util.schemaHasRules(v,t.RULES.all)),_=p.baseId;if(y||g){var E;p.createErrors=!1,p.schema=s,p.schemaPath=a,p.errSchemaPath=l,r+=" var "+f+" = errors; var "+h+" = true; ";var b=t.compositeRule;t.compositeRule=p.compositeRule=!0,r+=" "+t.validate(p)+" ",p.baseId=_,p.createErrors=!0,r+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",t.compositeRule=p.compositeRule=b,y?(r+=" if ("+d+") { ",p.schema=t.schema.then,p.schemaPath=t.schemaPath+".then",p.errSchemaPath=t.errSchemaPath+"/then",r+=" "+t.validate(p)+" ",p.baseId=_,r+=" "+h+" = "+d+"; ",y&&g?r+=" var "+(E="ifClause"+i)+" = 'then'; ":E="'then'",r+=" } ",g&&(r+=" else { ")):r+=" if (!"+d+") { ",g&&(p.schema=t.schema.else,p.schemaPath=t.schemaPath+".else",p.errSchemaPath=t.errSchemaPath+"/else",r+=" "+t.validate(p)+" ",p.baseId=_,r+=" "+h+" = "+d+"; ",y&&g?r+=" var "+(E="ifClause"+i)+" = 'else'; ":E="'else'",r+=" } "),r+=" if (!"+h+") { var err = ",!1!==t.createErrors?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { failingKeyword: "+E+" } ",!1!==t.opts.messages&&(r+=" , message: 'should match \"' + "+E+" + '\" schema' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&u&&(t.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",u&&(r+=" else { ")}else u&&(r+=" if (true) { ");return r}},674:(t,e,n)=>{"use strict";t.exports={$ref:n(392),allOf:n(988),anyOf:n(996),$comment:n(812),const:n(306),contains:n(840),dependencies:n(659),enum:n(740),format:n(14),if:n(231),items:n(482),maximum:n(210),minimum:n(210),maxItems:n(38),minItems:n(38),maxLength:n(425),minLength:n(425),maxProperties:n(204),minProperties:n(204),multipleOf:n(673),not:n(528),oneOf:n(709),pattern:n(614),properties:n(175),propertyNames:n(441),required:n(287),uniqueItems:n(603),validate:n(508)}},482:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t),d="";p.level++;var m="valid"+p.level,v="i"+i,y=p.dataLevel=t.dataLevel+1,g="data"+y,_=t.baseId;if(r+="var "+f+" = errors;var "+h+";",Array.isArray(s)){var E=t.schema.additionalItems;if(!1===E){r+=" "+h+" = "+c+".length <= "+s.length+"; ";var b=l;l=t.errSchemaPath+"/additionalItems",r+=" if (!"+h+") { ";var x=x||[];x.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { limit: "+s.length+" } ",!1!==t.opts.messages&&(r+=" , message: 'should NOT have more than "+s.length+" items' "),t.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var w=r;r=x.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+w+"]); ":r+=" validate.errors = ["+w+"]; return false; ":r+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",l=b,u&&(d+="}",r+=" else { ")}var k=s;if(k)for(var T,S=-1,O=k.length-1;S0||!1===T:t.util.schemaHasRules(T,t.RULES.all)){r+=" "+m+" = true; if ("+c+".length > "+S+") { ";var A=c+"["+S+"]";p.schema=T,p.schemaPath=a+"["+S+"]",p.errSchemaPath=l+"/"+S,p.errorPath=t.util.getPathExpr(t.errorPath,S,t.opts.jsonPointers,!0),p.dataPathArr[y]=S;var C=t.validate(p);p.baseId=_,t.util.varOccurences(C,g)<2?r+=" "+t.util.varReplace(C,g,A)+" ":r+=" var "+g+" = "+A+"; "+C+" ",r+=" } ",u&&(r+=" if ("+m+") { ",d+="}")}"object"==typeof E&&(t.opts.strictKeywords?"object"==typeof E&&Object.keys(E).length>0||!1===E:t.util.schemaHasRules(E,t.RULES.all))&&(p.schema=E,p.schemaPath=t.schemaPath+".additionalItems",p.errSchemaPath=t.errSchemaPath+"/additionalItems",r+=" "+m+" = true; if ("+c+".length > "+s.length+") { for (var "+v+" = "+s.length+"; "+v+" < "+c+".length; "+v+"++) { ",p.errorPath=t.util.getPathExpr(t.errorPath,v,t.opts.jsonPointers,!0),A=c+"["+v+"]",p.dataPathArr[y]=v,C=t.validate(p),p.baseId=_,t.util.varOccurences(C,g)<2?r+=" "+t.util.varReplace(C,g,A)+" ":r+=" var "+g+" = "+A+"; "+C+" ",u&&(r+=" if (!"+m+") break; "),r+=" } } ",u&&(r+=" if ("+m+") { ",d+="}"))}else(t.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:t.util.schemaHasRules(s,t.RULES.all))&&(p.schema=s,p.schemaPath=a,p.errSchemaPath=l,r+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",p.errorPath=t.util.getPathExpr(t.errorPath,v,t.opts.jsonPointers,!0),A=c+"["+v+"]",p.dataPathArr[y]=v,C=t.validate(p),p.baseId=_,t.util.varOccurences(C,g)<2?r+=" "+t.util.varReplace(C,g,A)+" ":r+=" var "+g+" = "+A+"; "+C+" ",u&&(r+=" if (!"+m+") break; "),r+=" }");return u&&(r+=" "+d+" if ("+f+" == errors) {"),r}},673:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;if(f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,!f&&"number"!=typeof a)throw new Error(e+" must be number");i+="var division"+o+";if (",f&&(i+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),i+=" (division"+o+" = "+h+" / "+r+", ",t.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+t.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",f&&(i+=" ) "),i+=" ) { ";var p=p||[];p.push(i),i="",!1!==t.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { multipleOf: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should be multiple of ",i+=f?"' + "+r:r+"'"),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var d=i;return i=p.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},528:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="errs__"+i,f=t.util.copy(t);f.level++;var p="valid"+f.level;if(t.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:t.util.schemaHasRules(s,t.RULES.all)){f.schema=s,f.schemaPath=a,f.errSchemaPath=l,r+=" var "+h+" = errors; ";var d,m=t.compositeRule;t.compositeRule=f.compositeRule=!0,f.createErrors=!1,f.opts.allErrors&&(d=f.opts.allErrors,f.opts.allErrors=!1),r+=" "+t.validate(f)+" ",f.createErrors=!0,d&&(f.opts.allErrors=d),t.compositeRule=f.compositeRule=m,r+=" if ("+p+") { ";var v=v||[];v.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should NOT be valid' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var y=r;r=v.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",t.opts.allErrors&&(r+=" } ")}else r+=" var err = ",!1!==t.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should NOT be valid' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(r+=" if (false) { ");return r}},709:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t),d="";p.level++;var m="valid"+p.level,v=p.baseId,y="prevValid"+i,g="passingSchemas"+i;r+="var "+f+" = errors , "+y+" = false , "+h+" = false , "+g+" = null; ";var _=t.compositeRule;t.compositeRule=p.compositeRule=!0;var E=s;if(E)for(var b,x=-1,w=E.length-1;x0||!1===b:t.util.schemaHasRules(b,t.RULES.all))?(p.schema=b,p.schemaPath=a+"["+x+"]",p.errSchemaPath=l+"/"+x,r+=" "+t.validate(p)+" ",p.baseId=v):r+=" var "+m+" = true; ",x&&(r+=" if ("+m+" && "+y+") { "+h+" = false; "+g+" = ["+g+", "+x+"]; } else { ",d+="}"),r+=" if ("+m+") { "+h+" = "+y+" = true; "+g+" = "+x+"; }";return t.compositeRule=p.compositeRule=_,r+=d+"if (!"+h+") { var err = ",!1!==t.createErrors?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { passingSchemas: "+g+" } ",!1!==t.opts.messages&&(r+=" , message: 'should match exactly one schema in oneOf' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&u&&(t.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; }",t.opts.allErrors&&(r+=" } "),r}},614:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,i+="if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'string') || "),i+=" !"+(f?"(new RegExp("+r+"))":t.usePattern(a))+".test("+h+") ) { ";var p=p||[];p.push(i),i="",!1!==t.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { pattern: ",i+=f?""+r:""+t.util.toQuotedString(a),i+=" } ",!1!==t.opts.messages&&(i+=" , message: 'should match pattern \"",i+=f?"' + "+r+" + '":""+t.util.escapeQuotes(a),i+="\"' "),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+t.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var d=i;return i=p.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},175:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="errs__"+i,f=t.util.copy(t),p="";f.level++;var d="valid"+f.level,m="key"+i,v="idx"+i,y=f.dataLevel=t.dataLevel+1,g="data"+y,_="dataProperties"+i,E=Object.keys(s||{}).filter(N),b=t.schema.patternProperties||{},x=Object.keys(b).filter(N),w=t.schema.additionalProperties,k=E.length||x.length,T=!1===w,S="object"==typeof w&&Object.keys(w).length,O=t.opts.removeAdditional,A=T||S||O,C=t.opts.ownProperties,R=t.baseId,L=t.schema.required;if(L&&(!t.opts.$data||!L.$data)&&L.length8)r+=" || validate.schema"+a+".hasOwnProperty("+m+") ";else{var I=E;if(I)for(var F=-1,D=I.length-1;F0||!1===J:t.util.schemaHasRules(J,t.RULES.all)){var Z=t.util.getProperty(W),tt=(z=c+Z,G&&void 0!==J.default);if(f.schema=J,f.schemaPath=a+Z,f.errSchemaPath=l+"/"+t.util.escapeFragment(W),f.errorPath=t.util.getPath(t.errorPath,W,t.opts.jsonPointers),f.dataPathArr[y]=t.util.toQuotedString(W),q=t.validate(f),f.baseId=R,t.util.varOccurences(q,g)<2){q=t.util.varReplace(q,g,z);var et=z}else et=g,r+=" var "+g+" = "+z+"; ";if(tt)r+=" "+q+" ";else{if(P&&P[W]){r+=" if ( "+et+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(W)+"') "),r+=") { "+d+" = false; ",U=t.errorPath,K=l;var nt,rt=t.util.escapeQuotes(W);t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPath(U,W,t.opts.jsonPointers)),l=t.errSchemaPath+"/required",(nt=nt||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { missingProperty: '"+rt+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+rt+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",$=r,r=nt.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+$+"]); ":r+=" validate.errors = ["+$+"]; return false; ":r+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=K,t.errorPath=U,r+=" } else { "}else u?(r+=" if ( "+et+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(W)+"') "),r+=") { "+d+" = true; } else { "):(r+=" if ("+et+" !== undefined ",C&&(r+=" && Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(W)+"') "),r+=" ) { ");r+=" "+q+" } "}}u&&(r+=" if ("+d+") { ",p+="}")}}if(x.length){var it=x;if(it)for(var ot,st=-1,at=it.length-1;st0||!1===J:t.util.schemaHasRules(J,t.RULES.all))&&(f.schema=J,f.schemaPath=t.schemaPath+".patternProperties"+t.util.getProperty(ot),f.errSchemaPath=t.errSchemaPath+"/patternProperties/"+t.util.escapeFragment(ot),r+=C?" "+_+" = "+_+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+c+") { ",r+=" if ("+t.usePattern(ot)+".test("+m+")) { ",f.errorPath=t.util.getPathExpr(t.errorPath,m,t.opts.jsonPointers),z=c+"["+m+"]",f.dataPathArr[y]=m,q=t.validate(f),f.baseId=R,t.util.varOccurences(q,g)<2?r+=" "+t.util.varReplace(q,g,z)+" ":r+=" var "+g+" = "+z+"; "+q+" ",u&&(r+=" if (!"+d+") break; "),r+=" } ",u&&(r+=" else "+d+" = true; "),r+=" } ",u&&(r+=" if ("+d+") { ",p+="}"))}return u&&(r+=" "+p+" if ("+h+" == errors) {"),r}},441:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="errs__"+i,f=t.util.copy(t);f.level++;var p="valid"+f.level;if(r+="var "+h+" = errors;",t.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:t.util.schemaHasRules(s,t.RULES.all)){f.schema=s,f.schemaPath=a,f.errSchemaPath=l;var d="key"+i,m="idx"+i,v="i"+i,y="' + "+d+" + '",g="data"+(f.dataLevel=t.dataLevel+1),_="dataProperties"+i,E=t.opts.ownProperties,b=t.baseId;E&&(r+=" var "+_+" = undefined; "),r+=E?" "+_+" = "+_+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+_+".length; "+m+"++) { var "+d+" = "+_+"["+m+"]; ":" for (var "+d+" in "+c+") { ",r+=" var startErrs"+i+" = errors; ";var x=d,w=t.compositeRule;t.compositeRule=f.compositeRule=!0;var k=t.validate(f);f.baseId=b,t.util.varOccurences(k,g)<2?r+=" "+t.util.varReplace(k,g,x)+" ":r+=" var "+g+" = "+x+"; "+k+" ",t.compositeRule=f.compositeRule=w,r+=" if (!"+p+") { for (var "+v+"=startErrs"+i+"; "+v+"{"use strict";t.exports=function(t,e,n){var r,i,o=" ",s=t.level,a=t.dataLevel,l=t.schema[e],u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(a||""),f="valid"+s;if("#"==l||"#/"==l)t.isRoot?(r=t.async,i="validate"):(r=!0===t.root.schema.$async,i="root.refVal[0]");else{var p=t.resolveRef(t.baseId,l,t.isRoot);if(void 0===p){var d=t.MissingRefError.message(t.baseId,l);if("fail"==t.opts.missingRefs){t.logger.error(d),(g=g||[]).push(o),o="",!1!==t.createErrors?(o+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { ref: '"+t.util.escapeQuotes(l)+"' } ",!1!==t.opts.messages&&(o+=" , message: 'can\\'t resolve reference "+t.util.escapeQuotes(l)+"' "),t.opts.verbose&&(o+=" , schema: "+t.util.toQuotedString(l)+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),o+=" } "):o+=" {} ";var m=o;o=g.pop(),!t.compositeRule&&c?t.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(o+=" if (false) { ")}else{if("ignore"!=t.opts.missingRefs)throw new t.MissingRefError(t.baseId,l,d);t.logger.warn(d),c&&(o+=" if (true) { ")}}else if(p.inline){var v=t.util.copy(t);v.level++;var y="valid"+v.level;v.schema=p.schema,v.schemaPath="",v.errSchemaPath=l,o+=" "+t.validate(v).replace(/validate\.schema/g,p.code)+" ",c&&(o+=" if ("+y+") { ")}else r=!0===p.$async||t.async&&!1!==p.$async,i=p.code}if(i){var g;(g=g||[]).push(o),o="",t.opts.passContext?o+=" "+i+".call(this, ":o+=" "+i+"( ",o+=" "+h+", (dataPath || '')",'""'!=t.errorPath&&(o+=" + "+t.errorPath);var _=o+=" , "+(a?"data"+(a-1||""):"parentData")+" , "+(a?t.dataPathArr[a]:"parentDataProperty")+", rootData) ";if(o=g.pop(),r){if(!t.async)throw new Error("async schema referenced by sync schema");c&&(o+=" var "+f+"; "),o+=" try { await "+_+"; ",c&&(o+=" "+f+" = true; "),o+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(o+=" "+f+" = false; "),o+=" } ",c&&(o+=" if ("+f+") { ")}else o+=" if (!"+_+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",c&&(o+=" else { ")}return o}},287:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f=t.opts.$data&&s&&s.$data;f&&(r+=" var schema"+i+" = "+t.util.getData(s.$data,o,t.dataPathArr)+"; ");var p="schema"+i;if(!f)if(s.length0||!1===_:t.util.schemaHasRules(_,t.RULES.all))||(d[d.length]=v)}}else d=s;if(f||d.length){var E=t.errorPath,b=f||d.length>=t.opts.loopRequired,x=t.opts.ownProperties;if(u)if(r+=" var missing"+i+"; ",b){f||(r+=" var "+p+" = validate.schema"+a+"; ");var w="' + "+(C="schema"+i+"["+(O="i"+i)+"]")+" + '";t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPathExpr(E,C,t.opts.jsonPointers)),r+=" var "+h+" = true; ",f&&(r+=" if (schema"+i+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+i+")) "+h+" = false; else {"),r+=" for (var "+O+" = 0; "+O+" < "+p+".length; "+O+"++) { "+h+" = "+c+"["+p+"["+O+"]] !== undefined ",x&&(r+=" && Object.prototype.hasOwnProperty.call("+c+", "+p+"["+O+"]) "),r+="; if (!"+h+") break; } ",f&&(r+=" } "),r+=" if (!"+h+") { ",(T=T||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { missingProperty: '"+w+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+w+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var k=r;r=T.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+k+"]); ":r+=" validate.errors = ["+k+"]; return false; ":r+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var T,S=d;if(S)for(var O=-1,A=S.length-1;O{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f="valid"+o,p=t.opts.$data&&a&&a.$data;if(p?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,(a||p)&&!1!==t.opts.uniqueItems){p&&(i+=" var "+f+"; if ("+r+" === false || "+r+" === undefined) "+f+" = true; else if (typeof "+r+" != 'boolean') "+f+" = false; else { "),i+=" var i = "+h+".length , "+f+" = true , j; if (i > 1) { ";var d=t.schema.items&&t.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(d.indexOf("object")>=0||d.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+f+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var v="checkDataType"+(m?"s":"");i+=" if ("+t.util[v](d,"item",t.opts.strictNumbers,!0)+") continue; ",m&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",p&&(i+=" } "),i+=" if (!"+f+") { ";var y=y||[];y.push(i),i="",!1!==t.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),t.opts.verbose&&(i+=" , schema: ",i+=p?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var g=i;i=y.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { ")}else c&&(i+=" if (true) { ");return i}},508:t=>{"use strict";t.exports=function(t,e,n){var r="",i=!0===t.schema.$async,o=t.util.schemaHasRulesExcept(t.schema,t.RULES.all,"$ref"),s=t.self._getId(t.schema);if(t.opts.strictKeywords){var a=t.util.schemaUnknownRules(t.schema,t.RULES.keywords);if(a){var l="unknown keyword: "+a;if("log"!==t.opts.strictKeywords)throw new Error(l);t.logger.warn(l)}}if(t.isTop&&(r+=" var validate = ",i&&(t.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",s&&(t.opts.sourceCode||t.opts.processCode)&&(r+=" /*# sourceURL="+s+" */ ")),"boolean"==typeof t.schema||!o&&!t.schema.$ref){e="false schema";var u=t.level,c=t.dataLevel,h=t.schema[e],f=t.schemaPath+t.util.getProperty(e),p=t.errSchemaPath+"/"+e,d=!t.opts.allErrors,m="data"+(c||""),v="valid"+u;if(!1===t.schema){t.isTop?d=!0:r+=" var "+v+" = false; ",(z=z||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'boolean schema is false' "),t.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var y=r;r=z.pop(),!t.compositeRule&&d?t.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else t.isTop?r+=i?" return data; ":" validate.errors = null; return true; ":r+=" var "+v+" = true; ";return t.isTop&&(r+=" }; return validate; "),r}if(t.isTop){var g=t.isTop;if(u=t.level=0,c=t.dataLevel=0,m="data",t.rootId=t.resolve.fullPath(t.self._getId(t.root.schema)),t.baseId=t.baseId||t.rootId,delete t.isTop,t.dataPathArr=[""],void 0!==t.schema.default&&t.opts.useDefaults&&t.opts.strictDefaults){var _="default is ignored in the schema root";if("log"!==t.opts.strictDefaults)throw new Error(_);t.logger.warn(_)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{if(u=t.level,m="data"+((c=t.dataLevel)||""),s&&(t.baseId=t.resolve.url(t.baseId,s)),i&&!t.async)throw new Error("async schema in sync schema");r+=" var errs_"+u+" = errors;"}v="valid"+u,d=!t.opts.allErrors;var E="",b="",x=t.schema.type,w=Array.isArray(x);if(x&&t.opts.nullable&&!0===t.schema.nullable&&(w?-1==x.indexOf("null")&&(x=x.concat("null")):"null"!=x&&(x=[x,"null"],w=!0)),w&&1==x.length&&(x=x[0],w=!1),t.schema.$ref&&o){if("fail"==t.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+t.errSchemaPath+'" (see option extendRefs)');!0!==t.opts.extendRefs&&(o=!1,t.logger.warn('$ref: keywords ignored in schema at path "'+t.errSchemaPath+'"'))}if(t.schema.$comment&&t.opts.$comment&&(r+=" "+t.RULES.all.$comment.code(t,"$comment")),x){if(t.opts.coerceTypes)var k=t.util.coerceToTypes(t.opts.coerceTypes,x);var T=t.RULES.types[x];if(k||w||!0===T||T&&!X(T)){f=t.schemaPath+".type",p=t.errSchemaPath+"/type",f=t.schemaPath+".type",p=t.errSchemaPath+"/type";var S=w?"checkDataTypes":"checkDataType";if(r+=" if ("+t.util[S](x,m,t.opts.strictNumbers,!0)+") { ",k){var O="dataType"+u,A="coerced"+u;r+=" var "+O+" = typeof "+m+"; var "+A+" = undefined; ","array"==t.opts.coerceTypes&&(r+=" if ("+O+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+O+" = typeof "+m+"; if ("+t.util.checkDataType(t.schema.type,m,t.opts.strictNumbers)+") "+A+" = "+m+"; } "),r+=" if ("+A+" !== undefined) ; ";var C=k;if(C)for(var R,L=-1,P=C.length-1;L{"use strict";var r=/^[a-z_$][a-z0-9_$-]*$/i,i=n(165),o=n(128);t.exports={add:function(t,e){var n=this.RULES;if(n.keywords[t])throw new Error("Keyword "+t+" is already defined");if(!r.test(t))throw new Error("Keyword "+t+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var o=e.type;if(Array.isArray(o))for(var s=0;s{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!=e&&n!=n}},35:t=>{"use strict";t.exports=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var n,r="boolean"==typeof e.cycles&&e.cycles,i=e.cmp&&(n=e.cmp,function(t){return function(e,r){var i={key:e,value:t[e]},o={key:r,value:t[r]};return n(i,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);var n,s;if(Array.isArray(e)){for(s="[",n=0;n{"use strict";var e=t.exports=function(t,e,r){"function"==typeof e&&(r=e,e={}),n(e,"function"==typeof(r=e.cb||r)?r:r.pre||function(){},r.post||function(){},t,"",t)};function n(t,r,i,o,s,a,l,u,c,h){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var f in r(o,s,a,l,u,c,h),o){var p=o[f];if(Array.isArray(p)){if(f in e.arrayKeywords)for(var d=0;d{(()=>{var t={985:function(t){var e;"undefined"!=typeof self&&self,e=function(){return 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}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get: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=11)}([function(t,e,n){"use strict";var r=Array.prototype,i=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">"},s=/[&"'<>]/g;function a(t,e){return i.hasOwnProperty.call(t,e)}function l(t){return o[t]}function u(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,u.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var s=Object.getOwnPropertyDescriptor(i,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return i.stack})}else{var a=new Error(t).stack;o=function(){return a}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function c(t){return"[object Function]"===i.toString.call(t)}function h(t){return"[object Array]"===i.toString.call(t)}function f(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)s=i.slice(0,t.length),i.slice(s.length,a).forEach((function(t,n){n2?i-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:l,Root:h,NodeList:c,Value:u,Literal:f,Symbol:p,Group:d,Array:m,Pair:v,Dict:y,Output:U,Capture:V,TemplateData:K,If:_,IfAsync:E,InlineIf:b,For:x,AsyncEach:w,AsyncAll:k,Macro:T,Caller:S,Import:O,FromImport:A,FunCall:C,Filter:R,FilterAsync:L,KeywordArgs:P,Block:N,Super:I,Extends:F,Include:D,Set:j,Switch:M,Case:B,LookupVal:g,BinOp:H,In:z,Is:q,Or:G,And:Y,Not:W,Add:Q,Concat:X,Sub:J,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:st,CompareOperand:at,CallExtension:lt,CallExtensionAsync:ut,printNodes:function t(e,n){if(n=n||0,ct(e.typename+": ",n),e instanceof c)ct("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof lt)ct(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof l?r.push([e,t]):(i=i||{})[e]=t})),i?ct(JSON.stringify(i,null,2)+"\n",null,!0):ct("\n"),r.forEach((function(e){var r=e[0],i=e[1];ct("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),s=n(3),a=n(0).TemplateError,l=n(2).Frame,u=n(1).Obj,c={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},h=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new a(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var l=this._tmpid();this._emitLine(", "+this._makeCallback(l)),this._emitLine(this.buffer+" += runtime.suppressValue("+l+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+c[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,s.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof s.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+r+"]["+s+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+s+"]);"),e.set(t.name.children[s].value,a)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var a=t.name.children,l=a[0],u=a[1],c=this._tmpid(),h=this._tmpid();e.set(l.value,c),e.set(u.value,h),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+c+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+h+" = "+o+"["+c+"];"),this._emitLine('frame.set("'+l.value+'", '+c+");"),this._emitLine('frame.set("'+u.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var f=this._tmpid();e.set(t.name.value,f),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+f+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),a=this._tmpid(),l=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof s.Array){var u=t.name.children.length;this._emit("runtime."+l+"("+a+", "+u+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var c=t.name.value;this._emitLine("runtime."+l+"("+a+", 1, function("+c+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+c+'", '+c+");"),e.set(c,c)}this._emitLoopBindings(t,a,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var h=this._tmpid();this._emitLine("}, "+this._makeCallback(h)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+h+";"),t.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),a=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof s.Dict?i=e:(n.assertType(e,s.Symbol),r.push(e))}));var u,c=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),h=r.map((function(t){return'"'+t.value+'"'})),f=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));u=a?e.push(!0):new l,this._emitLines("var "+o+" = runtime.makeMacro(","["+h.join(", ")+"], ","["+f.join(", ")+"], ","function ("+c.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),u.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,u),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,u)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),s=this._makeCallback(i),a=n?"true":"false",l=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+a+", "+o+", "+l+", "+s),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,a=n._tmpid();t instanceof s.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+a+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,a),e.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof s.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new l,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(s.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new l;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(u);t.exports={compile:function(t,e,n,r,s){void 0===s&&(s={});var a=new h(r,s.throwOnUndefined),l=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return a.compile(o.transform(i.parse(l,n,s),e,r)),a.getCode()},Compiler:h}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var s=o.prototype;return s.resolve=function(t,e){return i.resolve(i.dirname(t),e)},s.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),s=n(15),a=n(0),l=n(5),u=n(18),c=n(10),h=c.FileSystemLoader,f=c.WebLoader,p=c.PrecompiledLoader,d=n(20),m=n(21),v=n(1),y=v.Obj,g=v.EmitterObj,_=n(2),E=_.handleError,b=_.Frame,x=n(22);function w(t,e,n){o((function(){t(e,n)}))}var k={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(E(t,null,null))}}}},T=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=a.isArray(t)?t:[t]:h?this.loaders=[new h("views")]:f&&(this.loaders=[new f("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(u).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),a._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=a.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,s=this,l=this,u=null;if(t&&t.raw&&(t=t.raw),a.isFunction(n)&&(i=n,n=null,e=e||!1),a.isFunction(e)&&(i=e,e=!1),t instanceof O)u=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var c=0;c0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var l=this.parsePrimary();r.addChild(new o.Pair(a.lineno,a.colno,a,l))}else r.addChild(a);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},l.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},l.parseExtends=function(){var t=this.peekToken();this.skipSymbol("extends")||this.fail("parseTemplateRef: expected extends");var e=new o.Extends(t.lineno,t.colno);return e.template=this.parseExpression(),this.advanceAfterBlockEnd(t.value),e},l.parseInclude=function(){var t=this.peekToken();this.skipSymbol("include")||this.fail("parseInclude: expected include");var e=new o.Include(t.lineno,t.colno);return e.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(e.ignoreMissing=!0),this.advanceAfterBlockEnd(t.value),e},l.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},l.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},l.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var a,l=this.peekToken(),u=[];do{this.skipSymbol(n);var c=this.parseExpression();this.advanceAfterBlockEnd(t);var h=this.parseUntilBlocks(n,r,e);u.push(new o.Case(l.line,l.col,c,h)),l=this.peekToken()}while(l&&l.value===n);switch(l.value){case r:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,s,u,a)},l.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var l=s[0],u=s[1],c=s[2];c===t?r+=1:c===e&&(r-=1),0===r?(i+=u,this.tokens.backN(l.length-u.length)):i+=l}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,i)])},l.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},l.parseExpression=function(){return this.parseInlineIf()},l.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},l.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},l.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},l.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},l.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},l.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},l.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},l.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},l.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},l.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},l.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},l.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},l.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},l.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},l.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},l.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},l.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},l.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},l.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},l.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},l.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},l.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var s=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,s))}else{var a=this.parseExpression();t.addChild(a)}}return t},l.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(a&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var l=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(l.lineno,l.colno,l,this.parseExpression())):r.addChild(l)}a=!0}return s.children.length&&r.addChild(s),r},l.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],j=L+this.current();switch(-1!==r.indexOf(D,j)&&(this.forward(),L=j,-1!==r.indexOf(D,j+this.current())&&(L=j+this.current(),this.forward())),L){case"(":F=d;break;case")":F=m;break;case"[":F=v;break;case"]":F=y;break;case"{":F=g;break;case"}":F=_;break;case",":F=b;break;case":":F=x;break;case"~":F=w;break;case"|":F=k;break;default:F=E}return R(F,L,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var M=this._extract("0123456789");return R(T,t+"."+M,e,n)}return R("int",t,e,n)}if(t.match(/^(true|false)$/))return R(S,t,e,n);if("none"===t)return R(O,t,e,n);if("null"===t)return R(O,t,e,n);if(t)return R(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var B,U=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,R(u,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,R(h,t,e,n);t="";var V=!1;for(this._matches(this.tags.COMMENT_START)&&(V=!0,t=this._extractString(this.tags.COMMENT_START));null!==(B=this._extractUntil(U));){if(t+=B,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!V){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var K=t.slice(-this.colno);if(/^\s+$/.test(K)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!V)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===B&&V)throw new Error("expected end of comment, got end of file");return R(V?p:l,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var u=l.length,c=v(l,u);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function s(){return"hole_"+o++}function a(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,s=r.repeat(" ",n/2-n%2),a=r.repeat(" ",n/2);return i.copySafeness(t,s+t+a)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var s in t)o.push([s,t[s]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],s=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var s=t.split("\n"),a=r.repeat(" ",e),l=s.map((function(t,e){return 0!==e||n?""+a+t:t})).join("\n");return i.copySafeness(t,l)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=l,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=u(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=u(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return s=n+t.split("").join(n)+n,i.copySafeness(t,s);var a=t.indexOf(e);if(0===r||-1===a)return t;for(var l=0,u=0;a>-1&&(-1===r||u=i&&c.push(n),o.push(c)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,s=r.map(t,(function(t){return t})),a=r.getAttrGetter(i);return s.sort((function(t,s){var l=i?a(t):t,u=i?a(s):s;if(o.env.opts.throwOnUndefined&&i&&(void 0===l||void 0===u))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(l)&&r.isString(u)&&(l=l.toLowerCase(),u=u.toLowerCase()),lu?e?-1:1:0})),s})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=c((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return a(t)}));return i.copySafeness(t,e.join(" "))},e.trim=c,e.truncate=function(t,e,n,r){var s=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var a=t.lastIndexOf(" ",e);-1===a&&(a=e),t=t.substring(0,a)}return t+=null!=r?r:"...",i.copySafeness(s,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var h=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,f=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){s(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(h),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":f.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return s(n)?e:n};var v=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return s(r)?e:r}));e.int=v,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t=t.length&&(e=0),this.current=t[e],this.current}}}t.exports=function(){return{range:function(t,e,n){void 0===e?(e=t,t=0,n=1):n||(n=1);var r=[];if(n>0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return r(Array.prototype.slice.call(arguments))},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,l=n(24);function u(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function c(t,e){(e=e||{}).isString=!0;var n=e.env||new a([]),r=e.wrapper||l;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([h(t,e.name,n)],e)}function h(t,e,n){var r,i=(n=n||new a([])).asyncFilters,l=n.extensionsList;e=e.replace(/\\/g,"/");try{r=s.compile(t,i,l,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new a([]),o=e.wrapper||l;if(e.isString)return c(t,e);var s=r.existsSync(t)&&r.statSync(t),f=[],p=[];if(s.isFile())f.push(h(r.readFileSync(t,"utf-8"),e.name||t,n));else if(s.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(s){var a=i.join(o,s),l=a.substr(i.join(t,"/").length),c=r.statSync(a);c&&c.isDirectory()?u(l+="/",e.exclude)||n(a):u(l,e.include)&&p.push(a)}))}(t);for(var d=0;dt.length||i>0&&s>=r||i<0&&s<=r);s+=i)o.push(n.memberLookup(t,s));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.r(i),r.d(i,{Component:()=>p,ComponentAttribute:()=>n,ComponentAttributeDefinition:()=>x,ComponentDefinition:()=>v,ComponentDrawOption:()=>k,ComponentLink:()=>R,ComponentLinkDefinition:()=>N,DefaultData:()=>Wi,DefaultDrawer:()=>Ni,DefaultMetadata:()=>Ii,DefaultParser:()=>Di,DefaultPlugin:()=>Ji,DefaultRender:()=>ji,FileInformation:()=>s,FileInput:()=>B,ParseError:()=>qi});var e=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,value:null,type:null,definition:null};t(this,e);var r=n.name,i=n.value,o=n.type,s=n.definition;this.name=r||null,this.value=i||null,this.type=o||null,this.definition=s||null}));const n=e;function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}const s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null};o(this,t);var n=e.path;this.path=n||null}var e,n;return e=t,(n=[{key:"fileName",get:function(){return this.path?this.path.replace(/^.*[\\/]/,""):null}}])&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,name:null,definition:null,drawOption:null,attributes:[],children:[]};l(this,a),t=s.call(this,e);var n=e.id,r=e.name,i=e.definition,o=e.drawOption,u=e.attributes,c=e.children;return t.__class="Component",t.id=n||null,t.name=r||null,t.definition=i||null,t.drawOption=o||null,t.attributes=u||[],t.children=c||[],t}return e=a,r=[{key:"setReferenceAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.containerRef.includes(t.definition.type)}));if(e){var r=this.attributes.filter((function(t){return t.definition.name===e.name}));r.length>0?r.forEach((function(e){e.value=t.id})):this.attributes.push(new n({name:e.name,value:t.id,type:"String",definition:e}))}}},{key:"removeAllReferenceAttributes",value:function(t){this.attributes=t?this.attributes.filter((function(e){var n=e.definition,r=e.value;return!("Reference"===n.type&&n.containerRef===t.definition.type&&r===t.id)})):this.attributes.filter((function(t){return"Reference"!==t.definition.type}))}},{key:"setLinkAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.name===t.definition.attributeRef})),r=this.attributes.find((function(t){var n=t.definition;return"Link"===n.type&&e.name===n.name}));r&&!r.value.includes(t.target)?r.value.push(t.target):r||this.attributes.push(new n({name:e.name,definition:e,type:"Array",value:[t.target]}))}},{key:"removeLinkAttribute",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.attributes=this.attributes.filter((function(n){if(e&&n.name!==e)return!0;if(n.definition&&"Link"===n.definition.type){var r=n.value.findIndex((function(e){return e===t}));return r>=0&&n.value.splice(r,1),0!==n.value.length}return!0}))}},{key:"getAttributeByName",value:function(t){return this.__getAttributeByName(this.attributes,t)}},{key:"__getAttributeByName",value:function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,icon:null,model:null,parentTypes:[],childrenTypes:[],definedAttributes:[],isContainer:!1};d(this,t);var n=e.type,r=e.icon,i=e.model,o=e.parentTypes,s=e.childrenTypes,a=e.definedAttributes,l=e.isContainer;this.type=n||null,this.icon=r||null,this.model=i||null,this.parentTypes=o||[],this.childrenTypes=s||[],this.definedAttributes=a||[],this.isContainer=void 0!==l&&l}));const v=m;function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,linkType:null,linkRef:[],containerRef:[],required:!1,definedAttributes:[],rules:{values:null,min:null,max:null,regex:null}};E(this,t);var n=e.name,r=e.type,i=e.linkType,o=e.linkRef,s=e.containerRef,a=e.definedAttributes,l=e.required,u=e.rules;this.name=n||null,this.type=r||null,this.linkType=i||null,this.linkRef=o||[],this.containerRef=s||[],this.definedAttributes=a||[],this.required=l||!1,this.rules=g({values:null,min:null,max:null,regex:null},u)}));const x=b;function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}const k=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:null,y:null,width:null,height:null,needsResizing:!1};w(this,t);var n=e.x,r=e.y,i=e.width,o=e.height,s=e.needsResizing;this.x=n||null,this.y=r||null,this.width=i||null,this.height=o||null,this.needsResizing=s||!1}));function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}function A(t,e){if(e&&("object"===T(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function C(t){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},C(t)}const R=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=C(n);if(r){var i=C(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return A(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{source:null,target:null,definition:null};S(this,o),t=i.call(this);var n=e.source,r=e.target,s=e.definition;return t.__class="Link",t.source=n||null,t.target=r||null,t.definition=s||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(s);function L(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var P=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{attributeRef:null,sourceRef:null,targetRef:null,type:null};L(this,t);var n=e.attributeRef,r=e.sourceRef,i=e.targetRef,o=e.type;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null}));const N=P;function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},D(t,e)}function j(t,e){if(e&&("object"===I(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function M(t){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},M(t)}const B=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&D(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=M(n);if(r){var i=M(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return j(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,name:null,content:null};F(this,o),t=i.call(this,e);var n=e.content;return t.content=n||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(s);class U extends Map{constructor(t,e=z){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(K(this,t))}has(t){return super.has(K(this,t))}set(t,e){return super.set($(this,t),e)}delete(t){return super.delete(H(this,t))}}class V extends Set{constructor(t,e=z){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(K(this,t))}add(t){return super.add($(this,t))}delete(t){return super.delete(H(this,t))}}function K({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function $({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function H({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function z(t){return null!==t&&"object"==typeof t?t.valueOf():t}function q(t){return t}function G(){}function Y(t){return null==t?G:function(){return this.querySelector(t)}}function W(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function Q(){return[]}function X(t){return null==t?Q:function(){return this.querySelectorAll(t)}}function J(t){return function(){return this.matches(t)}}function Z(t){return function(e){return e.matches(t)}}var tt=Array.prototype.find;function et(){return this.firstElementChild}var nt=Array.prototype.filter;function rt(){return Array.from(this.children)}function it(t){return new Array(t.length)}function ot(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function st(t){return function(){return t}}function at(t,e,n,r,i,o){for(var s,a=0,l=e.length,u=o.length;ae?1:t>=e?0:NaN}ot.prototype={constructor:ot,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var ft="http://www.w3.org/1999/xhtml";const pt={svg:"http://www.w3.org/2000/svg",xhtml:ft,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function dt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),pt.hasOwnProperty(e)?{space:pt[e],local:t}:t}function mt(t){return function(){this.removeAttribute(t)}}function vt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function yt(t,e){return function(){this.setAttribute(t,e)}}function gt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function _t(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Et(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function bt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function xt(t){return function(){this.style.removeProperty(t)}}function wt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function kt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Tt(t,e){return t.style.getPropertyValue(e)||bt(t).getComputedStyle(t,null).getPropertyValue(e)}function St(t){return function(){delete this[t]}}function Ot(t,e){return function(){this[t]=e}}function At(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Ct(t){return t.trim().split(/^|\s+/)}function Rt(t){return t.classList||new Lt(t)}function Lt(t){this._node=t,this._names=Ct(t.getAttribute("class")||"")}function Pt(t,e){for(var n=Rt(t),r=-1,i=e.length;++r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function Zt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ie=[null];function oe(t,e){this._groups=t,this._parents=e}function se(){return new oe([[document.documentElement]],ie)}oe.prototype=se.prototype={constructor:oe,select:function(t){"function"!=typeof t&&(t=Y(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=b&&(b=E+1);!(_=v[b])&&++b=0;)(r=i[o])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ht);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?xt:"function"==typeof e?kt:wt)(t,e,null==n?"":n)):Tt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?St:"function"==typeof e?At:Ot)(t,e)):this.node()[t]},classed:function(t,e){var n=Ct(t+"");if(arguments.length<2){for(var r=Rt(this.node()),i=-1,o=n.length;++i{}};function ue(){for(var t,e=0,n=arguments.length,r={};e=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function fe(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(void 0,t),e=e._next;--ye}()}finally{ye=0,function(){for(var t,e,n=me,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:me=e);ve=t,Le(r)}(),be=0}}function Re(){var t=we.now(),e=t-Ee;e>1e3&&(xe-=e,Ee=t)}function Le(t){ye||(ge&&(ge=clearTimeout(ge)),t-be>24?(t<1/0&&(ge=setTimeout(Ce,t-we.now()-xe)),_e&&(_e=clearInterval(_e))):(_e||(Ee=we.now(),_e=setInterval(Re,1e3)),ye=1,ke(Ce)))}function Pe(t,e,n){var r=new Oe;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Oe.prototype=Ae.prototype={constructor:Oe,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Te():+n)+(null==e?0:+e),this._next||ve===this||(ve?ve._next=this:me=this,ve=this),this._call=t,this._time=n,Le()},stop:function(){this._call&&(this._call=null,this._time=1/0,Le())}};var Ne=de("start","end","cancel","interrupt"),Ie=[];function Fe(t,e,n,r,i,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(l){var u,c,h,f;if(1!==n.state)return a();for(u in i)if((f=i[u]).name===n.name){if(3===f.state)return Pe(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[u]):+u0)throw new Error("too late; already scheduled");return n}function je(t,e){var n=Me(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Me(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Be(t,e){var n,r,i,o=t.__transition,s=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):s=!1;s&&delete t.__transition}}function Ue(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Ve,Ke=180/Math.PI,$e={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function He(t,e,n,r,i,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Ue(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Ue(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,s.skewX,a,l),function(t,e,n,r,o,s){if(t!==n||e!==r){var a=o.push(i(o)+"scale(",null,",",null,")");s.push({i:a-4,x:Ue(t,n)},{i:a-2,x:Ue(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,r=l.length;++n>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?gn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?gn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=an.exec(t))?new bn(e[1],e[2],e[3],1):(e=ln.exec(t))?new bn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=un.exec(t))?gn(e[1],e[2],e[3],e[4]):(e=cn.exec(t))?gn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=hn.exec(t))?On(e[1],e[2]/100,e[3]/100,1):(e=fn.exec(t))?On(e[1],e[2]/100,e[3]/100,e[4]):pn.hasOwnProperty(t)?yn(pn[t]):"transparent"===t?new bn(NaN,NaN,NaN,0):null}function yn(t){return new bn(t>>16&255,t>>8&255,255&t,1)}function gn(t,e,n,r){return r<=0&&(t=e=n=NaN),new bn(t,e,n,r)}function _n(t){return t instanceof Ze||(t=vn(t)),t?new bn((t=t.rgb()).r,t.g,t.b,t.opacity):new bn}function En(t,e,n,r){return 1===arguments.length?_n(t):new bn(t,e,n,null==r?1:r)}function bn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function xn(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}`}function wn(){const t=kn(this.opacity);return`${1===t?"rgb(":"rgba("}${Tn(this.r)}, ${Tn(this.g)}, ${Tn(this.b)}${1===t?")":`, ${t})`}`}function kn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Tn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Sn(t){return((t=Tn(t))<16?"0":"")+t.toString(16)}function On(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Cn(t,e,n,r)}function An(t){if(t instanceof Cn)return new Cn(t.h,t.s,t.l,t.opacity);if(t instanceof Ze||(t=vn(t)),!t)return new Cn;if(t instanceof Cn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=e===o?(n-r)/a+6*(n0&&l<1?0:s,new Cn(s,a,l,t.opacity)}function Cn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Rn(t){return(t=(t||0)%360)<0?t+360:t}function Ln(t){return Math.max(0,Math.min(1,t||0))}function Pn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Nn(t,e,n,r,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*n+(1+3*t+3*o-3*s)*r+s*i)/6}Xe(Ze,vn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:dn,formatHex:dn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return An(this).formatHsl()},formatRgb:mn,toString:mn}),Xe(bn,En,Je(Ze,{brighter(t){return t=null==t?en:Math.pow(en,t),new bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?tn:Math.pow(tn,t),new bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new bn(Tn(this.r),Tn(this.g),Tn(this.b),kn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xn,formatHex:xn,formatHex8:function(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}${Sn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:wn,toString:wn})),Xe(Cn,(function(t,e,n,r){return 1===arguments.length?An(t):new Cn(t,e,n,null==r?1:r)}),Je(Ze,{brighter(t){return t=null==t?en:Math.pow(en,t),new Cn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?tn:Math.pow(tn,t),new Cn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new bn(Pn(t>=240?t-240:t+120,i,r),Pn(t,i,r),Pn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Cn(Rn(this.h),Ln(this.s),Ln(this.l),kn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=kn(this.opacity);return`${1===t?"hsl(":"hsla("}${Rn(this.h)}, ${100*Ln(this.s)}%, ${100*Ln(this.l)}%${1===t?")":`, ${t})`}`}}));const In=t=>()=>t;function Fn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):In(isNaN(t)?e:t)}const Dn=function t(e){var n=function(t){return 1==(t=+t)?Fn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):In(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=En(t)).r,(e=En(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),s=Fn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return r.gamma=t,r}(1);function jn(t){return function(e){var n,r,i=e.length,o=new Array(i),s=new Array(i),a=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=ro&&(i=e.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Ue(n,r)})),o=Bn.lastIndex;return o=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?De:je;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}var ir=ae.prototype.constructor;function or(t){return function(){this.style.removeProperty(t)}}function sr(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ar(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&sr(t,o,n)),r}return o._value=e,o}function lr(t){return function(e){this.textContent=t.call(this,e)}}function ur(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&lr(r)),e}return r._value=t,r}var cr=0;function hr(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function fr(){return++cr}var pr=ae.prototype;hr.prototype=function(t){return ae().transition(t)}.prototype={constructor:hr,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Y(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s()=>t;function Cr(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}function Rr(t){return!t.ctrlKey&&!t.button}function Lr(){return this.parentNode}function Pr(t,e){return null==e?{x:t.x,y:t.y}:e}function Nr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ir(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function Fr(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=jr)):void 0===e&&(e=Dr);for(var n,r,i,o,s,a=new Ur(t),l=[a];n=l.pop();)if((i=e(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new Ur(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(Br)}function Dr(t){return t.children}function jr(t){return Array.isArray(t)?t[1]:null}function Mr(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Br(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Ur(t){this.data=t,this.depth=this.height=0,this.parent=null}function Vr(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Kr(t,e,n,r,i){for(var o,s=t.children,a=-1,l=s.length,u=t.value&&(r-e)/t.value;++a=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Fr(this).eachBefore(Mr)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;nf&&(f=a),v=c*c*m,(p=Math.max(f/v,v/h))>d){c-=a;break}d=p}y.push(s={value:c,dice:l1?e:1)},n}((1+Math.sqrt(5))/2);function zr(t){if("function"!=typeof t)throw new Error;return t}function qr(){return 0}function Gr(t){return function(){return t}}function Yr(t){return"string"==typeof t?new oe([document.querySelectorAll(t)],[document.documentElement]):new oe([W(t)],ie)}const Wr=Math.PI,Qr=2*Wr,Xr=1e-6,Jr=Qr-Xr;function Zr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ti(){return new Zr}Zr.prototype=ti.prototype={constructor:Zr,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,s=this._y1,a=n-t,l=r-e,u=o-t,c=s-e,h=u*u+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>Xr)if(Math.abs(c*a-l*u)>Xr&&i){var f=n-o,p=r-s,d=a*a+l*l,m=f*f+p*p,v=Math.sqrt(d),y=Math.sqrt(h),g=i*Math.tan((Wr-Math.acos((d+h-m)/(2*v*y)))/2),_=g/y,E=g/v;Math.abs(_-1)>Xr&&(this._+="L"+(t+_*u)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*f>u*p)+","+(this._x1=t+E*a)+","+(this._y1=e+E*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var s=(n=+n)*Math.cos(r),a=n*Math.sin(r),l=t+s,u=e+a,c=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>Xr||Math.abs(this._y1-u)>Xr)&&(this._+="L"+l+","+u),n&&(h<0&&(h=h%Qr+Qr),h>Jr?this._+="A"+n+","+n+",0,1,"+c+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):h>Xr&&(this._+="A"+n+","+n+",0,"+ +(h>=Wr)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};const ei=ti;var ni=Array.prototype.slice;function ri(t){return function(){return t}}function ii(t){return t[0]}function oi(t){return t[1]}function si(t){return t.source}function ai(t){return t.target}class li{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function ui(t){return new li(t,!0)}function ci(t){return((t=Math.exp(t))+1/t)/2}const hi=function t(e,n,r){function i(t,i){var o,s,a=t[0],l=t[1],u=t[2],c=i[0],h=i[1],f=i[2],p=c-a,d=h-l,m=p*p+d*d;if(m<1e-12)s=Math.log(f/u)/e,o=function(t){return[a+t*p,l+t*d,u*Math.exp(e*t*s)]};else{var v=Math.sqrt(m),y=(f*f-u*u+r*m)/(2*u*n*v),g=(f*f-u*u-r*m)/(2*f*n*v),_=Math.log(Math.sqrt(y*y+1)-y),E=Math.log(Math.sqrt(g*g+1)-g);s=(E-_)/e,o=function(t){var r,i=t*s,o=ci(_),c=u/(n*v)*(o*(r=e*i+_,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[a+c*p,l+c*d,u*o/ci(e*i+_)]}}return o.duration=1e3*s*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4),fi=t=>()=>t;function pi(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function di(t,e,n){this.k=t,this.x=e,this.y=n}di.prototype={constructor:di,scale:function(t){return 1===t?this:new di(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new di(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var mi=new di(1,0,0);function vi(t){for(;!t.__zoom;)if(!(t=t.parentNode))return mi;return t.__zoom}function yi(t){t.stopImmediatePropagation()}function gi(t){t.preventDefault(),t.stopImmediatePropagation()}function _i(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Ei(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function bi(){return this.__zoom||mi}function xi(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function wi(){return navigator.maxTouchPoints||"ontouchstart"in this}function ki(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}vi.prototype=di.prototype;var Ti=r(985),Si=r.n(Ti);const Oi='';function Ai(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],s=!0,a=!1;try{for(n=n.call(t);!(s=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);s=!0);}catch(t){a=!0,i=t}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}}(t,e)||Ci(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ci(t,e){if(t){if("string"==typeof t)return Ri(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ri(t,e):void 0}}function Ri(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{SelectEvent:null,EditEvent:null,DeleteEvent:null},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"root",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};Li(this,t),this.pluginData=e,this.rootId=i,this.resources=n,this.width=void 0!==o.width?o.width:1280,this.height=void 0!==o.height?o.height:1280,this.minWidth=void 0!==o.minWidth?o.minWidth:230,this.minHeight=void 0!==o.minHeight?o.minHeight:50,this.padding=void 0!==o.padding?o.padding:30,this.margin=void 0!==o.margin?o.margin:6,this.lineLengthPerDepth=void 0!==o.lineLengthPerDepth?o.lineLengthPerDepth:[5,1],this.actionMenuButtonSize=o.actionMenuButtonSize||24,this.actions={selection:{current:null,style:"2px solid hsl(205, 100%, 50%)",offset:"3px"},linkCreation:{source:null,target:null,creating:!1},drag:{offsetX:0,offsetY:0,state:!1,target:null}},this.setEvents(r)}var e,n;return e=t,n=[{key:"screenToSVG",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=n||this.svg.node(),i=new DOMPoint(t,e);return i.matrixTransform(r.getScreenCTM().inverse())}},{key:"SVGToScreen",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=n||this.svg.node(),i=new DOMPoint(t,e);return i.matrixTransform(r.getScreenCTM())}},{key:"setEvents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{SelectEvent:null,EditEvent:null,DeleteEvent:null};this.events={SelectEvent:t.SelectEvent||null,EditEvent:t.EditEvent||null,DeleteEvent:t.DeleteEvent||null}}},{key:"__getVerticalCoefficient",value:function(t){var e=this;if(t.children&&t.children.length>0){var n=Math.ceil(t.children.filter((function(t){return t&&t.data&&t.data.definition&&t.data.definition.isContainer})).reduce((function(t,n){return t+e.__getVerticalCoefficient(n)}),0));return t.children.filter((function(t){return!(t&&t.data&&t.data.definition&&t.data.definition.isContainer)})).reduce((function(t,e){return t+e.value}),0)/this.getLineLengthForDepth(t.depth)+n+(t.data&&t.data.definition&&t.data.definition.isContainer?1:0)}return t.value/this.getLineLengthForDepth(t.depth)+(t.data&&t.data.definition&&t.data.definition.isContainer?1:0)}},{key:"getLineLengthForDepth",value:function(t){return this.lineLengthPerDepth[Math.min(t,this.lineLengthPerDepth.length-1)]}},{key:"setDisabledStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".component",e="#".concat(this.rootId," ").concat(t||".component");Yr(e).classed("disabled",!0)}},{key:"unsetAllDisabledStyles",value:function(){Yr("#".concat(this.rootId," .disabled")).classed("disabled",!1)}},{key:"dragHandler",value:function(t,e){this.hideActionMenu();var n=document.elementsFromPoint(e.sourceEvent.x,e.sourceEvent.y).find((function(t){return e.subject.data.id!==t.dataset.parentId&&(t.classList.contains("container-background")||t.classList.contains("container"))})),r=Er("#".concat(e.subject.data.id)).attr("cursor","grabbing");Er("#root-components").append((function(){return r.node()}));var i=this.screenToSVG(e.sourceEvent.clientX,e.sourceEvent.clientY,this.svg.select(".container").node());if(Er(t).attr("transform",e.subject.transform="translate(".concat(i.x-this.actions.drag.offsetX,",\n ").concat(i.y-this.actions.drag.offsetY,")")),e.subject.x=i.x-this.actions.drag.offsetX,e.subject.y=i.y-this.actions.drag.offsetY,e.subject.data.definition){var o=e.subject.data.definition.parentTypes.map((function(t){return".component:not(#".concat(e.subject.data.id,"):not(.").concat(t,")")})).join(",");this.setDisabledStyle(o)}return this.drawLinks(),n}},{key:"setupDragBehavior",value:function(){var t=this,e=null,n=!1,r=this.dragHandler.bind(this);return function(){var t,e,n,r,i=Rr,o=Lr,s=Pr,a=Nr,l={},u=de("start","drag","end"),c=0,h=0;function f(t){t.on("mousedown.drag",p).filter(a).on("touchstart.drag",v).on("touchmove.drag",y,xr).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(s,a){if(!r&&i.call(this,s,a)){var l=_(this,o.call(this,s,a),s,a,"mouse");l&&(Er(s.view).on("mousemove.drag",d,wr).on("mouseup.drag",m,wr),Sr(s.view),kr(s),n=!1,t=s.clientX,e=s.clientY,l("start",s))}}function d(r){if(Tr(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>h}l.mouse("drag",r)}function m(t){Er(t.view).on("mousemove.drag mouseup.drag",null),Or(t.view,n),Tr(t),l.mouse("end",t)}function v(t,e){if(i.call(this,t,e)){var n,r,s=t.changedTouches,a=o.call(this,t,e),l=s.length;for(n=0;nsvg")).empty()?(this.svg=Er("#".concat(this.rootId)).append("svg").attr("viewBox",[0,0,this.width,this.height]).attr("preserveAspectRatio","xMinYMin meet").style("font","10px sans-serif"),this.svg.append("g").attr("class","container").attr("height","100%").attr("width","100%").attr("x",0).attr("y",0)):this.svg=Er("#".concat(this.rootId)).select("svg")}},{key:"draw",value:function(t){this.rootId=t,this.createRenderingContext(),this.__unselectComponent(),this.drawComponents(),this.drawLinks(),this.setViewPortAction(Er("#".concat(this.rootId)))}},{key:"clickHandler",value:function(t){t.stopPropagation(),this.__selectComponent(Er(t.currentTarget))}},{key:"drawComponents",value:function(){var t=this;this.shadowRoot={children:this.pluginData.components,id:"__shadowRoot",name:""};var e=this.buildTree(),n=this.clickHandler.bind(this),r=this.setupDragBehavior(),i=this.svg.select(".container").selectAll("g").data(e,(function(t){return t})).join("g").attr("id",(function(t){return Ai(t,1)[0]})).selectAll("g").data((function(t){return Ai(t,2)[1]})).join("g").attr("id",(function(t){return t.data.id})).on("click",n).call(r).attr("x",(function(t){return t.x0})).attr("y",(function(t){return t.y0})).attr("transform",(function(t){var e=t.x0,n=t.y0;return"translate(".concat(e,",").concat(n,")")}));i.filter((function(t){return"__shadowRoot"!==t.data.id})).attr("class",(function(t){var e=t.data;return"component\n component-".concat(e.definition.model,"\n ").concat(e.definition.type)})).html((function(e){var n=e.data;return Si().renderString(t.resources.models[n.definition.model],n)})).select("svg").attr("id",(function(t){var e=t.data;return"svg-".concat(e.id)})).attr("height",(function(t){var e=t.y0;return t.y1-e})).attr("width",(function(t){var e=t.x0;return t.x1-e})),i.select(".component-icon").html((function(e){var n=e.data;return t.resources.icons[n.definition.icon]})),i.select("rect").filter((function(t){return t.data&&t.data.definition&&t.data.definition.isContainer})).attr("height",(function(t){var e=t.y0;return t.y1-e})).attr("width",(function(t){var e=t.x0;return t.x1-e})),i.select(".component-container").attr("height",(function(e){var n=e.y0,r=e.y1;return Math.max(r-(n+t.minHeight)-t.margin,t.minHeight)})).attr("width",(function(e){var n=e.x0,r=e.x1;return Math.max(r-n-2*t.margin,t.minWidth)})).attr("x",(function(){return t.margin})).attr("y",(function(){return t.minHeight})).filter((function(t){return t.children})).append((function(t){var e=t.data;return Er("#group-".concat(e.id)).node()})),i.select(".component-container>rect").attr("data-parentId",(function(t){return t.data.id}))}},{key:"buildTree",value:function(){var t=this,e=function(){var t=Hr,e=!1,n=1,r=1,i=[0],o=qr,s=qr,a=qr,l=qr,u=qr;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(h),i=[0],e&&t.eachBefore(Vr),t}function h(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,h=e.x1-n,f=e.y1-n;h=r.length)return n(i);const s=new U,a=r[o++];let l=-1;for(const t of i){const e=a(t,++l,i),n=s.get(e);n?n.push(t):s.set(e,[t])}for(const[e,n]of s)s.set(e,t(n,o));return e(s)}(t,0)}(t,Array.from,q,e)}(n,(function(t){var e=t.parent;return e&&"__shadowRoot"!==e.data.id?"group-".concat(e.data.id):"root-components"})).filter((function(t){return"root-__shadowRoot"!==Ai(t,1)[0]}))}},{key:"getAnchorPoint",value:function(t,e){if(t.empty()||e.empty())return null;var n,r=t.node().getBoundingClientRect(),i=e.node().getBoundingClientRect(),o=[{y:r.top,x:r.x+r.width/2},{y:r.bottom,x:r.x+r.width/2},{x:r.left,y:r.top+r.height/2},{x:r.right,y:r.top+r.height/2}],s=[{y:i.top,x:i.x+i.width/2},{y:i.bottom,x:i.x+i.width/2},{x:i.left,y:i.top+i.height/2},{x:i.right,y:i.top+i.height/2}],a=1/0;o.forEach((function(t){s.forEach((function(e){var r=Math.round(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)));r0){var s=Math.max.apply(Math,function(t){if(Array.isArray(t))return Ri(t)}(i=t.items.map((function(t){return t.value})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||Ci(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());n=t.items.find((function(t){return t.value===s}))}}))}},{key:"__buildLines",value:function(t){var e=this,n=t.children,r=t.depth,i=[{total:0,items:[]}],o=0,s=i[o];return n.forEach((function(t){s.items.length>=e.getLineLengthForDepth(r)&&(i.push({total:0,items:[]}),o+=1),(s=i[o]).total+=t.value,s.items.push(t)})),i}},{key:"setViewPortAction",value:function(t){var e=this;this.svg.on("click",(function(){e.__unselectComponent(),e.cancelLinkCreationInteraction()}));var n=this.drawLinks.bind(this);t.call(function(){var t,e,n,r=_i,i=Ei,o=ki,s=xi,a=wi,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,h=hi,f=de("start","zoom","end"),p=500,d=0,m=10;function v(t){t.property("__zoom",bi).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",T).filter(a).on("touchstart.zoom",S).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new di(e,t.x,t.y)}function g(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new di(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function E(t,e,n,r){t.on("start.zoom",(function(){b(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,s=b(t,o).event(r),a=i.apply(t,o),l=null==n?_(a):"function"==typeof n?n.apply(t,o):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=t.__zoom,f="function"==typeof e?e.apply(t,o):e,p=h(c.invert(l).concat(u/c.k),f.invert(l).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=p(t),n=u/e[2];t=new di(n,l[0]-e[0]*n,l[1]-e[1]*n)}s.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new x(t,e)}function x(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function w(t,...e){if(r.apply(this,arguments)){var n=b(this,e).event(t),i=this.__zoom,a=Math.max(l[0],Math.min(l[1],i.k*Math.pow(2,s.apply(this,arguments)))),c=br(t);if(n.wheel)n.mouse[0][0]===c[0]&&n.mouse[0][1]===c[1]||(n.mouse[1]=i.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(i.k===a)return;n.mouse=[c,i.invert(c)],Be(this),n.start()}gi(t),n.wheel=setTimeout(h,150),n.zoom("mouse",o(g(y(i,a),n.mouse[0],n.mouse[1]),n.extent,u))}function h(){n.wheel=null,n.end()}}function k(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,s=b(this,e,!0).event(t),a=Er(t.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",p,!0),l=br(t,i),c=t.clientX,h=t.clientY;Sr(t.view),yi(t),s.mouse=[l,this.__zoom.invert(l)],Be(this),s.start()}function f(t){if(gi(t),!s.moved){var e=t.clientX-c,n=t.clientY-h;s.moved=e*e+n*n>d}s.event(t).zoom("mouse",o(g(s.that.__zoom,s.mouse[0]=br(t,i),s.mouse[1]),s.extent,u))}function p(t){a.on("mousemove.zoom mouseup.zoom",null),Or(t.view,s.moved),gi(t),s.event(t).end()}}function T(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,s=br(t.changedTouches?t.changedTouches[0]:t,this),a=n.invert(s),l=n.k*(t.shiftKey?.5:2),h=o(g(y(n,l),s,a),i.apply(this,e),u);gi(t),c>0?Er(this).transition().duration(c).call(E,h,s,t):Er(this).call(v.transform,h,s,t)}}function S(n,...i){if(r.apply(this,arguments)){var o,s,a,l,u=n.touches,c=u.length,h=b(this,i,n.changedTouches.length===c).event(n);for(yi(n),s=0;s',handler:function(){this.startLinkCreationInteraction()}},{id:"remove-component",icon:Oi,handler:function(){this.pluginData.removeComponentById(this.actions.selection.current.id),this.draw(this.rootId)}}]:[{id:"remove-link",icon:Oi,handler:function(){this.pluginData.removeLink(this.actions.selection.current),this.draw(this.rootId)}}]}},{key:"cancelLinkCreationInteraction",value:function(){this.actions.linkCreation.creating=!1,this.actions.linkCreation.source=null,this.actions.linkCreation.target=null,this.unsetAllDisabledStyles()}},{key:"hideActionMenu",value:function(){Er("#action-menu").remove()}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"Error happened when trying to parse.",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"Error";return Bi(this,o),(t=i.call(this,e)).name="ParseError",t.startLine=n,t.startColumn=r,t.endLine=s,t.endColumn=a,t.severity=l,t}return r=o,Object.defineProperty(r,"prototype",{writable:!1}),r}(Vi(Error));function Gi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Yi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,version:null,components:[],definitions:{components:[],links:[]},parseErrors:[]};Gi(this,t),this.name=e.name||null,this.version=e.version||null,this.components=e.components||[],this.definitions={components:[],links:[]},e.definitions&&(this.definitions.components=e.definitions.components||[],this.definitions.links=e.definitions.links||[]),this.parseErrors=e.parseErrors||[]}var e,n;return e=t,n=[{key:"coreVersion",get:function(){return"0.10.0"}},{key:"getComponentById",value:function(t){return this.__getComponentById(this.components,t)}},{key:"__getComponentById",value:function(t,e){for(var n=0;n0&&n.__removeRefAttributeById(t.children,e),t.removeLinkAttribute(e)}))}},{key:"removeLink",value:function(t){var e=t.source,n=t.target,r=t.definition.attributeRef;this.getComponentById(e).removeLinkAttribute(n,r)}},{key:"getLinks",value:function(){var t=this,e=[];return this.definitions.links.forEach((function(n){t.getComponentsByType(n.sourceRef).forEach((function(t){var r=t.getAttributeByName(n.attributeRef);r&&r.value.forEach((function(r){return e.push(new R({definition:n,source:t.id,target:r}))}))}))})),e}},{key:"initLinkDefinitions",value:function(){var t=this;this.definitions.links=[],this.definitions.components.forEach((function(e){var n=e.type,r=e.definedAttributes;t.__setLinkDefinitions(n,r)}))}},{key:"__setLinkDefinitions",value:function(t,e){var n=this;e.forEach((function(e){if("Link"===e.type){var r=new N({type:e.linkType,attributeRef:e.name,sourceRef:t,targetRef:e.linkRef});n.definitions.links.push(r)}else"Object"===e.type&&n.__setLinkDefinitions(t,e.definedAttributes)}))}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{pluginData:null,pluginDrawer:null,pluginMetadata:null,pluginParser:null,pluginRenderer:null};Qi(this,t),this.data=e.pluginData||new Wi,this.__drawer=e.pluginDrawer||new Ni(this.data),this.__metadata=e.pluginMetadata||new Ii(this.data),this.__parser=e.pluginParser||new Di(this.data),this.__renderer=e.pluginRenderer||new ji(this.data)}var e,n;return e=t,n=[{key:"init",value:function(t){this.__drawer.setEvents(t),this.__metadata.parse(),this.data.initLinkDefinitions()}},{key:"initResources",value:function(t){this.__drawer.resources=t}},{key:"draw",value:function(t){this.__drawer.draw(t)}},{key:"parse",value:function(t,e){this.__parser.parse(e),this.__parser.parseConfiguration(t)}},{key:"isParsable",value:function(t){return this.__parser.isParsable(t)}},{key:"render",value:function(t){return this.__renderer.renderConfiguration(t),this.__renderer.render()}}],n&&function(t,e){for(var n=0;n":">"},s=/[&"'<>]/g;function a(t,e){return i.hasOwnProperty.call(t,e)}function l(t){return o[t]}function u(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,u.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var s=Object.getOwnPropertyDescriptor(i,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return i.stack})}else{var a=new Error(t).stack;o=function(){return a}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function c(t){return"[object Function]"===i.toString.call(t)}function h(t){return"[object Array]"===i.toString.call(t)}function f(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)s=i.slice(0,t.length),i.slice(s.length,a).forEach((function(t,n){n2?i-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:l,Root:h,NodeList:c,Value:u,Literal:f,Symbol:p,Group:d,Array:m,Pair:v,Dict:y,Output:U,Capture:V,TemplateData:K,If:_,IfAsync:E,InlineIf:b,For:x,AsyncEach:w,AsyncAll:k,Macro:T,Caller:S,Import:O,FromImport:A,FunCall:C,Filter:R,FilterAsync:L,KeywordArgs:P,Block:N,Super:I,Extends:F,Include:D,Set:j,Switch:M,Case:B,LookupVal:g,BinOp:H,In:z,Is:q,Or:G,And:Y,Not:W,Add:Q,Concat:X,Sub:J,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:st,CompareOperand:at,CallExtension:lt,CallExtensionAsync:ut,printNodes:function t(e,n){if(n=n||0,ct(e.typename+": ",n),e instanceof c)ct("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof lt)ct(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof l?r.push([e,t]):(i=i||{})[e]=t})),i?ct(JSON.stringify(i,null,2)+"\n",null,!0):ct("\n"),r.forEach((function(e){var r=e[0],i=e[1];ct("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),s=n(3),a=n(0).TemplateError,l=n(2).Frame,u=n(1).Obj,c={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},h=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new a(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var l=this._tmpid();this._emitLine(", "+this._makeCallback(l)),this._emitLine(this.buffer+" += runtime.suppressValue("+l+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+c[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,s.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof s.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+r+"]["+s+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+s+"]);"),e.set(t.name.children[s].value,a)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var a=t.name.children,l=a[0],u=a[1],c=this._tmpid(),h=this._tmpid();e.set(l.value,c),e.set(u.value,h),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+c+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+h+" = "+o+"["+c+"];"),this._emitLine('frame.set("'+l.value+'", '+c+");"),this._emitLine('frame.set("'+u.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var f=this._tmpid();e.set(t.name.value,f),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+f+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),a=this._tmpid(),l=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof s.Array){var u=t.name.children.length;this._emit("runtime."+l+"("+a+", "+u+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var c=t.name.value;this._emitLine("runtime."+l+"("+a+", 1, function("+c+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+c+'", '+c+");"),e.set(c,c)}this._emitLoopBindings(t,a,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var h=this._tmpid();this._emitLine("}, "+this._makeCallback(h)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+h+";"),t.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),a=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof s.Dict?i=e:(n.assertType(e,s.Symbol),r.push(e))}));var u,c=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),h=r.map((function(t){return'"'+t.value+'"'})),f=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));u=a?e.push(!0):new l,this._emitLines("var "+o+" = runtime.makeMacro(","["+h.join(", ")+"], ","["+f.join(", ")+"], ","function ("+c.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),u.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,u),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,u)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),s=this._makeCallback(i),a=n?"true":"false",l=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+a+", "+o+", "+l+", "+s),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,a=n._tmpid();t instanceof s.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+a+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,a),e.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof s.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new l,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(s.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new l;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(u);t.exports={compile:function(t,e,n,r,s){void 0===s&&(s={});var a=new h(r,s.throwOnUndefined),l=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return a.compile(o.transform(i.parse(l,n,s),e,r)),a.getCode()},Compiler:h}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var s=o.prototype;return s.resolve=function(t,e){return i.resolve(i.dirname(t),e)},s.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),s=n(15),a=n(0),l=n(5),u=n(18),c=n(10),h=c.FileSystemLoader,f=c.WebLoader,p=c.PrecompiledLoader,d=n(20),m=n(21),v=n(1),y=v.Obj,g=v.EmitterObj,_=n(2),E=_.handleError,b=_.Frame,x=n(22);function w(t,e,n){o((function(){t(e,n)}))}var k={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(E(t,null,null))}}}},T=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=a.isArray(t)?t:[t]:h?this.loaders=[new h("views")]:f&&(this.loaders=[new f("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(u).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),a._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=a.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,s=this,l=this,u=null;if(t&&t.raw&&(t=t.raw),a.isFunction(n)&&(i=n,n=null,e=e||!1),a.isFunction(e)&&(i=e,e=!1),t instanceof O)u=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var c=0;c0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var l=this.parsePrimary();r.addChild(new o.Pair(a.lineno,a.colno,a,l))}else r.addChild(a);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},l.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},l.parseExtends=function(){var t=this.peekToken();this.skipSymbol("extends")||this.fail("parseTemplateRef: expected extends");var e=new o.Extends(t.lineno,t.colno);return e.template=this.parseExpression(),this.advanceAfterBlockEnd(t.value),e},l.parseInclude=function(){var t=this.peekToken();this.skipSymbol("include")||this.fail("parseInclude: expected include");var e=new o.Include(t.lineno,t.colno);return e.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(e.ignoreMissing=!0),this.advanceAfterBlockEnd(t.value),e},l.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},l.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},l.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var a,l=this.peekToken(),u=[];do{this.skipSymbol(n);var c=this.parseExpression();this.advanceAfterBlockEnd(t);var h=this.parseUntilBlocks(n,r,e);u.push(new o.Case(l.line,l.col,c,h)),l=this.peekToken()}while(l&&l.value===n);switch(l.value){case r:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,s,u,a)},l.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var l=s[0],u=s[1],c=s[2];c===t?r+=1:c===e&&(r-=1),0===r?(i+=u,this.tokens.backN(l.length-u.length)):i+=l}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,i)])},l.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},l.parseExpression=function(){return this.parseInlineIf()},l.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},l.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},l.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},l.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},l.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},l.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},l.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},l.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},l.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},l.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},l.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},l.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},l.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},l.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},l.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},l.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},l.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},l.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},l.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},l.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},l.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},l.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var s=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,s))}else{var a=this.parseExpression();t.addChild(a)}}return t},l.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(a&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var l=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(l.lineno,l.colno,l,this.parseExpression())):r.addChild(l)}a=!0}return s.children.length&&r.addChild(s),r},l.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],j=L+this.current();switch(-1!==r.indexOf(D,j)&&(this.forward(),L=j,-1!==r.indexOf(D,j+this.current())&&(L=j+this.current(),this.forward())),L){case"(":F=d;break;case")":F=m;break;case"[":F=v;break;case"]":F=y;break;case"{":F=g;break;case"}":F=_;break;case",":F=b;break;case":":F=x;break;case"~":F=w;break;case"|":F=k;break;default:F=E}return R(F,L,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var M=this._extract("0123456789");return R(T,t+"."+M,e,n)}return R("int",t,e,n)}if(t.match(/^(true|false)$/))return R(S,t,e,n);if("none"===t)return R(O,t,e,n);if("null"===t)return R(O,t,e,n);if(t)return R(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var B,U=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,R(u,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,R(h,t,e,n);t="";var V=!1;for(this._matches(this.tags.COMMENT_START)&&(V=!0,t=this._extractString(this.tags.COMMENT_START));null!==(B=this._extractUntil(U));){if(t+=B,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!V){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var K=t.slice(-this.colno);if(/^\s+$/.test(K)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!V)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===B&&V)throw new Error("expected end of comment, got end of file");return R(V?p:l,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var u=l.length,c=v(l,u);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function s(){return"hole_"+o++}function a(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,s=r.repeat(" ",n/2-n%2),a=r.repeat(" ",n/2);return i.copySafeness(t,s+t+a)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var s in t)o.push([s,t[s]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],s=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var s=t.split("\n"),a=r.repeat(" ",e),l=s.map((function(t,e){return 0!==e||n?""+a+t:t})).join("\n");return i.copySafeness(t,l)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=l,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=u(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=u(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return s=n+t.split("").join(n)+n,i.copySafeness(t,s);var a=t.indexOf(e);if(0===r||-1===a)return t;for(var l=0,u=0;a>-1&&(-1===r||u=i&&c.push(n),o.push(c)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,s=r.map(t,(function(t){return t})),a=r.getAttrGetter(i);return s.sort((function(t,s){var l=i?a(t):t,u=i?a(s):s;if(o.env.opts.throwOnUndefined&&i&&(void 0===l||void 0===u))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(l)&&r.isString(u)&&(l=l.toLowerCase(),u=u.toLowerCase()),lu?e?-1:1:0})),s})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=c((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return a(t)}));return i.copySafeness(t,e.join(" "))},e.trim=c,e.truncate=function(t,e,n,r){var s=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var a=t.lastIndexOf(" ",e);-1===a&&(a=e),t=t.substring(0,a)}return t+=null!=r?r:"...",i.copySafeness(s,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var h=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,f=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){s(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(h),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":f.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return s(n)?e:n};var v=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return s(r)?e:r}));e.int=v,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t=t.length&&(e=0),this.current=t[e],this.current}}}t.exports=function(){return{range:function(t,e,n){void 0===e?(e=t,t=0,n=1):n||(n=1);var r=[];if(n>0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return r(Array.prototype.slice.call(arguments))},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,l=n(24);function u(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function c(t,e){(e=e||{}).isString=!0;var n=e.env||new a([]),r=e.wrapper||l;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([h(t,e.name,n)],e)}function h(t,e,n){var r,i=(n=n||new a([])).asyncFilters,l=n.extensionsList;e=e.replace(/\\/g,"/");try{r=s.compile(t,i,l,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new a([]),o=e.wrapper||l;if(e.isString)return c(t,e);var s=r.existsSync(t)&&r.statSync(t),f=[],p=[];if(s.isFile())f.push(h(r.readFileSync(t,"utf-8"),e.name||t,n));else if(s.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(s){var a=i.join(o,s),l=a.substr(i.join(t,"/").length),c=r.statSync(a);c&&c.isDirectory()?u(l+="/",e.exclude)||n(a):u(l,e.include)&&p.push(a)}))}(t);for(var d=0;dt.length||i>0&&s>=r||i<0&&s<=r);s+=i)o.push(n.memberLookup(t,s));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,v=String.fromCharCode;function y(t){throw new RangeError(d[t])}function g(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+function(t,e){for(var n=[],r=t.length;r--;)n[r]=e(t[r]);return n}((t=t.replace(p,".")).split("."),e).join(".")}function _(t){for(var e=[],n=0,r=t.length;n=55296&&i<=56319&&n>1,t+=m(t/e);t>455;r+=c)t=m(t/35);return m(r+36*t/(t+38))},x=function(t){var e,n=[],r=t.length,i=0,o=128,s=72,a=t.lastIndexOf("-");a<0&&(a=0);for(var l=0;l=128&&y("not-basic"),n.push(t.charCodeAt(l));for(var h=a>0?a+1:0;h=r&&y("invalid-input");var v=(e=t.charCodeAt(h++))-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c;(v>=c||v>m((u-i)/p))&&y("overflow"),i+=v*p;var g=d<=s?1:d>=s+26?26:d-s;if(vm(u/_)&&y("overflow"),p*=_}var E=n.length+1;s=b(i-f,E,0==f),m(i/E)>u-o&&y("overflow"),o+=m(i/E),i%=E,n.splice(i++,0,o)}return String.fromCodePoint.apply(String,n)},w=function(t){var e=[],n=(t=_(t)).length,r=128,i=0,o=72,s=!0,a=!1,l=void 0;try{for(var h,f=t[Symbol.iterator]();!(s=(h=f.next()).done);s=!0){var p=h.value;p<128&&e.push(v(p))}}catch(t){a=!0,l=t}finally{try{!s&&f.return&&f.return()}finally{if(a)throw l}}var d=e.length,g=d;for(d&&e.push("-");g=r&&Am((u-i)/C)&&y("overflow"),i+=(x-r)*C,r=x;var R=!0,L=!1,P=void 0;try{for(var N,I=t[Symbol.iterator]();!(R=(N=I.next()).done);R=!0){var F=N.value;if(Fu&&y("overflow"),F==r){for(var D=i,j=c;;j+=c){var M=j<=o?1:j>=o+26?26:j-o;if(D>6|192).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase():"%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase()}function A(t){for(var e="",n=0,r=t.length;n=194&&i<224){if(r-n>=6){var o=parseInt(t.substr(n+4,2),16);e+=String.fromCharCode((31&i)<<6|63&o)}else e+=t.substr(n,6);n+=6}else if(i>=224){if(r-n>=9){var s=parseInt(t.substr(n+4,2),16),a=parseInt(t.substr(n+7,2),16);e+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}else e+=t.substr(n,9);n+=9}else e+=t.substr(n,3),n+=3}return e}function C(t,e){function n(t){var n=A(t);return n.match(e.UNRESERVED)?n:t}return t.scheme&&(t.scheme=String(t.scheme).replace(e.PCT_ENCODED,n).toLowerCase().replace(e.NOT_SCHEME,"")),void 0!==t.userinfo&&(t.userinfo=String(t.userinfo).replace(e.PCT_ENCODED,n).replace(e.NOT_USERINFO,O).replace(e.PCT_ENCODED,i)),void 0!==t.host&&(t.host=String(t.host).replace(e.PCT_ENCODED,n).toLowerCase().replace(e.NOT_HOST,O).replace(e.PCT_ENCODED,i)),void 0!==t.path&&(t.path=String(t.path).replace(e.PCT_ENCODED,n).replace(t.scheme?e.NOT_PATH:e.NOT_PATH_NOSCHEME,O).replace(e.PCT_ENCODED,i)),void 0!==t.query&&(t.query=String(t.query).replace(e.PCT_ENCODED,n).replace(e.NOT_QUERY,O).replace(e.PCT_ENCODED,i)),void 0!==t.fragment&&(t.fragment=String(t.fragment).replace(e.PCT_ENCODED,n).replace(e.NOT_FRAGMENT,O).replace(e.PCT_ENCODED,i)),t}function R(t){return t.replace(/^0*(.*)/,"$1")||"0"}function L(t,e){var n=t.match(e.IPV4ADDRESS)||[],r=l(n,2)[1];return r?r.split(".").map(R).join("."):t}function P(t,e){var n=t.match(e.IPV6ADDRESS)||[],r=l(n,3),i=r[1],o=r[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),a=l(s,2),u=a[0],c=a[1],h=c?c.split(":").map(R):[],f=u.split(":").map(R),p=e.IPV4ADDRESS.test(f[f.length-1]),d=p?7:8,m=f.length-d,v=Array(d),y=0;y1){var E=v.slice(0,g.index),b=v.slice(g.index+g.length);_=E.join(":")+"::"+b.join(":")}else _=v.join(":");return o&&(_+="%"+o),_}return t}var N=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,I=void 0==="".match(/(){0}/)[1];function F(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==e.iri?a:s;"suffix"===e.reference&&(t=(e.scheme?e.scheme+":":"")+"//"+t);var i=t.match(N);if(i){I?(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5])):(n.scheme=i[1]||void 0,n.userinfo=-1!==t.indexOf("@")?i[3]:void 0,n.host=-1!==t.indexOf("//")?i[4]:void 0,n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=-1!==t.indexOf("?")?i[7]:void 0,n.fragment=-1!==t.indexOf("#")?i[8]:void 0,isNaN(n.port)&&(n.port=t.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),n.host&&(n.host=P(L(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",e.reference&&"suffix"!==e.reference&&e.reference!==n.reference&&(n.error=n.error||"URI is not a "+e.reference+" reference.");var o=S[(e.scheme||n.scheme||"").toLowerCase()];if(e.unicodeSupport||o&&o.unicodeSupport)C(n,r);else{if(n.host&&(e.domainHost||o&&o.domainHost))try{n.host=k(n.host.replace(r.PCT_ENCODED,A).toLowerCase())}catch(t){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+t}C(n,s)}o&&o.parse&&o.parse(n,e)}else n.error=n.error||"URI can not be parsed.";return n}function D(t,e){var n=!1!==e.iri?a:s,r=[];return void 0!==t.userinfo&&(r.push(t.userinfo),r.push("@")),void 0!==t.host&&r.push(P(L(String(t.host),n),n).replace(n.IPV6ADDRESS,(function(t,e,n){return"["+e+(n?"%25"+n:"")+"]"}))),"number"!=typeof t.port&&"string"!=typeof t.port||(r.push(":"),r.push(String(t.port))),r.length?r.join(""):void 0}var j=/^\.\.?\//,M=/^\/\.(\/|$)/,B=/^\/\.\.(\/|$)/,U=/^\/?(?:.|\n)*?(?=\/|$)/;function V(t){for(var e=[];t.length;)if(t.match(j))t=t.replace(j,"");else if(t.match(M))t=t.replace(M,"/");else if(t.match(B))t=t.replace(B,"/"),e.pop();else if("."===t||".."===t)t="";else{var n=t.match(U);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];t=t.slice(r.length),e.push(r)}return e.join("")}function K(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.iri?a:s,r=[],i=S[(e.scheme||t.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(t,e),t.host)if(n.IPV6ADDRESS.test(t.host));else if(e.domainHost||i&&i.domainHost)try{t.host=e.iri?T(t.host):k(t.host.replace(n.PCT_ENCODED,A).toLowerCase())}catch(n){t.error=t.error||"Host's domain name can not be converted to "+(e.iri?"Unicode":"ASCII")+" via punycode: "+n}C(t,n),"suffix"!==e.reference&&t.scheme&&(r.push(t.scheme),r.push(":"));var o=D(t,e);if(void 0!==o&&("suffix"!==e.reference&&r.push("//"),r.push(o),t.path&&"/"!==t.path.charAt(0)&&r.push("/")),void 0!==t.path){var l=t.path;e.absolutePath||i&&i.absolutePath||(l=V(l)),void 0===o&&(l=l.replace(/^\/\//,"/%2F")),r.push(l)}return void 0!==t.query&&(r.push("?"),r.push(t.query)),void 0!==t.fragment&&(r.push("#"),r.push(t.fragment)),r.join("")}function $(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(t=F(K(t,n),n),e=F(K(e,n),n)),!(n=n||{}).tolerant&&e.scheme?(r.scheme=e.scheme,r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=V(e.path||""),r.query=e.query):(void 0!==e.userinfo||void 0!==e.host||void 0!==e.port?(r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=V(e.path||""),r.query=e.query):(e.path?("/"===e.path.charAt(0)?r.path=V(e.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?r.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:r.path=e.path:r.path="/"+e.path,r.path=V(r.path)),r.query=e.query):(r.path=t.path,void 0!==e.query?r.query=e.query:r.query=t.query),r.userinfo=t.userinfo,r.host=t.host,r.port=t.port),r.scheme=t.scheme),r.fragment=e.fragment,r}function H(t,e){return t&&t.toString().replace(e&&e.iri?a.PCT_ENCODED:s.PCT_ENCODED,A)}var z={scheme:"http",domainHost:!0,parse:function(t,e){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t},serialize:function(t,e){var n="https"===String(t.scheme).toLowerCase();return t.port!==(n?443:80)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}},q={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize};function G(t){return"boolean"==typeof t.secure?t.secure:"wss"===String(t.scheme).toLowerCase()}var Y={scheme:"ws",domainHost:!0,parse:function(t,e){var n=t;return n.secure=G(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(t,e){if(t.port!==(G(t)?443:80)&&""!==t.port||(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){var n=t.resourceName.split("?"),r=l(n,2),i=r[0],o=r[1];t.path=i&&"/"!==i?i:void 0,t.query=o,t.resourceName=void 0}return t.fragment=void 0,t}},W={scheme:"wss",domainHost:Y.domainHost,parse:Y.parse,serialize:Y.serialize},Q={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",J="[0-9A-Fa-f]",Z=n(n("%[EFef][0-9A-Fa-f]%"+J+J+"%"+J+J)+"|"+n("%[89A-Fa-f][0-9A-Fa-f]%"+J+J)+"|"+n("%"+J+J)),tt=e("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),et=new RegExp(X,"g"),nt=new RegExp(Z,"g"),rt=new RegExp(e("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',tt),"g"),it=new RegExp(e("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ot=it;function st(t){var e=A(t);return e.match(et)?e:t}var at={scheme:"mailto",parse:function(t,e){var n=t,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var i=!1,o={},s=n.query.split("&"),a=0,l=s.length;a{},894:t=>{"use strict";t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},680:t=>{"use strict";t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{default:()=>Lr});var t=n(181);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function s(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}const l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,n,r,l=(n=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(n);if(r){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return s(this,t)});function u(){return i(this,u),l.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(t.DefaultDrawer);var u=n(96),c=n.n(u);function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function d(t,e){if(e&&("object"===h(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}const v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=m(n);if(r){var i=m(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return d(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{blockType:null,provider:null};return f(this,o),(t=i.call(this,e)).blockType=e.blockType||null,t.provider=e.provider||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(t.ComponentDefinition),y={$id:"https://ditrit.io/schemas",type:"object",properties:{name:{type:"string"},model:{type:"string"},icon:{type:"string"},attributes:{type:"array",items:{$ref:"#/definitions/attribute"}},data:{type:"array",items:{$ref:"#/definitions/data"}},modules:{type:"array",items:{$ref:"#/definitions/module"}},resources:{type:"array",items:{$ref:"#/definitions/resource"}},variables:{type:"array",items:{$ref:"#/definitions/variable"}}},required:["name","attributes","data","modules","resources","variables"],definitions:{defaultObject:{type:"object",properties:{type:{type:"string"},model:{type:"string"},icon:{type:"string"},isContainer:{type:"boolean"},attributes:{type:"array",items:{$ref:"#/definitions/attribute"}}},required:["type","attributes"]},attribute:{type:"object",properties:{name:{type:"string"},type:{type:"string",pattern:"(String|Boolean|Number|Array|Object|Link|Reference)"},required:{type:"boolean"},linkType:{type:"string",pattern:"(Default|Reverse)"},linkRef:{type:"string"},containerRef:{type:"string"},attributes:{type:"array",items:{$ref:"#/definitions/attribute"}},rules:{$ref:"#/definitions/rule"}},required:["name","type"]},rule:{type:"object",properties:{values:{type:"array",items:{type:"string"}},min:{type:"integer"},max:{type:"integer"},regex:{type:"string"}}},data:{$ref:"#/definitions/defaultObject"},module:{$ref:"#/definitions/defaultObject"},resource:{$ref:"#/definitions/defaultObject"},variable:{$ref:"#/definitions/defaultObject"}}},g={aws:JSON.parse('{"name":"aws","model":"DefaultModel","icon":"aws","attributes":[{"name":"region","type":"String","required":true}],"data":[{"type":"aws_ami","model":"DefaultModel","icon":"Aws_EC2_AMI"}],"modules":[{"type":"server","model":"DefaultModel","icon":"Aws_Servers"}],"resources":[{"type":"aws_security_group","model":"DefaultModel","icon":"AwsSecurityGroup","attributes":[{"name":"vpc_id","type":"Link","linkType":"Default","linkRef":"aws_vpc"}]},{"type":"aws_instance","model":"DefaultModel","icon":"Aws_EC2-Instance","attributes":[{"name":"security_groups","type":"Link","linkType":"Reverse","linkRef":"aws_security_group"},{"name":"vpc_security_group_ids","type":"Link","linkType":"Reverse","linkRef":"aws_security_group"},{"name":"subnet_id","type":"Link","linkType":"Default","linkRef":"aws_subnet"}]},{"type":"aws_volume_attachment","model":"DefaultModel","icon":"Aws_Elastic-Block-Store_Volume","attributes":[{"name":"device_name","type":"String"},{"name":"volume_id","type":"Link","linkType":"Default","linkRef":"aws_ebs_volume"},{"name":"instance_id","type":"Link","linkType":"Default","linkRef":"aws_instance"}]},{"type":"aws_ebs_volume","model":"DefaultModel","icon":"Aws_Elastic-Block-Store_Volume","attributes":[{"name":"availability_zone","type":"String"}]},{"type":"aws_elb","model":"DefaultModel","icon":"Aws_Elastic-Load-Balancing_Network-Load-Balancer","attributes":[{"name":"listener","type":"Object","required":true,"attributes":[{"name":"instance_port","type":"String","required":true},{"name":"lb_port","type":"Number","required":true},{"name":"lb_protocol","type":"String","required":true},{"name":"instance_protocol","type":"String","required":true}]},{"name":"subnets","type":"Link","linkType":"Default","linkRef":"aws_subnet"},{"name":"security_groups","type":"Link","linkType":"Default","linkRef":"aws_security_group"},{"name":"instances","type":"Link","linkType":"Default","linkRef":"aws_instance"}]},{"type":"aws_vpc","model":"DefaultContainer","icon":"Aws_Virtual-Private-Cloud","isContainer":true},{"type":"aws_internet_gateway","model":"DefaultModel","icon":"Aws_VPC_Internet-Gateway","attributes":[{"name":"vpc_id","type":"Reference","containerRef":"aws_vpc"}]},{"type":"aws_route","model":"DefaultModel","icon":"Aws_Route-53","attributes":[{"name":"route_table_id","type":"Reference","required":true,"containerRef":"aws_route"},{"name":"gateway_id","type":"Link","linkType":"Default","linkRef":"aws_internet_gateway"}]},{"type":"aws_subnet","model":"DefaultModel","icon":"AwsSubnet","attributes":[{"name":"vpc_id","type":"Reference","containerRef":"aws_vpc"},{"name":"gateway_id","type":"Link","linkType":"Default","linkRef":"aws_internet_gateway"}]},{"type":"aws_db_subnet_group","model":"DefaultContainer","icon":"AwsDbSubnetGroup","isContainer":true,"attributes":[{"name":"subnet_ids","type":"Reference","required":true,"containerRef":"aws_subnet"}]},{"type":"aws_route53_zone","model":"DefaultContainer","icon":"Aws_Route-53-Hosted-Zone","isContainer":true,"attributes":[{"name":"name","type":"String","required":true}]},{"type":"aws_route53_record","model":"DefaultModel","icon":"Aws_Route-53_Route-Table","attributes":[{"name":"zone_id","type":"Reference","required":true,"containerRef":"aws_route53_zone"},{"name":"records","type":"Link","linkType":"Default","linkRef":"aws_route53_record"}]},{"type":"aws_db_instance","model":"DefaultModel","icon":"Aws_EC2_DB-Instance","attributes":[{"name":"instance_class","type":"String","required":true},{"name":"db_subnet_group_name","type":"Link","linkType":"Default","linkRef":"aws_db_subnet_group"},{"name":"vpc_security_group_ids","type":"Link","required":true,"linkType":"Default","linkRef":"aws_security_group"}]},{"type":"aws_key_pair","model":"DefaultModel","icon":"Aws_Identity-Access-Management_Long-Term-Security-Credential"}],"variables":[{"type":"image_id","model":"DefaultModel","icon":"variable"}]}')};function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0)throw new Error("Metadata are not valid",{cause:e});return!0}},{key:"parse",value:function(){this.pluginData.definitions={components:this.getComponentDefinitions()}}},{key:"getComponentDefinitions",value:function(){var t=this,e=[];return Object.keys(this.providers).map((function(e){return t.providers[e]})).forEach((function(n){var r=[];r.push(t.getProviderDefinition(n)),n.data.forEach((function(e){return r.push(t.getBlockDefinition("data",n.name,e))})),n.modules.forEach((function(e){return r.push(t.getBlockDefinition("module",n.name,e))})),n.resources.forEach((function(e){return r.push(t.getBlockDefinition("resource",n.name,e))})),n.variables.forEach((function(e){return r.push(t.getBlockDefinition("variable",n.name,e))})),t.setChildrenTypes(r),r.forEach((function(t){e.push(t)}))})),e}},{key:"getProviderDefinition",value:function(t){var e=new v({blockType:"provider",provider:t.name,type:t.name,icon:t.icon,model:t.model,definedAttributes:t.attributes.map(this.getAttributeDefinition),isContainer:t.isContainer});return e.parentTypes=this.getParentTypes(e),e}},{key:"getBlockDefinition",value:function(t,e,n){var r=n.attributes||[],i=new v({blockType:t,provider:e,type:n.type,model:n.model,icon:n.icon,isContainer:n.isContainer||!1,definedAttributes:r.map(this.getAttributeDefinition)});return i.parentTypes=this.getParentTypes(i),i}},{key:"getAttributeDefinition",value:function(e){var n=e.attributes||[];return new t.ComponentAttributeDefinition(x(x({},e),{},{definedAttributes:n.map(this.getAttributeDefinition)}))}},{key:"getParentTypes",value:function(t){var e=[];return t.definedAttributes.filter((function(t){return"Reference"===t.type})).map((function(t){return t.containerRef})).filter((function(t){return!e.includes(t)})).forEach((function(t){return e.push(t)})),e}},{key:"setChildrenTypes",value:function(t){var e=t.filter((function(t){return t.parentTypes.length>0})).reduce((function(t,e){return e.parentTypes.forEach((function(n){var r;t[n]=[].concat(function(t){if(Array.isArray(t))return E(t)}(r=t[n]||[])||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return E(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[e.type])})),t}),{});t.filter((function(t){return e[t.type]})).forEach((function(t){t.childrenTypes=e[t.type]}))}}])&&k(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),a}(t.DefaultMetadata);String.prototype.seed=String.prototype.seed||Math.round(Math.random()*Math.pow(2,32)),String.prototype.hashCode=function(){const t=this.toString();let e,n;const r=3&t.length,i=t.length-r;let o=String.prototype.seed;const s=3432918353,a=461845907;let l=0;for(;l>>16)*s&65535)<<16)&4294967295,n=n<<15|n>>>17,n=(65535&n)*a+(((n>>>16)*a&65535)<<16)&4294967295,o^=n,o=o<<13|o>>>19,e=5*(65535&o)+((5*(o>>>16)&65535)<<16)&4294967295,o=27492+(65535&e)+((58964+(e>>>16)&65535)<<16);switch(n=0,r){case 3:n^=(255&t.charCodeAt(l+2))<<16;case 2:n^=(255&t.charCodeAt(l+1))<<8;case 1:n^=255&t.charCodeAt(l),n=(65535&n)*s+(((n>>>16)*s&65535)<<16)&4294967295,n=n<<15|n>>>17,n=(65535&n)*a+(((n>>>16)*a&65535)<<16)&4294967295,o^=n}return o^=t.length,o^=o>>>16,o=2246822507*(65535&o)+((2246822507*(o>>>16)&65535)<<16)&4294967295,o^=o>>>13,o=3266489909*(65535&o)+((3266489909*(o>>>16)&65535)<<16)&4294967295,o^=o>>>16,o>>>0},String.prototype.codePointAt||function(){var t=function(){let t;try{const e={},n=Object.defineProperty;t=n(e,e,e)&&n}catch(t){}return t}();const e=function(t){if(null==this)throw TypeError();const e=String(this),n=e.length;let r=t?Number(t):0;if(r!=r&&(r=0),r<0||r>=n)return;const i=e.charCodeAt(r);let o;return i>=55296&&i<=56319&&n>r+1&&(o=e.charCodeAt(r+1),o>=56320&&o<=57343)?1024*(i-55296)+o-56320+65536:i};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}(),String.fromCodePoint||function(){const t=function(){let t;try{const e={},n=Object.defineProperty;t=n(e,e,e)&&n}catch(t){}return t}(),e=String.fromCharCode,n=Math.floor,r=function(t){const r=16384,i=[];let o,s,a=-1;const l=arguments.length;if(!l)return"";let u="";for(;++a1114111||n(t)!==t)throw RangeError("Invalid code point: "+t);t<=65535?i.push(t):(t-=65536,o=55296+(t>>10),s=t%1024+56320,i.push(o,s)),(a+1===l||i.length>r)&&(u+=e.apply(null,i),i.length=0)}return u};t?t(String,"fromCodePoint",{value:r,configurable:!0,writable:!0}):String.fromCodePoint=r}();class L{constructor(){this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.tokenIndex=null,this.line=null,this.column=null,this._text=null}getTokenSource(){return this.source[0]}getInputStream(){return this.source[1]}get text(){return this._text}set text(t){this._text=t}}function P(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n>>17,t*=461845907,this.count=this.count+1;let n=this.hash^t;n=n<<13|n>>>19,n=5*n+3864292196,this.hash=n}}}finish(){let t=this.hash^4*this.count;return t^=t>>>16,t*=2246822507,t^=t>>>13,t*=3266489909,t^=t>>>16,t}static hashStuff(){const t=new N;return t.update.apply(t,arguments),t.finish()}}function I(t){return t?t.hashCode():-1}function F(t,e){return t?t.equals(e):t===e}function D(t){return null===t?"null":t}function j(t){return Array.isArray(t)?"["+t.map(D).join(", ")+"]":"null"}const M="h-";class B{constructor(t,e){this.data={},this.hashFunction=t||I,this.equalsFunction=e||F}add(t){const e=M+this.hashFunction(t);if(e in this.data){const n=this.data[e];for(let e=0;et.startsWith(M))).flatMap((t=>this.data[t]),this)}toString(){return j(this.values())}get length(){return Object.keys(this.data).filter((t=>t.startsWith(M))).map((t=>this.data[t].length),this).reduce(((t,e)=>t+e),0)}}class U{hashCode(){const t=new N;return this.updateHashCode(t),t.finish()}evaluate(t,e){}evalPrecedence(t,e){return this}static andContext(t,e){if(null===t||t===U.NONE)return e;if(null===e||e===U.NONE)return t;const n=new V(t,e);return 1===n.opnds.length?n.opnds[0]:n}static orContext(t,e){if(null===t)return e;if(null===e)return t;if(t===U.NONE||e===U.NONE)return U.NONE;const n=new K(t,e);return 1===n.opnds.length?n.opnds[0]:n}}class V extends U{constructor(t,e){super();const n=new B;t instanceof V?t.opnds.map((function(t){n.add(t)})):n.add(t),e instanceof V?e.opnds.map((function(t){n.add(t)})):n.add(e);const r=$(n);if(r.length>0){let t=null;r.map((function(e){(null===t||e.precedencet.toString()));return(t.length>3?t.slice(3):t).join("&&")}}class K extends U{constructor(t,e){super();const n=new B;t instanceof K?t.opnds.map((function(t){n.add(t)})):n.add(t),e instanceof K?e.opnds.map((function(t){n.add(t)})):n.add(e);const r=$(n);if(r.length>0){const t=r.sort((function(t,e){return t.compareTo(e)})),e=t[t.length-1];n.add(e)}this.opnds=Array.from(n.values())}equals(t){return this===t||t instanceof K&&P(this.opnds,t.opnds)}updateHashCode(t){t.update(this.opnds,"OR")}evaluate(t,e){for(let n=0;nt.toString()));return(t.length>3?t.slice(3):t).join("||")}}function $(t){const e=[];return t.values().map((function(t){t instanceof U.PrecedencePredicate&&e.push(t)})),e}function H(t,e){if(null===t){const t={state:null,alt:null,context:null,semanticContext:null};return e&&(t.reachesIntoOuterContext=0),t}{const n={};return n.state=t.state||null,n.alt=void 0===t.alt?null:t.alt,n.context=t.context||null,n.semanticContext=t.semanticContext||null,e&&(n.reachesIntoOuterContext=t.reachesIntoOuterContext||0,n.precedenceFilterSuppressed=t.precedenceFilterSuppressed||!1),n}}class z{constructor(t,e){this.checkContext(t,e),t=H(t),e=H(e,!0),this.state=null!==t.state?t.state:e.state,this.alt=null!==t.alt?t.alt:e.alt,this.context=null!==t.context?t.context:e.context,this.semanticContext=null!==t.semanticContext?t.semanticContext:null!==e.semanticContext?e.semanticContext:U.NONE,this.reachesIntoOuterContext=e.reachesIntoOuterContext,this.precedenceFilterSuppressed=e.precedenceFilterSuppressed}checkContext(t,e){null!==t.context&&void 0!==t.context||null!==e&&null!==e.context&&void 0!==e.context||(this.context=null)}hashCode(){const t=new N;return this.updateHashCode(t),t.finish()}updateHashCode(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)}equals(t){return this===t||t instanceof z&&this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&(null===this.context?null===t.context:this.context.equals(t.context))&&this.semanticContext.equals(t.semanticContext)&&this.precedenceFilterSuppressed===t.precedenceFilterSuppressed}hashCodeForConfigSet(){const t=new N;return t.update(this.state.stateNumber,this.alt,this.semanticContext),t.finish()}equalsForConfigSet(t){return this===t||t instanceof z&&this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&this.semanticContext.equals(t.semanticContext)}toString(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==U.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"}}class q{constructor(t,e){this.start=t,this.stop=e}clone(){return new q(this.start,this.stop)}contains(t){return t>=this.start&&tthis.addInterval(t)),this),this}reduce(t){if(t=n.stop?(this.intervals.splice(t+1,1),this.reduce(t)):e.stop>=n.start&&(this.intervals[t]=new q(e.start,n.stop),this.intervals.splice(t+1,1))}}complement(t,e){const n=new G;return n.addInterval(new q(t,e+1)),null!==this.intervals&&this.intervals.forEach((t=>n.removeRange(t))),n}contains(t){if(null===this.intervals)return!1;for(let e=0;en.start&&t.stop=n.stop?(this.intervals.splice(e,1),e-=1):t.start"):t.push("'"+String.fromCharCode(n.start)+"'"):t.push("'"+String.fromCharCode(n.start)+"'..'"+String.fromCharCode(n.stop-1)+"'")}return t.length>1?"{"+t.join(", ")+"}":t[0]}toIndexString(){const t=[];for(let e=0;e"):t.push(n.start.toString()):t.push(n.start.toString()+".."+(n.stop-1).toString())}return t.length>1?"{"+t.join(", ")+"}":t[0]}toTokenString(t,e){const n=[];for(let r=0;r1?"{"+n.join(", ")+"}":n[0]}elementName(t,e,n){return n===L.EOF?"":n===L.EPSILON?"":t[n]||e[n]}get length(){return this.intervals.map((t=>t.length)).reduce(((t,e)=>t+e))}}class Y{constructor(){this.atn=null,this.stateNumber=Y.INVALID_STATE_NUMBER,this.stateType=null,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.nextTokenWithinRule=null}toString(){return this.stateNumber}equals(t){return t instanceof Y&&this.stateNumber===t.stateNumber}isNonGreedyExitState(){return!1}addTransition(t,e){void 0===e&&(e=-1),0===this.transitions.length?this.epsilonOnlyTransitions=t.isEpsilon:this.epsilonOnlyTransitions!==t.isEpsilon&&(this.epsilonOnlyTransitions=!1),-1===e?this.transitions.push(t):this.transitions.splice(e,1,t)}}Y.INVALID_TYPE=0,Y.BASIC=1,Y.RULE_START=2,Y.BLOCK_START=3,Y.PLUS_BLOCK_START=4,Y.STAR_BLOCK_START=5,Y.TOKEN_START=6,Y.RULE_STOP=7,Y.BLOCK_END=8,Y.STAR_LOOP_BACK=9,Y.STAR_LOOP_ENTRY=10,Y.PLUS_LOOP_BACK=11,Y.LOOP_END=12,Y.serializationNames=["INVALID","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END"],Y.INVALID_STATE_NUMBER=-1;class W extends Y{constructor(){return super(),this.stateType=Y.RULE_STOP,this}}class Q{constructor(t){if(null==t)throw"target cannot be null.";this.target=t,this.isEpsilon=!1,this.label=null}}Q.EPSILON=1,Q.RANGE=2,Q.RULE=3,Q.PREDICATE=4,Q.ATOM=5,Q.ACTION=6,Q.SET=7,Q.NOT_SET=8,Q.WILDCARD=9,Q.PRECEDENCE=10,Q.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],Q.serializationTypes={EpsilonTransition:Q.EPSILON,RangeTransition:Q.RANGE,RuleTransition:Q.RULE,PredicateTransition:Q.PREDICATE,AtomTransition:Q.ATOM,ActionTransition:Q.ACTION,SetTransition:Q.SET,NotSetTransition:Q.NOT_SET,WildcardTransition:Q.WILDCARD,PrecedencePredicateTransition:Q.PRECEDENCE};class X extends Q{constructor(t,e,n,r){super(t),this.ruleIndex=e,this.precedence=n,this.followState=r,this.serializationType=Q.RULE,this.isEpsilon=!0}matches(t,e,n){return!1}}class J extends Q{constructor(t,e){super(t),this.serializationType=Q.SET,null!=e?this.label=e:(this.label=new G,this.label.addOne(L.INVALID_TYPE))}matches(t,e,n){return this.label.contains(t)}toString(){return this.label.toString()}}class Z extends J{constructor(t,e){super(t,e),this.serializationType=Q.NOT_SET}matches(t,e,n){return t>=e&&t<=n&&!super.matches(t,e,n)}toString(){return"~"+super.toString()}}class tt extends Q{constructor(t){super(t),this.serializationType=Q.WILDCARD}matches(t,e,n){return t>=e&&t<=n}toString(){return"."}}class et extends Q{constructor(t){super(t)}}class nt{}class rt extends nt{}class it extends rt{}class ot extends it{getRuleContext(){throw new Error("missing interface implementation")}}class st extends it{}class at extends st{}const lt={toStringTree:function(t,e,n){e=e||null,null!==(n=n||null)&&(e=n.ruleNames);let r=lt.getNodeText(t,e);r=function(t,e){return t=t.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}(r);const i=t.getChildCount();if(0===i)return r;let o="("+r+" ";i>0&&(r=lt.toStringTree(t.getChild(0),e),o=o.concat(r));for(let n=1;n=0&&e0&&(t+=", "),this.returnStates[e]!==ht.EMPTY_RETURN_STATE?(t+=this.returnStates[e],null!==this.parents[e]?t=t+" "+this.parents[e]:t+="null"):t+="$";return t+"]"}}get length(){return this.returnStates.length}}class pt extends ht{constructor(t,e){let n=0;const r=new N;null!==t?r.update(t,e):r.update(1),n=r.finish(),super(n),this.parentCtx=t,this.returnState=e}getParent(t){return this.parentCtx}getReturnState(t){return this.returnState}equals(t){return this===t||t instanceof pt&&this.hashCode()===t.hashCode()&&this.returnState===t.returnState&&(null==this.parentCtx?null==t.parentCtx:this.parentCtx.equals(t.parentCtx))}toString(){const t=null===this.parentCtx?"":this.parentCtx.toString();return 0===t.length?this.returnState===ht.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+t}get length(){return 1}static create(t,e){return e===ht.EMPTY_RETURN_STATE&&null===t?ht.EMPTY:new pt(t,e)}}class dt extends pt{constructor(){super(null,ht.EMPTY_RETURN_STATE)}isEmpty(){return!0}getParent(t){return null}getReturnState(t){return this.returnState}equals(t){return this===t}toString(){return"$"}}ht.EMPTY=new dt;const mt="h-";class vt{constructor(t,e){this.data={},this.hashFunction=t||I,this.equalsFunction=e||F}set(t,e){const n=mt+this.hashFunction(t);if(n in this.data){const r=this.data[n];for(let n=0;nt.startsWith(mt))).flatMap((t=>this.data[t]),this)}getKeys(){return this.entries().map((t=>t.key))}getValues(){return this.entries().map((t=>t.value))}toString(){return"["+this.entries().map((t=>"{"+t.key+":"+t.value+"}")).join(", ")+"]"}get length(){return Object.keys(this.data).filter((t=>t.startsWith(mt))).map((t=>this.data[t].length),this).reduce(((t,e)=>t+e),0)}}function yt(t,e){if(null==e&&(e=ct.EMPTY),null===e.parentCtx||e===ct.EMPTY)return ht.EMPTY;const n=yt(t,e.parentCtx),r=t.states[e.invokingState].transitions[0];return pt.create(n,r.followState.stateNumber)}function gt(t,e,n){if(t.isEmpty())return t;let r=n.get(t)||null;if(null!==r)return r;if(r=e.get(t),null!==r)return n.set(t,r),r;let i=!1,o=[];for(let r=0;re.returnState&&(i[0]=e.returnState,i[1]=t.returnState);const o=new ft([n,n],i);return null!==r&&r.set(t,e,o),o}const i=[t.returnState,e.returnState];let o=[t.parentCtx,e.parentCtx];t.returnState>e.returnState&&(i[0]=e.returnState,i[1]=t.returnState,o=[e.parentCtx,t.parentCtx]);const s=new ft(o,i);return null!==r&&r.set(t,e,s),s}}(t,e,n,r);if(n){if(t instanceof dt)return t;if(e instanceof dt)return e}return t instanceof pt&&(t=new ft([t.getParent()],[t.returnState])),e instanceof pt&&(e=new ft([e.getParent()],[e.returnState])),function(t,e,n,r){if(null!==r){let n=r.get(t,e);if(null!==n)return n;if(n=r.get(e,t),null!==n)return n}let i=0,o=0,s=0,a=[],l=[];for(;ithis.add(t)),this)}remove(t){delete this.data[t]}has(t){return!0===this.data[t]}values(){return Object.keys(this.data)}minValue(){return Math.min.apply(null,this.values())}hashCode(){return N.hashStuff(this.values())}equals(t){return t instanceof Et&&P(this.data,t.data)}toString(){return"{"+this.values().join(", ")+"}"}get length(){return this.values().length}}class bt{constructor(t){this.atn=t}getDecisionLookahead(t){if(null===t)return null;const e=t.transitions.length,n=[];for(let r=0;r=this.states.length)throw"Invalid state number.";const n=this.states[t];let r=this.nextTokens(n);if(!r.contains(L.EPSILON))return r;const i=new G;for(i.addSet(r),i.removeOne(L.EPSILON);null!==e&&e.invokingState>=0&&r.contains(L.EPSILON);){const t=this.states[e.invokingState].transitions[0];r=this.nextTokens(t.followState),i.addSet(r),i.removeOne(L.EPSILON),e=e.parentCtx}return r.contains(L.EPSILON)&&i.addOne(L.EOF),i}}xt.INVALID_ALT_NUMBER=0;class wt extends Y{constructor(){super(),this.stateType=Y.BASIC}}class kt extends Y{constructor(){return super(),this.decision=-1,this.nonGreedy=!1,this}}class Tt extends kt{constructor(){return super(),this.endState=null,this}}class St extends Y{constructor(){return super(),this.stateType=Y.BLOCK_END,this.startState=null,this}}class Ot extends Y{constructor(){return super(),this.stateType=Y.LOOP_END,this.loopBackState=null,this}}class At extends Y{constructor(){return super(),this.stateType=Y.RULE_START,this.stopState=null,this.isPrecedenceRule=!1,this}}class Ct extends kt{constructor(){return super(),this.stateType=Y.TOKEN_START,this}}class Rt extends kt{constructor(){return super(),this.stateType=Y.PLUS_LOOP_BACK,this}}class Lt extends Y{constructor(){return super(),this.stateType=Y.STAR_LOOP_BACK,this}}class Pt extends kt{constructor(){return super(),this.stateType=Y.STAR_LOOP_ENTRY,this.loopBackState=null,this.isPrecedenceDecision=null,this}}class Nt extends Tt{constructor(){return super(),this.stateType=Y.PLUS_BLOCK_START,this.loopBackState=null,this}}class It extends Tt{constructor(){return super(),this.stateType=Y.STAR_BLOCK_START,this}}class Ft extends Tt{constructor(){return super(),this.stateType=Y.BLOCK_START,this}}class Dt extends Q{constructor(t,e){super(t),this.label_=e,this.label=this.makeLabel(),this.serializationType=Q.ATOM}makeLabel(){const t=new G;return t.addOne(this.label_),t}matches(t,e,n){return this.label_===t}toString(){return this.label_}}class jt extends Q{constructor(t,e,n){super(t),this.serializationType=Q.RANGE,this.start=e,this.stop=n,this.label=this.makeLabel()}makeLabel(){const t=new G;return t.addRange(this.start,this.stop),t}matches(t,e,n){return t>=this.start&&t<=this.stop}toString(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"}}class Mt extends Q{constructor(t,e,n,r){super(t),this.serializationType=Q.ACTION,this.ruleIndex=e,this.actionIndex=void 0===n?-1:n,this.isCtxDependent=void 0!==r&&r,this.isEpsilon=!0}matches(t,e,n){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}}class Bt extends Q{constructor(t,e){super(t),this.serializationType=Q.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=e}matches(t,e,n){return!1}toString(){return"epsilon"}}class Ut extends U{constructor(t,e,n){super(),this.ruleIndex=void 0===t?-1:t,this.predIndex=void 0===e?-1:e,this.isCtxDependent=void 0!==n&&n}evaluate(t,e){const n=this.isCtxDependent?e:null;return t.sempred(n,this.ruleIndex,this.predIndex)}updateHashCode(t){t.update(this.ruleIndex,this.predIndex,this.isCtxDependent)}equals(t){return this===t||t instanceof Ut&&this.ruleIndex===t.ruleIndex&&this.predIndex===t.predIndex&&this.isCtxDependent===t.isCtxDependent}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}U.NONE=new Ut;class Vt extends et{constructor(t,e,n,r){super(t),this.serializationType=Q.PREDICATE,this.ruleIndex=e,this.predIndex=n,this.isCtxDependent=r,this.isEpsilon=!0}matches(t,e,n){return!1}getPredicate(){return new Ut(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}}class Kt extends U{constructor(t){super(),this.precedence=void 0===t?0:t}evaluate(t,e){return t.precpred(e,this.precedence)}evalPrecedence(t,e){return t.precpred(e,this.precedence)?U.NONE:null}compareTo(t){return this.precedence-t.precedence}updateHashCode(t){t.update(this.precedence)}equals(t){return this===t||t instanceof Kt&&this.precedence===t.precedence}toString(){return"{"+this.precedence+">=prec}?"}}U.PrecedencePredicate=Kt;class $t extends et{constructor(t,e){super(t),this.serializationType=Q.PRECEDENCE,this.precedence=e,this.isEpsilon=!0}matches(t,e,n){return!1}getPredicate(){return new Kt(this.precedence)}toString(){return this.precedence+" >= _p"}}class Ht{constructor(t){void 0===t&&(t=null),this.readOnly=!1,this.verifyATN=null===t||t.verifyATN,this.generateRuleBypassTransitions=null!==t&&t.generateRuleBypassTransitions}}Ht.defaultOptions=new Ht,Ht.defaultOptions.readOnly=!0;class zt{constructor(t){this.actionType=t,this.isPositionDependent=!1}hashCode(){const t=new N;return this.updateHashCode(t),t.finish()}updateHashCode(t){t.update(this.actionType)}equals(t){return this===t}}class qt extends zt{constructor(){super(6)}execute(t){t.skip()}toString(){return"skip"}}qt.INSTANCE=new qt;class Gt extends zt{constructor(t){super(0),this.channel=t}execute(t){t._channel=this.channel}updateHashCode(t){t.update(this.actionType,this.channel)}equals(t){return this===t||t instanceof Gt&&this.channel===t.channel}toString(){return"channel("+this.channel+")"}}class Yt extends zt{constructor(t,e){super(1),this.ruleIndex=t,this.actionIndex=e,this.isPositionDependent=!0}execute(t){t.action(null,this.ruleIndex,this.actionIndex)}updateHashCode(t){t.update(this.actionType,this.ruleIndex,this.actionIndex)}equals(t){return this===t||t instanceof Yt&&this.ruleIndex===t.ruleIndex&&this.actionIndex===t.actionIndex}}class Wt extends zt{constructor(){super(3)}execute(t){t.more()}toString(){return"more"}}Wt.INSTANCE=new Wt;class Qt extends zt{constructor(t){super(7),this.type=t}execute(t){t.type=this.type}updateHashCode(t){t.update(this.actionType,this.type)}equals(t){return this===t||t instanceof Qt&&this.type===t.type}toString(){return"type("+this.type+")"}}class Xt extends zt{constructor(t){super(5),this.mode=t}execute(t){t.pushMode(this.mode)}updateHashCode(t){t.update(this.actionType,this.mode)}equals(t){return this===t||t instanceof Xt&&this.mode===t.mode}toString(){return"pushMode("+this.mode+")"}}class Jt extends zt{constructor(){super(4)}execute(t){t.popMode()}toString(){return"popMode"}}Jt.INSTANCE=new Jt;class Zt extends zt{constructor(t){super(2),this.mode=t}execute(t){t.mode(this.mode)}updateHashCode(t){t.update(this.actionType,this.mode)}equals(t){return this===t||t instanceof Zt&&this.mode===t.mode}toString(){return"mode("+this.mode+")"}}function te(t,e){const n=[];return n[t-1]=e,n.map((function(t){return e}))}class ee{constructor(t){null==t&&(t=Ht.defaultOptions),this.deserializationOptions=t,this.stateFactories=null,this.actionFactories=null}deserialize(t){const e=this.reset(t);this.checkVersion(e),e&&this.skipUUID();const n=this.readATN();this.readStates(n,e),this.readRules(n,e),this.readModes(n);const r=[];return this.readSets(n,r,this.readInt.bind(this)),e&&this.readSets(n,r,this.readInt32.bind(this)),this.readEdges(n,r),this.readDecisions(n),this.readLexerActions(n,e),this.markPrecedenceDecisions(n),this.verifyATN(n),this.deserializationOptions.generateRuleBypassTransitions&&1===n.grammarType&&(this.generateRuleBypassTransitions(n),this.verifyATN(n)),n}reset(t){if(3===(t.charCodeAt?t.charCodeAt(0):t[0])){const e=function(t){const e=t.charCodeAt(0);return e>1?e-2:e+65534},n=t.split("").map(e);return n[0]=t.charCodeAt(0),this.data=n,this.pos=0,!0}return this.data=t,this.pos=0,!1}skipUUID(){let t=0;for(;t++<8;)this.readInt()}checkVersion(t){const e=this.readInt();if(!t&&4!==e)throw"Could not deserialize ATN with version "+e+" (expected 4)."}readATN(){const t=this.readInt(),e=this.readInt();return new xt(t,e)}readStates(t,e){let n,r,i;const o=[],s=[],a=this.readInt();for(let n=0;n0;)i.addTransition(l.transitions[u-1]),l.transitions=l.transitions.slice(-1);t.ruleToStartState[e].addTransition(new Bt(i)),o.addTransition(new Bt(a));const c=new wt;t.addState(c),c.addTransition(new Dt(o,t.ruleToTokenType[e])),i.addTransition(new Bt(c))}stateIsEndStateFor(t,e){if(t.ruleIndex!==e)return null;if(!(t instanceof Pt))return null;const n=t.transitions[t.transitions.length-1].target;return n instanceof Ot&&n.epsilonOnlyTransitions&&n.transitions[0].target instanceof W?t:null}markPrecedenceDecisions(t){for(let e=0;e=0):this.checkCondition(n.transitions.length<=1||n instanceof W)}}checkCondition(t,e){if(!t)throw null==e&&(e="IllegalState"),e}readInt(){return this.data[this.pos++]}readInt32(){return this.readInt()|this.readInt()<<16}edgeFactory(t,e,n,r,i,o,s,a){const l=t.states[r];switch(e){case Q.EPSILON:return new Bt(l);case Q.RANGE:return new jt(l,0!==s?L.EOF:i,o);case Q.RULE:return new X(t.states[i],o,s,l);case Q.PREDICATE:return new Vt(l,i,o,0!==s);case Q.PRECEDENCE:return new $t(l,i);case Q.ATOM:return new Dt(l,0!==s?L.EOF:i);case Q.ACTION:return new Mt(l,i,o,0!==s);case Q.SET:return new J(l,a[i]);case Q.NOT_SET:return new Z(l,a[i]);case Q.WILDCARD:return new tt(l);default:throw"The specified transition type: "+e+" is not valid."}}stateFactory(t,e){if(null===this.stateFactories){const t=[];t[Y.INVALID_TYPE]=null,t[Y.BASIC]=()=>new wt,t[Y.RULE_START]=()=>new At,t[Y.BLOCK_START]=()=>new Ft,t[Y.PLUS_BLOCK_START]=()=>new Nt,t[Y.STAR_BLOCK_START]=()=>new It,t[Y.TOKEN_START]=()=>new Ct,t[Y.RULE_STOP]=()=>new W,t[Y.BLOCK_END]=()=>new St,t[Y.STAR_LOOP_BACK]=()=>new Lt,t[Y.STAR_LOOP_ENTRY]=()=>new Pt,t[Y.PLUS_LOOP_BACK]=()=>new Rt,t[Y.LOOP_END]=()=>new Ot,this.stateFactories=t}if(t>this.stateFactories.length||null===this.stateFactories[t])throw"The specified state type "+t+" is not valid.";{const n=this.stateFactories[t]();if(null!==n)return n.ruleIndex=e,n}}lexerActionFactory(t,e,n){if(null===this.actionFactories){const t=[];t[0]=(t,e)=>new Gt(t),t[1]=(t,e)=>new Yt(t,e),t[2]=(t,e)=>new Zt(t),t[3]=(t,e)=>Wt.INSTANCE,t[4]=(t,e)=>Jt.INSTANCE,t[5]=(t,e)=>new Xt(t),t[6]=(t,e)=>qt.INSTANCE,t[7]=(t,e)=>new Qt(t),this.actionFactories=t}if(t>this.actionFactories.length||null===this.actionFactories[t])throw"The specified lexer action type "+t+" is not valid.";return this.actionFactories[t](e,n)}}class ne{syntaxError(t,e,n,r,i,o){}reportAmbiguity(t,e,n,r,i,o,s){}reportAttemptingFullContext(t,e,n,r,i,o){}reportContextSensitivity(t,e,n,r,i,o){}}class re extends ne{constructor(){super()}syntaxError(t,e,n,r,i,o){console.error("line "+n+":"+r+" "+i)}}re.INSTANCE=new re;class ie extends ne{constructor(t){if(super(),null===t)throw"delegates";return this.delegates=t,this}syntaxError(t,e,n,r,i,o){this.delegates.map((s=>s.syntaxError(t,e,n,r,i,o)))}reportAmbiguity(t,e,n,r,i,o,s){this.delegates.map((a=>a.reportAmbiguity(t,e,n,r,i,o,s)))}reportAttemptingFullContext(t,e,n,r,i,o){this.delegates.map((s=>s.reportAttemptingFullContext(t,e,n,r,i,o)))}reportContextSensitivity(t,e,n,r,i,o){this.delegates.map((s=>s.reportContextSensitivity(t,e,n,r,i,o)))}}class oe{constructor(){this._listeners=[re.INSTANCE],this._interp=null,this._stateNumber=-1}checkVersion(t){"4.11.0"!==t&&console.log("ANTLR runtime and generated code versions disagree: 4.11.0!="+t)}addErrorListener(t){this._listeners.push(t)}removeErrorListeners(){this._listeners=[]}getLiteralNames(){return Object.getPrototypeOf(this).constructor.literalNames||[]}getSymbolicNames(){return Object.getPrototypeOf(this).constructor.symbolicNames||[]}getTokenNames(){if(!this.tokenNames){const t=this.getLiteralNames(),e=this.getSymbolicNames(),n=t.length>e.length?t.length:e.length;this.tokenNames=[];for(let r=0;r";let e=t.text;return null===e&&(e=t.type===L.EOF?"":"<"+t.type+">"),e=e.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"),"'"+e+"'"}getErrorListenerDispatch(){return new ie(this._listeners)}sempred(t,e,n){return!0}precpred(t,e){return!0}get state(){return this._stateNumber}set state(t){this._stateNumber=t}}oe.tokenTypeMapCache={},oe.ruleIndexMapCache={};class se extends L{constructor(t,e,n,r,i){super(),this.source=void 0!==t?t:se.EMPTY_SOURCE,this.type=void 0!==e?e:null,this.channel=void 0!==n?n:L.DEFAULT_CHANNEL,this.start=void 0!==r?r:-1,this.stop=void 0!==i?i:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=t[0].line,this.column=t[0].column):this.column=-1}clone(){const t=new se(this.source,this.type,this.channel,this.start,this.stop);return t.tokenIndex=this.tokenIndex,t.line=this.line,t.column=this.column,t.text=this.text,t}toString(){let t=this.text;return t=null!==t?t.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+t+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"}get text(){if(null!==this._text)return this._text;const t=this.getInputStream();if(null===t)return null;const e=t.size;return this.start"}set text(t){this._text=t}}se.EMPTY_SOURCE=[null,null];class ae{}class le extends ae{constructor(t){super(),this.copyText=void 0!==t&&t}create(t,e,n,r,i,o,s,a){const l=new se(t,e,r,i,o);return l.line=s,l.column=a,null!==n?l.text=n:this.copyText&&null!==t[1]&&(l.text=t[1].getText(i,o)),l}createThin(t,e){const n=new se(null,t);return n.text=e,n}}le.DEFAULT=new le;class ue extends Error{constructor(t){super(t.message),Error.captureStackTrace&&Error.captureStackTrace(this,ue),this.message=t.message,this.recognizer=t.recognizer,this.input=t.input,this.ctx=t.ctx,this.offendingToken=null,this.offendingState=-1,null!==this.recognizer&&(this.offendingState=this.recognizer.state)}getExpectedTokens(){return null!==this.recognizer?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null}toString(){return this.message}}class ce extends ue{constructor(t,e,n,r){super({message:"",recognizer:t,input:e,ctx:null}),this.startIndex=n,this.deadEndConfigs=r}toString(){let t="";return this.startIndex>=0&&this.startIndex":"\n"===t?"\\n":"\t"===t?"\\t":"\r"===t?"\\r":t}getCharErrorDisplay(t){return"'"+this.getErrorDisplayForChar(t)+"'"}recover(t){this._input.LA(1)!==L.EOF&&(t instanceof ce?this._interp.consume(this._input):this._input.consume())}get inputStream(){return this._input}set inputStream(t){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=t,this._tokenFactorySourcePair=[this,this._input]}get sourceName(){return this._input.sourceName}get type(){return this._type}set type(t){this._type=t}get line(){return this._interp.line}set line(t){this._interp.line=t}get column(){return this._interp.column}set column(t){this._interp.column=t}get text(){return null!==this._text?this._text:this._interp.getText(this._input)}set text(t){this._text=t}}function fe(t){return t.hashCodeForConfigSet()}function pe(t,e){return t===e||null!==t&&null!==e&&t.equalsForConfigSet(e)}he.DEFAULT_MODE=0,he.MORE=-2,he.SKIP=-3,he.DEFAULT_TOKEN_CHANNEL=L.DEFAULT_CHANNEL,he.HIDDEN=L.HIDDEN_CHANNEL,he.MIN_CHAR_VALUE=0,he.MAX_CHAR_VALUE=1114111;class de{constructor(t){this.configLookup=new B(fe,pe),this.fullCtx=void 0===t||t,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1}add(t,e){if(void 0===e&&(e=null),this.readOnly)throw"This set is readonly";t.semanticContext!==U.NONE&&(this.hasSemanticContext=!0),t.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);const n=this.configLookup.add(t);if(n===t)return this.cachedHashCode=-1,this.configs.push(t),!0;const r=!this.fullCtx,i=_t(n.context,t.context,r,e);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,t.reachesIntoOuterContext),t.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=i,!0}getStates(){const t=new B;for(let e=0;ewe.MAX_DFA_EDGE)return null;let n=t.edges[e-we.MIN_DFA_EDGE];return void 0===n&&(n=null),we.debug&&null!==n&&console.log("reuse state "+t.stateNumber+" edge to "+n.stateNumber),n}computeTargetState(t,e,n){const r=new ye;return this.getReachableConfigSet(t,e.configs,r,n),0===r.items.length?(r.hasSemanticContext||this.addDFAEdge(e,n,ve.ERROR),ve.ERROR):this.addDFAEdge(e,n,null,r)}failOrAccept(t,e,n,r){if(null!==this.prevAccept.dfaState){const n=t.dfaState.lexerActionExecutor;return this.accept(e,n,this.startIndex,t.index,t.line,t.column),t.dfaState.prediction}if(r===L.EOF&&e.index===this.startIndex)return L.EOF;throw new ce(this.recog,e,this.startIndex,n)}getReachableConfigSet(t,e,n,r){let i=xt.INVALID_ALT_NUMBER;for(let o=0;owe.MAX_DFA_EDGE||(we.debug&&console.log("EDGE "+t+" -> "+n+" upon "+e),null===t.edges&&(t.edges=[]),t.edges[e-we.MIN_DFA_EDGE]=n),n}addDFAState(t){const e=new me(null,t);let n=null;for(let e=0;et.startsWith("k-"))).map((t=>this.data[t]),this)}}const Se={SLL:0,LL:1,LL_EXACT_AMBIG_DETECTION:2,hasSLLConflictTerminatingPrediction:function(t,e){if(Se.allConfigsInRuleStopStates(e))return!0;if(t===Se.SLL&&e.hasSemanticContext){const t=new de;for(let n=0;n1)return!0;return!1},allSubsetsEqual:function(t){let e=null;for(let n=0;n0&&(o=this.getAltThatFinishedDecisionEntryRule(i),o!==xt.INVALID_ALT_NUMBER)?o:xt.INVALID_ALT_NUMBER}getAltThatFinishedDecisionEntryRule(t){const e=[];for(let n=0;n0||r.state instanceof W&&r.context.hasEmptyPath())&&e.indexOf(r.alt)<0&&e.push(r.alt)}return 0===e.length?xt.INVALID_ALT_NUMBER:Math.min.apply(null,e)}splitAccordingToSemanticValidity(t,e){const n=new de(t.fullCtx),r=new de(t.fullCtx);for(let i=0;i50))throw"problem";if(t.state instanceof W){if(!t.context.isEmpty()){for(let a=0;a=0&&(r+=1)}this.closureCheckingStopState(h,e,n,c,i,r,s)}}}canDropLoopEntryEdgeInLeftRecursiveRule(t){const e=t.state;if(e.stateType!==Y.STAR_LOOP_ENTRY)return!1;if(e.stateType!==Y.STAR_LOOP_ENTRY||!e.isPrecedenceDecision||t.context.isEmpty()||t.context.hasEmptyPath())return!1;const n=t.context.length;for(let r=0;r=0?this.parser.ruleNames[t]:""}getEpsilonTarget(t,e,n,r,i,o){switch(e.serializationType){case Q.RULE:return this.ruleTransition(t,e);case Q.PRECEDENCE:return this.precedenceTransition(t,e,n,r,i);case Q.PREDICATE:return this.predTransition(t,e,n,r,i);case Q.ACTION:return this.actionTransition(t,e);case Q.EPSILON:return new z({state:e.target},t);case Q.ATOM:case Q.RANGE:case Q.SET:return o&&e.matches(L.EOF,0,1)?new z({state:e.target},t):null;default:return null}}actionTransition(t,e){if(this.debug){const t=-1===e.actionIndex?65535:e.actionIndex;console.log("ACTION edge "+e.ruleIndex+":"+t)}return new z({state:e.target},t)}precedenceTransition(t,e,n,r,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+j(this.parser.getRuleInvocationStack())));let o=null;if(n&&r)if(i){const n=this._input.index;this._input.seek(this._startIndex);const r=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),r&&(o=new z({state:e.target},t))}else{const n=U.andContext(t.semanticContext,e.getPredicate());o=new z({state:e.target,semanticContext:n},t)}else o=new z({state:e.target},t);return this.debug&&console.log("config from pred transition="+o),o}predTransition(t,e,n,r,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.ruleIndex+":"+e.predIndex+", ctx dependent="+e.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+j(this.parser.getRuleInvocationStack())));let o=null;if(n&&(e.isCtxDependent&&r||!e.isCtxDependent))if(i){const n=this._input.index;this._input.seek(this._startIndex);const r=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),r&&(o=new z({state:e.target},t))}else{const n=U.andContext(t.semanticContext,e.getPredicate());o=new z({state:e.target,semanticContext:n},t)}else o=new z({state:e.target},t);return this.debug&&console.log("config from pred transition="+o),o}ruleTransition(t,e){this.debug&&console.log("CALL rule "+this.getRuleName(e.target.ruleIndex)+", ctx="+t.context);const n=e.followState,r=pt.create(t.context,n.stateNumber);return new z({state:e.target,context:r},t)}getConflictingAlts(t){const e=Oe.getConflictingAltSubsets(t);return Oe.getAlts(e)}getConflictingAltsOrUniqueAlt(t){let e=null;return t.uniqueAlt!==xt.INVALID_ALT_NUMBER?(e=new Et,e.add(t.uniqueAlt)):e=t.conflictingAlts,e}getTokenName(t){if(t===L.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(t>=this.parser.literalNames.length&&t>=this.parser.symbolicNames.length))return(this.parser.literalNames[t]||this.parser.symbolicNames[t])+"<"+t+">";console.log(t+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+t}getLookaheadName(t){return this.getTokenName(t.LA(1))}dumpDeadEndConfigs(t){console.log("dead end configs: ");const e=t.getDeadEndConfigs();for(let t=0;t0){const t=n.state.transitions[0];t instanceof Dt?r="Atom "+this.getTokenName(t.label):t instanceof J&&(r=(t instanceof Z?"~":"")+"Set "+t.set)}console.error(n.toString(this.parser,!0)+":"+r)}}noViableAlt(t,e,n,r){return new Ae(this.parser,t,t.get(r),t.LT(1),n,e)}getUniqueAlt(t){let e=xt.INVALID_ALT_NUMBER;for(let n=0;n "+r+" upon "+this.getTokenName(n)),null===r)return null;if(r=this.addDFAState(t,r),null===e||n<-1||n>this.atn.maxTokenType)return r;if(null===e.edges&&(e.edges=[]),e.edges[n+1]=r,this.debug){const e=null===this.parser?null:this.parser.literalNames,n=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+t.toString(e,n))}return r}addDFAState(t,e){if(e===ve.ERROR)return e;const n=t.states.get(e);return null!==n?n:(e.stateNumber=t.states.length,e.configs.readOnly||(e.configs.optimizeConfigs(this),e.configs.setReadonly(!0)),t.states.add(e),this.debug&&console.log("adding new DFA state: "+e),e)}reportAttemptingFullContext(t,e,n,r,i){if(this.debug||this.retry_debug){const e=new q(r,i+1);console.log("reportAttemptingFullContext decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(e))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,t,r,i,e,n)}reportContextSensitivity(t,e,n,r,i){if(this.debug||this.retry_debug){const e=new q(r,i+1);console.log("reportContextSensitivity decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(e))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,t,r,i,e,n)}reportAmbiguity(t,e,n,r,i,o,s){if(this.debug||this.retry_debug){const t=new q(n,r+1);console.log("reportAmbiguity "+o+":"+s+", input="+this.parser.getTokenStream().getText(t))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,t,n,r,i,o,s)}},PredictionMode:Oe};class Le{constructor(t,e,n){this.dfa=t,this.literalNames=e||[],this.symbolicNames=n||[]}toString(){if(null===this.dfa.s0)return null;let t="";const e=this.dfa.sortedStates();for(let n=0;n"),t=t.concat(this.getStateString(e)),t=t.concat("\n"))}}}return 0===t.length?null:t}getEdgeLabel(t){return 0===t?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[t-1]||this.symbolicNames[t-1]:String.fromCharCode(t-1)}getStateString(t){const e=(t.isAcceptState?":":"")+"s"+t.stateNumber+(t.requiresFullContext?"^":"");return t.isAcceptState?null!==t.predicates?e+"=>"+j(t.predicates):e+"=>"+t.prediction.toString():e}}class Pe extends Le{constructor(t){super(t,null)}getEdgeLabel(t){return"'"+String.fromCharCode(t)+"'"}}const Ne={DFA:class{constructor(t,e){if(void 0===e&&(e=0),this.atnStartState=t,this.decision=e,this._states=new B,this.s0=null,this.precedenceDfa=!1,t instanceof Pt&&t.isPrecedenceDecision){this.precedenceDfa=!0;const t=new me(null,new de);t.edges=[],t.isAcceptState=!1,t.requiresFullContext=!1,this.s0=t}}getPrecedenceStartState(t){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return t<0||t>=this.s0.edges.length?null:this.s0.edges[t]||null}setPrecedenceStartState(t,e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";t<0||(this.s0.edges[t]=e)}setPrecedenceDfa(t){if(this.precedenceDfa!==t){if(this._states=new B,t){const t=new me(null,new de);t.edges=[],t.isAcceptState=!1,t.requiresFullContext=!1,this.s0=t}else this.s0=null;this.precedenceDfa=t}}sortedStates(){return this._states.values().sort((function(t,e){return t.stateNumber-e.stateNumber}))}toString(t,e){return t=t||null,e=e||null,null===this.s0?"":new Le(this,t,e).toString()}toLexerString(){return null===this.s0?"":new Pe(this).toString()}get states(){return this._states}},DFASerializer:Le,LexerDFASerializer:Pe,PredPrediction:ke};class Ie{visitTerminal(t){}visitErrorNode(t){}enterEveryRule(t){}exitEveryRule(t){}}class Fe{walk(t,e){if(e instanceof at||void 0!==e.isErrorNode&&e.isErrorNode())t.visitErrorNode(e);else if(e instanceof st)t.visitTerminal(e);else{this.enterRule(t,e);for(let n=0;n=0&&t.consume(),this.lastErrorIndex=t._input.index,null===this.lastErrorStates&&(this.lastErrorStates=[]),this.lastErrorStates.push(t.state);const n=this.getErrorRecoverySet(t);this.consumeUntil(t,n)}sync(t){if(this.inErrorRecoveryMode(t))return;const e=t._interp.atn.states[t.state],n=t.getTokenStream().LA(1),r=t.atn.nextTokens(e);if(r.contains(n))return this.nextTokensContext=null,void(this.nextTokenState=Y.INVALID_STATE_NUMBER);if(r.contains(L.EPSILON))null===this.nextTokensContext&&(this.nextTokensContext=t._ctx,this.nextTokensState=t._stateNumber);else switch(e.stateType){case Y.BLOCK_START:case Y.STAR_BLOCK_START:case Y.PLUS_BLOCK_START:case Y.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(t))return;throw new je(t);case Y.PLUS_LOOP_BACK:case Y.STAR_LOOP_BACK:{this.reportUnwantedToken(t);const e=new G;e.addSet(t.getExpectedTokens());const n=e.addSet(this.getErrorRecoverySet(t));this.consumeUntil(t,n)}}}reportNoViableAlternative(t,e){const n=t.getTokenStream();let r;r=null!==n?e.startToken.type===L.EOF?"":n.getText(new q(e.startToken.tokenIndex,e.offendingToken.tokenIndex)):"";const i="no viable alternative at input "+this.escapeWSAndQuote(r);t.notifyErrorListeners(i,e.offendingToken,e)}reportInputMismatch(t,e){const n="mismatched input "+this.getTokenErrorDisplay(e.offendingToken)+" expecting "+e.getExpectedTokens().toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e.offendingToken,e)}reportFailedPredicate(t,e){const n="rule "+t.ruleNames[t._ctx.ruleIndex]+" "+e.message;t.notifyErrorListeners(n,e.offendingToken,e)}reportUnwantedToken(t){if(this.inErrorRecoveryMode(t))return;this.beginErrorCondition(t);const e=t.getCurrentToken(),n="extraneous input "+this.getTokenErrorDisplay(e)+" expecting "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e,null)}reportMissingToken(t){if(this.inErrorRecoveryMode(t))return;this.beginErrorCondition(t);const e=t.getCurrentToken(),n="missing "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames)+" at "+this.getTokenErrorDisplay(e);t.notifyErrorListeners(n,e,null)}recoverInline(t){const e=this.singleTokenDeletion(t);if(null!==e)return t.consume(),e;if(this.singleTokenInsertion(t))return this.getMissingSymbol(t);throw new je(t)}singleTokenInsertion(t){const e=t.getTokenStream().LA(1),n=t._interp.atn,r=n.states[t.state].transitions[0].target;return!!n.nextTokens(r,t._ctx).contains(e)&&(this.reportMissingToken(t),!0)}singleTokenDeletion(t){const e=t.getTokenStream().LA(2);if(this.getExpectedTokens(t).contains(e)){this.reportUnwantedToken(t),t.consume();const e=t.getCurrentToken();return this.reportMatch(t),e}return null}getMissingSymbol(t){const e=t.getCurrentToken(),n=this.getExpectedTokens(t).first();let r;r=n===L.EOF?"":"";let i=e;const o=t.getTokenStream().LT(-1);return i.type===L.EOF&&null!==o&&(i=o),t.getTokenFactory().create(i.source,n,r,L.DEFAULT_CHANNEL,-1,-1,i.line,i.column)}getExpectedTokens(t){return t.getExpectedTokens()}getTokenErrorDisplay(t){if(null===t)return"";let e=t.text;return null===e&&(e=t.type===L.EOF?"":"<"+t.type+">"),this.escapeWSAndQuote(e)}escapeWSAndQuote(t){return"'"+(t=(t=(t=t.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}getErrorRecoverySet(t){const e=t._interp.atn;let n=t._ctx;const r=new G;for(;null!==n&&n.invokingState>=0;){const t=e.states[n.invokingState].transitions[0],i=e.nextTokens(t.followState);r.addSet(i),n=n.parentCtx}return r.removeOne(L.EPSILON),r}consumeUntil(t,e){let n=t.getTokenStream().LA(1);for(;n!==L.EOF&&!e.contains(n);)t.consume(),n=t.getTokenStream().LA(1)}}const $e={RecognitionException:ue,NoViableAltException:Ae,LexerNoViableAltException:ce,InputMismatchException:je,FailedPredicateException:Me,DiagnosticErrorListener:class extends ne{constructor(t){super(),t=t||!0,this.exactOnly=t}reportAmbiguity(t,e,n,r,i,o,s){if(this.exactOnly&&!i)return;const a="reportAmbiguity d="+this.getDecisionDescription(t,e)+": ambigAlts="+this.getConflictingAlts(o,s)+", input='"+t.getTokenStream().getText(new q(n,r))+"'";t.notifyErrorListeners(a)}reportAttemptingFullContext(t,e,n,r,i,o){const s="reportAttemptingFullContext d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new q(n,r))+"'";t.notifyErrorListeners(s)}reportContextSensitivity(t,e,n,r,i,o){const s="reportContextSensitivity d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new q(n,r))+"'";t.notifyErrorListeners(s)}getDecisionDescription(t,e){const n=e.decision,r=e.atnStartState.ruleIndex,i=t.ruleNames;if(r<0||r>=i.length)return""+n;const o=i[r]||null;return null===o||0===o.length?""+n:`${n} (${o})`}getConflictingAlts(t,e){if(null!==t)return t;const n=new Et;for(let t=0;t=this._size)throw"cannot consume EOF";this._index+=1}LA(t){if(0===t)return 0;t<0&&(t+=1);const e=this._index+t-1;return e<0||e>=this._size?L.EOF:this.data[e]}LT(t){return this.LA(t)}mark(){return-1}release(t){}seek(t){t<=this._index?this._index=t:this._index=Math.min(t,this._size)}getText(t,e){if(e>=this._size&&(e=this._size-1),t>=this._size)return"";if(this.decodeToUnicodeCodePoints){let n="";for(let r=t;r<=e;r++)n+=String.fromCodePoint(this.data[r]);return n}return this.strdata.slice(t,e+1)}toString(){return this.strdata}get index(){return this._index}get size(){return this._size}}var ze=n(654);const qe={fromString:function(t){return new He(t,!0)},fromBlob:function(t,e,n,r){const i=new window.FileReader;i.onload=function(t){const e=new He(t.target.result,!0);n(e)},i.onerror=r,i.readAsText(t,e)},fromBuffer:function(t,e){return new He(t.toString(e),!0)},fromPath:function(t,e,n){ze.readFile(t,e,(function(t,e){let r=null;null!==e&&(r=new He(e,!0)),n(t,r)}))},fromPathSync:function(t,e){const n=ze.readFileSync(t,e);return new He(n,!0)}};class Ge{}class Ye extends Ge{constructor(t){super(),this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1}mark(){return 0}release(t){}reset(){this.seek(0)}seek(t){this.lazyInit(),this.index=this.adjustSeekIndex(t)}get(t){return this.lazyInit(),this.tokens[t]}consume(){let t=!1;if(t=this.index>=0&&(this.fetchedEOF?this.index0)||this.fetch(e)>=e}fetch(t){if(this.fetchedEOF)return 0;for(let e=0;e=this.tokens.length&&(e=this.tokens.length-1);for(let i=t;i=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[e]}adjustSeekIndex(t){return t}lazyInit(){-1===this.index&&this.setup()}setup(){this.sync(0),this.index=this.adjustSeekIndex(0)}setTokenSource(t){this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1}nextTokenOnChannel(t,e){if(this.sync(t),t>=this.tokens.length)return-1;let n=this.tokens[t];for(;n.channel!==this.channel;){if(n.type===L.EOF)return-1;t+=1,this.sync(t),n=this.tokens[t]}return t}previousTokenOnChannel(t,e){for(;t>=0&&this.tokens[t].channel!==e;)t-=1;return t}getHiddenTokensToRight(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;const n=this.nextTokenOnChannel(t+1,he.DEFAULT_TOKEN_CHANNEL),r=t+1,i=-1===n?this.tokens.length-1:n;return this.filterForChannel(r,i,e)}getHiddenTokensToLeft(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;const n=this.previousTokenOnChannel(t-1,he.DEFAULT_TOKEN_CHANNEL);if(n===t-1)return null;const r=n+1,i=t-1;return this.filterForChannel(r,i,e)}filterForChannel(t,e,n){const r=[];for(let i=t;i=this.tokens.length&&(n=this.tokens.length-1);let r="";for(let t=e;t=0&&this._parseListeners.splice(e,1),0===this._parseListeners.length&&(this._parseListeners=null)}}removeParseListeners(){this._parseListeners=null}triggerEnterRuleEvent(){if(null!==this._parseListeners){const t=this._ctx;this._parseListeners.forEach((function(e){e.enterEveryRule(t),t.enterRule(e)}))}}triggerExitRuleEvent(){if(null!==this._parseListeners){const t=this._ctx;this._parseListeners.slice(0).reverse().forEach((function(e){t.exitRule(e),e.exitEveryRule(t)}))}}getTokenFactory(){return this._input.tokenSource._factory}setTokenFactory(t){this._input.tokenSource._factory=t}getATNWithBypassAlts(){const t=this.getSerializedATN();if(null===t)throw"The current parser does not support an ATN with bypass alternatives.";let e=this.bypassAltsAtnCache[t];if(null===e){const n=new Ht;n.generateRuleBypassTransitions=!0,e=new ee(n).deserialize(t),this.bypassAltsAtnCache[t]=e}return e}getInputStream(){return this.getTokenStream()}setInputStream(t){this.setTokenStream(t)}getTokenStream(){return this._input}setTokenStream(t){this._input=null,this.reset(),this._input=t}getCurrentToken(){return this._input.LT(1)}notifyErrorListeners(t,e,n){n=n||null,null===(e=e||null)&&(e=this.getCurrentToken()),this._syntaxErrors+=1;const r=e.line,i=e.column;this.getErrorListenerDispatch().syntaxError(this,e,r,i,t,n)}consume(){const t=this.getCurrentToken();t.type!==L.EOF&&this.getInputStream().consume();const e=null!==this._parseListeners&&this._parseListeners.length>0;if(this.buildParseTrees||e){let n;n=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(t):this._ctx.addTokenNode(t),n.invokingState=this.state,e&&this._parseListeners.forEach((function(t){n instanceof at||void 0!==n.isErrorNode&&n.isErrorNode()?t.visitErrorNode(n):n instanceof st&&t.visitTerminal(n)}))}return t}addContextToParseTree(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)}enterRule(t,e,n){this.state=e,this._ctx=t,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}enterOuterAlt(t,e){t.setAltNumber(e),this.buildParseTrees&&this._ctx!==t&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(t)),this._ctx=t}getPrecedence(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]}enterRecursionRule(t,e,n,r){this.state=e,this._precedenceStack.push(r),this._ctx=t,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(t,e,n){const r=this._ctx;r.parentCtx=t,r.invokingState=e,r.stop=this._input.LT(-1),this._ctx=t,this._ctx.start=r.start,this.buildParseTrees&&this._ctx.addChild(r),this.triggerEnterRuleEvent()}unrollRecursionContexts(t){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);const e=this._ctx,n=this.getParseListeners();if(null!==n&&n.length>0)for(;this._ctx!==t;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=t;e.parentCtx=t,this.buildParseTrees&&null!==t&&t.addChild(e)}getInvokingContext(t){let e=this._ctx;for(;null!==e;){if(e.ruleIndex===t)return e;e=e.parentCtx}return null}precpred(t,e){return e>=this._precedenceStack[this._precedenceStack.length-1]}inContext(t){return!1}isExpectedToken(t){const e=this._interp.atn;let n=this._ctx;const r=e.states[this.state];let i=e.nextTokens(r);if(i.contains(t))return!0;if(!i.contains(L.EPSILON))return!1;for(;null!==n&&n.invokingState>=0&&i.contains(L.EPSILON);){const r=e.states[n.invokingState].transitions[0];if(i=e.nextTokens(r.followState),i.contains(t))return!0;n=n.parentCtx}return!(!i.contains(L.EPSILON)||t!==L.EOF)}getExpectedTokens(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}getExpectedTokensWithinCurrentRule(){const t=this._interp.atn,e=t.states[this.state];return t.nextTokens(e)}getRuleIndex(t){const e=this.getRuleIndexMap()[t];return null!==e?e:-1}getRuleInvocationStack(t){null===(t=t||null)&&(t=this._ctx);const e=[];for(;null!==t;){const n=t.ruleIndex;n<0?e.push("n/a"):e.push(this.ruleNames[n]),t=t.parentCtx}return e}getDFAStrings(){return this._interp.decisionToDFA.toString()}dumpDFA(){let t=!1;for(let e=0;e0&&(t&&console.log(),this.printer.println("Decision "+n.decision+":"),this.printer.print(n.toString(this.literalNames,this.symbolicNames)),t=!0)}}getSourceName(){return this._input.sourceName}setTrace(t){t?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new We(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}Qe.bypassAltsAtnCache={};class Xe extends st{constructor(t){super(),this.parentCtx=null,this.symbol=t}getChild(t){return null}getSymbol(){return this.symbol}getParent(){return this.parentCtx}getPayload(){return this.symbol}getSourceInterval(){if(null===this.symbol)return q.INVALID_INTERVAL;const t=this.symbol.tokenIndex;return new q(t,t)}getChildCount(){return 0}accept(t){return t.visitTerminal(this)}getText(){return this.symbol.text}toString(){return this.symbol.type===L.EOF?"":this.symbol.text}}class Je extends Xe{constructor(t){super(t)}isErrorNode(){return!0}accept(t){return t.visitErrorNode(this)}}class Ze extends ct{constructor(t,e){super(t=t||null,e=e||null),this.ruleIndex=-1,this.children=null,this.start=null,this.stop=null,this.exception=null}copyFrom(t){this.parentCtx=t.parentCtx,this.invokingState=t.invokingState,this.children=null,this.start=t.start,this.stop=t.stop,t.children&&(this.children=[],t.children.map((function(t){t instanceof Je&&(this.children.push(t),t.parentCtx=this)}),this))}enterRule(t){}exitRule(t){}addChild(t){return null===this.children&&(this.children=[]),this.children.push(t),t}removeLastChild(){null!==this.children&&this.children.pop()}addTokenNode(t){const e=new Xe(t);return this.addChild(e),e.parentCtx=this,e}addErrorNode(t){const e=new Je(t);return this.addChild(e),e.parentCtx=this,e}getChild(t,e){if(e=e||null,null===this.children||t<0||t>=this.children.length)return null;if(null===e)return this.children[t];for(let n=0;n=this.children.length)return null;for(let n=0;n@BDFHJ L!N\"P#R$T%V&X'","Z\\^(`)b*((>>@@~~","--112;&&00C\\aac|","𐠁𐠁\udc02\n","$$11^^ddhhppttvv2;CHch!$$^^",'3;\f\f\v\f""',"c|\b#&/1??aa}}Ƶ","\b","\n\f","","","",""," ",'"$',"&(","*,",".02","46","8:","@J","LN","PRT","VX","^`","bd","k\bp\nw","\f€Š","“œ","£¨","¬³","½Ë",' Í"Ï',"$Ñ&Ó","(Õ*×",",Ù.Û0Ý","2ß4è","6Ā8ī",":ĭ<Ķ",">ļ@ľ","BňDōFœ","HŕJş","LšNů","PźRƄ","TƊVƒ","XƔZƖ\\Ƙ","^ƚ`Ɯ","bƞdeo","efqfgfghwhi","nijgjkl","flmcmnvno","copquqr","qrswstttu","euvgv\twx","rxytyzqz{x","{|k|}f}~g","~t\v€","v‚g‚ƒ","tƒ„t„…","c…†h†‡q","‡ˆtˆ‰o","‰\rŠ‹t‹","ŒgŒuŽ","qŽw","t‘e‘’g","’“”x","”•c•–t","–—k—˜c˜","™d™šnš›","g›œ","qžwžŸ","vŸ r ¡w","¡¢v¢","£¤n¤¥k","¥¦u¦§v§","¨©o©","ªcª«r«","¬­q­®","d®¯l¯°","g°±e±²v","²³´e","´µqµ¶p","¶·f·¸k¸","¹v¹ºkº»","q»¼p¼","½¾g¾¿","t¿ÀtÀÁq","ÁÂtÂÃa","ÃÄoÄÅgÅ","ÆuÆÇuÇÈ","cÈÉiÉÊ","gÊËÌ","}ÌÍÎ","Î!ÏÐ","?Ð#ÑÒ*","Ò%ÓÔ+","Ô'ÕÖ]Ö",")×Ø_Ø+","ÙÚ.Ú-","ÛÜ0Ü/","ÝÞ/Þ1","ßà,à3á",'é\tâé"ãä',"?äé?åé","2æé0çé\t","èáèâ","èãèå","èæèç","é5êëv","ëìtìíwí","āgîï$ïð","vðñtñò","wòógóā$","ôõhõöc","ö÷n÷øuø","āgùú$úû","hûücüý","nýþuþÿg","ÿā$Āê","ĀîĀô","Āùā7","ĂăuăĄv","ĄątąĆkĆ","ćpćĬiĈĉ","$ĉĊuĊċ","vċČtČčk","čĎpĎďi","ďĬ$Đđpđ","ĒwĒēoēĔ","dĔĕgĕĬ","tĖė$ėĘp","ĘęwęĚo","ĚěděĜgĜ","ĝtĝĬ$Ğğ","dğĠqĠġ","qġĬnĢģ$","ģĤdĤĥq","ĥĦqĦħnħ","Ĭ$ĨĩcĩĪ","pĪĬ{īĂ","īĈīĐ","īĖīĞ","īĢīĨ","Ĭ9ĭı",">Įİ<įĮ","İijıį","ıIJIJ;","ijıĴķ>","ĵķ\tĶĴ","Ķĵķ=","ĸĽ\tĹĽ\n","ĺĻ\tĻĽ\t\bļ","ĸļĹļ","ĺĽ?ľ","Ń$ĿłB!ŀł","H$ŁĿŁŀ","łŅŃŁ","Ńńńņ","ŅŃņŇ$","ŇAňŋ^",'ʼnŌ\t\tŊŌD"ŋ',"ʼnŋŊŌ","CōŎwŎŏ","F#ŏŐF#ŐőF#ő","ŒF#ŒEœŔ\t\n","ŔGŕŖ\n\v","ŖIŗŠ2","ŘŜ\t\fřś\tŚř","śŞŜŚ","ŜŝŝŠ","ŞŜşŗ","şŘŠK","šŢ1Ţţ",",ţŧŤŦ","\vťŤŦũ","ŧŨŧť","ŨŪũŧ","Ūū,ūŬ","1ŬŭŭŮ","\b&ŮMůŰ1","Űű1űŵ","ŲŴ\n\rųŲ","Ŵŷŵų","ŵŶŶŸ","ŷŵŸŹ\b'Ź","Oźž%ŻŽ","\n\rżŻŽƀ","žżžſ","ſƁƀž","ƁƂ\b(ƂQ","ƃƅ\tƄƃ","ƅƆƆƄ","ƆƇƇƈ","ƈƉ\b)ƉSƊ","Ƌ>Ƌƌ>ƌƍ","GƍƎQƎƏ","HƏƐƐƑ\b*","ƑUƒƓ\t","ƓWƔƕR)ƕY","ƖƗF#Ɨ[","ƘƙH$ƙ]ƚ","ƛJ%ƛ_ƜƝ\t","ƝaƞƟG","ƟƠQƠơH","ơƢƢƣ\b1ƣ","cèĀīı","ĶļŁŃŋŜşŧŵžƆ",""].join(""),En=(new nn.atn.ATNDeserializer).deserialize(_n),bn=En.decisionToState.map((function(t,e){return new nn.dfa.DFA(t,e)})),xn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pn(t,e)}(s,t);var e,n,r,i,o=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=vn(r);if(i){var n=vn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return dn(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=o.call(this,t))._interp=new nn.atn.LexerATNSimulator(mn(e),En,bn,new nn.PredictionContextCache),e}return e=s,(n=[{key:"atn",get:function(){return En}}])&&fn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(nn.Lexer);function wn(t){return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(t)}function kn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tn(t,e){for(var n=0;n\bI","\nT\fX^","gn","x‚","„—","›Ÿ",' ³"µ',"$Ç&Ï","(Ñ*ù,ě",".ĝ02","102331","344","5=\f6=\b7=\t","8=\n9=\v:=\b",";=<5<6","<7<8<9","<:<;=",">??@\r","@A\fACBD","CBDEEC","EFFGGH","HIJ","JK\fKNLO\n","MONLNM","OPPNPQ","QRRS","S\tTUUV","VWW\v","XYYZ\fZ[","[\\\\]]\r","^__a","`ba`bc","cacdde","eff","gh\bhi\rij\fj","kkllm","mno\top","\fprqsr","qsttr","tuuvvw","wxy\nyz","\fz|{}","|{}~~|","~€","€","‚ƒƒ","„……","†˜‡˜\v","ˆ‰\v‰Š","Š‹‹Œ","Œ˜Ž\f","Ž","‘‘˜","’“\r“”","”••–","–˜—†","—‡—ˆ","——’","˜™œ ","šœ›™","›šœ","›ž","žŸ \t"," ¡¡¢&","¢£¤","¤¥¥¦","¦§§´","¨©©ª","ª®«¬","¬­­¯","®«¯°","°®°±","±²²´","³£³¨","´!µ¶","¶··¹","¸º$¹¸","º»»¹","»¼¼½","½¾¾¿","¿ÀÀÁ","Á#ÂÈ","ÃÈ ÄÈ","ÅÈÆÈ(","ÇÂÇÃ","ÇÄÇÅ","ÇÆÈ%","ÉÐ ÊÐ","ËÐ,ÌÐ*","ÍÐÎÐ","ÏÉÏÊ","ÏËÏÌ","ÏÍÏÎ","Ð'ÑÒ","ÒÓÓØ&","ÔÕÕ×&","ÖÔ×Ú","ØÖØÙ","ÙÜÚØ","ÛÝÜÛ","ÜÝÝÞ","Þßß)","àá\báú","âä\tãâ","äååã","åææú","çï%èð&é","ð)êì'ëê","ìííë","íîîð","ïèïé","ïëðñ","ñïñò","òóóú","*ôõõö","*ö÷÷ú","øú(ùà","ùãùç","ùôùø","úĈûü","\f\büýýć","*\tþÿ\fÿĀ","Āā.āĂ","ĂćăĄ\f","Ąąąć.","ĆûĆþ","ĆăćĊ","ĈĆĈĉ","ĉ+ĊĈ","ċČČĜ","čĎĎē&","ďĐĐĒ&","đďĒĕ","ēđēĔ","Ĕėĕē","ĖĘėĖ","ėĘĘę","ęĚĚĜ","ěċěč","Ĝ-ĝĞ\t","Ğ/30&&void 0!==arguments[0]?arguments[0]:[],e=new cn(this.pluginData.definitions.components);t.forEach((function(t){e.currentFile=t;var n=new nn.InputStream(t.content),r=new xn(n),i=new nn.CommonTokenStream(r),o=new Bn(i);o.buildParseTrees=!0;var s=o.file();nn.tree.ParseTreeWalker.DEFAULT.walk(e,s)}));var n=e.components.map((function(t){return t.id=t.name,t}));this.pluginData.components=this.getComponentTree(n),this.pluginData.parseErrors=e.errors}},{key:"getComponentTree",value:function(t){var e=this,n=[];return t.forEach((function(r){e.hasParent(r)?e.getParents(t,r).forEach((function(t){t.children.push(r)})):n.push(r)})),n}},{key:"getParents",value:function(t,e){return t.filter((function(t){return!(!t.definition||!t.definition.isContainer)&&e.attributes.some((function(e){return e.definition&&"Reference"===e.definition.type&&e.definition.containerRef===t.definition.type&&e.value===t.id}))}))}},{key:"hasParent",value:function(t){return!!t.definition&&t.definition.parentTypes.length>0&&t.attributes.some((function(t){return t.definition&&"Reference"===t.definition.type}))}}],n&&hr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(t.DefaultParser);const vr=mr;var yr=n(985),gr=n.n(yr);function _r(t){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(t)}function Er(t,e){for(var n=0;n{var t={96:(t,e,n)=>{"use strict";var r=n(153),i=n(610),o=n(531),s=n(22),a=n(35),l=n(516),u=n(753),c=n(978),h=n(889);t.exports=y,y.prototype.validate=function(t,e){var n;if("string"==typeof t){if(!(n=this.getSchema(t)))throw new Error('no schema with key or ref "'+t+'"')}else{var r=this._addSchema(t);n=r.validate||this._compile(r)}var i=n(e);return!0!==n.$async&&(this.errors=n.errors),i},y.prototype.compile=function(t,e){var n=this._addSchema(t,void 0,e);return n.validate||this._compile(n)},y.prototype.addSchema=function(t,e,n,r){if(Array.isArray(t)){for(var o=0;o{"use strict";var e=t.exports=function(){this._cache={}};e.prototype.put=function(t,e){this._cache[t]=e},e.prototype.get=function(t){return this._cache[t]},e.prototype.del=function(t){delete this._cache[t]},e.prototype.clear=function(){this._cache={}}},931:(t,e,n)=>{"use strict";var r=n(802).MissingRef;t.exports=function t(e,n,i){var o=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof n&&(i=n,n=void 0);var s=a(e).then((function(){var t=o._addSchema(e,void 0,n);return t.validate||l(t)}));return i&&s.then((function(t){i(null,t)}),i),s;function a(e){var n=e.$schema;return n&&!o.getSchema(n)?t.call(o,{$ref:n},!0):Promise.resolve()}function l(t){try{return o._compile(t)}catch(e){if(e instanceof r)return function(e){var r=e.missingSchema;if(u(r))throw new Error("Schema "+r+" is loaded but "+e.missingRef+" cannot be resolved");var i=o._loadingSchemas[r];return i||(i=o._loadingSchemas[r]=o._opts.loadSchema(r)).then(s,s),i.then((function(t){if(!u(r))return a(t).then((function(){u(r)||o.addSchema(t,r,void 0,n)}))})).then((function(){return l(t)}));function s(){delete o._loadingSchemas[r]}function u(t){return o._refs[t]||o._schemas[t]}}(e);throw e}}}},802:(t,e,n)=>{"use strict";var r=n(610);function i(t,e,n){this.message=n||i.message(t,e),this.missingRef=r.url(t,e),this.missingSchema=r.normalizeId(r.fullPath(this.missingRef))}function o(t){return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}t.exports={Validation:o((function(t){this.message="validation failed",this.errors=t,this.ajv=this.validation=!0})),MissingRef:o(i)},i.message=function(t,e){return"can't resolve reference "+e+" from id "+t}},516:(t,e,n)=>{"use strict";var r=n(889),i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31],s=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,a=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,l=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,u=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,f=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(t){return t="full"==t?"full":"fast",r.copy(m[t])}function v(t){var e=t.match(i);if(!e)return!1;var n=+e[1],r=+e[2],s=+e[3];return r>=1&&r<=12&&s>=1&&s<=(2==r&&function(t){return t%4==0&&(t%100!=0||t%400==0)}(n)?29:o[r])}function y(t,e){var n=t.match(s);if(!n)return!1;var r=n[1],i=n[2],o=n[3],a=n[5];return(r<=23&&i<=59&&o<=59||23==r&&59==i&&60==o)&&(!e||a)}t.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:b,uuid:h,"json-pointer":f,"json-pointer-uri-fragment":p,"relative-json-pointer":d},m.full={date:v,time:y,"date-time":function(t){var e=t.split(g);return 2==e.length&&v(e[0])&&y(e[1],!0)},uri:function(t){return _.test(t)&&l.test(t)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:b,uuid:h,"json-pointer":f,"json-pointer-uri-fragment":p,"relative-json-pointer":d};var g=/t|\s/i,_=/\/|:/,E=/[^\\]\\Z/;function b(t){if(E.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}}},153:(t,e,n)=>{"use strict";var r=n(610),i=n(889),o=n(802),s=n(35),a=n(508),l=i.ucs2length,u=n(63),c=o.Validation;function h(t,e,n){var r=p.call(this,t,e,n);return r>=0?{index:r,compiling:!0}:(r=this._compilations.length,this._compilations[r]={schema:t,root:e,baseId:n},{index:r,compiling:!1})}function f(t,e,n){var r=p.call(this,t,e,n);r>=0&&this._compilations.splice(r,1)}function p(t,e,n){for(var r=0;r{"use strict";var r=n(540),i=n(63),o=n(889),s=n(22),a=n(461);function l(t,e,n){var r=this._refs[n];if("string"==typeof r){if(!this._refs[r])return l.call(this,t,e,r);r=this._refs[r]}if((r=r||this._schemas[n])instanceof s)return d(r.schema,this._opts.inlineRefs)?r.schema:r.validate||this._compile(r);var i,o,a,c=u.call(this,e,n);return c&&(i=c.schema,e=c.root,a=c.baseId),i instanceof s?o=i.validate||t.call(this,i.schema,e,void 0,a):void 0!==i&&(o=d(i,this._opts.inlineRefs)?i:t.call(this,i,e,void 0,a)),o}function u(t,e){var n=r.parse(e),i=g(n),o=y(this._getId(t.schema));if(0===Object.keys(t.schema).length||i!==o){var a=E(i),l=this._refs[a];if("string"==typeof l)return c.call(this,t,l,n);if(l instanceof s)l.validate||this._compile(l),t=l;else{if(!((l=this._schemas[a])instanceof s))return;if(l.validate||this._compile(l),a==E(e))return{schema:l,root:t,baseId:o};t=l}if(!t.schema)return;o=y(this._getId(t.schema))}return f.call(this,n,o,t.schema,t)}function c(t,e,n){var r=u.call(this,t,e);if(r){var i=r.schema,o=r.baseId;t=r.root;var s=this._getId(i);return s&&(o=b(o,s)),f.call(this,n,o,i,t)}}t.exports=l,l.normalizeId=E,l.fullPath=y,l.url=b,l.ids=function(t){var e=E(this._getId(t)),n={"":e},s={"":y(e,!1)},l={},u=this;return a(t,{allKeys:!0},(function(t,e,a,c,h,f,p){if(""!==e){var d=u._getId(t),m=n[c],v=s[c]+"/"+h;if(void 0!==p&&(v+="/"+("number"==typeof p?p:o.escapeFragment(p))),"string"==typeof d){d=m=E(m?r.resolve(m,d):d);var y=u._refs[d];if("string"==typeof y&&(y=u._refs[y]),y&&y.schema){if(!i(t,y.schema))throw new Error('id "'+d+'" resolves to more than one schema')}else if(d!=E(v))if("#"==d[0]){if(l[d]&&!i(t,l[d]))throw new Error('id "'+d+'" resolves to more than one schema');l[d]=t}else u._refs[d]=v}n[e]=m,s[e]=v}})),l},l.inlineRef=d,l.schema=u;var h=o.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function f(t,e,n,r){if(t.fragment=t.fragment||"","/"==t.fragment.slice(0,1)){for(var i=t.fragment.split("/"),s=1;s{"use strict";var r=n(674),i=n(889).toHash;t.exports=function(){var t=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],e=["type","$comment"];return t.all=i(e),t.types=i(["number","integer","string","array","object","boolean","null"]),t.forEach((function(n){n.rules=n.rules.map((function(n){var i;if("object"==typeof n){var o=Object.keys(n)[0];i=n[o],n=o,i.forEach((function(n){e.push(n),t.all[n]=!0}))}return e.push(n),t.all[n]={keyword:n,code:r[n],implements:i}})),t.all.$comment={keyword:"$comment",code:r.$comment},n.type&&(t.types[n.type]=n)})),t.keywords=i(e.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),t.custom={},t}},22:(t,e,n)=>{"use strict";var r=n(889);t.exports=function(t){r.copy(t,this)}},442:t=>{"use strict";t.exports=function(t){for(var e,n=0,r=t.length,i=0;i=55296&&e<=56319&&i{"use strict";function r(t,e,n,r){var i=r?" !== ":" === ",o=r?" || ":" && ",s=r?"!":"",a=r?"":"!";switch(t){case"null":return e+i+"null";case"array":return s+"Array.isArray("+e+")";case"object":return"("+s+e+o+"typeof "+e+i+'"object"'+o+a+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+i+'"number"'+o+a+"("+e+" % 1)"+o+e+i+e+(n?o+s+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+i+'"'+t+'"'+(n?o+s+"isFinite("+e+")":"")+")";default:return"typeof "+e+i+'"'+t+'"'}}t.exports={copy:function(t,e){for(var n in e=e||{},t)e[n]=t[n];return e},checkDataType:r,checkDataTypes:function(t,e,n){if(1===t.length)return r(t[0],e,n,!0);var i="",s=o(t);for(var a in s.array&&s.object&&(i=s.null?"(":"(!"+e+" || ",i+="typeof "+e+' !== "object")',delete s.null,delete s.array,delete s.object),s.number&&delete s.integer,s)i+=(i?" && ":"")+r(a,e,n,!0);return i},coerceToTypes:function(t,e){if(Array.isArray(e)){for(var n=[],r=0;r=e)throw new Error("Cannot access property/index "+r+" levels up, current level is "+e);return n[e-r]}if(r>e)throw new Error("Cannot access data "+r+" levels up, current level is "+e);if(o="data"+(e-r||""),!i)return o}for(var a=o,u=i.split("/"),c=0;c{"use strict";var e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];t.exports=function(t,n){for(var r=0;r{"use strict";var r=n(680);t.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:r.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:r.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},210:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a;var p="maximum"==e,d=p?"exclusiveMaximum":"exclusiveMinimum",m=t.schema[d],v=t.opts.$data&&m&&m.$data,y=p?"<":">",g=p?">":"<",_=void 0;if(!f&&"number"!=typeof a&&void 0!==a)throw new Error(e+" must be number");if(!v&&void 0!==m&&"number"!=typeof m&&"boolean"!=typeof m)throw new Error(d+" must be number or boolean");if(v){var E,b=t.util.getData(m.$data,s,t.dataPathArr),x="exclusive"+o,w="exclType"+o,k="exclIsNumber"+o,T="' + "+(O="op"+o)+" + '";i+=" var schemaExcl"+o+" = "+b+"; ",i+=" var "+x+"; var "+w+" = typeof "+(b="schemaExcl"+o)+"; if ("+w+" != 'boolean' && "+w+" != 'undefined' && "+w+" != 'number') { ",_=d,(E=E||[]).push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: {} ",!1!==t.opts.messages&&(i+=" , message: '"+d+" should be boolean' "),t.opts.verbose&&(i+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var S=i;i=E.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+w+" == 'number' ? ( ("+x+" = "+r+" === undefined || "+b+" "+y+"= "+r+") ? "+h+" "+g+"= "+b+" : "+h+" "+g+" "+r+" ) : ( ("+x+" = "+b+" === true) ? "+h+" "+g+"= "+r+" : "+h+" "+g+" "+r+" ) || "+h+" !== "+h+") { var op"+o+" = "+x+" ? '"+y+"' : '"+y+"='; ",void 0===a&&(_=d,u=t.errSchemaPath+"/"+d,r=b,f=v)}else if(T=y,(k="number"==typeof m)&&f){var O="'"+T+"'";i+=" if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" ( "+r+" === undefined || "+m+" "+y+"= "+r+" ? "+h+" "+g+"= "+m+" : "+h+" "+g+" "+r+" ) || "+h+" !== "+h+") { "}else k&&void 0===a?(x=!0,_=d,u=t.errSchemaPath+"/"+d,r=m,g+="="):(k&&(r=Math[p?"min":"max"](m,a)),m===(!k||r)?(x=!0,_=d,u=t.errSchemaPath+"/"+d,g+="="):(x=!1,T+="=")),O="'"+T+"'",i+=" if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+h+" "+g+" "+r+" || "+h+" !== "+h+") { ";return _=_||e,(E=E||[]).push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { comparison: "+O+", limit: "+r+", exclusive: "+x+" } ",!1!==t.opts.messages&&(i+=" , message: 'should be "+T+" ",i+=f?"' + "+r:r+"'"),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ",S=i,i=E.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { "),i}},38:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;if(f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,!f&&"number"!=typeof a)throw new Error(e+" must be number");i+="if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+h+".length "+("maxItems"==e?">":"<")+" "+r+") { ";var p=e,d=d||[];d.push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { limit: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxItems"==e?"more":"fewer",i+=" than ",i+=f?"' + "+r+" + '":""+a,i+=" items' "),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var m=i;return i=d.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},425:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;if(f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,!f&&"number"!=typeof a)throw new Error(e+" must be number");var p="maxLength"==e?">":"<";i+="if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),!1===t.opts.unicode?i+=" "+h+".length ":i+=" ucs2length("+h+") ",i+=" "+p+" "+r+") { ";var d=e,m=m||[];m.push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { limit: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT be ",i+="maxLength"==e?"longer":"shorter",i+=" than ",i+=f?"' + "+r+" + '":""+a,i+=" characters' "),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var v=i;return i=m.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},204:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;if(f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,!f&&"number"!=typeof a)throw new Error(e+" must be number");i+="if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" Object.keys("+h+").length "+("maxProperties"==e?">":"<")+" "+r+") { ";var p=e,d=d||[];d.push(i),i="",!1!==t.createErrors?(i+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { limit: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxProperties"==e?"more":"fewer",i+=" than ",i+=f?"' + "+r+" + '":""+a,i+=" properties' "),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var m=i;return i=d.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},988:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.schema[e],o=t.schemaPath+t.util.getProperty(e),s=t.errSchemaPath+"/"+e,a=!t.opts.allErrors,l=t.util.copy(t),u="";l.level++;var c="valid"+l.level,h=l.baseId,f=!0,p=i;if(p)for(var d,m=-1,v=p.length-1;m0||!1===d:t.util.schemaHasRules(d,t.RULES.all))&&(f=!1,l.schema=d,l.schemaPath=o+"["+m+"]",l.errSchemaPath=s+"/"+m,r+=" "+t.validate(l)+" ",l.baseId=h,a&&(r+=" if ("+c+") { ",u+="}"));return a&&(r+=f?" if (true) { ":" "+u.slice(0,-1)+" "),r}},996:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t),d="";p.level++;var m="valid"+p.level,v=s.every((function(e){return t.opts.strictKeywords?"object"==typeof e&&Object.keys(e).length>0||!1===e:t.util.schemaHasRules(e,t.RULES.all)}));if(v){var y=p.baseId;r+=" var "+f+" = errors; var "+h+" = false; ";var g=t.compositeRule;t.compositeRule=p.compositeRule=!0;var _=s;if(_)for(var E,b=-1,x=_.length-1;b{"use strict";t.exports=function(t,e,n){var r=" ",i=t.schema[e],o=t.errSchemaPath+"/"+e,s=(t.opts.allErrors,t.util.toQuotedString(i));return!0===t.opts.$comment?r+=" console.log("+s+");":"function"==typeof t.opts.$comment&&(r+=" self._opts.$comment("+s+", "+t.util.toQuotedString(o)+", validate.root.schema);"),r}},306:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f=t.opts.$data&&s&&s.$data;f&&(r+=" var schema"+i+" = "+t.util.getData(s.$data,o,t.dataPathArr)+"; "),f||(r+=" var schema"+i+" = validate.schema"+a+";"),r+="var "+h+" = equal("+c+", schema"+i+"); if (!"+h+") { ";var p=p||[];p.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { allowedValue: schema"+i+" } ",!1!==t.opts.messages&&(r+=" , message: 'should be equal to constant' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var d=r;return r=p.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+d+"]); ":r+=" validate.errors = ["+d+"]; return false; ":r+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",u&&(r+=" else { "),r}},840:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t);p.level++;var d="valid"+p.level,m="i"+i,v=p.dataLevel=t.dataLevel+1,y="data"+v,g=t.baseId,_=t.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:t.util.schemaHasRules(s,t.RULES.all);if(r+="var "+f+" = errors;var "+h+";",_){var E=t.compositeRule;t.compositeRule=p.compositeRule=!0,p.schema=s,p.schemaPath=a,p.errSchemaPath=l,r+=" var "+d+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",p.errorPath=t.util.getPathExpr(t.errorPath,m,t.opts.jsonPointers,!0);var b=c+"["+m+"]";p.dataPathArr[v]=m;var x=t.validate(p);p.baseId=g,t.util.varOccurences(x,y)<2?r+=" "+t.util.varReplace(x,y,b)+" ":r+=" var "+y+" = "+b+"; "+x+" ",r+=" if ("+d+") break; } ",t.compositeRule=p.compositeRule=E,r+=" if (!"+d+") {"}else r+=" if ("+c+".length == 0) {";var w=w||[];w.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should contain a valid item' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var k=r;return r=w.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+k+"]); ":r+=" validate.errors = ["+k+"]; return false; ":r+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",_&&(r+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } "),t.opts.allErrors&&(r+=" } "),r}},165:t=>{"use strict";t.exports=function(t,e,n){var r,i,o=" ",s=t.level,a=t.dataLevel,l=t.schema[e],u=t.schemaPath+t.util.getProperty(e),c=t.errSchemaPath+"/"+e,h=!t.opts.allErrors,f="data"+(a||""),p="valid"+s,d="errs__"+s,m=t.opts.$data&&l&&l.$data;m?(o+=" var schema"+s+" = "+t.util.getData(l.$data,a,t.dataPathArr)+"; ",i="schema"+s):i=l;var v,y,g,_,E,b=this,x="definition"+s,w=b.definition,k="";if(m&&w.$data){E="keywordValidate"+s;var T=w.validateSchema;o+=" var "+x+" = RULES.custom['"+e+"'].definition; var "+E+" = "+x+".validate;"}else{if(!(_=t.useCustomRule(b,l,t.schema,t)))return;i="validate.schema"+u,E=_.code,v=w.compile,y=w.inline,g=w.macro}var S=E+".errors",O="i"+s,A="ruleErr"+s,C=w.async;if(C&&!t.async)throw new Error("async keyword in sync schema");if(y||g||(o+=S+" = null;"),o+="var "+d+" = errors;var "+p+";",m&&w.$data&&(k+="}",o+=" if ("+i+" === undefined) { "+p+" = true; } else { ",T&&(k+="}",o+=" "+p+" = "+x+".validateSchema("+i+"); if ("+p+") { ")),y)w.statements?o+=" "+_.validate+" ":o+=" "+p+" = "+_.validate+"; ";else if(g){var R=t.util.copy(t);k="",R.level++;var L="valid"+R.level;R.schema=_.validate,R.schemaPath="";var P=t.compositeRule;t.compositeRule=R.compositeRule=!0;var N=t.validate(R).replace(/validate\.schema/g,E);t.compositeRule=R.compositeRule=P,o+=" "+N}else{(j=j||[]).push(o),o="",o+=" "+E+".call( ",t.opts.passContext?o+="this":o+="self",v||!1===w.schema?o+=" , "+f+" ":o+=" , "+i+" , "+f+" , validate.schema"+t.schemaPath+" ",o+=" , (dataPath || '')",'""'!=t.errorPath&&(o+=" + "+t.errorPath);var I=a?"data"+(a-1||""):"parentData",F=a?t.dataPathArr[a]:"parentDataProperty",D=o+=" , "+I+" , "+F+" , rootData ) ";o=j.pop(),!1===w.errors?(o+=" "+p+" = ",C&&(o+="await "),o+=D+"; "):o+=C?" var "+(S="customErrors"+s)+" = null; try { "+p+" = await "+D+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+S+" = e.errors; else throw e; } ":" "+S+" = null; "+p+" = "+D+"; "}if(w.modifying&&(o+=" if ("+I+") "+f+" = "+I+"["+F+"];"),o+=""+k,w.valid)h&&(o+=" if (true) { ");else{var j;o+=" if ( ",void 0===w.valid?(o+=" !",o+=g?""+L:""+p):o+=" "+!w.valid+" ",o+=") { ",r=b.keyword,(j=j||[]).push(o),o="",(j=j||[]).push(o),o="",!1!==t.createErrors?(o+=" { keyword: '"+(r||"custom")+"' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(c)+" , params: { keyword: '"+b.keyword+"' } ",!1!==t.opts.messages&&(o+=" , message: 'should pass \""+b.keyword+"\" keyword validation' "),t.opts.verbose&&(o+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+f+" "),o+=" } "):o+=" {} ";var M=o;o=j.pop(),!t.compositeRule&&h?t.async?o+=" throw new ValidationError(["+M+"]); ":o+=" validate.errors = ["+M+"]; return false; ":o+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var B=o;o=j.pop(),y?w.errors?"full"!=w.errors&&(o+=" for (var "+O+"="+d+"; "+O+"{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="errs__"+i,f=t.util.copy(t),p="";f.level++;var d="valid"+f.level,m={},v={},y=t.opts.ownProperties;for(b in s)if("__proto__"!=b){var g=s[b],_=Array.isArray(g)?v:m;_[b]=g}r+="var "+h+" = errors;";var E=t.errorPath;for(var b in r+="var missing"+i+";",v)if((_=v[b]).length){if(r+=" if ( "+c+t.util.getProperty(b)+" !== undefined ",y&&(r+=" && Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(b)+"') "),u){r+=" && ( ";var x=_;if(x)for(var w=-1,k=x.length-1;w0||!1===g:t.util.schemaHasRules(g,t.RULES.all))&&(r+=" "+d+" = true; if ( "+c+t.util.getProperty(b)+" !== undefined ",y&&(r+=" && Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(b)+"') "),r+=") { ",f.schema=g,f.schemaPath=a+t.util.getProperty(b),f.errSchemaPath=l+"/"+t.util.escapeFragment(b),r+=" "+t.validate(f)+" ",f.baseId=F,r+=" } ",u&&(r+=" if ("+d+") { ",p+="}"));return u&&(r+=" "+p+" if ("+h+" == errors) {"),r}},740:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f=t.opts.$data&&s&&s.$data;f&&(r+=" var schema"+i+" = "+t.util.getData(s.$data,o,t.dataPathArr)+"; ");var p="i"+i,d="schema"+i;f||(r+=" var "+d+" = validate.schema"+a+";"),r+="var "+h+";",f&&(r+=" if (schema"+i+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+i+")) "+h+" = false; else {"),r+=h+" = false;for (var "+p+"=0; "+p+"<"+d+".length; "+p+"++) if (equal("+c+", "+d+"["+p+"])) { "+h+" = true; break; }",f&&(r+=" } "),r+=" if (!"+h+") { ";var m=m||[];m.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { allowedValues: schema"+i+" } ",!1!==t.opts.messages&&(r+=" , message: 'should be equal to one of the allowed values' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var v=r;return r=m.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+v+"]); ":r+=" validate.errors = ["+v+"]; return false; ":r+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",u&&(r+=" else { "),r}},14:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||"");if(!1===t.opts.format)return u&&(r+=" if (true) { "),r;var h,f=t.opts.$data&&s&&s.$data;f?(r+=" var schema"+i+" = "+t.util.getData(s.$data,o,t.dataPathArr)+"; ",h="schema"+i):h=s;var p=t.opts.unknownFormats,d=Array.isArray(p);if(f)r+=" var "+(m="format"+i)+" = formats["+h+"]; var "+(v="isObject"+i)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(y="formatType"+i)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",t.async&&(r+=" var async"+i+" = "+m+".async; "),r+=" "+m+" = "+m+".validate; } if ( ",f&&(r+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),r+=" (","ignore"!=p&&(r+=" ("+h+" && !"+m+" ",d&&(r+=" && self._opts.unknownFormats.indexOf("+h+") == -1 "),r+=") || "),r+=" ("+m+" && "+y+" == '"+n+"' && !(typeof "+m+" == 'function' ? ",t.async?r+=" (async"+i+" ? await "+m+"("+c+") : "+m+"("+c+")) ":r+=" "+m+"("+c+") ",r+=" : "+m+".test("+c+"))))) {";else{var m;if(!(m=t.formats[s])){if("ignore"==p)return t.logger.warn('unknown format "'+s+'" ignored in schema at path "'+t.errSchemaPath+'"'),u&&(r+=" if (true) { "),r;if(d&&p.indexOf(s)>=0)return u&&(r+=" if (true) { "),r;throw new Error('unknown format "'+s+'" is used in schema at path "'+t.errSchemaPath+'"')}var v,y=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var g=!0===m.async;m=m.validate}if(y!=n)return u&&(r+=" if (true) { "),r;if(g){if(!t.async)throw new Error("async format in sync schema");r+=" if (!(await "+(_="formats"+t.util.getProperty(s)+".validate")+"("+c+"))) { "}else{r+=" if (! ";var _="formats"+t.util.getProperty(s);v&&(_+=".validate"),r+="function"==typeof m?" "+_+"("+c+") ":" "+_+".test("+c+") ",r+=") { "}}var E=E||[];E.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { format: ",r+=f?""+h:""+t.util.toQuotedString(s),r+=" } ",!1!==t.opts.messages&&(r+=" , message: 'should match format \"",r+=f?"' + "+h+" + '":""+t.util.escapeQuotes(s),r+="\"' "),t.opts.verbose&&(r+=" , schema: ",r+=f?"validate.schema"+a:""+t.util.toQuotedString(s),r+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var b=r;return r=E.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+b+"]); ":r+=" validate.errors = ["+b+"]; return false; ":r+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",u&&(r+=" else { "),r}},231:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t);p.level++;var d="valid"+p.level,m=t.schema.then,v=t.schema.else,y=void 0!==m&&(t.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:t.util.schemaHasRules(m,t.RULES.all)),g=void 0!==v&&(t.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:t.util.schemaHasRules(v,t.RULES.all)),_=p.baseId;if(y||g){var E;p.createErrors=!1,p.schema=s,p.schemaPath=a,p.errSchemaPath=l,r+=" var "+f+" = errors; var "+h+" = true; ";var b=t.compositeRule;t.compositeRule=p.compositeRule=!0,r+=" "+t.validate(p)+" ",p.baseId=_,p.createErrors=!0,r+=" errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",t.compositeRule=p.compositeRule=b,y?(r+=" if ("+d+") { ",p.schema=t.schema.then,p.schemaPath=t.schemaPath+".then",p.errSchemaPath=t.errSchemaPath+"/then",r+=" "+t.validate(p)+" ",p.baseId=_,r+=" "+h+" = "+d+"; ",y&&g?r+=" var "+(E="ifClause"+i)+" = 'then'; ":E="'then'",r+=" } ",g&&(r+=" else { ")):r+=" if (!"+d+") { ",g&&(p.schema=t.schema.else,p.schemaPath=t.schemaPath+".else",p.errSchemaPath=t.errSchemaPath+"/else",r+=" "+t.validate(p)+" ",p.baseId=_,r+=" "+h+" = "+d+"; ",y&&g?r+=" var "+(E="ifClause"+i)+" = 'else'; ":E="'else'",r+=" } "),r+=" if (!"+h+") { var err = ",!1!==t.createErrors?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { failingKeyword: "+E+" } ",!1!==t.opts.messages&&(r+=" , message: 'should match \"' + "+E+" + '\" schema' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&u&&(t.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",u&&(r+=" else { ")}else u&&(r+=" if (true) { ");return r}},674:(t,e,n)=>{"use strict";t.exports={$ref:n(392),allOf:n(988),anyOf:n(996),$comment:n(812),const:n(306),contains:n(840),dependencies:n(659),enum:n(740),format:n(14),if:n(231),items:n(482),maximum:n(210),minimum:n(210),maxItems:n(38),minItems:n(38),maxLength:n(425),minLength:n(425),maxProperties:n(204),minProperties:n(204),multipleOf:n(673),not:n(528),oneOf:n(709),pattern:n(614),properties:n(175),propertyNames:n(441),required:n(287),uniqueItems:n(603),validate:n(508)}},482:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t),d="";p.level++;var m="valid"+p.level,v="i"+i,y=p.dataLevel=t.dataLevel+1,g="data"+y,_=t.baseId;if(r+="var "+f+" = errors;var "+h+";",Array.isArray(s)){var E=t.schema.additionalItems;if(!1===E){r+=" "+h+" = "+c+".length <= "+s.length+"; ";var b=l;l=t.errSchemaPath+"/additionalItems",r+=" if (!"+h+") { ";var x=x||[];x.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { limit: "+s.length+" } ",!1!==t.opts.messages&&(r+=" , message: 'should NOT have more than "+s.length+" items' "),t.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var w=r;r=x.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+w+"]); ":r+=" validate.errors = ["+w+"]; return false; ":r+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",l=b,u&&(d+="}",r+=" else { ")}var k=s;if(k)for(var T,S=-1,O=k.length-1;S0||!1===T:t.util.schemaHasRules(T,t.RULES.all)){r+=" "+m+" = true; if ("+c+".length > "+S+") { ";var A=c+"["+S+"]";p.schema=T,p.schemaPath=a+"["+S+"]",p.errSchemaPath=l+"/"+S,p.errorPath=t.util.getPathExpr(t.errorPath,S,t.opts.jsonPointers,!0),p.dataPathArr[y]=S;var C=t.validate(p);p.baseId=_,t.util.varOccurences(C,g)<2?r+=" "+t.util.varReplace(C,g,A)+" ":r+=" var "+g+" = "+A+"; "+C+" ",r+=" } ",u&&(r+=" if ("+m+") { ",d+="}")}"object"==typeof E&&(t.opts.strictKeywords?"object"==typeof E&&Object.keys(E).length>0||!1===E:t.util.schemaHasRules(E,t.RULES.all))&&(p.schema=E,p.schemaPath=t.schemaPath+".additionalItems",p.errSchemaPath=t.errSchemaPath+"/additionalItems",r+=" "+m+" = true; if ("+c+".length > "+s.length+") { for (var "+v+" = "+s.length+"; "+v+" < "+c+".length; "+v+"++) { ",p.errorPath=t.util.getPathExpr(t.errorPath,v,t.opts.jsonPointers,!0),A=c+"["+v+"]",p.dataPathArr[y]=v,C=t.validate(p),p.baseId=_,t.util.varOccurences(C,g)<2?r+=" "+t.util.varReplace(C,g,A)+" ":r+=" var "+g+" = "+A+"; "+C+" ",u&&(r+=" if (!"+m+") break; "),r+=" } } ",u&&(r+=" if ("+m+") { ",d+="}"))}else(t.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:t.util.schemaHasRules(s,t.RULES.all))&&(p.schema=s,p.schemaPath=a,p.errSchemaPath=l,r+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",p.errorPath=t.util.getPathExpr(t.errorPath,v,t.opts.jsonPointers,!0),A=c+"["+v+"]",p.dataPathArr[y]=v,C=t.validate(p),p.baseId=_,t.util.varOccurences(C,g)<2?r+=" "+t.util.varReplace(C,g,A)+" ":r+=" var "+g+" = "+A+"; "+C+" ",u&&(r+=" if (!"+m+") break; "),r+=" }");return u&&(r+=" "+d+" if ("+f+" == errors) {"),r}},673:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;if(f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,!f&&"number"!=typeof a)throw new Error(e+" must be number");i+="var division"+o+";if (",f&&(i+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),i+=" (division"+o+" = "+h+" / "+r+", ",t.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+t.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",f&&(i+=" ) "),i+=" ) { ";var p=p||[];p.push(i),i="",!1!==t.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { multipleOf: "+r+" } ",!1!==t.opts.messages&&(i+=" , message: 'should be multiple of ",i+=f?"' + "+r:r+"'"),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var d=i;return i=p.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},528:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="errs__"+i,f=t.util.copy(t);f.level++;var p="valid"+f.level;if(t.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:t.util.schemaHasRules(s,t.RULES.all)){f.schema=s,f.schemaPath=a,f.errSchemaPath=l,r+=" var "+h+" = errors; ";var d,m=t.compositeRule;t.compositeRule=f.compositeRule=!0,f.createErrors=!1,f.opts.allErrors&&(d=f.opts.allErrors,f.opts.allErrors=!1),r+=" "+t.validate(f)+" ",f.createErrors=!0,d&&(f.opts.allErrors=d),t.compositeRule=f.compositeRule=m,r+=" if ("+p+") { ";var v=v||[];v.push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should NOT be valid' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var y=r;r=v.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",t.opts.allErrors&&(r+=" } ")}else r+=" var err = ",!1!==t.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'should NOT be valid' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(r+=" if (false) { ");return r}},709:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f="errs__"+i,p=t.util.copy(t),d="";p.level++;var m="valid"+p.level,v=p.baseId,y="prevValid"+i,g="passingSchemas"+i;r+="var "+f+" = errors , "+y+" = false , "+h+" = false , "+g+" = null; ";var _=t.compositeRule;t.compositeRule=p.compositeRule=!0;var E=s;if(E)for(var b,x=-1,w=E.length-1;x0||!1===b:t.util.schemaHasRules(b,t.RULES.all))?(p.schema=b,p.schemaPath=a+"["+x+"]",p.errSchemaPath=l+"/"+x,r+=" "+t.validate(p)+" ",p.baseId=v):r+=" var "+m+" = true; ",x&&(r+=" if ("+m+" && "+y+") { "+h+" = false; "+g+" = ["+g+", "+x+"]; } else { ",d+="}"),r+=" if ("+m+") { "+h+" = "+y+" = true; "+g+" = "+x+"; }";return t.compositeRule=p.compositeRule=_,r+=d+"if (!"+h+") { var err = ",!1!==t.createErrors?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { passingSchemas: "+g+" } ",!1!==t.opts.messages&&(r+=" , message: 'should match exactly one schema in oneOf' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!t.compositeRule&&u&&(t.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; }",t.opts.allErrors&&(r+=" } "),r}},614:t=>{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f=t.opts.$data&&a&&a.$data;f?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,i+="if ( ",f&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'string') || "),i+=" !"+(f?"(new RegExp("+r+"))":t.usePattern(a))+".test("+h+") ) { ";var p=p||[];p.push(i),i="",!1!==t.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { pattern: ",i+=f?""+r:""+t.util.toQuotedString(a),i+=" } ",!1!==t.opts.messages&&(i+=" , message: 'should match pattern \"",i+=f?"' + "+r+" + '":""+t.util.escapeQuotes(a),i+="\"' "),t.opts.verbose&&(i+=" , schema: ",i+=f?"validate.schema"+l:""+t.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var d=i;return i=p.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},175:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="errs__"+i,f=t.util.copy(t),p="";f.level++;var d="valid"+f.level,m="key"+i,v="idx"+i,y=f.dataLevel=t.dataLevel+1,g="data"+y,_="dataProperties"+i,E=Object.keys(s||{}).filter(N),b=t.schema.patternProperties||{},x=Object.keys(b).filter(N),w=t.schema.additionalProperties,k=E.length||x.length,T=!1===w,S="object"==typeof w&&Object.keys(w).length,O=t.opts.removeAdditional,A=T||S||O,C=t.opts.ownProperties,R=t.baseId,L=t.schema.required;if(L&&(!t.opts.$data||!L.$data)&&L.length8)r+=" || validate.schema"+a+".hasOwnProperty("+m+") ";else{var I=E;if(I)for(var F=-1,D=I.length-1;F0||!1===J:t.util.schemaHasRules(J,t.RULES.all)){var Z=t.util.getProperty(W),tt=(z=c+Z,G&&void 0!==J.default);if(f.schema=J,f.schemaPath=a+Z,f.errSchemaPath=l+"/"+t.util.escapeFragment(W),f.errorPath=t.util.getPath(t.errorPath,W,t.opts.jsonPointers),f.dataPathArr[y]=t.util.toQuotedString(W),q=t.validate(f),f.baseId=R,t.util.varOccurences(q,g)<2){q=t.util.varReplace(q,g,z);var et=z}else et=g,r+=" var "+g+" = "+z+"; ";if(tt)r+=" "+q+" ";else{if(P&&P[W]){r+=" if ( "+et+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(W)+"') "),r+=") { "+d+" = false; ",U=t.errorPath,K=l;var nt,rt=t.util.escapeQuotes(W);t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPath(U,W,t.opts.jsonPointers)),l=t.errSchemaPath+"/required",(nt=nt||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { missingProperty: '"+rt+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+rt+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",$=r,r=nt.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+$+"]); ":r+=" validate.errors = ["+$+"]; return false; ":r+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=K,t.errorPath=U,r+=" } else { "}else u?(r+=" if ( "+et+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(W)+"') "),r+=") { "+d+" = true; } else { "):(r+=" if ("+et+" !== undefined ",C&&(r+=" && Object.prototype.hasOwnProperty.call("+c+", '"+t.util.escapeQuotes(W)+"') "),r+=" ) { ");r+=" "+q+" } "}}u&&(r+=" if ("+d+") { ",p+="}")}}if(x.length){var it=x;if(it)for(var ot,st=-1,at=it.length-1;st0||!1===J:t.util.schemaHasRules(J,t.RULES.all))&&(f.schema=J,f.schemaPath=t.schemaPath+".patternProperties"+t.util.getProperty(ot),f.errSchemaPath=t.errSchemaPath+"/patternProperties/"+t.util.escapeFragment(ot),r+=C?" "+_+" = "+_+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+c+") { ",r+=" if ("+t.usePattern(ot)+".test("+m+")) { ",f.errorPath=t.util.getPathExpr(t.errorPath,m,t.opts.jsonPointers),z=c+"["+m+"]",f.dataPathArr[y]=m,q=t.validate(f),f.baseId=R,t.util.varOccurences(q,g)<2?r+=" "+t.util.varReplace(q,g,z)+" ":r+=" var "+g+" = "+z+"; "+q+" ",u&&(r+=" if (!"+d+") break; "),r+=" } ",u&&(r+=" else "+d+" = true; "),r+=" } ",u&&(r+=" if ("+d+") { ",p+="}"))}return u&&(r+=" "+p+" if ("+h+" == errors) {"),r}},441:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="errs__"+i,f=t.util.copy(t);f.level++;var p="valid"+f.level;if(r+="var "+h+" = errors;",t.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:t.util.schemaHasRules(s,t.RULES.all)){f.schema=s,f.schemaPath=a,f.errSchemaPath=l;var d="key"+i,m="idx"+i,v="i"+i,y="' + "+d+" + '",g="data"+(f.dataLevel=t.dataLevel+1),_="dataProperties"+i,E=t.opts.ownProperties,b=t.baseId;E&&(r+=" var "+_+" = undefined; "),r+=E?" "+_+" = "+_+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+_+".length; "+m+"++) { var "+d+" = "+_+"["+m+"]; ":" for (var "+d+" in "+c+") { ",r+=" var startErrs"+i+" = errors; ";var x=d,w=t.compositeRule;t.compositeRule=f.compositeRule=!0;var k=t.validate(f);f.baseId=b,t.util.varOccurences(k,g)<2?r+=" "+t.util.varReplace(k,g,x)+" ":r+=" var "+g+" = "+x+"; "+k+" ",t.compositeRule=f.compositeRule=w,r+=" if (!"+p+") { for (var "+v+"=startErrs"+i+"; "+v+"{"use strict";t.exports=function(t,e,n){var r,i,o=" ",s=t.level,a=t.dataLevel,l=t.schema[e],u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(a||""),f="valid"+s;if("#"==l||"#/"==l)t.isRoot?(r=t.async,i="validate"):(r=!0===t.root.schema.$async,i="root.refVal[0]");else{var p=t.resolveRef(t.baseId,l,t.isRoot);if(void 0===p){var d=t.MissingRefError.message(t.baseId,l);if("fail"==t.opts.missingRefs){t.logger.error(d),(g=g||[]).push(o),o="",!1!==t.createErrors?(o+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { ref: '"+t.util.escapeQuotes(l)+"' } ",!1!==t.opts.messages&&(o+=" , message: 'can\\'t resolve reference "+t.util.escapeQuotes(l)+"' "),t.opts.verbose&&(o+=" , schema: "+t.util.toQuotedString(l)+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),o+=" } "):o+=" {} ";var m=o;o=g.pop(),!t.compositeRule&&c?t.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(o+=" if (false) { ")}else{if("ignore"!=t.opts.missingRefs)throw new t.MissingRefError(t.baseId,l,d);t.logger.warn(d),c&&(o+=" if (true) { ")}}else if(p.inline){var v=t.util.copy(t);v.level++;var y="valid"+v.level;v.schema=p.schema,v.schemaPath="",v.errSchemaPath=l,o+=" "+t.validate(v).replace(/validate\.schema/g,p.code)+" ",c&&(o+=" if ("+y+") { ")}else r=!0===p.$async||t.async&&!1!==p.$async,i=p.code}if(i){var g;(g=g||[]).push(o),o="",t.opts.passContext?o+=" "+i+".call(this, ":o+=" "+i+"( ",o+=" "+h+", (dataPath || '')",'""'!=t.errorPath&&(o+=" + "+t.errorPath);var _=o+=" , "+(a?"data"+(a-1||""):"parentData")+" , "+(a?t.dataPathArr[a]:"parentDataProperty")+", rootData) ";if(o=g.pop(),r){if(!t.async)throw new Error("async schema referenced by sync schema");c&&(o+=" var "+f+"; "),o+=" try { await "+_+"; ",c&&(o+=" "+f+" = true; "),o+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(o+=" "+f+" = false; "),o+=" } ",c&&(o+=" if ("+f+") { ")}else o+=" if (!"+_+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",c&&(o+=" else { ")}return o}},287:t=>{"use strict";t.exports=function(t,e,n){var r=" ",i=t.level,o=t.dataLevel,s=t.schema[e],a=t.schemaPath+t.util.getProperty(e),l=t.errSchemaPath+"/"+e,u=!t.opts.allErrors,c="data"+(o||""),h="valid"+i,f=t.opts.$data&&s&&s.$data;f&&(r+=" var schema"+i+" = "+t.util.getData(s.$data,o,t.dataPathArr)+"; ");var p="schema"+i;if(!f)if(s.length0||!1===_:t.util.schemaHasRules(_,t.RULES.all))||(d[d.length]=v)}}else d=s;if(f||d.length){var E=t.errorPath,b=f||d.length>=t.opts.loopRequired,x=t.opts.ownProperties;if(u)if(r+=" var missing"+i+"; ",b){f||(r+=" var "+p+" = validate.schema"+a+"; ");var w="' + "+(C="schema"+i+"["+(O="i"+i)+"]")+" + '";t.opts._errorDataPathProperty&&(t.errorPath=t.util.getPathExpr(E,C,t.opts.jsonPointers)),r+=" var "+h+" = true; ",f&&(r+=" if (schema"+i+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+i+")) "+h+" = false; else {"),r+=" for (var "+O+" = 0; "+O+" < "+p+".length; "+O+"++) { "+h+" = "+c+"["+p+"["+O+"]] !== undefined ",x&&(r+=" && Object.prototype.hasOwnProperty.call("+c+", "+p+"["+O+"]) "),r+="; if (!"+h+") break; } ",f&&(r+=" } "),r+=" if (!"+h+") { ",(T=T||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(l)+" , params: { missingProperty: '"+w+"' } ",!1!==t.opts.messages&&(r+=" , message: '",t.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+w+"\\'",r+="' "),t.opts.verbose&&(r+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+t.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ";var k=r;r=T.pop(),!t.compositeRule&&u?t.async?r+=" throw new ValidationError(["+k+"]); ":r+=" validate.errors = ["+k+"]; return false; ":r+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var T,S=d;if(S)for(var O=-1,A=S.length-1;O{"use strict";t.exports=function(t,e,n){var r,i=" ",o=t.level,s=t.dataLevel,a=t.schema[e],l=t.schemaPath+t.util.getProperty(e),u=t.errSchemaPath+"/"+e,c=!t.opts.allErrors,h="data"+(s||""),f="valid"+o,p=t.opts.$data&&a&&a.$data;if(p?(i+=" var schema"+o+" = "+t.util.getData(a.$data,s,t.dataPathArr)+"; ",r="schema"+o):r=a,(a||p)&&!1!==t.opts.uniqueItems){p&&(i+=" var "+f+"; if ("+r+" === false || "+r+" === undefined) "+f+" = true; else if (typeof "+r+" != 'boolean') "+f+" = false; else { "),i+=" var i = "+h+".length , "+f+" = true , j; if (i > 1) { ";var d=t.schema.items&&t.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(d.indexOf("object")>=0||d.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+f+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var v="checkDataType"+(m?"s":"");i+=" if ("+t.util[v](d,"item",t.opts.strictNumbers,!0)+") continue; ",m&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",p&&(i+=" } "),i+=" if (!"+f+") { ";var y=y||[];y.push(i),i="",!1!==t.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==t.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),t.opts.verbose&&(i+=" , schema: ",i+=p?"validate.schema"+l:""+a,i+=" , parentSchema: validate.schema"+t.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ";var g=i;i=y.pop(),!t.compositeRule&&c?t.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",c&&(i+=" else { ")}else c&&(i+=" if (true) { ");return i}},508:t=>{"use strict";t.exports=function(t,e,n){var r="",i=!0===t.schema.$async,o=t.util.schemaHasRulesExcept(t.schema,t.RULES.all,"$ref"),s=t.self._getId(t.schema);if(t.opts.strictKeywords){var a=t.util.schemaUnknownRules(t.schema,t.RULES.keywords);if(a){var l="unknown keyword: "+a;if("log"!==t.opts.strictKeywords)throw new Error(l);t.logger.warn(l)}}if(t.isTop&&(r+=" var validate = ",i&&(t.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",s&&(t.opts.sourceCode||t.opts.processCode)&&(r+=" /*# sourceURL="+s+" */ ")),"boolean"==typeof t.schema||!o&&!t.schema.$ref){e="false schema";var u=t.level,c=t.dataLevel,h=t.schema[e],f=t.schemaPath+t.util.getProperty(e),p=t.errSchemaPath+"/"+e,d=!t.opts.allErrors,m="data"+(c||""),v="valid"+u;if(!1===t.schema){t.isTop?d=!0:r+=" var "+v+" = false; ",(z=z||[]).push(r),r="",!1!==t.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+t.errorPath+" , schemaPath: "+t.util.toQuotedString(p)+" , params: {} ",!1!==t.opts.messages&&(r+=" , message: 'boolean schema is false' "),t.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+t.schemaPath+" , data: "+m+" "),r+=" } "):r+=" {} ";var y=r;r=z.pop(),!t.compositeRule&&d?t.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else t.isTop?r+=i?" return data; ":" validate.errors = null; return true; ":r+=" var "+v+" = true; ";return t.isTop&&(r+=" }; return validate; "),r}if(t.isTop){var g=t.isTop;if(u=t.level=0,c=t.dataLevel=0,m="data",t.rootId=t.resolve.fullPath(t.self._getId(t.root.schema)),t.baseId=t.baseId||t.rootId,delete t.isTop,t.dataPathArr=[""],void 0!==t.schema.default&&t.opts.useDefaults&&t.opts.strictDefaults){var _="default is ignored in the schema root";if("log"!==t.opts.strictDefaults)throw new Error(_);t.logger.warn(_)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{if(u=t.level,m="data"+((c=t.dataLevel)||""),s&&(t.baseId=t.resolve.url(t.baseId,s)),i&&!t.async)throw new Error("async schema in sync schema");r+=" var errs_"+u+" = errors;"}v="valid"+u,d=!t.opts.allErrors;var E="",b="",x=t.schema.type,w=Array.isArray(x);if(x&&t.opts.nullable&&!0===t.schema.nullable&&(w?-1==x.indexOf("null")&&(x=x.concat("null")):"null"!=x&&(x=[x,"null"],w=!0)),w&&1==x.length&&(x=x[0],w=!1),t.schema.$ref&&o){if("fail"==t.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+t.errSchemaPath+'" (see option extendRefs)');!0!==t.opts.extendRefs&&(o=!1,t.logger.warn('$ref: keywords ignored in schema at path "'+t.errSchemaPath+'"'))}if(t.schema.$comment&&t.opts.$comment&&(r+=" "+t.RULES.all.$comment.code(t,"$comment")),x){if(t.opts.coerceTypes)var k=t.util.coerceToTypes(t.opts.coerceTypes,x);var T=t.RULES.types[x];if(k||w||!0===T||T&&!X(T)){f=t.schemaPath+".type",p=t.errSchemaPath+"/type",f=t.schemaPath+".type",p=t.errSchemaPath+"/type";var S=w?"checkDataTypes":"checkDataType";if(r+=" if ("+t.util[S](x,m,t.opts.strictNumbers,!0)+") { ",k){var O="dataType"+u,A="coerced"+u;r+=" var "+O+" = typeof "+m+"; var "+A+" = undefined; ","array"==t.opts.coerceTypes&&(r+=" if ("+O+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+O+" = typeof "+m+"; if ("+t.util.checkDataType(t.schema.type,m,t.opts.strictNumbers)+") "+A+" = "+m+"; } "),r+=" if ("+A+" !== undefined) ; ";var C=k;if(C)for(var R,L=-1,P=C.length-1;L{"use strict";var r=/^[a-z_$][a-z0-9_$-]*$/i,i=n(165),o=n(128);t.exports={add:function(t,e){var n=this.RULES;if(n.keywords[t])throw new Error("Keyword "+t+" is already defined");if(!r.test(t))throw new Error("Keyword "+t+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var o=e.type;if(Array.isArray(o))for(var s=0;s{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!=e&&n!=n}},35:t=>{"use strict";t.exports=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var n,r="boolean"==typeof e.cycles&&e.cycles,i=e.cmp&&(n=e.cmp,function(t){return function(e,r){var i={key:e,value:t[e]},o={key:r,value:t[r]};return n(i,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);var n,s;if(Array.isArray(e)){for(s="[",n=0;n{"use strict";var e=t.exports=function(t,e,r){"function"==typeof e&&(r=e,e={}),n(e,"function"==typeof(r=e.cb||r)?r:r.pre||function(){},r.post||function(){},t,"",t)};function n(t,r,i,o,s,a,l,u,c,h){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var f in r(o,s,a,l,u,c,h),o){var p=o[f];if(Array.isArray(p)){if(f in e.arrayKeywords)for(var d=0;d{(()=>{var t={985:function(t){var e;"undefined"!=typeof self&&self,e=function(){return 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}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get: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=11)}([function(t,e,n){"use strict";var r=Array.prototype,i=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">"},s=/[&"'<>]/g;function a(t,e){return i.hasOwnProperty.call(t,e)}function l(t){return o[t]}function u(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,u.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var s=Object.getOwnPropertyDescriptor(i,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return i.stack})}else{var a=new Error(t).stack;o=function(){return a}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function c(t){return"[object Function]"===i.toString.call(t)}function h(t){return"[object Array]"===i.toString.call(t)}function f(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)s=i.slice(0,t.length),i.slice(s.length,a).forEach((function(t,n){n2?i-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:l,Root:h,NodeList:c,Value:u,Literal:f,Symbol:p,Group:d,Array:m,Pair:v,Dict:y,Output:U,Capture:V,TemplateData:K,If:_,IfAsync:E,InlineIf:b,For:x,AsyncEach:w,AsyncAll:k,Macro:T,Caller:S,Import:O,FromImport:A,FunCall:C,Filter:R,FilterAsync:L,KeywordArgs:P,Block:N,Super:I,Extends:F,Include:D,Set:j,Switch:M,Case:B,LookupVal:g,BinOp:H,In:z,Is:q,Or:G,And:Y,Not:W,Add:Q,Concat:X,Sub:J,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:st,CompareOperand:at,CallExtension:lt,CallExtensionAsync:ut,printNodes:function t(e,n){if(n=n||0,ct(e.typename+": ",n),e instanceof c)ct("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof lt)ct(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof l?r.push([e,t]):(i=i||{})[e]=t})),i?ct(JSON.stringify(i,null,2)+"\n",null,!0):ct("\n"),r.forEach((function(e){var r=e[0],i=e[1];ct("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),s=n(3),a=n(0).TemplateError,l=n(2).Frame,u=n(1).Obj,c={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},h=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new a(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var l=this._tmpid();this._emitLine(", "+this._makeCallback(l)),this._emitLine(this.buffer+" += runtime.suppressValue("+l+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+c[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,s.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof s.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+r+"]["+s+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+s+"]);"),e.set(t.name.children[s].value,a)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var a=t.name.children,l=a[0],u=a[1],c=this._tmpid(),h=this._tmpid();e.set(l.value,c),e.set(u.value,h),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+c+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+h+" = "+o+"["+c+"];"),this._emitLine('frame.set("'+l.value+'", '+c+");"),this._emitLine('frame.set("'+u.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var f=this._tmpid();e.set(t.name.value,f),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+f+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),a=this._tmpid(),l=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof s.Array){var u=t.name.children.length;this._emit("runtime."+l+"("+a+", "+u+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var c=t.name.value;this._emitLine("runtime."+l+"("+a+", 1, function("+c+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+c+'", '+c+");"),e.set(c,c)}this._emitLoopBindings(t,a,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var h=this._tmpid();this._emitLine("}, "+this._makeCallback(h)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+h+";"),t.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),a=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof s.Dict?i=e:(n.assertType(e,s.Symbol),r.push(e))}));var u,c=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),h=r.map((function(t){return'"'+t.value+'"'})),f=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));u=a?e.push(!0):new l,this._emitLines("var "+o+" = runtime.makeMacro(","["+h.join(", ")+"], ","["+f.join(", ")+"], ","function ("+c.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),u.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,u),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,u)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),s=this._makeCallback(i),a=n?"true":"false",l=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+a+", "+o+", "+l+", "+s),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,a=n._tmpid();t instanceof s.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+a+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,a),e.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof s.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new l,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(s.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new l;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(u);t.exports={compile:function(t,e,n,r,s){void 0===s&&(s={});var a=new h(r,s.throwOnUndefined),l=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return a.compile(o.transform(i.parse(l,n,s),e,r)),a.getCode()},Compiler:h}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var s=o.prototype;return s.resolve=function(t,e){return i.resolve(i.dirname(t),e)},s.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),s=n(15),a=n(0),l=n(5),u=n(18),c=n(10),h=c.FileSystemLoader,f=c.WebLoader,p=c.PrecompiledLoader,d=n(20),m=n(21),v=n(1),y=v.Obj,g=v.EmitterObj,_=n(2),E=_.handleError,b=_.Frame,x=n(22);function w(t,e,n){o((function(){t(e,n)}))}var k={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(E(t,null,null))}}}},T=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=a.isArray(t)?t:[t]:h?this.loaders=[new h("views")]:f&&(this.loaders=[new f("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(u).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),a._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=a.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,s=this,l=this,u=null;if(t&&t.raw&&(t=t.raw),a.isFunction(n)&&(i=n,n=null,e=e||!1),a.isFunction(e)&&(i=e,e=!1),t instanceof O)u=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var c=0;c0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var l=this.parsePrimary();r.addChild(new o.Pair(a.lineno,a.colno,a,l))}else r.addChild(a);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},l.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},l.parseExtends=function(){var t=this.peekToken();this.skipSymbol("extends")||this.fail("parseTemplateRef: expected extends");var e=new o.Extends(t.lineno,t.colno);return e.template=this.parseExpression(),this.advanceAfterBlockEnd(t.value),e},l.parseInclude=function(){var t=this.peekToken();this.skipSymbol("include")||this.fail("parseInclude: expected include");var e=new o.Include(t.lineno,t.colno);return e.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(e.ignoreMissing=!0),this.advanceAfterBlockEnd(t.value),e},l.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},l.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},l.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var a,l=this.peekToken(),u=[];do{this.skipSymbol(n);var c=this.parseExpression();this.advanceAfterBlockEnd(t);var h=this.parseUntilBlocks(n,r,e);u.push(new o.Case(l.line,l.col,c,h)),l=this.peekToken()}while(l&&l.value===n);switch(l.value){case r:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,s,u,a)},l.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var l=s[0],u=s[1],c=s[2];c===t?r+=1:c===e&&(r-=1),0===r?(i+=u,this.tokens.backN(l.length-u.length)):i+=l}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,i)])},l.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},l.parseExpression=function(){return this.parseInlineIf()},l.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},l.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},l.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},l.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},l.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},l.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},l.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},l.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},l.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},l.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},l.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},l.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},l.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},l.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},l.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},l.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},l.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},l.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},l.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},l.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},l.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},l.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var s=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,s))}else{var a=this.parseExpression();t.addChild(a)}}return t},l.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(a&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var l=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(l.lineno,l.colno,l,this.parseExpression())):r.addChild(l)}a=!0}return s.children.length&&r.addChild(s),r},l.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],j=L+this.current();switch(-1!==r.indexOf(D,j)&&(this.forward(),L=j,-1!==r.indexOf(D,j+this.current())&&(L=j+this.current(),this.forward())),L){case"(":F=d;break;case")":F=m;break;case"[":F=v;break;case"]":F=y;break;case"{":F=g;break;case"}":F=_;break;case",":F=b;break;case":":F=x;break;case"~":F=w;break;case"|":F=k;break;default:F=E}return R(F,L,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var M=this._extract("0123456789");return R(T,t+"."+M,e,n)}return R("int",t,e,n)}if(t.match(/^(true|false)$/))return R(S,t,e,n);if("none"===t)return R(O,t,e,n);if("null"===t)return R(O,t,e,n);if(t)return R(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var B,U=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,R(u,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,R(h,t,e,n);t="";var V=!1;for(this._matches(this.tags.COMMENT_START)&&(V=!0,t=this._extractString(this.tags.COMMENT_START));null!==(B=this._extractUntil(U));){if(t+=B,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!V){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var K=t.slice(-this.colno);if(/^\s+$/.test(K)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!V)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===B&&V)throw new Error("expected end of comment, got end of file");return R(V?p:l,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var u=l.length,c=v(l,u);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function s(){return"hole_"+o++}function a(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,s=r.repeat(" ",n/2-n%2),a=r.repeat(" ",n/2);return i.copySafeness(t,s+t+a)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var s in t)o.push([s,t[s]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],s=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var s=t.split("\n"),a=r.repeat(" ",e),l=s.map((function(t,e){return 0!==e||n?""+a+t:t})).join("\n");return i.copySafeness(t,l)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=l,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=u(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=u(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return s=n+t.split("").join(n)+n,i.copySafeness(t,s);var a=t.indexOf(e);if(0===r||-1===a)return t;for(var l=0,u=0;a>-1&&(-1===r||u=i&&c.push(n),o.push(c)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,s=r.map(t,(function(t){return t})),a=r.getAttrGetter(i);return s.sort((function(t,s){var l=i?a(t):t,u=i?a(s):s;if(o.env.opts.throwOnUndefined&&i&&(void 0===l||void 0===u))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(l)&&r.isString(u)&&(l=l.toLowerCase(),u=u.toLowerCase()),lu?e?-1:1:0})),s})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=c((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return a(t)}));return i.copySafeness(t,e.join(" "))},e.trim=c,e.truncate=function(t,e,n,r){var s=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var a=t.lastIndexOf(" ",e);-1===a&&(a=e),t=t.substring(0,a)}return t+=null!=r?r:"...",i.copySafeness(s,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var h=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,f=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){s(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(h),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":f.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return s(n)?e:n};var v=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return s(r)?e:r}));e.int=v,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t=t.length&&(e=0),this.current=t[e],this.current}}}t.exports=function(){return{range:function(t,e,n){void 0===e?(e=t,t=0,n=1):n||(n=1);var r=[];if(n>0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return r(Array.prototype.slice.call(arguments))},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,l=n(24);function u(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function c(t,e){(e=e||{}).isString=!0;var n=e.env||new a([]),r=e.wrapper||l;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([h(t,e.name,n)],e)}function h(t,e,n){var r,i=(n=n||new a([])).asyncFilters,l=n.extensionsList;e=e.replace(/\\/g,"/");try{r=s.compile(t,i,l,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new a([]),o=e.wrapper||l;if(e.isString)return c(t,e);var s=r.existsSync(t)&&r.statSync(t),f=[],p=[];if(s.isFile())f.push(h(r.readFileSync(t,"utf-8"),e.name||t,n));else if(s.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(s){var a=i.join(o,s),l=a.substr(i.join(t,"/").length),c=r.statSync(a);c&&c.isDirectory()?u(l+="/",e.exclude)||n(a):u(l,e.include)&&p.push(a)}))}(t);for(var d=0;dt.length||i>0&&s>=r||i<0&&s<=r);s+=i)o.push(n.memberLookup(t,s));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.r(i),r.d(i,{Component:()=>p,ComponentAttribute:()=>n,ComponentAttributeDefinition:()=>x,ComponentDefinition:()=>v,ComponentDrawOption:()=>k,ComponentLink:()=>R,ComponentLinkDefinition:()=>N,DefaultData:()=>Qi,DefaultDrawer:()=>Ii,DefaultMetadata:()=>Fi,DefaultParser:()=>ji,DefaultPlugin:()=>Zi,DefaultRender:()=>Mi,FileInformation:()=>s,FileInput:()=>B,ParseError:()=>Gi});var e=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,value:null,type:null,definition:null};t(this,e);var r=n.name,i=n.value,o=n.type,s=n.definition;this.name=r||null,this.value=i||null,this.type=o||null,this.definition=s||null}));const n=e;function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}const s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null};o(this,t);var n=e.path;this.path=n||null}var e,n;return e=t,(n=[{key:"fileName",get:function(){return this.path?this.path.replace(/^.*[\\/]/,""):null}}])&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,name:null,definition:null,drawOption:null,attributes:[]};l(this,a),t=s.call(this,e);var n=e.id,r=e.name,i=e.definition,o=e.drawOption,u=e.attributes;return t.__class="Component",t.id=n||null,t.name=r||null,t.definition=i||null,t.drawOption=o||null,t.attributes=u||[],t}return e=a,r=[{key:"setReferenceAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.containerRef.includes(t.definition.type)}));if(e){var r=this.attributes.filter((function(t){return t.definition.name===e.name}));r.length>0?r.forEach((function(e){e.value=t.id})):this.attributes.push(new n({name:e.name,value:t.id,type:"String",definition:e}))}}},{key:"removeAllReferenceAttributes",value:function(t){this.attributes=t?this.attributes.filter((function(e){var n=e.definition,r=e.value;return!("Reference"===n.type&&n.containerRef===t.definition.type&&r===t.id)})):this.attributes.filter((function(t){return"Reference"!==t.definition.type}))}},{key:"setLinkAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.name===t.definition.attributeRef})),r=this.attributes.find((function(t){var n=t.definition;return"Link"===n.type&&e.name===n.name}));r&&!r.value.includes(t.target)?r.value.push(t.target):r||this.attributes.push(new n({name:e.name,definition:e,type:"Array",value:[t.target]}))}},{key:"removeLinkAttribute",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.attributes=this.attributes.filter((function(n){if(e&&n.name!==e)return!0;if(n.definition&&"Link"===n.definition.type){var r=n.value.findIndex((function(e){return e===t}));return r>=0&&n.value.splice(r,1),0!==n.value.length}return!0}))}},{key:"getAttributeByName",value:function(t){return this.__getAttributeByName(this.attributes,t)}},{key:"__getAttributeByName",value:function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,icon:null,model:null,parentTypes:[],childrenTypes:[],definedAttributes:[],isContainer:!1};d(this,t);var n=e.type,r=e.icon,i=e.model,o=e.parentTypes,s=e.childrenTypes,a=e.definedAttributes,l=e.isContainer;this.type=n||null,this.icon=r||null,this.model=i||null,this.parentTypes=o||[],this.childrenTypes=s||[],this.definedAttributes=a||[],this.isContainer=void 0!==l&&l}));const v=m;function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,linkType:null,linkRef:[],linkColor:"black",linkWidth:2,linkDashStyle:null,containerRef:[],required:!1,definedAttributes:[],rules:{values:null,min:null,max:null,regex:null}};E(this,t);var n=e.name,r=e.type,i=e.linkType,o=e.linkRef,s=e.linkColor,a=e.linkWidth,l=e.linkDashStyle,u=e.containerRef,c=e.definedAttributes,h=e.required,f=e.rules;this.name=n||null,this.type=r||null,this.linkType=i||null,this.linkRef=o||[],this.linkColor=s||"black",this.linkWidth=a||2,this.linkDashStyle=l||null,this.containerRef=u||[],this.definedAttributes=c||[],this.required=h||!1,this.rules=g({values:null,min:null,max:null,regex:null},f)}));const x=b;function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}const k=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:null,y:null,width:null,height:null,needsResizing:!1};w(this,t);var n=e.x,r=e.y,i=e.width,o=e.height,s=e.needsResizing;this.x=n||null,this.y=r||null,this.width=i||null,this.height=o||null,this.needsResizing=s||!1}));function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}function A(t,e){if(e&&("object"===T(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function C(t){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},C(t)}const R=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=C(n);if(r){var i=C(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return A(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{source:null,target:null,definition:null};S(this,o),t=i.call(this);var n=e.source,r=e.target,s=e.definition;return t.__class="Link",t.source=n||null,t.target=r||null,t.definition=s||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(s);function L(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var P=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{attributeRef:null,sourceRef:null,targetRef:null,type:null,color:"black",width:2,dashStyle:null};L(this,t);var n=e.attributeRef,r=e.sourceRef,i=e.targetRef,o=e.type,s=e.color,a=e.width,l=e.dashStyle;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null,this.color=s||"black",this.width=a||2,this.dashStyle=l||null}));const N=P;function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},D(t,e)}function j(t,e){if(e&&("object"===I(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function M(t){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},M(t)}const B=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&D(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=M(n);if(r){var i=M(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return j(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,name:null,content:null};F(this,o),t=i.call(this,e);var n=e.content;return t.content=n||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(s);class U extends Map{constructor(t,e=z){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(K(this,t))}has(t){return super.has(K(this,t))}set(t,e){return super.set($(this,t),e)}delete(t){return super.delete(H(this,t))}}class V extends Set{constructor(t,e=z){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(K(this,t))}add(t){return super.add($(this,t))}delete(t){return super.delete(H(this,t))}}function K({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function $({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function H({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function z(t){return null!==t&&"object"==typeof t?t.valueOf():t}function q(t){return t}function G(){}function Y(t){return null==t?G:function(){return this.querySelector(t)}}function W(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function Q(){return[]}function X(t){return null==t?Q:function(){return this.querySelectorAll(t)}}function J(t){return function(){return this.matches(t)}}function Z(t){return function(e){return e.matches(t)}}var tt=Array.prototype.find;function et(){return this.firstElementChild}var nt=Array.prototype.filter;function rt(){return Array.from(this.children)}function it(t){return new Array(t.length)}function ot(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function st(t){return function(){return t}}function at(t,e,n,r,i,o){for(var s,a=0,l=e.length,u=o.length;ae?1:t>=e?0:NaN}ot.prototype={constructor:ot,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var ft="http://www.w3.org/1999/xhtml";const pt={svg:"http://www.w3.org/2000/svg",xhtml:ft,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function dt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),pt.hasOwnProperty(e)?{space:pt[e],local:t}:t}function mt(t){return function(){this.removeAttribute(t)}}function vt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function yt(t,e){return function(){this.setAttribute(t,e)}}function gt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function _t(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Et(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function bt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function xt(t){return function(){this.style.removeProperty(t)}}function wt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function kt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Tt(t,e){return t.style.getPropertyValue(e)||bt(t).getComputedStyle(t,null).getPropertyValue(e)}function St(t){return function(){delete this[t]}}function Ot(t,e){return function(){this[t]=e}}function At(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Ct(t){return t.trim().split(/^|\s+/)}function Rt(t){return t.classList||new Lt(t)}function Lt(t){this._node=t,this._names=Ct(t.getAttribute("class")||"")}function Pt(t,e){for(var n=Rt(t),r=-1,i=e.length;++r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function Zt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ie=[null];function oe(t,e){this._groups=t,this._parents=e}function se(){return new oe([[document.documentElement]],ie)}oe.prototype=se.prototype={constructor:oe,select:function(t){"function"!=typeof t&&(t=Y(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=b&&(b=E+1);!(_=v[b])&&++b=0;)(r=i[o])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ht);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?xt:"function"==typeof e?kt:wt)(t,e,null==n?"":n)):Tt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?St:"function"==typeof e?At:Ot)(t,e)):this.node()[t]},classed:function(t,e){var n=Ct(t+"");if(arguments.length<2){for(var r=Rt(this.node()),i=-1,o=n.length;++i{}};function ue(){for(var t,e=0,n=arguments.length,r={};e=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function fe(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(void 0,t),e=e._next;--ye}()}finally{ye=0,function(){for(var t,e,n=me,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:me=e);ve=t,Le(r)}(),be=0}}function Re(){var t=we.now(),e=t-Ee;e>1e3&&(xe-=e,Ee=t)}function Le(t){ye||(ge&&(ge=clearTimeout(ge)),t-be>24?(t<1/0&&(ge=setTimeout(Ce,t-we.now()-xe)),_e&&(_e=clearInterval(_e))):(_e||(Ee=we.now(),_e=setInterval(Re,1e3)),ye=1,ke(Ce)))}function Pe(t,e,n){var r=new Oe;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Oe.prototype=Ae.prototype={constructor:Oe,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Te():+n)+(null==e?0:+e),this._next||ve===this||(ve?ve._next=this:me=this,ve=this),this._call=t,this._time=n,Le()},stop:function(){this._call&&(this._call=null,this._time=1/0,Le())}};var Ne=de("start","end","cancel","interrupt"),Ie=[];function Fe(t,e,n,r,i,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(l){var u,c,h,f;if(1!==n.state)return a();for(u in i)if((f=i[u]).name===n.name){if(3===f.state)return Pe(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[u]):+u0)throw new Error("too late; already scheduled");return n}function je(t,e){var n=Me(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Me(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Be(t,e){var n,r,i,o=t.__transition,s=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):s=!1;s&&delete t.__transition}}function Ue(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Ve,Ke=180/Math.PI,$e={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function He(t,e,n,r,i,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Ue(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Ue(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,s.skewX,a,l),function(t,e,n,r,o,s){if(t!==n||e!==r){var a=o.push(i(o)+"scale(",null,",",null,")");s.push({i:a-4,x:Ue(t,n)},{i:a-2,x:Ue(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,r=l.length;++n>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?gn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?gn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=an.exec(t))?new bn(e[1],e[2],e[3],1):(e=ln.exec(t))?new bn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=un.exec(t))?gn(e[1],e[2],e[3],e[4]):(e=cn.exec(t))?gn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=hn.exec(t))?On(e[1],e[2]/100,e[3]/100,1):(e=fn.exec(t))?On(e[1],e[2]/100,e[3]/100,e[4]):pn.hasOwnProperty(t)?yn(pn[t]):"transparent"===t?new bn(NaN,NaN,NaN,0):null}function yn(t){return new bn(t>>16&255,t>>8&255,255&t,1)}function gn(t,e,n,r){return r<=0&&(t=e=n=NaN),new bn(t,e,n,r)}function _n(t){return t instanceof Ze||(t=vn(t)),t?new bn((t=t.rgb()).r,t.g,t.b,t.opacity):new bn}function En(t,e,n,r){return 1===arguments.length?_n(t):new bn(t,e,n,null==r?1:r)}function bn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function xn(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}`}function wn(){const t=kn(this.opacity);return`${1===t?"rgb(":"rgba("}${Tn(this.r)}, ${Tn(this.g)}, ${Tn(this.b)}${1===t?")":`, ${t})`}`}function kn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Tn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Sn(t){return((t=Tn(t))<16?"0":"")+t.toString(16)}function On(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Cn(t,e,n,r)}function An(t){if(t instanceof Cn)return new Cn(t.h,t.s,t.l,t.opacity);if(t instanceof Ze||(t=vn(t)),!t)return new Cn;if(t instanceof Cn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=e===o?(n-r)/a+6*(n0&&l<1?0:s,new Cn(s,a,l,t.opacity)}function Cn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Rn(t){return(t=(t||0)%360)<0?t+360:t}function Ln(t){return Math.max(0,Math.min(1,t||0))}function Pn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Nn(t,e,n,r,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*n+(1+3*t+3*o-3*s)*r+s*i)/6}Xe(Ze,vn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:dn,formatHex:dn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return An(this).formatHsl()},formatRgb:mn,toString:mn}),Xe(bn,En,Je(Ze,{brighter(t){return t=null==t?en:Math.pow(en,t),new bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?tn:Math.pow(tn,t),new bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new bn(Tn(this.r),Tn(this.g),Tn(this.b),kn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xn,formatHex:xn,formatHex8:function(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}${Sn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:wn,toString:wn})),Xe(Cn,(function(t,e,n,r){return 1===arguments.length?An(t):new Cn(t,e,n,null==r?1:r)}),Je(Ze,{brighter(t){return t=null==t?en:Math.pow(en,t),new Cn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?tn:Math.pow(tn,t),new Cn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new bn(Pn(t>=240?t-240:t+120,i,r),Pn(t,i,r),Pn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Cn(Rn(this.h),Ln(this.s),Ln(this.l),kn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=kn(this.opacity);return`${1===t?"hsl(":"hsla("}${Rn(this.h)}, ${100*Ln(this.s)}%, ${100*Ln(this.l)}%${1===t?")":`, ${t})`}`}}));const In=t=>()=>t;function Fn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):In(isNaN(t)?e:t)}const Dn=function t(e){var n=function(t){return 1==(t=+t)?Fn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):In(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=En(t)).r,(e=En(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),s=Fn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return r.gamma=t,r}(1);function jn(t){return function(e){var n,r,i=e.length,o=new Array(i),s=new Array(i),a=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=ro&&(i=e.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Ue(n,r)})),o=Bn.lastIndex;return o=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?De:je;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}var ir=ae.prototype.constructor;function or(t){return function(){this.style.removeProperty(t)}}function sr(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ar(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&sr(t,o,n)),r}return o._value=e,o}function lr(t){return function(e){this.textContent=t.call(this,e)}}function ur(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&lr(r)),e}return r._value=t,r}var cr=0;function hr(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function fr(){return++cr}var pr=ae.prototype;hr.prototype=function(t){return ae().transition(t)}.prototype={constructor:hr,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Y(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s()=>t;function Cr(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}function Rr(t){return!t.ctrlKey&&!t.button}function Lr(){return this.parentNode}function Pr(t,e){return null==e?{x:t.x,y:t.y}:e}function Nr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ir(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function Fr(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=jr)):void 0===e&&(e=Dr);for(var n,r,i,o,s,a=new Ur(t),l=[a];n=l.pop();)if((i=e(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new Ur(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(Br)}function Dr(t){return t.children}function jr(t){return Array.isArray(t)?t[1]:null}function Mr(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Br(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Ur(t){this.data=t,this.depth=this.height=0,this.parent=null}function Vr(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Kr(t,e,n,r,i){for(var o,s=t.children,a=-1,l=s.length,u=t.value&&(r-e)/t.value;++a=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Fr(this).eachBefore(Mr)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;nf&&(f=a),v=c*c*m,(p=Math.max(f/v,v/h))>d){c-=a;break}d=p}y.push(s={value:c,dice:l1?e:1)},n}((1+Math.sqrt(5))/2);function zr(t){if("function"!=typeof t)throw new Error;return t}function qr(){return 0}function Gr(t){return function(){return t}}function Yr(t){return"string"==typeof t?new oe([document.querySelectorAll(t)],[document.documentElement]):new oe([W(t)],ie)}const Wr=Math.PI,Qr=2*Wr,Xr=1e-6,Jr=Qr-Xr;function Zr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ti(){return new Zr}Zr.prototype=ti.prototype={constructor:Zr,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,s=this._y1,a=n-t,l=r-e,u=o-t,c=s-e,h=u*u+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>Xr)if(Math.abs(c*a-l*u)>Xr&&i){var f=n-o,p=r-s,d=a*a+l*l,m=f*f+p*p,v=Math.sqrt(d),y=Math.sqrt(h),g=i*Math.tan((Wr-Math.acos((d+h-m)/(2*v*y)))/2),_=g/y,E=g/v;Math.abs(_-1)>Xr&&(this._+="L"+(t+_*u)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*f>u*p)+","+(this._x1=t+E*a)+","+(this._y1=e+E*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var s=(n=+n)*Math.cos(r),a=n*Math.sin(r),l=t+s,u=e+a,c=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>Xr||Math.abs(this._y1-u)>Xr)&&(this._+="L"+l+","+u),n&&(h<0&&(h=h%Qr+Qr),h>Jr?this._+="A"+n+","+n+",0,1,"+c+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):h>Xr&&(this._+="A"+n+","+n+",0,"+ +(h>=Wr)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};const ei=ti;var ni=Array.prototype.slice;function ri(t){return function(){return t}}function ii(t){return t[0]}function oi(t){return t[1]}function si(t){return t.source}function ai(t){return t.target}class li{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function ui(t){return new li(t,!0)}function ci(t){return new li(t,!1)}function hi(t){return((t=Math.exp(t))+1/t)/2}const fi=function t(e,n,r){function i(t,i){var o,s,a=t[0],l=t[1],u=t[2],c=i[0],h=i[1],f=i[2],p=c-a,d=h-l,m=p*p+d*d;if(m<1e-12)s=Math.log(f/u)/e,o=function(t){return[a+t*p,l+t*d,u*Math.exp(e*t*s)]};else{var v=Math.sqrt(m),y=(f*f-u*u+r*m)/(2*u*n*v),g=(f*f-u*u-r*m)/(2*f*n*v),_=Math.log(Math.sqrt(y*y+1)-y),E=Math.log(Math.sqrt(g*g+1)-g);s=(E-_)/e,o=function(t){var r,i=t*s,o=hi(_),c=u/(n*v)*(o*(r=e*i+_,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[a+c*p,l+c*d,u*o/hi(e*i+_)]}}return o.duration=1e3*s*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4),pi=t=>()=>t;function di(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function mi(t,e,n){this.k=t,this.x=e,this.y=n}mi.prototype={constructor:mi,scale:function(t){return 1===t?this:new mi(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new mi(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var vi=new mi(1,0,0);function yi(t){for(;!t.__zoom;)if(!(t=t.parentNode))return vi;return t.__zoom}function gi(t){t.stopImmediatePropagation()}function _i(t){t.preventDefault(),t.stopImmediatePropagation()}function Ei(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function bi(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function xi(){return this.__zoom||vi}function wi(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ki(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ti(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}yi.prototype=mi.prototype;var Si=r(985),Oi=r.n(Si);const Ai='';function Ci(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],s=!0,a=!1;try{for(n=n.call(t);!(s=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);s=!0);}catch(t){a=!0,i=t}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}}(t,e)||Ri(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ri(t,e){if(t){if("string"==typeof t)return Li(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Li(t,e):void 0}}function Li(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{SelectEvent:null,UpdateEvent:null},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"root",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};Pi(this,t),this.pluginData=e,this.rootId=i,this.resources=n,this.width=void 0!==o.width?o.width:1280,this.height=void 0!==o.height?o.height:1280,this.minWidth=void 0!==o.minWidth?o.minWidth:230,this.minHeight=void 0!==o.minHeight?o.minHeight:50,this.padding=void 0!==o.padding?o.padding:30,this.margin=void 0!==o.margin?o.margin:6,this.lineLengthPerDepth=void 0!==o.lineLengthPerDepth?o.lineLengthPerDepth:[5,1],this.actionMenuButtonSize=o.actionMenuButtonSize||24,this.actions={selection:{current:null,style:"2px solid hsl(205, 100%, 50%)",offset:"3px"},linkCreation:{source:null,target:null,creating:!1},drag:{offsetX:0,offsetY:0,state:!1,target:null}},this.setEvents(r)}var e,n;return e=t,n=[{key:"screenToSVG",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=n||this.svg.node(),i=new DOMPoint(t,e);return i.matrixTransform(r.getScreenCTM().inverse())}},{key:"SVGToScreen",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=n||this.svg.node(),i=new DOMPoint(t,e);return i.matrixTransform(r.getScreenCTM())}},{key:"setEvents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{SelectEvent:null,UpdateEvent:null};this.events={SelectEvent:t.SelectEvent||null,UpdateEvent:t.UpdateEvent||null}}},{key:"emitUpdateEvent",value:function(){this.events&&this.events.UpdateEvent&&this.events.UpdateEvent.next()}},{key:"__getVerticalCoefficient",value:function(t){var e=this;if(t.children&&t.children.length>0){var n=Math.ceil(t.children.filter((function(t){return t&&t.data&&t.data.definition&&t.data.definition.isContainer})).reduce((function(t,n){return t+e.__getVerticalCoefficient(n)}),0));return t.children.filter((function(t){return!(t&&t.data&&t.data.definition&&t.data.definition.isContainer)})).reduce((function(t,e){return t+e.value}),0)/this.getLineLengthForDepth(t.depth)+n+(t.data&&t.data.definition&&t.data.definition.isContainer?1:0)}return t.value/this.getLineLengthForDepth(t.depth)+(t.data&&t.data.definition&&t.data.definition.isContainer?1:0)}},{key:"getLineLengthForDepth",value:function(t){return this.lineLengthPerDepth[Math.min(t,this.lineLengthPerDepth.length-1)]}},{key:"setDisabledStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".component",e="#".concat(this.rootId," ").concat(t||".component");Yr(e).classed("disabled",!0)}},{key:"unsetAllDisabledStyles",value:function(){Yr("#".concat(this.rootId," .disabled")).classed("disabled",!1)}},{key:"dragHandler",value:function(t,e){this.hideActionMenu();var n=document.elementsFromPoint(e.sourceEvent.x,e.sourceEvent.y).find((function(t){return e.subject.data.id!==t.dataset.parentId&&(t.classList.contains("container-background")||t.classList.contains("container"))})),r=Er("#".concat(e.subject.data.id)).attr("cursor","grabbing");Er("#root-components").append((function(){return r.node()}));var i=this.screenToSVG(e.sourceEvent.clientX,e.sourceEvent.clientY,this.svg.select(".container").node());if(Er(t).attr("transform",e.subject.transform="translate(".concat(i.x-this.actions.drag.offsetX,",\n ").concat(i.y-this.actions.drag.offsetY,")")),e.subject.x=i.x-this.actions.drag.offsetX,e.subject.y=i.y-this.actions.drag.offsetY,e.subject.data.definition){var o=e.subject.data.definition.parentTypes.map((function(t){return":not(.".concat(t,")")})).join("");this.setDisabledStyle(".component:not(#".concat(e.subject.data.id,")").concat(o))}return this.drawLinks(),n}},{key:"setupDragBehavior",value:function(){var t=this,e=null,n=!1,r=this.dragHandler.bind(this);return function(){var t,e,n,r,i=Rr,o=Lr,s=Pr,a=Nr,l={},u=de("start","drag","end"),c=0,h=0;function f(t){t.on("mousedown.drag",p).filter(a).on("touchstart.drag",v).on("touchmove.drag",y,xr).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(s,a){if(!r&&i.call(this,s,a)){var l=_(this,o.call(this,s,a),s,a,"mouse");l&&(Er(s.view).on("mousemove.drag",d,wr).on("mouseup.drag",m,wr),Sr(s.view),kr(s),n=!1,t=s.clientX,e=s.clientY,l("start",s))}}function d(r){if(Tr(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>h}l.mouse("drag",r)}function m(t){Er(t.view).on("mousemove.drag mouseup.drag",null),Or(t.view,n),Tr(t),l.mouse("end",t)}function v(t,e){if(i.call(this,t,e)){var n,r,s=t.changedTouches,a=o.call(this,t,e),l=s.length;for(n=0;nsvg")).empty()?(this.svg=Er("#".concat(this.rootId)).append("svg").attr("viewBox",[0,0,this.width,this.height]).attr("preserveAspectRatio","xMinYMin meet").style("font","10px sans-serif"),this.svg.append("g").attr("class","container").attr("height","100%").attr("width","100%").attr("x",0).attr("y",0)):this.svg=Er("#".concat(this.rootId)).select("svg")}},{key:"draw",value:function(t){this.rootId=t,this.createRenderingContext(),this.__unselectComponent(),this.drawComponents(),this.drawLinks(),this.setViewPortAction(Er("#".concat(this.rootId)))}},{key:"clickHandler",value:function(t){t.stopPropagation(),this.__selectComponent(Er(t.currentTarget))}},{key:"drawComponents",value:function(){var t=this;this.shadowRoot={children:this.pluginData.components,id:"__shadowRoot",name:""};var e=this.buildTree(),n=this.clickHandler.bind(this),r=this.setupDragBehavior(),i=this.svg.select(".container").selectAll("g").data(e,(function(t){return t})).join("g").attr("id",(function(t){return Ci(t,1)[0]})).selectAll("g").data((function(t){return Ci(t,2)[1]})).join("g").attr("id",(function(t){return t.data.id})).on("click",n).call(r).attr("x",(function(t){return t.x0})).attr("y",(function(t){return t.y0})).attr("transform",(function(t){var e=t.x0,n=t.y0;return"translate(".concat(e,",").concat(n,")")}));i.filter((function(t){return"__shadowRoot"!==t.data.id})).attr("class",(function(t){var e=t.data;return"component\n component-".concat(e.definition.model,"\n ").concat(e.definition.type)})).html((function(e){var n=e.data;return Oi().renderString(t.resources.models[n.definition.model],n)})).select("svg").attr("id",(function(t){var e=t.data;return"svg-".concat(e.id)})).attr("height",(function(t){var e=t.y0;return t.y1-e})).attr("width",(function(t){var e=t.x0;return t.x1-e})),i.select(".component-icon").html((function(e){var n=e.data;return t.resources.icons[n.definition.icon]})),i.select("rect").filter((function(t){return t.data&&t.data.definition&&t.data.definition.isContainer})).attr("height",(function(t){var e=t.y0;return t.y1-e})).attr("width",(function(t){var e=t.x0;return t.x1-e})),i.select(".component-container").attr("height",(function(e){var n=e.y0,r=e.y1;return Math.max(r-(n+t.minHeight)-t.margin,t.minHeight)})).attr("width",(function(e){var n=e.x0,r=e.x1;return Math.max(r-n-2*t.margin,t.minWidth)})).attr("x",(function(){return t.margin})).attr("y",(function(){return t.minHeight})).filter((function(t){return t.children})).append((function(t){var e=t.data;return Er("#group-".concat(e.id)).node()})),i.select(".component-container>rect").attr("data-parentId",(function(t){return t.data.id}))}},{key:"buildTree",value:function(){var t=this,e=function(){var t=Hr,e=!1,n=1,r=1,i=[0],o=qr,s=qr,a=qr,l=qr,u=qr;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(h),i=[0],e&&t.eachBefore(Vr),t}function h(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,h=e.x1-n,f=e.y1-n;h=r.length)return n(i);const s=new U,a=r[o++];let l=-1;for(const t of i){const e=a(t,++l,i),n=s.get(e);n?n.push(t):s.set(e,[t])}for(const[e,n]of s)s.set(e,t(n,o));return e(s)}(t,0)}(t,Array.from,q,e)}(n,(function(t){var e=t.parent;return e&&"__shadowRoot"!==e.data.id?"group-".concat(e.data.id):"root-components"})).filter((function(t){return"root-__shadowRoot"!==Ci(t,1)[0]}))}},{key:"getAnchorPoint",value:function(t,e){if(t.empty()||e.empty())return null;var n,r=t.node().getBoundingClientRect(),i=this.getSelectionCenter(t),o=this.getSelectionCenter(e),s=this.getBearing(this.screenToSVG(i.x,i.y,this.svg.select(".container").node()),this.screenToSVG(o.x,o.y,this.svg.select(".container").node())),a={y:r.top,x:r.x+r.width/2},l={y:r.bottom,x:r.x+r.width/2},u={x:r.left,y:r.top+r.height/2},c={x:r.right,y:r.top+r.height/2};n=s<45||s>=315?l:s>=45&&s<135?c:s>=135&&s<225?a:u;var h=this.screenToSVG(n.x,n.y);return[h.x,h.y]}},{key:"drawLinks",value:function(){var t=this,e=this.pluginData.getLinks();if(e){var n=this.svg.selectAll(".link");n.data(e,(function(t){return t})).join("path").filter((function(t){var e=t.source,n=t.target;return!Er("#".concat(e)).empty()&&!Er("#".concat(n)).empty()})).classed("link",!0).attr("d",(function(e){return t.getLinkGenerator(e)(e)})).attr("fill","none").attr("stroke",(function(t){return t.definition.color})).attr("stroke-width",(function(t){return t.definition.width})).attr("stroke-dasharray",(function(t){return t.definition.dashStyle||"none"})).attr("cursor","pointer").on("click",(function(e){return t.clickHandler(e)})),n.raise()}}},{key:"getSelectionCenter",value:function(t){var e=t.node().getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2}}},{key:"getBearing",value:function(t,e){var n=e.x-t.x,r=e.y-t.y,i=n/Math.sqrt(Math.pow(n,2)+Math.pow(r,2)),o=r/Math.sqrt(Math.pow(n,2)+Math.pow(r,2));return(Math.atan2(i,o)*(180/Math.PI)+360)%360}},{key:"getLinkGenerator",value:function(t){var e=Er("#".concat(t.source)),n=Er("#".concat(t.target)),r=this.getAnchorPoint(e,n),i=this.getAnchorPoint(n,e),o=this.getSelectionCenter(e),s=this.getSelectionCenter(n),a=this.getBearing(this.screenToSVG(o.x,o.y,this.svg.select(".container").node()),this.screenToSVG(s.x,s.y,this.svg.select(".container").node()));return function(t){let e=si,n=ai,r=ii,i=oi,o=null,s=null;function a(){let a;const l=ni.call(arguments),u=e.apply(this,l),c=n.apply(this,l);if(null==o&&(s=t(a=ei())),s.lineStart(),l[0]=u,s.point(+r.apply(this,l),+i.apply(this,l)),l[0]=c,s.point(+r.apply(this,l),+i.apply(this,l)),s.lineEnd(),a)return s=null,a+""||null}return a.source=function(t){return arguments.length?(e=t,a):e},a.target=function(t){return arguments.length?(n=t,a):n},a.x=function(t){return arguments.length?(r="function"==typeof t?t:ri(+t),a):r},a.y=function(t){return arguments.length?(i="function"==typeof t?t:ri(+t),a):i},a.context=function(e){return arguments.length?(null==e?o=s=null:s=t(o=e),a):o},a}(a<45||a>=315||a>=135&&a<225?ci:ui).source((function(){return r})).target((function(){return i}))}},{key:"setupTiles",value:function(t){var e=this,n={x1:0,y1:0};t.forEach((function(t,r){var i,o={x1:0,y0:r*e.minHeight+e.padding};if(t.items.forEach((function(t){if(t.data.drawOption?(t.x0=t.data.drawOption.x,t.y0=t.data.drawOption.y):(t.x0=o.x1+e.padding,t.y0=n.y1+e.padding,o=t),!t.data.drawOption||t.data.drawOption.needsResizing){var r=Math.min(t.value,e.getLineLengthForDepth(t.depth)),i=Math.ceil(e.__getVerticalCoefficient(t));t.x1=t.x0+r*(e.minWidth+2*e.margin)+2*t.height*e.padding+(r-1)*(e.padding+2*e.margin),t.y1=t.y0+i*e.minHeight+t.height*e.padding+(i-1)*(e.padding+e.margin),t.data.drawOption&&(t.data.drawOption.needsResizing=!1,t.data.drawOption.width=t.x1-t.x0,t.data.drawOption.height=t.y1-t.y0)}else t.x1=t.x0+t.data.drawOption.width,t.y1=t.y0+t.data.drawOption.height})),t.items.length>0){var s=Math.max.apply(Math,function(t){if(Array.isArray(t))return Li(t)}(i=t.items.map((function(t){return t.value})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||Ri(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());n=t.items.find((function(t){return t.value===s}))}}))}},{key:"__buildLines",value:function(t){var e=this,n=t.children,r=t.depth,i=[{total:0,items:[]}],o=0,s=i[o];return n.forEach((function(t){s.items.length>=e.getLineLengthForDepth(r)&&(i.push({total:0,items:[]}),o+=1),(s=i[o]).total+=t.value,s.items.push(t)})),i}},{key:"setViewPortAction",value:function(t){var e=this;this.svg.on("click",(function(){e.__unselectComponent(),e.cancelLinkCreationInteraction()}));var n=this.drawLinks.bind(this);t.call(function(){var t,e,n,r=Ei,i=bi,o=Ti,s=wi,a=ki,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,h=fi,f=de("start","zoom","end"),p=500,d=0,m=10;function v(t){t.property("__zoom",xi).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",T).filter(a).on("touchstart.zoom",S).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new mi(e,t.x,t.y)}function g(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new mi(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function E(t,e,n,r){t.on("start.zoom",(function(){b(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,s=b(t,o).event(r),a=i.apply(t,o),l=null==n?_(a):"function"==typeof n?n.apply(t,o):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=t.__zoom,f="function"==typeof e?e.apply(t,o):e,p=h(c.invert(l).concat(u/c.k),f.invert(l).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=p(t),n=u/e[2];t=new mi(n,l[0]-e[0]*n,l[1]-e[1]*n)}s.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new x(t,e)}function x(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function w(t,...e){if(r.apply(this,arguments)){var n=b(this,e).event(t),i=this.__zoom,a=Math.max(l[0],Math.min(l[1],i.k*Math.pow(2,s.apply(this,arguments)))),c=br(t);if(n.wheel)n.mouse[0][0]===c[0]&&n.mouse[0][1]===c[1]||(n.mouse[1]=i.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(i.k===a)return;n.mouse=[c,i.invert(c)],Be(this),n.start()}_i(t),n.wheel=setTimeout(h,150),n.zoom("mouse",o(g(y(i,a),n.mouse[0],n.mouse[1]),n.extent,u))}function h(){n.wheel=null,n.end()}}function k(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,s=b(this,e,!0).event(t),a=Er(t.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",p,!0),l=br(t,i),c=t.clientX,h=t.clientY;Sr(t.view),gi(t),s.mouse=[l,this.__zoom.invert(l)],Be(this),s.start()}function f(t){if(_i(t),!s.moved){var e=t.clientX-c,n=t.clientY-h;s.moved=e*e+n*n>d}s.event(t).zoom("mouse",o(g(s.that.__zoom,s.mouse[0]=br(t,i),s.mouse[1]),s.extent,u))}function p(t){a.on("mousemove.zoom mouseup.zoom",null),Or(t.view,s.moved),_i(t),s.event(t).end()}}function T(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,s=br(t.changedTouches?t.changedTouches[0]:t,this),a=n.invert(s),l=n.k*(t.shiftKey?.5:2),h=o(g(y(n,l),s,a),i.apply(this,e),u);_i(t),c>0?Er(this).transition().duration(c).call(E,h,s,t):Er(this).call(v.transform,h,s,t)}}function S(n,...i){if(r.apply(this,arguments)){var o,s,a,l,u=n.touches,c=u.length,h=b(this,i,n.changedTouches.length===c).event(n);for(gi(n),s=0;s',handler:function(){this.startLinkCreationInteraction()}},{id:"remove-component",icon:Ai,handler:function(){this.pluginData.removeComponentById(this.actions.selection.current.id),this.emitUpdateEvent(),this.draw(this.rootId)}}]:[{id:"remove-link",icon:Ai,handler:function(){this.pluginData.removeLink(this.actions.selection.current),this.emitUpdateEvent(),this.draw(this.rootId)}}]}},{key:"cancelLinkCreationInteraction",value:function(){this.actions.linkCreation.creating=!1,this.actions.linkCreation.source=null,this.actions.linkCreation.target=null,this.unsetAllDisabledStyles()}},{key:"hideActionMenu",value:function(){Er("#action-menu").remove()}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],e=t.reduce((function(t,e){return t[e.path]="",t}),{});return this.renderFiles().forEach((function(t){e[t.path]=t.content})),Object.keys(e).map((function(t){return new B({path:t,content:e[t]})}))}},{key:"renderFiles",value:function(){return[]}},{key:"renderConfiguration",value:function(t){var e={};this.pluginData.components.filter((function(t){return t.drawOption})).forEach((function(t){e[t.id]=t.drawOption}));var n=JSON.parse(t.content)||{};n[this.pluginData.name]=e,t.content=JSON.stringify(n,(function(t,e){return null===e?void 0:e}))}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"Error happened when trying to parse.",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"Error";return Ui(this,o),(t=i.call(this,e)).name="ParseError",t.startLine=n,t.startColumn=r,t.endLine=s,t.endColumn=a,t.severity=l,t}return r=o,Object.defineProperty(r,"prototype",{writable:!1}),r}(Ki(Error));function Yi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Wi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,version:null,components:[],definitions:{components:[],links:[]},parseErrors:[]};Yi(this,t),this.name=e.name||null,this.version=e.version||null,this.components=e.components||[],this.definitions={components:[],links:[]},e.definitions&&(this.definitions.components=e.definitions.components||[],this.definitions.links=e.definitions.links||[]),this.parseErrors=e.parseErrors||[]}var e,n;return e=t,n=[{key:"coreVersion",get:function(){return"0.11.0"}},{key:"getComponentById",value:function(t){return this.components.find((function(e){return e.id===t}))||null}},{key:"getComponentsByType",value:function(t){return this.components.filter((function(e){var n=e.definition;return n&&n.type===t}))}},{key:"addComponent",value:function(t,e){this.components.push(new p({id:t,name:t,definition:e}))}},{key:"removeComponentById",value:function(t){var e=this;this.getChildren(t).forEach((function(t){return e.removeComponentById(t.id)})),this.components=this.components.filter((function(e){return e.id!==t})),this.components.forEach((function(e){e.removeLinkAttribute(t)}))}},{key:"removeLink",value:function(t){var e=t.source,n=t.target,r=t.definition.attributeRef;this.getComponentById(e).removeLinkAttribute(n,r)}},{key:"getLinks",value:function(){var t=this,e=[];return this.definitions.links.forEach((function(n){t.getComponentsByType(n.sourceRef).forEach((function(t){var r=t.getAttributeByName(n.attributeRef);r&&r.value.forEach((function(r){return e.push(new R({definition:n,source:t.id,target:r}))}))}))})),e}},{key:"initLinkDefinitions",value:function(){var t=this;this.definitions.links=[],this.definitions.components.forEach((function(e){var n=e.type,r=e.definedAttributes;t.__setLinkDefinitions(n,r)}))}},{key:"__setLinkDefinitions",value:function(t,e){var n=this;e.forEach((function(e){if("Link"===e.type){var r=new N({type:e.linkType,attributeRef:e.name,sourceRef:t,targetRef:e.linkRef,color:e.linkColor,width:e.linkWidth,dashStyle:e.linkDashStyle});n.definitions.links.push(r)}else"Object"===e.type&&n.__setLinkDefinitions(t,e.definedAttributes)}))}},{key:"getChildren",value:function(t){return this.components.filter((function(e){return e.getContainerId()===t}))}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{pluginData:null,pluginDrawer:null,pluginMetadata:null,pluginParser:null,pluginRenderer:null};Xi(this,t),this.data=e.pluginData||new Qi,this.__drawer=e.pluginDrawer||new Ii(this.data),this.__metadata=e.pluginMetadata||new Fi(this.data),this.__parser=e.pluginParser||new ji(this.data),this.__renderer=e.pluginRenderer||new Mi(this.data)}var e,n;return e=t,n=[{key:"init",value:function(t){this.__drawer.setEvents(t),this.__metadata.parse(),this.data.initLinkDefinitions()}},{key:"initResources",value:function(t){this.__drawer.resources=t}},{key:"draw",value:function(t){this.__drawer.draw(t)}},{key:"parse",value:function(t,e){this.__parser.parse(e),this.__parser.parseConfiguration(t)}},{key:"isParsable",value:function(t){return this.__parser.isParsable(t)}},{key:"render",value:function(t,e){return this.__renderer.renderConfiguration(t),this.__renderer.render(e)}}],n&&function(t,e){for(var n=0;n":">"},s=/[&"'<>]/g;function a(t,e){return i.hasOwnProperty.call(t,e)}function l(t){return o[t]}function u(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,u.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var s=Object.getOwnPropertyDescriptor(i,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return i.stack})}else{var a=new Error(t).stack;o=function(){return a}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function c(t){return"[object Function]"===i.toString.call(t)}function h(t){return"[object Array]"===i.toString.call(t)}function f(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)s=i.slice(0,t.length),i.slice(s.length,a).forEach((function(t,n){n2?i-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:l,Root:h,NodeList:c,Value:u,Literal:f,Symbol:p,Group:d,Array:m,Pair:v,Dict:y,Output:U,Capture:V,TemplateData:K,If:_,IfAsync:E,InlineIf:b,For:x,AsyncEach:w,AsyncAll:k,Macro:T,Caller:S,Import:O,FromImport:A,FunCall:C,Filter:R,FilterAsync:L,KeywordArgs:P,Block:N,Super:I,Extends:F,Include:D,Set:j,Switch:M,Case:B,LookupVal:g,BinOp:H,In:z,Is:q,Or:G,And:Y,Not:W,Add:Q,Concat:X,Sub:J,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:st,CompareOperand:at,CallExtension:lt,CallExtensionAsync:ut,printNodes:function t(e,n){if(n=n||0,ct(e.typename+": ",n),e instanceof c)ct("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof lt)ct(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof l?r.push([e,t]):(i=i||{})[e]=t})),i?ct(JSON.stringify(i,null,2)+"\n",null,!0):ct("\n"),r.forEach((function(e){var r=e[0],i=e[1];ct("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),s=n(3),a=n(0).TemplateError,l=n(2).Frame,u=n(1).Obj,c={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},h=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new a(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var l=this._tmpid();this._emitLine(", "+this._makeCallback(l)),this._emitLine(this.buffer+" += runtime.suppressValue("+l+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+c[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,s.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof s.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+r+"]["+s+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+s+"]);"),e.set(t.name.children[s].value,a)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var a=t.name.children,l=a[0],u=a[1],c=this._tmpid(),h=this._tmpid();e.set(l.value,c),e.set(u.value,h),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+c+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+h+" = "+o+"["+c+"];"),this._emitLine('frame.set("'+l.value+'", '+c+");"),this._emitLine('frame.set("'+u.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var f=this._tmpid();e.set(t.name.value,f),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+f+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),a=this._tmpid(),l=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof s.Array){var u=t.name.children.length;this._emit("runtime."+l+"("+a+", "+u+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var c=t.name.value;this._emitLine("runtime."+l+"("+a+", 1, function("+c+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+c+'", '+c+");"),e.set(c,c)}this._emitLoopBindings(t,a,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var h=this._tmpid();this._emitLine("}, "+this._makeCallback(h)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+h+";"),t.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),a=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof s.Dict?i=e:(n.assertType(e,s.Symbol),r.push(e))}));var u,c=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),h=r.map((function(t){return'"'+t.value+'"'})),f=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));u=a?e.push(!0):new l,this._emitLines("var "+o+" = runtime.makeMacro(","["+h.join(", ")+"], ","["+f.join(", ")+"], ","function ("+c.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),u.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,u),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,u)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),s=this._makeCallback(i),a=n?"true":"false",l=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+a+", "+o+", "+l+", "+s),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,a=n._tmpid();t instanceof s.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+a+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,a),e.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof s.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new l,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(s.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new l;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(u);t.exports={compile:function(t,e,n,r,s){void 0===s&&(s={});var a=new h(r,s.throwOnUndefined),l=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return a.compile(o.transform(i.parse(l,n,s),e,r)),a.getCode()},Compiler:h}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var s=o.prototype;return s.resolve=function(t,e){return i.resolve(i.dirname(t),e)},s.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),s=n(15),a=n(0),l=n(5),u=n(18),c=n(10),h=c.FileSystemLoader,f=c.WebLoader,p=c.PrecompiledLoader,d=n(20),m=n(21),v=n(1),y=v.Obj,g=v.EmitterObj,_=n(2),E=_.handleError,b=_.Frame,x=n(22);function w(t,e,n){o((function(){t(e,n)}))}var k={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(E(t,null,null))}}}},T=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=a.isArray(t)?t:[t]:h?this.loaders=[new h("views")]:f&&(this.loaders=[new f("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(u).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),a._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=a.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,s=this,l=this,u=null;if(t&&t.raw&&(t=t.raw),a.isFunction(n)&&(i=n,n=null,e=e||!1),a.isFunction(e)&&(i=e,e=!1),t instanceof O)u=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var c=0;c0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var l=this.parsePrimary();r.addChild(new o.Pair(a.lineno,a.colno,a,l))}else r.addChild(a);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},l.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},l.parseExtends=function(){var t="extends",e=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var n=new o.Extends(e.lineno,e.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n},l.parseInclude=function(){var t="include",e=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var n=new o.Include(e.lineno,e.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),n},l.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},l.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},l.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var a,l=this.peekToken(),u=[];do{this.skipSymbol(n);var c=this.parseExpression();this.advanceAfterBlockEnd(t);var h=this.parseUntilBlocks(n,r,e);u.push(new o.Case(l.line,l.col,c,h)),l=this.peekToken()}while(l&&l.value===n);switch(l.value){case r:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,s,u,a)},l.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var l=s[0],u=s[1],c=s[2];c===t?r+=1:c===e&&(r-=1),0===r?(i+=u,this.tokens.backN(l.length-u.length)):i+=l}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,i)])},l.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},l.parseExpression=function(){return this.parseInlineIf()},l.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},l.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},l.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},l.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},l.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},l.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},l.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},l.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},l.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},l.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},l.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},l.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},l.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},l.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},l.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},l.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},l.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},l.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},l.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},l.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},l.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},l.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var s=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,s))}else{var a=this.parseExpression();t.addChild(a)}}return t},l.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(a&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var l=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(l.lineno,l.colno,l,this.parseExpression())):r.addChild(l)}a=!0}return s.children.length&&r.addChild(s),r},l.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],j=L+this.current();switch(-1!==r.indexOf(D,j)&&(this.forward(),L=j,-1!==r.indexOf(D,j+this.current())&&(L=j+this.current(),this.forward())),L){case"(":F=d;break;case")":F=m;break;case"[":F=v;break;case"]":F=y;break;case"{":F=g;break;case"}":F=_;break;case",":F=b;break;case":":F=x;break;case"~":F=w;break;case"|":F=k;break;default:F=E}return R(F,L,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var M=this._extract("0123456789");return R(T,t+"."+M,e,n)}return R("int",t,e,n)}if(t.match(/^(true|false)$/))return R(S,t,e,n);if("none"===t)return R(O,t,e,n);if("null"===t)return R(O,t,e,n);if(t)return R(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var B,U=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,R(u,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,R(h,t,e,n);t="";var V=!1;for(this._matches(this.tags.COMMENT_START)&&(V=!0,t=this._extractString(this.tags.COMMENT_START));null!==(B=this._extractUntil(U));){if(t+=B,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!V){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var K=t.slice(-this.colno);if(/^\s+$/.test(K)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!V)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===B&&V)throw new Error("expected end of comment, got end of file");return R(V?p:l,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var u=l.length,c=v(l,u);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function s(){return"hole_"+o++}function a(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,s=r.repeat(" ",n/2-n%2),a=r.repeat(" ",n/2);return i.copySafeness(t,s+t+a)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var s in t)o.push([s,t[s]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],s=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var s=t.split("\n"),a=r.repeat(" ",e),l=s.map((function(t,e){return 0!==e||n?""+a+t:t})).join("\n");return i.copySafeness(t,l)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=l,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=u(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=u(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return s=n+t.split("").join(n)+n,i.copySafeness(t,s);var a=t.indexOf(e);if(0===r||-1===a)return t;for(var l=0,u=0;a>-1&&(-1===r||u=i&&c.push(n),o.push(c)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,s=r.map(t,(function(t){return t})),a=r.getAttrGetter(i);return s.sort((function(t,s){var l=i?a(t):t,u=i?a(s):s;if(o.env.opts.throwOnUndefined&&i&&(void 0===l||void 0===u))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(l)&&r.isString(u)&&(l=l.toLowerCase(),u=u.toLowerCase()),lu?e?-1:1:0})),s})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=c((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return a(t)}));return i.copySafeness(t,e.join(" "))},e.trim=c,e.truncate=function(t,e,n,r){var s=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var a=t.lastIndexOf(" ",e);-1===a&&(a=e),t=t.substring(0,a)}return t+=null!=r?r:"...",i.copySafeness(s,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var h=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,f=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){s(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(h),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":f.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return s(n)?e:n};var v=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return s(r)?e:r}));e.int=v,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t=t.length&&(e=0),this.current=t[e],this.current}}}t.exports=function(){return{range:function(t,e,n){void 0===e?(e=t,t=0,n=1):n||(n=1);var r=[];if(n>0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return r(Array.prototype.slice.call(arguments))},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,l=n(24);function u(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function c(t,e){(e=e||{}).isString=!0;var n=e.env||new a([]),r=e.wrapper||l;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([h(t,e.name,n)],e)}function h(t,e,n){var r,i=(n=n||new a([])).asyncFilters,l=n.extensionsList;e=e.replace(/\\/g,"/");try{r=s.compile(t,i,l,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new a([]),o=e.wrapper||l;if(e.isString)return c(t,e);var s=r.existsSync(t)&&r.statSync(t),f=[],p=[];if(s.isFile())f.push(h(r.readFileSync(t,"utf-8"),e.name||t,n));else if(s.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(s){var a=i.join(o,s),l=a.substr(i.join(t,"/").length),c=r.statSync(a);c&&c.isDirectory()?u(l+="/",e.exclude)||n(a):u(l,e.include)&&p.push(a)}))}(t);for(var d=0;dt.length||i>0&&s>=r||i<0&&s<=r);s+=i)o.push(n.memberLookup(t,s));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e1){e[0]=e[0].slice(0,-1);for(var r=e.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,v=String.fromCharCode;function y(t){throw new RangeError(d[t])}function g(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+function(t,e){for(var n=[],r=t.length;r--;)n[r]=e(t[r]);return n}((t=t.replace(p,".")).split("."),e).join(".")}function _(t){for(var e=[],n=0,r=t.length;n=55296&&i<=56319&&n>1,t+=m(t/e);t>455;r+=c)t=m(t/35);return m(r+36*t/(t+38))},x=function(t){var e,n=[],r=t.length,i=0,o=128,s=72,a=t.lastIndexOf("-");a<0&&(a=0);for(var l=0;l=128&&y("not-basic"),n.push(t.charCodeAt(l));for(var h=a>0?a+1:0;h=r&&y("invalid-input");var v=(e=t.charCodeAt(h++))-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c;(v>=c||v>m((u-i)/p))&&y("overflow"),i+=v*p;var g=d<=s?1:d>=s+26?26:d-s;if(vm(u/_)&&y("overflow"),p*=_}var E=n.length+1;s=b(i-f,E,0==f),m(i/E)>u-o&&y("overflow"),o+=m(i/E),i%=E,n.splice(i++,0,o)}return String.fromCodePoint.apply(String,n)},w=function(t){var e=[],n=(t=_(t)).length,r=128,i=0,o=72,s=!0,a=!1,l=void 0;try{for(var h,f=t[Symbol.iterator]();!(s=(h=f.next()).done);s=!0){var p=h.value;p<128&&e.push(v(p))}}catch(t){a=!0,l=t}finally{try{!s&&f.return&&f.return()}finally{if(a)throw l}}var d=e.length,g=d;for(d&&e.push("-");g=r&&Am((u-i)/C)&&y("overflow"),i+=(x-r)*C,r=x;var R=!0,L=!1,P=void 0;try{for(var N,I=t[Symbol.iterator]();!(R=(N=I.next()).done);R=!0){var F=N.value;if(Fu&&y("overflow"),F==r){for(var D=i,j=c;;j+=c){var M=j<=o?1:j>=o+26?26:j-o;if(D>6|192).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase():"%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase()}function A(t){for(var e="",n=0,r=t.length;n=194&&i<224){if(r-n>=6){var o=parseInt(t.substr(n+4,2),16);e+=String.fromCharCode((31&i)<<6|63&o)}else e+=t.substr(n,6);n+=6}else if(i>=224){if(r-n>=9){var s=parseInt(t.substr(n+4,2),16),a=parseInt(t.substr(n+7,2),16);e+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}else e+=t.substr(n,9);n+=9}else e+=t.substr(n,3),n+=3}return e}function C(t,e){function n(t){var n=A(t);return n.match(e.UNRESERVED)?n:t}return t.scheme&&(t.scheme=String(t.scheme).replace(e.PCT_ENCODED,n).toLowerCase().replace(e.NOT_SCHEME,"")),void 0!==t.userinfo&&(t.userinfo=String(t.userinfo).replace(e.PCT_ENCODED,n).replace(e.NOT_USERINFO,O).replace(e.PCT_ENCODED,i)),void 0!==t.host&&(t.host=String(t.host).replace(e.PCT_ENCODED,n).toLowerCase().replace(e.NOT_HOST,O).replace(e.PCT_ENCODED,i)),void 0!==t.path&&(t.path=String(t.path).replace(e.PCT_ENCODED,n).replace(t.scheme?e.NOT_PATH:e.NOT_PATH_NOSCHEME,O).replace(e.PCT_ENCODED,i)),void 0!==t.query&&(t.query=String(t.query).replace(e.PCT_ENCODED,n).replace(e.NOT_QUERY,O).replace(e.PCT_ENCODED,i)),void 0!==t.fragment&&(t.fragment=String(t.fragment).replace(e.PCT_ENCODED,n).replace(e.NOT_FRAGMENT,O).replace(e.PCT_ENCODED,i)),t}function R(t){return t.replace(/^0*(.*)/,"$1")||"0"}function L(t,e){var n=t.match(e.IPV4ADDRESS)||[],r=l(n,2)[1];return r?r.split(".").map(R).join("."):t}function P(t,e){var n=t.match(e.IPV6ADDRESS)||[],r=l(n,3),i=r[1],o=r[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),a=l(s,2),u=a[0],c=a[1],h=c?c.split(":").map(R):[],f=u.split(":").map(R),p=e.IPV4ADDRESS.test(f[f.length-1]),d=p?7:8,m=f.length-d,v=Array(d),y=0;y1){var E=v.slice(0,g.index),b=v.slice(g.index+g.length);_=E.join(":")+"::"+b.join(":")}else _=v.join(":");return o&&(_+="%"+o),_}return t}var N=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,I=void 0==="".match(/(){0}/)[1];function F(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==e.iri?a:s;"suffix"===e.reference&&(t=(e.scheme?e.scheme+":":"")+"//"+t);var i=t.match(N);if(i){I?(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5])):(n.scheme=i[1]||void 0,n.userinfo=-1!==t.indexOf("@")?i[3]:void 0,n.host=-1!==t.indexOf("//")?i[4]:void 0,n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=-1!==t.indexOf("?")?i[7]:void 0,n.fragment=-1!==t.indexOf("#")?i[8]:void 0,isNaN(n.port)&&(n.port=t.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),n.host&&(n.host=P(L(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",e.reference&&"suffix"!==e.reference&&e.reference!==n.reference&&(n.error=n.error||"URI is not a "+e.reference+" reference.");var o=S[(e.scheme||n.scheme||"").toLowerCase()];if(e.unicodeSupport||o&&o.unicodeSupport)C(n,r);else{if(n.host&&(e.domainHost||o&&o.domainHost))try{n.host=k(n.host.replace(r.PCT_ENCODED,A).toLowerCase())}catch(t){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+t}C(n,s)}o&&o.parse&&o.parse(n,e)}else n.error=n.error||"URI can not be parsed.";return n}function D(t,e){var n=!1!==e.iri?a:s,r=[];return void 0!==t.userinfo&&(r.push(t.userinfo),r.push("@")),void 0!==t.host&&r.push(P(L(String(t.host),n),n).replace(n.IPV6ADDRESS,(function(t,e,n){return"["+e+(n?"%25"+n:"")+"]"}))),"number"!=typeof t.port&&"string"!=typeof t.port||(r.push(":"),r.push(String(t.port))),r.length?r.join(""):void 0}var j=/^\.\.?\//,M=/^\/\.(\/|$)/,B=/^\/\.\.(\/|$)/,U=/^\/?(?:.|\n)*?(?=\/|$)/;function V(t){for(var e=[];t.length;)if(t.match(j))t=t.replace(j,"");else if(t.match(M))t=t.replace(M,"/");else if(t.match(B))t=t.replace(B,"/"),e.pop();else if("."===t||".."===t)t="";else{var n=t.match(U);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];t=t.slice(r.length),e.push(r)}return e.join("")}function K(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.iri?a:s,r=[],i=S[(e.scheme||t.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(t,e),t.host)if(n.IPV6ADDRESS.test(t.host));else if(e.domainHost||i&&i.domainHost)try{t.host=e.iri?T(t.host):k(t.host.replace(n.PCT_ENCODED,A).toLowerCase())}catch(n){t.error=t.error||"Host's domain name can not be converted to "+(e.iri?"Unicode":"ASCII")+" via punycode: "+n}C(t,n),"suffix"!==e.reference&&t.scheme&&(r.push(t.scheme),r.push(":"));var o=D(t,e);if(void 0!==o&&("suffix"!==e.reference&&r.push("//"),r.push(o),t.path&&"/"!==t.path.charAt(0)&&r.push("/")),void 0!==t.path){var l=t.path;e.absolutePath||i&&i.absolutePath||(l=V(l)),void 0===o&&(l=l.replace(/^\/\//,"/%2F")),r.push(l)}return void 0!==t.query&&(r.push("?"),r.push(t.query)),void 0!==t.fragment&&(r.push("#"),r.push(t.fragment)),r.join("")}function $(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(t=F(K(t,n),n),e=F(K(e,n),n)),!(n=n||{}).tolerant&&e.scheme?(r.scheme=e.scheme,r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=V(e.path||""),r.query=e.query):(void 0!==e.userinfo||void 0!==e.host||void 0!==e.port?(r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=V(e.path||""),r.query=e.query):(e.path?("/"===e.path.charAt(0)?r.path=V(e.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?r.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:r.path=e.path:r.path="/"+e.path,r.path=V(r.path)),r.query=e.query):(r.path=t.path,void 0!==e.query?r.query=e.query:r.query=t.query),r.userinfo=t.userinfo,r.host=t.host,r.port=t.port),r.scheme=t.scheme),r.fragment=e.fragment,r}function H(t,e){return t&&t.toString().replace(e&&e.iri?a.PCT_ENCODED:s.PCT_ENCODED,A)}var z={scheme:"http",domainHost:!0,parse:function(t,e){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t},serialize:function(t,e){var n="https"===String(t.scheme).toLowerCase();return t.port!==(n?443:80)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}},q={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize};function G(t){return"boolean"==typeof t.secure?t.secure:"wss"===String(t.scheme).toLowerCase()}var Y={scheme:"ws",domainHost:!0,parse:function(t,e){var n=t;return n.secure=G(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(t,e){if(t.port!==(G(t)?443:80)&&""!==t.port||(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){var n=t.resourceName.split("?"),r=l(n,2),i=r[0],o=r[1];t.path=i&&"/"!==i?i:void 0,t.query=o,t.resourceName=void 0}return t.fragment=void 0,t}},W={scheme:"wss",domainHost:Y.domainHost,parse:Y.parse,serialize:Y.serialize},Q={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",J="[0-9A-Fa-f]",Z=n(n("%[EFef]"+J+"%"+J+J+"%"+J+J)+"|"+n("%[89A-Fa-f]"+J+"%"+J+J)+"|"+n("%"+J+J)),tt=e("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),et=new RegExp(X,"g"),nt=new RegExp(Z,"g"),rt=new RegExp(e("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',tt),"g"),it=new RegExp(e("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ot=it;function st(t){var e=A(t);return e.match(et)?e:t}var at={scheme:"mailto",parse:function(t,e){var n=t,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var i=!1,o={},s=n.query.split("&"),a=0,l=s.length;a{},894:t=>{"use strict";t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},680:t=>{"use strict";t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{default:()=>Rr});var t=n(181);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function s(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}const l=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,n,r,l=(n=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(n);if(r){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return s(this,t)});function u(){return i(this,u),l.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(t.DefaultDrawer);var u=n(96),c=n.n(u);function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function d(t,e){if(e&&("object"===h(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}const v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=m(n);if(r){var i=m(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return d(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{blockType:null,provider:null};return f(this,o),(t=i.call(this,e)).blockType=e.blockType||null,t.provider=e.provider||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(t.ComponentDefinition),y={$id:"https://ditrit.io/schemas",type:"object",properties:{name:{type:"string"},model:{type:"string"},icon:{type:"string"},attributes:{type:"array",items:{$ref:"#/definitions/attribute"}},data:{type:"array",items:{$ref:"#/definitions/data"}},modules:{type:"array",items:{$ref:"#/definitions/module"}},resources:{type:"array",items:{$ref:"#/definitions/resource"}},variables:{type:"array",items:{$ref:"#/definitions/variable"}}},required:["name","attributes","data","modules","resources","variables"],definitions:{defaultObject:{type:"object",properties:{type:{type:"string"},model:{type:"string"},icon:{type:"string"},isContainer:{type:"boolean"},attributes:{type:"array",items:{$ref:"#/definitions/attribute"}}},required:["type","attributes"]},attribute:{type:"object",properties:{name:{type:"string"},type:{type:"string",pattern:"(String|Boolean|Number|Array|Object|Link|Reference)"},required:{type:"boolean"},linkType:{type:"string",pattern:"(Default|Reverse)"},linkRef:{type:"string"},containerRef:{type:"string"},attributes:{type:"array",items:{$ref:"#/definitions/attribute"}},rules:{$ref:"#/definitions/rule"}},required:["name","type"]},rule:{type:"object",properties:{values:{type:"array",items:{type:"string"}},min:{type:"integer"},max:{type:"integer"},regex:{type:"string"}}},data:{$ref:"#/definitions/defaultObject"},module:{$ref:"#/definitions/defaultObject"},resource:{$ref:"#/definitions/defaultObject"},variable:{$ref:"#/definitions/defaultObject"}}},g={aws:JSON.parse('{"name":"aws","model":"DefaultModel","icon":"aws","attributes":[{"name":"region","type":"String","required":true}],"data":[{"type":"aws_ami","model":"DefaultModel","icon":"Aws_EC2_AMI"}],"modules":[{"type":"server","model":"DefaultModel","icon":"Aws_Servers"}],"resources":[{"type":"aws_security_group","model":"DefaultModel","icon":"AwsSecurityGroup","attributes":[{"name":"vpc_id","type":"Link","linkType":"Default","linkRef":"aws_vpc"}]},{"type":"aws_instance","model":"DefaultModel","icon":"Aws_EC2-Instance","attributes":[{"name":"security_groups","type":"Link","linkType":"Reverse","linkRef":"aws_security_group"},{"name":"vpc_security_group_ids","type":"Link","linkType":"Reverse","linkRef":"aws_security_group"},{"name":"subnet_id","type":"Link","linkType":"Default","linkRef":"aws_subnet"}]},{"type":"aws_volume_attachment","model":"DefaultModel","icon":"Aws_Elastic-Block-Store_Volume","attributes":[{"name":"device_name","type":"String"},{"name":"volume_id","type":"Link","linkType":"Default","linkRef":"aws_ebs_volume"},{"name":"instance_id","type":"Link","linkType":"Default","linkRef":"aws_instance"}]},{"type":"aws_ebs_volume","model":"DefaultModel","icon":"Aws_Elastic-Block-Store_Volume","attributes":[{"name":"availability_zone","type":"String"}]},{"type":"aws_elb","model":"DefaultModel","icon":"Aws_Elastic-Load-Balancing_Network-Load-Balancer","attributes":[{"name":"listener","type":"Object","required":true,"attributes":[{"name":"instance_port","type":"String","required":true},{"name":"lb_port","type":"Number","required":true},{"name":"lb_protocol","type":"String","required":true},{"name":"instance_protocol","type":"String","required":true}]},{"name":"subnets","type":"Link","linkType":"Default","linkRef":"aws_subnet"},{"name":"security_groups","type":"Link","linkType":"Default","linkRef":"aws_security_group"},{"name":"instances","type":"Link","linkType":"Default","linkRef":"aws_instance"}]},{"type":"aws_vpc","model":"DefaultContainer","icon":"Aws_Virtual-Private-Cloud","isContainer":true},{"type":"aws_internet_gateway","model":"DefaultModel","icon":"Aws_VPC_Internet-Gateway","attributes":[{"name":"vpc_id","type":"Reference","containerRef":"aws_vpc"}]},{"type":"aws_route","model":"DefaultModel","icon":"Aws_Route-53","attributes":[{"name":"route_table_id","type":"Reference","required":true,"containerRef":"aws_route"},{"name":"gateway_id","type":"Link","linkType":"Default","linkRef":"aws_internet_gateway"}]},{"type":"aws_subnet","model":"DefaultModel","icon":"AwsSubnet","attributes":[{"name":"vpc_id","type":"Reference","containerRef":"aws_vpc"},{"name":"gateway_id","type":"Link","linkType":"Default","linkRef":"aws_internet_gateway"}]},{"type":"aws_db_subnet_group","model":"DefaultContainer","icon":"AwsDbSubnetGroup","isContainer":true,"attributes":[{"name":"subnet_ids","type":"Reference","required":true,"containerRef":"aws_subnet"}]},{"type":"aws_route53_zone","model":"DefaultContainer","icon":"Aws_Route-53-Hosted-Zone","isContainer":true,"attributes":[{"name":"name","type":"String","required":true}]},{"type":"aws_route53_record","model":"DefaultModel","icon":"Aws_Route-53_Route-Table","attributes":[{"name":"zone_id","type":"Reference","required":true,"containerRef":"aws_route53_zone"},{"name":"records","type":"Link","linkType":"Default","linkRef":"aws_route53_record"}]},{"type":"aws_db_instance","model":"DefaultModel","icon":"Aws_EC2_DB-Instance","attributes":[{"name":"instance_class","type":"String","required":true},{"name":"db_subnet_group_name","type":"Link","linkType":"Default","linkRef":"aws_db_subnet_group"},{"name":"vpc_security_group_ids","type":"Link","required":true,"linkType":"Default","linkRef":"aws_security_group"}]},{"type":"aws_key_pair","model":"DefaultModel","icon":"Aws_Identity-Access-Management_Long-Term-Security-Credential"}],"variables":[{"type":"image_id","model":"DefaultModel","icon":"variable"}]}')};function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0)throw new Error("Metadata are not valid",{cause:e});return!0}},{key:"parse",value:function(){this.pluginData.definitions={components:this.getComponentDefinitions()}}},{key:"getComponentDefinitions",value:function(){var t=this,e=[];return Object.keys(this.providers).map((function(e){return t.providers[e]})).forEach((function(n){var r=[];r.push(t.getProviderDefinition(n)),n.data.forEach((function(e){return r.push(t.getBlockDefinition("data",n.name,e))})),n.modules.forEach((function(e){return r.push(t.getBlockDefinition("module",n.name,e))})),n.resources.forEach((function(e){return r.push(t.getBlockDefinition("resource",n.name,e))})),n.variables.forEach((function(e){return r.push(t.getBlockDefinition("variable",n.name,e))})),t.setChildrenTypes(r),r.forEach((function(t){e.push(t)}))})),e}},{key:"getProviderDefinition",value:function(t){var e=new v({blockType:"provider",provider:t.name,type:t.name,icon:t.icon,model:t.model,definedAttributes:t.attributes.map(this.getAttributeDefinition),isContainer:t.isContainer});return e.parentTypes=this.getParentTypes(e),e}},{key:"getBlockDefinition",value:function(t,e,n){var r=n.attributes||[],i=new v({blockType:t,provider:e,type:n.type,model:n.model,icon:n.icon,isContainer:n.isContainer||!1,definedAttributes:r.map(this.getAttributeDefinition)});return i.parentTypes=this.getParentTypes(i),i}},{key:"getAttributeDefinition",value:function(e){var n=e.attributes||[];return new t.ComponentAttributeDefinition(x(x({},e),{},{definedAttributes:n.map(this.getAttributeDefinition)}))}},{key:"getParentTypes",value:function(t){var e=[];return t.definedAttributes.filter((function(t){return"Reference"===t.type})).map((function(t){return t.containerRef})).filter((function(t){return!e.includes(t)})).forEach((function(t){return e.push(t)})),e}},{key:"setChildrenTypes",value:function(t){var e=t.filter((function(t){return t.parentTypes.length>0})).reduce((function(t,e){return e.parentTypes.forEach((function(n){var r;t[n]=[].concat(function(t){if(Array.isArray(t))return E(t)}(r=t[n]||[])||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return E(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[e.type])})),t}),{});t.filter((function(t){return e[t.type]})).forEach((function(t){t.childrenTypes=e[t.type]}))}}])&&k(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),a}(t.DefaultMetadata);String.prototype.seed=String.prototype.seed||Math.round(Math.random()*Math.pow(2,32)),String.prototype.hashCode=function(){const t=this.toString();let e,n;const r=3&t.length,i=t.length-r;let o=String.prototype.seed;const s=3432918353,a=461845907;let l=0;for(;l>>16)*s&65535)<<16)&4294967295,n=n<<15|n>>>17,n=(65535&n)*a+(((n>>>16)*a&65535)<<16)&4294967295,o^=n,o=o<<13|o>>>19,e=5*(65535&o)+((5*(o>>>16)&65535)<<16)&4294967295,o=27492+(65535&e)+((58964+(e>>>16)&65535)<<16);switch(n=0,r){case 3:n^=(255&t.charCodeAt(l+2))<<16;case 2:n^=(255&t.charCodeAt(l+1))<<8;case 1:n^=255&t.charCodeAt(l),n=(65535&n)*s+(((n>>>16)*s&65535)<<16)&4294967295,n=n<<15|n>>>17,n=(65535&n)*a+(((n>>>16)*a&65535)<<16)&4294967295,o^=n}return o^=t.length,o^=o>>>16,o=2246822507*(65535&o)+((2246822507*(o>>>16)&65535)<<16)&4294967295,o^=o>>>13,o=3266489909*(65535&o)+((3266489909*(o>>>16)&65535)<<16)&4294967295,o^=o>>>16,o>>>0},String.prototype.codePointAt||function(){var t=function(){let t;try{const e={},n=Object.defineProperty;t=n(e,e,e)&&n}catch(t){}return t}();const e=function(t){if(null==this)throw TypeError();const e=String(this),n=e.length;let r=t?Number(t):0;if(r!=r&&(r=0),r<0||r>=n)return;const i=e.charCodeAt(r);let o;return i>=55296&&i<=56319&&n>r+1&&(o=e.charCodeAt(r+1),o>=56320&&o<=57343)?1024*(i-55296)+o-56320+65536:i};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}(),String.fromCodePoint||function(){const t=function(){let t;try{const e={},n=Object.defineProperty;t=n(e,e,e)&&n}catch(t){}return t}(),e=String.fromCharCode,n=Math.floor,r=function(t){const r=16384,i=[];let o,s,a=-1;const l=arguments.length;if(!l)return"";let u="";for(;++a1114111||n(t)!==t)throw RangeError("Invalid code point: "+t);t<=65535?i.push(t):(t-=65536,o=55296+(t>>10),s=t%1024+56320,i.push(o,s)),(a+1===l||i.length>r)&&(u+=e.apply(null,i),i.length=0)}return u};t?t(String,"fromCodePoint",{value:r,configurable:!0,writable:!0}):String.fromCodePoint=r}();class L{constructor(){this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.tokenIndex=null,this.line=null,this.column=null,this._text=null}getTokenSource(){return this.source[0]}getInputStream(){return this.source[1]}get text(){return this._text}set text(t){this._text=t}}function P(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n>>17,t*=461845907,this.count=this.count+1;let n=this.hash^t;n=n<<13|n>>>19,n=5*n+3864292196,this.hash=n}}}finish(){let t=this.hash^4*this.count;return t^=t>>>16,t*=2246822507,t^=t>>>13,t*=3266489909,t^=t>>>16,t}static hashStuff(){const t=new N;return t.update.apply(t,arguments),t.finish()}}function I(t){return t?t.hashCode():-1}function F(t,e){return t?t.equals(e):t===e}function D(t){return null===t?"null":t}function j(t){return Array.isArray(t)?"["+t.map(D).join(", ")+"]":"null"}const M="h-";class B{constructor(t,e){this.data={},this.hashFunction=t||I,this.equalsFunction=e||F}add(t){const e=M+this.hashFunction(t);if(e in this.data){const n=this.data[e];for(let e=0;et.startsWith(M))).flatMap((t=>this.data[t]),this)}toString(){return j(this.values())}get length(){return Object.keys(this.data).filter((t=>t.startsWith(M))).map((t=>this.data[t].length),this).reduce(((t,e)=>t+e),0)}}class U{hashCode(){const t=new N;return this.updateHashCode(t),t.finish()}evaluate(t,e){}evalPrecedence(t,e){return this}static andContext(t,e){if(null===t||t===U.NONE)return e;if(null===e||e===U.NONE)return t;const n=new V(t,e);return 1===n.opnds.length?n.opnds[0]:n}static orContext(t,e){if(null===t)return e;if(null===e)return t;if(t===U.NONE||e===U.NONE)return U.NONE;const n=new K(t,e);return 1===n.opnds.length?n.opnds[0]:n}}class V extends U{constructor(t,e){super();const n=new B;t instanceof V?t.opnds.map((function(t){n.add(t)})):n.add(t),e instanceof V?e.opnds.map((function(t){n.add(t)})):n.add(e);const r=$(n);if(r.length>0){let t=null;r.map((function(e){(null===t||e.precedencet.toString()));return(t.length>3?t.slice(3):t).join("&&")}}class K extends U{constructor(t,e){super();const n=new B;t instanceof K?t.opnds.map((function(t){n.add(t)})):n.add(t),e instanceof K?e.opnds.map((function(t){n.add(t)})):n.add(e);const r=$(n);if(r.length>0){const t=r.sort((function(t,e){return t.compareTo(e)})),e=t[t.length-1];n.add(e)}this.opnds=Array.from(n.values())}equals(t){return this===t||t instanceof K&&P(this.opnds,t.opnds)}updateHashCode(t){t.update(this.opnds,"OR")}evaluate(t,e){for(let n=0;nt.toString()));return(t.length>3?t.slice(3):t).join("||")}}function $(t){const e=[];return t.values().map((function(t){t instanceof U.PrecedencePredicate&&e.push(t)})),e}function H(t,e){if(null===t){const t={state:null,alt:null,context:null,semanticContext:null};return e&&(t.reachesIntoOuterContext=0),t}{const n={};return n.state=t.state||null,n.alt=void 0===t.alt?null:t.alt,n.context=t.context||null,n.semanticContext=t.semanticContext||null,e&&(n.reachesIntoOuterContext=t.reachesIntoOuterContext||0,n.precedenceFilterSuppressed=t.precedenceFilterSuppressed||!1),n}}class z{constructor(t,e){this.checkContext(t,e),t=H(t),e=H(e,!0),this.state=null!==t.state?t.state:e.state,this.alt=null!==t.alt?t.alt:e.alt,this.context=null!==t.context?t.context:e.context,this.semanticContext=null!==t.semanticContext?t.semanticContext:null!==e.semanticContext?e.semanticContext:U.NONE,this.reachesIntoOuterContext=e.reachesIntoOuterContext,this.precedenceFilterSuppressed=e.precedenceFilterSuppressed}checkContext(t,e){null!==t.context&&void 0!==t.context||null!==e&&null!==e.context&&void 0!==e.context||(this.context=null)}hashCode(){const t=new N;return this.updateHashCode(t),t.finish()}updateHashCode(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)}equals(t){return this===t||t instanceof z&&this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&(null===this.context?null===t.context:this.context.equals(t.context))&&this.semanticContext.equals(t.semanticContext)&&this.precedenceFilterSuppressed===t.precedenceFilterSuppressed}hashCodeForConfigSet(){const t=new N;return t.update(this.state.stateNumber,this.alt,this.semanticContext),t.finish()}equalsForConfigSet(t){return this===t||t instanceof z&&this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&this.semanticContext.equals(t.semanticContext)}toString(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==U.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"}}class q{constructor(t,e){this.start=t,this.stop=e}clone(){return new q(this.start,this.stop)}contains(t){return t>=this.start&&tthis.addInterval(t)),this),this}reduce(t){if(t=n.stop?(this.intervals.splice(t+1,1),this.reduce(t)):e.stop>=n.start&&(this.intervals[t]=new q(e.start,n.stop),this.intervals.splice(t+1,1))}}complement(t,e){const n=new G;return n.addInterval(new q(t,e+1)),null!==this.intervals&&this.intervals.forEach((t=>n.removeRange(t))),n}contains(t){if(null===this.intervals)return!1;for(let e=0;en.start&&t.stop=n.stop?(this.intervals.splice(e,1),e-=1):t.start"):t.push("'"+String.fromCharCode(n.start)+"'"):t.push("'"+String.fromCharCode(n.start)+"'..'"+String.fromCharCode(n.stop-1)+"'")}return t.length>1?"{"+t.join(", ")+"}":t[0]}toIndexString(){const t=[];for(let e=0;e"):t.push(n.start.toString()):t.push(n.start.toString()+".."+(n.stop-1).toString())}return t.length>1?"{"+t.join(", ")+"}":t[0]}toTokenString(t,e){const n=[];for(let r=0;r1?"{"+n.join(", ")+"}":n[0]}elementName(t,e,n){return n===L.EOF?"":n===L.EPSILON?"":t[n]||e[n]}get length(){return this.intervals.map((t=>t.length)).reduce(((t,e)=>t+e))}}class Y{constructor(){this.atn=null,this.stateNumber=Y.INVALID_STATE_NUMBER,this.stateType=null,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.nextTokenWithinRule=null}toString(){return this.stateNumber}equals(t){return t instanceof Y&&this.stateNumber===t.stateNumber}isNonGreedyExitState(){return!1}addTransition(t,e){void 0===e&&(e=-1),0===this.transitions.length?this.epsilonOnlyTransitions=t.isEpsilon:this.epsilonOnlyTransitions!==t.isEpsilon&&(this.epsilonOnlyTransitions=!1),-1===e?this.transitions.push(t):this.transitions.splice(e,1,t)}}Y.INVALID_TYPE=0,Y.BASIC=1,Y.RULE_START=2,Y.BLOCK_START=3,Y.PLUS_BLOCK_START=4,Y.STAR_BLOCK_START=5,Y.TOKEN_START=6,Y.RULE_STOP=7,Y.BLOCK_END=8,Y.STAR_LOOP_BACK=9,Y.STAR_LOOP_ENTRY=10,Y.PLUS_LOOP_BACK=11,Y.LOOP_END=12,Y.serializationNames=["INVALID","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END"],Y.INVALID_STATE_NUMBER=-1;class W extends Y{constructor(){return super(),this.stateType=Y.RULE_STOP,this}}class Q{constructor(t){if(null==t)throw"target cannot be null.";this.target=t,this.isEpsilon=!1,this.label=null}}Q.EPSILON=1,Q.RANGE=2,Q.RULE=3,Q.PREDICATE=4,Q.ATOM=5,Q.ACTION=6,Q.SET=7,Q.NOT_SET=8,Q.WILDCARD=9,Q.PRECEDENCE=10,Q.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],Q.serializationTypes={EpsilonTransition:Q.EPSILON,RangeTransition:Q.RANGE,RuleTransition:Q.RULE,PredicateTransition:Q.PREDICATE,AtomTransition:Q.ATOM,ActionTransition:Q.ACTION,SetTransition:Q.SET,NotSetTransition:Q.NOT_SET,WildcardTransition:Q.WILDCARD,PrecedencePredicateTransition:Q.PRECEDENCE};class X extends Q{constructor(t,e,n,r){super(t),this.ruleIndex=e,this.precedence=n,this.followState=r,this.serializationType=Q.RULE,this.isEpsilon=!0}matches(t,e,n){return!1}}class J extends Q{constructor(t,e){super(t),this.serializationType=Q.SET,null!=e?this.label=e:(this.label=new G,this.label.addOne(L.INVALID_TYPE))}matches(t,e,n){return this.label.contains(t)}toString(){return this.label.toString()}}class Z extends J{constructor(t,e){super(t,e),this.serializationType=Q.NOT_SET}matches(t,e,n){return t>=e&&t<=n&&!super.matches(t,e,n)}toString(){return"~"+super.toString()}}class tt extends Q{constructor(t){super(t),this.serializationType=Q.WILDCARD}matches(t,e,n){return t>=e&&t<=n}toString(){return"."}}class et extends Q{constructor(t){super(t)}}class nt{}class rt extends nt{}class it extends rt{}class ot extends it{getRuleContext(){throw new Error("missing interface implementation")}}class st extends it{}class at extends st{}const lt={toStringTree:function(t,e,n){e=e||null,null!==(n=n||null)&&(e=n.ruleNames);let r=lt.getNodeText(t,e);r=function(t,e){return t=t.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}(r);const i=t.getChildCount();if(0===i)return r;let o="("+r+" ";i>0&&(r=lt.toStringTree(t.getChild(0),e),o=o.concat(r));for(let n=1;n=0&&e0&&(t+=", "),this.returnStates[e]!==ht.EMPTY_RETURN_STATE?(t+=this.returnStates[e],null!==this.parents[e]?t=t+" "+this.parents[e]:t+="null"):t+="$";return t+"]"}}get length(){return this.returnStates.length}}class pt extends ht{constructor(t,e){let n=0;const r=new N;null!==t?r.update(t,e):r.update(1),n=r.finish(),super(n),this.parentCtx=t,this.returnState=e}getParent(t){return this.parentCtx}getReturnState(t){return this.returnState}equals(t){return this===t||t instanceof pt&&this.hashCode()===t.hashCode()&&this.returnState===t.returnState&&(null==this.parentCtx?null==t.parentCtx:this.parentCtx.equals(t.parentCtx))}toString(){const t=null===this.parentCtx?"":this.parentCtx.toString();return 0===t.length?this.returnState===ht.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+t}get length(){return 1}static create(t,e){return e===ht.EMPTY_RETURN_STATE&&null===t?ht.EMPTY:new pt(t,e)}}class dt extends pt{constructor(){super(null,ht.EMPTY_RETURN_STATE)}isEmpty(){return!0}getParent(t){return null}getReturnState(t){return this.returnState}equals(t){return this===t}toString(){return"$"}}ht.EMPTY=new dt;const mt="h-";class vt{constructor(t,e){this.data={},this.hashFunction=t||I,this.equalsFunction=e||F}set(t,e){const n=mt+this.hashFunction(t);if(n in this.data){const r=this.data[n];for(let n=0;nt.startsWith(mt))).flatMap((t=>this.data[t]),this)}getKeys(){return this.entries().map((t=>t.key))}getValues(){return this.entries().map((t=>t.value))}toString(){return"["+this.entries().map((t=>"{"+t.key+":"+t.value+"}")).join(", ")+"]"}get length(){return Object.keys(this.data).filter((t=>t.startsWith(mt))).map((t=>this.data[t].length),this).reduce(((t,e)=>t+e),0)}}function yt(t,e){if(null==e&&(e=ct.EMPTY),null===e.parentCtx||e===ct.EMPTY)return ht.EMPTY;const n=yt(t,e.parentCtx),r=t.states[e.invokingState].transitions[0];return pt.create(n,r.followState.stateNumber)}function gt(t,e,n){if(t.isEmpty())return t;let r=n.get(t)||null;if(null!==r)return r;if(r=e.get(t),null!==r)return n.set(t,r),r;let i=!1,o=[];for(let r=0;re.returnState&&(i[0]=e.returnState,i[1]=t.returnState);const o=new ft([n,n],i);return null!==r&&r.set(t,e,o),o}const i=[t.returnState,e.returnState];let o=[t.parentCtx,e.parentCtx];t.returnState>e.returnState&&(i[0]=e.returnState,i[1]=t.returnState,o=[e.parentCtx,t.parentCtx]);const s=new ft(o,i);return null!==r&&r.set(t,e,s),s}}(t,e,n,r);if(n){if(t instanceof dt)return t;if(e instanceof dt)return e}return t instanceof pt&&(t=new ft([t.getParent()],[t.returnState])),e instanceof pt&&(e=new ft([e.getParent()],[e.returnState])),function(t,e,n,r){if(null!==r){let n=r.get(t,e);if(null!==n)return n;if(n=r.get(e,t),null!==n)return n}let i=0,o=0,s=0,a=[],l=[];for(;ithis.add(t)),this)}remove(t){delete this.data[t]}has(t){return!0===this.data[t]}values(){return Object.keys(this.data)}minValue(){return Math.min.apply(null,this.values())}hashCode(){return N.hashStuff(this.values())}equals(t){return t instanceof Et&&P(this.data,t.data)}toString(){return"{"+this.values().join(", ")+"}"}get length(){return this.values().length}}class bt{constructor(t){this.atn=t}getDecisionLookahead(t){if(null===t)return null;const e=t.transitions.length,n=[];for(let r=0;r=this.states.length)throw"Invalid state number.";const n=this.states[t];let r=this.nextTokens(n);if(!r.contains(L.EPSILON))return r;const i=new G;for(i.addSet(r),i.removeOne(L.EPSILON);null!==e&&e.invokingState>=0&&r.contains(L.EPSILON);){const t=this.states[e.invokingState].transitions[0];r=this.nextTokens(t.followState),i.addSet(r),i.removeOne(L.EPSILON),e=e.parentCtx}return r.contains(L.EPSILON)&&i.addOne(L.EOF),i}}xt.INVALID_ALT_NUMBER=0;class wt extends Y{constructor(){super(),this.stateType=Y.BASIC}}class kt extends Y{constructor(){return super(),this.decision=-1,this.nonGreedy=!1,this}}class Tt extends kt{constructor(){return super(),this.endState=null,this}}class St extends Y{constructor(){return super(),this.stateType=Y.BLOCK_END,this.startState=null,this}}class Ot extends Y{constructor(){return super(),this.stateType=Y.LOOP_END,this.loopBackState=null,this}}class At extends Y{constructor(){return super(),this.stateType=Y.RULE_START,this.stopState=null,this.isPrecedenceRule=!1,this}}class Ct extends kt{constructor(){return super(),this.stateType=Y.TOKEN_START,this}}class Rt extends kt{constructor(){return super(),this.stateType=Y.PLUS_LOOP_BACK,this}}class Lt extends Y{constructor(){return super(),this.stateType=Y.STAR_LOOP_BACK,this}}class Pt extends kt{constructor(){return super(),this.stateType=Y.STAR_LOOP_ENTRY,this.loopBackState=null,this.isPrecedenceDecision=null,this}}class Nt extends Tt{constructor(){return super(),this.stateType=Y.PLUS_BLOCK_START,this.loopBackState=null,this}}class It extends Tt{constructor(){return super(),this.stateType=Y.STAR_BLOCK_START,this}}class Ft extends Tt{constructor(){return super(),this.stateType=Y.BLOCK_START,this}}class Dt extends Q{constructor(t,e){super(t),this.label_=e,this.label=this.makeLabel(),this.serializationType=Q.ATOM}makeLabel(){const t=new G;return t.addOne(this.label_),t}matches(t,e,n){return this.label_===t}toString(){return this.label_}}class jt extends Q{constructor(t,e,n){super(t),this.serializationType=Q.RANGE,this.start=e,this.stop=n,this.label=this.makeLabel()}makeLabel(){const t=new G;return t.addRange(this.start,this.stop),t}matches(t,e,n){return t>=this.start&&t<=this.stop}toString(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"}}class Mt extends Q{constructor(t,e,n,r){super(t),this.serializationType=Q.ACTION,this.ruleIndex=e,this.actionIndex=void 0===n?-1:n,this.isCtxDependent=void 0!==r&&r,this.isEpsilon=!0}matches(t,e,n){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}}class Bt extends Q{constructor(t,e){super(t),this.serializationType=Q.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=e}matches(t,e,n){return!1}toString(){return"epsilon"}}class Ut extends U{constructor(t,e,n){super(),this.ruleIndex=void 0===t?-1:t,this.predIndex=void 0===e?-1:e,this.isCtxDependent=void 0!==n&&n}evaluate(t,e){const n=this.isCtxDependent?e:null;return t.sempred(n,this.ruleIndex,this.predIndex)}updateHashCode(t){t.update(this.ruleIndex,this.predIndex,this.isCtxDependent)}equals(t){return this===t||t instanceof Ut&&this.ruleIndex===t.ruleIndex&&this.predIndex===t.predIndex&&this.isCtxDependent===t.isCtxDependent}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}U.NONE=new Ut;class Vt extends et{constructor(t,e,n,r){super(t),this.serializationType=Q.PREDICATE,this.ruleIndex=e,this.predIndex=n,this.isCtxDependent=r,this.isEpsilon=!0}matches(t,e,n){return!1}getPredicate(){return new Ut(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}}class Kt extends U{constructor(t){super(),this.precedence=void 0===t?0:t}evaluate(t,e){return t.precpred(e,this.precedence)}evalPrecedence(t,e){return t.precpred(e,this.precedence)?U.NONE:null}compareTo(t){return this.precedence-t.precedence}updateHashCode(t){t.update(this.precedence)}equals(t){return this===t||t instanceof Kt&&this.precedence===t.precedence}toString(){return"{"+this.precedence+">=prec}?"}}U.PrecedencePredicate=Kt;class $t extends et{constructor(t,e){super(t),this.serializationType=Q.PRECEDENCE,this.precedence=e,this.isEpsilon=!0}matches(t,e,n){return!1}getPredicate(){return new Kt(this.precedence)}toString(){return this.precedence+" >= _p"}}class Ht{constructor(t){void 0===t&&(t=null),this.readOnly=!1,this.verifyATN=null===t||t.verifyATN,this.generateRuleBypassTransitions=null!==t&&t.generateRuleBypassTransitions}}Ht.defaultOptions=new Ht,Ht.defaultOptions.readOnly=!0;class zt{constructor(t){this.actionType=t,this.isPositionDependent=!1}hashCode(){const t=new N;return this.updateHashCode(t),t.finish()}updateHashCode(t){t.update(this.actionType)}equals(t){return this===t}}class qt extends zt{constructor(){super(6)}execute(t){t.skip()}toString(){return"skip"}}qt.INSTANCE=new qt;class Gt extends zt{constructor(t){super(0),this.channel=t}execute(t){t._channel=this.channel}updateHashCode(t){t.update(this.actionType,this.channel)}equals(t){return this===t||t instanceof Gt&&this.channel===t.channel}toString(){return"channel("+this.channel+")"}}class Yt extends zt{constructor(t,e){super(1),this.ruleIndex=t,this.actionIndex=e,this.isPositionDependent=!0}execute(t){t.action(null,this.ruleIndex,this.actionIndex)}updateHashCode(t){t.update(this.actionType,this.ruleIndex,this.actionIndex)}equals(t){return this===t||t instanceof Yt&&this.ruleIndex===t.ruleIndex&&this.actionIndex===t.actionIndex}}class Wt extends zt{constructor(){super(3)}execute(t){t.more()}toString(){return"more"}}Wt.INSTANCE=new Wt;class Qt extends zt{constructor(t){super(7),this.type=t}execute(t){t.type=this.type}updateHashCode(t){t.update(this.actionType,this.type)}equals(t){return this===t||t instanceof Qt&&this.type===t.type}toString(){return"type("+this.type+")"}}class Xt extends zt{constructor(t){super(5),this.mode=t}execute(t){t.pushMode(this.mode)}updateHashCode(t){t.update(this.actionType,this.mode)}equals(t){return this===t||t instanceof Xt&&this.mode===t.mode}toString(){return"pushMode("+this.mode+")"}}class Jt extends zt{constructor(){super(4)}execute(t){t.popMode()}toString(){return"popMode"}}Jt.INSTANCE=new Jt;class Zt extends zt{constructor(t){super(2),this.mode=t}execute(t){t.mode(this.mode)}updateHashCode(t){t.update(this.actionType,this.mode)}equals(t){return this===t||t instanceof Zt&&this.mode===t.mode}toString(){return"mode("+this.mode+")"}}function te(t,e){const n=[];return n[t-1]=e,n.map((function(t){return e}))}class ee{constructor(t){null==t&&(t=Ht.defaultOptions),this.deserializationOptions=t,this.stateFactories=null,this.actionFactories=null}deserialize(t){const e=this.reset(t);this.checkVersion(e),e&&this.skipUUID();const n=this.readATN();this.readStates(n,e),this.readRules(n,e),this.readModes(n);const r=[];return this.readSets(n,r,this.readInt.bind(this)),e&&this.readSets(n,r,this.readInt32.bind(this)),this.readEdges(n,r),this.readDecisions(n),this.readLexerActions(n,e),this.markPrecedenceDecisions(n),this.verifyATN(n),this.deserializationOptions.generateRuleBypassTransitions&&1===n.grammarType&&(this.generateRuleBypassTransitions(n),this.verifyATN(n)),n}reset(t){if(3===(t.charCodeAt?t.charCodeAt(0):t[0])){const e=function(t){const e=t.charCodeAt(0);return e>1?e-2:e+65534},n=t.split("").map(e);return n[0]=t.charCodeAt(0),this.data=n,this.pos=0,!0}return this.data=t,this.pos=0,!1}skipUUID(){let t=0;for(;t++<8;)this.readInt()}checkVersion(t){const e=this.readInt();if(!t&&4!==e)throw"Could not deserialize ATN with version "+e+" (expected 4)."}readATN(){const t=this.readInt(),e=this.readInt();return new xt(t,e)}readStates(t,e){let n,r,i;const o=[],s=[],a=this.readInt();for(let n=0;n0;)i.addTransition(l.transitions[u-1]),l.transitions=l.transitions.slice(-1);t.ruleToStartState[e].addTransition(new Bt(i)),o.addTransition(new Bt(a));const c=new wt;t.addState(c),c.addTransition(new Dt(o,t.ruleToTokenType[e])),i.addTransition(new Bt(c))}stateIsEndStateFor(t,e){if(t.ruleIndex!==e)return null;if(!(t instanceof Pt))return null;const n=t.transitions[t.transitions.length-1].target;return n instanceof Ot&&n.epsilonOnlyTransitions&&n.transitions[0].target instanceof W?t:null}markPrecedenceDecisions(t){for(let e=0;e=0):this.checkCondition(n.transitions.length<=1||n instanceof W)}}checkCondition(t,e){if(!t)throw null==e&&(e="IllegalState"),e}readInt(){return this.data[this.pos++]}readInt32(){return this.readInt()|this.readInt()<<16}edgeFactory(t,e,n,r,i,o,s,a){const l=t.states[r];switch(e){case Q.EPSILON:return new Bt(l);case Q.RANGE:return new jt(l,0!==s?L.EOF:i,o);case Q.RULE:return new X(t.states[i],o,s,l);case Q.PREDICATE:return new Vt(l,i,o,0!==s);case Q.PRECEDENCE:return new $t(l,i);case Q.ATOM:return new Dt(l,0!==s?L.EOF:i);case Q.ACTION:return new Mt(l,i,o,0!==s);case Q.SET:return new J(l,a[i]);case Q.NOT_SET:return new Z(l,a[i]);case Q.WILDCARD:return new tt(l);default:throw"The specified transition type: "+e+" is not valid."}}stateFactory(t,e){if(null===this.stateFactories){const t=[];t[Y.INVALID_TYPE]=null,t[Y.BASIC]=()=>new wt,t[Y.RULE_START]=()=>new At,t[Y.BLOCK_START]=()=>new Ft,t[Y.PLUS_BLOCK_START]=()=>new Nt,t[Y.STAR_BLOCK_START]=()=>new It,t[Y.TOKEN_START]=()=>new Ct,t[Y.RULE_STOP]=()=>new W,t[Y.BLOCK_END]=()=>new St,t[Y.STAR_LOOP_BACK]=()=>new Lt,t[Y.STAR_LOOP_ENTRY]=()=>new Pt,t[Y.PLUS_LOOP_BACK]=()=>new Rt,t[Y.LOOP_END]=()=>new Ot,this.stateFactories=t}if(t>this.stateFactories.length||null===this.stateFactories[t])throw"The specified state type "+t+" is not valid.";{const n=this.stateFactories[t]();if(null!==n)return n.ruleIndex=e,n}}lexerActionFactory(t,e,n){if(null===this.actionFactories){const t=[];t[0]=(t,e)=>new Gt(t),t[1]=(t,e)=>new Yt(t,e),t[2]=(t,e)=>new Zt(t),t[3]=(t,e)=>Wt.INSTANCE,t[4]=(t,e)=>Jt.INSTANCE,t[5]=(t,e)=>new Xt(t),t[6]=(t,e)=>qt.INSTANCE,t[7]=(t,e)=>new Qt(t),this.actionFactories=t}if(t>this.actionFactories.length||null===this.actionFactories[t])throw"The specified lexer action type "+t+" is not valid.";return this.actionFactories[t](e,n)}}class ne{syntaxError(t,e,n,r,i,o){}reportAmbiguity(t,e,n,r,i,o,s){}reportAttemptingFullContext(t,e,n,r,i,o){}reportContextSensitivity(t,e,n,r,i,o){}}class re extends ne{constructor(){super()}syntaxError(t,e,n,r,i,o){console.error("line "+n+":"+r+" "+i)}}re.INSTANCE=new re;class ie extends ne{constructor(t){if(super(),null===t)throw"delegates";return this.delegates=t,this}syntaxError(t,e,n,r,i,o){this.delegates.map((s=>s.syntaxError(t,e,n,r,i,o)))}reportAmbiguity(t,e,n,r,i,o,s){this.delegates.map((a=>a.reportAmbiguity(t,e,n,r,i,o,s)))}reportAttemptingFullContext(t,e,n,r,i,o){this.delegates.map((s=>s.reportAttemptingFullContext(t,e,n,r,i,o)))}reportContextSensitivity(t,e,n,r,i,o){this.delegates.map((s=>s.reportContextSensitivity(t,e,n,r,i,o)))}}class oe{constructor(){this._listeners=[re.INSTANCE],this._interp=null,this._stateNumber=-1}checkVersion(t){const e="4.11.0";e!==t&&console.log("ANTLR runtime and generated code versions disagree: "+e+"!="+t)}addErrorListener(t){this._listeners.push(t)}removeErrorListeners(){this._listeners=[]}getLiteralNames(){return Object.getPrototypeOf(this).constructor.literalNames||[]}getSymbolicNames(){return Object.getPrototypeOf(this).constructor.symbolicNames||[]}getTokenNames(){if(!this.tokenNames){const t=this.getLiteralNames(),e=this.getSymbolicNames(),n=t.length>e.length?t.length:e.length;this.tokenNames=[];for(let r=0;r";let e=t.text;return null===e&&(e=t.type===L.EOF?"":"<"+t.type+">"),e=e.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"),"'"+e+"'"}getErrorListenerDispatch(){return new ie(this._listeners)}sempred(t,e,n){return!0}precpred(t,e){return!0}get state(){return this._stateNumber}set state(t){this._stateNumber=t}}oe.tokenTypeMapCache={},oe.ruleIndexMapCache={};class se extends L{constructor(t,e,n,r,i){super(),this.source=void 0!==t?t:se.EMPTY_SOURCE,this.type=void 0!==e?e:null,this.channel=void 0!==n?n:L.DEFAULT_CHANNEL,this.start=void 0!==r?r:-1,this.stop=void 0!==i?i:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=t[0].line,this.column=t[0].column):this.column=-1}clone(){const t=new se(this.source,this.type,this.channel,this.start,this.stop);return t.tokenIndex=this.tokenIndex,t.line=this.line,t.column=this.column,t.text=this.text,t}toString(){let t=this.text;return t=null!==t?t.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+t+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"}get text(){if(null!==this._text)return this._text;const t=this.getInputStream();if(null===t)return null;const e=t.size;return this.start"}set text(t){this._text=t}}se.EMPTY_SOURCE=[null,null];class ae{}class le extends ae{constructor(t){super(),this.copyText=void 0!==t&&t}create(t,e,n,r,i,o,s,a){const l=new se(t,e,r,i,o);return l.line=s,l.column=a,null!==n?l.text=n:this.copyText&&null!==t[1]&&(l.text=t[1].getText(i,o)),l}createThin(t,e){const n=new se(null,t);return n.text=e,n}}le.DEFAULT=new le;class ue extends Error{constructor(t){super(t.message),Error.captureStackTrace&&Error.captureStackTrace(this,ue),this.message=t.message,this.recognizer=t.recognizer,this.input=t.input,this.ctx=t.ctx,this.offendingToken=null,this.offendingState=-1,null!==this.recognizer&&(this.offendingState=this.recognizer.state)}getExpectedTokens(){return null!==this.recognizer?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null}toString(){return this.message}}class ce extends ue{constructor(t,e,n,r){super({message:"",recognizer:t,input:e,ctx:null}),this.startIndex=n,this.deadEndConfigs=r}toString(){let t="";return this.startIndex>=0&&this.startIndex":"\n"===t?"\\n":"\t"===t?"\\t":"\r"===t?"\\r":t}getCharErrorDisplay(t){return"'"+this.getErrorDisplayForChar(t)+"'"}recover(t){this._input.LA(1)!==L.EOF&&(t instanceof ce?this._interp.consume(this._input):this._input.consume())}get inputStream(){return this._input}set inputStream(t){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=t,this._tokenFactorySourcePair=[this,this._input]}get sourceName(){return this._input.sourceName}get type(){return this._type}set type(t){this._type=t}get line(){return this._interp.line}set line(t){this._interp.line=t}get column(){return this._interp.column}set column(t){this._interp.column=t}get text(){return null!==this._text?this._text:this._interp.getText(this._input)}set text(t){this._text=t}}function fe(t){return t.hashCodeForConfigSet()}function pe(t,e){return t===e||null!==t&&null!==e&&t.equalsForConfigSet(e)}he.DEFAULT_MODE=0,he.MORE=-2,he.SKIP=-3,he.DEFAULT_TOKEN_CHANNEL=L.DEFAULT_CHANNEL,he.HIDDEN=L.HIDDEN_CHANNEL,he.MIN_CHAR_VALUE=0,he.MAX_CHAR_VALUE=1114111;class de{constructor(t){this.configLookup=new B(fe,pe),this.fullCtx=void 0===t||t,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1}add(t,e){if(void 0===e&&(e=null),this.readOnly)throw"This set is readonly";t.semanticContext!==U.NONE&&(this.hasSemanticContext=!0),t.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);const n=this.configLookup.add(t);if(n===t)return this.cachedHashCode=-1,this.configs.push(t),!0;const r=!this.fullCtx,i=_t(n.context,t.context,r,e);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,t.reachesIntoOuterContext),t.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=i,!0}getStates(){const t=new B;for(let e=0;ewe.MAX_DFA_EDGE)return null;let n=t.edges[e-we.MIN_DFA_EDGE];return void 0===n&&(n=null),we.debug&&null!==n&&console.log("reuse state "+t.stateNumber+" edge to "+n.stateNumber),n}computeTargetState(t,e,n){const r=new ye;return this.getReachableConfigSet(t,e.configs,r,n),0===r.items.length?(r.hasSemanticContext||this.addDFAEdge(e,n,ve.ERROR),ve.ERROR):this.addDFAEdge(e,n,null,r)}failOrAccept(t,e,n,r){if(null!==this.prevAccept.dfaState){const n=t.dfaState.lexerActionExecutor;return this.accept(e,n,this.startIndex,t.index,t.line,t.column),t.dfaState.prediction}if(r===L.EOF&&e.index===this.startIndex)return L.EOF;throw new ce(this.recog,e,this.startIndex,n)}getReachableConfigSet(t,e,n,r){let i=xt.INVALID_ALT_NUMBER;for(let o=0;owe.MAX_DFA_EDGE||(we.debug&&console.log("EDGE "+t+" -> "+n+" upon "+e),null===t.edges&&(t.edges=[]),t.edges[e-we.MIN_DFA_EDGE]=n),n}addDFAState(t){const e=new me(null,t);let n=null;for(let e=0;et.startsWith("k-"))).map((t=>this.data[t]),this)}}const Se={SLL:0,LL:1,LL_EXACT_AMBIG_DETECTION:2,hasSLLConflictTerminatingPrediction:function(t,e){if(Se.allConfigsInRuleStopStates(e))return!0;if(t===Se.SLL&&e.hasSemanticContext){const t=new de;for(let n=0;n1)return!0;return!1},allSubsetsEqual:function(t){let e=null;for(let n=0;n0&&(o=this.getAltThatFinishedDecisionEntryRule(i),o!==xt.INVALID_ALT_NUMBER)?o:xt.INVALID_ALT_NUMBER}getAltThatFinishedDecisionEntryRule(t){const e=[];for(let n=0;n0||r.state instanceof W&&r.context.hasEmptyPath())&&e.indexOf(r.alt)<0&&e.push(r.alt)}return 0===e.length?xt.INVALID_ALT_NUMBER:Math.min.apply(null,e)}splitAccordingToSemanticValidity(t,e){const n=new de(t.fullCtx),r=new de(t.fullCtx);for(let i=0;i50))throw"problem";if(t.state instanceof W){if(!t.context.isEmpty()){for(let a=0;a=0&&(r+=1)}this.closureCheckingStopState(h,e,n,c,i,r,s)}}}canDropLoopEntryEdgeInLeftRecursiveRule(t){const e=t.state;if(e.stateType!==Y.STAR_LOOP_ENTRY)return!1;if(e.stateType!==Y.STAR_LOOP_ENTRY||!e.isPrecedenceDecision||t.context.isEmpty()||t.context.hasEmptyPath())return!1;const n=t.context.length;for(let r=0;r=0?this.parser.ruleNames[t]:""}getEpsilonTarget(t,e,n,r,i,o){switch(e.serializationType){case Q.RULE:return this.ruleTransition(t,e);case Q.PRECEDENCE:return this.precedenceTransition(t,e,n,r,i);case Q.PREDICATE:return this.predTransition(t,e,n,r,i);case Q.ACTION:return this.actionTransition(t,e);case Q.EPSILON:return new z({state:e.target},t);case Q.ATOM:case Q.RANGE:case Q.SET:return o&&e.matches(L.EOF,0,1)?new z({state:e.target},t):null;default:return null}}actionTransition(t,e){if(this.debug){const t=-1===e.actionIndex?65535:e.actionIndex;console.log("ACTION edge "+e.ruleIndex+":"+t)}return new z({state:e.target},t)}precedenceTransition(t,e,n,r,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+j(this.parser.getRuleInvocationStack())));let o=null;if(n&&r)if(i){const n=this._input.index;this._input.seek(this._startIndex);const r=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),r&&(o=new z({state:e.target},t))}else{const n=U.andContext(t.semanticContext,e.getPredicate());o=new z({state:e.target,semanticContext:n},t)}else o=new z({state:e.target},t);return this.debug&&console.log("config from pred transition="+o),o}predTransition(t,e,n,r,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.ruleIndex+":"+e.predIndex+", ctx dependent="+e.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+j(this.parser.getRuleInvocationStack())));let o=null;if(n&&(e.isCtxDependent&&r||!e.isCtxDependent))if(i){const n=this._input.index;this._input.seek(this._startIndex);const r=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),r&&(o=new z({state:e.target},t))}else{const n=U.andContext(t.semanticContext,e.getPredicate());o=new z({state:e.target,semanticContext:n},t)}else o=new z({state:e.target},t);return this.debug&&console.log("config from pred transition="+o),o}ruleTransition(t,e){this.debug&&console.log("CALL rule "+this.getRuleName(e.target.ruleIndex)+", ctx="+t.context);const n=e.followState,r=pt.create(t.context,n.stateNumber);return new z({state:e.target,context:r},t)}getConflictingAlts(t){const e=Oe.getConflictingAltSubsets(t);return Oe.getAlts(e)}getConflictingAltsOrUniqueAlt(t){let e=null;return t.uniqueAlt!==xt.INVALID_ALT_NUMBER?(e=new Et,e.add(t.uniqueAlt)):e=t.conflictingAlts,e}getTokenName(t){if(t===L.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(t>=this.parser.literalNames.length&&t>=this.parser.symbolicNames.length))return(this.parser.literalNames[t]||this.parser.symbolicNames[t])+"<"+t+">";console.log(t+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+t}getLookaheadName(t){return this.getTokenName(t.LA(1))}dumpDeadEndConfigs(t){console.log("dead end configs: ");const e=t.getDeadEndConfigs();for(let t=0;t0){const t=n.state.transitions[0];t instanceof Dt?r="Atom "+this.getTokenName(t.label):t instanceof J&&(r=(t instanceof Z?"~":"")+"Set "+t.set)}console.error(n.toString(this.parser,!0)+":"+r)}}noViableAlt(t,e,n,r){return new Ae(this.parser,t,t.get(r),t.LT(1),n,e)}getUniqueAlt(t){let e=xt.INVALID_ALT_NUMBER;for(let n=0;n "+r+" upon "+this.getTokenName(n)),null===r)return null;if(r=this.addDFAState(t,r),null===e||n<-1||n>this.atn.maxTokenType)return r;if(null===e.edges&&(e.edges=[]),e.edges[n+1]=r,this.debug){const e=null===this.parser?null:this.parser.literalNames,n=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+t.toString(e,n))}return r}addDFAState(t,e){if(e===ve.ERROR)return e;const n=t.states.get(e);return null!==n?n:(e.stateNumber=t.states.length,e.configs.readOnly||(e.configs.optimizeConfigs(this),e.configs.setReadonly(!0)),t.states.add(e),this.debug&&console.log("adding new DFA state: "+e),e)}reportAttemptingFullContext(t,e,n,r,i){if(this.debug||this.retry_debug){const e=new q(r,i+1);console.log("reportAttemptingFullContext decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(e))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,t,r,i,e,n)}reportContextSensitivity(t,e,n,r,i){if(this.debug||this.retry_debug){const e=new q(r,i+1);console.log("reportContextSensitivity decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(e))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,t,r,i,e,n)}reportAmbiguity(t,e,n,r,i,o,s){if(this.debug||this.retry_debug){const t=new q(n,r+1);console.log("reportAmbiguity "+o+":"+s+", input="+this.parser.getTokenStream().getText(t))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,t,n,r,i,o,s)}},PredictionMode:Oe};class Le{constructor(t,e,n){this.dfa=t,this.literalNames=e||[],this.symbolicNames=n||[]}toString(){if(null===this.dfa.s0)return null;let t="";const e=this.dfa.sortedStates();for(let n=0;n"),t=t.concat(this.getStateString(e)),t=t.concat("\n"))}}}return 0===t.length?null:t}getEdgeLabel(t){return 0===t?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[t-1]||this.symbolicNames[t-1]:String.fromCharCode(t-1)}getStateString(t){const e=(t.isAcceptState?":":"")+"s"+t.stateNumber+(t.requiresFullContext?"^":"");return t.isAcceptState?null!==t.predicates?e+"=>"+j(t.predicates):e+"=>"+t.prediction.toString():e}}class Pe extends Le{constructor(t){super(t,null)}getEdgeLabel(t){return"'"+String.fromCharCode(t)+"'"}}const Ne={DFA:class{constructor(t,e){if(void 0===e&&(e=0),this.atnStartState=t,this.decision=e,this._states=new B,this.s0=null,this.precedenceDfa=!1,t instanceof Pt&&t.isPrecedenceDecision){this.precedenceDfa=!0;const t=new me(null,new de);t.edges=[],t.isAcceptState=!1,t.requiresFullContext=!1,this.s0=t}}getPrecedenceStartState(t){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return t<0||t>=this.s0.edges.length?null:this.s0.edges[t]||null}setPrecedenceStartState(t,e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";t<0||(this.s0.edges[t]=e)}setPrecedenceDfa(t){if(this.precedenceDfa!==t){if(this._states=new B,t){const t=new me(null,new de);t.edges=[],t.isAcceptState=!1,t.requiresFullContext=!1,this.s0=t}else this.s0=null;this.precedenceDfa=t}}sortedStates(){return this._states.values().sort((function(t,e){return t.stateNumber-e.stateNumber}))}toString(t,e){return t=t||null,e=e||null,null===this.s0?"":new Le(this,t,e).toString()}toLexerString(){return null===this.s0?"":new Pe(this).toString()}get states(){return this._states}},DFASerializer:Le,LexerDFASerializer:Pe,PredPrediction:ke};class Ie{visitTerminal(t){}visitErrorNode(t){}enterEveryRule(t){}exitEveryRule(t){}}class Fe{walk(t,e){if(e instanceof at||void 0!==e.isErrorNode&&e.isErrorNode())t.visitErrorNode(e);else if(e instanceof st)t.visitTerminal(e);else{this.enterRule(t,e);for(let n=0;n=0&&t.consume(),this.lastErrorIndex=t._input.index,null===this.lastErrorStates&&(this.lastErrorStates=[]),this.lastErrorStates.push(t.state);const n=this.getErrorRecoverySet(t);this.consumeUntil(t,n)}sync(t){if(this.inErrorRecoveryMode(t))return;const e=t._interp.atn.states[t.state],n=t.getTokenStream().LA(1),r=t.atn.nextTokens(e);if(r.contains(n))return this.nextTokensContext=null,void(this.nextTokenState=Y.INVALID_STATE_NUMBER);if(r.contains(L.EPSILON))null===this.nextTokensContext&&(this.nextTokensContext=t._ctx,this.nextTokensState=t._stateNumber);else switch(e.stateType){case Y.BLOCK_START:case Y.STAR_BLOCK_START:case Y.PLUS_BLOCK_START:case Y.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(t))return;throw new je(t);case Y.PLUS_LOOP_BACK:case Y.STAR_LOOP_BACK:{this.reportUnwantedToken(t);const e=new G;e.addSet(t.getExpectedTokens());const n=e.addSet(this.getErrorRecoverySet(t));this.consumeUntil(t,n)}}}reportNoViableAlternative(t,e){const n=t.getTokenStream();let r;r=null!==n?e.startToken.type===L.EOF?"":n.getText(new q(e.startToken.tokenIndex,e.offendingToken.tokenIndex)):"";const i="no viable alternative at input "+this.escapeWSAndQuote(r);t.notifyErrorListeners(i,e.offendingToken,e)}reportInputMismatch(t,e){const n="mismatched input "+this.getTokenErrorDisplay(e.offendingToken)+" expecting "+e.getExpectedTokens().toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e.offendingToken,e)}reportFailedPredicate(t,e){const n="rule "+t.ruleNames[t._ctx.ruleIndex]+" "+e.message;t.notifyErrorListeners(n,e.offendingToken,e)}reportUnwantedToken(t){if(this.inErrorRecoveryMode(t))return;this.beginErrorCondition(t);const e=t.getCurrentToken(),n="extraneous input "+this.getTokenErrorDisplay(e)+" expecting "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e,null)}reportMissingToken(t){if(this.inErrorRecoveryMode(t))return;this.beginErrorCondition(t);const e=t.getCurrentToken(),n="missing "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames)+" at "+this.getTokenErrorDisplay(e);t.notifyErrorListeners(n,e,null)}recoverInline(t){const e=this.singleTokenDeletion(t);if(null!==e)return t.consume(),e;if(this.singleTokenInsertion(t))return this.getMissingSymbol(t);throw new je(t)}singleTokenInsertion(t){const e=t.getTokenStream().LA(1),n=t._interp.atn,r=n.states[t.state].transitions[0].target;return!!n.nextTokens(r,t._ctx).contains(e)&&(this.reportMissingToken(t),!0)}singleTokenDeletion(t){const e=t.getTokenStream().LA(2);if(this.getExpectedTokens(t).contains(e)){this.reportUnwantedToken(t),t.consume();const e=t.getCurrentToken();return this.reportMatch(t),e}return null}getMissingSymbol(t){const e=t.getCurrentToken(),n=this.getExpectedTokens(t).first();let r;r=n===L.EOF?"":"";let i=e;const o=t.getTokenStream().LT(-1);return i.type===L.EOF&&null!==o&&(i=o),t.getTokenFactory().create(i.source,n,r,L.DEFAULT_CHANNEL,-1,-1,i.line,i.column)}getExpectedTokens(t){return t.getExpectedTokens()}getTokenErrorDisplay(t){if(null===t)return"";let e=t.text;return null===e&&(e=t.type===L.EOF?"":"<"+t.type+">"),this.escapeWSAndQuote(e)}escapeWSAndQuote(t){return"'"+(t=(t=(t=t.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}getErrorRecoverySet(t){const e=t._interp.atn;let n=t._ctx;const r=new G;for(;null!==n&&n.invokingState>=0;){const t=e.states[n.invokingState].transitions[0],i=e.nextTokens(t.followState);r.addSet(i),n=n.parentCtx}return r.removeOne(L.EPSILON),r}consumeUntil(t,e){let n=t.getTokenStream().LA(1);for(;n!==L.EOF&&!e.contains(n);)t.consume(),n=t.getTokenStream().LA(1)}}const $e={RecognitionException:ue,NoViableAltException:Ae,LexerNoViableAltException:ce,InputMismatchException:je,FailedPredicateException:Me,DiagnosticErrorListener:class extends ne{constructor(t){super(),t=t||!0,this.exactOnly=t}reportAmbiguity(t,e,n,r,i,o,s){if(this.exactOnly&&!i)return;const a="reportAmbiguity d="+this.getDecisionDescription(t,e)+": ambigAlts="+this.getConflictingAlts(o,s)+", input='"+t.getTokenStream().getText(new q(n,r))+"'";t.notifyErrorListeners(a)}reportAttemptingFullContext(t,e,n,r,i,o){const s="reportAttemptingFullContext d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new q(n,r))+"'";t.notifyErrorListeners(s)}reportContextSensitivity(t,e,n,r,i,o){const s="reportContextSensitivity d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new q(n,r))+"'";t.notifyErrorListeners(s)}getDecisionDescription(t,e){const n=e.decision,r=e.atnStartState.ruleIndex,i=t.ruleNames;if(r<0||r>=i.length)return""+n;const o=i[r]||null;return null===o||0===o.length?""+n:`${n} (${o})`}getConflictingAlts(t,e){if(null!==t)return t;const n=new Et;for(let t=0;t=this._size)throw"cannot consume EOF";this._index+=1}LA(t){if(0===t)return 0;t<0&&(t+=1);const e=this._index+t-1;return e<0||e>=this._size?L.EOF:this.data[e]}LT(t){return this.LA(t)}mark(){return-1}release(t){}seek(t){t<=this._index?this._index=t:this._index=Math.min(t,this._size)}getText(t,e){if(e>=this._size&&(e=this._size-1),t>=this._size)return"";if(this.decodeToUnicodeCodePoints){let n="";for(let r=t;r<=e;r++)n+=String.fromCodePoint(this.data[r]);return n}return this.strdata.slice(t,e+1)}toString(){return this.strdata}get index(){return this._index}get size(){return this._size}}var ze=n(654);const qe={fromString:function(t){return new He(t,!0)},fromBlob:function(t,e,n,r){const i=new window.FileReader;i.onload=function(t){const e=new He(t.target.result,!0);n(e)},i.onerror=r,i.readAsText(t,e)},fromBuffer:function(t,e){return new He(t.toString(e),!0)},fromPath:function(t,e,n){ze.readFile(t,e,(function(t,e){let r=null;null!==e&&(r=new He(e,!0)),n(t,r)}))},fromPathSync:function(t,e){const n=ze.readFileSync(t,e);return new He(n,!0)}};class Ge{}class Ye extends Ge{constructor(t){super(),this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1}mark(){return 0}release(t){}reset(){this.seek(0)}seek(t){this.lazyInit(),this.index=this.adjustSeekIndex(t)}get(t){return this.lazyInit(),this.tokens[t]}consume(){let t=!1;if(t=this.index>=0&&(this.fetchedEOF?this.index0)||this.fetch(e)>=e}fetch(t){if(this.fetchedEOF)return 0;for(let e=0;e=this.tokens.length&&(e=this.tokens.length-1);for(let i=t;i=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[e]}adjustSeekIndex(t){return t}lazyInit(){-1===this.index&&this.setup()}setup(){this.sync(0),this.index=this.adjustSeekIndex(0)}setTokenSource(t){this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1}nextTokenOnChannel(t,e){if(this.sync(t),t>=this.tokens.length)return-1;let n=this.tokens[t];for(;n.channel!==this.channel;){if(n.type===L.EOF)return-1;t+=1,this.sync(t),n=this.tokens[t]}return t}previousTokenOnChannel(t,e){for(;t>=0&&this.tokens[t].channel!==e;)t-=1;return t}getHiddenTokensToRight(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;const n=this.nextTokenOnChannel(t+1,he.DEFAULT_TOKEN_CHANNEL),r=t+1,i=-1===n?this.tokens.length-1:n;return this.filterForChannel(r,i,e)}getHiddenTokensToLeft(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;const n=this.previousTokenOnChannel(t-1,he.DEFAULT_TOKEN_CHANNEL);if(n===t-1)return null;const r=n+1,i=t-1;return this.filterForChannel(r,i,e)}filterForChannel(t,e,n){const r=[];for(let i=t;i=this.tokens.length&&(n=this.tokens.length-1);let r="";for(let t=e;t=0&&this._parseListeners.splice(e,1),0===this._parseListeners.length&&(this._parseListeners=null)}}removeParseListeners(){this._parseListeners=null}triggerEnterRuleEvent(){if(null!==this._parseListeners){const t=this._ctx;this._parseListeners.forEach((function(e){e.enterEveryRule(t),t.enterRule(e)}))}}triggerExitRuleEvent(){if(null!==this._parseListeners){const t=this._ctx;this._parseListeners.slice(0).reverse().forEach((function(e){t.exitRule(e),e.exitEveryRule(t)}))}}getTokenFactory(){return this._input.tokenSource._factory}setTokenFactory(t){this._input.tokenSource._factory=t}getATNWithBypassAlts(){const t=this.getSerializedATN();if(null===t)throw"The current parser does not support an ATN with bypass alternatives.";let e=this.bypassAltsAtnCache[t];if(null===e){const n=new Ht;n.generateRuleBypassTransitions=!0,e=new ee(n).deserialize(t),this.bypassAltsAtnCache[t]=e}return e}getInputStream(){return this.getTokenStream()}setInputStream(t){this.setTokenStream(t)}getTokenStream(){return this._input}setTokenStream(t){this._input=null,this.reset(),this._input=t}getCurrentToken(){return this._input.LT(1)}notifyErrorListeners(t,e,n){n=n||null,null===(e=e||null)&&(e=this.getCurrentToken()),this._syntaxErrors+=1;const r=e.line,i=e.column;this.getErrorListenerDispatch().syntaxError(this,e,r,i,t,n)}consume(){const t=this.getCurrentToken();t.type!==L.EOF&&this.getInputStream().consume();const e=null!==this._parseListeners&&this._parseListeners.length>0;if(this.buildParseTrees||e){let n;n=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(t):this._ctx.addTokenNode(t),n.invokingState=this.state,e&&this._parseListeners.forEach((function(t){n instanceof at||void 0!==n.isErrorNode&&n.isErrorNode()?t.visitErrorNode(n):n instanceof st&&t.visitTerminal(n)}))}return t}addContextToParseTree(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)}enterRule(t,e,n){this.state=e,this._ctx=t,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}enterOuterAlt(t,e){t.setAltNumber(e),this.buildParseTrees&&this._ctx!==t&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(t)),this._ctx=t}getPrecedence(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]}enterRecursionRule(t,e,n,r){this.state=e,this._precedenceStack.push(r),this._ctx=t,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(t,e,n){const r=this._ctx;r.parentCtx=t,r.invokingState=e,r.stop=this._input.LT(-1),this._ctx=t,this._ctx.start=r.start,this.buildParseTrees&&this._ctx.addChild(r),this.triggerEnterRuleEvent()}unrollRecursionContexts(t){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);const e=this._ctx,n=this.getParseListeners();if(null!==n&&n.length>0)for(;this._ctx!==t;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=t;e.parentCtx=t,this.buildParseTrees&&null!==t&&t.addChild(e)}getInvokingContext(t){let e=this._ctx;for(;null!==e;){if(e.ruleIndex===t)return e;e=e.parentCtx}return null}precpred(t,e){return e>=this._precedenceStack[this._precedenceStack.length-1]}inContext(t){return!1}isExpectedToken(t){const e=this._interp.atn;let n=this._ctx;const r=e.states[this.state];let i=e.nextTokens(r);if(i.contains(t))return!0;if(!i.contains(L.EPSILON))return!1;for(;null!==n&&n.invokingState>=0&&i.contains(L.EPSILON);){const r=e.states[n.invokingState].transitions[0];if(i=e.nextTokens(r.followState),i.contains(t))return!0;n=n.parentCtx}return!(!i.contains(L.EPSILON)||t!==L.EOF)}getExpectedTokens(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}getExpectedTokensWithinCurrentRule(){const t=this._interp.atn,e=t.states[this.state];return t.nextTokens(e)}getRuleIndex(t){const e=this.getRuleIndexMap()[t];return null!==e?e:-1}getRuleInvocationStack(t){null===(t=t||null)&&(t=this._ctx);const e=[];for(;null!==t;){const n=t.ruleIndex;n<0?e.push("n/a"):e.push(this.ruleNames[n]),t=t.parentCtx}return e}getDFAStrings(){return this._interp.decisionToDFA.toString()}dumpDFA(){let t=!1;for(let e=0;e0&&(t&&console.log(),this.printer.println("Decision "+n.decision+":"),this.printer.print(n.toString(this.literalNames,this.symbolicNames)),t=!0)}}getSourceName(){return this._input.sourceName}setTrace(t){t?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new We(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}Qe.bypassAltsAtnCache={};class Xe extends st{constructor(t){super(),this.parentCtx=null,this.symbol=t}getChild(t){return null}getSymbol(){return this.symbol}getParent(){return this.parentCtx}getPayload(){return this.symbol}getSourceInterval(){if(null===this.symbol)return q.INVALID_INTERVAL;const t=this.symbol.tokenIndex;return new q(t,t)}getChildCount(){return 0}accept(t){return t.visitTerminal(this)}getText(){return this.symbol.text}toString(){return this.symbol.type===L.EOF?"":this.symbol.text}}class Je extends Xe{constructor(t){super(t)}isErrorNode(){return!0}accept(t){return t.visitErrorNode(this)}}class Ze extends ct{constructor(t,e){super(t=t||null,e=e||null),this.ruleIndex=-1,this.children=null,this.start=null,this.stop=null,this.exception=null}copyFrom(t){this.parentCtx=t.parentCtx,this.invokingState=t.invokingState,this.children=null,this.start=t.start,this.stop=t.stop,t.children&&(this.children=[],t.children.map((function(t){t instanceof Je&&(this.children.push(t),t.parentCtx=this)}),this))}enterRule(t){}exitRule(t){}addChild(t){return null===this.children&&(this.children=[]),this.children.push(t),t}removeLastChild(){null!==this.children&&this.children.pop()}addTokenNode(t){const e=new Xe(t);return this.addChild(e),e.parentCtx=this,e}addErrorNode(t){const e=new Je(t);return this.addChild(e),e.parentCtx=this,e}getChild(t,e){if(e=e||null,null===this.children||t<0||t>=this.children.length)return null;if(null===e)return this.children[t];for(let n=0;n=this.children.length)return null;for(let n=0;n@BDFHJ L!N\"P#R$T%V&X'","Z\\^(`)b*((>>@@~~","--112;&&00C\\aac|","𐠁𐠁\udc02\n","$$11^^ddhhppttvv2;CHch!$$^^",'3;\f\f\v\f""',"c|\b#&/1??aa}}Ƶ","\b","\n\f","","","",""," ",'"$',"&(","*,",".02","46","8:","@J","LN","PRT","VX","^`","bd","k\bp\nw","\f€Š","“œ","£¨","¬³","½Ë",' Í"Ï',"$Ñ&Ó","(Õ*×",",Ù.Û0Ý","2ß4è","6Ā8ī",":ĭ<Ķ",">ļ@ľ","BňDōFœ","HŕJş","LšNů","PźRƄ","TƊVƒ","XƔZƖ\\Ƙ","^ƚ`Ɯ","bƞdeo","efqfgfghwhi","nijgjkl","flmcmnvno","copquqr","qrswstttu","euvgv\twx","rxytyzqz{x","{|k|}f}~g","~t\v€","v‚g‚ƒ","tƒ„t„…","c…†h†‡q","‡ˆtˆ‰o","‰\rŠ‹t‹","ŒgŒuŽ","qŽw","t‘e‘’g","’“”x","”•c•–t","–—k—˜c˜","™d™šnš›","g›œ","qžwžŸ","vŸ r ¡w","¡¢v¢","£¤n¤¥k","¥¦u¦§v§","¨©o©","ªcª«r«","¬­q­®","d®¯l¯°","g°±e±²v","²³´e","´µqµ¶p","¶·f·¸k¸","¹v¹ºkº»","q»¼p¼","½¾g¾¿","t¿ÀtÀÁq","ÁÂtÂÃa","ÃÄoÄÅgÅ","ÆuÆÇuÇÈ","cÈÉiÉÊ","gÊËÌ","}ÌÍÎ","Î!ÏÐ","?Ð#ÑÒ*","Ò%ÓÔ+","Ô'ÕÖ]Ö",")×Ø_Ø+","ÙÚ.Ú-","ÛÜ0Ü/","ÝÞ/Þ1","ßà,à3á",'é\tâé"ãä',"?äé?åé","2æé0çé\t","èáèâ","èãèå","èæèç","é5êëv","ëìtìíwí","āgîï$ïð","vðñtñò","wòógóā$","ôõhõöc","ö÷n÷øuø","āgùú$úû","hûücüý","nýþuþÿg","ÿā$Āê","ĀîĀô","Āùā7","ĂăuăĄv","ĄątąĆkĆ","ćpćĬiĈĉ","$ĉĊuĊċ","vċČtČčk","čĎpĎďi","ďĬ$Đđpđ","ĒwĒēoēĔ","dĔĕgĕĬ","tĖė$ėĘp","ĘęwęĚo","ĚěděĜgĜ","ĝtĝĬ$Ğğ","dğĠqĠġ","qġĬnĢģ$","ģĤdĤĥq","ĥĦqĦħnħ","Ĭ$ĨĩcĩĪ","pĪĬ{īĂ","īĈīĐ","īĖīĞ","īĢīĨ","Ĭ9ĭı",">Įİ<įĮ","İijıį","ıIJIJ;","ijıĴķ>","ĵķ\tĶĴ","Ķĵķ=","ĸĽ\tĹĽ\n","ĺĻ\tĻĽ\t\bļ","ĸļĹļ","ĺĽ?ľ","Ń$ĿłB!ŀł","H$ŁĿŁŀ","łŅŃŁ","Ńńńņ","ŅŃņŇ$","ŇAňŋ^",'ʼnŌ\t\tŊŌD"ŋ',"ʼnŋŊŌ","CōŎwŎŏ","F#ŏŐF#ŐőF#ő","ŒF#ŒEœŔ\t\n","ŔGŕŖ\n\v","ŖIŗŠ2","ŘŜ\t\fřś\tŚř","śŞŜŚ","ŜŝŝŠ","ŞŜşŗ","şŘŠK","šŢ1Ţţ",",ţŧŤŦ","\vťŤŦũ","ŧŨŧť","ŨŪũŧ","Ūū,ūŬ","1ŬŭŭŮ","\b&ŮMůŰ1","Űű1űŵ","ŲŴ\n\rųŲ","Ŵŷŵų","ŵŶŶŸ","ŷŵŸŹ\b'Ź","Oźž%ŻŽ","\n\rżŻŽƀ","žżžſ","ſƁƀž","ƁƂ\b(ƂQ","ƃƅ\tƄƃ","ƅƆƆƄ","ƆƇƇƈ","ƈƉ\b)ƉSƊ","Ƌ>Ƌƌ>ƌƍ","GƍƎQƎƏ","HƏƐƐƑ\b*","ƑUƒƓ\t","ƓWƔƕR)ƕY","ƖƗF#Ɨ[","ƘƙH$ƙ]ƚ","ƛJ%ƛ_ƜƝ\t","ƝaƞƟG","ƟƠQƠơH","ơƢƢƣ\b1ƣ","cèĀīı","ĶļŁŃŋŜşŧŵžƆ",""].join(""),En=(new nn.atn.ATNDeserializer).deserialize(_n),bn=En.decisionToState.map((function(t,e){return new nn.dfa.DFA(t,e)})),xn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pn(t,e)}(s,t);var e,n,r,i,o=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=vn(r);if(i){var n=vn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return dn(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=o.call(this,t))._interp=new nn.atn.LexerATNSimulator(mn(e),En,bn,new nn.PredictionContextCache),e}return e=s,(n=[{key:"atn",get:function(){return En}}])&&fn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(nn.Lexer);function wn(t){return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(t)}function kn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tn(t,e){for(var n=0;n\bI","\nT\fX^","gn","x‚","„—","›Ÿ",' ³"µ',"$Ç&Ï","(Ñ*ù,ě",".ĝ02","102331","344","5=\f6=\b7=\t","8=\n9=\v:=\b",";=<5<6","<7<8<9","<:<;=",">??@\r","@A\fACBD","CBDEEC","EFFGGH","HIJ","JK\fKNLO\n","MONLNM","OPPNPQ","QRRS","S\tTUUV","VWW\v","XYYZ\fZ[","[\\\\]]\r","^__a","`ba`bc","cacdde","eff","gh\bhi\rij\fj","kkllm","mno\top","\fprqsr","qsttr","tuuvvw","wxy\nyz","\fz|{}","|{}~~|","~€","€","‚ƒƒ","„……","†˜‡˜\v","ˆ‰\v‰Š","Š‹‹Œ","Œ˜Ž\f","Ž","‘‘˜","’“\r“”","”••–","–˜—†","—‡—ˆ","——’","˜™œ ","šœ›™","›šœ","›ž","žŸ \t"," ¡¡¢&","¢£¤","¤¥¥¦","¦§§´","¨©©ª","ª®«¬","¬­­¯","®«¯°","°®°±","±²²´","³£³¨","´!µ¶","¶··¹","¸º$¹¸","º»»¹","»¼¼½","½¾¾¿","¿ÀÀÁ","Á#ÂÈ","ÃÈ ÄÈ","ÅÈÆÈ(","ÇÂÇÃ","ÇÄÇÅ","ÇÆÈ%","ÉÐ ÊÐ","ËÐ,ÌÐ*","ÍÐÎÐ","ÏÉÏÊ","ÏËÏÌ","ÏÍÏÎ","Ð'ÑÒ","ÒÓÓØ&","ÔÕÕ×&","ÖÔ×Ú","ØÖØÙ","ÙÜÚØ","ÛÝÜÛ","ÜÝÝÞ","Þßß)","àá\báú","âä\tãâ","äååã","åææú","çï%èð&é","ð)êì'ëê","ìííë","íîîð","ïèïé","ïëðñ","ñïñò","òóóú","*ôõõö","*ö÷÷ú","øú(ùà","ùãùç","ùôùø","úĈûü","\f\büýýć","*\tþÿ\fÿĀ","Āā.āĂ","ĂćăĄ\f","Ąąąć.","ĆûĆþ","ĆăćĊ","ĈĆĈĉ","ĉ+ĊĈ","ċČČĜ","čĎĎē&","ďĐĐĒ&","đďĒĕ","ēđēĔ","Ĕėĕē","ĖĘėĖ","ėĘĘę","ęĚĚĜ","ěċěč","Ĝ-ĝĞ\t","Ğ/30&&void 0!==arguments[0]?arguments[0]:[],e=new cn(this.pluginData.definitions.components);t.forEach((function(t){e.currentFile=t;var n=new nn.InputStream(t.content),r=new xn(n),i=new nn.CommonTokenStream(r),o=new Bn(i);o.buildParseTrees=!0;var s=o.file();nn.tree.ParseTreeWalker.DEFAULT.walk(e,s)})),this.pluginData.components=e.components.map((function(t){return t.id=t.name,t})),this.pluginData.parseErrors=e.errors}}],n&&hr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(t.DefaultParser);const vr=mr;var yr=n(985),gr=n.n(yr);function _r(t){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(t)}function Er(t,e){for(var n=0;n