@kosatyi/ejs 0.0.99 → 0.0.100

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.
@@ -1027,7 +1027,6 @@
1027
1027
  }
1028
1028
 
1029
1029
  var createContextScope = function createContextScope(config, methods) {
1030
- var _Object$definePropert;
1031
1030
  var _config$vars = config.vars,
1032
1031
  BLOCKS = _config$vars.BLOCKS,
1033
1032
  MACRO = _config$vars.MACRO,
@@ -1049,206 +1048,264 @@
1049
1048
  Object.assign(this, omit(data, [SCOPE, BUFFER, SAFE, COMPONENT, ELEMENT]));
1050
1049
  }
1051
1050
  Object.assign(ContextScope.prototype, methods);
1052
- Object.defineProperties(ContextScope.prototype, (_Object$definePropert = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$definePropert, BUFFER, {
1051
+ Object.defineProperty(ContextScope.prototype, BUFFER, {
1053
1052
  value: createBuffer()
1054
- }), BLOCKS, {
1053
+ });
1054
+ Object.defineProperty(ContextScope.prototype, BLOCKS, {
1055
1055
  value: {},
1056
1056
  writable: true
1057
- }), MACRO, {
1057
+ });
1058
+ Object.defineProperty(ContextScope.prototype, MACRO, {
1058
1059
  value: {},
1059
1060
  writable: true
1060
- }), LAYOUT, {
1061
+ });
1062
+ Object.defineProperty(ContextScope.prototype, LAYOUT, {
1061
1063
  value: false,
1062
1064
  writable: true
1063
- }), EXTEND, {
1065
+ });
1066
+ Object.defineProperty(ContextScope.prototype, EXTEND, {
1064
1067
  value: false,
1065
1068
  writable: true
1066
- }), "useSafeValue", {
1067
- get: function get() {
1068
- return safeValue;
1069
- }
1070
- }), "useComponent", {
1071
- get: function get() {
1072
- if (isFunction(this[COMPONENT])) {
1073
- return this[COMPONENT].bind(this);
1074
- } else {
1075
- return function () {
1076
- throw new Error("".concat(COMPONENT, " must be a function"));
1077
- };
1069
+ });
1070
+ Object.defineProperties(ContextScope.prototype, {
1071
+ /** @type {function} */
1072
+ useSafeValue: {
1073
+ get: function get() {
1074
+ return safeValue;
1078
1075
  }
1079
- }
1080
- }), "useElement", {
1081
- get: function get() {
1082
- if (isFunction(this[ELEMENT])) {
1083
- return this[ELEMENT].bind(this);
1084
- } else {
1076
+ },
1077
+ /** @type {function} */
1078
+ useComponent: {
1079
+ get: function get() {
1080
+ if (isFunction(this[COMPONENT])) {
1081
+ return this[COMPONENT].bind(this);
1082
+ } else {
1083
+ return function () {
1084
+ throw new Error("".concat(COMPONENT, " must be a function"));
1085
+ };
1086
+ }
1087
+ }
1088
+ },
1089
+ /** @type {function} */
1090
+ useElement: {
1091
+ get: function get() {
1092
+ if (isFunction(this[ELEMENT])) {
1093
+ return this[ELEMENT].bind(this);
1094
+ } else {
1095
+ return function () {
1096
+ throw new Error("".concat(ELEMENT, " must be a function"));
1097
+ };
1098
+ }
1099
+ }
1100
+ },
1101
+ /** @type {()=>this[MACRO]} */
1102
+ getMacro: {
1103
+ value: function value() {
1104
+ return this[MACRO];
1105
+ }
1106
+ },
1107
+ /** @type {function} */
1108
+ getBuffer: {
1109
+ value: function value() {
1110
+ return this[BUFFER];
1111
+ }
1112
+ },
1113
+ /** @type {function} */
1114
+ getBlocks: {
1115
+ value: function value() {
1116
+ return this[BLOCKS];
1117
+ }
1118
+ },
1119
+ /** @type {function} */
1120
+ setExtend: {
1121
+ value: function value(_value) {
1122
+ this[EXTEND] = _value;
1123
+ }
1124
+ },
1125
+ /** @type {function} */
1126
+ getExtend: {
1127
+ value: function value() {
1128
+ return this[EXTEND];
1129
+ }
1130
+ },
1131
+ /** @type {function} */
1132
+ setLayout: {
1133
+ value: function value(layout) {
1134
+ this[LAYOUT] = layout;
1135
+ }
1136
+ },
1137
+ /** @type {function} */
1138
+ getLayout: {
1139
+ value: function value() {
1140
+ return this[LAYOUT];
1141
+ }
1142
+ },
1143
+ /** @type {function} */
1144
+ clone: {
1145
+ value: function value(exclude_blocks) {
1146
+ var filter = [LAYOUT, EXTEND, BUFFER];
1147
+ if (exclude_blocks === true) {
1148
+ filter.push(BLOCKS);
1149
+ }
1150
+ return omit(this, filter);
1151
+ }
1152
+ },
1153
+ /** @type {function} */
1154
+ extend: {
1155
+ value: function value(layout) {
1156
+ this.setExtend(true);
1157
+ this.setLayout(layout);
1158
+ }
1159
+ },
1160
+ /** @type {function} */
1161
+ echo: {
1162
+ value: function value(layout) {
1163
+ var buffer = this.getBuffer();
1164
+ var params = [].slice.call(arguments);
1165
+ params.forEach(buffer);
1166
+ }
1167
+ },
1168
+ /** @type {function} */
1169
+ fn: {
1170
+ value: function value(callback) {
1171
+ var buffer = this.getBuffer();
1172
+ var context = this;
1085
1173
  return function () {
1086
- throw new Error("".concat(ELEMENT, " must be a function"));
1174
+ if (isFunction(callback)) {
1175
+ buffer.backup();
1176
+ buffer(callback.apply(context, arguments));
1177
+ return buffer.restore();
1178
+ }
1087
1179
  };
1088
1180
  }
1089
- }
1090
- }), "getMacro", {
1091
- value: function value() {
1092
- return this[MACRO];
1093
- }
1094
- }), "getBuffer", {
1095
- value: function value() {
1096
- return this[BUFFER];
1097
- }
1098
- }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$definePropert, "getBlocks", {
1099
- value: function value() {
1100
- return this[BLOCKS];
1101
- }
1102
- }), "setExtend", {
1103
- value: function value(_value) {
1104
- this[EXTEND] = _value;
1105
- }
1106
- }), "getExtend", {
1107
- value: function value() {
1108
- return this[EXTEND];
1109
- }
1110
- }), "setLayout", {
1111
- value: function value(layout) {
1112
- this[LAYOUT] = layout;
1113
- }
1114
- }), "getLayout", {
1115
- value: function value() {
1116
- return this[LAYOUT];
1117
- }
1118
- }), "clone", {
1119
- value: function value(exclude_blocks) {
1120
- var filter = [LAYOUT, EXTEND, BUFFER];
1121
- if (exclude_blocks === true) {
1122
- filter.push(BLOCKS);
1181
+ },
1182
+ /** @type {function} */
1183
+ macro: {
1184
+ value: function value(name, callback) {
1185
+ var list = this.getMacro();
1186
+ var macro = this.fn(callback);
1187
+ var context = this;
1188
+ list[name] = function () {
1189
+ return context.echo(macro.apply(undefined, arguments));
1190
+ };
1123
1191
  }
1124
- return omit(this, filter);
1125
- }
1126
- }), "extend", {
1127
- value: function value(layout) {
1128
- this.setExtend(true);
1129
- this.setLayout(layout);
1130
- }
1131
- }), "echo", {
1132
- value: function value(layout) {
1133
- var buffer = this.getBuffer();
1134
- var params = [].slice.call(arguments);
1135
- params.forEach(buffer);
1136
- }
1137
- }), "fn", {
1138
- value: function value(callback) {
1139
- var buffer = this.getBuffer();
1140
- var context = this;
1141
- return function () {
1142
- if (isFunction(callback)) {
1143
- buffer.backup();
1144
- buffer(callback.apply(context, arguments));
1145
- return buffer.restore();
1192
+ },
1193
+ /** @type {function} */
1194
+ call: {
1195
+ value: function value(name) {
1196
+ var list = this.getMacro();
1197
+ var macro = list[name];
1198
+ var params = [].slice.call(arguments, 1);
1199
+ if (isFunction(macro)) {
1200
+ return macro.apply(macro, params);
1146
1201
  }
1147
- };
1148
- }
1149
- }), "macro", {
1150
- value: function value(name, callback) {
1151
- var list = this.getMacro();
1152
- var macro = this.fn(callback);
1153
- var context = this;
1154
- list[name] = function () {
1155
- return context.echo(macro.apply(undefined, arguments));
1156
- };
1157
- }
1158
- }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$definePropert, "call", {
1159
- value: function value(name) {
1160
- var list = this.getMacro();
1161
- var macro = list[name];
1162
- var params = [].slice.call(arguments, 1);
1163
- if (isFunction(macro)) {
1164
- return macro.apply(macro, params);
1165
1202
  }
1166
- }
1167
- }), "block", {
1168
- value: function value(name, callback) {
1169
- var _this = this;
1170
- var blocks = this.getBlocks();
1171
- blocks[name] = blocks[name] || [];
1172
- blocks[name].push(this.fn(callback));
1173
- if (this.getExtend()) return;
1174
- var list = Object.assign([], blocks[name]);
1175
- var current = function current() {
1176
- return list.shift();
1177
- };
1178
- var _next = function next() {
1179
- var parent = current();
1180
- if (parent) {
1181
- return function () {
1182
- _this.echo(parent(_next()));
1183
- };
1184
- } else {
1185
- return noop;
1186
- }
1187
- };
1188
- this.echo(current()(_next()));
1189
- }
1190
- }), "hasBlock", {
1191
- value: function value(name) {
1192
- return this.getBlocks().hasOwnProperty(name);
1193
- }
1194
- }), "include", {
1195
- value: function value(path, data, cx) {
1196
- var context = cx === false ? {} : this.clone(true);
1197
- var params = extend(context, data || {});
1198
- var promise = this.render(path, params);
1199
- this.echo(promise);
1200
- }
1201
- }), "use", {
1202
- value: function value(path, namespace) {
1203
- var _this2 = this;
1204
- this.echo(Promise.resolve(this.require(path)).then(function (exports) {
1205
- var list = _this2.getMacro();
1206
- each(exports, function (macro, name) {
1207
- list[[namespace, name].join('.')] = macro;
1208
- });
1209
- }));
1210
- }
1211
- }), "async", {
1212
- value: function value(promise, callback) {
1213
- this.echo(Promise.resolve(promise).then(callback));
1214
- }
1215
- }), "get", {
1216
- value: function value(name, defaults) {
1217
- var path = getPath(this, name, true);
1218
- var result = path.shift();
1219
- var prop = path.pop();
1220
- return hasProp(result, prop) ? result[prop] : defaults;
1221
- }
1222
- }), "set", {
1223
- value: function value(name, _value2) {
1224
- var path = getPath(this, name, false);
1225
- var result = path.shift();
1226
- var prop = path.pop();
1227
- if (this.getExtend() && hasProp(result, prop)) {
1228
- return result[prop];
1203
+ },
1204
+ /** @type {function} */
1205
+ block: {
1206
+ value: function value(name, callback) {
1207
+ var _this = this;
1208
+ var blocks = this.getBlocks();
1209
+ blocks[name] = blocks[name] || [];
1210
+ blocks[name].push(this.fn(callback));
1211
+ if (this.getExtend()) return;
1212
+ var list = Object.assign([], blocks[name]);
1213
+ var current = function current() {
1214
+ return list.shift();
1215
+ };
1216
+ var _next = function next() {
1217
+ var parent = current();
1218
+ if (parent) {
1219
+ return function () {
1220
+ _this.echo(parent(_next()));
1221
+ };
1222
+ } else {
1223
+ return noop;
1224
+ }
1225
+ };
1226
+ this.echo(current()(_next()));
1229
1227
  }
1230
- return result[prop] = _value2;
1231
- }
1232
- }), "each", {
1233
- value: function value(object, callback) {
1234
- if (isString(object)) {
1235
- object = this.get(object, []);
1228
+ },
1229
+ /** @type {function} */
1230
+ hasBlock: {
1231
+ value: function value(name) {
1232
+ return this.getBlocks().hasOwnProperty(name);
1236
1233
  }
1237
- each(object, callback);
1238
1234
  },
1239
- writable: true
1240
- }), "el", {
1241
- value: function value(tag, attr, content) {
1242
- content = isFunction(content) ? this.fn(content)() : content;
1243
- this.echo(Promise.resolve(content).then(function (content) {
1244
- return element(tag, attr, content);
1245
- }));
1235
+ /** @type {function} */
1236
+ include: {
1237
+ value: function value(path, data, cx) {
1238
+ var context = cx === false ? {} : this.clone(true);
1239
+ var params = extend(context, data || {});
1240
+ var promise = this.render(path, params);
1241
+ this.echo(promise);
1242
+ }
1246
1243
  },
1247
- writable: true
1248
- }), _defineProperty(_Object$definePropert, "ui", {
1249
- value: function value(layout) {},
1250
- writable: true
1251
- })));
1244
+ /** @type {function} */
1245
+ use: {
1246
+ value: function value(path, namespace) {
1247
+ var _this2 = this;
1248
+ this.echo(Promise.resolve(this.require(path)).then(function (exports) {
1249
+ var list = _this2.getMacro();
1250
+ each(exports, function (macro, name) {
1251
+ list[[namespace, name].join('.')] = macro;
1252
+ });
1253
+ }));
1254
+ }
1255
+ },
1256
+ /** @type {function} */
1257
+ async: {
1258
+ value: function value(promise, callback) {
1259
+ this.echo(Promise.resolve(promise).then(callback));
1260
+ }
1261
+ },
1262
+ /** @type {function} */
1263
+ get: {
1264
+ value: function value(name, defaults) {
1265
+ var path = getPath(this, name, true);
1266
+ var result = path.shift();
1267
+ var prop = path.pop();
1268
+ return hasProp(result, prop) ? result[prop] : defaults;
1269
+ }
1270
+ },
1271
+ /** @type {function} */
1272
+ set: {
1273
+ value: function value(name, _value2) {
1274
+ var path = getPath(this, name, false);
1275
+ var result = path.shift();
1276
+ var prop = path.pop();
1277
+ if (this.getExtend() && hasProp(result, prop)) {
1278
+ return result[prop];
1279
+ }
1280
+ return result[prop] = _value2;
1281
+ }
1282
+ },
1283
+ /** @type {function} */
1284
+ each: {
1285
+ value: function value(object, callback) {
1286
+ if (isString(object)) {
1287
+ object = this.get(object, []);
1288
+ }
1289
+ each(object, callback);
1290
+ },
1291
+ writable: true
1292
+ },
1293
+ /** @type {function} */
1294
+ el: {
1295
+ value: function value(tag, attr, content) {
1296
+ content = isFunction(content) ? this.fn(content)() : content;
1297
+ this.echo(Promise.resolve(content).then(function (content) {
1298
+ return element(tag, attr, content);
1299
+ }));
1300
+ },
1301
+ writable: true
1302
+ },
1303
+ /** @type {function} */
1304
+ ui: {
1305
+ value: function value(layout) {},
1306
+ writable: true
1307
+ }
1308
+ });
1252
1309
  return ContextScope;
