@nocobase/plugin-flow-engine 2.3.0-beta.15 → 2.3.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/externalVersion.js +9 -9
- package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
- package/dist/node_modules/acorn/package.json +1 -1
- package/dist/node_modules/acorn-jsx/package.json +1 -1
- package/dist/node_modules/acorn-walk/package.json +1 -1
- package/dist/node_modules/liquidjs/LICENSE +21 -0
- package/dist/node_modules/liquidjs/bin/liquid.js +139 -0
- package/dist/node_modules/liquidjs/dist/build/fs-impl-browser.d.ts +7 -0
- package/dist/node_modules/liquidjs/dist/build/fs-impl-browser.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/build/streamed-emitter-browser.d.ts +10 -0
- package/dist/node_modules/liquidjs/dist/build/streamed-emitter-browser.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/cache/cache.d.ts +7 -0
- package/dist/node_modules/liquidjs/dist/cache/index.d.ts +2 -0
- package/dist/node_modules/liquidjs/dist/cache/lru.d.ts +14 -0
- package/dist/node_modules/liquidjs/dist/cache/lru.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/context/block-mode.d.ts +4 -0
- package/dist/node_modules/liquidjs/dist/context/context.d.ts +64 -0
- package/dist/node_modules/liquidjs/dist/context/context.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/context/index.d.ts +3 -0
- package/dist/node_modules/liquidjs/dist/context/scope.d.ts +6 -0
- package/dist/node_modules/liquidjs/dist/drop/blank-drop.d.ts +5 -0
- package/dist/node_modules/liquidjs/dist/drop/block-drop.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/drop/comparable.d.ts +8 -0
- package/dist/node_modules/liquidjs/dist/drop/drop.d.ts +4 -0
- package/dist/node_modules/liquidjs/dist/drop/empty-drop.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/drop/forloop-drop.d.ts +15 -0
- package/dist/node_modules/liquidjs/dist/drop/index.d.ts +7 -0
- package/dist/node_modules/liquidjs/dist/drop/null-drop.d.ts +10 -0
- package/dist/node_modules/liquidjs/dist/drop/tablerowloop-drop.d.ts +10 -0
- package/dist/node_modules/liquidjs/dist/emitters/emitter.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/emitters/index.d.ts +4 -0
- package/dist/node_modules/liquidjs/dist/emitters/keeping-type-emitter.d.ts +5 -0
- package/dist/node_modules/liquidjs/dist/emitters/simple-emitter.d.ts +5 -0
- package/dist/node_modules/liquidjs/dist/emitters/streamed-emitter.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/filters/array.d.ts +32 -0
- package/dist/node_modules/liquidjs/dist/filters/date.d.ts +6 -0
- package/dist/node_modules/liquidjs/dist/filters/html.d.ts +6 -0
- package/dist/node_modules/liquidjs/dist/filters/index.d.ts +2 -0
- package/dist/node_modules/liquidjs/dist/filters/math.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/filters/misc.d.ts +18 -0
- package/dist/node_modules/liquidjs/dist/filters/string.d.ts +27 -0
- package/dist/node_modules/liquidjs/dist/filters/url.d.ts +14 -0
- package/dist/node_modules/liquidjs/dist/fs/fs-impl.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/fs/fs-impl.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/fs/fs.d.ts +20 -0
- package/dist/node_modules/liquidjs/dist/fs/index.d.ts +2 -0
- package/dist/node_modules/liquidjs/dist/fs/loader.d.ts +24 -0
- package/dist/node_modules/liquidjs/dist/fs/loader.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/fs/map-fs.d.ts +13 -0
- package/dist/node_modules/liquidjs/dist/fs/map-fs.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/fs/node-require.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/index.d.ts +16 -0
- package/dist/node_modules/liquidjs/dist/liquid-options.d.ts +159 -0
- package/dist/node_modules/liquidjs/dist/liquid-options.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/liquid.browser.min.js +2 -0
- package/dist/node_modules/liquidjs/dist/liquid.browser.umd.js +7265 -0
- package/dist/node_modules/liquidjs/dist/liquid.d.ts +70 -0
- package/dist/node_modules/liquidjs/dist/liquid.node.js +1 -0
- package/dist/node_modules/liquidjs/dist/parser/filter-arg.d.ts +5 -0
- package/dist/node_modules/liquidjs/dist/parser/index.d.ts +4 -0
- package/dist/node_modules/liquidjs/dist/parser/parse-stream.d.ts +15 -0
- package/dist/node_modules/liquidjs/dist/parser/parse-stream.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/parser/parser.d.ts +20 -0
- package/dist/node_modules/liquidjs/dist/parser/parser.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/parser/token-kind.d.ts +16 -0
- package/dist/node_modules/liquidjs/dist/parser/tokenizer.d.ts +63 -0
- package/dist/node_modules/liquidjs/dist/parser/tokenizer.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/parser/whitespace-ctrl.d.ts +3 -0
- package/dist/node_modules/liquidjs/dist/render/boolean.d.ts +3 -0
- package/dist/node_modules/liquidjs/dist/render/boolean.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/render/expression.d.ts +10 -0
- package/dist/node_modules/liquidjs/dist/render/expression.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/render/index.d.ts +4 -0
- package/dist/node_modules/liquidjs/dist/render/operator.d.ts +8 -0
- package/dist/node_modules/liquidjs/dist/render/render.d.ts +8 -0
- package/dist/node_modules/liquidjs/dist/render/render.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/render/string.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/render/string.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/tags/assign.d.ts +12 -0
- package/dist/node_modules/liquidjs/dist/tags/block.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/tags/break.d.ts +4 -0
- package/dist/node_modules/liquidjs/dist/tags/capture.d.ts +13 -0
- package/dist/node_modules/liquidjs/dist/tags/case.d.ts +15 -0
- package/dist/node_modules/liquidjs/dist/tags/comment.d.ts +5 -0
- package/dist/node_modules/liquidjs/dist/tags/continue.d.ts +4 -0
- package/dist/node_modules/liquidjs/dist/tags/cycle.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/tags/decrement.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/tags/echo.d.ts +8 -0
- package/dist/node_modules/liquidjs/dist/tags/for.d.ts +15 -0
- package/dist/node_modules/liquidjs/dist/tags/if.d.ts +14 -0
- package/dist/node_modules/liquidjs/dist/tags/include.d.ts +12 -0
- package/dist/node_modules/liquidjs/dist/tags/increment.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/tags/index.d.ts +24 -0
- package/dist/node_modules/liquidjs/dist/tags/inline-comment.d.ts +5 -0
- package/dist/node_modules/liquidjs/dist/tags/layout.d.ts +14 -0
- package/dist/node_modules/liquidjs/dist/tags/liquid.d.ts +8 -0
- package/dist/node_modules/liquidjs/dist/tags/raw.d.ts +6 -0
- package/dist/node_modules/liquidjs/dist/tags/render.d.ts +22 -0
- package/dist/node_modules/liquidjs/dist/tags/tablerow.d.ts +14 -0
- package/dist/node_modules/liquidjs/dist/tags/unless.d.ts +15 -0
- package/dist/node_modules/liquidjs/dist/template/analysis.d.ts +85 -0
- package/dist/node_modules/liquidjs/dist/template/analysis.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/template/filter-impl-options.d.ts +14 -0
- package/dist/node_modules/liquidjs/dist/template/filter.d.ts +15 -0
- package/dist/node_modules/liquidjs/dist/template/filter.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/template/hash.d.ts +18 -0
- package/dist/node_modules/liquidjs/dist/template/hash.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/template/html.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/template/index.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/template/output.d.ts +12 -0
- package/dist/node_modules/liquidjs/dist/template/output.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/template/tag-options-adapter.d.ts +10 -0
- package/dist/node_modules/liquidjs/dist/template/tag.d.ts +18 -0
- package/dist/node_modules/liquidjs/dist/template/template-impl.d.ts +4 -0
- package/dist/node_modules/liquidjs/dist/template/template.d.ts +36 -0
- package/dist/node_modules/liquidjs/dist/template/value.d.ts +15 -0
- package/dist/node_modules/liquidjs/dist/template/value.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/tokens/delimited-token.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/tokens/filter-token.d.ts +7 -0
- package/dist/node_modules/liquidjs/dist/tokens/filtered-value-token.d.ts +17 -0
- package/dist/node_modules/liquidjs/dist/tokens/hash-token.d.ts +12 -0
- package/dist/node_modules/liquidjs/dist/tokens/html-token.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/tokens/identifier-token.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/tokens/index.d.ts +18 -0
- package/dist/node_modules/liquidjs/dist/tokens/liquid-tag-token.d.ts +12 -0
- package/dist/node_modules/liquidjs/dist/tokens/literal-token.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/tokens/number-token.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/tokens/operator-token.d.ts +38 -0
- package/dist/node_modules/liquidjs/dist/tokens/output-token.d.ts +5 -0
- package/dist/node_modules/liquidjs/dist/tokens/property-access-token.d.ts +12 -0
- package/dist/node_modules/liquidjs/dist/tokens/quoted-token.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/tokens/range-token.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/tokens/tag-token.d.ts +9 -0
- package/dist/node_modules/liquidjs/dist/tokens/token.d.ts +12 -0
- package/dist/node_modules/liquidjs/dist/tokens/top-level-token.d.ts +4 -0
- package/dist/node_modules/liquidjs/dist/tokens/value-token.d.ts +6 -0
- package/dist/node_modules/liquidjs/dist/util/assert.d.ts +2 -0
- package/dist/node_modules/liquidjs/dist/util/assert.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/util/async.d.ts +2 -0
- package/dist/node_modules/liquidjs/dist/util/async.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/util/character.d.ts +10 -0
- package/dist/node_modules/liquidjs/dist/util/error.d.ts +35 -0
- package/dist/node_modules/liquidjs/dist/util/error.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/util/index.d.ts +12 -0
- package/dist/node_modules/liquidjs/dist/util/intl.d.ts +6 -0
- package/dist/node_modules/liquidjs/dist/util/limiter.d.ts +8 -0
- package/dist/node_modules/liquidjs/dist/util/liquid-date.d.ts +52 -0
- package/dist/node_modules/liquidjs/dist/util/liquid-date.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/util/literal.d.ts +11 -0
- package/dist/node_modules/liquidjs/dist/util/operator-trie.d.ts +14 -0
- package/dist/node_modules/liquidjs/dist/util/performance.d.ts +5 -0
- package/dist/node_modules/liquidjs/dist/util/performance.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/util/strftime.d.ts +2 -0
- package/dist/node_modules/liquidjs/dist/util/strftime.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/util/type-guards.d.ts +13 -0
- package/dist/node_modules/liquidjs/dist/util/type-guards.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/dist/util/underscore.d.ts +40 -0
- package/dist/node_modules/liquidjs/dist/util/underscore.spec.d.ts +1 -0
- package/dist/node_modules/liquidjs/node_modules/commander/index.js +27 -0
- package/dist/node_modules/liquidjs/node_modules/commander/lib/argument.js +147 -0
- package/dist/node_modules/liquidjs/node_modules/commander/lib/command.js +2179 -0
- package/dist/node_modules/liquidjs/node_modules/commander/lib/error.js +45 -0
- package/dist/node_modules/liquidjs/node_modules/commander/lib/help.js +464 -0
- package/dist/node_modules/liquidjs/node_modules/commander/lib/option.js +331 -0
- package/dist/node_modules/liquidjs/node_modules/commander/lib/suggestSimilar.js +100 -0
- package/dist/node_modules/liquidjs/node_modules/commander/package-support.json +16 -0
- package/dist/node_modules/liquidjs/node_modules/commander/package.json +80 -0
- package/dist/node_modules/liquidjs/node_modules/commander/typings/index.d.ts +889 -0
- package/dist/node_modules/liquidjs/package.json +1 -0
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/variables/runjs-variable-dependencies.js +21 -1
- package/package.json +3 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Context } from './context';
|
|
3
|
+
import { TagClass, TagImplOptions, FilterImplOptions, Template, StaticAnalysisOptions, StaticAnalysis, SegmentArray } from './template';
|
|
4
|
+
import { LookupType } from './fs/loader';
|
|
5
|
+
import { Render } from './render';
|
|
6
|
+
import { Parser } from './parser';
|
|
7
|
+
import { LiquidOptions, NormalizedFullOptions, RenderOptions, RenderFileOptions } from './liquid-options';
|
|
8
|
+
export declare class Liquid {
|
|
9
|
+
readonly options: NormalizedFullOptions;
|
|
10
|
+
readonly renderer: Render;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated will be removed. In tags use `this.parser` instead
|
|
13
|
+
*/
|
|
14
|
+
readonly parser: Parser;
|
|
15
|
+
readonly filters: Record<string, FilterImplOptions>;
|
|
16
|
+
readonly tags: Record<string, TagClass>;
|
|
17
|
+
constructor(opts?: LiquidOptions);
|
|
18
|
+
parse(html: string, filepath?: string): Template[];
|
|
19
|
+
_render(tpl: Template[], scope: Context | object | undefined, renderOptions: RenderOptions): IterableIterator<any>;
|
|
20
|
+
render(tpl: Template[], scope?: object, renderOptions?: RenderOptions): Promise<any>;
|
|
21
|
+
renderSync(tpl: Template[], scope?: object, renderOptions?: RenderOptions): any;
|
|
22
|
+
renderToNodeStream(tpl: Template[], scope?: object, renderOptions?: RenderOptions): NodeJS.ReadableStream;
|
|
23
|
+
_parseAndRender(html: string, scope: Context | object | undefined, renderOptions: RenderOptions): IterableIterator<any>;
|
|
24
|
+
parseAndRender(html: string, scope?: Context | object, renderOptions?: RenderOptions): Promise<any>;
|
|
25
|
+
parseAndRenderSync(html: string, scope?: Context | object, renderOptions?: RenderOptions): any;
|
|
26
|
+
_parsePartialFile(file: string, sync?: boolean, currentFile?: string): Generator<unknown, Template[], string | Template[]>;
|
|
27
|
+
_parseLayoutFile(file: string, sync?: boolean, currentFile?: string): Generator<unknown, Template[], string | Template[]>;
|
|
28
|
+
_parseFile(file: string, sync?: boolean, lookupType?: LookupType, currentFile?: string): Generator<unknown, Template[]>;
|
|
29
|
+
parseFile(file: string, lookupType?: LookupType): Promise<Template[]>;
|
|
30
|
+
parseFileSync(file: string, lookupType?: LookupType): Template[];
|
|
31
|
+
_renderFile(file: string, ctx: Context | object | undefined, renderFileOptions: RenderFileOptions): Generator<any>;
|
|
32
|
+
renderFile(file: string, ctx?: Context | object, renderFileOptions?: RenderFileOptions): Promise<any>;
|
|
33
|
+
renderFileSync(file: string, ctx?: Context | object, renderFileOptions?: RenderFileOptions): any;
|
|
34
|
+
renderFileToNodeStream(file: string, scope?: object, renderOptions?: RenderOptions): Promise<NodeJS.ReadableStream>;
|
|
35
|
+
_evalValue(str: string, scope?: object | Context): IterableIterator<any>;
|
|
36
|
+
evalValue(str: string, scope?: object | Context): Promise<any>;
|
|
37
|
+
evalValueSync(str: string, scope?: object | Context): any;
|
|
38
|
+
registerFilter(name: string, filter: FilterImplOptions): void;
|
|
39
|
+
registerTag(name: string, tag: TagClass | TagImplOptions): void;
|
|
40
|
+
plugin(plugin: (this: Liquid, L: typeof Liquid) => void): void;
|
|
41
|
+
express(): (this: any, filePath: string, ctx: object, callback: (err: Error | null, rendered: string) => void) => void;
|
|
42
|
+
analyze(template: Template[], options?: StaticAnalysisOptions): Promise<StaticAnalysis>;
|
|
43
|
+
analyzeSync(template: Template[], options?: StaticAnalysisOptions): StaticAnalysis;
|
|
44
|
+
parseAndAnalyze(html: string, filename?: string, options?: StaticAnalysisOptions): Promise<StaticAnalysis>;
|
|
45
|
+
parseAndAnalyzeSync(html: string, filename?: string, options?: StaticAnalysisOptions): StaticAnalysis;
|
|
46
|
+
/** Return an array of all variables without their properties. */
|
|
47
|
+
variables(template: string | Template[], options?: StaticAnalysisOptions): Promise<string[]>;
|
|
48
|
+
/** Return an array of all variables without their properties. */
|
|
49
|
+
variablesSync(template: string | Template[], options?: StaticAnalysisOptions): string[];
|
|
50
|
+
/** Return an array of all variables including their properties/paths. */
|
|
51
|
+
fullVariables(template: string | Template[], options?: StaticAnalysisOptions): Promise<string[]>;
|
|
52
|
+
/** Return an array of all variables including their properties/paths. */
|
|
53
|
+
fullVariablesSync(template: string | Template[], options?: StaticAnalysisOptions): string[];
|
|
54
|
+
/** Return an array of all variables, each as an array of properties/segments. */
|
|
55
|
+
variableSegments(template: string | Template[], options?: StaticAnalysisOptions): Promise<Array<SegmentArray>>;
|
|
56
|
+
/** Return an array of all variables, each as an array of properties/segments. */
|
|
57
|
+
variableSegmentsSync(template: string | Template[], options?: StaticAnalysisOptions): Array<SegmentArray>;
|
|
58
|
+
/** Return an array of all expected context variables without their properties. */
|
|
59
|
+
globalVariables(template: string | Template[], options?: StaticAnalysisOptions): Promise<string[]>;
|
|
60
|
+
/** Return an array of all expected context variables without their properties. */
|
|
61
|
+
globalVariablesSync(template: string | Template[], options?: StaticAnalysisOptions): string[];
|
|
62
|
+
/** Return an array of all expected context variables including their properties/paths. */
|
|
63
|
+
globalFullVariables(template: string | Template[], options?: StaticAnalysisOptions): Promise<string[]>;
|
|
64
|
+
/** Return an array of all expected context variables including their properties/paths. */
|
|
65
|
+
globalFullVariablesSync(template: string | Template[], options?: StaticAnalysisOptions): string[];
|
|
66
|
+
/** Return an array of all expected context variables, each as an array of properties/segments. */
|
|
67
|
+
globalVariableSegments(template: string | Template[], options?: StaticAnalysisOptions): Promise<Array<SegmentArray>>;
|
|
68
|
+
/** Return an array of all expected context variables, each as an array of properties/segments. */
|
|
69
|
+
globalVariableSegmentsSync(template: string | Template[], options?: StaticAnalysisOptions): Array<SegmentArray>;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={262:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:true});var s=i(781);var r=i(17);var n=i(147);class Token{constructor(e,t,i,s,r){this.kind=e;this.input=t;this.begin=i;this.end=s;this.file=r}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[e,t]=[1,1];for(let i=0;i<this.begin;i++){if(this.input[i]==="\n"){e++;t=1}else t++}return[e,t]}size(){return this.end-this.begin}}class Drop{liquidMethodMissing(e,t){return undefined}}const o=Object.prototype.toString;const a=String.prototype.toLowerCase;const l=Object.hasOwnProperty;function isString(e){return typeof e==="string"}function isFunction(e){return typeof e==="function"}function isPromise(e){return e&&isFunction(e.then)}function isIterator(e){return e&&isFunction(e.next)&&isFunction(e.throw)&&isFunction(e.return)}function escapeRegex(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function promisify(e){return function(...t){return new Promise(((i,s)=>{e(...t,((e,t)=>{e?s(e):i(t)}))}))}}function stringify(e){e=toValue(e);if(isString(e))return e;if(isNil(e))return"";if(isArray(e))return e.map((e=>stringify(e))).join("");return String(e)}function toEnumerable(e){e=toValue(e);if(isArray(e))return e;if(isString(e)&&e.length>0)return[e];if(isIterable(e))return Array.from(e);if(isObject(e))return Object.keys(e).map((t=>[t,e[t]]));return[]}function toArray(e){e=toValue(e);if(isNil(e))return[];if(isArray(e))return e;return[e]}function toValue(e){return e instanceof Drop&&isFunction(e.valueOf)?e.valueOf():e}function toNumber(e){return+toValue(e)||0}function isNumber(e){return typeof e==="number"}function toLiquid(e){if(e&&isFunction(e.toLiquid))return toLiquid(e.toLiquid());return e}function isNil(e){return e==null}function isUndefined(e){return e===undefined}function isArray(e){return o.call(e)==="[object Array]"}function isArrayLike(e){return e&&isNumber(e.length)}function isIterable(e){return isObject(e)&&Symbol.iterator in e}function forOwn(e,t){e=e||{};for(const i in e){if(l.call(e,i)){if(t(e[i],i,e)===false)break}}return e}function last(e){return e[e.length-1]}function isObject(e){const t=typeof e;return e!==null&&(t==="object"||t==="function")}function range(e,t,i=1){const s=[];for(let r=e;r<t;r+=i){s.push(r)}return s}function padStart(e,t,i=" "){return pad(e,t,i,((e,t)=>t+e))}function padEnd(e,t,i=" "){return pad(e,t,i,((e,t)=>e+t))}function pad(e,t,i,s){e=String(e);let r=t-e.length;while(r-- >0)e=s(e,i);return e}function identify(e){return e}function changeCase(e){const t=[...e].some((e=>e>="a"&&e<="z"));return t?e.toUpperCase():e.toLowerCase()}function ellipsis(e,t){return e.length>t?e.slice(0,t-3)+"...":e}function caseInsensitiveCompare(e,t){if(e==null&&t==null)return 0;if(e==null)return 1;if(t==null)return-1;e=a.call(e);t=a.call(t);if(e<t)return-1;if(e>t)return 1;return 0}function argumentsToValue(e){return function(...t){return e.call(this,...t.map(toValue))}}function argumentsToNumber(e){return function(...t){return e.call(this,...t.map(toNumber))}}function escapeRegExp(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function*strictUniq(e){const t=new Set;for(const i of e){const e=JSON.stringify(i);if(!t.has(e)){t.add(e);yield i}}}const c="__liquidClass__";class LiquidError extends Error{constructor(e,t){super(typeof e==="string"?e:e.message);this.context="";if(typeof e!=="string")Object.defineProperty(this,"originalError",{value:e,enumerable:false});Object.defineProperty(this,"token",{value:t,enumerable:false});Object.defineProperty(this,c,{value:"LiquidError",enumerable:false})}update(){Object.defineProperty(this,"context",{value:mkContext(this.token),enumerable:false});this.message=mkMessage(this.message,this.token);this.stack=this.message+"\n"+this.context+"\n"+this.stack;if(this.originalError)this.stack+="\nFrom "+this.originalError.stack}static is(e){return e?.[c]==="LiquidError"}}class TokenizationError extends LiquidError{constructor(e,t){super(e,t);this.name="TokenizationError";super.update()}}class ParseError extends LiquidError{constructor(e,t){super(e,t);this.name="ParseError";this.message=e.message;super.update()}}class RenderError extends LiquidError{constructor(e,t){super(e,t.token);this.name="RenderError";this.message=e.message;super.update()}static is(e){return e.name==="RenderError"}}class LiquidErrors extends LiquidError{constructor(e){super(e[0],e[0].token);this.errors=e;this.name="LiquidErrors";const t=e.length>1?"s":"";this.message=`${e.length} error${t} found`;super.update()}static is(e){return e.name==="LiquidErrors"}}class UndefinedVariableError extends LiquidError{constructor(e,t){super(e,t);this.name="UndefinedVariableError";this.message=e.message;super.update()}}class InternalUndefinedVariableError extends Error{constructor(e){super(`undefined variable: ${e}`);this.name="InternalUndefinedVariableError";this.variableName=e}}class AssertionError extends Error{constructor(e){super(e);this.name="AssertionError";this.message=e+""}}function mkContext(e){const[t,i]=e.getPosition();const s=e.input.split("\n");const r=Math.max(t-2,1);const n=Math.min(t+3,s.length);const o=range(r,n+1).map((e=>{const r=e===t?">> ":" ";const o=padStart(String(e),String(n).length);let a=`${r}${o}| `;const l=e===t?"\n"+padStart("^",i+a.length):"";a+=s[e-1];a+=l;return a})).join("\n");return o}function mkMessage(e,t){if(t.file)e+=`, file:${t.file}`;const[i,s]=t.getPosition();e+=`, line:${i}, col:${s}`;return e}const u=[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];const h=1;const p=4;const f=8;const d=16;const g=32;const m=64;const y=128;function isWord(e){const t=e.charCodeAt(0);return t>=128?!u[t]:!!(u[t]&h)}u[160]=u[5760]=u[6158]=u[8192]=u[8193]=u[8194]=u[8195]=u[8196]=u[8197]=u[8198]=u[8199]=u[8200]=u[8201]=u[8202]=u[8232]=u[8233]=u[8239]=u[8287]=u[12288]=p;u[8220]=u[8221]=y;function assert(e,t){if(!e){const i=typeof t==="function"?t():t||`expect ${e} to be true`;throw new AssertionError(i)}}function assertEmpty(e,t=`unexpected ${JSON.stringify(e)}`){assert(!e,t)}class NullDrop extends Drop{equals(e){return isNil(toValue(e))}gt(){return false}geq(){return false}lt(){return false}leq(){return false}valueOf(){return null}}class EmptyDrop extends Drop{equals(e){if(e instanceof EmptyDrop)return false;e=toValue(e);if(isString(e)||isArray(e))return e.length===0;if(isObject(e))return Object.keys(e).length===0;return false}gt(){return false}geq(){return false}lt(){return false}leq(){return false}valueOf(){return""}static is(e){return e instanceof EmptyDrop}}class BlankDrop extends EmptyDrop{equals(e){if(e===false)return true;if(isNil(toValue(e)))return true;if(isString(e))return/^\s*$/.test(e);return super.equals(e)}static is(e){return e instanceof BlankDrop}}class ForloopDrop extends Drop{constructor(e,t,i){super();this.i=0;this.length=e;this.name=`${i}-${t}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return this.i===0}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}}class SimpleEmitter{constructor(){this.buffer=""}write(e){this.buffer+=stringify(e)}}class StreamedEmitter{constructor(){this.buffer="";this.stream=new s.PassThrough}write(e){this.stream.write(stringify(e))}error(e){this.stream.emit("error",e)}end(){this.stream.end()}}class KeepingTypeEmitter{constructor(){this.buffer=""}write(e){e=toValue(e);if(typeof e!=="string"&&this.buffer===""){this.buffer=e}else{this.buffer=stringify(this.buffer)+stringify(e)}}}class BlockDrop extends Drop{constructor(e=(()=>"")){super();this.superBlockRender=e}*super(){const e=new SimpleEmitter;yield this.superBlockRender(e);return e.buffer}}function isComparable(e){return e&&isFunction(e.equals)&&isFunction(e.gt)&&isFunction(e.geq)&&isFunction(e.lt)&&isFunction(e.leq)}const T=new NullDrop;const k={true:true,false:false,nil:T,null:T,empty:new EmptyDrop,blank:new BlankDrop};function createTrie(e){const t={};for(const[i,s]of Object.entries(e)){let e=t;for(let t=0;t<i.length;t++){const s=i[t];e[s]=e[s]||{};if(t===i.length-1&&isWord(i[t])){e[s].needBoundary=true}e=e[s]}e.data=s;e.end=true}return t}async function toPromise(e){if(!isIterator(e))return e;let t;let i=false;let s="next";do{const r=e[s](t);i=r.done;t=r.value;s="next";try{if(isIterator(t))t=toPromise(t);if(isPromise(t))t=await t}catch(e){s="throw";t=e}}while(!i);return t}function toValueSync(e){if(!isIterator(e))return e;let t;let i=false;let s="next";do{const r=e[s](t);i=r.done;t=r.value;s="next";if(isIterator(t)){try{t=toValueSync(t)}catch(e){s="throw";t=e}}}while(!i);return t}const w=/%([-_0^#:]+)?(\d+)?([EO])?(.)/;function daysInMonth(e){const t=isLeapYear(e)?29:28;return[31,t,31,30,31,30,31,31,30,31,30,31]}function getDayOfYear(e){let t=0;for(let i=0;i<e.getMonth();++i){t+=daysInMonth(e)[i]}return t+e.getDate()}function getWeekOfYear(e,t){const i=getDayOfYear(e)+(t-e.getDay());const s=new Date(e.getFullYear(),0,1);const r=7-s.getDay()+t;return String(Math.floor((i-r)/7)+1)}function isLeapYear(e){const t=e.getFullYear();return!!((t&3)===0&&(t%100||t%400===0&&t))}function ordinal(e){const t=e.getDate();if([11,12,13].includes(t))return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}function century(e){return parseInt(e.getFullYear().toString().substring(0,2),10)}const b={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};const x=new Set("aAbBceklpP");function getTimezoneOffset(e,t){const i=Math.abs(e.getTimezoneOffset());const s=Math.floor(i/60);const r=i%60;return(e.getTimezoneOffset()>0?"-":"+")+padStart(s,2,"0")+(t.flags[":"]?":":"")+padStart(r,2,"0")}const v={a:e=>e.getShortWeekdayName(),A:e=>e.getLongWeekdayName(),b:e=>e.getShortMonthName(),B:e=>e.getLongMonthName(),c:e=>e.toLocaleString(),C:e=>century(e),d:e=>e.getDate(),e:e=>e.getDate(),H:e=>e.getHours(),I:e=>String(e.getHours()%12||12),j:e=>getDayOfYear(e),k:e=>e.getHours(),l:e=>String(e.getHours()%12||12),L:e=>e.getMilliseconds(),m:e=>e.getMonth()+1,M:e=>e.getMinutes(),N:(e,t)=>{const i=Number(t.width)||9;const s=String(e.getMilliseconds()).slice(0,i);return padEnd(s,i,"0")},p:e=>e.getHours()<12?"AM":"PM",P:e=>e.getHours()<12?"am":"pm",q:e=>ordinal(e),s:e=>Math.round(e.getTime()/1e3),S:e=>e.getSeconds(),u:e=>e.getDay()||7,U:e=>getWeekOfYear(e,0),w:e=>e.getDay(),W:e=>getWeekOfYear(e,1),x:e=>e.toLocaleDateString(),X:e=>e.toLocaleTimeString(),y:e=>e.getFullYear().toString().slice(2,4),Y:e=>e.getFullYear(),z:getTimezoneOffset,Z:(e,t)=>e.getTimeZoneName()||getTimezoneOffset(e,t),t:()=>"\t",n:()=>"\n","%":()=>"%"};v.h=v.b;function strftime(e,t){let i="";let s=t;let r;while(r=w.exec(s)){i+=s.slice(0,r.index);s=s.slice(r.index+r[0].length);i+=format(e,r)}return i+s}function format(e,t){const[i,s="",r,n,o]=t;const a=v[o];if(!a)return i;const l={};for(const e of s)l[e]=true;let c=String(a(e,{flags:l,width:r,modifier:n}));let u=x.has(o)?" ":"0";let h=r||b[o]||0;if(l["^"])c=c.toUpperCase();else if(l["#"])c=changeCase(c);if(l["_"])u=" ";else if(l["0"])u="0";if(l["-"])h=0;return padStart(c,h,u)}function getDateTimeFormat(){return typeof Intl!=="undefined"?Intl.DateTimeFormat:undefined}const S=6e4;const _=/([zZ]|([+-])(\d{2}):?(\d{2}))$/;const L=["January","February","March","April","May","June","July","August","September","October","November","December"];const F=L.map((e=>e.slice(0,3)));const V=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];const z=V.map((e=>e.slice(0,3)));class LiquidDate{constructor(e,t,i){this.locale=t;this.DateTimeFormat=getDateTimeFormat();this.date=new Date(e);this.timezoneFixed=i!==undefined;if(i===undefined){i=this.date.getTimezoneOffset()}this.timezoneOffset=isString(i)?LiquidDate.getTimezoneOffset(i,this.date):i;this.timezoneName=isString(i)?i:"";const s=(this.date.getTimezoneOffset()-this.timezoneOffset)*S;const r=this.date.getTime()+s;this.displayDate=new Date(r)}getTime(){return this.displayDate.getTime()}getMilliseconds(){return this.displayDate.getMilliseconds()}getSeconds(){return this.displayDate.getSeconds()}getMinutes(){return this.displayDate.getMinutes()}getHours(){return this.displayDate.getHours()}getDay(){return this.displayDate.getDay()}getDate(){return this.displayDate.getDate()}getMonth(){return this.displayDate.getMonth()}getFullYear(){return this.displayDate.getFullYear()}toLocaleString(e,t){if(t?.timeZone){return this.date.toLocaleString(e,t)}return this.displayDate.toLocaleString(e,t)}toLocaleTimeString(e){return this.displayDate.toLocaleTimeString(e)}toLocaleDateString(e){return this.displayDate.toLocaleDateString(e)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){if(this.timezoneFixed)return this.timezoneName;if(!this.DateTimeFormat)return;return this.DateTimeFormat().resolvedOptions().timeZone}getLongMonthName(){return this.format({month:"long"})??L[this.getMonth()]}getShortMonthName(){return this.format({month:"short"})??F[this.getMonth()]}getLongWeekdayName(){return this.format({weekday:"long"})??V[this.displayDate.getDay()]}getShortWeekdayName(){return this.format({weekday:"short"})??z[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(e){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,e).format(this.displayDate)}static createDateFixedToTimezone(e,t){const i=e.match(_);if(i&&i[1]==="Z"){return new LiquidDate(+new Date(e),t,0)}if(i&&i[2]&&i[3]&&i[4]){const[,,s,r,n]=i;const o=(s==="+"?-1:1)*(parseInt(r,10)*60+parseInt(n,10));return new LiquidDate(+new Date(e),t,o)}return new LiquidDate(e,t)}static getTimezoneOffset(e,t){const i=t.toLocaleString("en-US",{timeZone:e});const s=t.toLocaleString("en-US",{timeZone:"UTC"});const r=new Date(i);const n=new Date(s);return(+n-+r)/(60*1e3)}}class Limiter{constructor(e,t){this.base=0;this.message=`${e} limit exceeded`;this.limit=t}use(e){e=+e||0;assert(this.base+e<=this.limit,this.message);this.base+=e}check(e){e=+e||0;assert(e<=this.limit,this.message)}}class DelimitedToken extends Token{constructor(e,[t,i],s,r,n,o,a,l){super(e,s,r,n,l);this.trimLeft=false;this.trimRight=false;const c=s[t]==="-";const h=s[i-1]==="-";let f=c?t+1:t;let d=h?i-1:i;while(f<d&&u[s.charCodeAt(f)]&p)f++;while(d>f&&u[s.charCodeAt(d-1)]&p)d--;this.contentRange=[f,d];this.trimLeft=c||o;this.trimRight=h||a}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}}class TagToken extends DelimitedToken{constructor(e,i,s,r,n){const{trimTagLeft:o,trimTagRight:a,tagDelimiterLeft:l,tagDelimiterRight:c}=r;const[u,h]=[i+l.length,s-c.length];super(t.TokenKind.Tag,[u,h],e,i,s,o,a,n);this.tokenizer=new Tokenizer(e,r.operators,n,this.contentRange);this.name=this.tokenizer.readTagName();this.tokenizer.assert(this.name,`illegal tag syntax, tag name expected`);this.tokenizer.skipBlank();this.args=this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class OutputToken extends DelimitedToken{constructor(e,i,s,r,n){const{trimOutputLeft:o,trimOutputRight:a,outputDelimiterLeft:l,outputDelimiterRight:c}=r;const u=[i+l.length,s-c.length];super(t.TokenKind.Output,u,e,i,s,o,a,n)}}class HTMLToken extends Token{constructor(e,i,s,r){super(t.TokenKind.HTML,e,i,s,r);this.input=e;this.begin=i;this.end=s;this.file=r;this.trimLeft=0;this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}}class NumberToken extends Token{constructor(e,i,s,r){super(t.TokenKind.Number,e,i,s,r);this.input=e;this.begin=i;this.end=s;this.file=r;this.content=Number(this.getText())}}class IdentifierToken extends Token{constructor(e,i,s,r){super(t.TokenKind.Word,e,i,s,r);this.input=e;this.begin=i;this.end=s;this.file=r;this.content=this.getText()}}class LiteralToken extends Token{constructor(e,i,s,r){super(t.TokenKind.Literal,e,i,s,r);this.input=e;this.begin=i;this.end=s;this.file=r;this.literal=this.getText();this.content=k[this.literal]}}const O={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0};const q={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0};class OperatorToken extends Token{constructor(e,i,s,r){super(t.TokenKind.Operator,e,i,s,r);this.input=e;this.begin=i;this.end=s;this.file=r;this.operator=this.getText()}getPrecedence(){const e=this.getText();return e in O?O[e]:1}}class PropertyAccessToken extends Token{constructor(e,i,s,r,n,o){super(t.TokenKind.PropertyAccess,s,r,n,o);this.variable=e;this.props=i}}class FilterToken extends Token{constructor(e,i,s,r,n,o){super(t.TokenKind.Filter,s,r,n,o);this.name=e;this.args=i}}class HashToken extends Token{constructor(e,i,s,r,n,o){super(t.TokenKind.Hash,e,i,s,o);this.input=e;this.begin=i;this.end=s;this.name=r;this.value=n;this.file=o}}const E=/[\da-fA-F]/;const D=/[0-7]/;const A={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function hexVal(e){const t=e.charCodeAt(0);if(t>=97)return t-87;if(t>=65)return t-55;return t-48}function parseStringLiteral(e){let t="";for(let i=1;i<e.length-1;i++){if(e[i]!=="\\"){t+=e[i];continue}if(A[e[i+1]]!==undefined){t+=A[e[++i]]}else if(e[i+1]==="u"){let s=0;let r=i+2;while(r<=i+5&&E.test(e[r])){s=s*16+hexVal(e[r++])}i=r-1;t+=String.fromCharCode(s)}else if(!D.test(e[i+1])){t+=e[++i]}else{let s=i+1;let r=0;while(s<=i+3&&D.test(e[s])){r=r*8+hexVal(e[s++])}i=s-1;t+=String.fromCharCode(r)}}return t}class QuotedToken extends Token{constructor(e,i,s,r){super(t.TokenKind.Quoted,e,i,s,r);this.input=e;this.begin=i;this.end=s;this.file=r;this.content=parseStringLiteral(this.getText())}}class RangeToken extends Token{constructor(e,i,s,r,n,o){super(t.TokenKind.Range,e,i,s,o);this.input=e;this.begin=i;this.end=s;this.lhs=r;this.rhs=n;this.file=o}}class LiquidTagToken extends DelimitedToken{constructor(e,i,s,r,n){super(t.TokenKind.Tag,[i,s],e,i,s,false,false,n);this.tokenizer=new Tokenizer(e,r.operators,n,this.contentRange);this.name=this.tokenizer.readTagName();this.tokenizer.assert(this.name,"illegal liquid tag syntax");this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}}class FilteredValueToken extends Token{constructor(e,i,s,r,n,o){super(t.TokenKind.FilteredValue,s,r,n,o);this.initial=e;this.filters=i;this.input=s;this.begin=r;this.end=n;this.file=o}}const R={now:()=>Date.now()};function getPerformance(){return typeof global==="object"&&global.performance||typeof window==="object"&&window.performance||R}class Render{renderTemplatesToNodeStream(e,t){const i=new StreamedEmitter;Promise.resolve().then((()=>toPromise(this.renderTemplates(e,t,i)))).then((()=>i.end()),(e=>i.error(e)));return i.stream}*renderTemplates(e,t,i){if(!i){i=t.opts.keepOutputType?new KeepingTypeEmitter:new SimpleEmitter}const s=[];for(const r of e){t.renderLimit.check(getPerformance().now());try{const e=yield r.render(t,i);e&&i.write(e);if(t.breakCalled||t.continueCalled)break}catch(e){const i=LiquidError.is(e)?e:new RenderError(e,r);if(t.opts.catchAllErrors)s.push(i);else throw i}}if(s.length){throw new LiquidErrors(s)}return i.buffer}}class Expression{constructor(e){this.postfix=[...toPostfix(e)]}*evaluate(e,t){assert(e,"unable to evaluate: context not defined");const i=[];for(const s of this.postfix){if(isOperatorToken(s)){const t=i.pop();let r;if(q[s.operator]===1){r=yield e.opts.operators[s.operator](t,e)}else{const n=i.pop();r=yield e.opts.operators[s.operator](n,t,e)}i.push(r)}else{i.push(yield evalToken(s,e,t))}}return i[0]}valid(){return!!this.postfix.length}}function*evalToken(e,t,i=false){if(!e)return;if("content"in e)return e.content;if(isPropertyAccessToken(e))return yield evalPropertyAccessToken(e,t,i);if(isRangeToken(e))return yield evalRangeToken(e,t)}function*evalPropertyAccessToken(e,t,i){const s=[];for(const i of e.props){s.push(yield evalToken(i,t,false))}try{if(e.variable){const r=yield evalToken(e.variable,t,i);return yield t._getFromScope(r,s)}else{return yield t._get(s)}}catch(t){if(i&&t.name==="InternalUndefinedVariableError")return null;throw new UndefinedVariableError(t,e)}}function evalQuotedToken(e){return e.content}function*evalRangeToken(e,t){const i=yield evalToken(e.lhs,t);const s=yield evalToken(e.rhs,t);t.memoryLimit.use(s-i+1);return range(+i,+s+1)}function*toPostfix(e){const t=[];for(const i of e){if(isOperatorToken(i)){while(t.length&&t[t.length-1].getPrecedence()>i.getPrecedence()){yield t.pop()}t.push(i)}else yield i}while(t.length){yield t.pop()}}function isTruthy(e,t){return!isFalsy(e,t)}function isFalsy(e,t){e=toValue(e);if(t.opts.jsTruthy){return!e}else{return e===false||undefined===e||e===null}}const N={"==":equals,"!=":(e,t)=>!equals(e,t),">":(e,t)=>{if(isComparable(e))return e.gt(t);if(isComparable(t))return t.lt(e);return toValue(e)>toValue(t)},"<":(e,t)=>{if(isComparable(e))return e.lt(t);if(isComparable(t))return t.gt(e);return toValue(e)<toValue(t)},">=":(e,t)=>{if(isComparable(e))return e.geq(t);if(isComparable(t))return t.leq(e);return toValue(e)>=toValue(t)},"<=":(e,t)=>{if(isComparable(e))return e.leq(t);if(isComparable(t))return t.geq(e);return toValue(e)<=toValue(t)},contains:(e,t)=>{e=toValue(e);if(isArray(e))return e.some((e=>equals(e,t)));if(isFunction(e?.indexOf))return e.indexOf(toValue(t))>-1;return false},not:(e,t)=>isFalsy(toValue(e),t),and:(e,t,i)=>isTruthy(toValue(e),i)&&isTruthy(toValue(t),i),or:(e,t,i)=>isTruthy(toValue(e),i)||isTruthy(toValue(t),i)};function equals(e,t){if(isComparable(e))return e.equals(t);if(isComparable(t))return t.equals(e);e=toValue(e);t=toValue(t);if(isArray(e)){return isArray(t)&&arrayEquals(e,t)}return e===t}function arrayEquals(e,t){if(e.length!==t.length)return false;return!e.some(((e,i)=>!equals(e,t[i])))}function arrayIncludes(e,t){return e.some((e=>equals(e,t)))}class Node{constructor(e,t,i,s){this.key=e;this.value=t;this.next=i;this.prev=s}}class LRU{constructor(e,t=0){this.limit=e;this.size=t;this.cache={};this.head=new Node("HEAD",null,null,null);this.tail=new Node("TAIL",null,null,null);this.head.next=this.tail;this.tail.prev=this.head}write(e,t){if(this.cache[e]){this.cache[e].value=t}else{const i=new Node(e,t,this.head.next,this.head);this.head.next.prev=i;this.head.next=i;this.cache[e]=i;this.size++;this.ensureLimit()}}read(e){if(!this.cache[e])return;const{value:t}=this.cache[e];this.remove(e);this.write(e,t);return t}remove(e){const t=this.cache[e];t.prev.next=t.next;t.next.prev=t.prev;delete this.cache[e];this.size--}clear(){this.head.next=this.tail;this.tail.prev=this.head;this.size=0;this.cache={}}ensureLimit(){if(this.size>this.limit)this.remove(this.tail.prev.key)}}const requireResolve=e=>require.resolve(e,{paths:["."]});const P=promisify(n.stat);const M=promisify(n.readFile);async function exists(e){try{await P(e);return true}catch(e){return false}}function readFile(e){return M(e,"utf8")}function existsSync(e){try{n.statSync(e);return true}catch(e){return false}}function readFileSync(e){return n.readFileSync(e,"utf8")}function resolve(e,t,i){if(!r.extname(t))t+=i;return r.resolve(e,t)}function fallback(e){try{return requireResolve(e)}catch(e){}}function dirname(e){return r.dirname(e)}function contains(e,t){e=r.resolve(e);e=e.endsWith(r.sep)?e:e+r.sep;return t.startsWith(e)}var C=Object.freeze({__proto__:null,exists:exists,readFile:readFile,existsSync:existsSync,readFileSync:readFileSync,resolve:resolve,fallback:fallback,dirname:dirname,contains:contains,sep:r.sep});function defaultFilter(e,t,...i){e=toValue(e);if(isArray(e)||isString(e))return e.length?e:t;if(e===false&&new Map(i).get("allow_false"))return false;return isFalsy(e,this.context)?t:e}function json(e,t=0){return JSON.stringify(e,null,t)}function inspect(e,t=0){const i=[];return JSON.stringify(e,(function(e,t){if(typeof t!=="object"||t===null)return t;while(i.length>0&&i[i.length-1]!==this)i.pop();if(i.includes(t))return"[Circular]";i.push(t);return t}),t)}function to_integer(e){return Number(e)}const j={raw:true,handler:identify};var I={default:defaultFilter,raw:j,jsonify:json,to_integer:to_integer,json:json,inspect:inspect};const $={"&":"&","<":"<",">":">",'"':""","'":"'"};const B={"&":"&","<":"<",">":">",""":'"',"'":"'"};function escape(e){e=stringify(e);this.context.memoryLimit.use(e.length);return e.replace(/&|<|>|"|'/g,(e=>$[e]))}function xml_escape(e){return escape.call(this,e)}function unescape(e){e=stringify(e);this.context.memoryLimit.use(e.length);return e.replace(/&(amp|lt|gt|#34|#39);/g,(e=>B[e]))}function escape_once(e){return escape.call(this,unescape.call(this,e))}function newline_to_br(e){const t=stringify(e);this.context.memoryLimit.use(t.length);return t.replace(/\r?\n/gm,"<br />\n")}function strip_html(e){const t=stringify(e);this.context.memoryLimit.use(t.length);return t.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,"")}var H=Object.freeze({__proto__:null,escape:escape,xml_escape:xml_escape,escape_once:escape_once,newline_to_br:newline_to_br,strip_html:strip_html});class MapFS{constructor(e){this.mapping=e;this.sep="/"}async exists(e){return this.existsSync(e)}existsSync(e){return!isNil(this.mapping[e])}async readFile(e){return this.readFileSync(e)}readFileSync(e){const t=this.mapping[e];if(isNil(t))throw new Error(`ENOENT: ${e}`);return t}dirname(e){const t=e.split(this.sep);t.pop();return t.join(this.sep)}resolve(e,t,i){t+=i;if(e===".")return t;const s=e.split(/\/+/);for(const e of t.split(this.sep)){if(e==="."||e==="")continue;else if(e===".."){if(s.length>1||s[0]!=="")s.pop()}else s.push(e)}return s.join(this.sep)}}const U={root:["."],layouts:["."],partials:["."],relativeReference:true,jekyllInclude:false,keyValueSeparator:":",cache:undefined,extname:"",fs:C,dynamicPartials:true,jsTruthy:false,dateFormat:"%A, %B %-e, %Y at %-l:%M %P %z",locale:"",trimTagRight:false,trimTagLeft:false,trimOutputRight:false,trimOutputLeft:false,greedy:true,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:false,strictFilters:false,strictVariables:false,ownPropertyOnly:true,lenientIf:false,globals:{},keepOutputType:false,operators:N,memoryLimit:Infinity,parseLimit:Infinity,renderLimit:Infinity};function normalize(e){if(e.hasOwnProperty("root")){if(!e.hasOwnProperty("partials"))e.partials=e.root;if(!e.hasOwnProperty("layouts"))e.layouts=e.root}if(e.hasOwnProperty("cache")){let t;if(typeof e.cache==="number")t=e.cache>0?new LRU(e.cache):undefined;else if(typeof e.cache==="object")t=e.cache;else t=e.cache?new LRU(1024):undefined;e.cache=t}e={...U,...e.jekyllInclude?{dynamicPartials:false}:{},...e};if((!e.fs.dirname||!e.fs.sep)&&e.relativeReference){console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning");e.relativeReference=false}e.root=normalizeDirectoryList(e.root);e.partials=normalizeDirectoryList(e.partials);e.layouts=normalizeDirectoryList(e.layouts);e.outputEscape=e.outputEscape&&getOutputEscapeFunction(e.outputEscape);if(!e.locale){e.locale=getDateTimeFormat()?.().resolvedOptions().locale??"en-US"}if(e.templates){e.fs=new MapFS(e.templates);e.relativeReference=true;e.root=e.partials=e.layouts="."}return e}function getOutputEscapeFunction(e){if(e==="escape")return escape;if(e==="json")return I.json;assert(isFunction(e),"`outputEscape` need to be of type string or function");return e}function normalizeDirectoryList(e){let t=[];if(isArray(e))t=e;if(isString(e))t=[e];return t}function whiteSpaceCtrl(e,t){let i=false;for(let s=0;s<e.length;s++){const r=e[s];if(!isDelimitedToken(r))continue;if(!i&&r.trimLeft){trimLeft(e[s-1],t.greedy)}if(isTagToken(r)){if(r.name==="raw")i=true;else if(r.name==="endraw")i=false}if(!i&&r.trimRight){trimRight(e[s+1],t.greedy)}}}function trimLeft(e,t){if(!e||!isHTMLToken(e))return;const i=t?p:d;while(u[e.input.charCodeAt(e.end-1-e.trimRight)]&i)e.trimRight++}function trimRight(e,t){if(!e||!isHTMLToken(e))return;const i=t?p:d;while(u[e.input.charCodeAt(e.begin+e.trimLeft)]&i)e.trimLeft++;if(e.input.charAt(e.begin+e.trimLeft)==="\n")e.trimLeft++}class Tokenizer{constructor(e,t=U.operators,i,s){this.input=e;this.file=i;this.rawBeginAt=-1;this.p=s?s[0]:0;this.N=s?s[1]:e.length;this.opTrie=createTrie(t);this.literalTrie=createTrie(k)}readExpression(){return new Expression(this.readExpressionTokens())}*readExpressionTokens(){while(this.p<this.N){const e=this.readOperator();if(e){yield e;continue}const t=this.readValue();if(t){yield t;continue}return}}readOperator(){this.skipBlank();const e=this.matchTrie(this.opTrie);if(e===-1)return;return new OperatorToken(this.input,this.p,this.p=e,this.file)}matchTrie(e){let t=e;let i=this.p;let s;while(t[this.input[i]]&&i<this.N){t=t[this.input[i++]];if(t["end"])s=t}if(!s)return-1;if(s["needBoundary"]&&isWord(this.peek(i-this.p)))return-1;return i}readFilteredValue(){const e=this.p;const t=this.readExpression();this.assert(t.valid(),`invalid value expression: ${this.snapshot()}`);const i=this.readFilters();return new FilteredValueToken(t,i,this.input,e,this.p,this.file)}readFilters(){const e=[];while(true){const t=this.readFilter();if(!t)return e;e.push(t)}}readFilter(){this.skipBlank();if(this.end())return null;this.assert(this.read()==="|",`expected "|" before filter`);const e=this.readIdentifier();if(!e.size()){this.assert(this.end(),`expected filter name`);return null}const t=[];this.skipBlank();if(this.peek()===":"){do{++this.p;const e=this.readFilterArg();e&&t.push(e);this.skipBlank();this.assert(this.end()||this.peek()===","||this.peek()==="|",(()=>`unexpected character ${this.snapshot()}`))}while(this.peek()===",")}else if(this.peek()==="|"||this.end());else{throw this.error('expected ":" after filter name')}return new FilterToken(e.getText(),t,this.input,e.begin,this.p,this.file)}readFilterArg(){const e=this.readValue();if(!e)return;this.skipBlank();if(this.peek()!==":")return e;++this.p;const t=this.readValue();return[e.getText(),t]}readTopLevelTokens(e=U){const t=[];while(this.p<this.N){const i=this.readTopLevelToken(e);t.push(i)}whiteSpaceCtrl(t,e);return t}readTopLevelToken(e){const{tagDelimiterLeft:t,outputDelimiterLeft:i}=e;if(this.rawBeginAt>-1)return this.readEndrawOrRawContent(e);if(this.match(t))return this.readTagToken(e);if(this.match(i))return this.readOutputToken(e);return this.readHTMLToken([t,i])}readHTMLToken(e){const t=this.p;while(this.p<this.N){if(e.some((e=>this.match(e))))break;++this.p}return new HTMLToken(this.input,t,this.p,this.file)}readTagToken(e){const{file:t,input:i}=this;const s=this.p;if(this.readToDelimiter(e.tagDelimiterRight)===-1){throw this.error(`tag ${this.snapshot(s)} not closed`,s)}const r=new TagToken(i,s,this.p,e,t);if(r.name==="raw")this.rawBeginAt=s;return r}readToDelimiter(e,t=false){this.skipBlank();while(this.p<this.N){if(t&&this.peekType()&f){this.readQuoted();continue}++this.p;if(this.rmatch(e))return this.p}return-1}readOutputToken(e=U){const{file:t,input:i}=this;const{outputDelimiterRight:s}=e;const r=this.p;if(this.readToDelimiter(s,true)===-1){throw this.error(`output ${this.snapshot(r)} not closed`,r)}return new OutputToken(i,r,this.p,e,t)}readEndrawOrRawContent(e){const{tagDelimiterLeft:t,tagDelimiterRight:i}=e;const s=this.p;let r=this.readTo(t)-t.length;while(this.p<this.N){if(this.readIdentifier().getText()!=="endraw"){r=this.readTo(t)-t.length;continue}while(this.p<=this.N){if(this.rmatch(i)){const t=this.p;if(s===r){this.rawBeginAt=-1;return new TagToken(this.input,s,t,e,this.file)}else{this.p=r;return new HTMLToken(this.input,s,r,this.file)}}if(this.rmatch(t))break;this.p++}}throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,s)}readLiquidTagTokens(e=U){const t=[];while(this.p<this.N){const i=this.readLiquidTagToken(e);i&&t.push(i)}return t}readLiquidTagToken(e){this.skipBlank();if(this.end())return;const t=this.p;this.readToDelimiter("\n");const i=this.p;return new LiquidTagToken(this.input,t,i,e,this.file)}error(e,t=this.p){return new TokenizationError(e,new IdentifierToken(this.input,t,this.N,this.file))}assert(e,t,i){if(!e)throw this.error(typeof t==="function"?t():t,i)}snapshot(e=this.p){return JSON.stringify(ellipsis(this.input.slice(e,this.N),32))}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();const e=this.p;while(!this.end()&&isWord(this.peek()))++this.p;return new IdentifierToken(this.input,e,this.p,this.file)}readNonEmptyIdentifier(){const e=this.readIdentifier();return e.size()?e:undefined}readTagName(){this.skipBlank();if(this.input[this.p]==="#")return this.input.slice(this.p,++this.p);return this.readIdentifier().getText()}readHashes(e){const t=[];while(true){const i=this.readHash(e);if(!i)return t;t.push(i)}}readHash(e){this.skipBlank();if(this.peek()===",")++this.p;const t=this.p;const i=this.readNonEmptyIdentifier();if(!i)return;let s;this.skipBlank();const r=isString(e)?e:e?"=":":";if(this.peek()===r){++this.p;s=this.readValue()}return new HashToken(this.input,t,this.p,i,s,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(e=1){this.p+=e}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(e){while(this.p<this.N){++this.p;if(this.rmatch(e))return this.p}return-1}readValue(){this.skipBlank();const e=this.p;const t=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber();const i=this.readProperties(!t);if(!i.length)return t;return new PropertyAccessToken(t,i,this.input,e,this.p)}readScopeValue(){this.skipBlank();const e=this.p;const t=this.readProperties();if(!t.length)return undefined;return new PropertyAccessToken(undefined,t,this.input,e,this.p)}readProperties(e=true){const t=[];while(true){if(this.peek()==="["){this.p++;const e=this.readValue()||new IdentifierToken(this.input,this.p,this.p,this.file);this.assert(this.readTo("]")!==-1,"[ not closed");t.push(e);continue}if(e&&!t.length){const e=this.readNonEmptyIdentifier();if(e){t.push(e);continue}}if(this.peek()==="."&&this.peek(1)!=="."){this.p++;const e=this.readNonEmptyIdentifier();if(!e)break;t.push(e);continue}break}return t}readNumber(){this.skipBlank();let e=false;let t=false;let i=0;if(this.peekType()&m)i++;while(this.p+i<=this.N){if(this.peekType(i)&g){t=true;i++}else if(this.peek(i)==="."&&this.peek(i+1)!=="."){if(e||!t)return;e=true;i++}else break}if(t&&!isWord(this.peek(i))){const e=new NumberToken(this.input,this.p,this.p+i,this.file);this.advance(i);return e}}readLiteral(){this.skipBlank();const e=this.matchTrie(this.literalTrie);if(e===-1)return;const t=new LiteralToken(this.input,this.p,e,this.file);this.p=e;return t}readRange(){this.skipBlank();const e=this.p;if(this.peek()!=="(")return;++this.p;const t=this.readValueOrThrow();this.skipBlank();this.assert(this.read()==="."&&this.read()===".","invalid range syntax");const i=this.readValueOrThrow();this.skipBlank();this.assert(this.read()===")","invalid range syntax");return new RangeToken(this.input,e,this.p,t,i,this.file)}readValueOrThrow(){const e=this.readValue();this.assert(e,(()=>`unexpected token ${this.snapshot()}, value expected`));return e}readQuoted(){this.skipBlank();const e=this.p;if(!(this.peekType()&f))return;++this.p;let t=false;while(this.p<this.N){++this.p;if(this.input[this.p-1]===this.input[e]&&!t)break;if(t)t=false;else if(this.input[this.p-1]==="\\")t=true}return new QuotedToken(this.input,e,this.p,this.file)}*readFileNameTemplate(e){const{outputDelimiterLeft:t}=e;const i=[","," ",t];const s=new Set(i);while(this.p<this.N&&!s.has(this.peek())){yield this.match(t)?this.readOutputToken(e):this.readHTMLToken(i)}}match(e){for(let t=0;t<e.length;t++){if(e[t]!==this.input[this.p+t])return false}return true}rmatch(e){for(let t=0;t<e.length;t++){if(e[e.length-1-t]!==this.input[this.p-1-t])return false}return true}peekType(e=0){return this.p+e>=this.N?0:u[this.input.charCodeAt(this.p+e)]}peek(e=0){return this.p+e>=this.N?"":this.input[this.p+e]}skipBlank(){while(this.peekType()&p)++this.p}}class ParseStream{constructor(e,t){this.handlers={};this.stopRequested=false;this.tokens=e;this.parseToken=t}on(e,t){this.handlers[e]=t;return this}trigger(e,t){const i=this.handlers[e];return i?(i.call(this,t),true):false}start(){this.trigger("start");let e;while(!this.stopRequested&&(e=this.tokens.shift())){if(this.trigger("token",e))continue;if(isTagToken(e)&&this.trigger(`tag:${e.name}`,e)){continue}const t=this.parseToken(e,this.tokens);this.trigger("template",t)}if(!this.stopRequested)this.trigger("end");return this}stop(){this.stopRequested=true;return this}}class TemplateImpl{constructor(e){this.token=e}}class Tag extends TemplateImpl{constructor(e,t,i){super(e);this.name=e.name;this.liquid=i;this.tokenizer=e.tokenizer}}class Hash{constructor(e,t){this.hash={};const i=e instanceof Tokenizer?e:new Tokenizer(e,{});for(const e of i.readHashes(t)){this.hash[e.name.content]=e.value}}*render(e){const t={};for(const i of Object.keys(this.hash)){t[i]=this.hash[i]===undefined?true:yield evalToken(this.hash[i],e)}return t}}function createTagClass(e){return class extends Tag{constructor(t,i,s){super(t,i,s);if(isFunction(e.parse)){e.parse.call(this,t,i)}}*render(t,i){const s=yield new Hash(this.token.args,t.opts.keyValueSeparator).render(t);return yield e.render.call(this,t,i,s)}}}function isKeyValuePair(e){return isArray(e)}class Filter{constructor(e,t,i){this.token=e;this.name=e.name;this.handler=isFunction(t)?t:isFunction(t?.handler)?t.handler:identify;this.raw=!isFunction(t)&&!!t?.raw;this.args=e.args;this.liquid=i}*render(e,t){const i=[];for(const e of this.args){if(isKeyValuePair(e))i.push([e[0],yield evalToken(e[1],t)]);else i.push(yield evalToken(e,t))}return yield this.handler.apply({context:t,token:this.token,liquid:this.liquid},[e,...i])}}class Value{constructor(e,t){this.filters=[];const i=typeof e==="string"?new Tokenizer(e,t.options.operators).readFilteredValue():e;this.initial=i.initial;this.filters=i.filters.map((e=>new Filter(e,this.getFilter(t,e.name),t)))}*value(e,t){t=t||e.opts.lenientIf&&this.filters.length>0&&this.filters[0].name==="default";let i=yield this.initial.evaluate(e,t);for(const t of this.filters){i=yield t.render(i,e)}return i}getFilter(e,t){const i=e.filters[t];assert(i||!e.options.strictFilters,(()=>`undefined filter: ${t}`));return i}}class Output extends TemplateImpl{constructor(e,t){super(e);const i=new Tokenizer(e.input,t.options.operators,e.file,e.contentRange);this.value=new Value(i.readFilteredValue(),t);const s=this.value.filters;const r=t.options.outputEscape;if(!s[s.length-1]?.raw&&r){const e=new FilterToken(toString.call(r),[],"",0,0);s.push(new Filter(e,r,t))}}*render(e,t){const i=yield this.value.value(e,false);t.write(i)}*arguments(){yield this.value}}class HTML extends TemplateImpl{constructor(e){super(e);this.str=e.getContent()}*render(e,t){t.write(this.str)}}class Variable{constructor(e,t){this.segments=e;this.location=t}toString(){return segmentsString(this.segments,true)}toArray(){function*_visit(...e){for(const t of e){if(t instanceof Variable){yield Array.from(_visit(...t.segments))}else{yield t}}}return Array.from(_visit(...this.segments))}}class VariableMap{constructor(){this.map=new Map}get(e){const t=segmentsString([e.segments[0]]);if(!this.map.has(t)){this.map.set(t,[])}return this.map.get(t)}has(e){return this.map.has(segmentsString([e.segments[0]]))}push(e){this.get(e).push(e)}asObject(){return Object.fromEntries(this.map)}}const K={partials:true};function*_analyze(e,t,i){const s=new VariableMap;const r=new VariableMap;const n=new VariableMap;const o=new DummyScope(new Set);const a=new Set;function updateVariables(e,t){s.push(e);const i=t.alias(e);if(i!==undefined){const e=i.segments[0];if(isString(e)&&!o.has(e)){r.push(i)}}else{const i=e.segments[0];if(isString(i)&&!t.has(i)){r.push(e)}}for(const i of e.segments){if(i instanceof Variable){updateVariables(i,t)}}}function*visit(e,s){if(e.arguments){for(const t of e.arguments()){for(const e of extractVariables(t)){updateVariables(e,s)}}}if(e.localScope){for(const t of e.localScope()){s.add(t.content);s.deleteAlias(t.content);const[e,i]=t.getPosition();n.push(new Variable([t.content],{row:e,col:i,file:t.file}))}}if(e.children){if(e.partialScope){const r=e.partialScope();if(r===undefined){for(const r of yield e.children(t,i)){yield visit(r,s)}return}if(a.has(r.name))return;const n=new Set;const o=r.isolated?new DummyScope(n):s.push(n);for(const e of r.scope){if(isString(e)){n.add(e)}else{const[t,i]=e;n.add(t);const s=Array.from(extractVariables(i));if(s.length){o.setAlias(t,s[0].segments)}}}for(const s of yield e.children(t,i)){yield visit(s,o);a.add(r.name)}o.pop()}else{if(e.blockScope){s.push(new Set(e.blockScope()))}for(const r of yield e.children(t,i)){yield visit(r,s)}if(e.blockScope){s.pop()}}}}for(const t of e){yield visit(t,o)}return{variables:s.asObject(),globals:r.asObject(),locals:n.asObject()}}function analyze(e,t={}){const i={...K,...t};return toPromise(_analyze(e,i.partials,false))}function analyzeSync(e,t={}){const i={...K,...t};return toValueSync(_analyze(e,i.partials,true))}class DummyScope{constructor(e){this.stack=[{names:e,aliases:new Map}]}has(e){for(const t of this.stack){if(t.names.has(e)){return true}}return false}push(e){this.stack.push({names:e,aliases:new Map});return this}pop(){return this.stack.pop()?.names}add(e){this.stack[0].names.add(e)}alias(e){const t=e.segments[0];if(!isString(t))return undefined;const i=this.getAlias(t);if(i===undefined)return undefined;return new Variable([...i,...e.segments.slice(1)],e.location)}setAlias(e,t){this.stack[this.stack.length-1].aliases.set(e,t)}deleteAlias(e){this.stack[this.stack.length-1].aliases.delete(e)}getAlias(e){for(const t of this.stack){if(t.aliases.has(e)){return t.aliases.get(e)}if(t.names.has(e)){return undefined}}return undefined}}function*extractVariables(e){if(isValueToken(e)){yield*extractValueTokenVariables(e)}else if(e instanceof Value){yield*extractFilteredValueVariables(e)}}function*extractFilteredValueVariables(e){for(const t of e.initial.postfix){if(isValueToken(t)){yield*extractValueTokenVariables(t)}}for(const t of e.filters){for(const e of t.args){if(isKeyValuePair(e)&&e[1]){yield*extractValueTokenVariables(e[1])}else if(isValueToken(e)){yield*extractValueTokenVariables(e)}}}}function*extractValueTokenVariables(e){if(isRangeToken(e)){yield*extractValueTokenVariables(e.lhs);yield*extractValueTokenVariables(e.rhs)}else if(isPropertyAccessToken(e)){yield extractPropertyAccessVariable(e)}}function extractPropertyAccessVariable(e){const t=[];let i=e.file;const s=e.props[0];i=i||s.file;if(isQuotedToken(s)||isNumberToken(s)||isWordToken(s)){t.push(s.content)}else if(isPropertyAccessToken(s)){t.push(...extractPropertyAccessVariable(s).segments)}for(const s of e.props.slice(1)){i=i||s.file;if(isQuotedToken(s)||isNumberToken(s)||isWordToken(s)){t.push(s.content)}else if(isPropertyAccessToken(s)){t.push(extractPropertyAccessVariable(s))}}const[r,n]=e.getPosition();return new Variable(t,{row:r,col:n,file:i})}const W=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/;function segmentsString(e,t=false){const i=[];const s=e[0];if(isString(s)){if(!t||s.match(W)){i.push(`${s}`)}else{i.push(`['${s}']`)}}for(const t of e.slice(1)){if(t instanceof Variable){i.push(`[${segmentsString(t.segments)}]`)}else if(isString(t)){if(t.match(W)){i.push(`.${t}`)}else{i.push(`['${t}']`)}}else{i.push(`[${t}]`)}}return i.join("")}var Y;(function(e){e["Partials"]="partials";e["Layouts"]="layouts";e["Root"]="root"})(Y||(Y={}));class Loader{constructor(e){this.options=e;if(e.relativeReference){const t=e.fs.sep;assert(t,"`fs.sep` is required for relative reference");const i=new RegExp(["."+t,".."+t,"./","../"].map((e=>escapeRegex(e))).join("|"));this.shouldLoadRelative=e=>i.test(e)}else{this.shouldLoadRelative=e=>false}this.contains=this.options.fs.contains||(()=>true)}*lookup(e,t,i,s){const{fs:r}=this.options;const n=this.options[t];for(const o of this.candidates(e,n,s,t!==Y.Root)){if(i?r.existsSync(o):yield r.exists(o))return o}throw this.lookupError(e,n)}*candidates(e,t,i,s){const{fs:r,extname:n}=this.options;if(this.shouldLoadRelative(e)&&i){const o=r.resolve(this.dirname(i),e,n);for(const e of t){if(!s||this.contains(e,o)){yield o;break}}}for(const i of t){const t=r.resolve(i,e,n);if(!s||this.contains(i,t)){yield t}}if(r.fallback!==undefined){const t=r.fallback(e);if(t!==undefined)yield t}}dirname(e){const t=this.options.fs;assert(t.dirname,"`fs.dirname` is required for relative reference");return t.dirname(e)}lookupError(e,t){const i=new Error("ENOENT");i.message=`ENOENT: Failed to lookup "${e}" in "${t}"`;i.code="ENOENT";return i}}class Parser{constructor(e){this.liquid=e;this.cache=this.liquid.options.cache;this.fs=this.liquid.options.fs;this.parseFile=this.cache?this._parseFileCached:this._parseFile;this.loader=new Loader(this.liquid.options);this.parseLimit=new Limiter("parse length",e.options.parseLimit)}parse(e,t){e=String(e);this.parseLimit.use(e.length);const i=new Tokenizer(e,this.liquid.options.operators,t);const s=i.readTopLevelTokens(this.liquid.options);return this.parseTokens(s)}parseTokens(e){let t;const i=[];const s=[];while(t=e.shift()){try{i.push(this.parseToken(t,e))}catch(e){if(this.liquid.options.catchAllErrors)s.push(e);else throw e}}if(s.length)throw new LiquidErrors(s);return i}parseToken(e,t){try{if(isTagToken(e)){const i=this.liquid.tags[e.name];assert(i,`tag "${e.name}" not found`);return new i(e,t,this.liquid,this)}if(isOutputToken(e)){return new Output(e,this.liquid)}return new HTML(e)}catch(t){if(LiquidError.is(t))throw t;throw new ParseError(t,e)}}parseStream(e){return new ParseStream(e,((e,t)=>this.parseToken(e,t)))}*_parseFileCached(e,t,i=Y.Root,s){const r=this.cache;const n=this.loader.shouldLoadRelative(e)?s+","+e:i+":"+e;const o=yield r.read(n);if(o)return o;const a=this._parseFile(e,t,i,s);const l=t?yield a:toPromise(a);r.write(n,l);try{return yield l}catch(e){r.remove(n);throw e}}*_parseFile(e,t,i=Y.Root,s){const r=yield this.loader.lookup(e,i,t,s);return this.parse(t?this.fs.readFileSync(r):yield this.fs.readFile(r),r)}}(function(e){e[e["Number"]=1]="Number";e[e["Literal"]=2]="Literal";e[e["Tag"]=4]="Tag";e[e["Output"]=8]="Output";e[e["HTML"]=16]="HTML";e[e["Filter"]=32]="Filter";e[e["Hash"]=64]="Hash";e[e["PropertyAccess"]=128]="PropertyAccess";e[e["Word"]=256]="Word";e[e["Range"]=512]="Range";e[e["Quoted"]=1024]="Quoted";e[e["Operator"]=2048]="Operator";e[e["FilteredValue"]=4096]="FilteredValue";e[e["Delimited"]=12]="Delimited"})(t.TokenKind||(t.TokenKind={}));function isDelimitedToken(e){return!!(getKind(e)&t.TokenKind.Delimited)}function isOperatorToken(e){return getKind(e)===t.TokenKind.Operator}function isHTMLToken(e){return getKind(e)===t.TokenKind.HTML}function isOutputToken(e){return getKind(e)===t.TokenKind.Output}function isTagToken(e){return getKind(e)===t.TokenKind.Tag}function isQuotedToken(e){return getKind(e)===t.TokenKind.Quoted}function isLiteralToken(e){return getKind(e)===t.TokenKind.Literal}function isNumberToken(e){return getKind(e)===t.TokenKind.Number}function isPropertyAccessToken(e){return getKind(e)===t.TokenKind.PropertyAccess}function isWordToken(e){return getKind(e)===t.TokenKind.Word}function isRangeToken(e){return getKind(e)===t.TokenKind.Range}function isValueToken(e){return(getKind(e)&1667)>0}function getKind(e){return e?e.kind:-1}var Q=Object.freeze({__proto__:null,isDelimitedToken:isDelimitedToken,isOperatorToken:isOperatorToken,isHTMLToken:isHTMLToken,isOutputToken:isOutputToken,isTagToken:isTagToken,isQuotedToken:isQuotedToken,isLiteralToken:isLiteralToken,isNumberToken:isNumberToken,isPropertyAccessToken:isPropertyAccessToken,isWordToken:isWordToken,isRangeToken:isRangeToken,isValueToken:isValueToken});var __assign=function(){__assign=Object.assign||function __assign(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};class Context{constructor(e={},t=U,i={},{memoryLimit:s,renderLimit:r}={}){this.scopes=[{}];this.registers={};this.breakCalled=false;this.continueCalled=false;this.sync=!!i.sync;this.opts=t;this.globals=i.globals??t.globals;this.environments=isObject(e)?e:Object(e);this.strictVariables=i.strictVariables??this.opts.strictVariables;this.ownPropertyOnly=i.ownPropertyOnly??t.ownPropertyOnly;this.memoryLimit=s??new Limiter("memory alloc",i.memoryLimit??t.memoryLimit);this.renderLimit=r??new Limiter("template render",getPerformance().now()+(i.renderLimit??t.renderLimit))}getRegister(e){return this.registers[e]=this.registers[e]||{}}setRegister(e,t){return this.registers[e]=t}saveRegister(...e){return e.map((e=>[e,this.getRegister(e)]))}restoreRegister(e){return e.forEach((([e,t])=>this.setRegister(e,t)))}getAll(){return[this.globals,this.environments,...this.scopes].reduce(((e,t)=>__assign(e,t)),{})}get(e){return this.getSync(e)}getSync(e){return toValueSync(this._get(e))}*_get(e){const t=this.findScope(e[0]);return yield this._getFromScope(t,e)}getFromScope(e,t){return toValueSync(this._getFromScope(e,t))}*_getFromScope(e,t,i=this.strictVariables){if(isString(t))t=t.split(".");for(let s=0;s<t.length;s++){e=yield this.readProperty(e,t[s]);if(i&&isUndefined(e)){throw new InternalUndefinedVariableError(t.slice(0,s+1).join("."))}}return e}push(e){return this.scopes.push(e)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(e={}){return new Context(e,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(e){for(let t=this.scopes.length-1;t>=0;t--){const i=this.scopes[t];if(e in i)return i}if(e in this.environments)return this.environments;return this.globals}readProperty(e,t){e=toLiquid(e);t=toValue(t);if(isNil(e))return e;if(isArray(e)&&t<0)return e[e.length+ +t];const i=readJSProperty(e,t,this.ownPropertyOnly);if(i===undefined&&e instanceof Drop)return e.liquidMethodMissing(t,this);if(isFunction(i))return i.call(e);if(t==="size")return readSize(e);else if(t==="first")return readFirst(e);else if(t==="last")return readLast(e);return i}}function readJSProperty(e,t,i){if(i&&!l.call(e,t)&&!(e instanceof Drop))return undefined;return e[t]}function readFirst(e){if(isArray(e))return e[0];return e["first"]}function readLast(e){if(isArray(e))return e[e.length-1];return e["last"]}function readSize(e){if(l.call(e,"size")||e["size"]!==undefined)return e["size"];if(isArray(e)||isString(e))return e.length;if(typeof e==="object")return Object.keys(e).length}var J;(function(e){e[e["OUTPUT"]=0]="OUTPUT";e[e["STORE"]=1]="STORE"})(J||(J={}));const Z=argumentsToNumber(Math.abs);const G=argumentsToNumber(Math.max);const X=argumentsToNumber(Math.min);const ee=argumentsToNumber(Math.ceil);const te=argumentsToNumber(((e,t,i=false)=>i?Math.floor(e/t):e/t));const ie=argumentsToNumber(Math.floor);const se=argumentsToNumber(((e,t)=>e-t));const re=argumentsToNumber(((e,t)=>e+t));const ne=argumentsToNumber(((e,t)=>e%t));const oe=argumentsToNumber(((e,t)=>e*t));function round(e,t=0){e=toNumber(e);t=toNumber(t);const i=Math.pow(10,t);return Math.round(e*i)/i}var ae=Object.freeze({__proto__:null,abs:Z,at_least:G,at_most:X,ceil:ee,divided_by:te,floor:ie,minus:se,plus:re,modulo:ne,times:oe,round:round});const url_decode=e=>decodeURIComponent(stringify(e)).replace(/\+/g," ");const url_encode=e=>encodeURIComponent(stringify(e)).replace(/%20/g,"+");const cgi_escape=e=>encodeURIComponent(stringify(e)).replace(/%20/g,"+").replace(/[!'()*]/g,(e=>"%"+e.charCodeAt(0).toString(16).toUpperCase()));const uri_escape=e=>encodeURI(stringify(e)).replace(/%5B/g,"[").replace(/%5D/g,"]");const le=/[^\p{M}\p{L}\p{Nd}]+/gu;const ce={raw:/\s+/g,default:le,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:le,none:null};function slugify(e,t="default",i=false){e=stringify(e);const s=ce[t];if(s){if(t==="latin")e=removeAccents(e);e=e.replace(s,"-").replace(/^-|-$/g,"")}return i?e:e.toLowerCase()}function removeAccents(e){return e.replace(/[àáâãäå]/g,"a").replace(/[æ]/g,"ae").replace(/[ç]/g,"c").replace(/[èéêë]/g,"e").replace(/[ìíîï]/g,"i").replace(/[ð]/g,"d").replace(/[ñ]/g,"n").replace(/[òóôõöø]/g,"o").replace(/[ùúûü]/g,"u").replace(/[ýÿ]/g,"y").replace(/[ß]/g,"ss").replace(/[œ]/g,"oe").replace(/[þ]/g,"th").replace(/[ẞ]/g,"SS").replace(/[Œ]/g,"OE").replace(/[Þ]/g,"TH")}var ue=Object.freeze({__proto__:null,url_decode:url_decode,url_encode:url_encode,cgi_escape:cgi_escape,uri_escape:uri_escape,slugify:slugify});const he=argumentsToValue((function(e,t){const i=toArray(e);const s=isNil(t)?" ":stringify(t);const r=i.length*(1+s.length);this.context.memoryLimit.use(r);return i.join(s)}));const pe=argumentsToValue((e=>isArrayLike(e)?last(e):""));const fe=argumentsToValue((e=>isArrayLike(e)?e[0]:""));const de=argumentsToValue((function(e){const t=toArray(e);this.context.memoryLimit.use(t.length);return[...t].reverse()}));function*sort(e,t){const i=[];const s=toArray(e);this.context.memoryLimit.use(s.length);for(const e of s){i.push([e,t?yield this.context._getFromScope(e,stringify(t).split("."),false):e])}return i.sort(((e,t)=>{const i=e[1];const s=t[1];return i<s?-1:i>s?1:0})).map((e=>e[0]))}function sort_natural(e,t){const i=stringify(t);const s=t===undefined?caseInsensitiveCompare:(e,t)=>caseInsensitiveCompare(e[i],t[i]);const r=toArray(e);this.context.memoryLimit.use(r.length);return[...r].sort(s)}const size=e=>e&&e.length||0;function*map(e,t){const i=[];const s=toArray(e);this.context.memoryLimit.use(s.length);for(const e of s){i.push(yield this.context._getFromScope(e,stringify(t),false))}return i}function*sum(e,t){let i=0;const s=toArray(e);for(const e of s){const s=Number(t?yield this.context._getFromScope(e,stringify(t),false):e);i+=Number.isNaN(s)?0:s}return i}function compact(e){const t=toArray(e);this.context.memoryLimit.use(t.length);return t.filter((e=>!isNil(toValue(e))))}function concat(e,t=[]){const i=toArray(e);const s=toArray(t);this.context.memoryLimit.use(i.length+s.length);return i.concat(s)}function push(e,t){return concat.call(this,e,[t])}function unshift(e,t){const i=toArray(e);this.context.memoryLimit.use(i.length);const s=[...i];s.unshift(t);return s}function pop(e){const t=[...toArray(e)];t.pop();return t}function shift(e){const t=toArray(e);this.context.memoryLimit.use(t.length);const i=[...t];i.shift();return i}function slice(e,t,i=1){e=toValue(e);if(isNil(e))return[];if(!isArray(e))e=stringify(e);t=t<0?e.length+t:t;this.context.memoryLimit.use(i);return e.slice(t,t+i)}function expectedMatcher(e){if(this.context.opts.jekyllWhere){return t=>EmptyDrop.is(e)?equals(t,e):isArray(t)?arrayIncludes(t,e):equals(t,e)}else if(e===undefined){return e=>isTruthy(e,this.context)}else{return t=>equals(t,e)}}function*filter(e,t,i,s){const r=[];t=toArray(t);this.context.memoryLimit.use(t.length);const n=new Tokenizer(stringify(i)).readScopeValue();for(const e of t){r.push(yield evalToken(n,this.context.spawn(e)))}const o=expectedMatcher.call(this,s);return t.filter(((t,i)=>o(r[i])===e))}function*filter_exp(e,t,i,s){const r=[];const n=new Value(stringify(s),this.liquid);const o=toArray(t);this.context.memoryLimit.use(o.length);for(const t of o){this.context.push({[i]:t});const s=yield n.value(this.context);this.context.pop();if(s===e)r.push(t)}return r}function*where(e,t,i){return yield*filter.call(this,true,e,t,i)}function*reject(e,t,i){return yield*filter.call(this,false,e,t,i)}function*where_exp(e,t,i){return yield*filter_exp.call(this,true,e,t,i)}function*reject_exp(e,t,i){return yield*filter_exp.call(this,false,e,t,i)}function*group_by(e,t){const i=new Map;e=toEnumerable(e);const s=new Tokenizer(stringify(t)).readScopeValue();this.context.memoryLimit.use(e.length);for(const t of e){const e=yield evalToken(s,this.context.spawn(t));if(!i.has(e))i.set(e,[]);i.get(e).push(t)}return[...i.entries()].map((([e,t])=>({name:e,items:t})))}function*group_by_exp(e,t,i){const s=new Map;const r=new Value(stringify(i),this.liquid);e=toEnumerable(e);this.context.memoryLimit.use(e.length);for(const i of e){this.context.push({[t]:i});const e=yield r.value(this.context);this.context.pop();if(!s.has(e))s.set(e,[]);s.get(e).push(i)}return[...s.entries()].map((([e,t])=>({name:e,items:t})))}function*search(e,t,i){const s=new Tokenizer(stringify(t)).readScopeValue();const r=toArray(e);const n=expectedMatcher.call(this,i);for(let e=0;e<r.length;e++){const t=yield evalToken(s,this.context.spawn(r[e]));if(n(t))return[e,r[e]]}}function*search_exp(e,t,i){const s=new Value(stringify(i),this.liquid);const r=toArray(e);for(let e=0;e<r.length;e++){this.context.push({[t]:r[e]});const i=yield s.value(this.context);this.context.pop();if(i)return[e,r[e]]}}function*has(e,t,i){const s=yield*search.call(this,e,t,i);return!!s}function*has_exp(e,t,i){const s=yield*search_exp.call(this,e,t,i);return!!s}function*find_index(e,t,i){const s=yield*search.call(this,e,t,i);return s?s[0]:undefined}function*find_index_exp(e,t,i){const s=yield*search_exp.call(this,e,t,i);return s?s[0]:undefined}function*find(e,t,i){const s=yield*search.call(this,e,t,i);return s?s[1]:undefined}function*find_exp(e,t,i){const s=yield*search_exp.call(this,e,t,i);return s?s[1]:undefined}function uniq(e){e=toArray(e);this.context.memoryLimit.use(e.length);return[...new Set(e)]}function sample(e,t=1){e=toValue(e);if(isNil(e))return[];if(!isArray(e))e=stringify(e);this.context.memoryLimit.use(t);const i=[...e].sort((()=>Math.random()-.5));if(t===1)return i[0];return i.slice(0,t)}var ge=Object.freeze({__proto__:null,join:he,last:pe,first:fe,reverse:de,sort:sort,sort_natural:sort_natural,size:size,map:map,sum:sum,compact:compact,concat:concat,push:push,unshift:unshift,pop:pop,shift:shift,slice:slice,where:where,reject:reject,where_exp:where_exp,reject_exp:reject_exp,group_by:group_by,group_by_exp:group_by_exp,has:has,has_exp:has_exp,find_index:find_index,find_index_exp:find_index_exp,find:find,find_exp:find_exp,uniq:uniq,sample:sample});function date(e,t,i){const s=(e?.length??0)+(t?.length??0)+(i?.length??0);this.context.memoryLimit.use(s);const r=parseDate(e,this.context.opts,i);if(!r)return e;t=toValue(t);t=isNil(t)?this.context.opts.dateFormat:stringify(t);return strftime(r,t)}function date_to_xmlschema(e){return date.call(this,e,"%Y-%m-%dT%H:%M:%S%:z")}function date_to_rfc822(e){return date.call(this,e,"%a, %d %b %Y %H:%M:%S %z")}function date_to_string(e,t,i){return stringify_date.call(this,e,"%b",t,i)}function date_to_long_string(e,t,i){return stringify_date.call(this,e,"%B",t,i)}function stringify_date(e,t,i,s){const r=parseDate(e,this.context.opts);if(!r)return e;if(i==="ordinal"){const e=r.getDate();return s==="US"?strftime(r,`${t} ${e}%q, %Y`):strftime(r,`${e}%q ${t} %Y`)}return strftime(r,`%d ${t} %Y`)}function parseDate(e,t,i){let s;const r=i??t.timezoneOffset;const n=t.locale;e=toValue(e);if(e==="now"||e==="today"){s=new LiquidDate(Date.now(),n,r)}else if(isNumber(e)){s=new LiquidDate(e*1e3,n,r)}else if(isString(e)){if(/^\d+$/.test(e)){s=new LiquidDate(+e*1e3,n,r)}else if(t.preserveTimezones&&i===undefined){s=LiquidDate.createDateFixedToTimezone(e,n)}else{s=new LiquidDate(e,n,r)}}else{s=new LiquidDate(e,n,r)}return s.valid()?s:undefined}var me=Object.freeze({__proto__:null,date:date,date_to_xmlschema:date_to_xmlschema,date_to_rfc822:date_to_rfc822,date_to_string:date_to_string,date_to_long_string:date_to_long_string});const ye=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu;const Te=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu;function append(e,t){assert(arguments.length===2,"append expect 2 arguments");const i=stringify(e);const s=stringify(t);this.context.memoryLimit.use(i.length+s.length);return i+s}function prepend(e,t){assert(arguments.length===2,"prepend expect 2 arguments");const i=stringify(e);const s=stringify(t);this.context.memoryLimit.use(i.length+s.length);return s+i}function lstrip(e,t){const i=stringify(e);this.context.memoryLimit.use(i.length);if(t){t=escapeRegExp(stringify(t));return i.replace(new RegExp(`^[${t}]+`,"g"),"")}return i.replace(/^\s+/,"")}function downcase(e){const t=stringify(e);this.context.memoryLimit.use(t.length);return t.toLowerCase()}function upcase(e){const t=stringify(e);this.context.memoryLimit.use(t.length);return stringify(t).toUpperCase()}function remove(e,t){const i=stringify(e);this.context.memoryLimit.use(i.length);return i.split(stringify(t)).join("")}function remove_first(e,t){const i=stringify(e);this.context.memoryLimit.use(i.length);return i.replace(stringify(t),"")}function remove_last(e,t){const i=stringify(e);this.context.memoryLimit.use(i.length);const s=stringify(t);const r=i.lastIndexOf(s);if(r===-1)return i;return i.substring(0,r)+i.substring(r+s.length)}function rstrip(e,t){e=stringify(e);this.context.memoryLimit.use(e.length);if(t){t=escapeRegExp(stringify(t));return e.replace(new RegExp(`[${t}]+$`,"g"),"")}return e.replace(/\s+$/,"")}function split(e,t){const i=stringify(e);this.context.memoryLimit.use(i.length);const s=i.split(stringify(t));while(s.length&&s[s.length-1]==="")s.pop();return s}function strip(e,t){const i=stringify(e);this.context.memoryLimit.use(i.length);if(t){t=escapeRegExp(stringify(t));return i.replace(new RegExp(`^[${t}]+`,"g"),"").replace(new RegExp(`[${t}]+$`,"g"),"")}return i.trim()}function strip_newlines(e){const t=stringify(e);this.context.memoryLimit.use(t.length);return t.replace(/\r?\n/gm,"")}function capitalize(e){e=stringify(e);this.context.memoryLimit.use(e.length);return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function replace(e,t,i){const s=stringify(e);this.context.memoryLimit.use(s.length);return s.split(stringify(t)).join(i)}function replace_first(e,t,i){const s=stringify(e);this.context.memoryLimit.use(s.length);return s.replace(stringify(t),i)}function replace_last(e,t,i){const s=stringify(e);this.context.memoryLimit.use(s.length);const r=stringify(t);const n=s.lastIndexOf(r);if(n===-1)return s;const o=stringify(i);return s.substring(0,n)+o+s.substring(n+r.length)}function truncate(e,t=50,i="..."){const s=stringify(e);this.context.memoryLimit.use(s.length);if(s.length<=t)return e;return s.substring(0,t-i.length)+i}function truncatewords(e,t=15,i="..."){const s=stringify(e);this.context.memoryLimit.use(s.length);const r=s.split(/\s+/);if(t<=0)t=1;let n=r.slice(0,t).join(" ");if(r.length>=t)n+=i;return n}function normalize_whitespace(e){const t=stringify(e);this.context.memoryLimit.use(t.length);return t.replace(/\s+/g," ")}function number_of_words(e,t){const i=stringify(e);this.context.memoryLimit.use(i.length);e=i.trim();if(!e)return 0;switch(t){case"cjk":return(e.match(ye)||[]).length+(e.match(Te)||[]).length;case"auto":return ye.test(e)?e.match(ye).length+(e.match(Te)||[]).length:e.split(/\s+/).length;default:return e.split(/\s+/).length}}function array_to_sentence_string(e,t="and"){this.context.memoryLimit.use(e.length);switch(e.length){case 0:return"";case 1:return e[0];case 2:return`${e[0]} ${t} ${e[1]}`;default:return`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`}}var ke=Object.freeze({__proto__:null,append:append,prepend:prepend,lstrip:lstrip,downcase:downcase,upcase:upcase,remove:remove,remove_first:remove_first,remove_last:remove_last,rstrip:rstrip,split:split,strip:strip,strip_newlines:strip_newlines,capitalize:capitalize,replace:replace,replace_first:replace_first,replace_last:replace_last,truncate:truncate,truncatewords:truncatewords,normalize_whitespace:normalize_whitespace,number_of_words:number_of_words,array_to_sentence_string:array_to_sentence_string});const we={...H,...ae,...ue,...ge,...me,...ke,...I};class AssignTag extends Tag{constructor(e,t,i){super(e,t,i);this.identifier=this.tokenizer.readIdentifier();this.key=this.identifier.content;this.tokenizer.assert(this.key,"expected variable name");this.tokenizer.skipBlank();this.tokenizer.assert(this.tokenizer.peek()==="=",'expected "="');this.tokenizer.advance();this.value=new Value(this.tokenizer.readFilteredValue(),this.liquid)}*render(e){e.bottom()[this.key]=yield this.value.value(e,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}}const be=["offset","limit","reversed"];class ForTag extends Tag{constructor(e,t,i,s){super(e,t,i);const r=this.tokenizer.readIdentifier();const n=this.tokenizer.readIdentifier();const o=this.tokenizer.readValue();if(!r.size()||n.content!=="in"||!o){throw new Error(`illegal tag: ${e.getText()}`)}this.variable=r.content;this.collection=o;this.hash=new Hash(this.tokenizer,i.options.keyValueSeparator);this.templates=[];this.elseTemplates=[];let a;const l=s.parseStream(t).on("start",(()=>a=this.templates)).on("tag:else",(e=>{assertEmpty(e.args);a=this.elseTemplates})).on("tag:endfor",(e=>{assertEmpty(e.args);l.stop()})).on("template",(e=>a.push(e))).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)}));l.start()}*render(e,t){const i=this.liquid.renderer;let s=toEnumerable(yield evalToken(this.collection,e));if(!s.length){yield i.renderTemplates(this.elseTemplates,e,t);return}const r="continue-"+this.variable+"-"+this.collection.getText();e.push({continue:e.getRegister(r)});const n=yield this.hash.render(e);e.pop();const o=this.liquid.options.orderedFilterParameters?Object.keys(n).filter((e=>be.includes(e))):be.filter((e=>n[e]!==undefined));s=o.reduce(((e,t)=>{if(t==="offset")return offset(e,n["offset"]);if(t==="limit")return limit(e,n["limit"]);return reversed(e)}),s);e.setRegister(r,(n["offset"]||0)+s.length);const a={forloop:new ForloopDrop(s.length,this.collection.getText(),this.variable)};e.push(a);for(const r of s){a[this.variable]=r;e.continueCalled=e.breakCalled=false;yield i.renderTemplates(this.templates,e,t);if(e.breakCalled)break;a.forloop.next()}e.continueCalled=e.breakCalled=false;e.pop()}*children(){const e=this.templates.slice();if(this.elseTemplates){e.push(...this.elseTemplates)}return e}*arguments(){yield this.collection;for(const e of Object.values(this.hash.hash)){if(isValueToken(e)){yield e}}}blockScope(){return[this.variable,"forloop"]}}function reversed(e){return[...e].reverse()}function offset(e,t){return e.slice(t)}function limit(e,t){return e.slice(0,t)}class CaptureTag extends Tag{constructor(e,t,i,s){super(e,t,i);this.templates=[];this.identifier=this.readVariable();this.variable=this.identifier.content;while(t.length){const e=t.shift();if(isTagToken(e)&&e.name==="endcapture")return;this.templates.push(s.parseToken(e,t))}throw new Error(`tag ${e.getText()} not closed`)}readVariable(){let e=this.tokenizer.readIdentifier();if(e.content)return e;e=this.tokenizer.readQuoted();if(e)return e;throw this.tokenizer.error("invalid capture name")}*render(e){const t=this.liquid.renderer;const i=yield t.renderTemplates(this.templates,e);e.bottom()[this.variable]=i}*children(){return this.templates}*localScope(){yield this.identifier}}class CaseTag extends Tag{constructor(e,t,i,s){super(e,t,i);this.branches=[];this.elseTemplates=[];this.value=new Value(this.tokenizer.readFilteredValue(),this.liquid);this.elseTemplates=[];let r=[];let n=0;const o=s.parseStream(t).on("tag:when",(e=>{if(n>0){return}r=[];const t=[];while(!e.tokenizer.end()){t.push(e.tokenizer.readValueOrThrow());e.tokenizer.skipBlank();if(e.tokenizer.peek()===","){e.tokenizer.readTo(",")}else{e.tokenizer.readTo("or")}}this.branches.push({values:t,templates:r})})).on("tag:else",(()=>{n++;r=this.elseTemplates})).on("tag:endcase",(()=>o.stop())).on("template",(e=>{if(r!==this.elseTemplates||n===1){r.push(e)}})).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)}));o.start()}*render(e,t){const i=this.liquid.renderer;const s=toValue(yield this.value.value(e,e.opts.lenientIf));let r=false;for(const n of this.branches){for(const o of n.values){const a=yield evalToken(o,e,e.opts.lenientIf);if(equals(s,a)){yield i.renderTemplates(n.templates,e,t);r=true;break}}}if(!r){yield i.renderTemplates(this.elseTemplates,e,t)}}*arguments(){yield this.value;yield*this.branches.flatMap((e=>e.values))}*children(){const e=this.branches.flatMap((e=>e.templates));if(this.elseTemplates){e.push(...this.elseTemplates)}return e}}class CommentTag extends Tag{constructor(e,t,i){super(e,t,i);while(t.length){const e=t.shift();if(isTagToken(e)&&e.name==="endcomment")return}throw new Error(`tag ${e.getText()} not closed`)}render(){}}class RenderTag extends Tag{constructor(e,t,i,s){super(e,t,i);const r=this.tokenizer;this.file=parseFilePath(r,this.liquid,s);this.currentFile=e.file;while(!r.end()){r.skipBlank();const e=r.p;const t=r.readIdentifier();if(t.content==="with"||t.content==="for"){r.skipBlank();if(r.peek()!==":"){const e=r.readValue();if(e){const i=r.p;const s=r.readIdentifier();let n;if(s.content==="as")n=r.readIdentifier();else r.p=i;this[t.content]={value:e,alias:n&&n.content};r.skipBlank();if(r.peek()===",")r.advance();continue}}}r.p=e;break}this.hash=new Hash(r,i.options.keyValueSeparator)}*render(e,t){const{liquid:i,hash:s}=this;const r=yield renderFilePath(this["file"],e,i);assert(r,(()=>`illegal file path "${r}"`));const n=e.spawn();const o=n.bottom();__assign(o,yield s.render(e));if(this["with"]){const{value:t,alias:i}=this["with"];o[i||r]=yield evalToken(t,e)}if(this["for"]){const{value:s,alias:a}=this["for"];const l=toEnumerable(yield evalToken(s,e));o["forloop"]=new ForloopDrop(l.length,s.getText(),a);for(const e of l){o[a]=e;const s=yield i._parsePartialFile(r,n.sync,this["currentFile"]);yield i.renderer.renderTemplates(s,n,t);o["forloop"].next()}}else{const e=yield i._parsePartialFile(r,n.sync,this["currentFile"]);yield i.renderer.renderTemplates(e,n,t)}}*children(e,t){if(e&&isString(this["file"])){return yield this.liquid._parsePartialFile(this["file"],t,this["currentFile"])}return[]}partialScope(){if(isString(this["file"])){const e=Object.keys(this.hash.hash);if(this["with"]){const{value:t,alias:i}=this["with"];if(isString(i)){e.push([i,t])}else if(isString(this.file)){e.push([this.file,t])}}if(this["for"]){const{value:t,alias:i}=this["for"];if(isString(i)){e.push([i,t])}else if(isString(this.file)){e.push([this.file,t])}}return{name:this["file"],isolated:true,scope:e}}}*arguments(){for(const e of Object.values(this.hash.hash)){if(isValueToken(e)){yield e}}if(this["with"]){const{value:e}=this["with"];if(isValueToken(e)){yield e}}if(this["for"]){const{value:e}=this["for"];if(isValueToken(e)){yield e}}}}function parseFilePath(e,t,i){if(t.options.dynamicPartials){const t=e.readValue();e.assert(t,"illegal file path");if(t.getText()==="none")return;if(isQuotedToken(t)){const e=i.parse(evalQuotedToken(t));return optimize(e)}return t}const s=[...e.readFileNameTemplate(t.options)];const r=optimize(i.parseTokens(s));return r==="none"?undefined:r}function optimize(e){if(e.length===1&&isHTMLToken(e[0].token))return e[0].token.getContent();return e}function*renderFilePath(e,t,i){if(typeof e==="string")return e;if(Array.isArray(e))return i.renderer.renderTemplates(e,t);return yield evalToken(e,t)}class IncludeTag extends Tag{constructor(e,t,i,s){super(e,t,i);const{tokenizer:r}=e;this["file"]=parseFilePath(r,this.liquid,s);this["currentFile"]=e.file;const n=r.p;const o=r.readIdentifier();if(o.content==="with"){r.skipBlank();if(r.peek()!==":"){this.withVar=r.readValue()}else r.p=n}else r.p=n;this.hash=new Hash(r,i.options.jekyllInclude||i.options.keyValueSeparator)}*render(e,t){const{liquid:i,hash:s,withVar:r}=this;const{renderer:n}=i;const o=yield renderFilePath(this["file"],e,i);assert(o,(()=>`illegal file path "${o}"`));const a=e.saveRegister("blocks","blockMode");e.setRegister("blocks",{});e.setRegister("blockMode",J.OUTPUT);const l=yield s.render(e);if(r)l[o]=yield evalToken(r,e);const c=yield i._parsePartialFile(o,e.sync,this["currentFile"]);e.push(e.opts.jekyllInclude?{include:l}:l);yield n.renderTemplates(c,e,t);e.pop();e.restoreRegister(a)}*children(e,t){if(e&&isString(this["file"])){return yield this.liquid._parsePartialFile(this["file"],t,this["currentFile"])}return[]}partialScope(){if(isString(this["file"])){let e;if(this.liquid.options.jekyllInclude){e=["include"]}else{e=Object.keys(this.hash.hash);if(this.withVar){e.push([this["file"],this.withVar])}}return{name:this["file"],isolated:false,scope:e}}}*arguments(){yield*Object.values(this.hash.hash).filter(isValueToken);if(isValueToken(this["file"])){yield this["file"]}if(isValueToken(this.withVar)){yield this.withVar}}}class DecrementTag extends Tag{constructor(e,t,i){super(e,t,i);this.identifier=this.tokenizer.readIdentifier();this.variable=this.identifier.content}render(e,t){const i=e.environments;if(!isNumber(i[this.variable])){i[this.variable]=0}t.write(stringify(--i[this.variable]))}*localScope(){yield this.identifier}}class CycleTag extends Tag{constructor(e,t,i){super(e,t,i);this.candidates=[];const s=this.tokenizer.readValue();this.tokenizer.skipBlank();if(s){if(this.tokenizer.peek()===":"){this.group=s;this.tokenizer.advance()}else this.candidates.push(s)}while(!this.tokenizer.end()){const e=this.tokenizer.readValue();if(e)this.candidates.push(e);this.tokenizer.readTo(",")}this.tokenizer.assert(this.candidates.length,(()=>`empty candidates: "${e.getText()}"`))}*render(e,t){const i=yield evalToken(this.group,e);const s=`cycle:${i}:`+this.candidates.join(",");const r=e.getRegister("cycle");let n=r[s];if(n===undefined){n=r[s]=0}const o=this.candidates[n];n=(n+1)%this.candidates.length;r[s]=n;return yield evalToken(o,e)}*arguments(){yield*this.candidates;if(this.group){yield this.group}}}class IfTag extends Tag{constructor(e,t,i,s){super(e,t,i);this.branches=[];let r=[];s.parseStream(t).on("start",(()=>this.branches.push({value:new Value(e.tokenizer.readFilteredValue(),this.liquid),templates:r=[]}))).on("tag:elsif",(e=>{assert(!this.elseTemplates,"unexpected elsif after else");this.branches.push({value:new Value(e.tokenizer.readFilteredValue(),this.liquid),templates:r=[]})})).on("tag:else",(e=>{assertEmpty(e.args);assert(!this.elseTemplates,"duplicated else");r=this.elseTemplates=[]})).on("tag:endif",(function(e){assertEmpty(e.args);this.stop()})).on("template",(e=>r.push(e))).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)})).start()}*render(e,t){const i=this.liquid.renderer;for(const{value:s,templates:r}of this.branches){const n=yield s.value(e,e.opts.lenientIf);if(isTruthy(n,e)){yield i.renderTemplates(r,e,t);return}}yield i.renderTemplates(this.elseTemplates||[],e,t)}*children(){const e=this.branches.flatMap((e=>e.templates));if(this.elseTemplates){e.push(...this.elseTemplates)}return e}arguments(){return this.branches.map((e=>e.value))}}class IncrementTag extends Tag{constructor(e,t,i){super(e,t,i);this.identifier=this.tokenizer.readIdentifier();this.variable=this.identifier.content}render(e,t){const i=e.environments;if(!isNumber(i[this.variable])){i[this.variable]=0}const s=i[this.variable];i[this.variable]++;t.write(stringify(s))}*localScope(){yield this.identifier}}class LayoutTag extends Tag{constructor(e,t,i,s){super(e,t,i);this.file=parseFilePath(this.tokenizer,this.liquid,s);this["currentFile"]=e.file;this.args=new Hash(this.tokenizer,i.options.keyValueSeparator);this.templates=s.parseTokens(t)}*render(e,t){const{liquid:i,args:s,file:r}=this;const{renderer:n}=i;if(r===undefined){e.setRegister("blockMode",J.OUTPUT);yield n.renderTemplates(this.templates,e,t);return}const o=yield renderFilePath(this.file,e,i);assert(o,(()=>`illegal file path "${o}"`));const a=yield i._parseLayoutFile(o,e.sync,this["currentFile"]);e.setRegister("blockMode",J.STORE);const l=yield n.renderTemplates(this.templates,e);const c=e.getRegister("blocks");if(c[""]===undefined)c[""]=(e,t)=>t.write(l);e.setRegister("blockMode",J.OUTPUT);e.push(yield s.render(e));yield n.renderTemplates(a,e,t);e.pop()}*children(e){const t=this.templates.slice();if(e&&isString(this.file)){t.push(...yield this.liquid._parsePartialFile(this.file,true,this["currentFile"]))}return t}*arguments(){for(const e of Object.values(this.args.hash)){if(isValueToken(e)){yield e}}if(isValueToken(this.file)){yield this.file}}partialScope(){if(isString(this.file)){return{name:this.file,isolated:false,scope:Object.keys(this.args.hash)}}}}class BlockTag extends Tag{constructor(e,t,i,s){super(e,t,i);this.templates=[];const r=/\w+/.exec(e.args);this.block=r?r[0]:"";while(t.length){const e=t.shift();if(isTagToken(e)&&e.name==="endblock")return;const i=s.parseToken(e,t);this.templates.push(i)}throw new Error(`tag ${e.getText()} not closed`)}*render(e,t){const i=this.getBlockRender(e);if(e.getRegister("blockMode")===J.STORE){e.getRegister("blocks")[this.block]=i}else{yield i(new BlockDrop,t)}}getBlockRender(e){const{liquid:t,templates:i}=this;const s=e.getRegister("blocks")[this.block];const renderCurrent=function*(s,r){e.push({block:s});yield t.renderer.renderTemplates(i,e,r);e.pop()};return s?(e,t)=>s(new BlockDrop((t=>renderCurrent(e,t))),t):renderCurrent}*children(){return this.templates}blockScope(){return["block"]}}class RawTag extends Tag{constructor(e,t,i){super(e,t,i);this.tokens=[];while(t.length){const e=t.shift();if(isTagToken(e)&&e.name==="endraw")return;this.tokens.push(e)}throw new Error(`tag ${e.getText()} not closed`)}render(){return this.tokens.map((e=>e.getText())).join("")}}class TablerowloopDrop extends ForloopDrop{constructor(e,t,i,s){super(e,i,s);this.length=e;this.cols=t}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return this.col0()===0}col_last(){return this.col()===this.cols}}class TablerowTag extends Tag{constructor(e,t,i,s){super(e,t,i);const r=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();const n=this.tokenizer.readIdentifier();const o=this.tokenizer.readValue();if(n.content!=="in"||!o){throw new Error(`illegal tag: ${e.getText()}`)}this.variable=r.content;this.collection=o;this.args=new Hash(this.tokenizer,i.options.keyValueSeparator);this.templates=[];let a;const l=s.parseStream(t).on("start",(()=>a=this.templates)).on("tag:endtablerow",(()=>l.stop())).on("template",(e=>a.push(e))).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)}));l.start()}*render(e,t){let i=toEnumerable(yield evalToken(this.collection,e));const s=yield this.args.render(e);const r=s.offset||0;const n=s.limit===undefined?i.length:s.limit;i=i.slice(r,r+n);const o=s.cols||i.length;const a=this.liquid.renderer;const l=new TablerowloopDrop(i.length,o,this.collection.getText(),this.variable);const c={tablerowloop:l};e.push(c);for(let s=0;s<i.length;s++,l.next()){c[this.variable]=i[s];if(l.col0()===0){if(l.row()!==1)t.write("</tr>");t.write(`<tr class="row${l.row()}">`)}t.write(`<td class="col${l.col()}">`);yield a.renderTemplates(this.templates,e,t);t.write("</td>")}if(i.length)t.write("</tr>");e.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(const e of Object.values(this.args.hash)){if(isValueToken(e)){yield e}}}blockScope(){return[this.variable,"tablerowloop"]}}class UnlessTag extends Tag{constructor(e,t,i,s){super(e,t,i);this.branches=[];this.elseTemplates=[];let r=[];let n=0;s.parseStream(t).on("start",(()=>this.branches.push({value:new Value(e.tokenizer.readFilteredValue(),this.liquid),test:isFalsy,templates:r=[]}))).on("tag:elsif",(e=>{if(n>0){r=[];return}this.branches.push({value:new Value(e.tokenizer.readFilteredValue(),this.liquid),test:isTruthy,templates:r=[]})})).on("tag:else",(()=>{n++;r=this.elseTemplates})).on("tag:endunless",(function(){this.stop()})).on("template",(e=>{if(r!==this.elseTemplates||n===1){r.push(e)}})).on("end",(()=>{throw new Error(`tag ${e.getText()} not closed`)})).start()}*render(e,t){const i=this.liquid.renderer;for(const{value:s,test:r,templates:n}of this.branches){const o=yield s.value(e,e.opts.lenientIf);if(r(o,e)){yield i.renderTemplates(n,e,t);return}}yield i.renderTemplates(this.elseTemplates,e,t)}*children(){const e=this.branches.flatMap((e=>e.templates));if(this.elseTemplates){e.push(...this.elseTemplates)}return e}arguments(){return this.branches.map((e=>e.value))}}class BreakTag extends Tag{render(e,t){e.breakCalled=true}}class ContinueTag extends Tag{render(e,t){e.continueCalled=true}}class EchoTag extends Tag{constructor(e,t,i){super(e,t,i);this.tokenizer.skipBlank();if(!this.tokenizer.end()){this.value=new Value(this.tokenizer.readFilteredValue(),this.liquid)}}*render(e,t){if(!this.value)return;const i=yield this.value.value(e,false);t.write(i)}*arguments(){if(this.value){yield this.value}}}class LiquidTag extends Tag{constructor(e,t,i,s){super(e,t,i);const r=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=s.parseTokens(r)}*render(e,t){yield this.liquid.renderer.renderTemplates(this.templates,e,t)}*children(){return this.templates}}class InlineCommentTag extends Tag{constructor(e,t,i){super(e,t,i);if(e.args.search(/\n\s*[^#\s]/g)!==-1){throw new Error("every line of an inline comment must start with a '#' character")}}render(){}}const xe={assign:AssignTag,for:ForTag,capture:CaptureTag,case:CaseTag,comment:CommentTag,include:IncludeTag,render:RenderTag,decrement:DecrementTag,increment:IncrementTag,cycle:CycleTag,if:IfTag,layout:LayoutTag,block:BlockTag,raw:RawTag,tablerow:TablerowTag,unless:UnlessTag,break:BreakTag,continue:ContinueTag,echo:EchoTag,liquid:LiquidTag,"#":InlineCommentTag};class Liquid{constructor(e={}){this.renderer=new Render;this.filters={};this.tags={};this.options=normalize(e);this.parser=new Parser(this);forOwn(xe,((e,t)=>this.registerTag(t,e)));forOwn(we,((e,t)=>this.registerFilter(t,e)))}parse(e,t){const i=new Parser(this);return i.parse(e,t)}_render(e,t,i){const s=t instanceof Context?t:new Context(t,this.options,i);return this.renderer.renderTemplates(e,s)}async render(e,t,i){return toPromise(this._render(e,t,{...i,sync:false}))}renderSync(e,t,i){return toValueSync(this._render(e,t,{...i,sync:true}))}renderToNodeStream(e,t,i={}){const s=new Context(t,this.options,i);return this.renderer.renderTemplatesToNodeStream(e,s)}_parseAndRender(e,t,i){const s=this.parse(e);return this._render(s,t,i)}async parseAndRender(e,t,i){return toPromise(this._parseAndRender(e,t,{...i,sync:false}))}parseAndRenderSync(e,t,i){return toValueSync(this._parseAndRender(e,t,{...i,sync:true}))}_parsePartialFile(e,t,i){return new Parser(this).parseFile(e,t,Y.Partials,i)}_parseLayoutFile(e,t,i){return new Parser(this).parseFile(e,t,Y.Layouts,i)}_parseFile(e,t,i,s){return new Parser(this).parseFile(e,t,i,s)}async parseFile(e,t){return toPromise(new Parser(this).parseFile(e,false,t))}parseFileSync(e,t){return toValueSync(new Parser(this).parseFile(e,true,t))}*_renderFile(e,t,i){const s=yield this._parseFile(e,i.sync,i.lookupType);return yield this._render(s,t,i)}async renderFile(e,t,i){return toPromise(this._renderFile(e,t,{...i,sync:false}))}renderFileSync(e,t,i){return toValueSync(this._renderFile(e,t,{...i,sync:true}))}async renderFileToNodeStream(e,t,i){const s=await this.parseFile(e);return this.renderToNodeStream(s,t,i)}_evalValue(e,t){const i=new Value(e,this);const s=t instanceof Context?t:new Context(t,this.options);return i.value(s)}async evalValue(e,t){return toPromise(this._evalValue(e,t))}evalValueSync(e,t){return toValueSync(this._evalValue(e,t))}registerFilter(e,t){this.filters[e]=t}registerTag(e,t){this.tags[e]=isFunction(t)?t:createTagClass(t)}plugin(e){return e.call(this,Liquid)}express(){const e=this;let t=true;return function(i,s,r){if(t){t=false;const i=normalizeDirectoryList(this.root);e.options.root.unshift(...i);e.options.layouts.unshift(...i);e.options.partials.unshift(...i)}e.renderFile(i,s).then((e=>r(null,e)),r)}}async analyze(e,t={}){return analyze(e,t)}analyzeSync(e,t={}){return analyzeSync(e,t)}async parseAndAnalyze(e,t,i={}){return analyze(this.parse(e,t),i)}parseAndAnalyzeSync(e,t,i={}){return analyzeSync(this.parse(e,t),i)}async variables(e,t={}){const i=await analyze(isString(e)?this.parse(e):e,t);return Object.keys(i.variables)}variablesSync(e,t={}){const i=analyzeSync(isString(e)?this.parse(e):e,t);return Object.keys(i.variables)}async fullVariables(e,t={}){const i=await analyze(isString(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(i.variables).flatMap((e=>e.map((e=>String(e)))))))}fullVariablesSync(e,t={}){const i=analyzeSync(isString(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(i.variables).flatMap((e=>e.map((e=>String(e)))))))}async variableSegments(e,t={}){const i=await analyze(isString(e)?this.parse(e):e,t);return Array.from(strictUniq(Object.values(i.variables).flatMap((e=>e.map((e=>e.toArray()))))))}variableSegmentsSync(e,t={}){const i=analyzeSync(isString(e)?this.parse(e):e,t);return Array.from(strictUniq(Object.values(i.variables).flatMap((e=>e.map((e=>e.toArray()))))))}async globalVariables(e,t={}){const i=await analyze(isString(e)?this.parse(e):e,t);return Object.keys(i.globals)}globalVariablesSync(e,t={}){const i=analyzeSync(isString(e)?this.parse(e):e,t);return Object.keys(i.globals)}async globalFullVariables(e,t={}){const i=await analyze(isString(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(i.globals).flatMap((e=>e.map((e=>String(e)))))))}globalFullVariablesSync(e,t={}){const i=analyzeSync(isString(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(i.globals).flatMap((e=>e.map((e=>String(e)))))))}async globalVariableSegments(e,t={}){const i=await analyze(isString(e)?this.parse(e):e,t);return Array.from(strictUniq(Object.values(i.globals).flatMap((e=>e.map((e=>e.toArray()))))))}globalVariableSegmentsSync(e,t={}){const i=analyzeSync(isString(e)?this.parse(e):e,t);return Array.from(strictUniq(Object.values(i.globals).flatMap((e=>e.map((e=>e.toArray()))))))}}const ve="10.23.0";t.AssertionError=AssertionError;t.AssignTag=AssignTag;t.BlockTag=BlockTag;t.BreakTag=BreakTag;t.CaptureTag=CaptureTag;t.CaseTag=CaseTag;t.CommentTag=CommentTag;t.Context=Context;t.ContinueTag=ContinueTag;t.CycleTag=CycleTag;t.DecrementTag=DecrementTag;t.Drop=Drop;t.EchoTag=EchoTag;t.Expression=Expression;t.Filter=Filter;t.ForTag=ForTag;t.Hash=Hash;t.IfTag=IfTag;t.IncludeTag=IncludeTag;t.IncrementTag=IncrementTag;t.InlineCommentTag=InlineCommentTag;t.LayoutTag=LayoutTag;t.Liquid=Liquid;t.LiquidError=LiquidError;t.LiquidTag=LiquidTag;t.Output=Output;t.ParseError=ParseError;t.ParseStream=ParseStream;t.Parser=Parser;t.RawTag=RawTag;t.RenderError=RenderError;t.RenderTag=RenderTag;t.TablerowTag=TablerowTag;t.Tag=Tag;t.TagToken=TagToken;t.Token=Token;t.TokenizationError=TokenizationError;t.Tokenizer=Tokenizer;t.TypeGuards=Q;t.UndefinedVariableError=UndefinedVariableError;t.UnlessTag=UnlessTag;t.Value=Value;t.Variable=Variable;t.analyze=analyze;t.analyzeSync=analyzeSync;t.assert=assert;t.createTrie=createTrie;t.defaultOperators=N;t.defaultOptions=U;t.evalQuotedToken=evalQuotedToken;t.evalToken=evalToken;t.filters=we;t.isFalsy=isFalsy;t.isTruthy=isTruthy;t.tags=xe;t.toPromise=toPromise;t.toValue=toValue;t.toValueSync=toValueSync;t.version=ve},147:e=>{e.exports=require("fs")},17:e=>{e.exports=require("path")},781:e=>{e.exports=require("stream")}};var t={};function __nccwpck_require__(i){var s=t[i];if(s!==undefined){return s.exports}var r=t[i]={exports:{}};var n=true;try{e[i](r,r.exports,__nccwpck_require__);n=false}finally{if(n)delete t[i]}return r.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(262);module.exports=i})();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Token, TopLevelToken } from '../tokens';
|
|
2
|
+
import { Template } from '../template';
|
|
3
|
+
type ParseToken<T extends Token> = ((token: T, remainTokens: T[]) => Template);
|
|
4
|
+
export declare class ParseStream<T extends Token = TopLevelToken> {
|
|
5
|
+
private tokens;
|
|
6
|
+
private handlers;
|
|
7
|
+
private stopRequested;
|
|
8
|
+
private parseToken;
|
|
9
|
+
constructor(tokens: T[], parseToken: ParseToken<T>);
|
|
10
|
+
on<T2 extends Template | T | undefined>(name: string, cb: (this: ParseStream, arg: T2) => void): ParseStream<T>;
|
|
11
|
+
private trigger;
|
|
12
|
+
start(): this;
|
|
13
|
+
stop(): this;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ParseStream } from './parse-stream';
|
|
2
|
+
import { TopLevelToken } from '../tokens';
|
|
3
|
+
import { Template, Output, HTML } from '../template';
|
|
4
|
+
import { LookupType } from '../fs';
|
|
5
|
+
import type { Liquid } from '../liquid';
|
|
6
|
+
export declare class Parser {
|
|
7
|
+
parseFile: (file: string, sync?: boolean, type?: LookupType, currentFile?: string) => Generator<unknown, Template[], Template[] | string>;
|
|
8
|
+
private liquid;
|
|
9
|
+
private fs;
|
|
10
|
+
private cache?;
|
|
11
|
+
private loader;
|
|
12
|
+
private parseLimit;
|
|
13
|
+
constructor(liquid: Liquid);
|
|
14
|
+
parse(html: string, filepath?: string): Template[];
|
|
15
|
+
parseTokens(tokens: TopLevelToken[]): Template[];
|
|
16
|
+
parseToken(token: TopLevelToken, remainTokens: TopLevelToken[]): import("../template").Tag | Output | HTML;
|
|
17
|
+
parseStream(tokens: TopLevelToken[]): ParseStream<TopLevelToken>;
|
|
18
|
+
private _parseFileCached;
|
|
19
|
+
private _parseFile;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum TokenKind {
|
|
2
|
+
Number = 1,
|
|
3
|
+
Literal = 2,
|
|
4
|
+
Tag = 4,
|
|
5
|
+
Output = 8,
|
|
6
|
+
HTML = 16,
|
|
7
|
+
Filter = 32,
|
|
8
|
+
Hash = 64,
|
|
9
|
+
PropertyAccess = 128,
|
|
10
|
+
Word = 256,
|
|
11
|
+
Range = 512,
|
|
12
|
+
Quoted = 1024,
|
|
13
|
+
Operator = 2048,
|
|
14
|
+
FilteredValue = 4096,
|
|
15
|
+
Delimited = 12
|
|
16
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FilteredValueToken, TagToken, HTMLToken, HashToken, QuotedToken, LiquidTagToken, OutputToken, ValueToken, Token, RangeToken, FilterToken, TopLevelToken, OperatorToken, LiteralToken, IdentifierToken, NumberToken } from '../tokens';
|
|
2
|
+
import { Trie, TokenizationError } from '../util';
|
|
3
|
+
import { Operators, Expression } from '../render';
|
|
4
|
+
import { NormalizedFullOptions } from '../liquid-options';
|
|
5
|
+
import { FilterArg } from './filter-arg';
|
|
6
|
+
export declare class Tokenizer {
|
|
7
|
+
input: string;
|
|
8
|
+
file?: string | undefined;
|
|
9
|
+
p: number;
|
|
10
|
+
N: number;
|
|
11
|
+
private rawBeginAt;
|
|
12
|
+
private opTrie;
|
|
13
|
+
private literalTrie;
|
|
14
|
+
constructor(input: string, operators?: Operators, file?: string | undefined, range?: [number, number]);
|
|
15
|
+
readExpression(): Expression;
|
|
16
|
+
readExpressionTokens(): IterableIterator<Token>;
|
|
17
|
+
readOperator(): OperatorToken | undefined;
|
|
18
|
+
matchTrie<T>(trie: Trie<T>): number;
|
|
19
|
+
readFilteredValue(): FilteredValueToken;
|
|
20
|
+
readFilters(): FilterToken[];
|
|
21
|
+
readFilter(): FilterToken | null;
|
|
22
|
+
readFilterArg(): FilterArg | undefined;
|
|
23
|
+
readTopLevelTokens(options?: NormalizedFullOptions): TopLevelToken[];
|
|
24
|
+
readTopLevelToken(options: NormalizedFullOptions): TopLevelToken;
|
|
25
|
+
readHTMLToken(stopStrings: string[]): HTMLToken;
|
|
26
|
+
readTagToken(options: NormalizedFullOptions): TagToken;
|
|
27
|
+
readToDelimiter(delimiter: string, respectQuoted?: boolean): number;
|
|
28
|
+
readOutputToken(options?: NormalizedFullOptions): OutputToken;
|
|
29
|
+
readEndrawOrRawContent(options: NormalizedFullOptions): HTMLToken | TagToken;
|
|
30
|
+
readLiquidTagTokens(options?: NormalizedFullOptions): LiquidTagToken[];
|
|
31
|
+
readLiquidTagToken(options: NormalizedFullOptions): LiquidTagToken | undefined;
|
|
32
|
+
error(msg: string, pos?: number): TokenizationError;
|
|
33
|
+
assert(pred: unknown, msg: string | (() => string), pos?: number): void;
|
|
34
|
+
snapshot(begin?: number): string;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated use #readIdentifier instead
|
|
37
|
+
*/
|
|
38
|
+
readWord(): IdentifierToken;
|
|
39
|
+
readIdentifier(): IdentifierToken;
|
|
40
|
+
readNonEmptyIdentifier(): IdentifierToken | undefined;
|
|
41
|
+
readTagName(): string;
|
|
42
|
+
readHashes(jekyllStyle?: boolean | string): HashToken[];
|
|
43
|
+
readHash(jekyllStyle?: boolean | string): HashToken | undefined;
|
|
44
|
+
remaining(): string;
|
|
45
|
+
advance(step?: number): void;
|
|
46
|
+
end(): boolean;
|
|
47
|
+
read(): string;
|
|
48
|
+
readTo(end: string): number;
|
|
49
|
+
readValue(): ValueToken | undefined;
|
|
50
|
+
readScopeValue(): ValueToken | undefined;
|
|
51
|
+
private readProperties;
|
|
52
|
+
readNumber(): NumberToken | undefined;
|
|
53
|
+
readLiteral(): LiteralToken | undefined;
|
|
54
|
+
readRange(): RangeToken | undefined;
|
|
55
|
+
readValueOrThrow(): ValueToken;
|
|
56
|
+
readQuoted(): QuotedToken | undefined;
|
|
57
|
+
readFileNameTemplate(options: NormalizedFullOptions): IterableIterator<TopLevelToken>;
|
|
58
|
+
match(word: string): boolean;
|
|
59
|
+
rmatch(pattern: string): boolean;
|
|
60
|
+
peekType(n?: number): number;
|
|
61
|
+
peek(n?: number): string;
|
|
62
|
+
skipBlank(): void;
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { QuotedToken, Token } from '../tokens';
|
|
2
|
+
import type { Context } from '../context';
|
|
3
|
+
export declare class Expression {
|
|
4
|
+
readonly postfix: Token[];
|
|
5
|
+
constructor(tokens: IterableIterator<Token>);
|
|
6
|
+
evaluate(ctx: Context, lenient?: boolean): Generator<unknown, unknown, unknown>;
|
|
7
|
+
valid(): boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function evalToken(token: Token | undefined, ctx: Context, lenient?: boolean): IterableIterator<unknown>;
|
|
10
|
+
export declare function evalQuotedToken(token: QuotedToken): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Context } from '../context';
|
|
2
|
+
export type UnaryOperatorHandler = (operand: any, ctx: Context) => boolean;
|
|
3
|
+
export type BinaryOperatorHandler = (lhs: any, rhs: any, ctx: Context) => boolean;
|
|
4
|
+
export type OperatorHandler = UnaryOperatorHandler | BinaryOperatorHandler;
|
|
5
|
+
export type Operators = Record<string, OperatorHandler>;
|
|
6
|
+
export declare const defaultOperators: Operators;
|
|
7
|
+
export declare function equals(lhs: any, rhs: any): boolean;
|
|
8
|
+
export declare function arrayIncludes(arr: any[], item: any): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Context } from '../context';
|
|
3
|
+
import { Template } from '../template';
|
|
4
|
+
import { Emitter } from '../emitters';
|
|
5
|
+
export declare class Render {
|
|
6
|
+
renderTemplatesToNodeStream(templates: Template[], ctx: Context): NodeJS.ReadableStream;
|
|
7
|
+
renderTemplates(templates: Template[], ctx: Context, emitter?: Emitter): IterableIterator<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseStringLiteral(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Liquid, TopLevelToken, TagToken, Context, Tag } from '..';
|
|
2
|
+
import { Arguments } from '../template';
|
|
3
|
+
import { IdentifierToken } from '../tokens';
|
|
4
|
+
export default class extends Tag {
|
|
5
|
+
private key;
|
|
6
|
+
private value;
|
|
7
|
+
private identifier;
|
|
8
|
+
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
|
|
9
|
+
render(ctx: Context): Generator<unknown, void, unknown>;
|
|
10
|
+
arguments(): Arguments;
|
|
11
|
+
localScope(): Iterable<IdentifierToken>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Liquid, TagToken, TopLevelToken, Template, Context, Emitter, Tag } from '..';
|
|
2
|
+
import { Parser } from '../parser';
|
|
3
|
+
export default class extends Tag {
|
|
4
|
+
block: string;
|
|
5
|
+
templates: Template[];
|
|
6
|
+
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
|
|
7
|
+
render(ctx: Context, emitter: Emitter): Generator<any, void, unknown>;
|
|
8
|
+
private getBlockRender;
|
|
9
|
+
children(): Generator<unknown, Template[]>;
|
|
10
|
+
blockScope(): Iterable<string>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Liquid, Tag, Template, Context, TagToken, TopLevelToken } from '..';
|
|
2
|
+
import { Parser } from '../parser';
|
|
3
|
+
import { IdentifierToken, QuotedToken } from '../tokens';
|
|
4
|
+
export default class extends Tag {
|
|
5
|
+
identifier: IdentifierToken | QuotedToken;
|
|
6
|
+
variable: string;
|
|
7
|
+
templates: Template[];
|
|
8
|
+
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
|
|
9
|
+
private readVariable;
|
|
10
|
+
render(ctx: Context): Generator<unknown, void, string>;
|
|
11
|
+
children(): Generator<unknown, Template[]>;
|
|
12
|
+
localScope(): Iterable<string | IdentifierToken | QuotedToken>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ValueToken, Liquid, Value, Emitter, TagToken, TopLevelToken, Context, Template, Tag } from '..';
|
|
2
|
+
import { Parser } from '../parser';
|
|
3
|
+
import { Arguments } from '../template';
|
|
4
|
+
export default class extends Tag {
|
|
5
|
+
value: Value;
|
|
6
|
+
branches: {
|
|
7
|
+
values: ValueToken[];
|
|
8
|
+
templates: Template[];
|
|
9
|
+
}[];
|
|
10
|
+
elseTemplates: Template[];
|
|
11
|
+
constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
|
|
12
|
+
render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
|
|
13
|
+
arguments(): Arguments;
|
|
14
|
+
children(): Generator<unknown, Template[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TopLevelToken, Liquid, Emitter, TagToken, Context, Tag } from '..';
|
|
2
|
+
import { Arguments } from '../template';
|
|
3
|
+
export default class extends Tag {
|
|
4
|
+
private candidates;
|
|
5
|
+
private group?;
|
|
6
|
+
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
|
|
7
|
+
render(ctx: Context, emitter: Emitter): Generator<unknown, unknown, unknown>;
|
|
8
|
+
arguments(): Arguments;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..';
|
|
2
|
+
import { IdentifierToken } from '../tokens';
|
|
3
|
+
export default class extends Tag {
|
|
4
|
+
private identifier;
|
|
5
|
+
private variable;
|
|
6
|
+
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
|
|
7
|
+
render(context: Context, emitter: Emitter): void;
|
|
8
|
+
localScope(): Iterable<string | IdentifierToken>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Liquid, TopLevelToken, Emitter, TagToken, Context, Tag } from '..';
|
|
2
|
+
import { Arguments } from '../template';
|
|
3
|
+
export default class extends Tag {
|
|
4
|
+
private value?;
|
|
5
|
+
constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
|
|
6
|
+
render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
|
|
7
|
+
arguments(): Arguments;
|
|
8
|
+
}
|