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