Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

liquidjs

Package Overview
Dependencies
Maintainers
1
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liquidjs - npm Package Compare versions

Comparing version 9.27.1 to 9.28.0

dist/util/timezone-date.d.ts

14

CHANGELOG.md

@@ -0,1 +1,15 @@

# [9.28.0](https://github.com/harttle/liquidjs/compare/v9.27.1...v9.28.0) (2021-10-06)
### Bug Fixes
* skip root check for renderFile() ([822ba0b](https://github.com/harttle/liquidjs/commit/822ba0be0f1cfbedd50376aff8ac49eee71bd48c))
* support timezoneOffset for date from scope, [#401](https://github.com/harttle/liquidjs/issues/401) ([fd5ef47](https://github.com/harttle/liquidjs/commit/fd5ef474c36212e6a2446012dcd26bca93f84c7b))
### Features
* `relativeReference` for render/include/layout, [#395](https://github.com/harttle/liquidjs/issues/395) ([a3455eb](https://github.com/harttle/liquidjs/commit/a3455ebd0b207141c34630c0af44d917db2ca1dd))
* implement `forloop.name` as found in ruby shopify/liquid ([6dc7fad](https://github.com/harttle/liquidjs/commit/6dc7fada72467418806c1ee4bd7eaf3003690fe6))
## [9.27.1](https://github.com/harttle/liquidjs/compare/v9.27.0...v9.27.1) (2021-10-04)

@@ -2,0 +16,0 @@

3

dist/drop/forloop-drop.d.ts
import { Drop } from './drop';
export declare class ForloopDrop extends Drop {
protected i: number;
name: string;
length: number;
constructor(length: number);
constructor(length: number, collection: string, variable: string);
next(): void;

@@ -7,0 +8,0 @@ index0(): number;

import { ForloopDrop } from './forloop-drop';
export declare class TablerowloopDrop extends ForloopDrop {
private cols;
constructor(length: number, cols: number);
constructor(length: number, cols: number, collection: string, variable: string);
row(): number;

@@ -6,0 +6,0 @@ col0(): number;

@@ -8,2 +8,3 @@ import { FS } from './fs';

layouts: string[];
relativeReference: boolean;
}

@@ -18,6 +19,9 @@ export declare enum LookupType {

constructor(options: LoaderOptions);
lookup(file: string, type: LookupType, sync?: boolean): IterableIterator<string | Promise<boolean>>;
private candidates;
lookup(file: string, type: LookupType, sync?: boolean, currentFile?: string): IterableIterator<string | Promise<boolean>>;
shouldLoadRelative(currentFile: string): boolean;
isRelativePath(path: string): boolean;
candidates(file: string, dirs: string[], currentFile?: string, enforceRoot?: boolean): IterableIterator<string>;
private dirname;
private lookupError;
}
export {};

@@ -13,2 +13,4 @@ import { Template } from './template/template';

layouts?: string | string[];
/** Allow refer to layouts/partials by relative pathname. To avoid arbitrary filesystem read, paths been referenced also need to be within corresponding root, partials, layouts. Defaults to `true`. */
relativeReference?: boolean;
/** Add a extname (if filepath doesn't include one) before template file lookup. Eg: setting to `".html"` will allow including file by basename. Defaults to `""`. */

@@ -72,2 +74,3 @@ extname?: string;

layouts: string[];
relativeReference: boolean;
extname: string;

@@ -99,3 +102,3 @@ cache: undefined | Cache<Template[]>;

export declare function applyDefault(options: NormalizedOptions): NormalizedFullOptions;
export declare function normalizeStringArray(value: any): string[];
export declare function normalizeDirectoryList(value: any): string[];
export {};

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).liquidjs={})}(this,function(p){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function t(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(s,o,a,u){return new(a=a||Promise)(function(t,e){function r(t){try{i(u.next(t))}catch(t){e(t)}}function n(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(r,n)}i((u=u.apply(s,o||[])).next())})}function T(r,n){var i,s,o,t,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,s&&(o=2&e[0]?s.return:e[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(o=0<(o=a.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(r,a)}catch(t){e=[6,t],s=0}finally{i=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}function k(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function m(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,s=r.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function w(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}var o=(e.prototype.valueOf=function(){},e.prototype.liquidMethodMissing=function(t){},e);function e(){}var r=Object.prototype.toString,a=String.prototype.toLowerCase;function u(t){return"string"==typeof t}function c(t){return"function"==typeof t}function l(t){return u(t=f(t))?t:d(t)?"":String(t)}function f(t){return t instanceof o?t.valueOf():t}function h(t){return"number"==typeof t}function d(t){return null==t}function v(t){return"[object Array]"===r.call(t)}function g(t,e){for(var r in t=t||{})if(t.hasOwnProperty(r)&&!1===e(t[r],r,t))break;return t}function y(t){return t[t.length-1]}function b(t){var e=typeof t;return null!==t&&("object"==e||"function"==e)}function x(t,e,r){void 0===r&&(r=1);for(var n=[],i=t;i<e;i+=r)n.push(i);return n}function q(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return e+t})}function O(t,e,r,n){for(var i=e-(t=String(t)).length;0<i--;)t=n(t,r);return t}function S(t){return t}function F(t){return t.replace(/(\w?)([A-Z])/g,function(t,e,r){return(e?e+"_":"")+r.toLowerCase()})}function R(t,e){return null==t&&null==e?0:null==t?1:null==e?-1:(t=a.call(t))<(e=a.call(e))?-1:e<t?1:0}var E=function(t,e,r,n){this.key=t,this.value=e,this.next=r,this.prev=n},L=(P.prototype.write=function(t,e){if(this.cache[t])this.cache[t].value=e;else{var r=new E(t,e,this.head.next,this.head);this.head.next.prev=r,this.head.next=r,this.cache[t]=r,this.size++,this.ensureLimit()}},P.prototype.read=function(t){if(this.cache[t]){var e=this.cache[t].value;return this.remove(t),this.write(t,e),e}},P.prototype.remove=function(t){var e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--},P.prototype.clear=function(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}},P.prototype.ensureLimit=function(){this.size>this.limit&&this.remove(this.tail.prev.key)},P);function P(t,e){void 0===e&&(e=0),this.limit=t,this.size=e,this.cache={},this.head=new E("HEAD",null,null,null),this.tail=new E("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}var D=Object.freeze({resolve:function(t,e,i){return t.length&&"/"!==y(t)&&(t+="/"),function(t,e){var r=document.createElement("base");r.href=t;var n=document.getElementsByTagName("head")[0];n.insertBefore(r,n.firstChild);var i=document.createElement("a");i.href=e;var s=i.href;return n.removeChild(r),s}(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(t,e,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?t:e+r+i})},readFile:function(n){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,new Promise(function(t,e){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?t(r.responseText):e(new Error(r.statusText))},r.onerror=function(){e(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},readFileSync:function(t){var e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||300<=e.status)throw new Error(e.statusText);return e.responseText},exists:function(t){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,!0]})})},existsSync:function(t){return!0}});function N(t){return t&&c(t.equals)}function M(t,e){return!A(t,e)}function A(t,e){return e.opts.jsTruthy?!t:!1===t||null==t}var I={"==":function(t,e){return N(t)?t.equals(e):N(e)?e.equals(t):t===e},"!=":function(t,e){return N(t)?!t.equals(e):N(e)?!e.equals(t):t!==e},">":function(t,e){return N(t)?t.gt(e):N(e)?e.lt(t):e<t},"<":function(t,e){return N(t)?t.lt(e):N(e)?e.gt(t):t<e},">=":function(t,e){return N(t)?t.geq(e):N(e)?e.leq(t):e<=t},"<=":function(t,e){return N(t)?t.leq(e):N(e)?e.geq(t):t<=e},contains:function(t,e){return!(!t||!c(t.indexOf))&&-1<t.indexOf(e)},and:function(t,e,r){return M(t,r)&&M(e,r)},or:function(t,e,r){return M(t,r)||M(e,r)}},_=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],V=1,j=4,B=16;function C(t){var e,r,n={};try{for(var i=k(Object.entries(t)),s=i.next();!s.done;s=i.next()){for(var o=m(s.value,2),a=o[0],u=o[1],c=n,l=0;l<a.length;l++){var h=a[l];c[h]=c[h]||{},l===a.length-1&&_[a.charCodeAt(l)]&V&&(c[h].needBoundary=!0),c=c[h]}c.handler=u,c.end=!0}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}_[160]=_[5760]=_[6158]=_[8192]=_[8193]=_[8194]=_[8195]=_[8196]=_[8197]=_[8198]=_[8199]=_[8200]=_[8201]=_[8202]=_[8232]=_[8233]=_[8239]=_[8287]=_[12288]=j;var z=(new Date).getTimezoneOffset(),H=/([zZ]|([+-])(\d{2}):(\d{2}))$/,K=/%([-_0^#:]+)?(\d+)?([EO])?(.)/,U=["January","February","March","April","May","June","July","August","September","October","November","December"],Q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],W=U.map($),J=Q.map($),Y={1:"st",2:"nd",3:"rd",default:"th"};function $(t){return t.slice(0,3)}function G(t){for(var e=0,r=0;r<t.getMonth();++r)e+=[31,function(t){var e=t.getFullYear();return!(0!=(3&e)||!(e%100||e%400==0&&e))}(t)?29:28,31,30,31,30,31,31,30,31,30,31][r];return e+t.getDate()}function X(t,e){var r=G(t)+(e-t.getDay()),n=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((r-n)/7)+1)}var Z={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},tt={a:" ",A:" ",b:" ",B:" ",c:" ",e:" ",k:" ",l:" ",p:" ",P:" "},et={a:function(t){return J[t.getDay()]},A:function(t){return Q[t.getDay()]},b:function(t){return W[t.getMonth()]},B:function(t){return U[t.getMonth()]},c:function(t){return t.toLocaleString()},C:function(t){return function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t)},d:function(t){return t.getDate()},e:function(t){return t.getDate()},H:function(t){return t.getHours()},I:function(t){return String(t.getHours()%12||12)},j:function(t){return G(t)},k:function(t){return t.getHours()},l:function(t){return String(t.getHours()%12||12)},L:function(t){return t.getMilliseconds()},m:function(t){return t.getMonth()+1},M:function(t){return t.getMinutes()},N:function(t,e){var r=Number(e.width)||9;return function(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return t+e})}(String(t.getMilliseconds()).substr(0,r),r,"0")},p:function(t){return t.getHours()<12?"AM":"PM"},P:function(t){return t.getHours()<12?"am":"pm"},q:function(t){return function(t){var e=t.getDate().toString(),r=parseInt(e.slice(-1));return Y[r]||Y.default}(t)},s:function(t){return Math.round(t.valueOf()/1e3)},S:function(t){return t.getSeconds()},u:function(t){return t.getDay()||7},U:function(t){return X(t,0)},w:function(t){return t.getDay()},W:function(t){return X(t,1)},x:function(t){return t.toLocaleDateString()},X:function(t){return t.toLocaleTimeString()},y:function(t){return t.getFullYear().toString().substring(2,4)},Y:function(t){return t.getFullYear()},z:function(t,e){var r=Math.abs(z),n=Math.floor(r/60),i=r%60;return(0<z?"-":"+")+q(n,2,"0")+(e.flags[":"]?":":"")+q(i,2,"0")},t:function(){return"\t"},n:function(){return"\n"},"%":function(){return"%"}};function rt(t,e){var r,n,i=m(e,5),s=i[0],o=i[1],a=void 0===o?"":o,u=i[2],c=i[3],l=i[4],h=et[l];if(!h)return s;var p={};try{for(var f=k(a),d=f.next();!d.done;d=f.next()){p[d.value]=!0}}catch(t){r={error:t}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var v=String(h(t,{flags:p,width:u,modifier:c})),g=tt[l]||"0",y=u||Z[l]||0;return p["^"]?v=v.toUpperCase():p["#"]&&(v=function(t){return w(t).some(function(t){return"a"<=t&&t<="z"})?t.toUpperCase():t.toLowerCase()}(v)),p._?g=" ":p[0]&&(g="0"),p["-"]&&(y=0),q(v,y,g)}et.h=et.b;var nt={root:["."],layouts:["."],partials:["."],cache:void 0,extname:"",fs:D,dynamicPartials:!0,jsTruthy:!1,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,lenientIf:!1,globals:{},keepOutputType:!1,timezoneOffset:z,operators:I,operatorsTrie:C(I)};function it(t){return v(t)?t:u(t)?[t]:[]}var st,ot=(t(at,st=Error),at.prototype.update=function(){var t=this.originalError;this.context=function(t){var e=m(t.getPosition(),1)[0],r=t.input.split("\n"),n=Math.max(e-2,1),i=Math.min(e+3,r.length);return x(n,i+1).map(function(t){return(t===e?">> ":" ")+q(String(t),String(i).length)+"| "+r[t-1]}).join("\n")}(this.token),this.message=function(t,e){e.file&&(t+=", file:"+e.file);var r=m(e.getPosition(),2),n=r[0],i=r[1];return t+=", line:"+n+", col:"+i}(t.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack+"\nFrom "+t.stack},at);function at(t,e){var r=st.call(this,t.message)||this;return r.originalError=t,r.token=e,r.context="",r}var ut,ct=(t(lt,ut=ot),lt);function lt(t,e){var r=ut.call(this,new Error(t),e)||this;return r.name="TokenizationError",ut.prototype.update.call(r),r}var ht,pt=(t(ft,ht=ot),ft);function ft(t,e){var r=ht.call(this,t,e)||this;return r.name="ParseError",r.message=t.message,ht.prototype.update.call(r),r}var dt,vt=(t(gt,dt=ot),gt.is=function(t){return"RenderError"===t.name},gt);function gt(t,e){var r=dt.call(this,t,e.token)||this;return r.name="RenderError",r.message=t.message,dt.prototype.update.call(r),r}var yt,mt=(t(wt,yt=ot),wt);function wt(t,e){var r=yt.call(this,t,e)||this;return r.name="UndefinedVariableError",r.message=t.message,yt.prototype.update.call(r),r}var bt,Tt=(t(kt,bt=Error),kt);function kt(t){var e=bt.call(this,"undefined variable: "+t)||this;return e.name="InternalUndefinedVariableError",e.variableName=t,e}var xt,qt=(t(Ot,xt=Error),Ot);function Ot(t){var e=xt.call(this,t)||this;return e.name="AssertionError",e.message=t+"",e}var St,Ft,Rt=(Et.prototype.getRegister=function(t){return this.registers[t]=this.registers[t]||{}},Et.prototype.setRegister=function(t,e){return this.registers[t]=e},Et.prototype.saveRegister=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.map(function(t){return[t,e.getRegister(t)]})},Et.prototype.restoreRegister=function(t){var i=this;return t.forEach(function(t){var e=m(t,2),r=e[0],n=e[1];return i.setRegister(r,n)})},Et.prototype.getAll=function(){return w([this.globals,this.environments],this.scopes).reduce(function(t,e){return i(t,e)},{})},Et.prototype.get=function(t){var e=this.findScope(t[0]);return this.getFromScope(e,t)},Et.prototype.getFromScope=function(t,e){var r=this;return"string"==typeof e&&(e=e.split(".")),e.reduce(function(t,e){if(d(t=function(t,e){return d(t)?t:c((t=function t(e){return e&&c(e.toLiquid)?t(e.toLiquid()):e}(t))[e])?t[e]():t instanceof o?t.hasOwnProperty(e)?t[e]:t.liquidMethodMissing(e):"size"===e?function(t){return v(t)||u(t)?t.length:t.size}(t):"first"===e?function(t){return v(t)?t[0]:t.first}(t):"last"===e?function(t){return v(t)?t[t.length-1]:t.last}(t):t[e]}(t,e))&&r.opts.strictVariables)throw new Tt(e);return t},t)},Et.prototype.push=function(t){return this.scopes.push(t)},Et.prototype.pop=function(){return this.scopes.pop()},Et.prototype.bottom=function(){return this.scopes[0]},Et.prototype.findScope=function(t){for(var e=this.scopes.length-1;0<=e;e--){var r=this.scopes[e];if(t in r)return r}return t in this.environments?this.environments:this.globals},Et);function Et(t,e,r){void 0===t&&(t={}),void 0===e&&(e=nt),void 0===r&&(r=!1),this.scopes=[{}],this.registers={},this.sync=r,this.opts=e,this.globals=e.globals,this.environments=t}(Ft=St=St||{}).Partials="partials",Ft.Layouts="layouts",Ft.Root="root";var Lt=(Pt.prototype.lookup=function(e,r,n){var i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:i=this.options.fs,s=this.options[r],t.label=1;case 1:t.trys.push([1,8,9,10]),o=k(this.candidates(e,s)),a=o.next(),t.label=2;case 2:return a.done?[3,7]:(u=a.value,n?(c=i.existsSync(u),[3,5]):[3,3]);case 3:return[4,i.exists(u)];case 4:c=t.sent(),t.label=5;case 5:if(c)return[2,u];t.label=6;case 6:return a=o.next(),[3,2];case 7:return[3,10];case 8:return l=t.sent(),h={error:l},[3,10];case 9:try{a&&!a.done&&(p=o.return)&&p.call(o)}finally{if(h)throw h.error}return[7];case 10:throw this.lookupError(e,s)}})},Pt.prototype.candidates=function(e,r){var n,i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:n=this.options,i=n.fs,s=n.extname,t.label=1;case 1:t.trys.push([1,6,7,8]),o=k(r),a=o.next(),t.label=2;case 2:return a.done?[3,5]:(u=a.value,[4,i.resolve(u,e,s)]);case 3:t.sent(),t.label=4;case 4:return a=o.next(),[3,2];case 5:return[3,8];case 6:return c=t.sent(),h={error:c},[3,8];case 7:try{a&&!a.done&&(p=o.return)&&p.call(o)}finally{if(h)throw h.error}return[7];case 8:return void 0===i.fallback?[3,10]:void 0===(l=i.fallback(e))?[3,10]:[4,l];case 9:t.sent(),t.label=10;case 10:return[2]}})},Pt.prototype.lookupError=function(t,e){var r=new Error("ENOENT");return r.message='ENOENT: Failed to lookup "'+t+'" in "'+e+'"',r.code="ENOENT",r},Pt);function Pt(t){this.options=t}var Dt=(Nt.prototype.write=function(t){this.buffer+=l(t)},Nt);function Nt(){this.buffer=""}var Mt=function(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")};function At(e){var t={then:function(t){return t(e)},catch:function(){return t}};return t}function It(r){var n={then:function(t,e){return e?e(r):n},catch:function(t){return t(r)}};return n}function _t(n){return function(t){return t&&c(t.then)}(n)?n:function(t){return t&&c(t.next)&&c(t.throw)&&c(t.return)}(n)?function r(t){var e;try{e=n.next(t)}catch(t){return It(t)}if(e.done)return At(e.value);return _t(e.value).then(r,function(t){var e;try{e=n.throw(t)}catch(t){return It(t)}return e.done?At(e.value):r(e.value)})}():At(n)}function Vt(t){return Promise.resolve(_t(t))}function jt(t){var e;return _t(t).then(function(t){return At(e=t)}).catch(function(t){throw t}),e}var Bt=(Ct.prototype.write=function(t){"string"!=typeof(t=f(t))&&""===this.buffer?this.buffer=t:this.buffer=l(this.buffer)+l(t)},Ct);function Ct(){this.buffer=""}var zt,Ht=(Kt.prototype.renderTemplatesToNodeStream=function(t,e){var r=this,n=new Mt;return Promise.resolve().then(function(){return _t(r.renderTemplates(t,e,n))}).then(function(){return n.end()},function(t){return n.error(t)}),n.stream},Kt.prototype.renderTemplates=function(e,r,n){var i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:n=n||(r.opts.keepOutputType?new Bt:new Dt),t.label=1;case 1:t.trys.push([1,8,9,10]),i=k(e),s=i.next(),t.label=2;case 2:if(s.done)return[3,7];o=s.value,t.label=3;case 3:return t.trys.push([3,5,,6]),[4,o.render(r,n)];case 4:return(a=t.sent())&&n.write(a),n.break||n.continue?[3,7]:[3,6];case 5:throw u=t.sent(),vt.is(u)?u:new vt(u,o);case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,n.buffer]}})},Kt);function Kt(){}function Ut(t){return!!(re(t)&p.TokenKind.Delimited)}function Qt(t){return re(t)===p.TokenKind.Operator}function Wt(t){return re(t)===p.TokenKind.HTML}function Jt(t){return re(t)===p.TokenKind.Output}function Yt(t){return re(t)===p.TokenKind.Tag}function $t(t){return re(t)===p.TokenKind.Quoted}function Gt(t){return re(t)===p.TokenKind.Literal}function Xt(t){return re(t)===p.TokenKind.Number}function Zt(t){return re(t)===p.TokenKind.PropertyAccess}function te(t){return re(t)===p.TokenKind.Word}function ee(t){return re(t)===p.TokenKind.Range}function re(t){return t?t.kind:-1}(zt=p.TokenKind||(p.TokenKind={}))[zt.Number=1]="Number",zt[zt.Literal=2]="Literal",zt[zt.Tag=4]="Tag",zt[zt.Output=8]="Output",zt[zt.HTML=16]="HTML",zt[zt.Filter=32]="Filter",zt[zt.Hash=64]="Hash",zt[zt.PropertyAccess=128]="PropertyAccess",zt[zt.Word=256]="Word",zt[zt.Range=512]="Range",zt[zt.Quoted=1024]="Quoted",zt[zt.Operator=2048]="Operator",zt[zt.Delimited=12]="Delimited";var ne=Object.freeze({isDelimitedToken:Ut,isOperatorToken:Qt,isHTMLToken:Wt,isOutputToken:Jt,isTagToken:Yt,isQuotedToken:$t,isLiteralToken:Gt,isNumberToken:Xt,isPropertyAccessToken:Zt,isWordToken:te,isRangeToken:ee}),ie=(se.prototype.on=function(t,e){return this.handlers[t]=e,this},se.prototype.trigger=function(t,e){var r=this.handlers[t];return!!r&&(r.call(this,e),!0)},se.prototype.start=function(){var t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());)if(!(this.trigger("token",t)||Yt(t)&&this.trigger("tag:"+t.name,t))){var e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this},se.prototype.stop=function(){return this.stopRequested=!0,this},se);function se(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}function oe(t){this.token=t}function ae(t,e){if(!t){var r=e?e():"expect "+t+" to be true";throw new qt(r)}}var ue,ce=(t(le,ue=o),le.prototype.equals=function(t){return d(f(t))},le.prototype.gt=function(){return!1},le.prototype.geq=function(){return!1},le.prototype.lt=function(){return!1},le.prototype.leq=function(){return!1},le.prototype.valueOf=function(){return null},le);function le(){return null!==ue&&ue.apply(this,arguments)||this}var he,pe=(t(fe,he=o),fe.prototype.equals=function(t){return!(t instanceof fe||(u(t=f(t))||v(t)?0!==t.length:!b(t)||0!==Object.keys(t).length))},fe.prototype.gt=function(){return!1},fe.prototype.geq=function(){return!1},fe.prototype.lt=function(){return!1},fe.prototype.leq=function(){return!1},fe.prototype.valueOf=function(){return""},fe);function fe(){return null!==he&&he.apply(this,arguments)||this}var de,ve=(t(ge,de=pe),ge.prototype.equals=function(t){return!1===t||!!d(f(t))||(u(t)?/^\s*$/.test(t):de.prototype.equals.call(this,t))},ge);function ge(){return null!==de&&de.apply(this,arguments)||this}var ye=new ce,me={true:!0,false:!1,nil:ye,null:ye,empty:new pe,blank:new ve},we=/[\da-fA-F]/,be=/[0-7]/,Te={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function ke(t){var e=t.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}function xe(t){for(var e="",r=1;r<t.length-1;r++)if("\\"===t[r])if(void 0!==Te[t[r+1]])e+=Te[t[++r]];else if("u"===t[r+1]){for(var n=0,i=r+2;i<=r+5&&we.test(t[i]);)n=16*n+ke(t[i++]);r=i-1,e+=String.fromCharCode(n)}else if(be.test(t[r+1])){for(i=r+1,n=0;i<=r+3&&be.test(t[i]);)n=8*n+ke(t[i++]);r=i-1,e+=String.fromCharCode(n)}else e+=t[++r];else e+=t[r];return e}var qe=(Oe.prototype.evaluate=function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:ae(e,function(){return"unable to evaluate: context not defined"}),n=[],t.label=1;case 1:t.trys.push([1,9,10,11]),i=k(this.postfix),s=i.next(),t.label=2;case 2:return s.done?[3,8]:Qt(o=s.value)?[4,n.pop()]:[3,5];case 3:return a=t.sent(),[4,n.pop()];case 4:return u=t.sent(),c=function(t,e,r,n,i){return(0,t[e.operator])(r,n,i)}(e.opts.operators,o,u,a,e),n.push(c),[3,7];case 5:return h=(l=n).push,[4,Se(o,e,r&&1===this.postfix.length)];case 6:h.apply(l,[t.sent()]),t.label=7;case 7:return s=i.next(),[3,2];case 8:return[3,11];case 9:return p=t.sent(),f={error:p},[3,11];case 10:try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 11:return[2,n[0]]}})},Oe);function Oe(t){this.postfix=w(function(e){var r,n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:r=[],t.label=1;case 1:t.trys.push([1,10,11,12]),n=k(e),i=n.next(),t.label=2;case 2:if(i.done)return[3,9];if(!Qt(s=i.value))return[3,6];t.label=3;case 3:return r.length&&r[r.length-1].getPrecedence()>s.getPrecedence()?[4,r.pop()]:[3,5];case 4:return t.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:t.sent(),t.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=t.sent(),a={error:o},[3,12];case 11:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(a)throw a.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return t.sent(),[3,12];case 14:return[2]}})}(t))}function Se(t,e,r){return void 0===r&&(r=!1),Zt(t)?function(e,r,n){var t=e.props.map(function(t){return Se(t,r,!1)});try{return r.get(w([e.propertyName],t))}catch(t){if(n&&"InternalUndefinedVariableError"===t.name)return null;throw new mt(t,e)}}(t,e,r):ee(t)?function(t,e){var r=Se(t.lhs,e),n=Se(t.rhs,e);return x(+r,+n+1)}(t,e):Gt(t)?function(t){return me[t.literal]}(t):Xt(t)?function(t){var e=t.whole.content+"."+(t.decimal?t.decimal.content:"");return Number(e)}(t):te(t)?t.getText():$t(t)?Fe(t):void 0}function Fe(t){return xe(t.getText())}var Re=(Ee.prototype.getText=function(){return this.input.slice(this.begin,this.end)},Ee.prototype.getPosition=function(){for(var t=m([1,1],2),e=t[0],r=t[1],n=0;n<this.begin;n++)"\n"===this.input[n]?(e++,r=1):r++;return[e,r]},Ee.prototype.size=function(){return this.end-this.begin},Ee);function Ee(t,e,r,n,i){this.kind=t,this.input=e,this.begin=r,this.end=n,this.file=i}var Le,Pe=(t(De,Le=Re),De);function De(t,e,r,n,i,s,o,a){var u=Le.call(this,t,r,n,i,a)||this;u.trimLeft=!1,u.trimRight=!1,u.content=u.getText();var c="-"===e[0],l="-"===y(e);return u.content=e.slice(c?1:0,l?-1:e.length).trim(),u.trimLeft=c||s,u.trimRight=l||o,u}function Ne(t,e){if(t&&Wt(t))for(var r=e?j:B;_[t.input.charCodeAt(t.end-1-t.trimRight)]&r;)t.trimRight++}function Me(t,e){if(t&&Wt(t)){for(var r=e?j:B;_[t.input.charCodeAt(t.begin+t.trimLeft)]&r;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}}var Ae,Ie=(t(_e,Ae=Re),_e);function _e(t,e){var r=Ae.call(this,p.TokenKind.Number,t.input,t.begin,e?e.end:t.end,t.file)||this;return r.whole=t,r.decimal=e,r}var Ve,je=(t(Be,Ve=Re),Be.prototype.isNumber=function(t){void 0===t&&(t=!1);for(var e=t&&64&_[this.input.charCodeAt(this.begin)]?this.begin+1:this.begin;e<this.end;e++)if(!(32&_[this.input.charCodeAt(e)]))return!1;return!0},Be);function Be(t,e,r,n){var i=Ve.call(this,p.TokenKind.Word,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.content=i.getText(),i}var Ce,ze=(t(He,Ce=Re),He);function He(t,e,r,n){var i=Ce.call(this,p.TokenKind.Literal,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.literal=i.getText(),i}var Ke,Ue={"==":1,"!=":1,">":1,"<":1,">=":1,"<=":1,contains:1,and:0,or:0},Qe=(t(We,Ke=Re),We.prototype.getPrecedence=function(){var t=this.getText();return t in Ue?Ue[t]:1},We);function We(t,e,r,n){var i=Ke.call(this,p.TokenKind.Operator,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.operator=i.getText(),i}var Je,Ye=(t($e,Je=Re),$e);function $e(t,e,r){var n=Je.call(this,p.TokenKind.PropertyAccess,t.input,t.begin,r,t.file)||this;return n.variable=t,n.props=e,n.propertyName=n.variable instanceof je?n.variable.getText():xe(n.variable.getText()),n}var Ge,Xe=(t(Ze,Ge=Re),Ze);function Ze(t,e,r,n,i,s){var o=Ge.call(this,p.TokenKind.Filter,r,n,i,s)||this;return o.name=t,o.args=e,o}var tr,er=(t(rr,tr=Re),rr);function rr(t,e,r,n,i,s){var o=tr.call(this,p.TokenKind.Hash,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.name=n,o.value=i,o.file=s,o}var nr,ir=(t(sr,nr=Re),sr);function sr(t,e,r,n){var i=nr.call(this,p.TokenKind.Quoted,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i}var or,ar=(t(ur,or=Re),ur.prototype.getContent=function(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)},ur);function ur(t,e,r,n){var i=or.call(this,p.TokenKind.HTML,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.trimLeft=0,i.trimRight=0,i}var cr,lr=(t(hr,cr=Re),hr);function hr(t,e,r,n,i,s){var o=cr.call(this,p.TokenKind.Range,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.lhs=n,o.rhs=i,o.file=s,o}var pr,fr=(t(dr,pr=Pe),dr);function dr(t,e,r,n,i){var s=n.trimOutputLeft,o=n.trimOutputRight,a=n.outputDelimiterLeft,u=n.outputDelimiterRight,c=t.slice(e+a.length,r-u.length);return pr.call(this,p.TokenKind.Output,c,t,e,r,s,o,i)||this}var vr=(gr.prototype.readExpression=function(){return new qe(this.readExpressionTokens())},gr.prototype.readExpressionTokens=function(){var e,r,n;return T(this,function(t){switch(t.label){case 0:return(e=this.readValue())?[4,e]:[2];case 1:t.sent(),t.label=2;case 2:return this.p<this.N?(r=this.readOperator())&&(n=this.readValue())?[4,r]:[2]:[3,5];case 3:return t.sent(),[4,n];case 4:return t.sent(),[3,2];case 5:return[2]}})},gr.prototype.readOperator=function(){this.skipBlank();var t=function(t,e,r,n){void 0===n&&(n=t.length);for(var i,s=r,o=e;s[t[o]]&&o<n;)(s=s[t[o++]]).end&&(i=s);return i?i.needBoundary&&_[t.charCodeAt(o)]&V?-1:o:-1}(this.input,this.p,this.trie,this.p+8);if(-1!==t)return new Qe(this.input,this.p,this.p=t,this.file)},gr.prototype.readFilters=function(){for(var t=[];;){var e=this.readFilter();if(!e)return t;t.push(e)}},gr.prototype.readFilter=function(){var t=this;if(this.skipBlank(),this.end())return null;ae("|"===this.peek(),function(){return"unexpected token at "+t.snapshot()}),this.p++;var e=this.p,r=this.readIdentifier();if(!r.size())return null;var n=[];if(this.skipBlank(),":"===this.peek())do{++this.p;var i=this.readFilterArg();for(i&&n.push(i);this.p<this.N&&","!==this.peek()&&"|"!==this.peek();)++this.p}while(","===this.peek());return new Xe(r.getText(),n,this.input,e,this.p,this.file)},gr.prototype.readFilterArg=function(){var t=this.readValue();if(t){if(this.skipBlank(),":"!==this.peek())return t;++this.p;var e=this.readValue();return[t.getText(),e]}},gr.prototype.readTopLevelTokens=function(t){void 0===t&&(t=nt);for(var e=[];this.p<this.N;){var r=this.readTopLevelToken(t);e.push(r)}return function(t,e){for(var r=!1,n=0;n<t.length;n++){var i=t[n];Ut(i)&&(!r&&i.trimLeft&&Ne(t[n-1],e.greedy),Yt(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight&&Me(t[n+1],e.greedy))}}(e,t),e},gr.prototype.readTopLevelToken=function(t){var e=t.tagDelimiterLeft,r=t.outputDelimiterLeft;return-1<this.rawBeginAt?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(r)?this.readOutputToken(t):this.readHTMLToken(t)},gr.prototype.readHTMLToken=function(t){for(var e=this.p;this.p<this.N;){var r=t.tagDelimiterLeft,n=t.outputDelimiterLeft;if(this.match(r))break;if(this.match(n))break;++this.p}return new ar(this.input,e,this.p,this.file)},gr.prototype.readTagToken=function(t){void 0===t&&(t=nt);var e=this.file,r=this.input,n=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.mkError("tag "+this.snapshot(n)+" not closed",n);var i=new mr(r,n,this.p,t,e);return"raw"===i.name&&(this.rawBeginAt=n),i},gr.prototype.readToDelimiter=function(t){for(;this.p<this.N;)if(8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1},gr.prototype.readOutputToken=function(t){void 0===t&&(t=nt);var e=this.file,r=this.input,n=t.outputDelimiterRight,i=this.p;if(-1===this.readToDelimiter(n))throw this.mkError("output "+this.snapshot(i)+" not closed",i);return new fr(r,i,this.p,t,e)},gr.prototype.readEndrawOrRawContent=function(t){for(var e=t.tagDelimiterLeft,r=t.tagDelimiterRight,n=this.p,i=this.readTo(e)-e.length;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(r)){var s=this.p;return n===i?(this.rawBeginAt=-1,new mr(this.input,n,s,t,this.file)):(this.p=i,new ar(this.input,n,i,this.file))}if(this.rmatch(e))break;this.p++}else i=this.readTo(e)-e.length;throw this.mkError("raw "+this.snapshot(this.rawBeginAt)+" not closed",n)},gr.prototype.mkError=function(t,e){return new ct(t,new je(this.input,e,this.N,this.file))},gr.prototype.snapshot=function(t){return void 0===t&&(t=this.p),JSON.stringify(function(t,e){return t.length>e?t.substr(0,e-3)+"...":t}(this.input.slice(t),16))},gr.prototype.readWord=function(){return console.warn("Tokenizer#readWord() will be removed, use #readIdentifier instead"),this.readIdentifier()},gr.prototype.readIdentifier=function(){this.skipBlank();for(var t=this.p;this.peekType()&V;)++this.p;return new je(this.input,t,this.p,this.file)},gr.prototype.readHashes=function(){for(var t=[];;){var e=this.readHash();if(!e)return t;t.push(e)}},gr.prototype.readHash=function(){this.skipBlank(),","===this.peek()&&++this.p;var t,e=this.p,r=this.readIdentifier();if(r.size())return this.skipBlank(),":"===this.peek()&&(++this.p,t=this.readValue()),new er(this.input,e,this.p,r,t,this.file)},gr.prototype.remaining=function(){return this.input.slice(this.p)},gr.prototype.advance=function(t){void 0===t&&(t=1),this.p+=t},gr.prototype.end=function(){return this.p>=this.N},gr.prototype.readTo=function(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1},gr.prototype.readValue=function(){var t=this.readQuoted()||this.readRange();if(t)return t;if("["===this.peek()){if(this.p++,!(i=this.readQuoted()))return;if("]"!==this.peek())return;return this.p++,new Ye(i,[],this.p)}var e=this.readIdentifier();if(e.size()){for(var r=e.isNumber(!0),n=[];;)if("["===this.peek()){r=!1,this.p++;var i=this.readValue()||new je(this.input,this.p,this.p,this.file);this.readTo("]"),n.push(i)}else{if("."!==this.peek()||"."===this.peek(1))break;if(this.p++,!(i=this.readIdentifier()).size())break;i.isNumber()||(r=!1),n.push(i)}return!n.length&&me.hasOwnProperty(e.content)?new ze(this.input,e.begin,e.end,this.file):r?new Ie(e,n[0]):new Ye(e,n,this.p)}},gr.prototype.readRange=function(){this.skipBlank();var t=this.p;if("("===this.peek()){++this.p;var e=this.readValueOrThrow();this.p+=2;var r=this.readValueOrThrow();return++this.p,new lr(this.input,t,this.p,e,r,this.file)}},gr.prototype.readValueOrThrow=function(){var t=this,e=this.readValue();return ae(e,function(){return"unexpected token "+t.snapshot()+", value expected"}),e},gr.prototype.readQuoted=function(){this.skipBlank();var t=this.p;if(8&this.peekType()){++this.p;for(var e=!1;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new ir(this.input,t,this.p,this.file)}},gr.prototype.readFileName=function(){for(var t=this.p;!(this.peekType()&j)&&","!==this.peek()&&this.p<this.N;)this.p++;return new je(this.input,t,this.p,this.file)},gr.prototype.match=function(t){for(var e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0},gr.prototype.rmatch=function(t){for(var e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0},gr.prototype.peekType=function(t){return void 0===t&&(t=0),_[this.input.charCodeAt(this.p+t)]},gr.prototype.peek=function(t){return void 0===t&&(t=0),this.input[this.p+t]},gr.prototype.skipBlank=function(){for(;this.peekType()&j;)++this.p},gr);function gr(t,e,r){void 0===r&&(r=""),this.input=t,this.trie=e,this.file=r,this.p=0,this.rawBeginAt=-1,this.N=t.length}var yr,mr=(t(wr,yr=Pe),wr);function wr(t,e,r,n,i){var s=this,o=n.trimTagLeft,a=n.trimTagRight,u=n.tagDelimiterLeft,c=n.tagDelimiterRight,l=t.slice(e+u.length,r-c.length);s=yr.call(this,p.TokenKind.Tag,l,t,e,r,o,a,i)||this;var h=new vr(s.content,n.operatorsTrie);if(s.name=h.readIdentifier().getText(),!s.name)throw new ct("illegal tag syntax",s);return h.skipBlank(),s.args=h.remaining(),s}var br=(Tr.prototype.render=function(e){var r,n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:r={},t.label=1;case 1:t.trys.push([1,8,9,10]),n=k(Object.keys(this.hash)),i=n.next(),t.label=2;case 2:return i.done?[3,7]:(s=i.value,o=r,a=s,void 0!==this.hash[s]?[3,3]:(u=!0,[3,5]));case 3:return[4,Se(this.hash[s],e)];case 4:u=t.sent(),t.label=5;case 5:o[a]=u,t.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}return[7];case 10:return[2,r]}})},Tr);function Tr(t){var e,r;this.hash={};var n=new vr(t,{});try{for(var i=k(n.readHashes()),s=i.next();!s.done;s=i.next()){var o=s.value;this.hash[o.name.content]=o.value}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}var kr=(xr.prototype.render=function(t,e){var r,n,i=[];try{for(var s=k(this.args),o=s.next();!o.done;o=s.next()){var a=o.value;v(a)?i.push([a[0],Se(a[1],e)]):i.push(Se(a,e))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this.impl.apply({context:e,liquid:this.liquid},w([t],i))},xr);function xr(t,e,r,n){this.name=t,this.impl=e||S,this.args=r,this.liquid=n}var qr=(Or.prototype.value=function(e,r){var n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:return r=r||e.opts.lenientIf&&0<this.filters.length&&"default"===this.filters[0].name,[4,this.initial.evaluate(e,r)];case 1:n=t.sent(),t.label=2;case 2:t.trys.push([2,7,8,9]),i=k(this.filters),s=i.next(),t.label=3;case 3:return s.done?[3,6]:[4,s.value.render(n,e)];case 4:n=t.sent(),t.label=5;case 5:return s=i.next(),[3,3];case 6:return[3,9];case 7:return o=t.sent(),a={error:o},[3,9];case 8:try{s&&!s.done&&(u=i.return)&&u.call(i)}finally{if(a)throw a.error}return[7];case 9:return[2,n]}})},Or);function Or(t,n){this.filters=[];var e=new vr(t,n.options.operatorsTrie);this.initial=e.readExpression(),this.filters=e.readFilters().map(function(t){var e=t.name,r=t.args;return new kr(e,n.filters.get(e),r,n)})}var Sr,Fr=(t(Rr,Sr=oe),Rr.prototype.render=function(e,r){var n,i;return T(this,function(t){switch(t.label){case 0:return[4,new br(this.token.args).render(e)];case 1:return n=t.sent(),c((i=this.impl).render)?[4,i.render(e,r,n)]:[3,3];case 2:return[2,t.sent()];case 3:return[2]}})},Rr);function Rr(t,e,r){var n=Sr.call(this,t)||this;n.name=t.name;var i=r.tags.get(t.name);return n.impl=Object.create(i),n.impl.liquid=r,n.impl.parse&&n.impl.parse(t,e),n}var Er,Lr=(t(Pr,Er=oe),Pr.prototype.render=function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return[4,this.value.value(e,!1)];case 1:return n=t.sent(),r.write(n),[2]}})},Pr);function Pr(t,e){var r=Er.call(this,t)||this;return r.value=new qr(t.content,e),r}var Dr,Nr=(t(Mr,Dr=oe),Mr.prototype.render=function(t,e){return T(this,function(t){return e.write(this.str),[2]})},Mr);function Mr(t){var e=Dr.call(this,t)||this;return e.str=t.getContent(),e}var Ar=(Ir.prototype.parse=function(t,e){var r=new vr(t,this.liquid.options.operatorsTrie,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(r)},Ir.prototype.parseTokens=function(t){for(var e,r=[];e=t.shift();)r.push(this.parseToken(e,t));return r},Ir.prototype.parseToken=function(e,t){try{return Yt(e)?new Fr(e,t,this.liquid):Jt(e)?new Lr(e,this.liquid):new Nr(e)}catch(t){throw new pt(t,e)}},Ir.prototype.parseStream=function(t){var r=this;return new ie(t,function(t,e){return r.parseToken(t,e)})},Ir.prototype._parseFileCached=function(e,r,n){var i,s;return void 0===n&&(n=St.Root),T(this,function(t){switch(t.label){case 0:return i=n+":"+e,[4,this.cache.read(i)];case 1:return(s=t.sent())?[2,s]:[4,this._parseFile(e,r)];case 2:return s=t.sent(),this.cache.write(i,s),[2,s]}})},Ir.prototype._parseFile=function(e,r,n){var i,s,o,a;return void 0===n&&(n=St.Root),T(this,function(t){switch(t.label){case 0:return[4,this.loader.lookup(e,n,r)];case 1:return i=t.sent(),o=(s=this.liquid).parse,r?(a=this.fs.readFileSync(i),[3,4]):[3,2];case 2:return[4,this.fs.readFile(i)];case 3:a=t.sent(),t.label=4;case 4:return[2,o.apply(s,[a,i])]}})},Ir);function Ir(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new Lt(this.liquid.options)}var _r={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie);this.key=e.readIdentifier().content,e.skipBlank(),ae("="===e.peek(),function(){return"illegal token "+t.getText()}),e.advance(),this.value=e.remaining()},render:function(e){var r,n;return T(this,function(t){switch(t.label){case 0:return r=e.bottom(),n=this.key,[4,this.liquid._evalValue(this.value,e)];case 1:return r[n]=t.sent(),[2]}})}};function Vr(e){return v(e)?e:u(e)&&0<e.length?[e]:b(e)?Object.keys(e).map(function(t){return[t,e[t]]}):[]}function jr(t){return v(t)?t:[t]}var Br,Cr=(t(zr,Br=o),zr.prototype.next=function(){this.i++},zr.prototype.index0=function(){return this.i},zr.prototype.index=function(){return this.i+1},zr.prototype.first=function(){return 0===this.i},zr.prototype.last=function(){return this.i===this.length-1},zr.prototype.rindex=function(){return this.length-this.i},zr.prototype.rindex0=function(){return this.length-this.i-1},zr.prototype.valueOf=function(){return JSON.stringify(this)},zr);function zr(t){var e=Br.call(this)||this;return e.i=0,e.length=t,e}var Hr=["offset","limit","reversed"],Kr={type:"block",parse:function(t,e){var r,n=this,i=new vr(t.args,this.liquid.options.operatorsTrie),s=i.readIdentifier(),o=i.readIdentifier(),a=i.readValue();ae(s.size()&&"in"===o.content&&a,function(){return"illegal tag: "+t.getText()}),this.variable=s.content,this.collection=a,this.hash=new br(i.remaining()),this.templates=[],this.elseTemplates=[];var u=this.liquid.parser.parseStream(e).on("start",function(){return r=n.templates}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endfor",function(){return u.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});u.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=Vr,[4,Se(this.collection,e)];case 1:return(i=s.apply(void 0,[t.sent()])).length?[3,3]:[4,n.renderTemplates(this.elseTemplates,e,r)];case 2:return t.sent(),[2];case 3:return[4,this.hash.render(e)];case 4:o=t.sent(),a=this.liquid.options.orderedFilterParameters?Object.keys(o).filter(function(t){return Hr.includes(t)}):Hr.filter(function(t){return void 0!==o[t]}),i=a.reduce(function(t,e){return"offset"===e?function(t,e){return t.slice(e)}(t,o.offset):"limit"===e?function(t,e){return t.slice(0,e)}(t,o.limit):function(t){return w(t).reverse()}(t)},i),u={forloop:new Cr(i.length)},e.push(u),t.label=5;case 5:t.trys.push([5,10,11,12]),c=k(i),l=c.next(),t.label=6;case 6:return l.done?[3,9]:(h=l.value,u[this.variable]=h,[4,n.renderTemplates(this.templates,e,r)]);case 7:if(t.sent(),r.break)return r.break=!1,[3,9];r.continue=!1,u.forloop.next(),t.label=8;case 8:return l=c.next(),[3,6];case 9:return[3,12];case 10:return p=t.sent(),f={error:p},[3,12];case 11:try{l&&!l.done&&(d=c.return)&&d.call(c)}finally{if(f)throw f.error}return[7];case 12:return e.pop(),[2]}})}};var Ur={parse:function(t,e){var r=this,n=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=function(t){var e=t.readIdentifier().content;if(e)return e;var r=t.readQuoted();if(r)return Fe(r)}(n),ae(this.variable,function(){return t.args+" not valid identifier"}),this.templates=[];var i=this.liquid.parser.parseStream(e);i.on("tag:endcapture",function(){return i.stop()}).on("template",function(t){return r.templates.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),i.start()},render:function(e){var r;return T(this,function(t){switch(t.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,e)];case 1:return r=t.sent(),e.bottom()[this.variable]=r,[2]}})}};var Qr,Wr,Jr={parse:function(t,e){var n=this;this.cond=new qr(t.args,this.liquid),this.cases=[],this.elseTemplates=[];var i=[],r=this.liquid.parser.parseStream(e).on("tag:when",function(t){i=[];for(var e=new vr(t.args,n.liquid.options.operatorsTrie);!e.end();){var r=e.readValue();n.cases.push({val:r,templates:i}),e.readTo(",")}}).on("tag:else",function(){return i=n.elseTemplates}).on("tag:endcase",function(){return r.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});r.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=f,[4,this.cond.value(e,e.opts.lenientIf)];case 1:i=s.apply(void 0,[t.sent()]),t.label=2;case 2:t.trys.push([2,7,8,9]),o=k(this.cases),a=o.next(),t.label=3;case 3:return a.done?[3,6]:(u=a.value,Se(u.val,e,e.opts.lenientIf)!==i?[3,5]:[4,n.renderTemplates(u.templates,e,r)]);case 4:return t.sent(),[2];case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},Yr={parse:function(t,e){var r=this.liquid.parser.parseStream(e);r.on("token",function(t){"endcomment"===t.name&&r.stop()}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),r.start()}};(Wr=Qr=Qr||{})[Wr.OUTPUT=0]="OUTPUT",Wr[Wr.STORE=1]="STORE";var $r=Qr,Gr={parseFilePath:Xr,renderFilePath:Zr,parse:function(t){var e=t.args,r=new vr(e,this.liquid.options.operatorsTrie);for(this.file=this.parseFilePath(r,this.liquid);!r.end();){r.skipBlank();var n=r.p,i=r.readIdentifier();if(("with"===i.content||"for"===i.content)&&(r.skipBlank(),":"!==r.peek())){var s=r.readValue();if(s){var o=r.p,a=void 0;"as"===r.readIdentifier().content?a=r.readIdentifier():r.p=o,this[i.content]={value:s,alias:a&&a.content},r.skipBlank(),","===r.peek()&&r.advance();continue}}r.p=n;break}this.hash=new br(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d,v,g,y,m,w,b;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,[4,this.renderFilePath(this.file,e,i)];case 1:return ae(o=t.sent(),function(){return'illegal filename "'+o+'"'}),a=new Rt({},e.opts,e.sync),[4,s.render(e)];case 2:if(u=t.sent(),this.with&&(c=this.with,h=c.value,p=c.alias,u[p||o]=Se(h,e)),a.push(u),!this.for)return[3,12];l=this.for,h=l.value,p=l.alias,f=Vr(f=Se(h,e)),u.forloop=new Cr(f.length),t.label=3;case 3:t.trys.push([3,9,10,11]),d=k(f),v=d.next(),t.label=4;case 4:return v.done?[3,8]:(g=v.value,u[p]=g,[4,i._parsePartialFile(o,a.sync)]);case 5:return m=t.sent(),[4,i.renderer.renderTemplates(m,a,r)];case 6:t.sent(),u.forloop.next(),t.label=7;case 7:return v=d.next(),[3,4];case 8:return[3,11];case 9:return y=t.sent(),w={error:y},[3,11];case 10:try{v&&!v.done&&(b=d.return)&&b.call(d)}finally{if(w)throw w.error}return[7];case 11:return[3,15];case 12:return[4,i._parsePartialFile(o,a.sync)];case 13:return m=t.sent(),[4,i.renderer.renderTemplates(m,a,r)];case 14:t.sent(),t.label=15;case 15:return[2]}})}};function Xr(t,e){if(e.options.dynamicPartials){var r=t.readValue();if(void 0===r)throw new TypeError('illegal argument "'+t.input+'"');if("none"===r.getText())return null;if($t(r)){var n=e.parse(Fe(r));return 1===n.length&&Wt(n[0].token)?n[0].token.getContent():n}return r}var i=t.readFileName().getText();return"none"===i?null:i}function Zr(t,e,r){return"string"==typeof t?t:Array.isArray(t)?r.renderer.renderTemplates(t,e):Se(t,e)}var tn,en={parseFilePath:Xr,renderFilePath:Zr,parse:function(t){var e=t.args,r=new vr(e,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid);var n=r.p;"with"===r.readIdentifier().content?(r.skipBlank(),":"!==r.peek()?this.withVar=r.readValue():r.p=n):r.p=n,this.hash=new br(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.withVar,a=i.renderer,[4,this.renderFilePath(this.file,e,i)];case 1:return ae(u=t.sent(),function(){return'illegal filename "'+u+'"'}),c=e.saveRegister("blocks","blockMode"),e.setRegister("blocks",{}),e.setRegister("blockMode",$r.OUTPUT),[4,s.render(e)];case 2:return l=t.sent(),o&&(l[u]=Se(o,e)),[4,i._parsePartialFile(u,e.sync)];case 3:return h=t.sent(),e.push(l),[4,a.renderTemplates(h,e,r)];case 4:return t.sent(),e.pop(),e.restoreRegister(c),[2]}})}},rn={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0),e.write(l(--r[this.variable]))}},nn={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie),r=e.readValue();for(e.skipBlank(),this.candidates=[],r&&(":"===e.peek()?(this.group=r,e.advance()):this.candidates.push(r));!e.end();){var n=e.readValue();n&&this.candidates.push(n),e.readTo(",")}ae(this.candidates.length,function(){return"empty candidates: "+t.getText()})},render:function(t,e){var r="cycle:"+Se(this.group,t)+":"+this.candidates.join(","),n=t.getRegister("cycle"),i=n[r];void 0===i&&(i=n[r]=0);var s=this.candidates[i];i=(i+1)%this.candidates.length,n[r]=i;var o=Se(s,t);e.write(o)}},sn={parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[],this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({predicate:new qr(t.args,n.liquid),templates:r=[]})}).on("tag:elsif",function(t){return n.branches.push({predicate:new qr(t.args,n.liquid),templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endif",function(){this.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=k(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:(o=s.value,a=o.predicate,u=o.templates,[4,a.value(e,e.opts.lenientIf)]);case 3:return M(t.sent(),e)?[4,n.renderTemplates(u,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},on={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0);var n=r[this.variable];r[this.variable]++,e.write(l(n))}},an={parseFilePath:Xr,renderFilePath:Zr,parse:function(t,e){var r=new vr(t.args,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid),this.hash=new br(r.remaining()),this.tpls=this.liquid.parser.parseTokens(e)},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.file,a=i.renderer,null!==o?[3,2]:(e.setRegister("blockMode",$r.OUTPUT),[4,a.renderTemplates(this.tpls,e,r)]);case 1:return t.sent(),[2];case 2:return[4,this.renderFilePath(this.file,e,i)];case 3:return ae(u=t.sent(),function(){return'illegal filename "'+u+'"'}),[4,i._parseLayoutFile(u,e.sync)];case 4:return c=t.sent(),e.setRegister("blockMode",$r.STORE),[4,a.renderTemplates(this.tpls,e)];case 5:return l=t.sent(),void 0===(h=e.getRegister("blocks"))[""]&&(h[""]=function(t,e){return e.write(l)}),e.setRegister("blockMode",$r.OUTPUT),f=(p=e).push,[4,s.render(e)];case 6:return f.apply(p,[t.sent()]),[4,a.renderTemplates(c,e,r)];case 7:return t.sent(),e.pop(),[2]}})}},un=(t(cn,tn=o),cn.prototype.super=function(){return this.superBlockRender()},cn);function cn(t){void 0===t&&(t=function(){return""});var e=tn.call(this)||this;return e.superBlockRender=t,e}var ln,hn={parse:function(t,e){var r=this,n=/\w+/.exec(t.args);this.block=n?n[0]:"",this.tpls=[],this.liquid.parser.parseStream(e).on("tag:endblock",function(){this.stop()}).on("template",function(t){return r.tpls.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return n=this.getBlockRender(e),e.getRegister("blockMode")!==$r.STORE?[3,1]:(e.getRegister("blocks")[this.block]=n,[3,3]);case 1:return[4,n(new un,r)];case 2:t.sent(),t.label=3;case 3:return[2]}})},getBlockRender:function(n){function r(e,r){return T(this,function(t){switch(t.label){case 0:return n.push({block:e}),[4,i.renderer.renderTemplates(s,n,r)];case 1:return t.sent(),n.pop(),[2]}})}var i=this.liquid,s=this.tpls,o=n.getRegister("blocks")[this.block];return o?function(t,e){return o(new un(function(){return r(t,e)}),e)}:r}},pn={parse:function(t,e){var r=this;this.tokens=[];var n=this.liquid.parser.parseStream(e);n.on("token",function(t){"endraw"===t.name?n.stop():r.tokens.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),n.start()},render:function(){return this.tokens.map(function(t){return t.getText()}).join("")}},fn=(t(dn,ln=Cr),dn.prototype.row=function(){return Math.floor(this.i/this.cols)+1},dn.prototype.col0=function(){return this.i%this.cols},dn.prototype.col=function(){return this.col0()+1},dn.prototype.col_first=function(){return 0===this.col0()},dn.prototype.col_last=function(){return this.col()===this.cols},dn);function dn(t,e){var r=ln.call(this,t)||this;return r.length=t,r.cols=e,r}var vn={assign:_r,for:Kr,capture:Ur,case:Jr,comment:Yr,include:en,render:Gr,decrement:rn,increment:on,cycle:nn,if:sn,layout:an,block:hn,raw:pn,tablerow:{parse:function(t,e){var r=this,n=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=n.readIdentifier(),n.skipBlank();var i,s=n.readIdentifier();ae(s&&"in"===s.content,function(){return"illegal tag: "+t.getText()}),this.collection=n.readValue(),this.hash=new br(n.remaining()),this.templates=[];var o=this.liquid.parser.parseStream(e).on("start",function(){return i=r.templates}).on("tag:endtablerow",function(){return o.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});o.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:return i=Vr,[4,Se(this.collection,e)];case 1:return n=i.apply(void 0,[t.sent()]),[4,this.hash.render(e)];case 2:s=t.sent(),o=s.offset||0,a=void 0===s.limit?n.length:s.limit,n=n.slice(o,o+a),u=s.cols||n.length,c=this.liquid.renderer,l=new fn(n.length,u),h={tablerowloop:l},e.push(h),p=0,t.label=3;case 3:return p<n.length?(h[this.variable.content]=n[p],0===l.col0()&&(1!==l.row()&&r.write("</tr>"),r.write('<tr class="row'+l.row()+'">')),r.write('<td class="col'+l.col()+'">'),[4,c.renderTemplates(this.templates,e,r)]):[3,6];case 4:t.sent(),r.write("</td>"),t.label=5;case 5:return p++,l.next(),[3,3];case 6:return n.length&&r.write("</tr>"),e.pop(),[2]}})}},unless:{parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[],this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({predicate:new qr(t.args,n.liquid),test:A,templates:r=[]})}).on("tag:elsif",function(t){return n.branches.push({predicate:new qr(t.args,n.liquid),test:M,templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endunless",function(){this.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=k(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:(o=s.value,a=o.predicate,u=o.test,c=o.templates,[4,a.value(e,e.opts.lenientIf)]);case 3:return l=t.sent(),u(l,e)?[4,n.renderTemplates(c,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return h=t.sent(),p={error:h},[3,9];case 8:try{s&&!s.done&&(f=i.return)&&f.call(i)}finally{if(p)throw p.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},break:{render:function(t,e){e.break=!0}},continue:{render:function(t,e){e.continue=!0}}},gn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},yn={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function mn(t){return l(t).replace(/&|<|>|"|'/g,function(t){return gn[t]})}var wn=Math.abs,bn=Math.max,Tn=Math.min,kn=Math.ceil,xn=Math.floor;var qn=Object.freeze({escape:mn,escapeOnce:function(t){return mn(function(t){return String(t).replace(/&(amp|lt|gt|#34|#39);/g,function(t){return yn[t]})}(t))},newlineToBr:function(t){return t.replace(/\n/g,"<br />\n")},stripHtml:function(t){return t.replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")},abs:wn,atLeast:bn,atMost:Tn,ceil:kn,dividedBy:function(t,e){return t/e},floor:xn,minus:function(t,e){return t-e},modulo:function(t,e){return t%e},times:function(t,e){return t*e},round:function(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return Math.round(t*r)/r},plus:function(t,e){return Number(t)+Number(e)},sortNatural:function(t,r){return t&&t.sort?void 0!==r?w(t).sort(function(t,e){return R(t[r],e[r])}):w(t).sort(R):[]},urlDecode:function(t){return t.split("+").map(decodeURIComponent).join(" ")},urlEncode:function(t){return t.split(" ").map(encodeURIComponent).join("+")},join:function(t,e){return t.join(void 0===e?" ":e)},last:function(t){return v(t)?y(t):""},first:function(t){return v(t)?t[0]:""},reverse:function(t){return w(t).reverse()},sort:function(t,e){function r(t){return e?n.context.getFromScope(t,e.split(".")):t}var n=this;return jr(t).sort(function(t,e){return(t=r(t))<(e=r(e))?-1:e<t?1:0})},size:function(t){return t&&t.length||0},map:function(t,e){var r=this;return jr(t).map(function(t){return r.context.getFromScope(t,e.split("."))})},compact:function(t){return jr(t).filter(function(t){return!d(t)})},concat:function(t,e){return jr(t).concat(e)},slice:function(t,e,r){return void 0===r&&(r=1),e=e<0?t.length+e:e,t.slice(e,e+r)},where:function(t,r,n){var i=this;return jr(t).filter(function(t){var e=i.context.getFromScope(t,String(r).split("."));return void 0===n?M(e,i.context):e===n})},uniq:function(t){var e={};return(t||[]).filter(function(t){return!e.hasOwnProperty(String(t))&&(e[String(t)]=!0)})},date:function(t,e){var r;return function(t){return t instanceof Date&&!isNaN(t.getTime())}(r="now"===t||"today"===t?new Date:h(t)?new Date(1e3*t):u(t)?/^\d+$/.test(t)?new Date(1e3*+t):this.context.opts.preserveTimezones?function(t){var e=t.match(H);if(e&&"Z"===e[1])return new Date(+new Date(t)+6e4*z);if(e&&e[2]&&e[3]&&e[4]){var r=m(e,5),n=r[2],i=r[3],s=r[4],o=("+"===n?1:-1)*(60*parseInt(i,10)+parseInt(s,10));return new Date(+new Date(t)+6e4*(z+o))}return new Date(t)}(t):new Date(t):t)?function(t,e){for(var r,n="",i=e;r=K.exec(i);)n+=i.slice(0,r.index),i=i.slice(r.index+r[0].length),n+=rt(t,r);return n+i}(r,e):t},Default:function(t,e){return v(t)||u(t)?t.length?t:e:A(f(t),this.context)?e:t},json:function(t){return JSON.stringify(t)},append:function(t,e){return ae(2===arguments.length,function(){return"append expect 2 arguments"}),l(t)+l(e)},prepend:function(t,e){return ae(2===arguments.length,function(){return"prepend expect 2 arguments"}),l(e)+l(t)},lstrip:function(t){return l(t).replace(/^\s+/,"")},downcase:function(t){return l(t).toLowerCase()},upcase:function(t){return l(t).toUpperCase()},remove:function(t,e){return l(t).split(String(e)).join("")},removeFirst:function(t,e){return l(t).replace(String(e),"")},rstrip:function(t){return l(t).replace(/\s+$/,"")},split:function(t,e){return l(t).split(String(e))},strip:function(t){return l(t).trim()},stripNewlines:function(t){return l(t).replace(/\n/g,"")},capitalize:function(t){return(t=l(t)).charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,r){return l(t).split(String(e)).join(r)},replaceFirst:function(t,e,r){return l(t).replace(String(e),r)},truncate:function(t,e,r){return void 0===e&&(e=50),void 0===r&&(r="..."),(t=l(t)).length<=e?t:t.substr(0,e-r.length)+r},truncatewords:function(t,e,r){void 0===e&&(e=15),void 0===r&&(r="...");var n=t.split(/\s+/),i=n.slice(0,e).join(" ");return n.length>=e&&(i+=r),i}}),On=(Sn.prototype.get=function(t){var e=this.impls[t];return ae(e,function(){return'tag "'+t+'" not found'}),e},Sn.prototype.set=function(t,e){this.impls[t]=e},Sn);function Sn(){this.impls={}}var Fn=(Rn.prototype.get=function(t){var e=this.impls[t];return ae(e||!this.strictFilters,function(){return"undefined filter: "+t}),e},Rn.prototype.set=function(t,e){this.impls[t]=e},Rn.prototype.create=function(t,e){return new kr(t,this.get(t),e,this.liquid)},Rn);function Rn(t,e){this.strictFilters=t,this.liquid=e,this.impls={}}var En=(Ln.prototype.parse=function(t,e){return this.parser.parse(t,e)},Ln.prototype._render=function(t,e,r){var n=new Rt(e,this.options,r);return this.renderer.renderTemplates(t,n)},Ln.prototype.render=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this._render(e,r,!1))]})})},Ln.prototype.renderSync=function(t,e){return jt(this._render(t,e,!0))},Ln.prototype.renderToNodeStream=function(t,e){var r=new Rt(e,this.options);return this.renderer.renderTemplatesToNodeStream(t,r)},Ln.prototype._parseAndRender=function(t,e,r){var n=this.parse(t);return this._render(n,e,r)},Ln.prototype.parseAndRender=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this._parseAndRender(e,r,!1))]})})},Ln.prototype.parseAndRenderSync=function(t,e){return jt(this._parseAndRender(t,e,!0))},Ln.prototype._parsePartialFile=function(t,e){return this.parser.parseFile(t,e,St.Partials)},Ln.prototype._parseLayoutFile=function(t,e){return this.parser.parseFile(t,e,St.Layouts)},Ln.prototype.parseFile=function(e){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this.parser.parseFile(e,!1))]})})},Ln.prototype.parseFileSync=function(t){return jt(this.parser.parseFile(t,!0))},Ln.prototype.renderFile=function(r,n){return s(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r)];case 1:return e=t.sent(),[2,this.render(e,n)]}})})},Ln.prototype.renderFileSync=function(t,e){var r=this.parseFileSync(t);return this.renderSync(r,e)},Ln.prototype.renderFileToNodeStream=function(r,n){return s(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r)];case 1:return e=t.sent(),[2,this.renderToNodeStream(e,n)]}})})},Ln.prototype._evalValue=function(t,e){return new qr(t,this).value(e,!1)},Ln.prototype.evalValue=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this._evalValue(e,r))]})})},Ln.prototype.evalValueSync=function(t,e){return jt(this._evalValue(t,e))},Ln.prototype.registerFilter=function(t,e){this.filters.set(t,e)},Ln.prototype.registerTag=function(t,e){this.tags.set(t,e)},Ln.prototype.plugin=function(t){return t.call(this,Ln)},Ln.prototype.express=function(){var i=this,s=!0;return function(t,e,r){var n;s&&(s=!1,(n=i.options.root).unshift.apply(n,w(it(this.root)))),i.renderFile(t,e).then(function(t){return r(null,t)},r)}},Ln);function Ln(t){var r=this;void 0===t&&(t={}),this.options=function(t){var e=i({},nt,t);return e.partials===nt.partials&&(e.partials=e.root),e.layouts===nt.layouts&&(e.layouts=e.root),e}(function(t){if((t=t||{}).hasOwnProperty("root")&&(t.root=it(t.root)),t.hasOwnProperty("partials")&&(t.partials=it(t.partials)),t.hasOwnProperty("layouts")&&(t.layouts=it(t.layouts)),t.hasOwnProperty("cache")){var e=void 0;e="number"==typeof t.cache?0<t.cache?new L(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new L(1024):void 0,t.cache=e}return t.hasOwnProperty("operators")&&(t.operatorsTrie=C(t.operators)),t}(t)),this.parser=new Ar(this),this.renderer=new Ht,this.filters=new Fn(this.options.strictFilters,this),this.tags=new On,g(vn,function(t,e){return r.registerTag(F(e),t)}),g(qn,function(t,e){return r.registerFilter(F(e),t)})}p.AssertionError=qt,p.Context=Rt,p.Drop=o,p.Expression=qe,p.Hash=br,p.InternalUndefinedVariableError=Tt,p.Liquid=En,p.LiquidError=ot,p.ParseError=pt,p.ParseStream=ie,p.RenderError=vt,p.TagToken=mr,p.Token=Re,p.TokenizationError=ct,p.Tokenizer=vr,p.TypeGuards=ne,p.UndefinedVariableError=mt,p.Value=qr,p.assert=ae,p.createTrie=C,p.defaultOperators=I,p.evalQuotedToken=Fe,p.evalToken=Se,p.isFalsy=A,p.isTruthy=M,p.toPromise=Vt,p.toThenable=_t,p.toValue=f,Object.defineProperty(p,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).liquidjs={})}(this,function(p){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function t(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(s,o,a,u){return new(a=a||Promise)(function(t,e){function r(t){try{i(u.next(t))}catch(t){e(t)}}function n(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(r,n)}i((u=u.apply(s,o||[])).next())})}function T(r,n){var i,s,o,t,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,s&&(o=2&e[0]?s.return:e[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(o=0<(o=a.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(r,a)}catch(t){e=[6,t],s=0}finally{i=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}function k(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function m(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,s=r.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function w(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}var o=(e.prototype.valueOf=function(){},e.prototype.liquidMethodMissing=function(t){},e);function e(){}var r=Object.prototype.toString,a=String.prototype.toLowerCase;function u(t){return"string"==typeof t}function c(t){return"function"==typeof t}function l(t){return u(t=f(t))?t:d(t)?"":String(t)}function f(t){return t instanceof o?t.valueOf():t}function h(t){return"number"==typeof t}function d(t){return null==t}function v(t){return"[object Array]"===r.call(t)}function g(t,e){for(var r in t=t||{})if(t.hasOwnProperty(r)&&!1===e(t[r],r,t))break;return t}function y(t){return t[t.length-1]}function b(t){var e=typeof t;return null!==t&&("object"==e||"function"==e)}function x(t,e,r){void 0===r&&(r=1);for(var n=[],i=t;i<e;i+=r)n.push(i);return n}function q(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return e+t})}function O(t,e,r,n){for(var i=e-(t=String(t)).length;0<i--;)t=n(t,r);return t}function F(t){return t}function S(t){return t.replace(/(\w?)([A-Z])/g,function(t,e,r){return(e?e+"_":"")+r.toLowerCase()})}function R(t,e){return null==t&&null==e?0:null==t?1:null==e?-1:(t=a.call(t))<(e=a.call(e))?-1:e<t?1:0}var E=function(t,e,r,n){this.key=t,this.value=e,this.next=r,this.prev=n},L=(P.prototype.write=function(t,e){if(this.cache[t])this.cache[t].value=e;else{var r=new E(t,e,this.head.next,this.head);this.head.next.prev=r,this.head.next=r,this.cache[t]=r,this.size++,this.ensureLimit()}},P.prototype.read=function(t){if(this.cache[t]){var e=this.cache[t].value;return this.remove(t),this.write(t,e),e}},P.prototype.remove=function(t){var e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--},P.prototype.clear=function(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}},P.prototype.ensureLimit=function(){this.size>this.limit&&this.remove(this.tail.prev.key)},P);function P(t,e){void 0===e&&(e=0),this.limit=t,this.size=e,this.cache={},this.head=new E("HEAD",null,null,null),this.tail=new E("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}function D(t,e,i){return t.length&&"/"!==y(t)&&(t+="/"),function(t,e){var r=document.createElement("base");r.href=t;var n=document.getElementsByTagName("head")[0];n.insertBefore(r,n.firstChild);var i=document.createElement("a");i.href=e;var s=i.href;return n.removeChild(r),s}(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(t,e,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?t:e+r+i})}var N=Object.freeze({resolve:D,readFile:function(n){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,new Promise(function(t,e){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?t(r.responseText):e(new Error(r.statusText))},r.onerror=function(){e(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},readFileSync:function(t){var e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||300<=e.status)throw new Error(e.statusText);return e.responseText},exists:function(t){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,!0]})})},existsSync:function(t){return!0}});function M(t){return t&&c(t.equals)}function A(t,e){return!I(t,e)}function I(t,e){return e.opts.jsTruthy?!t:!1===t||null==t}var z={"==":function(t,e){return M(t)?t.equals(e):M(e)?e.equals(t):t===e},"!=":function(t,e){return M(t)?!t.equals(e):M(e)?!e.equals(t):t!==e},">":function(t,e){return M(t)?t.gt(e):M(e)?e.lt(t):e<t},"<":function(t,e){return M(t)?t.lt(e):M(e)?e.gt(t):t<e},">=":function(t,e){return M(t)?t.geq(e):M(e)?e.leq(t):e<=t},"<=":function(t,e){return M(t)?t.leq(e):M(e)?e.geq(t):t<=e},contains:function(t,e){return!(!t||!c(t.indexOf))&&-1<t.indexOf(e)},and:function(t,e,r){return A(t,r)&&A(e,r)},or:function(t,e,r){return A(t,r)||A(e,r)}},_=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],j=1,V=4,B=16;function C(t){var e,r,n={};try{for(var i=k(Object.entries(t)),s=i.next();!s.done;s=i.next()){for(var o=m(s.value,2),a=o[0],u=o[1],c=n,l=0;l<a.length;l++){var h=a[l];c[h]=c[h]||{},l===a.length-1&&_[a.charCodeAt(l)]&j&&(c[h].needBoundary=!0),c=c[h]}c.handler=u,c.end=!0}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}_[160]=_[5760]=_[6158]=_[8192]=_[8193]=_[8194]=_[8195]=_[8196]=_[8197]=_[8198]=_[8199]=_[8200]=_[8201]=_[8202]=_[8232]=_[8233]=_[8239]=_[8287]=_[12288]=V;var H={root:["."],layouts:["."],partials:["."],relativeReference:!0,cache:void 0,extname:"",fs:N,dynamicPartials:!0,jsTruthy:!1,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,lenientIf:!1,globals:{},keepOutputType:!1,operators:z,operatorsTrie:C(z)};function K(t){var e=[];return v(t)&&(e=t),u(t)&&(e=[t]),e.map(function(t){return D(t,".","")}).map(function(t){return"/"!==t[t.length-1]?t+"/":t})}var U,W=(t(Q,U=Error),Q.prototype.update=function(){var t=this.originalError;this.context=function(t){var e=m(t.getPosition(),1)[0],r=t.input.split("\n"),n=Math.max(e-2,1),i=Math.min(e+3,r.length);return x(n,i+1).map(function(t){return(t===e?">> ":" ")+q(String(t),String(i).length)+"| "+r[t-1]}).join("\n")}(this.token),this.message=function(t,e){e.file&&(t+=", file:"+e.file);var r=m(e.getPosition(),2),n=r[0],i=r[1];return t+=", line:"+n+", col:"+i}(t.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack+"\nFrom "+t.stack},Q);function Q(t,e){var r=U.call(this,t.message)||this;return r.originalError=t,r.token=e,r.context="",r}var J,Y=(t($,J=W),$);function $(t,e){var r=J.call(this,new Error(t),e)||this;return r.name="TokenizationError",J.prototype.update.call(r),r}var G,X=(t(Z,G=W),Z);function Z(t,e){var r=G.call(this,t,e)||this;return r.name="ParseError",r.message=t.message,G.prototype.update.call(r),r}var tt,et=(t(rt,tt=W),rt.is=function(t){return"RenderError"===t.name},rt);function rt(t,e){var r=tt.call(this,t,e.token)||this;return r.name="RenderError",r.message=t.message,tt.prototype.update.call(r),r}var nt,it=(t(st,nt=W),st);function st(t,e){var r=nt.call(this,t,e)||this;return r.name="UndefinedVariableError",r.message=t.message,nt.prototype.update.call(r),r}var ot,at=(t(ut,ot=Error),ut);function ut(t){var e=ot.call(this,"undefined variable: "+t)||this;return e.name="InternalUndefinedVariableError",e.variableName=t,e}var ct,lt=(t(ht,ct=Error),ht);function ht(t){var e=ct.call(this,t)||this;return e.name="AssertionError",e.message=t+"",e}var pt,ft,dt=(vt.prototype.getRegister=function(t){return this.registers[t]=this.registers[t]||{}},vt.prototype.setRegister=function(t,e){return this.registers[t]=e},vt.prototype.saveRegister=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.map(function(t){return[t,e.getRegister(t)]})},vt.prototype.restoreRegister=function(t){var i=this;return t.forEach(function(t){var e=m(t,2),r=e[0],n=e[1];return i.setRegister(r,n)})},vt.prototype.getAll=function(){return w([this.globals,this.environments],this.scopes).reduce(function(t,e){return i(t,e)},{})},vt.prototype.get=function(t){var e=this.findScope(t[0]);return this.getFromScope(e,t)},vt.prototype.getFromScope=function(t,e){var r=this;return"string"==typeof e&&(e=e.split(".")),e.reduce(function(t,e){if(d(t=function(t,e){return d(t)?t:c((t=function t(e){return e&&c(e.toLiquid)?t(e.toLiquid()):e}(t))[e])?t[e]():t instanceof o?t.hasOwnProperty(e)?t[e]:t.liquidMethodMissing(e):"size"===e?function(t){return v(t)||u(t)?t.length:t.size}(t):"first"===e?function(t){return v(t)?t[0]:t.first}(t):"last"===e?function(t){return v(t)?t[t.length-1]:t.last}(t):t[e]}(t,e))&&r.opts.strictVariables)throw new at(e);return t},t)},vt.prototype.push=function(t){return this.scopes.push(t)},vt.prototype.pop=function(){return this.scopes.pop()},vt.prototype.bottom=function(){return this.scopes[0]},vt.prototype.findScope=function(t){for(var e=this.scopes.length-1;0<=e;e--){var r=this.scopes[e];if(t in r)return r}return t in this.environments?this.environments:this.globals},vt);function vt(t,e,r){void 0===t&&(t={}),void 0===e&&(e=H),void 0===r&&(r=!1),this.scopes=[{}],this.registers={},this.sync=r,this.opts=e,this.globals=e.globals,this.environments=t}(ft=pt=pt||{}).Partials="partials",ft.Layouts="layouts",ft.Root="root";var gt=(yt.prototype.lookup=function(e,r,n,i){var s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:s=this.options.fs,o=this.options[r],t.label=1;case 1:t.trys.push([1,8,9,10]),a=k(this.candidates(e,o,i,r!==pt.Root)),u=a.next(),t.label=2;case 2:return u.done?[3,7]:(c=u.value,n?(l=s.existsSync(c),[3,5]):[3,3]);case 3:return[4,s.exists(c)];case 4:l=t.sent(),t.label=5;case 5:if(l)return[2,c];t.label=6;case 6:return u=a.next(),[3,2];case 7:return[3,10];case 8:return h=t.sent(),p={error:h},[3,10];case 9:try{u&&!u.done&&(f=a.return)&&f.call(a)}finally{if(p)throw p.error}return[7];case 10:throw this.lookupError(e,o)}})},yt.prototype.shouldLoadRelative=function(t){return this.options.relativeReference&&this.isRelativePath(t)},yt.prototype.isRelativePath=function(t){return t.startsWith("./")||t.startsWith("../")},yt.prototype.candidates=function(e,r,n,i){var s,o,a,u,c,l,h,p,f,d,v,g,y,m,w,b;return T(this,function(t){switch(t.label){case 0:if(s=this.options,o=s.fs,a=s.extname,!this.shouldLoadRelative(e)||!n)return[3,8];d=o.resolve(this.dirname(n),e,a),t.label=1;case 1:t.trys.push([1,6,7,8]),u=k(r),c=u.next(),t.label=2;case 2:return c.done?[3,5]:(f=c.value,i&&!d.startsWith(f)?[3,4]:[4,d]);case 3:return t.sent(),[2];case 4:return c=u.next(),[3,2];case 5:return[3,8];case 6:return l=t.sent(),y={error:l},[3,8];case 7:try{c&&!c.done&&(m=u.return)&&m.call(u)}finally{if(y)throw y.error}return[7];case 8:t.trys.push([8,13,14,15]),h=k(r),p=h.next(),t.label=9;case 9:return p.done?[3,12]:(f=p.value,d=o.resolve(f,e,a),i&&!d.startsWith(f)?[3,11]:[4,d]);case 10:t.sent(),t.label=11;case 11:return p=h.next(),[3,9];case 12:return[3,15];case 13:return v=t.sent(),w={error:v},[3,15];case 14:try{p&&!p.done&&(b=h.return)&&b.call(h)}finally{if(w)throw w.error}return[7];case 15:return void 0===o.fallback?[3,17]:void 0===(g=o.fallback(e))?[3,17]:[4,g];case 16:t.sent(),t.label=17;case 17:return[2]}})},yt.prototype.dirname=function(t){var e=t.split("/");return e.pop(),e.join("/")},yt.prototype.lookupError=function(t,e){var r=new Error("ENOENT");return r.message='ENOENT: Failed to lookup "'+t+'" in "'+e+'"',r.code="ENOENT",r},yt);function yt(t){this.options=t}var mt=(wt.prototype.write=function(t){this.buffer+=l(t)},wt);function wt(){this.buffer=""}var bt=function(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")};function Tt(e){var t={then:function(t){return t(e)},catch:function(){return t}};return t}function kt(r){var n={then:function(t,e){return e?e(r):n},catch:function(t){return t(r)}};return n}function xt(n){return function(t){return t&&c(t.then)}(n)?n:function(t){return t&&c(t.next)&&c(t.throw)&&c(t.return)}(n)?function r(t){var e;try{e=n.next(t)}catch(t){return kt(t)}if(e.done)return Tt(e.value);return xt(e.value).then(r,function(t){var e;try{e=n.throw(t)}catch(t){return kt(t)}return e.done?Tt(e.value):r(e.value)})}():Tt(n)}function qt(t){return Promise.resolve(xt(t))}function Ot(t){var e;return xt(t).then(function(t){return Tt(e=t)}).catch(function(t){throw t}),e}var Ft=(St.prototype.write=function(t){"string"!=typeof(t=f(t))&&""===this.buffer?this.buffer=t:this.buffer=l(this.buffer)+l(t)},St);function St(){this.buffer=""}var Rt,Et=(Lt.prototype.renderTemplatesToNodeStream=function(t,e){var r=this,n=new bt;return Promise.resolve().then(function(){return xt(r.renderTemplates(t,e,n))}).then(function(){return n.end()},function(t){return n.error(t)}),n.stream},Lt.prototype.renderTemplates=function(e,r,n){var i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:n=n||(r.opts.keepOutputType?new Ft:new mt),t.label=1;case 1:t.trys.push([1,8,9,10]),i=k(e),s=i.next(),t.label=2;case 2:if(s.done)return[3,7];o=s.value,t.label=3;case 3:return t.trys.push([3,5,,6]),[4,o.render(r,n)];case 4:return(a=t.sent())&&n.write(a),n.break||n.continue?[3,7]:[3,6];case 5:throw u=t.sent(),et.is(u)?u:new et(u,o);case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,n.buffer]}})},Lt);function Lt(){}function Pt(t){return!!(Ct(t)&p.TokenKind.Delimited)}function Dt(t){return Ct(t)===p.TokenKind.Operator}function Nt(t){return Ct(t)===p.TokenKind.HTML}function Mt(t){return Ct(t)===p.TokenKind.Output}function At(t){return Ct(t)===p.TokenKind.Tag}function It(t){return Ct(t)===p.TokenKind.Quoted}function zt(t){return Ct(t)===p.TokenKind.Literal}function _t(t){return Ct(t)===p.TokenKind.Number}function jt(t){return Ct(t)===p.TokenKind.PropertyAccess}function Vt(t){return Ct(t)===p.TokenKind.Word}function Bt(t){return Ct(t)===p.TokenKind.Range}function Ct(t){return t?t.kind:-1}(Rt=p.TokenKind||(p.TokenKind={}))[Rt.Number=1]="Number",Rt[Rt.Literal=2]="Literal",Rt[Rt.Tag=4]="Tag",Rt[Rt.Output=8]="Output",Rt[Rt.HTML=16]="HTML",Rt[Rt.Filter=32]="Filter",Rt[Rt.Hash=64]="Hash",Rt[Rt.PropertyAccess=128]="PropertyAccess",Rt[Rt.Word=256]="Word",Rt[Rt.Range=512]="Range",Rt[Rt.Quoted=1024]="Quoted",Rt[Rt.Operator=2048]="Operator",Rt[Rt.Delimited=12]="Delimited";var Ht=Object.freeze({isDelimitedToken:Pt,isOperatorToken:Dt,isHTMLToken:Nt,isOutputToken:Mt,isTagToken:At,isQuotedToken:It,isLiteralToken:zt,isNumberToken:_t,isPropertyAccessToken:jt,isWordToken:Vt,isRangeToken:Bt}),Kt=(Ut.prototype.on=function(t,e){return this.handlers[t]=e,this},Ut.prototype.trigger=function(t,e){var r=this.handlers[t];return!!r&&(r.call(this,e),!0)},Ut.prototype.start=function(){var t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());)if(!(this.trigger("token",t)||At(t)&&this.trigger("tag:"+t.name,t))){var e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this},Ut.prototype.stop=function(){return this.stopRequested=!0,this},Ut);function Ut(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}function Wt(t){this.token=t}function Qt(t,e){if(!t){var r=e?e():"expect "+t+" to be true";throw new lt(r)}}var Jt,Yt=(t($t,Jt=o),$t.prototype.equals=function(t){return d(f(t))},$t.prototype.gt=function(){return!1},$t.prototype.geq=function(){return!1},$t.prototype.lt=function(){return!1},$t.prototype.leq=function(){return!1},$t.prototype.valueOf=function(){return null},$t);function $t(){return null!==Jt&&Jt.apply(this,arguments)||this}var Gt,Xt=(t(Zt,Gt=o),Zt.prototype.equals=function(t){return!(t instanceof Zt||(u(t=f(t))||v(t)?0!==t.length:!b(t)||0!==Object.keys(t).length))},Zt.prototype.gt=function(){return!1},Zt.prototype.geq=function(){return!1},Zt.prototype.lt=function(){return!1},Zt.prototype.leq=function(){return!1},Zt.prototype.valueOf=function(){return""},Zt);function Zt(){return null!==Gt&&Gt.apply(this,arguments)||this}var te,ee=(t(re,te=Xt),re.prototype.equals=function(t){return!1===t||!!d(f(t))||(u(t)?/^\s*$/.test(t):te.prototype.equals.call(this,t))},re);function re(){return null!==te&&te.apply(this,arguments)||this}var ne=new Yt,ie={true:!0,false:!1,nil:ne,null:ne,empty:new Xt,blank:new ee},se=/[\da-fA-F]/,oe=/[0-7]/,ae={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function ue(t){var e=t.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}function ce(t){for(var e="",r=1;r<t.length-1;r++)if("\\"===t[r])if(void 0!==ae[t[r+1]])e+=ae[t[++r]];else if("u"===t[r+1]){for(var n=0,i=r+2;i<=r+5&&se.test(t[i]);)n=16*n+ue(t[i++]);r=i-1,e+=String.fromCharCode(n)}else if(oe.test(t[r+1])){for(i=r+1,n=0;i<=r+3&&oe.test(t[i]);)n=8*n+ue(t[i++]);r=i-1,e+=String.fromCharCode(n)}else e+=t[++r];else e+=t[r];return e}var le=(he.prototype.evaluate=function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:Qt(e,function(){return"unable to evaluate: context not defined"}),n=[],t.label=1;case 1:t.trys.push([1,9,10,11]),i=k(this.postfix),s=i.next(),t.label=2;case 2:return s.done?[3,8]:Dt(o=s.value)?[4,n.pop()]:[3,5];case 3:return a=t.sent(),[4,n.pop()];case 4:return u=t.sent(),c=function(t,e,r,n,i){return(0,t[e.operator])(r,n,i)}(e.opts.operators,o,u,a,e),n.push(c),[3,7];case 5:return h=(l=n).push,[4,pe(o,e,r&&1===this.postfix.length)];case 6:h.apply(l,[t.sent()]),t.label=7;case 7:return s=i.next(),[3,2];case 8:return[3,11];case 9:return p=t.sent(),f={error:p},[3,11];case 10:try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 11:return[2,n[0]]}})},he);function he(t){this.postfix=w(function(e){var r,n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:r=[],t.label=1;case 1:t.trys.push([1,10,11,12]),n=k(e),i=n.next(),t.label=2;case 2:if(i.done)return[3,9];if(!Dt(s=i.value))return[3,6];t.label=3;case 3:return r.length&&r[r.length-1].getPrecedence()>s.getPrecedence()?[4,r.pop()]:[3,5];case 4:return t.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:t.sent(),t.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=t.sent(),a={error:o},[3,12];case 11:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(a)throw a.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return t.sent(),[3,12];case 14:return[2]}})}(t))}function pe(t,e,r){return void 0===r&&(r=!1),jt(t)?function(e,r,n){var t=e.props.map(function(t){return pe(t,r,!1)});try{return r.get(w([e.propertyName],t))}catch(t){if(n&&"InternalUndefinedVariableError"===t.name)return null;throw new it(t,e)}}(t,e,r):Bt(t)?function(t,e){var r=pe(t.lhs,e),n=pe(t.rhs,e);return x(+r,+n+1)}(t,e):zt(t)?function(t){return ie[t.literal]}(t):_t(t)?function(t){var e=t.whole.content+"."+(t.decimal?t.decimal.content:"");return Number(e)}(t):Vt(t)?t.getText():It(t)?fe(t):void 0}function fe(t){return ce(t.getText())}var de=(ve.prototype.getText=function(){return this.input.slice(this.begin,this.end)},ve.prototype.getPosition=function(){for(var t=m([1,1],2),e=t[0],r=t[1],n=0;n<this.begin;n++)"\n"===this.input[n]?(e++,r=1):r++;return[e,r]},ve.prototype.size=function(){return this.end-this.begin},ve);function ve(t,e,r,n,i){this.kind=t,this.input=e,this.begin=r,this.end=n,this.file=i}var ge,ye=(t(me,ge=de),me);function me(t,e,r,n,i,s,o,a){var u=ge.call(this,t,r,n,i,a)||this;u.trimLeft=!1,u.trimRight=!1,u.content=u.getText();var c="-"===e[0],l="-"===y(e);return u.content=e.slice(c?1:0,l?-1:e.length).trim(),u.trimLeft=c||s,u.trimRight=l||o,u}function we(t,e){if(t&&Nt(t))for(var r=e?V:B;_[t.input.charCodeAt(t.end-1-t.trimRight)]&r;)t.trimRight++}function be(t,e){if(t&&Nt(t)){for(var r=e?V:B;_[t.input.charCodeAt(t.begin+t.trimLeft)]&r;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}}var Te,ke=(t(xe,Te=de),xe);function xe(t,e){var r=Te.call(this,p.TokenKind.Number,t.input,t.begin,e?e.end:t.end,t.file)||this;return r.whole=t,r.decimal=e,r}var qe,Oe=(t(Fe,qe=de),Fe.prototype.isNumber=function(t){void 0===t&&(t=!1);for(var e=t&&64&_[this.input.charCodeAt(this.begin)]?this.begin+1:this.begin;e<this.end;e++)if(!(32&_[this.input.charCodeAt(e)]))return!1;return!0},Fe);function Fe(t,e,r,n){var i=qe.call(this,p.TokenKind.Word,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.content=i.getText(),i}var Se,Re=(t(Ee,Se=de),Ee);function Ee(t,e,r,n){var i=Se.call(this,p.TokenKind.Literal,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.literal=i.getText(),i}var Le,Pe={"==":1,"!=":1,">":1,"<":1,">=":1,"<=":1,contains:1,and:0,or:0},De=(t(Ne,Le=de),Ne.prototype.getPrecedence=function(){var t=this.getText();return t in Pe?Pe[t]:1},Ne);function Ne(t,e,r,n){var i=Le.call(this,p.TokenKind.Operator,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.operator=i.getText(),i}var Me,Ae=(t(Ie,Me=de),Ie);function Ie(t,e,r){var n=Me.call(this,p.TokenKind.PropertyAccess,t.input,t.begin,r,t.file)||this;return n.variable=t,n.props=e,n.propertyName=n.variable instanceof Oe?n.variable.getText():ce(n.variable.getText()),n}var ze,_e=(t(je,ze=de),je);function je(t,e,r,n,i,s){var o=ze.call(this,p.TokenKind.Filter,r,n,i,s)||this;return o.name=t,o.args=e,o}var Ve,Be=(t(Ce,Ve=de),Ce);function Ce(t,e,r,n,i,s){var o=Ve.call(this,p.TokenKind.Hash,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.name=n,o.value=i,o.file=s,o}var He,Ke=(t(Ue,He=de),Ue);function Ue(t,e,r,n){var i=He.call(this,p.TokenKind.Quoted,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i}var We,Qe=(t(Je,We=de),Je.prototype.getContent=function(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)},Je);function Je(t,e,r,n){var i=We.call(this,p.TokenKind.HTML,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.trimLeft=0,i.trimRight=0,i}var Ye,$e=(t(Ge,Ye=de),Ge);function Ge(t,e,r,n,i,s){var o=Ye.call(this,p.TokenKind.Range,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.lhs=n,o.rhs=i,o.file=s,o}var Xe,Ze=(t(tr,Xe=ye),tr);function tr(t,e,r,n,i){var s=n.trimOutputLeft,o=n.trimOutputRight,a=n.outputDelimiterLeft,u=n.outputDelimiterRight,c=t.slice(e+a.length,r-u.length);return Xe.call(this,p.TokenKind.Output,c,t,e,r,s,o,i)||this}var er=(rr.prototype.readExpression=function(){return new le(this.readExpressionTokens())},rr.prototype.readExpressionTokens=function(){var e,r,n;return T(this,function(t){switch(t.label){case 0:return(e=this.readValue())?[4,e]:[2];case 1:t.sent(),t.label=2;case 2:return this.p<this.N?(r=this.readOperator())&&(n=this.readValue())?[4,r]:[2]:[3,5];case 3:return t.sent(),[4,n];case 4:return t.sent(),[3,2];case 5:return[2]}})},rr.prototype.readOperator=function(){this.skipBlank();var t=function(t,e,r,n){void 0===n&&(n=t.length);for(var i,s=r,o=e;s[t[o]]&&o<n;)(s=s[t[o++]]).end&&(i=s);return i?i.needBoundary&&_[t.charCodeAt(o)]&j?-1:o:-1}(this.input,this.p,this.trie,this.p+8);if(-1!==t)return new De(this.input,this.p,this.p=t,this.file)},rr.prototype.readFilters=function(){for(var t=[];;){var e=this.readFilter();if(!e)return t;t.push(e)}},rr.prototype.readFilter=function(){var t=this;if(this.skipBlank(),this.end())return null;Qt("|"===this.peek(),function(){return"unexpected token at "+t.snapshot()}),this.p++;var e=this.p,r=this.readIdentifier();if(!r.size())return null;var n=[];if(this.skipBlank(),":"===this.peek())do{++this.p;var i=this.readFilterArg();for(i&&n.push(i);this.p<this.N&&","!==this.peek()&&"|"!==this.peek();)++this.p}while(","===this.peek());return new _e(r.getText(),n,this.input,e,this.p,this.file)},rr.prototype.readFilterArg=function(){var t=this.readValue();if(t){if(this.skipBlank(),":"!==this.peek())return t;++this.p;var e=this.readValue();return[t.getText(),e]}},rr.prototype.readTopLevelTokens=function(t){void 0===t&&(t=H);for(var e=[];this.p<this.N;){var r=this.readTopLevelToken(t);e.push(r)}return function(t,e){for(var r=!1,n=0;n<t.length;n++){var i=t[n];Pt(i)&&(!r&&i.trimLeft&&we(t[n-1],e.greedy),At(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight&&be(t[n+1],e.greedy))}}(e,t),e},rr.prototype.readTopLevelToken=function(t){var e=t.tagDelimiterLeft,r=t.outputDelimiterLeft;return-1<this.rawBeginAt?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(r)?this.readOutputToken(t):this.readHTMLToken(t)},rr.prototype.readHTMLToken=function(t){for(var e=this.p;this.p<this.N;){var r=t.tagDelimiterLeft,n=t.outputDelimiterLeft;if(this.match(r))break;if(this.match(n))break;++this.p}return new Qe(this.input,e,this.p,this.file)},rr.prototype.readTagToken=function(t){void 0===t&&(t=H);var e=this.file,r=this.input,n=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.mkError("tag "+this.snapshot(n)+" not closed",n);var i=new ir(r,n,this.p,t,e);return"raw"===i.name&&(this.rawBeginAt=n),i},rr.prototype.readToDelimiter=function(t){for(;this.p<this.N;)if(8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1},rr.prototype.readOutputToken=function(t){void 0===t&&(t=H);var e=this.file,r=this.input,n=t.outputDelimiterRight,i=this.p;if(-1===this.readToDelimiter(n))throw this.mkError("output "+this.snapshot(i)+" not closed",i);return new Ze(r,i,this.p,t,e)},rr.prototype.readEndrawOrRawContent=function(t){for(var e=t.tagDelimiterLeft,r=t.tagDelimiterRight,n=this.p,i=this.readTo(e)-e.length;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(r)){var s=this.p;return n===i?(this.rawBeginAt=-1,new ir(this.input,n,s,t,this.file)):(this.p=i,new Qe(this.input,n,i,this.file))}if(this.rmatch(e))break;this.p++}else i=this.readTo(e)-e.length;throw this.mkError("raw "+this.snapshot(this.rawBeginAt)+" not closed",n)},rr.prototype.mkError=function(t,e){return new Y(t,new Oe(this.input,e,this.N,this.file))},rr.prototype.snapshot=function(t){return void 0===t&&(t=this.p),JSON.stringify(function(t,e){return t.length>e?t.substr(0,e-3)+"...":t}(this.input.slice(t),16))},rr.prototype.readWord=function(){return console.warn("Tokenizer#readWord() will be removed, use #readIdentifier instead"),this.readIdentifier()},rr.prototype.readIdentifier=function(){this.skipBlank();for(var t=this.p;this.peekType()&j;)++this.p;return new Oe(this.input,t,this.p,this.file)},rr.prototype.readHashes=function(){for(var t=[];;){var e=this.readHash();if(!e)return t;t.push(e)}},rr.prototype.readHash=function(){this.skipBlank(),","===this.peek()&&++this.p;var t,e=this.p,r=this.readIdentifier();if(r.size())return this.skipBlank(),":"===this.peek()&&(++this.p,t=this.readValue()),new Be(this.input,e,this.p,r,t,this.file)},rr.prototype.remaining=function(){return this.input.slice(this.p)},rr.prototype.advance=function(t){void 0===t&&(t=1),this.p+=t},rr.prototype.end=function(){return this.p>=this.N},rr.prototype.readTo=function(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1},rr.prototype.readValue=function(){var t=this.readQuoted()||this.readRange();if(t)return t;if("["===this.peek()){if(this.p++,!(i=this.readQuoted()))return;if("]"!==this.peek())return;return this.p++,new Ae(i,[],this.p)}var e=this.readIdentifier();if(e.size()){for(var r=e.isNumber(!0),n=[];;)if("["===this.peek()){r=!1,this.p++;var i=this.readValue()||new Oe(this.input,this.p,this.p,this.file);this.readTo("]"),n.push(i)}else{if("."!==this.peek()||"."===this.peek(1))break;if(this.p++,!(i=this.readIdentifier()).size())break;i.isNumber()||(r=!1),n.push(i)}return!n.length&&ie.hasOwnProperty(e.content)?new Re(this.input,e.begin,e.end,this.file):r?new ke(e,n[0]):new Ae(e,n,this.p)}},rr.prototype.readRange=function(){this.skipBlank();var t=this.p;if("("===this.peek()){++this.p;var e=this.readValueOrThrow();this.p+=2;var r=this.readValueOrThrow();return++this.p,new $e(this.input,t,this.p,e,r,this.file)}},rr.prototype.readValueOrThrow=function(){var t=this,e=this.readValue();return Qt(e,function(){return"unexpected token "+t.snapshot()+", value expected"}),e},rr.prototype.readQuoted=function(){this.skipBlank();var t=this.p;if(8&this.peekType()){++this.p;for(var e=!1;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new Ke(this.input,t,this.p,this.file)}},rr.prototype.readFileName=function(){for(var t=this.p;!(this.peekType()&V)&&","!==this.peek()&&this.p<this.N;)this.p++;return new Oe(this.input,t,this.p,this.file)},rr.prototype.match=function(t){for(var e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0},rr.prototype.rmatch=function(t){for(var e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0},rr.prototype.peekType=function(t){return void 0===t&&(t=0),_[this.input.charCodeAt(this.p+t)]},rr.prototype.peek=function(t){return void 0===t&&(t=0),this.input[this.p+t]},rr.prototype.skipBlank=function(){for(;this.peekType()&V;)++this.p},rr);function rr(t,e,r){void 0===r&&(r=""),this.input=t,this.trie=e,this.file=r,this.p=0,this.rawBeginAt=-1,this.N=t.length}var nr,ir=(t(sr,nr=ye),sr);function sr(t,e,r,n,i){var s=this,o=n.trimTagLeft,a=n.trimTagRight,u=n.tagDelimiterLeft,c=n.tagDelimiterRight,l=t.slice(e+u.length,r-c.length);s=nr.call(this,p.TokenKind.Tag,l,t,e,r,o,a,i)||this;var h=new er(s.content,n.operatorsTrie);if(s.name=h.readIdentifier().getText(),!s.name)throw new Y("illegal tag syntax",s);return h.skipBlank(),s.args=h.remaining(),s}var or=(ar.prototype.render=function(e){var r,n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:r={},t.label=1;case 1:t.trys.push([1,8,9,10]),n=k(Object.keys(this.hash)),i=n.next(),t.label=2;case 2:return i.done?[3,7]:(s=i.value,o=r,a=s,void 0!==this.hash[s]?[3,3]:(u=!0,[3,5]));case 3:return[4,pe(this.hash[s],e)];case 4:u=t.sent(),t.label=5;case 5:o[a]=u,t.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}return[7];case 10:return[2,r]}})},ar);function ar(t){var e,r;this.hash={};var n=new er(t,{});try{for(var i=k(n.readHashes()),s=i.next();!s.done;s=i.next()){var o=s.value;this.hash[o.name.content]=o.value}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}var ur=(cr.prototype.render=function(t,e){var r,n,i=[];try{for(var s=k(this.args),o=s.next();!o.done;o=s.next()){var a=o.value;v(a)?i.push([a[0],pe(a[1],e)]):i.push(pe(a,e))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this.impl.apply({context:e,liquid:this.liquid},w([t],i))},cr);function cr(t,e,r,n){this.name=t,this.impl=e||F,this.args=r,this.liquid=n}var lr=(hr.prototype.value=function(e,r){var n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:return r=r||e.opts.lenientIf&&0<this.filters.length&&"default"===this.filters[0].name,[4,this.initial.evaluate(e,r)];case 1:n=t.sent(),t.label=2;case 2:t.trys.push([2,7,8,9]),i=k(this.filters),s=i.next(),t.label=3;case 3:return s.done?[3,6]:[4,s.value.render(n,e)];case 4:n=t.sent(),t.label=5;case 5:return s=i.next(),[3,3];case 6:return[3,9];case 7:return o=t.sent(),a={error:o},[3,9];case 8:try{s&&!s.done&&(u=i.return)&&u.call(i)}finally{if(a)throw a.error}return[7];case 9:return[2,n]}})},hr);function hr(t,n){this.filters=[];var e=new er(t,n.options.operatorsTrie);this.initial=e.readExpression(),this.filters=e.readFilters().map(function(t){var e=t.name,r=t.args;return new ur(e,n.filters.get(e),r,n)})}var pr,fr=(t(dr,pr=Wt),dr.prototype.render=function(e,r){var n,i;return T(this,function(t){switch(t.label){case 0:return[4,new or(this.token.args).render(e)];case 1:return n=t.sent(),c((i=this.impl).render)?[4,i.render(e,r,n)]:[3,3];case 2:return[2,t.sent()];case 3:return[2]}})},dr);function dr(t,e,r){var n=pr.call(this,t)||this;n.name=t.name;var i=r.tags.get(t.name);return n.impl=Object.create(i),n.impl.liquid=r,n.impl.parse&&n.impl.parse(t,e),n}var vr,gr=(t(yr,vr=Wt),yr.prototype.render=function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return[4,this.value.value(e,!1)];case 1:return n=t.sent(),r.write(n),[2]}})},yr);function yr(t,e){var r=vr.call(this,t)||this;return r.value=new lr(t.content,e),r}var mr,wr=(t(br,mr=Wt),br.prototype.render=function(t,e){return T(this,function(t){return e.write(this.str),[2]})},br);function br(t){var e=mr.call(this,t)||this;return e.str=t.getContent(),e}var Tr=(kr.prototype.parse=function(t,e){var r=new er(t,this.liquid.options.operatorsTrie,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(r)},kr.prototype.parseTokens=function(t){for(var e,r=[];e=t.shift();)r.push(this.parseToken(e,t));return r},kr.prototype.parseToken=function(e,t){try{return At(e)?new fr(e,t,this.liquid):Mt(e)?new gr(e,this.liquid):new wr(e)}catch(t){throw new X(t,e)}},kr.prototype.parseStream=function(t){var r=this;return new Kt(t,function(t,e){return r.parseToken(t,e)})},kr.prototype._parseFileCached=function(e,r,n,i){var s,o;return void 0===n&&(n=pt.Root),T(this,function(t){switch(t.label){case 0:return s=this.loader.shouldLoadRelative(e)?i+","+e:n+":"+e,[4,this.cache.read(s)];case 1:return(o=t.sent())?[2,o]:[4,this._parseFile(e,r,n,i)];case 2:return o=t.sent(),this.cache.write(s,o),[2,o]}})},kr.prototype._parseFile=function(e,r,n,i){var s,o,a,u;return void 0===n&&(n=pt.Root),T(this,function(t){switch(t.label){case 0:return[4,this.loader.lookup(e,n,r,i)];case 1:return s=t.sent(),a=(o=this.liquid).parse,r?(u=this.fs.readFileSync(s),[3,4]):[3,2];case 2:return[4,this.fs.readFile(s)];case 3:u=t.sent(),t.label=4;case 4:return[2,a.apply(o,[u,s])]}})},kr);function kr(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new gt(this.liquid.options)}var xr={parse:function(t){var e=new er(t.args,this.liquid.options.operatorsTrie);this.key=e.readIdentifier().content,e.skipBlank(),Qt("="===e.peek(),function(){return"illegal token "+t.getText()}),e.advance(),this.value=e.remaining()},render:function(e){var r,n;return T(this,function(t){switch(t.label){case 0:return r=e.bottom(),n=this.key,[4,this.liquid._evalValue(this.value,e)];case 1:return r[n]=t.sent(),[2]}})}};function qr(e){return v(e)?e:u(e)&&0<e.length?[e]:b(e)?Object.keys(e).map(function(t){return[t,e[t]]}):[]}function Or(t){return v(t)?t:[t]}var Fr,Sr=(t(Rr,Fr=o),Rr.prototype.next=function(){this.i++},Rr.prototype.index0=function(){return this.i},Rr.prototype.index=function(){return this.i+1},Rr.prototype.first=function(){return 0===this.i},Rr.prototype.last=function(){return this.i===this.length-1},Rr.prototype.rindex=function(){return this.length-this.i},Rr.prototype.rindex0=function(){return this.length-this.i-1},Rr.prototype.valueOf=function(){return JSON.stringify(this)},Rr);function Rr(t,e,r){var n=Fr.call(this)||this;return n.i=0,n.length=t,n.name=r+"-"+e,n}var Er=["offset","limit","reversed"],Lr={type:"block",parse:function(t,e){var r,n=this,i=new er(t.args,this.liquid.options.operatorsTrie),s=i.readIdentifier(),o=i.readIdentifier(),a=i.readValue();Qt(s.size()&&"in"===o.content&&a,function(){return"illegal tag: "+t.getText()}),this.variable=s.content,this.collection=a,this.hash=new or(i.remaining()),this.templates=[],this.elseTemplates=[];var u=this.liquid.parser.parseStream(e).on("start",function(){return r=n.templates}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endfor",function(){return u.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});u.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=qr,[4,pe(this.collection,e)];case 1:return(i=s.apply(void 0,[t.sent()])).length?[3,3]:[4,n.renderTemplates(this.elseTemplates,e,r)];case 2:return t.sent(),[2];case 3:return[4,this.hash.render(e)];case 4:o=t.sent(),a=this.liquid.options.orderedFilterParameters?Object.keys(o).filter(function(t){return Er.includes(t)}):Er.filter(function(t){return void 0!==o[t]}),i=a.reduce(function(t,e){return"offset"===e?function(t,e){return t.slice(e)}(t,o.offset):"limit"===e?function(t,e){return t.slice(0,e)}(t,o.limit):function(t){return w(t).reverse()}(t)},i),u={forloop:new Sr(i.length,this.collection.getText(),this.variable)},e.push(u),t.label=5;case 5:t.trys.push([5,10,11,12]),c=k(i),l=c.next(),t.label=6;case 6:return l.done?[3,9]:(h=l.value,u[this.variable]=h,[4,n.renderTemplates(this.templates,e,r)]);case 7:if(t.sent(),r.break)return r.break=!1,[3,9];r.continue=!1,u.forloop.next(),t.label=8;case 8:return l=c.next(),[3,6];case 9:return[3,12];case 10:return p=t.sent(),f={error:p},[3,12];case 11:try{l&&!l.done&&(d=c.return)&&d.call(c)}finally{if(f)throw f.error}return[7];case 12:return e.pop(),[2]}})}};var Pr={parse:function(t,e){var r=this,n=new er(t.args,this.liquid.options.operatorsTrie);this.variable=function(t){var e=t.readIdentifier().content;if(e)return e;var r=t.readQuoted();if(r)return fe(r)}(n),Qt(this.variable,function(){return t.args+" not valid identifier"}),this.templates=[];var i=this.liquid.parser.parseStream(e);i.on("tag:endcapture",function(){return i.stop()}).on("template",function(t){return r.templates.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),i.start()},render:function(e){var r;return T(this,function(t){switch(t.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,e)];case 1:return r=t.sent(),e.bottom()[this.variable]=r,[2]}})}};var Dr,Nr,Mr={parse:function(t,e){var n=this;this.cond=new lr(t.args,this.liquid),this.cases=[],this.elseTemplates=[];var i=[],r=this.liquid.parser.parseStream(e).on("tag:when",function(t){i=[];for(var e=new er(t.args,n.liquid.options.operatorsTrie);!e.end();){var r=e.readValue();n.cases.push({val:r,templates:i}),e.readTo(",")}}).on("tag:else",function(){return i=n.elseTemplates}).on("tag:endcase",function(){return r.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});r.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=f,[4,this.cond.value(e,e.opts.lenientIf)];case 1:i=s.apply(void 0,[t.sent()]),t.label=2;case 2:t.trys.push([2,7,8,9]),o=k(this.cases),a=o.next(),t.label=3;case 3:return a.done?[3,6]:(u=a.value,pe(u.val,e,e.opts.lenientIf)!==i?[3,5]:[4,n.renderTemplates(u.templates,e,r)]);case 4:return t.sent(),[2];case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},Ar={parse:function(t,e){var r=this.liquid.parser.parseStream(e);r.on("token",function(t){"endcomment"===t.name&&r.stop()}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),r.start()}};(Nr=Dr=Dr||{})[Nr.OUTPUT=0]="OUTPUT",Nr[Nr.STORE=1]="STORE";var Ir=Dr,zr={parseFilePath:_r,renderFilePath:jr,parse:function(t){var e=t.args,r=new er(e,this.liquid.options.operatorsTrie);for(this.file=this.parseFilePath(r,this.liquid),this.currentFile=t.file;!r.end();){r.skipBlank();var n=r.p,i=r.readIdentifier();if(("with"===i.content||"for"===i.content)&&(r.skipBlank(),":"!==r.peek())){var s=r.readValue();if(s){var o=r.p,a=void 0;"as"===r.readIdentifier().content?a=r.readIdentifier():r.p=o,this[i.content]={value:s,alias:a&&a.content},r.skipBlank(),","===r.peek()&&r.advance();continue}}r.p=n;break}this.hash=new or(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d,v,g,y,m,w,b;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,[4,this.renderFilePath(this.file,e,i)];case 1:return Qt(o=t.sent(),function(){return'illegal filename "'+o+'"'}),a=new dt({},e.opts,e.sync),[4,s.render(e)];case 2:if(u=t.sent(),this.with&&(c=this.with,h=c.value,p=c.alias,u[p||o]=pe(h,e)),a.push(u),!this.for)return[3,12];l=this.for,h=l.value,p=l.alias,f=qr(f=pe(h,e)),u.forloop=new Sr(f.length,h.getText(),p),t.label=3;case 3:t.trys.push([3,9,10,11]),d=k(f),v=d.next(),t.label=4;case 4:return v.done?[3,8]:(g=v.value,u[p]=g,[4,i._parsePartialFile(o,a.sync,this.currentFile)]);case 5:return m=t.sent(),[4,i.renderer.renderTemplates(m,a,r)];case 6:t.sent(),u.forloop.next(),t.label=7;case 7:return v=d.next(),[3,4];case 8:return[3,11];case 9:return y=t.sent(),w={error:y},[3,11];case 10:try{v&&!v.done&&(b=d.return)&&b.call(d)}finally{if(w)throw w.error}return[7];case 11:return[3,15];case 12:return[4,i._parsePartialFile(o,a.sync,this.currentFile)];case 13:return m=t.sent(),[4,i.renderer.renderTemplates(m,a,r)];case 14:t.sent(),t.label=15;case 15:return[2]}})}};function _r(t,e){if(e.options.dynamicPartials){var r=t.readValue();if(void 0===r)throw new TypeError('illegal argument "'+t.input+'"');if("none"===r.getText())return null;if(It(r)){var n=e.parse(fe(r));return 1===n.length&&Nt(n[0].token)?n[0].token.getContent():n}return r}var i=t.readFileName().getText();return"none"===i?null:i}function jr(t,e,r){return"string"==typeof t?t:Array.isArray(t)?r.renderer.renderTemplates(t,e):pe(t,e)}var Vr,Br={parseFilePath:_r,renderFilePath:jr,parse:function(t){var e=t.args,r=new er(e,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid),this.currentFile=t.file;var n=r.p;"with"===r.readIdentifier().content?(r.skipBlank(),":"!==r.peek()?this.withVar=r.readValue():r.p=n):r.p=n,this.hash=new or(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.withVar,a=i.renderer,[4,this.renderFilePath(this.file,e,i)];case 1:return Qt(u=t.sent(),function(){return'illegal filename "'+u+'"'}),c=e.saveRegister("blocks","blockMode"),e.setRegister("blocks",{}),e.setRegister("blockMode",Ir.OUTPUT),[4,s.render(e)];case 2:return l=t.sent(),o&&(l[u]=pe(o,e)),[4,i._parsePartialFile(u,e.sync,this.currentFile)];case 3:return h=t.sent(),e.push(l),[4,a.renderTemplates(h,e,r)];case 4:return t.sent(),e.pop(),e.restoreRegister(c),[2]}})}},Cr={parse:function(t){var e=new er(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0),e.write(l(--r[this.variable]))}},Hr={parse:function(t){var e=new er(t.args,this.liquid.options.operatorsTrie),r=e.readValue();for(e.skipBlank(),this.candidates=[],r&&(":"===e.peek()?(this.group=r,e.advance()):this.candidates.push(r));!e.end();){var n=e.readValue();n&&this.candidates.push(n),e.readTo(",")}Qt(this.candidates.length,function(){return"empty candidates: "+t.getText()})},render:function(t,e){var r="cycle:"+pe(this.group,t)+":"+this.candidates.join(","),n=t.getRegister("cycle"),i=n[r];void 0===i&&(i=n[r]=0);var s=this.candidates[i];i=(i+1)%this.candidates.length,n[r]=i;var o=pe(s,t);e.write(o)}},Kr={parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[],this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({predicate:new lr(t.args,n.liquid),templates:r=[]})}).on("tag:elsif",function(t){return n.branches.push({predicate:new lr(t.args,n.liquid),templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endif",function(){this.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=k(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:(o=s.value,a=o.predicate,u=o.templates,[4,a.value(e,e.opts.lenientIf)]);case 3:return A(t.sent(),e)?[4,n.renderTemplates(u,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},Ur={parse:function(t){var e=new er(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0);var n=r[this.variable];r[this.variable]++,e.write(l(n))}},Wr={parseFilePath:_r,renderFilePath:jr,parse:function(t,e){var r=new er(t.args,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid),this.currentFile=t.file,this.hash=new or(r.remaining()),this.tpls=this.liquid.parser.parseTokens(e)},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.file,a=i.renderer,null!==o?[3,2]:(e.setRegister("blockMode",Ir.OUTPUT),[4,a.renderTemplates(this.tpls,e,r)]);case 1:return t.sent(),[2];case 2:return[4,this.renderFilePath(this.file,e,i)];case 3:return Qt(u=t.sent(),function(){return'illegal filename "'+u+'"'}),[4,i._parseLayoutFile(u,e.sync,this.currentFile)];case 4:return c=t.sent(),e.setRegister("blockMode",Ir.STORE),[4,a.renderTemplates(this.tpls,e)];case 5:return l=t.sent(),void 0===(h=e.getRegister("blocks"))[""]&&(h[""]=function(t,e){return e.write(l)}),e.setRegister("blockMode",Ir.OUTPUT),f=(p=e).push,[4,s.render(e)];case 6:return f.apply(p,[t.sent()]),[4,a.renderTemplates(c,e,r)];case 7:return t.sent(),e.pop(),[2]}})}},Qr=(t(Jr,Vr=o),Jr.prototype.super=function(){return this.superBlockRender()},Jr);function Jr(t){void 0===t&&(t=function(){return""});var e=Vr.call(this)||this;return e.superBlockRender=t,e}var Yr,$r={parse:function(t,e){var r=this,n=/\w+/.exec(t.args);this.block=n?n[0]:"",this.tpls=[],this.liquid.parser.parseStream(e).on("tag:endblock",function(){this.stop()}).on("template",function(t){return r.tpls.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return n=this.getBlockRender(e),e.getRegister("blockMode")!==Ir.STORE?[3,1]:(e.getRegister("blocks")[this.block]=n,[3,3]);case 1:return[4,n(new Qr,r)];case 2:t.sent(),t.label=3;case 3:return[2]}})},getBlockRender:function(n){function r(e,r){return T(this,function(t){switch(t.label){case 0:return n.push({block:e}),[4,i.renderer.renderTemplates(s,n,r)];case 1:return t.sent(),n.pop(),[2]}})}var i=this.liquid,s=this.tpls,o=n.getRegister("blocks")[this.block];return o?function(t,e){return o(new Qr(function(){return r(t,e)}),e)}:r}},Gr={parse:function(t,e){var r=this;this.tokens=[];var n=this.liquid.parser.parseStream(e);n.on("token",function(t){"endraw"===t.name?n.stop():r.tokens.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),n.start()},render:function(){return this.tokens.map(function(t){return t.getText()}).join("")}},Xr=(t(Zr,Yr=Sr),Zr.prototype.row=function(){return Math.floor(this.i/this.cols)+1},Zr.prototype.col0=function(){return this.i%this.cols},Zr.prototype.col=function(){return this.col0()+1},Zr.prototype.col_first=function(){return 0===this.col0()},Zr.prototype.col_last=function(){return this.col()===this.cols},Zr);function Zr(t,e,r,n){var i=Yr.call(this,t,r,n)||this;return i.length=t,i.cols=e,i}var tn={assign:xr,for:Lr,capture:Pr,case:Mr,comment:Ar,include:Br,render:zr,decrement:Cr,increment:Ur,cycle:Hr,if:Kr,layout:Wr,block:$r,raw:Gr,tablerow:{parse:function(t,e){var r=this,n=new er(t.args,this.liquid.options.operatorsTrie),i=n.readIdentifier();n.skipBlank();var s,o=n.readIdentifier();Qt(o&&"in"===o.content,function(){return"illegal tag: "+t.getText()}),this.variable=i.content,this.collection=n.readValue(),this.hash=new or(n.remaining()),this.templates=[];var a=this.liquid.parser.parseStream(e).on("start",function(){return s=r.templates}).on("tag:endtablerow",function(){return a.stop()}).on("template",function(t){return s.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});a.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:return i=qr,[4,pe(this.collection,e)];case 1:return n=i.apply(void 0,[t.sent()]),[4,this.hash.render(e)];case 2:s=t.sent(),o=s.offset||0,a=void 0===s.limit?n.length:s.limit,n=n.slice(o,o+a),u=s.cols||n.length,c=this.liquid.renderer,l=new Xr(n.length,u,this.collection.getText(),this.variable),h={tablerowloop:l},e.push(h),p=0,t.label=3;case 3:return p<n.length?(h[this.variable]=n[p],0===l.col0()&&(1!==l.row()&&r.write("</tr>"),r.write('<tr class="row'+l.row()+'">')),r.write('<td class="col'+l.col()+'">'),[4,c.renderTemplates(this.templates,e,r)]):[3,6];case 4:t.sent(),r.write("</td>"),t.label=5;case 5:return p++,l.next(),[3,3];case 6:return n.length&&r.write("</tr>"),e.pop(),[2]}})}},unless:{parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[],this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({predicate:new lr(t.args,n.liquid),test:I,templates:r=[]})}).on("tag:elsif",function(t){return n.branches.push({predicate:new lr(t.args,n.liquid),test:A,templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endunless",function(){this.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=k(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:(o=s.value,a=o.predicate,u=o.test,c=o.templates,[4,a.value(e,e.opts.lenientIf)]);case 3:return l=t.sent(),u(l,e)?[4,n.renderTemplates(c,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return h=t.sent(),p={error:h},[3,9];case 8:try{s&&!s.done&&(f=i.return)&&f.call(i)}finally{if(p)throw p.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},break:{render:function(t,e){e.break=!0}},continue:{render:function(t,e){e.continue=!0}}},en={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},rn={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function nn(t){return l(t).replace(/&|<|>|"|'/g,function(t){return en[t]})}var sn=Math.abs,on=Math.max,an=Math.min,un=Math.ceil,cn=Math.floor;var ln=/%([-_0^#:]+)?(\d+)?([EO])?(.)/,hn=["January","February","March","April","May","June","July","August","September","October","November","December"],pn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],fn=hn.map(gn),dn=pn.map(gn),vn={1:"st",2:"nd",3:"rd",default:"th"};function gn(t){return t.slice(0,3)}function yn(t){for(var e=0,r=0;r<t.getMonth();++r)e+=[31,function(t){var e=t.getFullYear();return!(0!=(3&e)||!(e%100||e%400==0&&e))}(t)?29:28,31,30,31,30,31,31,30,31,30,31][r];return e+t.getDate()}function mn(t,e){var r=yn(t)+(e-t.getDay()),n=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((r-n)/7)+1)}var wn={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},bn={a:" ",A:" ",b:" ",B:" ",c:" ",e:" ",k:" ",l:" ",p:" ",P:" "},Tn={a:function(t){return dn[t.getDay()]},A:function(t){return pn[t.getDay()]},b:function(t){return fn[t.getMonth()]},B:function(t){return hn[t.getMonth()]},c:function(t){return t.toLocaleString()},C:function(t){return function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t)},d:function(t){return t.getDate()},e:function(t){return t.getDate()},H:function(t){return t.getHours()},I:function(t){return String(t.getHours()%12||12)},j:function(t){return yn(t)},k:function(t){return t.getHours()},l:function(t){return String(t.getHours()%12||12)},L:function(t){return t.getMilliseconds()},m:function(t){return t.getMonth()+1},M:function(t){return t.getMinutes()},N:function(t,e){var r=Number(e.width)||9;return function(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return t+e})}(String(t.getMilliseconds()).substr(0,r),r,"0")},p:function(t){return t.getHours()<12?"AM":"PM"},P:function(t){return t.getHours()<12?"am":"pm"},q:function(t){return function(t){var e=t.getDate().toString(),r=parseInt(e.slice(-1));return vn[r]||vn.default}(t)},s:function(t){return Math.round(t.valueOf()/1e3)},S:function(t){return t.getSeconds()},u:function(t){return t.getDay()||7},U:function(t){return mn(t,0)},w:function(t){return t.getDay()},W:function(t){return mn(t,1)},x:function(t){return t.toLocaleDateString()},X:function(t){return t.toLocaleTimeString()},y:function(t){return t.getFullYear().toString().substring(2,4)},Y:function(t){return t.getFullYear()},z:function(t,e){var r=Math.abs(t.getTimezoneOffset()),n=Math.floor(r/60),i=r%60;return(0<t.getTimezoneOffset()?"-":"+")+q(n,2,"0")+(e.flags[":"]?":":"")+q(i,2,"0")},t:function(){return"\t"},n:function(){return"\n"},"%":function(){return"%"}};function kn(t,e){var r,n,i=m(e,5),s=i[0],o=i[1],a=void 0===o?"":o,u=i[2],c=i[3],l=i[4],h=Tn[l];if(!h)return s;var p={};try{for(var f=k(a),d=f.next();!d.done;d=f.next()){p[d.value]=!0}}catch(t){r={error:t}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var v=String(h(t,{flags:p,width:u,modifier:c})),g=bn[l]||"0",y=u||wn[l]||0;return p["^"]?v=v.toUpperCase():p["#"]&&(v=function(t){return w(t).some(function(t){return"a"<=t&&t<="z"})?t.toUpperCase():t.toLowerCase()}(v)),p._?g=" ":p[0]&&(g="0"),p["-"]&&(y=0),q(v,y,g)}Tn.h=Tn.b;var xn,qn=(new Date).getTimezoneOffset(),On=/([zZ]|([+-])(\d{2}):(\d{2}))$/,Fn=(t(Sn,xn=Date),Sn.prototype.getTimezoneOffset=function(){return this.timezoneOffset},Sn.createDateFixedToTimezone=function(t){var e=t.match(On);if(e&&"Z"===e[1])return new Sn(+new Date(t),0);if(e&&e[2]&&e[3]&&e[4]){var r=m(e,5),n=r[2],i=r[3],s=r[4],o=("+"===n?-1:1)*(60*parseInt(i,10)+parseInt(s,10));return new Sn(+new Date(t),o)}return new Date(t)},Sn);function Sn(t,e){var r=this;if(t instanceof Sn)return t;var n=6e4*(qn-e),i=new Date(t).getTime()+n;return(r=xn.call(this,i)||this).timezoneOffset=e,r}var Rn=Object.freeze({escape:nn,escapeOnce:function(t){return nn(function(t){return String(t).replace(/&(amp|lt|gt|#34|#39);/g,function(t){return rn[t]})}(t))},newlineToBr:function(t){return t.replace(/\n/g,"<br />\n")},stripHtml:function(t){return t.replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")},abs:sn,atLeast:on,atMost:an,ceil:un,dividedBy:function(t,e){return t/e},floor:cn,minus:function(t,e){return t-e},modulo:function(t,e){return t%e},times:function(t,e){return t*e},round:function(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return Math.round(t*r)/r},plus:function(t,e){return Number(t)+Number(e)},sortNatural:function(t,r){return t&&t.sort?void 0!==r?w(t).sort(function(t,e){return R(t[r],e[r])}):w(t).sort(R):[]},urlDecode:function(t){return t.split("+").map(decodeURIComponent).join(" ")},urlEncode:function(t){return t.split(" ").map(encodeURIComponent).join("+")},join:function(t,e){return t.join(void 0===e?" ":e)},last:function(t){return v(t)?y(t):""},first:function(t){return v(t)?t[0]:""},reverse:function(t){return w(t).reverse()},sort:function(t,e){function r(t){return e?n.context.getFromScope(t,e.split(".")):t}var n=this;return Or(t).sort(function(t,e){return(t=r(t))<(e=r(e))?-1:e<t?1:0})},size:function(t){return t&&t.length||0},map:function(t,e){var r=this;return Or(t).map(function(t){return r.context.getFromScope(t,e.split("."))})},compact:function(t){return Or(t).filter(function(t){return!d(t)})},concat:function(t,e){return Or(t).concat(e)},slice:function(t,e,r){return void 0===r&&(r=1),e=e<0?t.length+e:e,t.slice(e,e+r)},where:function(t,r,n){var i=this;return Or(t).filter(function(t){var e=i.context.getFromScope(t,String(r).split("."));return void 0===n?A(e,i.context):e===n})},uniq:function(t){var e={};return(t||[]).filter(function(t){return!e.hasOwnProperty(String(t))&&(e[String(t)]=!0)})},date:function(t,e){var r,n=this.context.opts;return function(t){return t instanceof Date&&!isNaN(t.getTime())}(r="now"===t||"today"===t?new Date:h(t)?new Date(1e3*t):u(t)?/^\d+$/.test(t)?new Date(1e3*+t):n.preserveTimezones?Fn.createDateFixedToTimezone(t):new Date(t):t)?(n.hasOwnProperty("timezoneOffset")&&(r=new Fn(r,n.timezoneOffset)),function(t,e){for(var r,n="",i=e;r=ln.exec(i);)n+=i.slice(0,r.index),i=i.slice(r.index+r[0].length),n+=kn(t,r);return n+i}(r,e)):t},Default:function(t,e){return v(t)||u(t)?t.length?t:e:I(f(t),this.context)?e:t},json:function(t){return JSON.stringify(t)},append:function(t,e){return Qt(2===arguments.length,function(){return"append expect 2 arguments"}),l(t)+l(e)},prepend:function(t,e){return Qt(2===arguments.length,function(){return"prepend expect 2 arguments"}),l(e)+l(t)},lstrip:function(t){return l(t).replace(/^\s+/,"")},downcase:function(t){return l(t).toLowerCase()},upcase:function(t){return l(t).toUpperCase()},remove:function(t,e){return l(t).split(String(e)).join("")},removeFirst:function(t,e){return l(t).replace(String(e),"")},rstrip:function(t){return l(t).replace(/\s+$/,"")},split:function(t,e){return l(t).split(String(e))},strip:function(t){return l(t).trim()},stripNewlines:function(t){return l(t).replace(/\n/g,"")},capitalize:function(t){return(t=l(t)).charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,r){return l(t).split(String(e)).join(r)},replaceFirst:function(t,e,r){return l(t).replace(String(e),r)},truncate:function(t,e,r){return void 0===e&&(e=50),void 0===r&&(r="..."),(t=l(t)).length<=e?t:t.substr(0,e-r.length)+r},truncatewords:function(t,e,r){void 0===e&&(e=15),void 0===r&&(r="...");var n=t.split(/\s+/),i=n.slice(0,e).join(" ");return n.length>=e&&(i+=r),i}}),En=(Ln.prototype.get=function(t){var e=this.impls[t];return Qt(e,function(){return'tag "'+t+'" not found'}),e},Ln.prototype.set=function(t,e){this.impls[t]=e},Ln);function Ln(){this.impls={}}var Pn=(Dn.prototype.get=function(t){var e=this.impls[t];return Qt(e||!this.strictFilters,function(){return"undefined filter: "+t}),e},Dn.prototype.set=function(t,e){this.impls[t]=e},Dn.prototype.create=function(t,e){return new ur(t,this.get(t),e,this.liquid)},Dn);function Dn(t,e){this.strictFilters=t,this.liquid=e,this.impls={}}var Nn=(Mn.prototype.parse=function(t,e){return this.parser.parse(t,e)},Mn.prototype._render=function(t,e,r){var n=new dt(e,this.options,r);return this.renderer.renderTemplates(t,n)},Mn.prototype.render=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,qt(this._render(e,r,!1))]})})},Mn.prototype.renderSync=function(t,e){return Ot(this._render(t,e,!0))},Mn.prototype.renderToNodeStream=function(t,e){var r=new dt(e,this.options);return this.renderer.renderTemplatesToNodeStream(t,r)},Mn.prototype._parseAndRender=function(t,e,r){var n=this.parse(t);return this._render(n,e,r)},Mn.prototype.parseAndRender=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,qt(this._parseAndRender(e,r,!1))]})})},Mn.prototype.parseAndRenderSync=function(t,e){return Ot(this._parseAndRender(t,e,!0))},Mn.prototype._parsePartialFile=function(t,e,r){return this.parser.parseFile(t,e,pt.Partials,r)},Mn.prototype._parseLayoutFile=function(t,e,r){return this.parser.parseFile(t,e,pt.Layouts,r)},Mn.prototype.parseFile=function(e){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,qt(this.parser.parseFile(e,!1))]})})},Mn.prototype.parseFileSync=function(t){return Ot(this.parser.parseFile(t,!0))},Mn.prototype.renderFile=function(r,n){return s(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r)];case 1:return e=t.sent(),[2,this.render(e,n)]}})})},Mn.prototype.renderFileSync=function(t,e){var r=this.parseFileSync(t);return this.renderSync(r,e)},Mn.prototype.renderFileToNodeStream=function(r,n){return s(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r)];case 1:return e=t.sent(),[2,this.renderToNodeStream(e,n)]}})})},Mn.prototype._evalValue=function(t,e){return new lr(t,this).value(e,!1)},Mn.prototype.evalValue=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,qt(this._evalValue(e,r))]})})},Mn.prototype.evalValueSync=function(t,e){return Ot(this._evalValue(t,e))},Mn.prototype.registerFilter=function(t,e){this.filters.set(t,e)},Mn.prototype.registerTag=function(t,e){this.tags.set(t,e)},Mn.prototype.plugin=function(t){return t.call(this,Mn)},Mn.prototype.express=function(){var i=this,s=!0;return function(t,e,r){var n;s&&(s=!1,(n=i.options.root).unshift.apply(n,w(K(this.root)))),i.renderFile(t,e).then(function(t){return r(null,t)},r)}},Mn);function Mn(t){var r=this;void 0===t&&(t={}),this.options=function(t){var e=i({},H,t);return e.partials===H.partials&&(e.partials=e.root),e.layouts===H.layouts&&(e.layouts=e.root),e}(function(t){if((t=t||{}).hasOwnProperty("root")&&(t.root=K(t.root)),t.hasOwnProperty("partials")&&(t.partials=K(t.partials)),t.hasOwnProperty("layouts")&&(t.layouts=K(t.layouts)),t.hasOwnProperty("cache")){var e=void 0;e="number"==typeof t.cache?0<t.cache?new L(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new L(1024):void 0,t.cache=e}return t.hasOwnProperty("operators")&&(t.operatorsTrie=C(t.operators)),t}(t)),this.parser=new Tr(this),this.renderer=new Et,this.filters=new Pn(this.options.strictFilters,this),this.tags=new En,g(tn,function(t,e){return r.registerTag(S(e),t)}),g(Rn,function(t,e){return r.registerFilter(S(e),t)})}p.AssertionError=lt,p.Context=dt,p.Drop=o,p.Expression=le,p.Hash=or,p.InternalUndefinedVariableError=at,p.Liquid=Nn,p.LiquidError=W,p.ParseError=X,p.ParseStream=Kt,p.RenderError=et,p.TagToken=ir,p.Token=de,p.TokenizationError=Y,p.Tokenizer=er,p.TypeGuards=Ht,p.UndefinedVariableError=it,p.Value=lr,p.assert=Qt,p.createTrie=C,p.defaultOperators=z,p.evalQuotedToken=fe,p.evalToken=pe,p.isFalsy=I,p.isTruthy=A,p.toPromise=qt,p.toThenable=xt,p.toValue=f,Object.defineProperty(p,"__esModule",{value:!0})});
//# sourceMappingURL=liquid.browser.min.js.map

@@ -28,4 +28,4 @@ /// <reference types="node" />

parseAndRenderSync(html: string, scope?: object): any;
_parsePartialFile(file: string, sync?: boolean): Iterator<Template[]>;
_parseLayoutFile(file: string, sync?: boolean): Iterator<Template[]>;
_parsePartialFile(file: string, sync?: boolean, currentFile?: string): Iterator<Template[]>;
_parseLayoutFile(file: string, sync?: boolean, currentFile?: string): Iterator<Template[]>;
parseFile(file: string): Promise<Template[]>;

@@ -32,0 +32,0 @@ parseFileSync(file: string): Template[];

@@ -10,3 +10,3 @@ import { Liquid } from '../liquid';

export default class Parser {
parseFile: (file: string, sync?: boolean, type?: LookupType) => Iterator<Template[]>;
parseFile: (file: string, sync?: boolean, type?: LookupType, currentFile?: string) => Iterator<Template[]>;
private liquid;

@@ -13,0 +13,0 @@ private fs;

@@ -1,16 +0,1 @@

export declare const timezoneOffset: number;
export default function (d: Date, formatStr: string): string;
/**
* Create a Date object fixed to it's declared Timezone. Both
* - 2021-08-06T02:29:00.000Z and
* - 2021-08-06T02:29:00.000+08:00
* will always be displayed as
* - 2021-08-06 02:29:00
* regardless timezoneOffset in JavaScript realm
*
* The implementation hack:
* Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`,
* we create a different Date to trick strftime, it's both simpler and more performant.
* Given that a template is expected to be parsed fewer times than rendered.
*/
export declare function createDateFixedToTimezone(dateString: string): Date;
{
"name": "liquidjs",
"version": "9.27.1",
"version": "9.28.0",
"description": "A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.",

@@ -5,0 +5,0 @@ "main": "dist/liquid.node.cjs.js",

@@ -113,2 +113,3 @@ # liquidjs

<td align="center"><a href="https://github.com/mattvague"><img src="https://avatars.githubusercontent.com/u/64985?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matt Vague</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=mattvague" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="https://github.com/bglw"><img src="https://avatars.githubusercontent.com/u/40188355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Liam Bigelow</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=bglw" title="Code">๐Ÿ’ป</a></td>
</tr>

@@ -115,0 +116,0 @@ </table>

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc