templebars 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,8 @@
1
- /*
1
+ /*!
2
2
 
3
- Copyright (C) 2011 by Yehuda Katz
3
+ handlebars v4.0.5
4
+
5
+ Copyright (C) 2011-2015 by Yehuda Katz
4
6
 
5
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
8
  of this software and associated documentation files (the "Software"), to deal
@@ -20,344 +22,1219 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
23
  THE SOFTWARE.
22
24
 
25
+ @license
23
26
  */
27
+ (function webpackUniversalModuleDefinition(root, factory) {
28
+ if(typeof exports === 'object' && typeof module === 'object')
29
+ module.exports = factory();
30
+ else if(typeof define === 'function' && define.amd)
31
+ define([], factory);
32
+ else if(typeof exports === 'object')
33
+ exports["Handlebars"] = factory();
34
+ else
35
+ root["Handlebars"] = factory();
36
+ })(this, function() {
37
+ return /******/ (function(modules) { // webpackBootstrap
38
+ /******/ // The module cache
39
+ /******/ var installedModules = {};
24
40
 
25
- // lib/handlebars/browser-prefix.js
26
- var Handlebars = {};
27
-
28
- (function(Handlebars, undefined) {
29
- ;
30
- // lib/handlebars/base.js
31
-
32
- Handlebars.VERSION = "1.0.0";
33
- Handlebars.COMPILER_REVISION = 4;
34
-
35
- Handlebars.REVISION_CHANGES = {
36
- 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
37
- 2: '== 1.0.0-rc.3',
38
- 3: '== 1.0.0-rc.4',
39
- 4: '>= 1.0.0'
40
- };
41
-
42
- Handlebars.helpers = {};
43
- Handlebars.partials = {};
44
-
45
- var toString = Object.prototype.toString,
46
- functionType = '[object Function]',
47
- objectType = '[object Object]';
48
-
49
- Handlebars.registerHelper = function(name, fn, inverse) {
50
- if (toString.call(name) === objectType) {
51
- if (inverse || fn) { throw new Handlebars.Exception('Arg not supported with multiple helpers'); }
52
- Handlebars.Utils.extend(this.helpers, name);
53
- } else {
54
- if (inverse) { fn.not = inverse; }
55
- this.helpers[name] = fn;
56
- }
57
- };
58
-
59
- Handlebars.registerPartial = function(name, str) {
60
- if (toString.call(name) === objectType) {
61
- Handlebars.Utils.extend(this.partials, name);
62
- } else {
63
- this.partials[name] = str;
64
- }
65
- };
66
-
67
- Handlebars.registerHelper('helperMissing', function(arg) {
68
- if(arguments.length === 2) {
69
- return undefined;
70
- } else {
71
- throw new Error("Missing helper: '" + arg + "'");
72
- }
73
- });
41
+ /******/ // The require function
42
+ /******/ function __webpack_require__(moduleId) {
74
43
 
75
- Handlebars.registerHelper('blockHelperMissing', function(context, options) {
76
- var inverse = options.inverse || function() {}, fn = options.fn;
77
-
78
- var type = toString.call(context);
79
-
80
- if(type === functionType) { context = context.call(this); }
81
-
82
- if(context === true) {
83
- return fn(this);
84
- } else if(context === false || context == null) {
85
- return inverse(this);
86
- } else if(type === "[object Array]") {
87
- if(context.length > 0) {
88
- return Handlebars.helpers.each(context, options);
89
- } else {
90
- return inverse(this);
91
- }
92
- } else {
93
- return fn(context);
94
- }
95
- });
44
+ /******/ // Check if module is in cache
45
+ /******/ if(installedModules[moduleId])
46
+ /******/ return installedModules[moduleId].exports;
96
47
 
97
- Handlebars.K = function() {};
98
-
99
- Handlebars.createFrame = Object.create || function(object) {
100
- Handlebars.K.prototype = object;
101
- var obj = new Handlebars.K();
102
- Handlebars.K.prototype = null;
103
- return obj;
104
- };
105
-
106
- Handlebars.logger = {
107
- DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
108
-
109
- methodMap: {0: 'debug', 1: 'info', 2: 'warn', 3: 'error'},
110
-
111
- // can be overridden in the host environment
112
- log: function(level, obj) {
113
- if (Handlebars.logger.level <= level) {
114
- var method = Handlebars.logger.methodMap[level];
115
- if (typeof console !== 'undefined' && console[method]) {
116
- console[method].call(console, obj);
117
- }
118
- }
119
- }
120
- };
121
-
122
- Handlebars.log = function(level, obj) { Handlebars.logger.log(level, obj); };
123
-
124
- Handlebars.registerHelper('each', function(context, options) {
125
- var fn = options.fn, inverse = options.inverse;
126
- var i = 0, ret = "", data;
127
-
128
- var type = toString.call(context);
129
- if(type === functionType) { context = context.call(this); }
130
-
131
- if (options.data) {
132
- data = Handlebars.createFrame(options.data);
133
- }
134
-
135
- if(context && typeof context === 'object') {
136
- if(context instanceof Array){
137
- for(var j = context.length; i<j; i++) {
138
- if (data) { data.index = i; }
139
- ret = ret + fn(context[i], { data: data });
140
- }
141
- } else {
142
- for(var key in context) {
143
- if(context.hasOwnProperty(key)) {
144
- if(data) { data.key = key; }
145
- ret = ret + fn(context[key], {data: data});
146
- i++;
147
- }
148
- }
149
- }
150
- }
151
-
152
- if(i === 0){
153
- ret = inverse(this);
154
- }
155
-
156
- return ret;
157
- });
48
+ /******/ // Create a new module (and put it into the cache)
49
+ /******/ var module = installedModules[moduleId] = {
50
+ /******/ exports: {},
51
+ /******/ id: moduleId,
52
+ /******/ loaded: false
53
+ /******/ };
158
54
 
159
- Handlebars.registerHelper('if', function(conditional, options) {
160
- var type = toString.call(conditional);
161
- if(type === functionType) { conditional = conditional.call(this); }
55
+ /******/ // Execute the module function
56
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
162
57
 
163
- if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
164
- return options.inverse(this);
165
- } else {
166
- return options.fn(this);
167
- }
168
- });
58
+ /******/ // Flag the module as loaded
59
+ /******/ module.loaded = true;
169
60
 
170
- Handlebars.registerHelper('unless', function(conditional, options) {
171
- return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
172
- });
61
+ /******/ // Return the exports of the module
62
+ /******/ return module.exports;
63
+ /******/ }
173
64
 
174
- Handlebars.registerHelper('with', function(context, options) {
175
- var type = toString.call(context);
176
- if(type === functionType) { context = context.call(this); }
177
65
 
178
- if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
179
- });
66
+ /******/ // expose the modules object (__webpack_modules__)
67
+ /******/ __webpack_require__.m = modules;
180
68
 
181
- Handlebars.registerHelper('log', function(context, options) {
182
- var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
183
- Handlebars.log(level, context);
184
- });
185
- ;
186
- // lib/handlebars/utils.js
187
-
188
- var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
189
-
190
- Handlebars.Exception = function(message) {
191
- var tmp = Error.prototype.constructor.apply(this, arguments);
192
-
193
- // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
194
- for (var idx = 0; idx < errorProps.length; idx++) {
195
- this[errorProps[idx]] = tmp[errorProps[idx]];
196
- }
197
- };
198
- Handlebars.Exception.prototype = new Error();
199
-
200
- // Build out our basic SafeString type
201
- Handlebars.SafeString = function(string) {
202
- this.string = string;
203
- };
204
- Handlebars.SafeString.prototype.toString = function() {
205
- return this.string.toString();
206
- };
207
-
208
- var escape = {
209
- "&": "&amp;",
210
- "<": "&lt;",
211
- ">": "&gt;",
212
- '"': "&quot;",
213
- "'": "&#x27;",
214
- "`": "&#x60;"
215
- };
216
-
217
- var badChars = /[&<>"'`]/g;
218
- var possible = /[&<>"'`]/;
219
-
220
- var escapeChar = function(chr) {
221
- return escape[chr] || "&amp;";
222
- };
223
-
224
- Handlebars.Utils = {
225
- extend: function(obj, value) {
226
- for(var key in value) {
227
- if(value.hasOwnProperty(key)) {
228
- obj[key] = value[key];
229
- }
230
- }
231
- },
232
-
233
- escapeExpression: function(string) {
234
- // don't escape SafeStrings, since they're already safe
235
- if (string instanceof Handlebars.SafeString) {
236
- return string.toString();
237
- } else if (string == null || string === false) {
238
- return "";
239
- }
240
-
241
- // Force a string conversion as this will be done by the append regardless and
242
- // the regex test will do this transparently behind the scenes, causing issues if
243
- // an object's to string has escaped characters in it.
244
- string = string.toString();
245
-
246
- if(!possible.test(string)) { return string; }
247
- return string.replace(badChars, escapeChar);
248
- },
249
-
250
- isEmpty: function(value) {
251
- if (!value && value !== 0) {
252
- return true;
253
- } else if(toString.call(value) === "[object Array]" && value.length === 0) {
254
- return true;
255
- } else {
256
- return false;
257
- }
258
- }
259
- };
260
- ;
261
- // lib/handlebars/runtime.js
262
-
263
- Handlebars.VM = {
264
- template: function(templateSpec) {
265
- // Just add water
266
- var container = {
267
- escapeExpression: Handlebars.Utils.escapeExpression,
268
- invokePartial: Handlebars.VM.invokePartial,
269
- programs: [],
270
- program: function(i, fn, data) {
271
- var programWrapper = this.programs[i];
272
- if(data) {
273
- programWrapper = Handlebars.VM.program(i, fn, data);
274
- } else if (!programWrapper) {
275
- programWrapper = this.programs[i] = Handlebars.VM.program(i, fn);
276
- }
277
- return programWrapper;
278
- },
279
- merge: function(param, common) {
280
- var ret = param || common;
281
-
282
- if (param && common) {
283
- ret = {};
284
- Handlebars.Utils.extend(ret, common);
285
- Handlebars.Utils.extend(ret, param);
286
- }
287
- return ret;
288
- },
289
- programWithDepth: Handlebars.VM.programWithDepth,
290
- noop: Handlebars.VM.noop,
291
- compilerInfo: null
292
- };
293
-
294
- return function(context, options) {
295
- options = options || {};
296
- var result = templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
297
-
298
- var compilerInfo = container.compilerInfo || [],
299
- compilerRevision = compilerInfo[0] || 1,
300
- currentRevision = Handlebars.COMPILER_REVISION;
301
-
302
- if (compilerRevision !== currentRevision) {
303
- if (compilerRevision < currentRevision) {
304
- var runtimeVersions = Handlebars.REVISION_CHANGES[currentRevision],
305
- compilerVersions = Handlebars.REVISION_CHANGES[compilerRevision];
306
- throw "Template was precompiled with an older version of Handlebars than the current runtime. "+
307
- "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").";
308
- } else {
309
- // Use the embedded version info since the runtime doesn't know about this revision yet
310
- throw "Template was precompiled with a newer version of Handlebars than the current runtime. "+
311
- "Please update your runtime to a newer version ("+compilerInfo[1]+").";
312
- }
313
- }
314
-
315
- return result;
316
- };
317
- },
318
-
319
- programWithDepth: function(i, fn, data /*, $depth */) {
320
- var args = Array.prototype.slice.call(arguments, 3);
321
-
322
- var program = function(context, options) {
323
- options = options || {};
324
-
325
- return fn.apply(this, [context, options.data || data].concat(args));
326
- };
327
- program.program = i;
328
- program.depth = args.length;
329
- return program;
330
- },
331
- program: function(i, fn, data) {
332
- var program = function(context, options) {
333
- options = options || {};
334
-
335
- return fn(context, options.data || data);
336
- };
337
- program.program = i;
338
- program.depth = 0;
339
- return program;
340
- },
341
- noop: function() { return ""; },
342
- invokePartial: function(partial, name, context, helpers, partials, data) {
343
- var options = { helpers: helpers, partials: partials, data: data };
344
-
345
- if(partial === undefined) {
346
- throw new Handlebars.Exception("The partial " + name + " could not be found");
347
- } else if(partial instanceof Function) {
348
- return partial(context, options);
349
- } else if (!Handlebars.compile) {
350
- throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
351
- } else {
352
- partials[name] = Handlebars.compile(partial, {data: data !== undefined});
353
- return partials[name](context, options);
354
- }
355
- }
356
- };
357
-
358
- Handlebars.template = Handlebars.VM.template;
359
- ;
360
- // lib/handlebars/browser-suffix.js
361
- })(Handlebars);
362
- ;
69
+ /******/ // expose the module cache
70
+ /******/ __webpack_require__.c = installedModules;
71
+
72
+ /******/ // __webpack_public_path__
73
+ /******/ __webpack_require__.p = "";
74
+
75
+ /******/ // Load entry module and return exports
76
+ /******/ return __webpack_require__(0);
77
+ /******/ })
78
+ /************************************************************************/
79
+ /******/ ([
80
+ /* 0 */
81
+ /***/ function(module, exports, __webpack_require__) {
82
+
83
+ 'use strict';
84
+
85
+ var _interopRequireWildcard = __webpack_require__(1)['default'];
86
+
87
+ var _interopRequireDefault = __webpack_require__(2)['default'];
88
+
89
+ exports.__esModule = true;
90
+
91
+ var _handlebarsBase = __webpack_require__(3);
92
+
93
+ var base = _interopRequireWildcard(_handlebarsBase);
94
+
95
+ // Each of these augment the Handlebars object. No need to setup here.
96
+ // (This is done to easily share code between commonjs and browse envs)
97
+
98
+ var _handlebarsSafeString = __webpack_require__(17);
99
+
100
+ var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
101
+
102
+ var _handlebarsException = __webpack_require__(5);
103
+
104
+ var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
105
+
106
+ var _handlebarsUtils = __webpack_require__(4);
107
+
108
+ var Utils = _interopRequireWildcard(_handlebarsUtils);
109
+
110
+ var _handlebarsRuntime = __webpack_require__(18);
111
+
112
+ var runtime = _interopRequireWildcard(_handlebarsRuntime);
113
+
114
+ var _handlebarsNoConflict = __webpack_require__(19);
115
+
116
+ var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
117
+
118
+ // For compatibility and usage outside of module systems, make the Handlebars object a namespace
119
+ function create() {
120
+ var hb = new base.HandlebarsEnvironment();
121
+
122
+ Utils.extend(hb, base);
123
+ hb.SafeString = _handlebarsSafeString2['default'];
124
+ hb.Exception = _handlebarsException2['default'];
125
+ hb.Utils = Utils;
126
+ hb.escapeExpression = Utils.escapeExpression;
127
+
128
+ hb.VM = runtime;
129
+ hb.template = function (spec) {
130
+ return runtime.template(spec, hb);
131
+ };
132
+
133
+ return hb;
134
+ }
135
+
136
+ var inst = create();
137
+ inst.create = create;
138
+
139
+ _handlebarsNoConflict2['default'](inst);
140
+
141
+ inst['default'] = inst;
142
+
143
+ exports['default'] = inst;
144
+ module.exports = exports['default'];
145
+
146
+ /***/ },
147
+ /* 1 */
148
+ /***/ function(module, exports) {
149
+
150
+ "use strict";
151
+
152
+ exports["default"] = function (obj) {
153
+ if (obj && obj.__esModule) {
154
+ return obj;
155
+ } else {
156
+ var newObj = {};
157
+
158
+ if (obj != null) {
159
+ for (var key in obj) {
160
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
161
+ }
162
+ }
163
+
164
+ newObj["default"] = obj;
165
+ return newObj;
166
+ }
167
+ };
168
+
169
+ exports.__esModule = true;
170
+
171
+ /***/ },
172
+ /* 2 */
173
+ /***/ function(module, exports) {
174
+
175
+ "use strict";
176
+
177
+ exports["default"] = function (obj) {
178
+ return obj && obj.__esModule ? obj : {
179
+ "default": obj
180
+ };
181
+ };
182
+
183
+ exports.__esModule = true;
184
+
185
+ /***/ },
186
+ /* 3 */
187
+ /***/ function(module, exports, __webpack_require__) {
188
+
189
+ 'use strict';
190
+
191
+ var _interopRequireDefault = __webpack_require__(2)['default'];
192
+
193
+ exports.__esModule = true;
194
+ exports.HandlebarsEnvironment = HandlebarsEnvironment;
195
+
196
+ var _utils = __webpack_require__(4);
197
+
198
+ var _exception = __webpack_require__(5);
199
+
200
+ var _exception2 = _interopRequireDefault(_exception);
201
+
202
+ var _helpers = __webpack_require__(6);
203
+
204
+ var _decorators = __webpack_require__(14);
205
+
206
+ var _logger = __webpack_require__(16);
207
+
208
+ var _logger2 = _interopRequireDefault(_logger);
209
+
210
+ var VERSION = '4.0.5';
211
+ exports.VERSION = VERSION;
212
+ var COMPILER_REVISION = 7;
213
+
214
+ exports.COMPILER_REVISION = COMPILER_REVISION;
215
+ var REVISION_CHANGES = {
216
+ 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
217
+ 2: '== 1.0.0-rc.3',
218
+ 3: '== 1.0.0-rc.4',
219
+ 4: '== 1.x.x',
220
+ 5: '== 2.0.0-alpha.x',
221
+ 6: '>= 2.0.0-beta.1',
222
+ 7: '>= 4.0.0'
223
+ };
224
+
225
+ exports.REVISION_CHANGES = REVISION_CHANGES;
226
+ var objectType = '[object Object]';
227
+
228
+ function HandlebarsEnvironment(helpers, partials, decorators) {
229
+ this.helpers = helpers || {};
230
+ this.partials = partials || {};
231
+ this.decorators = decorators || {};
232
+
233
+ _helpers.registerDefaultHelpers(this);
234
+ _decorators.registerDefaultDecorators(this);
235
+ }
236
+
237
+ HandlebarsEnvironment.prototype = {
238
+ constructor: HandlebarsEnvironment,
239
+
240
+ logger: _logger2['default'],
241
+ log: _logger2['default'].log,
242
+
243
+ registerHelper: function registerHelper(name, fn) {
244
+ if (_utils.toString.call(name) === objectType) {
245
+ if (fn) {
246
+ throw new _exception2['default']('Arg not supported with multiple helpers');
247
+ }
248
+ _utils.extend(this.helpers, name);
249
+ } else {
250
+ this.helpers[name] = fn;
251
+ }
252
+ },
253
+ unregisterHelper: function unregisterHelper(name) {
254
+ delete this.helpers[name];
255
+ },
256
+
257
+ registerPartial: function registerPartial(name, partial) {
258
+ if (_utils.toString.call(name) === objectType) {
259
+ _utils.extend(this.partials, name);
260
+ } else {
261
+ if (typeof partial === 'undefined') {
262
+ throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
263
+ }
264
+ this.partials[name] = partial;
265
+ }
266
+ },
267
+ unregisterPartial: function unregisterPartial(name) {
268
+ delete this.partials[name];
269
+ },
270
+
271
+ registerDecorator: function registerDecorator(name, fn) {
272
+ if (_utils.toString.call(name) === objectType) {
273
+ if (fn) {
274
+ throw new _exception2['default']('Arg not supported with multiple decorators');
275
+ }
276
+ _utils.extend(this.decorators, name);
277
+ } else {
278
+ this.decorators[name] = fn;
279
+ }
280
+ },
281
+ unregisterDecorator: function unregisterDecorator(name) {
282
+ delete this.decorators[name];
283
+ }
284
+ };
285
+
286
+ var log = _logger2['default'].log;
287
+
288
+ exports.log = log;
289
+ exports.createFrame = _utils.createFrame;
290
+ exports.logger = _logger2['default'];
291
+
292
+ /***/ },
293
+ /* 4 */
294
+ /***/ function(module, exports) {
295
+
296
+ 'use strict';
297
+
298
+ exports.__esModule = true;
299
+ exports.extend = extend;
300
+ exports.indexOf = indexOf;
301
+ exports.escapeExpression = escapeExpression;
302
+ exports.isEmpty = isEmpty;
303
+ exports.createFrame = createFrame;
304
+ exports.blockParams = blockParams;
305
+ exports.appendContextPath = appendContextPath;
306
+ var escape = {
307
+ '&': '&amp;',
308
+ '<': '&lt;',
309
+ '>': '&gt;',
310
+ '"': '&quot;',
311
+ "'": '&#x27;',
312
+ '`': '&#x60;',
313
+ '=': '&#x3D;'
314
+ };
315
+
316
+ var badChars = /[&<>"'`=]/g,
317
+ possible = /[&<>"'`=]/;
318
+
319
+ function escapeChar(chr) {
320
+ return escape[chr];
321
+ }
322
+
323
+ function extend(obj /* , ...source */) {
324
+ for (var i = 1; i < arguments.length; i++) {
325
+ for (var key in arguments[i]) {
326
+ if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
327
+ obj[key] = arguments[i][key];
328
+ }
329
+ }
330
+ }
331
+
332
+ return obj;
333
+ }
334
+
335
+ var toString = Object.prototype.toString;
336
+
337
+ exports.toString = toString;
338
+ // Sourced from lodash
339
+ // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
340
+ /* eslint-disable func-style */
341
+ var isFunction = function isFunction(value) {
342
+ return typeof value === 'function';
343
+ };
344
+ // fallback for older versions of Chrome and Safari
345
+ /* istanbul ignore next */
346
+ if (isFunction(/x/)) {
347
+ exports.isFunction = isFunction = function (value) {
348
+ return typeof value === 'function' && toString.call(value) === '[object Function]';
349
+ };
350
+ }
351
+ exports.isFunction = isFunction;
352
+
353
+ /* eslint-enable func-style */
354
+
355
+ /* istanbul ignore next */
356
+ var isArray = Array.isArray || function (value) {
357
+ return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
358
+ };
359
+
360
+ exports.isArray = isArray;
361
+ // Older IE versions do not directly support indexOf so we must implement our own, sadly.
362
+
363
+ function indexOf(array, value) {
364
+ for (var i = 0, len = array.length; i < len; i++) {
365
+ if (array[i] === value) {
366
+ return i;
367
+ }
368
+ }
369
+ return -1;
370
+ }
371
+
372
+ function escapeExpression(string) {
373
+ if (typeof string !== 'string') {
374
+ // don't escape SafeStrings, since they're already safe
375
+ if (string && string.toHTML) {
376
+ return string.toHTML();
377
+ } else if (string == null) {
378
+ return '';
379
+ } else if (!string) {
380
+ return string + '';
381
+ }
382
+
383
+ // Force a string conversion as this will be done by the append regardless and
384
+ // the regex test will do this transparently behind the scenes, causing issues if
385
+ // an object's to string has escaped characters in it.
386
+ string = '' + string;
387
+ }
388
+
389
+ if (!possible.test(string)) {
390
+ return string;
391
+ }
392
+ return string.replace(badChars, escapeChar);
393
+ }
394
+
395
+ function isEmpty(value) {
396
+ if (!value && value !== 0) {
397
+ return true;
398
+ } else if (isArray(value) && value.length === 0) {
399
+ return true;
400
+ } else {
401
+ return false;
402
+ }
403
+ }
404
+
405
+ function createFrame(object) {
406
+ var frame = extend({}, object);
407
+ frame._parent = object;
408
+ return frame;
409
+ }
410
+
411
+ function blockParams(params, ids) {
412
+ params.path = ids;
413
+ return params;
414
+ }
415
+
416
+ function appendContextPath(contextPath, id) {
417
+ return (contextPath ? contextPath + '.' : '') + id;
418
+ }
419
+
420
+ /***/ },
421
+ /* 5 */
422
+ /***/ function(module, exports) {
423
+
424
+ 'use strict';
425
+
426
+ exports.__esModule = true;
427
+
428
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
429
+
430
+ function Exception(message, node) {
431
+ var loc = node && node.loc,
432
+ line = undefined,
433
+ column = undefined;
434
+ if (loc) {
435
+ line = loc.start.line;
436
+ column = loc.start.column;
437
+
438
+ message += ' - ' + line + ':' + column;
439
+ }
440
+
441
+ var tmp = Error.prototype.constructor.call(this, message);
442
+
443
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
444
+ for (var idx = 0; idx < errorProps.length; idx++) {
445
+ this[errorProps[idx]] = tmp[errorProps[idx]];
446
+ }
447
+
448
+ /* istanbul ignore else */
449
+ if (Error.captureStackTrace) {
450
+ Error.captureStackTrace(this, Exception);
451
+ }
452
+
453
+ if (loc) {
454
+ this.lineNumber = line;
455
+ this.column = column;
456
+ }
457
+ }
458
+
459
+ Exception.prototype = new Error();
460
+
461
+ exports['default'] = Exception;
462
+ module.exports = exports['default'];
463
+
464
+ /***/ },
465
+ /* 6 */
466
+ /***/ function(module, exports, __webpack_require__) {
467
+
468
+ 'use strict';
469
+
470
+ var _interopRequireDefault = __webpack_require__(2)['default'];
471
+
472
+ exports.__esModule = true;
473
+ exports.registerDefaultHelpers = registerDefaultHelpers;
474
+
475
+ var _helpersBlockHelperMissing = __webpack_require__(7);
476
+
477
+ var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
478
+
479
+ var _helpersEach = __webpack_require__(8);
480
+
481
+ var _helpersEach2 = _interopRequireDefault(_helpersEach);
482
+
483
+ var _helpersHelperMissing = __webpack_require__(9);
484
+
485
+ var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
486
+
487
+ var _helpersIf = __webpack_require__(10);
488
+
489
+ var _helpersIf2 = _interopRequireDefault(_helpersIf);
490
+
491
+ var _helpersLog = __webpack_require__(11);
492
+
493
+ var _helpersLog2 = _interopRequireDefault(_helpersLog);
494
+
495
+ var _helpersLookup = __webpack_require__(12);
496
+
497
+ var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
498
+
499
+ var _helpersWith = __webpack_require__(13);
500
+
501
+ var _helpersWith2 = _interopRequireDefault(_helpersWith);
502
+
503
+ function registerDefaultHelpers(instance) {
504
+ _helpersBlockHelperMissing2['default'](instance);
505
+ _helpersEach2['default'](instance);
506
+ _helpersHelperMissing2['default'](instance);
507
+ _helpersIf2['default'](instance);
508
+ _helpersLog2['default'](instance);
509
+ _helpersLookup2['default'](instance);
510
+ _helpersWith2['default'](instance);
511
+ }
512
+
513
+ /***/ },
514
+ /* 7 */
515
+ /***/ function(module, exports, __webpack_require__) {
516
+
517
+ 'use strict';
518
+
519
+ exports.__esModule = true;
520
+
521
+ var _utils = __webpack_require__(4);
522
+
523
+ exports['default'] = function (instance) {
524
+ instance.registerHelper('blockHelperMissing', function (context, options) {
525
+ var inverse = options.inverse,
526
+ fn = options.fn;
527
+
528
+ if (context === true) {
529
+ return fn(this);
530
+ } else if (context === false || context == null) {
531
+ return inverse(this);
532
+ } else if (_utils.isArray(context)) {
533
+ if (context.length > 0) {
534
+ if (options.ids) {
535
+ options.ids = [options.name];
536
+ }
537
+
538
+ return instance.helpers.each(context, options);
539
+ } else {
540
+ return inverse(this);
541
+ }
542
+ } else {
543
+ if (options.data && options.ids) {
544
+ var data = _utils.createFrame(options.data);
545
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
546
+ options = { data: data };
547
+ }
548
+
549
+ return fn(context, options);
550
+ }
551
+ });
552
+ };
553
+
554
+ module.exports = exports['default'];
555
+
556
+ /***/ },
557
+ /* 8 */
558
+ /***/ function(module, exports, __webpack_require__) {
559
+
560
+ 'use strict';
561
+
562
+ var _interopRequireDefault = __webpack_require__(2)['default'];
563
+
564
+ exports.__esModule = true;
565
+
566
+ var _utils = __webpack_require__(4);
567
+
568
+ var _exception = __webpack_require__(5);
569
+
570
+ var _exception2 = _interopRequireDefault(_exception);
571
+
572
+ exports['default'] = function (instance) {
573
+ instance.registerHelper('each', function (context, options) {
574
+ if (!options) {
575
+ throw new _exception2['default']('Must pass iterator to #each');
576
+ }
363
577
 
578
+ var fn = options.fn,
579
+ inverse = options.inverse,
580
+ i = 0,
581
+ ret = '',
582
+ data = undefined,
583
+ contextPath = undefined;
584
+
585
+ if (options.data && options.ids) {
586
+ contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
587
+ }
588
+
589
+ if (_utils.isFunction(context)) {
590
+ context = context.call(this);
591
+ }
592
+
593
+ if (options.data) {
594
+ data = _utils.createFrame(options.data);
595
+ }
596
+
597
+ function execIteration(field, index, last) {
598
+ if (data) {
599
+ data.key = field;
600
+ data.index = index;
601
+ data.first = index === 0;
602
+ data.last = !!last;
603
+
604
+ if (contextPath) {
605
+ data.contextPath = contextPath + field;
606
+ }
607
+ }
608
+
609
+ ret = ret + fn(context[field], {
610
+ data: data,
611
+ blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
612
+ });
613
+ }
614
+
615
+ if (context && typeof context === 'object') {
616
+ if (_utils.isArray(context)) {
617
+ for (var j = context.length; i < j; i++) {
618
+ if (i in context) {
619
+ execIteration(i, i, i === context.length - 1);
620
+ }
621
+ }
622
+ } else {
623
+ var priorKey = undefined;
624
+
625
+ for (var key in context) {
626
+ if (context.hasOwnProperty(key)) {
627
+ // We're running the iterations one step out of sync so we can detect
628
+ // the last iteration without have to scan the object twice and create
629
+ // an itermediate keys array.
630
+ if (priorKey !== undefined) {
631
+ execIteration(priorKey, i - 1);
632
+ }
633
+ priorKey = key;
634
+ i++;
635
+ }
636
+ }
637
+ if (priorKey !== undefined) {
638
+ execIteration(priorKey, i - 1, true);
639
+ }
640
+ }
641
+ }
642
+
643
+ if (i === 0) {
644
+ ret = inverse(this);
645
+ }
646
+
647
+ return ret;
648
+ });
649
+ };
650
+
651
+ module.exports = exports['default'];
652
+
653
+ /***/ },
654
+ /* 9 */
655
+ /***/ function(module, exports, __webpack_require__) {
656
+
657
+ 'use strict';
658
+
659
+ var _interopRequireDefault = __webpack_require__(2)['default'];
660
+
661
+ exports.__esModule = true;
662
+
663
+ var _exception = __webpack_require__(5);
664
+
665
+ var _exception2 = _interopRequireDefault(_exception);
666
+
667
+ exports['default'] = function (instance) {
668
+ instance.registerHelper('helperMissing', function () /* [args, ]options */{
669
+ if (arguments.length === 1) {
670
+ // A missing field in a {{foo}} construct.
671
+ return undefined;
672
+ } else {
673
+ // Someone is actually trying to call something, blow up.
674
+ throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
675
+ }
676
+ });
677
+ };
678
+
679
+ module.exports = exports['default'];
680
+
681
+ /***/ },
682
+ /* 10 */
683
+ /***/ function(module, exports, __webpack_require__) {
684
+
685
+ 'use strict';
686
+
687
+ exports.__esModule = true;
688
+
689
+ var _utils = __webpack_require__(4);
690
+
691
+ exports['default'] = function (instance) {
692
+ instance.registerHelper('if', function (conditional, options) {
693
+ if (_utils.isFunction(conditional)) {
694
+ conditional = conditional.call(this);
695
+ }
696
+
697
+ // Default behavior is to render the positive path if the value is truthy and not empty.
698
+ // The `includeZero` option may be set to treat the condtional as purely not empty based on the
699
+ // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
700
+ if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
701
+ return options.inverse(this);
702
+ } else {
703
+ return options.fn(this);
704
+ }
705
+ });
706
+
707
+ instance.registerHelper('unless', function (conditional, options) {
708
+ return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
709
+ });
710
+ };
711
+
712
+ module.exports = exports['default'];
713
+
714
+ /***/ },
715
+ /* 11 */
716
+ /***/ function(module, exports) {
717
+
718
+ 'use strict';
719
+
720
+ exports.__esModule = true;
721
+
722
+ exports['default'] = function (instance) {
723
+ instance.registerHelper('log', function () /* message, options */{
724
+ var args = [undefined],
725
+ options = arguments[arguments.length - 1];
726
+ for (var i = 0; i < arguments.length - 1; i++) {
727
+ args.push(arguments[i]);
728
+ }
729
+
730
+ var level = 1;
731
+ if (options.hash.level != null) {
732
+ level = options.hash.level;
733
+ } else if (options.data && options.data.level != null) {
734
+ level = options.data.level;
735
+ }
736
+ args[0] = level;
737
+
738
+ instance.log.apply(instance, args);
739
+ });
740
+ };
741
+
742
+ module.exports = exports['default'];
743
+
744
+ /***/ },
745
+ /* 12 */
746
+ /***/ function(module, exports) {
747
+
748
+ 'use strict';
749
+
750
+ exports.__esModule = true;
751
+
752
+ exports['default'] = function (instance) {
753
+ instance.registerHelper('lookup', function (obj, field) {
754
+ return obj && obj[field];
755
+ });
756
+ };
757
+
758
+ module.exports = exports['default'];
759
+
760
+ /***/ },
761
+ /* 13 */
762
+ /***/ function(module, exports, __webpack_require__) {
763
+
764
+ 'use strict';
765
+
766
+ exports.__esModule = true;
767
+
768
+ var _utils = __webpack_require__(4);
769
+
770
+ exports['default'] = function (instance) {
771
+ instance.registerHelper('with', function (context, options) {
772
+ if (_utils.isFunction(context)) {
773
+ context = context.call(this);
774
+ }
775
+
776
+ var fn = options.fn;
777
+
778
+ if (!_utils.isEmpty(context)) {
779
+ var data = options.data;
780
+ if (options.data && options.ids) {
781
+ data = _utils.createFrame(options.data);
782
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
783
+ }
784
+
785
+ return fn(context, {
786
+ data: data,
787
+ blockParams: _utils.blockParams([context], [data && data.contextPath])
788
+ });
789
+ } else {
790
+ return options.inverse(this);
791
+ }
792
+ });
793
+ };
794
+
795
+ module.exports = exports['default'];
796
+
797
+ /***/ },
798
+ /* 14 */
799
+ /***/ function(module, exports, __webpack_require__) {
800
+
801
+ 'use strict';
802
+
803
+ var _interopRequireDefault = __webpack_require__(2)['default'];
804
+
805
+ exports.__esModule = true;
806
+ exports.registerDefaultDecorators = registerDefaultDecorators;
807
+
808
+ var _decoratorsInline = __webpack_require__(15);
809
+
810
+ var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
811
+
812
+ function registerDefaultDecorators(instance) {
813
+ _decoratorsInline2['default'](instance);
814
+ }
815
+
816
+ /***/ },
817
+ /* 15 */
818
+ /***/ function(module, exports, __webpack_require__) {
819
+
820
+ 'use strict';
821
+
822
+ exports.__esModule = true;
823
+
824
+ var _utils = __webpack_require__(4);
825
+
826
+ exports['default'] = function (instance) {
827
+ instance.registerDecorator('inline', function (fn, props, container, options) {
828
+ var ret = fn;
829
+ if (!props.partials) {
830
+ props.partials = {};
831
+ ret = function (context, options) {
832
+ // Create a new partials stack frame prior to exec.
833
+ var original = container.partials;
834
+ container.partials = _utils.extend({}, original, props.partials);
835
+ var ret = fn(context, options);
836
+ container.partials = original;
837
+ return ret;
838
+ };
839
+ }
840
+
841
+ props.partials[options.args[0]] = options.fn;
842
+
843
+ return ret;
844
+ });
845
+ };
846
+
847
+ module.exports = exports['default'];
848
+
849
+ /***/ },
850
+ /* 16 */
851
+ /***/ function(module, exports, __webpack_require__) {
852
+
853
+ 'use strict';
854
+
855
+ exports.__esModule = true;
856
+
857
+ var _utils = __webpack_require__(4);
858
+
859
+ var logger = {
860
+ methodMap: ['debug', 'info', 'warn', 'error'],
861
+ level: 'info',
862
+
863
+ // Maps a given level value to the `methodMap` indexes above.
864
+ lookupLevel: function lookupLevel(level) {
865
+ if (typeof level === 'string') {
866
+ var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
867
+ if (levelMap >= 0) {
868
+ level = levelMap;
869
+ } else {
870
+ level = parseInt(level, 10);
871
+ }
872
+ }
873
+
874
+ return level;
875
+ },
876
+
877
+ // Can be overridden in the host environment
878
+ log: function log(level) {
879
+ level = logger.lookupLevel(level);
880
+
881
+ if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
882
+ var method = logger.methodMap[level];
883
+ if (!console[method]) {
884
+ // eslint-disable-line no-console
885
+ method = 'log';
886
+ }
887
+
888
+ for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
889
+ message[_key - 1] = arguments[_key];
890
+ }
891
+
892
+ console[method].apply(console, message); // eslint-disable-line no-console
893
+ }
894
+ }
895
+ };
896
+
897
+ exports['default'] = logger;
898
+ module.exports = exports['default'];
899
+
900
+ /***/ },
901
+ /* 17 */
902
+ /***/ function(module, exports) {
903
+
904
+ // Build out our basic SafeString type
905
+ 'use strict';
906
+
907
+ exports.__esModule = true;
908
+ function SafeString(string) {
909
+ this.string = string;
910
+ }
911
+
912
+ SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
913
+ return '' + this.string;
914
+ };
915
+
916
+ exports['default'] = SafeString;
917
+ module.exports = exports['default'];
918
+
919
+ /***/ },
920
+ /* 18 */
921
+ /***/ function(module, exports, __webpack_require__) {
922
+
923
+ 'use strict';
924
+
925
+ var _interopRequireWildcard = __webpack_require__(1)['default'];
926
+
927
+ var _interopRequireDefault = __webpack_require__(2)['default'];
928
+
929
+ exports.__esModule = true;
930
+ exports.checkRevision = checkRevision;
931
+ exports.template = template;
932
+ exports.wrapProgram = wrapProgram;
933
+ exports.resolvePartial = resolvePartial;
934
+ exports.invokePartial = invokePartial;
935
+ exports.noop = noop;
936
+
937
+ var _utils = __webpack_require__(4);
938
+
939
+ var Utils = _interopRequireWildcard(_utils);
940
+
941
+ var _exception = __webpack_require__(5);
942
+
943
+ var _exception2 = _interopRequireDefault(_exception);
944
+
945
+ var _base = __webpack_require__(3);
946
+
947
+ function checkRevision(compilerInfo) {
948
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
949
+ currentRevision = _base.COMPILER_REVISION;
950
+
951
+ if (compilerRevision !== currentRevision) {
952
+ if (compilerRevision < currentRevision) {
953
+ var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
954
+ compilerVersions = _base.REVISION_CHANGES[compilerRevision];
955
+ throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
956
+ } else {
957
+ // Use the embedded version info since the runtime doesn't know about this revision yet
958
+ throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
959
+ }
960
+ }
961
+ }
962
+
963
+ function template(templateSpec, env) {
964
+ /* istanbul ignore next */
965
+ if (!env) {
966
+ throw new _exception2['default']('No environment passed to template');
967
+ }
968
+ if (!templateSpec || !templateSpec.main) {
969
+ throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
970
+ }
971
+
972
+ templateSpec.main.decorator = templateSpec.main_d;
973
+
974
+ // Note: Using env.VM references rather than local var references throughout this section to allow
975
+ // for external users to override these as psuedo-supported APIs.
976
+ env.VM.checkRevision(templateSpec.compiler);
977
+
978
+ function invokePartialWrapper(partial, context, options) {
979
+ if (options.hash) {
980
+ context = Utils.extend({}, context, options.hash);
981
+ if (options.ids) {
982
+ options.ids[0] = true;
983
+ }
984
+ }
985
+
986
+ partial = env.VM.resolvePartial.call(this, partial, context, options);
987
+ var result = env.VM.invokePartial.call(this, partial, context, options);
988
+
989
+ if (result == null && env.compile) {
990
+ options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
991
+ result = options.partials[options.name](context, options);
992
+ }
993
+ if (result != null) {
994
+ if (options.indent) {
995
+ var lines = result.split('\n');
996
+ for (var i = 0, l = lines.length; i < l; i++) {
997
+ if (!lines[i] && i + 1 === l) {
998
+ break;
999
+ }
1000
+
1001
+ lines[i] = options.indent + lines[i];
1002
+ }
1003
+ result = lines.join('\n');
1004
+ }
1005
+ return result;
1006
+ } else {
1007
+ throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
1008
+ }
1009
+ }
1010
+
1011
+ // Just add water
1012
+ var container = {
1013
+ strict: function strict(obj, name) {
1014
+ if (!(name in obj)) {
1015
+ throw new _exception2['default']('"' + name + '" not defined in ' + obj);
1016
+ }
1017
+ return obj[name];
1018
+ },
1019
+ lookup: function lookup(depths, name) {
1020
+ var len = depths.length;
1021
+ for (var i = 0; i < len; i++) {
1022
+ if (depths[i] && depths[i][name] != null) {
1023
+ return depths[i][name];
1024
+ }
1025
+ }
1026
+ },
1027
+ lambda: function lambda(current, context) {
1028
+ return typeof current === 'function' ? current.call(context) : current;
1029
+ },
1030
+
1031
+ escapeExpression: Utils.escapeExpression,
1032
+ invokePartial: invokePartialWrapper,
1033
+
1034
+ fn: function fn(i) {
1035
+ var ret = templateSpec[i];
1036
+ ret.decorator = templateSpec[i + '_d'];
1037
+ return ret;
1038
+ },
1039
+
1040
+ programs: [],
1041
+ program: function program(i, data, declaredBlockParams, blockParams, depths) {
1042
+ var programWrapper = this.programs[i],
1043
+ fn = this.fn(i);
1044
+ if (data || depths || blockParams || declaredBlockParams) {
1045
+ programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
1046
+ } else if (!programWrapper) {
1047
+ programWrapper = this.programs[i] = wrapProgram(this, i, fn);
1048
+ }
1049
+ return programWrapper;
1050
+ },
1051
+
1052
+ data: function data(value, depth) {
1053
+ while (value && depth--) {
1054
+ value = value._parent;
1055
+ }
1056
+ return value;
1057
+ },
1058
+ merge: function merge(param, common) {
1059
+ var obj = param || common;
1060
+
1061
+ if (param && common && param !== common) {
1062
+ obj = Utils.extend({}, common, param);
1063
+ }
1064
+
1065
+ return obj;
1066
+ },
1067
+
1068
+ noop: env.VM.noop,
1069
+ compilerInfo: templateSpec.compiler
1070
+ };
1071
+
1072
+ function ret(context) {
1073
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1074
+
1075
+ var data = options.data;
1076
+
1077
+ ret._setup(options);
1078
+ if (!options.partial && templateSpec.useData) {
1079
+ data = initData(context, data);
1080
+ }
1081
+ var depths = undefined,
1082
+ blockParams = templateSpec.useBlockParams ? [] : undefined;
1083
+ if (templateSpec.useDepths) {
1084
+ if (options.depths) {
1085
+ depths = context !== options.depths[0] ? [context].concat(options.depths) : options.depths;
1086
+ } else {
1087
+ depths = [context];
1088
+ }
1089
+ }
1090
+
1091
+ function main(context /*, options*/) {
1092
+ return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
1093
+ }
1094
+ main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
1095
+ return main(context, options);
1096
+ }
1097
+ ret.isTop = true;
1098
+
1099
+ ret._setup = function (options) {
1100
+ if (!options.partial) {
1101
+ container.helpers = container.merge(options.helpers, env.helpers);
1102
+
1103
+ if (templateSpec.usePartial) {
1104
+ container.partials = container.merge(options.partials, env.partials);
1105
+ }
1106
+ if (templateSpec.usePartial || templateSpec.useDecorators) {
1107
+ container.decorators = container.merge(options.decorators, env.decorators);
1108
+ }
1109
+ } else {
1110
+ container.helpers = options.helpers;
1111
+ container.partials = options.partials;
1112
+ container.decorators = options.decorators;
1113
+ }
1114
+ };
1115
+
1116
+ ret._child = function (i, data, blockParams, depths) {
1117
+ if (templateSpec.useBlockParams && !blockParams) {
1118
+ throw new _exception2['default']('must pass block params');
1119
+ }
1120
+ if (templateSpec.useDepths && !depths) {
1121
+ throw new _exception2['default']('must pass parent depths');
1122
+ }
1123
+
1124
+ return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
1125
+ };
1126
+ return ret;
1127
+ }
1128
+
1129
+ function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
1130
+ function prog(context) {
1131
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1132
+
1133
+ var currentDepths = depths;
1134
+ if (depths && context !== depths[0]) {
1135
+ currentDepths = [context].concat(depths);
1136
+ }
1137
+
1138
+ return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
1139
+ }
1140
+
1141
+ prog = executeDecorators(fn, prog, container, depths, data, blockParams);
1142
+
1143
+ prog.program = i;
1144
+ prog.depth = depths ? depths.length : 0;
1145
+ prog.blockParams = declaredBlockParams || 0;
1146
+ return prog;
1147
+ }
1148
+
1149
+ function resolvePartial(partial, context, options) {
1150
+ if (!partial) {
1151
+ if (options.name === '@partial-block') {
1152
+ partial = options.data['partial-block'];
1153
+ } else {
1154
+ partial = options.partials[options.name];
1155
+ }
1156
+ } else if (!partial.call && !options.name) {
1157
+ // This is a dynamic partial that returned a string
1158
+ options.name = partial;
1159
+ partial = options.partials[partial];
1160
+ }
1161
+ return partial;
1162
+ }
1163
+
1164
+ function invokePartial(partial, context, options) {
1165
+ options.partial = true;
1166
+ if (options.ids) {
1167
+ options.data.contextPath = options.ids[0] || options.data.contextPath;
1168
+ }
1169
+
1170
+ var partialBlock = undefined;
1171
+ if (options.fn && options.fn !== noop) {
1172
+ options.data = _base.createFrame(options.data);
1173
+ partialBlock = options.data['partial-block'] = options.fn;
1174
+
1175
+ if (partialBlock.partials) {
1176
+ options.partials = Utils.extend({}, options.partials, partialBlock.partials);
1177
+ }
1178
+ }
1179
+
1180
+ if (partial === undefined && partialBlock) {
1181
+ partial = partialBlock;
1182
+ }
1183
+
1184
+ if (partial === undefined) {
1185
+ throw new _exception2['default']('The partial ' + options.name + ' could not be found');
1186
+ } else if (partial instanceof Function) {
1187
+ return partial(context, options);
1188
+ }
1189
+ }
1190
+
1191
+ function noop() {
1192
+ return '';
1193
+ }
1194
+
1195
+ function initData(context, data) {
1196
+ if (!data || !('root' in data)) {
1197
+ data = data ? _base.createFrame(data) : {};
1198
+ data.root = context;
1199
+ }
1200
+ return data;
1201
+ }
1202
+
1203
+ function executeDecorators(fn, prog, container, depths, data, blockParams) {
1204
+ if (fn.decorator) {
1205
+ var props = {};
1206
+ prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
1207
+ Utils.extend(prog, props);
1208
+ }
1209
+ return prog;
1210
+ }
1211
+
1212
+ /***/ },
1213
+ /* 19 */
1214
+ /***/ function(module, exports) {
1215
+
1216
+ /* WEBPACK VAR INJECTION */(function(global) {/* global window */
1217
+ 'use strict';
1218
+
1219
+ exports.__esModule = true;
1220
+
1221
+ exports['default'] = function (Handlebars) {
1222
+ /* istanbul ignore next */
1223
+ var root = typeof global !== 'undefined' ? global : window,
1224
+ $Handlebars = root.Handlebars;
1225
+ /* istanbul ignore next */
1226
+ Handlebars.noConflict = function () {
1227
+ if (root.Handlebars === Handlebars) {
1228
+ root.Handlebars = $Handlebars;
1229
+ }
1230
+ return Handlebars;
1231
+ };
1232
+ };
1233
+
1234
+ module.exports = exports['default'];
1235
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1236
+
1237
+ /***/ }
1238
+ /******/ ])
1239
+ });
1240
+ ;