@kosatyi/ejs 0.0.85 → 0.0.87

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/bin/bundler.js CHANGED
@@ -8,7 +8,6 @@ const schema = argv(process.argv.slice(2))
8
8
 
9
9
  const params = schema({
10
10
  target: null,
11
- minify: false,
12
11
  umd: false,
13
12
  withObject: false,
14
13
  export: 'ejsPrecompiled',
@@ -333,7 +333,7 @@ function Compiler(config) {
333
333
  var params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
334
334
  try {
335
335
  result = Function.apply(null, params.concat(source));
336
- result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n})");
336
+ result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n});");
337
337
  } catch (e) {
338
338
  e.filename = path;
339
339
  e.source = source;
@@ -4,7 +4,6 @@ var fs = require('fs');
4
4
  var glob = require('glob');
5
5
  var watch = require('glob-watcher');
6
6
  var path = require('path');
7
- var terser = require('terser');
8
7
  var index_js = require('./index.js');
9
8
 
10
9
  const isPlainObject = function(obj) {
@@ -45,8 +44,9 @@ class Bundler {
45
44
  return index_js.compile(content, name).source
46
45
  }
47
46
 
48
- stageWrapper(content){
47
+ getBundle() {
49
48
  const umd = this.options.umd;
49
+ const strict = this.config.withObject === false;
50
50
  const module = this.config.export;
51
51
  const out = [];
52
52
  if (umd) {
@@ -58,35 +58,18 @@ class Bundler {
58
58
  out.push(`global || self,global["${module}"] = factory())`);
59
59
  out.push('})(this,(function(){');
60
60
  }
61
- out.push(content);
62
- if (umd) {
63
- out.push('return templates}))');
64
- } else {
65
- out.push('export default templates');
66
- }
67
- return out.join('')
68
- }
69
- async stageMinify(content) {
70
- if (this.options.minify === false) return content
71
- const config = {
72
- compress: {
73
- dead_code: false,
74
- side_effects: false
75
- }
76
- };
77
- const response = await terser.minify(content, config);
78
- return response.code
79
- }
80
-
81
- getBundle() {
82
- const out = [];
83
- if (this.config.withObject === false) out.push(`'use strict'`);
61
+ if (strict) out.push(`'use strict'`);
84
62
  out.push('const templates = {}');
85
63
  Object.entries(this.templates).forEach(([name, content]) => {
86
64
  name = JSON.stringify(name);
87
65
  content = String(content);
88
66
  out.push(`templates[${name}] = ${content}`);
89
67
  });
68
+ if (umd) {
69
+ out.push('return templates}))');
70
+ } else {
71
+ out.push('export default templates');
72
+ }
90
73
  return out.join('\n')
91
74
  }
92
75
  async watch() {
@@ -132,11 +115,7 @@ class Bundler {
132
115
 
133
116
  async output() {
134
117
  const target = [].concat(this.options.target);
135
- let content = this.getBundle();
136
- if (this.options.minify) {
137
- content = await this.stageMinify(content);
138
- }
139
- content = this.stageWrapper(content);
118
+ const content = this.getBundle();
140
119
  for (let file of target) {
141
120
  const folderPath = path.dirname(file);
142
121
  const folderExists = await fs.promises
package/dist/cjs/index.js CHANGED
@@ -336,7 +336,7 @@ function Compiler(config) {
336
336
  var params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
337
337
  try {
338
338
  result = Function.apply(null, params.concat(source));
339
- result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n})");
339
+ result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n});");
340
340
  } catch (e) {
341
341
  e.filename = path;
342
342
  e.source = source;
@@ -677,7 +677,7 @@ function Compiler(config) {
677
677
  var params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
678
678
  try {
679
679
  result = Function.apply(null, params.concat(source));
680
- result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n})");
680
+ result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n});");
681
681
  } catch (e) {
682
682
  e.filename = path;
683
683
  e.source = source;
@@ -398,7 +398,7 @@ function Compiler(config) {
398
398
  let params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
399
399
  try {
400
400
  result = Function.apply(null, params.concat(source));
401
- result.source = `(function(${params.join(',')}){\n${source}\n})`;
401
+ result.source = `(function(${params.join(',')}){\n${source}\n});`;
402
402
  } catch (e) {
403
403
  e.filename = path;
404
404
  e.source = source;
@@ -2,7 +2,6 @@ import { promises } from 'fs';
2
2
  import { glob } from 'glob';
3
3
  import watch from 'glob-watcher';
4
4
  import { join, dirname } from 'path';
5
- import { minify } from 'terser';
6
5
  import { configure, compile } from './index.js';
7
6
 
8
7
  const isPlainObject = function(obj) {
@@ -43,8 +42,9 @@ class Bundler {
43
42
  return compile(content, name).source
44
43
  }
45
44
 
46
- stageWrapper(content){
45
+ getBundle() {
47
46
  const umd = this.options.umd;
47
+ const strict = this.config.withObject === false;
48
48
  const module = this.config.export;
49
49
  const out = [];
50
50
  if (umd) {
@@ -56,35 +56,18 @@ class Bundler {
56
56
  out.push(`global || self,global["${module}"] = factory())`);
57
57
  out.push('})(this,(function(){');
58
58
  }
59
- out.push(content);
60
- if (umd) {
61
- out.push('return templates}))');
62
- } else {
63
- out.push('export default templates');
64
- }
65
- return out.join('')
66
- }
67
- async stageMinify(content) {
68
- if (this.options.minify === false) return content
69
- const config = {
70
- compress: {
71
- dead_code: false,
72
- side_effects: false
73
- }
74
- };
75
- const response = await minify(content, config);
76
- return response.code
77
- }
78
-
79
- getBundle() {
80
- const out = [];
81
- if (this.config.withObject === false) out.push(`'use strict'`);
59
+ if (strict) out.push(`'use strict'`);
82
60
  out.push('const templates = {}');
83
61
  Object.entries(this.templates).forEach(([name, content]) => {
84
62
  name = JSON.stringify(name);
85
63
  content = String(content);
86
64
  out.push(`templates[${name}] = ${content}`);
87
65
  });
66
+ if (umd) {
67
+ out.push('return templates}))');
68
+ } else {
69
+ out.push('export default templates');
70
+ }
88
71
  return out.join('\n')
89
72
  }
90
73
  async watch() {
@@ -130,11 +113,7 @@ class Bundler {
130
113
 
131
114
  async output() {
132
115
  const target = [].concat(this.options.target);
133
- let content = this.getBundle();
134
- if (this.options.minify) {
135
- content = await this.stageMinify(content);
136
- }
137
- content = this.stageWrapper(content);
116
+ const content = this.getBundle();
138
117
  for (let file of target) {
139
118
  const folderPath = dirname(file);
140
119
  const folderExists = await promises
package/dist/esm/index.js CHANGED
@@ -401,7 +401,7 @@ function Compiler(config) {
401
401
  let params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
402
402
  try {
403
403
  result = Function.apply(null, params.concat(source));
404
- result.source = `(function(${params.join(',')}){\n${source}\n})`;
404
+ result.source = `(function(${params.join(',')}){\n${source}\n});`;
405
405
  } catch (e) {
406
406
  e.filename = path;
407
407
  e.source = source;
@@ -392,7 +392,7 @@ function Compiler(config) {
392
392
  let params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
393
393
  try {
394
394
  result = Function.apply(null, params.concat(source));
395
- result.source = `(function(${params.join(',')}){\n${source}\n})`;
395
+ result.source = `(function(${params.join(',')}){\n${source}\n});`;
396
396
  } catch (e) {
397
397
  e.filename = path;
398
398
  e.source = source;
@@ -337,7 +337,7 @@
337
337
  var params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
338
338
  try {
339
339
  result = Function.apply(null, params.concat(source));
340
- result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n})");
340
+ result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n});");
341
341
  } catch (e) {
342
342
  e.filename = path;
343
343
  e.source = source;
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ejs={})}(this,(function(e){"use strict";var t=function(){var e=[].slice.call(arguments),t=e.shift();return e.filter(t).pop()},n=function(e){return Array.isArray(e)},r=function(e){return"function"==typeof e},i=function(e){return"string"==typeof e},o=function(e){return"boolean"==typeof e},u=function(e){return void 0===e},c="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},s=function(e){return new RegExp(["[",Object.keys(e).join(""),"]"].join(""),"g")},f=s(l),h=s(a),p=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(f,(function(e){return l[e]}))},b=function(e,t){var n=e;return null==n?"":!0===t?p(n):n},g=function(e,t){return Boolean(e instanceof t)},v=function(e,t,n){for(var i=e,o=String(t).split("."),u=o.pop(),c=0;c<o.length;c++){var a=o[c];if(r(i.toJSON)&&(i=i.toJSON()),n&&!1===i.hasOwnProperty(a)){i={};break}i=i[a]=i[a]||{}}return r(i.toJSON)&&(i=i.toJSON()),[i,u]},m=function(e,t){var n=e.split(".").pop();return n!==t&&(e=[e,t].join(".")),e},d=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.filter((function(e){return e})).reduce((function(e,t){return Object.assign(e,t)}),e)},w=function(){},y=function(e,t){var n;for(n in e)O(e,n)&&t(e[n],n,e)},j=function(e,t){return function(e,t){var n=e instanceof Array,r=n?[]:{};return y(e,(function(e,i,o){var c=t(e,i,o);!1===u(c)&&(n?r.push(c):r[i]=c)})),r}(e,(function(e,n){if(-1===t.indexOf(n))return e}))},E=function(e,t,n){return Promise.resolve(e).then(t.bind(n))},O=function(e,t){return e&&e.hasOwnProperty(t)},x={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(e,t){return Promise.resolve(["resolver is not defined",e,t].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},k=function(e,u){d(e,{path:t(i,x.path,e.path,u.path),export:t(i,x.export,e.export,u.export),resolver:t(r,x.resolver,e.resolver,u.resolver),extension:t(i,x.extension,e.extension,u.extension),withObject:t(o,x.withObject,e.withObject,u.withObject),rmWhitespace:t(o,x.rmWhitespace,e.rmWhitespace,u.rmWhitespace),cache:t(o,x.cache,e.cache,u.cache),token:d({},x.token,e.token,u.token),vars:d({},x.vars,e.vars,u.vars),globalHelpers:t(n,x.globalHelpers,e.globalHelpers,u.globalHelpers)})},F="undefined"!=typeof globalThis?globalThis:window||self;function P(e){if(!1===g(this,P))return new P;var t={enabled:!0,list:{}};this.configure=function(e){t.enabled=e.cache,!1===c&&this.load(F[e.export])},this.clear=function(){t.list={}},this.load=function(e){return t.enabled&&d(t.list,e||{}),this},this.get=function(e){if(t.enabled)return t.list[e]},this.set=function(e,n){return t.enabled&&(t.list[e]=n),this},this.resolve=function(e){return Promise.resolve(this.get(e))},this.remove=function(e){delete t.list[e]},this.exist=function(e){return O(t.list,e)}}var S=[{symbol:"-",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(e){return"')\n/**".concat(e,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(e){return"')\n".concat(e.trim(),"\n").concat(this.BUFFER,"('")}}];function B(e){if(!1===g(this,B))return new B(e);var t={};this.configure=function(e){t.withObject=e.withObject,t.rmWhitespace=e.rmWhitespace,t.token=e.token,t.vars=e.vars,t.globalHelpers=e.globalHelpers,t.matches=[],t.formats=[],t.slurp={match:"[ \\t]*",start:[t.token.start,"_"],end:["_",t.token.end]},S.forEach((function(e){t.matches.push(t.token.start.concat(e.symbol).concat(t.token.regex).concat(t.token.end)),t.formats.push(e.format.bind(t.vars))})),t.regex=new RegExp(t.matches.join("|").concat("|$"),"g"),t.slurpStart=new RegExp([t.slurp.match,t.slurp.start.join("")].join(""),"gm"),t.slurpEnd=new RegExp([t.slurp.end.join(""),t.slurp.match].join(""),"gm")},this.compile=function(e,n){var r=t.vars,i=r.SCOPE,o=r.SAFE,u=r.BUFFER,c=r.COMPONENT,l=t.globalHelpers;e=String(e),t.rmWhitespace&&(e=e.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),e=e.replace(t.slurpStart,t.token.start).replace(t.slurpEnd,t.token.end);var s,f,p,b="".concat(u,"('");s=t.regex,f=function(n,r,i){b+=(""+e.slice(r,i)).replace(h,(function(e){return"\\"+a[e]})),n.forEach((function(e,n){e&&(b+=t.formats[n](e))}))},p=0,e.replace(s,(function(){var e=[].slice.call(arguments,0,-1),t=e.pop(),n=e.shift();return f(e,p,t),p=t+n.length,n})),b="try{".concat(b+="');","}catch(e){return ").concat(u,".error(e)}"),t.withObject&&(b="with(".concat(i,"){").concat(b,"}")),b="".concat(u,".start();").concat(b,"return ").concat(u,".end();"),b+="\n//# sourceURL=".concat(n);var g=null,v=[i,c,u,o].concat(l);try{(g=Function.apply(null,v.concat(b))).source="(function(".concat(v.join(","),"){\n").concat(b,"\n})")}catch(e){throw e.filename=n,e.source=b,e}return g},this.configure(e)}function T(e,t,n){if(!1===g(this,T))return new T(e,t,n);if(!1===g(t,P))throw new TypeError("cache is not instance of Cache");if(!1===g(n,B))throw new TypeError("compiler is not instance of Compiler");var i={},o=function(e){return i.resolver(i.path,e)};this.configure=function(e){i.path=e.path,i.cache=e.cache,r(e.resolver)&&(i.resolver=e.resolver)},this.get=function(e){return t.exist(e)?t.resolve(e):o(e).then((function(i){return function(e,n){return t.set(e,n),n}(e,function(e,t){return r(e)?e:n.compile(e,t)}(i,e))}))},this.configure(e)}function R(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],$=" ",A='"',C="/",U="<",M=">",H=function(e,t,n){var r=[],i=-1===N.indexOf(e),o=function(e,t){var n=[];return y(e,(function(e,r,i){var o=t(e,r,i);!1===u(o)&&n.push(o)})),n}(t,(function(e,t){if(null!=e)return[p(t),[A,p(e),A].join("")].join("=")})).join($);return r.push([U,e,$,o,M].join("")),n&&r.push(n instanceof Array?n.join(""):n),i&&r.push([U,C,e,M].join("")),r.join("")};function L(e){this.code=1,this.name="TemplateError",this.message=e,Error.call(this)}function W(e){L.call(this),this.code=404,this.name="TemplateNotFound",this.message=e}function J(e){L.call(this),this.code=500,this.name="TemplateSyntaxError",this.message=e}function q(e){return Promise.all(e||[]).then((function(e){return e.join("")}))}function D(){var e=[],t=[];function n(e){t.push(e)}return n.start=function(){t=[]},n.backup=function(){e.push(t.concat()),t=[]},n.restore=function(){var n=t.concat();return t=e.pop(),q(n)},n.error=function(e){return t=e,Promise.reject(new J(t.message));var t},n.end=function(){return q(t)},n}function K(e){if(!1===g(this,K))return new K(e);this.configure=function(e,t){var n,o=e.vars,u=o.BLOCKS,c=o.MACRO,a=o.EXTEND,l=o.LAYOUT,s=o.BUFFER,f=o.COMPONENT;function h(e){this[u]={},this[c]={},d(this,e||{})}this.create=function(e){return new h(e)},this.helpers=function(e){d(h.prototype,e||{})},h.prototype=d({},t||{}),Object.defineProperties(h.prototype,(R(R(R(R(R(R(R(R(R(R(n={},s,{value:D(),writable:!0,configurable:!1,enumerable:!1}),u,{value:{},writable:!0,configurable:!1,enumerable:!1}),c,{value:{},writable:!0,configurable:!1,enumerable:!1}),l,{value:!1,writable:!0,configurable:!1,enumerable:!1}),a,{value:!1,writable:!0,configurable:!1,enumerable:!1}),"getMacro",{value:function(){return this[c]},writable:!1,configurable:!1,enumerable:!1}),"getBuffer",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),"getComponent",{value:function(){var e=this;return f in e?function(){return e[f].apply(e,arguments)}:function(){console.log("%s function not defined",f)}},writable:!1,configurable:!1,enumerable:!1}),"getBlocks",{value:function(){return this[u]},writable:!1,configurable:!1,enumerable:!1}),"setExtend",{value:function(e){this[a]=e},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(R(n,"getExtend",{value:function(){return this[a]},writable:!1,configurable:!1,enumerable:!1}),"setLayout",{value:function(e){this[l]=e},writable:!1,configurable:!1,enumerable:!1}),"getLayout",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),"clone",{value:function(e){var t=[l,a,s];return!0===e&&t.push(u),j(this,t)},writable:!1,configurable:!1,enumerable:!1}),"extend",{value:function(e){this.setExtend(!0),this.setLayout(e)},writable:!1,configurable:!1,enumerable:!1}),"echo",{value:function(e){var t=this.getBuffer();[].slice.call(arguments).forEach(t)},writable:!1,configurable:!1,enumerable:!1}),"fn",{value:function(e){var t=this.getBuffer(),n=this;return function(){return t.backup(),r(e)&&e.apply(n,arguments),t.restore()}},writable:!1,configurable:!1,enumerable:!1}),"get",{value:function(e,t){var n=v(this,e,!0),r=n.shift(),i=n.pop();return O(r,i)?r[i]:t},writable:!0,configurable:!0,enumerable:!1}),"set",{value:function(e,t){var n=v(this,e,!1),r=n.shift(),i=n.pop();return this.getExtend()&&O(r,i)?r[i]:r[i]=t},writable:!1,configurable:!1,enumerable:!1}),"macro",{value:function(e,t){var n=this.getMacro(),r=this.fn(t),i=this;n[e]=function(){return i.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(n,"call",{value:function(e){var t=this.getMacro()[e],n=[].slice.call(arguments,1);if(r(t))return t.apply(t,n)},writable:!1,configurable:!1,enumerable:!1}),"block",{value:function(e,t){var n=this,r=this.getBlocks();if(r[e]=r[e]||[],r[e].push(this.fn(t)),!this.getExtend()){var i=Object.assign([],r[e]),o=function(){return i.shift()},u=function(){var e=o();return e?function(){n.echo(e(u()))}:w};this.echo(o()(u()))}},writable:!1,configurable:!1,enumerable:!1}),"hasBlock",{value:function(e){return this.getBlocks().hasOwnProperty(e)},writable:!1,configurable:!1,enumerable:!1}),"include",{value:function(e,t,n){var r=!1===n?{}:this.clone(!0),i=d(r,t||{}),o=this.render(e,i);this.echo(o)},writable:!1,configurable:!1,enumerable:!1}),"use",{value:function(e,t){var n=this.require(e);this.echo(E(n,(function(e){var n=this.getMacro();y(e,(function(e,r){n[[t,r].join(".")]=e}))}),this))},writable:!1,configurable:!1,enumerable:!1}),"async",{value:function(e,t){this.echo(E(e,(function(e){return this.fn(t)(e)}),this))},writable:!1,configurable:!1,enumerable:!1}),"each",{value:function(e,t){i(e)&&(e=this.get(e,[])),y(e,t)},writable:!1,configurable:!1,enumerable:!1}),"element",{value:function(e,t,n){return H(e,t,n)},writable:!1,configurable:!1,enumerable:!1}),"el",{value:function(e,t,n){r(n)&&(n=this.fn(n)()),this.echo(E(n,(function(n){return this.element(e,t,n)}),this))},writable:!1,configurable:!1,enumerable:!1})))},this.configure(e)}Object.setPrototypeOf(W.prototype,Error.prototype),Object.setPrototypeOf(W.prototype,L.prototype),Object.setPrototypeOf(J.prototype,L.prototype);var X=new function e(t){if(!1===g(this,e))return new e(t);var n={},i={};k(i,t||{});var o=new K(i),u=new B(i),c=new P,a=new T(i,c,u),l=function(e,t){var n=i.globalHelpers,o=[t,t.getComponent(),t.getBuffer(),b].concat(n.filter((function(e){return r(t[e])})).map((function(e){return t[e].bind(t)})));return a.get(e).then((function(e){return e.apply(t,o)}))},s=function(e,t){var n=m(e,i.extension),r=o.create(t);return l(n,r).then((function(e){if(r.getExtend()){r.setExtend(!1);var t=r.getLayout(),n=r.clone();return s(t,n)}return e}))};return this.configure=function(e){return k(i,e=e||{}),o.configure(i,n),u.configure(i),c.configure(i),a.configure(i),i},this.render=function(e,t){return s(e,t)},this.helpers=function(e){o.helpers(d(n,e))},this.preload=function(e){return c.load(e||{})},this.create=function(t){return new e(t)},this.compile=function(e,t){return u.compile(e,t)},this.context=function(e){return o.create(e)},this.helpers({require:function(e){var t=m(e,i.extension),n=o.create({});return l(t,n).then((function(){return n.getMacro()}))},render:s}),this}({resolver:function(e,t){return fetch(function(e,t){return(t=[e,t].join("/")).replace(/\/\//g,"/")}(e,t)).then((function(e){return e.text()}),(function(e){return new L(e)}))}}),Y=X.render,_=X.context,z=X.compile,G=X.helpers,I=X.preload,Q=X.configure,V=X.create;e.compile=z,e.configure=Q,e.context=_,e.create=V,e.helpers=G,e.preload=I,e.render=Y}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ejs={})}(this,(function(e){"use strict";var t=function(){var e=[].slice.call(arguments),t=e.shift();return e.filter(t).pop()},n=function(e){return Array.isArray(e)},r=function(e){return"function"==typeof e},i=function(e){return"string"==typeof e},o=function(e){return"boolean"==typeof e},u=function(e){return void 0===e},c="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},s=function(e){return new RegExp(["[",Object.keys(e).join(""),"]"].join(""),"g")},f=s(l),h=s(a),p=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(f,(function(e){return l[e]}))},b=function(e,t){var n=e;return null==n?"":!0===t?p(n):n},g=function(e,t){return Boolean(e instanceof t)},v=function(e,t,n){for(var i=e,o=String(t).split("."),u=o.pop(),c=0;c<o.length;c++){var a=o[c];if(r(i.toJSON)&&(i=i.toJSON()),n&&!1===i.hasOwnProperty(a)){i={};break}i=i[a]=i[a]||{}}return r(i.toJSON)&&(i=i.toJSON()),[i,u]},m=function(e,t){var n=e.split(".").pop();return n!==t&&(e=[e,t].join(".")),e},d=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.filter((function(e){return e})).reduce((function(e,t){return Object.assign(e,t)}),e)},w=function(){},y=function(e,t){var n;for(n in e)O(e,n)&&t(e[n],n,e)},j=function(e,t){return function(e,t){var n=e instanceof Array,r=n?[]:{};return y(e,(function(e,i,o){var c=t(e,i,o);!1===u(c)&&(n?r.push(c):r[i]=c)})),r}(e,(function(e,n){if(-1===t.indexOf(n))return e}))},E=function(e,t,n){return Promise.resolve(e).then(t.bind(n))},O=function(e,t){return e&&e.hasOwnProperty(t)},x={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(e,t){return Promise.resolve(["resolver is not defined",e,t].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},k=function(e,u){d(e,{path:t(i,x.path,e.path,u.path),export:t(i,x.export,e.export,u.export),resolver:t(r,x.resolver,e.resolver,u.resolver),extension:t(i,x.extension,e.extension,u.extension),withObject:t(o,x.withObject,e.withObject,u.withObject),rmWhitespace:t(o,x.rmWhitespace,e.rmWhitespace,u.rmWhitespace),cache:t(o,x.cache,e.cache,u.cache),token:d({},x.token,e.token,u.token),vars:d({},x.vars,e.vars,u.vars),globalHelpers:t(n,x.globalHelpers,e.globalHelpers,u.globalHelpers)})},F="undefined"!=typeof globalThis?globalThis:window||self;function P(e){if(!1===g(this,P))return new P;var t={enabled:!0,list:{}};this.configure=function(e){t.enabled=e.cache,!1===c&&this.load(F[e.export])},this.clear=function(){t.list={}},this.load=function(e){return t.enabled&&d(t.list,e||{}),this},this.get=function(e){if(t.enabled)return t.list[e]},this.set=function(e,n){return t.enabled&&(t.list[e]=n),this},this.resolve=function(e){return Promise.resolve(this.get(e))},this.remove=function(e){delete t.list[e]},this.exist=function(e){return O(t.list,e)}}var S=[{symbol:"-",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(e){return"')\n/**".concat(e,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(e){return"')\n".concat(e.trim(),"\n").concat(this.BUFFER,"('")}}];function B(e){if(!1===g(this,B))return new B(e);var t={};this.configure=function(e){t.withObject=e.withObject,t.rmWhitespace=e.rmWhitespace,t.token=e.token,t.vars=e.vars,t.globalHelpers=e.globalHelpers,t.matches=[],t.formats=[],t.slurp={match:"[ \\t]*",start:[t.token.start,"_"],end:["_",t.token.end]},S.forEach((function(e){t.matches.push(t.token.start.concat(e.symbol).concat(t.token.regex).concat(t.token.end)),t.formats.push(e.format.bind(t.vars))})),t.regex=new RegExp(t.matches.join("|").concat("|$"),"g"),t.slurpStart=new RegExp([t.slurp.match,t.slurp.start.join("")].join(""),"gm"),t.slurpEnd=new RegExp([t.slurp.end.join(""),t.slurp.match].join(""),"gm")},this.compile=function(e,n){var r=t.vars,i=r.SCOPE,o=r.SAFE,u=r.BUFFER,c=r.COMPONENT,l=t.globalHelpers;e=String(e),t.rmWhitespace&&(e=e.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),e=e.replace(t.slurpStart,t.token.start).replace(t.slurpEnd,t.token.end);var s,f,p,b="".concat(u,"('");s=t.regex,f=function(n,r,i){b+=(""+e.slice(r,i)).replace(h,(function(e){return"\\"+a[e]})),n.forEach((function(e,n){e&&(b+=t.formats[n](e))}))},p=0,e.replace(s,(function(){var e=[].slice.call(arguments,0,-1),t=e.pop(),n=e.shift();return f(e,p,t),p=t+n.length,n})),b="try{".concat(b+="');","}catch(e){return ").concat(u,".error(e)}"),t.withObject&&(b="with(".concat(i,"){").concat(b,"}")),b="".concat(u,".start();").concat(b,"return ").concat(u,".end();"),b+="\n//# sourceURL=".concat(n);var g=null,v=[i,c,u,o].concat(l);try{(g=Function.apply(null,v.concat(b))).source="(function(".concat(v.join(","),"){\n").concat(b,"\n});")}catch(e){throw e.filename=n,e.source=b,e}return g},this.configure(e)}function T(e,t,n){if(!1===g(this,T))return new T(e,t,n);if(!1===g(t,P))throw new TypeError("cache is not instance of Cache");if(!1===g(n,B))throw new TypeError("compiler is not instance of Compiler");var i={},o=function(e){return i.resolver(i.path,e)};this.configure=function(e){i.path=e.path,i.cache=e.cache,r(e.resolver)&&(i.resolver=e.resolver)},this.get=function(e){return t.exist(e)?t.resolve(e):o(e).then((function(i){return function(e,n){return t.set(e,n),n}(e,function(e,t){return r(e)?e:n.compile(e,t)}(i,e))}))},this.configure(e)}function R(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],$=" ",A='"',C="/",U="<",M=">",H=function(e,t,n){var r=[],i=-1===N.indexOf(e),o=function(e,t){var n=[];return y(e,(function(e,r,i){var o=t(e,r,i);!1===u(o)&&n.push(o)})),n}(t,(function(e,t){if(null!=e)return[p(t),[A,p(e),A].join("")].join("=")})).join($);return r.push([U,e,$,o,M].join("")),n&&r.push(n instanceof Array?n.join(""):n),i&&r.push([U,C,e,M].join("")),r.join("")};function L(e){this.code=1,this.name="TemplateError",this.message=e,Error.call(this)}function W(e){L.call(this),this.code=404,this.name="TemplateNotFound",this.message=e}function J(e){L.call(this),this.code=500,this.name="TemplateSyntaxError",this.message=e}function q(e){return Promise.all(e||[]).then((function(e){return e.join("")}))}function D(){var e=[],t=[];function n(e){t.push(e)}return n.start=function(){t=[]},n.backup=function(){e.push(t.concat()),t=[]},n.restore=function(){var n=t.concat();return t=e.pop(),q(n)},n.error=function(e){return t=e,Promise.reject(new J(t.message));var t},n.end=function(){return q(t)},n}function K(e){if(!1===g(this,K))return new K(e);this.configure=function(e,t){var n,o=e.vars,u=o.BLOCKS,c=o.MACRO,a=o.EXTEND,l=o.LAYOUT,s=o.BUFFER,f=o.COMPONENT;function h(e){this[u]={},this[c]={},d(this,e||{})}this.create=function(e){return new h(e)},this.helpers=function(e){d(h.prototype,e||{})},h.prototype=d({},t||{}),Object.defineProperties(h.prototype,(R(R(R(R(R(R(R(R(R(R(n={},s,{value:D(),writable:!0,configurable:!1,enumerable:!1}),u,{value:{},writable:!0,configurable:!1,enumerable:!1}),c,{value:{},writable:!0,configurable:!1,enumerable:!1}),l,{value:!1,writable:!0,configurable:!1,enumerable:!1}),a,{value:!1,writable:!0,configurable:!1,enumerable:!1}),"getMacro",{value:function(){return this[c]},writable:!1,configurable:!1,enumerable:!1}),"getBuffer",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),"getComponent",{value:function(){var e=this;return f in e?function(){return e[f].apply(e,arguments)}:function(){console.log("%s function not defined",f)}},writable:!1,configurable:!1,enumerable:!1}),"getBlocks",{value:function(){return this[u]},writable:!1,configurable:!1,enumerable:!1}),"setExtend",{value:function(e){this[a]=e},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(R(n,"getExtend",{value:function(){return this[a]},writable:!1,configurable:!1,enumerable:!1}),"setLayout",{value:function(e){this[l]=e},writable:!1,configurable:!1,enumerable:!1}),"getLayout",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),"clone",{value:function(e){var t=[l,a,s];return!0===e&&t.push(u),j(this,t)},writable:!1,configurable:!1,enumerable:!1}),"extend",{value:function(e){this.setExtend(!0),this.setLayout(e)},writable:!1,configurable:!1,enumerable:!1}),"echo",{value:function(e){var t=this.getBuffer();[].slice.call(arguments).forEach(t)},writable:!1,configurable:!1,enumerable:!1}),"fn",{value:function(e){var t=this.getBuffer(),n=this;return function(){return t.backup(),r(e)&&e.apply(n,arguments),t.restore()}},writable:!1,configurable:!1,enumerable:!1}),"get",{value:function(e,t){var n=v(this,e,!0),r=n.shift(),i=n.pop();return O(r,i)?r[i]:t},writable:!0,configurable:!0,enumerable:!1}),"set",{value:function(e,t){var n=v(this,e,!1),r=n.shift(),i=n.pop();return this.getExtend()&&O(r,i)?r[i]:r[i]=t},writable:!1,configurable:!1,enumerable:!1}),"macro",{value:function(e,t){var n=this.getMacro(),r=this.fn(t),i=this;n[e]=function(){return i.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(n,"call",{value:function(e){var t=this.getMacro()[e],n=[].slice.call(arguments,1);if(r(t))return t.apply(t,n)},writable:!1,configurable:!1,enumerable:!1}),"block",{value:function(e,t){var n=this,r=this.getBlocks();if(r[e]=r[e]||[],r[e].push(this.fn(t)),!this.getExtend()){var i=Object.assign([],r[e]),o=function(){return i.shift()},u=function(){var e=o();return e?function(){n.echo(e(u()))}:w};this.echo(o()(u()))}},writable:!1,configurable:!1,enumerable:!1}),"hasBlock",{value:function(e){return this.getBlocks().hasOwnProperty(e)},writable:!1,configurable:!1,enumerable:!1}),"include",{value:function(e,t,n){var r=!1===n?{}:this.clone(!0),i=d(r,t||{}),o=this.render(e,i);this.echo(o)},writable:!1,configurable:!1,enumerable:!1}),"use",{value:function(e,t){var n=this.require(e);this.echo(E(n,(function(e){var n=this.getMacro();y(e,(function(e,r){n[[t,r].join(".")]=e}))}),this))},writable:!1,configurable:!1,enumerable:!1}),"async",{value:function(e,t){this.echo(E(e,(function(e){return this.fn(t)(e)}),this))},writable:!1,configurable:!1,enumerable:!1}),"each",{value:function(e,t){i(e)&&(e=this.get(e,[])),y(e,t)},writable:!1,configurable:!1,enumerable:!1}),"element",{value:function(e,t,n){return H(e,t,n)},writable:!1,configurable:!1,enumerable:!1}),"el",{value:function(e,t,n){r(n)&&(n=this.fn(n)()),this.echo(E(n,(function(n){return this.element(e,t,n)}),this))},writable:!1,configurable:!1,enumerable:!1})))},this.configure(e)}Object.setPrototypeOf(W.prototype,Error.prototype),Object.setPrototypeOf(W.prototype,L.prototype),Object.setPrototypeOf(J.prototype,L.prototype);var X=new function e(t){if(!1===g(this,e))return new e(t);var n={},i={};k(i,t||{});var o=new K(i),u=new B(i),c=new P,a=new T(i,c,u),l=function(e,t){var n=i.globalHelpers,o=[t,t.getComponent(),t.getBuffer(),b].concat(n.filter((function(e){return r(t[e])})).map((function(e){return t[e].bind(t)})));return a.get(e).then((function(e){return e.apply(t,o)}))},s=function(e,t){var n=m(e,i.extension),r=o.create(t);return l(n,r).then((function(e){if(r.getExtend()){r.setExtend(!1);var t=r.getLayout(),n=r.clone();return s(t,n)}return e}))};return this.configure=function(e){return k(i,e=e||{}),o.configure(i,n),u.configure(i),c.configure(i),a.configure(i),i},this.render=function(e,t){return s(e,t)},this.helpers=function(e){o.helpers(d(n,e))},this.preload=function(e){return c.load(e||{})},this.create=function(t){return new e(t)},this.compile=function(e,t){return u.compile(e,t)},this.context=function(e){return o.create(e)},this.helpers({require:function(e){var t=m(e,i.extension),n=o.create({});return l(t,n).then((function(){return n.getMacro()}))},render:s}),this}({resolver:function(e,t){return fetch(function(e,t){return(t=[e,t].join("/")).replace(/\/\//g,"/")}(e,t)).then((function(e){return e.text()}),(function(e){return new L(e)}))}}),Y=X.render,_=X.context,z=X.compile,G=X.helpers,I=X.preload,Q=X.configure,V=X.create;e.compile=z,e.configure=Q,e.context=_,e.create=V,e.helpers=G,e.preload=I,e.render=Y}));
package/dist/umd/index.js CHANGED
@@ -337,7 +337,7 @@
337
337
  var params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
338
338
  try {
339
339
  result = Function.apply(null, params.concat(source));
340
- result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n})");
340
+ result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n});");
341
341
  } catch (e) {
342
342
  e.filename = path;
343
343
  e.source = source;
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ejs={})}(this,(function(e){"use strict";var t=function(){var e=[].slice.call(arguments),t=e.shift();return e.filter(t).pop()},n=function(e){return Array.isArray(e)},r=function(e){return"function"==typeof e},i=function(e){return"string"==typeof e},o=function(e){return"boolean"==typeof e},u=function(e){return void 0===e},c="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},s=function(e){return new RegExp(["[",Object.keys(e).join(""),"]"].join(""),"g")},f=s(l),h=s(a),p=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(f,(function(e){return l[e]}))},b=function(e,t){var n=e;return null==n?"":!0===t?p(n):n},v=function(e,t){return Boolean(e instanceof t)},g=function(e,t,n){for(var i=e,o=String(t).split("."),u=o.pop(),c=0;c<o.length;c++){var a=o[c];if(r(i.toJSON)&&(i=i.toJSON()),n&&!1===i.hasOwnProperty(a)){i={};break}i=i[a]=i[a]||{}}return r(i.toJSON)&&(i=i.toJSON()),[i,u]},m=function(e,t){var n=e.split(".").pop();return n!==t&&(e=[e,t].join(".")),e},d=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.filter((function(e){return e})).reduce((function(e,t){return Object.assign(e,t)}),e)},w=function(){},y=function(e,t){var n;for(n in e)O(e,n)&&t(e[n],n,e)},j=function(e,t){return function(e,t){var n=e instanceof Array,r=n?[]:{};return y(e,(function(e,i,o){var c=t(e,i,o);!1===u(c)&&(n?r.push(c):r[i]=c)})),r}(e,(function(e,n){if(-1===t.indexOf(n))return e}))},E=function(e,t,n){return Promise.resolve(e).then(t.bind(n))},O=function(e,t){return e&&e.hasOwnProperty(t)},x={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(e,t){return Promise.resolve(["resolver is not defined",e,t].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},k=function(e,u){d(e,{path:t(i,x.path,e.path,u.path),export:t(i,x.export,e.export,u.export),resolver:t(r,x.resolver,e.resolver,u.resolver),extension:t(i,x.extension,e.extension,u.extension),withObject:t(o,x.withObject,e.withObject,u.withObject),rmWhitespace:t(o,x.rmWhitespace,e.rmWhitespace,u.rmWhitespace),cache:t(o,x.cache,e.cache,u.cache),token:d({},x.token,e.token,u.token),vars:d({},x.vars,e.vars,u.vars),globalHelpers:t(n,x.globalHelpers,e.globalHelpers,u.globalHelpers)})},F="undefined"!=typeof globalThis?globalThis:window||self;function P(e){if(!1===v(this,P))return new P;var t={enabled:!0,list:{}};this.configure=function(e){t.enabled=e.cache,!1===c&&this.load(F[e.export])},this.clear=function(){t.list={}},this.load=function(e){return t.enabled&&d(t.list,e||{}),this},this.get=function(e){if(t.enabled)return t.list[e]},this.set=function(e,n){return t.enabled&&(t.list[e]=n),this},this.resolve=function(e){return Promise.resolve(this.get(e))},this.remove=function(e){delete t.list[e]},this.exist=function(e){return O(t.list,e)}}var S=[{symbol:"-",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(e){return"')\n/**".concat(e,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(e){return"')\n".concat(e.trim(),"\n").concat(this.BUFFER,"('")}}];function B(e){if(!1===v(this,B))return new B(e);var t={};this.configure=function(e){t.withObject=e.withObject,t.rmWhitespace=e.rmWhitespace,t.token=e.token,t.vars=e.vars,t.globalHelpers=e.globalHelpers,t.matches=[],t.formats=[],t.slurp={match:"[ \\t]*",start:[t.token.start,"_"],end:["_",t.token.end]},S.forEach((function(e){t.matches.push(t.token.start.concat(e.symbol).concat(t.token.regex).concat(t.token.end)),t.formats.push(e.format.bind(t.vars))})),t.regex=new RegExp(t.matches.join("|").concat("|$"),"g"),t.slurpStart=new RegExp([t.slurp.match,t.slurp.start.join("")].join(""),"gm"),t.slurpEnd=new RegExp([t.slurp.end.join(""),t.slurp.match].join(""),"gm")},this.compile=function(e,n){var r=t.vars,i=r.SCOPE,o=r.SAFE,u=r.BUFFER,c=r.COMPONENT,l=t.globalHelpers;e=String(e),t.rmWhitespace&&(e=e.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),e=e.replace(t.slurpStart,t.token.start).replace(t.slurpEnd,t.token.end);var s,f,p,b="".concat(u,"('");s=t.regex,f=function(n,r,i){b+=(""+e.slice(r,i)).replace(h,(function(e){return"\\"+a[e]})),n.forEach((function(e,n){e&&(b+=t.formats[n](e))}))},p=0,e.replace(s,(function(){var e=[].slice.call(arguments,0,-1),t=e.pop(),n=e.shift();return f(e,p,t),p=t+n.length,n})),b="try{".concat(b+="');","}catch(e){return ").concat(u,".error(e)}"),t.withObject&&(b="with(".concat(i,"){").concat(b,"}")),b="".concat(u,".start();").concat(b,"return ").concat(u,".end();"),b+="\n//# sourceURL=".concat(n);var v=null,g=[i,c,u,o].concat(l);try{(v=Function.apply(null,g.concat(b))).source="(function(".concat(g.join(","),"){\n").concat(b,"\n})")}catch(e){throw e.filename=n,e.source=b,e}return v},this.configure(e)}function T(e,t,n){if(!1===v(this,T))return new T(e,t,n);if(!1===v(t,P))throw new TypeError("cache is not instance of Cache");if(!1===v(n,B))throw new TypeError("compiler is not instance of Compiler");var i={},o=function(e){return i.resolver(i.path,e)};this.configure=function(e){i.path=e.path,i.cache=e.cache,r(e.resolver)&&(i.resolver=e.resolver)},this.get=function(e){return t.exist(e)?t.resolve(e):o(e).then((function(i){return function(e,n){return t.set(e,n),n}(e,function(e,t){return r(e)?e:n.compile(e,t)}(i,e))}))},this.configure(e)}function R(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],$=" ",A='"',C="/",U="<",M=">",H=function(e,t,n){var r=[],i=-1===N.indexOf(e),o=function(e,t){var n=[];return y(e,(function(e,r,i){var o=t(e,r,i);!1===u(o)&&n.push(o)})),n}(t,(function(e,t){if(null!=e)return[p(t),[A,p(e),A].join("")].join("=")})).join($);return r.push([U,e,$,o,M].join("")),n&&r.push(n instanceof Array?n.join(""):n),i&&r.push([U,C,e,M].join("")),r.join("")};function L(e){this.code=1,this.name="TemplateError",this.message=e,Error.call(this)}function W(e){L.call(this),this.code=404,this.name="TemplateNotFound",this.message=e}function J(e){L.call(this),this.code=500,this.name="TemplateSyntaxError",this.message=e}function _(e){return Promise.all(e||[]).then((function(e){return e.join("")}))}function q(){var e=[],t=[];function n(e){t.push(e)}return n.start=function(){t=[]},n.backup=function(){e.push(t.concat()),t=[]},n.restore=function(){var n=t.concat();return t=e.pop(),_(n)},n.error=function(e){return t=e,Promise.reject(new J(t.message));var t},n.end=function(){return _(t)},n}function D(e){if(!1===v(this,D))return new D(e);this.configure=function(e,t){var n,o=e.vars,u=o.BLOCKS,c=o.MACRO,a=o.EXTEND,l=o.LAYOUT,s=o.BUFFER,f=o.COMPONENT;function h(e){this[u]={},this[c]={},d(this,e||{})}this.create=function(e){return new h(e)},this.helpers=function(e){d(h.prototype,e||{})},h.prototype=d({},t||{}),Object.defineProperties(h.prototype,(R(R(R(R(R(R(R(R(R(R(n={},s,{value:q(),writable:!0,configurable:!1,enumerable:!1}),u,{value:{},writable:!0,configurable:!1,enumerable:!1}),c,{value:{},writable:!0,configurable:!1,enumerable:!1}),l,{value:!1,writable:!0,configurable:!1,enumerable:!1}),a,{value:!1,writable:!0,configurable:!1,enumerable:!1}),"getMacro",{value:function(){return this[c]},writable:!1,configurable:!1,enumerable:!1}),"getBuffer",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),"getComponent",{value:function(){var e=this;return f in e?function(){return e[f].apply(e,arguments)}:function(){console.log("%s function not defined",f)}},writable:!1,configurable:!1,enumerable:!1}),"getBlocks",{value:function(){return this[u]},writable:!1,configurable:!1,enumerable:!1}),"setExtend",{value:function(e){this[a]=e},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(R(n,"getExtend",{value:function(){return this[a]},writable:!1,configurable:!1,enumerable:!1}),"setLayout",{value:function(e){this[l]=e},writable:!1,configurable:!1,enumerable:!1}),"getLayout",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),"clone",{value:function(e){var t=[l,a,s];return!0===e&&t.push(u),j(this,t)},writable:!1,configurable:!1,enumerable:!1}),"extend",{value:function(e){this.setExtend(!0),this.setLayout(e)},writable:!1,configurable:!1,enumerable:!1}),"echo",{value:function(e){var t=this.getBuffer();[].slice.call(arguments).forEach(t)},writable:!1,configurable:!1,enumerable:!1}),"fn",{value:function(e){var t=this.getBuffer(),n=this;return function(){return t.backup(),r(e)&&e.apply(n,arguments),t.restore()}},writable:!1,configurable:!1,enumerable:!1}),"get",{value:function(e,t){var n=g(this,e,!0),r=n.shift(),i=n.pop();return O(r,i)?r[i]:t},writable:!0,configurable:!0,enumerable:!1}),"set",{value:function(e,t){var n=g(this,e,!1),r=n.shift(),i=n.pop();return this.getExtend()&&O(r,i)?r[i]:r[i]=t},writable:!1,configurable:!1,enumerable:!1}),"macro",{value:function(e,t){var n=this.getMacro(),r=this.fn(t),i=this;n[e]=function(){return i.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(n,"call",{value:function(e){var t=this.getMacro()[e],n=[].slice.call(arguments,1);if(r(t))return t.apply(t,n)},writable:!1,configurable:!1,enumerable:!1}),"block",{value:function(e,t){var n=this,r=this.getBlocks();if(r[e]=r[e]||[],r[e].push(this.fn(t)),!this.getExtend()){var i=Object.assign([],r[e]),o=function(){return i.shift()},u=function(){var e=o();return e?function(){n.echo(e(u()))}:w};this.echo(o()(u()))}},writable:!1,configurable:!1,enumerable:!1}),"hasBlock",{value:function(e){return this.getBlocks().hasOwnProperty(e)},writable:!1,configurable:!1,enumerable:!1}),"include",{value:function(e,t,n){var r=!1===n?{}:this.clone(!0),i=d(r,t||{}),o=this.render(e,i);this.echo(o)},writable:!1,configurable:!1,enumerable:!1}),"use",{value:function(e,t){var n=this.require(e);this.echo(E(n,(function(e){var n=this.getMacro();y(e,(function(e,r){n[[t,r].join(".")]=e}))}),this))},writable:!1,configurable:!1,enumerable:!1}),"async",{value:function(e,t){this.echo(E(e,(function(e){return this.fn(t)(e)}),this))},writable:!1,configurable:!1,enumerable:!1}),"each",{value:function(e,t){i(e)&&(e=this.get(e,[])),y(e,t)},writable:!1,configurable:!1,enumerable:!1}),"element",{value:function(e,t,n){return H(e,t,n)},writable:!1,configurable:!1,enumerable:!1}),"el",{value:function(e,t,n){r(n)&&(n=this.fn(n)()),this.echo(E(n,(function(n){return this.element(e,t,n)}),this))},writable:!1,configurable:!1,enumerable:!1})))},this.configure(e)}Object.setPrototypeOf(W.prototype,Error.prototype),Object.setPrototypeOf(W.prototype,L.prototype),Object.setPrototypeOf(J.prototype,L.prototype);var K={};var X=new function e(t){if(!1===v(this,e))return new e(t);var n={},i={};k(i,t||{});var o=new D(i),u=new B(i),c=new P,a=new T(i,c,u),l=function(e,t){var n=i.globalHelpers,o=[t,t.getComponent(),t.getBuffer(),b].concat(n.filter((function(e){return r(t[e])})).map((function(e){return t[e].bind(t)})));return a.get(e).then((function(e){return e.apply(t,o)}))},s=function(e,t){var n=m(e,i.extension),r=o.create(t);return l(n,r).then((function(e){if(r.getExtend()){r.setExtend(!1);var t=r.getLayout(),n=r.clone();return s(t,n)}return e}))};return this.configure=function(e){return k(i,e=e||{}),o.configure(i,n),u.configure(i),c.configure(i),a.configure(i),i},this.render=function(e,t){return s(e,t)},this.helpers=function(e){o.helpers(d(n,e))},this.preload=function(e){return c.load(e||{})},this.create=function(t){return new e(t)},this.compile=function(e,t){return u.compile(e,t)},this.context=function(e){return o.create(e)},this.helpers({require:function(e){var t=m(e,i.extension),n=o.create({});return l(t,n).then((function(){return n.getMacro()}))},render:s}),this}({resolver:function(e,t){return new Promise((function(n,r){K.readFile(function(e,t){return(t=[e,t].join("/")).replace(/\/\//g,"/")}(e,t),(function(e,t){e?r(new L(e)):n(t.toString())}))}))}}),Y=X.render,z=X.context,G=X.compile,I=X.helpers,Q=X.preload,V=X.configure,Z=X.create,ee=function(e){return function(n,u,c){r(u)&&(c=u,u={});var a=d({},(u=u||{}).settings),l=t(i,x.path,a.views),s=t(o,x.cache,a["view cache"]),f=d({},a["view options"]),h=K.relative(l,n);return f.path=l,f.cache=s,e.configure(f),e.render(h,u).then((function(e){c(null,e)})).catch((function(e){c(e)}))}}(X);e.__express=ee,e.compile=G,e.configure=V,e.context=z,e.create=Z,e.helpers=I,e.preload=Q,e.render=Y}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ejs={})}(this,(function(e){"use strict";var t=function(){var e=[].slice.call(arguments),t=e.shift();return e.filter(t).pop()},n=function(e){return Array.isArray(e)},r=function(e){return"function"==typeof e},i=function(e){return"string"==typeof e},o=function(e){return"boolean"==typeof e},u=function(e){return void 0===e},c="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},s=function(e){return new RegExp(["[",Object.keys(e).join(""),"]"].join(""),"g")},f=s(l),h=s(a),p=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(f,(function(e){return l[e]}))},b=function(e,t){var n=e;return null==n?"":!0===t?p(n):n},v=function(e,t){return Boolean(e instanceof t)},g=function(e,t,n){for(var i=e,o=String(t).split("."),u=o.pop(),c=0;c<o.length;c++){var a=o[c];if(r(i.toJSON)&&(i=i.toJSON()),n&&!1===i.hasOwnProperty(a)){i={};break}i=i[a]=i[a]||{}}return r(i.toJSON)&&(i=i.toJSON()),[i,u]},m=function(e,t){var n=e.split(".").pop();return n!==t&&(e=[e,t].join(".")),e},d=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.filter((function(e){return e})).reduce((function(e,t){return Object.assign(e,t)}),e)},w=function(){},y=function(e,t){var n;for(n in e)O(e,n)&&t(e[n],n,e)},j=function(e,t){return function(e,t){var n=e instanceof Array,r=n?[]:{};return y(e,(function(e,i,o){var c=t(e,i,o);!1===u(c)&&(n?r.push(c):r[i]=c)})),r}(e,(function(e,n){if(-1===t.indexOf(n))return e}))},E=function(e,t,n){return Promise.resolve(e).then(t.bind(n))},O=function(e,t){return e&&e.hasOwnProperty(t)},x={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(e,t){return Promise.resolve(["resolver is not defined",e,t].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},k=function(e,u){d(e,{path:t(i,x.path,e.path,u.path),export:t(i,x.export,e.export,u.export),resolver:t(r,x.resolver,e.resolver,u.resolver),extension:t(i,x.extension,e.extension,u.extension),withObject:t(o,x.withObject,e.withObject,u.withObject),rmWhitespace:t(o,x.rmWhitespace,e.rmWhitespace,u.rmWhitespace),cache:t(o,x.cache,e.cache,u.cache),token:d({},x.token,e.token,u.token),vars:d({},x.vars,e.vars,u.vars),globalHelpers:t(n,x.globalHelpers,e.globalHelpers,u.globalHelpers)})},F="undefined"!=typeof globalThis?globalThis:window||self;function P(e){if(!1===v(this,P))return new P;var t={enabled:!0,list:{}};this.configure=function(e){t.enabled=e.cache,!1===c&&this.load(F[e.export])},this.clear=function(){t.list={}},this.load=function(e){return t.enabled&&d(t.list,e||{}),this},this.get=function(e){if(t.enabled)return t.list[e]},this.set=function(e,n){return t.enabled&&(t.list[e]=n),this},this.resolve=function(e){return Promise.resolve(this.get(e))},this.remove=function(e){delete t.list[e]},this.exist=function(e){return O(t.list,e)}}var S=[{symbol:"-",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(e){return"')\n/**".concat(e,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(e){return"')\n".concat(e.trim(),"\n").concat(this.BUFFER,"('")}}];function B(e){if(!1===v(this,B))return new B(e);var t={};this.configure=function(e){t.withObject=e.withObject,t.rmWhitespace=e.rmWhitespace,t.token=e.token,t.vars=e.vars,t.globalHelpers=e.globalHelpers,t.matches=[],t.formats=[],t.slurp={match:"[ \\t]*",start:[t.token.start,"_"],end:["_",t.token.end]},S.forEach((function(e){t.matches.push(t.token.start.concat(e.symbol).concat(t.token.regex).concat(t.token.end)),t.formats.push(e.format.bind(t.vars))})),t.regex=new RegExp(t.matches.join("|").concat("|$"),"g"),t.slurpStart=new RegExp([t.slurp.match,t.slurp.start.join("")].join(""),"gm"),t.slurpEnd=new RegExp([t.slurp.end.join(""),t.slurp.match].join(""),"gm")},this.compile=function(e,n){var r=t.vars,i=r.SCOPE,o=r.SAFE,u=r.BUFFER,c=r.COMPONENT,l=t.globalHelpers;e=String(e),t.rmWhitespace&&(e=e.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),e=e.replace(t.slurpStart,t.token.start).replace(t.slurpEnd,t.token.end);var s,f,p,b="".concat(u,"('");s=t.regex,f=function(n,r,i){b+=(""+e.slice(r,i)).replace(h,(function(e){return"\\"+a[e]})),n.forEach((function(e,n){e&&(b+=t.formats[n](e))}))},p=0,e.replace(s,(function(){var e=[].slice.call(arguments,0,-1),t=e.pop(),n=e.shift();return f(e,p,t),p=t+n.length,n})),b="try{".concat(b+="');","}catch(e){return ").concat(u,".error(e)}"),t.withObject&&(b="with(".concat(i,"){").concat(b,"}")),b="".concat(u,".start();").concat(b,"return ").concat(u,".end();"),b+="\n//# sourceURL=".concat(n);var v=null,g=[i,c,u,o].concat(l);try{(v=Function.apply(null,g.concat(b))).source="(function(".concat(g.join(","),"){\n").concat(b,"\n});")}catch(e){throw e.filename=n,e.source=b,e}return v},this.configure(e)}function T(e,t,n){if(!1===v(this,T))return new T(e,t,n);if(!1===v(t,P))throw new TypeError("cache is not instance of Cache");if(!1===v(n,B))throw new TypeError("compiler is not instance of Compiler");var i={},o=function(e){return i.resolver(i.path,e)};this.configure=function(e){i.path=e.path,i.cache=e.cache,r(e.resolver)&&(i.resolver=e.resolver)},this.get=function(e){return t.exist(e)?t.resolve(e):o(e).then((function(i){return function(e,n){return t.set(e,n),n}(e,function(e,t){return r(e)?e:n.compile(e,t)}(i,e))}))},this.configure(e)}function R(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],$=" ",A='"',C="/",U="<",M=">",H=function(e,t,n){var r=[],i=-1===N.indexOf(e),o=function(e,t){var n=[];return y(e,(function(e,r,i){var o=t(e,r,i);!1===u(o)&&n.push(o)})),n}(t,(function(e,t){if(null!=e)return[p(t),[A,p(e),A].join("")].join("=")})).join($);return r.push([U,e,$,o,M].join("")),n&&r.push(n instanceof Array?n.join(""):n),i&&r.push([U,C,e,M].join("")),r.join("")};function L(e){this.code=1,this.name="TemplateError",this.message=e,Error.call(this)}function W(e){L.call(this),this.code=404,this.name="TemplateNotFound",this.message=e}function J(e){L.call(this),this.code=500,this.name="TemplateSyntaxError",this.message=e}function _(e){return Promise.all(e||[]).then((function(e){return e.join("")}))}function q(){var e=[],t=[];function n(e){t.push(e)}return n.start=function(){t=[]},n.backup=function(){e.push(t.concat()),t=[]},n.restore=function(){var n=t.concat();return t=e.pop(),_(n)},n.error=function(e){return t=e,Promise.reject(new J(t.message));var t},n.end=function(){return _(t)},n}function D(e){if(!1===v(this,D))return new D(e);this.configure=function(e,t){var n,o=e.vars,u=o.BLOCKS,c=o.MACRO,a=o.EXTEND,l=o.LAYOUT,s=o.BUFFER,f=o.COMPONENT;function h(e){this[u]={},this[c]={},d(this,e||{})}this.create=function(e){return new h(e)},this.helpers=function(e){d(h.prototype,e||{})},h.prototype=d({},t||{}),Object.defineProperties(h.prototype,(R(R(R(R(R(R(R(R(R(R(n={},s,{value:q(),writable:!0,configurable:!1,enumerable:!1}),u,{value:{},writable:!0,configurable:!1,enumerable:!1}),c,{value:{},writable:!0,configurable:!1,enumerable:!1}),l,{value:!1,writable:!0,configurable:!1,enumerable:!1}),a,{value:!1,writable:!0,configurable:!1,enumerable:!1}),"getMacro",{value:function(){return this[c]},writable:!1,configurable:!1,enumerable:!1}),"getBuffer",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),"getComponent",{value:function(){var e=this;return f in e?function(){return e[f].apply(e,arguments)}:function(){console.log("%s function not defined",f)}},writable:!1,configurable:!1,enumerable:!1}),"getBlocks",{value:function(){return this[u]},writable:!1,configurable:!1,enumerable:!1}),"setExtend",{value:function(e){this[a]=e},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(R(n,"getExtend",{value:function(){return this[a]},writable:!1,configurable:!1,enumerable:!1}),"setLayout",{value:function(e){this[l]=e},writable:!1,configurable:!1,enumerable:!1}),"getLayout",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),"clone",{value:function(e){var t=[l,a,s];return!0===e&&t.push(u),j(this,t)},writable:!1,configurable:!1,enumerable:!1}),"extend",{value:function(e){this.setExtend(!0),this.setLayout(e)},writable:!1,configurable:!1,enumerable:!1}),"echo",{value:function(e){var t=this.getBuffer();[].slice.call(arguments).forEach(t)},writable:!1,configurable:!1,enumerable:!1}),"fn",{value:function(e){var t=this.getBuffer(),n=this;return function(){return t.backup(),r(e)&&e.apply(n,arguments),t.restore()}},writable:!1,configurable:!1,enumerable:!1}),"get",{value:function(e,t){var n=g(this,e,!0),r=n.shift(),i=n.pop();return O(r,i)?r[i]:t},writable:!0,configurable:!0,enumerable:!1}),"set",{value:function(e,t){var n=g(this,e,!1),r=n.shift(),i=n.pop();return this.getExtend()&&O(r,i)?r[i]:r[i]=t},writable:!1,configurable:!1,enumerable:!1}),"macro",{value:function(e,t){var n=this.getMacro(),r=this.fn(t),i=this;n[e]=function(){return i.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(n,"call",{value:function(e){var t=this.getMacro()[e],n=[].slice.call(arguments,1);if(r(t))return t.apply(t,n)},writable:!1,configurable:!1,enumerable:!1}),"block",{value:function(e,t){var n=this,r=this.getBlocks();if(r[e]=r[e]||[],r[e].push(this.fn(t)),!this.getExtend()){var i=Object.assign([],r[e]),o=function(){return i.shift()},u=function(){var e=o();return e?function(){n.echo(e(u()))}:w};this.echo(o()(u()))}},writable:!1,configurable:!1,enumerable:!1}),"hasBlock",{value:function(e){return this.getBlocks().hasOwnProperty(e)},writable:!1,configurable:!1,enumerable:!1}),"include",{value:function(e,t,n){var r=!1===n?{}:this.clone(!0),i=d(r,t||{}),o=this.render(e,i);this.echo(o)},writable:!1,configurable:!1,enumerable:!1}),"use",{value:function(e,t){var n=this.require(e);this.echo(E(n,(function(e){var n=this.getMacro();y(e,(function(e,r){n[[t,r].join(".")]=e}))}),this))},writable:!1,configurable:!1,enumerable:!1}),"async",{value:function(e,t){this.echo(E(e,(function(e){return this.fn(t)(e)}),this))},writable:!1,configurable:!1,enumerable:!1}),"each",{value:function(e,t){i(e)&&(e=this.get(e,[])),y(e,t)},writable:!1,configurable:!1,enumerable:!1}),"element",{value:function(e,t,n){return H(e,t,n)},writable:!1,configurable:!1,enumerable:!1}),"el",{value:function(e,t,n){r(n)&&(n=this.fn(n)()),this.echo(E(n,(function(n){return this.element(e,t,n)}),this))},writable:!1,configurable:!1,enumerable:!1})))},this.configure(e)}Object.setPrototypeOf(W.prototype,Error.prototype),Object.setPrototypeOf(W.prototype,L.prototype),Object.setPrototypeOf(J.prototype,L.prototype);var K={};var X=new function e(t){if(!1===v(this,e))return new e(t);var n={},i={};k(i,t||{});var o=new D(i),u=new B(i),c=new P,a=new T(i,c,u),l=function(e,t){var n=i.globalHelpers,o=[t,t.getComponent(),t.getBuffer(),b].concat(n.filter((function(e){return r(t[e])})).map((function(e){return t[e].bind(t)})));return a.get(e).then((function(e){return e.apply(t,o)}))},s=function(e,t){var n=m(e,i.extension),r=o.create(t);return l(n,r).then((function(e){if(r.getExtend()){r.setExtend(!1);var t=r.getLayout(),n=r.clone();return s(t,n)}return e}))};return this.configure=function(e){return k(i,e=e||{}),o.configure(i,n),u.configure(i),c.configure(i),a.configure(i),i},this.render=function(e,t){return s(e,t)},this.helpers=function(e){o.helpers(d(n,e))},this.preload=function(e){return c.load(e||{})},this.create=function(t){return new e(t)},this.compile=function(e,t){return u.compile(e,t)},this.context=function(e){return o.create(e)},this.helpers({require:function(e){var t=m(e,i.extension),n=o.create({});return l(t,n).then((function(){return n.getMacro()}))},render:s}),this}({resolver:function(e,t){return new Promise((function(n,r){K.readFile(function(e,t){return(t=[e,t].join("/")).replace(/\/\//g,"/")}(e,t),(function(e,t){e?r(new L(e)):n(t.toString())}))}))}}),Y=X.render,z=X.context,G=X.compile,I=X.helpers,Q=X.preload,V=X.configure,Z=X.create,ee=function(e){return function(n,u,c){r(u)&&(c=u,u={});var a=d({},(u=u||{}).settings),l=t(i,x.path,a.views),s=t(o,x.cache,a["view cache"]),f=d({},a["view options"]),h=K.relative(l,n);return f.path=l,f.cache=s,e.configure(f),e.render(h,u).then((function(e){c(null,e)})).catch((function(e){c(e)}))}}(X);e.__express=ee,e.compile=G,e.configure=V,e.context=z,e.create=Z,e.helpers=I,e.preload=Q,e.render=Y}));
@@ -681,7 +681,7 @@
681
681
  var params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
682
682
  try {
683
683
  result = Function.apply(null, params.concat(source));
684
- result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n})");
684
+ result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n});");
685
685
  } catch (e) {
686
686
  e.filename = path;
687
687
  e.source = source;
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ejs={})}(this,(function(t){"use strict";function e(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(){r=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new N(r||[]);return i(a,"_invoke",{value:P(t,n,c)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",v="suspendedYield",g="executing",b="completed",m={};function d(){}function y(){}function w(){}var x={};l(x,c,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(B([])));j&&j!==n&&o.call(j,c)&&(x=j);var O=w.prototype=d.prototype=Object.create(x);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(r,i,a,c){var u=h(t[r],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var r;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}})}function P(e,n,r){var o=p;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=F(c,r);if(u){if(u===m)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=b,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?b:v,s.arg===m)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=b,r.method="throw",r.arg=s.arg)}}}function F(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,F(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=w,i(O,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:y,configurable:!0}),y.displayName=l(w,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(f(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(O),l(O,s,"Generator"),l(O,c,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=B,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var o=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},i=function(t){return Array.isArray(t)},a=function(t){return"function"==typeof t},c=function(t){return"string"==typeof t},u=function(t){return"boolean"==typeof t},s=function(t){return void 0===t},l="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),f={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},p=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},v=p(h),g=p(f),b=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(v,(function(t){return h[t]}))},m=function(t,e){var n=t;return null==n?"":!0===e?b(n):n},d=function(t,e){return Boolean(t instanceof e)},y=function(t,e,n){for(var r=t,o=String(e).split("."),i=o.pop(),c=0;c<o.length;c++){var u=o[c];if(a(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(u)){r={};break}r=r[u]=r[u]||{}}return a(r.toJSON)&&(r=r.toJSON()),[r,i]},w=function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t},x=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.filter((function(t){return t})).reduce((function(t,e){return Object.assign(t,e)}),t)},E=function(){},j=function(t,e){var n;for(n in t)k(t,n)&&e(t[n],n,t)},O=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return j(t,(function(t,o,i){var a=e(t,o,i);!1===s(a)&&(n?r.push(a):r[o]=a)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},L=function(t,e,n){return Promise.resolve(t).then(e.bind(n))},k=function(t,e){return t&&t.hasOwnProperty(e)},P={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(t,e){return Promise.resolve(["resolver is not defined",t,e].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},F=function(t,e){x(t,{path:o(c,P.path,t.path,e.path),export:o(c,P.export,t.export,e.export),resolver:o(a,P.resolver,t.resolver,e.resolver),extension:o(c,P.extension,t.extension,e.extension),withObject:o(u,P.withObject,t.withObject,e.withObject),rmWhitespace:o(u,P.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:o(u,P.cache,t.cache,e.cache),token:x({},P.token,t.token,e.token),vars:x({},P.vars,t.vars,e.vars),globalHelpers:o(i,P.globalHelpers,t.globalHelpers,e.globalHelpers)})},S="undefined"!=typeof globalThis?globalThis:window||self;function T(t){if(!1===d(this,T))return new T;var e={enabled:!0,list:{}};this.configure=function(t){e.enabled=t.cache,!1===l&&this.load(S[t.export])},this.clear=function(){e.list={}},this.load=function(t){return e.enabled&&x(e.list,t||{}),this},this.get=function(t){if(e.enabled)return e.list[t]},this.set=function(t,n){return e.enabled&&(e.list[t]=n),this},this.resolve=function(t){return Promise.resolve(this.get(t))},this.remove=function(t){delete e.list[t]},this.exist=function(t){return k(e.list,t)}}var N=[{symbol:"-",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(t){return"')\n/**".concat(t,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(t){return"')\n".concat(t.trim(),"\n").concat(this.BUFFER,"('")}}];function B(t){if(!1===d(this,B))return new B(t);var e={};this.configure=function(t){e.withObject=t.withObject,e.rmWhitespace=t.rmWhitespace,e.token=t.token,e.vars=t.vars,e.globalHelpers=t.globalHelpers,e.matches=[],e.formats=[],e.slurp={match:"[ \\t]*",start:[e.token.start,"_"],end:["_",e.token.end]},N.forEach((function(t){e.matches.push(e.token.start.concat(t.symbol).concat(e.token.regex).concat(e.token.end)),e.formats.push(t.format.bind(e.vars))})),e.regex=new RegExp(e.matches.join("|").concat("|$"),"g"),e.slurpStart=new RegExp([e.slurp.match,e.slurp.start.join("")].join(""),"gm"),e.slurpEnd=new RegExp([e.slurp.end.join(""),e.slurp.match].join(""),"gm")},this.compile=function(t,n){var r=e.vars,o=r.SCOPE,i=r.SAFE,a=r.BUFFER,c=r.COMPONENT,u=e.globalHelpers;t=String(t),e.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=t.replace(e.slurpStart,e.token.start).replace(e.slurpEnd,e.token.end);var s,l,h,p="".concat(a,"('");s=e.regex,l=function(n,r,o){p+=(""+t.slice(r,o)).replace(g,(function(t){return"\\"+f[t]})),n.forEach((function(t,n){t&&(p+=e.formats[n](t))}))},h=0,t.replace(s,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return l(t,h,e),h=e+n.length,n})),p="try{".concat(p+="');","}catch(e){return ").concat(a,".error(e)}"),e.withObject&&(p="with(".concat(o,"){").concat(p,"}")),p="".concat(a,".start();").concat(p,"return ").concat(a,".end();"),p+="\n//# sourceURL=".concat(n);var v=null,b=[o,c,a,i].concat(u);try{(v=Function.apply(null,b.concat(p))).source="(function(".concat(b.join(","),"){\n").concat(p,"\n})")}catch(t){throw t.filename=n,t.source=p,t}return v},this.configure(t)}function R(t,e,n){if(!1===d(this,R))return new R(t,e,n);if(!1===d(e,T))throw new TypeError("cache is not instance of Cache");if(!1===d(n,B))throw new TypeError("compiler is not instance of Compiler");var r={},o=function(t){return r.resolver(r.path,t)};this.configure=function(t){r.path=t.path,r.cache=t.cache,a(t.resolver)&&(r.resolver=t.resolver)},this.get=function(t){return e.exist(t)?e.resolve(t):o(t).then((function(r){return function(t,n){return e.set(t,n),n}(t,function(t,e){return a(t)?t:n.compile(t,e)}(r,t))}))},this.configure(t)}var _=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],A=" ",$='"',C="/",U="<",M=">",H=function(t,e,n){var r=[],o=-1===_.indexOf(t),i=function(t,e){var n=[];return j(t,(function(t,r,o){var i=e(t,r,o);!1===s(i)&&n.push(i)})),n}(e,(function(t,e){if(null!=t)return[b(e),[$,b(t),$].join("")].join("=")})).join(A);return r.push([U,t,A,i,M].join("")),n&&r.push(n instanceof Array?n.join(""):n),o&&r.push([U,C,t,M].join("")),r.join("")};function G(t){this.code=1,this.name="TemplateError",this.message=t,Error.call(this)}function W(t){G.call(this),this.code=404,this.name="TemplateNotFound",this.message=t}function q(t){G.call(this),this.code=500,this.name="TemplateSyntaxError",this.message=t}function J(t){return Promise.all(t||[]).then((function(t){return t.join("")}))}function Y(){var t=[],e=[];function n(t){e.push(t)}return n.start=function(){e=[]},n.backup=function(){t.push(e.concat()),e=[]},n.restore=function(){var n=e.concat();return e=t.pop(),J(n)},n.error=function(t){return e=t,Promise.reject(new q(e.message));var e},n.end=function(){return J(e)},n}function I(t){if(!1===d(this,I))return new I(t);this.configure=function(t,e){var r,o=t.vars,i=o.BLOCKS,u=o.MACRO,s=o.EXTEND,l=o.LAYOUT,f=o.BUFFER,h=o.COMPONENT;function p(t){this[i]={},this[u]={},x(this,t||{})}this.create=function(t){return new p(t)},this.helpers=function(t){x(p.prototype,t||{})},p.prototype=x({},e||{}),Object.defineProperties(p.prototype,(n(n(n(n(n(n(n(n(n(n(r={},f,{value:Y(),writable:!0,configurable:!1,enumerable:!1}),i,{value:{},writable:!0,configurable:!1,enumerable:!1}),u,{value:{},writable:!0,configurable:!1,enumerable:!1}),l,{value:!1,writable:!0,configurable:!1,enumerable:!1}),s,{value:!1,writable:!0,configurable:!1,enumerable:!1}),"getMacro",{value:function(){return this[u]},writable:!1,configurable:!1,enumerable:!1}),"getBuffer",{value:function(){return this[f]},writable:!1,configurable:!1,enumerable:!1}),"getComponent",{value:function(){var t=this;return h in t?function(){return t[h].apply(t,arguments)}:function(){console.log("%s function not defined",h)}},writable:!1,configurable:!1,enumerable:!1}),"getBlocks",{value:function(){return this[i]},writable:!1,configurable:!1,enumerable:!1}),"setExtend",{value:function(t){this[s]=t},writable:!1,configurable:!1,enumerable:!1}),n(n(n(n(n(n(n(n(n(n(r,"getExtend",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),"setLayout",{value:function(t){this[l]=t},writable:!1,configurable:!1,enumerable:!1}),"getLayout",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),"clone",{value:function(t){var e=[l,s,f];return!0===t&&e.push(i),O(this,e)},writable:!1,configurable:!1,enumerable:!1}),"extend",{value:function(t){this.setExtend(!0),this.setLayout(t)},writable:!1,configurable:!1,enumerable:!1}),"echo",{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)},writable:!1,configurable:!1,enumerable:!1}),"fn",{value:function(t){var e=this.getBuffer(),n=this;return function(){return e.backup(),a(t)&&t.apply(n,arguments),e.restore()}},writable:!1,configurable:!1,enumerable:!1}),"get",{value:function(t,e){var n=y(this,t,!0),r=n.shift(),o=n.pop();return k(r,o)?r[o]:e},writable:!0,configurable:!0,enumerable:!1}),"set",{value:function(t,e){var n=y(this,t,!1),r=n.shift(),o=n.pop();return this.getExtend()&&k(r,o)?r[o]:r[o]=e},writable:!1,configurable:!1,enumerable:!1}),"macro",{value:function(t,e){var n=this.getMacro(),r=this.fn(e),o=this;n[t]=function(){return o.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),n(n(n(n(n(n(n(n(n(r,"call",{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(a(e))return e.apply(e,n)},writable:!1,configurable:!1,enumerable:!1}),"block",{value:function(t,e){var n=this,r=this.getBlocks();if(r[t]=r[t]||[],r[t].push(this.fn(e)),!this.getExtend()){var o=Object.assign([],r[t]),i=function(){return o.shift()},a=function(){var t=i();return t?function(){n.echo(t(a()))}:E};this.echo(i()(a()))}},writable:!1,configurable:!1,enumerable:!1}),"hasBlock",{value:function(t){return this.getBlocks().hasOwnProperty(t)},writable:!1,configurable:!1,enumerable:!1}),"include",{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),o=x(r,e||{}),i=this.render(t,o);this.echo(i)},writable:!1,configurable:!1,enumerable:!1}),"use",{value:function(t,e){var n=this.require(t);this.echo(L(n,(function(t){var n=this.getMacro();j(t,(function(t,r){n[[e,r].join(".")]=t}))}),this))},writable:!1,configurable:!1,enumerable:!1}),"async",{value:function(t,e){this.echo(L(t,(function(t){return this.fn(e)(t)}),this))},writable:!1,configurable:!1,enumerable:!1}),"each",{value:function(t,e){c(t)&&(t=this.get(t,[])),j(t,e)},writable:!1,configurable:!1,enumerable:!1}),"element",{value:function(t,e,n){return H(t,e,n)},writable:!1,configurable:!1,enumerable:!1}),"el",{value:function(t,e,n){a(n)&&(n=this.fn(n)()),this.echo(L(n,(function(n){return this.element(t,e,n)}),this))},writable:!1,configurable:!1,enumerable:!1})))},this.configure(t)}Object.setPrototypeOf(W.prototype,Error.prototype),Object.setPrototypeOf(W.prototype,G.prototype),Object.setPrototypeOf(q.prototype,G.prototype);var D={},K=new function t(e){if(!1===d(this,t))return new t(e);var n={},r={};F(r,e||{});var o=new I(r),i=new B(r),c=new T,u=new R(r,c,i),s=function(t,e){var n=r.globalHelpers,o=[e,e.getComponent(),e.getBuffer(),m].concat(n.filter((function(t){return a(e[t])})).map((function(t){return e[t].bind(e)})));return u.get(t).then((function(t){return t.apply(e,o)}))},l=function(t,e){var n=w(t,r.extension),i=o.create(e);return s(n,i).then((function(t){if(i.getExtend()){i.setExtend(!1);var e=i.getLayout(),n=i.clone();return l(e,n)}return t}))};return this.configure=function(t){return F(r,t=t||{}),o.configure(r,n),i.configure(r),c.configure(r),u.configure(r),r},this.render=function(t,e){return l(t,e)},this.helpers=function(t){o.helpers(x(n,t))},this.preload=function(t){return c.load(t||{})},this.create=function(e){return new t(e)},this.compile=function(t,e){return i.compile(t,e)},this.context=function(t){return o.create(t)},this.helpers({require:function(t){var e=w(t,r.extension),n=o.create({});return s(e,n).then((function(){return n.getMacro()}))},render:l}),this}({cache:!1,withObject:!1,resolver:function(t,e){return new Promise((function(t,n){D.hasOwnProperty(e)?t(D[e]):n(new W("template ".concat(e," not found")))}))}}),X=function(t,e){return t=new URL(t),e&&(t.protocol="https:"),t.origin};var z=K.render,Q=K.context,V=K.compile,Z=K.helpers,tt=K.preload,et=K.configure,nt=K.create;t.compile=V,t.configure=et,t.context=Q,t.create=nt,t.helpers=Z,t.preload=tt,t.render=z,t.setRenderer=function(t){var n=t.secure,o=void 0===n||n,i=t.version,a=void 0===i?"1.0":i;return function(){var t,n=(t=r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.data=Q({}),e.data.set("version",a),e.data.set("origin",X(e.req.url,o)),e.ejs=function(t,n){return z(t,Object.assign({},e.data,n))},e.render=function(t,n){return e.html(e.ejs(t,n))},t.next=7,n();case 7:case"end":return t.stop()}}),t)})),function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function c(t){e(a,o,i,c,u,"next",t)}function u(t){e(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(t,e){return n.apply(this,arguments)}}()},t.setTemplates=function(t){Object.assign(D,t||{})}}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ejs={})}(this,(function(t){"use strict";function e(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(){r=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new N(r||[]);return i(a,"_invoke",{value:P(t,n,c)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",v="suspendedYield",g="executing",b="completed",m={};function d(){}function y(){}function w(){}var x={};l(x,c,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(B([])));j&&j!==n&&o.call(j,c)&&(x=j);var O=w.prototype=d.prototype=Object.create(x);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(r,i,a,c){var u=h(t[r],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var r;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}})}function P(e,n,r){var o=p;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=F(c,r);if(u){if(u===m)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=b,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?b:v,s.arg===m)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=b,r.method="throw",r.arg=s.arg)}}}function F(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,F(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=w,i(O,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:y,configurable:!0}),y.displayName=l(w,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(f(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(O),l(O,s,"Generator"),l(O,c,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=B,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var o=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},i=function(t){return Array.isArray(t)},a=function(t){return"function"==typeof t},c=function(t){return"string"==typeof t},u=function(t){return"boolean"==typeof t},s=function(t){return void 0===t},l="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),f={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},p=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},v=p(h),g=p(f),b=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(v,(function(t){return h[t]}))},m=function(t,e){var n=t;return null==n?"":!0===e?b(n):n},d=function(t,e){return Boolean(t instanceof e)},y=function(t,e,n){for(var r=t,o=String(e).split("."),i=o.pop(),c=0;c<o.length;c++){var u=o[c];if(a(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(u)){r={};break}r=r[u]=r[u]||{}}return a(r.toJSON)&&(r=r.toJSON()),[r,i]},w=function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t},x=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.filter((function(t){return t})).reduce((function(t,e){return Object.assign(t,e)}),t)},E=function(){},j=function(t,e){var n;for(n in t)k(t,n)&&e(t[n],n,t)},O=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return j(t,(function(t,o,i){var a=e(t,o,i);!1===s(a)&&(n?r.push(a):r[o]=a)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},L=function(t,e,n){return Promise.resolve(t).then(e.bind(n))},k=function(t,e){return t&&t.hasOwnProperty(e)},P={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(t,e){return Promise.resolve(["resolver is not defined",t,e].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},F=function(t,e){x(t,{path:o(c,P.path,t.path,e.path),export:o(c,P.export,t.export,e.export),resolver:o(a,P.resolver,t.resolver,e.resolver),extension:o(c,P.extension,t.extension,e.extension),withObject:o(u,P.withObject,t.withObject,e.withObject),rmWhitespace:o(u,P.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:o(u,P.cache,t.cache,e.cache),token:x({},P.token,t.token,e.token),vars:x({},P.vars,t.vars,e.vars),globalHelpers:o(i,P.globalHelpers,t.globalHelpers,e.globalHelpers)})},S="undefined"!=typeof globalThis?globalThis:window||self;function T(t){if(!1===d(this,T))return new T;var e={enabled:!0,list:{}};this.configure=function(t){e.enabled=t.cache,!1===l&&this.load(S[t.export])},this.clear=function(){e.list={}},this.load=function(t){return e.enabled&&x(e.list,t||{}),this},this.get=function(t){if(e.enabled)return e.list[t]},this.set=function(t,n){return e.enabled&&(e.list[t]=n),this},this.resolve=function(t){return Promise.resolve(this.get(t))},this.remove=function(t){delete e.list[t]},this.exist=function(t){return k(e.list,t)}}var N=[{symbol:"-",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(t){return"')\n/**".concat(t,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(t){return"')\n".concat(t.trim(),"\n").concat(this.BUFFER,"('")}}];function B(t){if(!1===d(this,B))return new B(t);var e={};this.configure=function(t){e.withObject=t.withObject,e.rmWhitespace=t.rmWhitespace,e.token=t.token,e.vars=t.vars,e.globalHelpers=t.globalHelpers,e.matches=[],e.formats=[],e.slurp={match:"[ \\t]*",start:[e.token.start,"_"],end:["_",e.token.end]},N.forEach((function(t){e.matches.push(e.token.start.concat(t.symbol).concat(e.token.regex).concat(e.token.end)),e.formats.push(t.format.bind(e.vars))})),e.regex=new RegExp(e.matches.join("|").concat("|$"),"g"),e.slurpStart=new RegExp([e.slurp.match,e.slurp.start.join("")].join(""),"gm"),e.slurpEnd=new RegExp([e.slurp.end.join(""),e.slurp.match].join(""),"gm")},this.compile=function(t,n){var r=e.vars,o=r.SCOPE,i=r.SAFE,a=r.BUFFER,c=r.COMPONENT,u=e.globalHelpers;t=String(t),e.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=t.replace(e.slurpStart,e.token.start).replace(e.slurpEnd,e.token.end);var s,l,h,p="".concat(a,"('");s=e.regex,l=function(n,r,o){p+=(""+t.slice(r,o)).replace(g,(function(t){return"\\"+f[t]})),n.forEach((function(t,n){t&&(p+=e.formats[n](t))}))},h=0,t.replace(s,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return l(t,h,e),h=e+n.length,n})),p="try{".concat(p+="');","}catch(e){return ").concat(a,".error(e)}"),e.withObject&&(p="with(".concat(o,"){").concat(p,"}")),p="".concat(a,".start();").concat(p,"return ").concat(a,".end();"),p+="\n//# sourceURL=".concat(n);var v=null,b=[o,c,a,i].concat(u);try{(v=Function.apply(null,b.concat(p))).source="(function(".concat(b.join(","),"){\n").concat(p,"\n});")}catch(t){throw t.filename=n,t.source=p,t}return v},this.configure(t)}function R(t,e,n){if(!1===d(this,R))return new R(t,e,n);if(!1===d(e,T))throw new TypeError("cache is not instance of Cache");if(!1===d(n,B))throw new TypeError("compiler is not instance of Compiler");var r={},o=function(t){return r.resolver(r.path,t)};this.configure=function(t){r.path=t.path,r.cache=t.cache,a(t.resolver)&&(r.resolver=t.resolver)},this.get=function(t){return e.exist(t)?e.resolve(t):o(t).then((function(r){return function(t,n){return e.set(t,n),n}(t,function(t,e){return a(t)?t:n.compile(t,e)}(r,t))}))},this.configure(t)}var _=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],A=" ",$='"',C="/",U="<",M=">",H=function(t,e,n){var r=[],o=-1===_.indexOf(t),i=function(t,e){var n=[];return j(t,(function(t,r,o){var i=e(t,r,o);!1===s(i)&&n.push(i)})),n}(e,(function(t,e){if(null!=t)return[b(e),[$,b(t),$].join("")].join("=")})).join(A);return r.push([U,t,A,i,M].join("")),n&&r.push(n instanceof Array?n.join(""):n),o&&r.push([U,C,t,M].join("")),r.join("")};function G(t){this.code=1,this.name="TemplateError",this.message=t,Error.call(this)}function W(t){G.call(this),this.code=404,this.name="TemplateNotFound",this.message=t}function q(t){G.call(this),this.code=500,this.name="TemplateSyntaxError",this.message=t}function J(t){return Promise.all(t||[]).then((function(t){return t.join("")}))}function Y(){var t=[],e=[];function n(t){e.push(t)}return n.start=function(){e=[]},n.backup=function(){t.push(e.concat()),e=[]},n.restore=function(){var n=e.concat();return e=t.pop(),J(n)},n.error=function(t){return e=t,Promise.reject(new q(e.message));var e},n.end=function(){return J(e)},n}function I(t){if(!1===d(this,I))return new I(t);this.configure=function(t,e){var r,o=t.vars,i=o.BLOCKS,u=o.MACRO,s=o.EXTEND,l=o.LAYOUT,f=o.BUFFER,h=o.COMPONENT;function p(t){this[i]={},this[u]={},x(this,t||{})}this.create=function(t){return new p(t)},this.helpers=function(t){x(p.prototype,t||{})},p.prototype=x({},e||{}),Object.defineProperties(p.prototype,(n(n(n(n(n(n(n(n(n(n(r={},f,{value:Y(),writable:!0,configurable:!1,enumerable:!1}),i,{value:{},writable:!0,configurable:!1,enumerable:!1}),u,{value:{},writable:!0,configurable:!1,enumerable:!1}),l,{value:!1,writable:!0,configurable:!1,enumerable:!1}),s,{value:!1,writable:!0,configurable:!1,enumerable:!1}),"getMacro",{value:function(){return this[u]},writable:!1,configurable:!1,enumerable:!1}),"getBuffer",{value:function(){return this[f]},writable:!1,configurable:!1,enumerable:!1}),"getComponent",{value:function(){var t=this;return h in t?function(){return t[h].apply(t,arguments)}:function(){console.log("%s function not defined",h)}},writable:!1,configurable:!1,enumerable:!1}),"getBlocks",{value:function(){return this[i]},writable:!1,configurable:!1,enumerable:!1}),"setExtend",{value:function(t){this[s]=t},writable:!1,configurable:!1,enumerable:!1}),n(n(n(n(n(n(n(n(n(n(r,"getExtend",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),"setLayout",{value:function(t){this[l]=t},writable:!1,configurable:!1,enumerable:!1}),"getLayout",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),"clone",{value:function(t){var e=[l,s,f];return!0===t&&e.push(i),O(this,e)},writable:!1,configurable:!1,enumerable:!1}),"extend",{value:function(t){this.setExtend(!0),this.setLayout(t)},writable:!1,configurable:!1,enumerable:!1}),"echo",{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)},writable:!1,configurable:!1,enumerable:!1}),"fn",{value:function(t){var e=this.getBuffer(),n=this;return function(){return e.backup(),a(t)&&t.apply(n,arguments),e.restore()}},writable:!1,configurable:!1,enumerable:!1}),"get",{value:function(t,e){var n=y(this,t,!0),r=n.shift(),o=n.pop();return k(r,o)?r[o]:e},writable:!0,configurable:!0,enumerable:!1}),"set",{value:function(t,e){var n=y(this,t,!1),r=n.shift(),o=n.pop();return this.getExtend()&&k(r,o)?r[o]:r[o]=e},writable:!1,configurable:!1,enumerable:!1}),"macro",{value:function(t,e){var n=this.getMacro(),r=this.fn(e),o=this;n[t]=function(){return o.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),n(n(n(n(n(n(n(n(n(r,"call",{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(a(e))return e.apply(e,n)},writable:!1,configurable:!1,enumerable:!1}),"block",{value:function(t,e){var n=this,r=this.getBlocks();if(r[t]=r[t]||[],r[t].push(this.fn(e)),!this.getExtend()){var o=Object.assign([],r[t]),i=function(){return o.shift()},a=function(){var t=i();return t?function(){n.echo(t(a()))}:E};this.echo(i()(a()))}},writable:!1,configurable:!1,enumerable:!1}),"hasBlock",{value:function(t){return this.getBlocks().hasOwnProperty(t)},writable:!1,configurable:!1,enumerable:!1}),"include",{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),o=x(r,e||{}),i=this.render(t,o);this.echo(i)},writable:!1,configurable:!1,enumerable:!1}),"use",{value:function(t,e){var n=this.require(t);this.echo(L(n,(function(t){var n=this.getMacro();j(t,(function(t,r){n[[e,r].join(".")]=t}))}),this))},writable:!1,configurable:!1,enumerable:!1}),"async",{value:function(t,e){this.echo(L(t,(function(t){return this.fn(e)(t)}),this))},writable:!1,configurable:!1,enumerable:!1}),"each",{value:function(t,e){c(t)&&(t=this.get(t,[])),j(t,e)},writable:!1,configurable:!1,enumerable:!1}),"element",{value:function(t,e,n){return H(t,e,n)},writable:!1,configurable:!1,enumerable:!1}),"el",{value:function(t,e,n){a(n)&&(n=this.fn(n)()),this.echo(L(n,(function(n){return this.element(t,e,n)}),this))},writable:!1,configurable:!1,enumerable:!1})))},this.configure(t)}Object.setPrototypeOf(W.prototype,Error.prototype),Object.setPrototypeOf(W.prototype,G.prototype),Object.setPrototypeOf(q.prototype,G.prototype);var D={},K=new function t(e){if(!1===d(this,t))return new t(e);var n={},r={};F(r,e||{});var o=new I(r),i=new B(r),c=new T,u=new R(r,c,i),s=function(t,e){var n=r.globalHelpers,o=[e,e.getComponent(),e.getBuffer(),m].concat(n.filter((function(t){return a(e[t])})).map((function(t){return e[t].bind(e)})));return u.get(t).then((function(t){return t.apply(e,o)}))},l=function(t,e){var n=w(t,r.extension),i=o.create(e);return s(n,i).then((function(t){if(i.getExtend()){i.setExtend(!1);var e=i.getLayout(),n=i.clone();return l(e,n)}return t}))};return this.configure=function(t){return F(r,t=t||{}),o.configure(r,n),i.configure(r),c.configure(r),u.configure(r),r},this.render=function(t,e){return l(t,e)},this.helpers=function(t){o.helpers(x(n,t))},this.preload=function(t){return c.load(t||{})},this.create=function(e){return new t(e)},this.compile=function(t,e){return i.compile(t,e)},this.context=function(t){return o.create(t)},this.helpers({require:function(t){var e=w(t,r.extension),n=o.create({});return s(e,n).then((function(){return n.getMacro()}))},render:l}),this}({cache:!1,withObject:!1,resolver:function(t,e){return new Promise((function(t,n){D.hasOwnProperty(e)?t(D[e]):n(new W("template ".concat(e," not found")))}))}}),X=function(t,e){return t=new URL(t),e&&(t.protocol="https:"),t.origin};var z=K.render,Q=K.context,V=K.compile,Z=K.helpers,tt=K.preload,et=K.configure,nt=K.create;t.compile=V,t.configure=et,t.context=Q,t.create=nt,t.helpers=Z,t.preload=tt,t.render=z,t.setRenderer=function(t){var n=t.secure,o=void 0===n||n,i=t.version,a=void 0===i?"1.0":i;return function(){var t,n=(t=r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.data=Q({}),e.data.set("version",a),e.data.set("origin",X(e.req.url,o)),e.ejs=function(t,n){return z(t,Object.assign({},e.data,n))},e.render=function(t,n){return e.html(e.ejs(t,n))},t.next=7,n();case 7:case"end":return t.stop()}}),t)})),function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function c(t){e(a,o,i,c,u,"next",t)}function u(t){e(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(t,e){return n.apply(this,arguments)}}()},t.setTemplates=function(t){Object.assign(D,t||{})}}));
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "EJS Templates",
4
4
  "homepage": "https://github.com/kosatyi/ejs",
5
5
  "type": "module",
6
- "version": "0.0.85",
6
+ "version": "0.0.87",
7
7
  "main": "dist/cjs/index.js",
8
8
  "module": "dist/esm/index.js",
9
9
  "browser": "dist/umd/browser.js",
@@ -57,13 +57,14 @@
57
57
  },
58
58
  "keywords": [
59
59
  "ejs",
60
- "template-engine",
61
- "nodejs"
60
+ "ejs-express",
61
+ "ejs-cloudflare",
62
+ "ejs-template-engine"
62
63
  ],
63
64
  "peerDependencies": {
64
65
  "glob": "11.x",
65
66
  "process.argv": "1.x",
66
- "terser": "5.x"
67
+ "glob-watcher": "6.x"
67
68
  },
68
69
  "devDependencies": {
69
70
  "@babel/preset-env": "^7.26.0",
@@ -74,8 +75,5 @@
74
75
  "rollup": "^4.28.1",
75
76
  "rollup-plugin-copy": "^3.5.0",
76
77
  "rollup-plugin-ignore": "^1.0.10"
77
- },
78
- "dependencies": {
79
- "glob-watcher": "^6.0.0"
80
78
  }
81
79
  }