@rhinostone/swig 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changes/v2.0.1.md +8 -0
- package/.changes/v2.1.0.md +8 -0
- package/.eslintrc.json +8 -1
- package/AUTHORS +1 -1
- package/HISTORY.md +18 -0
- package/README.md +15 -3
- package/ROADMAP.md +15 -4
- package/dist/swig.js +493 -30
- package/dist/swig.min.js +24 -6
- package/dist/swig.min.js.map +1 -1
- package/lib/async/pre-walker.js +279 -0
- package/lib/lexer.js +1 -1
- package/lib/parser.js +2 -2
- package/lib/swig.js +146 -2
- package/package.json +2 -2
package/dist/swig.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! Swig v2.
|
|
1
|
+
/*! Swig v2.1.0 | https://github.com/gina-io/swig | @license https://github.com/gina-io/swig/blob/master/LICENSE */
|
|
2
2
|
/*! DateZ (c) 2011 Tomo Universalis | @license https://github.com/ocrybit/DateZ/blob/master/LISENCE */
|
|
3
|
-
(()=>{var e=Object.getOwnPropertyNames,t=(t,r)=>function(){return r||(0,t[e(t)[0]])((r={exports:{}}).exports,r),r.exports},r=t({"packages/swig-core/lib/utils.js"(e){var t;e.strip=function(e){return e.replace(/^\s+|\s+$/g,"")},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.each=function(e,r){var n,o;if(t(e))for(n=0,o=e.length;n<o&&!1!==r(e[n],n,e);n+=1);else for(n in e)if(e.hasOwnProperty(n)&&!1===r(e[n],n,e))break;return e},e.isArray=t=Array.hasOwnProperty("isArray")?Array.isArray:function(e){return!!e&&("object"==typeof e&&-1!==Object.prototype.toString.call(e).indexOf())},e.some=function(r,n){var o,a,i=0;if(t(r))for(a=r.length;i<a&&!(o=n(r[i],i,r));i+=1);else e.each(r,function(e,t){return!(o=n(e,t,r))});return!!o},e.map=function(e,r){var n,o=0,a=[];if(t(e))for(n=e.length;o<n;o+=1)a[o]=r(e[o],o);else for(o in e)e.hasOwnProperty(o)&&(a[o]=r(e[o],o));return a},e.extend=function(){for(var e,t,r=arguments,n=r[0],o=r.length>1?Array.prototype.slice.call(r,1):[],a=0,i=o.length;a<i;a+=1)for(e in t=o[a]||{})t.hasOwnProperty(e)&&(n[e]=t[e]);return n},e.keys=function(t){return t?Object.keys?Object.keys(t):e.map(t,function(e,t){return t}):[]},e.throwError=function(e,t,r){throw t&&(e+=" on line "+t),r&&(e+=" in file "+r),new Error(e+".")},e.range=function(e,t){var r,n,o,a=[];if("number"==typeof e&&"number"==typeof t){if(e<=t)for(r=e;r<=t;r+=1)a.push(r);else for(r=e;r>=t;r-=1)a.push(r);return a}if("string"==typeof e&&"string"==typeof t&&1===e.length&&1===t.length){if((n=e.charCodeAt(0))<=(o=t.charCodeAt(0)))for(r=n;r<=o;r+=1)a.push(String.fromCharCode(r));else for(r=n;r>=o;r-=1)a.push(String.fromCharCode(r));return a}return a}}}),n=t({"lib/utils.js"(e,t){t.exports=r()}}),o=t({"packages/swig-core/lib/ir.js"(e){function t(e,t){return void 0!==t&&(e.loc=t),e}e.template=function(e,r,n,o){var a={type:"Template",body:e};return void 0!==r&&(a.parent=r),void 0!==n&&(a.blocks=n),t(a,o)},e.text=function(e,r){return t({type:"Text",value:e},r)},e.output=function(e,r,n,o){var a={type:"Output",expr:e};return void 0!==r&&(a.filters=r),void 0!==n&&(a.safe=n),t(a,o)},e.filterCall=function(e,t){var r={name:e};return void 0!==t&&(r.args=t),r},e.ifStmt=function(e,r){return t({type:"If",branches:e},r)},e.ifBranch=function(e,t){return{test:e,body:t}},e.forStmt=function(e,r,n,o,a,i){var s={type:"For",value:e,iterable:r,body:n};return void 0!==o&&(s.key=o),void 0!==a&&(s.emptyBody=a),t(s,i)},e.block=function(e,r,n){return t({type:"Block",name:e,body:r},n)},e.include=function(e,r,n,o,a,i){var s={type:"Include",path:e};return void 0!==r&&(s.context=r),void 0!==n&&(s.isolated=n),void 0!==o&&(s.ignoreMissing=o),void 0!==a&&(s.resolveFrom=a),t(s,i)},e.importStmt=function(e,r,n){return t({type:"Import",path:e,alias:r},n)},e.macro=function(e,r,n,o){return t({type:"Macro",name:e,params:r,body:n},o)},e.macroParam=function(e,t){var r={name:e};return void 0!==t&&(r.default=t),r},e.call=function(e,r,n){return t({type:"Call",callee:e,args:r},n)},e.set=function(e,r,n,o){return t({type:"Set",target:e,op:r,value:n},o)},e.raw=function(e,r){return t({type:"Raw",value:e},r)},e.parent=function(e,r){var n={type:"Parent"};return void 0!==e&&(n.body=e),t(n,r)},e.autoescape=function(e,r,n){return t({type:"Autoescape",strategy:e,body:r},n)},e.filter=function(e,r,n,o){var a={type:"Filter",name:e,body:r};return void 0!==n&&(a.args=n),t(a,o)},e.withStmt=function(e,r,n,o){var a={type:"With",body:n};return void 0!==e&&(a.context=e),void 0!==r&&(a.isolated=r),t(a,o)},e.legacyJS=function(e,r){return t({type:"LegacyJS",js:e},r)},e.literal=function(e,r,n){return t({type:"Literal",kind:e,value:r},n)},e.varRef=function(e,r){return t({type:"VarRef",path:e},r)},e.varRefExists=function(e,r){return t({type:"VarRefExists",path:e},r)},e.access=function(e,r,n){return t({type:"Access",object:e,key:r},n)},e.binaryOp=function(e,r,n,o){return t({type:"BinaryOp",op:e,left:r,right:n},o)},e.unaryOp=function(e,r,n){return t({type:"UnaryOp",op:e,operand:r},n)},e.conditional=function(e,r,n,o){var a={type:"Conditional",test:e,then:r};return a.else=n,t(a,o)},e.arrayLiteral=function(e,r){return t({type:"ArrayLiteral",elements:e},r)},e.objectLiteral=function(e,r){return t({type:"ObjectLiteral",properties:e},r)},e.objectProperty=function(e,t){return{key:e,value:t}},e.fnCall=function(e,r,n){return t({type:"FnCall",callee:e,args:r},n)},e.filterCallExpr=function(e,r,n,o){var a={type:"FilterCall",name:e,input:r};return void 0!==n&&(a.args=n),t(a,o)}}}),a=t({"lib/tags/autoescape.js"(e){var t=n(),r=o(),a=["html","js"];e.compile=function(e,t,n,o,a,i){var s=e(n,o,a,i);return r.autoescape(function(e){if("true"===e)return!0;if("false"===e)return!1;if("string"==typeof e&&e.length>=2){var t=e.charAt(0),r=e.charAt(e.length-1);if('"'===t&&'"'===r||"'"===t&&"'"===r)return e.slice(1,-1)}return e}(t[0]),[r.legacyJS(s)])},e.parse=function(e,r,n,o,i,s){var c;return n.on("*",function(e){if(!c&&(e.type===o.BOOL||e.type===o.STRING&&-1===a.indexOf(e.match)))return this.out.push(e.match),void(c=!0);t.throwError('Unexpected token "'+e.match+'" in autoescape tag',r,s.filename)}),!0},e.ends=!0}}),i=t({"lib/tags/block.js"(e){var t=o();e.compile=function(e,r,n,o,a){var i=r.join("");return t.block(i,[t.legacyJS(e(n,o,a,i))])},e.parse=function(e,t,r){return r.on("*",function(e){this.out.push(e.match)}),!0},e.ends=!0,e.block=!0}}),s=t({"lib/tags/else.js"(e){e.compile=function(){return"} else {\n"},e.parse=function(e,t,r,n,o){return r.on("*",function(e){throw new Error('"else" tag does not accept any tokens. Found "'+e.match+'" on line '+t+".")}),o.length&&"if"===o[o.length-1].name}}}),c=t({"packages/swig-core/lib/tokentypes.js"(e,t){t.exports={WHITESPACE:0,STRING:1,FILTER:2,FILTEREMPTY:3,FUNCTION:4,FUNCTIONEMPTY:5,PARENOPEN:6,PARENCLOSE:7,COMMA:8,VAR:9,NUMBER:10,OPERATOR:11,BRACKETOPEN:12,BRACKETCLOSE:13,DOTKEY:14,ARRAYOPEN:15,CURLYOPEN:17,CURLYCLOSE:18,COLON:19,COMPARATOR:20,LOGIC:21,NOT:22,BOOL:23,ASSIGNMENT:24,METHODOPEN:25,UNKNOWN:100}}}),l=t({"lib/tags/if.js"(e){var t=o(),r=c();e.compile=function(e,r,n,o,a,i,s){var c,l,u=[],p=s&&s.irExpr?s.irExpr:t.legacyJS(r.join(" ")),f=[];for(c=0;c<n.length;c++)!(l=n[c])||"elseif"!==l.name&&"else"!==l.name?f.push(l):(u.push(t.ifBranch(p,[t.legacyJS(e(f,o,a,i))])),p="else"===l.name?null:l.irExpr?l.irExpr:t.legacyJS(l.args.join(" ")),f=[]);return u.push(t.ifBranch(p,[t.legacyJS(e(f,o,a,i))])),t.ifStmt(u)},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,t,r,n){if(void 0===e)throw new Error("No conditional statement provided on line "+t+".");return r.on(n.COMPARATOR,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");if(this.prevToken.type===n.NOT)throw new Error('Attempted logic "not '+e.match+'" on line '+t+". Use !(foo "+e.match+") instead.");this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),r.on(n.NOT,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match)}),r.on(n.BOOL,function(e){this.out.push(e.match)}),r.on(n.LOGIC,function(e){if(!this.out.length||this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match),this.filterApplyIdx.pop()}),!0},e.ends=!0}}),u=t({"lib/tags/elseif.js"(e){var t=l().parse,r=c();e.compile=function(e,t){return"} else if ("+t.join(" ")+") {\n"},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,r,n,o,a){return t(e,r,n,o,a)&&a.length&&"if"===a[a.length-1].name}}}),p=t({"lib/tags/extends.js"(e){e.compile=function(){},e.parse=function(){return!0},e.ends=!1}}),f=t({"packages/swig-core/lib/dateformatter.js"(e){var t=r(),n={full:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},o={full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],alt:{"-1":"Yesterday",0:"Today",1:"Tomorrow"}};e.tzOffset=0,e.DateZ=function(){var r=["getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","toISOString","toGMTString","toUTCString","valueOf","getTime"],n=["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getYear","toDateString","toLocaleDateString","toLocaleTimeString"],o=this;o.date=o.dateZ=arguments.length>1?new Date(Date.UTC.apply(Date,arguments)+6e4*(new Date).getTimezoneOffset()):1===arguments.length?new Date(new Date(arguments[0])):new Date,o.timezoneOffset=o.dateZ.getTimezoneOffset(),t.each(n,function(e){o[e]=function(){return o.dateZ[e]()}}),t.each(r,function(e){o[e]=function(){return o.date[e]()}}),this.setTimezoneOffset(e.tzOffset)},e.DateZ.prototype={getTimezoneOffset:function(){return this.timezoneOffset},setTimezoneOffset:function(e){return this.timezoneOffset=e,this.dateZ=new Date(this.date.getTime()+6e4*this.date.getTimezoneOffset()-6e4*this.timezoneOffset),this}},e.d=function(e){return(e.getDate()<10?"0":"")+e.getDate()},e.D=function(e){return o.abbr[e.getDay()]},e.j=function(e){return e.getDate()},e.l=function(e){return o.full[e.getDay()]},e.N=function(e){var t=e.getDay();return t>=1?t:7},e.S=function(e){var t=e.getDate();return t%10==1&&11!==t?"st":t%10==2&&12!==t?"nd":t%10==3&&13!==t?"rd":"th"},e.w=function(e){return e.getDay()},e.z=function(t,r,n){var o=t.getFullYear(),a=new e.DateZ(o,t.getMonth(),t.getDate(),12,0,0),i=new e.DateZ(o,0,1,12,0,0);return a.setTimezoneOffset(r,n),i.setTimezoneOffset(r,n),Math.round((a-i)/864e5)},e.W=function(e){var t,r=new Date(e.valueOf()),n=(e.getDay()+6)%7;return r.setDate(r.getDate()-n+3),t=r.valueOf(),r.setMonth(0,1),4!==r.getDay()&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((t-r)/6048e5)},e.F=function(e){return n.full[e.getMonth()]},e.m=function(e){return(e.getMonth()<9?"0":"")+(e.getMonth()+1)},e.M=function(e){return n.abbr[e.getMonth()]},e.n=function(e){return e.getMonth()+1},e.t=function(e){return 32-new Date(e.getFullYear(),e.getMonth(),32).getDate()},e.L=function(e){return 29===new Date(e.getFullYear(),1,29).getDate()},e.o=function(e){var t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},e.Y=function(e){return e.getFullYear()},e.y=function(e){return e.getFullYear().toString().substr(2)},e.a=function(e){return e.getHours()<12?"am":"pm"},e.A=function(e){return e.getHours()<12?"AM":"PM"},e.B=function(e){var t,r=e.getUTCHours();return r=23===r?0:r+1,t=Math.abs((60*(60*r+e.getUTCMinutes())+e.getUTCSeconds())/86.4).toFixed(0),"000".concat(t).slice(t.length)},e.g=function(e){var t=e.getHours();return 0===t?12:t>12?t-12:t},e.G=function(e){return e.getHours()},e.h=function(e){var t=e.getHours();return(t<10||12<t&&22>t?"0":"")+(t<12?t:t-12)},e.H=function(e){var t=e.getHours();return(t<10?"0":"")+t},e.i=function(e){var t=e.getMinutes();return(t<10?"0":"")+t},e.s=function(e){var t=e.getSeconds();return(t<10?"0":"")+t},e.O=function(e){var t=e.getTimezoneOffset();return(t<0?"-":"+")+(t/60<10?"0":"")+Math.abs(t/60)+"00"},e.Z=function(e){return 60*e.getTimezoneOffset()},e.c=function(e){return e.toISOString()},e.r=function(e){return e.toUTCString()},e.U=function(e){return e.getTime()/1e3}}}),h=t({"lib/dateformatter.js"(e,t){t.exports=f()}}),g=t({"packages/swig-core/lib/filters.js"(e){var t=r();e.iterateFilter=function(e){var r=this,n={};return t.isArray(e)?t.map(e,function(e){return r.apply(null,arguments)}):"object"==typeof e?(t.each(e,function(e,t){n[t]=r.apply(null,arguments)}),n):void 0}}}),y=t({"lib/filters.js"(e){var t=n(),r=h(),o=g().iterateFilter;e.addslashes=function(t){var r=o.apply(e.addslashes,arguments);return void 0!==r?r:t.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\"/g,'\\"')},e.capitalize=function(t){var r=o.apply(e.capitalize,arguments);return void 0!==r?r:t.toString().charAt(0).toUpperCase()+t.toString().substr(1).toLowerCase()},e.date=function(e,t,n,o){var a,i=t.length,s=new r.DateZ(e),c=0,l="";for(n&&s.setTimezoneOffset(n,o);c<i;c+=1)"\\"===(a=t.charAt(c))?l+=(c+=1)<i?t.charAt(c):a:r.hasOwnProperty(a)?l+=r[a](s,n,o):l+=a;return l},e.default=function(e,t){return void 0===e||!e&&"number"!=typeof e?t:e},e.escape=function(t,r){var n,a=o.apply(e.escape,arguments),i=t,s=0;if(void 0!==a)return a;if("string"!=typeof t)return t;if(a="","js"===r){for(i=i.replace(/\\/g,"\\u005C");s<i.length;s+=1)a+=(n=i.charCodeAt(s))<32?"\\u00"+(n=(n=n.toString(16).toUpperCase()).length<2?"0"+n:n):i[s];return a.replace(/&/g,"\\u0026").replace(/</g,"\\u003C").replace(/>/g,"\\u003E").replace(/\'/g,"\\u0027").replace(/"/g,"\\u0022").replace(/\=/g,"\\u003D").replace(/-/g,"\\u002D").replace(/;/g,"\\u003B")}return i.replace(/&(?!amp;|lt;|gt;|quot;|#39;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},e.e=e.escape,e.first=function(e){return"object"!=typeof e||t.isArray(e)?"string"==typeof e?e.substr(0,1):e[0]:e[t.keys(e)[0]]},e.groupBy=function(e,r){if(!t.isArray(e))return e;var n={};return t.each(e,function(e){if(e.hasOwnProperty(r)){var o=e[r],a=t.extend({},e);delete a[r],n[o]||(n[o]=[]),n[o].push(a)}}),n},e.join=function(e,r){if(t.isArray(e))return e.join(r);if("object"==typeof e){var n=[];return t.each(e,function(e){n.push(e)}),n.join(r)}return e},e.json=function(e,t){return JSON.stringify(e,null,t||0)},e.json_encode=e.json,e.last=function(e){if("object"==typeof e&&!t.isArray(e)){var r=t.keys(e);return e[r[r.length-1]]}return"string"==typeof e?e.charAt(e.length-1):e[e.length-1]},e.length=function(e){return"object"!=typeof e||t.isArray(e)?e.hasOwnProperty("length")?e.length:"":t.keys(e).length},e.lower=function(t){var r=o.apply(e.lower,arguments);return void 0!==r?r:t.toString().toLowerCase()},e.raw=function(t){return e.safe(t)},e.raw.safe=!0,e.replace=function(e,t,r,n){var o=new RegExp(t,n);return e.replace(o,r)},e.reverse=function(t){return e.sort(t,!0)},e.safe=function(e){return e},e.safe.safe=!0,e.sort=function(e,r){var n;if(t.isArray(e))n=t.extend([],e).sort();else switch(typeof e){case"object":n=t.keys(e).sort();break;case"string":return n=e.split(""),r?n.reverse().join(""):n.sort().join("")}return n&&r?n.reverse():n||e},e.striptags=function(t){var r=o.apply(e.striptags,arguments);return void 0!==r?r:t.toString().replace(/(<([^>]+)>)/gi,"")},e.title=function(t){var r=o.apply(e.title,arguments);return void 0!==r?r:t.toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},e.uniq=function(e){var r;return e&&t.isArray(e)?(r=[],t.each(e,function(e){-1===r.indexOf(e)&&r.push(e)}),r):""},e.upper=function(t){var r=o.apply(e.upper,arguments);return void 0!==r?r:t.toString().toUpperCase()},e.url_encode=function(t){var r=o.apply(e.url_encode,arguments);return void 0!==r?r:encodeURIComponent(t)},e.url_decode=function(t){var r=o.apply(e.url_decode,arguments);return void 0!==r?r:decodeURIComponent(t)}}}),d=t({"lib/tags/filter.js"(e){var t=y(),r=o(),n=c();e.compile=function(e,t,n,o,a,i,s){var c=t.shift().replace(/\($/,""),l=e(n,o,a,i);")"===t[t.length-1]&&t.pop();var u=s&&s.irExpr?s.irExpr:t.length?t:void 0;return r.filter(c,[r.legacyJS(l)],u)},e.lowerExpr=function(e,t){for(var r=0;r<t.length&&t[r].type===n.WHITESPACE;)r+=1;if(!(r>=t.length)){var o=t[r];if(o.type!==n.VAR){if(o.type===n.FUNCTIONEMPTY)return[];if(o.type===n.FUNCTION){var a,i=1,s=r+1,c=[];for(a=r+1;a<t.length;a+=1){var l=t[a];if(l.type===n.FILTER||l.type===n.FILTEREMPTY)return;if(l.type!==n.PARENOPEN&&l.type!==n.FUNCTION&&l.type!==n.BRACKETOPEN&&l.type!==n.CURLYOPEN){if(l.type!==n.PARENCLOSE&&l.type!==n.BRACKETCLOSE&&l.type!==n.CURLYCLOSE)l.type===n.COMMA&&1===i&&(c.push(t.slice(s,a)),s=a+1);else if(0===(i-=1)){a>s&&c.push(t.slice(s,a));break}}else i+=1}if(0===i){var u=[];for(a=0;a<c.length;a+=1)u.push(e.parseExpr(c[a]));return u}}}}},e.parse=function(e,r,n,o){var a;function i(e){if(!t.hasOwnProperty(e))throw new Error('Filter "'+e+'" does not exist on line '+r+".")}return n.on(o.FUNCTION,function(e){return!!a||(i(a=e.match.replace(/\($/,"")),this.out.push(e.match),void this.state.push(e.type))}),n.on(o.VAR,function(e){return!!a||(i(a=e.match),void this.out.push(a))}),!0},e.ends=!0}}),m=t({"packages/swig-core/lib/security.js"(e){e.dangerousProps=["__proto__","constructor","prototype"]}}),E=t({"lib/tags/for.js"(e){var t=o(),r=c(),n=m().dangerousProps;e.compile=function(e,r,n,o,a,i,s){var c,l=r.shift(),u="__k";r[0]&&","===r[0]&&(r.shift(),u=l,l=r.shift()),c=s&&s.irExpr?s.irExpr:r.join("");var p=e(n,o,a,i);return t.forStmt(l,c,[t.legacyJS(p)],u)},e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.COMPARATOR&&"in"===t[n].match){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY)return;return e.parseExpr(a)}},e.parse=function(e,t,r,o){var a,i;return r.on(o.NUMBER,function(e){var r=this.state.length?this.state[this.state.length-1]:null;if(!i||r!==o.ARRAYOPEN&&r!==o.CURLYOPEN&&r!==o.CURLYCLOSE&&r!==o.FUNCTION&&r!==o.FILTER)throw new Error('Unexpected number "'+e.match+'" on line '+t+".");return!0}),r.on(o.VAR,function(e){if(i&&a)return!0;if(-1!==e.match.indexOf("."))throw new Error('Loop variable "'+e.match+'" must be a bare identifier in "for" tag on line '+t+".");if(-1!==n.indexOf(e.match))throw new Error('Unsafe loop variable "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.length||(a=!0),this.out.push(e.match)}),r.on(o.COMMA,function(e){if(!a||this.prevToken.type!==o.VAR)return!0;this.out.push(e.match)}),r.on(o.COMPARATOR,function(e){if("in"!==e.match||!a)throw new Error('Unexpected token "'+e.match+'" on line '+t+".");i=!0,this.filterApplyIdx.push(this.out.length)}),!0},e.ends=!0}}),v=t({"packages/swig-core/lib/backend.js"(e){var t=r(),n=m(),a=o();function i(e){return e.replace(/\\/g,"\\\\").replace(/\n|\r/g,"\\n").replace(/"/g,'\\"')}function s(e){return{dangerousProps:(e=e||{}).dangerousProps||n.dangerousProps,throwError:e.throwError||t.throwError}}function c(e,r){switch(e&&"string"==typeof e.type||r.throwError("emitExpr: expected an IR expression node"),e.type){case"Literal":return function(e,t){switch(e.kind){case"string":return JSON.stringify(e.value);case"number":return String(e.value);case"bool":return e.value?"true":"false";case"null":return"null";case"undefined":return"undefined"}t.throwError('emitLiteral: unknown literal kind "'+e.kind+'"')}(e,r);case"VarRef":return function(e,r){t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRef: path must be a non-empty array");return t.each(e.path,function(t){l(t,r,e)}),f(e.path)}(e,r);case"VarRefExists":return u(e,r);case"Access":return function(e,t){e.key&&"Literal"===e.key.type&&"string"===e.key.kind&&l(e.key.value,t,e);return c(e.object,t)+"["+c(e.key,t)+"]"}(e,r);case"BinaryOp":return function(e,t){var r=c(e.left,t),n=c(e.right,t);if(o=e.op,"+"===o||"-"===o||"*"===o||"/"===o||"%"===o)return r+" "+e.op+" "+n;var o;if("in"===e.op)return r+" in "+n;if("~"===e.op)return"(String("+r+") + String("+n+"))";if("??"===e.op&&e.left&&"VarRef"===e.left.type){return"("+u(a.varRefExists(e.left.path,e.left.loc),t)+" ? "+r+" : "+n+")"}return r+e.op+n}(e,r);case"UnaryOp":return function(e,t){var r=c(e.operand,t);e.operand&&"BinaryOp"===e.operand.type&&(r="("+r+")");return e.op+r}(e,r);case"Conditional":return function(e,t){return"("+c(e.test,t)+" ? "+c(e.then,t)+" : "+c(e.else,t)+")"}(e,r);case"ArrayLiteral":return function(e,r){var n=[];return t.each(e.elements,function(e){n.push(c(e,r))}),"["+n.join(", ")+"]"}(e,r);case"ObjectLiteral":return function(e,r){var n=[];return t.each(e.properties,function(e){n.push(c(e.key,r)+":"+c(e.value,r))}),"{"+n.join(", ")+"}"}(e,r);case"FnCall":return function(e,r){var n,o,a,i=[],s=e.callee;if(t.each(e.args,function(e){i.push(c(e,r))}),a=i.join(", "),s&&"VarRef"===s.type&&t.isArray(s.path))return t.each(s.path,function(e){l(e,r,s)}),1===s.path.length?"((typeof _ctx."+(n=s.path[0])+' !== "undefined") ? _ctx.'+n+" : ((typeof "+n+' !== "undefined") ? '+n+" : _fn))("+a+")":(o=s.path.slice(0,-1),"("+f(s.path)+" || _fn).call("+f(o)+(a?", "+a:"")+")");return"("+c(s,r)+")("+a+")"}(e,r);case"FilterCall":return function(e,r){var n=c(e.input,r),o="";if(e.args&&e.args.length){var a=[];t.each(e.args,function(e){a.push(c(e,r))}),o=", "+a.join(", ")}return'_filters["'+e.name+'"]('+n+o+")"}(e,r)}r.throwError('emitExpr: unknown IR expression type "'+e.type+'"')}function l(e,t,r){if(-1!==t.dangerousProps.indexOf(e)){var n=r&&r.loc&&r.loc.line||void 0,o=r&&r.loc&&r.loc.filename||void 0;t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',n,o)}}function u(e,r){return t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRefExists: path must be a non-empty array"),t.each(e.path,function(t){l(t,r,e)}),"("+p(e.path,"_ctx.")+" || "+p(e.path,"")+")"}function p(e,r){var n=r+e[0],o="";return o="(typeof "+n+' !== "undefined" && '+n+" !== null",t.each(e,function(e,t){0!==t&&(o+=" && "+n+"."+e+" !== undefined && "+n+"."+e+" !== null",n+="."+e)}),o+=")"}function f(e){var t;function r(t){return"("+p(e,t)+" ? "+t+e.join(".")+' : "")'}return"("+(t="("+p(e,"_ctx.")+" ? "+r("_ctx.")+" : "+r("")+")")+" !== null ? "+t+' : "" )'}e.compile=function(r,n,o,c){var u="",p=t.isArray(r)?r:r.tokens,f=[];return t.each(p,function(r){if("string"!=typeof r)if(r&&"object"==typeof r&&"string"==typeof r.type&&"function"!=typeof r.compile)f.push(r);else{var i=r.compile(e.compile,r.args?r.args.slice(0):[],r.content?r.content.slice(0):[],n,o,c,r);null!=i&&""!==i&&("string"!=typeof i?t.isArray(i)?t.each(i,function(e){f.push(e)}):"object"!=typeof i||"string"!=typeof i.type?f.push(a.legacyJS(String(i))):f.push(i):f.push(a.legacyJS(i)))}else f.push(a.text(r))}),t.each(f,function(r){if("Text"!==r.type&&"Raw"!==r.type)if("LegacyJS"!==r.type)if("Autoescape"!==r.type){if("If"===r.type){var n="";return t.each(r.branches,function(r,o){var a,s="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(s+='_output += "'+i(e.value)+'";\n'):s+=e.js}),null!==r.test?(a=r.test&&"object"==typeof r.test&&"LegacyJS"===r.test.type?r.test.js:"object"==typeof r.test&&"string"==typeof r.test.type?e.emitExpr(r.test):r.test,n+=0===o?"if ("+a+") { \n"+s:"} else if ("+a+") {\n"+s):n+="} else {\n"+s}),void(u+=n+"\n}")}if("Set"===r.type){var o,a;if(r.target&&"object"==typeof r.target&&"VarRef"===r.target.type){var c=s();t.isArray(r.target.path)&&0!==r.target.path.length||c.throwError("Set: target VarRef must have a non-empty path"),t.each(r.target.path,function(e){l(e,c,r.target)}),o="_ctx."+r.target.path.join(".")}else o=r.target;return a=r.value&&"object"==typeof r.value&&"string"==typeof r.value.type?e.emitExpr(r.value):r.value,void(u+=o+" "+r.op+" "+a+";\n")}if("For"===r.type){var p,f=r.value,h=r.key,g="",y=("_ctx.__loopcache"+Math.random()).replace(/\./g,""),d="_ctx.",m="_ctx.loop";return p=r.iterable&&"object"==typeof r.iterable&&"string"==typeof r.iterable.type?e.emitExpr(r.iterable):r.iterable,t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(g+='_output += "'+i(e.value)+'";\n'):g+=e.js}),void(u+="(function () {\n var __l = "+p+', __len = (_utils.isArray(__l) || typeof __l === "string") ? __l.length : _utils.keys(__l).length;\n if (!__l) { return; }\n var '+y+" = { loop: "+m+", "+f+": "+d+f+", "+h+": "+d+h+" };\n "+m+" = { first: false, index: 1, index0: 0, revindex: __len, revindex0: __len - 1, length: __len, last: false };\n _utils.each(__l, function ("+f+", "+h+") {\n "+d+f+" = "+f+";\n "+d+h+" = "+h+";\n "+m+".key = "+h+";\n "+m+".first = ("+m+".index0 === 0);\n "+m+".last = ("+m+".revindex0 === 0);\n "+g+" "+m+".index += 1; "+m+".index0 += 1; "+m+".revindex -= 1; "+m+".revindex0 -= 1;\n });\n "+m+" = "+y+".loop;\n "+d+f+" = "+y+"."+f+";\n "+d+h+" = "+y+"."+h+";\n "+y+" = undefined;\n})();\n")}if("Macro"!==r.type)if("Parent"!==r.type)if("Block"!==r.type){var E,v,x;if("Include"===r.type)return E=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path,void 0!==r.context&&(v="object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context),x=r.isolated&&v?v:v?"_utils.extend({}, _ctx, "+v+")":"_ctx",void(u+=(r.ignoreMissing?" try {\n":"")+"_output += _swig.compileFile("+E+', {resolveFrom: "'+r.resolveFrom+'"})('+x+");\n"+(r.ignoreMissing?"} catch (e) {}\n":""));if("With"===r.type){var O;void 0!==r.context&&(O=r.context&&"object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context);var w,C="";return t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(C+='_output += "'+i(e.value)+'";\n'):C+=e.js}),w=r.isolated?void 0!==O?O:"{}":void 0!==O?"_utils.extend({}, _ctx, "+O+")":"_utils.extend({}, _ctx)",void(u+="(function (_ctx) {\n"+C+"})("+w+");\n")}if("Output"===r.type){if(r.expr&&"LegacyJS"===r.expr.type)return void(u+=r.expr.js);var T=e.emitExpr(r.expr);return r.filters&&r.filters.length&&t.each(r.filters,function(r){var n="";if(r.args&&r.args.length){var o=[];t.each(r.args,function(t){o.push(e.emitExpr(t))}),n=", "+o.join(", ")}T='_filters["'+r.name+'"]('+T+n+")"}),void(u+="_output += "+T+";\n")}if("Filter"!==r.type);else{var b="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(b+='_output += "'+i(e.value)+'";\n'):b+=e.js});var R='(function () {\n var _output = "";\n'+b+" return _output;\n})()",A="";if(r.args&&r.args.length){var N=[];t.each(r.args,function(t){t&&"object"==typeof t&&"string"==typeof t.type?N.push(e.emitExpr(t)):N.push(t)}),A=", "+N.join(", ")}u+='_output += _filters["'+r.name+'"]('+R+A+");\n"}}else t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else t.each(r.body||[],function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else{var P="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(P+='_output += "'+i(e.value)+'";\n'):P+=e.js});var k,L,S=r.params||[];if(S.length&&"object"==typeof S[0]&&null!==S[0]&&"string"==typeof S[0].name){var I=[];t.each(S,function(e){I.push(e.name)}),k=I.join(", ");var U=[];t.each(I,function(e){U.push(JSON.stringify(e))}),L=U.join(",")}else k=S.join(""),L='"'+S.join('","')+'"';u+="_ctx."+r.name+" = function ("+k+') {\n var _output = "",\n __ctx = _utils.extend({}, _ctx);\n _utils.each(_ctx, function (v, k) {\n if (['+L+"].indexOf(k) !== -1) { delete _ctx[k]; }\n });\n"+P+"\n _ctx = _utils.extend(_ctx, __ctx);\n return _output;\n};\n_ctx."+r.name+".safe = true;\n"}}else t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else u+=r.js;else u+='_output += "'+i(r.value)+'";\n'}),u},e.emitExpr=function(e,t){return c(e,s(t))}}}),x=t({"lib/lexer.js"(e){var t=n(),r=c(),o=[{type:r.WHITESPACE,regex:[/^\s+/]},{type:r.STRING,regex:[/^""/,/^".*?[^\\]"/,/^''/,/^'.*?[^\\]'/]},{type:r.FILTER,regex:[/^\|\s*(\w+)\(/],idx:1},{type:r.FILTEREMPTY,regex:[/^\|\s*(\w+)/],idx:1},{type:r.FUNCTIONEMPTY,regex:[/^\s*(\w+)\(\)/],idx:1},{type:r.FUNCTION,regex:[/^\s*(\w+)\(/],idx:1},{type:r.PARENOPEN,regex:[/^\(/]},{type:r.PARENCLOSE,regex:[/^\)/]},{type:r.COMMA,regex:[/^,/]},{type:r.LOGIC,regex:[/^(&&|\|\|)\s*/,/^(and|or)\s+/],idx:1,replace:{and:"&&",or:"||"}},{type:r.COMPARATOR,regex:[/^(===|==|\!==|\!=|<=|<|>=|>|in\s|gte\s|gt\s|lte\s|lt\s)\s*/],idx:1,replace:{gte:">=",gt:">",lte:"<=",lt:"<"}},{type:r.ASSIGNMENT,regex:[/^(=|\+=|-=|\*=|\/=)/]},{type:r.NOT,regex:[/^\!\s*/,/^not\s+/],replace:{not:"!"}},{type:r.BOOL,regex:[/^(true|false)\s+/,/^(true|false)$/],idx:1},{type:r.VAR,regex:[/^[a-zA-Z_$]\w*((\.\$?\w*)+)?/,/^[a-zA-Z_$]\w*/]},{type:r.BRACKETOPEN,regex:[/^\[/]},{type:r.BRACKETCLOSE,regex:[/^\]/]},{type:r.CURLYOPEN,regex:[/^\{/]},{type:r.COLON,regex:[/^\:/]},{type:r.CURLYCLOSE,regex:[/^\}/]},{type:r.DOTKEY,regex:[/^\.(\w+)/],idx:1},{type:r.NUMBER,regex:[/^[+\-]?\d+(\.\d+)?/]},{type:r.OPERATOR,regex:[/^(\+|\-|\/|\*|%)/]}];function a(e){var n;return t.some(o,function(r){return t.some(r.regex,function(t){var o,a=e.match(t);if(a)return o=a[r.idx||0].replace(/\s*$/,""),o=r.hasOwnProperty("replace")&&r.replace.hasOwnProperty(o)?r.replace[o]:o,n={match:o,type:r.type,length:a[0].length},!0})}),n||(n={match:e,type:r.UNKNOWN,length:e.length}),n}e.types=r,e.read=function(e){for(var t,r=0,n=[];r<e.length;)r+=(t=a(e.substring(r))).length,n.push(t);return n}}}),O=t({"packages/swig-core/lib/tokenparser.js"(e){var t=r(),n=c(),a=o(),i=m().dangerousProps,s=["break","case","catch","continue","debugger","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","this","throw","try","typeof","var","void","while","with"];function l(e,r,o,a,i){this.out=[],this.state=[],this.filterApplyIdx=[],this._parsers={},this.line=a,this.filename=i,this.filters=r,this.escape=o,this.parse=function(){var r=this;return r._parsers.start&&r._parsers.start.call(r),t.each(e,function(t,o){var a=e[o-1];if(r.isLast=o===e.length-1,a)for(;a.type===n.WHITESPACE;)a=e[(o-=1)-1];r.prevToken=a,r.parseToken(t)}),r._parsers.end&&r._parsers.end.call(r),r.escape&&(r.filterApplyIdx=[0],"string"==typeof r.escape?(r.parseToken({type:n.FILTER,match:"e"}),r.parseToken({type:n.COMMA,match:","}),r.parseToken({type:n.STRING,match:String(o)}),r.parseToken({type:n.PARENCLOSE,match:")"})):r.parseToken({type:n.FILTEREMPTY,match:"e"})),r.out}}l.prototype={on:function(e,t){this._parsers[e]=t},parseToken:function(e){var r,o=this,a=o._parsers[e.type]||o._parsers["*"],s=e.match,c=o.prevToken,l=c?c.type:null,u=o.state.length?o.state[o.state.length-1]:null;if(!a||"function"!=typeof a||a.call(this,e))switch(u&&c&&u===n.FILTER&&l===n.FILTER&&e.type!==n.PARENCLOSE&&e.type!==n.COMMA&&e.type!==n.OPERATOR&&e.type!==n.FILTER&&e.type!==n.FILTEREMPTY&&o.out.push(", "),u&&u===n.METHODOPEN&&(o.state.pop(),e.type!==n.PARENCLOSE&&o.out.push(", ")),e.type){case n.WHITESPACE:break;case n.STRING:if(u===n.BRACKETOPEN){var p=s.replace(/^['"]|['"]$/g,"");-1!==i.indexOf(p)&&t.throwError('Unsafe access to "'+p+'" via bracket notation is not allowed in templates (CVE-2023-25345)',o.line,o.filename)}o.filterApplyIdx.push(o.out.length),o.out.push(s.replace(/\\/g,"\\\\"));break;case n.NUMBER:case n.BOOL:o.filterApplyIdx.push(o.out.length),o.out.push(s);break;case n.FILTER:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.state.push(e.type);break;case n.FILTEREMPTY:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.out.push(")");break;case n.FUNCTION:case n.FUNCTIONEMPTY:o.out.push("((typeof _ctx."+s+' !== "undefined") ? _ctx.'+s+" : ((typeof "+s+' !== "undefined") ? '+s+" : _fn))("),o.escape=!1,e.type===n.FUNCTIONEMPTY?o.out[o.out.length-1]=o.out[o.out.length-1]+")":o.state.push(e.type),o.filterApplyIdx.push(o.out.length-1);break;case n.PARENOPEN:o.state.push(e.type),o.filterApplyIdx.length?(o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,"("),c&&l===n.VAR?(r=c.match.split(".").slice(0,-1),o.out.push(" || _fn).call("+o.checkMatch(r)),o.state.push(n.METHODOPEN),o.escape=!1):o.out.push(" || _fn)("),o.filterApplyIdx.push(o.out.length-3)):(o.out.push("("),o.filterApplyIdx.push(o.out.length-1));break;case n.PARENCLOSE:(r=o.state.pop())!==n.PARENOPEN&&r!==n.FUNCTION&&r!==n.FILTER&&t.throwError("Mismatched nesting state",o.line,o.filename),o.out.push(")"),o.filterApplyIdx.pop(),r!==n.FILTER&&o.filterApplyIdx.pop();break;case n.COMMA:u!==n.FUNCTION&&u!==n.FILTER&&u!==n.ARRAYOPEN&&u!==n.CURLYOPEN&&u!==n.PARENOPEN&&u!==n.COLON&&t.throwError("Unexpected comma",o.line,o.filename),u===n.COLON&&o.state.pop(),o.out.push(", "),o.filterApplyIdx.pop();break;case n.LOGIC:case n.COMPARATOR:c&&l!==n.COMMA&&l!==e.type&&l!==n.BRACKETOPEN&&l!==n.CURLYOPEN&&l!==n.PARENOPEN&&l!==n.FUNCTION||t.throwError("Unexpected logic",o.line,o.filename),o.out.push(e.match);break;case n.NOT:o.out.push(e.match);break;case n.VAR:o.parseVar(e,s,u);break;case n.BRACKETOPEN:!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.PARENCLOSE?(o.state.push(n.ARRAYOPEN),o.filterApplyIdx.push(o.out.length)):o.state.push(e.type),o.out.push("[");break;case n.BRACKETCLOSE:(r=o.state.pop())!==n.BRACKETOPEN&&r!==n.ARRAYOPEN&&t.throwError("Unexpected closing square bracket",o.line,o.filename),o.out.push("]"),o.filterApplyIdx.pop();break;case n.CURLYOPEN:o.state.push(e.type),o.out.push("{"),o.filterApplyIdx.push(o.out.length-1);break;case n.COLON:u!==n.CURLYOPEN&&t.throwError("Unexpected colon",o.line,o.filename),o.state.push(e.type),o.out.push(":"),o.filterApplyIdx.pop();break;case n.CURLYCLOSE:u===n.COLON&&o.state.pop(),o.state.pop()!==n.CURLYOPEN&&t.throwError("Unexpected closing curly brace",o.line,o.filename),o.out.push("}"),o.filterApplyIdx.pop();break;case n.DOTKEY:(!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.DOTKEY&&l!==n.PARENCLOSE&&l!==n.FUNCTIONEMPTY&&l!==n.FILTEREMPTY&&l!==n.CURLYCLOSE)&&t.throwError('Unexpected key "'+s+'"',o.line,o.filename),-1!==i.indexOf(s)&&t.throwError('Unsafe access to "'+s+'" is not allowed in templates (CVE-2023-25345)',o.line,o.filename),o.out.push("."+s);break;case n.OPERATOR:o.out.push(" "+s+" "),o.filterApplyIdx.pop()}},parseVar:function(e,r,o){var a=this;if(r=r.split("."),-1!==s.indexOf(r[0])&&t.throwError('Reserved keyword "'+r[0]+'" attempted to be used as a variable',a.line,a.filename),t.each(r,function(e){-1!==i.indexOf(e)&&t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',a.line,a.filename)}),a.filterApplyIdx.push(a.out.length),o===n.CURLYOPEN)return r.length>1&&t.throwError("Unexpected dot",a.line,a.filename),void a.out.push(r[0]);a.out.push(a.checkMatch(r))},parseExpr:function(e,r){var o=this,c=0;function l(){return function(){for(;c<e.length&&e[c].type===n.WHITESPACE;)c+=1}(),c<e.length?e[c]:null}function u(){var e=l();return e&&(c+=1),e}function p(e){t.throwError(e,o.line,o.filename)}function f(e){-1!==i.indexOf(e)&&p('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)')}function h(e){-1!==i.indexOf(e)&&p('Unsafe access to "'+e+'" via bracket notation is not allowed in templates (CVE-2023-25345)')}function g(e){var t;if(e.type===n.LOGIC){if("||"===e.match)return{op:"||",prec:1};if("&&"===e.match)return{op:"&&",prec:2}}if(e.type===n.COMPARATOR)return"==="===(t=e.match)||"!=="===t||"=="===t||"!="===t?{op:t,prec:3}:{op:t,prec:4};if(e.type===n.OPERATOR){if("+"===(t=e.match)||"-"===t)return{op:t,prec:5};if("*"===t||"/"===t||"%"===t)return{op:t,prec:6}}return null}function y(e){return e.replace(/^['"]|['"]$/g,"")}function d(e){var t=[],r=l();if(r&&r.type===e)return u(),t;for(;;){t.push(x(0));var o=u();if(o||p("Unexpected end of expression"),o.type===e)break;o.type!==n.COMMA&&p("Expected comma or closing delimiter")}return t}function m(e){for(;;){var t=l();if(!t)break;if(t.type===n.DOTKEY)u(),f(t.match),e="VarRef"===e.type?a.varRef(e.path.concat([t.match])):a.access(e,a.literal("string",t.match));else if(t.type===n.BRACKETOPEN){u();var r=x(0);"Literal"===r.type&&"string"===r.kind&&h(r.value);var i=u();i&&i.type===n.BRACKETCLOSE||p("Unexpected closing square bracket"),e=a.access(e,r)}else if(t.type===n.PARENOPEN)u(),e=a.fnCall(e,d(n.PARENCLOSE));else{if(t.type!==n.FILTER&&t.type!==n.FILTEREMPTY)break;u();var s,c=t.match;o.filters.hasOwnProperty(c)&&"function"==typeof o.filters[c]||p('Invalid filter "'+c+'"'),t.type===n.FILTER&&(s=d(n.PARENCLOSE)),e=a.filterCallExpr(c,e,s)}}return e}function E(){var e,r=u();switch(r||p("Unexpected end of expression"),r.type){case n.STRING:return a.literal("string",y(r.match));case n.NUMBER:return a.literal("number",parseFloat(r.match));case n.BOOL:return a.literal("bool","true"===r.match);case n.NOT:return a.unaryOp("!",v());case n.OPERATOR:if("+"===(e=r.match)||"-"===e)return a.unaryOp(e,v());p('Unexpected operator "'+e+'"');break;case n.PARENOPEN:var o=x(0),i=u();return i&&i.type===n.PARENCLOSE||p("Mismatched nesting state"),m(o);case n.BRACKETOPEN:return m(a.arrayLiteral(d(n.BRACKETCLOSE)));case n.CURLYOPEN:return m(function(){var e=[],t=l();if(t&&t.type===n.CURLYCLOSE)return u(),a.objectLiteral([]);for(;;){var r,o=u();o||p("Unclosed object literal"),o.type===n.STRING?r=a.literal("string",y(o.match)):o.type===n.VAR?(-1!==o.match.indexOf(".")&&p("Unexpected dot"),r=a.literal("string",o.match)):o.type===n.NUMBER?r=a.literal("number",parseFloat(o.match)):p("Unexpected object key");var i=u();i&&i.type===n.COLON||p("Unexpected colon");var s=x(0);e.push(a.objectProperty(r,s));var c=u();if(c||p("Unclosed object literal"),c.type===n.CURLYCLOSE)break;c.type!==n.COMMA&&p("Expected comma or closing curly brace")}return a.objectLiteral(e)}());case n.VAR:var c=r.match.split(".");return-1!==s.indexOf(c[0])&&p('Reserved keyword "'+c[0]+'" attempted to be used as a variable'),t.each(c,function(e){f(e)}),m(a.varRef(c));case n.FUNCTION:case n.FUNCTIONEMPTY:return e=r.match,-1!==s.indexOf(e)&&p('Reserved keyword "'+e+'" attempted to be used as a variable'),f(e),r.type===n.FUNCTIONEMPTY?m(a.fnCall(a.varRef([e]),[])):m(a.fnCall(a.varRef([e]),d(n.PARENCLOSE)))}return p('Unexpected token "'+r.match+'"'),null}function v(){return E()}function x(e){for(var t=v();;){var r=l();if(!r)break;if(r.type===n.FILTER||r.type===n.FILTEREMPTY)break;var o=g(r);if(!o||o.prec<e)break;u();var i=x(o.prec+1);t=a.binaryOp(o.op,t,i)}return t}var O=x(0);return r&&(r.pos=c),O},parseOutput:function(e){var r=this;function o(){var e=r.parse().join("");return a.output(a.legacyJS("_output += "+e+";\n"))}var i,s,c=!1;for(i=0;i<e.length;i+=1)if(e[i].type!==n.WHITESPACE){c=!0;break}if(!c)return o();if("string"==typeof r.escape)return o();var l=0,u=!1,p=!1,f=-1;for(i=0;i<e.length;i+=1)s=e[i],0===l&&(s.type!==n.OPERATOR&&s.type!==n.LOGIC&&s.type!==n.COMPARATOR&&s.type!==n.NOT||(u=!0),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||(p=!0,f<0&&(f=i))),s.type===n.PARENOPEN||s.type===n.FUNCTION||s.type===n.BRACKETOPEN||s.type===n.CURLYOPEN||s.type===n.FILTER?l+=1:s.type!==n.PARENCLOSE&&s.type!==n.BRACKETCLOSE&&s.type!==n.CURLYCLOSE||(l-=1);if(0===f)return o();try{var h=r.escape;for(i=0;i<e.length;i+=1)if((s=e[i]).type!==n.FUNCTION&&s.type!==n.FUNCTIONEMPTY||(h=!1),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||r.filters.hasOwnProperty(s.match)&&"function"==typeof r.filters[s.match]&&r.filters[s.match].safe&&(h=!1),s.type===n.PARENOPEN){for(var g=i-1;g>=0&&e[g].type===n.WHITESPACE;)g-=1;g>=0&&e[g].type===n.VAR&&(h=!1)}if(u&&p){var y=r.parseExpr(e),d=h?[a.filterCall("e")]:[];return a.output(y,d.length>0?d:void 0)}var m=f>=0?f:e.length,E=e.slice(0,m),v={pos:0},x=r.parseExpr(E,v),O=!1;for(i=v.pos;i<E.length;i+=1)if(E[i].type!==n.WHITESPACE){O=!0;break}if(O)return o();var w=[];if(f>=0)for(var C=f;C<e.length;){var T=e[C];if(T.type!==n.WHITESPACE)if(T.type!==n.FILTEREMPTY)if(T.type!==n.FILTER)t.throwError('Unexpected token "'+T.match+'"',r.line,r.filename);else{r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(h=!1);for(var b=1,R=C+1,A=C+1;A<e.length&&b>0;){var N=e[A];if(N.type===n.PARENOPEN||N.type===n.FUNCTION||N.type===n.BRACKETOPEN||N.type===n.CURLYOPEN||N.type===n.FILTER)b+=1;else if((N.type===n.PARENCLOSE||N.type===n.BRACKETCLOSE||N.type===n.CURLYCLOSE)&&0===(b-=1))break;A+=1}0!==b&&t.throwError('Unable to parse filter "'+T.match+'"',r.line,r.filename);var P,k=[],L=R,S=1;for(P=R;P<A;P+=1){var I=e[P];I.type===n.PARENOPEN||I.type===n.FUNCTION||I.type===n.BRACKETOPEN||I.type===n.CURLYOPEN||I.type===n.FILTER?S+=1:I.type===n.PARENCLOSE||I.type===n.BRACKETCLOSE||I.type===n.CURLYCLOSE?S-=1:I.type===n.COMMA&&1===S&&(k.push(e.slice(L,P)),L=P+1)}L<A&&k.push(e.slice(L,A));var U,_=[];for(U=0;U<k.length;U+=1){var F,j=k[U],M=!1;for(F=0;F<j.length;F+=1)if(j[F].type!==n.WHITESPACE){M=!0;break}M&&_.push(r.parseExpr(j))}w.push(a.filterCall(T.match,_)),C=A+1}else r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(h=!1),w.push(a.filterCall(T.match)),C+=1;else C+=1}return h&&w.push(a.filterCall("e")),a.output(x,w.length>0?w:void 0)}catch(e){return o()}},checkMatch:function(e){var r,n=e[0];function o(r){var o=r+n,a=e,i="";return i="(typeof "+o+' !== "undefined" && '+o+" !== null",t.each(a,function(e,t){0!==t&&(i+=" && "+o+"."+e+" !== undefined && "+o+"."+e+" !== null",o+="."+e)}),i+=")"}function a(t){return"("+o(t)+" ? "+t+e.join(".")+' : "")'}return"("+(r="("+o("_ctx.")+" ? "+a("_ctx.")+" : "+a("")+")")+" !== null ? "+r+' : "" )'}},e.TokenParser=l}}),w=t({"lib/parser.js"(e){var t=n(),r=x(),o=r.types,a=O().TokenParser;function i(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}e.parse=function(n,s,c,l,u){s=s.replace(/\r\n/g,"\n");var p,f=c.autoescape,h=c.tagControls[0],g=c.tagControls[1],y=c.varControls[0],d=c.varControls[1],m=i(h),E=i(g),v=i(y),x=i(d),O=new RegExp("^"+m+"-?\\s*-?|-?\\s*-?"+E+"$","g"),w=new RegExp("^"+m+"-"),C=new RegExp("-"+E+"$"),T=new RegExp("^"+v+"-?\\s*-?|-?\\s*-?"+x+"$","g"),b=new RegExp("^"+v+"-"),R=new RegExp("-"+x+"$"),A=c.cmtControls[0],N=c.cmtControls[1],P="[\\s\\S]*?",k=new RegExp("("+m+P+E+"|"+v+P+x+"|"+i(A)+P+i(N)+")"),L=1,S=[],I=null,U=[],_={},F=!1;function j(e,n){var o,i,s=r.read(t.strip(e));return i=(o=new a(s,u,f,n,c.filename)).parseOutput(s),o.state.length&&t.throwError('Unable to parse "'+e+'"',n,c.filename),i}function M(e){return"string"==typeof e&&(e=e.replace(/\s*$/,"")),e}return e.parseVariable=j,t.each(s.split(k),function(e){var i,s,m,E,v;if(e){if(!F&&t.startsWith(e,y)&&t.endsWith(e,d))m=b.test(e),p=R.test(e),i=j(e.replace(T,""),L);else if(t.startsWith(e,h)&&t.endsWith(e,g))m=w.test(e),p=C.test(e),(i=function(e,i){var s,p,h,g,y,d,m;if(t.startsWith(e,"end")){if((m=S[S.length-1])&&m.name===e.split(/\s+/)[0].replace(/^end/,"")&&m.ends){switch(m.name){case"autoescape":f=c.autoescape;break;case"raw":F=!1}return void S.pop()}F||t.throwError('Unexpected end of tag "'+e.replace(/^end/,"")+'"',i,c.filename)}if(!F){switch(g=(h=e.split(/\s+(.+)?/)).shift(),l.hasOwnProperty(g)||t.throwError('Unexpected tag "'+e+'"',i,c.filename),s=r.read(t.strip(h.join(" "))),p=new a(s,u,!1,i,c.filename),(y=l[g]).parse(h[1],i,p,o,S,c,n)||t.throwError('Unexpected tag "'+g+'"',i,c.filename),p.parse(),d=p.out,g){case"autoescape":f="false"!==d[0]&&d[0];break;case"raw":F=!0}var E;return"function"==typeof y.lowerExpr&&(E=y.lowerExpr(p,s,h[1],i)),{block:!!l[g].block,compile:y.compile,args:d,content:[],ends:y.ends,name:g,irExpr:E}}}(e.replace(O,""),L))&&("extends"===i.name?I=i.args.join("").replace(/^\'|\'$/g,"").replace(/^\"|\"$/g,""):i.block&&!S.length&&(_[i.args.join("")]=i)),F&&!i&&(i=e);else if(F||!t.startsWith(e,A)&&!t.endsWith(e,N))i=p?e.replace(/^\s*/,""):e,p=!1;else if(t.startsWith(e,A)&&t.endsWith(e,N))return;m&&U.length&&("string"==typeof(E=U.pop())?E=M(E):E.content&&E.content.length&&(v=M(E.content.pop()),E.content.push(v)),U.push(E)),i&&(S.length?S[S.length-1].content.push(i):U.push(i),i.name&&i.ends&&S.push(i),s=e.match(/\n/g),L+=s?s.length:0)}}),{name:c.filename,parent:I,tokens:U,blocks:_}},e.compile=v().compile}}),C=t({"lib/tags/import.js"(e){var t=n(),r=v(),o=m().dangerousProps;e.compile=function(e,r){var n=r.pop(),o=t.map(r,function(e){return e.name}).join("|"),a="_ctx."+n+' = {};\n var _output = "";\n',i=t.map(r,function(e){return{ex:new RegExp("_ctx."+e.name+"(\\W)(?!"+o+")","g"),re:"_ctx."+n+"."+e.name+"$1"}});return t.each(r,function(e){var r=e.compiled;t.each(i,function(e){r=r.replace(e.ex,e.re)}),a+=r}),a},e.parse=function(e,n,a,i,s,c,l){var u,p,f=w().compile,h={resolveFrom:c.filename},g=t.extend({},c,h);return a.on(i.STRING,function(e){var o=this;if(!u)return u=l.parseFile(e.match.replace(/^("|')|("|')$/g,""),h).tokens,void t.each(u,function(e){var t,n="";e&&"macro"===e.name&&e.compile&&(t=e.args[0],n+=r.compile([e.compile(f,e.args,e.content,[],g)],[],g)+"\n",o.out.push({compiled:n,name:t}))});throw new Error("Unexpected string "+e.match+" on line "+n+".")}),a.on(i.VAR,function(e){if(!u||p)throw new Error('Unexpected variable "'+e.match+'" on line '+n+".");if("as"!==e.match){if(-1!==o.indexOf(e.match))throw new Error('Unsafe import alias "'+e.match+'" is not allowed (CVE-2023-25345) on line '+n+".");return p=e.match,this.out.push(p),!1}}),!0},e.block=!0}}),T=t({"lib/tags/include.js"(e){var t=o(),r=c(),n="ignore",a="missing",i="only";e.compile=function(e,r,n,o,s,c,l){var u=r.shift(),p=r.indexOf(i),f=-1!==p&&r.splice(p,1),h=(r.pop()||"").replace(/\\/g,"\\\\"),g=r[r.length-1]===a&&r.pop(),y=r.join("");return l&&l.irExpr&&(u=l.irExpr.file,y=void 0!==l.irExpr.context?l.irExpr.context:void 0),t.include(u,y||void 0,!!f,!!g,h)},e.lowerExpr=function(e,t){var o,a,s=0,c=-1,l=-1,u=-1;for(o=0;o<t.length;o++){if((a=t[o]).type===r.FILTER||a.type===r.FILTEREMPTY)return;a.type!==r.PARENOPEN&&a.type!==r.BRACKETOPEN&&a.type!==r.ARRAYOPEN&&a.type!==r.CURLYOPEN&&a.type!==r.FUNCTION&&a.type!==r.METHODOPEN?a.type!==r.PARENCLOSE&&a.type!==r.BRACKETCLOSE&&a.type!==r.CURLYCLOSE?0===s&&a.type===r.VAR&&(-1===c&&"with"===a.match?c=o:-1!==c&&-1===l&&a.match===i?l=o:-1===u&&a.match===n&&(u=o)):s--:s++}var p=t.length;-1!==c?p=c:-1!==u&&(p=u);var f=t.slice(0,p);if(0!==f.length){var h={file:e.parseExpr(f)};if(-1!==c){var g=t.length;-1!==l?g=l:-1!==u&&(g=u);var y=t.slice(c+1,g);y.length>0&&(h.context=e.parseExpr(y))}return h}},e.parse=function(e,t,r,o,s,c){var l,u;return r.on(o.STRING,function(e){return!!l||(l=e.match,void this.out.push(l))}),r.on(o.VAR,function(e){if(!l)return l=e.match,!0;if(u||"with"!==e.match){if(!u||e.match!==i||"with"===this.prevToken.match){if(e.match===n)return!1;if(e.match===a){if(this.prevToken.match!==n)throw new Error('Unexpected token "'+a+'" on line '+t+".");return this.out.push(e.match),!1}if(this.prevToken.match===n)throw new Error('Expected "'+a+'" on line '+t+' but found "'+e.match+'".');return!0}this.out.push(e.match)}else u=!0}),r.on("end",function(){this.out.push(c.filename||null)}),!0}}}),b=t({"lib/tags/macro.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s=r.shift();return t.macro(s,r,[t.legacyJS(e(n,o,a,i))])};var r=m().dangerousProps;e.parse=function(e,t,n,o){var a;return n.on(o.VAR,function(e){if(-1!==e.match.indexOf("."))throw new Error('Unexpected dot in macro argument "'+e.match+'" on line '+t+".");if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");return a=e.match,void this.out.push(a)}if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro argument "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.push({name:e.match})}),n.on(o.FUNCTION,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a),this.state.push(o.FUNCTION)}}),n.on(o.FUNCTIONEMPTY,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a)}}),n.on(o.PARENCLOSE,function(){if(!this.isLast)throw new Error("Unexpected parenthesis close on line "+t+".")}),n.on(o.COMMA,function(){}),n.on("*",function(){}),!0},e.ends=!0,e.block=!0}}),R=t({"lib/tags/parent.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){if(!o||!o.length)return"";for(var s,c,l=r[0],u=o.length,p=0;p<u;p+=1)if((s=o[p]).blocks&&s.blocks.hasOwnProperty(i)&&l!==s.name){var f=(c=s.blocks[i]).compile(e,[i],c.content,o.slice(p+1),a);return t.parent(f&&f.body?f.body.concat([t.legacyJS("\n")]):[t.legacyJS("\n")])}},e.parse=function(e,t,r,n,o,a){return r.on("*",function(e){throw new Error('Unexpected argument "'+e.match+'" on line '+t+".")}),r.on("end",function(){this.out.push(a.filename)}),!0}}}),A=t({"lib/tags/raw.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s,c=[];for(s=0;s<n.length;s++)"string"==typeof n[s]?c.push(t.raw(n[s])):c.push(t.legacyJS(e([n[s]],o,a,i)));return c},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" in raw tag on line '+t+".")}),!0},e.ends=!0}}),N=t({"lib/tags/set.js"(e){var t=o(),r=c(),n=/^_ctx\.([a-zA-Z_$][\w$]*)((?:\.[a-zA-Z_$][\w$]*)*)$/;e.compile=function(e,r,o,a,i,s,c){var l=r[0],u="string"==typeof l&&n.exec(l);if(u){var p=[u[1]];if(u[2])for(var f=u[2].split("."),h=1;h<f.length;h++)p.push(f[h]);l=t.varRef(p)}var g=c&&c.irExpr?c.irExpr:r.slice(2).join(" ");return t.set(l,r[1],g)};var a=m().dangerousProps;e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.ASSIGNMENT){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY||a[n].type===r.ASSIGNMENT)return;return e.parseExpr(a)}},e.parse=function(e,t,r,n){var o,i="";return r.on(n.VAR,function(e){if(o)o+="_ctx."+e.match;else{if(r.out.length)return!0;for(var n=e.match.split("."),s=0;s<n.length;s++)if(-1!==a.indexOf(n[s]))throw new Error('Unsafe assignment to "'+n[s]+'" is not allowed (CVE-2023-25345) on line '+t+".");i+=e.match}}),r.on(n.BRACKETOPEN,function(e){if(o||this.out.length)return!0;o=e.match}),r.on(n.STRING,function(e){if(!o||this.out.length)return!0;var r=e.match.replace(/^['"]|['"]$/g,"");if(-1!==a.indexOf(r))throw new Error('Unsafe assignment to "'+r+'" via bracket notation is not allowed (CVE-2023-25345) on line '+t+".");o+=e.match}),r.on(n.BRACKETCLOSE,function(e){return!(o&&!this.out.length)||(i+=o+e.match,void(o=void 0))}),r.on(n.DOTKEY,function(e){if(!o&&!i)return!0;if(-1!==a.indexOf(e.match))throw new Error('Unsafe assignment to "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");i+="."+e.match}),r.on(n.ASSIGNMENT,function(e){if(this.out.length||!i)throw new Error('Unexpected assignment "'+e.match+'" on line '+t+".");this.out.push("_ctx."+i),this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),!0},e.block=!0}}),P=t({"lib/tags/spaceless.js"(e){n();e.compile=function(e,t,r,n,o,a){var i=e(r,n,o,a);return i+='_output = _output.replace(/^\\s+/, "")\n .replace(/>\\s+</g, "><")\n .replace(/\\s+$/, "");\n'},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" on line '+t+".")}),!0},e.ends=!0}}),k=t({"lib/tags/index.js"(e){e.autoescape=a(),e.block=i(),e.else=s(),e.elseif=u(),e.elif=e.elseif,e.extends=p(),e.filter=d(),e.for=E(),e.if=l(),e.import=C(),e.include=T(),e.macro=b(),e.parent=R(),e.raw=A(),e.set=N(),e.spaceless=P()}}),L=t({"browser/stubs/fs.js"(e,t){t.exports={}}}),S=t({"node_modules/path-browserify/index.js"(e,t){"use strict";function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var r,n="",o=0,a=-1,i=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(a===s-1||1===i);else if(a!==s-1&&2===i){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),a=s,i=0;continue}}else if(2===n.length||1===n.length){n="",o=0,a=s,i=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),o=s-a-1;a=s,i=0}else 46===r&&-1!==i?++i:i=-1}return n}var o={resolve:function(){for(var e,t="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var i;a>=0?i=arguments[a]:(void 0===e&&(e=process.cwd()),i=e),r(i),0!==i.length&&(t=i+"/"+t,o=47===i.charCodeAt(0))}return t=n(t,!o),o?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!t)).length||t||(e="."),e.length>0&&o&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":o.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=o.resolve(e))===(t=o.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var a=e.length,i=a-n,s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var c=t.length-s,l=i<c?i:c,u=-1,p=0;p<=l;++p){if(p===l){if(c>l){if(47===t.charCodeAt(s+p))return t.slice(s+p+1);if(0===p)return t.slice(s+p)}else i>l&&(47===e.charCodeAt(n+p)?u=p:0===p&&(u=0));break}var f=e.charCodeAt(n+p);if(f!==t.charCodeAt(s+p))break;47===f&&(u=p)}var h="";for(p=n+u+1;p<=a;++p)p!==a&&47!==e.charCodeAt(p)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(s+u):(s+=u,47===t.charCodeAt(s)&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,a=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!a){o=i;break}}else a=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,a=-1,i=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!i){o=n+1;break}}else-1===c&&(i=!1,c=n+1),s>=0&&(l===t.charCodeAt(s)?-1===--s&&(a=n):(s=-1,a=c))}return o===a?a=c:-1===a&&(a=e.length),e.slice(o,a)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!i){o=n+1;break}}else-1===a&&(i=!1,a=n+1);return-1===a?"":e.slice(o,a)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,a=!0,i=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(a=!1,o=s+1),46===c?-1===t?t=s:1!==i&&(i=1):-1!==t&&(i=-1);else if(!a){n=s+1;break}}return-1===t||-1===o||0===i||1===i&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),a=47===o;a?(t.root="/",n=1):n=0;for(var i=-1,s=0,c=-1,l=!0,u=e.length-1,p=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===i?i=u:1!==p&&(p=1):-1!==i&&(p=-1);else if(!l){s=u+1;break}return-1===i||-1===c||0===p||1===p&&i===c-1&&i===s+1?-1!==c&&(t.base=t.name=0===s&&a?e.slice(1,c):e.slice(s,c)):(0===s&&a?(t.name=e.slice(1,i),t.base=e.slice(1,c)):(t.name=e.slice(s,i),t.base=e.slice(s,c)),t.ext=e.slice(i,c)),s>0?t.dir=e.slice(0,s-1):a&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,t.exports=o}}),I=t({"packages/swig-core/lib/loaders/filesystem.js"(e,t){var r=L(),n=S();t.exports=function(e,t){var o={};return t=t||"utf8",e=e?n.normalize(e):null,o.resolve=function(t,r){return r=e||(r?n.dirname(r):process.cwd()),n.resolve(r,t)},o.load=function(e,n){if(!r||n&&!r.readFile||!r.readFileSync)throw new Error("Unable to find file "+e+" because there is no filesystem to read from.");if(e=o.resolve(e),!n)return r.readFileSync(e,t);r.readFile(e,t,n)},o}}}),U=t({"packages/swig-core/lib/loaders/memory.js"(e,t){var n=S(),o=r();t.exports=function(e,t){var r={};return t=t?n.normalize(t):null,r.resolve=function(e,r){return r=t||(r?n.dirname(r):"/"),n.resolve(r,e)},r.load=function(t,r){var n,a;if(a=[t,t.replace(/^(\/|\\)/,"")],(n=e[a[0]]||e[a[1]])||o.throwError('Unable to find template "'+t+'".'),!r)return n;r(null,n)},r}}}),_=t({"packages/swig-core/lib/loaders/index.js"(e){e.fs=I(),e.memory=U()}}),F=t({"lib/loaders/index.js"(e,t){t.exports=_()}}),j=t({"packages/swig-core/lib/cache.js"(e){e.shouldCache=function(e,t){return(e=e||{}).hasOwnProperty("cache")&&!e.cache||!t},e.cacheGet=function(t,r,n,o){if(!e.shouldCache(r,n))return"memory"===n?o[t]:n.get(t)},e.cacheSet=function(t,r,n,o,a){e.shouldCache(r,o)||("memory"!==o?o.set(t,n):a[t]=n)}}}),M=t({"packages/swig-core/lib/engine.js"(e){var t=r(),n=v(),o=j();function a(){return""}e.remapBlocks=function e(r,n){return t.map(n,function(t){var n=t.args?t.args.join(""):"";return"block"===t.name&&r[n]&&(t=r[n]),t.content&&t.content.length&&(t.content=e(r,t.content)),t})},e.importNonBlocks=function(e,r){var n=[];t.each(e,function(e){n.push(e)}),t.each(n.reverse(),function(e){"block"!==e.name&&r.unshift(e)})},e.getParents=function(r,n,o){for(var a,i,s,c=r.parent,l=[],u=[];c;){if(!n||!n.filename)throw new Error('Cannot extend "'+c+'" because current template has no filename.');if(a=a||n.filename,a=o.resolve(c,a),c=(i=o.cacheGet(a,n)||o.parseFile(a,t.extend({},n,{filename:a}))).parent,-1!==l.indexOf(a))throw new Error('Illegal circular extends of "'+a+'".');l.push(a),u.push(i)}for(s=u.length,s=u.length-2;s>=0;s-=1)u[s].tokens=e.remapBlocks(u[s].blocks,u[s+1].tokens),e.importNonBlocks(u[s].blocks,u[s].tokens);return u},e.buildTemplateFunction=function(e,t,r){return new Function("_swig","_ctx","_filters","_utils","_fn",' var _ext = _swig.extensions,\n _output = "";\n'+n.compile(e,t,r)+"\n return _output;\n")},e.install=function(r,n){var i=n.parser,s=t.extend({},n.tags),c=t.extend({},n.filters),l=n.validateOptions,u=n.onCompileError;function p(e){return e&&e.locals?t.extend({},r.options.locals,e.locals):r.options.locals}function f(e,t){return o.cacheGet(e,t,r.options.cache,r.cache)}function h(e,t,n){o.cacheSet(e,t,n,r.options.cache,r.cache)}r.invalidateCache=function(){"memory"===r.options.cache&&(r.cache={})},r.setFilter=function(e,t){if("function"!=typeof t)throw new Error('Filter "'+e+'" is not a valid function.');c[e]=t},r.setTag=function(e,t,r,n,o){if("function"!=typeof t)throw new Error('Tag "'+e+'" parse method is not a valid function.');if("function"!=typeof r)throw new Error('Tag "'+e+'" compile method is not a valid function.');s[e]={parse:t,compile:r,ends:n||!1,block:!!o}},r.setExtension=function(e,t){r.extensions[e]=t},r.parse=function(e,n){l(n);var o,a=p(n),u={};for(o in n)n.hasOwnProperty(o)&&"locals"!==o&&(u[o]=n[o]);return(n=t.extend({},r.options,u)).locals=a,i.parse(r,e,n,s,c)},r.parseFile=function(e,n){var o;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),o=r.options.loader.load(e),n.filename||(n=t.extend({filename:e},n)),r.parse(o,n)},r.precompile=function(t,n){var o,a=r.parse(t,n),i=function(t,n){return e.getParents(t,n,{resolve:function(e,t){return r.options.loader.resolve(e,t)},parseFile:r.parseFile,cacheGet:f})}(a,n);i.length&&(a.tokens=e.remapBlocks(a.blocks,i[0].tokens),e.importNonBlocks(a.blocks,a.tokens));try{o=e.buildTemplateFunction(a,i,n)}catch(e){u(e,n)}return{tpl:o,tokens:a}},r.compile=function(e,n){var o,i,s,l=n?n.filename:null,u=l?f(l,n):null;if(u)return u;function g(e){var n;return n=e&&i?t.extend({},o,e):e&&!i?e:!e&&i?o:{},s.tpl(r,n,c,t,a)}return o=p(n),i=t.keys(o).length,s=r.precompile(e,n),t.extend(g,s.tokens),l&&h(l,n,g),g},r.compileFile=function(e,n,o){var a,i;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),n.filename||(n=t.extend({filename:e},n)),(i=f(e,n))?o?void o(null,i):i:o?void r.options.loader.load(e,function(e,t){if(e)o(e);else{var a;try{a=r.compile(t,n)}catch(e){return void o(e)}o(e,a)}}):(a=r.options.loader.load(e),r.compile(a,n))},r.render=function(e,t){return r.compile(e,t)()},r.renderFile=function(e,t,n){if(!n)return r.compileFile(e)(t);r.compileFile(e,{},function(e,r){var o;if(e)n(e);else{try{o=r(t)}catch(e){return void n(e)}n(null,o)}})},r.run=function(e,n,o){var i=p({locals:n});return o&&h(o,{},e),e(r,i,c,t,a)}}}}),Y=t({"lib/swig.js"(e){var t=n(),r=k(),o=y(),a=w(),i=h(),s=F(),c=M();e.version="2.0.0";var l,u={autoescape:!0,varControls:["{{","}}"],tagControls:["{%","%}"],cmtControls:["{#","#}"],locals:{},cache:"memory",loader:s.fs()};function p(e){if(e){if(t.each(["varControls","tagControls","cmtControls"],function(r){if(e.hasOwnProperty(r)){if(!t.isArray(e[r])||2!==e[r].length)throw new Error('Option "'+r+'" must be an array containing 2 different control strings.');if(e[r][0]===e[r][1])throw new Error('Option "'+r+'" open and close controls must not be the same.');t.each(e[r],function(e,t){if(e.length<2)throw new Error('Option "'+r+'" '+(t?"open ":"close ")+'control must be at least 2 characters. Saw "'+e+'" instead.')})}}),e.hasOwnProperty("cache")&&e.cache&&"memory"!==e.cache&&(!e.cache.get||!e.cache.set))throw new Error("Invalid cache option "+JSON.stringify(e.cache)+' found. Expected "memory" or { get: function (key) { ... }, set: function (key, value) { ... } }.');if(e.hasOwnProperty("loader")&&e.loader&&(!e.loader.load||!e.loader.resolve))throw new Error("Invalid loader option "+JSON.stringify(e.loader)+" found. Expected { load: function (pathname, cb) { ... }, resolve: function (to, from) { ... } }.")}}e.setDefaults=function(e){p(e),l.options=t.extend(l.options,e)},e.setDefaultTZOffset=function(e){i.tzOffset=e},e.Swig=function(e){p(e),this.options=t.extend({},u,e||{}),this.cache={},this.extensions={},c.install(this,{parser:a,tags:r,filters:o,validateOptions:p,onCompileError:function(e,r){t.throwError(e,null,r.filename)}})},l=new e.Swig,e.setFilter=l.setFilter,e.setTag=l.setTag,e.setExtension=l.setExtension,e.parseFile=l.parseFile,e.precompile=l.precompile,e.compile=l.compile,e.compileFile=l.compileFile,e.render=l.render,e.renderFile=l.renderFile,e.run=l.run,e.invalidateCache=l.invalidateCache,e.loaders=s}})();"function"==typeof window.define&&"object"==typeof window.define.amd?window.define("swig",[],function(){return Y}):window.swig=Y})();
|
|
3
|
+
(()=>{var e=Object.getOwnPropertyNames,t=(t,r)=>function(){return r||(0,t[e(t)[0]])((r={exports:{}}).exports,r),r.exports},r=t({"packages/swig-core/lib/utils.js"(e){var t;e.strip=function(e){return e.replace(/^\s+|\s+$/g,"")},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.each=function(e,r){var n,o;if(t(e))for(n=0,o=e.length;n<o&&!1!==r(e[n],n,e);n+=1);else for(n in e)if(e.hasOwnProperty(n)&&!1===r(e[n],n,e))break;return e},e.isArray=t=Array.hasOwnProperty("isArray")?Array.isArray:function(e){return!!e&&("object"==typeof e&&-1!==Object.prototype.toString.call(e).indexOf())},e.some=function(r,n){var o,a,i=0;if(t(r))for(a=r.length;i<a&&!(o=n(r[i],i,r));i+=1);else e.each(r,function(e,t){return!(o=n(e,t,r))});return!!o},e.map=function(e,r){var n,o=0,a=[];if(t(e))for(n=e.length;o<n;o+=1)a[o]=r(e[o],o);else for(o in e)e.hasOwnProperty(o)&&(a[o]=r(e[o],o));return a},e.extend=function(){for(var e,t,r=arguments,n=r[0],o=r.length>1?Array.prototype.slice.call(r,1):[],a=0,i=o.length;a<i;a+=1)for(e in t=o[a]||{})t.hasOwnProperty(e)&&(n[e]=t[e]);return n},e.keys=function(t){return t?Object.keys?Object.keys(t):e.map(t,function(e,t){return t}):[]},e.throwError=function(e,t,r){throw t&&(e+=" on line "+t),r&&(e+=" in file "+r),new Error(e+".")},e.range=function(e,t){var r,n,o,a=[];if("number"==typeof e&&"number"==typeof t){if(e<=t)for(r=e;r<=t;r+=1)a.push(r);else for(r=e;r>=t;r-=1)a.push(r);return a}if("string"==typeof e&&"string"==typeof t&&1===e.length&&1===t.length){if((n=e.charCodeAt(0))<=(o=t.charCodeAt(0)))for(r=n;r<=o;r+=1)a.push(String.fromCharCode(r));else for(r=n;r>=o;r-=1)a.push(String.fromCharCode(r));return a}return a}}}),n=t({"lib/utils.js"(e,t){t.exports=r()}}),o=t({"packages/swig-core/lib/ir.js"(e){function t(e,t){return void 0!==t&&(e.loc=t),e}e.template=function(e,r,n,o){var a={type:"Template",body:e};return void 0!==r&&(a.parent=r),void 0!==n&&(a.blocks=n),t(a,o)},e.text=function(e,r){return t({type:"Text",value:e},r)},e.output=function(e,r,n,o){var a={type:"Output",expr:e};return void 0!==r&&(a.filters=r),void 0!==n&&(a.safe=n),t(a,o)},e.filterCall=function(e,t){var r={name:e};return void 0!==t&&(r.args=t),r},e.ifStmt=function(e,r){return t({type:"If",branches:e},r)},e.ifBranch=function(e,t){return{test:e,body:t}},e.forStmt=function(e,r,n,o,a,i){var s={type:"For",value:e,iterable:r,body:n};return void 0!==o&&(s.key=o),void 0!==a&&(s.emptyBody=a),t(s,i)},e.block=function(e,r,n){return t({type:"Block",name:e,body:r},n)},e.include=function(e,r,n,o,a,i){var s={type:"Include",path:e};return void 0!==r&&(s.context=r),void 0!==n&&(s.isolated=n),void 0!==o&&(s.ignoreMissing=o),void 0!==a&&(s.resolveFrom=a),t(s,i)},e.importStmt=function(e,r,n){return t({type:"Import",path:e,alias:r},n)},e.macro=function(e,r,n,o){return t({type:"Macro",name:e,params:r,body:n},o)},e.macroParam=function(e,t){var r={name:e};return void 0!==t&&(r.default=t),r},e.call=function(e,r,n){return t({type:"Call",callee:e,args:r},n)},e.set=function(e,r,n,o){return t({type:"Set",target:e,op:r,value:n},o)},e.raw=function(e,r){return t({type:"Raw",value:e},r)},e.parent=function(e,r){var n={type:"Parent"};return void 0!==e&&(n.body=e),t(n,r)},e.autoescape=function(e,r,n){return t({type:"Autoescape",strategy:e,body:r},n)},e.filter=function(e,r,n,o){var a={type:"Filter",name:e,body:r};return void 0!==n&&(a.args=n),t(a,o)},e.withStmt=function(e,r,n,o){var a={type:"With",body:n};return void 0!==e&&(a.context=e),void 0!==r&&(a.isolated=r),t(a,o)},e.legacyJS=function(e,r){return t({type:"LegacyJS",js:e},r)},e.extendsDeferred=function(e,r,n,o,a){var i={type:"ExtendsDeferred",path:e};return void 0!==r&&(i.childBlocks=r),void 0!==n&&(i.childIRs=n),void 0!==o&&(i.resolveFrom=o),t(i,a)},e.includeDeferred=function(e,r,n,o,a,i){var s={type:"IncludeDeferred",path:e};return void 0!==r&&(s.context=r),void 0!==n&&(s.isolated=n),void 0!==o&&(s.ignoreMissing=o),void 0!==a&&(s.resolveFrom=a),t(s,i)},e.importDeferred=function(e,r,n,o){var a={type:"ImportDeferred",path:e,alias:r};return void 0!==n&&(a.resolveFrom=n),t(a,o)},e.fromImportDeferred=function(e,r,n,o){var a={type:"FromImportDeferred",path:e,imports:r};return void 0!==n&&(a.resolveFrom=n),t(a,o)},e.literal=function(e,r,n){return t({type:"Literal",kind:e,value:r},n)},e.varRef=function(e,r){return t({type:"VarRef",path:e},r)},e.varRefExists=function(e,r){return t({type:"VarRefExists",path:e},r)},e.access=function(e,r,n){return t({type:"Access",object:e,key:r},n)},e.binaryOp=function(e,r,n,o){return t({type:"BinaryOp",op:e,left:r,right:n},o)},e.unaryOp=function(e,r,n){return t({type:"UnaryOp",op:e,operand:r},n)},e.conditional=function(e,r,n,o){var a={type:"Conditional",test:e,then:r};return a.else=n,t(a,o)},e.arrayLiteral=function(e,r){return t({type:"ArrayLiteral",elements:e},r)},e.objectLiteral=function(e,r){return t({type:"ObjectLiteral",properties:e},r)},e.objectProperty=function(e,t){return{key:e,value:t}},e.fnCall=function(e,r,n){return t({type:"FnCall",callee:e,args:r},n)},e.filterCallExpr=function(e,r,n,o){var a={type:"FilterCall",name:e,input:r};return void 0!==n&&(a.args=n),t(a,o)}}}),a=t({"lib/tags/autoescape.js"(e){var t=n(),r=o(),a=["html","js"];e.compile=function(e,t,n,o,a,i){var s=e(n,o,a,i);return r.autoescape(function(e){if("true"===e)return!0;if("false"===e)return!1;if("string"==typeof e&&e.length>=2){var t=e.charAt(0),r=e.charAt(e.length-1);if('"'===t&&'"'===r||"'"===t&&"'"===r)return e.slice(1,-1)}return e}(t[0]),[r.legacyJS(s)])},e.parse=function(e,r,n,o,i,s){var c;return n.on("*",function(e){if(!c&&(e.type===o.BOOL||e.type===o.STRING&&-1===a.indexOf(e.match)))return this.out.push(e.match),void(c=!0);t.throwError('Unexpected token "'+e.match+'" in autoescape tag',r,s.filename)}),!0},e.ends=!0}}),i=t({"lib/tags/block.js"(e){var t=o();e.compile=function(e,r,n,o,a){var i=r.join("");return t.block(i,[t.legacyJS(e(n,o,a,i))])},e.parse=function(e,t,r){return r.on("*",function(e){this.out.push(e.match)}),!0},e.ends=!0,e.block=!0}}),s=t({"lib/tags/else.js"(e){e.compile=function(){return"} else {\n"},e.parse=function(e,t,r,n,o){return r.on("*",function(e){throw new Error('"else" tag does not accept any tokens. Found "'+e.match+'" on line '+t+".")}),o.length&&"if"===o[o.length-1].name}}}),c=t({"packages/swig-core/lib/tokentypes.js"(e,t){t.exports={WHITESPACE:0,STRING:1,FILTER:2,FILTEREMPTY:3,FUNCTION:4,FUNCTIONEMPTY:5,PARENOPEN:6,PARENCLOSE:7,COMMA:8,VAR:9,NUMBER:10,OPERATOR:11,BRACKETOPEN:12,BRACKETCLOSE:13,DOTKEY:14,ARRAYOPEN:15,CURLYOPEN:17,CURLYCLOSE:18,COLON:19,COMPARATOR:20,LOGIC:21,NOT:22,BOOL:23,ASSIGNMENT:24,METHODOPEN:25,UNKNOWN:100}}}),l=t({"lib/tags/if.js"(e){var t=o(),r=c();e.compile=function(e,r,n,o,a,i,s){var c,l,p=[],u=s&&s.irExpr?s.irExpr:t.legacyJS(r.join(" ")),f=[];for(c=0;c<n.length;c++)!(l=n[c])||"elseif"!==l.name&&"else"!==l.name?f.push(l):(p.push(t.ifBranch(u,[t.legacyJS(e(f,o,a,i))])),u="else"===l.name?null:l.irExpr?l.irExpr:t.legacyJS(l.args.join(" ")),f=[]);return p.push(t.ifBranch(u,[t.legacyJS(e(f,o,a,i))])),t.ifStmt(p)},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,t,r,n){if(void 0===e)throw new Error("No conditional statement provided on line "+t+".");return r.on(n.COMPARATOR,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");if(this.prevToken.type===n.NOT)throw new Error('Attempted logic "not '+e.match+'" on line '+t+". Use !(foo "+e.match+") instead.");this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),r.on(n.NOT,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match)}),r.on(n.BOOL,function(e){this.out.push(e.match)}),r.on(n.LOGIC,function(e){if(!this.out.length||this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match),this.filterApplyIdx.pop()}),!0},e.ends=!0}}),p=t({"lib/tags/elseif.js"(e){var t=l().parse,r=c();e.compile=function(e,t){return"} else if ("+t.join(" ")+") {\n"},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,r,n,o,a){return t(e,r,n,o,a)&&a.length&&"if"===a[a.length-1].name}}}),u=t({"lib/tags/extends.js"(e){e.compile=function(){},e.parse=function(){return!0},e.ends=!1}}),f=t({"packages/swig-core/lib/dateformatter.js"(e){var t=r(),n={full:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},o={full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],alt:{"-1":"Yesterday",0:"Today",1:"Tomorrow"}};e.tzOffset=0,e.DateZ=function(){var r=["getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","toISOString","toGMTString","toUTCString","valueOf","getTime"],n=["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getYear","toDateString","toLocaleDateString","toLocaleTimeString"],o=this;o.date=o.dateZ=arguments.length>1?new Date(Date.UTC.apply(Date,arguments)+6e4*(new Date).getTimezoneOffset()):1===arguments.length?new Date(new Date(arguments[0])):new Date,o.timezoneOffset=o.dateZ.getTimezoneOffset(),t.each(n,function(e){o[e]=function(){return o.dateZ[e]()}}),t.each(r,function(e){o[e]=function(){return o.date[e]()}}),this.setTimezoneOffset(e.tzOffset)},e.DateZ.prototype={getTimezoneOffset:function(){return this.timezoneOffset},setTimezoneOffset:function(e){return this.timezoneOffset=e,this.dateZ=new Date(this.date.getTime()+6e4*this.date.getTimezoneOffset()-6e4*this.timezoneOffset),this}},e.d=function(e){return(e.getDate()<10?"0":"")+e.getDate()},e.D=function(e){return o.abbr[e.getDay()]},e.j=function(e){return e.getDate()},e.l=function(e){return o.full[e.getDay()]},e.N=function(e){var t=e.getDay();return t>=1?t:7},e.S=function(e){var t=e.getDate();return t%10==1&&11!==t?"st":t%10==2&&12!==t?"nd":t%10==3&&13!==t?"rd":"th"},e.w=function(e){return e.getDay()},e.z=function(t,r,n){var o=t.getFullYear(),a=new e.DateZ(o,t.getMonth(),t.getDate(),12,0,0),i=new e.DateZ(o,0,1,12,0,0);return a.setTimezoneOffset(r,n),i.setTimezoneOffset(r,n),Math.round((a-i)/864e5)},e.W=function(e){var t,r=new Date(e.valueOf()),n=(e.getDay()+6)%7;return r.setDate(r.getDate()-n+3),t=r.valueOf(),r.setMonth(0,1),4!==r.getDay()&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((t-r)/6048e5)},e.F=function(e){return n.full[e.getMonth()]},e.m=function(e){return(e.getMonth()<9?"0":"")+(e.getMonth()+1)},e.M=function(e){return n.abbr[e.getMonth()]},e.n=function(e){return e.getMonth()+1},e.t=function(e){return 32-new Date(e.getFullYear(),e.getMonth(),32).getDate()},e.L=function(e){return 29===new Date(e.getFullYear(),1,29).getDate()},e.o=function(e){var t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},e.Y=function(e){return e.getFullYear()},e.y=function(e){return e.getFullYear().toString().substr(2)},e.a=function(e){return e.getHours()<12?"am":"pm"},e.A=function(e){return e.getHours()<12?"AM":"PM"},e.B=function(e){var t,r=e.getUTCHours();return r=23===r?0:r+1,t=Math.abs((60*(60*r+e.getUTCMinutes())+e.getUTCSeconds())/86.4).toFixed(0),"000".concat(t).slice(t.length)},e.g=function(e){var t=e.getHours();return 0===t?12:t>12?t-12:t},e.G=function(e){return e.getHours()},e.h=function(e){var t=e.getHours();return(t<10||12<t&&22>t?"0":"")+(t<12?t:t-12)},e.H=function(e){var t=e.getHours();return(t<10?"0":"")+t},e.i=function(e){var t=e.getMinutes();return(t<10?"0":"")+t},e.s=function(e){var t=e.getSeconds();return(t<10?"0":"")+t},e.O=function(e){var t=e.getTimezoneOffset();return(t<0?"-":"+")+(t/60<10?"0":"")+Math.abs(t/60)+"00"},e.Z=function(e){return 60*e.getTimezoneOffset()},e.c=function(e){return e.toISOString()},e.r=function(e){return e.toUTCString()},e.U=function(e){return e.getTime()/1e3}}}),h=t({"lib/dateformatter.js"(e,t){t.exports=f()}}),d=t({"packages/swig-core/lib/filters.js"(e){var t=r();e.iterateFilter=function(e){var r=this,n={};return t.isArray(e)?t.map(e,function(e){return r.apply(null,arguments)}):"object"==typeof e?(t.each(e,function(e,t){n[t]=r.apply(null,arguments)}),n):void 0}}}),y=t({"lib/filters.js"(e){var t=n(),r=h(),o=d().iterateFilter;e.addslashes=function(t){var r=o.apply(e.addslashes,arguments);return void 0!==r?r:t.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\"/g,'\\"')},e.capitalize=function(t){var r=o.apply(e.capitalize,arguments);return void 0!==r?r:t.toString().charAt(0).toUpperCase()+t.toString().substr(1).toLowerCase()},e.date=function(e,t,n,o){var a,i=t.length,s=new r.DateZ(e),c=0,l="";for(n&&s.setTimezoneOffset(n,o);c<i;c+=1)"\\"===(a=t.charAt(c))?l+=(c+=1)<i?t.charAt(c):a:r.hasOwnProperty(a)?l+=r[a](s,n,o):l+=a;return l},e.default=function(e,t){return void 0===e||!e&&"number"!=typeof e?t:e},e.escape=function(t,r){var n,a=o.apply(e.escape,arguments),i=t,s=0;if(void 0!==a)return a;if("string"!=typeof t)return t;if(a="","js"===r){for(i=i.replace(/\\/g,"\\u005C");s<i.length;s+=1)a+=(n=i.charCodeAt(s))<32?"\\u00"+(n=(n=n.toString(16).toUpperCase()).length<2?"0"+n:n):i[s];return a.replace(/&/g,"\\u0026").replace(/</g,"\\u003C").replace(/>/g,"\\u003E").replace(/\'/g,"\\u0027").replace(/"/g,"\\u0022").replace(/\=/g,"\\u003D").replace(/-/g,"\\u002D").replace(/;/g,"\\u003B")}return i.replace(/&(?!amp;|lt;|gt;|quot;|#39;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},e.e=e.escape,e.first=function(e){return"object"!=typeof e||t.isArray(e)?"string"==typeof e?e.substr(0,1):e[0]:e[t.keys(e)[0]]},e.groupBy=function(e,r){if(!t.isArray(e))return e;var n={};return t.each(e,function(e){if(e.hasOwnProperty(r)){var o=e[r],a=t.extend({},e);delete a[r],n[o]||(n[o]=[]),n[o].push(a)}}),n},e.join=function(e,r){if(t.isArray(e))return e.join(r);if("object"==typeof e){var n=[];return t.each(e,function(e){n.push(e)}),n.join(r)}return e},e.json=function(e,t){return JSON.stringify(e,null,t||0)},e.json_encode=e.json,e.last=function(e){if("object"==typeof e&&!t.isArray(e)){var r=t.keys(e);return e[r[r.length-1]]}return"string"==typeof e?e.charAt(e.length-1):e[e.length-1]},e.length=function(e){return"object"!=typeof e||t.isArray(e)?e.hasOwnProperty("length")?e.length:"":t.keys(e).length},e.lower=function(t){var r=o.apply(e.lower,arguments);return void 0!==r?r:t.toString().toLowerCase()},e.raw=function(t){return e.safe(t)},e.raw.safe=!0,e.replace=function(e,t,r,n){var o=new RegExp(t,n);return e.replace(o,r)},e.reverse=function(t){return e.sort(t,!0)},e.safe=function(e){return e},e.safe.safe=!0,e.sort=function(e,r){var n;if(t.isArray(e))n=t.extend([],e).sort();else switch(typeof e){case"object":n=t.keys(e).sort();break;case"string":return n=e.split(""),r?n.reverse().join(""):n.sort().join("")}return n&&r?n.reverse():n||e},e.striptags=function(t){var r=o.apply(e.striptags,arguments);return void 0!==r?r:t.toString().replace(/(<([^>]+)>)/gi,"")},e.title=function(t){var r=o.apply(e.title,arguments);return void 0!==r?r:t.toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},e.uniq=function(e){var r;return e&&t.isArray(e)?(r=[],t.each(e,function(e){-1===r.indexOf(e)&&r.push(e)}),r):""},e.upper=function(t){var r=o.apply(e.upper,arguments);return void 0!==r?r:t.toString().toUpperCase()},e.url_encode=function(t){var r=o.apply(e.url_encode,arguments);return void 0!==r?r:encodeURIComponent(t)},e.url_decode=function(t){var r=o.apply(e.url_decode,arguments);return void 0!==r?r:decodeURIComponent(t)}}}),g=t({"lib/tags/filter.js"(e){var t=y(),r=o(),n=c();e.compile=function(e,t,n,o,a,i,s){var c=t.shift().replace(/\($/,""),l=e(n,o,a,i);")"===t[t.length-1]&&t.pop();var p=s&&s.irExpr?s.irExpr:t.length?t:void 0;return r.filter(c,[r.legacyJS(l)],p)},e.lowerExpr=function(e,t){for(var r=0;r<t.length&&t[r].type===n.WHITESPACE;)r+=1;if(!(r>=t.length)){var o=t[r];if(o.type!==n.VAR){if(o.type===n.FUNCTIONEMPTY)return[];if(o.type===n.FUNCTION){var a,i=1,s=r+1,c=[];for(a=r+1;a<t.length;a+=1){var l=t[a];if(l.type===n.FILTER||l.type===n.FILTEREMPTY)return;if(l.type!==n.PARENOPEN&&l.type!==n.FUNCTION&&l.type!==n.BRACKETOPEN&&l.type!==n.CURLYOPEN){if(l.type!==n.PARENCLOSE&&l.type!==n.BRACKETCLOSE&&l.type!==n.CURLYCLOSE)l.type===n.COMMA&&1===i&&(c.push(t.slice(s,a)),s=a+1);else if(0===(i-=1)){a>s&&c.push(t.slice(s,a));break}}else i+=1}if(0===i){var p=[];for(a=0;a<c.length;a+=1)p.push(e.parseExpr(c[a]));return p}}}}},e.parse=function(e,r,n,o){var a;function i(e){if(!t.hasOwnProperty(e))throw new Error('Filter "'+e+'" does not exist on line '+r+".")}return n.on(o.FUNCTION,function(e){return!!a||(i(a=e.match.replace(/\($/,"")),this.out.push(e.match),void this.state.push(e.type))}),n.on(o.VAR,function(e){return!!a||(i(a=e.match),void this.out.push(a))}),!0},e.ends=!0}}),v=t({"packages/swig-core/lib/security.js"(e){e.dangerousProps=["__proto__","constructor","prototype"]}}),m=t({"lib/tags/for.js"(e){var t=o(),r=c(),n=v().dangerousProps;e.compile=function(e,r,n,o,a,i,s){var c,l=r.shift(),p="__k";r[0]&&","===r[0]&&(r.shift(),p=l,l=r.shift()),c=s&&s.irExpr?s.irExpr:r.join("");var u=e(n,o,a,i);return t.forStmt(l,c,[t.legacyJS(u)],p)},e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.COMPARATOR&&"in"===t[n].match){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY)return;return e.parseExpr(a)}},e.parse=function(e,t,r,o){var a,i;return r.on(o.NUMBER,function(e){var r=this.state.length?this.state[this.state.length-1]:null;if(!i||r!==o.ARRAYOPEN&&r!==o.CURLYOPEN&&r!==o.CURLYCLOSE&&r!==o.FUNCTION&&r!==o.FILTER)throw new Error('Unexpected number "'+e.match+'" on line '+t+".");return!0}),r.on(o.VAR,function(e){if(i&&a)return!0;if(-1!==e.match.indexOf("."))throw new Error('Loop variable "'+e.match+'" must be a bare identifier in "for" tag on line '+t+".");if(-1!==n.indexOf(e.match))throw new Error('Unsafe loop variable "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.length||(a=!0),this.out.push(e.match)}),r.on(o.COMMA,function(e){if(!a||this.prevToken.type!==o.VAR)return!0;this.out.push(e.match)}),r.on(o.COMPARATOR,function(e){if("in"!==e.match||!a)throw new Error('Unexpected token "'+e.match+'" on line '+t+".");i=!0,this.filterApplyIdx.push(this.out.length)}),!0},e.ends=!0}}),E=t({"packages/swig-core/lib/backend.js"(e){var t=r(),n=v(),a=o();function i(e){return e.replace(/\\/g,"\\\\").replace(/\n|\r/g,"\\n").replace(/"/g,'\\"')}function s(e){return{dangerousProps:(e=e||{}).dangerousProps||n.dangerousProps,throwError:e.throwError||t.throwError}}function c(e,r){switch(e&&"string"==typeof e.type||r.throwError("emitExpr: expected an IR expression node"),e.type){case"Literal":return function(e,t){switch(e.kind){case"string":return JSON.stringify(e.value);case"number":return String(e.value);case"bool":return e.value?"true":"false";case"null":return"null";case"undefined":return"undefined"}t.throwError('emitLiteral: unknown literal kind "'+e.kind+'"')}(e,r);case"VarRef":return function(e,r){t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRef: path must be a non-empty array");return t.each(e.path,function(t){l(t,r,e)}),f(e.path)}(e,r);case"VarRefExists":return p(e,r);case"Access":return function(e,t){e.key&&"Literal"===e.key.type&&"string"===e.key.kind&&l(e.key.value,t,e);return c(e.object,t)+"["+c(e.key,t)+"]"}(e,r);case"BinaryOp":return function(e,t){var r=c(e.left,t),n=c(e.right,t);if(o=e.op,"+"===o||"-"===o||"*"===o||"/"===o||"%"===o)return r+" "+e.op+" "+n;var o;if("in"===e.op)return r+" in "+n;if("~"===e.op)return"(String("+r+") + String("+n+"))";if("??"===e.op&&e.left&&"VarRef"===e.left.type){return"("+p(a.varRefExists(e.left.path,e.left.loc),t)+" ? "+r+" : "+n+")"}return r+e.op+n}(e,r);case"UnaryOp":return function(e,t){var r=c(e.operand,t);e.operand&&"BinaryOp"===e.operand.type&&(r="("+r+")");return e.op+r}(e,r);case"Conditional":return function(e,t){return"("+c(e.test,t)+" ? "+c(e.then,t)+" : "+c(e.else,t)+")"}(e,r);case"ArrayLiteral":return function(e,r){var n=[];return t.each(e.elements,function(e){n.push(c(e,r))}),"["+n.join(", ")+"]"}(e,r);case"ObjectLiteral":return function(e,r){var n=[];return t.each(e.properties,function(e){n.push(c(e.key,r)+":"+c(e.value,r))}),"{"+n.join(", ")+"}"}(e,r);case"FnCall":return function(e,r){var n,o,a,i=[],s=e.callee;if(t.each(e.args,function(e){i.push(c(e,r))}),a=i.join(", "),s&&"VarRef"===s.type&&t.isArray(s.path))return t.each(s.path,function(e){l(e,r,s)}),1===s.path.length?"((typeof _ctx."+(n=s.path[0])+' !== "undefined") ? _ctx.'+n+" : ((typeof "+n+' !== "undefined") ? '+n+" : _fn))("+a+")":(o=s.path.slice(0,-1),"("+f(s.path)+" || _fn).call("+f(o)+(a?", "+a:"")+")");return"("+c(s,r)+")("+a+")"}(e,r);case"FilterCall":return function(e,r){var n=c(e.input,r),o="";if(e.args&&e.args.length){var a=[];t.each(e.args,function(e){a.push(c(e,r))}),o=", "+a.join(", ")}return'_filters["'+e.name+'"]('+n+o+")"}(e,r)}r.throwError('emitExpr: unknown IR expression type "'+e.type+'"')}function l(e,t,r){if(-1!==t.dangerousProps.indexOf(e)){var n=r&&r.loc&&r.loc.line||void 0,o=r&&r.loc&&r.loc.filename||void 0;t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',n,o)}}function p(e,r){return t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRefExists: path must be a non-empty array"),t.each(e.path,function(t){l(t,r,e)}),"("+u(e.path,"_ctx.")+" || "+u(e.path,"")+")"}function u(e,r){var n=r+e[0],o="";return o="(typeof "+n+' !== "undefined" && '+n+" !== null",t.each(e,function(e,t){0!==t&&(o+=" && "+n+"."+e+" !== undefined && "+n+"."+e+" !== null",n+="."+e)}),o+=")"}function f(e){var t=e.join(".");return"("+u(e,"_ctx.")+" ? _ctx."+t+" : ("+u(e,"")+" ? "+t+' : ""))'}e.compile=function(r,o,c,p){var u="",f=t.isArray(r)?r:r.tokens,h=[];return t.each(f,function(r){if("string"!=typeof r)if(r&&"object"==typeof r&&"string"==typeof r.type&&"function"!=typeof r.compile)h.push(r);else{var n=r.compile(e.compile,r.args?r.args.slice(0):[],r.content?r.content.slice(0):[],o,c,p,r);null!=n&&""!==n&&("string"!=typeof n?t.isArray(n)?t.each(n,function(e){h.push(e)}):"object"!=typeof n||"string"!=typeof n.type?h.push(a.legacyJS(String(n))):h.push(n):h.push(a.legacyJS(n)))}else h.push(a.text(r))}),t.each(h,function(r){if("Text"!==r.type&&"Raw"!==r.type)if("LegacyJS"!==r.type)if("Autoescape"!==r.type){if("If"===r.type){var a="";return t.each(r.branches,function(r,n){var o,s="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(s+='_output += "'+i(e.value)+'";\n'):s+=e.js}),null!==r.test?(o=r.test&&"object"==typeof r.test&&"LegacyJS"===r.test.type?r.test.js:"object"==typeof r.test&&"string"==typeof r.test.type?e.emitExpr(r.test):r.test,a+=0===n?"if ("+o+") { \n"+s:"} else if ("+o+") {\n"+s):a+="} else {\n"+s}),void(u+=a+"\n}")}if("Set"===r.type){var p,f;if(r.target&&"object"==typeof r.target&&"VarRef"===r.target.type){var h=s();t.isArray(r.target.path)&&0!==r.target.path.length||h.throwError("Set: target VarRef must have a non-empty path"),t.each(r.target.path,function(e){l(e,h,r.target)}),p="_ctx."+r.target.path.join(".")}else p=r.target;return f=r.value&&"object"==typeof r.value&&"string"==typeof r.value.type?e.emitExpr(r.value):r.value,void(u+=p+" "+r.op+" "+f+";\n")}if("For"===r.type){var d,y=r.value,g=r.key,v="",m=("_ctx.__loopcache"+Math.random()).replace(/\./g,""),E="_ctx.",x="_ctx.loop";return d=r.iterable&&"object"==typeof r.iterable&&"string"==typeof r.iterable.type?e.emitExpr(r.iterable):r.iterable,t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(v+='_output += "'+i(e.value)+'";\n'):v+=e.js}),void(u+="(function () {\n var __l = "+d+', __len = (_utils.isArray(__l) || typeof __l === "string") ? __l.length : _utils.keys(__l).length;\n if (!__l) { return; }\n var '+m+" = { loop: "+x+", "+y+": "+E+y+", "+g+": "+E+g+" };\n "+x+" = { first: false, index: 1, index0: 0, revindex: __len, revindex0: __len - 1, length: __len, last: false };\n _utils.each(__l, function ("+y+", "+g+") {\n "+E+y+" = "+y+";\n "+E+g+" = "+g+";\n "+x+".key = "+g+";\n "+x+".first = ("+x+".index0 === 0);\n "+x+".last = ("+x+".revindex0 === 0);\n "+v+" "+x+".index += 1; "+x+".index0 += 1; "+x+".revindex -= 1; "+x+".revindex0 -= 1;\n });\n "+x+" = "+m+".loop;\n "+E+y+" = "+m+"."+y+";\n "+E+g+" = "+m+"."+g+";\n "+m+" = undefined;\n})();\n")}if("Macro"!==r.type)if("Parent"!==r.type)if("Block"!==r.type){var O,w,C;if("Include"===r.type)return O=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path,void 0!==r.context&&(w="object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context),C=r.isolated&&w?w:w?"_utils.extend({}, _ctx, "+w+")":"_ctx",void(u+=(r.ignoreMissing?" try {\n":"")+"_output += _swig.compileFile("+O+', {resolveFrom: "'+r.resolveFrom+'"})('+C+");\n"+(r.ignoreMissing?"} catch (e) {}\n":""));if("IncludeDeferred"!==r.type)if("ImportDeferred"!==r.type){if("FromImportDeferred"===r.type){var b,T=r.imports||[];t.each(T,function(e){if(-1!==n.dangerousProps.indexOf(e.name))throw new Error('From-import name "'+e.name+'" is reserved.');var t=e.alias||e.name;if(-1!==n.dangerousProps.indexOf(t))throw new Error('From-import binding "'+t+'" is reserved.')}),b=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path;var R='{resolveFrom: "'+(r.resolveFrom||"")+'"}',A="";return t.each(T,function(e){var t=e.alias||e.name;A+=" _ctx."+t+' = _imp["'+e.name+'"];\n'}),void(u+="await (async function () {\n var _imp = (await (await _swig.getTemplate("+b+", "+R+"))(_ctx)).exports;\n"+A+"})();\n")}if("ExtendsDeferred"===r.type){var N;r.childIRs&&r.childIRs.length&&(u+=e.compile(r.childIRs,o,c)),u+="var _localChildBlocks = {};\n",r.childBlocks&&t.each(r.childBlocks,function(e,r){var n="";t.each(e.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(n+='_output += "'+i(e.value)+'";\n'):n+=e.js}),u+="_localChildBlocks["+JSON.stringify(r)+'] = async function (_ctx) {\n var _output = "";\n'+n+" return _output;\n};\n"}),u+="var _mergedBlocks = _utils.extend({}, _localChildBlocks, _blocks || {});\n",N=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path;var k='{resolveFrom: "'+(r.resolveFrom||"")+'"}';return u+="var _parentTpl = await _swig.getTemplate("+N+", "+k+");\n",u+="var _parentResult = await _parentTpl(_ctx, _mergedBlocks);\n",void(u+="_output = _parentResult.output;\n")}if("With"===r.type){var P;void 0!==r.context&&(P=r.context&&"object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context);var _,L="";return t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(L+='_output += "'+i(e.value)+'";\n'):L+=e.js}),_=r.isolated?void 0!==P?P:"{}":void 0!==P?"_utils.extend({}, _ctx, "+P+")":"_utils.extend({}, _ctx)",void(u+="(function (_ctx) {\n"+L+"})("+_+");\n")}if("Output"===r.type){if(r.expr&&"LegacyJS"===r.expr.type)return void(u+=r.expr.js);var S=e.emitExpr(r.expr);return r.filters&&r.filters.length&&t.each(r.filters,function(r){var n="";if(r.args&&r.args.length){var o=[];t.each(r.args,function(t){o.push(e.emitExpr(t))}),n=", "+o.join(", ")}S='_filters["'+r.name+'"]('+S+n+")"}),void(u+="_output += "+S+";\n")}if("Filter"!==r.type);else{var I="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(I+='_output += "'+i(e.value)+'";\n'):I+=e.js});var F='(function () {\n var _output = "";\n'+I+" return _output;\n})()",U="";if(r.args&&r.args.length){var j=[];t.each(r.args,function(t){t&&"object"==typeof t&&"string"==typeof t.type?j.push(e.emitExpr(t)):j.push(t)}),U=", "+j.join(", ")}u+='_output += _filters["'+r.name+'"]('+F+U+");\n"}}else{if(-1!==n.dangerousProps.indexOf(r.alias))throw new Error('Import alias "'+r.alias+'" is reserved.');var M;M=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path;var Y='{resolveFrom: "'+(r.resolveFrom||"")+'"}';u+="_ctx."+r.alias+" = (await (await _swig.getTemplate("+M+", "+Y+"))(_ctx)).exports;\n"}else{var D,B,V;D=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path,void 0!==r.context&&(B="object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context),V=r.isolated&&B?B:B?"_utils.extend({}, _ctx, "+B+")":"_ctx";var J='{resolveFrom: "'+(r.resolveFrom||"")+'"}';u+=(r.ignoreMissing?" try {\n":"")+"_output += (await (await _swig.getTemplate("+D+", "+J+"))("+V+")).output;\n"+(r.ignoreMissing?"} catch (e) {}\n":"")}}else{if(c&&"async"===c.codegenMode){var K=JSON.stringify(r.name);return u+="if (_blocks && _blocks["+K+"]) {\n",u+=" _output += await _blocks["+K+"](_ctx);\n",u+="} else {\n",t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js}),void(u+="}\n")}t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js})}else t.each(r.body||[],function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else{var W="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(W+='_output += "'+i(e.value)+'";\n'):W+=e.js});var $,z,G=r.params||[];if(G.length&&"object"==typeof G[0]&&null!==G[0]&&"string"==typeof G[0].name){var H=[];t.each(G,function(e){H.push(e.name)}),$=H.join(", ");var Z=[];t.each(H,function(e){Z.push(JSON.stringify(e))}),z=Z.join(",")}else $=G.join(""),z='"'+G.join('","')+'"';if(u+="_ctx."+r.name+" = function ("+$+') {\n var _output = "",\n __ctx = _utils.extend({}, _ctx);\n _utils.each(_ctx, function (v, k) {\n if (['+z+"].indexOf(k) !== -1) { delete _ctx[k]; }\n });\n"+W+"\n _ctx = _utils.extend(_ctx, __ctx);\n return _output;\n};\n_ctx."+r.name+".safe = true;\n",c&&"async"===c.codegenMode){if(-1!==n.dangerousProps.indexOf(r.name))throw new Error('Macro name "'+r.name+'" is reserved.');u+="_exports."+r.name+" = _ctx."+r.name+";\n"}}}else t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else u+=r.js;else u+='_output += "'+i(r.value)+'";\n'}),u},e.emitExpr=function(e,t){return c(e,s(t))}}}),x=t({"lib/lexer.js"(e){var t=n(),r=c(),o=[{type:r.WHITESPACE,regex:[/^\s+/]},{type:r.STRING,regex:[/^""/,/^".*?[^\\]"/,/^''/,/^'.*?[^\\]'/]},{type:r.FILTER,regex:[/^\|\s*(\w+)\(/],idx:1},{type:r.FILTEREMPTY,regex:[/^\|\s*(\w+)/],idx:1},{type:r.FUNCTIONEMPTY,regex:[/^\s*(\w+)\(\)/],idx:1},{type:r.FUNCTION,regex:[/^\s*(\w+)\(/],idx:1},{type:r.PARENOPEN,regex:[/^\(/]},{type:r.PARENCLOSE,regex:[/^\)/]},{type:r.COMMA,regex:[/^,/]},{type:r.LOGIC,regex:[/^(&&|\|\|)\s*/,/^(and|or)\s+/],idx:1,replace:{and:"&&",or:"||"}},{type:r.COMPARATOR,regex:[/^(===|==|\!==|\!=|<=|<|>=|>|in\s|gte\s|gt\s|lte\s|lt\s)\s*/],idx:1,replace:{gte:">=",gt:">",lte:"<=",lt:"<"}},{type:r.ASSIGNMENT,regex:[/^(=|\+=|-=|\*=|\/=)/]},{type:r.NOT,regex:[/^\!\s*/,/^not\s+/],replace:{not:"!"}},{type:r.BOOL,regex:[/^(true|false)\s+/,/^(true|false)$/],idx:1},{type:r.VAR,regex:[/^[a-zA-Z_$]\w*((\.\$?\w*)+)?/,/^[a-zA-Z_$]\w*/]},{type:r.BRACKETOPEN,regex:[/^\[/]},{type:r.BRACKETCLOSE,regex:[/^\]/]},{type:r.CURLYOPEN,regex:[/^\{/]},{type:r.COLON,regex:[/^\:/]},{type:r.CURLYCLOSE,regex:[/^\}/]},{type:r.DOTKEY,regex:[/^\.(\w+)/],idx:1},{type:r.NUMBER,regex:[/^\d+(\.\d+)?/]},{type:r.OPERATOR,regex:[/^(\+|\-|\/|\*|%)/]}];function a(e){var n;return t.some(o,function(r){return t.some(r.regex,function(t){var o,a=e.match(t);if(a)return o=a[r.idx||0].replace(/\s*$/,""),o=r.hasOwnProperty("replace")&&r.replace.hasOwnProperty(o)?r.replace[o]:o,n={match:o,type:r.type,length:a[0].length},!0})}),n||(n={match:e,type:r.UNKNOWN,length:e.length}),n}e.types=r,e.read=function(e){for(var t,r=0,n=[];r<e.length;)r+=(t=a(e.substring(r))).length,n.push(t);return n}}}),O=t({"packages/swig-core/lib/tokenparser.js"(e){var t=r(),n=c(),a=o(),i=v().dangerousProps,s=["break","case","catch","continue","debugger","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","this","throw","try","typeof","var","void","while","with"];function l(e,r,o,a,i){this.out=[],this.state=[],this.filterApplyIdx=[],this._parsers={},this.line=a,this.filename=i,this.filters=r,this.escape=o,this.parse=function(){var r=this;return r._parsers.start&&r._parsers.start.call(r),t.each(e,function(t,o){var a=e[o-1];if(r.isLast=o===e.length-1,a)for(;a.type===n.WHITESPACE;)a=e[(o-=1)-1];r.prevToken=a,r.parseToken(t)}),r._parsers.end&&r._parsers.end.call(r),r.escape&&(r.filterApplyIdx=[0],"string"==typeof r.escape?(r.parseToken({type:n.FILTER,match:"e"}),r.parseToken({type:n.COMMA,match:","}),r.parseToken({type:n.STRING,match:String(o)}),r.parseToken({type:n.PARENCLOSE,match:")"})):r.parseToken({type:n.FILTEREMPTY,match:"e"})),r.out}}l.prototype={on:function(e,t){this._parsers[e]=t},parseToken:function(e){var r,o=this,a=o._parsers[e.type]||o._parsers["*"],s=e.match,c=o.prevToken,l=c?c.type:null,p=o.state.length?o.state[o.state.length-1]:null;if(!a||"function"!=typeof a||a.call(this,e))switch(p&&c&&p===n.FILTER&&l===n.FILTER&&e.type!==n.PARENCLOSE&&e.type!==n.COMMA&&e.type!==n.OPERATOR&&e.type!==n.FILTER&&e.type!==n.FILTEREMPTY&&o.out.push(", "),p&&p===n.METHODOPEN&&(o.state.pop(),e.type!==n.PARENCLOSE&&o.out.push(", ")),e.type){case n.WHITESPACE:break;case n.STRING:if(p===n.BRACKETOPEN){var u=s.replace(/^['"]|['"]$/g,"");-1!==i.indexOf(u)&&t.throwError('Unsafe access to "'+u+'" via bracket notation is not allowed in templates (CVE-2023-25345)',o.line,o.filename)}o.filterApplyIdx.push(o.out.length),o.out.push(s.replace(/\\/g,"\\\\"));break;case n.NUMBER:case n.BOOL:o.filterApplyIdx.push(o.out.length),o.out.push(s);break;case n.FILTER:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.state.push(e.type);break;case n.FILTEREMPTY:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.out.push(")");break;case n.FUNCTION:case n.FUNCTIONEMPTY:o.out.push("((typeof _ctx."+s+' !== "undefined") ? _ctx.'+s+" : ((typeof "+s+' !== "undefined") ? '+s+" : _fn))("),o.escape=!1,e.type===n.FUNCTIONEMPTY?o.out[o.out.length-1]=o.out[o.out.length-1]+")":o.state.push(e.type),o.filterApplyIdx.push(o.out.length-1);break;case n.PARENOPEN:o.state.push(e.type),o.filterApplyIdx.length?(o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,"("),c&&l===n.VAR?(r=c.match.split(".").slice(0,-1),o.out.push(" || _fn).call("+o.checkMatch(r)),o.state.push(n.METHODOPEN),o.escape=!1):o.out.push(" || _fn)("),o.filterApplyIdx.push(o.out.length-3)):(o.out.push("("),o.filterApplyIdx.push(o.out.length-1));break;case n.PARENCLOSE:(r=o.state.pop())!==n.PARENOPEN&&r!==n.FUNCTION&&r!==n.FILTER&&t.throwError("Mismatched nesting state",o.line,o.filename),o.out.push(")"),o.filterApplyIdx.pop(),r!==n.FILTER&&o.filterApplyIdx.pop();break;case n.COMMA:p!==n.FUNCTION&&p!==n.FILTER&&p!==n.ARRAYOPEN&&p!==n.CURLYOPEN&&p!==n.PARENOPEN&&p!==n.COLON&&t.throwError("Unexpected comma",o.line,o.filename),p===n.COLON&&o.state.pop(),o.out.push(", "),o.filterApplyIdx.pop();break;case n.LOGIC:case n.COMPARATOR:c&&l!==n.COMMA&&l!==e.type&&l!==n.BRACKETOPEN&&l!==n.CURLYOPEN&&l!==n.PARENOPEN&&l!==n.FUNCTION||t.throwError("Unexpected logic",o.line,o.filename),o.out.push(e.match);break;case n.NOT:o.out.push(e.match);break;case n.VAR:o.parseVar(e,s,p);break;case n.BRACKETOPEN:!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.PARENCLOSE?(o.state.push(n.ARRAYOPEN),o.filterApplyIdx.push(o.out.length)):o.state.push(e.type),o.out.push("[");break;case n.BRACKETCLOSE:(r=o.state.pop())!==n.BRACKETOPEN&&r!==n.ARRAYOPEN&&t.throwError("Unexpected closing square bracket",o.line,o.filename),o.out.push("]"),o.filterApplyIdx.pop();break;case n.CURLYOPEN:o.state.push(e.type),o.out.push("{"),o.filterApplyIdx.push(o.out.length-1);break;case n.COLON:p!==n.CURLYOPEN&&t.throwError("Unexpected colon",o.line,o.filename),o.state.push(e.type),o.out.push(":"),o.filterApplyIdx.pop();break;case n.CURLYCLOSE:p===n.COLON&&o.state.pop(),o.state.pop()!==n.CURLYOPEN&&t.throwError("Unexpected closing curly brace",o.line,o.filename),o.out.push("}"),o.filterApplyIdx.pop();break;case n.DOTKEY:(!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.DOTKEY&&l!==n.PARENCLOSE&&l!==n.FUNCTIONEMPTY&&l!==n.FILTEREMPTY&&l!==n.CURLYCLOSE)&&t.throwError('Unexpected key "'+s+'"',o.line,o.filename),-1!==i.indexOf(s)&&t.throwError('Unsafe access to "'+s+'" is not allowed in templates (CVE-2023-25345)',o.line,o.filename),o.out.push("."+s);break;case n.OPERATOR:o.out.push(" "+s+" "),o.filterApplyIdx.pop()}},parseVar:function(e,r,o){var a=this;if(r=r.split("."),-1!==s.indexOf(r[0])&&t.throwError('Reserved keyword "'+r[0]+'" attempted to be used as a variable',a.line,a.filename),t.each(r,function(e){-1!==i.indexOf(e)&&t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',a.line,a.filename)}),a.filterApplyIdx.push(a.out.length),o===n.CURLYOPEN)return r.length>1&&t.throwError("Unexpected dot",a.line,a.filename),void a.out.push(r[0]);a.out.push(a.checkMatch(r))},parseExpr:function(e,r){var o=this,c=0;function l(){return function(){for(;c<e.length&&e[c].type===n.WHITESPACE;)c+=1}(),c<e.length?e[c]:null}function p(){var e=l();return e&&(c+=1),e}function u(e){t.throwError(e,o.line,o.filename)}function f(e){-1!==i.indexOf(e)&&u('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)')}function h(e){-1!==i.indexOf(e)&&u('Unsafe access to "'+e+'" via bracket notation is not allowed in templates (CVE-2023-25345)')}function d(e){var t;if(e.type===n.LOGIC){if("||"===e.match)return{op:"||",prec:1};if("&&"===e.match)return{op:"&&",prec:2}}if(e.type===n.COMPARATOR)return"==="===(t=e.match)||"!=="===t||"=="===t||"!="===t?{op:t,prec:3}:{op:t,prec:4};if(e.type===n.OPERATOR){if("+"===(t=e.match)||"-"===t)return{op:t,prec:5};if("*"===t||"/"===t||"%"===t)return{op:t,prec:6}}return null}function y(e){return e.replace(/^['"]|['"]$/g,"")}function g(e){var t=[],r=l();if(r&&r.type===e)return p(),t;for(;;){t.push(x(0));var o=p();if(o||u("Unexpected end of expression"),o.type===e)break;o.type!==n.COMMA&&u("Expected comma or closing delimiter")}return t}function v(e){for(;;){var t=l();if(!t)break;if(t.type===n.DOTKEY)p(),f(t.match),e="VarRef"===e.type?a.varRef(e.path.concat([t.match])):a.access(e,a.literal("string",t.match));else if(t.type===n.BRACKETOPEN){p();var r=x(0);"Literal"===r.type&&"string"===r.kind&&h(r.value);var i=p();i&&i.type===n.BRACKETCLOSE||u("Unexpected closing square bracket"),e=a.access(e,r)}else if(t.type===n.PARENOPEN)p(),e=a.fnCall(e,g(n.PARENCLOSE));else{if(t.type!==n.FILTER&&t.type!==n.FILTEREMPTY)break;p();var s,c=t.match;o.filters.hasOwnProperty(c)&&"function"==typeof o.filters[c]||u('Invalid filter "'+c+'"'),t.type===n.FILTER&&(s=g(n.PARENCLOSE)),e=a.filterCallExpr(c,e,s)}}return e}function m(){var e,r=p();switch(r||u("Unexpected end of expression"),r.type){case n.STRING:return a.literal("string",y(r.match));case n.NUMBER:return a.literal("number",parseFloat(r.match));case n.BOOL:return a.literal("bool","true"===r.match);case n.NOT:return a.unaryOp("!",E());case n.OPERATOR:if("+"===(e=r.match)||"-"===e)return a.unaryOp(e,E());u('Unexpected operator "'+e+'"');break;case n.PARENOPEN:var o=x(0),i=p();return i&&i.type===n.PARENCLOSE||u("Mismatched nesting state"),v(o);case n.BRACKETOPEN:return v(a.arrayLiteral(g(n.BRACKETCLOSE)));case n.CURLYOPEN:return v(function(){var e=[],t=l();if(t&&t.type===n.CURLYCLOSE)return p(),a.objectLiteral([]);for(;;){var r,o=p();o||u("Unclosed object literal"),o.type===n.STRING?r=a.literal("string",y(o.match)):o.type===n.VAR?(-1!==o.match.indexOf(".")&&u("Unexpected dot"),r=a.literal("string",o.match)):o.type===n.NUMBER?r=a.literal("number",parseFloat(o.match)):u("Unexpected object key");var i=p();i&&i.type===n.COLON||u("Unexpected colon");var s=x(0);e.push(a.objectProperty(r,s));var c=p();if(c||u("Unclosed object literal"),c.type===n.CURLYCLOSE)break;c.type!==n.COMMA&&u("Expected comma or closing curly brace")}return a.objectLiteral(e)}());case n.VAR:var c=r.match.split(".");return-1!==s.indexOf(c[0])&&u('Reserved keyword "'+c[0]+'" attempted to be used as a variable'),t.each(c,function(e){f(e)}),v(a.varRef(c));case n.FUNCTION:case n.FUNCTIONEMPTY:return e=r.match,-1!==s.indexOf(e)&&u('Reserved keyword "'+e+'" attempted to be used as a variable'),f(e),r.type===n.FUNCTIONEMPTY?v(a.fnCall(a.varRef([e]),[])):v(a.fnCall(a.varRef([e]),g(n.PARENCLOSE)))}return u('Unexpected token "'+r.match+'"'),null}function E(){return m()}function x(e){for(var t=E();;){var r=l();if(!r)break;if(r.type===n.FILTER||r.type===n.FILTEREMPTY)break;var o=d(r);if(!o||o.prec<e)break;p();var i=x(o.prec+1);t=a.binaryOp(o.op,t,i)}return t}var O=x(0);return r&&(r.pos=c),O},parseOutput:function(e){var r=this;function o(){var e=r.parse().join("");return a.output(a.legacyJS("_output += "+e+";\n"))}var i,s,c=!1;for(i=0;i<e.length;i+=1)if(e[i].type!==n.WHITESPACE){c=!0;break}if(!c)return o();if("string"==typeof r.escape)return o();var l=0,p=!1,u=!1,f=-1;for(i=0;i<e.length;i+=1)s=e[i],0===l&&(s.type!==n.OPERATOR&&s.type!==n.LOGIC&&s.type!==n.COMPARATOR&&s.type!==n.NOT||(p=!0),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||(u=!0,f<0&&(f=i))),s.type===n.PARENOPEN||s.type===n.FUNCTION||s.type===n.BRACKETOPEN||s.type===n.CURLYOPEN||s.type===n.FILTER?l+=1:s.type!==n.PARENCLOSE&&s.type!==n.BRACKETCLOSE&&s.type!==n.CURLYCLOSE||(l-=1);if(0===f)return o();try{var h=r.escape;for(i=0;i<e.length;i+=1)if((s=e[i]).type!==n.FUNCTION&&s.type!==n.FUNCTIONEMPTY||(h=!1),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||r.filters.hasOwnProperty(s.match)&&"function"==typeof r.filters[s.match]&&r.filters[s.match].safe&&(h=!1),s.type===n.PARENOPEN){for(var d=i-1;d>=0&&e[d].type===n.WHITESPACE;)d-=1;d>=0&&e[d].type===n.VAR&&(h=!1)}if(p&&u){var y=r.parseExpr(e),g=h?[a.filterCall("e")]:[];return a.output(y,g.length>0?g:void 0)}var v=f>=0?f:e.length,m=e.slice(0,v),E={pos:0},x=r.parseExpr(m,E),O=!1;for(i=E.pos;i<m.length;i+=1)if(m[i].type!==n.WHITESPACE){O=!0;break}if(O)return o();var w=[];if(f>=0)for(var C=f;C<e.length;){var b=e[C];if(b.type!==n.WHITESPACE)if(b.type!==n.FILTEREMPTY)if(b.type!==n.FILTER)t.throwError('Unexpected token "'+b.match+'"',r.line,r.filename);else{r.filters.hasOwnProperty(b.match)&&"function"==typeof r.filters[b.match]||t.throwError('Invalid filter "'+b.match+'"',r.line,r.filename),r.filters[b.match].safe&&(h=!1);for(var T=1,R=C+1,A=C+1;A<e.length&&T>0;){var N=e[A];if(N.type===n.PARENOPEN||N.type===n.FUNCTION||N.type===n.BRACKETOPEN||N.type===n.CURLYOPEN||N.type===n.FILTER)T+=1;else if((N.type===n.PARENCLOSE||N.type===n.BRACKETCLOSE||N.type===n.CURLYCLOSE)&&0===(T-=1))break;A+=1}0!==T&&t.throwError('Unable to parse filter "'+b.match+'"',r.line,r.filename);var k,P=[],_=R,L=1;for(k=R;k<A;k+=1){var S=e[k];S.type===n.PARENOPEN||S.type===n.FUNCTION||S.type===n.BRACKETOPEN||S.type===n.CURLYOPEN||S.type===n.FILTER?L+=1:S.type===n.PARENCLOSE||S.type===n.BRACKETCLOSE||S.type===n.CURLYCLOSE?L-=1:S.type===n.COMMA&&1===L&&(P.push(e.slice(_,k)),_=k+1)}_<A&&P.push(e.slice(_,A));var I,F=[];for(I=0;I<P.length;I+=1){var U,j=P[I],M=!1;for(U=0;U<j.length;U+=1)if(j[U].type!==n.WHITESPACE){M=!0;break}M&&F.push(r.parseExpr(j))}w.push(a.filterCall(b.match,F)),C=A+1}else r.filters.hasOwnProperty(b.match)&&"function"==typeof r.filters[b.match]||t.throwError('Invalid filter "'+b.match+'"',r.line,r.filename),r.filters[b.match].safe&&(h=!1),w.push(a.filterCall(b.match)),C+=1;else C+=1}return h&&w.push(a.filterCall("e")),a.output(x,w.length>0?w:void 0)}catch(e){return o()}},checkMatch:function(e){var r=e[0],n=e.join(".");function o(n){var o=n+r,a=e,i="";return i="(typeof "+o+' !== "undefined" && '+o+" !== null",t.each(a,function(e,t){0!==t&&(i+=" && "+o+"."+e+" !== undefined && "+o+"."+e+" !== null",o+="."+e)}),i+=")"}return"("+o("_ctx.")+" ? _ctx."+n+" : ("+o("")+" ? "+n+' : ""))'}},e.TokenParser=l}}),w=t({"lib/parser.js"(e){var t=n(),r=x(),o=r.types,a=O().TokenParser;function i(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}e.parse=function(n,s,c,l,p){s=s.replace(/\r\n/g,"\n");var u,f=c.autoescape,h=c.tagControls[0],d=c.tagControls[1],y=c.varControls[0],g=c.varControls[1],v=i(h),m=i(d),E=i(y),x=i(g),O=new RegExp("^"+v+"-?\\s*|\\s*-?"+m+"$","g"),w=new RegExp("^"+v+"-"),C=new RegExp("-"+m+"$"),b=new RegExp("^"+E+"-?\\s*|\\s*-?"+x+"$","g"),T=new RegExp("^"+E+"-"),R=new RegExp("-"+x+"$"),A=c.cmtControls[0],N=c.cmtControls[1],k="[\\s\\S]*?",P=new RegExp("("+v+k+m+"|"+E+k+x+"|"+i(A)+k+i(N)+")"),_=1,L=[],S=null,I=[],F={},U=!1;function j(e,n){var o,i,s=r.read(t.strip(e));return i=(o=new a(s,p,f,n,c.filename)).parseOutput(s),o.state.length&&t.throwError('Unable to parse "'+e+'"',n,c.filename),i}function M(e){return"string"==typeof e&&(e=e.replace(/\s*$/,"")),e}return e.parseVariable=j,t.each(s.split(P),function(e){var i,s,v,m,E;if(e){if(!U&&t.startsWith(e,y)&&t.endsWith(e,g))v=T.test(e),u=R.test(e),i=j(e.replace(b,""),_);else if(t.startsWith(e,h)&&t.endsWith(e,d))v=w.test(e),u=C.test(e),(i=function(e,i){var s,u,h,d,y,g,v;if(t.startsWith(e,"end")){if((v=L[L.length-1])&&v.name===e.split(/\s+/)[0].replace(/^end/,"")&&v.ends){switch(v.name){case"autoescape":f=c.autoescape;break;case"raw":U=!1}return void L.pop()}U||t.throwError('Unexpected end of tag "'+e.replace(/^end/,"")+'"',i,c.filename)}if(!U){switch(d=(h=e.split(/\s+(.+)?/)).shift(),l.hasOwnProperty(d)||t.throwError('Unexpected tag "'+e+'"',i,c.filename),s=r.read(t.strip(h.join(" "))),u=new a(s,p,!1,i,c.filename),(y=l[d]).parse(h[1],i,u,o,L,c,n)||t.throwError('Unexpected tag "'+d+'"',i,c.filename),u.parse(),g=u.out,d){case"autoescape":f="false"!==g[0]&&g[0];break;case"raw":U=!0}var m;return"function"==typeof y.lowerExpr&&(m=y.lowerExpr(u,s,h[1],i)),{block:!!l[d].block,compile:y.compile,args:g,content:[],ends:y.ends,name:d,irExpr:m}}}(e.replace(O,""),_))&&("extends"===i.name?S=i.args.join("").replace(/^\'|\'$/g,"").replace(/^\"|\"$/g,""):i.block&&!L.length&&(F[i.args.join("")]=i)),U&&!i&&(i=e);else if(U||!t.startsWith(e,A)&&!t.endsWith(e,N))i=u?e.replace(/^\s*/,""):e,u=!1;else if(t.startsWith(e,A)&&t.endsWith(e,N))return;v&&I.length&&("string"==typeof(m=I.pop())?m=M(m):m.content&&m.content.length&&(E=M(m.content.pop()),m.content.push(E)),I.push(m)),i&&(L.length?L[L.length-1].content.push(i):I.push(i),i.name&&i.ends&&L.push(i),s=e.match(/\n/g),_+=s?s.length:0)}}),{name:c.filename,parent:S,tokens:I,blocks:F}},e.compile=E().compile}}),C=t({"lib/tags/import.js"(e){var t=n(),r=E(),o=v().dangerousProps;e.compile=function(e,r){var n=r.pop(),o=t.map(r,function(e){return e.name}).join("|"),a="_ctx."+n+' = {};\n var _output = "";\n',i=t.map(r,function(e){return{ex:new RegExp("_ctx."+e.name+"(\\W)(?!"+o+")","g"),re:"_ctx."+n+"."+e.name+"$1"}});return t.each(r,function(e){var r=e.compiled;t.each(i,function(e){r=r.replace(e.ex,e.re)}),a+=r}),a},e.parse=function(e,n,a,i,s,c,l){var p,u,f=w().compile,h={resolveFrom:c.filename},d=t.extend({},c,h);return a.on(i.STRING,function(e){var o=this;if(!p)return p=l.parseFile(e.match.replace(/^("|')|("|')$/g,""),h).tokens,void t.each(p,function(e){var t,n="";e&&"macro"===e.name&&e.compile&&(t=e.args[0],n+=r.compile([e.compile(f,e.args,e.content,[],d)],[],d)+"\n",o.out.push({compiled:n,name:t}))});throw new Error("Unexpected string "+e.match+" on line "+n+".")}),a.on(i.VAR,function(e){if(!p||u)throw new Error('Unexpected variable "'+e.match+'" on line '+n+".");if("as"!==e.match){if(-1!==o.indexOf(e.match))throw new Error('Unsafe import alias "'+e.match+'" is not allowed (CVE-2023-25345) on line '+n+".");return u=e.match,this.out.push(u),!1}}),!0},e.block=!0}}),b=t({"lib/tags/include.js"(e){var t=o(),r=c(),n="ignore",a="missing",i="only";e.compile=function(e,r,n,o,s,c,l){var p=r.shift(),u=r.indexOf(i),f=-1!==u&&r.splice(u,1),h=(r.pop()||"").replace(/\\/g,"\\\\"),d=r[r.length-1]===a&&r.pop(),y=r.join("");return l&&l.irExpr&&(p=l.irExpr.file,y=void 0!==l.irExpr.context?l.irExpr.context:void 0),t.include(p,y||void 0,!!f,!!d,h)},e.lowerExpr=function(e,t){var o,a,s=0,c=-1,l=-1,p=-1;for(o=0;o<t.length;o++){if((a=t[o]).type===r.FILTER||a.type===r.FILTEREMPTY)return;a.type!==r.PARENOPEN&&a.type!==r.BRACKETOPEN&&a.type!==r.ARRAYOPEN&&a.type!==r.CURLYOPEN&&a.type!==r.FUNCTION&&a.type!==r.METHODOPEN?a.type!==r.PARENCLOSE&&a.type!==r.BRACKETCLOSE&&a.type!==r.CURLYCLOSE?0===s&&a.type===r.VAR&&(-1===c&&"with"===a.match?c=o:-1!==c&&-1===l&&a.match===i?l=o:-1===p&&a.match===n&&(p=o)):s--:s++}var u=t.length;-1!==c?u=c:-1!==p&&(u=p);var f=t.slice(0,u);if(0!==f.length){var h={file:e.parseExpr(f)};if(-1!==c){var d=t.length;-1!==l?d=l:-1!==p&&(d=p);var y=t.slice(c+1,d);y.length>0&&(h.context=e.parseExpr(y))}return h}},e.parse=function(e,t,r,o,s,c){var l,p;return r.on(o.STRING,function(e){return!!l||(l=e.match,void this.out.push(l))}),r.on(o.VAR,function(e){if(!l)return l=e.match,!0;if(p||"with"!==e.match){if(!p||e.match!==i||"with"===this.prevToken.match){if(e.match===n)return!1;if(e.match===a){if(this.prevToken.match!==n)throw new Error('Unexpected token "'+a+'" on line '+t+".");return this.out.push(e.match),!1}if(this.prevToken.match===n)throw new Error('Expected "'+a+'" on line '+t+' but found "'+e.match+'".');return!0}this.out.push(e.match)}else p=!0}),r.on("end",function(){this.out.push(c.filename||null)}),!0}}}),T=t({"lib/tags/macro.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s=r.shift();return t.macro(s,r,[t.legacyJS(e(n,o,a,i))])};var r=v().dangerousProps;e.parse=function(e,t,n,o){var a;return n.on(o.VAR,function(e){if(-1!==e.match.indexOf("."))throw new Error('Unexpected dot in macro argument "'+e.match+'" on line '+t+".");if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");return a=e.match,void this.out.push(a)}if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro argument "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.push({name:e.match})}),n.on(o.FUNCTION,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a),this.state.push(o.FUNCTION)}}),n.on(o.FUNCTIONEMPTY,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a)}}),n.on(o.PARENCLOSE,function(){if(!this.isLast)throw new Error("Unexpected parenthesis close on line "+t+".")}),n.on(o.COMMA,function(){}),n.on("*",function(){}),!0},e.ends=!0,e.block=!0}}),R=t({"lib/tags/parent.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){if(!o||!o.length)return"";for(var s,c,l=r[0],p=o.length,u=0;u<p;u+=1)if((s=o[u]).blocks&&s.blocks.hasOwnProperty(i)&&l!==s.name){var f=(c=s.blocks[i]).compile(e,[i],c.content,o.slice(u+1),a);return t.parent(f&&f.body?f.body.concat([t.legacyJS("\n")]):[t.legacyJS("\n")])}},e.parse=function(e,t,r,n,o,a){return r.on("*",function(e){throw new Error('Unexpected argument "'+e.match+'" on line '+t+".")}),r.on("end",function(){this.out.push(a.filename)}),!0}}}),A=t({"lib/tags/raw.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s,c=[];for(s=0;s<n.length;s++)"string"==typeof n[s]?c.push(t.raw(n[s])):c.push(t.legacyJS(e([n[s]],o,a,i)));return c},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" in raw tag on line '+t+".")}),!0},e.ends=!0}}),N=t({"lib/tags/set.js"(e){var t=o(),r=c(),n=/^_ctx\.([a-zA-Z_$][\w$]*)((?:\.[a-zA-Z_$][\w$]*)*)$/;e.compile=function(e,r,o,a,i,s,c){var l=r[0],p="string"==typeof l&&n.exec(l);if(p){var u=[p[1]];if(p[2])for(var f=p[2].split("."),h=1;h<f.length;h++)u.push(f[h]);l=t.varRef(u)}var d=c&&c.irExpr?c.irExpr:r.slice(2).join(" ");return t.set(l,r[1],d)};var a=v().dangerousProps;e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.ASSIGNMENT){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY||a[n].type===r.ASSIGNMENT)return;return e.parseExpr(a)}},e.parse=function(e,t,r,n){var o,i="";return r.on(n.VAR,function(e){if(o)o+="_ctx."+e.match;else{if(r.out.length)return!0;for(var n=e.match.split("."),s=0;s<n.length;s++)if(-1!==a.indexOf(n[s]))throw new Error('Unsafe assignment to "'+n[s]+'" is not allowed (CVE-2023-25345) on line '+t+".");i+=e.match}}),r.on(n.BRACKETOPEN,function(e){if(o||this.out.length)return!0;o=e.match}),r.on(n.STRING,function(e){if(!o||this.out.length)return!0;var r=e.match.replace(/^['"]|['"]$/g,"");if(-1!==a.indexOf(r))throw new Error('Unsafe assignment to "'+r+'" via bracket notation is not allowed (CVE-2023-25345) on line '+t+".");o+=e.match}),r.on(n.BRACKETCLOSE,function(e){return!(o&&!this.out.length)||(i+=o+e.match,void(o=void 0))}),r.on(n.DOTKEY,function(e){if(!o&&!i)return!0;if(-1!==a.indexOf(e.match))throw new Error('Unsafe assignment to "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");i+="."+e.match}),r.on(n.ASSIGNMENT,function(e){if(this.out.length||!i)throw new Error('Unexpected assignment "'+e.match+'" on line '+t+".");this.out.push("_ctx."+i),this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),!0},e.block=!0}}),k=t({"lib/tags/spaceless.js"(e){n();e.compile=function(e,t,r,n,o,a){var i=e(r,n,o,a);return i+='_output = _output.replace(/^\\s+/, "")\n .replace(/>\\s+</g, "><")\n .replace(/\\s+$/, "");\n'},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" on line '+t+".")}),!0},e.ends=!0}}),P=t({"lib/tags/index.js"(e){e.autoescape=a(),e.block=i(),e.else=s(),e.elseif=p(),e.elif=e.elseif,e.extends=u(),e.filter=g(),e.for=m(),e.if=l(),e.import=C(),e.include=b(),e.macro=T(),e.parent=R(),e.raw=A(),e.set=N(),e.spaceless=k()}}),_=t({"browser/stubs/fs.js"(e,t){t.exports={}}}),L=t({"node_modules/path-browserify/index.js"(e,t){"use strict";function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var r,n="",o=0,a=-1,i=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(a===s-1||1===i);else if(a!==s-1&&2===i){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),a=s,i=0;continue}}else if(2===n.length||1===n.length){n="",o=0,a=s,i=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),o=s-a-1;a=s,i=0}else 46===r&&-1!==i?++i:i=-1}return n}var o={resolve:function(){for(var e,t="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var i;a>=0?i=arguments[a]:(void 0===e&&(e=process.cwd()),i=e),r(i),0!==i.length&&(t=i+"/"+t,o=47===i.charCodeAt(0))}return t=n(t,!o),o?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!t)).length||t||(e="."),e.length>0&&o&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":o.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=o.resolve(e))===(t=o.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var a=e.length,i=a-n,s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var c=t.length-s,l=i<c?i:c,p=-1,u=0;u<=l;++u){if(u===l){if(c>l){if(47===t.charCodeAt(s+u))return t.slice(s+u+1);if(0===u)return t.slice(s+u)}else i>l&&(47===e.charCodeAt(n+u)?p=u:0===u&&(p=0));break}var f=e.charCodeAt(n+u);if(f!==t.charCodeAt(s+u))break;47===f&&(p=u)}var h="";for(u=n+p+1;u<=a;++u)u!==a&&47!==e.charCodeAt(u)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(s+p):(s+=p,47===t.charCodeAt(s)&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,a=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!a){o=i;break}}else a=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,a=-1,i=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!i){o=n+1;break}}else-1===c&&(i=!1,c=n+1),s>=0&&(l===t.charCodeAt(s)?-1===--s&&(a=n):(s=-1,a=c))}return o===a?a=c:-1===a&&(a=e.length),e.slice(o,a)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!i){o=n+1;break}}else-1===a&&(i=!1,a=n+1);return-1===a?"":e.slice(o,a)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,a=!0,i=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(a=!1,o=s+1),46===c?-1===t?t=s:1!==i&&(i=1):-1!==t&&(i=-1);else if(!a){n=s+1;break}}return-1===t||-1===o||0===i||1===i&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),a=47===o;a?(t.root="/",n=1):n=0;for(var i=-1,s=0,c=-1,l=!0,p=e.length-1,u=0;p>=n;--p)if(47!==(o=e.charCodeAt(p)))-1===c&&(l=!1,c=p+1),46===o?-1===i?i=p:1!==u&&(u=1):-1!==i&&(u=-1);else if(!l){s=p+1;break}return-1===i||-1===c||0===u||1===u&&i===c-1&&i===s+1?-1!==c&&(t.base=t.name=0===s&&a?e.slice(1,c):e.slice(s,c)):(0===s&&a?(t.name=e.slice(1,i),t.base=e.slice(1,c)):(t.name=e.slice(s,i),t.base=e.slice(s,c)),t.ext=e.slice(i,c)),s>0?t.dir=e.slice(0,s-1):a&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,t.exports=o}}),S=t({"packages/swig-core/lib/loaders/filesystem.js"(e,t){var r=_(),n=L();t.exports=function(e,t){var o={};return t=t||"utf8",e=e?n.normalize(e):null,o.resolve=function(t,r){return r=e||(r?n.dirname(r):process.cwd()),n.resolve(r,t)},o.load=function(e,n){if(!r||n&&!r.readFile||!r.readFileSync)throw new Error("Unable to find file "+e+" because there is no filesystem to read from.");if(e=o.resolve(e),!n)return r.readFileSync(e,t);r.readFile(e,t,n)},o}}}),I=t({"packages/swig-core/lib/loaders/memory.js"(e,t){var n=L(),o=r();t.exports=function(e,t){var r={};return t=t?n.normalize(t):null,r.resolve=function(e,r){return r=t||(r?n.dirname(r):"/"),n.resolve(r,e)},r.load=function(t,r){var n,a;if(a=[t,t.replace(/^(\/|\\)/,"")],(n=e[a[0]]||e[a[1]])||o.throwError('Unable to find template "'+t+'".'),!r)return n;r(null,n)},r}}}),F=t({"packages/swig-core/lib/loaders/index.js"(e){e.fs=S(),e.memory=I()}}),U=t({"lib/loaders/index.js"(e,t){t.exports=F()}}),j=t({"lib/async/pre-walker.js"(e){var t=n();function r(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}function o(e,t,r){var n=e.substr(t.length,e.length-t.length-r.length);return"-"===n.charAt(0)&&(n=n.substr(1)),"-"===n.charAt(n.length-1)&&(n=n.substr(0,n.length-1)),n.replace(/^\s+|\s+$/g,"")}e.scan=function(e,n){e=e.replace(/\r\n/g,"\n");var a,i,s,c,l,p=function(e){var t="[\\s\\S]*?",n=r(e.varControls[0]),o=r(e.varControls[1]),a=r(e.tagControls[0]),i=r(e.tagControls[1]),s=r(e.cmtControls[0]),c=r(e.cmtControls[1]);return new RegExp("("+a+t+i+"|"+n+t+o+"|"+s+t+c+")")}(n),u=n.tagControls[0],f=n.tagControls[1],h=n.rawTag,d="end"+h,y=new RegExp("^("+n.keywords.join("|")+")\\s+[\"\\']([^\"\\']+)[\"\\']"),g=e.split(p),v=[],m=!1;for(a=0;a<g.length;a+=1)"string"==typeof(i=g[a])&&i&&t.startsWith(i,u)&&t.endsWith(i,f)&&((c=(s=o(i,u,f)).split(/\s+/)[0])!==h?c!==d?m||(l=y.exec(s))&&v.push({kind:l[1],path:l[2]}):m=!1:m=!0);return v},e.walk=function(t,r,n){var o={},a={};return new Promise(function(i,s){var c=0,l=[],p=!1;function u(e){o.hasOwnProperty(e)||a[e]||(a[e]=!0,l.push(e))}function f(){for(;l.length>0&&!p;){var e=l.shift();c+=1,h(e)}0!==c||p||0!==l.length||i(o)}function h(t){r.load(t,function(a,i){if(!p){if(a)return p=!0,void s(a);if("string"!=typeof i)return p=!0,void s(new Error('Async loader returned non-string source for "'+t+'"'));var l,h,d;o[t]=i;try{l=e.scan(i,n)}catch(e){return p=!0,void s(e)}for(h=0;h<l.length;h+=1){try{d=r.resolve(l[h].path,t)}catch(e){return p=!0,void s(e)}u(d)}c-=1,f()}})}u(t),f()})},e.makeMemoryWrapper=function(e,t){return{resolve:function(t,r){return e.resolve(t,r)},load:function(e,r){var n=t[e];if("string"!=typeof n){var o=new Error('Pre-walked map missing path: "'+e+'"');if(r)return void r(o);throw o}if(!r)return n;r(null,n)}}}}}),M=t({"packages/swig-core/lib/cache.js"(e){e.shouldCache=function(e,t){return(e=e||{}).hasOwnProperty("cache")&&!e.cache||!t},e.cacheGet=function(t,r,n,o){if(!e.shouldCache(r,n))return"memory"===n?o[t]:n.get(t)},e.cacheSet=function(t,r,n,o,a){e.shouldCache(r,o)||("memory"!==o?o.set(t,n):a[t]=n)}}}),Y=t({"packages/swig-core/lib/engine.js"(e){var t=r(),n=E(),o=M(),a=Object.getPrototypeOf(async function(){}).constructor;function i(){return""}e.remapBlocks=function e(r,n){return t.map(n,function(t){var n=t.args?t.args.join(""):"";return"block"===t.name&&r[n]&&(t=r[n]),t.content&&t.content.length&&(t.content=e(r,t.content)),t})},e.importNonBlocks=function(e,r){var n=[];t.each(e,function(e){n.push(e)}),t.each(n.reverse(),function(e){"block"!==e.name&&r.unshift(e)})},e.getParents=function(r,n,o){for(var a,i,s,c=r.parent,l=[],p=[];c;){if(!n||!n.filename)throw new Error('Cannot extend "'+c+'" because current template has no filename.');if(a=a||n.filename,a=o.resolve(c,a),c=(i=o.cacheGet(a,n)||o.parseFile(a,t.extend({},n,{filename:a}))).parent,-1!==l.indexOf(a))throw new Error('Illegal circular extends of "'+a+'".');l.push(a),p.push(i)}for(s=p.length,s=p.length-2;s>=0;s-=1)p[s].tokens=e.remapBlocks(p[s].blocks,p[s+1].tokens),e.importNonBlocks(p[s].blocks,p[s].tokens);return p},e.buildTemplateFunction=function(e,t,r){if(r&&"async"===r.codegenMode){var o=' var _ext = _swig.extensions,\n _output = "",\n _exports = {};\n'+n.compile(e,t,r)+"\n return { output: _output, exports: _exports };\n";return new a("_swig","_ctx","_filters","_utils","_fn","_blocks",o)}var i=' var _ext = _swig.extensions,\n _output = "";\n'+n.compile(e,t,r)+"\n return _output;\n";return new Function("_swig","_ctx","_filters","_utils","_fn",i)},e.install=function(r,n){var a=n.parser,s=t.extend({},n.tags),c=t.extend({},n.filters),l=n.validateOptions,p=n.onCompileError;function u(e){return e&&e.locals?t.extend({},r.options.locals,e.locals):r.options.locals}function f(e,t){return o.cacheGet(e,t,r.options.cache,r.cache)}function h(e,t,n){o.cacheSet(e,t,n,r.options.cache,r.cache)}r.invalidateCache=function(){"memory"===r.options.cache&&(r.cache={})},r.setFilter=function(e,t){if("function"!=typeof t)throw new Error('Filter "'+e+'" is not a valid function.');c[e]=t},r.setTag=function(e,t,r,n,o){if("function"!=typeof t)throw new Error('Tag "'+e+'" parse method is not a valid function.');if("function"!=typeof r)throw new Error('Tag "'+e+'" compile method is not a valid function.');s[e]={parse:t,compile:r,ends:n||!1,block:!!o}},r.setExtension=function(e,t){r.extensions[e]=t},r.parse=function(e,n){l(n);var o,i=u(n),p={};for(o in n)n.hasOwnProperty(o)&&"locals"!==o&&(p[o]=n[o]);return(n=t.extend({},r.options,p)).locals=i,a.parse(r,e,n,s,c)},r.parseFile=function(e,n){var o;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),o=r.options.loader.load(e),n.filename||(n=t.extend({filename:e},n)),r.parse(o,n)},r.precompile=function(t,n){var o,a=r.parse(t,n),i=function(t,n){return e.getParents(t,n,{resolve:function(e,t){return r.options.loader.resolve(e,t)},parseFile:r.parseFile,cacheGet:f})}(a,n);i.length&&(a.tokens=e.remapBlocks(a.blocks,i[0].tokens),e.importNonBlocks(a.blocks,a.tokens));try{o=e.buildTemplateFunction(a,i,n)}catch(e){p(e,n)}return{tpl:o,tokens:a}},r.compile=function(e,n){var o,a,s,l=n?n.filename:null,p=l?f(l,n):null;if(p)return p;function d(e,n){var l;return l=e&&a?t.extend({},o,e):e&&!a?e:!e&&a?o:{},s.tpl(r,l,c,t,i,n)}return o=u(n),a=t.keys(o).length,s=r.precompile(e,n),t.extend(d,s.tokens),l&&h(l,n,d),d},r.compileFile=function(e,n,o){var a,i;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),n.filename||(n=t.extend({filename:e},n)),(i=f(e,n))?o?void o(null,i):i:o?void r.options.loader.load(e,function(e,t){if(e)o(e);else{var a;try{a=r.compile(t,n)}catch(e){return void o(e)}o(e,a)}}):(a=r.options.loader.load(e),r.compile(a,n))},r.getTemplate=function(e,n){var o;n=n||{};try{o=r.options.loader.resolve(e,n.resolveFrom)}catch(e){return Promise.reject(e)}var a=t.extend({},n,{filename:n.filename||o,codegenMode:"async",cache:!1});return new Promise(function(e,t){function n(n,o){if(n)t(n);else{var i;try{i=r.compile(o,a)}catch(e){return void t(e)}e(i)}}if(r.options.loader.load.length>=2)try{r.options.loader.load(o,n)}catch(e){n(e)}else{var i;try{i=r.options.loader.load(o)}catch(e){return void n(e)}n(null,i)}})},r.render=function(e,t){return r.compile(e,t)()},r.renderFile=function(e,t,n){if(!n)return r.compileFile(e)(t);r.compileFile(e,{},function(e,r){var o;if(e)n(e);else{try{o=r(t)}catch(e){return void n(e)}n(null,o)}})},r.run=function(e,n,o){var a=u({locals:n});return o&&h(o,{},e),e(r,a,c,t,i)}}}}),D=t({"lib/swig.js"(e){var t=n(),r=P(),o=y(),a=w(),i=h(),s=U(),c=j(),l=Y();e.version="2.1.0";var p,u={autoescape:!0,varControls:["{{","}}"],tagControls:["{%","%}"],cmtControls:["{#","#}"],locals:{},cache:"memory",loader:s.fs()};function f(e){if(e){if(t.each(["varControls","tagControls","cmtControls"],function(r){if(e.hasOwnProperty(r)){if(!t.isArray(e[r])||2!==e[r].length)throw new Error('Option "'+r+'" must be an array containing 2 different control strings.');if(e[r][0]===e[r][1])throw new Error('Option "'+r+'" open and close controls must not be the same.');t.each(e[r],function(e,t){if(e.length<2)throw new Error('Option "'+r+'" '+(t?"open ":"close ")+'control must be at least 2 characters. Saw "'+e+'" instead.')})}}),e.hasOwnProperty("cache")&&e.cache&&"memory"!==e.cache&&(!e.cache.get||!e.cache.set))throw new Error("Invalid cache option "+JSON.stringify(e.cache)+' found. Expected "memory" or { get: function (key) { ... }, set: function (key, value) { ... } }.');if(e.hasOwnProperty("loader")&&e.loader&&(!e.loader.load||!e.loader.resolve))throw new Error("Invalid loader option "+JSON.stringify(e.loader)+" found. Expected { load: function (pathname, cb) { ... }, resolve: function (to, from) { ... } }.")}}e.setDefaults=function(e){f(e),p.options=t.extend(p.options,e)},e.setDefaultTZOffset=function(e){i.tzOffset=e},e.Swig=function(e){f(e),this.options=t.extend({},u,e||{}),this.cache={},this.extensions={},l.install(this,{parser:a,tags:r,filters:o,validateOptions:f,onCompileError:function(e,r){t.throwError(e,null,r.filename)}});var n=this;function i(){return{varControls:n.options.varControls,tagControls:n.options.tagControls,cmtControls:n.options.cmtControls,rawTag:"raw",keywords:["extends","include","import"]}}this.renderFileAsync=function(e,t,r){"function"==typeof t&&(r=t,t=void 0);var o,a=n.options.loader;try{o=a.resolve(e)}catch(e){return void r(e)}c.walk(o,a,i()).then(function(e){var i,s,l=c.makeMemoryWrapper(a,e),p=n.options.loader;n.options.loader=l;try{i=n.renderFile(o,t)}catch(e){s=e}n.options.loader=p,s?r(s):r(null,i)},function(e){r(e)})},this.compileFileAsync=function(e,t,r){"function"==typeof t&&(r=t,t={});var o,a=n.options.loader;try{o=a.resolve(e)}catch(e){return void r(e)}c.walk(o,a,i()).then(function(e){var i,s,l=c.makeMemoryWrapper(a,e),p=n.options.loader;n.options.loader=l;try{i=n.compileFile(o,t)}catch(e){s=e}if(n.options.loader=p,s)r(s);else{r(null,function(e){var t=n.options.loader;n.options.loader=l;try{var r=i(e);return n.options.loader=t,r}catch(e){throw n.options.loader=t,e}})}},function(e){r(e)})}},p=new e.Swig,e.setFilter=p.setFilter,e.setTag=p.setTag,e.setExtension=p.setExtension,e.parseFile=p.parseFile,e.precompile=p.precompile,e.compile=p.compile,e.compileFile=p.compileFile,e.compileFileAsync=p.compileFileAsync,e.render=p.render,e.renderFile=p.renderFile,e.renderFileAsync=p.renderFileAsync,e.run=p.run,e.invalidateCache=p.invalidateCache,e.loaders=s}})();"function"==typeof window.define&&"object"==typeof window.define.amd?window.define("swig",[],function(){return D}):window.swig=D})();
|
|
4
4
|
/*!
|
|
5
5
|
* Attach `loc` to the node if provided, skipping the assignment otherwise
|
|
6
6
|
* so consumers can tell "no source location available" from
|
|
@@ -65,10 +65,13 @@
|
|
|
65
65
|
* compiled VarRef body relies on. @private
|
|
66
66
|
*/
|
|
67
67
|
/*!
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
68
|
+
* Build the dot-path emit. `(checkDot_ctx ? _ctx.<path> : (checkDot_closure
|
|
69
|
+
* ? <path> : ""))` — checks the `_ctx.<path>` walk first, falls back to a
|
|
70
|
+
* bare-closure walk (covers macro params, host-globals like `Math`), and
|
|
71
|
+
* coerces a missing path to `""` for safe interpolation. Kept as a local
|
|
72
|
+
* private helper rather than imported from tokenparser.js because (a) it
|
|
73
|
+
* is a pure function of its argument and (b) the backend must not acquire
|
|
74
|
+
* a runtime dependency on the TokenParser module (which is a specific
|
|
72
75
|
* frontend concern, not a shared-backend one). @private
|
|
73
76
|
*/
|
|
74
77
|
/*!
|
|
@@ -108,6 +111,21 @@
|
|
|
108
111
|
* Loop over the source, split via the tag/var/comment regular expression splitter.
|
|
109
112
|
* Send each chunk to the appropriate parser.
|
|
110
113
|
*/
|
|
114
|
+
/*!
|
|
115
|
+
* Makes a string safe for a regular expression. Mirrors lib/parser.js.
|
|
116
|
+
* @private
|
|
117
|
+
*/
|
|
118
|
+
/*!
|
|
119
|
+
* Build the splitter regex from the controls trio. Mirrors the regex that
|
|
120
|
+
* parser.parse() builds at parse-time so the pre-walker chunks the same
|
|
121
|
+
* way the real parser would.
|
|
122
|
+
* @private
|
|
123
|
+
*/
|
|
124
|
+
/*!
|
|
125
|
+
* Strip tag controls and optional whitespace-control markers from a tag
|
|
126
|
+
* chunk, returning the trimmed tag body (e.g. `extends "x.html"`).
|
|
127
|
+
* @private
|
|
128
|
+
*/
|
|
111
129
|
/*!
|
|
112
130
|
* Export methods publicly
|
|
113
131
|
*/
|