mutton 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4131 @@
1
+ /*!
2
+
3
+ handlebars v3.0.3
4
+
5
+ Copyright (C) 2011-2014 by Yehuda Katz
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+
25
+ @license
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 = {};
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
+ 'use strict';
84
+
85
+ var _interopRequireDefault = __webpack_require__(8)['default'];
86
+
87
+ exports.__esModule = true;
88
+
89
+ var _runtime = __webpack_require__(1);
90
+
91
+ var _runtime2 = _interopRequireDefault(_runtime);
92
+
93
+ // Compiler imports
94
+
95
+ var _AST = __webpack_require__(2);
96
+
97
+ var _AST2 = _interopRequireDefault(_AST);
98
+
99
+ var _Parser$parse = __webpack_require__(3);
100
+
101
+ var _Compiler$compile$precompile = __webpack_require__(4);
102
+
103
+ var _JavaScriptCompiler = __webpack_require__(5);
104
+
105
+ var _JavaScriptCompiler2 = _interopRequireDefault(_JavaScriptCompiler);
106
+
107
+ var _Visitor = __webpack_require__(6);
108
+
109
+ var _Visitor2 = _interopRequireDefault(_Visitor);
110
+
111
+ var _noConflict = __webpack_require__(7);
112
+
113
+ var _noConflict2 = _interopRequireDefault(_noConflict);
114
+
115
+ var _create = _runtime2['default'].create;
116
+ function create() {
117
+ var hb = _create();
118
+
119
+ hb.compile = function (input, options) {
120
+ return _Compiler$compile$precompile.compile(input, options, hb);
121
+ };
122
+ hb.precompile = function (input, options) {
123
+ return _Compiler$compile$precompile.precompile(input, options, hb);
124
+ };
125
+
126
+ hb.AST = _AST2['default'];
127
+ hb.Compiler = _Compiler$compile$precompile.Compiler;
128
+ hb.JavaScriptCompiler = _JavaScriptCompiler2['default'];
129
+ hb.Parser = _Parser$parse.parser;
130
+ hb.parse = _Parser$parse.parse;
131
+
132
+ return hb;
133
+ }
134
+
135
+ var inst = create();
136
+ inst.create = create;
137
+
138
+ _noConflict2['default'](inst);
139
+
140
+ inst.Visitor = _Visitor2['default'];
141
+
142
+ inst['default'] = inst;
143
+
144
+ exports['default'] = inst;
145
+ module.exports = exports['default'];
146
+
147
+ /***/ },
148
+ /* 1 */
149
+ /***/ function(module, exports, __webpack_require__) {
150
+
151
+ 'use strict';
152
+
153
+ var _interopRequireWildcard = __webpack_require__(9)['default'];
154
+
155
+ var _interopRequireDefault = __webpack_require__(8)['default'];
156
+
157
+ exports.__esModule = true;
158
+
159
+ var _import = __webpack_require__(10);
160
+
161
+ var base = _interopRequireWildcard(_import);
162
+
163
+ // Each of these augment the Handlebars object. No need to setup here.
164
+ // (This is done to easily share code between commonjs and browse envs)
165
+
166
+ var _SafeString = __webpack_require__(11);
167
+
168
+ var _SafeString2 = _interopRequireDefault(_SafeString);
169
+
170
+ var _Exception = __webpack_require__(12);
171
+
172
+ var _Exception2 = _interopRequireDefault(_Exception);
173
+
174
+ var _import2 = __webpack_require__(13);
175
+
176
+ var Utils = _interopRequireWildcard(_import2);
177
+
178
+ var _import3 = __webpack_require__(14);
179
+
180
+ var runtime = _interopRequireWildcard(_import3);
181
+
182
+ var _noConflict = __webpack_require__(7);
183
+
184
+ var _noConflict2 = _interopRequireDefault(_noConflict);
185
+
186
+ // For compatibility and usage outside of module systems, make the Handlebars object a namespace
187
+ function create() {
188
+ var hb = new base.HandlebarsEnvironment();
189
+
190
+ Utils.extend(hb, base);
191
+ hb.SafeString = _SafeString2['default'];
192
+ hb.Exception = _Exception2['default'];
193
+ hb.Utils = Utils;
194
+ hb.escapeExpression = Utils.escapeExpression;
195
+
196
+ hb.VM = runtime;
197
+ hb.template = function (spec) {
198
+ return runtime.template(spec, hb);
199
+ };
200
+
201
+ return hb;
202
+ }
203
+
204
+ var inst = create();
205
+ inst.create = create;
206
+
207
+ _noConflict2['default'](inst);
208
+
209
+ inst['default'] = inst;
210
+
211
+ exports['default'] = inst;
212
+ module.exports = exports['default'];
213
+
214
+ /***/ },
215
+ /* 2 */
216
+ /***/ function(module, exports, __webpack_require__) {
217
+
218
+ 'use strict';
219
+
220
+ exports.__esModule = true;
221
+ var AST = {
222
+ Program: function Program(statements, blockParams, strip, locInfo) {
223
+ this.loc = locInfo;
224
+ this.type = 'Program';
225
+ this.body = statements;
226
+
227
+ this.blockParams = blockParams;
228
+ this.strip = strip;
229
+ },
230
+
231
+ MustacheStatement: function MustacheStatement(path, params, hash, escaped, strip, locInfo) {
232
+ this.loc = locInfo;
233
+ this.type = 'MustacheStatement';
234
+
235
+ this.path = path;
236
+ this.params = params || [];
237
+ this.hash = hash;
238
+ this.escaped = escaped;
239
+
240
+ this.strip = strip;
241
+ },
242
+
243
+ BlockStatement: function BlockStatement(path, params, hash, program, inverse, openStrip, inverseStrip, closeStrip, locInfo) {
244
+ this.loc = locInfo;
245
+ this.type = 'BlockStatement';
246
+
247
+ this.path = path;
248
+ this.params = params || [];
249
+ this.hash = hash;
250
+ this.program = program;
251
+ this.inverse = inverse;
252
+
253
+ this.openStrip = openStrip;
254
+ this.inverseStrip = inverseStrip;
255
+ this.closeStrip = closeStrip;
256
+ },
257
+
258
+ PartialStatement: function PartialStatement(name, params, hash, strip, locInfo) {
259
+ this.loc = locInfo;
260
+ this.type = 'PartialStatement';
261
+
262
+ this.name = name;
263
+ this.params = params || [];
264
+ this.hash = hash;
265
+
266
+ this.indent = '';
267
+ this.strip = strip;
268
+ },
269
+
270
+ ContentStatement: function ContentStatement(string, locInfo) {
271
+ this.loc = locInfo;
272
+ this.type = 'ContentStatement';
273
+ this.original = this.value = string;
274
+ },
275
+
276
+ CommentStatement: function CommentStatement(comment, strip, locInfo) {
277
+ this.loc = locInfo;
278
+ this.type = 'CommentStatement';
279
+ this.value = comment;
280
+
281
+ this.strip = strip;
282
+ },
283
+
284
+ SubExpression: function SubExpression(path, params, hash, locInfo) {
285
+ this.loc = locInfo;
286
+
287
+ this.type = 'SubExpression';
288
+ this.path = path;
289
+ this.params = params || [];
290
+ this.hash = hash;
291
+ },
292
+
293
+ PathExpression: function PathExpression(data, depth, parts, original, locInfo) {
294
+ this.loc = locInfo;
295
+ this.type = 'PathExpression';
296
+
297
+ this.data = data;
298
+ this.original = original;
299
+ this.parts = parts;
300
+ this.depth = depth;
301
+ },
302
+
303
+ StringLiteral: function StringLiteral(string, locInfo) {
304
+ this.loc = locInfo;
305
+ this.type = 'StringLiteral';
306
+ this.original = this.value = string;
307
+ },
308
+
309
+ NumberLiteral: function NumberLiteral(number, locInfo) {
310
+ this.loc = locInfo;
311
+ this.type = 'NumberLiteral';
312
+ this.original = this.value = Number(number);
313
+ },
314
+
315
+ BooleanLiteral: function BooleanLiteral(bool, locInfo) {
316
+ this.loc = locInfo;
317
+ this.type = 'BooleanLiteral';
318
+ this.original = this.value = bool === 'true';
319
+ },
320
+
321
+ UndefinedLiteral: function UndefinedLiteral(locInfo) {
322
+ this.loc = locInfo;
323
+ this.type = 'UndefinedLiteral';
324
+ this.original = this.value = undefined;
325
+ },
326
+
327
+ NullLiteral: function NullLiteral(locInfo) {
328
+ this.loc = locInfo;
329
+ this.type = 'NullLiteral';
330
+ this.original = this.value = null;
331
+ },
332
+
333
+ Hash: function Hash(pairs, locInfo) {
334
+ this.loc = locInfo;
335
+ this.type = 'Hash';
336
+ this.pairs = pairs;
337
+ },
338
+ HashPair: function HashPair(key, value, locInfo) {
339
+ this.loc = locInfo;
340
+ this.type = 'HashPair';
341
+ this.key = key;
342
+ this.value = value;
343
+ },
344
+
345
+ // Public API used to evaluate derived attributes regarding AST nodes
346
+ helpers: {
347
+ // a mustache is definitely a helper if:
348
+ // * it is an eligible helper, and
349
+ // * it has at least one parameter or hash segment
350
+ helperExpression: function helperExpression(node) {
351
+ return !!(node.type === 'SubExpression' || node.params.length || node.hash);
352
+ },
353
+
354
+ scopedId: function scopedId(path) {
355
+ return /^\.|this\b/.test(path.original);
356
+ },
357
+
358
+ // an ID is simple if it only has one part, and that part is not
359
+ // `..` or `this`.
360
+ simpleId: function simpleId(path) {
361
+ return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
362
+ }
363
+ }
364
+ };
365
+
366
+ // Must be exported as an object rather than the root of the module as the jison lexer
367
+ // must modify the object to operate properly.
368
+ exports['default'] = AST;
369
+ module.exports = exports['default'];
370
+
371
+ /***/ },
372
+ /* 3 */
373
+ /***/ function(module, exports, __webpack_require__) {
374
+
375
+ 'use strict';
376
+
377
+ var _interopRequireDefault = __webpack_require__(8)['default'];
378
+
379
+ var _interopRequireWildcard = __webpack_require__(9)['default'];
380
+
381
+ exports.__esModule = true;
382
+ exports.parse = parse;
383
+
384
+ var _parser = __webpack_require__(15);
385
+
386
+ var _parser2 = _interopRequireDefault(_parser);
387
+
388
+ var _AST = __webpack_require__(2);
389
+
390
+ var _AST2 = _interopRequireDefault(_AST);
391
+
392
+ var _WhitespaceControl = __webpack_require__(16);
393
+
394
+ var _WhitespaceControl2 = _interopRequireDefault(_WhitespaceControl);
395
+
396
+ var _import = __webpack_require__(17);
397
+
398
+ var Helpers = _interopRequireWildcard(_import);
399
+
400
+ var _extend = __webpack_require__(13);
401
+
402
+ exports.parser = _parser2['default'];
403
+
404
+ var yy = {};
405
+ _extend.extend(yy, Helpers, _AST2['default']);
406
+
407
+ function parse(input, options) {
408
+ // Just return if an already-compiled AST was passed in.
409
+ if (input.type === 'Program') {
410
+ return input;
411
+ }
412
+
413
+ _parser2['default'].yy = yy;
414
+
415
+ // Altering the shared object here, but this is ok as parser is a sync operation
416
+ yy.locInfo = function (locInfo) {
417
+ return new yy.SourceLocation(options && options.srcName, locInfo);
418
+ };
419
+
420
+ var strip = new _WhitespaceControl2['default']();
421
+ return strip.accept(_parser2['default'].parse(input));
422
+ }
423
+
424
+ /***/ },
425
+ /* 4 */
426
+ /***/ function(module, exports, __webpack_require__) {
427
+
428
+ 'use strict';
429
+
430
+ var _interopRequireDefault = __webpack_require__(8)['default'];
431
+
432
+ exports.__esModule = true;
433
+ exports.Compiler = Compiler;
434
+ exports.precompile = precompile;
435
+ exports.compile = compile;
436
+
437
+ var _Exception = __webpack_require__(12);
438
+
439
+ var _Exception2 = _interopRequireDefault(_Exception);
440
+
441
+ var _isArray$indexOf = __webpack_require__(13);
442
+
443
+ var _AST = __webpack_require__(2);
444
+
445
+ var _AST2 = _interopRequireDefault(_AST);
446
+
447
+ var slice = [].slice;
448
+
449
+ function Compiler() {}
450
+
451
+ // the foundHelper register will disambiguate helper lookup from finding a
452
+ // function in a context. This is necessary for mustache compatibility, which
453
+ // requires that context functions in blocks are evaluated by blockHelperMissing,
454
+ // and then proceed as if the resulting value was provided to blockHelperMissing.
455
+
456
+ Compiler.prototype = {
457
+ compiler: Compiler,
458
+
459
+ equals: function equals(other) {
460
+ var len = this.opcodes.length;
461
+ if (other.opcodes.length !== len) {
462
+ return false;
463
+ }
464
+
465
+ for (var i = 0; i < len; i++) {
466
+ var opcode = this.opcodes[i],
467
+ otherOpcode = other.opcodes[i];
468
+ if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
469
+ return false;
470
+ }
471
+ }
472
+
473
+ // We know that length is the same between the two arrays because they are directly tied
474
+ // to the opcode behavior above.
475
+ len = this.children.length;
476
+ for (var i = 0; i < len; i++) {
477
+ if (!this.children[i].equals(other.children[i])) {
478
+ return false;
479
+ }
480
+ }
481
+
482
+ return true;
483
+ },
484
+
485
+ guid: 0,
486
+
487
+ compile: function compile(program, options) {
488
+ this.sourceNode = [];
489
+ this.opcodes = [];
490
+ this.children = [];
491
+ this.options = options;
492
+ this.stringParams = options.stringParams;
493
+ this.trackIds = options.trackIds;
494
+
495
+ options.blockParams = options.blockParams || [];
496
+
497
+ // These changes will propagate to the other compiler components
498
+ var knownHelpers = options.knownHelpers;
499
+ options.knownHelpers = {
500
+ helperMissing: true,
501
+ blockHelperMissing: true,
502
+ each: true,
503
+ 'if': true,
504
+ unless: true,
505
+ 'with': true,
506
+ log: true,
507
+ lookup: true
508
+ };
509
+ if (knownHelpers) {
510
+ for (var _name in knownHelpers) {
511
+ if (_name in knownHelpers) {
512
+ options.knownHelpers[_name] = knownHelpers[_name];
513
+ }
514
+ }
515
+ }
516
+
517
+ return this.accept(program);
518
+ },
519
+
520
+ compileProgram: function compileProgram(program) {
521
+ var childCompiler = new this.compiler(),
522
+ // eslint-disable-line new-cap
523
+ result = childCompiler.compile(program, this.options),
524
+ guid = this.guid++;
525
+
526
+ this.usePartial = this.usePartial || result.usePartial;
527
+
528
+ this.children[guid] = result;
529
+ this.useDepths = this.useDepths || result.useDepths;
530
+
531
+ return guid;
532
+ },
533
+
534
+ accept: function accept(node) {
535
+ this.sourceNode.unshift(node);
536
+ var ret = this[node.type](node);
537
+ this.sourceNode.shift();
538
+ return ret;
539
+ },
540
+
541
+ Program: function Program(program) {
542
+ this.options.blockParams.unshift(program.blockParams);
543
+
544
+ var body = program.body,
545
+ bodyLength = body.length;
546
+ for (var i = 0; i < bodyLength; i++) {
547
+ this.accept(body[i]);
548
+ }
549
+
550
+ this.options.blockParams.shift();
551
+
552
+ this.isSimple = bodyLength === 1;
553
+ this.blockParams = program.blockParams ? program.blockParams.length : 0;
554
+
555
+ return this;
556
+ },
557
+
558
+ BlockStatement: function BlockStatement(block) {
559
+ transformLiteralToPath(block);
560
+
561
+ var program = block.program,
562
+ inverse = block.inverse;
563
+
564
+ program = program && this.compileProgram(program);
565
+ inverse = inverse && this.compileProgram(inverse);
566
+
567
+ var type = this.classifySexpr(block);
568
+
569
+ if (type === 'helper') {
570
+ this.helperSexpr(block, program, inverse);
571
+ } else if (type === 'simple') {
572
+ this.simpleSexpr(block);
573
+
574
+ // now that the simple mustache is resolved, we need to
575
+ // evaluate it by executing `blockHelperMissing`
576
+ this.opcode('pushProgram', program);
577
+ this.opcode('pushProgram', inverse);
578
+ this.opcode('emptyHash');
579
+ this.opcode('blockValue', block.path.original);
580
+ } else {
581
+ this.ambiguousSexpr(block, program, inverse);
582
+
583
+ // now that the simple mustache is resolved, we need to
584
+ // evaluate it by executing `blockHelperMissing`
585
+ this.opcode('pushProgram', program);
586
+ this.opcode('pushProgram', inverse);
587
+ this.opcode('emptyHash');
588
+ this.opcode('ambiguousBlockValue');
589
+ }
590
+
591
+ this.opcode('append');
592
+ },
593
+
594
+ PartialStatement: function PartialStatement(partial) {
595
+ this.usePartial = true;
596
+
597
+ var params = partial.params;
598
+ if (params.length > 1) {
599
+ throw new _Exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
600
+ } else if (!params.length) {
601
+ params.push({ type: 'PathExpression', parts: [], depth: 0 });
602
+ }
603
+
604
+ var partialName = partial.name.original,
605
+ isDynamic = partial.name.type === 'SubExpression';
606
+ if (isDynamic) {
607
+ this.accept(partial.name);
608
+ }
609
+
610
+ this.setupFullMustacheParams(partial, undefined, undefined, true);
611
+
612
+ var indent = partial.indent || '';
613
+ if (this.options.preventIndent && indent) {
614
+ this.opcode('appendContent', indent);
615
+ indent = '';
616
+ }
617
+
618
+ this.opcode('invokePartial', isDynamic, partialName, indent);
619
+ this.opcode('append');
620
+ },
621
+
622
+ MustacheStatement: function MustacheStatement(mustache) {
623
+ this.SubExpression(mustache); // eslint-disable-line new-cap
624
+
625
+ if (mustache.escaped && !this.options.noEscape) {
626
+ this.opcode('appendEscaped');
627
+ } else {
628
+ this.opcode('append');
629
+ }
630
+ },
631
+
632
+ ContentStatement: function ContentStatement(content) {
633
+ if (content.value) {
634
+ this.opcode('appendContent', content.value);
635
+ }
636
+ },
637
+
638
+ CommentStatement: function CommentStatement() {},
639
+
640
+ SubExpression: function SubExpression(sexpr) {
641
+ transformLiteralToPath(sexpr);
642
+ var type = this.classifySexpr(sexpr);
643
+
644
+ if (type === 'simple') {
645
+ this.simpleSexpr(sexpr);
646
+ } else if (type === 'helper') {
647
+ this.helperSexpr(sexpr);
648
+ } else {
649
+ this.ambiguousSexpr(sexpr);
650
+ }
651
+ },
652
+ ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
653
+ var path = sexpr.path,
654
+ name = path.parts[0],
655
+ isBlock = program != null || inverse != null;
656
+
657
+ this.opcode('getContext', path.depth);
658
+
659
+ this.opcode('pushProgram', program);
660
+ this.opcode('pushProgram', inverse);
661
+
662
+ this.accept(path);
663
+
664
+ this.opcode('invokeAmbiguous', name, isBlock);
665
+ },
666
+
667
+ simpleSexpr: function simpleSexpr(sexpr) {
668
+ this.accept(sexpr.path);
669
+ this.opcode('resolvePossibleLambda');
670
+ },
671
+
672
+ helperSexpr: function helperSexpr(sexpr, program, inverse) {
673
+ var params = this.setupFullMustacheParams(sexpr, program, inverse),
674
+ path = sexpr.path,
675
+ name = path.parts[0];
676
+
677
+ if (this.options.knownHelpers[name]) {
678
+ this.opcode('invokeKnownHelper', params.length, name);
679
+ } else if (this.options.knownHelpersOnly) {
680
+ throw new _Exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
681
+ } else {
682
+ path.falsy = true;
683
+
684
+ this.accept(path);
685
+ this.opcode('invokeHelper', params.length, path.original, _AST2['default'].helpers.simpleId(path));
686
+ }
687
+ },
688
+
689
+ PathExpression: function PathExpression(path) {
690
+ this.addDepth(path.depth);
691
+ this.opcode('getContext', path.depth);
692
+
693
+ var name = path.parts[0],
694
+ scoped = _AST2['default'].helpers.scopedId(path),
695
+ blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
696
+
697
+ if (blockParamId) {
698
+ this.opcode('lookupBlockParam', blockParamId, path.parts);
699
+ } else if (!name) {
700
+ // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
701
+ this.opcode('pushContext');
702
+ } else if (path.data) {
703
+ this.options.data = true;
704
+ this.opcode('lookupData', path.depth, path.parts);
705
+ } else {
706
+ this.opcode('lookupOnContext', path.parts, path.falsy, scoped);
707
+ }
708
+ },
709
+
710
+ StringLiteral: function StringLiteral(string) {
711
+ this.opcode('pushString', string.value);
712
+ },
713
+
714
+ NumberLiteral: function NumberLiteral(number) {
715
+ this.opcode('pushLiteral', number.value);
716
+ },
717
+
718
+ BooleanLiteral: function BooleanLiteral(bool) {
719
+ this.opcode('pushLiteral', bool.value);
720
+ },
721
+
722
+ UndefinedLiteral: function UndefinedLiteral() {
723
+ this.opcode('pushLiteral', 'undefined');
724
+ },
725
+
726
+ NullLiteral: function NullLiteral() {
727
+ this.opcode('pushLiteral', 'null');
728
+ },
729
+
730
+ Hash: function Hash(hash) {
731
+ var pairs = hash.pairs,
732
+ i = 0,
733
+ l = pairs.length;
734
+
735
+ this.opcode('pushHash');
736
+
737
+ for (; i < l; i++) {
738
+ this.pushParam(pairs[i].value);
739
+ }
740
+ while (i--) {
741
+ this.opcode('assignToHash', pairs[i].key);
742
+ }
743
+ this.opcode('popHash');
744
+ },
745
+
746
+ // HELPERS
747
+ opcode: function opcode(name) {
748
+ this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc });
749
+ },
750
+
751
+ addDepth: function addDepth(depth) {
752
+ if (!depth) {
753
+ return;
754
+ }
755
+
756
+ this.useDepths = true;
757
+ },
758
+
759
+ classifySexpr: function classifySexpr(sexpr) {
760
+ var isSimple = _AST2['default'].helpers.simpleId(sexpr.path);
761
+
762
+ var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
763
+
764
+ // a mustache is an eligible helper if:
765
+ // * its id is simple (a single part, not `this` or `..`)
766
+ var isHelper = !isBlockParam && _AST2['default'].helpers.helperExpression(sexpr);
767
+
768
+ // if a mustache is an eligible helper but not a definite
769
+ // helper, it is ambiguous, and will be resolved in a later
770
+ // pass or at runtime.
771
+ var isEligible = !isBlockParam && (isHelper || isSimple);
772
+
773
+ // if ambiguous, we can possibly resolve the ambiguity now
774
+ // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
775
+ if (isEligible && !isHelper) {
776
+ var _name2 = sexpr.path.parts[0],
777
+ options = this.options;
778
+
779
+ if (options.knownHelpers[_name2]) {
780
+ isHelper = true;
781
+ } else if (options.knownHelpersOnly) {
782
+ isEligible = false;
783
+ }
784
+ }
785
+
786
+ if (isHelper) {
787
+ return 'helper';
788
+ } else if (isEligible) {
789
+ return 'ambiguous';
790
+ } else {
791
+ return 'simple';
792
+ }
793
+ },
794
+
795
+ pushParams: function pushParams(params) {
796
+ for (var i = 0, l = params.length; i < l; i++) {
797
+ this.pushParam(params[i]);
798
+ }
799
+ },
800
+
801
+ pushParam: function pushParam(val) {
802
+ var value = val.value != null ? val.value : val.original || '';
803
+
804
+ if (this.stringParams) {
805
+ if (value.replace) {
806
+ value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
807
+ }
808
+
809
+ if (val.depth) {
810
+ this.addDepth(val.depth);
811
+ }
812
+ this.opcode('getContext', val.depth || 0);
813
+ this.opcode('pushStringParam', value, val.type);
814
+
815
+ if (val.type === 'SubExpression') {
816
+ // SubExpressions get evaluated and passed in
817
+ // in string params mode.
818
+ this.accept(val);
819
+ }
820
+ } else {
821
+ if (this.trackIds) {
822
+ var blockParamIndex = undefined;
823
+ if (val.parts && !_AST2['default'].helpers.scopedId(val) && !val.depth) {
824
+ blockParamIndex = this.blockParamIndex(val.parts[0]);
825
+ }
826
+ if (blockParamIndex) {
827
+ var blockParamChild = val.parts.slice(1).join('.');
828
+ this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
829
+ } else {
830
+ value = val.original || value;
831
+ if (value.replace) {
832
+ value = value.replace(/^\.\//g, '').replace(/^\.$/g, '');
833
+ }
834
+
835
+ this.opcode('pushId', val.type, value);
836
+ }
837
+ }
838
+ this.accept(val);
839
+ }
840
+ },
841
+
842
+ setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
843
+ var params = sexpr.params;
844
+ this.pushParams(params);
845
+
846
+ this.opcode('pushProgram', program);
847
+ this.opcode('pushProgram', inverse);
848
+
849
+ if (sexpr.hash) {
850
+ this.accept(sexpr.hash);
851
+ } else {
852
+ this.opcode('emptyHash', omitEmpty);
853
+ }
854
+
855
+ return params;
856
+ },
857
+
858
+ blockParamIndex: function blockParamIndex(name) {
859
+ for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
860
+ var blockParams = this.options.blockParams[depth],
861
+ param = blockParams && _isArray$indexOf.indexOf(blockParams, name);
862
+ if (blockParams && param >= 0) {
863
+ return [depth, param];
864
+ }
865
+ }
866
+ }
867
+ };
868
+
869
+ function precompile(input, options, env) {
870
+ if (input == null || typeof input !== 'string' && input.type !== 'Program') {
871
+ throw new _Exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
872
+ }
873
+
874
+ options = options || {};
875
+ if (!('data' in options)) {
876
+ options.data = true;
877
+ }
878
+ if (options.compat) {
879
+ options.useDepths = true;
880
+ }
881
+
882
+ var ast = env.parse(input, options),
883
+ environment = new env.Compiler().compile(ast, options);
884
+ return new env.JavaScriptCompiler().compile(environment, options);
885
+ }
886
+
887
+ function compile(input, _x, env) {
888
+ var options = arguments[1] === undefined ? {} : arguments[1];
889
+
890
+ if (input == null || typeof input !== 'string' && input.type !== 'Program') {
891
+ throw new _Exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
892
+ }
893
+
894
+ if (!('data' in options)) {
895
+ options.data = true;
896
+ }
897
+ if (options.compat) {
898
+ options.useDepths = true;
899
+ }
900
+
901
+ var compiled = undefined;
902
+
903
+ function compileInput() {
904
+ var ast = env.parse(input, options),
905
+ environment = new env.Compiler().compile(ast, options),
906
+ templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
907
+ return env.template(templateSpec);
908
+ }
909
+
910
+ // Template is only compiled on first use and cached after that point.
911
+ function ret(context, execOptions) {
912
+ if (!compiled) {
913
+ compiled = compileInput();
914
+ }
915
+ return compiled.call(this, context, execOptions);
916
+ }
917
+ ret._setup = function (setupOptions) {
918
+ if (!compiled) {
919
+ compiled = compileInput();
920
+ }
921
+ return compiled._setup(setupOptions);
922
+ };
923
+ ret._child = function (i, data, blockParams, depths) {
924
+ if (!compiled) {
925
+ compiled = compileInput();
926
+ }
927
+ return compiled._child(i, data, blockParams, depths);
928
+ };
929
+ return ret;
930
+ }
931
+
932
+ function argEquals(a, b) {
933
+ if (a === b) {
934
+ return true;
935
+ }
936
+
937
+ if (_isArray$indexOf.isArray(a) && _isArray$indexOf.isArray(b) && a.length === b.length) {
938
+ for (var i = 0; i < a.length; i++) {
939
+ if (!argEquals(a[i], b[i])) {
940
+ return false;
941
+ }
942
+ }
943
+ return true;
944
+ }
945
+ }
946
+
947
+ function transformLiteralToPath(sexpr) {
948
+ if (!sexpr.path.parts) {
949
+ var literal = sexpr.path;
950
+ // Casting to string here to make false and 0 literal values play nicely with the rest
951
+ // of the system.
952
+ sexpr.path = new _AST2['default'].PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc);
953
+ }
954
+ }
955
+
956
+ /***/ },
957
+ /* 5 */
958
+ /***/ function(module, exports, __webpack_require__) {
959
+
960
+ 'use strict';
961
+
962
+ var _interopRequireDefault = __webpack_require__(8)['default'];
963
+
964
+ exports.__esModule = true;
965
+
966
+ var _COMPILER_REVISION$REVISION_CHANGES = __webpack_require__(10);
967
+
968
+ var _Exception = __webpack_require__(12);
969
+
970
+ var _Exception2 = _interopRequireDefault(_Exception);
971
+
972
+ var _isArray = __webpack_require__(13);
973
+
974
+ var _CodeGen = __webpack_require__(18);
975
+
976
+ var _CodeGen2 = _interopRequireDefault(_CodeGen);
977
+
978
+ function Literal(value) {
979
+ this.value = value;
980
+ }
981
+
982
+ function JavaScriptCompiler() {}
983
+
984
+ JavaScriptCompiler.prototype = {
985
+ // PUBLIC API: You can override these methods in a subclass to provide
986
+ // alternative compiled forms for name lookup and buffering semantics
987
+ nameLookup: function nameLookup(parent, name /* , type*/) {
988
+ if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
989
+ return [parent, '.', name];
990
+ } else {
991
+ return [parent, '[\'', name, '\']'];
992
+ }
993
+ },
994
+ depthedLookup: function depthedLookup(name) {
995
+ return [this.aliasable('this.lookup'), '(depths, "', name, '")'];
996
+ },
997
+
998
+ compilerInfo: function compilerInfo() {
999
+ var revision = _COMPILER_REVISION$REVISION_CHANGES.COMPILER_REVISION,
1000
+ versions = _COMPILER_REVISION$REVISION_CHANGES.REVISION_CHANGES[revision];
1001
+ return [revision, versions];
1002
+ },
1003
+
1004
+ appendToBuffer: function appendToBuffer(source, location, explicit) {
1005
+ // Force a source as this simplifies the merge logic.
1006
+ if (!_isArray.isArray(source)) {
1007
+ source = [source];
1008
+ }
1009
+ source = this.source.wrap(source, location);
1010
+
1011
+ if (this.environment.isSimple) {
1012
+ return ['return ', source, ';'];
1013
+ } else if (explicit) {
1014
+ // This is a case where the buffer operation occurs as a child of another
1015
+ // construct, generally braces. We have to explicitly output these buffer
1016
+ // operations to ensure that the emitted code goes in the correct location.
1017
+ return ['buffer += ', source, ';'];
1018
+ } else {
1019
+ source.appendToBuffer = true;
1020
+ return source;
1021
+ }
1022
+ },
1023
+
1024
+ initializeBuffer: function initializeBuffer() {
1025
+ return this.quotedString('');
1026
+ },
1027
+ // END PUBLIC API
1028
+
1029
+ compile: function compile(environment, options, context, asObject) {
1030
+ this.environment = environment;
1031
+ this.options = options;
1032
+ this.stringParams = this.options.stringParams;
1033
+ this.trackIds = this.options.trackIds;
1034
+ this.precompile = !asObject;
1035
+
1036
+ this.name = this.environment.name;
1037
+ this.isChild = !!context;
1038
+ this.context = context || {
1039
+ programs: [],
1040
+ environments: []
1041
+ };
1042
+
1043
+ this.preamble();
1044
+
1045
+ this.stackSlot = 0;
1046
+ this.stackVars = [];
1047
+ this.aliases = {};
1048
+ this.registers = { list: [] };
1049
+ this.hashes = [];
1050
+ this.compileStack = [];
1051
+ this.inlineStack = [];
1052
+ this.blockParams = [];
1053
+
1054
+ this.compileChildren(environment, options);
1055
+
1056
+ this.useDepths = this.useDepths || environment.useDepths || this.options.compat;
1057
+ this.useBlockParams = this.useBlockParams || environment.useBlockParams;
1058
+
1059
+ var opcodes = environment.opcodes,
1060
+ opcode = undefined,
1061
+ firstLoc = undefined,
1062
+ i = undefined,
1063
+ l = undefined;
1064
+
1065
+ for (i = 0, l = opcodes.length; i < l; i++) {
1066
+ opcode = opcodes[i];
1067
+
1068
+ this.source.currentLocation = opcode.loc;
1069
+ firstLoc = firstLoc || opcode.loc;
1070
+ this[opcode.opcode].apply(this, opcode.args);
1071
+ }
1072
+
1073
+ // Flush any trailing content that might be pending.
1074
+ this.source.currentLocation = firstLoc;
1075
+ this.pushSource('');
1076
+
1077
+ /* istanbul ignore next */
1078
+ if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
1079
+ throw new _Exception2['default']('Compile completed with content left on stack');
1080
+ }
1081
+
1082
+ var fn = this.createFunctionContext(asObject);
1083
+ if (!this.isChild) {
1084
+ var ret = {
1085
+ compiler: this.compilerInfo(),
1086
+ main: fn
1087
+ };
1088
+ var programs = this.context.programs;
1089
+ for (i = 0, l = programs.length; i < l; i++) {
1090
+ if (programs[i]) {
1091
+ ret[i] = programs[i];
1092
+ }
1093
+ }
1094
+
1095
+ if (this.environment.usePartial) {
1096
+ ret.usePartial = true;
1097
+ }
1098
+ if (this.options.data) {
1099
+ ret.useData = true;
1100
+ }
1101
+ if (this.useDepths) {
1102
+ ret.useDepths = true;
1103
+ }
1104
+ if (this.useBlockParams) {
1105
+ ret.useBlockParams = true;
1106
+ }
1107
+ if (this.options.compat) {
1108
+ ret.compat = true;
1109
+ }
1110
+
1111
+ if (!asObject) {
1112
+ ret.compiler = JSON.stringify(ret.compiler);
1113
+
1114
+ this.source.currentLocation = { start: { line: 1, column: 0 } };
1115
+ ret = this.objectLiteral(ret);
1116
+
1117
+ if (options.srcName) {
1118
+ ret = ret.toStringWithSourceMap({ file: options.destName });
1119
+ ret.map = ret.map && ret.map.toString();
1120
+ } else {
1121
+ ret = ret.toString();
1122
+ }
1123
+ } else {
1124
+ ret.compilerOptions = this.options;
1125
+ }
1126
+
1127
+ return ret;
1128
+ } else {
1129
+ return fn;
1130
+ }
1131
+ },
1132
+
1133
+ preamble: function preamble() {
1134
+ // track the last context pushed into place to allow skipping the
1135
+ // getContext opcode when it would be a noop
1136
+ this.lastContext = 0;
1137
+ this.source = new _CodeGen2['default'](this.options.srcName);
1138
+ },
1139
+
1140
+ createFunctionContext: function createFunctionContext(asObject) {
1141
+ var varDeclarations = '';
1142
+
1143
+ var locals = this.stackVars.concat(this.registers.list);
1144
+ if (locals.length > 0) {
1145
+ varDeclarations += ', ' + locals.join(', ');
1146
+ }
1147
+
1148
+ // Generate minimizer alias mappings
1149
+ //
1150
+ // When using true SourceNodes, this will update all references to the given alias
1151
+ // as the source nodes are reused in situ. For the non-source node compilation mode,
1152
+ // aliases will not be used, but this case is already being run on the client and
1153
+ // we aren't concern about minimizing the template size.
1154
+ var aliasCount = 0;
1155
+ for (var alias in this.aliases) {
1156
+ // eslint-disable-line guard-for-in
1157
+ var node = this.aliases[alias];
1158
+
1159
+ if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) {
1160
+ varDeclarations += ', alias' + ++aliasCount + '=' + alias;
1161
+ node.children[0] = 'alias' + aliasCount;
1162
+ }
1163
+ }
1164
+
1165
+ var params = ['depth0', 'helpers', 'partials', 'data'];
1166
+
1167
+ if (this.useBlockParams || this.useDepths) {
1168
+ params.push('blockParams');
1169
+ }
1170
+ if (this.useDepths) {
1171
+ params.push('depths');
1172
+ }
1173
+
1174
+ // Perform a second pass over the output to merge content when possible
1175
+ var source = this.mergeSource(varDeclarations);
1176
+
1177
+ if (asObject) {
1178
+ params.push(source);
1179
+
1180
+ return Function.apply(this, params);
1181
+ } else {
1182
+ return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
1183
+ }
1184
+ },
1185
+ mergeSource: function mergeSource(varDeclarations) {
1186
+ var isSimple = this.environment.isSimple,
1187
+ appendOnly = !this.forceBuffer,
1188
+ appendFirst = undefined,
1189
+ sourceSeen = undefined,
1190
+ bufferStart = undefined,
1191
+ bufferEnd = undefined;
1192
+ this.source.each(function (line) {
1193
+ if (line.appendToBuffer) {
1194
+ if (bufferStart) {
1195
+ line.prepend(' + ');
1196
+ } else {
1197
+ bufferStart = line;
1198
+ }
1199
+ bufferEnd = line;
1200
+ } else {
1201
+ if (bufferStart) {
1202
+ if (!sourceSeen) {
1203
+ appendFirst = true;
1204
+ } else {
1205
+ bufferStart.prepend('buffer += ');
1206
+ }
1207
+ bufferEnd.add(';');
1208
+ bufferStart = bufferEnd = undefined;
1209
+ }
1210
+
1211
+ sourceSeen = true;
1212
+ if (!isSimple) {
1213
+ appendOnly = false;
1214
+ }
1215
+ }
1216
+ });
1217
+
1218
+ if (appendOnly) {
1219
+ if (bufferStart) {
1220
+ bufferStart.prepend('return ');
1221
+ bufferEnd.add(';');
1222
+ } else if (!sourceSeen) {
1223
+ this.source.push('return "";');
1224
+ }
1225
+ } else {
1226
+ varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
1227
+
1228
+ if (bufferStart) {
1229
+ bufferStart.prepend('return buffer + ');
1230
+ bufferEnd.add(';');
1231
+ } else {
1232
+ this.source.push('return buffer;');
1233
+ }
1234
+ }
1235
+
1236
+ if (varDeclarations) {
1237
+ this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
1238
+ }
1239
+
1240
+ return this.source.merge();
1241
+ },
1242
+
1243
+ // [blockValue]
1244
+ //
1245
+ // On stack, before: hash, inverse, program, value
1246
+ // On stack, after: return value of blockHelperMissing
1247
+ //
1248
+ // The purpose of this opcode is to take a block of the form
1249
+ // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
1250
+ // replace it on the stack with the result of properly
1251
+ // invoking blockHelperMissing.
1252
+ blockValue: function blockValue(name) {
1253
+ var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
1254
+ params = [this.contextName(0)];
1255
+ this.setupHelperArgs(name, 0, params);
1256
+
1257
+ var blockName = this.popStack();
1258
+ params.splice(1, 0, blockName);
1259
+
1260
+ this.push(this.source.functionCall(blockHelperMissing, 'call', params));
1261
+ },
1262
+
1263
+ // [ambiguousBlockValue]
1264
+ //
1265
+ // On stack, before: hash, inverse, program, value
1266
+ // Compiler value, before: lastHelper=value of last found helper, if any
1267
+ // On stack, after, if no lastHelper: same as [blockValue]
1268
+ // On stack, after, if lastHelper: value
1269
+ ambiguousBlockValue: function ambiguousBlockValue() {
1270
+ // We're being a bit cheeky and reusing the options value from the prior exec
1271
+ var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
1272
+ params = [this.contextName(0)];
1273
+ this.setupHelperArgs('', 0, params, true);
1274
+
1275
+ this.flushInline();
1276
+
1277
+ var current = this.topStack();
1278
+ params.splice(1, 0, current);
1279
+
1280
+ this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
1281
+ },
1282
+
1283
+ // [appendContent]
1284
+ //
1285
+ // On stack, before: ...
1286
+ // On stack, after: ...
1287
+ //
1288
+ // Appends the string value of `content` to the current buffer
1289
+ appendContent: function appendContent(content) {
1290
+ if (this.pendingContent) {
1291
+ content = this.pendingContent + content;
1292
+ } else {
1293
+ this.pendingLocation = this.source.currentLocation;
1294
+ }
1295
+
1296
+ this.pendingContent = content;
1297
+ },
1298
+
1299
+ // [append]
1300
+ //
1301
+ // On stack, before: value, ...
1302
+ // On stack, after: ...
1303
+ //
1304
+ // Coerces `value` to a String and appends it to the current buffer.
1305
+ //
1306
+ // If `value` is truthy, or 0, it is coerced into a string and appended
1307
+ // Otherwise, the empty string is appended
1308
+ append: function append() {
1309
+ if (this.isInline()) {
1310
+ this.replaceStack(function (current) {
1311
+ return [' != null ? ', current, ' : ""'];
1312
+ });
1313
+
1314
+ this.pushSource(this.appendToBuffer(this.popStack()));
1315
+ } else {
1316
+ var local = this.popStack();
1317
+ this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
1318
+ if (this.environment.isSimple) {
1319
+ this.pushSource(['else { ', this.appendToBuffer('\'\'', undefined, true), ' }']);
1320
+ }
1321
+ }
1322
+ },
1323
+
1324
+ // [appendEscaped]
1325
+ //
1326
+ // On stack, before: value, ...
1327
+ // On stack, after: ...
1328
+ //
1329
+ // Escape `value` and append it to the buffer
1330
+ appendEscaped: function appendEscaped() {
1331
+ this.pushSource(this.appendToBuffer([this.aliasable('this.escapeExpression'), '(', this.popStack(), ')']));
1332
+ },
1333
+
1334
+ // [getContext]
1335
+ //
1336
+ // On stack, before: ...
1337
+ // On stack, after: ...
1338
+ // Compiler value, after: lastContext=depth
1339
+ //
1340
+ // Set the value of the `lastContext` compiler value to the depth
1341
+ getContext: function getContext(depth) {
1342
+ this.lastContext = depth;
1343
+ },
1344
+
1345
+ // [pushContext]
1346
+ //
1347
+ // On stack, before: ...
1348
+ // On stack, after: currentContext, ...
1349
+ //
1350
+ // Pushes the value of the current context onto the stack.
1351
+ pushContext: function pushContext() {
1352
+ this.pushStackLiteral(this.contextName(this.lastContext));
1353
+ },
1354
+
1355
+ // [lookupOnContext]
1356
+ //
1357
+ // On stack, before: ...
1358
+ // On stack, after: currentContext[name], ...
1359
+ //
1360
+ // Looks up the value of `name` on the current context and pushes
1361
+ // it onto the stack.
1362
+ lookupOnContext: function lookupOnContext(parts, falsy, scoped) {
1363
+ var i = 0;
1364
+
1365
+ if (!scoped && this.options.compat && !this.lastContext) {
1366
+ // The depthed query is expected to handle the undefined logic for the root level that
1367
+ // is implemented below, so we evaluate that directly in compat mode
1368
+ this.push(this.depthedLookup(parts[i++]));
1369
+ } else {
1370
+ this.pushContext();
1371
+ }
1372
+
1373
+ this.resolvePath('context', parts, i, falsy);
1374
+ },
1375
+
1376
+ // [lookupBlockParam]
1377
+ //
1378
+ // On stack, before: ...
1379
+ // On stack, after: blockParam[name], ...
1380
+ //
1381
+ // Looks up the value of `parts` on the given block param and pushes
1382
+ // it onto the stack.
1383
+ lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
1384
+ this.useBlockParams = true;
1385
+
1386
+ this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
1387
+ this.resolvePath('context', parts, 1);
1388
+ },
1389
+
1390
+ // [lookupData]
1391
+ //
1392
+ // On stack, before: ...
1393
+ // On stack, after: data, ...
1394
+ //
1395
+ // Push the data lookup operator
1396
+ lookupData: function lookupData(depth, parts) {
1397
+ if (!depth) {
1398
+ this.pushStackLiteral('data');
1399
+ } else {
1400
+ this.pushStackLiteral('this.data(data, ' + depth + ')');
1401
+ }
1402
+
1403
+ this.resolvePath('data', parts, 0, true);
1404
+ },
1405
+
1406
+ resolvePath: function resolvePath(type, parts, i, falsy) {
1407
+ var _this = this;
1408
+
1409
+ if (this.options.strict || this.options.assumeObjects) {
1410
+ this.push(strictLookup(this.options.strict, this, parts, type));
1411
+ return;
1412
+ }
1413
+
1414
+ var len = parts.length;
1415
+ for (; i < len; i++) {
1416
+ /*eslint-disable no-loop-func */
1417
+ this.replaceStack(function (current) {
1418
+ var lookup = _this.nameLookup(current, parts[i], type);
1419
+ // We want to ensure that zero and false are handled properly if the context (falsy flag)
1420
+ // needs to have the special handling for these values.
1421
+ if (!falsy) {
1422
+ return [' != null ? ', lookup, ' : ', current];
1423
+ } else {
1424
+ // Otherwise we can use generic falsy handling
1425
+ return [' && ', lookup];
1426
+ }
1427
+ });
1428
+ /*eslint-enable no-loop-func */
1429
+ }
1430
+ },
1431
+
1432
+ // [resolvePossibleLambda]
1433
+ //
1434
+ // On stack, before: value, ...
1435
+ // On stack, after: resolved value, ...
1436
+ //
1437
+ // If the `value` is a lambda, replace it on the stack by
1438
+ // the return value of the lambda
1439
+ resolvePossibleLambda: function resolvePossibleLambda() {
1440
+ this.push([this.aliasable('this.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
1441
+ },
1442
+
1443
+ // [pushStringParam]
1444
+ //
1445
+ // On stack, before: ...
1446
+ // On stack, after: string, currentContext, ...
1447
+ //
1448
+ // This opcode is designed for use in string mode, which
1449
+ // provides the string value of a parameter along with its
1450
+ // depth rather than resolving it immediately.
1451
+ pushStringParam: function pushStringParam(string, type) {
1452
+ this.pushContext();
1453
+ this.pushString(type);
1454
+
1455
+ // If it's a subexpression, the string result
1456
+ // will be pushed after this opcode.
1457
+ if (type !== 'SubExpression') {
1458
+ if (typeof string === 'string') {
1459
+ this.pushString(string);
1460
+ } else {
1461
+ this.pushStackLiteral(string);
1462
+ }
1463
+ }
1464
+ },
1465
+
1466
+ emptyHash: function emptyHash(omitEmpty) {
1467
+ if (this.trackIds) {
1468
+ this.push('{}'); // hashIds
1469
+ }
1470
+ if (this.stringParams) {
1471
+ this.push('{}'); // hashContexts
1472
+ this.push('{}'); // hashTypes
1473
+ }
1474
+ this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
1475
+ },
1476
+ pushHash: function pushHash() {
1477
+ if (this.hash) {
1478
+ this.hashes.push(this.hash);
1479
+ }
1480
+ this.hash = { values: [], types: [], contexts: [], ids: [] };
1481
+ },
1482
+ popHash: function popHash() {
1483
+ var hash = this.hash;
1484
+ this.hash = this.hashes.pop();
1485
+
1486
+ if (this.trackIds) {
1487
+ this.push(this.objectLiteral(hash.ids));
1488
+ }
1489
+ if (this.stringParams) {
1490
+ this.push(this.objectLiteral(hash.contexts));
1491
+ this.push(this.objectLiteral(hash.types));
1492
+ }
1493
+
1494
+ this.push(this.objectLiteral(hash.values));
1495
+ },
1496
+
1497
+ // [pushString]
1498
+ //
1499
+ // On stack, before: ...
1500
+ // On stack, after: quotedString(string), ...
1501
+ //
1502
+ // Push a quoted version of `string` onto the stack
1503
+ pushString: function pushString(string) {
1504
+ this.pushStackLiteral(this.quotedString(string));
1505
+ },
1506
+
1507
+ // [pushLiteral]
1508
+ //
1509
+ // On stack, before: ...
1510
+ // On stack, after: value, ...
1511
+ //
1512
+ // Pushes a value onto the stack. This operation prevents
1513
+ // the compiler from creating a temporary variable to hold
1514
+ // it.
1515
+ pushLiteral: function pushLiteral(value) {
1516
+ this.pushStackLiteral(value);
1517
+ },
1518
+
1519
+ // [pushProgram]
1520
+ //
1521
+ // On stack, before: ...
1522
+ // On stack, after: program(guid), ...
1523
+ //
1524
+ // Push a program expression onto the stack. This takes
1525
+ // a compile-time guid and converts it into a runtime-accessible
1526
+ // expression.
1527
+ pushProgram: function pushProgram(guid) {
1528
+ if (guid != null) {
1529
+ this.pushStackLiteral(this.programExpression(guid));
1530
+ } else {
1531
+ this.pushStackLiteral(null);
1532
+ }
1533
+ },
1534
+
1535
+ // [invokeHelper]
1536
+ //
1537
+ // On stack, before: hash, inverse, program, params..., ...
1538
+ // On stack, after: result of helper invocation
1539
+ //
1540
+ // Pops off the helper's parameters, invokes the helper,
1541
+ // and pushes the helper's return value onto the stack.
1542
+ //
1543
+ // If the helper is not found, `helperMissing` is called.
1544
+ invokeHelper: function invokeHelper(paramSize, name, isSimple) {
1545
+ var nonHelper = this.popStack(),
1546
+ helper = this.setupHelper(paramSize, name),
1547
+ simple = isSimple ? [helper.name, ' || '] : '';
1548
+
1549
+ var lookup = ['('].concat(simple, nonHelper);
1550
+ if (!this.options.strict) {
1551
+ lookup.push(' || ', this.aliasable('helpers.helperMissing'));
1552
+ }
1553
+ lookup.push(')');
1554
+
1555
+ this.push(this.source.functionCall(lookup, 'call', helper.callParams));
1556
+ },
1557
+
1558
+ // [invokeKnownHelper]
1559
+ //
1560
+ // On stack, before: hash, inverse, program, params..., ...
1561
+ // On stack, after: result of helper invocation
1562
+ //
1563
+ // This operation is used when the helper is known to exist,
1564
+ // so a `helperMissing` fallback is not required.
1565
+ invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
1566
+ var helper = this.setupHelper(paramSize, name);
1567
+ this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
1568
+ },
1569
+
1570
+ // [invokeAmbiguous]
1571
+ //
1572
+ // On stack, before: hash, inverse, program, params..., ...
1573
+ // On stack, after: result of disambiguation
1574
+ //
1575
+ // This operation is used when an expression like `{{foo}}`
1576
+ // is provided, but we don't know at compile-time whether it
1577
+ // is a helper or a path.
1578
+ //
1579
+ // This operation emits more code than the other options,
1580
+ // and can be avoided by passing the `knownHelpers` and
1581
+ // `knownHelpersOnly` flags at compile-time.
1582
+ invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
1583
+ this.useRegister('helper');
1584
+
1585
+ var nonHelper = this.popStack();
1586
+
1587
+ this.emptyHash();
1588
+ var helper = this.setupHelper(0, name, helperCall);
1589
+
1590
+ var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
1591
+
1592
+ var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
1593
+ if (!this.options.strict) {
1594
+ lookup[0] = '(helper = ';
1595
+ lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing'));
1596
+ }
1597
+
1598
+ this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
1599
+ },
1600
+
1601
+ // [invokePartial]
1602
+ //
1603
+ // On stack, before: context, ...
1604
+ // On stack after: result of partial invocation
1605
+ //
1606
+ // This operation pops off a context, invokes a partial with that context,
1607
+ // and pushes the result of the invocation back.
1608
+ invokePartial: function invokePartial(isDynamic, name, indent) {
1609
+ var params = [],
1610
+ options = this.setupParams(name, 1, params, false);
1611
+
1612
+ if (isDynamic) {
1613
+ name = this.popStack();
1614
+ delete options.name;
1615
+ }
1616
+
1617
+ if (indent) {
1618
+ options.indent = JSON.stringify(indent);
1619
+ }
1620
+ options.helpers = 'helpers';
1621
+ options.partials = 'partials';
1622
+
1623
+ if (!isDynamic) {
1624
+ params.unshift(this.nameLookup('partials', name, 'partial'));
1625
+ } else {
1626
+ params.unshift(name);
1627
+ }
1628
+
1629
+ if (this.options.compat) {
1630
+ options.depths = 'depths';
1631
+ }
1632
+ options = this.objectLiteral(options);
1633
+ params.push(options);
1634
+
1635
+ this.push(this.source.functionCall('this.invokePartial', '', params));
1636
+ },
1637
+
1638
+ // [assignToHash]
1639
+ //
1640
+ // On stack, before: value, ..., hash, ...
1641
+ // On stack, after: ..., hash, ...
1642
+ //
1643
+ // Pops a value off the stack and assigns it to the current hash
1644
+ assignToHash: function assignToHash(key) {
1645
+ var value = this.popStack(),
1646
+ context = undefined,
1647
+ type = undefined,
1648
+ id = undefined;
1649
+
1650
+ if (this.trackIds) {
1651
+ id = this.popStack();
1652
+ }
1653
+ if (this.stringParams) {
1654
+ type = this.popStack();
1655
+ context = this.popStack();
1656
+ }
1657
+
1658
+ var hash = this.hash;
1659
+ if (context) {
1660
+ hash.contexts[key] = context;
1661
+ }
1662
+ if (type) {
1663
+ hash.types[key] = type;
1664
+ }
1665
+ if (id) {
1666
+ hash.ids[key] = id;
1667
+ }
1668
+ hash.values[key] = value;
1669
+ },
1670
+
1671
+ pushId: function pushId(type, name, child) {
1672
+ if (type === 'BlockParam') {
1673
+ this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
1674
+ } else if (type === 'PathExpression') {
1675
+ this.pushString(name);
1676
+ } else if (type === 'SubExpression') {
1677
+ this.pushStackLiteral('true');
1678
+ } else {
1679
+ this.pushStackLiteral('null');
1680
+ }
1681
+ },
1682
+
1683
+ // HELPERS
1684
+
1685
+ compiler: JavaScriptCompiler,
1686
+
1687
+ compileChildren: function compileChildren(environment, options) {
1688
+ var children = environment.children,
1689
+ child = undefined,
1690
+ compiler = undefined;
1691
+
1692
+ for (var i = 0, l = children.length; i < l; i++) {
1693
+ child = children[i];
1694
+ compiler = new this.compiler(); // eslint-disable-line new-cap
1695
+
1696
+ var index = this.matchExistingProgram(child);
1697
+
1698
+ if (index == null) {
1699
+ this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
1700
+ index = this.context.programs.length;
1701
+ child.index = index;
1702
+ child.name = 'program' + index;
1703
+ this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
1704
+ this.context.environments[index] = child;
1705
+
1706
+ this.useDepths = this.useDepths || compiler.useDepths;
1707
+ this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
1708
+ } else {
1709
+ child.index = index;
1710
+ child.name = 'program' + index;
1711
+
1712
+ this.useDepths = this.useDepths || child.useDepths;
1713
+ this.useBlockParams = this.useBlockParams || child.useBlockParams;
1714
+ }
1715
+ }
1716
+ },
1717
+ matchExistingProgram: function matchExistingProgram(child) {
1718
+ for (var i = 0, len = this.context.environments.length; i < len; i++) {
1719
+ var environment = this.context.environments[i];
1720
+ if (environment && environment.equals(child)) {
1721
+ return i;
1722
+ }
1723
+ }
1724
+ },
1725
+
1726
+ programExpression: function programExpression(guid) {
1727
+ var child = this.environment.children[guid],
1728
+ programParams = [child.index, 'data', child.blockParams];
1729
+
1730
+ if (this.useBlockParams || this.useDepths) {
1731
+ programParams.push('blockParams');
1732
+ }
1733
+ if (this.useDepths) {
1734
+ programParams.push('depths');
1735
+ }
1736
+
1737
+ return 'this.program(' + programParams.join(', ') + ')';
1738
+ },
1739
+
1740
+ useRegister: function useRegister(name) {
1741
+ if (!this.registers[name]) {
1742
+ this.registers[name] = true;
1743
+ this.registers.list.push(name);
1744
+ }
1745
+ },
1746
+
1747
+ push: function push(expr) {
1748
+ if (!(expr instanceof Literal)) {
1749
+ expr = this.source.wrap(expr);
1750
+ }
1751
+
1752
+ this.inlineStack.push(expr);
1753
+ return expr;
1754
+ },
1755
+
1756
+ pushStackLiteral: function pushStackLiteral(item) {
1757
+ this.push(new Literal(item));
1758
+ },
1759
+
1760
+ pushSource: function pushSource(source) {
1761
+ if (this.pendingContent) {
1762
+ this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
1763
+ this.pendingContent = undefined;
1764
+ }
1765
+
1766
+ if (source) {
1767
+ this.source.push(source);
1768
+ }
1769
+ },
1770
+
1771
+ replaceStack: function replaceStack(callback) {
1772
+ var prefix = ['('],
1773
+ stack = undefined,
1774
+ createdStack = undefined,
1775
+ usedLiteral = undefined;
1776
+
1777
+ /* istanbul ignore next */
1778
+ if (!this.isInline()) {
1779
+ throw new _Exception2['default']('replaceStack on non-inline');
1780
+ }
1781
+
1782
+ // We want to merge the inline statement into the replacement statement via ','
1783
+ var top = this.popStack(true);
1784
+
1785
+ if (top instanceof Literal) {
1786
+ // Literals do not need to be inlined
1787
+ stack = [top.value];
1788
+ prefix = ['(', stack];
1789
+ usedLiteral = true;
1790
+ } else {
1791
+ // Get or create the current stack name for use by the inline
1792
+ createdStack = true;
1793
+ var _name = this.incrStack();
1794
+
1795
+ prefix = ['((', this.push(_name), ' = ', top, ')'];
1796
+ stack = this.topStack();
1797
+ }
1798
+
1799
+ var item = callback.call(this, stack);
1800
+
1801
+ if (!usedLiteral) {
1802
+ this.popStack();
1803
+ }
1804
+ if (createdStack) {
1805
+ this.stackSlot--;
1806
+ }
1807
+ this.push(prefix.concat(item, ')'));
1808
+ },
1809
+
1810
+ incrStack: function incrStack() {
1811
+ this.stackSlot++;
1812
+ if (this.stackSlot > this.stackVars.length) {
1813
+ this.stackVars.push('stack' + this.stackSlot);
1814
+ }
1815
+ return this.topStackName();
1816
+ },
1817
+ topStackName: function topStackName() {
1818
+ return 'stack' + this.stackSlot;
1819
+ },
1820
+ flushInline: function flushInline() {
1821
+ var inlineStack = this.inlineStack;
1822
+ this.inlineStack = [];
1823
+ for (var i = 0, len = inlineStack.length; i < len; i++) {
1824
+ var entry = inlineStack[i];
1825
+ /* istanbul ignore if */
1826
+ if (entry instanceof Literal) {
1827
+ this.compileStack.push(entry);
1828
+ } else {
1829
+ var stack = this.incrStack();
1830
+ this.pushSource([stack, ' = ', entry, ';']);
1831
+ this.compileStack.push(stack);
1832
+ }
1833
+ }
1834
+ },
1835
+ isInline: function isInline() {
1836
+ return this.inlineStack.length;
1837
+ },
1838
+
1839
+ popStack: function popStack(wrapped) {
1840
+ var inline = this.isInline(),
1841
+ item = (inline ? this.inlineStack : this.compileStack).pop();
1842
+
1843
+ if (!wrapped && item instanceof Literal) {
1844
+ return item.value;
1845
+ } else {
1846
+ if (!inline) {
1847
+ /* istanbul ignore next */
1848
+ if (!this.stackSlot) {
1849
+ throw new _Exception2['default']('Invalid stack pop');
1850
+ }
1851
+ this.stackSlot--;
1852
+ }
1853
+ return item;
1854
+ }
1855
+ },
1856
+
1857
+ topStack: function topStack() {
1858
+ var stack = this.isInline() ? this.inlineStack : this.compileStack,
1859
+ item = stack[stack.length - 1];
1860
+
1861
+ /* istanbul ignore if */
1862
+ if (item instanceof Literal) {
1863
+ return item.value;
1864
+ } else {
1865
+ return item;
1866
+ }
1867
+ },
1868
+
1869
+ contextName: function contextName(context) {
1870
+ if (this.useDepths && context) {
1871
+ return 'depths[' + context + ']';
1872
+ } else {
1873
+ return 'depth' + context;
1874
+ }
1875
+ },
1876
+
1877
+ quotedString: function quotedString(str) {
1878
+ return this.source.quotedString(str);
1879
+ },
1880
+
1881
+ objectLiteral: function objectLiteral(obj) {
1882
+ return this.source.objectLiteral(obj);
1883
+ },
1884
+
1885
+ aliasable: function aliasable(name) {
1886
+ var ret = this.aliases[name];
1887
+ if (ret) {
1888
+ ret.referenceCount++;
1889
+ return ret;
1890
+ }
1891
+
1892
+ ret = this.aliases[name] = this.source.wrap(name);
1893
+ ret.aliasable = true;
1894
+ ret.referenceCount = 1;
1895
+
1896
+ return ret;
1897
+ },
1898
+
1899
+ setupHelper: function setupHelper(paramSize, name, blockHelper) {
1900
+ var params = [],
1901
+ paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
1902
+ var foundHelper = this.nameLookup('helpers', name, 'helper');
1903
+
1904
+ return {
1905
+ params: params,
1906
+ paramsInit: paramsInit,
1907
+ name: foundHelper,
1908
+ callParams: [this.contextName(0)].concat(params)
1909
+ };
1910
+ },
1911
+
1912
+ setupParams: function setupParams(helper, paramSize, params) {
1913
+ var options = {},
1914
+ contexts = [],
1915
+ types = [],
1916
+ ids = [],
1917
+ param = undefined;
1918
+
1919
+ options.name = this.quotedString(helper);
1920
+ options.hash = this.popStack();
1921
+
1922
+ if (this.trackIds) {
1923
+ options.hashIds = this.popStack();
1924
+ }
1925
+ if (this.stringParams) {
1926
+ options.hashTypes = this.popStack();
1927
+ options.hashContexts = this.popStack();
1928
+ }
1929
+
1930
+ var inverse = this.popStack(),
1931
+ program = this.popStack();
1932
+
1933
+ // Avoid setting fn and inverse if neither are set. This allows
1934
+ // helpers to do a check for `if (options.fn)`
1935
+ if (program || inverse) {
1936
+ options.fn = program || 'this.noop';
1937
+ options.inverse = inverse || 'this.noop';
1938
+ }
1939
+
1940
+ // The parameters go on to the stack in order (making sure that they are evaluated in order)
1941
+ // so we need to pop them off the stack in reverse order
1942
+ var i = paramSize;
1943
+ while (i--) {
1944
+ param = this.popStack();
1945
+ params[i] = param;
1946
+
1947
+ if (this.trackIds) {
1948
+ ids[i] = this.popStack();
1949
+ }
1950
+ if (this.stringParams) {
1951
+ types[i] = this.popStack();
1952
+ contexts[i] = this.popStack();
1953
+ }
1954
+ }
1955
+
1956
+ if (this.trackIds) {
1957
+ options.ids = this.source.generateArray(ids);
1958
+ }
1959
+ if (this.stringParams) {
1960
+ options.types = this.source.generateArray(types);
1961
+ options.contexts = this.source.generateArray(contexts);
1962
+ }
1963
+
1964
+ if (this.options.data) {
1965
+ options.data = 'data';
1966
+ }
1967
+ if (this.useBlockParams) {
1968
+ options.blockParams = 'blockParams';
1969
+ }
1970
+ return options;
1971
+ },
1972
+
1973
+ setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
1974
+ var options = this.setupParams(helper, paramSize, params, true);
1975
+ options = this.objectLiteral(options);
1976
+ if (useRegister) {
1977
+ this.useRegister('options');
1978
+ params.push('options');
1979
+ return ['options=', options];
1980
+ } else {
1981
+ params.push(options);
1982
+ return '';
1983
+ }
1984
+ }
1985
+ };
1986
+
1987
+ (function () {
1988
+ var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' ');
1989
+
1990
+ var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
1991
+
1992
+ for (var i = 0, l = reservedWords.length; i < l; i++) {
1993
+ compilerWords[reservedWords[i]] = true;
1994
+ }
1995
+ })();
1996
+
1997
+ JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
1998
+ return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
1999
+ };
2000
+
2001
+ function strictLookup(requireTerminal, compiler, parts, type) {
2002
+ var stack = compiler.popStack(),
2003
+ i = 0,
2004
+ len = parts.length;
2005
+ if (requireTerminal) {
2006
+ len--;
2007
+ }
2008
+
2009
+ for (; i < len; i++) {
2010
+ stack = compiler.nameLookup(stack, parts[i], type);
2011
+ }
2012
+
2013
+ if (requireTerminal) {
2014
+ return [compiler.aliasable('this.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')'];
2015
+ } else {
2016
+ return stack;
2017
+ }
2018
+ }
2019
+
2020
+ exports['default'] = JavaScriptCompiler;
2021
+ module.exports = exports['default'];
2022
+
2023
+ /***/ },
2024
+ /* 6 */
2025
+ /***/ function(module, exports, __webpack_require__) {
2026
+
2027
+ 'use strict';
2028
+
2029
+ var _interopRequireDefault = __webpack_require__(8)['default'];
2030
+
2031
+ exports.__esModule = true;
2032
+
2033
+ var _Exception = __webpack_require__(12);
2034
+
2035
+ var _Exception2 = _interopRequireDefault(_Exception);
2036
+
2037
+ var _AST = __webpack_require__(2);
2038
+
2039
+ var _AST2 = _interopRequireDefault(_AST);
2040
+
2041
+ function Visitor() {
2042
+ this.parents = [];
2043
+ }
2044
+
2045
+ Visitor.prototype = {
2046
+ constructor: Visitor,
2047
+ mutating: false,
2048
+
2049
+ // Visits a given value. If mutating, will replace the value if necessary.
2050
+ acceptKey: function acceptKey(node, name) {
2051
+ var value = this.accept(node[name]);
2052
+ if (this.mutating) {
2053
+ // Hacky sanity check:
2054
+ if (value && (!value.type || !_AST2['default'][value.type])) {
2055
+ throw new _Exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
2056
+ }
2057
+ node[name] = value;
2058
+ }
2059
+ },
2060
+
2061
+ // Performs an accept operation with added sanity check to ensure
2062
+ // required keys are not removed.
2063
+ acceptRequired: function acceptRequired(node, name) {
2064
+ this.acceptKey(node, name);
2065
+
2066
+ if (!node[name]) {
2067
+ throw new _Exception2['default'](node.type + ' requires ' + name);
2068
+ }
2069
+ },
2070
+
2071
+ // Traverses a given array. If mutating, empty respnses will be removed
2072
+ // for child elements.
2073
+ acceptArray: function acceptArray(array) {
2074
+ for (var i = 0, l = array.length; i < l; i++) {
2075
+ this.acceptKey(array, i);
2076
+
2077
+ if (!array[i]) {
2078
+ array.splice(i, 1);
2079
+ i--;
2080
+ l--;
2081
+ }
2082
+ }
2083
+ },
2084
+
2085
+ accept: function accept(object) {
2086
+ if (!object) {
2087
+ return;
2088
+ }
2089
+
2090
+ if (this.current) {
2091
+ this.parents.unshift(this.current);
2092
+ }
2093
+ this.current = object;
2094
+
2095
+ var ret = this[object.type](object);
2096
+
2097
+ this.current = this.parents.shift();
2098
+
2099
+ if (!this.mutating || ret) {
2100
+ return ret;
2101
+ } else if (ret !== false) {
2102
+ return object;
2103
+ }
2104
+ },
2105
+
2106
+ Program: function Program(program) {
2107
+ this.acceptArray(program.body);
2108
+ },
2109
+
2110
+ MustacheStatement: function MustacheStatement(mustache) {
2111
+ this.acceptRequired(mustache, 'path');
2112
+ this.acceptArray(mustache.params);
2113
+ this.acceptKey(mustache, 'hash');
2114
+ },
2115
+
2116
+ BlockStatement: function BlockStatement(block) {
2117
+ this.acceptRequired(block, 'path');
2118
+ this.acceptArray(block.params);
2119
+ this.acceptKey(block, 'hash');
2120
+
2121
+ this.acceptKey(block, 'program');
2122
+ this.acceptKey(block, 'inverse');
2123
+ },
2124
+
2125
+ PartialStatement: function PartialStatement(partial) {
2126
+ this.acceptRequired(partial, 'name');
2127
+ this.acceptArray(partial.params);
2128
+ this.acceptKey(partial, 'hash');
2129
+ },
2130
+
2131
+ ContentStatement: function ContentStatement() {},
2132
+ CommentStatement: function CommentStatement() {},
2133
+
2134
+ SubExpression: function SubExpression(sexpr) {
2135
+ this.acceptRequired(sexpr, 'path');
2136
+ this.acceptArray(sexpr.params);
2137
+ this.acceptKey(sexpr, 'hash');
2138
+ },
2139
+
2140
+ PathExpression: function PathExpression() {},
2141
+
2142
+ StringLiteral: function StringLiteral() {},
2143
+ NumberLiteral: function NumberLiteral() {},
2144
+ BooleanLiteral: function BooleanLiteral() {},
2145
+ UndefinedLiteral: function UndefinedLiteral() {},
2146
+ NullLiteral: function NullLiteral() {},
2147
+
2148
+ Hash: function Hash(hash) {
2149
+ this.acceptArray(hash.pairs);
2150
+ },
2151
+ HashPair: function HashPair(pair) {
2152
+ this.acceptRequired(pair, 'value');
2153
+ }
2154
+ };
2155
+
2156
+ exports['default'] = Visitor;
2157
+ module.exports = exports['default'];
2158
+ /* content */ /* comment */ /* path */ /* string */ /* number */ /* bool */ /* literal */ /* literal */
2159
+
2160
+ /***/ },
2161
+ /* 7 */
2162
+ /***/ function(module, exports, __webpack_require__) {
2163
+
2164
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
2165
+
2166
+ exports.__esModule = true;
2167
+ /*global window */
2168
+
2169
+ exports['default'] = function (Handlebars) {
2170
+ /* istanbul ignore next */
2171
+ var root = typeof global !== 'undefined' ? global : window,
2172
+ $Handlebars = root.Handlebars;
2173
+ /* istanbul ignore next */
2174
+ Handlebars.noConflict = function () {
2175
+ if (root.Handlebars === Handlebars) {
2176
+ root.Handlebars = $Handlebars;
2177
+ }
2178
+ };
2179
+ };
2180
+
2181
+ module.exports = exports['default'];
2182
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2183
+
2184
+ /***/ },
2185
+ /* 8 */
2186
+ /***/ function(module, exports, __webpack_require__) {
2187
+
2188
+ "use strict";
2189
+
2190
+ exports["default"] = function (obj) {
2191
+ return obj && obj.__esModule ? obj : {
2192
+ "default": obj
2193
+ };
2194
+ };
2195
+
2196
+ exports.__esModule = true;
2197
+
2198
+ /***/ },
2199
+ /* 9 */
2200
+ /***/ function(module, exports, __webpack_require__) {
2201
+
2202
+ "use strict";
2203
+
2204
+ exports["default"] = function (obj) {
2205
+ if (obj && obj.__esModule) {
2206
+ return obj;
2207
+ } else {
2208
+ var newObj = {};
2209
+
2210
+ if (typeof obj === "object" && obj !== null) {
2211
+ for (var key in obj) {
2212
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
2213
+ }
2214
+ }
2215
+
2216
+ newObj["default"] = obj;
2217
+ return newObj;
2218
+ }
2219
+ };
2220
+
2221
+ exports.__esModule = true;
2222
+
2223
+ /***/ },
2224
+ /* 10 */
2225
+ /***/ function(module, exports, __webpack_require__) {
2226
+
2227
+ 'use strict';
2228
+
2229
+ var _interopRequireWildcard = __webpack_require__(9)['default'];
2230
+
2231
+ var _interopRequireDefault = __webpack_require__(8)['default'];
2232
+
2233
+ exports.__esModule = true;
2234
+ exports.HandlebarsEnvironment = HandlebarsEnvironment;
2235
+ exports.createFrame = createFrame;
2236
+
2237
+ var _import = __webpack_require__(13);
2238
+
2239
+ var Utils = _interopRequireWildcard(_import);
2240
+
2241
+ var _Exception = __webpack_require__(12);
2242
+
2243
+ var _Exception2 = _interopRequireDefault(_Exception);
2244
+
2245
+ var VERSION = '3.0.1';
2246
+ exports.VERSION = VERSION;
2247
+ var COMPILER_REVISION = 6;
2248
+
2249
+ exports.COMPILER_REVISION = COMPILER_REVISION;
2250
+ var REVISION_CHANGES = {
2251
+ 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
2252
+ 2: '== 1.0.0-rc.3',
2253
+ 3: '== 1.0.0-rc.4',
2254
+ 4: '== 1.x.x',
2255
+ 5: '== 2.0.0-alpha.x',
2256
+ 6: '>= 2.0.0-beta.1'
2257
+ };
2258
+
2259
+ exports.REVISION_CHANGES = REVISION_CHANGES;
2260
+ var isArray = Utils.isArray,
2261
+ isFunction = Utils.isFunction,
2262
+ toString = Utils.toString,
2263
+ objectType = '[object Object]';
2264
+
2265
+ function HandlebarsEnvironment(helpers, partials) {
2266
+ this.helpers = helpers || {};
2267
+ this.partials = partials || {};
2268
+
2269
+ registerDefaultHelpers(this);
2270
+ }
2271
+
2272
+ HandlebarsEnvironment.prototype = {
2273
+ constructor: HandlebarsEnvironment,
2274
+
2275
+ logger: logger,
2276
+ log: log,
2277
+
2278
+ registerHelper: function registerHelper(name, fn) {
2279
+ if (toString.call(name) === objectType) {
2280
+ if (fn) {
2281
+ throw new _Exception2['default']('Arg not supported with multiple helpers');
2282
+ }
2283
+ Utils.extend(this.helpers, name);
2284
+ } else {
2285
+ this.helpers[name] = fn;
2286
+ }
2287
+ },
2288
+ unregisterHelper: function unregisterHelper(name) {
2289
+ delete this.helpers[name];
2290
+ },
2291
+
2292
+ registerPartial: function registerPartial(name, partial) {
2293
+ if (toString.call(name) === objectType) {
2294
+ Utils.extend(this.partials, name);
2295
+ } else {
2296
+ if (typeof partial === 'undefined') {
2297
+ throw new _Exception2['default']('Attempting to register a partial as undefined');
2298
+ }
2299
+ this.partials[name] = partial;
2300
+ }
2301
+ },
2302
+ unregisterPartial: function unregisterPartial(name) {
2303
+ delete this.partials[name];
2304
+ }
2305
+ };
2306
+
2307
+ function registerDefaultHelpers(instance) {
2308
+ instance.registerHelper('helperMissing', function () {
2309
+ if (arguments.length === 1) {
2310
+ // A missing field in a {{foo}} constuct.
2311
+ return undefined;
2312
+ } else {
2313
+ // Someone is actually trying to call something, blow up.
2314
+ throw new _Exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
2315
+ }
2316
+ });
2317
+
2318
+ instance.registerHelper('blockHelperMissing', function (context, options) {
2319
+ var inverse = options.inverse,
2320
+ fn = options.fn;
2321
+
2322
+ if (context === true) {
2323
+ return fn(this);
2324
+ } else if (context === false || context == null) {
2325
+ return inverse(this);
2326
+ } else if (isArray(context)) {
2327
+ if (context.length > 0) {
2328
+ if (options.ids) {
2329
+ options.ids = [options.name];
2330
+ }
2331
+
2332
+ return instance.helpers.each(context, options);
2333
+ } else {
2334
+ return inverse(this);
2335
+ }
2336
+ } else {
2337
+ if (options.data && options.ids) {
2338
+ var data = createFrame(options.data);
2339
+ data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name);
2340
+ options = { data: data };
2341
+ }
2342
+
2343
+ return fn(context, options);
2344
+ }
2345
+ });
2346
+
2347
+ instance.registerHelper('each', function (context, options) {
2348
+ if (!options) {
2349
+ throw new _Exception2['default']('Must pass iterator to #each');
2350
+ }
2351
+
2352
+ var fn = options.fn,
2353
+ inverse = options.inverse,
2354
+ i = 0,
2355
+ ret = '',
2356
+ data = undefined,
2357
+ contextPath = undefined;
2358
+
2359
+ if (options.data && options.ids) {
2360
+ contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
2361
+ }
2362
+
2363
+ if (isFunction(context)) {
2364
+ context = context.call(this);
2365
+ }
2366
+
2367
+ if (options.data) {
2368
+ data = createFrame(options.data);
2369
+ }
2370
+
2371
+ function execIteration(field, index, last) {
2372
+ if (data) {
2373
+ data.key = field;
2374
+ data.index = index;
2375
+ data.first = index === 0;
2376
+ data.last = !!last;
2377
+
2378
+ if (contextPath) {
2379
+ data.contextPath = contextPath + field;
2380
+ }
2381
+ }
2382
+
2383
+ ret = ret + fn(context[field], {
2384
+ data: data,
2385
+ blockParams: Utils.blockParams([context[field], field], [contextPath + field, null])
2386
+ });
2387
+ }
2388
+
2389
+ if (context && typeof context === 'object') {
2390
+ if (isArray(context)) {
2391
+ for (var j = context.length; i < j; i++) {
2392
+ execIteration(i, i, i === context.length - 1);
2393
+ }
2394
+ } else {
2395
+ var priorKey = undefined;
2396
+
2397
+ for (var key in context) {
2398
+ if (context.hasOwnProperty(key)) {
2399
+ // We're running the iterations one step out of sync so we can detect
2400
+ // the last iteration without have to scan the object twice and create
2401
+ // an itermediate keys array.
2402
+ if (priorKey) {
2403
+ execIteration(priorKey, i - 1);
2404
+ }
2405
+ priorKey = key;
2406
+ i++;
2407
+ }
2408
+ }
2409
+ if (priorKey) {
2410
+ execIteration(priorKey, i - 1, true);
2411
+ }
2412
+ }
2413
+ }
2414
+
2415
+ if (i === 0) {
2416
+ ret = inverse(this);
2417
+ }
2418
+
2419
+ return ret;
2420
+ });
2421
+
2422
+ instance.registerHelper('if', function (conditional, options) {
2423
+ if (isFunction(conditional)) {
2424
+ conditional = conditional.call(this);
2425
+ }
2426
+
2427
+ // Default behavior is to render the positive path if the value is truthy and not empty.
2428
+ // The `includeZero` option may be set to treat the condtional as purely not empty based on the
2429
+ // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
2430
+ if (!options.hash.includeZero && !conditional || Utils.isEmpty(conditional)) {
2431
+ return options.inverse(this);
2432
+ } else {
2433
+ return options.fn(this);
2434
+ }
2435
+ });
2436
+
2437
+ instance.registerHelper('unless', function (conditional, options) {
2438
+ return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
2439
+ });
2440
+
2441
+ instance.registerHelper('with', function (context, options) {
2442
+ if (isFunction(context)) {
2443
+ context = context.call(this);
2444
+ }
2445
+
2446
+ var fn = options.fn;
2447
+
2448
+ if (!Utils.isEmpty(context)) {
2449
+ if (options.data && options.ids) {
2450
+ var data = createFrame(options.data);
2451
+ data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]);
2452
+ options = { data: data };
2453
+ }
2454
+
2455
+ return fn(context, options);
2456
+ } else {
2457
+ return options.inverse(this);
2458
+ }
2459
+ });
2460
+
2461
+ instance.registerHelper('log', function (message, options) {
2462
+ var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
2463
+ instance.log(level, message);
2464
+ });
2465
+
2466
+ instance.registerHelper('lookup', function (obj, field) {
2467
+ return obj && obj[field];
2468
+ });
2469
+ }
2470
+
2471
+ var logger = {
2472
+ methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
2473
+
2474
+ // State enum
2475
+ DEBUG: 0,
2476
+ INFO: 1,
2477
+ WARN: 2,
2478
+ ERROR: 3,
2479
+ level: 1,
2480
+
2481
+ // Can be overridden in the host environment
2482
+ log: function log(level, message) {
2483
+ if (typeof console !== 'undefined' && logger.level <= level) {
2484
+ var method = logger.methodMap[level];
2485
+ (console[method] || console.log).call(console, message); // eslint-disable-line no-console
2486
+ }
2487
+ }
2488
+ };
2489
+
2490
+ exports.logger = logger;
2491
+ var log = logger.log;
2492
+
2493
+ exports.log = log;
2494
+
2495
+ function createFrame(object) {
2496
+ var frame = Utils.extend({}, object);
2497
+ frame._parent = object;
2498
+ return frame;
2499
+ }
2500
+
2501
+ /* [args, ]options */
2502
+
2503
+ /***/ },
2504
+ /* 11 */
2505
+ /***/ function(module, exports, __webpack_require__) {
2506
+
2507
+ 'use strict';
2508
+
2509
+ exports.__esModule = true;
2510
+ // Build out our basic SafeString type
2511
+ function SafeString(string) {
2512
+ this.string = string;
2513
+ }
2514
+
2515
+ SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
2516
+ return '' + this.string;
2517
+ };
2518
+
2519
+ exports['default'] = SafeString;
2520
+ module.exports = exports['default'];
2521
+
2522
+ /***/ },
2523
+ /* 12 */
2524
+ /***/ function(module, exports, __webpack_require__) {
2525
+
2526
+ 'use strict';
2527
+
2528
+ exports.__esModule = true;
2529
+
2530
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
2531
+
2532
+ function Exception(message, node) {
2533
+ var loc = node && node.loc,
2534
+ line = undefined,
2535
+ column = undefined;
2536
+ if (loc) {
2537
+ line = loc.start.line;
2538
+ column = loc.start.column;
2539
+
2540
+ message += ' - ' + line + ':' + column;
2541
+ }
2542
+
2543
+ var tmp = Error.prototype.constructor.call(this, message);
2544
+
2545
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
2546
+ for (var idx = 0; idx < errorProps.length; idx++) {
2547
+ this[errorProps[idx]] = tmp[errorProps[idx]];
2548
+ }
2549
+
2550
+ if (Error.captureStackTrace) {
2551
+ Error.captureStackTrace(this, Exception);
2552
+ }
2553
+
2554
+ if (loc) {
2555
+ this.lineNumber = line;
2556
+ this.column = column;
2557
+ }
2558
+ }
2559
+
2560
+ Exception.prototype = new Error();
2561
+
2562
+ exports['default'] = Exception;
2563
+ module.exports = exports['default'];
2564
+
2565
+ /***/ },
2566
+ /* 13 */
2567
+ /***/ function(module, exports, __webpack_require__) {
2568
+
2569
+ 'use strict';
2570
+
2571
+ exports.__esModule = true;
2572
+ exports.extend = extend;
2573
+
2574
+ // Older IE versions do not directly support indexOf so we must implement our own, sadly.
2575
+ exports.indexOf = indexOf;
2576
+ exports.escapeExpression = escapeExpression;
2577
+ exports.isEmpty = isEmpty;
2578
+ exports.blockParams = blockParams;
2579
+ exports.appendContextPath = appendContextPath;
2580
+ var escape = {
2581
+ '&': '&amp;',
2582
+ '<': '&lt;',
2583
+ '>': '&gt;',
2584
+ '"': '&quot;',
2585
+ '\'': '&#x27;',
2586
+ '`': '&#x60;'
2587
+ };
2588
+
2589
+ var badChars = /[&<>"'`]/g,
2590
+ possible = /[&<>"'`]/;
2591
+
2592
+ function escapeChar(chr) {
2593
+ return escape[chr];
2594
+ }
2595
+
2596
+ function extend(obj /* , ...source */) {
2597
+ for (var i = 1; i < arguments.length; i++) {
2598
+ for (var key in arguments[i]) {
2599
+ if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
2600
+ obj[key] = arguments[i][key];
2601
+ }
2602
+ }
2603
+ }
2604
+
2605
+ return obj;
2606
+ }
2607
+
2608
+ var toString = Object.prototype.toString;
2609
+
2610
+ exports.toString = toString;
2611
+ // Sourced from lodash
2612
+ // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
2613
+ /*eslint-disable func-style, no-var */
2614
+ var isFunction = function isFunction(value) {
2615
+ return typeof value === 'function';
2616
+ };
2617
+ // fallback for older versions of Chrome and Safari
2618
+ /* istanbul ignore next */
2619
+ if (isFunction(/x/)) {
2620
+ exports.isFunction = isFunction = function (value) {
2621
+ return typeof value === 'function' && toString.call(value) === '[object Function]';
2622
+ };
2623
+ }
2624
+ var isFunction;
2625
+ exports.isFunction = isFunction;
2626
+ /*eslint-enable func-style, no-var */
2627
+
2628
+ /* istanbul ignore next */
2629
+ var isArray = Array.isArray || function (value) {
2630
+ return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
2631
+ };exports.isArray = isArray;
2632
+
2633
+ function indexOf(array, value) {
2634
+ for (var i = 0, len = array.length; i < len; i++) {
2635
+ if (array[i] === value) {
2636
+ return i;
2637
+ }
2638
+ }
2639
+ return -1;
2640
+ }
2641
+
2642
+ function escapeExpression(string) {
2643
+ if (typeof string !== 'string') {
2644
+ // don't escape SafeStrings, since they're already safe
2645
+ if (string && string.toHTML) {
2646
+ return string.toHTML();
2647
+ } else if (string == null) {
2648
+ return '';
2649
+ } else if (!string) {
2650
+ return string + '';
2651
+ }
2652
+
2653
+ // Force a string conversion as this will be done by the append regardless and
2654
+ // the regex test will do this transparently behind the scenes, causing issues if
2655
+ // an object's to string has escaped characters in it.
2656
+ string = '' + string;
2657
+ }
2658
+
2659
+ if (!possible.test(string)) {
2660
+ return string;
2661
+ }
2662
+ return string.replace(badChars, escapeChar);
2663
+ }
2664
+
2665
+ function isEmpty(value) {
2666
+ if (!value && value !== 0) {
2667
+ return true;
2668
+ } else if (isArray(value) && value.length === 0) {
2669
+ return true;
2670
+ } else {
2671
+ return false;
2672
+ }
2673
+ }
2674
+
2675
+ function blockParams(params, ids) {
2676
+ params.path = ids;
2677
+ return params;
2678
+ }
2679
+
2680
+ function appendContextPath(contextPath, id) {
2681
+ return (contextPath ? contextPath + '.' : '') + id;
2682
+ }
2683
+
2684
+ /***/ },
2685
+ /* 14 */
2686
+ /***/ function(module, exports, __webpack_require__) {
2687
+
2688
+ 'use strict';
2689
+
2690
+ var _interopRequireWildcard = __webpack_require__(9)['default'];
2691
+
2692
+ var _interopRequireDefault = __webpack_require__(8)['default'];
2693
+
2694
+ exports.__esModule = true;
2695
+ exports.checkRevision = checkRevision;
2696
+
2697
+ // TODO: Remove this line and break up compilePartial
2698
+
2699
+ exports.template = template;
2700
+ exports.wrapProgram = wrapProgram;
2701
+ exports.resolvePartial = resolvePartial;
2702
+ exports.invokePartial = invokePartial;
2703
+ exports.noop = noop;
2704
+
2705
+ var _import = __webpack_require__(13);
2706
+
2707
+ var Utils = _interopRequireWildcard(_import);
2708
+
2709
+ var _Exception = __webpack_require__(12);
2710
+
2711
+ var _Exception2 = _interopRequireDefault(_Exception);
2712
+
2713
+ var _COMPILER_REVISION$REVISION_CHANGES$createFrame = __webpack_require__(10);
2714
+
2715
+ function checkRevision(compilerInfo) {
2716
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
2717
+ currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION;
2718
+
2719
+ if (compilerRevision !== currentRevision) {
2720
+ if (compilerRevision < currentRevision) {
2721
+ var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision],
2722
+ compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision];
2723
+ 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 + ').');
2724
+ } else {
2725
+ // Use the embedded version info since the runtime doesn't know about this revision yet
2726
+ 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] + ').');
2727
+ }
2728
+ }
2729
+ }
2730
+
2731
+ function template(templateSpec, env) {
2732
+ /* istanbul ignore next */
2733
+ if (!env) {
2734
+ throw new _Exception2['default']('No environment passed to template');
2735
+ }
2736
+ if (!templateSpec || !templateSpec.main) {
2737
+ throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec);
2738
+ }
2739
+
2740
+ // Note: Using env.VM references rather than local var references throughout this section to allow
2741
+ // for external users to override these as psuedo-supported APIs.
2742
+ env.VM.checkRevision(templateSpec.compiler);
2743
+
2744
+ function invokePartialWrapper(partial, context, options) {
2745
+ if (options.hash) {
2746
+ context = Utils.extend({}, context, options.hash);
2747
+ }
2748
+
2749
+ partial = env.VM.resolvePartial.call(this, partial, context, options);
2750
+ var result = env.VM.invokePartial.call(this, partial, context, options);
2751
+
2752
+ if (result == null && env.compile) {
2753
+ options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
2754
+ result = options.partials[options.name](context, options);
2755
+ }
2756
+ if (result != null) {
2757
+ if (options.indent) {
2758
+ var lines = result.split('\n');
2759
+ for (var i = 0, l = lines.length; i < l; i++) {
2760
+ if (!lines[i] && i + 1 === l) {
2761
+ break;
2762
+ }
2763
+
2764
+ lines[i] = options.indent + lines[i];
2765
+ }
2766
+ result = lines.join('\n');
2767
+ }
2768
+ return result;
2769
+ } else {
2770
+ throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
2771
+ }
2772
+ }
2773
+
2774
+ // Just add water
2775
+ var container = {
2776
+ strict: function strict(obj, name) {
2777
+ if (!(name in obj)) {
2778
+ throw new _Exception2['default']('"' + name + '" not defined in ' + obj);
2779
+ }
2780
+ return obj[name];
2781
+ },
2782
+ lookup: function lookup(depths, name) {
2783
+ var len = depths.length;
2784
+ for (var i = 0; i < len; i++) {
2785
+ if (depths[i] && depths[i][name] != null) {
2786
+ return depths[i][name];
2787
+ }
2788
+ }
2789
+ },
2790
+ lambda: function lambda(current, context) {
2791
+ return typeof current === 'function' ? current.call(context) : current;
2792
+ },
2793
+
2794
+ escapeExpression: Utils.escapeExpression,
2795
+ invokePartial: invokePartialWrapper,
2796
+
2797
+ fn: function fn(i) {
2798
+ return templateSpec[i];
2799
+ },
2800
+
2801
+ programs: [],
2802
+ program: function program(i, data, declaredBlockParams, blockParams, depths) {
2803
+ var programWrapper = this.programs[i],
2804
+ fn = this.fn(i);
2805
+ if (data || depths || blockParams || declaredBlockParams) {
2806
+ programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
2807
+ } else if (!programWrapper) {
2808
+ programWrapper = this.programs[i] = wrapProgram(this, i, fn);
2809
+ }
2810
+ return programWrapper;
2811
+ },
2812
+
2813
+ data: function data(value, depth) {
2814
+ while (value && depth--) {
2815
+ value = value._parent;
2816
+ }
2817
+ return value;
2818
+ },
2819
+ merge: function merge(param, common) {
2820
+ var obj = param || common;
2821
+
2822
+ if (param && common && param !== common) {
2823
+ obj = Utils.extend({}, common, param);
2824
+ }
2825
+
2826
+ return obj;
2827
+ },
2828
+
2829
+ noop: env.VM.noop,
2830
+ compilerInfo: templateSpec.compiler
2831
+ };
2832
+
2833
+ function ret(context) {
2834
+ var options = arguments[1] === undefined ? {} : arguments[1];
2835
+
2836
+ var data = options.data;
2837
+
2838
+ ret._setup(options);
2839
+ if (!options.partial && templateSpec.useData) {
2840
+ data = initData(context, data);
2841
+ }
2842
+ var depths = undefined,
2843
+ blockParams = templateSpec.useBlockParams ? [] : undefined;
2844
+ if (templateSpec.useDepths) {
2845
+ depths = options.depths ? [context].concat(options.depths) : [context];
2846
+ }
2847
+
2848
+ return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths);
2849
+ }
2850
+ ret.isTop = true;
2851
+
2852
+ ret._setup = function (options) {
2853
+ if (!options.partial) {
2854
+ container.helpers = container.merge(options.helpers, env.helpers);
2855
+
2856
+ if (templateSpec.usePartial) {
2857
+ container.partials = container.merge(options.partials, env.partials);
2858
+ }
2859
+ } else {
2860
+ container.helpers = options.helpers;
2861
+ container.partials = options.partials;
2862
+ }
2863
+ };
2864
+
2865
+ ret._child = function (i, data, blockParams, depths) {
2866
+ if (templateSpec.useBlockParams && !blockParams) {
2867
+ throw new _Exception2['default']('must pass block params');
2868
+ }
2869
+ if (templateSpec.useDepths && !depths) {
2870
+ throw new _Exception2['default']('must pass parent depths');
2871
+ }
2872
+
2873
+ return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
2874
+ };
2875
+ return ret;
2876
+ }
2877
+
2878
+ function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
2879
+ function prog(context) {
2880
+ var options = arguments[1] === undefined ? {} : arguments[1];
2881
+
2882
+ return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths));
2883
+ }
2884
+ prog.program = i;
2885
+ prog.depth = depths ? depths.length : 0;
2886
+ prog.blockParams = declaredBlockParams || 0;
2887
+ return prog;
2888
+ }
2889
+
2890
+ function resolvePartial(partial, context, options) {
2891
+ if (!partial) {
2892
+ partial = options.partials[options.name];
2893
+ } else if (!partial.call && !options.name) {
2894
+ // This is a dynamic partial that returned a string
2895
+ options.name = partial;
2896
+ partial = options.partials[partial];
2897
+ }
2898
+ return partial;
2899
+ }
2900
+
2901
+ function invokePartial(partial, context, options) {
2902
+ options.partial = true;
2903
+
2904
+ if (partial === undefined) {
2905
+ throw new _Exception2['default']('The partial ' + options.name + ' could not be found');
2906
+ } else if (partial instanceof Function) {
2907
+ return partial(context, options);
2908
+ }
2909
+ }
2910
+
2911
+ function noop() {
2912
+ return '';
2913
+ }
2914
+
2915
+ function initData(context, data) {
2916
+ if (!data || !('root' in data)) {
2917
+ data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {};
2918
+ data.root = context;
2919
+ }
2920
+ return data;
2921
+ }
2922
+
2923
+ /***/ },
2924
+ /* 15 */
2925
+ /***/ function(module, exports, __webpack_require__) {
2926
+
2927
+ "use strict";
2928
+
2929
+ exports.__esModule = true;
2930
+ /* istanbul ignore next */
2931
+ /* Jison generated parser */
2932
+ var handlebars = (function () {
2933
+ var parser = { trace: function trace() {},
2934
+ yy: {},
2935
+ symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, content: 12, COMMENT: 13, CONTENT: 14, openRawBlock: 15, END_RAW_BLOCK: 16, OPEN_RAW_BLOCK: 17, helperName: 18, openRawBlock_repetition0: 19, openRawBlock_option0: 20, CLOSE_RAW_BLOCK: 21, openBlock: 22, block_option0: 23, closeBlock: 24, openInverse: 25, block_option1: 26, OPEN_BLOCK: 27, openBlock_repetition0: 28, openBlock_option0: 29, openBlock_option1: 30, CLOSE: 31, OPEN_INVERSE: 32, openInverse_repetition0: 33, openInverse_option0: 34, openInverse_option1: 35, openInverseChain: 36, OPEN_INVERSE_CHAIN: 37, openInverseChain_repetition0: 38, openInverseChain_option0: 39, openInverseChain_option1: 40, inverseAndProgram: 41, INVERSE: 42, inverseChain: 43, inverseChain_option0: 44, OPEN_ENDBLOCK: 45, OPEN: 46, mustache_repetition0: 47, mustache_option0: 48, OPEN_UNESCAPED: 49, mustache_repetition1: 50, mustache_option1: 51, CLOSE_UNESCAPED: 52, OPEN_PARTIAL: 53, partialName: 54, partial_repetition0: 55, partial_option0: 56, param: 57, sexpr: 58, OPEN_SEXPR: 59, sexpr_repetition0: 60, sexpr_option0: 61, CLOSE_SEXPR: 62, hash: 63, hash_repetition_plus0: 64, hashSegment: 65, ID: 66, EQUALS: 67, blockParams: 68, OPEN_BLOCK_PARAMS: 69, blockParams_repetition_plus0: 70, CLOSE_BLOCK_PARAMS: 71, path: 72, dataName: 73, STRING: 74, NUMBER: 75, BOOLEAN: 76, UNDEFINED: 77, NULL: 78, DATA: 79, pathSegments: 80, SEP: 81, $accept: 0, $end: 1 },
2936
+ terminals_: { 2: "error", 5: "EOF", 13: "COMMENT", 14: "CONTENT", 16: "END_RAW_BLOCK", 17: "OPEN_RAW_BLOCK", 21: "CLOSE_RAW_BLOCK", 27: "OPEN_BLOCK", 31: "CLOSE", 32: "OPEN_INVERSE", 37: "OPEN_INVERSE_CHAIN", 42: "INVERSE", 45: "OPEN_ENDBLOCK", 46: "OPEN", 49: "OPEN_UNESCAPED", 52: "CLOSE_UNESCAPED", 53: "OPEN_PARTIAL", 59: "OPEN_SEXPR", 62: "CLOSE_SEXPR", 66: "ID", 67: "EQUALS", 69: "OPEN_BLOCK_PARAMS", 71: "CLOSE_BLOCK_PARAMS", 74: "STRING", 75: "NUMBER", 76: "BOOLEAN", 77: "UNDEFINED", 78: "NULL", 79: "DATA", 81: "SEP" },
2937
+ productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [12, 1], [10, 3], [15, 5], [9, 4], [9, 4], [22, 6], [25, 6], [36, 6], [41, 2], [43, 3], [43, 1], [24, 3], [8, 5], [8, 5], [11, 5], [57, 1], [57, 1], [58, 5], [63, 1], [65, 3], [68, 3], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [54, 1], [54, 1], [73, 2], [72, 1], [80, 3], [80, 1], [6, 0], [6, 2], [19, 0], [19, 2], [20, 0], [20, 1], [23, 0], [23, 1], [26, 0], [26, 1], [28, 0], [28, 2], [29, 0], [29, 1], [30, 0], [30, 1], [33, 0], [33, 2], [34, 0], [34, 1], [35, 0], [35, 1], [38, 0], [38, 2], [39, 0], [39, 1], [40, 0], [40, 1], [44, 0], [44, 1], [47, 0], [47, 2], [48, 0], [48, 1], [50, 0], [50, 2], [51, 0], [51, 1], [55, 0], [55, 2], [56, 0], [56, 1], [60, 0], [60, 2], [61, 0], [61, 1], [64, 1], [64, 2], [70, 1], [70, 2]],
2938
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
2939
+
2940
+ var $0 = $$.length - 1;
2941
+ switch (yystate) {
2942
+ case 1:
2943
+ return $$[$0 - 1];
2944
+ break;
2945
+ case 2:
2946
+ this.$ = new yy.Program($$[$0], null, {}, yy.locInfo(this._$));
2947
+ break;
2948
+ case 3:
2949
+ this.$ = $$[$0];
2950
+ break;
2951
+ case 4:
2952
+ this.$ = $$[$0];
2953
+ break;
2954
+ case 5:
2955
+ this.$ = $$[$0];
2956
+ break;
2957
+ case 6:
2958
+ this.$ = $$[$0];
2959
+ break;
2960
+ case 7:
2961
+ this.$ = $$[$0];
2962
+ break;
2963
+ case 8:
2964
+ this.$ = new yy.CommentStatement(yy.stripComment($$[$0]), yy.stripFlags($$[$0], $$[$0]), yy.locInfo(this._$));
2965
+ break;
2966
+ case 9:
2967
+ this.$ = new yy.ContentStatement($$[$0], yy.locInfo(this._$));
2968
+ break;
2969
+ case 10:
2970
+ this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
2971
+ break;
2972
+ case 11:
2973
+ this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
2974
+ break;
2975
+ case 12:
2976
+ this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
2977
+ break;
2978
+ case 13:
2979
+ this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
2980
+ break;
2981
+ case 14:
2982
+ this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
2983
+ break;
2984
+ case 15:
2985
+ this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
2986
+ break;
2987
+ case 16:
2988
+ this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
2989
+ break;
2990
+ case 17:
2991
+ this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
2992
+ break;
2993
+ case 18:
2994
+ var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
2995
+ program = new yy.Program([inverse], null, {}, yy.locInfo(this._$));
2996
+ program.chained = true;
2997
+
2998
+ this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
2999
+
3000
+ break;
3001
+ case 19:
3002
+ this.$ = $$[$0];
3003
+ break;
3004
+ case 20:
3005
+ this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
3006
+ break;
3007
+ case 21:
3008
+ this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
3009
+ break;
3010
+ case 22:
3011
+ this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
3012
+ break;
3013
+ case 23:
3014
+ this.$ = new yy.PartialStatement($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], yy.stripFlags($$[$0 - 4], $$[$0]), yy.locInfo(this._$));
3015
+ break;
3016
+ case 24:
3017
+ this.$ = $$[$0];
3018
+ break;
3019
+ case 25:
3020
+ this.$ = $$[$0];
3021
+ break;
3022
+ case 26:
3023
+ this.$ = new yy.SubExpression($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], yy.locInfo(this._$));
3024
+ break;
3025
+ case 27:
3026
+ this.$ = new yy.Hash($$[$0], yy.locInfo(this._$));
3027
+ break;
3028
+ case 28:
3029
+ this.$ = new yy.HashPair(yy.id($$[$0 - 2]), $$[$0], yy.locInfo(this._$));
3030
+ break;
3031
+ case 29:
3032
+ this.$ = yy.id($$[$0 - 1]);
3033
+ break;
3034
+ case 30:
3035
+ this.$ = $$[$0];
3036
+ break;
3037
+ case 31:
3038
+ this.$ = $$[$0];
3039
+ break;
3040
+ case 32:
3041
+ this.$ = new yy.StringLiteral($$[$0], yy.locInfo(this._$));
3042
+ break;
3043
+ case 33:
3044
+ this.$ = new yy.NumberLiteral($$[$0], yy.locInfo(this._$));
3045
+ break;
3046
+ case 34:
3047
+ this.$ = new yy.BooleanLiteral($$[$0], yy.locInfo(this._$));
3048
+ break;
3049
+ case 35:
3050
+ this.$ = new yy.UndefinedLiteral(yy.locInfo(this._$));
3051
+ break;
3052
+ case 36:
3053
+ this.$ = new yy.NullLiteral(yy.locInfo(this._$));
3054
+ break;
3055
+ case 37:
3056
+ this.$ = $$[$0];
3057
+ break;
3058
+ case 38:
3059
+ this.$ = $$[$0];
3060
+ break;
3061
+ case 39:
3062
+ this.$ = yy.preparePath(true, $$[$0], this._$);
3063
+ break;
3064
+ case 40:
3065
+ this.$ = yy.preparePath(false, $$[$0], this._$);
3066
+ break;
3067
+ case 41:
3068
+ $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
3069
+ break;
3070
+ case 42:
3071
+ this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
3072
+ break;
3073
+ case 43:
3074
+ this.$ = [];
3075
+ break;
3076
+ case 44:
3077
+ $$[$0 - 1].push($$[$0]);
3078
+ break;
3079
+ case 45:
3080
+ this.$ = [];
3081
+ break;
3082
+ case 46:
3083
+ $$[$0 - 1].push($$[$0]);
3084
+ break;
3085
+ case 53:
3086
+ this.$ = [];
3087
+ break;
3088
+ case 54:
3089
+ $$[$0 - 1].push($$[$0]);
3090
+ break;
3091
+ case 59:
3092
+ this.$ = [];
3093
+ break;
3094
+ case 60:
3095
+ $$[$0 - 1].push($$[$0]);
3096
+ break;
3097
+ case 65:
3098
+ this.$ = [];
3099
+ break;
3100
+ case 66:
3101
+ $$[$0 - 1].push($$[$0]);
3102
+ break;
3103
+ case 73:
3104
+ this.$ = [];
3105
+ break;
3106
+ case 74:
3107
+ $$[$0 - 1].push($$[$0]);
3108
+ break;
3109
+ case 77:
3110
+ this.$ = [];
3111
+ break;
3112
+ case 78:
3113
+ $$[$0 - 1].push($$[$0]);
3114
+ break;
3115
+ case 81:
3116
+ this.$ = [];
3117
+ break;
3118
+ case 82:
3119
+ $$[$0 - 1].push($$[$0]);
3120
+ break;
3121
+ case 85:
3122
+ this.$ = [];
3123
+ break;
3124
+ case 86:
3125
+ $$[$0 - 1].push($$[$0]);
3126
+ break;
3127
+ case 89:
3128
+ this.$ = [$$[$0]];
3129
+ break;
3130
+ case 90:
3131
+ $$[$0 - 1].push($$[$0]);
3132
+ break;
3133
+ case 91:
3134
+ this.$ = [$$[$0]];
3135
+ break;
3136
+ case 92:
3137
+ $$[$0 - 1].push($$[$0]);
3138
+ break;
3139
+ }
3140
+ },
3141
+ table: [{ 3: 1, 4: 2, 5: [2, 43], 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: [1, 11], 14: [1, 18], 15: 16, 17: [1, 21], 22: 14, 25: 15, 27: [1, 19], 32: [1, 20], 37: [2, 2], 42: [2, 2], 45: [2, 2], 46: [1, 12], 49: [1, 13], 53: [1, 17] }, { 1: [2, 1] }, { 5: [2, 44], 13: [2, 44], 14: [2, 44], 17: [2, 44], 27: [2, 44], 32: [2, 44], 37: [2, 44], 42: [2, 44], 45: [2, 44], 46: [2, 44], 49: [2, 44], 53: [2, 44] }, { 5: [2, 3], 13: [2, 3], 14: [2, 3], 17: [2, 3], 27: [2, 3], 32: [2, 3], 37: [2, 3], 42: [2, 3], 45: [2, 3], 46: [2, 3], 49: [2, 3], 53: [2, 3] }, { 5: [2, 4], 13: [2, 4], 14: [2, 4], 17: [2, 4], 27: [2, 4], 32: [2, 4], 37: [2, 4], 42: [2, 4], 45: [2, 4], 46: [2, 4], 49: [2, 4], 53: [2, 4] }, { 5: [2, 5], 13: [2, 5], 14: [2, 5], 17: [2, 5], 27: [2, 5], 32: [2, 5], 37: [2, 5], 42: [2, 5], 45: [2, 5], 46: [2, 5], 49: [2, 5], 53: [2, 5] }, { 5: [2, 6], 13: [2, 6], 14: [2, 6], 17: [2, 6], 27: [2, 6], 32: [2, 6], 37: [2, 6], 42: [2, 6], 45: [2, 6], 46: [2, 6], 49: [2, 6], 53: [2, 6] }, { 5: [2, 7], 13: [2, 7], 14: [2, 7], 17: [2, 7], 27: [2, 7], 32: [2, 7], 37: [2, 7], 42: [2, 7], 45: [2, 7], 46: [2, 7], 49: [2, 7], 53: [2, 7] }, { 5: [2, 8], 13: [2, 8], 14: [2, 8], 17: [2, 8], 27: [2, 8], 32: [2, 8], 37: [2, 8], 42: [2, 8], 45: [2, 8], 46: [2, 8], 49: [2, 8], 53: [2, 8] }, { 18: 22, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 33, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 4: 34, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 37: [2, 43], 42: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 4: 35, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 42: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 12: 36, 14: [1, 18] }, { 18: 38, 54: 37, 58: 39, 59: [1, 40], 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 5: [2, 9], 13: [2, 9], 14: [2, 9], 16: [2, 9], 17: [2, 9], 27: [2, 9], 32: [2, 9], 37: [2, 9], 42: [2, 9], 45: [2, 9], 46: [2, 9], 49: [2, 9], 53: [2, 9] }, { 18: 41, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 42, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 43, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 31: [2, 73], 47: 44, 59: [2, 73], 66: [2, 73], 74: [2, 73], 75: [2, 73], 76: [2, 73], 77: [2, 73], 78: [2, 73], 79: [2, 73] }, { 21: [2, 30], 31: [2, 30], 52: [2, 30], 59: [2, 30], 62: [2, 30], 66: [2, 30], 69: [2, 30], 74: [2, 30], 75: [2, 30], 76: [2, 30], 77: [2, 30], 78: [2, 30], 79: [2, 30] }, { 21: [2, 31], 31: [2, 31], 52: [2, 31], 59: [2, 31], 62: [2, 31], 66: [2, 31], 69: [2, 31], 74: [2, 31], 75: [2, 31], 76: [2, 31], 77: [2, 31], 78: [2, 31], 79: [2, 31] }, { 21: [2, 32], 31: [2, 32], 52: [2, 32], 59: [2, 32], 62: [2, 32], 66: [2, 32], 69: [2, 32], 74: [2, 32], 75: [2, 32], 76: [2, 32], 77: [2, 32], 78: [2, 32], 79: [2, 32] }, { 21: [2, 33], 31: [2, 33], 52: [2, 33], 59: [2, 33], 62: [2, 33], 66: [2, 33], 69: [2, 33], 74: [2, 33], 75: [2, 33], 76: [2, 33], 77: [2, 33], 78: [2, 33], 79: [2, 33] }, { 21: [2, 34], 31: [2, 34], 52: [2, 34], 59: [2, 34], 62: [2, 34], 66: [2, 34], 69: [2, 34], 74: [2, 34], 75: [2, 34], 76: [2, 34], 77: [2, 34], 78: [2, 34], 79: [2, 34] }, { 21: [2, 35], 31: [2, 35], 52: [2, 35], 59: [2, 35], 62: [2, 35], 66: [2, 35], 69: [2, 35], 74: [2, 35], 75: [2, 35], 76: [2, 35], 77: [2, 35], 78: [2, 35], 79: [2, 35] }, { 21: [2, 36], 31: [2, 36], 52: [2, 36], 59: [2, 36], 62: [2, 36], 66: [2, 36], 69: [2, 36], 74: [2, 36], 75: [2, 36], 76: [2, 36], 77: [2, 36], 78: [2, 36], 79: [2, 36] }, { 21: [2, 40], 31: [2, 40], 52: [2, 40], 59: [2, 40], 62: [2, 40], 66: [2, 40], 69: [2, 40], 74: [2, 40], 75: [2, 40], 76: [2, 40], 77: [2, 40], 78: [2, 40], 79: [2, 40], 81: [1, 45] }, { 66: [1, 32], 80: 46 }, { 21: [2, 42], 31: [2, 42], 52: [2, 42], 59: [2, 42], 62: [2, 42], 66: [2, 42], 69: [2, 42], 74: [2, 42], 75: [2, 42], 76: [2, 42], 77: [2, 42], 78: [2, 42], 79: [2, 42], 81: [2, 42] }, { 50: 47, 52: [2, 77], 59: [2, 77], 66: [2, 77], 74: [2, 77], 75: [2, 77], 76: [2, 77], 77: [2, 77], 78: [2, 77], 79: [2, 77] }, { 23: 48, 36: 50, 37: [1, 52], 41: 51, 42: [1, 53], 43: 49, 45: [2, 49] }, { 26: 54, 41: 55, 42: [1, 53], 45: [2, 51] }, { 16: [1, 56] }, { 31: [2, 81], 55: 57, 59: [2, 81], 66: [2, 81], 74: [2, 81], 75: [2, 81], 76: [2, 81], 77: [2, 81], 78: [2, 81], 79: [2, 81] }, { 31: [2, 37], 59: [2, 37], 66: [2, 37], 74: [2, 37], 75: [2, 37], 76: [2, 37], 77: [2, 37], 78: [2, 37], 79: [2, 37] }, { 31: [2, 38], 59: [2, 38], 66: [2, 38], 74: [2, 38], 75: [2, 38], 76: [2, 38], 77: [2, 38], 78: [2, 38], 79: [2, 38] }, { 18: 58, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 28: 59, 31: [2, 53], 59: [2, 53], 66: [2, 53], 69: [2, 53], 74: [2, 53], 75: [2, 53], 76: [2, 53], 77: [2, 53], 78: [2, 53], 79: [2, 53] }, { 31: [2, 59], 33: 60, 59: [2, 59], 66: [2, 59], 69: [2, 59], 74: [2, 59], 75: [2, 59], 76: [2, 59], 77: [2, 59], 78: [2, 59], 79: [2, 59] }, { 19: 61, 21: [2, 45], 59: [2, 45], 66: [2, 45], 74: [2, 45], 75: [2, 45], 76: [2, 45], 77: [2, 45], 78: [2, 45], 79: [2, 45] }, { 18: 65, 31: [2, 75], 48: 62, 57: 63, 58: 66, 59: [1, 40], 63: 64, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 66: [1, 70] }, { 21: [2, 39], 31: [2, 39], 52: [2, 39], 59: [2, 39], 62: [2, 39], 66: [2, 39], 69: [2, 39], 74: [2, 39], 75: [2, 39], 76: [2, 39], 77: [2, 39], 78: [2, 39], 79: [2, 39], 81: [1, 45] }, { 18: 65, 51: 71, 52: [2, 79], 57: 72, 58: 66, 59: [1, 40], 63: 73, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 24: 74, 45: [1, 75] }, { 45: [2, 50] }, { 4: 76, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 37: [2, 43], 42: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 45: [2, 19] }, { 18: 77, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 4: 78, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 24: 79, 45: [1, 75] }, { 45: [2, 52] }, { 5: [2, 10], 13: [2, 10], 14: [2, 10], 17: [2, 10], 27: [2, 10], 32: [2, 10], 37: [2, 10], 42: [2, 10], 45: [2, 10], 46: [2, 10], 49: [2, 10], 53: [2, 10] }, { 18: 65, 31: [2, 83], 56: 80, 57: 81, 58: 66, 59: [1, 40], 63: 82, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 59: [2, 85], 60: 83, 62: [2, 85], 66: [2, 85], 74: [2, 85], 75: [2, 85], 76: [2, 85], 77: [2, 85], 78: [2, 85], 79: [2, 85] }, { 18: 65, 29: 84, 31: [2, 55], 57: 85, 58: 66, 59: [1, 40], 63: 86, 64: 67, 65: 68, 66: [1, 69], 69: [2, 55], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 65, 31: [2, 61], 34: 87, 57: 88, 58: 66, 59: [1, 40], 63: 89, 64: 67, 65: 68, 66: [1, 69], 69: [2, 61], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 65, 20: 90, 21: [2, 47], 57: 91, 58: 66, 59: [1, 40], 63: 92, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 31: [1, 93] }, { 31: [2, 74], 59: [2, 74], 66: [2, 74], 74: [2, 74], 75: [2, 74], 76: [2, 74], 77: [2, 74], 78: [2, 74], 79: [2, 74] }, { 31: [2, 76] }, { 21: [2, 24], 31: [2, 24], 52: [2, 24], 59: [2, 24], 62: [2, 24], 66: [2, 24], 69: [2, 24], 74: [2, 24], 75: [2, 24], 76: [2, 24], 77: [2, 24], 78: [2, 24], 79: [2, 24] }, { 21: [2, 25], 31: [2, 25], 52: [2, 25], 59: [2, 25], 62: [2, 25], 66: [2, 25], 69: [2, 25], 74: [2, 25], 75: [2, 25], 76: [2, 25], 77: [2, 25], 78: [2, 25], 79: [2, 25] }, { 21: [2, 27], 31: [2, 27], 52: [2, 27], 62: [2, 27], 65: 94, 66: [1, 95], 69: [2, 27] }, { 21: [2, 89], 31: [2, 89], 52: [2, 89], 62: [2, 89], 66: [2, 89], 69: [2, 89] }, { 21: [2, 42], 31: [2, 42], 52: [2, 42], 59: [2, 42], 62: [2, 42], 66: [2, 42], 67: [1, 96], 69: [2, 42], 74: [2, 42], 75: [2, 42], 76: [2, 42], 77: [2, 42], 78: [2, 42], 79: [2, 42], 81: [2, 42] }, { 21: [2, 41], 31: [2, 41], 52: [2, 41], 59: [2, 41], 62: [2, 41], 66: [2, 41], 69: [2, 41], 74: [2, 41], 75: [2, 41], 76: [2, 41], 77: [2, 41], 78: [2, 41], 79: [2, 41], 81: [2, 41] }, { 52: [1, 97] }, { 52: [2, 78], 59: [2, 78], 66: [2, 78], 74: [2, 78], 75: [2, 78], 76: [2, 78], 77: [2, 78], 78: [2, 78], 79: [2, 78] }, { 52: [2, 80] }, { 5: [2, 12], 13: [2, 12], 14: [2, 12], 17: [2, 12], 27: [2, 12], 32: [2, 12], 37: [2, 12], 42: [2, 12], 45: [2, 12], 46: [2, 12], 49: [2, 12], 53: [2, 12] }, { 18: 98, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 36: 50, 37: [1, 52], 41: 51, 42: [1, 53], 43: 100, 44: 99, 45: [2, 71] }, { 31: [2, 65], 38: 101, 59: [2, 65], 66: [2, 65], 69: [2, 65], 74: [2, 65], 75: [2, 65], 76: [2, 65], 77: [2, 65], 78: [2, 65], 79: [2, 65] }, { 45: [2, 17] }, { 5: [2, 13], 13: [2, 13], 14: [2, 13], 17: [2, 13], 27: [2, 13], 32: [2, 13], 37: [2, 13], 42: [2, 13], 45: [2, 13], 46: [2, 13], 49: [2, 13], 53: [2, 13] }, { 31: [1, 102] }, { 31: [2, 82], 59: [2, 82], 66: [2, 82], 74: [2, 82], 75: [2, 82], 76: [2, 82], 77: [2, 82], 78: [2, 82], 79: [2, 82] }, { 31: [2, 84] }, { 18: 65, 57: 104, 58: 66, 59: [1, 40], 61: 103, 62: [2, 87], 63: 105, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 30: 106, 31: [2, 57], 68: 107, 69: [1, 108] }, { 31: [2, 54], 59: [2, 54], 66: [2, 54], 69: [2, 54], 74: [2, 54], 75: [2, 54], 76: [2, 54], 77: [2, 54], 78: [2, 54], 79: [2, 54] }, { 31: [2, 56], 69: [2, 56] }, { 31: [2, 63], 35: 109, 68: 110, 69: [1, 108] }, { 31: [2, 60], 59: [2, 60], 66: [2, 60], 69: [2, 60], 74: [2, 60], 75: [2, 60], 76: [2, 60], 77: [2, 60], 78: [2, 60], 79: [2, 60] }, { 31: [2, 62], 69: [2, 62] }, { 21: [1, 111] }, { 21: [2, 46], 59: [2, 46], 66: [2, 46], 74: [2, 46], 75: [2, 46], 76: [2, 46], 77: [2, 46], 78: [2, 46], 79: [2, 46] }, { 21: [2, 48] }, { 5: [2, 21], 13: [2, 21], 14: [2, 21], 17: [2, 21], 27: [2, 21], 32: [2, 21], 37: [2, 21], 42: [2, 21], 45: [2, 21], 46: [2, 21], 49: [2, 21], 53: [2, 21] }, { 21: [2, 90], 31: [2, 90], 52: [2, 90], 62: [2, 90], 66: [2, 90], 69: [2, 90] }, { 67: [1, 96] }, { 18: 65, 57: 112, 58: 66, 59: [1, 40], 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 5: [2, 22], 13: [2, 22], 14: [2, 22], 17: [2, 22], 27: [2, 22], 32: [2, 22], 37: [2, 22], 42: [2, 22], 45: [2, 22], 46: [2, 22], 49: [2, 22], 53: [2, 22] }, { 31: [1, 113] }, { 45: [2, 18] }, { 45: [2, 72] }, { 18: 65, 31: [2, 67], 39: 114, 57: 115, 58: 66, 59: [1, 40], 63: 116, 64: 67, 65: 68, 66: [1, 69], 69: [2, 67], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 5: [2, 23], 13: [2, 23], 14: [2, 23], 17: [2, 23], 27: [2, 23], 32: [2, 23], 37: [2, 23], 42: [2, 23], 45: [2, 23], 46: [2, 23], 49: [2, 23], 53: [2, 23] }, { 62: [1, 117] }, { 59: [2, 86], 62: [2, 86], 66: [2, 86], 74: [2, 86], 75: [2, 86], 76: [2, 86], 77: [2, 86], 78: [2, 86], 79: [2, 86] }, { 62: [2, 88] }, { 31: [1, 118] }, { 31: [2, 58] }, { 66: [1, 120], 70: 119 }, { 31: [1, 121] }, { 31: [2, 64] }, { 14: [2, 11] }, { 21: [2, 28], 31: [2, 28], 52: [2, 28], 62: [2, 28], 66: [2, 28], 69: [2, 28] }, { 5: [2, 20], 13: [2, 20], 14: [2, 20], 17: [2, 20], 27: [2, 20], 32: [2, 20], 37: [2, 20], 42: [2, 20], 45: [2, 20], 46: [2, 20], 49: [2, 20], 53: [2, 20] }, { 31: [2, 69], 40: 122, 68: 123, 69: [1, 108] }, { 31: [2, 66], 59: [2, 66], 66: [2, 66], 69: [2, 66], 74: [2, 66], 75: [2, 66], 76: [2, 66], 77: [2, 66], 78: [2, 66], 79: [2, 66] }, { 31: [2, 68], 69: [2, 68] }, { 21: [2, 26], 31: [2, 26], 52: [2, 26], 59: [2, 26], 62: [2, 26], 66: [2, 26], 69: [2, 26], 74: [2, 26], 75: [2, 26], 76: [2, 26], 77: [2, 26], 78: [2, 26], 79: [2, 26] }, { 13: [2, 14], 14: [2, 14], 17: [2, 14], 27: [2, 14], 32: [2, 14], 37: [2, 14], 42: [2, 14], 45: [2, 14], 46: [2, 14], 49: [2, 14], 53: [2, 14] }, { 66: [1, 125], 71: [1, 124] }, { 66: [2, 91], 71: [2, 91] }, { 13: [2, 15], 14: [2, 15], 17: [2, 15], 27: [2, 15], 32: [2, 15], 42: [2, 15], 45: [2, 15], 46: [2, 15], 49: [2, 15], 53: [2, 15] }, { 31: [1, 126] }, { 31: [2, 70] }, { 31: [2, 29] }, { 66: [2, 92], 71: [2, 92] }, { 13: [2, 16], 14: [2, 16], 17: [2, 16], 27: [2, 16], 32: [2, 16], 37: [2, 16], 42: [2, 16], 45: [2, 16], 46: [2, 16], 49: [2, 16], 53: [2, 16] }],
3142
+ defaultActions: { 4: [2, 1], 49: [2, 50], 51: [2, 19], 55: [2, 52], 64: [2, 76], 73: [2, 80], 78: [2, 17], 82: [2, 84], 92: [2, 48], 99: [2, 18], 100: [2, 72], 105: [2, 88], 107: [2, 58], 110: [2, 64], 111: [2, 11], 123: [2, 70], 124: [2, 29] },
3143
+ parseError: function parseError(str, hash) {
3144
+ throw new Error(str);
3145
+ },
3146
+ parse: function parse(input) {
3147
+ var self = this,
3148
+ stack = [0],
3149
+ vstack = [null],
3150
+ lstack = [],
3151
+ table = this.table,
3152
+ yytext = "",
3153
+ yylineno = 0,
3154
+ yyleng = 0,
3155
+ recovering = 0,
3156
+ TERROR = 2,
3157
+ EOF = 1;
3158
+ this.lexer.setInput(input);
3159
+ this.lexer.yy = this.yy;
3160
+ this.yy.lexer = this.lexer;
3161
+ this.yy.parser = this;
3162
+ if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
3163
+ var yyloc = this.lexer.yylloc;
3164
+ lstack.push(yyloc);
3165
+ var ranges = this.lexer.options && this.lexer.options.ranges;
3166
+ if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
3167
+ function popStack(n) {
3168
+ stack.length = stack.length - 2 * n;
3169
+ vstack.length = vstack.length - n;
3170
+ lstack.length = lstack.length - n;
3171
+ }
3172
+ function lex() {
3173
+ var token;
3174
+ token = self.lexer.lex() || 1;
3175
+ if (typeof token !== "number") {
3176
+ token = self.symbols_[token] || token;
3177
+ }
3178
+ return token;
3179
+ }
3180
+ var symbol,
3181
+ preErrorSymbol,
3182
+ state,
3183
+ action,
3184
+ a,
3185
+ r,
3186
+ yyval = {},
3187
+ p,
3188
+ len,
3189
+ newState,
3190
+ expected;
3191
+ while (true) {
3192
+ state = stack[stack.length - 1];
3193
+ if (this.defaultActions[state]) {
3194
+ action = this.defaultActions[state];
3195
+ } else {
3196
+ if (symbol === null || typeof symbol == "undefined") {
3197
+ symbol = lex();
3198
+ }
3199
+ action = table[state] && table[state][symbol];
3200
+ }
3201
+ if (typeof action === "undefined" || !action.length || !action[0]) {
3202
+ var errStr = "";
3203
+ if (!recovering) {
3204
+ expected = [];
3205
+ for (p in table[state]) if (this.terminals_[p] && p > 2) {
3206
+ expected.push("'" + this.terminals_[p] + "'");
3207
+ }
3208
+ if (this.lexer.showPosition) {
3209
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
3210
+ } else {
3211
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
3212
+ }
3213
+ this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
3214
+ }
3215
+ }
3216
+ if (action[0] instanceof Array && action.length > 1) {
3217
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
3218
+ }
3219
+ switch (action[0]) {
3220
+ case 1:
3221
+ stack.push(symbol);
3222
+ vstack.push(this.lexer.yytext);
3223
+ lstack.push(this.lexer.yylloc);
3224
+ stack.push(action[1]);
3225
+ symbol = null;
3226
+ if (!preErrorSymbol) {
3227
+ yyleng = this.lexer.yyleng;
3228
+ yytext = this.lexer.yytext;
3229
+ yylineno = this.lexer.yylineno;
3230
+ yyloc = this.lexer.yylloc;
3231
+ if (recovering > 0) recovering--;
3232
+ } else {
3233
+ symbol = preErrorSymbol;
3234
+ preErrorSymbol = null;
3235
+ }
3236
+ break;
3237
+ case 2:
3238
+ len = this.productions_[action[1]][1];
3239
+ yyval.$ = vstack[vstack.length - len];
3240
+ yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
3241
+ if (ranges) {
3242
+ yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
3243
+ }
3244
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
3245
+ if (typeof r !== "undefined") {
3246
+ return r;
3247
+ }
3248
+ if (len) {
3249
+ stack = stack.slice(0, -1 * len * 2);
3250
+ vstack = vstack.slice(0, -1 * len);
3251
+ lstack = lstack.slice(0, -1 * len);
3252
+ }
3253
+ stack.push(this.productions_[action[1]][0]);
3254
+ vstack.push(yyval.$);
3255
+ lstack.push(yyval._$);
3256
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
3257
+ stack.push(newState);
3258
+ break;
3259
+ case 3:
3260
+ return true;
3261
+ }
3262
+ }
3263
+ return true;
3264
+ }
3265
+ };
3266
+ /* Jison generated lexer */
3267
+ var lexer = (function () {
3268
+ var lexer = { EOF: 1,
3269
+ parseError: function parseError(str, hash) {
3270
+ if (this.yy.parser) {
3271
+ this.yy.parser.parseError(str, hash);
3272
+ } else {
3273
+ throw new Error(str);
3274
+ }
3275
+ },
3276
+ setInput: function setInput(input) {
3277
+ this._input = input;
3278
+ this._more = this._less = this.done = false;
3279
+ this.yylineno = this.yyleng = 0;
3280
+ this.yytext = this.matched = this.match = "";
3281
+ this.conditionStack = ["INITIAL"];
3282
+ this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
3283
+ if (this.options.ranges) this.yylloc.range = [0, 0];
3284
+ this.offset = 0;
3285
+ return this;
3286
+ },
3287
+ input: function input() {
3288
+ var ch = this._input[0];
3289
+ this.yytext += ch;
3290
+ this.yyleng++;
3291
+ this.offset++;
3292
+ this.match += ch;
3293
+ this.matched += ch;
3294
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
3295
+ if (lines) {
3296
+ this.yylineno++;
3297
+ this.yylloc.last_line++;
3298
+ } else {
3299
+ this.yylloc.last_column++;
3300
+ }
3301
+ if (this.options.ranges) this.yylloc.range[1]++;
3302
+
3303
+ this._input = this._input.slice(1);
3304
+ return ch;
3305
+ },
3306
+ unput: function unput(ch) {
3307
+ var len = ch.length;
3308
+ var lines = ch.split(/(?:\r\n?|\n)/g);
3309
+
3310
+ this._input = ch + this._input;
3311
+ this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
3312
+ //this.yyleng -= len;
3313
+ this.offset -= len;
3314
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
3315
+ this.match = this.match.substr(0, this.match.length - 1);
3316
+ this.matched = this.matched.substr(0, this.matched.length - 1);
3317
+
3318
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
3319
+ var r = this.yylloc.range;
3320
+
3321
+ this.yylloc = { first_line: this.yylloc.first_line,
3322
+ last_line: this.yylineno + 1,
3323
+ first_column: this.yylloc.first_column,
3324
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
3325
+ };
3326
+
3327
+ if (this.options.ranges) {
3328
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
3329
+ }
3330
+ return this;
3331
+ },
3332
+ more: function more() {
3333
+ this._more = true;
3334
+ return this;
3335
+ },
3336
+ less: function less(n) {
3337
+ this.unput(this.match.slice(n));
3338
+ },
3339
+ pastInput: function pastInput() {
3340
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
3341
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
3342
+ },
3343
+ upcomingInput: function upcomingInput() {
3344
+ var next = this.match;
3345
+ if (next.length < 20) {
3346
+ next += this._input.substr(0, 20 - next.length);
3347
+ }
3348
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
3349
+ },
3350
+ showPosition: function showPosition() {
3351
+ var pre = this.pastInput();
3352
+ var c = new Array(pre.length + 1).join("-");
3353
+ return pre + this.upcomingInput() + "\n" + c + "^";
3354
+ },
3355
+ next: function next() {
3356
+ if (this.done) {
3357
+ return this.EOF;
3358
+ }
3359
+ if (!this._input) this.done = true;
3360
+
3361
+ var token, match, tempMatch, index, col, lines;
3362
+ if (!this._more) {
3363
+ this.yytext = "";
3364
+ this.match = "";
3365
+ }
3366
+ var rules = this._currentRules();
3367
+ for (var i = 0; i < rules.length; i++) {
3368
+ tempMatch = this._input.match(this.rules[rules[i]]);
3369
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
3370
+ match = tempMatch;
3371
+ index = i;
3372
+ if (!this.options.flex) break;
3373
+ }
3374
+ }
3375
+ if (match) {
3376
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
3377
+ if (lines) this.yylineno += lines.length;
3378
+ this.yylloc = { first_line: this.yylloc.last_line,
3379
+ last_line: this.yylineno + 1,
3380
+ first_column: this.yylloc.last_column,
3381
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
3382
+ this.yytext += match[0];
3383
+ this.match += match[0];
3384
+ this.matches = match;
3385
+ this.yyleng = this.yytext.length;
3386
+ if (this.options.ranges) {
3387
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
3388
+ }
3389
+ this._more = false;
3390
+ this._input = this._input.slice(match[0].length);
3391
+ this.matched += match[0];
3392
+ token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
3393
+ if (this.done && this._input) this.done = false;
3394
+ if (token) {
3395
+ return token;
3396
+ } else {
3397
+ return;
3398
+ }
3399
+ }
3400
+ if (this._input === "") {
3401
+ return this.EOF;
3402
+ } else {
3403
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno });
3404
+ }
3405
+ },
3406
+ lex: function lex() {
3407
+ var r = this.next();
3408
+ if (typeof r !== "undefined") {
3409
+ return r;
3410
+ } else {
3411
+ return this.lex();
3412
+ }
3413
+ },
3414
+ begin: function begin(condition) {
3415
+ this.conditionStack.push(condition);
3416
+ },
3417
+ popState: function popState() {
3418
+ return this.conditionStack.pop();
3419
+ },
3420
+ _currentRules: function _currentRules() {
3421
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
3422
+ },
3423
+ topState: function topState() {
3424
+ return this.conditionStack[this.conditionStack.length - 2];
3425
+ },
3426
+ pushState: function begin(condition) {
3427
+ this.begin(condition);
3428
+ } };
3429
+ lexer.options = {};
3430
+ lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
3431
+
3432
+ function strip(start, end) {
3433
+ return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
3434
+ }
3435
+
3436
+ var YYSTATE = YY_START;
3437
+ switch ($avoiding_name_collisions) {
3438
+ case 0:
3439
+ if (yy_.yytext.slice(-2) === "\\\\") {
3440
+ strip(0, 1);
3441
+ this.begin("mu");
3442
+ } else if (yy_.yytext.slice(-1) === "\\") {
3443
+ strip(0, 1);
3444
+ this.begin("emu");
3445
+ } else {
3446
+ this.begin("mu");
3447
+ }
3448
+ if (yy_.yytext) {
3449
+ return 14;
3450
+ }break;
3451
+ case 1:
3452
+ return 14;
3453
+ break;
3454
+ case 2:
3455
+ this.popState();
3456
+ return 14;
3457
+
3458
+ break;
3459
+ case 3:
3460
+ yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9);
3461
+ this.popState();
3462
+ return 16;
3463
+
3464
+ break;
3465
+ case 4:
3466
+ return 14;
3467
+ break;
3468
+ case 5:
3469
+ this.popState();
3470
+ return 13;
3471
+
3472
+ break;
3473
+ case 6:
3474
+ return 59;
3475
+ break;
3476
+ case 7:
3477
+ return 62;
3478
+ break;
3479
+ case 8:
3480
+ return 17;
3481
+ break;
3482
+ case 9:
3483
+ this.popState();
3484
+ this.begin("raw");
3485
+ return 21;
3486
+
3487
+ break;
3488
+ case 10:
3489
+ return 53;
3490
+ break;
3491
+ case 11:
3492
+ return 27;
3493
+ break;
3494
+ case 12:
3495
+ return 45;
3496
+ break;
3497
+ case 13:
3498
+ this.popState();return 42;
3499
+ break;
3500
+ case 14:
3501
+ this.popState();return 42;
3502
+ break;
3503
+ case 15:
3504
+ return 32;
3505
+ break;
3506
+ case 16:
3507
+ return 37;
3508
+ break;
3509
+ case 17:
3510
+ return 49;
3511
+ break;
3512
+ case 18:
3513
+ return 46;
3514
+ break;
3515
+ case 19:
3516
+ this.unput(yy_.yytext);
3517
+ this.popState();
3518
+ this.begin("com");
3519
+
3520
+ break;
3521
+ case 20:
3522
+ this.popState();
3523
+ return 13;
3524
+
3525
+ break;
3526
+ case 21:
3527
+ return 46;
3528
+ break;
3529
+ case 22:
3530
+ return 67;
3531
+ break;
3532
+ case 23:
3533
+ return 66;
3534
+ break;
3535
+ case 24:
3536
+ return 66;
3537
+ break;
3538
+ case 25:
3539
+ return 81;
3540
+ break;
3541
+ case 26:
3542
+ // ignore whitespace
3543
+ break;
3544
+ case 27:
3545
+ this.popState();return 52;
3546
+ break;
3547
+ case 28:
3548
+ this.popState();return 31;
3549
+ break;
3550
+ case 29:
3551
+ yy_.yytext = strip(1, 2).replace(/\\"/g, "\"");return 74;
3552
+ break;
3553
+ case 30:
3554
+ yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 74;
3555
+ break;
3556
+ case 31:
3557
+ return 79;
3558
+ break;
3559
+ case 32:
3560
+ return 76;
3561
+ break;
3562
+ case 33:
3563
+ return 76;
3564
+ break;
3565
+ case 34:
3566
+ return 77;
3567
+ break;
3568
+ case 35:
3569
+ return 78;
3570
+ break;
3571
+ case 36:
3572
+ return 75;
3573
+ break;
3574
+ case 37:
3575
+ return 69;
3576
+ break;
3577
+ case 38:
3578
+ return 71;
3579
+ break;
3580
+ case 39:
3581
+ return 66;
3582
+ break;
3583
+ case 40:
3584
+ return 66;
3585
+ break;
3586
+ case 41:
3587
+ return "INVALID";
3588
+ break;
3589
+ case 42:
3590
+ return 5;
3591
+ break;
3592
+ }
3593
+ };
3594
+ lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{\/)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/];
3595
+ lexer.conditions = { mu: { rules: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], inclusive: false }, emu: { rules: [2], inclusive: false }, com: { rules: [5], inclusive: false }, raw: { rules: [3, 4], inclusive: false }, INITIAL: { rules: [0, 1, 42], inclusive: true } };
3596
+ return lexer;
3597
+ })();
3598
+ parser.lexer = lexer;
3599
+ function Parser() {
3600
+ this.yy = {};
3601
+ }Parser.prototype = parser;parser.Parser = Parser;
3602
+ return new Parser();
3603
+ })();exports["default"] = handlebars;
3604
+ module.exports = exports["default"];
3605
+
3606
+ /***/ },
3607
+ /* 16 */
3608
+ /***/ function(module, exports, __webpack_require__) {
3609
+
3610
+ 'use strict';
3611
+
3612
+ var _interopRequireDefault = __webpack_require__(8)['default'];
3613
+
3614
+ exports.__esModule = true;
3615
+
3616
+ var _Visitor = __webpack_require__(6);
3617
+
3618
+ var _Visitor2 = _interopRequireDefault(_Visitor);
3619
+
3620
+ function WhitespaceControl() {}
3621
+ WhitespaceControl.prototype = new _Visitor2['default']();
3622
+
3623
+ WhitespaceControl.prototype.Program = function (program) {
3624
+ var isRoot = !this.isRootSeen;
3625
+ this.isRootSeen = true;
3626
+
3627
+ var body = program.body;
3628
+ for (var i = 0, l = body.length; i < l; i++) {
3629
+ var current = body[i],
3630
+ strip = this.accept(current);
3631
+
3632
+ if (!strip) {
3633
+ continue;
3634
+ }
3635
+
3636
+ var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
3637
+ _isNextWhitespace = isNextWhitespace(body, i, isRoot),
3638
+ openStandalone = strip.openStandalone && _isPrevWhitespace,
3639
+ closeStandalone = strip.closeStandalone && _isNextWhitespace,
3640
+ inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
3641
+
3642
+ if (strip.close) {
3643
+ omitRight(body, i, true);
3644
+ }
3645
+ if (strip.open) {
3646
+ omitLeft(body, i, true);
3647
+ }
3648
+
3649
+ if (inlineStandalone) {
3650
+ omitRight(body, i);
3651
+
3652
+ if (omitLeft(body, i)) {
3653
+ // If we are on a standalone node, save the indent info for partials
3654
+ if (current.type === 'PartialStatement') {
3655
+ // Pull out the whitespace from the final line
3656
+ current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
3657
+ }
3658
+ }
3659
+ }
3660
+ if (openStandalone) {
3661
+ omitRight((current.program || current.inverse).body);
3662
+
3663
+ // Strip out the previous content node if it's whitespace only
3664
+ omitLeft(body, i);
3665
+ }
3666
+ if (closeStandalone) {
3667
+ // Always strip the next node
3668
+ omitRight(body, i);
3669
+
3670
+ omitLeft((current.inverse || current.program).body);
3671
+ }
3672
+ }
3673
+
3674
+ return program;
3675
+ };
3676
+ WhitespaceControl.prototype.BlockStatement = function (block) {
3677
+ this.accept(block.program);
3678
+ this.accept(block.inverse);
3679
+
3680
+ // Find the inverse program that is involed with whitespace stripping.
3681
+ var program = block.program || block.inverse,
3682
+ inverse = block.program && block.inverse,
3683
+ firstInverse = inverse,
3684
+ lastInverse = inverse;
3685
+
3686
+ if (inverse && inverse.chained) {
3687
+ firstInverse = inverse.body[0].program;
3688
+
3689
+ // Walk the inverse chain to find the last inverse that is actually in the chain.
3690
+ while (lastInverse.chained) {
3691
+ lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
3692
+ }
3693
+ }
3694
+
3695
+ var strip = {
3696
+ open: block.openStrip.open,
3697
+ close: block.closeStrip.close,
3698
+
3699
+ // Determine the standalone candiacy. Basically flag our content as being possibly standalone
3700
+ // so our parent can determine if we actually are standalone
3701
+ openStandalone: isNextWhitespace(program.body),
3702
+ closeStandalone: isPrevWhitespace((firstInverse || program).body)
3703
+ };
3704
+
3705
+ if (block.openStrip.close) {
3706
+ omitRight(program.body, null, true);
3707
+ }
3708
+
3709
+ if (inverse) {
3710
+ var inverseStrip = block.inverseStrip;
3711
+
3712
+ if (inverseStrip.open) {
3713
+ omitLeft(program.body, null, true);
3714
+ }
3715
+
3716
+ if (inverseStrip.close) {
3717
+ omitRight(firstInverse.body, null, true);
3718
+ }
3719
+ if (block.closeStrip.open) {
3720
+ omitLeft(lastInverse.body, null, true);
3721
+ }
3722
+
3723
+ // Find standalone else statments
3724
+ if (isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
3725
+ omitLeft(program.body);
3726
+ omitRight(firstInverse.body);
3727
+ }
3728
+ } else if (block.closeStrip.open) {
3729
+ omitLeft(program.body, null, true);
3730
+ }
3731
+
3732
+ return strip;
3733
+ };
3734
+
3735
+ WhitespaceControl.prototype.MustacheStatement = function (mustache) {
3736
+ return mustache.strip;
3737
+ };
3738
+
3739
+ WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
3740
+ /* istanbul ignore next */
3741
+ var strip = node.strip || {};
3742
+ return {
3743
+ inlineStandalone: true,
3744
+ open: strip.open,
3745
+ close: strip.close
3746
+ };
3747
+ };
3748
+
3749
+ function isPrevWhitespace(body, i, isRoot) {
3750
+ if (i === undefined) {
3751
+ i = body.length;
3752
+ }
3753
+
3754
+ // Nodes that end with newlines are considered whitespace (but are special
3755
+ // cased for strip operations)
3756
+ var prev = body[i - 1],
3757
+ sibling = body[i - 2];
3758
+ if (!prev) {
3759
+ return isRoot;
3760
+ }
3761
+
3762
+ if (prev.type === 'ContentStatement') {
3763
+ return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
3764
+ }
3765
+ }
3766
+ function isNextWhitespace(body, i, isRoot) {
3767
+ if (i === undefined) {
3768
+ i = -1;
3769
+ }
3770
+
3771
+ var next = body[i + 1],
3772
+ sibling = body[i + 2];
3773
+ if (!next) {
3774
+ return isRoot;
3775
+ }
3776
+
3777
+ if (next.type === 'ContentStatement') {
3778
+ return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
3779
+ }
3780
+ }
3781
+
3782
+ // Marks the node to the right of the position as omitted.
3783
+ // I.e. {{foo}}' ' will mark the ' ' node as omitted.
3784
+ //
3785
+ // If i is undefined, then the first child will be marked as such.
3786
+ //
3787
+ // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
3788
+ // content is met.
3789
+ function omitRight(body, i, multiple) {
3790
+ var current = body[i == null ? 0 : i + 1];
3791
+ if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
3792
+ return;
3793
+ }
3794
+
3795
+ var original = current.value;
3796
+ current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
3797
+ current.rightStripped = current.value !== original;
3798
+ }
3799
+
3800
+ // Marks the node to the left of the position as omitted.
3801
+ // I.e. ' '{{foo}} will mark the ' ' node as omitted.
3802
+ //
3803
+ // If i is undefined then the last child will be marked as such.
3804
+ //
3805
+ // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
3806
+ // content is met.
3807
+ function omitLeft(body, i, multiple) {
3808
+ var current = body[i == null ? body.length - 1 : i - 1];
3809
+ if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
3810
+ return;
3811
+ }
3812
+
3813
+ // We omit the last node if it's whitespace only and not preceeded by a non-content node.
3814
+ var original = current.value;
3815
+ current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
3816
+ current.leftStripped = current.value !== original;
3817
+ return current.leftStripped;
3818
+ }
3819
+
3820
+ exports['default'] = WhitespaceControl;
3821
+ module.exports = exports['default'];
3822
+
3823
+ /***/ },
3824
+ /* 17 */
3825
+ /***/ function(module, exports, __webpack_require__) {
3826
+
3827
+ 'use strict';
3828
+
3829
+ var _interopRequireDefault = __webpack_require__(8)['default'];
3830
+
3831
+ exports.__esModule = true;
3832
+ exports.SourceLocation = SourceLocation;
3833
+ exports.id = id;
3834
+ exports.stripFlags = stripFlags;
3835
+ exports.stripComment = stripComment;
3836
+ exports.preparePath = preparePath;
3837
+ exports.prepareMustache = prepareMustache;
3838
+ exports.prepareRawBlock = prepareRawBlock;
3839
+ exports.prepareBlock = prepareBlock;
3840
+
3841
+ var _Exception = __webpack_require__(12);
3842
+
3843
+ var _Exception2 = _interopRequireDefault(_Exception);
3844
+
3845
+ function SourceLocation(source, locInfo) {
3846
+ this.source = source;
3847
+ this.start = {
3848
+ line: locInfo.first_line,
3849
+ column: locInfo.first_column
3850
+ };
3851
+ this.end = {
3852
+ line: locInfo.last_line,
3853
+ column: locInfo.last_column
3854
+ };
3855
+ }
3856
+
3857
+ function id(token) {
3858
+ if (/^\[.*\]$/.test(token)) {
3859
+ return token.substr(1, token.length - 2);
3860
+ } else {
3861
+ return token;
3862
+ }
3863
+ }
3864
+
3865
+ function stripFlags(open, close) {
3866
+ return {
3867
+ open: open.charAt(2) === '~',
3868
+ close: close.charAt(close.length - 3) === '~'
3869
+ };
3870
+ }
3871
+
3872
+ function stripComment(comment) {
3873
+ return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, '');
3874
+ }
3875
+
3876
+ function preparePath(data, parts, locInfo) {
3877
+ locInfo = this.locInfo(locInfo);
3878
+
3879
+ var original = data ? '@' : '',
3880
+ dig = [],
3881
+ depth = 0,
3882
+ depthString = '';
3883
+
3884
+ for (var i = 0, l = parts.length; i < l; i++) {
3885
+ var part = parts[i].part,
3886
+
3887
+ // If we have [] syntax then we do not treat path references as operators,
3888
+ // i.e. foo.[this] resolves to approximately context.foo['this']
3889
+ isLiteral = parts[i].original !== part;
3890
+ original += (parts[i].separator || '') + part;
3891
+
3892
+ if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
3893
+ if (dig.length > 0) {
3894
+ throw new _Exception2['default']('Invalid path: ' + original, { loc: locInfo });
3895
+ } else if (part === '..') {
3896
+ depth++;
3897
+ depthString += '../';
3898
+ }
3899
+ } else {
3900
+ dig.push(part);
3901
+ }
3902
+ }
3903
+
3904
+ return new this.PathExpression(data, depth, dig, original, locInfo);
3905
+ }
3906
+
3907
+ function prepareMustache(path, params, hash, open, strip, locInfo) {
3908
+ // Must use charAt to support IE pre-10
3909
+ var escapeFlag = open.charAt(3) || open.charAt(2),
3910
+ escaped = escapeFlag !== '{' && escapeFlag !== '&';
3911
+
3912
+ return new this.MustacheStatement(path, params, hash, escaped, strip, this.locInfo(locInfo));
3913
+ }
3914
+
3915
+ function prepareRawBlock(openRawBlock, content, close, locInfo) {
3916
+ if (openRawBlock.path.original !== close) {
3917
+ var errorNode = { loc: openRawBlock.path.loc };
3918
+
3919
+ throw new _Exception2['default'](openRawBlock.path.original + ' doesn\'t match ' + close, errorNode);
3920
+ }
3921
+
3922
+ locInfo = this.locInfo(locInfo);
3923
+ var program = new this.Program([content], null, {}, locInfo);
3924
+
3925
+ return new this.BlockStatement(openRawBlock.path, openRawBlock.params, openRawBlock.hash, program, undefined, {}, {}, {}, locInfo);
3926
+ }
3927
+
3928
+ function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
3929
+ // When we are chaining inverse calls, we will not have a close path
3930
+ if (close && close.path && openBlock.path.original !== close.path.original) {
3931
+ var errorNode = { loc: openBlock.path.loc };
3932
+
3933
+ throw new _Exception2['default'](openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode);
3934
+ }
3935
+
3936
+ program.blockParams = openBlock.blockParams;
3937
+
3938
+ var inverse = undefined,
3939
+ inverseStrip = undefined;
3940
+
3941
+ if (inverseAndProgram) {
3942
+ if (inverseAndProgram.chain) {
3943
+ inverseAndProgram.program.body[0].closeStrip = close.strip;
3944
+ }
3945
+
3946
+ inverseStrip = inverseAndProgram.strip;
3947
+ inverse = inverseAndProgram.program;
3948
+ }
3949
+
3950
+ if (inverted) {
3951
+ inverted = inverse;
3952
+ inverse = program;
3953
+ program = inverted;
3954
+ }
3955
+
3956
+ return new this.BlockStatement(openBlock.path, openBlock.params, openBlock.hash, program, inverse, openBlock.strip, inverseStrip, close && close.strip, this.locInfo(locInfo));
3957
+ }
3958
+
3959
+ /***/ },
3960
+ /* 18 */
3961
+ /***/ function(module, exports, __webpack_require__) {
3962
+
3963
+ 'use strict';
3964
+
3965
+ exports.__esModule = true;
3966
+ /*global define */
3967
+
3968
+ var _isArray = __webpack_require__(13);
3969
+
3970
+ var SourceNode = undefined;
3971
+
3972
+ try {
3973
+ /* istanbul ignore next */
3974
+ if (false) {
3975
+ // We don't support this in AMD environments. For these environments, we asusme that
3976
+ // they are running on the browser and thus have no need for the source-map library.
3977
+ var SourceMap = require('source-map');
3978
+ SourceNode = SourceMap.SourceNode;
3979
+ }
3980
+ } catch (err) {}
3981
+
3982
+ /* istanbul ignore if: tested but not covered in istanbul due to dist build */
3983
+ if (!SourceNode) {
3984
+ SourceNode = function (line, column, srcFile, chunks) {
3985
+ this.src = '';
3986
+ if (chunks) {
3987
+ this.add(chunks);
3988
+ }
3989
+ };
3990
+ /* istanbul ignore next */
3991
+ SourceNode.prototype = {
3992
+ add: function add(chunks) {
3993
+ if (_isArray.isArray(chunks)) {
3994
+ chunks = chunks.join('');
3995
+ }
3996
+ this.src += chunks;
3997
+ },
3998
+ prepend: function prepend(chunks) {
3999
+ if (_isArray.isArray(chunks)) {
4000
+ chunks = chunks.join('');
4001
+ }
4002
+ this.src = chunks + this.src;
4003
+ },
4004
+ toStringWithSourceMap: function toStringWithSourceMap() {
4005
+ return { code: this.toString() };
4006
+ },
4007
+ toString: function toString() {
4008
+ return this.src;
4009
+ }
4010
+ };
4011
+ }
4012
+
4013
+ function castChunk(chunk, codeGen, loc) {
4014
+ if (_isArray.isArray(chunk)) {
4015
+ var ret = [];
4016
+
4017
+ for (var i = 0, len = chunk.length; i < len; i++) {
4018
+ ret.push(codeGen.wrap(chunk[i], loc));
4019
+ }
4020
+ return ret;
4021
+ } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
4022
+ // Handle primitives that the SourceNode will throw up on
4023
+ return chunk + '';
4024
+ }
4025
+ return chunk;
4026
+ }
4027
+
4028
+ function CodeGen(srcFile) {
4029
+ this.srcFile = srcFile;
4030
+ this.source = [];
4031
+ }
4032
+
4033
+ CodeGen.prototype = {
4034
+ prepend: function prepend(source, loc) {
4035
+ this.source.unshift(this.wrap(source, loc));
4036
+ },
4037
+ push: function push(source, loc) {
4038
+ this.source.push(this.wrap(source, loc));
4039
+ },
4040
+
4041
+ merge: function merge() {
4042
+ var source = this.empty();
4043
+ this.each(function (line) {
4044
+ source.add([' ', line, '\n']);
4045
+ });
4046
+ return source;
4047
+ },
4048
+
4049
+ each: function each(iter) {
4050
+ for (var i = 0, len = this.source.length; i < len; i++) {
4051
+ iter(this.source[i]);
4052
+ }
4053
+ },
4054
+
4055
+ empty: function empty() {
4056
+ var loc = arguments[0] === undefined ? this.currentLocation || { start: {} } : arguments[0];
4057
+
4058
+ return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
4059
+ },
4060
+ wrap: function wrap(chunk) {
4061
+ var loc = arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
4062
+
4063
+ if (chunk instanceof SourceNode) {
4064
+ return chunk;
4065
+ }
4066
+
4067
+ chunk = castChunk(chunk, this, loc);
4068
+
4069
+ return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
4070
+ },
4071
+
4072
+ functionCall: function functionCall(fn, type, params) {
4073
+ params = this.generateList(params);
4074
+ return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
4075
+ },
4076
+
4077
+ quotedString: function quotedString(str) {
4078
+ return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
4079
+ .replace(/\u2029/g, '\\u2029') + '"';
4080
+ },
4081
+
4082
+ objectLiteral: function objectLiteral(obj) {
4083
+ var pairs = [];
4084
+
4085
+ for (var key in obj) {
4086
+ if (obj.hasOwnProperty(key)) {
4087
+ var value = castChunk(obj[key], this);
4088
+ if (value !== 'undefined') {
4089
+ pairs.push([this.quotedString(key), ':', value]);
4090
+ }
4091
+ }
4092
+ }
4093
+
4094
+ var ret = this.generateList(pairs);
4095
+ ret.prepend('{');
4096
+ ret.add('}');
4097
+ return ret;
4098
+ },
4099
+
4100
+ generateList: function generateList(entries, loc) {
4101
+ var ret = this.empty(loc);
4102
+
4103
+ for (var i = 0, len = entries.length; i < len; i++) {
4104
+ if (i) {
4105
+ ret.add(',');
4106
+ }
4107
+
4108
+ ret.add(castChunk(entries[i], this, loc));
4109
+ }
4110
+
4111
+ return ret;
4112
+ },
4113
+
4114
+ generateArray: function generateArray(entries, loc) {
4115
+ var ret = this.generateList(entries, loc);
4116
+ ret.prepend('[');
4117
+ ret.add(']');
4118
+
4119
+ return ret;
4120
+ }
4121
+ };
4122
+
4123
+ exports['default'] = CodeGen;
4124
+ module.exports = exports['default'];
4125
+
4126
+ /* NOP */
4127
+
4128
+ /***/ }
4129
+ /******/ ])
4130
+ });
4131
+ ;