diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f765da..3611a6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## Template7 v1.4.1 - Released on February 5, 2019 + * Relaxed `escape` helper to escape only `<>&"'` characters + * Improved variables parsing in `js` and `js_if` helpers + ## Template7 v1.4.0 - Released on August 31, 2018 * Added TypeScript definitions diff --git a/dist/template7.esm.js b/dist/template7.esm.js index ada675f..c27d3a4 100644 --- a/dist/template7.esm.js +++ b/dist/template7.esm.js @@ -1,17 +1,18 @@ /** - * Template7 1.4.0 + * Template7 1.4.1 * Mobile-first HTML template engine * * http://www.idangero.us/template7/ * - * Copyright 2018, Vladimir Kharlampidi + * Copyright 2019, Vladimir Kharlampidi * The iDangero.us * http://www.idangero.us/ * * Licensed under MIT * - * Released on: August 31, 2018 + * Released on: February 5, 2019 */ + let t7ctx; if (typeof window !== 'undefined') { t7ctx = window; @@ -29,14 +30,13 @@ const Template7Utils = { isFunction(func) { return typeof func === 'function'; }, - escape(string) { - return (typeof Template7Context !== 'undefined' && Template7Context.escape) ? - Template7Context.escape(string) : - string - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); + escape(string = '') { + return string + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); }, helperToSlices(string) { const { quoteDoubleRexExp, quoteSingleRexExp } = Template7Utils; @@ -219,9 +219,19 @@ const Template7Utils = { return blocks; }, parseJsVariable(expression, replace, object) { - return expression.split(/([+ \-*/^])/g).map((part) => { - if (part.indexOf(replace) < 0) return part; - if (!object) return JSON.stringify(''); + return expression.split(/([+ \-*/^()&=|<>!%:?])/g).reduce((arr, part) => { + if (!part) { + return arr; + } + if (part.indexOf(replace) < 0) { + arr.push(part); + return arr; + } + if (!object) { + arr.push(JSON.stringify('')); + return arr; + } + let variable = object; if (part.indexOf(`${replace}.`) >= 0) { part.split(`${replace}.`)[1].split('.').forEach((partName) => { @@ -233,24 +243,47 @@ const Template7Utils = { variable = JSON.stringify(variable); } if (variable === undefined) variable = 'undefined'; - return variable; - }).join(''); + + arr.push(variable); + return arr; + }, []).join(''); }, parseJsParents(expression, parents) { - return expression.split(/([+ \-*^])/g).map((part) => { - if (part.indexOf('../') < 0) return part; - if (!parents || parents.length === 0) return JSON.stringify(''); + return expression.split(/([+ \-*^()&=|<>!%:?])/g).reduce((arr, part) => { + if (!part) { + return arr; + } + + if (part.indexOf('../') < 0) { + arr.push(part); + return arr; + } + + if (!parents || parents.length === 0) { + arr.push(JSON.stringify('')); + return arr; + } + const levelsUp = part.split('../').length - 1; const parentData = levelsUp > parents.length ? parents[parents.length - 1] : parents[levelsUp - 1]; let variable = parentData; const parentPart = part.replace(/..\//g, ''); parentPart.split('.').forEach((partName) => { - if (variable[partName]) variable = variable[partName]; + if (typeof variable[partName] !== 'undefined') variable = variable[partName]; else variable = 'undefined'; }); - return JSON.stringify(variable); - }).join(''); + if (variable === false || variable === true) { + arr.push(JSON.stringify(variable)); + return arr; + } + if (variable === null || variable === 'undefined') { + arr.push(JSON.stringify('')); + return arr; + } + arr.push(JSON.stringify(variable)); + return arr; + }, []).join(''); }, getCompileVar(name, ctx, data = 'data_1') { let variable = ctx; @@ -308,6 +341,7 @@ const Template7Utils = { }; /* eslint no-eval: "off" */ + const Template7Helpers = { _partial(partialName, options) { const ctx = this; diff --git a/dist/template7.js b/dist/template7.js index 5d08c85..f36015f 100644 --- a/dist/template7.js +++ b/dist/template7.js @@ -1,650 +1,659 @@ /** - * Template7 1.4.0 + * Template7 1.4.1 * Mobile-first HTML template engine * * http://www.idangero.us/template7/ * - * Copyright 2018, Vladimir Kharlampidi + * Copyright 2019, Vladimir Kharlampidi * The iDangero.us * http://www.idangero.us/ * * Licensed under MIT * - * Released on: August 31, 2018 + * Released on: February 5, 2019 */ + (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.Template7 = factory()); -}(this, (function () { 'use strict'; - -var t7ctx; -if (typeof window !== 'undefined') { - t7ctx = window; -} else if (typeof global !== 'undefined') { - t7ctx = global; -} else { - t7ctx = undefined; -} - -var Template7Context = t7ctx; - -var Template7Utils = { - quoteSingleRexExp: new RegExp('\'', 'g'), - quoteDoubleRexExp: new RegExp('"', 'g'), - isFunction: function isFunction(func) { - return typeof func === 'function'; - }, - escape: function escape(string) { - return (typeof Template7Context !== 'undefined' && Template7Context.escape) ? - Template7Context.escape(string) : - string + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.Template7 = factory()); +}(this, function () { 'use strict'; + + var t7ctx; + if (typeof window !== 'undefined') { + t7ctx = window; + } else if (typeof global !== 'undefined') { + t7ctx = global; + } else { + t7ctx = undefined; + } + + var Template7Context = t7ctx; + + var Template7Utils = { + quoteSingleRexExp: new RegExp('\'', 'g'), + quoteDoubleRexExp: new RegExp('"', 'g'), + isFunction: function isFunction(func) { + return typeof func === 'function'; + }, + escape: function escape(string) { + if ( string === void 0 ) string = ''; + + return string .replace(/&/g, '&') .replace(//g, '>') - .replace(/"/g, '"'); - }, - helperToSlices: function helperToSlices(string) { - var quoteDoubleRexExp = Template7Utils.quoteDoubleRexExp; - var quoteSingleRexExp = Template7Utils.quoteSingleRexExp; - var helperParts = string.replace(/[{}#}]/g, '').trim().split(' '); - var slices = []; - var shiftIndex; - var i; - var j; - for (i = 0; i < helperParts.length; i += 1) { - var part = helperParts[i]; - var blockQuoteRegExp = (void 0); - var openingQuote = (void 0); - if (i === 0) { slices.push(part); } - else if (part.indexOf('"') === 0 || part.indexOf('\'') === 0) { - blockQuoteRegExp = part.indexOf('"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp; - openingQuote = part.indexOf('"') === 0 ? '"' : '\''; - // Plain String - if (part.match(blockQuoteRegExp).length === 2) { - // One word string - slices.push(part); - } else { - // Find closed Index - shiftIndex = 0; - for (j = i + 1; j < helperParts.length; j += 1) { - part += " " + (helperParts[j]); - if (helperParts[j].indexOf(openingQuote) >= 0) { - shiftIndex = j; - slices.push(part); - break; + .replace(/"/g, '"') + .replace(/'/g, '''); + }, + helperToSlices: function helperToSlices(string) { + var quoteDoubleRexExp = Template7Utils.quoteDoubleRexExp; + var quoteSingleRexExp = Template7Utils.quoteSingleRexExp; + var helperParts = string.replace(/[{}#}]/g, '').trim().split(' '); + var slices = []; + var shiftIndex; + var i; + var j; + for (i = 0; i < helperParts.length; i += 1) { + var part = helperParts[i]; + var blockQuoteRegExp = (void 0); + var openingQuote = (void 0); + if (i === 0) { slices.push(part); } + else if (part.indexOf('"') === 0 || part.indexOf('\'') === 0) { + blockQuoteRegExp = part.indexOf('"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp; + openingQuote = part.indexOf('"') === 0 ? '"' : '\''; + // Plain String + if (part.match(blockQuoteRegExp).length === 2) { + // One word string + slices.push(part); + } else { + // Find closed Index + shiftIndex = 0; + for (j = i + 1; j < helperParts.length; j += 1) { + part += " " + (helperParts[j]); + if (helperParts[j].indexOf(openingQuote) >= 0) { + shiftIndex = j; + slices.push(part); + break; + } } + if (shiftIndex) { i = shiftIndex; } } - if (shiftIndex) { i = shiftIndex; } - } - } else if (part.indexOf('=') > 0) { - // Hash - var hashParts = part.split('='); - var hashName = hashParts[0]; - var hashContent = hashParts[1]; - if (!blockQuoteRegExp) { - blockQuoteRegExp = hashContent.indexOf('"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp; - openingQuote = hashContent.indexOf('"') === 0 ? '"' : '\''; - } - if (hashContent.match(blockQuoteRegExp).length !== 2) { - shiftIndex = 0; - for (j = i + 1; j < helperParts.length; j += 1) { - hashContent += " " + (helperParts[j]); - if (helperParts[j].indexOf(openingQuote) >= 0) { - shiftIndex = j; - break; + } else if (part.indexOf('=') > 0) { + // Hash + var hashParts = part.split('='); + var hashName = hashParts[0]; + var hashContent = hashParts[1]; + if (!blockQuoteRegExp) { + blockQuoteRegExp = hashContent.indexOf('"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp; + openingQuote = hashContent.indexOf('"') === 0 ? '"' : '\''; + } + if (hashContent.match(blockQuoteRegExp).length !== 2) { + shiftIndex = 0; + for (j = i + 1; j < helperParts.length; j += 1) { + hashContent += " " + (helperParts[j]); + if (helperParts[j].indexOf(openingQuote) >= 0) { + shiftIndex = j; + break; + } } + if (shiftIndex) { i = shiftIndex; } } - if (shiftIndex) { i = shiftIndex; } + var hash = [hashName, hashContent.replace(blockQuoteRegExp, '')]; + slices.push(hash); + } else { + // Plain variable + slices.push(part); } - var hash = [hashName, hashContent.replace(blockQuoteRegExp, '')]; - slices.push(hash); - } else { - // Plain variable - slices.push(part); } - } - return slices; - }, - stringToBlocks: function stringToBlocks(string) { - var blocks = []; - var i; - var j; - if (!string) { return []; } - var stringBlocks = string.split(/({{[^{^}]*}})/); - for (i = 0; i < stringBlocks.length; i += 1) { - var block = stringBlocks[i]; - if (block === '') { continue; } - if (block.indexOf('{{') < 0) { - blocks.push({ - type: 'plain', - content: block, - }); - } else { - if (block.indexOf('{/') >= 0) { - continue; - } - block = block - .replace(/{{([#/])*([ ])*/, '{{$1') - .replace(/([ ])*}}/, '}}'); - if (block.indexOf('{#') < 0 && block.indexOf(' ') < 0 && block.indexOf('else') < 0) { - // Simple variable + return slices; + }, + stringToBlocks: function stringToBlocks(string) { + var blocks = []; + var i; + var j; + if (!string) { return []; } + var stringBlocks = string.split(/({{[^{^}]*}})/); + for (i = 0; i < stringBlocks.length; i += 1) { + var block = stringBlocks[i]; + if (block === '') { continue; } + if (block.indexOf('{{') < 0) { blocks.push({ - type: 'variable', - contextName: block.replace(/[{}]/g, ''), + type: 'plain', + content: block, }); - continue; - } - // Helpers - var helperSlices = Template7Utils.helperToSlices(block); - var helperName = helperSlices[0]; - var isPartial = helperName === '>'; - var helperContext = []; - var helperHash = {}; - for (j = 1; j < helperSlices.length; j += 1) { - var slice = helperSlices[j]; - if (Array.isArray(slice)) { - // Hash - helperHash[slice[0]] = slice[1] === 'false' ? false : slice[1]; - } else { - helperContext.push(slice); + } else { + if (block.indexOf('{/') >= 0) { + continue; } - } - - if (block.indexOf('{#') >= 0) { - // Condition/Helper - var helperContent = ''; - var elseContent = ''; - var toSkip = 0; - var shiftIndex = (void 0); - var foundClosed = false; - var foundElse = false; - var depth = 0; - for (j = i + 1; j < stringBlocks.length; j += 1) { - if (stringBlocks[j].indexOf('{{#') >= 0) { - depth += 1; - } - if (stringBlocks[j].indexOf('{{/') >= 0) { - depth -= 1; + block = block + .replace(/{{([#/])*([ ])*/, '{{$1') + .replace(/([ ])*}}/, '}}'); + if (block.indexOf('{#') < 0 && block.indexOf(' ') < 0 && block.indexOf('else') < 0) { + // Simple variable + blocks.push({ + type: 'variable', + contextName: block.replace(/[{}]/g, ''), + }); + continue; + } + // Helpers + var helperSlices = Template7Utils.helperToSlices(block); + var helperName = helperSlices[0]; + var isPartial = helperName === '>'; + var helperContext = []; + var helperHash = {}; + for (j = 1; j < helperSlices.length; j += 1) { + var slice = helperSlices[j]; + if (Array.isArray(slice)) { + // Hash + helperHash[slice[0]] = slice[1] === 'false' ? false : slice[1]; + } else { + helperContext.push(slice); } - if (stringBlocks[j].indexOf(("{{#" + helperName)) >= 0) { - helperContent += stringBlocks[j]; - if (foundElse) { elseContent += stringBlocks[j]; } - toSkip += 1; - } else if (stringBlocks[j].indexOf(("{{/" + helperName)) >= 0) { - if (toSkip > 0) { - toSkip -= 1; + } + + if (block.indexOf('{#') >= 0) { + // Condition/Helper + var helperContent = ''; + var elseContent = ''; + var toSkip = 0; + var shiftIndex = (void 0); + var foundClosed = false; + var foundElse = false; + var depth = 0; + for (j = i + 1; j < stringBlocks.length; j += 1) { + if (stringBlocks[j].indexOf('{{#') >= 0) { + depth += 1; + } + if (stringBlocks[j].indexOf('{{/') >= 0) { + depth -= 1; + } + if (stringBlocks[j].indexOf(("{{#" + helperName)) >= 0) { helperContent += stringBlocks[j]; if (foundElse) { elseContent += stringBlocks[j]; } + toSkip += 1; + } else if (stringBlocks[j].indexOf(("{{/" + helperName)) >= 0) { + if (toSkip > 0) { + toSkip -= 1; + helperContent += stringBlocks[j]; + if (foundElse) { elseContent += stringBlocks[j]; } + } else { + shiftIndex = j; + foundClosed = true; + break; + } + } else if (stringBlocks[j].indexOf('else') >= 0 && depth === 0) { + foundElse = true; } else { - shiftIndex = j; - foundClosed = true; - break; + if (!foundElse) { helperContent += stringBlocks[j]; } + if (foundElse) { elseContent += stringBlocks[j]; } } - } else if (stringBlocks[j].indexOf('else') >= 0 && depth === 0) { - foundElse = true; - } else { - if (!foundElse) { helperContent += stringBlocks[j]; } - if (foundElse) { elseContent += stringBlocks[j]; } } - } - if (foundClosed) { - if (shiftIndex) { i = shiftIndex; } - if (helperName === 'raw') { - blocks.push({ - type: 'plain', - content: helperContent, - }); - } else { - blocks.push({ - type: 'helper', - helperName: helperName, - contextName: helperContext, - content: helperContent, - inverseContent: elseContent, - hash: helperHash, - }); + if (foundClosed) { + if (shiftIndex) { i = shiftIndex; } + if (helperName === 'raw') { + blocks.push({ + type: 'plain', + content: helperContent, + }); + } else { + blocks.push({ + type: 'helper', + helperName: helperName, + contextName: helperContext, + content: helperContent, + inverseContent: elseContent, + hash: helperHash, + }); + } } - } - } else if (block.indexOf(' ') > 0) { - if (isPartial) { - helperName = '_partial'; - if (helperContext[0]) { - if (helperContext[0].indexOf('[') === 0) { helperContext[0] = helperContext[0].replace(/[[\]]/g, ''); } - else { helperContext[0] = "\"" + (helperContext[0].replace(/"|'/g, '')) + "\""; } + } else if (block.indexOf(' ') > 0) { + if (isPartial) { + helperName = '_partial'; + if (helperContext[0]) { + if (helperContext[0].indexOf('[') === 0) { helperContext[0] = helperContext[0].replace(/[[\]]/g, ''); } + else { helperContext[0] = "\"" + (helperContext[0].replace(/"|'/g, '')) + "\""; } + } } + blocks.push({ + type: 'helper', + helperName: helperName, + contextName: helperContext, + hash: helperHash, + }); } - blocks.push({ - type: 'helper', - helperName: helperName, - contextName: helperContext, - hash: helperHash, - }); } } - } - return blocks; - }, - parseJsVariable: function parseJsVariable(expression, replace, object) { - return expression.split(/([+ \-*/^()&=|<>!%:?])/g).reduce(function(arr, part) { - if(!part) { - return arr; - } - if(part.indexOf(replace) < 0) { - arr.push(part); - return arr; - } - if(!object) { - arr.push(JSON.stringify('')); - return arr; - } - - var variable = object; - if (part.indexOf((replace + ".")) >= 0) { - part.split((replace + "."))[1].split('.').forEach(function (partName) { - if (partName in variable) variable = variable[partName]; - else variable = undefined; - }); - } - if (typeof variable === 'string') { - variable = JSON.stringify(variable); - } - if (variable === undefined) variable = 'undefined'; - - arr.push(variable); - return arr; - }, []).join(''); - }, - parseJsParents: function parseJsParents(expression, parents) { - return expression.split(/([+ \-*/^()&=|<>!%:?])/g).reduce(function(arr, part) { - if(!part) { - return arr; - } - - if(part.indexOf('../') < 0) { - arr.push(part); - return arr; - } - - if (!parents || parents.length === 0) { - arr.push(JSON.stringify('')); - return arr; - } - - var levelsUp = part.split('../').length - 1; - var parentData = levelsUp > parents.length ? parents[parents.length - 1] : parents[levelsUp - 1]; - - var variable = parentData; - var parentPart = part.replace(/..\//g, ''); - parentPart.split('.').forEach(function (partName) { - if (variable[partName]) { variable = variable[partName]; } - else { variable = 'undefined'; } - }); - - arr.push(JSON.stringify(variable)); - return arr; - }, []).join(''); - }, - getCompileVar: function getCompileVar(name, ctx, data) { - if ( data === void 0 ) data = 'data_1'; - - var variable = ctx; - var parts; - var levelsUp = 0; - var newDepth; - if (name.indexOf('../') === 0) { - levelsUp = name.split('../').length - 1; - newDepth = variable.split('_')[1] - levelsUp; - variable = "ctx_" + (newDepth >= 1 ? newDepth : 1); - parts = name.split('../')[levelsUp].split('.'); - } else if (name.indexOf('@global') === 0) { - variable = 'Template7.global'; - parts = name.split('@global.')[1].split('.'); - } else if (name.indexOf('@root') === 0) { - variable = 'root'; - parts = name.split('@root.')[1].split('.'); - } else { - parts = name.split('.'); - } - for (var i = 0; i < parts.length; i += 1) { - var part = parts[i]; - if (part.indexOf('@') === 0) { - var dataLevel = data.split('_')[1]; - if (levelsUp > 0) { - dataLevel = newDepth; + return blocks; + }, + parseJsVariable: function parseJsVariable(expression, replace, object) { + return expression.split(/([+ \-*/^()&=|<>!%:?])/g).reduce(function (arr, part) { + if (!part) { + return arr; } - if (i > 0) { - variable += "[(data_" + dataLevel + " && data_" + dataLevel + "." + (part.replace('@', '')) + ")]"; - } else { - variable = "(data_" + dataLevel + " && data_" + dataLevel + "." + (part.replace('@', '')) + ")"; + if (part.indexOf(replace) < 0) { + arr.push(part); + return arr; + } + if (!object) { + arr.push(JSON.stringify('')); + return arr; + } + + var variable = object; + if (part.indexOf((replace + ".")) >= 0) { + part.split((replace + "."))[1].split('.').forEach(function (partName) { + if (partName in variable) { variable = variable[partName]; } + else { variable = undefined; } + }); + } + if (typeof variable === 'string') { + variable = JSON.stringify(variable); + } + if (variable === undefined) { variable = 'undefined'; } + + arr.push(variable); + return arr; + }, []).join(''); + }, + parseJsParents: function parseJsParents(expression, parents) { + return expression.split(/([+ \-*^()&=|<>!%:?])/g).reduce(function (arr, part) { + if (!part) { + return arr; + } + + if (part.indexOf('../') < 0) { + arr.push(part); + return arr; } - } else if (Number.isFinite ? Number.isFinite(part) : Template7Context.isFinite(part)) { - variable += "[" + part + "]"; - } else if (part === 'this' || part.indexOf('this.') >= 0 || part.indexOf('this[') >= 0 || part.indexOf('this(') >= 0) { - variable = part.replace('this', ctx); + + if (!parents || parents.length === 0) { + arr.push(JSON.stringify('')); + return arr; + } + + var levelsUp = part.split('../').length - 1; + var parentData = levelsUp > parents.length ? parents[parents.length - 1] : parents[levelsUp - 1]; + + var variable = parentData; + var parentPart = part.replace(/..\//g, ''); + parentPart.split('.').forEach(function (partName) { + if (typeof variable[partName] !== 'undefined') { variable = variable[partName]; } + else { variable = 'undefined'; } + }); + if (variable === false || variable === true) { + arr.push(JSON.stringify(variable)); + return arr; + } + if (variable === null || variable === 'undefined') { + arr.push(JSON.stringify('')); + return arr; + } + arr.push(JSON.stringify(variable)); + return arr; + }, []).join(''); + }, + getCompileVar: function getCompileVar(name, ctx, data) { + if ( data === void 0 ) data = 'data_1'; + + var variable = ctx; + var parts; + var levelsUp = 0; + var newDepth; + if (name.indexOf('../') === 0) { + levelsUp = name.split('../').length - 1; + newDepth = variable.split('_')[1] - levelsUp; + variable = "ctx_" + (newDepth >= 1 ? newDepth : 1); + parts = name.split('../')[levelsUp].split('.'); + } else if (name.indexOf('@global') === 0) { + variable = 'Template7.global'; + parts = name.split('@global.')[1].split('.'); + } else if (name.indexOf('@root') === 0) { + variable = 'root'; + parts = name.split('@root.')[1].split('.'); } else { - variable += "." + part; + parts = name.split('.'); } - } - return variable; - }, - getCompiledArguments: function getCompiledArguments(contextArray, ctx, data) { - var arr = []; - for (var i = 0; i < contextArray.length; i += 1) { - if (/^['"]/.test(contextArray[i])) { arr.push(contextArray[i]); } - else if (/^(true|false|\d+)$/.test(contextArray[i])) { arr.push(contextArray[i]); } - else { - arr.push(Template7Utils.getCompileVar(contextArray[i], ctx, data)); + for (var i = 0; i < parts.length; i += 1) { + var part = parts[i]; + if (part.indexOf('@') === 0) { + var dataLevel = data.split('_')[1]; + if (levelsUp > 0) { + dataLevel = newDepth; + } + if (i > 0) { + variable += "[(data_" + dataLevel + " && data_" + dataLevel + "." + (part.replace('@', '')) + ")]"; + } else { + variable = "(data_" + dataLevel + " && data_" + dataLevel + "." + (part.replace('@', '')) + ")"; + } + } else if (Number.isFinite ? Number.isFinite(part) : Template7Context.isFinite(part)) { + variable += "[" + part + "]"; + } else if (part === 'this' || part.indexOf('this.') >= 0 || part.indexOf('this[') >= 0 || part.indexOf('this(') >= 0) { + variable = part.replace('this', ctx); + } else { + variable += "." + part; + } + } + return variable; + }, + getCompiledArguments: function getCompiledArguments(contextArray, ctx, data) { + var arr = []; + for (var i = 0; i < contextArray.length; i += 1) { + if (/^['"]/.test(contextArray[i])) { arr.push(contextArray[i]); } + else if (/^(true|false|\d+)$/.test(contextArray[i])) { arr.push(contextArray[i]); } + else { + arr.push(Template7Utils.getCompileVar(contextArray[i], ctx, data)); + } } - } - return arr.join(', '); - }, -}; - -/* eslint no-eval: "off" */ -var Template7Helpers = { - _partial: function _partial(partialName, options) { - var ctx = this; - var p = Template7Class.partials[partialName]; - if (!p || (p && !p.template)) { return ''; } - if (!p.compiled) { - p.compiled = new Template7Class(p.template).compile(); - } - Object.keys(options.hash).forEach(function (hashName) { - ctx[hashName] = options.hash[hashName]; - }); - return p.compiled(ctx, options.data, options.root); - }, - escape: function escape(context) { - if (typeof context !== 'string') { - throw new Error('Template7: Passed context to "escape" helper should be a string'); - } - return Template7Utils.escape(context); - }, - if: function if$1(context, options) { - var ctx = context; - if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); } - if (ctx) { - return options.fn(this, options.data); - } + return arr.join(', '); + }, + }; - return options.inverse(this, options.data); - }, - unless: function unless(context, options) { - var ctx = context; - if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); } - if (!ctx) { - return options.fn(this, options.data); - } + /* eslint no-eval: "off" */ - return options.inverse(this, options.data); - }, - each: function each(context, options) { - var ctx = context; - var ret = ''; - var i = 0; - if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); } - if (Array.isArray(ctx)) { - if (options.hash.reverse) { - ctx = ctx.reverse(); + var Template7Helpers = { + _partial: function _partial(partialName, options) { + var ctx = this; + var p = Template7Class.partials[partialName]; + if (!p || (p && !p.template)) { return ''; } + if (!p.compiled) { + p.compiled = new Template7Class(p.template).compile(); } - for (i = 0; i < ctx.length; i += 1) { - ret += options.fn(ctx[i], { first: i === 0, last: i === ctx.length - 1, index: i }); + Object.keys(options.hash).forEach(function (hashName) { + ctx[hashName] = options.hash[hashName]; + }); + return p.compiled(ctx, options.data, options.root); + }, + escape: function escape(context) { + if (typeof context !== 'string') { + throw new Error('Template7: Passed context to "escape" helper should be a string'); } - if (options.hash.reverse) { - ctx = ctx.reverse(); + return Template7Utils.escape(context); + }, + if: function if$1(context, options) { + var ctx = context; + if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); } + if (ctx) { + return options.fn(this, options.data); } - } else { - // eslint-disable-next-line - for (var key in ctx) { - i += 1; - ret += options.fn(ctx[key], { key: key }); + + return options.inverse(this, options.data); + }, + unless: function unless(context, options) { + var ctx = context; + if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); } + if (!ctx) { + return options.fn(this, options.data); } - } - if (i > 0) { return ret; } - return options.inverse(this); - }, - with: function with$1(context, options) { - var ctx = context; - if (Template7Utils.isFunction(ctx)) { ctx = context.call(this); } - return options.fn(ctx); - }, - join: function join(context, options) { - var ctx = context; - if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); } - return ctx.join(options.hash.delimiter || options.hash.delimeter); - }, - js: function js(expression, options) { - var data = options.data; - var func; - var execute = expression; - ('index first last key').split(' ').forEach(function (prop) { - if (typeof data[prop] !== 'undefined') { - var re1 = new RegExp(("this.@" + prop), 'g'); - var re2 = new RegExp(("@" + prop), 'g'); - execute = execute - .replace(re1, JSON.stringify(data[prop])) - .replace(re2, JSON.stringify(data[prop])); + + return options.inverse(this, options.data); + }, + each: function each(context, options) { + var ctx = context; + var ret = ''; + var i = 0; + if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); } + if (Array.isArray(ctx)) { + if (options.hash.reverse) { + ctx = ctx.reverse(); + } + for (i = 0; i < ctx.length; i += 1) { + ret += options.fn(ctx[i], { first: i === 0, last: i === ctx.length - 1, index: i }); + } + if (options.hash.reverse) { + ctx = ctx.reverse(); + } + } else { + // eslint-disable-next-line + for (var key in ctx) { + i += 1; + ret += options.fn(ctx[key], { key: key }); + } } - }); - if (options.root && execute.indexOf('@root') >= 0) { - execute = Template7Utils.parseJsVariable(execute, '@root', options.root); - } - if (execute.indexOf('@global') >= 0) { - execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global); - } - if (execute.indexOf('../') >= 0) { - execute = Template7Utils.parseJsParents(execute, options.parents); - } - if (execute.indexOf('return') >= 0) { - func = "(function(){" + execute + "})"; - } else { - func = "(function(){return (" + execute + ")})"; - } - return eval(func).call(this); - }, - js_if: function js_if(expression, options) { - var data = options.data; - var func; - var execute = expression; - ('index first last key').split(' ').forEach(function (prop) { - if (typeof data[prop] !== 'undefined') { - var re1 = new RegExp(("this.@" + prop), 'g'); - var re2 = new RegExp(("@" + prop), 'g'); - execute = execute - .replace(re1, JSON.stringify(data[prop])) - .replace(re2, JSON.stringify(data[prop])); + if (i > 0) { return ret; } + return options.inverse(this); + }, + with: function with$1(context, options) { + var ctx = context; + if (Template7Utils.isFunction(ctx)) { ctx = context.call(this); } + return options.fn(ctx); + }, + join: function join(context, options) { + var ctx = context; + if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); } + return ctx.join(options.hash.delimiter || options.hash.delimeter); + }, + js: function js(expression, options) { + var data = options.data; + var func; + var execute = expression; + ('index first last key').split(' ').forEach(function (prop) { + if (typeof data[prop] !== 'undefined') { + var re1 = new RegExp(("this.@" + prop), 'g'); + var re2 = new RegExp(("@" + prop), 'g'); + execute = execute + .replace(re1, JSON.stringify(data[prop])) + .replace(re2, JSON.stringify(data[prop])); + } + }); + if (options.root && execute.indexOf('@root') >= 0) { + execute = Template7Utils.parseJsVariable(execute, '@root', options.root); + } + if (execute.indexOf('@global') >= 0) { + execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global); + } + if (execute.indexOf('../') >= 0) { + execute = Template7Utils.parseJsParents(execute, options.parents); + } + if (execute.indexOf('return') >= 0) { + func = "(function(){" + execute + "})"; + } else { + func = "(function(){return (" + execute + ")})"; + } + return eval(func).call(this); + }, + js_if: function js_if(expression, options) { + var data = options.data; + var func; + var execute = expression; + ('index first last key').split(' ').forEach(function (prop) { + if (typeof data[prop] !== 'undefined') { + var re1 = new RegExp(("this.@" + prop), 'g'); + var re2 = new RegExp(("@" + prop), 'g'); + execute = execute + .replace(re1, JSON.stringify(data[prop])) + .replace(re2, JSON.stringify(data[prop])); + } + }); + if (options.root && execute.indexOf('@root') >= 0) { + execute = Template7Utils.parseJsVariable(execute, '@root', options.root); + } + if (execute.indexOf('@global') >= 0) { + execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global); + } + if (execute.indexOf('../') >= 0) { + execute = Template7Utils.parseJsParents(execute, options.parents); + } + if (execute.indexOf('return') >= 0) { + func = "(function(){" + execute + "})"; + } else { + func = "(function(){return (" + execute + ")})"; + } + var condition = eval(func).call(this); + if (condition) { + return options.fn(this, options.data); } - }); - if (options.root && execute.indexOf('@root') >= 0) { - execute = Template7Utils.parseJsVariable(execute, '@root', options.root); - } - if (execute.indexOf('@global') >= 0) { - execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global); - } - if (execute.indexOf('../') >= 0) { - execute = Template7Utils.parseJsParents(execute, options.parents); - } - if (execute.indexOf('return') >= 0) { - func = "(function(){" + execute + "})"; - } else { - func = "(function(){return (" + execute + ")})"; - } - var condition = eval(func).call(this); - if (condition) { - return options.fn(this, options.data); - } - return options.inverse(this, options.data); - }, -}; -Template7Helpers.js_compare = Template7Helpers.js_if; + return options.inverse(this, options.data); + }, + }; + Template7Helpers.js_compare = Template7Helpers.js_if; -var Template7Options = {}; -var Template7Partials = {}; + var Template7Options = {}; + var Template7Partials = {}; -var Template7Class = function Template7Class(template) { - var t = this; - t.template = template; -}; + var Template7Class = function Template7Class(template) { + var t = this; + t.template = template; + }; -var staticAccessors = { options: { configurable: true },partials: { configurable: true },helpers: { configurable: true } }; -Template7Class.prototype.compile = function compile (template, depth) { - if ( template === void 0 ) template = this.template; - if ( depth === void 0 ) depth = 1; + var staticAccessors = { options: { configurable: true },partials: { configurable: true },helpers: { configurable: true } }; + Template7Class.prototype.compile = function compile (template, depth) { + if ( template === void 0 ) template = this.template; + if ( depth === void 0 ) depth = 1; - var t = this; - if (t.compiled) { return t.compiled; } + var t = this; + if (t.compiled) { return t.compiled; } - if (typeof template !== 'string') { - throw new Error('Template7: Template must be a string'); - } - var stringToBlocks = Template7Utils.stringToBlocks; - var getCompileVar = Template7Utils.getCompileVar; - var getCompiledArguments = Template7Utils.getCompiledArguments; - - var blocks = stringToBlocks(template); - var ctx = "ctx_" + depth; - var data = "data_" + depth; - if (blocks.length === 0) { - return function empty() { return ''; }; - } + if (typeof template !== 'string') { + throw new Error('Template7: Template must be a string'); + } + var stringToBlocks = Template7Utils.stringToBlocks; + var getCompileVar = Template7Utils.getCompileVar; + var getCompiledArguments = Template7Utils.getCompiledArguments; + + var blocks = stringToBlocks(template); + var ctx = "ctx_" + depth; + var data = "data_" + depth; + if (blocks.length === 0) { + return function empty() { return ''; }; + } - function getCompileFn(block, newDepth) { - if (block.content) { return t.compile(block.content, newDepth); } - return function empty() { return ''; }; - } - function getCompileInverse(block, newDepth) { - if (block.inverseContent) { return t.compile(block.inverseContent, newDepth); } - return function empty() { return ''; }; - } + function getCompileFn(block, newDepth) { + if (block.content) { return t.compile(block.content, newDepth); } + return function empty() { return ''; }; + } + function getCompileInverse(block, newDepth) { + if (block.inverseContent) { return t.compile(block.inverseContent, newDepth); } + return function empty() { return ''; }; + } - var resultString = ''; - if (depth === 1) { - resultString += "(function (" + ctx + ", " + data + ", root) {\n"; - } else { - resultString += "(function (" + ctx + ", " + data + ") {\n"; - } - if (depth === 1) { - resultString += 'function isArray(arr){return Array.isArray(arr);}\n'; - resultString += 'function isFunction(func){return (typeof func === \'function\');}\n'; - resultString += 'function c(val, ctx) {if (typeof val !== "undefined" && val !== null) {if (isFunction(val)) {return val.call(ctx);} else return val;} else return "";}\n'; - resultString += 'root = root || ctx_1 || {};\n'; - } - resultString += 'var r = \'\';\n'; - var i; - for (i = 0; i < blocks.length; i += 1) { - var block = blocks[i]; - // Plain block - if (block.type === 'plain') { - // eslint-disable-next-line - resultString += "r +='" + ((block.content).replace(/\r/g, '\\r').replace(/\n/g, '\\n').replace(/'/g, '\\' + '\'')) + "';"; - continue; + var resultString = ''; + if (depth === 1) { + resultString += "(function (" + ctx + ", " + data + ", root) {\n"; + } else { + resultString += "(function (" + ctx + ", " + data + ") {\n"; } - var variable = (void 0); - var compiledArguments = (void 0); - // Variable block - if (block.type === 'variable') { - variable = getCompileVar(block.contextName, ctx, data); - resultString += "r += c(" + variable + ", " + ctx + ");"; + if (depth === 1) { + resultString += 'function isArray(arr){return Array.isArray(arr);}\n'; + resultString += 'function isFunction(func){return (typeof func === \'function\');}\n'; + resultString += 'function c(val, ctx) {if (typeof val !== "undefined" && val !== null) {if (isFunction(val)) {return val.call(ctx);} else return val;} else return "";}\n'; + resultString += 'root = root || ctx_1 || {};\n'; } - // Helpers block - if (block.type === 'helper') { - var parents = (void 0); - if (ctx !== 'ctx_1') { - var level = ctx.split('_')[1]; - var parentsString = "ctx_" + (level - 1); - for (var j = level - 2; j >= 1; j -= 1) { - parentsString += ", ctx_" + j; - } - parents = "[" + parentsString + "]"; - } else { - parents = "[" + ctx + "]"; + resultString += 'var r = \'\';\n'; + var i; + for (i = 0; i < blocks.length; i += 1) { + var block = blocks[i]; + // Plain block + if (block.type === 'plain') { + // eslint-disable-next-line + resultString += "r +='" + ((block.content).replace(/\r/g, '\\r').replace(/\n/g, '\\n').replace(/'/g, '\\' + '\'')) + "';"; + continue; } - var dynamicHelper = (void 0); - if (block.helperName.indexOf('[') === 0) { - block.helperName = getCompileVar(block.helperName.replace(/[[\]]/g, ''), ctx, data); - dynamicHelper = true; + var variable = (void 0); + var compiledArguments = (void 0); + // Variable block + if (block.type === 'variable') { + variable = getCompileVar(block.contextName, ctx, data); + resultString += "r += c(" + variable + ", " + ctx + ");"; } - if (dynamicHelper || block.helperName in Template7Helpers) { - compiledArguments = getCompiledArguments(block.contextName, ctx, data); - resultString += "r += (Template7Helpers" + (dynamicHelper ? ("[" + (block.helperName) + "]") : ("." + (block.helperName))) + ").call(" + ctx + ", " + (compiledArguments && ((compiledArguments + ", "))) + "{hash:" + (JSON.stringify(block.hash)) + ", data: " + data + " || {}, fn: " + (getCompileFn(block, depth + 1)) + ", inverse: " + (getCompileInverse(block, depth + 1)) + ", root: root, parents: " + parents + "});"; - } else if (block.contextName.length > 0) { - throw new Error(("Template7: Missing helper: \"" + (block.helperName) + "\"")); - } else { - variable = getCompileVar(block.helperName, ctx, data); - resultString += "if (" + variable + ") {"; - resultString += "if (isArray(" + variable + ")) {"; - resultString += "r += (Template7Helpers.each).call(" + ctx + ", " + variable + ", {hash:" + (JSON.stringify(block.hash)) + ", data: " + data + " || {}, fn: " + (getCompileFn(block, depth + 1)) + ", inverse: " + (getCompileInverse(block, depth + 1)) + ", root: root, parents: " + parents + "});"; - resultString += '}else {'; - resultString += "r += (Template7Helpers.with).call(" + ctx + ", " + variable + ", {hash:" + (JSON.stringify(block.hash)) + ", data: " + data + " || {}, fn: " + (getCompileFn(block, depth + 1)) + ", inverse: " + (getCompileInverse(block, depth + 1)) + ", root: root, parents: " + parents + "});"; - resultString += '}}'; + // Helpers block + if (block.type === 'helper') { + var parents = (void 0); + if (ctx !== 'ctx_1') { + var level = ctx.split('_')[1]; + var parentsString = "ctx_" + (level - 1); + for (var j = level - 2; j >= 1; j -= 1) { + parentsString += ", ctx_" + j; + } + parents = "[" + parentsString + "]"; + } else { + parents = "[" + ctx + "]"; + } + var dynamicHelper = (void 0); + if (block.helperName.indexOf('[') === 0) { + block.helperName = getCompileVar(block.helperName.replace(/[[\]]/g, ''), ctx, data); + dynamicHelper = true; + } + if (dynamicHelper || block.helperName in Template7Helpers) { + compiledArguments = getCompiledArguments(block.contextName, ctx, data); + resultString += "r += (Template7Helpers" + (dynamicHelper ? ("[" + (block.helperName) + "]") : ("." + (block.helperName))) + ").call(" + ctx + ", " + (compiledArguments && ((compiledArguments + ", "))) + "{hash:" + (JSON.stringify(block.hash)) + ", data: " + data + " || {}, fn: " + (getCompileFn(block, depth + 1)) + ", inverse: " + (getCompileInverse(block, depth + 1)) + ", root: root, parents: " + parents + "});"; + } else if (block.contextName.length > 0) { + throw new Error(("Template7: Missing helper: \"" + (block.helperName) + "\"")); + } else { + variable = getCompileVar(block.helperName, ctx, data); + resultString += "if (" + variable + ") {"; + resultString += "if (isArray(" + variable + ")) {"; + resultString += "r += (Template7Helpers.each).call(" + ctx + ", " + variable + ", {hash:" + (JSON.stringify(block.hash)) + ", data: " + data + " || {}, fn: " + (getCompileFn(block, depth + 1)) + ", inverse: " + (getCompileInverse(block, depth + 1)) + ", root: root, parents: " + parents + "});"; + resultString += '}else {'; + resultString += "r += (Template7Helpers.with).call(" + ctx + ", " + variable + ", {hash:" + (JSON.stringify(block.hash)) + ", data: " + data + " || {}, fn: " + (getCompileFn(block, depth + 1)) + ", inverse: " + (getCompileInverse(block, depth + 1)) + ", root: root, parents: " + parents + "});"; + resultString += '}}'; + } } } - } - resultString += '\nreturn r;})'; + resultString += '\nreturn r;})'; - if (depth === 1) { - // eslint-disable-next-line - t.compiled = eval(resultString); - return t.compiled; - } - return resultString; -}; -staticAccessors.options.get = function () { - return Template7Options; -}; -staticAccessors.partials.get = function () { - return Template7Partials; -}; -staticAccessors.helpers.get = function () { - return Template7Helpers; -}; - -Object.defineProperties( Template7Class, staticAccessors ); - -function Template7() { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; - - var template = args[0]; - var data = args[1]; - if (args.length === 2) { - var instance = new Template7Class(template); - var rendered = instance.compile()(data); - instance = null; - return (rendered); - } - return new Template7Class(template); -} -Template7.registerHelper = function registerHelper(name, fn) { - Template7Class.helpers[name] = fn; -}; -Template7.unregisterHelper = function unregisterHelper(name) { - Template7Class.helpers[name] = undefined; - delete Template7Class.helpers[name]; -}; -Template7.registerPartial = function registerPartial(name, template) { - Template7Class.partials[name] = { template: template }; -}; -Template7.unregisterPartial = function unregisterPartial(name) { - if (Template7Class.partials[name]) { - Template7Class.partials[name] = undefined; - delete Template7Class.partials[name]; + if (depth === 1) { + // eslint-disable-next-line + t.compiled = eval(resultString); + return t.compiled; + } + return resultString; + }; + staticAccessors.options.get = function () { + return Template7Options; + }; + staticAccessors.partials.get = function () { + return Template7Partials; + }; + staticAccessors.helpers.get = function () { + return Template7Helpers; + }; + + Object.defineProperties( Template7Class, staticAccessors ); + + function Template7() { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + var template = args[0]; + var data = args[1]; + if (args.length === 2) { + var instance = new Template7Class(template); + var rendered = instance.compile()(data); + instance = null; + return (rendered); + } + return new Template7Class(template); } -}; -Template7.compile = function compile(template, options) { - var instance = new Template7Class(template, options); - return instance.compile(); -}; - -Template7.options = Template7Class.options; -Template7.helpers = Template7Class.helpers; -Template7.partials = Template7Class.partials; + Template7.registerHelper = function registerHelper(name, fn) { + Template7Class.helpers[name] = fn; + }; + Template7.unregisterHelper = function unregisterHelper(name) { + Template7Class.helpers[name] = undefined; + delete Template7Class.helpers[name]; + }; + Template7.registerPartial = function registerPartial(name, template) { + Template7Class.partials[name] = { template: template }; + }; + Template7.unregisterPartial = function unregisterPartial(name) { + if (Template7Class.partials[name]) { + Template7Class.partials[name] = undefined; + delete Template7Class.partials[name]; + } + }; + Template7.compile = function compile(template, options) { + var instance = new Template7Class(template, options); + return instance.compile(); + }; -return Template7; + Template7.options = Template7Class.options; + Template7.helpers = Template7Class.helpers; + Template7.partials = Template7Class.partials; -}))); + return Template7; +})); //# sourceMappingURL=template7.js.map diff --git a/dist/template7.js.map b/dist/template7.js.map index 932a3d9..cb2fd1e 100644 --- a/dist/template7.js.map +++ b/dist/template7.js.map @@ -1 +1 @@ -{"version":3,"sources":["context.js","utils.js","helpers.js","template7-class.js","template7.js"],"names":["let","this","const"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAAA,IAAI,KAAK,CAAC;AACV,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;EACjC,KAAK,GAAG,MAAM,CAAC;CAChB,MAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;EACxC,KAAK,GAAG,MAAM,CAAC;CAChB,MAAM;EACL,KAAK,GAAGC,SAAI,CAAC;CACd;;AAEDC,IAAM,gBAAgB,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EAAE,EAAE;EAC3D,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;CACnC,CAAC;AACF,SAAS,CAAC,gBAAgB,GAAG,SAAS,gBAAgB,CAAC,IAAI,EAAE;EAC3D,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;EACzC,OAAO,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC,CAAC;AACF,SAAS,CAAC,eAAe,GAAG,SAAS,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE;EACnE,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,UAAA,QAAQ,EAAE,CAAC;CAC9C,CAAC;AACF,SAAS,CAAC,iBAAiB,GAAG,SAAS,iBAAiB,CAAC,IAAI,EAAE;EAC7D,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;IACjC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAC1C,OAAO,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;GACtC;CACF,CAAC;AACF,SAAS,CAAC,OAAO,GAAG,SAAS,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE;EACtDA,IAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;EACvD,OAAO,QAAQ,CAAC,OAAO,EAAE,CAAC;CAC3B,CAAC;;AAEF,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;AAC3C,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;AAC3C,SAAS,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC","file":"template7.js","sourcesContent":["let t7ctx;\nif (typeof window !== 'undefined') {\n t7ctx = window;\n} else if (typeof global !== 'undefined') {\n t7ctx = global;\n} else {\n t7ctx = this;\n}\n\nconst Template7Context = t7ctx;\n\nexport default Template7Context;\n","import Template7Context from './context';\n\nconst Template7Utils = {\n quoteSingleRexExp: new RegExp('\\'', 'g'),\n quoteDoubleRexExp: new RegExp('\"', 'g'),\n isFunction(func) {\n return typeof func === 'function';\n },\n escape(string) {\n return (typeof Template7Context !== 'undefined' && Template7Context.escape) ?\n Template7Context.escape(string) :\n string\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"');\n },\n helperToSlices(string) {\n const { quoteDoubleRexExp, quoteSingleRexExp } = Template7Utils;\n const helperParts = string.replace(/[{}#}]/g, '').trim().split(' ');\n const slices = [];\n let shiftIndex;\n let i;\n let j;\n for (i = 0; i < helperParts.length; i += 1) {\n let part = helperParts[i];\n let blockQuoteRegExp;\n let openingQuote;\n if (i === 0) slices.push(part);\n else if (part.indexOf('\"') === 0 || part.indexOf('\\'') === 0) {\n blockQuoteRegExp = part.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = part.indexOf('\"') === 0 ? '\"' : '\\'';\n // Plain String\n if (part.match(blockQuoteRegExp).length === 2) {\n // One word string\n slices.push(part);\n } else {\n // Find closed Index\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n part += ` ${helperParts[j]}`;\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n slices.push(part);\n break;\n }\n }\n if (shiftIndex) i = shiftIndex;\n }\n } else if (part.indexOf('=') > 0) {\n // Hash\n const hashParts = part.split('=');\n const hashName = hashParts[0];\n let hashContent = hashParts[1];\n if (!blockQuoteRegExp) {\n blockQuoteRegExp = hashContent.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = hashContent.indexOf('\"') === 0 ? '\"' : '\\'';\n }\n if (hashContent.match(blockQuoteRegExp).length !== 2) {\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n hashContent += ` ${helperParts[j]}`;\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n break;\n }\n }\n if (shiftIndex) i = shiftIndex;\n }\n const hash = [hashName, hashContent.replace(blockQuoteRegExp, '')];\n slices.push(hash);\n } else {\n // Plain variable\n slices.push(part);\n }\n }\n return slices;\n },\n stringToBlocks(string) {\n const blocks = [];\n let i;\n let j;\n if (!string) return [];\n const stringBlocks = string.split(/({{[^{^}]*}})/);\n for (i = 0; i < stringBlocks.length; i += 1) {\n let block = stringBlocks[i];\n if (block === '') continue;\n if (block.indexOf('{{') < 0) {\n blocks.push({\n type: 'plain',\n content: block,\n });\n } else {\n if (block.indexOf('{/') >= 0) {\n continue;\n }\n block = block\n .replace(/{{([#/])*([ ])*/, '{{$1')\n .replace(/([ ])*}}/, '}}');\n if (block.indexOf('{#') < 0 && block.indexOf(' ') < 0 && block.indexOf('else') < 0) {\n // Simple variable\n blocks.push({\n type: 'variable',\n contextName: block.replace(/[{}]/g, ''),\n });\n continue;\n }\n // Helpers\n const helperSlices = Template7Utils.helperToSlices(block);\n let helperName = helperSlices[0];\n const isPartial = helperName === '>';\n const helperContext = [];\n const helperHash = {};\n for (j = 1; j < helperSlices.length; j += 1) {\n const slice = helperSlices[j];\n if (Array.isArray(slice)) {\n // Hash\n helperHash[slice[0]] = slice[1] === 'false' ? false : slice[1];\n } else {\n helperContext.push(slice);\n }\n }\n\n if (block.indexOf('{#') >= 0) {\n // Condition/Helper\n let helperContent = '';\n let elseContent = '';\n let toSkip = 0;\n let shiftIndex;\n let foundClosed = false;\n let foundElse = false;\n let depth = 0;\n for (j = i + 1; j < stringBlocks.length; j += 1) {\n if (stringBlocks[j].indexOf('{{#') >= 0) {\n depth += 1;\n }\n if (stringBlocks[j].indexOf('{{/') >= 0) {\n depth -= 1;\n }\n if (stringBlocks[j].indexOf(`{{#${helperName}`) >= 0) {\n helperContent += stringBlocks[j];\n if (foundElse) elseContent += stringBlocks[j];\n toSkip += 1;\n } else if (stringBlocks[j].indexOf(`{{/${helperName}`) >= 0) {\n if (toSkip > 0) {\n toSkip -= 1;\n helperContent += stringBlocks[j];\n if (foundElse) elseContent += stringBlocks[j];\n } else {\n shiftIndex = j;\n foundClosed = true;\n break;\n }\n } else if (stringBlocks[j].indexOf('else') >= 0 && depth === 0) {\n foundElse = true;\n } else {\n if (!foundElse) helperContent += stringBlocks[j];\n if (foundElse) elseContent += stringBlocks[j];\n }\n }\n if (foundClosed) {\n if (shiftIndex) i = shiftIndex;\n if (helperName === 'raw') {\n blocks.push({\n type: 'plain',\n content: helperContent,\n });\n } else {\n blocks.push({\n type: 'helper',\n helperName,\n contextName: helperContext,\n content: helperContent,\n inverseContent: elseContent,\n hash: helperHash,\n });\n }\n }\n } else if (block.indexOf(' ') > 0) {\n if (isPartial) {\n helperName = '_partial';\n if (helperContext[0]) {\n if (helperContext[0].indexOf('[') === 0) helperContext[0] = helperContext[0].replace(/[[\\]]/g, '');\n else helperContext[0] = `\"${helperContext[0].replace(/\"|'/g, '')}\"`;\n }\n }\n blocks.push({\n type: 'helper',\n helperName,\n contextName: helperContext,\n hash: helperHash,\n });\n }\n }\n }\n return blocks;\n },\n parseJsVariable(expression, replace, object) {\n return expression.split(/([+ \\-*/^])/g).map((part) => {\n if (part.indexOf(replace) < 0) return part;\n if (!object) return JSON.stringify('');\n let variable = object;\n if (part.indexOf(`${replace}.`) >= 0) {\n part.split(`${replace}.`)[1].split('.').forEach((partName) => {\n if (partName in variable) variable = variable[partName];\n else variable = undefined;\n });\n }\n if (typeof variable === 'string') {\n variable = JSON.stringify(variable);\n }\n if (variable === undefined) variable = 'undefined';\n return variable;\n }).join('');\n },\n parseJsParents(expression, parents) {\n return expression.split(/([+ \\-*^])/g).map((part) => {\n if (part.indexOf('../') < 0) return part;\n if (!parents || parents.length === 0) return JSON.stringify('');\n const levelsUp = part.split('../').length - 1;\n const parentData = levelsUp > parents.length ? parents[parents.length - 1] : parents[levelsUp - 1];\n\n let variable = parentData;\n const parentPart = part.replace(/..\\//g, '');\n parentPart.split('.').forEach((partName) => {\n if (variable[partName]) variable = variable[partName];\n else variable = 'undefined';\n });\n return JSON.stringify(variable);\n }).join('');\n },\n getCompileVar(name, ctx, data = 'data_1') {\n let variable = ctx;\n let parts;\n let levelsUp = 0;\n let newDepth;\n if (name.indexOf('../') === 0) {\n levelsUp = name.split('../').length - 1;\n newDepth = variable.split('_')[1] - levelsUp;\n variable = `ctx_${newDepth >= 1 ? newDepth : 1}`;\n parts = name.split('../')[levelsUp].split('.');\n } else if (name.indexOf('@global') === 0) {\n variable = 'Template7.global';\n parts = name.split('@global.')[1].split('.');\n } else if (name.indexOf('@root') === 0) {\n variable = 'root';\n parts = name.split('@root.')[1].split('.');\n } else {\n parts = name.split('.');\n }\n for (let i = 0; i < parts.length; i += 1) {\n const part = parts[i];\n if (part.indexOf('@') === 0) {\n let dataLevel = data.split('_')[1];\n if (levelsUp > 0) {\n dataLevel = newDepth;\n }\n if (i > 0) {\n variable += `[(data_${dataLevel} && data_${dataLevel}.${part.replace('@', '')})]`;\n } else {\n variable = `(data_${dataLevel} && data_${dataLevel}.${part.replace('@', '')})`;\n }\n } else if (Number.isFinite ? Number.isFinite(part) : Template7Context.isFinite(part)) {\n variable += `[${part}]`;\n } else if (part === 'this' || part.indexOf('this.') >= 0 || part.indexOf('this[') >= 0 || part.indexOf('this(') >= 0) {\n variable = part.replace('this', ctx);\n } else {\n variable += `.${part}`;\n }\n }\n return variable;\n },\n getCompiledArguments(contextArray, ctx, data) {\n const arr = [];\n for (let i = 0; i < contextArray.length; i += 1) {\n if (/^['\"]/.test(contextArray[i])) arr.push(contextArray[i]);\n else if (/^(true|false|\\d+)$/.test(contextArray[i])) arr.push(contextArray[i]);\n else {\n arr.push(Template7Utils.getCompileVar(contextArray[i], ctx, data));\n }\n }\n\n return arr.join(', ');\n },\n};\n\nexport default Template7Utils;\n","/* eslint no-eval: \"off\" */\nimport Template7Utils from './utils';\nimport Template7Class from './template7-class';\nimport Template7Context from './context';\n\nconst Template7Helpers = {\n _partial(partialName, options) {\n const ctx = this;\n const p = Template7Class.partials[partialName];\n if (!p || (p && !p.template)) return '';\n if (!p.compiled) {\n p.compiled = new Template7Class(p.template).compile();\n }\n Object.keys(options.hash).forEach((hashName) => {\n ctx[hashName] = options.hash[hashName];\n });\n return p.compiled(ctx, options.data, options.root);\n },\n escape(context) {\n if (typeof context !== 'string') {\n throw new Error('Template7: Passed context to \"escape\" helper should be a string');\n }\n return Template7Utils.escape(context);\n },\n if(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n unless(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (!ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n each(context, options) {\n let ctx = context;\n let ret = '';\n let i = 0;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (Array.isArray(ctx)) {\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n for (i = 0; i < ctx.length; i += 1) {\n ret += options.fn(ctx[i], { first: i === 0, last: i === ctx.length - 1, index: i });\n }\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n } else {\n // eslint-disable-next-line\n for (const key in ctx) {\n i += 1;\n ret += options.fn(ctx[key], { key });\n }\n }\n if (i > 0) return ret;\n return options.inverse(this);\n },\n with(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = context.call(this); }\n return options.fn(ctx);\n },\n join(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n return ctx.join(options.hash.delimiter || options.hash.delimeter);\n },\n js(expression, options) {\n const data = options.data;\n let func;\n let execute = expression;\n ('index first last key').split(' ').forEach((prop) => {\n if (typeof data[prop] !== 'undefined') {\n const re1 = new RegExp(`this.@${prop}`, 'g');\n const re2 = new RegExp(`@${prop}`, 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = `(function(){${execute}})`;\n } else {\n func = `(function(){return (${execute})})`;\n }\n return eval(func).call(this);\n },\n js_if(expression, options) {\n const data = options.data;\n let func;\n let execute = expression;\n ('index first last key').split(' ').forEach((prop) => {\n if (typeof data[prop] !== 'undefined') {\n const re1 = new RegExp(`this.@${prop}`, 'g');\n const re2 = new RegExp(`@${prop}`, 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = `(function(){${execute}})`;\n } else {\n func = `(function(){return (${execute})})`;\n }\n const condition = eval(func).call(this);\n if (condition) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n};\nTemplate7Helpers.js_compare = Template7Helpers.js_if;\n\nexport default Template7Helpers;\n","import Template7Utils from './utils';\nimport Template7Helpers from './helpers';\n\nconst Template7Options = {};\nconst Template7Partials = {};\n\nclass Template7Class {\n constructor(template) {\n const t = this;\n t.template = template;\n }\n compile(template = this.template, depth = 1) {\n const t = this;\n if (t.compiled) return t.compiled;\n\n if (typeof template !== 'string') {\n throw new Error('Template7: Template must be a string');\n }\n const { stringToBlocks, getCompileVar, getCompiledArguments } = Template7Utils;\n\n const blocks = stringToBlocks(template);\n const ctx = `ctx_${depth}`;\n const data = `data_${depth}`;\n if (blocks.length === 0) {\n return function empty() { return ''; };\n }\n\n function getCompileFn(block, newDepth) {\n if (block.content) return t.compile(block.content, newDepth);\n return function empty() { return ''; };\n }\n function getCompileInverse(block, newDepth) {\n if (block.inverseContent) return t.compile(block.inverseContent, newDepth);\n return function empty() { return ''; };\n }\n\n let resultString = '';\n if (depth === 1) {\n resultString += `(function (${ctx}, ${data}, root) {\\n`;\n } else {\n resultString += `(function (${ctx}, ${data}) {\\n`;\n }\n if (depth === 1) {\n resultString += 'function isArray(arr){return Array.isArray(arr);}\\n';\n resultString += 'function isFunction(func){return (typeof func === \\'function\\');}\\n';\n resultString += 'function c(val, ctx) {if (typeof val !== \"undefined\" && val !== null) {if (isFunction(val)) {return val.call(ctx);} else return val;} else return \"\";}\\n';\n resultString += 'root = root || ctx_1 || {};\\n';\n }\n resultString += 'var r = \\'\\';\\n';\n let i;\n for (i = 0; i < blocks.length; i += 1) {\n const block = blocks[i];\n // Plain block\n if (block.type === 'plain') {\n // eslint-disable-next-line\n resultString += `r +='${(block.content).replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n').replace(/'/g, '\\\\' + '\\'')}';`;\n continue;\n }\n let variable;\n let compiledArguments;\n // Variable block\n if (block.type === 'variable') {\n variable = getCompileVar(block.contextName, ctx, data);\n resultString += `r += c(${variable}, ${ctx});`;\n }\n // Helpers block\n if (block.type === 'helper') {\n let parents;\n if (ctx !== 'ctx_1') {\n const level = ctx.split('_')[1];\n let parentsString = `ctx_${level - 1}`;\n for (let j = level - 2; j >= 1; j -= 1) {\n parentsString += `, ctx_${j}`;\n }\n parents = `[${parentsString}]`;\n } else {\n parents = `[${ctx}]`;\n }\n let dynamicHelper;\n if (block.helperName.indexOf('[') === 0) {\n block.helperName = getCompileVar(block.helperName.replace(/[[\\]]/g, ''), ctx, data);\n dynamicHelper = true;\n }\n if (dynamicHelper || block.helperName in Template7Helpers) {\n compiledArguments = getCompiledArguments(block.contextName, ctx, data);\n resultString += `r += (Template7Helpers${dynamicHelper ? `[${block.helperName}]` : `.${block.helperName}`}).call(${ctx}, ${compiledArguments && (`${compiledArguments}, `)}{hash:${JSON.stringify(block.hash)}, data: ${data} || {}, fn: ${getCompileFn(block, depth + 1)}, inverse: ${getCompileInverse(block, depth + 1)}, root: root, parents: ${parents}});`;\n } else if (block.contextName.length > 0) {\n throw new Error(`Template7: Missing helper: \"${block.helperName}\"`);\n } else {\n variable = getCompileVar(block.helperName, ctx, data);\n resultString += `if (${variable}) {`;\n resultString += `if (isArray(${variable})) {`;\n resultString += `r += (Template7Helpers.each).call(${ctx}, ${variable}, {hash:${JSON.stringify(block.hash)}, data: ${data} || {}, fn: ${getCompileFn(block, depth + 1)}, inverse: ${getCompileInverse(block, depth + 1)}, root: root, parents: ${parents}});`;\n resultString += '}else {';\n resultString += `r += (Template7Helpers.with).call(${ctx}, ${variable}, {hash:${JSON.stringify(block.hash)}, data: ${data} || {}, fn: ${getCompileFn(block, depth + 1)}, inverse: ${getCompileInverse(block, depth + 1)}, root: root, parents: ${parents}});`;\n resultString += '}}';\n }\n }\n }\n resultString += '\\nreturn r;})';\n\n if (depth === 1) {\n // eslint-disable-next-line\n t.compiled = eval(resultString);\n return t.compiled;\n }\n return resultString;\n }\n static get options() {\n return Template7Options;\n }\n static get partials() {\n return Template7Partials;\n }\n static get helpers() {\n return Template7Helpers;\n }\n}\nexport default Template7Class;\n","import Template7Class from './template7-class';\n\nfunction Template7(...args) {\n const [template, data] = args;\n if (args.length === 2) {\n let instance = new Template7Class(template);\n const rendered = instance.compile()(data);\n instance = null;\n return (rendered);\n }\n return new Template7Class(template);\n}\nTemplate7.registerHelper = function registerHelper(name, fn) {\n Template7Class.helpers[name] = fn;\n};\nTemplate7.unregisterHelper = function unregisterHelper(name) {\n Template7Class.helpers[name] = undefined;\n delete Template7Class.helpers[name];\n};\nTemplate7.registerPartial = function registerPartial(name, template) {\n Template7Class.partials[name] = { template };\n};\nTemplate7.unregisterPartial = function unregisterPartial(name) {\n if (Template7Class.partials[name]) {\n Template7Class.partials[name] = undefined;\n delete Template7Class.partials[name];\n }\n};\nTemplate7.compile = function compile(template, options) {\n const instance = new Template7Class(template, options);\n return instance.compile();\n};\n\nTemplate7.options = Template7Class.options;\nTemplate7.helpers = Template7Class.helpers;\nTemplate7.partials = Template7Class.partials;\n\nexport default Template7;\n"]} \ No newline at end of file +{"version":3,"file":"template7.js.map","sources":["../src/context.js","../src/utils.js","../src/helpers.js","../src/template7-class.js","../src/template7.js"],"sourcesContent":["let t7ctx;\nif (typeof window !== 'undefined') {\n t7ctx = window;\n} else if (typeof global !== 'undefined') {\n t7ctx = global;\n} else {\n t7ctx = this;\n}\n\nconst Template7Context = t7ctx;\n\nexport default Template7Context;\n","import Template7Context from './context';\n\nconst Template7Utils = {\n quoteSingleRexExp: new RegExp('\\'', 'g'),\n quoteDoubleRexExp: new RegExp('\"', 'g'),\n isFunction(func) {\n return typeof func === 'function';\n },\n escape(string = '') {\n return string\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n },\n helperToSlices(string) {\n const { quoteDoubleRexExp, quoteSingleRexExp } = Template7Utils;\n const helperParts = string.replace(/[{}#}]/g, '').trim().split(' ');\n const slices = [];\n let shiftIndex;\n let i;\n let j;\n for (i = 0; i < helperParts.length; i += 1) {\n let part = helperParts[i];\n let blockQuoteRegExp;\n let openingQuote;\n if (i === 0) slices.push(part);\n else if (part.indexOf('\"') === 0 || part.indexOf('\\'') === 0) {\n blockQuoteRegExp = part.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = part.indexOf('\"') === 0 ? '\"' : '\\'';\n // Plain String\n if (part.match(blockQuoteRegExp).length === 2) {\n // One word string\n slices.push(part);\n } else {\n // Find closed Index\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n part += ` ${helperParts[j]}`;\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n slices.push(part);\n break;\n }\n }\n if (shiftIndex) i = shiftIndex;\n }\n } else if (part.indexOf('=') > 0) {\n // Hash\n const hashParts = part.split('=');\n const hashName = hashParts[0];\n let hashContent = hashParts[1];\n if (!blockQuoteRegExp) {\n blockQuoteRegExp = hashContent.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = hashContent.indexOf('\"') === 0 ? '\"' : '\\'';\n }\n if (hashContent.match(blockQuoteRegExp).length !== 2) {\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n hashContent += ` ${helperParts[j]}`;\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n break;\n }\n }\n if (shiftIndex) i = shiftIndex;\n }\n const hash = [hashName, hashContent.replace(blockQuoteRegExp, '')];\n slices.push(hash);\n } else {\n // Plain variable\n slices.push(part);\n }\n }\n return slices;\n },\n stringToBlocks(string) {\n const blocks = [];\n let i;\n let j;\n if (!string) return [];\n const stringBlocks = string.split(/({{[^{^}]*}})/);\n for (i = 0; i < stringBlocks.length; i += 1) {\n let block = stringBlocks[i];\n if (block === '') continue;\n if (block.indexOf('{{') < 0) {\n blocks.push({\n type: 'plain',\n content: block,\n });\n } else {\n if (block.indexOf('{/') >= 0) {\n continue;\n }\n block = block\n .replace(/{{([#/])*([ ])*/, '{{$1')\n .replace(/([ ])*}}/, '}}');\n if (block.indexOf('{#') < 0 && block.indexOf(' ') < 0 && block.indexOf('else') < 0) {\n // Simple variable\n blocks.push({\n type: 'variable',\n contextName: block.replace(/[{}]/g, ''),\n });\n continue;\n }\n // Helpers\n const helperSlices = Template7Utils.helperToSlices(block);\n let helperName = helperSlices[0];\n const isPartial = helperName === '>';\n const helperContext = [];\n const helperHash = {};\n for (j = 1; j < helperSlices.length; j += 1) {\n const slice = helperSlices[j];\n if (Array.isArray(slice)) {\n // Hash\n helperHash[slice[0]] = slice[1] === 'false' ? false : slice[1];\n } else {\n helperContext.push(slice);\n }\n }\n\n if (block.indexOf('{#') >= 0) {\n // Condition/Helper\n let helperContent = '';\n let elseContent = '';\n let toSkip = 0;\n let shiftIndex;\n let foundClosed = false;\n let foundElse = false;\n let depth = 0;\n for (j = i + 1; j < stringBlocks.length; j += 1) {\n if (stringBlocks[j].indexOf('{{#') >= 0) {\n depth += 1;\n }\n if (stringBlocks[j].indexOf('{{/') >= 0) {\n depth -= 1;\n }\n if (stringBlocks[j].indexOf(`{{#${helperName}`) >= 0) {\n helperContent += stringBlocks[j];\n if (foundElse) elseContent += stringBlocks[j];\n toSkip += 1;\n } else if (stringBlocks[j].indexOf(`{{/${helperName}`) >= 0) {\n if (toSkip > 0) {\n toSkip -= 1;\n helperContent += stringBlocks[j];\n if (foundElse) elseContent += stringBlocks[j];\n } else {\n shiftIndex = j;\n foundClosed = true;\n break;\n }\n } else if (stringBlocks[j].indexOf('else') >= 0 && depth === 0) {\n foundElse = true;\n } else {\n if (!foundElse) helperContent += stringBlocks[j];\n if (foundElse) elseContent += stringBlocks[j];\n }\n }\n if (foundClosed) {\n if (shiftIndex) i = shiftIndex;\n if (helperName === 'raw') {\n blocks.push({\n type: 'plain',\n content: helperContent,\n });\n } else {\n blocks.push({\n type: 'helper',\n helperName,\n contextName: helperContext,\n content: helperContent,\n inverseContent: elseContent,\n hash: helperHash,\n });\n }\n }\n } else if (block.indexOf(' ') > 0) {\n if (isPartial) {\n helperName = '_partial';\n if (helperContext[0]) {\n if (helperContext[0].indexOf('[') === 0) helperContext[0] = helperContext[0].replace(/[[\\]]/g, '');\n else helperContext[0] = `\"${helperContext[0].replace(/\"|'/g, '')}\"`;\n }\n }\n blocks.push({\n type: 'helper',\n helperName,\n contextName: helperContext,\n hash: helperHash,\n });\n }\n }\n }\n return blocks;\n },\n parseJsVariable(expression, replace, object) {\n return expression.split(/([+ \\-*/^()&=|<>!%:?])/g).reduce((arr, part) => {\n if (!part) {\n return arr;\n }\n if (part.indexOf(replace) < 0) {\n arr.push(part);\n return arr;\n }\n if (!object) {\n arr.push(JSON.stringify(''));\n return arr;\n }\n\n let variable = object;\n if (part.indexOf(`${replace}.`) >= 0) {\n part.split(`${replace}.`)[1].split('.').forEach((partName) => {\n if (partName in variable) variable = variable[partName];\n else variable = undefined;\n });\n }\n if (typeof variable === 'string') {\n variable = JSON.stringify(variable);\n }\n if (variable === undefined) variable = 'undefined';\n\n arr.push(variable);\n return arr;\n }, []).join('');\n },\n parseJsParents(expression, parents) {\n return expression.split(/([+ \\-*^()&=|<>!%:?])/g).reduce((arr, part) => {\n if (!part) {\n return arr;\n }\n\n if (part.indexOf('../') < 0) {\n arr.push(part);\n return arr;\n }\n\n if (!parents || parents.length === 0) {\n arr.push(JSON.stringify(''));\n return arr;\n }\n\n const levelsUp = part.split('../').length - 1;\n const parentData = levelsUp > parents.length ? parents[parents.length - 1] : parents[levelsUp - 1];\n\n let variable = parentData;\n const parentPart = part.replace(/..\\//g, '');\n parentPart.split('.').forEach((partName) => {\n if (typeof variable[partName] !== 'undefined') variable = variable[partName];\n else variable = 'undefined';\n });\n if (variable === false || variable === true) {\n arr.push(JSON.stringify(variable));\n return arr;\n }\n if (variable === null || variable === 'undefined') {\n arr.push(JSON.stringify(''));\n return arr;\n }\n arr.push(JSON.stringify(variable));\n return arr;\n }, []).join('');\n },\n getCompileVar(name, ctx, data = 'data_1') {\n let variable = ctx;\n let parts;\n let levelsUp = 0;\n let newDepth;\n if (name.indexOf('../') === 0) {\n levelsUp = name.split('../').length - 1;\n newDepth = variable.split('_')[1] - levelsUp;\n variable = `ctx_${newDepth >= 1 ? newDepth : 1}`;\n parts = name.split('../')[levelsUp].split('.');\n } else if (name.indexOf('@global') === 0) {\n variable = 'Template7.global';\n parts = name.split('@global.')[1].split('.');\n } else if (name.indexOf('@root') === 0) {\n variable = 'root';\n parts = name.split('@root.')[1].split('.');\n } else {\n parts = name.split('.');\n }\n for (let i = 0; i < parts.length; i += 1) {\n const part = parts[i];\n if (part.indexOf('@') === 0) {\n let dataLevel = data.split('_')[1];\n if (levelsUp > 0) {\n dataLevel = newDepth;\n }\n if (i > 0) {\n variable += `[(data_${dataLevel} && data_${dataLevel}.${part.replace('@', '')})]`;\n } else {\n variable = `(data_${dataLevel} && data_${dataLevel}.${part.replace('@', '')})`;\n }\n } else if (Number.isFinite ? Number.isFinite(part) : Template7Context.isFinite(part)) {\n variable += `[${part}]`;\n } else if (part === 'this' || part.indexOf('this.') >= 0 || part.indexOf('this[') >= 0 || part.indexOf('this(') >= 0) {\n variable = part.replace('this', ctx);\n } else {\n variable += `.${part}`;\n }\n }\n return variable;\n },\n getCompiledArguments(contextArray, ctx, data) {\n const arr = [];\n for (let i = 0; i < contextArray.length; i += 1) {\n if (/^['\"]/.test(contextArray[i])) arr.push(contextArray[i]);\n else if (/^(true|false|\\d+)$/.test(contextArray[i])) arr.push(contextArray[i]);\n else {\n arr.push(Template7Utils.getCompileVar(contextArray[i], ctx, data));\n }\n }\n\n return arr.join(', ');\n },\n};\n\nexport default Template7Utils;\n","/* eslint no-eval: \"off\" */\nimport Template7Utils from './utils';\nimport Template7Class from './template7-class';\nimport Template7Context from './context';\n\nconst Template7Helpers = {\n _partial(partialName, options) {\n const ctx = this;\n const p = Template7Class.partials[partialName];\n if (!p || (p && !p.template)) return '';\n if (!p.compiled) {\n p.compiled = new Template7Class(p.template).compile();\n }\n Object.keys(options.hash).forEach((hashName) => {\n ctx[hashName] = options.hash[hashName];\n });\n return p.compiled(ctx, options.data, options.root);\n },\n escape(context) {\n if (typeof context !== 'string') {\n throw new Error('Template7: Passed context to \"escape\" helper should be a string');\n }\n return Template7Utils.escape(context);\n },\n if(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n unless(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (!ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n each(context, options) {\n let ctx = context;\n let ret = '';\n let i = 0;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (Array.isArray(ctx)) {\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n for (i = 0; i < ctx.length; i += 1) {\n ret += options.fn(ctx[i], { first: i === 0, last: i === ctx.length - 1, index: i });\n }\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n } else {\n // eslint-disable-next-line\n for (const key in ctx) {\n i += 1;\n ret += options.fn(ctx[key], { key });\n }\n }\n if (i > 0) return ret;\n return options.inverse(this);\n },\n with(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = context.call(this); }\n return options.fn(ctx);\n },\n join(context, options) {\n let ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n return ctx.join(options.hash.delimiter || options.hash.delimeter);\n },\n js(expression, options) {\n const data = options.data;\n let func;\n let execute = expression;\n ('index first last key').split(' ').forEach((prop) => {\n if (typeof data[prop] !== 'undefined') {\n const re1 = new RegExp(`this.@${prop}`, 'g');\n const re2 = new RegExp(`@${prop}`, 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = `(function(){${execute}})`;\n } else {\n func = `(function(){return (${execute})})`;\n }\n return eval(func).call(this);\n },\n js_if(expression, options) {\n const data = options.data;\n let func;\n let execute = expression;\n ('index first last key').split(' ').forEach((prop) => {\n if (typeof data[prop] !== 'undefined') {\n const re1 = new RegExp(`this.@${prop}`, 'g');\n const re2 = new RegExp(`@${prop}`, 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = `(function(){${execute}})`;\n } else {\n func = `(function(){return (${execute})})`;\n }\n const condition = eval(func).call(this);\n if (condition) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n};\nTemplate7Helpers.js_compare = Template7Helpers.js_if;\n\nexport default Template7Helpers;\n","import Template7Utils from './utils';\nimport Template7Helpers from './helpers';\n\nconst Template7Options = {};\nconst Template7Partials = {};\n\nclass Template7Class {\n constructor(template) {\n const t = this;\n t.template = template;\n }\n compile(template = this.template, depth = 1) {\n const t = this;\n if (t.compiled) return t.compiled;\n\n if (typeof template !== 'string') {\n throw new Error('Template7: Template must be a string');\n }\n const { stringToBlocks, getCompileVar, getCompiledArguments } = Template7Utils;\n\n const blocks = stringToBlocks(template);\n const ctx = `ctx_${depth}`;\n const data = `data_${depth}`;\n if (blocks.length === 0) {\n return function empty() { return ''; };\n }\n\n function getCompileFn(block, newDepth) {\n if (block.content) return t.compile(block.content, newDepth);\n return function empty() { return ''; };\n }\n function getCompileInverse(block, newDepth) {\n if (block.inverseContent) return t.compile(block.inverseContent, newDepth);\n return function empty() { return ''; };\n }\n\n let resultString = '';\n if (depth === 1) {\n resultString += `(function (${ctx}, ${data}, root) {\\n`;\n } else {\n resultString += `(function (${ctx}, ${data}) {\\n`;\n }\n if (depth === 1) {\n resultString += 'function isArray(arr){return Array.isArray(arr);}\\n';\n resultString += 'function isFunction(func){return (typeof func === \\'function\\');}\\n';\n resultString += 'function c(val, ctx) {if (typeof val !== \"undefined\" && val !== null) {if (isFunction(val)) {return val.call(ctx);} else return val;} else return \"\";}\\n';\n resultString += 'root = root || ctx_1 || {};\\n';\n }\n resultString += 'var r = \\'\\';\\n';\n let i;\n for (i = 0; i < blocks.length; i += 1) {\n const block = blocks[i];\n // Plain block\n if (block.type === 'plain') {\n // eslint-disable-next-line\n resultString += `r +='${(block.content).replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n').replace(/'/g, '\\\\' + '\\'')}';`;\n continue;\n }\n let variable;\n let compiledArguments;\n // Variable block\n if (block.type === 'variable') {\n variable = getCompileVar(block.contextName, ctx, data);\n resultString += `r += c(${variable}, ${ctx});`;\n }\n // Helpers block\n if (block.type === 'helper') {\n let parents;\n if (ctx !== 'ctx_1') {\n const level = ctx.split('_')[1];\n let parentsString = `ctx_${level - 1}`;\n for (let j = level - 2; j >= 1; j -= 1) {\n parentsString += `, ctx_${j}`;\n }\n parents = `[${parentsString}]`;\n } else {\n parents = `[${ctx}]`;\n }\n let dynamicHelper;\n if (block.helperName.indexOf('[') === 0) {\n block.helperName = getCompileVar(block.helperName.replace(/[[\\]]/g, ''), ctx, data);\n dynamicHelper = true;\n }\n if (dynamicHelper || block.helperName in Template7Helpers) {\n compiledArguments = getCompiledArguments(block.contextName, ctx, data);\n resultString += `r += (Template7Helpers${dynamicHelper ? `[${block.helperName}]` : `.${block.helperName}`}).call(${ctx}, ${compiledArguments && (`${compiledArguments}, `)}{hash:${JSON.stringify(block.hash)}, data: ${data} || {}, fn: ${getCompileFn(block, depth + 1)}, inverse: ${getCompileInverse(block, depth + 1)}, root: root, parents: ${parents}});`;\n } else if (block.contextName.length > 0) {\n throw new Error(`Template7: Missing helper: \"${block.helperName}\"`);\n } else {\n variable = getCompileVar(block.helperName, ctx, data);\n resultString += `if (${variable}) {`;\n resultString += `if (isArray(${variable})) {`;\n resultString += `r += (Template7Helpers.each).call(${ctx}, ${variable}, {hash:${JSON.stringify(block.hash)}, data: ${data} || {}, fn: ${getCompileFn(block, depth + 1)}, inverse: ${getCompileInverse(block, depth + 1)}, root: root, parents: ${parents}});`;\n resultString += '}else {';\n resultString += `r += (Template7Helpers.with).call(${ctx}, ${variable}, {hash:${JSON.stringify(block.hash)}, data: ${data} || {}, fn: ${getCompileFn(block, depth + 1)}, inverse: ${getCompileInverse(block, depth + 1)}, root: root, parents: ${parents}});`;\n resultString += '}}';\n }\n }\n }\n resultString += '\\nreturn r;})';\n\n if (depth === 1) {\n // eslint-disable-next-line\n t.compiled = eval(resultString);\n return t.compiled;\n }\n return resultString;\n }\n static get options() {\n return Template7Options;\n }\n static get partials() {\n return Template7Partials;\n }\n static get helpers() {\n return Template7Helpers;\n }\n}\nexport default Template7Class;\n","import Template7Class from './template7-class';\n\nfunction Template7(...args) {\n const [template, data] = args;\n if (args.length === 2) {\n let instance = new Template7Class(template);\n const rendered = instance.compile()(data);\n instance = null;\n return (rendered);\n }\n return new Template7Class(template);\n}\nTemplate7.registerHelper = function registerHelper(name, fn) {\n Template7Class.helpers[name] = fn;\n};\nTemplate7.unregisterHelper = function unregisterHelper(name) {\n Template7Class.helpers[name] = undefined;\n delete Template7Class.helpers[name];\n};\nTemplate7.registerPartial = function registerPartial(name, template) {\n Template7Class.partials[name] = { template };\n};\nTemplate7.unregisterPartial = function unregisterPartial(name) {\n if (Template7Class.partials[name]) {\n Template7Class.partials[name] = undefined;\n delete Template7Class.partials[name];\n }\n};\nTemplate7.compile = function compile(template, options) {\n const instance = new Template7Class(template, options);\n return instance.compile();\n};\n\nTemplate7.options = Template7Class.options;\nTemplate7.helpers = Template7Class.helpers;\nTemplate7.partials = Template7Class.partials;\n\nexport default Template7;\n"],"names":["let","this","const"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAAAA,IAAI,KAAK,CAAC;EACV,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,KAAK,GAAG,MAAM,CAAC;GAChB,MAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACxC,KAAK,GAAG,MA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C;EACF,SAAS,CAAC,eAAe,GAAG,SAAS,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE;IACnE,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,YAAE,QAAQ,EAAE,CAAC;GAC9C,CAAC;EACF,SAAS,CAAC,iBAAiB,GAAG,SAAS,iBAAiB,CAAC,IAAI,EAAE;IAC7D,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;MACjC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;MAC1C,OAAO,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;KACtC;GACF,CAAC;EACF,SAAS,CAAC,OAAO,GAAG,SAAS,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE;IACtDA,IAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvD,OAAO,QAAQ,CAAC,OAAO,EAAE,CAAC;GAC3B,CAAC;;EAEF,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;EAC3C,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;EAC3C,SAAS,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/dist/template7.min.js b/dist/template7.min.js index 0d95c9f..ade1d24 100644 --- a/dist/template7.min.js +++ b/dist/template7.min.js @@ -1,16 +1,16 @@ /** - * Template7 1.4.0 + * Template7 1.4.1 * Mobile-first HTML template engine * * http://www.idangero.us/template7/ * - * Copyright 2018, Vladimir Kharlampidi + * Copyright 2019, Vladimir Kharlampidi * The iDangero.us * http://www.idangero.us/ * * Licensed under MIT * - * Released on: August 31, 2018 + * Released on: February 5, 2019 */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Template7=t()}(this,function(){"use strict";function Template7(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=e[0],r=e[1];if(2===e.length){var n=new Template7Class(i),l=n.compile()(r);return n=null,l}return new Template7Class(i)}var t7ctx;t7ctx="undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;var Template7Context=t7ctx,Template7Utils={quoteSingleRexExp:new RegExp("'","g"),quoteDoubleRexExp:new RegExp('"',"g"),isFunction:function(e){return"function"==typeof e},escape:function(e){return void 0!==Template7Context&&Template7Context.escape?Template7Context.escape(e):e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},helperToSlices:function(e){var t,i,r,n=Template7Utils.quoteDoubleRexExp,l=Template7Utils.quoteSingleRexExp,a=e.replace(/[{}#}]/g,"").trim().split(" "),s=[];for(i=0;i=0){t=r,s.push(o);break}t&&(i=t)}else if(o.indexOf("=")>0){var u=o.split("="),f=u[0],m=u[1];if(p||(p=0===m.indexOf('"')?n:l,c=0===m.indexOf('"')?'"':"'"),2!==m.match(p).length){for(t=0,r=i+1;r=0){t=r;break}t&&(i=t)}var d=[f,m.replace(p,"")];s.push(d)}else s.push(o)}return s},stringToBlocks:function(e){var t,i,r=[];if(!e)return[];var n=e.split(/({{[^{^}]*}})/);for(t=0;t=0)continue;if((l=l.replace(/{{([#/])*([ ])*/,"{{$1").replace(/([ ])*}}/,"}}")).indexOf("{#")<0&&l.indexOf(" ")<0&&l.indexOf("else")<0){r.push({type:"variable",contextName:l.replace(/[{}]/g,"")});continue}var a=Template7Utils.helperToSlices(l),s=a[0],o=">"===s,p=[],c={};for(i=1;i=0){var f="",m="",d=0,g=void 0,h=!1,x=!1,v=0;for(i=t+1;i=0&&(v+=1),n[i].indexOf("{{/")>=0&&(v-=1),n[i].indexOf("{{#"+s)>=0)f+=n[i],x&&(m+=n[i]),d+=1;else if(n[i].indexOf("{{/"+s)>=0){if(!(d>0)){g=i,h=!0;break}d-=1,f+=n[i],x&&(m+=n[i])}else n[i].indexOf("else")>=0&&0===v?x=!0:(x||(f+=n[i]),x&&(m+=n[i]));h&&(g&&(t=g),"raw"===s?r.push({type:"plain",content:f}):r.push({type:"helper",helperName:s,contextName:p,content:f,inverseContent:m,hash:c}))}else l.indexOf(" ")>0&&(o&&(s="_partial",p[0]&&(0===p[0].indexOf("[")?p[0]=p[0].replace(/[[\]]/g,""):p[0]='"'+p[0].replace(/"|'/g,"")+'"')),r.push({type:"helper",helperName:s,contextName:p,hash:c}))}}return r},parseJsVariable:function(e,t,i){return e.split(/([+ \-*/^])/g).map(function(e){if(e.indexOf(t)<0)return e;if(!i)return JSON.stringify("");var r=i;return e.indexOf(t+".")>=0&&e.split(t+".")[1].split(".").forEach(function(e){r=e in r?r[e]:void 0}),"string"==typeof r&&(r=JSON.stringify(r)),void 0===r&&(r="undefined"),r}).join("")},parseJsParents:function(e,t){return e.split(/([+ \-*^])/g).map(function(e){if(e.indexOf("../")<0)return e;if(!t||0===t.length)return JSON.stringify("");var i=e.split("../").length-1,r=i>t.length?t[t.length-1]:t[i-1];return e.replace(/..\//g,"").split(".").forEach(function(e){r=r[e]?r[e]:"undefined"}),JSON.stringify(r)}).join("")},getCompileVar:function(e,t,i){void 0===i&&(i="data_1");var r,n,l=t,a=0;0===e.indexOf("../")?(a=e.split("../").length-1,l="ctx_"+((n=l.split("_")[1]-a)>=1?n:1),r=e.split("../")[a].split(".")):0===e.indexOf("@global")?(l="Template7.global",r=e.split("@global.")[1].split(".")):0===e.indexOf("@root")?(l="root",r=e.split("@root.")[1].split(".")):r=e.split(".");for(var s=0;s0&&(p=n),s>0?l+="[(data_"+p+" && data_"+p+"."+o.replace("@","")+")]":l="(data_"+p+" && data_"+p+"."+o.replace("@","")+")"}else(Number.isFinite?Number.isFinite(o):Template7Context.isFinite(o))?l+="["+o+"]":"this"===o||o.indexOf("this.")>=0||o.indexOf("this[")>=0||o.indexOf("this(")>=0?l=o.replace("this",t):l+="."+o}return l},getCompiledArguments:function(e,t,i){for(var r=[],n=0;n0?r:t.inverse(this)},with:function(e,t){var i=e;return Template7Utils.isFunction(i)&&(i=e.call(this)),t.fn(i)},join:function(e,t){var i=e;return Template7Utils.isFunction(i)&&(i=i.call(this)),i.join(t.hash.delimiter||t.hash.delimeter)},js:function js(expression,options){var data=options.data,func,execute=expression;return"index first last key".split(" ").forEach(function(e){if(void 0!==data[e]){var t=new RegExp("this.@"+e,"g"),i=new RegExp("@"+e,"g");execute=execute.replace(t,JSON.stringify(data[e])).replace(i,JSON.stringify(data[e]))}}),options.root&&execute.indexOf("@root")>=0&&(execute=Template7Utils.parseJsVariable(execute,"@root",options.root)),execute.indexOf("@global")>=0&&(execute=Template7Utils.parseJsVariable(execute,"@global",Template7Context.Template7.global)),execute.indexOf("../")>=0&&(execute=Template7Utils.parseJsParents(execute,options.parents)),func=execute.indexOf("return")>=0?"(function(){"+execute+"})":"(function(){return ("+execute+")})",eval(func).call(this)},js_if:function js_if(expression,options){var data=options.data,func,execute=expression;"index first last key".split(" ").forEach(function(e){if(void 0!==data[e]){var t=new RegExp("this.@"+e,"g"),i=new RegExp("@"+e,"g");execute=execute.replace(t,JSON.stringify(data[e])).replace(i,JSON.stringify(data[e]))}}),options.root&&execute.indexOf("@root")>=0&&(execute=Template7Utils.parseJsVariable(execute,"@root",options.root)),execute.indexOf("@global")>=0&&(execute=Template7Utils.parseJsVariable(execute,"@global",Template7Context.Template7.global)),execute.indexOf("../")>=0&&(execute=Template7Utils.parseJsParents(execute,options.parents)),func=execute.indexOf("return")>=0?"(function(){"+execute+"})":"(function(){return ("+execute+")})";var condition=eval(func).call(this);return condition?options.fn(this,options.data):options.inverse(this,options.data)}};Template7Helpers.js_compare=Template7Helpers.js_if;var Template7Options={},Template7Partials={},Template7Class=function(e){this.template=e},staticAccessors={options:{configurable:!0},partials:{configurable:!0},helpers:{configurable:!0}};return Template7Class.prototype.compile=function compile(template,depth){function getCompileFn(e,i){return e.content?t.compile(e.content,i):function(){return""}}function getCompileInverse(e,i){return e.inverseContent?t.compile(e.inverseContent,i):function(){return""}}void 0===template&&(template=this.template),void 0===depth&&(depth=1);var t=this;if(t.compiled)return t.compiled;if("string"!=typeof template)throw new Error("Template7: Template must be a string");var stringToBlocks=Template7Utils.stringToBlocks,getCompileVar=Template7Utils.getCompileVar,getCompiledArguments=Template7Utils.getCompiledArguments,blocks=stringToBlocks(template),ctx="ctx_"+depth,data="data_"+depth;if(0===blocks.length)return function(){return""};var resultString="";resultString+=1===depth?"(function ("+ctx+", "+data+", root) {\n":"(function ("+ctx+", "+data+") {\n",1===depth&&(resultString+="function isArray(arr){return Array.isArray(arr);}\n",resultString+="function isFunction(func){return (typeof func === 'function');}\n",resultString+='function c(val, ctx) {if (typeof val !== "undefined" && val !== null) {if (isFunction(val)) {return val.call(ctx);} else return val;} else return "";}\n',resultString+="root = root || ctx_1 || {};\n"),resultString+="var r = '';\n";var i;for(i=0;i=1;j-=1)parentsString+=", ctx_"+j;parents="["+parentsString+"]"}else parents="["+ctx+"]";var dynamicHelper=void 0;if(0===block.helperName.indexOf("[")&&(block.helperName=getCompileVar(block.helperName.replace(/[[\]]/g,""),ctx,data),dynamicHelper=!0),dynamicHelper||block.helperName in Template7Helpers)compiledArguments=getCompiledArguments(block.contextName,ctx,data),resultString+="r += (Template7Helpers"+(dynamicHelper?"["+block.helperName+"]":"."+block.helperName)+").call("+ctx+", "+(compiledArguments&&compiledArguments+", ")+"{hash:"+JSON.stringify(block.hash)+", data: "+data+" || {}, fn: "+getCompileFn(block,depth+1)+", inverse: "+getCompileInverse(block,depth+1)+", root: root, parents: "+parents+"});";else{if(block.contextName.length>0)throw new Error('Template7: Missing helper: "'+block.helperName+'"');variable=getCompileVar(block.helperName,ctx,data),resultString+="if ("+variable+") {",resultString+="if (isArray("+variable+")) {",resultString+="r += (Template7Helpers.each).call("+ctx+", "+variable+", {hash:"+JSON.stringify(block.hash)+", data: "+data+" || {}, fn: "+getCompileFn(block,depth+1)+", inverse: "+getCompileInverse(block,depth+1)+", root: root, parents: "+parents+"});",resultString+="}else {",resultString+="r += (Template7Helpers.with).call("+ctx+", "+variable+", {hash:"+JSON.stringify(block.hash)+", data: "+data+" || {}, fn: "+getCompileFn(block,depth+1)+", inverse: "+getCompileInverse(block,depth+1)+", root: root, parents: "+parents+"});",resultString+="}}"}}}else resultString+="r +='"+block.content.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/'/g,"\\'")+"';"}return resultString+="\nreturn r;})",1===depth?(t.compiled=eval(resultString),t.compiled):resultString},staticAccessors.options.get=function(){return Template7Options},staticAccessors.partials.get=function(){return Template7Partials},staticAccessors.helpers.get=function(){return Template7Helpers},Object.defineProperties(Template7Class,staticAccessors),Template7.registerHelper=function(e,t){Template7Class.helpers[e]=t},Template7.unregisterHelper=function(e){Template7Class.helpers[e]=void 0,delete Template7Class.helpers[e]},Template7.registerPartial=function(e,t){Template7Class.partials[e]={template:t}},Template7.unregisterPartial=function(e){Template7Class.partials[e]&&(Template7Class.partials[e]=void 0,delete Template7Class.partials[e])},Template7.compile=function(e,t){return new Template7Class(e,t).compile()},Template7.options=Template7Class.options,Template7.helpers=Template7Class.helpers,Template7.partials=Template7Class.partials,Template7}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Template7=t()}(this,function(){"use strict";var t7ctx;t7ctx="undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;var Template7Context=t7ctx,Template7Utils={quoteSingleRexExp:new RegExp("'","g"),quoteDoubleRexExp:new RegExp('"',"g"),isFunction:function(e){return"function"==typeof e},escape:function(e){return void 0===e&&(e=""),e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},helperToSlices:function(e){var t,i,r,n=Template7Utils.quoteDoubleRexExp,l=Template7Utils.quoteSingleRexExp,a=e.replace(/[{}#}]/g,"").trim().split(" "),s=[];for(i=0;i"===s,p=[],c={};for(i=1;i!%:?])/g).reduce(function(e,t){if(!t)return e;if(t.indexOf(r)<0)return e.push(t),e;if(!n)return e.push(JSON.stringify("")),e;var i=n;return 0<=t.indexOf(r+".")&&t.split(r+".")[1].split(".").forEach(function(e){i=e in i?i[e]:void 0}),"string"==typeof i&&(i=JSON.stringify(i)),void 0===i&&(i="undefined"),e.push(i),e},[]).join("")},parseJsParents:function(e,n){return e.split(/([+ \-*^()&=|<>!%:?])/g).reduce(function(e,t){if(!t)return e;if(t.indexOf("../")<0)return e.push(t),e;if(!n||0===n.length)return e.push(JSON.stringify("")),e;var i=t.split("../").length-1,r=i>n.length?n[n.length-1]:n[i-1];return t.replace(/..\//g,"").split(".").forEach(function(e){r=void 0!==r[e]?r[e]:"undefined"}),!1===r||!0===r?e.push(JSON.stringify(r)):null===r||"undefined"===r?e.push(JSON.stringify("")):e.push(JSON.stringify(r)),e},[]).join("")},getCompileVar:function(e,t,i){void 0===i&&(i="data_1");var r,n,l=t,a=0;r=0===e.indexOf("../")?(a=e.split("../").length-1,l="ctx_"+(1<=(n=l.split("_")[1]-a)?n:1),e.split("../")[a].split(".")):0===e.indexOf("@global")?(l="Template7.global",e.split("@global.")[1].split(".")):0===e.indexOf("@root")?(l="root",e.split("@root.")[1].split(".")):e.split(".");for(var s=0;s/g, '>')\n .replace(/\"/g, '"');\n },\n helperToSlices: function helperToSlices(string) {\n var quoteDoubleRexExp = Template7Utils.quoteDoubleRexExp;\n var quoteSingleRexExp = Template7Utils.quoteSingleRexExp;\n var helperParts = string.replace(/[{}#}]/g, '').trim().split(' ');\n var slices = [];\n var shiftIndex;\n var i;\n var j;\n for (i = 0; i < helperParts.length; i += 1) {\n var part = helperParts[i];\n var blockQuoteRegExp = (void 0);\n var openingQuote = (void 0);\n if (i === 0) { slices.push(part); }\n else if (part.indexOf('\"') === 0 || part.indexOf('\\'') === 0) {\n blockQuoteRegExp = part.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = part.indexOf('\"') === 0 ? '\"' : '\\'';\n // Plain String\n if (part.match(blockQuoteRegExp).length === 2) {\n // One word string\n slices.push(part);\n } else {\n // Find closed Index\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n part += \" \" + (helperParts[j]);\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n slices.push(part);\n break;\n }\n }\n if (shiftIndex) { i = shiftIndex; }\n }\n } else if (part.indexOf('=') > 0) {\n // Hash\n var hashParts = part.split('=');\n var hashName = hashParts[0];\n var hashContent = hashParts[1];\n if (!blockQuoteRegExp) {\n blockQuoteRegExp = hashContent.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = hashContent.indexOf('\"') === 0 ? '\"' : '\\'';\n }\n if (hashContent.match(blockQuoteRegExp).length !== 2) {\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n hashContent += \" \" + (helperParts[j]);\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n break;\n }\n }\n if (shiftIndex) { i = shiftIndex; }\n }\n var hash = [hashName, hashContent.replace(blockQuoteRegExp, '')];\n slices.push(hash);\n } else {\n // Plain variable\n slices.push(part);\n }\n }\n return slices;\n },\n stringToBlocks: function stringToBlocks(string) {\n var blocks = [];\n var i;\n var j;\n if (!string) { return []; }\n var stringBlocks = string.split(/({{[^{^}]*}})/);\n for (i = 0; i < stringBlocks.length; i += 1) {\n var block = stringBlocks[i];\n if (block === '') { continue; }\n if (block.indexOf('{{') < 0) {\n blocks.push({\n type: 'plain',\n content: block,\n });\n } else {\n if (block.indexOf('{/') >= 0) {\n continue;\n }\n block = block\n .replace(/{{([#/])*([ ])*/, '{{$1')\n .replace(/([ ])*}}/, '}}');\n if (block.indexOf('{#') < 0 && block.indexOf(' ') < 0 && block.indexOf('else') < 0) {\n // Simple variable\n blocks.push({\n type: 'variable',\n contextName: block.replace(/[{}]/g, ''),\n });\n continue;\n }\n // Helpers\n var helperSlices = Template7Utils.helperToSlices(block);\n var helperName = helperSlices[0];\n var isPartial = helperName === '>';\n var helperContext = [];\n var helperHash = {};\n for (j = 1; j < helperSlices.length; j += 1) {\n var slice = helperSlices[j];\n if (Array.isArray(slice)) {\n // Hash\n helperHash[slice[0]] = slice[1] === 'false' ? false : slice[1];\n } else {\n helperContext.push(slice);\n }\n }\n\n if (block.indexOf('{#') >= 0) {\n // Condition/Helper\n var helperContent = '';\n var elseContent = '';\n var toSkip = 0;\n var shiftIndex = (void 0);\n var foundClosed = false;\n var foundElse = false;\n var depth = 0;\n for (j = i + 1; j < stringBlocks.length; j += 1) {\n if (stringBlocks[j].indexOf('{{#') >= 0) {\n depth += 1;\n }\n if (stringBlocks[j].indexOf('{{/') >= 0) {\n depth -= 1;\n }\n if (stringBlocks[j].indexOf((\"{{#\" + helperName)) >= 0) {\n helperContent += stringBlocks[j];\n if (foundElse) { elseContent += stringBlocks[j]; }\n toSkip += 1;\n } else if (stringBlocks[j].indexOf((\"{{/\" + helperName)) >= 0) {\n if (toSkip > 0) {\n toSkip -= 1;\n helperContent += stringBlocks[j];\n if (foundElse) { elseContent += stringBlocks[j]; }\n } else {\n shiftIndex = j;\n foundClosed = true;\n break;\n }\n } else if (stringBlocks[j].indexOf('else') >= 0 && depth === 0) {\n foundElse = true;\n } else {\n if (!foundElse) { helperContent += stringBlocks[j]; }\n if (foundElse) { elseContent += stringBlocks[j]; }\n }\n }\n if (foundClosed) {\n if (shiftIndex) { i = shiftIndex; }\n if (helperName === 'raw') {\n blocks.push({\n type: 'plain',\n content: helperContent,\n });\n } else {\n blocks.push({\n type: 'helper',\n helperName: helperName,\n contextName: helperContext,\n content: helperContent,\n inverseContent: elseContent,\n hash: helperHash,\n });\n }\n }\n } else if (block.indexOf(' ') > 0) {\n if (isPartial) {\n helperName = '_partial';\n if (helperContext[0]) {\n if (helperContext[0].indexOf('[') === 0) { helperContext[0] = helperContext[0].replace(/[[\\]]/g, ''); }\n else { helperContext[0] = \"\\\"\" + (helperContext[0].replace(/\"|'/g, '')) + \"\\\"\"; }\n }\n }\n blocks.push({\n type: 'helper',\n helperName: helperName,\n contextName: helperContext,\n hash: helperHash,\n });\n }\n }\n }\n return blocks;\n },\n parseJsVariable: function parseJsVariable(expression, replace, object) {\n return expression.split(/([+ \\-*/^])/g).map(function (part) {\n if (part.indexOf(replace) < 0) { return part; }\n if (!object) { return JSON.stringify(''); }\n var variable = object;\n if (part.indexOf((replace + \".\")) >= 0) {\n part.split((replace + \".\"))[1].split('.').forEach(function (partName) {\n if (partName in variable) { variable = variable[partName]; }\n else { variable = undefined; }\n });\n }\n if (typeof variable === 'string') {\n variable = JSON.stringify(variable);\n }\n if (variable === undefined) { variable = 'undefined'; }\n return variable;\n }).join('');\n },\n parseJsParents: function parseJsParents(expression, parents) {\n return expression.split(/([+ \\-*^])/g).map(function (part) {\n if (part.indexOf('../') < 0) { return part; }\n if (!parents || parents.length === 0) { return JSON.stringify(''); }\n var levelsUp = part.split('../').length - 1;\n var parentData = levelsUp > parents.length ? parents[parents.length - 1] : parents[levelsUp - 1];\n\n var variable = parentData;\n var parentPart = part.replace(/..\\//g, '');\n parentPart.split('.').forEach(function (partName) {\n if (variable[partName]) { variable = variable[partName]; }\n else { variable = 'undefined'; }\n });\n return JSON.stringify(variable);\n }).join('');\n },\n getCompileVar: function getCompileVar(name, ctx, data) {\n if ( data === void 0 ) data = 'data_1';\n\n var variable = ctx;\n var parts;\n var levelsUp = 0;\n var newDepth;\n if (name.indexOf('../') === 0) {\n levelsUp = name.split('../').length - 1;\n newDepth = variable.split('_')[1] - levelsUp;\n variable = \"ctx_\" + (newDepth >= 1 ? newDepth : 1);\n parts = name.split('../')[levelsUp].split('.');\n } else if (name.indexOf('@global') === 0) {\n variable = 'Template7.global';\n parts = name.split('@global.')[1].split('.');\n } else if (name.indexOf('@root') === 0) {\n variable = 'root';\n parts = name.split('@root.')[1].split('.');\n } else {\n parts = name.split('.');\n }\n for (var i = 0; i < parts.length; i += 1) {\n var part = parts[i];\n if (part.indexOf('@') === 0) {\n var dataLevel = data.split('_')[1];\n if (levelsUp > 0) {\n dataLevel = newDepth;\n }\n if (i > 0) {\n variable += \"[(data_\" + dataLevel + \" && data_\" + dataLevel + \".\" + (part.replace('@', '')) + \")]\";\n } else {\n variable = \"(data_\" + dataLevel + \" && data_\" + dataLevel + \".\" + (part.replace('@', '')) + \")\";\n }\n } else if (Number.isFinite ? Number.isFinite(part) : Template7Context.isFinite(part)) {\n variable += \"[\" + part + \"]\";\n } else if (part === 'this' || part.indexOf('this.') >= 0 || part.indexOf('this[') >= 0 || part.indexOf('this(') >= 0) {\n variable = part.replace('this', ctx);\n } else {\n variable += \".\" + part;\n }\n }\n return variable;\n },\n getCompiledArguments: function getCompiledArguments(contextArray, ctx, data) {\n var arr = [];\n for (var i = 0; i < contextArray.length; i += 1) {\n if (/^['\"]/.test(contextArray[i])) { arr.push(contextArray[i]); }\n else if (/^(true|false|\\d+)$/.test(contextArray[i])) { arr.push(contextArray[i]); }\n else {\n arr.push(Template7Utils.getCompileVar(contextArray[i], ctx, data));\n }\n }\n\n return arr.join(', ');\n },\n};\n\n/* eslint no-eval: \"off\" */\nvar Template7Helpers = {\n _partial: function _partial(partialName, options) {\n var ctx = this;\n var p = Template7Class.partials[partialName];\n if (!p || (p && !p.template)) { return ''; }\n if (!p.compiled) {\n p.compiled = new Template7Class(p.template).compile();\n }\n Object.keys(options.hash).forEach(function (hashName) {\n ctx[hashName] = options.hash[hashName];\n });\n return p.compiled(ctx, options.data, options.root);\n },\n escape: function escape(context) {\n if (typeof context !== 'string') {\n throw new Error('Template7: Passed context to \"escape\" helper should be a string');\n }\n return Template7Utils.escape(context);\n },\n if: function if$1(context, options) {\n var ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n unless: function unless(context, options) {\n var ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (!ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n each: function each(context, options) {\n var ctx = context;\n var ret = '';\n var i = 0;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (Array.isArray(ctx)) {\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n for (i = 0; i < ctx.length; i += 1) {\n ret += options.fn(ctx[i], { first: i === 0, last: i === ctx.length - 1, index: i });\n }\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n } else {\n // eslint-disable-next-line\n for (var key in ctx) {\n i += 1;\n ret += options.fn(ctx[key], { key: key });\n }\n }\n if (i > 0) { return ret; }\n return options.inverse(this);\n },\n with: function with$1(context, options) {\n var ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = context.call(this); }\n return options.fn(ctx);\n },\n join: function join(context, options) {\n var ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n return ctx.join(options.hash.delimiter || options.hash.delimeter);\n },\n js: function js(expression, options) {\n var data = options.data;\n var func;\n var execute = expression;\n ('index first last key').split(' ').forEach(function (prop) {\n if (typeof data[prop] !== 'undefined') {\n var re1 = new RegExp((\"this.@\" + prop), 'g');\n var re2 = new RegExp((\"@\" + prop), 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = \"(function(){\" + execute + \"})\";\n } else {\n func = \"(function(){return (\" + execute + \")})\";\n }\n return eval(func).call(this);\n },\n js_if: function js_if(expression, options) {\n var data = options.data;\n var func;\n var execute = expression;\n ('index first last key').split(' ').forEach(function (prop) {\n if (typeof data[prop] !== 'undefined') {\n var re1 = new RegExp((\"this.@\" + prop), 'g');\n var re2 = new RegExp((\"@\" + prop), 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = \"(function(){\" + execute + \"})\";\n } else {\n func = \"(function(){return (\" + execute + \")})\";\n }\n var condition = eval(func).call(this);\n if (condition) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n};\nTemplate7Helpers.js_compare = Template7Helpers.js_if;\n\nvar Template7Options = {};\nvar Template7Partials = {};\n\nvar Template7Class = function Template7Class(template) {\n var t = this;\n t.template = template;\n};\n\nvar staticAccessors = { options: { configurable: true },partials: { configurable: true },helpers: { configurable: true } };\nTemplate7Class.prototype.compile = function compile (template, depth) {\n if ( template === void 0 ) template = this.template;\n if ( depth === void 0 ) depth = 1;\n\n var t = this;\n if (t.compiled) { return t.compiled; }\n\n if (typeof template !== 'string') {\n throw new Error('Template7: Template must be a string');\n }\n var stringToBlocks = Template7Utils.stringToBlocks;\n var getCompileVar = Template7Utils.getCompileVar;\n var getCompiledArguments = Template7Utils.getCompiledArguments;\n\n var blocks = stringToBlocks(template);\n var ctx = \"ctx_\" + depth;\n var data = \"data_\" + depth;\n if (blocks.length === 0) {\n return function empty() { return ''; };\n }\n\n function getCompileFn(block, newDepth) {\n if (block.content) { return t.compile(block.content, newDepth); }\n return function empty() { return ''; };\n }\n function getCompileInverse(block, newDepth) {\n if (block.inverseContent) { return t.compile(block.inverseContent, newDepth); }\n return function empty() { return ''; };\n }\n\n var resultString = '';\n if (depth === 1) {\n resultString += \"(function (\" + ctx + \", \" + data + \", root) {\\n\";\n } else {\n resultString += \"(function (\" + ctx + \", \" + data + \") {\\n\";\n }\n if (depth === 1) {\n resultString += 'function isArray(arr){return Array.isArray(arr);}\\n';\n resultString += 'function isFunction(func){return (typeof func === \\'function\\');}\\n';\n resultString += 'function c(val, ctx) {if (typeof val !== \"undefined\" && val !== null) {if (isFunction(val)) {return val.call(ctx);} else return val;} else return \"\";}\\n';\n resultString += 'root = root || ctx_1 || {};\\n';\n }\n resultString += 'var r = \\'\\';\\n';\n var i;\n for (i = 0; i < blocks.length; i += 1) {\n var block = blocks[i];\n // Plain block\n if (block.type === 'plain') {\n // eslint-disable-next-line\n resultString += \"r +='\" + ((block.content).replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n').replace(/'/g, '\\\\' + '\\'')) + \"';\";\n continue;\n }\n var variable = (void 0);\n var compiledArguments = (void 0);\n // Variable block\n if (block.type === 'variable') {\n variable = getCompileVar(block.contextName, ctx, data);\n resultString += \"r += c(\" + variable + \", \" + ctx + \");\";\n }\n // Helpers block\n if (block.type === 'helper') {\n var parents = (void 0);\n if (ctx !== 'ctx_1') {\n var level = ctx.split('_')[1];\n var parentsString = \"ctx_\" + (level - 1);\n for (var j = level - 2; j >= 1; j -= 1) {\n parentsString += \", ctx_\" + j;\n }\n parents = \"[\" + parentsString + \"]\";\n } else {\n parents = \"[\" + ctx + \"]\";\n }\n var dynamicHelper = (void 0);\n if (block.helperName.indexOf('[') === 0) {\n block.helperName = getCompileVar(block.helperName.replace(/[[\\]]/g, ''), ctx, data);\n dynamicHelper = true;\n }\n if (dynamicHelper || block.helperName in Template7Helpers) {\n compiledArguments = getCompiledArguments(block.contextName, ctx, data);\n resultString += \"r += (Template7Helpers\" + (dynamicHelper ? (\"[\" + (block.helperName) + \"]\") : (\".\" + (block.helperName))) + \").call(\" + ctx + \", \" + (compiledArguments && ((compiledArguments + \", \"))) + \"{hash:\" + (JSON.stringify(block.hash)) + \", data: \" + data + \" || {}, fn: \" + (getCompileFn(block, depth + 1)) + \", inverse: \" + (getCompileInverse(block, depth + 1)) + \", root: root, parents: \" + parents + \"});\";\n } else if (block.contextName.length > 0) {\n throw new Error((\"Template7: Missing helper: \\\"\" + (block.helperName) + \"\\\"\"));\n } else {\n variable = getCompileVar(block.helperName, ctx, data);\n resultString += \"if (\" + variable + \") {\";\n resultString += \"if (isArray(\" + variable + \")) {\";\n resultString += \"r += (Template7Helpers.each).call(\" + ctx + \", \" + variable + \", {hash:\" + (JSON.stringify(block.hash)) + \", data: \" + data + \" || {}, fn: \" + (getCompileFn(block, depth + 1)) + \", inverse: \" + (getCompileInverse(block, depth + 1)) + \", root: root, parents: \" + parents + \"});\";\n resultString += '}else {';\n resultString += \"r += (Template7Helpers.with).call(\" + ctx + \", \" + variable + \", {hash:\" + (JSON.stringify(block.hash)) + \", data: \" + data + \" || {}, fn: \" + (getCompileFn(block, depth + 1)) + \", inverse: \" + (getCompileInverse(block, depth + 1)) + \", root: root, parents: \" + parents + \"});\";\n resultString += '}}';\n }\n }\n }\n resultString += '\\nreturn r;})';\n\n if (depth === 1) {\n // eslint-disable-next-line\n t.compiled = eval(resultString);\n return t.compiled;\n }\n return resultString;\n};\nstaticAccessors.options.get = function () {\n return Template7Options;\n};\nstaticAccessors.partials.get = function () {\n return Template7Partials;\n};\nstaticAccessors.helpers.get = function () {\n return Template7Helpers;\n};\n\nObject.defineProperties( Template7Class, staticAccessors );\n\nfunction Template7() {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var template = args[0];\n var data = args[1];\n if (args.length === 2) {\n var instance = new Template7Class(template);\n var rendered = instance.compile()(data);\n instance = null;\n return (rendered);\n }\n return new Template7Class(template);\n}\nTemplate7.registerHelper = function registerHelper(name, fn) {\n Template7Class.helpers[name] = fn;\n};\nTemplate7.unregisterHelper = function unregisterHelper(name) {\n Template7Class.helpers[name] = undefined;\n delete Template7Class.helpers[name];\n};\nTemplate7.registerPartial = function registerPartial(name, template) {\n Template7Class.partials[name] = { template: template };\n};\nTemplate7.unregisterPartial = function unregisterPartial(name) {\n if (Template7Class.partials[name]) {\n Template7Class.partials[name] = undefined;\n delete Template7Class.partials[name];\n }\n};\nTemplate7.compile = function compile(template, options) {\n var instance = new Template7Class(template, options);\n return instance.compile();\n};\n\nTemplate7.options = Template7Class.options;\nTemplate7.helpers = Template7Class.helpers;\nTemplate7.partials = Template7Class.partials;\n\nreturn Template7;\n\n})));\n\n//# sourceMappingURL=template7.js.map\n"]} \ No newline at end of file +{"version":3,"sources":["template7.js"],"names":["global","factory","exports","module","define","amd","self","Template7","this","t7ctx","window","undefined","Template7Context","Template7Utils","quoteSingleRexExp","RegExp","quoteDoubleRexExp","isFunction","func","escape","string","replace","helperToSlices","shiftIndex","i","j","helperParts","trim","split","slices","length","part","blockQuoteRegExp","openingQuote","push","indexOf","match","hashParts","hashName","hashContent","hash","stringToBlocks","blocks","stringBlocks","block","type","content","contextName","helperSlices","helperName","isPartial","helperContext","helperHash","slice","Array","isArray","helperContent","elseContent","toSkip","foundClosed","foundElse","depth","inverseContent","parseJsVariable","expression","object","reduce","arr","JSON","stringify","variable","forEach","partName","join","parseJsParents","parents","levelsUp","getCompileVar","name","ctx","data","parts","newDepth","dataLevel","Number","isFinite","getCompiledArguments","contextArray","test","Template7Helpers","_partial","partialName","options","p","Template7Class","partials","template","compiled","compile","Object","keys","root","context","Error","if","call","fn","inverse","unless","each","ret","reverse","first","last","index","key","with","delimiter","delimeter","js","execute","prop","re1","re2","eval","js_if","condition","js_compare","Template7Options","Template7Partials","staticAccessors","configurable","helpers","args","len","arguments","instance","rendered","prototype","t","getCompileFn","getCompileInverse","resultString","compiledArguments","level","parentsString","dynamicHelper","get","defineProperties","registerHelper","unregisterHelper","registerPartial","unregisterPartial"],"mappings":";;;;;;;;;;;;;;CAeC,SAAUA,EAAQC,GACE,iBAAZC,SAA0C,oBAAXC,OAAyBA,OAAOD,QAAUD,IAC9D,mBAAXG,QAAyBA,OAAOC,IAAMD,OAAOH,IACnDD,EAASA,GAAUM,MAAaC,UAAYN,IAH/C,CAIEO,KAAM,WAA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,OAAOlB,mBAETC,gBAAgBE,QAAQe,IAAM,WAC5B,OAAO1D,kBAGTU,OAAOiD,iBAAkBtD,eAAgBoC,iBAgBzC3H,UAAU8I,eAAiB,SAAwBvE,EAAM4B,GACvDZ,eAAesC,QAAQtD,GAAQ4B,GAEjCnG,UAAU+I,iBAAmB,SAA0BxE,GACrDgB,eAAesC,QAAQtD,QAAQnE,SACxBmF,eAAesC,QAAQtD,IAEhCvE,UAAUgJ,gBAAkB,SAAyBzE,EAAMkB,GACzDF,eAAeC,SAASjB,GAAQ,CAAEkB,SAAUA,IAE9CzF,UAAUiJ,kBAAoB,SAA2B1E,GACnDgB,eAAeC,SAASjB,KAC1BgB,eAAeC,SAASjB,QAAQnE,SACzBmF,eAAeC,SAASjB,KAGnCvE,UAAU2F,QAAU,SAAiBF,EAAUJ,GAE7C,OADe,IAAIE,eAAeE,EAAUJ,GAC5BM,WAGlB3F,UAAUqF,QAAUE,eAAeF,QACnCrF,UAAU6H,QAAUtC,eAAesC,QACnC7H,UAAUwF,SAAWD,eAAeC,SAE7BxF","file":"template7.min.js","sourcesContent":["/**\n * Template7 1.4.1\n * Mobile-first HTML template engine\n * \n * http://www.idangero.us/template7/\n * \n * Copyright 2019, Vladimir Kharlampidi\n * The iDangero.us\n * http://www.idangero.us/\n * \n * Licensed under MIT\n * \n * Released on: February 5, 2019\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Template7 = factory());\n}(this, function () { 'use strict';\n\n var t7ctx;\n if (typeof window !== 'undefined') {\n t7ctx = window;\n } else if (typeof global !== 'undefined') {\n t7ctx = global;\n } else {\n t7ctx = undefined;\n }\n\n var Template7Context = t7ctx;\n\n var Template7Utils = {\n quoteSingleRexExp: new RegExp('\\'', 'g'),\n quoteDoubleRexExp: new RegExp('\"', 'g'),\n isFunction: function isFunction(func) {\n return typeof func === 'function';\n },\n escape: function escape(string) {\n if ( string === void 0 ) string = '';\n\n return string\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n },\n helperToSlices: function helperToSlices(string) {\n var quoteDoubleRexExp = Template7Utils.quoteDoubleRexExp;\n var quoteSingleRexExp = Template7Utils.quoteSingleRexExp;\n var helperParts = string.replace(/[{}#}]/g, '').trim().split(' ');\n var slices = [];\n var shiftIndex;\n var i;\n var j;\n for (i = 0; i < helperParts.length; i += 1) {\n var part = helperParts[i];\n var blockQuoteRegExp = (void 0);\n var openingQuote = (void 0);\n if (i === 0) { slices.push(part); }\n else if (part.indexOf('\"') === 0 || part.indexOf('\\'') === 0) {\n blockQuoteRegExp = part.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = part.indexOf('\"') === 0 ? '\"' : '\\'';\n // Plain String\n if (part.match(blockQuoteRegExp).length === 2) {\n // One word string\n slices.push(part);\n } else {\n // Find closed Index\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n part += \" \" + (helperParts[j]);\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n slices.push(part);\n break;\n }\n }\n if (shiftIndex) { i = shiftIndex; }\n }\n } else if (part.indexOf('=') > 0) {\n // Hash\n var hashParts = part.split('=');\n var hashName = hashParts[0];\n var hashContent = hashParts[1];\n if (!blockQuoteRegExp) {\n blockQuoteRegExp = hashContent.indexOf('\"') === 0 ? quoteDoubleRexExp : quoteSingleRexExp;\n openingQuote = hashContent.indexOf('\"') === 0 ? '\"' : '\\'';\n }\n if (hashContent.match(blockQuoteRegExp).length !== 2) {\n shiftIndex = 0;\n for (j = i + 1; j < helperParts.length; j += 1) {\n hashContent += \" \" + (helperParts[j]);\n if (helperParts[j].indexOf(openingQuote) >= 0) {\n shiftIndex = j;\n break;\n }\n }\n if (shiftIndex) { i = shiftIndex; }\n }\n var hash = [hashName, hashContent.replace(blockQuoteRegExp, '')];\n slices.push(hash);\n } else {\n // Plain variable\n slices.push(part);\n }\n }\n return slices;\n },\n stringToBlocks: function stringToBlocks(string) {\n var blocks = [];\n var i;\n var j;\n if (!string) { return []; }\n var stringBlocks = string.split(/({{[^{^}]*}})/);\n for (i = 0; i < stringBlocks.length; i += 1) {\n var block = stringBlocks[i];\n if (block === '') { continue; }\n if (block.indexOf('{{') < 0) {\n blocks.push({\n type: 'plain',\n content: block,\n });\n } else {\n if (block.indexOf('{/') >= 0) {\n continue;\n }\n block = block\n .replace(/{{([#/])*([ ])*/, '{{$1')\n .replace(/([ ])*}}/, '}}');\n if (block.indexOf('{#') < 0 && block.indexOf(' ') < 0 && block.indexOf('else') < 0) {\n // Simple variable\n blocks.push({\n type: 'variable',\n contextName: block.replace(/[{}]/g, ''),\n });\n continue;\n }\n // Helpers\n var helperSlices = Template7Utils.helperToSlices(block);\n var helperName = helperSlices[0];\n var isPartial = helperName === '>';\n var helperContext = [];\n var helperHash = {};\n for (j = 1; j < helperSlices.length; j += 1) {\n var slice = helperSlices[j];\n if (Array.isArray(slice)) {\n // Hash\n helperHash[slice[0]] = slice[1] === 'false' ? false : slice[1];\n } else {\n helperContext.push(slice);\n }\n }\n\n if (block.indexOf('{#') >= 0) {\n // Condition/Helper\n var helperContent = '';\n var elseContent = '';\n var toSkip = 0;\n var shiftIndex = (void 0);\n var foundClosed = false;\n var foundElse = false;\n var depth = 0;\n for (j = i + 1; j < stringBlocks.length; j += 1) {\n if (stringBlocks[j].indexOf('{{#') >= 0) {\n depth += 1;\n }\n if (stringBlocks[j].indexOf('{{/') >= 0) {\n depth -= 1;\n }\n if (stringBlocks[j].indexOf((\"{{#\" + helperName)) >= 0) {\n helperContent += stringBlocks[j];\n if (foundElse) { elseContent += stringBlocks[j]; }\n toSkip += 1;\n } else if (stringBlocks[j].indexOf((\"{{/\" + helperName)) >= 0) {\n if (toSkip > 0) {\n toSkip -= 1;\n helperContent += stringBlocks[j];\n if (foundElse) { elseContent += stringBlocks[j]; }\n } else {\n shiftIndex = j;\n foundClosed = true;\n break;\n }\n } else if (stringBlocks[j].indexOf('else') >= 0 && depth === 0) {\n foundElse = true;\n } else {\n if (!foundElse) { helperContent += stringBlocks[j]; }\n if (foundElse) { elseContent += stringBlocks[j]; }\n }\n }\n if (foundClosed) {\n if (shiftIndex) { i = shiftIndex; }\n if (helperName === 'raw') {\n blocks.push({\n type: 'plain',\n content: helperContent,\n });\n } else {\n blocks.push({\n type: 'helper',\n helperName: helperName,\n contextName: helperContext,\n content: helperContent,\n inverseContent: elseContent,\n hash: helperHash,\n });\n }\n }\n } else if (block.indexOf(' ') > 0) {\n if (isPartial) {\n helperName = '_partial';\n if (helperContext[0]) {\n if (helperContext[0].indexOf('[') === 0) { helperContext[0] = helperContext[0].replace(/[[\\]]/g, ''); }\n else { helperContext[0] = \"\\\"\" + (helperContext[0].replace(/\"|'/g, '')) + \"\\\"\"; }\n }\n }\n blocks.push({\n type: 'helper',\n helperName: helperName,\n contextName: helperContext,\n hash: helperHash,\n });\n }\n }\n }\n return blocks;\n },\n parseJsVariable: function parseJsVariable(expression, replace, object) {\n return expression.split(/([+ \\-*/^()&=|<>!%:?])/g).reduce(function (arr, part) {\n if (!part) {\n return arr;\n }\n if (part.indexOf(replace) < 0) {\n arr.push(part);\n return arr;\n }\n if (!object) {\n arr.push(JSON.stringify(''));\n return arr;\n }\n\n var variable = object;\n if (part.indexOf((replace + \".\")) >= 0) {\n part.split((replace + \".\"))[1].split('.').forEach(function (partName) {\n if (partName in variable) { variable = variable[partName]; }\n else { variable = undefined; }\n });\n }\n if (typeof variable === 'string') {\n variable = JSON.stringify(variable);\n }\n if (variable === undefined) { variable = 'undefined'; }\n\n arr.push(variable);\n return arr;\n }, []).join('');\n },\n parseJsParents: function parseJsParents(expression, parents) {\n return expression.split(/([+ \\-*^()&=|<>!%:?])/g).reduce(function (arr, part) {\n if (!part) {\n return arr;\n }\n\n if (part.indexOf('../') < 0) {\n arr.push(part);\n return arr;\n }\n\n if (!parents || parents.length === 0) {\n arr.push(JSON.stringify(''));\n return arr;\n }\n\n var levelsUp = part.split('../').length - 1;\n var parentData = levelsUp > parents.length ? parents[parents.length - 1] : parents[levelsUp - 1];\n\n var variable = parentData;\n var parentPart = part.replace(/..\\//g, '');\n parentPart.split('.').forEach(function (partName) {\n if (typeof variable[partName] !== 'undefined') { variable = variable[partName]; }\n else { variable = 'undefined'; }\n });\n if (variable === false || variable === true) {\n arr.push(JSON.stringify(variable));\n return arr;\n }\n if (variable === null || variable === 'undefined') {\n arr.push(JSON.stringify(''));\n return arr;\n }\n arr.push(JSON.stringify(variable));\n return arr;\n }, []).join('');\n },\n getCompileVar: function getCompileVar(name, ctx, data) {\n if ( data === void 0 ) data = 'data_1';\n\n var variable = ctx;\n var parts;\n var levelsUp = 0;\n var newDepth;\n if (name.indexOf('../') === 0) {\n levelsUp = name.split('../').length - 1;\n newDepth = variable.split('_')[1] - levelsUp;\n variable = \"ctx_\" + (newDepth >= 1 ? newDepth : 1);\n parts = name.split('../')[levelsUp].split('.');\n } else if (name.indexOf('@global') === 0) {\n variable = 'Template7.global';\n parts = name.split('@global.')[1].split('.');\n } else if (name.indexOf('@root') === 0) {\n variable = 'root';\n parts = name.split('@root.')[1].split('.');\n } else {\n parts = name.split('.');\n }\n for (var i = 0; i < parts.length; i += 1) {\n var part = parts[i];\n if (part.indexOf('@') === 0) {\n var dataLevel = data.split('_')[1];\n if (levelsUp > 0) {\n dataLevel = newDepth;\n }\n if (i > 0) {\n variable += \"[(data_\" + dataLevel + \" && data_\" + dataLevel + \".\" + (part.replace('@', '')) + \")]\";\n } else {\n variable = \"(data_\" + dataLevel + \" && data_\" + dataLevel + \".\" + (part.replace('@', '')) + \")\";\n }\n } else if (Number.isFinite ? Number.isFinite(part) : Template7Context.isFinite(part)) {\n variable += \"[\" + part + \"]\";\n } else if (part === 'this' || part.indexOf('this.') >= 0 || part.indexOf('this[') >= 0 || part.indexOf('this(') >= 0) {\n variable = part.replace('this', ctx);\n } else {\n variable += \".\" + part;\n }\n }\n return variable;\n },\n getCompiledArguments: function getCompiledArguments(contextArray, ctx, data) {\n var arr = [];\n for (var i = 0; i < contextArray.length; i += 1) {\n if (/^['\"]/.test(contextArray[i])) { arr.push(contextArray[i]); }\n else if (/^(true|false|\\d+)$/.test(contextArray[i])) { arr.push(contextArray[i]); }\n else {\n arr.push(Template7Utils.getCompileVar(contextArray[i], ctx, data));\n }\n }\n\n return arr.join(', ');\n },\n };\n\n /* eslint no-eval: \"off\" */\n\n var Template7Helpers = {\n _partial: function _partial(partialName, options) {\n var ctx = this;\n var p = Template7Class.partials[partialName];\n if (!p || (p && !p.template)) { return ''; }\n if (!p.compiled) {\n p.compiled = new Template7Class(p.template).compile();\n }\n Object.keys(options.hash).forEach(function (hashName) {\n ctx[hashName] = options.hash[hashName];\n });\n return p.compiled(ctx, options.data, options.root);\n },\n escape: function escape(context) {\n if (typeof context !== 'string') {\n throw new Error('Template7: Passed context to \"escape\" helper should be a string');\n }\n return Template7Utils.escape(context);\n },\n if: function if$1(context, options) {\n var ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n unless: function unless(context, options) {\n var ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (!ctx) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n each: function each(context, options) {\n var ctx = context;\n var ret = '';\n var i = 0;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n if (Array.isArray(ctx)) {\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n for (i = 0; i < ctx.length; i += 1) {\n ret += options.fn(ctx[i], { first: i === 0, last: i === ctx.length - 1, index: i });\n }\n if (options.hash.reverse) {\n ctx = ctx.reverse();\n }\n } else {\n // eslint-disable-next-line\n for (var key in ctx) {\n i += 1;\n ret += options.fn(ctx[key], { key: key });\n }\n }\n if (i > 0) { return ret; }\n return options.inverse(this);\n },\n with: function with$1(context, options) {\n var ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = context.call(this); }\n return options.fn(ctx);\n },\n join: function join(context, options) {\n var ctx = context;\n if (Template7Utils.isFunction(ctx)) { ctx = ctx.call(this); }\n return ctx.join(options.hash.delimiter || options.hash.delimeter);\n },\n js: function js(expression, options) {\n var data = options.data;\n var func;\n var execute = expression;\n ('index first last key').split(' ').forEach(function (prop) {\n if (typeof data[prop] !== 'undefined') {\n var re1 = new RegExp((\"this.@\" + prop), 'g');\n var re2 = new RegExp((\"@\" + prop), 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = \"(function(){\" + execute + \"})\";\n } else {\n func = \"(function(){return (\" + execute + \")})\";\n }\n return eval(func).call(this);\n },\n js_if: function js_if(expression, options) {\n var data = options.data;\n var func;\n var execute = expression;\n ('index first last key').split(' ').forEach(function (prop) {\n if (typeof data[prop] !== 'undefined') {\n var re1 = new RegExp((\"this.@\" + prop), 'g');\n var re2 = new RegExp((\"@\" + prop), 'g');\n execute = execute\n .replace(re1, JSON.stringify(data[prop]))\n .replace(re2, JSON.stringify(data[prop]));\n }\n });\n if (options.root && execute.indexOf('@root') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@root', options.root);\n }\n if (execute.indexOf('@global') >= 0) {\n execute = Template7Utils.parseJsVariable(execute, '@global', Template7Context.Template7.global);\n }\n if (execute.indexOf('../') >= 0) {\n execute = Template7Utils.parseJsParents(execute, options.parents);\n }\n if (execute.indexOf('return') >= 0) {\n func = \"(function(){\" + execute + \"})\";\n } else {\n func = \"(function(){return (\" + execute + \")})\";\n }\n var condition = eval(func).call(this);\n if (condition) {\n return options.fn(this, options.data);\n }\n\n return options.inverse(this, options.data);\n },\n };\n Template7Helpers.js_compare = Template7Helpers.js_if;\n\n var Template7Options = {};\n var Template7Partials = {};\n\n var Template7Class = function Template7Class(template) {\n var t = this;\n t.template = template;\n };\n\n var staticAccessors = { options: { configurable: true },partials: { configurable: true },helpers: { configurable: true } };\n Template7Class.prototype.compile = function compile (template, depth) {\n if ( template === void 0 ) template = this.template;\n if ( depth === void 0 ) depth = 1;\n\n var t = this;\n if (t.compiled) { return t.compiled; }\n\n if (typeof template !== 'string') {\n throw new Error('Template7: Template must be a string');\n }\n var stringToBlocks = Template7Utils.stringToBlocks;\n var getCompileVar = Template7Utils.getCompileVar;\n var getCompiledArguments = Template7Utils.getCompiledArguments;\n\n var blocks = stringToBlocks(template);\n var ctx = \"ctx_\" + depth;\n var data = \"data_\" + depth;\n if (blocks.length === 0) {\n return function empty() { return ''; };\n }\n\n function getCompileFn(block, newDepth) {\n if (block.content) { return t.compile(block.content, newDepth); }\n return function empty() { return ''; };\n }\n function getCompileInverse(block, newDepth) {\n if (block.inverseContent) { return t.compile(block.inverseContent, newDepth); }\n return function empty() { return ''; };\n }\n\n var resultString = '';\n if (depth === 1) {\n resultString += \"(function (\" + ctx + \", \" + data + \", root) {\\n\";\n } else {\n resultString += \"(function (\" + ctx + \", \" + data + \") {\\n\";\n }\n if (depth === 1) {\n resultString += 'function isArray(arr){return Array.isArray(arr);}\\n';\n resultString += 'function isFunction(func){return (typeof func === \\'function\\');}\\n';\n resultString += 'function c(val, ctx) {if (typeof val !== \"undefined\" && val !== null) {if (isFunction(val)) {return val.call(ctx);} else return val;} else return \"\";}\\n';\n resultString += 'root = root || ctx_1 || {};\\n';\n }\n resultString += 'var r = \\'\\';\\n';\n var i;\n for (i = 0; i < blocks.length; i += 1) {\n var block = blocks[i];\n // Plain block\n if (block.type === 'plain') {\n // eslint-disable-next-line\n resultString += \"r +='\" + ((block.content).replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n').replace(/'/g, '\\\\' + '\\'')) + \"';\";\n continue;\n }\n var variable = (void 0);\n var compiledArguments = (void 0);\n // Variable block\n if (block.type === 'variable') {\n variable = getCompileVar(block.contextName, ctx, data);\n resultString += \"r += c(\" + variable + \", \" + ctx + \");\";\n }\n // Helpers block\n if (block.type === 'helper') {\n var parents = (void 0);\n if (ctx !== 'ctx_1') {\n var level = ctx.split('_')[1];\n var parentsString = \"ctx_\" + (level - 1);\n for (var j = level - 2; j >= 1; j -= 1) {\n parentsString += \", ctx_\" + j;\n }\n parents = \"[\" + parentsString + \"]\";\n } else {\n parents = \"[\" + ctx + \"]\";\n }\n var dynamicHelper = (void 0);\n if (block.helperName.indexOf('[') === 0) {\n block.helperName = getCompileVar(block.helperName.replace(/[[\\]]/g, ''), ctx, data);\n dynamicHelper = true;\n }\n if (dynamicHelper || block.helperName in Template7Helpers) {\n compiledArguments = getCompiledArguments(block.contextName, ctx, data);\n resultString += \"r += (Template7Helpers\" + (dynamicHelper ? (\"[\" + (block.helperName) + \"]\") : (\".\" + (block.helperName))) + \").call(\" + ctx + \", \" + (compiledArguments && ((compiledArguments + \", \"))) + \"{hash:\" + (JSON.stringify(block.hash)) + \", data: \" + data + \" || {}, fn: \" + (getCompileFn(block, depth + 1)) + \", inverse: \" + (getCompileInverse(block, depth + 1)) + \", root: root, parents: \" + parents + \"});\";\n } else if (block.contextName.length > 0) {\n throw new Error((\"Template7: Missing helper: \\\"\" + (block.helperName) + \"\\\"\"));\n } else {\n variable = getCompileVar(block.helperName, ctx, data);\n resultString += \"if (\" + variable + \") {\";\n resultString += \"if (isArray(\" + variable + \")) {\";\n resultString += \"r += (Template7Helpers.each).call(\" + ctx + \", \" + variable + \", {hash:\" + (JSON.stringify(block.hash)) + \", data: \" + data + \" || {}, fn: \" + (getCompileFn(block, depth + 1)) + \", inverse: \" + (getCompileInverse(block, depth + 1)) + \", root: root, parents: \" + parents + \"});\";\n resultString += '}else {';\n resultString += \"r += (Template7Helpers.with).call(\" + ctx + \", \" + variable + \", {hash:\" + (JSON.stringify(block.hash)) + \", data: \" + data + \" || {}, fn: \" + (getCompileFn(block, depth + 1)) + \", inverse: \" + (getCompileInverse(block, depth + 1)) + \", root: root, parents: \" + parents + \"});\";\n resultString += '}}';\n }\n }\n }\n resultString += '\\nreturn r;})';\n\n if (depth === 1) {\n // eslint-disable-next-line\n t.compiled = eval(resultString);\n return t.compiled;\n }\n return resultString;\n };\n staticAccessors.options.get = function () {\n return Template7Options;\n };\n staticAccessors.partials.get = function () {\n return Template7Partials;\n };\n staticAccessors.helpers.get = function () {\n return Template7Helpers;\n };\n\n Object.defineProperties( Template7Class, staticAccessors );\n\n function Template7() {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var template = args[0];\n var data = args[1];\n if (args.length === 2) {\n var instance = new Template7Class(template);\n var rendered = instance.compile()(data);\n instance = null;\n return (rendered);\n }\n return new Template7Class(template);\n }\n Template7.registerHelper = function registerHelper(name, fn) {\n Template7Class.helpers[name] = fn;\n };\n Template7.unregisterHelper = function unregisterHelper(name) {\n Template7Class.helpers[name] = undefined;\n delete Template7Class.helpers[name];\n };\n Template7.registerPartial = function registerPartial(name, template) {\n Template7Class.partials[name] = { template: template };\n };\n Template7.unregisterPartial = function unregisterPartial(name) {\n if (Template7Class.partials[name]) {\n Template7Class.partials[name] = undefined;\n delete Template7Class.partials[name];\n }\n };\n Template7.compile = function compile(template, options) {\n var instance = new Template7Class(template, options);\n return instance.compile();\n };\n\n Template7.options = Template7Class.options;\n Template7.helpers = Template7Class.helpers;\n Template7.partials = Template7Class.partials;\n\n return Template7;\n\n}));\n//# sourceMappingURL=template7.js.map\n"]} \ No newline at end of file diff --git a/package.json b/package.json index 5a4d559..ccd0bee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "template7", - "version": "1.4.0", + "version": "1.4.1", "description": "Mobile-first HTML template engine", "main": "dist/template7.js", "types": "dist/template7.d.ts",