1253
1310
  };
1254
1311
  var _scope = /*#__PURE__*/new WeakMap();
@@ -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){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function n(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function r(t,e,n){return e=l(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,v()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}function o(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,n){return t.get(e(t,n))}function c(t,e,n){o(t,e),e.set(t,n)}function a(t,n,r){return t.set(e(t,n),r),r}function s(t,e){o(t,e),e.add(t)}function f(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,g(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t,e,n){return(e=g(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(v=function(){return!!t})()}function y(){y=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,u=Object.create(i.prototype),c=new F(r||[]);return o(u,"_invoke",{value:P(t,n,c)}),u}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 l="suspendedStart",p="suspendedYield",v="executing",d="completed",g={};function m(){}function w(){}function b(){}var E={};s(E,u,(function(){return this}));var k=Object.getPrototypeOf,j=k&&k(k(W([])));j&&j!==n&&r.call(j,u)&&(E=j);var O=b.prototype=m.prototype=Object.create(E);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function n(o,i,u,c){var a=h(t[o],t,i);if("throw"!==a.type){var s=a.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return n("throw",t,u,c)}))}c(a.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,n,r){var o=l;return function(i,u){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw u;return{value:t,done:!0}}for(r.method=i,r.arg=u;;){var c=r.delegate;if(c){var a=S(c,r);if(a){if(a===g)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===l)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?d:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=d,r.method="throw",r.arg=s.arg)}}}function S(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,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var u=i.arg;return u?u.done?(n[e.resultName]=u.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):u:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function M(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 F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function W(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],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 w.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,a,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,a,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var u=new L(f(t,n,r,o),i);return e.isGeneratorFunction(n)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},x(O),s(O,a,"Generator"),s(O,u,(function(){return this})),s(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=W,F.prototype={constructor:F,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)&&r.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 o(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 u=this.tryEntries[i],c=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var a=r.call(u,"catchLoc"),s=r.call(u,"finallyLoc");if(a&&s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(u)},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),g},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),g}},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:W(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function g(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);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}function m(t){var e="function"==typeof Map?new Map:void 0;return m=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(v())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&d(o,n.prototype),o}(t,arguments,l(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)},m(t)}var w=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},b=function(t){return Array.isArray(t)},E=function(t){return"function"==typeof t},k=function(t){return"string"==typeof t},j=function(t){return"boolean"==typeof t},O=function(t){return void 0===t},x="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),L={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},P={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},S=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},M=S(P),T=S(L),F=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(M,(function(t){return P[t]}))},W=function(t,e){var n=t;return null==n?"":!0===Boolean(e)?F(n):n},_=function(t,e){if(!1===function(t,e){return Boolean(t instanceof e)}(t,e))throw new TypeError("".concat(t," in not instance of ").concat(e))},N=function(t,e,n){for(var r=t,o=String(e).split("."),i=o.pop(),u=0;u<o.length;u++){var c=o[u];if(E(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(c)){r={};break}r=r[c]=r[c]||{}}return E(r.toJSON)&&(r=r.toJSON()),[r,i]},B=function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t},R=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)},A=function(){},C=function(t,e){var n;for(n in t)U(t,n)&&e(t[n],n,t)},$=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return C(t,(function(t,o,i){var u=e(t,o,i);!1===O(u)&&(n?r.push(u):r[o]=u)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},U=function(t,e){return t&&t.hasOwnProperty(e)},q={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",ELEMENT:"el",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},H=function(t,e){R(t,{path:w(k,q.path,t.path,e.path),export:w(k,q.export,t.export,e.export),resolver:w(E,q.resolver,t.resolver,e.resolver),extension:w(k,q.extension,t.extension,e.extension),withObject:w(j,q.withObject,t.withObject,e.withObject),rmWhitespace:w(j,q.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:w(j,q.cache,t.cache,e.cache),token:R({},q.token,t.token,e.token),vars:R({},q.vars,t.vars,e.vars),globalHelpers:w(b,q.globalHelpers,t.globalHelpers,e.globalHelpers)})},G="undefined"!=typeof globalThis?globalThis:window||self,J=new WeakMap,Y=new WeakMap,D=function(){return f((function t(e){i(this,t),c(this,J,!0),c(this,Y,{}),this.configure(e)}),[{key:"load",value:function(t){u(J,this)&&R(u(Y,this),t||{})}},{key:"get",value:function(t){if(u(J,this))return u(Y,this)[t]}},{key:"set",value:function(t,e){u(J,this)&&(u(Y,this)[t]=e)}},{key:"exist",value:function(t){return U(u(Y,this),t)}},{key:"clear",value:function(){a(Y,this,{})}},{key:"remove",value:function(t){delete u(Y,this)[t]}},{key:"resolve",value:function(t){return Promise.resolve(this.get(t))}},{key:"configure",value:function(t){a(J,this,t.cache),!1===x&&this.load(G[t.export])}}])}(),I=new WeakMap,K=new WeakMap,V=function(){return f((function t(e){i(this,t),c(this,I,{}),c(this,K,[{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,"('")}}]),this.configure(e)}),[{key:"configure",value:function(t){var e=this;u(I,this).withObject=t.withObject,u(I,this).rmWhitespace=t.rmWhitespace,u(I,this).token=t.token,u(I,this).vars=t.vars,u(I,this).globalHelpers=t.globalHelpers,u(I,this).matches=[],u(I,this).formats=[],u(I,this).slurp={match:"[s\t\n]*",start:[u(I,this).token.start,"_"],end:["_",u(I,this).token.end]},u(K,this).forEach((function(t){u(I,e).matches.push(u(I,e).token.start.concat(t.symbol).concat(u(I,e).token.regex).concat(u(I,e).token.end)),u(I,e).formats.push(t.format.bind(u(I,e).vars))})),u(I,this).regex=new RegExp(u(I,this).matches.join("|").concat("|$"),"g"),u(I,this).slurpStart=new RegExp([u(I,this).slurp.match,u(I,this).slurp.start.join("")].join(""),"gm"),u(I,this).slurpEnd=new RegExp([u(I,this).slurp.end.join(""),u(I,this).slurp.match].join(""),"gm")}},{key:"compile",value:function(t,e){var n=this,r=u(I,this).vars,o=r.SCOPE,i=r.SAFE,c=r.BUFFER,a=r.COMPONENT,s=r.ELEMENT,f=u(I,this).globalHelpers;u(I,this).rmWhitespace&&(t=String(t).replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=String(t).replace(u(I,this).slurpStart,u(I,this).token.start).replace(u(I,this).slurpEnd,u(I,this).token.end);var h,l,p,v="".concat(c,"('");h=u(I,this).regex,l=function(e,r,o){v+=(""+t.slice(r,o)).replace(T,(function(t){return"\\"+L[t]})),e.forEach((function(t,e){t&&(v+=u(I,n).formats[e](t))}))},p=0,t.replace(h,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return l(t,p,e),p=e+n.length,n})),v="try{".concat(v+="');","}catch(e){return ").concat(c,".error(e)}"),u(I,this).withObject&&(v="with(".concat(o,"){").concat(v,"}")),v="".concat(c,".start();").concat(v,"return ").concat(c,".end();"),v+="\n//# sourceURL=".concat(e);var y=null,d=[o,c,i,a,s].concat(f);try{(y=Function.apply(null,d.concat(v))).source="(function(".concat(d.join(","),"){\n").concat(v,"\n});")}catch(t){throw t.filename=e,t.source=v,t}return y}}])}(),X=new WeakMap,z=new WeakMap,Q=new WeakMap,Z=new WeakMap,tt=new WeakSet,et=function(){return f((function t(e,n,r){i(this,t),s(this,tt),c(this,X,void 0),c(this,z,void 0),c(this,Q,void 0),c(this,Z,void 0),_(n,D),_(r,V),a(z,this,n),a(Q,this,r),this.configure(e)}),[{key:"configure",value:function(t){a(X,this,t.path),E(t.resolver)&&a(Z,this,t.resolver)}},{key:"get",value:function(t){var n=this;return u(z,this).exist(t)?u(z,this).resolve(t):e(tt,this,nt).call(this,t).then((function(r){return e(tt,n,rt).call(n,t,e(tt,n,ot).call(n,r,t))}))}}])}();function nt(t){return u(Z,this).call(this,u(X,this),t)}function rt(t,e){return u(z,this).set(t,e),e}function ot(t,e){return E(t)?t:u(Q,this).compile(t,e)}var it=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],ut=" ",ct='"',at="/",st="<",ft=">",ht=function(t,e,n){var r=[],o=-1===it.indexOf(t),i=function(t,e){var n=[];return C(t,(function(t,r,o){var i=e(t,r,o);!1===O(i)&&n.push(i)})),n}(e,(function(t,e){if(null!=t)return[F(e),[ct,F(t),ct].join("")].join("=")})).join(ut);return r.push([st,t,ut,i,ft].join("")),n&&o&&r.push(n instanceof Array?n.join(""):n),o&&r.push([st,at,t,ft].join("")),r.join("")},lt=function(t){function e(t){var n;return i(this,e),h(n=r(this,e),"code",0),n.message=t,n}return p(e,t),f(e,[{key:"getCode",value:function(){return this.code}},{key:"getMessage",value:function(){return this.message}},{key:"toString",value:function(){return this.getMessage()}}])}(m(Error)),pt=function(t){function e(){var t;i(this,e);for(var n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=arguments[u];return h(t=r(this,e,[].concat(o)),"code",404),t}return p(e,t),f(e)}(lt),vt=function(t){function e(){var t;i(this,e);for(var n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=arguments[u];return h(t=r(this,e,[].concat(o)),"code",500),t}return p(e,t),f(e)}(lt);function yt(t){return Promise.all(t||[]).then((function(t){return t.join("")})).catch((function(t){return t}))}function dt(){var t=[],e=[],n=function(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(),yt(n)},n.error=function(t){return e=t,Promise.reject(new vt(e.message));var e},n.end=function(){return yt(e)},n}var gt=new WeakMap,mt=function(){return f((function t(e,n){i(this,t),c(this,gt,void 0),this.configure(e,n)}),[{key:"create",value:function(t){return new(u(gt,this))(t)}},{key:"configure",value:function(t,e){a(gt,this,function(t,e){var n,r=t.vars,o=r.BLOCKS,i=r.MACRO,u=r.EXTEND,c=r.LAYOUT,a=r.BUFFER,s=r.SAFE,f=r.SCOPE,l=r.COMPONENT,p=r.ELEMENT;function v(t){this[o]={},this[i]={},Object.assign(this,$(t,[f,a,s,l,p]))}return Object.assign(v.prototype,e),Object.defineProperties(v.prototype,(h(h(h(h(h(h(h(h(h(h(n={},a,{value:dt()}),o,{value:{},writable:!0}),i,{value:{},writable:!0}),c,{value:!1,writable:!0}),u,{value:!1,writable:!0}),"useSafeValue",{get:function(){return W}}),"useComponent",{get:function(){return E(this[l])?this[l].bind(this):function(){throw new Error("".concat(l," must be a function"))}}}),"useElement",{get:function(){return E(this[p])?this[p].bind(this):function(){throw new Error("".concat(p," must be a function"))}}}),"getMacro",{value:function(){return this[i]}}),"getBuffer",{value:function(){return this[a]}}),h(h(h(h(h(h(h(h(h(h(n,"getBlocks",{value:function(){return this[o]}}),"setExtend",{value:function(t){this[u]=t}}),"getExtend",{value:function(){return this[u]}}),"setLayout",{value:function(t){this[c]=t}}),"getLayout",{value:function(){return this[c]}}),"clone",{value:function(t){var e=[c,u,a];return!0===t&&e.push(o),$(this,e)}}),"extend",{value:function(t){this.setExtend(!0),this.setLayout(t)}}),"echo",{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)}}),"fn",{value:function(t){var e=this.getBuffer(),n=this;return function(){if(E(t))return e.backup(),e(t.apply(n,arguments)),e.restore()}}}),"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))}}}),h(h(h(h(h(h(h(h(h(h(n,"call",{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(E(e))return e.apply(e,n)}}),"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()},u=function(){var t=i();return t?function(){n.echo(t(u()))}:A};this.echo(i()(u()))}}}),"hasBlock",{value:function(t){return this.getBlocks().hasOwnProperty(t)}}),"include",{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),o=R(r,e||{}),i=this.render(t,o);this.echo(i)}}),"use",{value:function(t,e){var n=this;this.echo(Promise.resolve(this.require(t)).then((function(t){var r=n.getMacro();C(t,(function(t,n){r[[e,n].join(".")]=t}))})))}}),"async",{value:function(t,e){this.echo(Promise.resolve(t).then(e))}}),"get",{value:function(t,e){var n=N(this,t,!0),r=n.shift(),o=n.pop();return U(r,o)?r[o]:e}}),"set",{value:function(t,e){var n=N(this,t,!1),r=n.shift(),o=n.pop();return this.getExtend()&&U(r,o)?r[o]:r[o]=e}}),"each",{value:function(t,e){k(t)&&(t=this.get(t,[])),C(t,e)},writable:!0}),"el",{value:function(t,e,n){n=E(n)?this.fn(n)():n,this.echo(Promise.resolve(n).then((function(n){return ht(t,e,n)})))},writable:!0}),h(n,"ui",{value:function(t){},writable:!0}))),v}(t,e))}},{key:"helpers",value:function(t){R(u(gt,this).prototype,t||{})}}])}(),wt=new WeakMap,bt=new WeakMap,Et=new WeakMap,kt=new WeakMap,jt=new WeakMap,Ot=new WeakMap,xt=new WeakSet,Lt=function(){return f((function t(e){i(this,t),s(this,xt),c(this,wt,{}),c(this,bt,{}),c(this,Et,void 0),c(this,kt,void 0),c(this,jt,void 0),c(this,Ot,void 0),H(u(wt,this),e||{}),a(Et,this,new mt(u(wt,this),u(bt,this))),a(kt,this,new V(u(wt,this))),a(jt,this,new D(u(wt,this))),a(Ot,this,new et(u(wt,this),u(jt,this),u(kt,this))),function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((function(e){e in t&&(t[e]=t[e].bind(t))}))}(this,["configure","create","render","require","context","preload","compile","helpers"]),this.helpers({require:this.require,render:this.render})}),[{key:"configure",value:function(t){return H(u(wt,this),t||{}),u(Et,this).configure(u(wt,this),u(bt,this)),u(kt,this).configure(u(wt,this)),u(jt,this).configure(u(wt,this)),u(Ot,this).configure(u(wt,this)),u(wt,this)}},{key:"render",value:function(t,n){var r=this,o=B(t,u(wt,this).extension),i=this.context(n);return e(xt,this,Pt).call(this,o,i).then((function(t){if(i.getExtend()){i.setExtend(!1);var e=i.getLayout(),n=i.clone();return r.render(e,n)}return t}))}},{key:"helpers",value:function(t){u(Et,this).helpers(R(u(bt,this),t))}},{key:"context",value:function(t){return u(Et,this).create(t)}},{key:"compile",value:function(t,e){return u(kt,this).compile(t,e)}},{key:"preload",value:function(t){return u(jt,this).load(t||{})}},{key:"create",value:function(t){return new this.constructor(t)}},{key:"require",value:function(t){var n=B(t,u(wt,this).extension),r=this.context({});return e(xt,this,Pt).call(this,n,r).then((function(){return r.getMacro()}))}}])}();function Pt(t,e){var n=u(wt,this).globalHelpers,r=[e,e.getBuffer(),e.useSafeValue,e.useComponent,e.useElement].concat(n.filter((function(t){return E(e[t])})).map((function(t){return e[t].bind(e)})));return u(Ot,this).get(t).then((function(t){return t.apply(e,r)}))}var St={},Mt=function(t,e){return(t=new URL(t)).protocol=e?"https:":"http:",t.origin},Tt=new Lt({cache:!1,withObject:!1,resolver:function(t,e){return new Promise((function(t,n){St.hasOwnProperty(e)?t(St[e]):n(new pt("template ".concat(e," not found")))}))}}),Ft=Tt.render,Wt=Tt.context,_t=Tt.helpers,Nt=Tt.configure,Bt=Tt.create;t.TemplateError=lt,t.TemplateNotFound=pt,t.TemplateSyntaxError=vt,t.configure=Nt,t.context=Wt,t.create=Bt,t.helpers=_t,t.render=Ft,t.setRenderer=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.version,r=t.secure,o=void 0===r||r;return function(){var t,r=(t=y().mark((function t(n,r){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.data=Wt({}),n.data.set("version",e),n.data.set("origin",Mt(n.req.url,o)),n.data.set("path",n.req.path),n.data.set("query",n.req.query()),n.ejs=function(t,e){return Ft(t,Object.assign({param:n.req.param()},n.data,e))},n.helpers=function(t){return _t(t)},n.render=function(t,e){return n.html(n.ejs(t,e))},t.next=10,r();case 10:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(o,i){var u=t.apply(e,r);function c(t){n(u,o,i,c,a,"next",t)}function a(t){n(u,o,i,c,a,"throw",t)}c(void 0)}))});return function(t,e){return r.apply(this,arguments)}}()},t.setTemplates=function(t){Object.assign(St,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){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function n(t,e,n,r,o,i,c){try{var u=t[i](c),a=u.value}catch(t){return void n(t)}u.done?e(a):Promise.resolve(a).then(r,o)}function r(t,e,n){return e=l(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,v()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}function o(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,n){return t.get(e(t,n))}function u(t,e,n){o(t,e),e.set(t,n)}function a(t,n,r){return t.set(e(t,n),r),r}function s(t,e){o(t,e),e.add(t)}function f(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,g(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t,e,n){return(e=g(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(v=function(){return!!t})()}function y(){y=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,c=Object.create(i.prototype),u=new F(r||[]);return o(c,"_invoke",{value:L(t,n,u)}),c}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 l="suspendedStart",p="suspendedYield",v="executing",d="completed",g={};function m(){}function w(){}function b(){}var E={};s(E,c,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(W([])));O&&O!==n&&r.call(O,c)&&(E=O);var k=b.prototype=m.prototype=Object.create(E);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function n(o,i,c,u){var a=h(t[o],t,i);if("throw"!==a.type){var s=a.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(a.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function L(e,n,r){var o=l;return function(i,c){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw c;return{value:t,done:!0}}for(r.method=i,r.arg=c;;){var u=r.delegate;if(u){var a=S(u,r);if(a){if(a===g)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===l)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?d:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=d,r.method="throw",r.arg=s.arg)}}}function S(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,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var c=i.arg;return c?c.done?(n[e.resultName]=c.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):c:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function M(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 F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function W(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 o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],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 w.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,a,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,a,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},x(P.prototype),s(P.prototype,u,(function(){return this})),e.AsyncIterator=P,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var c=new P(f(t,n,r,o),i);return e.isGeneratorFunction(n)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},x(k),s(k,a,"Generator"),s(k,c,(function(){return this})),s(k,"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=W,F.prototype={constructor:F,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)&&r.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 o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var c=this.tryEntries[i],u=c.completion;if("root"===c.tryLoc)return o("end");if(c.tryLoc<=this.prev){var a=r.call(c,"catchLoc"),s=r.call(c,"finallyLoc");if(a&&s){if(this.prev<c.catchLoc)return o(c.catchLoc,!0);if(this.prev<c.finallyLoc)return o(c.finallyLoc)}else if(a){if(this.prev<c.catchLoc)return o(c.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return o(c.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(c)},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),g},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),g}},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:W(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function g(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);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}function m(t){var e="function"==typeof Map?new Map:void 0;return m=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(v())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&d(o,n.prototype),o}(t,arguments,l(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)},m(t)}var w=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},b=function(t){return Array.isArray(t)},E=function(t){return"function"==typeof t},j=function(t){return"string"==typeof t},O=function(t){return"boolean"==typeof t},k=function(t){return void 0===t},x="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),P={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},S=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},M=S(L),T=S(P),F=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(M,(function(t){return L[t]}))},W=function(t,e){var n=t;return null==n?"":!0===Boolean(e)?F(n):n},_=function(t,e){if(!1===function(t,e){return Boolean(t instanceof e)}(t,e))throw new TypeError("".concat(t," in not instance of ").concat(e))},N=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(E(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(u)){r={};break}r=r[u]=r[u]||{}}return E(r.toJSON)&&(r=r.toJSON()),[r,i]},B=function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t},R=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)},A=function(){},C=function(t,e){var n;for(n in t)U(t,n)&&e(t[n],n,t)},$=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return C(t,(function(t,o,i){var c=e(t,o,i);!1===k(c)&&(n?r.push(c):r[o]=c)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},U=function(t,e){return t&&t.hasOwnProperty(e)},q={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",ELEMENT:"el",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},H=function(t,e){R(t,{path:w(j,q.path,t.path,e.path),export:w(j,q.export,t.export,e.export),resolver:w(E,q.resolver,t.resolver,e.resolver),extension:w(j,q.extension,t.extension,e.extension),withObject:w(O,q.withObject,t.withObject,e.withObject),rmWhitespace:w(O,q.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:w(O,q.cache,t.cache,e.cache),token:R({},q.token,t.token,e.token),vars:R({},q.vars,t.vars,e.vars),globalHelpers:w(b,q.globalHelpers,t.globalHelpers,e.globalHelpers)})},G="undefined"!=typeof globalThis?globalThis:window||self,J=new WeakMap,Y=new WeakMap,D=function(){return f((function t(e){i(this,t),u(this,J,!0),u(this,Y,{}),this.configure(e)}),[{key:"load",value:function(t){c(J,this)&&R(c(Y,this),t||{})}},{key:"get",value:function(t){if(c(J,this))return c(Y,this)[t]}},{key:"set",value:function(t,e){c(J,this)&&(c(Y,this)[t]=e)}},{key:"exist",value:function(t){return U(c(Y,this),t)}},{key:"clear",value:function(){a(Y,this,{})}},{key:"remove",value:function(t){delete c(Y,this)[t]}},{key:"resolve",value:function(t){return Promise.resolve(this.get(t))}},{key:"configure",value:function(t){a(J,this,t.cache),!1===x&&this.load(G[t.export])}}])}(),I=new WeakMap,K=new WeakMap,V=function(){return f((function t(e){i(this,t),u(this,I,{}),u(this,K,[{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,"('")}}]),this.configure(e)}),[{key:"configure",value:function(t){var e=this;c(I,this).withObject=t.withObject,c(I,this).rmWhitespace=t.rmWhitespace,c(I,this).token=t.token,c(I,this).vars=t.vars,c(I,this).globalHelpers=t.globalHelpers,c(I,this).matches=[],c(I,this).formats=[],c(I,this).slurp={match:"[s\t\n]*",start:[c(I,this).token.start,"_"],end:["_",c(I,this).token.end]},c(K,this).forEach((function(t){c(I,e).matches.push(c(I,e).token.start.concat(t.symbol).concat(c(I,e).token.regex).concat(c(I,e).token.end)),c(I,e).formats.push(t.format.bind(c(I,e).vars))})),c(I,this).regex=new RegExp(c(I,this).matches.join("|").concat("|$"),"g"),c(I,this).slurpStart=new RegExp([c(I,this).slurp.match,c(I,this).slurp.start.join("")].join(""),"gm"),c(I,this).slurpEnd=new RegExp([c(I,this).slurp.end.join(""),c(I,this).slurp.match].join(""),"gm")}},{key:"compile",value:function(t,e){var n=this,r=c(I,this).vars,o=r.SCOPE,i=r.SAFE,u=r.BUFFER,a=r.COMPONENT,s=r.ELEMENT,f=c(I,this).globalHelpers;c(I,this).rmWhitespace&&(t=String(t).replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=String(t).replace(c(I,this).slurpStart,c(I,this).token.start).replace(c(I,this).slurpEnd,c(I,this).token.end);var h,l,p,v="".concat(u,"('");h=c(I,this).regex,l=function(e,r,o){v+=(""+t.slice(r,o)).replace(T,(function(t){return"\\"+P[t]})),e.forEach((function(t,e){t&&(v+=c(I,n).formats[e](t))}))},p=0,t.replace(h,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return l(t,p,e),p=e+n.length,n})),v="try{".concat(v+="');","}catch(e){return ").concat(u,".error(e)}"),c(I,this).withObject&&(v="with(".concat(o,"){").concat(v,"}")),v="".concat(u,".start();").concat(v,"return ").concat(u,".end();"),v+="\n//# sourceURL=".concat(e);var y=null,d=[o,u,i,a,s].concat(f);try{(y=Function.apply(null,d.concat(v))).source="(function(".concat(d.join(","),"){\n").concat(v,"\n});")}catch(t){throw t.filename=e,t.source=v,t}return y}}])}(),X=new WeakMap,z=new WeakMap,Q=new WeakMap,Z=new WeakMap,tt=new WeakSet,et=function(){return f((function t(e,n,r){i(this,t),s(this,tt),u(this,X,void 0),u(this,z,void 0),u(this,Q,void 0),u(this,Z,void 0),_(n,D),_(r,V),a(z,this,n),a(Q,this,r),this.configure(e)}),[{key:"configure",value:function(t){a(X,this,t.path),E(t.resolver)&&a(Z,this,t.resolver)}},{key:"get",value:function(t){var n=this;return c(z,this).exist(t)?c(z,this).resolve(t):e(tt,this,nt).call(this,t).then((function(r){return e(tt,n,rt).call(n,t,e(tt,n,ot).call(n,r,t))}))}}])}();function nt(t){return c(Z,this).call(this,c(X,this),t)}function rt(t,e){return c(z,this).set(t,e),e}function ot(t,e){return E(t)?t:c(Q,this).compile(t,e)}var it=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],ct=" ",ut='"',at="/",st="<",ft=">",ht=function(t,e,n){var r=[],o=-1===it.indexOf(t),i=function(t,e){var n=[];return C(t,(function(t,r,o){var i=e(t,r,o);!1===k(i)&&n.push(i)})),n}(e,(function(t,e){if(null!=t)return[F(e),[ut,F(t),ut].join("")].join("=")})).join(ct);return r.push([st,t,ct,i,ft].join("")),n&&o&&r.push(n instanceof Array?n.join(""):n),o&&r.push([st,at,t,ft].join("")),r.join("")},lt=function(t){function e(t){var n;return i(this,e),h(n=r(this,e),"code",0),n.message=t,n}return p(e,t),f(e,[{key:"getCode",value:function(){return this.code}},{key:"getMessage",value:function(){return this.message}},{key:"toString",value:function(){return this.getMessage()}}])}(m(Error)),pt=function(t){function e(){var t;i(this,e);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return h(t=r(this,e,[].concat(o)),"code",404),t}return p(e,t),f(e)}(lt),vt=function(t){function e(){var t;i(this,e);for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return h(t=r(this,e,[].concat(o)),"code",500),t}return p(e,t),f(e)}(lt);function yt(t){return Promise.all(t||[]).then((function(t){return t.join("")})).catch((function(t){return t}))}function dt(){var t=[],e=[],n=function(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(),yt(n)},n.error=function(t){return e=t,Promise.reject(new vt(e.message));var e},n.end=function(){return yt(e)},n}var gt=new WeakMap,mt=function(){return f((function t(e,n){i(this,t),u(this,gt,void 0),this.configure(e,n)}),[{key:"create",value:function(t){return new(c(gt,this))(t)}},{key:"configure",value:function(t,e){a(gt,this,function(t,e){var n=t.vars,r=n.BLOCKS,o=n.MACRO,i=n.EXTEND,c=n.LAYOUT,u=n.BUFFER,a=n.SAFE,s=n.SCOPE,f=n.COMPONENT,h=n.ELEMENT;function l(t){this[r]={},this[o]={},Object.assign(this,$(t,[s,u,a,f,h]))}return Object.assign(l.prototype,e),Object.defineProperty(l.prototype,u,{value:dt()}),Object.defineProperty(l.prototype,r,{value:{},writable:!0}),Object.defineProperty(l.prototype,o,{value:{},writable:!0}),Object.defineProperty(l.prototype,c,{value:!1,writable:!0}),Object.defineProperty(l.prototype,i,{value:!1,writable:!0}),Object.defineProperties(l.prototype,{useSafeValue:{get:function(){return W}},useComponent:{get:function(){return E(this[f])?this[f].bind(this):function(){throw new Error("".concat(f," must be a function"))}}},useElement:{get:function(){return E(this[h])?this[h].bind(this):function(){throw new Error("".concat(h," must be a function"))}}},getMacro:{value:function(){return this[o]}},getBuffer:{value:function(){return this[u]}},getBlocks:{value:function(){return this[r]}},setExtend:{value:function(t){this[i]=t}},getExtend:{value:function(){return this[i]}},setLayout:{value:function(t){this[c]=t}},getLayout:{value:function(){return this[c]}},clone:{value:function(t){var e=[c,i,u];return!0===t&&e.push(r),$(this,e)}},extend:{value:function(t){this.setExtend(!0),this.setLayout(t)}},echo:{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)}},fn:{value:function(t){var e=this.getBuffer(),n=this;return function(){if(E(t))return e.backup(),e(t.apply(n,arguments)),e.restore()}}},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))}}},call:{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(E(e))return e.apply(e,n)}},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()},c=function(){var t=i();return t?function(){n.echo(t(c()))}:A};this.echo(i()(c()))}}},hasBlock:{value:function(t){return this.getBlocks().hasOwnProperty(t)}},include:{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),o=R(r,e||{}),i=this.render(t,o);this.echo(i)}},use:{value:function(t,e){var n=this;this.echo(Promise.resolve(this.require(t)).then((function(t){var r=n.getMacro();C(t,(function(t,n){r[[e,n].join(".")]=t}))})))}},async:{value:function(t,e){this.echo(Promise.resolve(t).then(e))}},get:{value:function(t,e){var n=N(this,t,!0),r=n.shift(),o=n.pop();return U(r,o)?r[o]:e}},set:{value:function(t,e){var n=N(this,t,!1),r=n.shift(),o=n.pop();return this.getExtend()&&U(r,o)?r[o]:r[o]=e}},each:{value:function(t,e){j(t)&&(t=this.get(t,[])),C(t,e)},writable:!0},el:{value:function(t,e,n){n=E(n)?this.fn(n)():n,this.echo(Promise.resolve(n).then((function(n){return ht(t,e,n)})))},writable:!0},ui:{value:function(t){},writable:!0}}),l}(t,e))}},{key:"helpers",value:function(t){R(c(gt,this).prototype,t||{})}}])}(),wt=new WeakMap,bt=new WeakMap,Et=new WeakMap,jt=new WeakMap,Ot=new WeakMap,kt=new WeakMap,xt=new WeakSet,Pt=function(){return f((function t(e){i(this,t),s(this,xt),u(this,wt,{}),u(this,bt,{}),u(this,Et,void 0),u(this,jt,void 0),u(this,Ot,void 0),u(this,kt,void 0),H(c(wt,this),e||{}),a(Et,this,new mt(c(wt,this),c(bt,this))),a(jt,this,new V(c(wt,this))),a(Ot,this,new D(c(wt,this))),a(kt,this,new et(c(wt,this),c(Ot,this),c(jt,this))),function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((function(e){e in t&&(t[e]=t[e].bind(t))}))}(this,["configure","create","render","require","context","preload","compile","helpers"]),this.helpers({require:this.require,render:this.render})}),[{key:"configure",value:function(t){return H(c(wt,this),t||{}),c(Et,this).configure(c(wt,this),c(bt,this)),c(jt,this).configure(c(wt,this)),c(Ot,this).configure(c(wt,this)),c(kt,this).configure(c(wt,this)),c(wt,this)}},{key:"render",value:function(t,n){var r=this,o=B(t,c(wt,this).extension),i=this.context(n);return e(xt,this,Lt).call(this,o,i).then((function(t){if(i.getExtend()){i.setExtend(!1);var e=i.getLayout(),n=i.clone();return r.render(e,n)}return t}))}},{key:"helpers",value:function(t){c(Et,this).helpers(R(c(bt,this),t))}},{key:"context",value:function(t){return c(Et,this).create(t)}},{key:"compile",value:function(t,e){return c(jt,this).compile(t,e)}},{key:"preload",value:function(t){return c(Ot,this).load(t||{})}},{key:"create",value:function(t){return new this.constructor(t)}},{key:"require",value:function(t){var n=B(t,c(wt,this).extension),r=this.context({});return e(xt,this,Lt).call(this,n,r).then((function(){return r.getMacro()}))}}])}();function Lt(t,e){var n=c(wt,this).globalHelpers,r=[e,e.getBuffer(),e.useSafeValue,e.useComponent,e.useElement].concat(n.filter((function(t){return E(e[t])})).map((function(t){return e[t].bind(e)})));return c(kt,this).get(t).then((function(t){return t.apply(e,r)}))}var St={},Mt=function(t,e){return(t=new URL(t)).protocol=e?"https:":"http:",t.origin},Tt=new Pt({cache:!1,withObject:!1,resolver:function(t,e){return new Promise((function(t,n){St.hasOwnProperty(e)?t(St[e]):n(new pt("template ".concat(e," not found")))}))}}),Ft=Tt.render,Wt=Tt.context,_t=Tt.helpers,Nt=Tt.configure,Bt=Tt.create;t.TemplateError=lt,t.TemplateNotFound=pt,t.TemplateSyntaxError=vt,t.configure=Nt,t.context=Wt,t.create=Bt,t.helpers=_t,t.render=Ft,t.setRenderer=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.version,r=t.secure,o=void 0===r||r;return function(){var t,r=(t=y().mark((function t(n,r){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.data=Wt({}),n.data.set("version",e),n.data.set("origin",Mt(n.req.url,o)),n.data.set("path",n.req.path),n.data.set("query",n.req.query()),n.ejs=function(t,e){return Ft(t,Object.assign({param:n.req.param()},n.data,e))},n.helpers=function(t){return _t(t)},n.render=function(t,e){return n.html(n.ejs(t,e))},t.next=10,r();case 10:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(o,i){var c=t.apply(e,r);function u(t){n(c,o,i,u,a,"next",t)}function a(t){n(c,o,i,u,a,"throw",t)}u(void 0)}))});return function(t,e){return r.apply(this,arguments)}}()},t.setTemplates=function(t){Object.assign(St,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.99",
6
+ "version": "0.0.100",
7
7
  "main": "dist/cjs/index.js",
8
8
  "module": "dist/esm/index.js",
9
9
  "browser": "dist/umd/browser.js",