blob: baad5d3d97e64ef95cae6d0a349da1a6532bc068 [file] [log] [blame]
vasrazc9bfcc92021-05-11 12:44:06 +01001/**!
2
3 @license
4 handlebars v4.7.7
5
6Copyright (C) 2011-2019 by Yehuda Katz
7
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this software and associated documentation files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in
16all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24THE SOFTWARE.
25
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() {
37return /******/ (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__(1)['default'];
86
87 exports.__esModule = true;
88
89 var _handlebarsRuntime = __webpack_require__(2);
90
91 var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
92
93 // Compiler imports
94
95 var _handlebarsCompilerAst = __webpack_require__(45);
96
97 var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
98
99 var _handlebarsCompilerBase = __webpack_require__(46);
100
101 var _handlebarsCompilerCompiler = __webpack_require__(51);
102
103 var _handlebarsCompilerJavascriptCompiler = __webpack_require__(52);
104
105 var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
106
107 var _handlebarsCompilerVisitor = __webpack_require__(49);
108
109 var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
110
111 var _handlebarsNoConflict = __webpack_require__(44);
112
113 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
114
115 var _create = _handlebarsRuntime2['default'].create;
116 function create() {
117 var hb = _create();
118
119 hb.compile = function (input, options) {
120 return _handlebarsCompilerCompiler.compile(input, options, hb);
121 };
122 hb.precompile = function (input, options) {
123 return _handlebarsCompilerCompiler.precompile(input, options, hb);
124 };
125
126 hb.AST = _handlebarsCompilerAst2['default'];
127 hb.Compiler = _handlebarsCompilerCompiler.Compiler;
128 hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
129 hb.Parser = _handlebarsCompilerBase.parser;
130 hb.parse = _handlebarsCompilerBase.parse;
131 hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
132
133 return hb;
134 }
135
136 var inst = create();
137 inst.create = create;
138
139 _handlebarsNoConflict2['default'](inst);
140
141 inst.Visitor = _handlebarsCompilerVisitor2['default'];
142
143 inst['default'] = inst;
144
145 exports['default'] = inst;
146 module.exports = exports['default'];
147
148/***/ }),
149/* 1 */
150/***/ (function(module, exports) {
151
152 "use strict";
153
154 exports["default"] = function (obj) {
155 return obj && obj.__esModule ? obj : {
156 "default": obj
157 };
158 };
159
160 exports.__esModule = true;
161
162/***/ }),
163/* 2 */
164/***/ (function(module, exports, __webpack_require__) {
165
166 'use strict';
167
168 var _interopRequireWildcard = __webpack_require__(3)['default'];
169
170 var _interopRequireDefault = __webpack_require__(1)['default'];
171
172 exports.__esModule = true;
173
174 var _handlebarsBase = __webpack_require__(4);
175
176 var base = _interopRequireWildcard(_handlebarsBase);
177
178 // Each of these augment the Handlebars object. No need to setup here.
179 // (This is done to easily share code between commonjs and browse envs)
180
181 var _handlebarsSafeString = __webpack_require__(37);
182
183 var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
184
185 var _handlebarsException = __webpack_require__(6);
186
187 var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
188
189 var _handlebarsUtils = __webpack_require__(5);
190
191 var Utils = _interopRequireWildcard(_handlebarsUtils);
192
193 var _handlebarsRuntime = __webpack_require__(38);
194
195 var runtime = _interopRequireWildcard(_handlebarsRuntime);
196
197 var _handlebarsNoConflict = __webpack_require__(44);
198
199 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
200
201 // For compatibility and usage outside of module systems, make the Handlebars object a namespace
202 function create() {
203 var hb = new base.HandlebarsEnvironment();
204
205 Utils.extend(hb, base);
206 hb.SafeString = _handlebarsSafeString2['default'];
207 hb.Exception = _handlebarsException2['default'];
208 hb.Utils = Utils;
209 hb.escapeExpression = Utils.escapeExpression;
210
211 hb.VM = runtime;
212 hb.template = function (spec) {
213 return runtime.template(spec, hb);
214 };
215
216 return hb;
217 }
218
219 var inst = create();
220 inst.create = create;
221
222 _handlebarsNoConflict2['default'](inst);
223
224 inst['default'] = inst;
225
226 exports['default'] = inst;
227 module.exports = exports['default'];
228
229/***/ }),
230/* 3 */
231/***/ (function(module, exports) {
232
233 "use strict";
234
235 exports["default"] = function (obj) {
236 if (obj && obj.__esModule) {
237 return obj;
238 } else {
239 var newObj = {};
240
241 if (obj != null) {
242 for (var key in obj) {
243 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
244 }
245 }
246
247 newObj["default"] = obj;
248 return newObj;
249 }
250 };
251
252 exports.__esModule = true;
253
254/***/ }),
255/* 4 */
256/***/ (function(module, exports, __webpack_require__) {
257
258 'use strict';
259
260 var _interopRequireDefault = __webpack_require__(1)['default'];
261
262 exports.__esModule = true;
263 exports.HandlebarsEnvironment = HandlebarsEnvironment;
264
265 var _utils = __webpack_require__(5);
266
267 var _exception = __webpack_require__(6);
268
269 var _exception2 = _interopRequireDefault(_exception);
270
271 var _helpers = __webpack_require__(10);
272
273 var _decorators = __webpack_require__(30);
274
275 var _logger = __webpack_require__(32);
276
277 var _logger2 = _interopRequireDefault(_logger);
278
279 var _internalProtoAccess = __webpack_require__(33);
280
281 var VERSION = '4.7.7';
282 exports.VERSION = VERSION;
283 var COMPILER_REVISION = 8;
284 exports.COMPILER_REVISION = COMPILER_REVISION;
285 var LAST_COMPATIBLE_COMPILER_REVISION = 7;
286
287 exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
288 var REVISION_CHANGES = {
289 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
290 2: '== 1.0.0-rc.3',
291 3: '== 1.0.0-rc.4',
292 4: '== 1.x.x',
293 5: '== 2.0.0-alpha.x',
294 6: '>= 2.0.0-beta.1',
295 7: '>= 4.0.0 <4.3.0',
296 8: '>= 4.3.0'
297 };
298
299 exports.REVISION_CHANGES = REVISION_CHANGES;
300 var objectType = '[object Object]';
301
302 function HandlebarsEnvironment(helpers, partials, decorators) {
303 this.helpers = helpers || {};
304 this.partials = partials || {};
305 this.decorators = decorators || {};
306
307 _helpers.registerDefaultHelpers(this);
308 _decorators.registerDefaultDecorators(this);
309 }
310
311 HandlebarsEnvironment.prototype = {
312 constructor: HandlebarsEnvironment,
313
314 logger: _logger2['default'],
315 log: _logger2['default'].log,
316
317 registerHelper: function registerHelper(name, fn) {
318 if (_utils.toString.call(name) === objectType) {
319 if (fn) {
320 throw new _exception2['default']('Arg not supported with multiple helpers');
321 }
322 _utils.extend(this.helpers, name);
323 } else {
324 this.helpers[name] = fn;
325 }
326 },
327 unregisterHelper: function unregisterHelper(name) {
328 delete this.helpers[name];
329 },
330
331 registerPartial: function registerPartial(name, partial) {
332 if (_utils.toString.call(name) === objectType) {
333 _utils.extend(this.partials, name);
334 } else {
335 if (typeof partial === 'undefined') {
336 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
337 }
338 this.partials[name] = partial;
339 }
340 },
341 unregisterPartial: function unregisterPartial(name) {
342 delete this.partials[name];
343 },
344
345 registerDecorator: function registerDecorator(name, fn) {
346 if (_utils.toString.call(name) === objectType) {
347 if (fn) {
348 throw new _exception2['default']('Arg not supported with multiple decorators');
349 }
350 _utils.extend(this.decorators, name);
351 } else {
352 this.decorators[name] = fn;
353 }
354 },
355 unregisterDecorator: function unregisterDecorator(name) {
356 delete this.decorators[name];
357 },
358 /**
359 * Reset the memory of illegal property accesses that have already been logged.
360 * @deprecated should only be used in handlebars test-cases
361 */
362 resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
363 _internalProtoAccess.resetLoggedProperties();
364 }
365 };
366
367 var log = _logger2['default'].log;
368
369 exports.log = log;
370 exports.createFrame = _utils.createFrame;
371 exports.logger = _logger2['default'];
372
373/***/ }),
374/* 5 */
375/***/ (function(module, exports) {
376
377 'use strict';
378
379 exports.__esModule = true;
380 exports.extend = extend;
381 exports.indexOf = indexOf;
382 exports.escapeExpression = escapeExpression;
383 exports.isEmpty = isEmpty;
384 exports.createFrame = createFrame;
385 exports.blockParams = blockParams;
386 exports.appendContextPath = appendContextPath;
387 var escape = {
388 '&': '&amp;',
389 '<': '&lt;',
390 '>': '&gt;',
391 '"': '&quot;',
392 "'": '&#x27;',
393 '`': '&#x60;',
394 '=': '&#x3D;'
395 };
396
397 var badChars = /[&<>"'`=]/g,
398 possible = /[&<>"'`=]/;
399
400 function escapeChar(chr) {
401 return escape[chr];
402 }
403
404 function extend(obj /* , ...source */) {
405 for (var i = 1; i < arguments.length; i++) {
406 for (var key in arguments[i]) {
407 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
408 obj[key] = arguments[i][key];
409 }
410 }
411 }
412
413 return obj;
414 }
415
416 var toString = Object.prototype.toString;
417
418 exports.toString = toString;
419 // Sourced from lodash
420 // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
421 /* eslint-disable func-style */
422 var isFunction = function isFunction(value) {
423 return typeof value === 'function';
424 };
425 // fallback for older versions of Chrome and Safari
426 /* istanbul ignore next */
427 if (isFunction(/x/)) {
428 exports.isFunction = isFunction = function (value) {
429 return typeof value === 'function' && toString.call(value) === '[object Function]';
430 };
431 }
432 exports.isFunction = isFunction;
433
434 /* eslint-enable func-style */
435
436 /* istanbul ignore next */
437 var isArray = Array.isArray || function (value) {
438 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
439 };
440
441 exports.isArray = isArray;
442 // Older IE versions do not directly support indexOf so we must implement our own, sadly.
443
444 function indexOf(array, value) {
445 for (var i = 0, len = array.length; i < len; i++) {
446 if (array[i] === value) {
447 return i;
448 }
449 }
450 return -1;
451 }
452
453 function escapeExpression(string) {
454 if (typeof string !== 'string') {
455 // don't escape SafeStrings, since they're already safe
456 if (string && string.toHTML) {
457 return string.toHTML();
458 } else if (string == null) {
459 return '';
460 } else if (!string) {
461 return string + '';
462 }
463
464 // Force a string conversion as this will be done by the append regardless and
465 // the regex test will do this transparently behind the scenes, causing issues if
466 // an object's to string has escaped characters in it.
467 string = '' + string;
468 }
469
470 if (!possible.test(string)) {
471 return string;
472 }
473 return string.replace(badChars, escapeChar);
474 }
475
476 function isEmpty(value) {
477 if (!value && value !== 0) {
478 return true;
479 } else if (isArray(value) && value.length === 0) {
480 return true;
481 } else {
482 return false;
483 }
484 }
485
486 function createFrame(object) {
487 var frame = extend({}, object);
488 frame._parent = object;
489 return frame;
490 }
491
492 function blockParams(params, ids) {
493 params.path = ids;
494 return params;
495 }
496
497 function appendContextPath(contextPath, id) {
498 return (contextPath ? contextPath + '.' : '') + id;
499 }
500
501/***/ }),
502/* 6 */
503/***/ (function(module, exports, __webpack_require__) {
504
505 'use strict';
506
507 var _Object$defineProperty = __webpack_require__(7)['default'];
508
509 exports.__esModule = true;
510 var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
511
512 function Exception(message, node) {
513 var loc = node && node.loc,
514 line = undefined,
515 endLineNumber = undefined,
516 column = undefined,
517 endColumn = undefined;
518
519 if (loc) {
520 line = loc.start.line;
521 endLineNumber = loc.end.line;
522 column = loc.start.column;
523 endColumn = loc.end.column;
524
525 message += ' - ' + line + ':' + column;
526 }
527
528 var tmp = Error.prototype.constructor.call(this, message);
529
530 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
531 for (var idx = 0; idx < errorProps.length; idx++) {
532 this[errorProps[idx]] = tmp[errorProps[idx]];
533 }
534
535 /* istanbul ignore else */
536 if (Error.captureStackTrace) {
537 Error.captureStackTrace(this, Exception);
538 }
539
540 try {
541 if (loc) {
542 this.lineNumber = line;
543 this.endLineNumber = endLineNumber;
544
545 // Work around issue under safari where we can't directly set the column value
546 /* istanbul ignore next */
547 if (_Object$defineProperty) {
548 Object.defineProperty(this, 'column', {
549 value: column,
550 enumerable: true
551 });
552 Object.defineProperty(this, 'endColumn', {
553 value: endColumn,
554 enumerable: true
555 });
556 } else {
557 this.column = column;
558 this.endColumn = endColumn;
559 }
560 }
561 } catch (nop) {
562 /* Ignore if the browser is very particular */
563 }
564 }
565
566 Exception.prototype = new Error();
567
568 exports['default'] = Exception;
569 module.exports = exports['default'];
570
571/***/ }),
572/* 7 */
573/***/ (function(module, exports, __webpack_require__) {
574
575 module.exports = { "default": __webpack_require__(8), __esModule: true };
576
577/***/ }),
578/* 8 */
579/***/ (function(module, exports, __webpack_require__) {
580
581 var $ = __webpack_require__(9);
582 module.exports = function defineProperty(it, key, desc){
583 return $.setDesc(it, key, desc);
584 };
585
586/***/ }),
587/* 9 */
588/***/ (function(module, exports) {
589
590 var $Object = Object;
591 module.exports = {
592 create: $Object.create,
593 getProto: $Object.getPrototypeOf,
594 isEnum: {}.propertyIsEnumerable,
595 getDesc: $Object.getOwnPropertyDescriptor,
596 setDesc: $Object.defineProperty,
597 setDescs: $Object.defineProperties,
598 getKeys: $Object.keys,
599 getNames: $Object.getOwnPropertyNames,
600 getSymbols: $Object.getOwnPropertySymbols,
601 each: [].forEach
602 };
603
604/***/ }),
605/* 10 */
606/***/ (function(module, exports, __webpack_require__) {
607
608 'use strict';
609
610 var _interopRequireDefault = __webpack_require__(1)['default'];
611
612 exports.__esModule = true;
613 exports.registerDefaultHelpers = registerDefaultHelpers;
614 exports.moveHelperToHooks = moveHelperToHooks;
615
616 var _helpersBlockHelperMissing = __webpack_require__(11);
617
618 var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
619
620 var _helpersEach = __webpack_require__(12);
621
622 var _helpersEach2 = _interopRequireDefault(_helpersEach);
623
624 var _helpersHelperMissing = __webpack_require__(25);
625
626 var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
627
628 var _helpersIf = __webpack_require__(26);
629
630 var _helpersIf2 = _interopRequireDefault(_helpersIf);
631
632 var _helpersLog = __webpack_require__(27);
633
634 var _helpersLog2 = _interopRequireDefault(_helpersLog);
635
636 var _helpersLookup = __webpack_require__(28);
637
638 var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
639
640 var _helpersWith = __webpack_require__(29);
641
642 var _helpersWith2 = _interopRequireDefault(_helpersWith);
643
644 function registerDefaultHelpers(instance) {
645 _helpersBlockHelperMissing2['default'](instance);
646 _helpersEach2['default'](instance);
647 _helpersHelperMissing2['default'](instance);
648 _helpersIf2['default'](instance);
649 _helpersLog2['default'](instance);
650 _helpersLookup2['default'](instance);
651 _helpersWith2['default'](instance);
652 }
653
654 function moveHelperToHooks(instance, helperName, keepHelper) {
655 if (instance.helpers[helperName]) {
656 instance.hooks[helperName] = instance.helpers[helperName];
657 if (!keepHelper) {
658 delete instance.helpers[helperName];
659 }
660 }
661 }
662
663/***/ }),
664/* 11 */
665/***/ (function(module, exports, __webpack_require__) {
666
667 'use strict';
668
669 exports.__esModule = true;
670
671 var _utils = __webpack_require__(5);
672
673 exports['default'] = function (instance) {
674 instance.registerHelper('blockHelperMissing', function (context, options) {
675 var inverse = options.inverse,
676 fn = options.fn;
677
678 if (context === true) {
679 return fn(this);
680 } else if (context === false || context == null) {
681 return inverse(this);
682 } else if (_utils.isArray(context)) {
683 if (context.length > 0) {
684 if (options.ids) {
685 options.ids = [options.name];
686 }
687
688 return instance.helpers.each(context, options);
689 } else {
690 return inverse(this);
691 }
692 } else {
693 if (options.data && options.ids) {
694 var data = _utils.createFrame(options.data);
695 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
696 options = { data: data };
697 }
698
699 return fn(context, options);
700 }
701 });
702 };
703
704 module.exports = exports['default'];
705
706/***/ }),
707/* 12 */
708/***/ (function(module, exports, __webpack_require__) {
709
710 /* WEBPACK VAR INJECTION */(function(global) {'use strict';
711
712 var _Object$keys = __webpack_require__(13)['default'];
713
714 var _interopRequireDefault = __webpack_require__(1)['default'];
715
716 exports.__esModule = true;
717
718 var _utils = __webpack_require__(5);
719
720 var _exception = __webpack_require__(6);
721
722 var _exception2 = _interopRequireDefault(_exception);
723
724 exports['default'] = function (instance) {
725 instance.registerHelper('each', function (context, options) {
726 if (!options) {
727 throw new _exception2['default']('Must pass iterator to #each');
728 }
729
730 var fn = options.fn,
731 inverse = options.inverse,
732 i = 0,
733 ret = '',
734 data = undefined,
735 contextPath = undefined;
736
737 if (options.data && options.ids) {
738 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
739 }
740
741 if (_utils.isFunction(context)) {
742 context = context.call(this);
743 }
744
745 if (options.data) {
746 data = _utils.createFrame(options.data);
747 }
748
749 function execIteration(field, index, last) {
750 if (data) {
751 data.key = field;
752 data.index = index;
753 data.first = index === 0;
754 data.last = !!last;
755
756 if (contextPath) {
757 data.contextPath = contextPath + field;
758 }
759 }
760
761 ret = ret + fn(context[field], {
762 data: data,
763 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
764 });
765 }
766
767 if (context && typeof context === 'object') {
768 if (_utils.isArray(context)) {
769 for (var j = context.length; i < j; i++) {
770 if (i in context) {
771 execIteration(i, i, i === context.length - 1);
772 }
773 }
774 } else if (global.Symbol && context[global.Symbol.iterator]) {
775 var newContext = [];
776 var iterator = context[global.Symbol.iterator]();
777 for (var it = iterator.next(); !it.done; it = iterator.next()) {
778 newContext.push(it.value);
779 }
780 context = newContext;
781 for (var j = context.length; i < j; i++) {
782 execIteration(i, i, i === context.length - 1);
783 }
784 } else {
785 (function () {
786 var priorKey = undefined;
787
788 _Object$keys(context).forEach(function (key) {
789 // We're running the iterations one step out of sync so we can detect
790 // the last iteration without have to scan the object twice and create
791 // an itermediate keys array.
792 if (priorKey !== undefined) {
793 execIteration(priorKey, i - 1);
794 }
795 priorKey = key;
796 i++;
797 });
798 if (priorKey !== undefined) {
799 execIteration(priorKey, i - 1, true);
800 }
801 })();
802 }
803 }
804
805 if (i === 0) {
806 ret = inverse(this);
807 }
808
809 return ret;
810 });
811 };
812
813 module.exports = exports['default'];
814 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
815
816/***/ }),
817/* 13 */
818/***/ (function(module, exports, __webpack_require__) {
819
820 module.exports = { "default": __webpack_require__(14), __esModule: true };
821
822/***/ }),
823/* 14 */
824/***/ (function(module, exports, __webpack_require__) {
825
826 __webpack_require__(15);
827 module.exports = __webpack_require__(21).Object.keys;
828
829/***/ }),
830/* 15 */
831/***/ (function(module, exports, __webpack_require__) {
832
833 // 19.1.2.14 Object.keys(O)
834 var toObject = __webpack_require__(16);
835
836 __webpack_require__(18)('keys', function($keys){
837 return function keys(it){
838 return $keys(toObject(it));
839 };
840 });
841
842/***/ }),
843/* 16 */
844/***/ (function(module, exports, __webpack_require__) {
845
846 // 7.1.13 ToObject(argument)
847 var defined = __webpack_require__(17);
848 module.exports = function(it){
849 return Object(defined(it));
850 };
851
852/***/ }),
853/* 17 */
854/***/ (function(module, exports) {
855
856 // 7.2.1 RequireObjectCoercible(argument)
857 module.exports = function(it){
858 if(it == undefined)throw TypeError("Can't call method on " + it);
859 return it;
860 };
861
862/***/ }),
863/* 18 */
864/***/ (function(module, exports, __webpack_require__) {
865
866 // most Object methods by ES6 should accept primitives
867 var $export = __webpack_require__(19)
868 , core = __webpack_require__(21)
869 , fails = __webpack_require__(24);
870 module.exports = function(KEY, exec){
871 var fn = (core.Object || {})[KEY] || Object[KEY]
872 , exp = {};
873 exp[KEY] = exec(fn);
874 $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
875 };
876
877/***/ }),
878/* 19 */
879/***/ (function(module, exports, __webpack_require__) {
880
881 var global = __webpack_require__(20)
882 , core = __webpack_require__(21)
883 , ctx = __webpack_require__(22)
884 , PROTOTYPE = 'prototype';
885
886 var $export = function(type, name, source){
887 var IS_FORCED = type & $export.F
888 , IS_GLOBAL = type & $export.G
889 , IS_STATIC = type & $export.S
890 , IS_PROTO = type & $export.P
891 , IS_BIND = type & $export.B
892 , IS_WRAP = type & $export.W
893 , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
894 , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
895 , key, own, out;
896 if(IS_GLOBAL)source = name;
897 for(key in source){
898 // contains in native
899 own = !IS_FORCED && target && key in target;
900 if(own && key in exports)continue;
901 // export native or passed
902 out = own ? target[key] : source[key];
903 // prevent global pollution for namespaces
904 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
905 // bind timers to global for call from export context
906 : IS_BIND && own ? ctx(out, global)
907 // wrap global constructors for prevent change them in library
908 : IS_WRAP && target[key] == out ? (function(C){
909 var F = function(param){
910 return this instanceof C ? new C(param) : C(param);
911 };
912 F[PROTOTYPE] = C[PROTOTYPE];
913 return F;
914 // make static versions for prototype methods
915 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
916 if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
917 }
918 };
919 // type bitmap
920 $export.F = 1; // forced
921 $export.G = 2; // global
922 $export.S = 4; // static
923 $export.P = 8; // proto
924 $export.B = 16; // bind
925 $export.W = 32; // wrap
926 module.exports = $export;
927
928/***/ }),
929/* 20 */
930/***/ (function(module, exports) {
931
932 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
933 var global = module.exports = typeof window != 'undefined' && window.Math == Math
934 ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
935 if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
936
937/***/ }),
938/* 21 */
939/***/ (function(module, exports) {
940
941 var core = module.exports = {version: '1.2.6'};
942 if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
943
944/***/ }),
945/* 22 */
946/***/ (function(module, exports, __webpack_require__) {
947
948 // optional / simple context binding
949 var aFunction = __webpack_require__(23);
950 module.exports = function(fn, that, length){
951 aFunction(fn);
952 if(that === undefined)return fn;
953 switch(length){
954 case 1: return function(a){
955 return fn.call(that, a);
956 };
957 case 2: return function(a, b){
958 return fn.call(that, a, b);
959 };
960 case 3: return function(a, b, c){
961 return fn.call(that, a, b, c);
962 };
963 }
964 return function(/* ...args */){
965 return fn.apply(that, arguments);
966 };
967 };
968
969/***/ }),
970/* 23 */
971/***/ (function(module, exports) {
972
973 module.exports = function(it){
974 if(typeof it != 'function')throw TypeError(it + ' is not a function!');
975 return it;
976 };
977
978/***/ }),
979/* 24 */
980/***/ (function(module, exports) {
981
982 module.exports = function(exec){
983 try {
984 return !!exec();
985 } catch(e){
986 return true;
987 }
988 };
989
990/***/ }),
991/* 25 */
992/***/ (function(module, exports, __webpack_require__) {
993
994 'use strict';
995
996 var _interopRequireDefault = __webpack_require__(1)['default'];
997
998 exports.__esModule = true;
999
1000 var _exception = __webpack_require__(6);
1001
1002 var _exception2 = _interopRequireDefault(_exception);
1003
1004 exports['default'] = function (instance) {
1005 instance.registerHelper('helperMissing', function () /* [args, ]options */{
1006 if (arguments.length === 1) {
1007 // A missing field in a {{foo}} construct.
1008 return undefined;
1009 } else {
1010 // Someone is actually trying to call something, blow up.
1011 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
1012 }
1013 });
1014 };
1015
1016 module.exports = exports['default'];
1017
1018/***/ }),
1019/* 26 */
1020/***/ (function(module, exports, __webpack_require__) {
1021
1022 'use strict';
1023
1024 var _interopRequireDefault = __webpack_require__(1)['default'];
1025
1026 exports.__esModule = true;
1027
1028 var _utils = __webpack_require__(5);
1029
1030 var _exception = __webpack_require__(6);
1031
1032 var _exception2 = _interopRequireDefault(_exception);
1033
1034 exports['default'] = function (instance) {
1035 instance.registerHelper('if', function (conditional, options) {
1036 if (arguments.length != 2) {
1037 throw new _exception2['default']('#if requires exactly one argument');
1038 }
1039 if (_utils.isFunction(conditional)) {
1040 conditional = conditional.call(this);
1041 }
1042
1043 // Default behavior is to render the positive path if the value is truthy and not empty.
1044 // The `includeZero` option may be set to treat the condtional as purely not empty based on the
1045 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
1046 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
1047 return options.inverse(this);
1048 } else {
1049 return options.fn(this);
1050 }
1051 });
1052
1053 instance.registerHelper('unless', function (conditional, options) {
1054 if (arguments.length != 2) {
1055 throw new _exception2['default']('#unless requires exactly one argument');
1056 }
1057 return instance.helpers['if'].call(this, conditional, {
1058 fn: options.inverse,
1059 inverse: options.fn,
1060 hash: options.hash
1061 });
1062 });
1063 };
1064
1065 module.exports = exports['default'];
1066
1067/***/ }),
1068/* 27 */
1069/***/ (function(module, exports) {
1070
1071 'use strict';
1072
1073 exports.__esModule = true;
1074
1075 exports['default'] = function (instance) {
1076 instance.registerHelper('log', function () /* message, options */{
1077 var args = [undefined],
1078 options = arguments[arguments.length - 1];
1079 for (var i = 0; i < arguments.length - 1; i++) {
1080 args.push(arguments[i]);
1081 }
1082
1083 var level = 1;
1084 if (options.hash.level != null) {
1085 level = options.hash.level;
1086 } else if (options.data && options.data.level != null) {
1087 level = options.data.level;
1088 }
1089 args[0] = level;
1090
1091 instance.log.apply(instance, args);
1092 });
1093 };
1094
1095 module.exports = exports['default'];
1096
1097/***/ }),
1098/* 28 */
1099/***/ (function(module, exports) {
1100
1101 'use strict';
1102
1103 exports.__esModule = true;
1104
1105 exports['default'] = function (instance) {
1106 instance.registerHelper('lookup', function (obj, field, options) {
1107 if (!obj) {
1108 // Note for 5.0: Change to "obj == null" in 5.0
1109 return obj;
1110 }
1111 return options.lookupProperty(obj, field);
1112 });
1113 };
1114
1115 module.exports = exports['default'];
1116
1117/***/ }),
1118/* 29 */
1119/***/ (function(module, exports, __webpack_require__) {
1120
1121 'use strict';
1122
1123 var _interopRequireDefault = __webpack_require__(1)['default'];
1124
1125 exports.__esModule = true;
1126
1127 var _utils = __webpack_require__(5);
1128
1129 var _exception = __webpack_require__(6);
1130
1131 var _exception2 = _interopRequireDefault(_exception);
1132
1133 exports['default'] = function (instance) {
1134 instance.registerHelper('with', function (context, options) {
1135 if (arguments.length != 2) {
1136 throw new _exception2['default']('#with requires exactly one argument');
1137 }
1138 if (_utils.isFunction(context)) {
1139 context = context.call(this);
1140 }
1141
1142 var fn = options.fn;
1143
1144 if (!_utils.isEmpty(context)) {
1145 var data = options.data;
1146 if (options.data && options.ids) {
1147 data = _utils.createFrame(options.data);
1148 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
1149 }
1150
1151 return fn(context, {
1152 data: data,
1153 blockParams: _utils.blockParams([context], [data && data.contextPath])
1154 });
1155 } else {
1156 return options.inverse(this);
1157 }
1158 });
1159 };
1160
1161 module.exports = exports['default'];
1162
1163/***/ }),
1164/* 30 */
1165/***/ (function(module, exports, __webpack_require__) {
1166
1167 'use strict';
1168
1169 var _interopRequireDefault = __webpack_require__(1)['default'];
1170
1171 exports.__esModule = true;
1172 exports.registerDefaultDecorators = registerDefaultDecorators;
1173
1174 var _decoratorsInline = __webpack_require__(31);
1175
1176 var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
1177
1178 function registerDefaultDecorators(instance) {
1179 _decoratorsInline2['default'](instance);
1180 }
1181
1182/***/ }),
1183/* 31 */
1184/***/ (function(module, exports, __webpack_require__) {
1185
1186 'use strict';
1187
1188 exports.__esModule = true;
1189
1190 var _utils = __webpack_require__(5);
1191
1192 exports['default'] = function (instance) {
1193 instance.registerDecorator('inline', function (fn, props, container, options) {
1194 var ret = fn;
1195 if (!props.partials) {
1196 props.partials = {};
1197 ret = function (context, options) {
1198 // Create a new partials stack frame prior to exec.
1199 var original = container.partials;
1200 container.partials = _utils.extend({}, original, props.partials);
1201 var ret = fn(context, options);
1202 container.partials = original;
1203 return ret;
1204 };
1205 }
1206
1207 props.partials[options.args[0]] = options.fn;
1208
1209 return ret;
1210 });
1211 };
1212
1213 module.exports = exports['default'];
1214
1215/***/ }),
1216/* 32 */
1217/***/ (function(module, exports, __webpack_require__) {
1218
1219 'use strict';
1220
1221 exports.__esModule = true;
1222
1223 var _utils = __webpack_require__(5);
1224
1225 var logger = {
1226 methodMap: ['debug', 'info', 'warn', 'error'],
1227 level: 'info',
1228
1229 // Maps a given level value to the `methodMap` indexes above.
1230 lookupLevel: function lookupLevel(level) {
1231 if (typeof level === 'string') {
1232 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
1233 if (levelMap >= 0) {
1234 level = levelMap;
1235 } else {
1236 level = parseInt(level, 10);
1237 }
1238 }
1239
1240 return level;
1241 },
1242
1243 // Can be overridden in the host environment
1244 log: function log(level) {
1245 level = logger.lookupLevel(level);
1246
1247 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
1248 var method = logger.methodMap[level];
1249 // eslint-disable-next-line no-console
1250 if (!console[method]) {
1251 method = 'log';
1252 }
1253
1254 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1255 message[_key - 1] = arguments[_key];
1256 }
1257
1258 console[method].apply(console, message); // eslint-disable-line no-console
1259 }
1260 }
1261 };
1262
1263 exports['default'] = logger;
1264 module.exports = exports['default'];
1265
1266/***/ }),
1267/* 33 */
1268/***/ (function(module, exports, __webpack_require__) {
1269
1270 'use strict';
1271
1272 var _Object$create = __webpack_require__(34)['default'];
1273
1274 var _Object$keys = __webpack_require__(13)['default'];
1275
1276 var _interopRequireWildcard = __webpack_require__(3)['default'];
1277
1278 exports.__esModule = true;
1279 exports.createProtoAccessControl = createProtoAccessControl;
1280 exports.resultIsAllowed = resultIsAllowed;
1281 exports.resetLoggedProperties = resetLoggedProperties;
1282
1283 var _createNewLookupObject = __webpack_require__(36);
1284
1285 var _logger = __webpack_require__(32);
1286
1287 var logger = _interopRequireWildcard(_logger);
1288
1289 var loggedProperties = _Object$create(null);
1290
1291 function createProtoAccessControl(runtimeOptions) {
1292 var defaultMethodWhiteList = _Object$create(null);
1293 defaultMethodWhiteList['constructor'] = false;
1294 defaultMethodWhiteList['__defineGetter__'] = false;
1295 defaultMethodWhiteList['__defineSetter__'] = false;
1296 defaultMethodWhiteList['__lookupGetter__'] = false;
1297
1298 var defaultPropertyWhiteList = _Object$create(null);
1299 // eslint-disable-next-line no-proto
1300 defaultPropertyWhiteList['__proto__'] = false;
1301
1302 return {
1303 properties: {
1304 whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
1305 defaultValue: runtimeOptions.allowProtoPropertiesByDefault
1306 },
1307 methods: {
1308 whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
1309 defaultValue: runtimeOptions.allowProtoMethodsByDefault
1310 }
1311 };
1312 }
1313
1314 function resultIsAllowed(result, protoAccessControl, propertyName) {
1315 if (typeof result === 'function') {
1316 return checkWhiteList(protoAccessControl.methods, propertyName);
1317 } else {
1318 return checkWhiteList(protoAccessControl.properties, propertyName);
1319 }
1320 }
1321
1322 function checkWhiteList(protoAccessControlForType, propertyName) {
1323 if (protoAccessControlForType.whitelist[propertyName] !== undefined) {
1324 return protoAccessControlForType.whitelist[propertyName] === true;
1325 }
1326 if (protoAccessControlForType.defaultValue !== undefined) {
1327 return protoAccessControlForType.defaultValue;
1328 }
1329 logUnexpecedPropertyAccessOnce(propertyName);
1330 return false;
1331 }
1332
1333 function logUnexpecedPropertyAccessOnce(propertyName) {
1334 if (loggedProperties[propertyName] !== true) {
1335 loggedProperties[propertyName] = true;
1336 logger.log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
1337 }
1338 }
1339
1340 function resetLoggedProperties() {
1341 _Object$keys(loggedProperties).forEach(function (propertyName) {
1342 delete loggedProperties[propertyName];
1343 });
1344 }
1345
1346/***/ }),
1347/* 34 */
1348/***/ (function(module, exports, __webpack_require__) {
1349
1350 module.exports = { "default": __webpack_require__(35), __esModule: true };
1351
1352/***/ }),
1353/* 35 */
1354/***/ (function(module, exports, __webpack_require__) {
1355
1356 var $ = __webpack_require__(9);
1357 module.exports = function create(P, D){
1358 return $.create(P, D);
1359 };
1360
1361/***/ }),
1362/* 36 */
1363/***/ (function(module, exports, __webpack_require__) {
1364
1365 'use strict';
1366
1367 var _Object$create = __webpack_require__(34)['default'];
1368
1369 exports.__esModule = true;
1370 exports.createNewLookupObject = createNewLookupObject;
1371
1372 var _utils = __webpack_require__(5);
1373
1374 /**
1375 * Create a new object with "null"-prototype to avoid truthy results on prototype properties.
1376 * The resulting object can be used with "object[property]" to check if a property exists
1377 * @param {...object} sources a varargs parameter of source objects that will be merged
1378 * @returns {object}
1379 */
1380
1381 function createNewLookupObject() {
1382 for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
1383 sources[_key] = arguments[_key];
1384 }
1385
1386 return _utils.extend.apply(undefined, [_Object$create(null)].concat(sources));
1387 }
1388
1389/***/ }),
1390/* 37 */
1391/***/ (function(module, exports) {
1392
1393 // Build out our basic SafeString type
1394 'use strict';
1395
1396 exports.__esModule = true;
1397 function SafeString(string) {
1398 this.string = string;
1399 }
1400
1401 SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
1402 return '' + this.string;
1403 };
1404
1405 exports['default'] = SafeString;
1406 module.exports = exports['default'];
1407
1408/***/ }),
1409/* 38 */
1410/***/ (function(module, exports, __webpack_require__) {
1411
1412 'use strict';
1413
1414 var _Object$seal = __webpack_require__(39)['default'];
1415
1416 var _Object$keys = __webpack_require__(13)['default'];
1417
1418 var _interopRequireWildcard = __webpack_require__(3)['default'];
1419
1420 var _interopRequireDefault = __webpack_require__(1)['default'];
1421
1422 exports.__esModule = true;
1423 exports.checkRevision = checkRevision;
1424 exports.template = template;
1425 exports.wrapProgram = wrapProgram;
1426 exports.resolvePartial = resolvePartial;
1427 exports.invokePartial = invokePartial;
1428 exports.noop = noop;
1429
1430 var _utils = __webpack_require__(5);
1431
1432 var Utils = _interopRequireWildcard(_utils);
1433
1434 var _exception = __webpack_require__(6);
1435
1436 var _exception2 = _interopRequireDefault(_exception);
1437
1438 var _base = __webpack_require__(4);
1439
1440 var _helpers = __webpack_require__(10);
1441
1442 var _internalWrapHelper = __webpack_require__(43);
1443
1444 var _internalProtoAccess = __webpack_require__(33);
1445
1446 function checkRevision(compilerInfo) {
1447 var compilerRevision = compilerInfo && compilerInfo[0] || 1,
1448 currentRevision = _base.COMPILER_REVISION;
1449
1450 if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {
1451 return;
1452 }
1453
1454 if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
1455 var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
1456 compilerVersions = _base.REVISION_CHANGES[compilerRevision];
1457 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 + ').');
1458 } else {
1459 // Use the embedded version info since the runtime doesn't know about this revision yet
1460 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] + ').');
1461 }
1462 }
1463
1464 function template(templateSpec, env) {
1465 /* istanbul ignore next */
1466 if (!env) {
1467 throw new _exception2['default']('No environment passed to template');
1468 }
1469 if (!templateSpec || !templateSpec.main) {
1470 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
1471 }
1472
1473 templateSpec.main.decorator = templateSpec.main_d;
1474
1475 // Note: Using env.VM references rather than local var references throughout this section to allow
1476 // for external users to override these as pseudo-supported APIs.
1477 env.VM.checkRevision(templateSpec.compiler);
1478
1479 // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)
1480 var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
1481
1482 function invokePartialWrapper(partial, context, options) {
1483 if (options.hash) {
1484 context = Utils.extend({}, context, options.hash);
1485 if (options.ids) {
1486 options.ids[0] = true;
1487 }
1488 }
1489 partial = env.VM.resolvePartial.call(this, partial, context, options);
1490
1491 var extendedOptions = Utils.extend({}, options, {
1492 hooks: this.hooks,
1493 protoAccessControl: this.protoAccessControl
1494 });
1495
1496 var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
1497
1498 if (result == null && env.compile) {
1499 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
1500 result = options.partials[options.name](context, extendedOptions);
1501 }
1502 if (result != null) {
1503 if (options.indent) {
1504 var lines = result.split('\n');
1505 for (var i = 0, l = lines.length; i < l; i++) {
1506 if (!lines[i] && i + 1 === l) {
1507 break;
1508 }
1509
1510 lines[i] = options.indent + lines[i];
1511 }
1512 result = lines.join('\n');
1513 }
1514 return result;
1515 } else {
1516 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
1517 }
1518 }
1519
1520 // Just add water
1521 var container = {
1522 strict: function strict(obj, name, loc) {
1523 if (!obj || !(name in obj)) {
1524 throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
1525 loc: loc
1526 });
1527 }
1528 return container.lookupProperty(obj, name);
1529 },
1530 lookupProperty: function lookupProperty(parent, propertyName) {
1531 var result = parent[propertyName];
1532 if (result == null) {
1533 return result;
1534 }
1535 if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
1536 return result;
1537 }
1538
1539 if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
1540 return result;
1541 }
1542 return undefined;
1543 },
1544 lookup: function lookup(depths, name) {
1545 var len = depths.length;
1546 for (var i = 0; i < len; i++) {
1547 var result = depths[i] && container.lookupProperty(depths[i], name);
1548 if (result != null) {
1549 return depths[i][name];
1550 }
1551 }
1552 },
1553 lambda: function lambda(current, context) {
1554 return typeof current === 'function' ? current.call(context) : current;
1555 },
1556
1557 escapeExpression: Utils.escapeExpression,
1558 invokePartial: invokePartialWrapper,
1559
1560 fn: function fn(i) {
1561 var ret = templateSpec[i];
1562 ret.decorator = templateSpec[i + '_d'];
1563 return ret;
1564 },
1565
1566 programs: [],
1567 program: function program(i, data, declaredBlockParams, blockParams, depths) {
1568 var programWrapper = this.programs[i],
1569 fn = this.fn(i);
1570 if (data || depths || blockParams || declaredBlockParams) {
1571 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
1572 } else if (!programWrapper) {
1573 programWrapper = this.programs[i] = wrapProgram(this, i, fn);
1574 }
1575 return programWrapper;
1576 },
1577
1578 data: function data(value, depth) {
1579 while (value && depth--) {
1580 value = value._parent;
1581 }
1582 return value;
1583 },
1584 mergeIfNeeded: function mergeIfNeeded(param, common) {
1585 var obj = param || common;
1586
1587 if (param && common && param !== common) {
1588 obj = Utils.extend({}, common, param);
1589 }
1590
1591 return obj;
1592 },
1593 // An empty object to use as replacement for null-contexts
1594 nullContext: _Object$seal({}),
1595
1596 noop: env.VM.noop,
1597 compilerInfo: templateSpec.compiler
1598 };
1599
1600 function ret(context) {
1601 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1602
1603 var data = options.data;
1604
1605 ret._setup(options);
1606 if (!options.partial && templateSpec.useData) {
1607 data = initData(context, data);
1608 }
1609 var depths = undefined,
1610 blockParams = templateSpec.useBlockParams ? [] : undefined;
1611 if (templateSpec.useDepths) {
1612 if (options.depths) {
1613 depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
1614 } else {
1615 depths = [context];
1616 }
1617 }
1618
1619 function main(context /*, options*/) {
1620 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
1621 }
1622
1623 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
1624 return main(context, options);
1625 }
1626
1627 ret.isTop = true;
1628
1629 ret._setup = function (options) {
1630 if (!options.partial) {
1631 var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
1632 wrapHelpersToPassLookupProperty(mergedHelpers, container);
1633 container.helpers = mergedHelpers;
1634
1635 if (templateSpec.usePartial) {
1636 // Use mergeIfNeeded here to prevent compiling global partials multiple times
1637 container.partials = container.mergeIfNeeded(options.partials, env.partials);
1638 }
1639 if (templateSpec.usePartial || templateSpec.useDecorators) {
1640 container.decorators = Utils.extend({}, env.decorators, options.decorators);
1641 }
1642
1643 container.hooks = {};
1644 container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
1645
1646 var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
1647 _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
1648 _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
1649 } else {
1650 container.protoAccessControl = options.protoAccessControl; // internal option
1651 container.helpers = options.helpers;
1652 container.partials = options.partials;
1653 container.decorators = options.decorators;
1654 container.hooks = options.hooks;
1655 }
1656 };
1657
1658 ret._child = function (i, data, blockParams, depths) {
1659 if (templateSpec.useBlockParams && !blockParams) {
1660 throw new _exception2['default']('must pass block params');
1661 }
1662 if (templateSpec.useDepths && !depths) {
1663 throw new _exception2['default']('must pass parent depths');
1664 }
1665
1666 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
1667 };
1668 return ret;
1669 }
1670
1671 function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
1672 function prog(context) {
1673 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1674
1675 var currentDepths = depths;
1676 if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
1677 currentDepths = [context].concat(depths);
1678 }
1679
1680 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
1681 }
1682
1683 prog = executeDecorators(fn, prog, container, depths, data, blockParams);
1684
1685 prog.program = i;
1686 prog.depth = depths ? depths.length : 0;
1687 prog.blockParams = declaredBlockParams || 0;
1688 return prog;
1689 }
1690
1691 /**
1692 * This is currently part of the official API, therefore implementation details should not be changed.
1693 */
1694
1695 function resolvePartial(partial, context, options) {
1696 if (!partial) {
1697 if (options.name === '@partial-block') {
1698 partial = options.data['partial-block'];
1699 } else {
1700 partial = options.partials[options.name];
1701 }
1702 } else if (!partial.call && !options.name) {
1703 // This is a dynamic partial that returned a string
1704 options.name = partial;
1705 partial = options.partials[partial];
1706 }
1707 return partial;
1708 }
1709
1710 function invokePartial(partial, context, options) {
1711 // Use the current closure context to save the partial-block if this partial
1712 var currentPartialBlock = options.data && options.data['partial-block'];
1713 options.partial = true;
1714 if (options.ids) {
1715 options.data.contextPath = options.ids[0] || options.data.contextPath;
1716 }
1717
1718 var partialBlock = undefined;
1719 if (options.fn && options.fn !== noop) {
1720 (function () {
1721 options.data = _base.createFrame(options.data);
1722 // Wrapper function to get access to currentPartialBlock from the closure
1723 var fn = options.fn;
1724 partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
1725 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1726
1727 // Restore the partial-block from the closure for the execution of the block
1728 // i.e. the part inside the block of the partial call.
1729 options.data = _base.createFrame(options.data);
1730 options.data['partial-block'] = currentPartialBlock;
1731 return fn(context, options);
1732 };
1733 if (fn.partials) {
1734 options.partials = Utils.extend({}, options.partials, fn.partials);
1735 }
1736 })();
1737 }
1738
1739 if (partial === undefined && partialBlock) {
1740 partial = partialBlock;
1741 }
1742
1743 if (partial === undefined) {
1744 throw new _exception2['default']('The partial ' + options.name + ' could not be found');
1745 } else if (partial instanceof Function) {
1746 return partial(context, options);
1747 }
1748 }
1749
1750 function noop() {
1751 return '';
1752 }
1753
1754 function initData(context, data) {
1755 if (!data || !('root' in data)) {
1756 data = data ? _base.createFrame(data) : {};
1757 data.root = context;
1758 }
1759 return data;
1760 }
1761
1762 function executeDecorators(fn, prog, container, depths, data, blockParams) {
1763 if (fn.decorator) {
1764 var props = {};
1765 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
1766 Utils.extend(prog, props);
1767 }
1768 return prog;
1769 }
1770
1771 function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
1772 _Object$keys(mergedHelpers).forEach(function (helperName) {
1773 var helper = mergedHelpers[helperName];
1774 mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
1775 });
1776 }
1777
1778 function passLookupPropertyOption(helper, container) {
1779 var lookupProperty = container.lookupProperty;
1780 return _internalWrapHelper.wrapHelper(helper, function (options) {
1781 return Utils.extend({ lookupProperty: lookupProperty }, options);
1782 });
1783 }
1784
1785/***/ }),
1786/* 39 */
1787/***/ (function(module, exports, __webpack_require__) {
1788
1789 module.exports = { "default": __webpack_require__(40), __esModule: true };
1790
1791/***/ }),
1792/* 40 */
1793/***/ (function(module, exports, __webpack_require__) {
1794
1795 __webpack_require__(41);
1796 module.exports = __webpack_require__(21).Object.seal;
1797
1798/***/ }),
1799/* 41 */
1800/***/ (function(module, exports, __webpack_require__) {
1801
1802 // 19.1.2.17 Object.seal(O)
1803 var isObject = __webpack_require__(42);
1804
1805 __webpack_require__(18)('seal', function($seal){
1806 return function seal(it){
1807 return $seal && isObject(it) ? $seal(it) : it;
1808 };
1809 });
1810
1811/***/ }),
1812/* 42 */
1813/***/ (function(module, exports) {
1814
1815 module.exports = function(it){
1816 return typeof it === 'object' ? it !== null : typeof it === 'function';
1817 };
1818
1819/***/ }),
1820/* 43 */
1821/***/ (function(module, exports) {
1822
1823 'use strict';
1824
1825 exports.__esModule = true;
1826 exports.wrapHelper = wrapHelper;
1827
1828 function wrapHelper(helper, transformOptionsFn) {
1829 if (typeof helper !== 'function') {
1830 // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639
1831 // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.
1832 return helper;
1833 }
1834 var wrapper = function wrapper() /* dynamic arguments */{
1835 var options = arguments[arguments.length - 1];
1836 arguments[arguments.length - 1] = transformOptionsFn(options);
1837 return helper.apply(this, arguments);
1838 };
1839 return wrapper;
1840 }
1841
1842/***/ }),
1843/* 44 */
1844/***/ (function(module, exports) {
1845
1846 /* WEBPACK VAR INJECTION */(function(global) {'use strict';
1847
1848 exports.__esModule = true;
1849
1850 exports['default'] = function (Handlebars) {
1851 /* istanbul ignore next */
1852 var root = typeof global !== 'undefined' ? global : window,
1853 $Handlebars = root.Handlebars;
1854 /* istanbul ignore next */
1855 Handlebars.noConflict = function () {
1856 if (root.Handlebars === Handlebars) {
1857 root.Handlebars = $Handlebars;
1858 }
1859 return Handlebars;
1860 };
1861 };
1862
1863 module.exports = exports['default'];
1864 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1865
1866/***/ }),
1867/* 45 */
1868/***/ (function(module, exports) {
1869
1870 'use strict';
1871
1872 exports.__esModule = true;
1873 var AST = {
1874 // Public API used to evaluate derived attributes regarding AST nodes
1875 helpers: {
1876 // a mustache is definitely a helper if:
1877 // * it is an eligible helper, and
1878 // * it has at least one parameter or hash segment
1879 helperExpression: function helperExpression(node) {
1880 return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
1881 },
1882
1883 scopedId: function scopedId(path) {
1884 return (/^\.|this\b/.test(path.original)
1885 );
1886 },
1887
1888 // an ID is simple if it only has one part, and that part is not
1889 // `..` or `this`.
1890 simpleId: function simpleId(path) {
1891 return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
1892 }
1893 }
1894 };
1895
1896 // Must be exported as an object rather than the root of the module as the jison lexer
1897 // must modify the object to operate properly.
1898 exports['default'] = AST;
1899 module.exports = exports['default'];
1900
1901/***/ }),
1902/* 46 */
1903/***/ (function(module, exports, __webpack_require__) {
1904
1905 'use strict';
1906
1907 var _interopRequireDefault = __webpack_require__(1)['default'];
1908
1909 var _interopRequireWildcard = __webpack_require__(3)['default'];
1910
1911 exports.__esModule = true;
1912 exports.parseWithoutProcessing = parseWithoutProcessing;
1913 exports.parse = parse;
1914
1915 var _parser = __webpack_require__(47);
1916
1917 var _parser2 = _interopRequireDefault(_parser);
1918
1919 var _whitespaceControl = __webpack_require__(48);
1920
1921 var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
1922
1923 var _helpers = __webpack_require__(50);
1924
1925 var Helpers = _interopRequireWildcard(_helpers);
1926
1927 var _utils = __webpack_require__(5);
1928
1929 exports.parser = _parser2['default'];
1930
1931 var yy = {};
1932 _utils.extend(yy, Helpers);
1933
1934 function parseWithoutProcessing(input, options) {
1935 // Just return if an already-compiled AST was passed in.
1936 if (input.type === 'Program') {
1937 return input;
1938 }
1939
1940 _parser2['default'].yy = yy;
1941
1942 // Altering the shared object here, but this is ok as parser is a sync operation
1943 yy.locInfo = function (locInfo) {
1944 return new yy.SourceLocation(options && options.srcName, locInfo);
1945 };
1946
1947 var ast = _parser2['default'].parse(input);
1948
1949 return ast;
1950 }
1951
1952 function parse(input, options) {
1953 var ast = parseWithoutProcessing(input, options);
1954 var strip = new _whitespaceControl2['default'](options);
1955
1956 return strip.accept(ast);
1957 }
1958
1959/***/ }),
1960/* 47 */
1961/***/ (function(module, exports) {
1962
1963 // File ignored in coverage tests via setting in .istanbul.yml
1964 /* Jison generated parser */
1965 "use strict";
1966
1967 exports.__esModule = true;
1968 var handlebars = (function () {
1969 var parser = { trace: function trace() {},
1970 yy: {},
1971 symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
1972 terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
1973 productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
1974 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
1975
1976 var $0 = $$.length - 1;
1977 switch (yystate) {
1978 case 1:
1979 return $$[$0 - 1];
1980 break;
1981 case 2:
1982 this.$ = yy.prepareProgram($$[$0]);
1983 break;
1984 case 3:
1985 this.$ = $$[$0];
1986 break;
1987 case 4:
1988 this.$ = $$[$0];
1989 break;
1990 case 5:
1991 this.$ = $$[$0];
1992 break;
1993 case 6:
1994 this.$ = $$[$0];
1995 break;
1996 case 7:
1997 this.$ = $$[$0];
1998 break;
1999 case 8:
2000 this.$ = $$[$0];
2001 break;
2002 case 9:
2003 this.$ = {
2004 type: 'CommentStatement',
2005 value: yy.stripComment($$[$0]),
2006 strip: yy.stripFlags($$[$0], $$[$0]),
2007 loc: yy.locInfo(this._$)
2008 };
2009
2010 break;
2011 case 10:
2012 this.$ = {
2013 type: 'ContentStatement',
2014 original: $$[$0],
2015 value: $$[$0],
2016 loc: yy.locInfo(this._$)
2017 };
2018
2019 break;
2020 case 11:
2021 this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
2022 break;
2023 case 12:
2024 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
2025 break;
2026 case 13:
2027 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
2028 break;
2029 case 14:
2030 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
2031 break;
2032 case 15:
2033 this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
2034 break;
2035 case 16:
2036 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
2037 break;
2038 case 17:
2039 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
2040 break;
2041 case 18:
2042 this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
2043 break;
2044 case 19:
2045 var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
2046 program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
2047 program.chained = true;
2048
2049 this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
2050
2051 break;
2052 case 20:
2053 this.$ = $$[$0];
2054 break;
2055 case 21:
2056 this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
2057 break;
2058 case 22:
2059 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
2060 break;
2061 case 23:
2062 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
2063 break;
2064 case 24:
2065 this.$ = {
2066 type: 'PartialStatement',
2067 name: $$[$0 - 3],
2068 params: $$[$0 - 2],
2069 hash: $$[$0 - 1],
2070 indent: '',
2071 strip: yy.stripFlags($$[$0 - 4], $$[$0]),
2072 loc: yy.locInfo(this._$)
2073 };
2074
2075 break;
2076 case 25:
2077 this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
2078 break;
2079 case 26:
2080 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
2081 break;
2082 case 27:
2083 this.$ = $$[$0];
2084 break;
2085 case 28:
2086 this.$ = $$[$0];
2087 break;
2088 case 29:
2089 this.$ = {
2090 type: 'SubExpression',
2091 path: $$[$0 - 3],
2092 params: $$[$0 - 2],
2093 hash: $$[$0 - 1],
2094 loc: yy.locInfo(this._$)
2095 };
2096
2097 break;
2098 case 30:
2099 this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
2100 break;
2101 case 31:
2102 this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
2103 break;
2104 case 32:
2105 this.$ = yy.id($$[$0 - 1]);
2106 break;
2107 case 33:
2108 this.$ = $$[$0];
2109 break;
2110 case 34:
2111 this.$ = $$[$0];
2112 break;
2113 case 35:
2114 this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
2115 break;
2116 case 36:
2117 this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
2118 break;
2119 case 37:
2120 this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
2121 break;
2122 case 38:
2123 this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
2124 break;
2125 case 39:
2126 this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
2127 break;
2128 case 40:
2129 this.$ = $$[$0];
2130 break;
2131 case 41:
2132 this.$ = $$[$0];
2133 break;
2134 case 42:
2135 this.$ = yy.preparePath(true, $$[$0], this._$);
2136 break;
2137 case 43:
2138 this.$ = yy.preparePath(false, $$[$0], this._$);
2139 break;
2140 case 44:
2141 $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
2142 break;
2143 case 45:
2144 this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
2145 break;
2146 case 46:
2147 this.$ = [];
2148 break;
2149 case 47:
2150 $$[$0 - 1].push($$[$0]);
2151 break;
2152 case 48:
2153 this.$ = [];
2154 break;
2155 case 49:
2156 $$[$0 - 1].push($$[$0]);
2157 break;
2158 case 50:
2159 this.$ = [];
2160 break;
2161 case 51:
2162 $$[$0 - 1].push($$[$0]);
2163 break;
2164 case 58:
2165 this.$ = [];
2166 break;
2167 case 59:
2168 $$[$0 - 1].push($$[$0]);
2169 break;
2170 case 64:
2171 this.$ = [];
2172 break;
2173 case 65:
2174 $$[$0 - 1].push($$[$0]);
2175 break;
2176 case 70:
2177 this.$ = [];
2178 break;
2179 case 71:
2180 $$[$0 - 1].push($$[$0]);
2181 break;
2182 case 78:
2183 this.$ = [];
2184 break;
2185 case 79:
2186 $$[$0 - 1].push($$[$0]);
2187 break;
2188 case 82:
2189 this.$ = [];
2190 break;
2191 case 83:
2192 $$[$0 - 1].push($$[$0]);
2193 break;
2194 case 86:
2195 this.$ = [];
2196 break;
2197 case 87:
2198 $$[$0 - 1].push($$[$0]);
2199 break;
2200 case 90:
2201 this.$ = [];
2202 break;
2203 case 91:
2204 $$[$0 - 1].push($$[$0]);
2205 break;
2206 case 94:
2207 this.$ = [];
2208 break;
2209 case 95:
2210 $$[$0 - 1].push($$[$0]);
2211 break;
2212 case 98:
2213 this.$ = [$$[$0]];
2214 break;
2215 case 99:
2216 $$[$0 - 1].push($$[$0]);
2217 break;
2218 case 100:
2219 this.$ = [$$[$0]];
2220 break;
2221 case 101:
2222 $$[$0 - 1].push($$[$0]);
2223 break;
2224 }
2225 },
2226 table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 85, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 86, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
2227 defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] },
2228 parseError: function parseError(str, hash) {
2229 throw new Error(str);
2230 },
2231 parse: function parse(input) {
2232 var self = this,
2233 stack = [0],
2234 vstack = [null],
2235 lstack = [],
2236 table = this.table,
2237 yytext = "",
2238 yylineno = 0,
2239 yyleng = 0,
2240 recovering = 0,
2241 TERROR = 2,
2242 EOF = 1;
2243 this.lexer.setInput(input);
2244 this.lexer.yy = this.yy;
2245 this.yy.lexer = this.lexer;
2246 this.yy.parser = this;
2247 if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
2248 var yyloc = this.lexer.yylloc;
2249 lstack.push(yyloc);
2250 var ranges = this.lexer.options && this.lexer.options.ranges;
2251 if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
2252 function popStack(n) {
2253 stack.length = stack.length - 2 * n;
2254 vstack.length = vstack.length - n;
2255 lstack.length = lstack.length - n;
2256 }
2257 function lex() {
2258 var token;
2259 token = self.lexer.lex() || 1;
2260 if (typeof token !== "number") {
2261 token = self.symbols_[token] || token;
2262 }
2263 return token;
2264 }
2265 var symbol,
2266 preErrorSymbol,
2267 state,
2268 action,
2269 a,
2270 r,
2271 yyval = {},
2272 p,
2273 len,
2274 newState,
2275 expected;
2276 while (true) {
2277 state = stack[stack.length - 1];
2278 if (this.defaultActions[state]) {
2279 action = this.defaultActions[state];
2280 } else {
2281 if (symbol === null || typeof symbol == "undefined") {
2282 symbol = lex();
2283 }
2284 action = table[state] && table[state][symbol];
2285 }
2286 if (typeof action === "undefined" || !action.length || !action[0]) {
2287 var errStr = "";
2288 if (!recovering) {
2289 expected = [];
2290 for (p in table[state]) if (this.terminals_[p] && p > 2) {
2291 expected.push("'" + this.terminals_[p] + "'");
2292 }
2293 if (this.lexer.showPosition) {
2294 errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
2295 } else {
2296 errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
2297 }
2298 this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
2299 }
2300 }
2301 if (action[0] instanceof Array && action.length > 1) {
2302 throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
2303 }
2304 switch (action[0]) {
2305 case 1:
2306 stack.push(symbol);
2307 vstack.push(this.lexer.yytext);
2308 lstack.push(this.lexer.yylloc);
2309 stack.push(action[1]);
2310 symbol = null;
2311 if (!preErrorSymbol) {
2312 yyleng = this.lexer.yyleng;
2313 yytext = this.lexer.yytext;
2314 yylineno = this.lexer.yylineno;
2315 yyloc = this.lexer.yylloc;
2316 if (recovering > 0) recovering--;
2317 } else {
2318 symbol = preErrorSymbol;
2319 preErrorSymbol = null;
2320 }
2321 break;
2322 case 2:
2323 len = this.productions_[action[1]][1];
2324 yyval.$ = vstack[vstack.length - len];
2325 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 };
2326 if (ranges) {
2327 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
2328 }
2329 r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
2330 if (typeof r !== "undefined") {
2331 return r;
2332 }
2333 if (len) {
2334 stack = stack.slice(0, -1 * len * 2);
2335 vstack = vstack.slice(0, -1 * len);
2336 lstack = lstack.slice(0, -1 * len);
2337 }
2338 stack.push(this.productions_[action[1]][0]);
2339 vstack.push(yyval.$);
2340 lstack.push(yyval._$);
2341 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
2342 stack.push(newState);
2343 break;
2344 case 3:
2345 return true;
2346 }
2347 }
2348 return true;
2349 }
2350 };
2351 /* Jison generated lexer */
2352 var lexer = (function () {
2353 var lexer = { EOF: 1,
2354 parseError: function parseError(str, hash) {
2355 if (this.yy.parser) {
2356 this.yy.parser.parseError(str, hash);
2357 } else {
2358 throw new Error(str);
2359 }
2360 },
2361 setInput: function setInput(input) {
2362 this._input = input;
2363 this._more = this._less = this.done = false;
2364 this.yylineno = this.yyleng = 0;
2365 this.yytext = this.matched = this.match = '';
2366 this.conditionStack = ['INITIAL'];
2367 this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
2368 if (this.options.ranges) this.yylloc.range = [0, 0];
2369 this.offset = 0;
2370 return this;
2371 },
2372 input: function input() {
2373 var ch = this._input[0];
2374 this.yytext += ch;
2375 this.yyleng++;
2376 this.offset++;
2377 this.match += ch;
2378 this.matched += ch;
2379 var lines = ch.match(/(?:\r\n?|\n).*/g);
2380 if (lines) {
2381 this.yylineno++;
2382 this.yylloc.last_line++;
2383 } else {
2384 this.yylloc.last_column++;
2385 }
2386 if (this.options.ranges) this.yylloc.range[1]++;
2387
2388 this._input = this._input.slice(1);
2389 return ch;
2390 },
2391 unput: function unput(ch) {
2392 var len = ch.length;
2393 var lines = ch.split(/(?:\r\n?|\n)/g);
2394
2395 this._input = ch + this._input;
2396 this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
2397 //this.yyleng -= len;
2398 this.offset -= len;
2399 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
2400 this.match = this.match.substr(0, this.match.length - 1);
2401 this.matched = this.matched.substr(0, this.matched.length - 1);
2402
2403 if (lines.length - 1) this.yylineno -= lines.length - 1;
2404 var r = this.yylloc.range;
2405
2406 this.yylloc = { first_line: this.yylloc.first_line,
2407 last_line: this.yylineno + 1,
2408 first_column: this.yylloc.first_column,
2409 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
2410 };
2411
2412 if (this.options.ranges) {
2413 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
2414 }
2415 return this;
2416 },
2417 more: function more() {
2418 this._more = true;
2419 return this;
2420 },
2421 less: function less(n) {
2422 this.unput(this.match.slice(n));
2423 },
2424 pastInput: function pastInput() {
2425 var past = this.matched.substr(0, this.matched.length - this.match.length);
2426 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
2427 },
2428 upcomingInput: function upcomingInput() {
2429 var next = this.match;
2430 if (next.length < 20) {
2431 next += this._input.substr(0, 20 - next.length);
2432 }
2433 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
2434 },
2435 showPosition: function showPosition() {
2436 var pre = this.pastInput();
2437 var c = new Array(pre.length + 1).join("-");
2438 return pre + this.upcomingInput() + "\n" + c + "^";
2439 },
2440 next: function next() {
2441 if (this.done) {
2442 return this.EOF;
2443 }
2444 if (!this._input) this.done = true;
2445
2446 var token, match, tempMatch, index, col, lines;
2447 if (!this._more) {
2448 this.yytext = '';
2449 this.match = '';
2450 }
2451 var rules = this._currentRules();
2452 for (var i = 0; i < rules.length; i++) {
2453 tempMatch = this._input.match(this.rules[rules[i]]);
2454 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
2455 match = tempMatch;
2456 index = i;
2457 if (!this.options.flex) break;
2458 }
2459 }
2460 if (match) {
2461 lines = match[0].match(/(?:\r\n?|\n).*/g);
2462 if (lines) this.yylineno += lines.length;
2463 this.yylloc = { first_line: this.yylloc.last_line,
2464 last_line: this.yylineno + 1,
2465 first_column: this.yylloc.last_column,
2466 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
2467 this.yytext += match[0];
2468 this.match += match[0];
2469 this.matches = match;
2470 this.yyleng = this.yytext.length;
2471 if (this.options.ranges) {
2472 this.yylloc.range = [this.offset, this.offset += this.yyleng];
2473 }
2474 this._more = false;
2475 this._input = this._input.slice(match[0].length);
2476 this.matched += match[0];
2477 token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
2478 if (this.done && this._input) this.done = false;
2479 if (token) return token;else return;
2480 }
2481 if (this._input === "") {
2482 return this.EOF;
2483 } else {
2484 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
2485 }
2486 },
2487 lex: function lex() {
2488 var r = this.next();
2489 if (typeof r !== 'undefined') {
2490 return r;
2491 } else {
2492 return this.lex();
2493 }
2494 },
2495 begin: function begin(condition) {
2496 this.conditionStack.push(condition);
2497 },
2498 popState: function popState() {
2499 return this.conditionStack.pop();
2500 },
2501 _currentRules: function _currentRules() {
2502 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
2503 },
2504 topState: function topState() {
2505 return this.conditionStack[this.conditionStack.length - 2];
2506 },
2507 pushState: function begin(condition) {
2508 this.begin(condition);
2509 } };
2510 lexer.options = {};
2511 lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
2512
2513 function strip(start, end) {
2514 return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start);
2515 }
2516
2517 var YYSTATE = YY_START;
2518 switch ($avoiding_name_collisions) {
2519 case 0:
2520 if (yy_.yytext.slice(-2) === "\\\\") {
2521 strip(0, 1);
2522 this.begin("mu");
2523 } else if (yy_.yytext.slice(-1) === "\\") {
2524 strip(0, 1);
2525 this.begin("emu");
2526 } else {
2527 this.begin("mu");
2528 }
2529 if (yy_.yytext) return 15;
2530
2531 break;
2532 case 1:
2533 return 15;
2534 break;
2535 case 2:
2536 this.popState();
2537 return 15;
2538
2539 break;
2540 case 3:
2541 this.begin('raw');return 15;
2542 break;
2543 case 4:
2544 this.popState();
2545 // Should be using `this.topState()` below, but it currently
2546 // returns the second top instead of the first top. Opened an
2547 // issue about it at https://github.com/zaach/jison/issues/291
2548 if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
2549 return 15;
2550 } else {
2551 strip(5, 9);
2552 return 'END_RAW_BLOCK';
2553 }
2554
2555 break;
2556 case 5:
2557 return 15;
2558 break;
2559 case 6:
2560 this.popState();
2561 return 14;
2562
2563 break;
2564 case 7:
2565 return 65;
2566 break;
2567 case 8:
2568 return 68;
2569 break;
2570 case 9:
2571 return 19;
2572 break;
2573 case 10:
2574 this.popState();
2575 this.begin('raw');
2576 return 23;
2577
2578 break;
2579 case 11:
2580 return 55;
2581 break;
2582 case 12:
2583 return 60;
2584 break;
2585 case 13:
2586 return 29;
2587 break;
2588 case 14:
2589 return 47;
2590 break;
2591 case 15:
2592 this.popState();return 44;
2593 break;
2594 case 16:
2595 this.popState();return 44;
2596 break;
2597 case 17:
2598 return 34;
2599 break;
2600 case 18:
2601 return 39;
2602 break;
2603 case 19:
2604 return 51;
2605 break;
2606 case 20:
2607 return 48;
2608 break;
2609 case 21:
2610 this.unput(yy_.yytext);
2611 this.popState();
2612 this.begin('com');
2613
2614 break;
2615 case 22:
2616 this.popState();
2617 return 14;
2618
2619 break;
2620 case 23:
2621 return 48;
2622 break;
2623 case 24:
2624 return 73;
2625 break;
2626 case 25:
2627 return 72;
2628 break;
2629 case 26:
2630 return 72;
2631 break;
2632 case 27:
2633 return 87;
2634 break;
2635 case 28:
2636 // ignore whitespace
2637 break;
2638 case 29:
2639 this.popState();return 54;
2640 break;
2641 case 30:
2642 this.popState();return 33;
2643 break;
2644 case 31:
2645 yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
2646 break;
2647 case 32:
2648 yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
2649 break;
2650 case 33:
2651 return 85;
2652 break;
2653 case 34:
2654 return 82;
2655 break;
2656 case 35:
2657 return 82;
2658 break;
2659 case 36:
2660 return 83;
2661 break;
2662 case 37:
2663 return 84;
2664 break;
2665 case 38:
2666 return 81;
2667 break;
2668 case 39:
2669 return 75;
2670 break;
2671 case 40:
2672 return 77;
2673 break;
2674 case 41:
2675 return 72;
2676 break;
2677 case 42:
2678 yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
2679 break;
2680 case 43:
2681 return 'INVALID';
2682 break;
2683 case 44:
2684 return 5;
2685 break;
2686 }
2687 };
2688 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\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
2689 lexer.conditions = { "mu": { "rules": [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, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
2690 return lexer;
2691 })();
2692 parser.lexer = lexer;
2693 function Parser() {
2694 this.yy = {};
2695 }Parser.prototype = parser;parser.Parser = Parser;
2696 return new Parser();
2697 })();exports["default"] = handlebars;
2698 module.exports = exports["default"];
2699
2700/***/ }),
2701/* 48 */
2702/***/ (function(module, exports, __webpack_require__) {
2703
2704 'use strict';
2705
2706 var _interopRequireDefault = __webpack_require__(1)['default'];
2707
2708 exports.__esModule = true;
2709
2710 var _visitor = __webpack_require__(49);
2711
2712 var _visitor2 = _interopRequireDefault(_visitor);
2713
2714 function WhitespaceControl() {
2715 var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
2716
2717 this.options = options;
2718 }
2719 WhitespaceControl.prototype = new _visitor2['default']();
2720
2721 WhitespaceControl.prototype.Program = function (program) {
2722 var doStandalone = !this.options.ignoreStandalone;
2723
2724 var isRoot = !this.isRootSeen;
2725 this.isRootSeen = true;
2726
2727 var body = program.body;
2728 for (var i = 0, l = body.length; i < l; i++) {
2729 var current = body[i],
2730 strip = this.accept(current);
2731
2732 if (!strip) {
2733 continue;
2734 }
2735
2736 var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
2737 _isNextWhitespace = isNextWhitespace(body, i, isRoot),
2738 openStandalone = strip.openStandalone && _isPrevWhitespace,
2739 closeStandalone = strip.closeStandalone && _isNextWhitespace,
2740 inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
2741
2742 if (strip.close) {
2743 omitRight(body, i, true);
2744 }
2745 if (strip.open) {
2746 omitLeft(body, i, true);
2747 }
2748
2749 if (doStandalone && inlineStandalone) {
2750 omitRight(body, i);
2751
2752 if (omitLeft(body, i)) {
2753 // If we are on a standalone node, save the indent info for partials
2754 if (current.type === 'PartialStatement') {
2755 // Pull out the whitespace from the final line
2756 current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
2757 }
2758 }
2759 }
2760 if (doStandalone && openStandalone) {
2761 omitRight((current.program || current.inverse).body);
2762
2763 // Strip out the previous content node if it's whitespace only
2764 omitLeft(body, i);
2765 }
2766 if (doStandalone && closeStandalone) {
2767 // Always strip the next node
2768 omitRight(body, i);
2769
2770 omitLeft((current.inverse || current.program).body);
2771 }
2772 }
2773
2774 return program;
2775 };
2776
2777 WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
2778 this.accept(block.program);
2779 this.accept(block.inverse);
2780
2781 // Find the inverse program that is involed with whitespace stripping.
2782 var program = block.program || block.inverse,
2783 inverse = block.program && block.inverse,
2784 firstInverse = inverse,
2785 lastInverse = inverse;
2786
2787 if (inverse && inverse.chained) {
2788 firstInverse = inverse.body[0].program;
2789
2790 // Walk the inverse chain to find the last inverse that is actually in the chain.
2791 while (lastInverse.chained) {
2792 lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
2793 }
2794 }
2795
2796 var strip = {
2797 open: block.openStrip.open,
2798 close: block.closeStrip.close,
2799
2800 // Determine the standalone candiacy. Basically flag our content as being possibly standalone
2801 // so our parent can determine if we actually are standalone
2802 openStandalone: isNextWhitespace(program.body),
2803 closeStandalone: isPrevWhitespace((firstInverse || program).body)
2804 };
2805
2806 if (block.openStrip.close) {
2807 omitRight(program.body, null, true);
2808 }
2809
2810 if (inverse) {
2811 var inverseStrip = block.inverseStrip;
2812
2813 if (inverseStrip.open) {
2814 omitLeft(program.body, null, true);
2815 }
2816
2817 if (inverseStrip.close) {
2818 omitRight(firstInverse.body, null, true);
2819 }
2820 if (block.closeStrip.open) {
2821 omitLeft(lastInverse.body, null, true);
2822 }
2823
2824 // Find standalone else statments
2825 if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
2826 omitLeft(program.body);
2827 omitRight(firstInverse.body);
2828 }
2829 } else if (block.closeStrip.open) {
2830 omitLeft(program.body, null, true);
2831 }
2832
2833 return strip;
2834 };
2835
2836 WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
2837 return mustache.strip;
2838 };
2839
2840 WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
2841 /* istanbul ignore next */
2842 var strip = node.strip || {};
2843 return {
2844 inlineStandalone: true,
2845 open: strip.open,
2846 close: strip.close
2847 };
2848 };
2849
2850 function isPrevWhitespace(body, i, isRoot) {
2851 if (i === undefined) {
2852 i = body.length;
2853 }
2854
2855 // Nodes that end with newlines are considered whitespace (but are special
2856 // cased for strip operations)
2857 var prev = body[i - 1],
2858 sibling = body[i - 2];
2859 if (!prev) {
2860 return isRoot;
2861 }
2862
2863 if (prev.type === 'ContentStatement') {
2864 return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
2865 }
2866 }
2867 function isNextWhitespace(body, i, isRoot) {
2868 if (i === undefined) {
2869 i = -1;
2870 }
2871
2872 var next = body[i + 1],
2873 sibling = body[i + 2];
2874 if (!next) {
2875 return isRoot;
2876 }
2877
2878 if (next.type === 'ContentStatement') {
2879 return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
2880 }
2881 }
2882
2883 // Marks the node to the right of the position as omitted.
2884 // I.e. {{foo}}' ' will mark the ' ' node as omitted.
2885 //
2886 // If i is undefined, then the first child will be marked as such.
2887 //
2888 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2889 // content is met.
2890 function omitRight(body, i, multiple) {
2891 var current = body[i == null ? 0 : i + 1];
2892 if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
2893 return;
2894 }
2895
2896 var original = current.value;
2897 current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
2898 current.rightStripped = current.value !== original;
2899 }
2900
2901 // Marks the node to the left of the position as omitted.
2902 // I.e. ' '{{foo}} will mark the ' ' node as omitted.
2903 //
2904 // If i is undefined then the last child will be marked as such.
2905 //
2906 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2907 // content is met.
2908 function omitLeft(body, i, multiple) {
2909 var current = body[i == null ? body.length - 1 : i - 1];
2910 if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
2911 return;
2912 }
2913
2914 // We omit the last node if it's whitespace only and not preceded by a non-content node.
2915 var original = current.value;
2916 current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
2917 current.leftStripped = current.value !== original;
2918 return current.leftStripped;
2919 }
2920
2921 exports['default'] = WhitespaceControl;
2922 module.exports = exports['default'];
2923
2924/***/ }),
2925/* 49 */
2926/***/ (function(module, exports, __webpack_require__) {
2927
2928 'use strict';
2929
2930 var _interopRequireDefault = __webpack_require__(1)['default'];
2931
2932 exports.__esModule = true;
2933
2934 var _exception = __webpack_require__(6);
2935
2936 var _exception2 = _interopRequireDefault(_exception);
2937
2938 function Visitor() {
2939 this.parents = [];
2940 }
2941
2942 Visitor.prototype = {
2943 constructor: Visitor,
2944 mutating: false,
2945
2946 // Visits a given value. If mutating, will replace the value if necessary.
2947 acceptKey: function acceptKey(node, name) {
2948 var value = this.accept(node[name]);
2949 if (this.mutating) {
2950 // Hacky sanity check: This may have a few false positives for type for the helper
2951 // methods but will generally do the right thing without a lot of overhead.
2952 if (value && !Visitor.prototype[value.type]) {
2953 throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
2954 }
2955 node[name] = value;
2956 }
2957 },
2958
2959 // Performs an accept operation with added sanity check to ensure
2960 // required keys are not removed.
2961 acceptRequired: function acceptRequired(node, name) {
2962 this.acceptKey(node, name);
2963
2964 if (!node[name]) {
2965 throw new _exception2['default'](node.type + ' requires ' + name);
2966 }
2967 },
2968
2969 // Traverses a given array. If mutating, empty respnses will be removed
2970 // for child elements.
2971 acceptArray: function acceptArray(array) {
2972 for (var i = 0, l = array.length; i < l; i++) {
2973 this.acceptKey(array, i);
2974
2975 if (!array[i]) {
2976 array.splice(i, 1);
2977 i--;
2978 l--;
2979 }
2980 }
2981 },
2982
2983 accept: function accept(object) {
2984 if (!object) {
2985 return;
2986 }
2987
2988 /* istanbul ignore next: Sanity code */
2989 if (!this[object.type]) {
2990 throw new _exception2['default']('Unknown type: ' + object.type, object);
2991 }
2992
2993 if (this.current) {
2994 this.parents.unshift(this.current);
2995 }
2996 this.current = object;
2997
2998 var ret = this[object.type](object);
2999
3000 this.current = this.parents.shift();
3001
3002 if (!this.mutating || ret) {
3003 return ret;
3004 } else if (ret !== false) {
3005 return object;
3006 }
3007 },
3008
3009 Program: function Program(program) {
3010 this.acceptArray(program.body);
3011 },
3012
3013 MustacheStatement: visitSubExpression,
3014 Decorator: visitSubExpression,
3015
3016 BlockStatement: visitBlock,
3017 DecoratorBlock: visitBlock,
3018
3019 PartialStatement: visitPartial,
3020 PartialBlockStatement: function PartialBlockStatement(partial) {
3021 visitPartial.call(this, partial);
3022
3023 this.acceptKey(partial, 'program');
3024 },
3025
3026 ContentStatement: function ContentStatement() /* content */{},
3027 CommentStatement: function CommentStatement() /* comment */{},
3028
3029 SubExpression: visitSubExpression,
3030
3031 PathExpression: function PathExpression() /* path */{},
3032
3033 StringLiteral: function StringLiteral() /* string */{},
3034 NumberLiteral: function NumberLiteral() /* number */{},
3035 BooleanLiteral: function BooleanLiteral() /* bool */{},
3036 UndefinedLiteral: function UndefinedLiteral() /* literal */{},
3037 NullLiteral: function NullLiteral() /* literal */{},
3038
3039 Hash: function Hash(hash) {
3040 this.acceptArray(hash.pairs);
3041 },
3042 HashPair: function HashPair(pair) {
3043 this.acceptRequired(pair, 'value');
3044 }
3045 };
3046
3047 function visitSubExpression(mustache) {
3048 this.acceptRequired(mustache, 'path');
3049 this.acceptArray(mustache.params);
3050 this.acceptKey(mustache, 'hash');
3051 }
3052 function visitBlock(block) {
3053 visitSubExpression.call(this, block);
3054
3055 this.acceptKey(block, 'program');
3056 this.acceptKey(block, 'inverse');
3057 }
3058 function visitPartial(partial) {
3059 this.acceptRequired(partial, 'name');
3060 this.acceptArray(partial.params);
3061 this.acceptKey(partial, 'hash');
3062 }
3063
3064 exports['default'] = Visitor;
3065 module.exports = exports['default'];
3066
3067/***/ }),
3068/* 50 */
3069/***/ (function(module, exports, __webpack_require__) {
3070
3071 'use strict';
3072
3073 var _interopRequireDefault = __webpack_require__(1)['default'];
3074
3075 exports.__esModule = true;
3076 exports.SourceLocation = SourceLocation;
3077 exports.id = id;
3078 exports.stripFlags = stripFlags;
3079 exports.stripComment = stripComment;
3080 exports.preparePath = preparePath;
3081 exports.prepareMustache = prepareMustache;
3082 exports.prepareRawBlock = prepareRawBlock;
3083 exports.prepareBlock = prepareBlock;
3084 exports.prepareProgram = prepareProgram;
3085 exports.preparePartialBlock = preparePartialBlock;
3086
3087 var _exception = __webpack_require__(6);
3088
3089 var _exception2 = _interopRequireDefault(_exception);
3090
3091 function validateClose(open, close) {
3092 close = close.path ? close.path.original : close;
3093
3094 if (open.path.original !== close) {
3095 var errorNode = { loc: open.path.loc };
3096
3097 throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
3098 }
3099 }
3100
3101 function SourceLocation(source, locInfo) {
3102 this.source = source;
3103 this.start = {
3104 line: locInfo.first_line,
3105 column: locInfo.first_column
3106 };
3107 this.end = {
3108 line: locInfo.last_line,
3109 column: locInfo.last_column
3110 };
3111 }
3112
3113 function id(token) {
3114 if (/^\[.*\]$/.test(token)) {
3115 return token.substring(1, token.length - 1);
3116 } else {
3117 return token;
3118 }
3119 }
3120
3121 function stripFlags(open, close) {
3122 return {
3123 open: open.charAt(2) === '~',
3124 close: close.charAt(close.length - 3) === '~'
3125 };
3126 }
3127
3128 function stripComment(comment) {
3129 return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, '');
3130 }
3131
3132 function preparePath(data, parts, loc) {
3133 loc = this.locInfo(loc);
3134
3135 var original = data ? '@' : '',
3136 dig = [],
3137 depth = 0;
3138
3139 for (var i = 0, l = parts.length; i < l; i++) {
3140 var part = parts[i].part,
3141
3142 // If we have [] syntax then we do not treat path references as operators,
3143 // i.e. foo.[this] resolves to approximately context.foo['this']
3144 isLiteral = parts[i].original !== part;
3145 original += (parts[i].separator || '') + part;
3146
3147 if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
3148 if (dig.length > 0) {
3149 throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
3150 } else if (part === '..') {
3151 depth++;
3152 }
3153 } else {
3154 dig.push(part);
3155 }
3156 }
3157
3158 return {
3159 type: 'PathExpression',
3160 data: data,
3161 depth: depth,
3162 parts: dig,
3163 original: original,
3164 loc: loc
3165 };
3166 }
3167
3168 function prepareMustache(path, params, hash, open, strip, locInfo) {
3169 // Must use charAt to support IE pre-10
3170 var escapeFlag = open.charAt(3) || open.charAt(2),
3171 escaped = escapeFlag !== '{' && escapeFlag !== '&';
3172
3173 var decorator = /\*/.test(open);
3174 return {
3175 type: decorator ? 'Decorator' : 'MustacheStatement',
3176 path: path,
3177 params: params,
3178 hash: hash,
3179 escaped: escaped,
3180 strip: strip,
3181 loc: this.locInfo(locInfo)
3182 };
3183 }
3184
3185 function prepareRawBlock(openRawBlock, contents, close, locInfo) {
3186 validateClose(openRawBlock, close);
3187
3188 locInfo = this.locInfo(locInfo);
3189 var program = {
3190 type: 'Program',
3191 body: contents,
3192 strip: {},
3193 loc: locInfo
3194 };
3195
3196 return {
3197 type: 'BlockStatement',
3198 path: openRawBlock.path,
3199 params: openRawBlock.params,
3200 hash: openRawBlock.hash,
3201 program: program,
3202 openStrip: {},
3203 inverseStrip: {},
3204 closeStrip: {},
3205 loc: locInfo
3206 };
3207 }
3208
3209 function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
3210 if (close && close.path) {
3211 validateClose(openBlock, close);
3212 }
3213
3214 var decorator = /\*/.test(openBlock.open);
3215
3216 program.blockParams = openBlock.blockParams;
3217
3218 var inverse = undefined,
3219 inverseStrip = undefined;
3220
3221 if (inverseAndProgram) {
3222 if (decorator) {
3223 throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
3224 }
3225
3226 if (inverseAndProgram.chain) {
3227 inverseAndProgram.program.body[0].closeStrip = close.strip;
3228 }
3229
3230 inverseStrip = inverseAndProgram.strip;
3231 inverse = inverseAndProgram.program;
3232 }
3233
3234 if (inverted) {
3235 inverted = inverse;
3236 inverse = program;
3237 program = inverted;
3238 }
3239
3240 return {
3241 type: decorator ? 'DecoratorBlock' : 'BlockStatement',
3242 path: openBlock.path,
3243 params: openBlock.params,
3244 hash: openBlock.hash,
3245 program: program,
3246 inverse: inverse,
3247 openStrip: openBlock.strip,
3248 inverseStrip: inverseStrip,
3249 closeStrip: close && close.strip,
3250 loc: this.locInfo(locInfo)
3251 };
3252 }
3253
3254 function prepareProgram(statements, loc) {
3255 if (!loc && statements.length) {
3256 var firstLoc = statements[0].loc,
3257 lastLoc = statements[statements.length - 1].loc;
3258
3259 /* istanbul ignore else */
3260 if (firstLoc && lastLoc) {
3261 loc = {
3262 source: firstLoc.source,
3263 start: {
3264 line: firstLoc.start.line,
3265 column: firstLoc.start.column
3266 },
3267 end: {
3268 line: lastLoc.end.line,
3269 column: lastLoc.end.column
3270 }
3271 };
3272 }
3273 }
3274
3275 return {
3276 type: 'Program',
3277 body: statements,
3278 strip: {},
3279 loc: loc
3280 };
3281 }
3282
3283 function preparePartialBlock(open, program, close, locInfo) {
3284 validateClose(open, close);
3285
3286 return {
3287 type: 'PartialBlockStatement',
3288 name: open.path,
3289 params: open.params,
3290 hash: open.hash,
3291 program: program,
3292 openStrip: open.strip,
3293 closeStrip: close && close.strip,
3294 loc: this.locInfo(locInfo)
3295 };
3296 }
3297
3298/***/ }),
3299/* 51 */
3300/***/ (function(module, exports, __webpack_require__) {
3301
3302 /* eslint-disable new-cap */
3303
3304 'use strict';
3305
3306 var _Object$create = __webpack_require__(34)['default'];
3307
3308 var _interopRequireDefault = __webpack_require__(1)['default'];
3309
3310 exports.__esModule = true;
3311 exports.Compiler = Compiler;
3312 exports.precompile = precompile;
3313 exports.compile = compile;
3314
3315 var _exception = __webpack_require__(6);
3316
3317 var _exception2 = _interopRequireDefault(_exception);
3318
3319 var _utils = __webpack_require__(5);
3320
3321 var _ast = __webpack_require__(45);
3322
3323 var _ast2 = _interopRequireDefault(_ast);
3324
3325 var slice = [].slice;
3326
3327 function Compiler() {}
3328
3329 // the foundHelper register will disambiguate helper lookup from finding a
3330 // function in a context. This is necessary for mustache compatibility, which
3331 // requires that context functions in blocks are evaluated by blockHelperMissing,
3332 // and then proceed as if the resulting value was provided to blockHelperMissing.
3333
3334 Compiler.prototype = {
3335 compiler: Compiler,
3336
3337 equals: function equals(other) {
3338 var len = this.opcodes.length;
3339 if (other.opcodes.length !== len) {
3340 return false;
3341 }
3342
3343 for (var i = 0; i < len; i++) {
3344 var opcode = this.opcodes[i],
3345 otherOpcode = other.opcodes[i];
3346 if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
3347 return false;
3348 }
3349 }
3350
3351 // We know that length is the same between the two arrays because they are directly tied
3352 // to the opcode behavior above.
3353 len = this.children.length;
3354 for (var i = 0; i < len; i++) {
3355 if (!this.children[i].equals(other.children[i])) {
3356 return false;
3357 }
3358 }
3359
3360 return true;
3361 },
3362
3363 guid: 0,
3364
3365 compile: function compile(program, options) {
3366 this.sourceNode = [];
3367 this.opcodes = [];
3368 this.children = [];
3369 this.options = options;
3370 this.stringParams = options.stringParams;
3371 this.trackIds = options.trackIds;
3372
3373 options.blockParams = options.blockParams || [];
3374
3375 options.knownHelpers = _utils.extend(_Object$create(null), {
3376 helperMissing: true,
3377 blockHelperMissing: true,
3378 each: true,
3379 'if': true,
3380 unless: true,
3381 'with': true,
3382 log: true,
3383 lookup: true
3384 }, options.knownHelpers);
3385
3386 return this.accept(program);
3387 },
3388
3389 compileProgram: function compileProgram(program) {
3390 var childCompiler = new this.compiler(),
3391 // eslint-disable-line new-cap
3392 result = childCompiler.compile(program, this.options),
3393 guid = this.guid++;
3394
3395 this.usePartial = this.usePartial || result.usePartial;
3396
3397 this.children[guid] = result;
3398 this.useDepths = this.useDepths || result.useDepths;
3399
3400 return guid;
3401 },
3402
3403 accept: function accept(node) {
3404 /* istanbul ignore next: Sanity code */
3405 if (!this[node.type]) {
3406 throw new _exception2['default']('Unknown type: ' + node.type, node);
3407 }
3408
3409 this.sourceNode.unshift(node);
3410 var ret = this[node.type](node);
3411 this.sourceNode.shift();
3412 return ret;
3413 },
3414
3415 Program: function Program(program) {
3416 this.options.blockParams.unshift(program.blockParams);
3417
3418 var body = program.body,
3419 bodyLength = body.length;
3420 for (var i = 0; i < bodyLength; i++) {
3421 this.accept(body[i]);
3422 }
3423
3424 this.options.blockParams.shift();
3425
3426 this.isSimple = bodyLength === 1;
3427 this.blockParams = program.blockParams ? program.blockParams.length : 0;
3428
3429 return this;
3430 },
3431
3432 BlockStatement: function BlockStatement(block) {
3433 transformLiteralToPath(block);
3434
3435 var program = block.program,
3436 inverse = block.inverse;
3437
3438 program = program && this.compileProgram(program);
3439 inverse = inverse && this.compileProgram(inverse);
3440
3441 var type = this.classifySexpr(block);
3442
3443 if (type === 'helper') {
3444 this.helperSexpr(block, program, inverse);
3445 } else if (type === 'simple') {
3446 this.simpleSexpr(block);
3447
3448 // now that the simple mustache is resolved, we need to
3449 // evaluate it by executing `blockHelperMissing`
3450 this.opcode('pushProgram', program);
3451 this.opcode('pushProgram', inverse);
3452 this.opcode('emptyHash');
3453 this.opcode('blockValue', block.path.original);
3454 } else {
3455 this.ambiguousSexpr(block, program, inverse);
3456
3457 // now that the simple mustache is resolved, we need to
3458 // evaluate it by executing `blockHelperMissing`
3459 this.opcode('pushProgram', program);
3460 this.opcode('pushProgram', inverse);
3461 this.opcode('emptyHash');
3462 this.opcode('ambiguousBlockValue');
3463 }
3464
3465 this.opcode('append');
3466 },
3467
3468 DecoratorBlock: function DecoratorBlock(decorator) {
3469 var program = decorator.program && this.compileProgram(decorator.program);
3470 var params = this.setupFullMustacheParams(decorator, program, undefined),
3471 path = decorator.path;
3472
3473 this.useDecorators = true;
3474 this.opcode('registerDecorator', params.length, path.original);
3475 },
3476
3477 PartialStatement: function PartialStatement(partial) {
3478 this.usePartial = true;
3479
3480 var program = partial.program;
3481 if (program) {
3482 program = this.compileProgram(partial.program);
3483 }
3484
3485 var params = partial.params;
3486 if (params.length > 1) {
3487 throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
3488 } else if (!params.length) {
3489 if (this.options.explicitPartialContext) {
3490 this.opcode('pushLiteral', 'undefined');
3491 } else {
3492 params.push({ type: 'PathExpression', parts: [], depth: 0 });
3493 }
3494 }
3495
3496 var partialName = partial.name.original,
3497 isDynamic = partial.name.type === 'SubExpression';
3498 if (isDynamic) {
3499 this.accept(partial.name);
3500 }
3501
3502 this.setupFullMustacheParams(partial, program, undefined, true);
3503
3504 var indent = partial.indent || '';
3505 if (this.options.preventIndent && indent) {
3506 this.opcode('appendContent', indent);
3507 indent = '';
3508 }
3509
3510 this.opcode('invokePartial', isDynamic, partialName, indent);
3511 this.opcode('append');
3512 },
3513 PartialBlockStatement: function PartialBlockStatement(partialBlock) {
3514 this.PartialStatement(partialBlock);
3515 },
3516
3517 MustacheStatement: function MustacheStatement(mustache) {
3518 this.SubExpression(mustache);
3519
3520 if (mustache.escaped && !this.options.noEscape) {
3521 this.opcode('appendEscaped');
3522 } else {
3523 this.opcode('append');
3524 }
3525 },
3526 Decorator: function Decorator(decorator) {
3527 this.DecoratorBlock(decorator);
3528 },
3529
3530 ContentStatement: function ContentStatement(content) {
3531 if (content.value) {
3532 this.opcode('appendContent', content.value);
3533 }
3534 },
3535
3536 CommentStatement: function CommentStatement() {},
3537
3538 SubExpression: function SubExpression(sexpr) {
3539 transformLiteralToPath(sexpr);
3540 var type = this.classifySexpr(sexpr);
3541
3542 if (type === 'simple') {
3543 this.simpleSexpr(sexpr);
3544 } else if (type === 'helper') {
3545 this.helperSexpr(sexpr);
3546 } else {
3547 this.ambiguousSexpr(sexpr);
3548 }
3549 },
3550 ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
3551 var path = sexpr.path,
3552 name = path.parts[0],
3553 isBlock = program != null || inverse != null;
3554
3555 this.opcode('getContext', path.depth);
3556
3557 this.opcode('pushProgram', program);
3558 this.opcode('pushProgram', inverse);
3559
3560 path.strict = true;
3561 this.accept(path);
3562
3563 this.opcode('invokeAmbiguous', name, isBlock);
3564 },
3565
3566 simpleSexpr: function simpleSexpr(sexpr) {
3567 var path = sexpr.path;
3568 path.strict = true;
3569 this.accept(path);
3570 this.opcode('resolvePossibleLambda');
3571 },
3572
3573 helperSexpr: function helperSexpr(sexpr, program, inverse) {
3574 var params = this.setupFullMustacheParams(sexpr, program, inverse),
3575 path = sexpr.path,
3576 name = path.parts[0];
3577
3578 if (this.options.knownHelpers[name]) {
3579 this.opcode('invokeKnownHelper', params.length, name);
3580 } else if (this.options.knownHelpersOnly) {
3581 throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
3582 } else {
3583 path.strict = true;
3584 path.falsy = true;
3585
3586 this.accept(path);
3587 this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
3588 }
3589 },
3590
3591 PathExpression: function PathExpression(path) {
3592 this.addDepth(path.depth);
3593 this.opcode('getContext', path.depth);
3594
3595 var name = path.parts[0],
3596 scoped = _ast2['default'].helpers.scopedId(path),
3597 blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
3598
3599 if (blockParamId) {
3600 this.opcode('lookupBlockParam', blockParamId, path.parts);
3601 } else if (!name) {
3602 // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
3603 this.opcode('pushContext');
3604 } else if (path.data) {
3605 this.options.data = true;
3606 this.opcode('lookupData', path.depth, path.parts, path.strict);
3607 } else {
3608 this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
3609 }
3610 },
3611
3612 StringLiteral: function StringLiteral(string) {
3613 this.opcode('pushString', string.value);
3614 },
3615
3616 NumberLiteral: function NumberLiteral(number) {
3617 this.opcode('pushLiteral', number.value);
3618 },
3619
3620 BooleanLiteral: function BooleanLiteral(bool) {
3621 this.opcode('pushLiteral', bool.value);
3622 },
3623
3624 UndefinedLiteral: function UndefinedLiteral() {
3625 this.opcode('pushLiteral', 'undefined');
3626 },
3627
3628 NullLiteral: function NullLiteral() {
3629 this.opcode('pushLiteral', 'null');
3630 },
3631
3632 Hash: function Hash(hash) {
3633 var pairs = hash.pairs,
3634 i = 0,
3635 l = pairs.length;
3636
3637 this.opcode('pushHash');
3638
3639 for (; i < l; i++) {
3640 this.pushParam(pairs[i].value);
3641 }
3642 while (i--) {
3643 this.opcode('assignToHash', pairs[i].key);
3644 }
3645 this.opcode('popHash');
3646 },
3647
3648 // HELPERS
3649 opcode: function opcode(name) {
3650 this.opcodes.push({
3651 opcode: name,
3652 args: slice.call(arguments, 1),
3653 loc: this.sourceNode[0].loc
3654 });
3655 },
3656
3657 addDepth: function addDepth(depth) {
3658 if (!depth) {
3659 return;
3660 }
3661
3662 this.useDepths = true;
3663 },
3664
3665 classifySexpr: function classifySexpr(sexpr) {
3666 var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);
3667
3668 var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
3669
3670 // a mustache is an eligible helper if:
3671 // * its id is simple (a single part, not `this` or `..`)
3672 var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr);
3673
3674 // if a mustache is an eligible helper but not a definite
3675 // helper, it is ambiguous, and will be resolved in a later
3676 // pass or at runtime.
3677 var isEligible = !isBlockParam && (isHelper || isSimple);
3678
3679 // if ambiguous, we can possibly resolve the ambiguity now
3680 // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
3681 if (isEligible && !isHelper) {
3682 var _name = sexpr.path.parts[0],
3683 options = this.options;
3684 if (options.knownHelpers[_name]) {
3685 isHelper = true;
3686 } else if (options.knownHelpersOnly) {
3687 isEligible = false;
3688 }
3689 }
3690
3691 if (isHelper) {
3692 return 'helper';
3693 } else if (isEligible) {
3694 return 'ambiguous';
3695 } else {
3696 return 'simple';
3697 }
3698 },
3699
3700 pushParams: function pushParams(params) {
3701 for (var i = 0, l = params.length; i < l; i++) {
3702 this.pushParam(params[i]);
3703 }
3704 },
3705
3706 pushParam: function pushParam(val) {
3707 var value = val.value != null ? val.value : val.original || '';
3708
3709 if (this.stringParams) {
3710 if (value.replace) {
3711 value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
3712 }
3713
3714 if (val.depth) {
3715 this.addDepth(val.depth);
3716 }
3717 this.opcode('getContext', val.depth || 0);
3718 this.opcode('pushStringParam', value, val.type);
3719
3720 if (val.type === 'SubExpression') {
3721 // SubExpressions get evaluated and passed in
3722 // in string params mode.
3723 this.accept(val);
3724 }
3725 } else {
3726 if (this.trackIds) {
3727 var blockParamIndex = undefined;
3728 if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) {
3729 blockParamIndex = this.blockParamIndex(val.parts[0]);
3730 }
3731 if (blockParamIndex) {
3732 var blockParamChild = val.parts.slice(1).join('.');
3733 this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
3734 } else {
3735 value = val.original || value;
3736 if (value.replace) {
3737 value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
3738 }
3739
3740 this.opcode('pushId', val.type, value);
3741 }
3742 }
3743 this.accept(val);
3744 }
3745 },
3746
3747 setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
3748 var params = sexpr.params;
3749 this.pushParams(params);
3750
3751 this.opcode('pushProgram', program);
3752 this.opcode('pushProgram', inverse);
3753
3754 if (sexpr.hash) {
3755 this.accept(sexpr.hash);
3756 } else {
3757 this.opcode('emptyHash', omitEmpty);
3758 }
3759
3760 return params;
3761 },
3762
3763 blockParamIndex: function blockParamIndex(name) {
3764 for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
3765 var blockParams = this.options.blockParams[depth],
3766 param = blockParams && _utils.indexOf(blockParams, name);
3767 if (blockParams && param >= 0) {
3768 return [depth, param];
3769 }
3770 }
3771 }
3772 };
3773
3774 function precompile(input, options, env) {
3775 if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3776 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
3777 }
3778
3779 options = options || {};
3780 if (!('data' in options)) {
3781 options.data = true;
3782 }
3783 if (options.compat) {
3784 options.useDepths = true;
3785 }
3786
3787 var ast = env.parse(input, options),
3788 environment = new env.Compiler().compile(ast, options);
3789 return new env.JavaScriptCompiler().compile(environment, options);
3790 }
3791
3792 function compile(input, options, env) {
3793 if (options === undefined) options = {};
3794
3795 if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3796 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
3797 }
3798
3799 options = _utils.extend({}, options);
3800 if (!('data' in options)) {
3801 options.data = true;
3802 }
3803 if (options.compat) {
3804 options.useDepths = true;
3805 }
3806
3807 var compiled = undefined;
3808
3809 function compileInput() {
3810 var ast = env.parse(input, options),
3811 environment = new env.Compiler().compile(ast, options),
3812 templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
3813 return env.template(templateSpec);
3814 }
3815
3816 // Template is only compiled on first use and cached after that point.
3817 function ret(context, execOptions) {
3818 if (!compiled) {
3819 compiled = compileInput();
3820 }
3821 return compiled.call(this, context, execOptions);
3822 }
3823 ret._setup = function (setupOptions) {
3824 if (!compiled) {
3825 compiled = compileInput();
3826 }
3827 return compiled._setup(setupOptions);
3828 };
3829 ret._child = function (i, data, blockParams, depths) {
3830 if (!compiled) {
3831 compiled = compileInput();
3832 }
3833 return compiled._child(i, data, blockParams, depths);
3834 };
3835 return ret;
3836 }
3837
3838 function argEquals(a, b) {
3839 if (a === b) {
3840 return true;
3841 }
3842
3843 if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
3844 for (var i = 0; i < a.length; i++) {
3845 if (!argEquals(a[i], b[i])) {
3846 return false;
3847 }
3848 }
3849 return true;
3850 }
3851 }
3852
3853 function transformLiteralToPath(sexpr) {
3854 if (!sexpr.path.parts) {
3855 var literal = sexpr.path;
3856 // Casting to string here to make false and 0 literal values play nicely with the rest
3857 // of the system.
3858 sexpr.path = {
3859 type: 'PathExpression',
3860 data: false,
3861 depth: 0,
3862 parts: [literal.original + ''],
3863 original: literal.original + '',
3864 loc: literal.loc
3865 };
3866 }
3867 }
3868
3869/***/ }),
3870/* 52 */
3871/***/ (function(module, exports, __webpack_require__) {
3872
3873 'use strict';
3874
3875 var _Object$keys = __webpack_require__(13)['default'];
3876
3877 var _interopRequireDefault = __webpack_require__(1)['default'];
3878
3879 exports.__esModule = true;
3880
3881 var _base = __webpack_require__(4);
3882
3883 var _exception = __webpack_require__(6);
3884
3885 var _exception2 = _interopRequireDefault(_exception);
3886
3887 var _utils = __webpack_require__(5);
3888
3889 var _codeGen = __webpack_require__(53);
3890
3891 var _codeGen2 = _interopRequireDefault(_codeGen);
3892
3893 function Literal(value) {
3894 this.value = value;
3895 }
3896
3897 function JavaScriptCompiler() {}
3898
3899 JavaScriptCompiler.prototype = {
3900 // PUBLIC API: You can override these methods in a subclass to provide
3901 // alternative compiled forms for name lookup and buffering semantics
3902 nameLookup: function nameLookup(parent, name /*, type */) {
3903 return this.internalNameLookup(parent, name);
3904 },
3905 depthedLookup: function depthedLookup(name) {
3906 return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')'];
3907 },
3908
3909 compilerInfo: function compilerInfo() {
3910 var revision = _base.COMPILER_REVISION,
3911 versions = _base.REVISION_CHANGES[revision];
3912 return [revision, versions];
3913 },
3914
3915 appendToBuffer: function appendToBuffer(source, location, explicit) {
3916 // Force a source as this simplifies the merge logic.
3917 if (!_utils.isArray(source)) {
3918 source = [source];
3919 }
3920 source = this.source.wrap(source, location);
3921
3922 if (this.environment.isSimple) {
3923 return ['return ', source, ';'];
3924 } else if (explicit) {
3925 // This is a case where the buffer operation occurs as a child of another
3926 // construct, generally braces. We have to explicitly output these buffer
3927 // operations to ensure that the emitted code goes in the correct location.
3928 return ['buffer += ', source, ';'];
3929 } else {
3930 source.appendToBuffer = true;
3931 return source;
3932 }
3933 },
3934
3935 initializeBuffer: function initializeBuffer() {
3936 return this.quotedString('');
3937 },
3938 // END PUBLIC API
3939 internalNameLookup: function internalNameLookup(parent, name) {
3940 this.lookupPropertyFunctionIsUsed = true;
3941 return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];
3942 },
3943
3944 lookupPropertyFunctionIsUsed: false,
3945
3946 compile: function compile(environment, options, context, asObject) {
3947 this.environment = environment;
3948 this.options = options;
3949 this.stringParams = this.options.stringParams;
3950 this.trackIds = this.options.trackIds;
3951 this.precompile = !asObject;
3952
3953 this.name = this.environment.name;
3954 this.isChild = !!context;
3955 this.context = context || {
3956 decorators: [],
3957 programs: [],
3958 environments: []
3959 };
3960
3961 this.preamble();
3962
3963 this.stackSlot = 0;
3964 this.stackVars = [];
3965 this.aliases = {};
3966 this.registers = { list: [] };
3967 this.hashes = [];
3968 this.compileStack = [];
3969 this.inlineStack = [];
3970 this.blockParams = [];
3971
3972 this.compileChildren(environment, options);
3973
3974 this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
3975 this.useBlockParams = this.useBlockParams || environment.useBlockParams;
3976
3977 var opcodes = environment.opcodes,
3978 opcode = undefined,
3979 firstLoc = undefined,
3980 i = undefined,
3981 l = undefined;
3982
3983 for (i = 0, l = opcodes.length; i < l; i++) {
3984 opcode = opcodes[i];
3985
3986 this.source.currentLocation = opcode.loc;
3987 firstLoc = firstLoc || opcode.loc;
3988 this[opcode.opcode].apply(this, opcode.args);
3989 }
3990
3991 // Flush any trailing content that might be pending.
3992 this.source.currentLocation = firstLoc;
3993 this.pushSource('');
3994
3995 /* istanbul ignore next */
3996 if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
3997 throw new _exception2['default']('Compile completed with content left on stack');
3998 }
3999
4000 if (!this.decorators.isEmpty()) {
4001 this.useDecorators = true;
4002
4003 this.decorators.prepend(['var decorators = container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']);
4004 this.decorators.push('return fn;');
4005
4006 if (asObject) {
4007 this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
4008 } else {
4009 this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
4010 this.decorators.push('}\n');
4011 this.decorators = this.decorators.merge();
4012 }
4013 } else {
4014 this.decorators = undefined;
4015 }
4016
4017 var fn = this.createFunctionContext(asObject);
4018 if (!this.isChild) {
4019 var ret = {
4020 compiler: this.compilerInfo(),
4021 main: fn
4022 };
4023
4024 if (this.decorators) {
4025 ret.main_d = this.decorators; // eslint-disable-line camelcase
4026 ret.useDecorators = true;
4027 }
4028
4029 var _context = this.context;
4030 var programs = _context.programs;
4031 var decorators = _context.decorators;
4032
4033 for (i = 0, l = programs.length; i < l; i++) {
4034 if (programs[i]) {
4035 ret[i] = programs[i];
4036 if (decorators[i]) {
4037 ret[i + '_d'] = decorators[i];
4038 ret.useDecorators = true;
4039 }
4040 }
4041 }
4042
4043 if (this.environment.usePartial) {
4044 ret.usePartial = true;
4045 }
4046 if (this.options.data) {
4047 ret.useData = true;
4048 }
4049 if (this.useDepths) {
4050 ret.useDepths = true;
4051 }
4052 if (this.useBlockParams) {
4053 ret.useBlockParams = true;
4054 }
4055 if (this.options.compat) {
4056 ret.compat = true;
4057 }
4058
4059 if (!asObject) {
4060 ret.compiler = JSON.stringify(ret.compiler);
4061
4062 this.source.currentLocation = { start: { line: 1, column: 0 } };
4063 ret = this.objectLiteral(ret);
4064
4065 if (options.srcName) {
4066 ret = ret.toStringWithSourceMap({ file: options.destName });
4067 ret.map = ret.map && ret.map.toString();
4068 } else {
4069 ret = ret.toString();
4070 }
4071 } else {
4072 ret.compilerOptions = this.options;
4073 }
4074
4075 return ret;
4076 } else {
4077 return fn;
4078 }
4079 },
4080
4081 preamble: function preamble() {
4082 // track the last context pushed into place to allow skipping the
4083 // getContext opcode when it would be a noop
4084 this.lastContext = 0;
4085 this.source = new _codeGen2['default'](this.options.srcName);
4086 this.decorators = new _codeGen2['default'](this.options.srcName);
4087 },
4088
4089 createFunctionContext: function createFunctionContext(asObject) {
4090 // istanbul ignore next
4091
4092 var _this = this;
4093
4094 var varDeclarations = '';
4095
4096 var locals = this.stackVars.concat(this.registers.list);
4097 if (locals.length > 0) {
4098 varDeclarations += ', ' + locals.join(', ');
4099 }
4100
4101 // Generate minimizer alias mappings
4102 //
4103 // When using true SourceNodes, this will update all references to the given alias
4104 // as the source nodes are reused in situ. For the non-source node compilation mode,
4105 // aliases will not be used, but this case is already being run on the client and
4106 // we aren't concern about minimizing the template size.
4107 var aliasCount = 0;
4108 _Object$keys(this.aliases).forEach(function (alias) {
4109 var node = _this.aliases[alias];
4110 if (node.children && node.referenceCount > 1) {
4111 varDeclarations += ', alias' + ++aliasCount + '=' + alias;
4112 node.children[0] = 'alias' + aliasCount;
4113 }
4114 });
4115
4116 if (this.lookupPropertyFunctionIsUsed) {
4117 varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration();
4118 }
4119
4120 var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
4121
4122 if (this.useBlockParams || this.useDepths) {
4123 params.push('blockParams');
4124 }
4125 if (this.useDepths) {
4126 params.push('depths');
4127 }
4128
4129 // Perform a second pass over the output to merge content when possible
4130 var source = this.mergeSource(varDeclarations);
4131
4132 if (asObject) {
4133 params.push(source);
4134
4135 return Function.apply(this, params);
4136 } else {
4137 return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
4138 }
4139 },
4140 mergeSource: function mergeSource(varDeclarations) {
4141 var isSimple = this.environment.isSimple,
4142 appendOnly = !this.forceBuffer,
4143 appendFirst = undefined,
4144 sourceSeen = undefined,
4145 bufferStart = undefined,
4146 bufferEnd = undefined;
4147 this.source.each(function (line) {
4148 if (line.appendToBuffer) {
4149 if (bufferStart) {
4150 line.prepend(' + ');
4151 } else {
4152 bufferStart = line;
4153 }
4154 bufferEnd = line;
4155 } else {
4156 if (bufferStart) {
4157 if (!sourceSeen) {
4158 appendFirst = true;
4159 } else {
4160 bufferStart.prepend('buffer += ');
4161 }
4162 bufferEnd.add(';');
4163 bufferStart = bufferEnd = undefined;
4164 }
4165
4166 sourceSeen = true;
4167 if (!isSimple) {
4168 appendOnly = false;
4169 }
4170 }
4171 });
4172
4173 if (appendOnly) {
4174 if (bufferStart) {
4175 bufferStart.prepend('return ');
4176 bufferEnd.add(';');
4177 } else if (!sourceSeen) {
4178 this.source.push('return "";');
4179 }
4180 } else {
4181 varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
4182
4183 if (bufferStart) {
4184 bufferStart.prepend('return buffer + ');
4185 bufferEnd.add(';');
4186 } else {
4187 this.source.push('return buffer;');
4188 }
4189 }
4190
4191 if (varDeclarations) {
4192 this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
4193 }
4194
4195 return this.source.merge();
4196 },
4197
4198 lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() {
4199 return '\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n '.trim();
4200 },
4201
4202 // [blockValue]
4203 //
4204 // On stack, before: hash, inverse, program, value
4205 // On stack, after: return value of blockHelperMissing
4206 //
4207 // The purpose of this opcode is to take a block of the form
4208 // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
4209 // replace it on the stack with the result of properly
4210 // invoking blockHelperMissing.
4211 blockValue: function blockValue(name) {
4212 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
4213 params = [this.contextName(0)];
4214 this.setupHelperArgs(name, 0, params);
4215
4216 var blockName = this.popStack();
4217 params.splice(1, 0, blockName);
4218
4219 this.push(this.source.functionCall(blockHelperMissing, 'call', params));
4220 },
4221
4222 // [ambiguousBlockValue]
4223 //
4224 // On stack, before: hash, inverse, program, value
4225 // Compiler value, before: lastHelper=value of last found helper, if any
4226 // On stack, after, if no lastHelper: same as [blockValue]
4227 // On stack, after, if lastHelper: value
4228 ambiguousBlockValue: function ambiguousBlockValue() {
4229 // We're being a bit cheeky and reusing the options value from the prior exec
4230 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
4231 params = [this.contextName(0)];
4232 this.setupHelperArgs('', 0, params, true);
4233
4234 this.flushInline();
4235
4236 var current = this.topStack();
4237 params.splice(1, 0, current);
4238
4239 this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
4240 },
4241
4242 // [appendContent]
4243 //
4244 // On stack, before: ...
4245 // On stack, after: ...
4246 //
4247 // Appends the string value of `content` to the current buffer
4248 appendContent: function appendContent(content) {
4249 if (this.pendingContent) {
4250 content = this.pendingContent + content;
4251 } else {
4252 this.pendingLocation = this.source.currentLocation;
4253 }
4254
4255 this.pendingContent = content;
4256 },
4257
4258 // [append]
4259 //
4260 // On stack, before: value, ...
4261 // On stack, after: ...
4262 //
4263 // Coerces `value` to a String and appends it to the current buffer.
4264 //
4265 // If `value` is truthy, or 0, it is coerced into a string and appended
4266 // Otherwise, the empty string is appended
4267 append: function append() {
4268 if (this.isInline()) {
4269 this.replaceStack(function (current) {
4270 return [' != null ? ', current, ' : ""'];
4271 });
4272
4273 this.pushSource(this.appendToBuffer(this.popStack()));
4274 } else {
4275 var local = this.popStack();
4276 this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
4277 if (this.environment.isSimple) {
4278 this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
4279 }
4280 }
4281 },
4282
4283 // [appendEscaped]
4284 //
4285 // On stack, before: value, ...
4286 // On stack, after: ...
4287 //
4288 // Escape `value` and append it to the buffer
4289 appendEscaped: function appendEscaped() {
4290 this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
4291 },
4292
4293 // [getContext]
4294 //
4295 // On stack, before: ...
4296 // On stack, after: ...
4297 // Compiler value, after: lastContext=depth
4298 //
4299 // Set the value of the `lastContext` compiler value to the depth
4300 getContext: function getContext(depth) {
4301 this.lastContext = depth;
4302 },
4303
4304 // [pushContext]
4305 //
4306 // On stack, before: ...
4307 // On stack, after: currentContext, ...
4308 //
4309 // Pushes the value of the current context onto the stack.
4310 pushContext: function pushContext() {
4311 this.pushStackLiteral(this.contextName(this.lastContext));
4312 },
4313
4314 // [lookupOnContext]
4315 //
4316 // On stack, before: ...
4317 // On stack, after: currentContext[name], ...
4318 //
4319 // Looks up the value of `name` on the current context and pushes
4320 // it onto the stack.
4321 lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
4322 var i = 0;
4323
4324 if (!scoped && this.options.compat && !this.lastContext) {
4325 // The depthed query is expected to handle the undefined logic for the root level that
4326 // is implemented below, so we evaluate that directly in compat mode
4327 this.push(this.depthedLookup(parts[i++]));
4328 } else {
4329 this.pushContext();
4330 }
4331
4332 this.resolvePath('context', parts, i, falsy, strict);
4333 },
4334
4335 // [lookupBlockParam]
4336 //
4337 // On stack, before: ...
4338 // On stack, after: blockParam[name], ...
4339 //
4340 // Looks up the value of `parts` on the given block param and pushes
4341 // it onto the stack.
4342 lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
4343 this.useBlockParams = true;
4344
4345 this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
4346 this.resolvePath('context', parts, 1);
4347 },
4348
4349 // [lookupData]
4350 //
4351 // On stack, before: ...
4352 // On stack, after: data, ...
4353 //
4354 // Push the data lookup operator
4355 lookupData: function lookupData(depth, parts, strict) {
4356 if (!depth) {
4357 this.pushStackLiteral('data');
4358 } else {
4359 this.pushStackLiteral('container.data(data, ' + depth + ')');
4360 }
4361
4362 this.resolvePath('data', parts, 0, true, strict);
4363 },
4364
4365 resolvePath: function resolvePath(type, parts, i, falsy, strict) {
4366 // istanbul ignore next
4367
4368 var _this2 = this;
4369
4370 if (this.options.strict || this.options.assumeObjects) {
4371 this.push(strictLookup(this.options.strict && strict, this, parts, type));
4372 return;
4373 }
4374
4375 var len = parts.length;
4376 for (; i < len; i++) {
4377 /* eslint-disable no-loop-func */
4378 this.replaceStack(function (current) {
4379 var lookup = _this2.nameLookup(current, parts[i], type);
4380 // We want to ensure that zero and false are handled properly if the context (falsy flag)
4381 // needs to have the special handling for these values.
4382 if (!falsy) {
4383 return [' != null ? ', lookup, ' : ', current];
4384 } else {
4385 // Otherwise we can use generic falsy handling
4386 return [' && ', lookup];
4387 }
4388 });
4389 /* eslint-enable no-loop-func */
4390 }
4391 },
4392
4393 // [resolvePossibleLambda]
4394 //
4395 // On stack, before: value, ...
4396 // On stack, after: resolved value, ...
4397 //
4398 // If the `value` is a lambda, replace it on the stack by
4399 // the return value of the lambda
4400 resolvePossibleLambda: function resolvePossibleLambda() {
4401 this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
4402 },
4403
4404 // [pushStringParam]
4405 //
4406 // On stack, before: ...
4407 // On stack, after: string, currentContext, ...
4408 //
4409 // This opcode is designed for use in string mode, which
4410 // provides the string value of a parameter along with its
4411 // depth rather than resolving it immediately.
4412 pushStringParam: function pushStringParam(string, type) {
4413 this.pushContext();
4414 this.pushString(type);
4415
4416 // If it's a subexpression, the string result
4417 // will be pushed after this opcode.
4418 if (type !== 'SubExpression') {
4419 if (typeof string === 'string') {
4420 this.pushString(string);
4421 } else {
4422 this.pushStackLiteral(string);
4423 }
4424 }
4425 },
4426
4427 emptyHash: function emptyHash(omitEmpty) {
4428 if (this.trackIds) {
4429 this.push('{}'); // hashIds
4430 }
4431 if (this.stringParams) {
4432 this.push('{}'); // hashContexts
4433 this.push('{}'); // hashTypes
4434 }
4435 this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
4436 },
4437 pushHash: function pushHash() {
4438 if (this.hash) {
4439 this.hashes.push(this.hash);
4440 }
4441 this.hash = { values: {}, types: [], contexts: [], ids: [] };
4442 },
4443 popHash: function popHash() {
4444 var hash = this.hash;
4445 this.hash = this.hashes.pop();
4446
4447 if (this.trackIds) {
4448 this.push(this.objectLiteral(hash.ids));
4449 }
4450 if (this.stringParams) {
4451 this.push(this.objectLiteral(hash.contexts));
4452 this.push(this.objectLiteral(hash.types));
4453 }
4454
4455 this.push(this.objectLiteral(hash.values));
4456 },
4457
4458 // [pushString]
4459 //
4460 // On stack, before: ...
4461 // On stack, after: quotedString(string), ...
4462 //
4463 // Push a quoted version of `string` onto the stack
4464 pushString: function pushString(string) {
4465 this.pushStackLiteral(this.quotedString(string));
4466 },
4467
4468 // [pushLiteral]
4469 //
4470 // On stack, before: ...
4471 // On stack, after: value, ...
4472 //
4473 // Pushes a value onto the stack. This operation prevents
4474 // the compiler from creating a temporary variable to hold
4475 // it.
4476 pushLiteral: function pushLiteral(value) {
4477 this.pushStackLiteral(value);
4478 },
4479
4480 // [pushProgram]
4481 //
4482 // On stack, before: ...
4483 // On stack, after: program(guid), ...
4484 //
4485 // Push a program expression onto the stack. This takes
4486 // a compile-time guid and converts it into a runtime-accessible
4487 // expression.
4488 pushProgram: function pushProgram(guid) {
4489 if (guid != null) {
4490 this.pushStackLiteral(this.programExpression(guid));
4491 } else {
4492 this.pushStackLiteral(null);
4493 }
4494 },
4495
4496 // [registerDecorator]
4497 //
4498 // On stack, before: hash, program, params..., ...
4499 // On stack, after: ...
4500 //
4501 // Pops off the decorator's parameters, invokes the decorator,
4502 // and inserts the decorator into the decorators list.
4503 registerDecorator: function registerDecorator(paramSize, name) {
4504 var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
4505 options = this.setupHelperArgs(name, paramSize);
4506
4507 this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
4508 },
4509
4510 // [invokeHelper]
4511 //
4512 // On stack, before: hash, inverse, program, params..., ...
4513 // On stack, after: result of helper invocation
4514 //
4515 // Pops off the helper's parameters, invokes the helper,
4516 // and pushes the helper's return value onto the stack.
4517 //
4518 // If the helper is not found, `helperMissing` is called.
4519 invokeHelper: function invokeHelper(paramSize, name, isSimple) {
4520 var nonHelper = this.popStack(),
4521 helper = this.setupHelper(paramSize, name);
4522
4523 var possibleFunctionCalls = [];
4524
4525 if (isSimple) {
4526 // direct call to helper
4527 possibleFunctionCalls.push(helper.name);
4528 }
4529 // call a function from the input object
4530 possibleFunctionCalls.push(nonHelper);
4531 if (!this.options.strict) {
4532 possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing'));
4533 }
4534
4535 var functionLookupCode = ['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')'];
4536 var functionCall = this.source.functionCall(functionLookupCode, 'call', helper.callParams);
4537 this.push(functionCall);
4538 },
4539
4540 itemsSeparatedBy: function itemsSeparatedBy(items, separator) {
4541 var result = [];
4542 result.push(items[0]);
4543 for (var i = 1; i < items.length; i++) {
4544 result.push(separator, items[i]);
4545 }
4546 return result;
4547 },
4548 // [invokeKnownHelper]
4549 //
4550 // On stack, before: hash, inverse, program, params..., ...
4551 // On stack, after: result of helper invocation
4552 //
4553 // This operation is used when the helper is known to exist,
4554 // so a `helperMissing` fallback is not required.
4555 invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
4556 var helper = this.setupHelper(paramSize, name);
4557 this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
4558 },
4559
4560 // [invokeAmbiguous]
4561 //
4562 // On stack, before: hash, inverse, program, params..., ...
4563 // On stack, after: result of disambiguation
4564 //
4565 // This operation is used when an expression like `{{foo}}`
4566 // is provided, but we don't know at compile-time whether it
4567 // is a helper or a path.
4568 //
4569 // This operation emits more code than the other options,
4570 // and can be avoided by passing the `knownHelpers` and
4571 // `knownHelpersOnly` flags at compile-time.
4572 invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
4573 this.useRegister('helper');
4574
4575 var nonHelper = this.popStack();
4576
4577 this.emptyHash();
4578 var helper = this.setupHelper(0, name, helperCall);
4579
4580 var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
4581
4582 var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
4583 if (!this.options.strict) {
4584 lookup[0] = '(helper = ';
4585 lookup.push(' != null ? helper : ', this.aliasable('container.hooks.helperMissing'));
4586 }
4587
4588 this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
4589 },
4590
4591 // [invokePartial]
4592 //
4593 // On stack, before: context, ...
4594 // On stack after: result of partial invocation
4595 //
4596 // This operation pops off a context, invokes a partial with that context,
4597 // and pushes the result of the invocation back.
4598 invokePartial: function invokePartial(isDynamic, name, indent) {
4599 var params = [],
4600 options = this.setupParams(name, 1, params);
4601
4602 if (isDynamic) {
4603 name = this.popStack();
4604 delete options.name;
4605 }
4606
4607 if (indent) {
4608 options.indent = JSON.stringify(indent);
4609 }
4610 options.helpers = 'helpers';
4611 options.partials = 'partials';
4612 options.decorators = 'container.decorators';
4613
4614 if (!isDynamic) {
4615 params.unshift(this.nameLookup('partials', name, 'partial'));
4616 } else {
4617 params.unshift(name);
4618 }
4619
4620 if (this.options.compat) {
4621 options.depths = 'depths';
4622 }
4623 options = this.objectLiteral(options);
4624 params.push(options);
4625
4626 this.push(this.source.functionCall('container.invokePartial', '', params));
4627 },
4628
4629 // [assignToHash]
4630 //
4631 // On stack, before: value, ..., hash, ...
4632 // On stack, after: ..., hash, ...
4633 //
4634 // Pops a value off the stack and assigns it to the current hash
4635 assignToHash: function assignToHash(key) {
4636 var value = this.popStack(),
4637 context = undefined,
4638 type = undefined,
4639 id = undefined;
4640
4641 if (this.trackIds) {
4642 id = this.popStack();
4643 }
4644 if (this.stringParams) {
4645 type = this.popStack();
4646 context = this.popStack();
4647 }
4648
4649 var hash = this.hash;
4650 if (context) {
4651 hash.contexts[key] = context;
4652 }
4653 if (type) {
4654 hash.types[key] = type;
4655 }
4656 if (id) {
4657 hash.ids[key] = id;
4658 }
4659 hash.values[key] = value;
4660 },
4661
4662 pushId: function pushId(type, name, child) {
4663 if (type === 'BlockParam') {
4664 this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
4665 } else if (type === 'PathExpression') {
4666 this.pushString(name);
4667 } else if (type === 'SubExpression') {
4668 this.pushStackLiteral('true');
4669 } else {
4670 this.pushStackLiteral('null');
4671 }
4672 },
4673
4674 // HELPERS
4675
4676 compiler: JavaScriptCompiler,
4677
4678 compileChildren: function compileChildren(environment, options) {
4679 var children = environment.children,
4680 child = undefined,
4681 compiler = undefined;
4682
4683 for (var i = 0, l = children.length; i < l; i++) {
4684 child = children[i];
4685 compiler = new this.compiler(); // eslint-disable-line new-cap
4686
4687 var existing = this.matchExistingProgram(child);
4688
4689 if (existing == null) {
4690 this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
4691 var index = this.context.programs.length;
4692 child.index = index;
4693 child.name = 'program' + index;
4694 this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
4695 this.context.decorators[index] = compiler.decorators;
4696 this.context.environments[index] = child;
4697
4698 this.useDepths = this.useDepths || compiler.useDepths;
4699 this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
4700 child.useDepths = this.useDepths;
4701 child.useBlockParams = this.useBlockParams;
4702 } else {
4703 child.index = existing.index;
4704 child.name = 'program' + existing.index;
4705
4706 this.useDepths = this.useDepths || existing.useDepths;
4707 this.useBlockParams = this.useBlockParams || existing.useBlockParams;
4708 }
4709 }
4710 },
4711 matchExistingProgram: function matchExistingProgram(child) {
4712 for (var i = 0, len = this.context.environments.length; i < len; i++) {
4713 var environment = this.context.environments[i];
4714 if (environment && environment.equals(child)) {
4715 return environment;
4716 }
4717 }
4718 },
4719
4720 programExpression: function programExpression(guid) {
4721 var child = this.environment.children[guid],
4722 programParams = [child.index, 'data', child.blockParams];
4723
4724 if (this.useBlockParams || this.useDepths) {
4725 programParams.push('blockParams');
4726 }
4727 if (this.useDepths) {
4728 programParams.push('depths');
4729 }
4730
4731 return 'container.program(' + programParams.join(', ') + ')';
4732 },
4733
4734 useRegister: function useRegister(name) {
4735 if (!this.registers[name]) {
4736 this.registers[name] = true;
4737 this.registers.list.push(name);
4738 }
4739 },
4740
4741 push: function push(expr) {
4742 if (!(expr instanceof Literal)) {
4743 expr = this.source.wrap(expr);
4744 }
4745
4746 this.inlineStack.push(expr);
4747 return expr;
4748 },
4749
4750 pushStackLiteral: function pushStackLiteral(item) {
4751 this.push(new Literal(item));
4752 },
4753
4754 pushSource: function pushSource(source) {
4755 if (this.pendingContent) {
4756 this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
4757 this.pendingContent = undefined;
4758 }
4759
4760 if (source) {
4761 this.source.push(source);
4762 }
4763 },
4764
4765 replaceStack: function replaceStack(callback) {
4766 var prefix = ['('],
4767 stack = undefined,
4768 createdStack = undefined,
4769 usedLiteral = undefined;
4770
4771 /* istanbul ignore next */
4772 if (!this.isInline()) {
4773 throw new _exception2['default']('replaceStack on non-inline');
4774 }
4775
4776 // We want to merge the inline statement into the replacement statement via ','
4777 var top = this.popStack(true);
4778
4779 if (top instanceof Literal) {
4780 // Literals do not need to be inlined
4781 stack = [top.value];
4782 prefix = ['(', stack];
4783 usedLiteral = true;
4784 } else {
4785 // Get or create the current stack name for use by the inline
4786 createdStack = true;
4787 var _name = this.incrStack();
4788
4789 prefix = ['((', this.push(_name), ' = ', top, ')'];
4790 stack = this.topStack();
4791 }
4792
4793 var item = callback.call(this, stack);
4794
4795 if (!usedLiteral) {
4796 this.popStack();
4797 }
4798 if (createdStack) {
4799 this.stackSlot--;
4800 }
4801 this.push(prefix.concat(item, ')'));
4802 },
4803
4804 incrStack: function incrStack() {
4805 this.stackSlot++;
4806 if (this.stackSlot > this.stackVars.length) {
4807 this.stackVars.push('stack' + this.stackSlot);
4808 }
4809 return this.topStackName();
4810 },
4811 topStackName: function topStackName() {
4812 return 'stack' + this.stackSlot;
4813 },
4814 flushInline: function flushInline() {
4815 var inlineStack = this.inlineStack;
4816 this.inlineStack = [];
4817 for (var i = 0, len = inlineStack.length; i < len; i++) {
4818 var entry = inlineStack[i];
4819 /* istanbul ignore if */
4820 if (entry instanceof Literal) {
4821 this.compileStack.push(entry);
4822 } else {
4823 var stack = this.incrStack();
4824 this.pushSource([stack, ' = ', entry, ';']);
4825 this.compileStack.push(stack);
4826 }
4827 }
4828 },
4829 isInline: function isInline() {
4830 return this.inlineStack.length;
4831 },
4832
4833 popStack: function popStack(wrapped) {
4834 var inline = this.isInline(),
4835 item = (inline ? this.inlineStack : this.compileStack).pop();
4836
4837 if (!wrapped && item instanceof Literal) {
4838 return item.value;
4839 } else {
4840 if (!inline) {
4841 /* istanbul ignore next */
4842 if (!this.stackSlot) {
4843 throw new _exception2['default']('Invalid stack pop');
4844 }
4845 this.stackSlot--;
4846 }
4847 return item;
4848 }
4849 },
4850
4851 topStack: function topStack() {
4852 var stack = this.isInline() ? this.inlineStack : this.compileStack,
4853 item = stack[stack.length - 1];
4854
4855 /* istanbul ignore if */
4856 if (item instanceof Literal) {
4857 return item.value;
4858 } else {
4859 return item;
4860 }
4861 },
4862
4863 contextName: function contextName(context) {
4864 if (this.useDepths && context) {
4865 return 'depths[' + context + ']';
4866 } else {
4867 return 'depth' + context;
4868 }
4869 },
4870
4871 quotedString: function quotedString(str) {
4872 return this.source.quotedString(str);
4873 },
4874
4875 objectLiteral: function objectLiteral(obj) {
4876 return this.source.objectLiteral(obj);
4877 },
4878
4879 aliasable: function aliasable(name) {
4880 var ret = this.aliases[name];
4881 if (ret) {
4882 ret.referenceCount++;
4883 return ret;
4884 }
4885
4886 ret = this.aliases[name] = this.source.wrap(name);
4887 ret.aliasable = true;
4888 ret.referenceCount = 1;
4889
4890 return ret;
4891 },
4892
4893 setupHelper: function setupHelper(paramSize, name, blockHelper) {
4894 var params = [],
4895 paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
4896 var foundHelper = this.nameLookup('helpers', name, 'helper'),
4897 callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})');
4898
4899 return {
4900 params: params,
4901 paramsInit: paramsInit,
4902 name: foundHelper,
4903 callParams: [callContext].concat(params)
4904 };
4905 },
4906
4907 setupParams: function setupParams(helper, paramSize, params) {
4908 var options = {},
4909 contexts = [],
4910 types = [],
4911 ids = [],
4912 objectArgs = !params,
4913 param = undefined;
4914
4915 if (objectArgs) {
4916 params = [];
4917 }
4918
4919 options.name = this.quotedString(helper);
4920 options.hash = this.popStack();
4921
4922 if (this.trackIds) {
4923 options.hashIds = this.popStack();
4924 }
4925 if (this.stringParams) {
4926 options.hashTypes = this.popStack();
4927 options.hashContexts = this.popStack();
4928 }
4929
4930 var inverse = this.popStack(),
4931 program = this.popStack();
4932
4933 // Avoid setting fn and inverse if neither are set. This allows
4934 // helpers to do a check for `if (options.fn)`
4935 if (program || inverse) {
4936 options.fn = program || 'container.noop';
4937 options.inverse = inverse || 'container.noop';
4938 }
4939
4940 // The parameters go on to the stack in order (making sure that they are evaluated in order)
4941 // so we need to pop them off the stack in reverse order
4942 var i = paramSize;
4943 while (i--) {
4944 param = this.popStack();
4945 params[i] = param;
4946
4947 if (this.trackIds) {
4948 ids[i] = this.popStack();
4949 }
4950 if (this.stringParams) {
4951 types[i] = this.popStack();
4952 contexts[i] = this.popStack();
4953 }
4954 }
4955
4956 if (objectArgs) {
4957 options.args = this.source.generateArray(params);
4958 }
4959
4960 if (this.trackIds) {
4961 options.ids = this.source.generateArray(ids);
4962 }
4963 if (this.stringParams) {
4964 options.types = this.source.generateArray(types);
4965 options.contexts = this.source.generateArray(contexts);
4966 }
4967
4968 if (this.options.data) {
4969 options.data = 'data';
4970 }
4971 if (this.useBlockParams) {
4972 options.blockParams = 'blockParams';
4973 }
4974 return options;
4975 },
4976
4977 setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
4978 var options = this.setupParams(helper, paramSize, params);
4979 options.loc = JSON.stringify(this.source.currentLocation);
4980 options = this.objectLiteral(options);
4981 if (useRegister) {
4982 this.useRegister('options');
4983 params.push('options');
4984 return ['options=', options];
4985 } else if (params) {
4986 params.push(options);
4987 return '';
4988 } else {
4989 return options;
4990 }
4991 }
4992 };
4993
4994 (function () {
4995 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(' ');
4996
4997 var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
4998
4999 for (var i = 0, l = reservedWords.length; i < l; i++) {
5000 compilerWords[reservedWords[i]] = true;
5001 }
5002 })();
5003
5004 /**
5005 * @deprecated May be removed in the next major version
5006 */
5007 JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
5008 return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
5009 };
5010
5011 function strictLookup(requireTerminal, compiler, parts, type) {
5012 var stack = compiler.popStack(),
5013 i = 0,
5014 len = parts.length;
5015 if (requireTerminal) {
5016 len--;
5017 }
5018
5019 for (; i < len; i++) {
5020 stack = compiler.nameLookup(stack, parts[i], type);
5021 }
5022
5023 if (requireTerminal) {
5024 return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ' )'];
5025 } else {
5026 return stack;
5027 }
5028 }
5029
5030 exports['default'] = JavaScriptCompiler;
5031 module.exports = exports['default'];
5032
5033/***/ }),
5034/* 53 */
5035/***/ (function(module, exports, __webpack_require__) {
5036
5037 /* global define */
5038 'use strict';
5039
5040 var _Object$keys = __webpack_require__(13)['default'];
5041
5042 exports.__esModule = true;
5043
5044 var _utils = __webpack_require__(5);
5045
5046 var SourceNode = undefined;
5047
5048 try {
5049 /* istanbul ignore next */
5050 if (false) {
5051 // We don't support this in AMD environments. For these environments, we asusme that
5052 // they are running on the browser and thus have no need for the source-map library.
5053 var SourceMap = require('source-map');
5054 SourceNode = SourceMap.SourceNode;
5055 }
5056 } catch (err) {}
5057 /* NOP */
5058
5059 /* istanbul ignore if: tested but not covered in istanbul due to dist build */
5060 if (!SourceNode) {
5061 SourceNode = function (line, column, srcFile, chunks) {
5062 this.src = '';
5063 if (chunks) {
5064 this.add(chunks);
5065 }
5066 };
5067 /* istanbul ignore next */
5068 SourceNode.prototype = {
5069 add: function add(chunks) {
5070 if (_utils.isArray(chunks)) {
5071 chunks = chunks.join('');
5072 }
5073 this.src += chunks;
5074 },
5075 prepend: function prepend(chunks) {
5076 if (_utils.isArray(chunks)) {
5077 chunks = chunks.join('');
5078 }
5079 this.src = chunks + this.src;
5080 },
5081 toStringWithSourceMap: function toStringWithSourceMap() {
5082 return { code: this.toString() };
5083 },
5084 toString: function toString() {
5085 return this.src;
5086 }
5087 };
5088 }
5089
5090 function castChunk(chunk, codeGen, loc) {
5091 if (_utils.isArray(chunk)) {
5092 var ret = [];
5093
5094 for (var i = 0, len = chunk.length; i < len; i++) {
5095 ret.push(codeGen.wrap(chunk[i], loc));
5096 }
5097 return ret;
5098 } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
5099 // Handle primitives that the SourceNode will throw up on
5100 return chunk + '';
5101 }
5102 return chunk;
5103 }
5104
5105 function CodeGen(srcFile) {
5106 this.srcFile = srcFile;
5107 this.source = [];
5108 }
5109
5110 CodeGen.prototype = {
5111 isEmpty: function isEmpty() {
5112 return !this.source.length;
5113 },
5114 prepend: function prepend(source, loc) {
5115 this.source.unshift(this.wrap(source, loc));
5116 },
5117 push: function push(source, loc) {
5118 this.source.push(this.wrap(source, loc));
5119 },
5120
5121 merge: function merge() {
5122 var source = this.empty();
5123 this.each(function (line) {
5124 source.add([' ', line, '\n']);
5125 });
5126 return source;
5127 },
5128
5129 each: function each(iter) {
5130 for (var i = 0, len = this.source.length; i < len; i++) {
5131 iter(this.source[i]);
5132 }
5133 },
5134
5135 empty: function empty() {
5136 var loc = this.currentLocation || { start: {} };
5137 return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
5138 },
5139 wrap: function wrap(chunk) {
5140 var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
5141
5142 if (chunk instanceof SourceNode) {
5143 return chunk;
5144 }
5145
5146 chunk = castChunk(chunk, this, loc);
5147
5148 return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
5149 },
5150
5151 functionCall: function functionCall(fn, type, params) {
5152 params = this.generateList(params);
5153 return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
5154 },
5155
5156 quotedString: function quotedString(str) {
5157 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
5158 .replace(/\u2029/g, '\\u2029') + '"';
5159 },
5160
5161 objectLiteral: function objectLiteral(obj) {
5162 // istanbul ignore next
5163
5164 var _this = this;
5165
5166 var pairs = [];
5167
5168 _Object$keys(obj).forEach(function (key) {
5169 var value = castChunk(obj[key], _this);
5170 if (value !== 'undefined') {
5171 pairs.push([_this.quotedString(key), ':', value]);
5172 }
5173 });
5174
5175 var ret = this.generateList(pairs);
5176 ret.prepend('{');
5177 ret.add('}');
5178 return ret;
5179 },
5180
5181 generateList: function generateList(entries) {
5182 var ret = this.empty();
5183
5184 for (var i = 0, len = entries.length; i < len; i++) {
5185 if (i) {
5186 ret.add(',');
5187 }
5188
5189 ret.add(castChunk(entries[i], this));
5190 }
5191
5192 return ret;
5193 },
5194
5195 generateArray: function generateArray(entries) {
5196 var ret = this.generateList(entries);
5197 ret.prepend('[');
5198 ret.add(']');
5199
5200 return ret;
5201 }
5202 };
5203
5204 exports['default'] = CodeGen;
5205 module.exports = exports['default'];
5206
5207/***/ })
5208/******/ ])
5209});
5210;