handlebars-source 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of handlebars-source might be problematic. Click here for more details.

Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/handlebars.js +4071 -3721
  3. data/handlebars.runtime.js +840 -701
  4. metadata +2 -2
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
 
3
- handlebars v3.0.0
3
+ handlebars v3.0.2
4
4
 
5
5
  Copyright (C) 2011-2014 by Yehuda Katz
6
6
 
@@ -24,703 +24,842 @@ THE SOFTWARE.
24
24
 
25
25
  @license
26
26
  */
27
- /* exported Handlebars */
28
- (function (root, factory) {
29
- if (typeof define === 'function' && define.amd) {
30
- define([], factory);
31
- } else if (typeof exports === 'object') {
32
- module.exports = factory();
33
- } else {
34
- root.Handlebars = factory();
35
- }
36
- }(this, function () {
37
- // handlebars/utils.js
38
- var __module2__ = (function() {
39
- "use strict";
40
- var __exports__ = {};
41
- /*jshint -W004 */
42
- var escape = {
43
- "&": "&",
44
- "<": "&lt;",
45
- ">": "&gt;",
46
- '"': "&quot;",
47
- "'": "&#x27;",
48
- "`": "&#x60;"
49
- };
50
-
51
- var badChars = /[&<>"'`]/g;
52
- var possible = /[&<>"'`]/;
53
-
54
- function escapeChar(chr) {
55
- return escape[chr];
56
- }
57
-
58
- function extend(obj /* , ...source */) {
59
- for (var i = 1; i < arguments.length; i++) {
60
- for (var key in arguments[i]) {
61
- if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
62
- obj[key] = arguments[i][key];
63
- }
64
- }
65
- }
66
-
67
- return obj;
68
- }
69
-
70
- __exports__.extend = extend;var toString = Object.prototype.toString;
71
- __exports__.toString = toString;
72
- // Sourced from lodash
73
- // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
74
- var isFunction = function(value) {
75
- return typeof value === 'function';
76
- };
77
- // fallback for older versions of Chrome and Safari
78
- /* istanbul ignore next */
79
- if (isFunction(/x/)) {
80
- isFunction = function(value) {
81
- return typeof value === 'function' && toString.call(value) === '[object Function]';
82
- };
83
- }
84
- var isFunction;
85
- __exports__.isFunction = isFunction;
86
- /* istanbul ignore next */
87
- var isArray = Array.isArray || function(value) {
88
- return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
89
- };
90
- __exports__.isArray = isArray;
91
- // Older IE versions do not directly support indexOf so we must implement our own, sadly.
92
- function indexOf(array, value) {
93
- for (var i = 0, len = array.length; i < len; i++) {
94
- if (array[i] === value) {
95
- return i;
96
- }
97
- }
98
- return -1;
99
- }
100
-
101
- __exports__.indexOf = indexOf;
102
- function escapeExpression(string) {
103
- // don't escape SafeStrings, since they're already safe
104
- if (string && string.toHTML) {
105
- return string.toHTML();
106
- } else if (string == null) {
107
- return "";
108
- } else if (!string) {
109
- return string + '';
110
- }
111
-
112
- // Force a string conversion as this will be done by the append regardless and
113
- // the regex test will do this transparently behind the scenes, causing issues if
114
- // an object's to string has escaped characters in it.
115
- string = "" + string;
116
-
117
- if(!possible.test(string)) { return string; }
118
- return string.replace(badChars, escapeChar);
119
- }
120
-
121
- __exports__.escapeExpression = escapeExpression;function isEmpty(value) {
122
- if (!value && value !== 0) {
123
- return true;
124
- } else if (isArray(value) && value.length === 0) {
125
- return true;
126
- } else {
127
- return false;
128
- }
129
- }
130
-
131
- __exports__.isEmpty = isEmpty;function blockParams(params, ids) {
132
- params.path = ids;
133
- return params;
134
- }
135
-
136
- __exports__.blockParams = blockParams;function appendContextPath(contextPath, id) {
137
- return (contextPath ? contextPath + '.' : '') + id;
138
- }
139
-
140
- __exports__.appendContextPath = appendContextPath;
141
- return __exports__;
142
- })();
143
-
144
- // handlebars/exception.js
145
- var __module3__ = (function() {
146
- "use strict";
147
- var __exports__;
148
-
149
- var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
150
-
151
- function Exception(message, node) {
152
- var loc = node && node.loc,
153
- line,
154
- column;
155
- if (loc) {
156
- line = loc.start.line;
157
- column = loc.start.column;
158
-
159
- message += ' - ' + line + ':' + column;
160
- }
161
-
162
- var tmp = Error.prototype.constructor.call(this, message);
163
-
164
- // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
165
- for (var idx = 0; idx < errorProps.length; idx++) {
166
- this[errorProps[idx]] = tmp[errorProps[idx]];
167
- }
168
-
169
- if (loc) {
170
- this.lineNumber = line;
171
- this.column = column;
172
- }
173
- }
174
-
175
- Exception.prototype = new Error();
176
-
177
- __exports__ = Exception;
178
- return __exports__;
179
- })();
180
-
181
- // handlebars/base.js
182
- var __module1__ = (function(__dependency1__, __dependency2__) {
183
- "use strict";
184
- var __exports__ = {};
185
- var Utils = __dependency1__;
186
- var Exception = __dependency2__;
187
-
188
- var VERSION = "3.0.0";
189
- __exports__.VERSION = VERSION;var COMPILER_REVISION = 6;
190
- __exports__.COMPILER_REVISION = COMPILER_REVISION;
191
- var REVISION_CHANGES = {
192
- 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
193
- 2: '== 1.0.0-rc.3',
194
- 3: '== 1.0.0-rc.4',
195
- 4: '== 1.x.x',
196
- 5: '== 2.0.0-alpha.x',
197
- 6: '>= 2.0.0-beta.1'
198
- };
199
- __exports__.REVISION_CHANGES = REVISION_CHANGES;
200
- var isArray = Utils.isArray,
201
- isFunction = Utils.isFunction,
202
- toString = Utils.toString,
203
- objectType = '[object Object]';
204
-
205
- function HandlebarsEnvironment(helpers, partials) {
206
- this.helpers = helpers || {};
207
- this.partials = partials || {};
208
-
209
- registerDefaultHelpers(this);
210
- }
211
-
212
- __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
213
- constructor: HandlebarsEnvironment,
214
-
215
- logger: logger,
216
- log: log,
217
-
218
- registerHelper: function(name, fn) {
219
- if (toString.call(name) === objectType) {
220
- if (fn) { throw new Exception('Arg not supported with multiple helpers'); }
221
- Utils.extend(this.helpers, name);
222
- } else {
223
- this.helpers[name] = fn;
224
- }
225
- },
226
- unregisterHelper: function(name) {
227
- delete this.helpers[name];
228
- },
229
-
230
- registerPartial: function(name, partial) {
231
- if (toString.call(name) === objectType) {
232
- Utils.extend(this.partials, name);
233
- } else {
234
- if (typeof partial === 'undefined') {
235
- throw new Exception('Attempting to register a partial as undefined');
236
- }
237
- this.partials[name] = partial;
238
- }
239
- },
240
- unregisterPartial: function(name) {
241
- delete this.partials[name];
242
- }
243
- };
244
-
245
- function registerDefaultHelpers(instance) {
246
- instance.registerHelper('helperMissing', function(/* [args, ]options */) {
247
- if(arguments.length === 1) {
248
- // A missing field in a {{foo}} constuct.
249
- return undefined;
250
- } else {
251
- // Someone is actually trying to call something, blow up.
252
- throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'");
253
- }
254
- });
255
-
256
- instance.registerHelper('blockHelperMissing', function(context, options) {
257
- var inverse = options.inverse,
258
- fn = options.fn;
259
-
260
- if(context === true) {
261
- return fn(this);
262
- } else if(context === false || context == null) {
263
- return inverse(this);
264
- } else if (isArray(context)) {
265
- if(context.length > 0) {
266
- if (options.ids) {
267
- options.ids = [options.name];
268
- }
269
-
270
- return instance.helpers.each(context, options);
271
- } else {
272
- return inverse(this);
273
- }
274
- } else {
275
- if (options.data && options.ids) {
276
- var data = createFrame(options.data);
277
- data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name);
278
- options = {data: data};
279
- }
280
-
281
- return fn(context, options);
282
- }
283
- });
284
-
285
- instance.registerHelper('each', function(context, options) {
286
- if (!options) {
287
- throw new Exception('Must pass iterator to #each');
288
- }
289
-
290
- var fn = options.fn, inverse = options.inverse;
291
- var i = 0, ret = "", data;
292
-
293
- var contextPath;
294
- if (options.data && options.ids) {
295
- contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
296
- }
297
-
298
- if (isFunction(context)) { context = context.call(this); }
299
-
300
- if (options.data) {
301
- data = createFrame(options.data);
302
- }
303
-
304
- function execIteration(key, i, last) {
305
- if (data) {
306
- data.key = key;
307
- data.index = i;
308
- data.first = i === 0;
309
- data.last = !!last;
310
-
311
- if (contextPath) {
312
- data.contextPath = contextPath + key;
313
- }
314
- }
315
-
316
- ret = ret + fn(context[key], {
317
- data: data,
318
- blockParams: Utils.blockParams([context[key], key], [contextPath + key, null])
319
- });
320
- }
321
-
322
- if(context && typeof context === 'object') {
323
- if (isArray(context)) {
324
- for(var j = context.length; i<j; i++) {
325
- execIteration(i, i, i === context.length-1);
326
- }
327
- } else {
328
- var priorKey;
329
-
330
- for(var key in context) {
331
- if(context.hasOwnProperty(key)) {
332
- // We're running the iterations one step out of sync so we can detect
333
- // the last iteration without have to scan the object twice and create
334
- // an itermediate keys array.
335
- if (priorKey) {
336
- execIteration(priorKey, i-1);
337
- }
338
- priorKey = key;
339
- i++;
340
- }
341
- }
342
- if (priorKey) {
343
- execIteration(priorKey, i-1, true);
344
- }
345
- }
346
- }
347
-
348
- if(i === 0){
349
- ret = inverse(this);
350
- }
351
-
352
- return ret;
353
- });
354
-
355
- instance.registerHelper('if', function(conditional, options) {
356
- if (isFunction(conditional)) { conditional = conditional.call(this); }
357
-
358
- // Default behavior is to render the positive path if the value is truthy and not empty.
359
- // The `includeZero` option may be set to treat the condtional as purely not empty based on the
360
- // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
361
- if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {
362
- return options.inverse(this);
363
- } else {
364
- return options.fn(this);
365
- }
366
- });
367
-
368
- instance.registerHelper('unless', function(conditional, options) {
369
- return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});
370
- });
371
-
372
- instance.registerHelper('with', function(context, options) {
373
- if (isFunction(context)) { context = context.call(this); }
374
-
375
- var fn = options.fn;
376
-
377
- if (!Utils.isEmpty(context)) {
378
- if (options.data && options.ids) {
379
- var data = createFrame(options.data);
380
- data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]);
381
- options = {data:data};
382
- }
383
-
384
- return fn(context, options);
385
- } else {
386
- return options.inverse(this);
387
- }
388
- });
389
-
390
- instance.registerHelper('log', function(message, options) {
391
- var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
392
- instance.log(level, message);
393
- });
394
-
395
- instance.registerHelper('lookup', function(obj, field) {
396
- return obj && obj[field];
397
- });
398
- }
399
-
400
- var logger = {
401
- methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
402
-
403
- // State enum
404
- DEBUG: 0,
405
- INFO: 1,
406
- WARN: 2,
407
- ERROR: 3,
408
- level: 1,
409
-
410
- // Can be overridden in the host environment
411
- log: function(level, message) {
412
- if (typeof console !== 'undefined' && logger.level <= level) {
413
- var method = logger.methodMap[level];
414
- (console[method] || console.log).call(console, message);
415
- }
416
- }
417
- };
418
- __exports__.logger = logger;
419
- var log = logger.log;
420
- __exports__.log = log;
421
- var createFrame = function(object) {
422
- var frame = Utils.extend({}, object);
423
- frame._parent = object;
424
- return frame;
425
- };
426
- __exports__.createFrame = createFrame;
427
- return __exports__;
428
- })(__module2__, __module3__);
429
-
430
- // handlebars/safe-string.js
431
- var __module4__ = (function() {
432
- "use strict";
433
- var __exports__;
434
- // Build out our basic SafeString type
435
- function SafeString(string) {
436
- this.string = string;
437
- }
438
-
439
- SafeString.prototype.toString = SafeString.prototype.toHTML = function() {
440
- return "" + this.string;
441
- };
442
-
443
- __exports__ = SafeString;
444
- return __exports__;
445
- })();
446
-
447
- // handlebars/runtime.js
448
- var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
449
- "use strict";
450
- var __exports__ = {};
451
- var Utils = __dependency1__;
452
- var Exception = __dependency2__;
453
- var COMPILER_REVISION = __dependency3__.COMPILER_REVISION;
454
- var REVISION_CHANGES = __dependency3__.REVISION_CHANGES;
455
- var createFrame = __dependency3__.createFrame;
456
-
457
- function checkRevision(compilerInfo) {
458
- var compilerRevision = compilerInfo && compilerInfo[0] || 1,
459
- currentRevision = COMPILER_REVISION;
460
-
461
- if (compilerRevision !== currentRevision) {
462
- if (compilerRevision < currentRevision) {
463
- var runtimeVersions = REVISION_CHANGES[currentRevision],
464
- compilerVersions = REVISION_CHANGES[compilerRevision];
465
- throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
466
- "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
467
- } else {
468
- // Use the embedded version info since the runtime doesn't know about this revision yet
469
- throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
470
- "Please update your runtime to a newer version ("+compilerInfo[1]+").");
471
- }
472
- }
473
- }
474
-
475
- __exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial
476
-
477
- function template(templateSpec, env) {
478
- /* istanbul ignore next */
479
- if (!env) {
480
- throw new Exception("No environment passed to template");
481
- }
482
- if (!templateSpec || !templateSpec.main) {
483
- throw new Exception('Unknown template object: ' + typeof templateSpec);
484
- }
485
-
486
- // Note: Using env.VM references rather than local var references throughout this section to allow
487
- // for external users to override these as psuedo-supported APIs.
488
- env.VM.checkRevision(templateSpec.compiler);
489
-
490
- var invokePartialWrapper = function(partial, context, options) {
491
- if (options.hash) {
492
- context = Utils.extend({}, context, options.hash);
493
- }
494
-
495
- partial = env.VM.resolvePartial.call(this, partial, context, options);
496
- var result = env.VM.invokePartial.call(this, partial, context, options);
497
-
498
- if (result == null && env.compile) {
499
- options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
500
- result = options.partials[options.name](context, options);
501
- }
502
- if (result != null) {
503
- if (options.indent) {
504
- var lines = result.split('\n');
505
- for (var i = 0, l = lines.length; i < l; i++) {
506
- if (!lines[i] && i + 1 === l) {
507
- break;
508
- }
509
-
510
- lines[i] = options.indent + lines[i];
511
- }
512
- result = lines.join('\n');
513
- }
514
- return result;
515
- } else {
516
- throw new Exception("The partial " + options.name + " could not be compiled when running in runtime-only mode");
517
- }
518
- };
519
-
520
- // Just add water
521
- var container = {
522
- strict: function(obj, name) {
523
- if (!(name in obj)) {
524
- throw new Exception('"' + name + '" not defined in ' + obj);
525
- }
526
- return obj[name];
527
- },
528
- lookup: function(depths, name) {
529
- var len = depths.length;
530
- for (var i = 0; i < len; i++) {
531
- if (depths[i] && depths[i][name] != null) {
532
- return depths[i][name];
533
- }
534
- }
535
- },
536
- lambda: function(current, context) {
537
- return typeof current === 'function' ? current.call(context) : current;
538
- },
539
-
540
- escapeExpression: Utils.escapeExpression,
541
- invokePartial: invokePartialWrapper,
542
-
543
- fn: function(i) {
544
- return templateSpec[i];
545
- },
546
-
547
- programs: [],
548
- program: function(i, data, declaredBlockParams, blockParams, depths) {
549
- var programWrapper = this.programs[i],
550
- fn = this.fn(i);
551
- if (data || depths || blockParams || declaredBlockParams) {
552
- programWrapper = program(this, i, fn, data, declaredBlockParams, blockParams, depths);
553
- } else if (!programWrapper) {
554
- programWrapper = this.programs[i] = program(this, i, fn);
555
- }
556
- return programWrapper;
557
- },
558
-
559
- data: function(data, depth) {
560
- while (data && depth--) {
561
- data = data._parent;
562
- }
563
- return data;
564
- },
565
- merge: function(param, common) {
566
- var ret = param || common;
567
-
568
- if (param && common && (param !== common)) {
569
- ret = Utils.extend({}, common, param);
570
- }
571
-
572
- return ret;
573
- },
574
-
575
- noop: env.VM.noop,
576
- compilerInfo: templateSpec.compiler
577
- };
578
-
579
- var ret = function(context, options) {
580
- options = options || {};
581
- var data = options.data;
582
-
583
- ret._setup(options);
584
- if (!options.partial && templateSpec.useData) {
585
- data = initData(context, data);
586
- }
587
- var depths,
588
- blockParams = templateSpec.useBlockParams ? [] : undefined;
589
- if (templateSpec.useDepths) {
590
- depths = options.depths ? [context].concat(options.depths) : [context];
591
- }
592
-
593
- return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths);
594
- };
595
- ret.isTop = true;
596
-
597
- ret._setup = function(options) {
598
- if (!options.partial) {
599
- container.helpers = container.merge(options.helpers, env.helpers);
600
-
601
- if (templateSpec.usePartial) {
602
- container.partials = container.merge(options.partials, env.partials);
603
- }
604
- } else {
605
- container.helpers = options.helpers;
606
- container.partials = options.partials;
607
- }
608
- };
609
-
610
- ret._child = function(i, data, blockParams, depths) {
611
- if (templateSpec.useBlockParams && !blockParams) {
612
- throw new Exception('must pass block params');
613
- }
614
- if (templateSpec.useDepths && !depths) {
615
- throw new Exception('must pass parent depths');
616
- }
617
-
618
- return program(container, i, templateSpec[i], data, 0, blockParams, depths);
619
- };
620
- return ret;
621
- }
622
-
623
- __exports__.template = template;function program(container, i, fn, data, declaredBlockParams, blockParams, depths) {
624
- var prog = function(context, options) {
625
- options = options || {};
626
-
627
- return fn.call(container,
628
- context,
629
- container.helpers, container.partials,
630
- options.data || data,
631
- blockParams && [options.blockParams].concat(blockParams),
632
- depths && [context].concat(depths));
633
- };
634
- prog.program = i;
635
- prog.depth = depths ? depths.length : 0;
636
- prog.blockParams = declaredBlockParams || 0;
637
- return prog;
638
- }
639
-
640
- __exports__.program = program;function resolvePartial(partial, context, options) {
641
- if (!partial) {
642
- partial = options.partials[options.name];
643
- } else if (!partial.call && !options.name) {
644
- // This is a dynamic partial that returned a string
645
- options.name = partial;
646
- partial = options.partials[partial];
647
- }
648
- return partial;
649
- }
650
-
651
- __exports__.resolvePartial = resolvePartial;function invokePartial(partial, context, options) {
652
- options.partial = true;
653
-
654
- if(partial === undefined) {
655
- throw new Exception("The partial " + options.name + " could not be found");
656
- } else if(partial instanceof Function) {
657
- return partial(context, options);
658
- }
659
- }
660
-
661
- __exports__.invokePartial = invokePartial;function noop() { return ""; }
662
-
663
- __exports__.noop = noop;function initData(context, data) {
664
- if (!data || !('root' in data)) {
665
- data = data ? createFrame(data) : {};
666
- data.root = context;
667
- }
668
- return data;
669
- }
670
- return __exports__;
671
- })(__module2__, __module3__, __module1__);
672
-
673
- // handlebars.runtime.js
674
- var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
675
- "use strict";
676
- var __exports__;
677
- /*globals Handlebars: true */
678
- var base = __dependency1__;
679
-
680
- // Each of these augment the Handlebars object. No need to setup here.
681
- // (This is done to easily share code between commonjs and browse envs)
682
- var SafeString = __dependency2__;
683
- var Exception = __dependency3__;
684
- var Utils = __dependency4__;
685
- var runtime = __dependency5__;
686
-
687
- // For compatibility and usage outside of module systems, make the Handlebars object a namespace
688
- var create = function() {
689
- var hb = new base.HandlebarsEnvironment();
690
-
691
- Utils.extend(hb, base);
692
- hb.SafeString = SafeString;
693
- hb.Exception = Exception;
694
- hb.Utils = Utils;
695
- hb.escapeExpression = Utils.escapeExpression;
696
-
697
- hb.VM = runtime;
698
- hb.template = function(spec) {
699
- return runtime.template(spec, hb);
700
- };
701
-
702
- return hb;
703
- };
704
-
705
- var Handlebars = create();
706
- Handlebars.create = create;
707
-
708
- /*jshint -W040 */
709
- /* istanbul ignore next */
710
- var root = typeof global !== 'undefined' ? global : window,
711
- $Handlebars = root.Handlebars;
712
- /* istanbul ignore next */
713
- Handlebars.noConflict = function() {
714
- if (root.Handlebars === Handlebars) {
715
- root.Handlebars = $Handlebars;
716
- }
717
- };
718
-
719
- Handlebars['default'] = Handlebars;
720
-
721
- __exports__ = Handlebars;
722
- return __exports__;
723
- })(__module1__, __module4__, __module3__, __module2__, __module5__);
724
-
725
- return __module0__;
726
- }));
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 = {};
40
+
41
+ /******/ // The require function
42
+ /******/ function __webpack_require__(moduleId) {
43
+
44
+ /******/ // Check if module is in cache
45
+ /******/ if(installedModules[moduleId])
46
+ /******/ return installedModules[moduleId].exports;
47
+
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
+ /******/ };
54
+
55
+ /******/ // Execute the module function
56
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
57
+
58
+ /******/ // Flag the module as loaded
59
+ /******/ module.loaded = true;
60
+
61
+ /******/ // Return the exports of the module
62
+ /******/ return module.exports;
63
+ /******/ }
64
+
65
+
66
+ /******/ // expose the modules object (__webpack_modules__)
67
+ /******/ __webpack_require__.m = modules;
68
+
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
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
84
+
85
+ var _interopRequireWildcard = __webpack_require__(6)['default'];
86
+
87
+ exports.__esModule = true;
88
+ /*global window */
89
+
90
+ var _import = __webpack_require__(1);
91
+
92
+ var base = _interopRequireWildcard(_import);
93
+
94
+ // Each of these augment the Handlebars object. No need to setup here.
95
+ // (This is done to easily share code between commonjs and browse envs)
96
+
97
+ var _SafeString = __webpack_require__(2);
98
+
99
+ var _SafeString2 = _interopRequireWildcard(_SafeString);
100
+
101
+ var _Exception = __webpack_require__(3);
102
+
103
+ var _Exception2 = _interopRequireWildcard(_Exception);
104
+
105
+ var _import2 = __webpack_require__(4);
106
+
107
+ var Utils = _interopRequireWildcard(_import2);
108
+
109
+ var _import3 = __webpack_require__(5);
110
+
111
+ var runtime = _interopRequireWildcard(_import3);
112
+
113
+ // For compatibility and usage outside of module systems, make the Handlebars object a namespace
114
+ function create() {
115
+ var hb = new base.HandlebarsEnvironment();
116
+
117
+ Utils.extend(hb, base);
118
+ hb.SafeString = _SafeString2['default'];
119
+ hb.Exception = _Exception2['default'];
120
+ hb.Utils = Utils;
121
+ hb.escapeExpression = Utils.escapeExpression;
122
+
123
+ hb.VM = runtime;
124
+ hb.template = function (spec) {
125
+ return runtime.template(spec, hb);
126
+ };
127
+
128
+ return hb;
129
+ }
130
+
131
+ var Handlebars = create();
132
+ Handlebars.create = create;
133
+
134
+ /*jshint -W040 */
135
+ /* istanbul ignore next */
136
+ var root = typeof global !== 'undefined' ? global : window,
137
+ $Handlebars = root.Handlebars;
138
+ /* istanbul ignore next */
139
+ Handlebars.noConflict = function () {
140
+ if (root.Handlebars === Handlebars) {
141
+ root.Handlebars = $Handlebars;
142
+ }
143
+ };
144
+
145
+ Handlebars['default'] = Handlebars;
146
+
147
+ exports['default'] = Handlebars;
148
+ module.exports = exports['default'];
149
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
150
+
151
+ /***/ },
152
+ /* 1 */
153
+ /***/ function(module, exports, __webpack_require__) {
154
+
155
+ 'use strict';
156
+
157
+ var _interopRequireWildcard = __webpack_require__(6)['default'];
158
+
159
+ exports.__esModule = true;
160
+ exports.HandlebarsEnvironment = HandlebarsEnvironment;
161
+ exports.createFrame = createFrame;
162
+
163
+ var _import = __webpack_require__(4);
164
+
165
+ var Utils = _interopRequireWildcard(_import);
166
+
167
+ var _Exception = __webpack_require__(3);
168
+
169
+ var _Exception2 = _interopRequireWildcard(_Exception);
170
+
171
+ var VERSION = '3.0.1';
172
+ exports.VERSION = VERSION;
173
+ var COMPILER_REVISION = 6;
174
+
175
+ exports.COMPILER_REVISION = COMPILER_REVISION;
176
+ var REVISION_CHANGES = {
177
+ 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
178
+ 2: '== 1.0.0-rc.3',
179
+ 3: '== 1.0.0-rc.4',
180
+ 4: '== 1.x.x',
181
+ 5: '== 2.0.0-alpha.x',
182
+ 6: '>= 2.0.0-beta.1'
183
+ };
184
+
185
+ exports.REVISION_CHANGES = REVISION_CHANGES;
186
+ var isArray = Utils.isArray,
187
+ isFunction = Utils.isFunction,
188
+ toString = Utils.toString,
189
+ objectType = '[object Object]';
190
+
191
+ function HandlebarsEnvironment(helpers, partials) {
192
+ this.helpers = helpers || {};
193
+ this.partials = partials || {};
194
+
195
+ registerDefaultHelpers(this);
196
+ }
197
+
198
+ HandlebarsEnvironment.prototype = {
199
+ constructor: HandlebarsEnvironment,
200
+
201
+ logger: logger,
202
+ log: log,
203
+
204
+ registerHelper: function registerHelper(name, fn) {
205
+ if (toString.call(name) === objectType) {
206
+ if (fn) {
207
+ throw new _Exception2['default']('Arg not supported with multiple helpers');
208
+ }
209
+ Utils.extend(this.helpers, name);
210
+ } else {
211
+ this.helpers[name] = fn;
212
+ }
213
+ },
214
+ unregisterHelper: function unregisterHelper(name) {
215
+ delete this.helpers[name];
216
+ },
217
+
218
+ registerPartial: function registerPartial(name, partial) {
219
+ if (toString.call(name) === objectType) {
220
+ Utils.extend(this.partials, name);
221
+ } else {
222
+ if (typeof partial === 'undefined') {
223
+ throw new _Exception2['default']('Attempting to register a partial as undefined');
224
+ }
225
+ this.partials[name] = partial;
226
+ }
227
+ },
228
+ unregisterPartial: function unregisterPartial(name) {
229
+ delete this.partials[name];
230
+ }
231
+ };
232
+
233
+ function registerDefaultHelpers(instance) {
234
+ instance.registerHelper('helperMissing', function () {
235
+ if (arguments.length === 1) {
236
+ // A missing field in a {{foo}} constuct.
237
+ return undefined;
238
+ } else {
239
+ // Someone is actually trying to call something, blow up.
240
+ throw new _Exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
241
+ }
242
+ });
243
+
244
+ instance.registerHelper('blockHelperMissing', function (context, options) {
245
+ var inverse = options.inverse,
246
+ fn = options.fn;
247
+
248
+ if (context === true) {
249
+ return fn(this);
250
+ } else if (context === false || context == null) {
251
+ return inverse(this);
252
+ } else if (isArray(context)) {
253
+ if (context.length > 0) {
254
+ if (options.ids) {
255
+ options.ids = [options.name];
256
+ }
257
+
258
+ return instance.helpers.each(context, options);
259
+ } else {
260
+ return inverse(this);
261
+ }
262
+ } else {
263
+ if (options.data && options.ids) {
264
+ var data = createFrame(options.data);
265
+ data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name);
266
+ options = { data: data };
267
+ }
268
+
269
+ return fn(context, options);
270
+ }
271
+ });
272
+
273
+ instance.registerHelper('each', function (context, options) {
274
+ if (!options) {
275
+ throw new _Exception2['default']('Must pass iterator to #each');
276
+ }
277
+
278
+ var fn = options.fn,
279
+ inverse = options.inverse,
280
+ i = 0,
281
+ ret = '',
282
+ data = undefined,
283
+ contextPath = undefined;
284
+
285
+ if (options.data && options.ids) {
286
+ contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
287
+ }
288
+
289
+ if (isFunction(context)) {
290
+ context = context.call(this);
291
+ }
292
+
293
+ if (options.data) {
294
+ data = createFrame(options.data);
295
+ }
296
+
297
+ function execIteration(field, index, last) {
298
+ if (data) {
299
+ data.key = field;
300
+ data.index = index;
301
+ data.first = index === 0;
302
+ data.last = !!last;
303
+
304
+ if (contextPath) {
305
+ data.contextPath = contextPath + field;
306
+ }
307
+ }
308
+
309
+ ret = ret + fn(context[field], {
310
+ data: data,
311
+ blockParams: Utils.blockParams([context[field], field], [contextPath + field, null])
312
+ });
313
+ }
314
+
315
+ if (context && typeof context === 'object') {
316
+ if (isArray(context)) {
317
+ for (var j = context.length; i < j; i++) {
318
+ execIteration(i, i, i === context.length - 1);
319
+ }
320
+ } else {
321
+ var priorKey = undefined;
322
+
323
+ for (var key in context) {
324
+ if (context.hasOwnProperty(key)) {
325
+ // We're running the iterations one step out of sync so we can detect
326
+ // the last iteration without have to scan the object twice and create
327
+ // an itermediate keys array.
328
+ if (priorKey) {
329
+ execIteration(priorKey, i - 1);
330
+ }
331
+ priorKey = key;
332
+ i++;
333
+ }
334
+ }
335
+ if (priorKey) {
336
+ execIteration(priorKey, i - 1, true);
337
+ }
338
+ }
339
+ }
340
+
341
+ if (i === 0) {
342
+ ret = inverse(this);
343
+ }
344
+
345
+ return ret;
346
+ });
347
+
348
+ instance.registerHelper('if', function (conditional, options) {
349
+ if (isFunction(conditional)) {
350
+ conditional = conditional.call(this);
351
+ }
352
+
353
+ // Default behavior is to render the positive path if the value is truthy and not empty.
354
+ // The `includeZero` option may be set to treat the condtional as purely not empty based on the
355
+ // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
356
+ if (!options.hash.includeZero && !conditional || Utils.isEmpty(conditional)) {
357
+ return options.inverse(this);
358
+ } else {
359
+ return options.fn(this);
360
+ }
361
+ });
362
+
363
+ instance.registerHelper('unless', function (conditional, options) {
364
+ return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
365
+ });
366
+
367
+ instance.registerHelper('with', function (context, options) {
368
+ if (isFunction(context)) {
369
+ context = context.call(this);
370
+ }
371
+
372
+ var fn = options.fn;
373
+
374
+ if (!Utils.isEmpty(context)) {
375
+ if (options.data && options.ids) {
376
+ var data = createFrame(options.data);
377
+ data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]);
378
+ options = { data: data };
379
+ }
380
+
381
+ return fn(context, options);
382
+ } else {
383
+ return options.inverse(this);
384
+ }
385
+ });
386
+
387
+ instance.registerHelper('log', function (message, options) {
388
+ var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
389
+ instance.log(level, message);
390
+ });
391
+
392
+ instance.registerHelper('lookup', function (obj, field) {
393
+ return obj && obj[field];
394
+ });
395
+ }
396
+
397
+ var logger = {
398
+ methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
399
+
400
+ // State enum
401
+ DEBUG: 0,
402
+ INFO: 1,
403
+ WARN: 2,
404
+ ERROR: 3,
405
+ level: 1,
406
+
407
+ // Can be overridden in the host environment
408
+ log: function log(level, message) {
409
+ if (typeof console !== 'undefined' && logger.level <= level) {
410
+ var method = logger.methodMap[level];
411
+ (console[method] || console.log).call(console, message); // eslint-disable-line no-console
412
+ }
413
+ }
414
+ };
415
+
416
+ exports.logger = logger;
417
+ var log = logger.log;
418
+
419
+ exports.log = log;
420
+
421
+ function createFrame(object) {
422
+ var frame = Utils.extend({}, object);
423
+ frame._parent = object;
424
+ return frame;
425
+ }
426
+
427
+ /* [args, ]options */
428
+
429
+ /***/ },
430
+ /* 2 */
431
+ /***/ function(module, exports, __webpack_require__) {
432
+
433
+ 'use strict';
434
+
435
+ exports.__esModule = true;
436
+ // Build out our basic SafeString type
437
+ function SafeString(string) {
438
+ this.string = string;
439
+ }
440
+
441
+ SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
442
+ return '' + this.string;
443
+ };
444
+
445
+ exports['default'] = SafeString;
446
+ module.exports = exports['default'];
447
+
448
+ /***/ },
449
+ /* 3 */
450
+ /***/ function(module, exports, __webpack_require__) {
451
+
452
+ 'use strict';
453
+
454
+ exports.__esModule = true;
455
+
456
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
457
+
458
+ function Exception(message, node) {
459
+ var loc = node && node.loc,
460
+ line = undefined,
461
+ column = undefined;
462
+ if (loc) {
463
+ line = loc.start.line;
464
+ column = loc.start.column;
465
+
466
+ message += ' - ' + line + ':' + column;
467
+ }
468
+
469
+ var tmp = Error.prototype.constructor.call(this, message);
470
+
471
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
472
+ for (var idx = 0; idx < errorProps.length; idx++) {
473
+ this[errorProps[idx]] = tmp[errorProps[idx]];
474
+ }
475
+
476
+ if (Error.captureStackTrace) {
477
+ Error.captureStackTrace(this, Exception);
478
+ }
479
+
480
+ if (loc) {
481
+ this.lineNumber = line;
482
+ this.column = column;
483
+ }
484
+ }
485
+
486
+ Exception.prototype = new Error();
487
+
488
+ exports['default'] = Exception;
489
+ module.exports = exports['default'];
490
+
491
+ /***/ },
492
+ /* 4 */
493
+ /***/ function(module, exports, __webpack_require__) {
494
+
495
+ 'use strict';
496
+
497
+ exports.__esModule = true;
498
+ exports.extend = extend;
499
+
500
+ // Older IE versions do not directly support indexOf so we must implement our own, sadly.
501
+ exports.indexOf = indexOf;
502
+ exports.escapeExpression = escapeExpression;
503
+ exports.isEmpty = isEmpty;
504
+ exports.blockParams = blockParams;
505
+ exports.appendContextPath = appendContextPath;
506
+ /*jshint -W004 */
507
+ var escape = {
508
+ '&': '&amp;',
509
+ '<': '&lt;',
510
+ '>': '&gt;',
511
+ '"': '&quot;',
512
+ '\'': '&#x27;',
513
+ '`': '&#x60;'
514
+ };
515
+
516
+ var badChars = /[&<>"'`]/g,
517
+ possible = /[&<>"'`]/;
518
+
519
+ function escapeChar(chr) {
520
+ return escape[chr];
521
+ }
522
+
523
+ function extend(obj /* , ...source */) {
524
+ for (var i = 1; i < arguments.length; i++) {
525
+ for (var key in arguments[i]) {
526
+ if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
527
+ obj[key] = arguments[i][key];
528
+ }
529
+ }
530
+ }
531
+
532
+ return obj;
533
+ }
534
+
535
+ var toString = Object.prototype.toString;
536
+
537
+ exports.toString = toString;
538
+ // Sourced from lodash
539
+ // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
540
+ /*eslint-disable func-style, no-var */
541
+ var isFunction = function isFunction(value) {
542
+ return typeof value === 'function';
543
+ };
544
+ // fallback for older versions of Chrome and Safari
545
+ /* istanbul ignore next */
546
+ if (isFunction(/x/)) {
547
+ exports.isFunction = isFunction = function (value) {
548
+ return typeof value === 'function' && toString.call(value) === '[object Function]';
549
+ };
550
+ }
551
+ var isFunction;
552
+ exports.isFunction = isFunction;
553
+ /*eslint-enable func-style, no-var */
554
+
555
+ /* istanbul ignore next */
556
+ var isArray = Array.isArray || function (value) {
557
+ return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
558
+ };exports.isArray = isArray;
559
+
560
+ function indexOf(array, value) {
561
+ for (var i = 0, len = array.length; i < len; i++) {
562
+ if (array[i] === value) {
563
+ return i;
564
+ }
565
+ }
566
+ return -1;
567
+ }
568
+
569
+ function escapeExpression(string) {
570
+ if (typeof string !== 'string') {
571
+ // don't escape SafeStrings, since they're already safe
572
+ if (string && string.toHTML) {
573
+ return string.toHTML();
574
+ } else if (string == null) {
575
+ return '';
576
+ } else if (!string) {
577
+ return string + '';
578
+ }
579
+
580
+ // Force a string conversion as this will be done by the append regardless and
581
+ // the regex test will do this transparently behind the scenes, causing issues if
582
+ // an object's to string has escaped characters in it.
583
+ string = '' + string;
584
+ }
585
+
586
+ if (!possible.test(string)) {
587
+ return string;
588
+ }
589
+ return string.replace(badChars, escapeChar);
590
+ }
591
+
592
+ function isEmpty(value) {
593
+ if (!value && value !== 0) {
594
+ return true;
595
+ } else if (isArray(value) && value.length === 0) {
596
+ return true;
597
+ } else {
598
+ return false;
599
+ }
600
+ }
601
+
602
+ function blockParams(params, ids) {
603
+ params.path = ids;
604
+ return params;
605
+ }
606
+
607
+ function appendContextPath(contextPath, id) {
608
+ return (contextPath ? contextPath + '.' : '') + id;
609
+ }
610
+
611
+ /***/ },
612
+ /* 5 */
613
+ /***/ function(module, exports, __webpack_require__) {
614
+
615
+ 'use strict';
616
+
617
+ var _interopRequireWildcard = __webpack_require__(6)['default'];
618
+
619
+ exports.__esModule = true;
620
+ exports.checkRevision = checkRevision;
621
+
622
+ // TODO: Remove this line and break up compilePartial
623
+
624
+ exports.template = template;
625
+ exports.wrapProgram = wrapProgram;
626
+ exports.resolvePartial = resolvePartial;
627
+ exports.invokePartial = invokePartial;
628
+ exports.noop = noop;
629
+
630
+ var _import = __webpack_require__(4);
631
+
632
+ var Utils = _interopRequireWildcard(_import);
633
+
634
+ var _Exception = __webpack_require__(3);
635
+
636
+ var _Exception2 = _interopRequireWildcard(_Exception);
637
+
638
+ var _COMPILER_REVISION$REVISION_CHANGES$createFrame = __webpack_require__(1);
639
+
640
+ function checkRevision(compilerInfo) {
641
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
642
+ currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION;
643
+
644
+ if (compilerRevision !== currentRevision) {
645
+ if (compilerRevision < currentRevision) {
646
+ var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision],
647
+ compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision];
648
+ 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 + ').');
649
+ } else {
650
+ // Use the embedded version info since the runtime doesn't know about this revision yet
651
+ 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] + ').');
652
+ }
653
+ }
654
+ }
655
+
656
+ function template(templateSpec, env) {
657
+ /* istanbul ignore next */
658
+ if (!env) {
659
+ throw new _Exception2['default']('No environment passed to template');
660
+ }
661
+ if (!templateSpec || !templateSpec.main) {
662
+ throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec);
663
+ }
664
+
665
+ // Note: Using env.VM references rather than local var references throughout this section to allow
666
+ // for external users to override these as psuedo-supported APIs.
667
+ env.VM.checkRevision(templateSpec.compiler);
668
+
669
+ function invokePartialWrapper(partial, context, options) {
670
+ if (options.hash) {
671
+ context = Utils.extend({}, context, options.hash);
672
+ }
673
+
674
+ partial = env.VM.resolvePartial.call(this, partial, context, options);
675
+ var result = env.VM.invokePartial.call(this, partial, context, options);
676
+
677
+ if (result == null && env.compile) {
678
+ options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
679
+ result = options.partials[options.name](context, options);
680
+ }
681
+ if (result != null) {
682
+ if (options.indent) {
683
+ var lines = result.split('\n');
684
+ for (var i = 0, l = lines.length; i < l; i++) {
685
+ if (!lines[i] && i + 1 === l) {
686
+ break;
687
+ }
688
+
689
+ lines[i] = options.indent + lines[i];
690
+ }
691
+ result = lines.join('\n');
692
+ }
693
+ return result;
694
+ } else {
695
+ throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
696
+ }
697
+ }
698
+
699
+ // Just add water
700
+ var container = {
701
+ strict: function strict(obj, name) {
702
+ if (!(name in obj)) {
703
+ throw new _Exception2['default']('"' + name + '" not defined in ' + obj);
704
+ }
705
+ return obj[name];
706
+ },
707
+ lookup: function lookup(depths, name) {
708
+ var len = depths.length;
709
+ for (var i = 0; i < len; i++) {
710
+ if (depths[i] && depths[i][name] != null) {
711
+ return depths[i][name];
712
+ }
713
+ }
714
+ },
715
+ lambda: function lambda(current, context) {
716
+ return typeof current === 'function' ? current.call(context) : current;
717
+ },
718
+
719
+ escapeExpression: Utils.escapeExpression,
720
+ invokePartial: invokePartialWrapper,
721
+
722
+ fn: function fn(i) {
723
+ return templateSpec[i];
724
+ },
725
+
726
+ programs: [],
727
+ program: function program(i, data, declaredBlockParams, blockParams, depths) {
728
+ var programWrapper = this.programs[i],
729
+ fn = this.fn(i);
730
+ if (data || depths || blockParams || declaredBlockParams) {
731
+ programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
732
+ } else if (!programWrapper) {
733
+ programWrapper = this.programs[i] = wrapProgram(this, i, fn);
734
+ }
735
+ return programWrapper;
736
+ },
737
+
738
+ data: function data(value, depth) {
739
+ while (value && depth--) {
740
+ value = value._parent;
741
+ }
742
+ return value;
743
+ },
744
+ merge: function merge(param, common) {
745
+ var obj = param || common;
746
+
747
+ if (param && common && param !== common) {
748
+ obj = Utils.extend({}, common, param);
749
+ }
750
+
751
+ return obj;
752
+ },
753
+
754
+ noop: env.VM.noop,
755
+ compilerInfo: templateSpec.compiler
756
+ };
757
+
758
+ function ret(context) {
759
+ var options = arguments[1] === undefined ? {} : arguments[1];
760
+
761
+ var data = options.data;
762
+
763
+ ret._setup(options);
764
+ if (!options.partial && templateSpec.useData) {
765
+ data = initData(context, data);
766
+ }
767
+ var depths = undefined,
768
+ blockParams = templateSpec.useBlockParams ? [] : undefined;
769
+ if (templateSpec.useDepths) {
770
+ depths = options.depths ? [context].concat(options.depths) : [context];
771
+ }
772
+
773
+ return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths);
774
+ }
775
+ ret.isTop = true;
776
+
777
+ ret._setup = function (options) {
778
+ if (!options.partial) {
779
+ container.helpers = container.merge(options.helpers, env.helpers);
780
+
781
+ if (templateSpec.usePartial) {
782
+ container.partials = container.merge(options.partials, env.partials);
783
+ }
784
+ } else {
785
+ container.helpers = options.helpers;
786
+ container.partials = options.partials;
787
+ }
788
+ };
789
+
790
+ ret._child = function (i, data, blockParams, depths) {
791
+ if (templateSpec.useBlockParams && !blockParams) {
792
+ throw new _Exception2['default']('must pass block params');
793
+ }
794
+ if (templateSpec.useDepths && !depths) {
795
+ throw new _Exception2['default']('must pass parent depths');
796
+ }
797
+
798
+ return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
799
+ };
800
+ return ret;
801
+ }
802
+
803
+ function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
804
+ function prog(context) {
805
+ var options = arguments[1] === undefined ? {} : arguments[1];
806
+
807
+ return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths));
808
+ }
809
+ prog.program = i;
810
+ prog.depth = depths ? depths.length : 0;
811
+ prog.blockParams = declaredBlockParams || 0;
812
+ return prog;
813
+ }
814
+
815
+ function resolvePartial(partial, context, options) {
816
+ if (!partial) {
817
+ partial = options.partials[options.name];
818
+ } else if (!partial.call && !options.name) {
819
+ // This is a dynamic partial that returned a string
820
+ options.name = partial;
821
+ partial = options.partials[partial];
822
+ }
823
+ return partial;
824
+ }
825
+
826
+ function invokePartial(partial, context, options) {
827
+ options.partial = true;
828
+
829
+ if (partial === undefined) {
830
+ throw new _Exception2['default']('The partial ' + options.name + ' could not be found');
831
+ } else if (partial instanceof Function) {
832
+ return partial(context, options);
833
+ }
834
+ }
835
+
836
+ function noop() {
837
+ return '';
838
+ }
839
+
840
+ function initData(context, data) {
841
+ if (!data || !('root' in data)) {
842
+ data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {};
843
+ data.root = context;
844
+ }
845
+ return data;
846
+ }
847
+
848
+ /***/ },
849
+ /* 6 */
850
+ /***/ function(module, exports, __webpack_require__) {
851
+
852
+ "use strict";
853
+
854
+ exports["default"] = function (obj) {
855
+ return obj && obj.__esModule ? obj : {
856
+ "default": obj
857
+ };
858
+ };
859
+
860
+ exports.__esModule = true;
861
+
862
+ /***/ }
863
+ /******/ ])
864
+ });
865
+ ;