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