vendor: 4,729 bytes, lines 1-148
1/**! 2 3 @license 4 handlebars v4.0.12 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,342 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.0.12'; 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,539 bytes, lines 1630-1886
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 1635 var $0 = $$.length - 1; 1636 switch (yystate) { 1637 case 1: 1638 return $$[$0 - 1]; 1639 break; 1640 case 2: 1641 this.$ = yy.prepareProgram($$[$0]); 1642 break; 1643 case 3: 1644 this.$ = $$[$0]; 1645 break; 1646 case 4: 1647 this.$ = $$[$0]; 1648 break; 1649 case 5: 1650 this.$ = $$[$0]; 1651 break; 1652 case 6: 1653 this.$ = $$[$0]; 1654 break; 1655 case 7: 1656 this.$ = $$[$0]; 1657 break; 1658 case 8: 1659 this.$ = $$[$0]; 1660 break; 1661 case 9: 1662 this.$ = { 1663 type: 'CommentStatement', 1664 value: yy.stripComment($$[$0]), 1665 strip: yy.stripFlags($$[$0], $$[$0]), 1666 loc: yy.locInfo(this._$) 1667 }; 1668 1669 break; 1670 case 10: 1671 this.$ = { 1672 type: 'ContentStatement', 1673 original: $$[$0], 1674 value: $$[$0], 1675 loc: yy.locInfo(this._$) 1676 }; 1677 1678 break; 1679 case 11: 1680 this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 1681 break; 1682 case 12: 1683 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] }; 1684 break; 1685 case 13: 1686 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$); 1687 break; 1688 case 14: 1689 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$); 1690 break; 1691 case 15: 1692 this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 1693 break; 1694 case 16: 1695 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 1696 break; 1697 case 17: 1698 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 1699 break; 1700 case 18: 1701 this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] }; 1702 break; 1703 case 19: 1704 var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$), 1705 program = yy.prepareProgram([inverse], $$[$0 - 1].loc); 1706 program.chained = true; 1707 1708 this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true }; 1709 1710 break; 1711 case 20: 1712 this.$ = $$[$0]; 1713 break; 1714 case 21: 1715 this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) }; 1716 break; 1717 case 22: 1718 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 1719 break; 1720 case 23: 1721 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 1722 break; 1723 case 24: 1724 this.$ = { 1725 type: 'PartialStatement', 1726 name: $$[$0 - 3], 1727 params: $$[$0 - 2], 1728 hash: $$[$0 - 1], 1729 indent: '', 1730 strip: yy.stripFlags($$[$0 - 4], $$[$0]), 1731 loc: yy.locInfo(this._$) 1732 }; 1733 1734 break; 1735 case 25: 1736 this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 1737 break; 1738 case 26: 1739 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) }; 1740 break; 1741 case 27: 1742 this.$ = $$[$0]; 1743 break; 1744 case 28: 1745 this.$ = $$[$0]; 1746 break; 1747 case 29: 1748 this.$ = { 1749 type: 'SubExpression', 1750 path: $$[$0 - 3], 1751 params: $$[$0 - 2], 1752 hash: $$[$0 - 1], 1753 loc: yy.locInfo(this._$) 1754 }; 1755 1756 break; 1757 case 30: 1758 this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) }; 1759 break; 1760 case 31: 1761 this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) }; 1762 break; 1763 case 32: 1764 this.$ = yy.id($$[$0 - 1]); 1765 break; 1766 case 33: 1767 this.$ = $$[$0]; 1768 break; 1769 case 34: 1770 this.$ = $$[$0]; 1771 break; 1772 case 35: 1773 this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) }; 1774 break; 1775 case 36: 1776 this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) }; 1777 break; 1778 case 37: 1779 this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) }; 1780 break; 1781 case 38: 1782 this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) }; 1783 break; 1784 case 39: 1785 this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) }; 1786 break; 1787 case 40: 1788 this.$ = $$[$0]; 1789 break; 1790 case 41: 1791 this.$ = $$[$0]; 1792 break; 1793 case 42: 1794 this.$ = yy.preparePath(true, $$[$0], this._$); 1795 break; 1796 case 43: 1797 this.$ = yy.preparePath(false, $$[$0], this._$); 1798 break; 1799 case 44: 1800 $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2]; 1801 break; 1802 case 45: 1803 this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }]; 1804 break; 1805 case 46: 1806 this.$ = []; 1807 break; 1808 case 47: 1809 $$[$0 - 1].push($$[$0]); 1810 break; 1811 case 48: 1812 this.$ = [$$[$0]]; 1813 break; 1814 case 49: 1815 $$[$0 - 1].push($$[$0]); 1816 break; 1817 case 50: 1818 this.$ = []; 1819 break; 1820 case 51: 1821 $$[$0 - 1].push($$[$0]); 1822 break; 1823 case 58: 1824 this.$ = []; 1825 break; 1826 case 59: 1827 $$[$0 - 1].push($$[$0]); 1828 break; 1829 case 64: 1830 this.$ = []; 1831 break; 1832 case 65: 1833 $$[$0 - 1].push($$[$0]); 1834 break; 1835 case 70: 1836 this.$ = []; 1837 break; 1838 case 71: 1839 $$[$0 - 1].push($$[$0]); 1840 break; 1841 case 78: 1842 this.$ = []; 1843 break; 1844 case 79: 1845 $$[$0 - 1].push($$[$0]); 1846 break; 1847 case 82: 1848 this.$ = []; 1849 break; 1850 case 83: 1851 $$[$0 - 1].push($$[$0]); 1852 break; 1853 case 86: 1854 this.$ = []; 1855 break; 1856 case 87: 1857 $$[$0 - 1].push($$[$0]); 1858 break; 1859 case 90: 1860 this.$ = []; 1861 break; 1862 case 91: 1863 $$[$0 - 1].push($$[$0]); 1864 break; 1865 case 94: 1866 this.$ = []; 1867 break; 1868 case 95: 1869 $$[$0 - 1].push($$[$0]); 1870 break; 1871 case 98: 1872 this.$ = [$$[$0]]; 1873 break; 1874 case 99: 1875 $$[$0 - 1].push($$[$0]); 1876 break; 1877 case 100: 1878 this.$ = [$$[$0]]; 1879 break; 1880 case 101: 1881 $$[$0 - 1].push($$[$0]); 1882 break; 1883 } 1884 }, 1885 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] }], 1886 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
1886], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137
vendor: 13,423 bytes, lines 1886-2170
1886: [2, 32] }, 1887 parseError: function parseError(str, hash) { 1888 throw new Error(str); 1889 }, 1890 parse: function parse(input) { 1891 var self = this, 1892 stack = [0], 1893 vstack = [null], 1894 lstack = [], 1895 table = this.table, 1896 yytext = "", 1897 yylineno = 0, 1898 yyleng = 0, 1899 recovering = 0, 1900 TERROR = 2, 1901 EOF = 1; 1902 this.lexer.setInput(input); 1903 this.lexer.yy = this.yy; 1904 this.yy.lexer = this.lexer; 1905 this.yy.parser = this; 1906 if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {}; 1907 var yyloc = this.lexer.yylloc; 1908 lstack.push(yyloc); 1909 var ranges = this.lexer.options && this.lexer.options.ranges; 1910 if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError; 1911 function popStack(n) { 1912 stack.length = stack.length - 2 * n; 1913 vstack.length = vstack.length - n; 1914 lstack.length = lstack.length - n; 1915 } 1916 function lex() { 1917 var token; 1918 token = self.lexer.lex() || 1; 1919 if (typeof token !== "number") { 1920 token = self.symbols_[token] || token; 1921 } 1922 return token; 1923 } 1924 var symbol, 1925 preErrorSymbol, 1926 state, 1927 action, 1928 a, 1929 r, 1930 yyval = {}, 1931 p, 1932 len, 1933 newState, 1934 expected; 1935 while (true) { 1936 state = stack[stack.length - 1]; 1937 if (this.defaultActions[state]) { 1938 action = this.defaultActions[state]; 1939 } else { 1940 if (symbol === null || typeof symbol == "undefined") { 1941 symbol = lex(); 1942 } 1943 action = table[state] && table[state][symbol]; 1944 } 1945 if (typeof action === "undefined" || !action.length || !action[0]) { 1946 var errStr = ""; 1947 if (!recovering) { 1948 expected = []; 1949 for (p in table[state]) if (this.terminals_[p] && p > 2) { 1950 expected.push("'" + this.terminals_[p] + "'"); 1951 } 1952 if (this.lexer.showPosition) { 1953 errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; 1954 } else { 1955 errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); 1956 } 1957 this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected }); 1958 } 1959 } 1960 if (action[0] instanceof Array && action.length > 1) { 1961 throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); 1962 } 1963 switch (action[0]) { 1964 case 1: 1965 stack.push(symbol); 1966 vstack.push(this.lexer.yytext); 1967 lstack.push(this.lexer.yylloc); 1968 stack.push(action[1]); 1969 symbol = null; 1970 if (!preErrorSymbol) { 1971 yyleng = this.lexer.yyleng; 1972 yytext = this.lexer.yytext; 1973 yylineno = this.lexer.yylineno; 1974 yyloc = this.lexer.yylloc; 1975 if (recovering > 0) recovering--; 1976 } else { 1977 symbol = preErrorSymbol; 1978 preErrorSymbol = null; 1979 } 1980 break; 1981 case 2: 1982 len = this.productions_[action[1]][1]; 1983 yyval.$ = vstack[vstack.length - len]; 1984 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 }; 1985 if (ranges) { 1986 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; 1987 } 1988 r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); 1989 if (typeof r !== "undefined") { 1990 return r; 1991 } 1992 if (len) { 1993 stack = stack.slice(0, -1 * len * 2); 1994 vstack = vstack.slice(0, -1 * len); 1995 lstack = lstack.slice(0, -1 * len); 1996 } 1997 stack.push(this.productions_[action[1]][0]); 1998 vstack.push(yyval.$); 1999 lstack.push(yyval._$); 2000 newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; 2001 stack.push(newState); 2002 break; 2003 case 3: 2004 return true; 2005 } 2006 } 2007 return true; 2008 } 2009 }; 2010 /* Jison generated lexer */ 2011 var lexer = (function () { 2012 var lexer = { EOF: 1, 2013 parseError: function parseError(str, hash) { 2014 if (this.yy.parser) { 2015 this.yy.parser.parseError(str, hash); 2016 } else { 2017 throw new Error(str); 2018 } 2019 }, 2020 setInput: function setInput(input) { 2021 this._input = input; 2022 this._more = this._less = this.done = false; 2023 this.yylineno = this.yyleng = 0; 2024 this.yytext = this.matched = this.match = ''; 2025 this.conditionStack = ['INITIAL']; 2026 this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; 2027 if (this.options.ranges) this.yylloc.range = [0, 0]; 2028 this.offset = 0; 2029 return this; 2030 }, 2031 input: function input() { 2032 var ch = this._input[0]; 2033 this.yytext += ch; 2034 this.yyleng++; 2035 this.offset++; 2036 this.match += ch; 2037 this.matched += ch; 2038 var lines = ch.match(/(?:\r\n?|\n).*/g); 2039 if (lines) { 2040 this.yylineno++; 2041 this.yylloc.last_line++; 2042 } else { 2043 this.yylloc.last_column++; 2044 } 2045 if (this.options.ranges) this.yylloc.range[1]++; 2046 2047 this._input = this._input.slice(1); 2048 return ch; 2049 }, 2050 unput: function unput(ch) { 2051 var len = ch.length; 2052 var lines = ch.split(/(?:\r\n?|\n)/g); 2053 2054 this._input = ch + this._input; 2055 this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); 2056 //this.yyleng -= len; 2057 this.offset -= len; 2058 var oldLines = this.match.split(/(?:\r\n?|\n)/g); 2059 this.match = this.match.substr(0, this.match.length - 1); 2060 this.matched = this.matched.substr(0, this.matched.length - 1); 2061 2062 if (lines.length - 1) this.yylineno -= lines.length - 1; 2063 var r = this.yylloc.range; 2064 2065 this.yylloc = { first_line: this.yylloc.first_line, 2066 last_line: this.yylineno + 1, 2067 first_column: this.yylloc.first_column, 2068 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 2069 }; 2070 2071 if (this.options.ranges) { 2072 this.yylloc.range = [r[0], r[0] + this.yyleng - len]; 2073 } 2074 return this; 2075 }, 2076 more: function more() { 2077 this._more = true; 2078 return this; 2079 }, 2080 less: function less(n) { 2081 this.unput(this.match.slice(n)); 2082 }, 2083 pastInput: function pastInput() { 2084 var past = this.matched.substr(0, this.matched.length - this.match.length); 2085 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, ""); 2086 }, 2087 upcomingInput: function upcomingInput() { 2088 var next = this.match; 2089 if (next.length < 20) { 2090 next += this._input.substr(0, 20 - next.length); 2091 } 2092 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); 2093 }, 2094 showPosition: function showPosition() { 2095 var pre = this.pastInput(); 2096 var c = new Array(pre.length + 1).join("-"); 2097 return pre + this.upcomingInput() + "\n" + c + "^"; 2098 }, 2099 next: function next() { 2100 if (this.done) { 2101 return this.EOF; 2102 } 2103 if (!this._input) this.done = true; 2104 2105 var token, match, tempMatch, index, col, lines; 2106 if (!this._more) { 2107 this.yytext = ''; 2108 this.match = ''; 2109 } 2110 var rules = this._currentRules(); 2111 for (var i = 0; i < rules.length; i++) { 2112 tempMatch = this._input.match(this.rules[rules[i]]); 2113 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { 2114 match = tempMatch; 2115 index = i; 2116 if (!this.options.flex) break; 2117 } 2118 } 2119 if (match) { 2120 lines = match[0].match(/(?:\r\n?|\n).*/g); 2121 if (lines) this.yylineno += lines.length; 2122 this.yylloc = { first_line: this.yylloc.last_line, 2123 last_line: this.yylineno + 1, 2124 first_column: this.yylloc.last_column, 2125 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; 2126 this.yytext += match[0]; 2127 this.match += match[0]; 2128 this.matches = match; 2129 this.yyleng = this.yytext.length; 2130 if (this.options.ranges) { 2131 this.yylloc.range = [this.offset, this.offset += this.yyleng]; 2132 } 2133 this._more = false; 2134 this._input = this._input.slice(match[0].length); 2135 this.matched += match[0]; 2136 token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]); 2137 if (this.done && this._input) this.done = false; 2138 if (token) return token;else return; 2139 } 2140 if (this._input === "") { 2141 return this.EOF; 2142 } else { 2143 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); 2144 } 2145 }, 2146 lex: function lex() { 2147 var r = this.next(); 2148 if (typeof r !== 'undefined') { 2149 return r; 2150 } else { 2151 return this.lex(); 2152 } 2153 }, 2154 begin: function begin(condition) { 2155 this.conditionStack.push(condition); 2156 }, 2157 popState: function popState() { 2158 return this.conditionStack.pop(); 2159 }, 2160 _currentRules: function _currentRules() { 2161 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; 2162 }, 2163 topState: function topState() { 2164 return this.conditionStack[this.conditionStack.length - 2]; 2165 }, 2166 pushState: function begin(condition) { 2167 this.begin(condition); 2168 } }; 2169 lexer.options = {}; 2170 lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START
vendor: 7,146 bytes, lines 2170-2350
2170 2171 /**/) { 2172 2173 function strip(start, end) { 2174 return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end); 2175 } 2176 2177 var YYSTATE = YY_START; 2178 switch ($avoiding_name_collisions) { 2179 case 0: 2180 if (yy_.yytext.slice(-2) === "\\\\") { 2181 strip(0, 1); 2182 this.begin("mu"); 2183 } else if (yy_.yytext.slice(-1) === "\\") { 2184 strip(0, 1); 2185 this.begin("emu"); 2186 } else { 2187 this.begin("mu"); 2188 } 2189 if (yy_.yytext) return 15; 2190 2191 break; 2192 case 1: 2193 return 15; 2194 break; 2195 case 2: 2196 this.popState(); 2197 return 15; 2198 2199 break; 2200 case 3: 2201 this.begin('raw');return 15; 2202 break; 2203 case 4: 2204 this.popState(); 2205 // Should be using `this.topState()` below, but it currently 2206 // returns the second top instead of the first top. Opened an 2207 // issue about it at https://github.com/zaach/jison/issues/291 2208 if (this.conditionStack[this.conditionStack.length - 1] === 'raw') { 2209 return 15; 2210 } else { 2211 yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9); 2212 return 'END_RAW_BLOCK'; 2213 } 2214 2215 break; 2216 case 5: 2217 return 15; 2218 break; 2219 case 6: 2220 this.popState(); 2221 return 14; 2222 2223 break; 2224 case 7: 2225 return 65; 2226 break; 2227 case 8: 2228 return 68; 2229 break; 2230 case 9: 2231 return 19; 2232 break; 2233 case 10: 2234 this.popState(); 2235 this.begin('raw'); 2236 return 23; 2237 2238 break; 2239 case 11: 2240 return 55; 2241 break; 2242 case 12: 2243 return 60; 2244 break; 2245 case 13: 2246 return 29; 2247 break; 2248 case 14: 2249 return 47; 2250 break; 2251 case 15: 2252 this.popState();return 44; 2253 break; 2254 case 16: 2255 this.popState();return 44; 2256 break; 2257 case 17: 2258 return 34; 2259 break; 2260 case 18: 2261 return 39; 2262 break; 2263 case 19: 2264 return 51; 2265 break; 2266 case 20: 2267 return 48; 2268 break; 2269 case 21: 2270 this.unput(yy_.yytext); 2271 this.popState(); 2272 this.begin('com'); 2273 2274 break; 2275 case 22: 2276 this.popState(); 2277 return 14; 2278 2279 break; 2280 case 23: 2281 return 48; 2282 break; 2283 case 24: 2284 return 73; 2285 break; 2286 case 25: 2287 return 72; 2288 break; 2289 case 26: 2290 return 72; 2291 break; 2292 case 27: 2293 return 87; 2294 break; 2295 case 28: 2296 // ignore whitespace 2297 break; 2298 case 29: 2299 this.popState();return 54; 2300 break; 2301 case 30: 2302 this.popState();return 33; 2303 break; 2304 case 31: 2305 yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80; 2306 break; 2307 case 32: 2308 yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80; 2309 break; 2310 case 33: 2311 return 85; 2312 break; 2313 case 34: 2314 return 82; 2315 break; 2316 case 35: 2317 return 82; 2318 break; 2319 case 36: 2320 return 83; 2321 break; 2322 case 37: 2323 return 84; 2324 break; 2325 case 38: 2326 return 81; 2327 break; 2328 case 39: 2329 return 75; 2330 break; 2331 case 40: 2332 return 77; 2333 break; 2334 case 41: 2335 return 72; 2336 break; 2337 case 42: 2338 yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72; 2339 break; 2340 case 43: 2341 return 'INVALID'; 2342 break; 2343 case 44: 2344 return 5; 2345 break; 2346 } 2347 }; 2348 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\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/]; 2349 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 } }; 2350 return lexer;
vendor: 12,193 bytes, lines 2351-2775
2351 })(); 2352 parser.lexer = lexer; 2353 function Parser() { 2354 this.yy = {}; 2355 }Parser.prototype = parser;parser.Parser = Parser; 2356 return new Parser(); 2357 })();exports["default"] = handlebars; 2358 module.exports = exports["default"]; 2359 2360/***/ }), 2361/* 38 */ 2362/***/ (function(module, exports, __webpack_require__) { 2363 2364 'use strict'; 2365 2366 var _interopRequireDefault = __webpack_require__(1)['default']; 2367 2368 exports.__esModule = true; 2369 2370 var _visitor = __webpack_require__(39); 2371 2372 var _visitor2 = _interopRequireDefault(_visitor); 2373 2374 function WhitespaceControl() { 2375 var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; 2376 2377 this.options = options; 2378 } 2379 WhitespaceControl.prototype = new _visitor2['default'](); 2380 2381 WhitespaceControl.prototype.Program = function (program) { 2382 var doStandalone = !this.options.ignoreStandalone; 2383 2384 var isRoot = !this.isRootSeen; 2385 this.isRootSeen = true; 2386 2387 var body = program.body; 2388 for (var i = 0, l = body.length; i < l; i++) { 2389 var current = body[i], 2390 strip = this.accept(current); 2391 2392 if (!strip) { 2393 continue; 2394 } 2395 2396 var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), 2397 _isNextWhitespace = isNextWhitespace(body, i, isRoot), 2398 openStandalone = strip.openStandalone && _isPrevWhitespace, 2399 closeStandalone = strip.closeStandalone && _isNextWhitespace, 2400 inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; 2401 2402 if (strip.close) { 2403 omitRight(body, i, true); 2404 } 2405 if (strip.open) { 2406 omitLeft(body, i, true); 2407 } 2408 2409 if (doStandalone && inlineStandalone) { 2410 omitRight(body, i); 2411 2412 if (omitLeft(body, i)) { 2413 // If we are on a standalone node, save the indent info for partials 2414 if (current.type === 'PartialStatement') { 2415 // Pull out the whitespace from the final line 2416 current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]; 2417 } 2418 } 2419 } 2420 if (doStandalone && openStandalone) { 2421 omitRight((current.program || current.inverse).body); 2422 2423 // Strip out the previous content node if it's whitespace only 2424 omitLeft(body, i); 2425 } 2426 if (doStandalone && closeStandalone) { 2427 // Always strip the next node 2428 omitRight(body, i); 2429 2430 omitLeft((current.inverse || current.program).body); 2431 } 2432 } 2433 2434 return program; 2435 }; 2436 2437 WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) { 2438 this.accept(block.program); 2439 this.accept(block.inverse); 2440 2441 // Find the inverse program that is involed with whitespace stripping. 2442 var program = block.program || block.inverse, 2443 inverse = block.program && block.inverse, 2444 firstInverse = inverse, 2445 lastInverse = inverse; 2446 2447 if (inverse && inverse.chained) { 2448 firstInverse = inverse.body[0].program; 2449 2450 // Walk the inverse chain to find the last inverse that is actually in the chain. 2451 while (lastInverse.chained) { 2452 lastInverse = lastInverse.body[lastInverse.body.length - 1].program; 2453 } 2454 } 2455 2456 var strip = { 2457 open: block.openStrip.open, 2458 close: block.closeStrip.close, 2459 2460 // Determine the standalone candiacy. Basically flag our content as being possibly standalone 2461 // so our parent can determine if we actually are standalone 2462 openStandalone: isNextWhitespace(program.body), 2463 closeStandalone: isPrevWhitespace((firstInverse || program).body) 2464 }; 2465 2466 if (block.openStrip.close) { 2467 omitRight(program.body, null, true); 2468 } 2469 2470 if (inverse) { 2471 var inverseStrip = block.inverseStrip; 2472 2473 if (inverseStrip.open) { 2474 omitLeft(program.body, null, true); 2475 } 2476 2477 if (inverseStrip.close) { 2478 omitRight(firstInverse.body, null, true); 2479 } 2480 if (block.closeStrip.open) { 2481 omitLeft(lastInverse.body, null, true); 2482 } 2483 2484 // Find standalone else statments 2485 if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) { 2486 omitLeft(program.body); 2487 omitRight(firstInverse.body); 2488 } 2489 } else if (block.closeStrip.open) { 2490 omitLeft(program.body, null, true); 2491 } 2492 2493 return strip; 2494 }; 2495 2496 WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) { 2497 return mustache.strip; 2498 }; 2499 2500 WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) { 2501 /* istanbul ignore next */ 2502 var strip = node.strip || {}; 2503 return { 2504 inlineStandalone: true, 2505 open: strip.open, 2506 close: strip.close 2507 }; 2508 }; 2509 2510 function isPrevWhitespace(body, i, isRoot) { 2511 if (i === undefined) { 2512 i = body.length; 2513 } 2514 2515 // Nodes that end with newlines are considered whitespace (but are special 2516 // cased for strip operations) 2517 var prev = body[i - 1], 2518 sibling = body[i - 2]; 2519 if (!prev) { 2520 return isRoot; 2521 } 2522 2523 if (prev.type === 'ContentStatement') { 2524 return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original); 2525 } 2526 } 2527 function isNextWhitespace(body, i, isRoot) { 2528 if (i === undefined) { 2529 i = -1; 2530 } 2531 2532 var next = body[i + 1], 2533 sibling = body[i + 2]; 2534 if (!next) { 2535 return isRoot; 2536 } 2537 2538 if (next.type === 'ContentStatement') { 2539 return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original); 2540 } 2541 } 2542 2543 // Marks the node to the right of the position as omitted. 2544 // I.e. {{foo}}' ' will mark the ' ' node as omitted. 2545 // 2546 // If i is undefined, then the first child will be marked as such. 2547 // 2548 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 2549 // content is met. 2550 function omitRight(body, i, multiple) { 2551 var current = body[i == null ? 0 : i + 1]; 2552 if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) { 2553 return; 2554 } 2555 2556 var original = current.value; 2557 current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, ''); 2558 current.rightStripped = current.value !== original; 2559 } 2560 2561 // Marks the node to the left of the position as omitted. 2562 // I.e. ' '{{foo}} will mark the ' ' node as omitted. 2563 // 2564 // If i is undefined then the last child will be marked as such. 2565 // 2566 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 2567 // content is met. 2568 function omitLeft(body, i, multiple) { 2569 var current = body[i == null ? body.length - 1 : i - 1]; 2570 if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) { 2571 return; 2572 } 2573 2574 // We omit the last node if it's whitespace only and not preceeded by a non-content node. 2575 var original = current.value; 2576 current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, ''); 2577 current.leftStripped = current.value !== original; 2578 return current.leftStripped; 2579 } 2580 2581 exports['default'] = WhitespaceControl; 2582 module.exports = exports['default']; 2583 2584/***/ }), 2585/* 39 */ 2586/***/ (function(module, exports, __webpack_require__) { 2587 2588 'use strict'; 2589 2590 var _interopRequireDefault = __webpack_require__(1)['default']; 2591 2592 exports.__esModule = true; 2593 2594 var _exception = __webpack_require__(6); 2595 2596 var _exception2 = _interopRequireDefault(_exception); 2597 2598 function Visitor() { 2599 this.parents = []; 2600 } 2601 2602 Visitor.prototype = { 2603 constructor: Visitor, 2604 mutating: false, 2605 2606 // Visits a given value. If mutating, will replace the value if necessary. 2607 acceptKey: function acceptKey(node, name) { 2608 var value = this.accept(node[name]); 2609 if (this.mutating) { 2610 // Hacky sanity check: This may have a few false positives for type for the helper 2611 // methods but will generally do the right thing without a lot of overhead. 2612 if (value && !Visitor.prototype[value.type]) { 2613 throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); 2614 } 2615 node[name] = value; 2616 } 2617 }, 2618 2619 // Performs an accept operation with added sanity check to ensure 2620 // required keys are not removed. 2621 acceptRequired: function acceptRequired(node, name) { 2622 this.acceptKey(node, name); 2623 2624 if (!node[name]) { 2625 throw new _exception2['default'](node.type + ' requires ' + name); 2626 } 2627 }, 2628 2629 // Traverses a given array. If mutating, empty respnses will be removed 2630 // for child elements. 2631 acceptArray: function acceptArray(array) { 2632 for (var i = 0, l = array.length; i < l; i++) { 2633 this.acceptKey(array, i); 2634 2635 if (!array[i]) { 2636 array.splice(i, 1); 2637 i--; 2638 l--; 2639 } 2640 } 2641 }, 2642 2643 accept: function accept(object) { 2644 if (!object) { 2645 return; 2646 } 2647 2648 /* istanbul ignore next: Sanity code */ 2649 if (!this[object.type]) { 2650 throw new _exception2['default']('Unknown type: ' + object.type, object); 2651 } 2652 2653 if (this.current) { 2654 this.parents.unshift(this.current); 2655 } 2656 this.current = object; 2657 2658 var ret = this[object.type](object); 2659 2660 this.current = this.parents.shift(); 2661 2662 if (!this.mutating || ret) { 2663 return ret; 2664 } else if (ret !== false) { 2665 return object; 2666 } 2667 }, 2668 2669 Program: function Program(program) { 2670 this.acceptArray(program.body); 2671 }, 2672 2673 MustacheStatement: visitSubExpression, 2674 Decorator: visitSubExpression, 2675 2676 BlockStatement: visitBlock, 2677 DecoratorBlock: visitBlock, 2678 2679 PartialStatement: visitPartial, 2680 PartialBlockStatement: function PartialBlockStatement(partial) { 2681 visitPartial.call(this, partial); 2682 2683 this.acceptKey(partial, 'program'); 2684 }, 2685 2686 ContentStatement: function ContentStatement() /* content */{}, 2687 CommentStatement: function CommentStatement() /* comment */{}, 2688 2689 SubExpression: visitSubExpression, 2690 2691 PathExpression: function PathExpression() /* path */{}, 2692 2693 StringLiteral: function StringLiteral() /* string */{}, 2694 NumberLiteral: function NumberLiteral() /* number */{}, 2695 BooleanLiteral: function BooleanLiteral() /* bool */{}, 2696 UndefinedLiteral: function UndefinedLiteral() /* literal */{}, 2697 NullLiteral: function NullLiteral() /* literal */{}, 2698 2699 Hash: function Hash(hash) { 2700 this.acceptArray(hash.pairs); 2701 }, 2702 HashPair: function HashPair(pair) { 2703 this.acceptRequired(pair, 'value'); 2704 } 2705 }; 2706 2707 function visitSubExpression(mustache) { 2708 this.acceptRequired(mustache, 'path'); 2709 this.acceptArray(mustache.params); 2710 this.acceptKey(mustache, 'hash'); 2711 } 2712 function visitBlock(block) { 2713 visitSubExpression.call(this, block); 2714 2715 this.acceptKey(block, 'program'); 2716 this.acceptKey(block, 'inverse'); 2717 } 2718 function visitPartial(partial) { 2719 this.acceptRequired(partial, 'name'); 2720 this.acceptArray(partial.params); 2721 this.acceptKey(partial, 'hash'); 2722 } 2723 2724 exports['default'] = Visitor; 2725 module.exports = exports['default']; 2726 2727/***/ }), 2728/* 40 */ 2729/***/ (function(module, exports, __webpack_require__) { 2730 2731 'use strict'; 2732 2733 var _interopRequireDefault = __webpack_require__(1)['default']; 2734 2735 exports.__esModule = true; 2736 exports.SourceLocation = SourceLocation; 2737 exports.id = id; 2738 exports.stripFlags = stripFlags; 2739 exports.stripComment = stripComment; 2740 exports.preparePath = preparePath; 2741 exports.prepareMustache = prepareMustache; 2742 exports.prepareRawBlock = prepareRawBlock; 2743 exports.prepareBlock = prepareBlock; 2744 exports.prepareProgram = prepareProgram; 2745 exports.preparePartialBlock = preparePartialBlock; 2746 2747 var _exception = __webpack_require__(6); 2748 2749 var _exception2 = _interopRequireDefault(_exception); 2750 2751 function validateClose(open, close) { 2752 close = close.path ? close.path.original : close; 2753 2754 if (open.path.original !== close) { 2755 var errorNode = { loc: open.path.loc }; 2756 2757 throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode); 2758 } 2759 } 2760 2761 function SourceLocation(source, locInfo) { 2762 this.source = source; 2763 this.start = { 2764 line: locInfo.first_line, 2765 column: locInfo.first_column 2766 }; 2767 this.end = { 2768 line: locInfo.last_line, 2769 column: locInfo.last_column 2770 }; 2771 } 2772 2773 function id(token) { 2774 if (/^\[.*\]$/.test(token)) { 2775 return token.substr(1, token.length - 2
vendor: 4,301 bytes, lines 2775-2959
2775); 2776 } else { 2777 return token; 2778 } 2779 } 2780 2781 function stripFlags(open, close) { 2782 return { 2783 open: open.charAt(2) === '~', 2784 close: close.charAt(close.length - 3) === '~' 2785 }; 2786 } 2787 2788 function stripComment(comment) { 2789 return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, ''); 2790 } 2791 2792 function preparePath(data, parts, loc) { 2793 loc = this.locInfo(loc); 2794 2795 var original = data ? '@' : '', 2796 dig = [], 2797 depth = 0; 2798 2799 for (var i = 0, l = parts.length; i < l; i++) { 2800 var part = parts[i].part, 2801 2802 // If we have [] syntax then we do not treat path references as operators, 2803 // i.e. foo.[this] resolves to approximately context.foo['this'] 2804 isLiteral = parts[i].original !== part; 2805 original += (parts[i].separator || '') + part; 2806 2807 if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { 2808 if (dig.length > 0) { 2809 throw new _exception2['default']('Invalid path: ' + original, { loc: loc }); 2810 } else if (part === '..') { 2811 depth++; 2812 } 2813 } else { 2814 dig.push(part); 2815 } 2816 } 2817 2818 return { 2819 type: 'PathExpression', 2820 data: data, 2821 depth: depth, 2822 parts: dig, 2823 original: original, 2824 loc: loc 2825 }; 2826 } 2827 2828 function prepareMustache(path, params, hash, open, strip, locInfo) { 2829 // Must use charAt to support IE pre-10 2830 var escapeFlag = open.charAt(3) || open.charAt(2), 2831 escaped = escapeFlag !== '{' && escapeFlag !== '&'; 2832 2833 var decorator = /\*/.test(open); 2834 return { 2835 type: decorator ? 'Decorator' : 'MustacheStatement', 2836 path: path, 2837 params: params, 2838 hash: hash, 2839 escaped: escaped, 2840 strip: strip, 2841 loc: this.locInfo(locInfo) 2842 }; 2843 } 2844 2845 function prepareRawBlock(openRawBlock, contents, close, locInfo) { 2846 validateClose(openRawBlock, close); 2847 2848 locInfo = this.locInfo(locInfo); 2849 var program = { 2850 type: 'Program', 2851 body: contents, 2852 strip: {}, 2853 loc: locInfo 2854 }; 2855 2856 return { 2857 type: 'BlockStatement', 2858 path: openRawBlock.path, 2859 params: openRawBlock.params, 2860 hash: openRawBlock.hash, 2861 program: program, 2862 openStrip: {}, 2863 inverseStrip: {}, 2864 closeStrip: {}, 2865 loc: locInfo 2866 }; 2867 } 2868 2869 function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { 2870 if (close && close.path) { 2871 validateClose(openBlock, close); 2872 } 2873 2874 var decorator = /\*/.test(openBlock.open); 2875 2876 program.blockParams = openBlock.blockParams; 2877 2878 var inverse = undefined, 2879 inverseStrip = undefined; 2880 2881 if (inverseAndProgram) { 2882 if (decorator) { 2883 throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram); 2884 } 2885 2886 if (inverseAndProgram.chain) { 2887 inverseAndProgram.program.body[0].closeStrip = close.strip; 2888 } 2889 2890 inverseStrip = inverseAndProgram.strip; 2891 inverse = inverseAndProgram.program; 2892 } 2893 2894 if (inverted) { 2895 inverted = inverse; 2896 inverse = program; 2897 program = inverted; 2898 } 2899 2900 return { 2901 type: decorator ? 'DecoratorBlock' : 'BlockStatement', 2902 path: openBlock.path, 2903 params: openBlock.params, 2904 hash: openBlock.hash, 2905 program: program, 2906 inverse: inverse, 2907 openStrip: openBlock.strip, 2908 inverseStrip: inverseStrip, 2909 closeStrip: close && close.strip, 2910 loc: this.locInfo(locInfo) 2911 }; 2912 } 2913 2914 function prepareProgram(statements, loc) { 2915 if (!loc && statements.length) { 2916 var firstLoc = statements[0].loc, 2917 lastLoc = statements[statements.length - 1].loc; 2918 2919 /* istanbul ignore else */ 2920 if (firstLoc && lastLoc) { 2921 loc = { 2922 source: firstLoc.source, 2923 start: { 2924 line: firstLoc.start.line, 2925 column: firstLoc.start.column 2926 }, 2927 end: { 2928 line: lastLoc.end.line, 2929 column: lastLoc.end.column 2930 } 2931 }; 2932 } 2933 } 2934 2935 return { 2936 type: 'Program', 2937 body: statements, 2938 strip: {}, 2939 loc: loc 2940 }; 2941 } 2942 2943 function preparePartialBlock(open, program, close, locInfo) { 2944 validateClose(open, close); 2945 2946 return { 2947 type: 'PartialBlockStatement', 2948 name: open.path, 2949 params: open.params, 2950 hash: open.hash, 2951 program: program, 2952 openStrip: open.strip, 2953 closeStrip: close && close.strip, 2954 loc: this.locInfo(locInfo) 2955 }; 2956 } 2957 2958/***/ }), 2959/* 4
vendor: 2,693 bytes, lines 2959-3052
29591 */ 2960/***/ (function(module, exports, __webpack_require__) { 2961 2962 /* eslint-disable new-cap */ 2963 2964 'use strict'; 2965 2966 var _interopRequireDefault = __webpack_require__(1)['default']; 2967 2968 exports.__esModule = true; 2969 exports.Compiler = Compiler; 2970 exports.precompile = precompile; 2971 exports.compile = compile; 2972 2973 var _exception = __webpack_require__(6); 2974 2975 var _exception2 = _interopRequireDefault(_exception); 2976 2977 var _utils = __webpack_require__(5); 2978 2979 var _ast = __webpack_require__(35); 2980 2981 var _ast2 = _interopRequireDefault(_ast); 2982 2983 var slice = [].slice; 2984 2985 function Compiler() {} 2986 2987 // the foundHelper register will disambiguate helper lookup from finding a 2988 // function in a context. This is necessary for mustache compatibility, which 2989 // requires that context functions in blocks are evaluated by blockHelperMissing, 2990 // and then proceed as if the resulting value was provided to blockHelperMissing. 2991 2992 Compiler.prototype = { 2993 compiler: Compiler, 2994 2995 equals: function equals(other) { 2996 var len = this.opcodes.length; 2997 if (other.opcodes.length !== len) { 2998 return false; 2999 } 3000 3001 for (var i = 0; i < len; i++) { 3002 var opcode = this.opcodes[i], 3003 otherOpcode = other.opcodes[i]; 3004 if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { 3005 return false; 3006 } 3007 } 3008 3009 // We know that length is the same between the two arrays because they are directly tied 3010 // to the opcode behavior above. 3011 len = this.children.length; 3012 for (var i = 0; i < len; i++) { 3013 if (!this.children[i].equals(other.children[i])) { 3014 return false; 3015 } 3016 } 3017 3018 return true; 3019 }, 3020 3021 guid: 0, 3022 3023 compile: function compile(program, options) { 3024 this.sourceNode = []; 3025 this.opcodes = []; 3026 this.children = []; 3027 this.options = options; 3028 this.stringParams = options.stringParams; 3029 this.trackIds = options.trackIds; 3030 3031 options.blockParams = options.blockParams || []; 3032 3033 // These changes will propagate to the other compiler components 3034 var knownHelpers = options.knownHelpers; 3035 options.knownHelpers = { 3036 'helperMissing': true, 3037 'blockHelperMissing': true, 3038 'each': true, 3039 'if': true, 3040 'unless': true, 3041 'with': true, 3042 'log': true, 3043 'lookup': true 3044 }; 3045 if (knownHelpers) { 3046 // the next line should use "Object.keys", but the code has been like this a long time and changing it, might 3047 // cause backwards-compatibility issues... It's an old library... 3048 // eslint-disable-next-line guard-for-in 3049 for (var _name in knownHelpers) { 3050 this.options.knownHelpers[_name] = knownHelpers[_name]; 3051 } 3052 }
vendor: 8,795 bytes, lines 3052-3346
3052 3053 3054 return this.accept(program); 3055 }, 3056 3057 compileProgram: function compileProgram(program) { 3058 var childCompiler = new this.compiler(), 3059 // eslint-disable-line new-cap 3060 result = childCompiler.compile(program, this.options), 3061 guid = this.guid++; 3062 3063 this.usePartial = this.usePartial || result.usePartial; 3064 3065 this.children[guid] = result; 3066 this.useDepths = this.useDepths || result.useDepths; 3067 3068 return guid; 3069 }, 3070 3071 accept: function accept(node) { 3072 /* istanbul ignore next: Sanity code */ 3073 if (!this[node.type]) { 3074 throw new _exception2['default']('Unknown type: ' + node.type, node); 3075 } 3076 3077 this.sourceNode.unshift(node); 3078 var ret = this[node.type](node); 3079 this.sourceNode.shift(); 3080 return ret; 3081 }, 3082 3083 Program: function Program(program) { 3084 this.options.blockParams.unshift(program.blockParams); 3085 3086 var body = program.body, 3087 bodyLength = body.length; 3088 for (var i = 0; i < bodyLength; i++) { 3089 this.accept(body[i]); 3090 } 3091 3092 this.options.blockParams.shift(); 3093 3094 this.isSimple = bodyLength === 1; 3095 this.blockParams = program.blockParams ? program.blockParams.length : 0; 3096 3097 return this; 3098 }, 3099 3100 BlockStatement: function BlockStatement(block) { 3101 transformLiteralToPath(block); 3102 3103 var program = block.program, 3104 inverse = block.inverse; 3105 3106 program = program && this.compileProgram(program); 3107 inverse = inverse && this.compileProgram(inverse); 3108 3109 var type = this.classifySexpr(block); 3110 3111 if (type === 'helper') { 3112 this.helperSexpr(block, program, inverse); 3113 } else if (type === 'simple') { 3114 this.simpleSexpr(block); 3115 3116 // now that the simple mustache is resolved, we need to 3117 // evaluate it by executing `blockHelperMissing` 3118 this.opcode('pushProgram', program); 3119 this.opcode('pushProgram', inverse); 3120 this.opcode('emptyHash'); 3121 this.opcode('blockValue', block.path.original); 3122 } else { 3123 this.ambiguousSexpr(block, program, inverse); 3124 3125 // now that the simple mustache is resolved, we need to 3126 // evaluate it by executing `blockHelperMissing` 3127 this.opcode('pushProgram', program); 3128 this.opcode('pushProgram', inverse); 3129 this.opcode('emptyHash'); 3130 this.opcode('ambiguousBlockValue'); 3131 } 3132 3133 this.opcode('append'); 3134 }, 3135 3136 DecoratorBlock: function DecoratorBlock(decorator) { 3137 var program = decorator.program && this.compileProgram(decorator.program); 3138 var params = this.setupFullMustacheParams(decorator, program, undefined), 3139 path = decorator.path; 3140 3141 this.useDecorators = true; 3142 this.opcode('registerDecorator', params.length, path.original); 3143 }, 3144 3145 PartialStatement: function PartialStatement(partial) { 3146 this.usePartial = true; 3147 3148 var program = partial.program; 3149 if (program) { 3150 program = this.compileProgram(partial.program); 3151 } 3152 3153 var params = partial.params; 3154 if (params.length > 1) { 3155 throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial); 3156 } else if (!params.length) { 3157 if (this.options.explicitPartialContext) { 3158 this.opcode('pushLiteral', 'undefined'); 3159 } else { 3160 params.push({ type: 'PathExpression', parts: [], depth: 0 }); 3161 } 3162 } 3163 3164 var partialName = partial.name.original, 3165 isDynamic = partial.name.type === 'SubExpression'; 3166 if (isDynamic) { 3167 this.accept(partial.name); 3168 } 3169 3170 this.setupFullMustacheParams(partial, program, undefined, true); 3171 3172 var indent = partial.indent || ''; 3173 if (this.options.preventIndent && indent) { 3174 this.opcode('appendContent', indent); 3175 indent = ''; 3176 } 3177 3178 this.opcode('invokePartial', isDynamic, partialName, indent); 3179 this.opcode('append'); 3180 }, 3181 PartialBlockStatement: function PartialBlockStatement(partialBlock) { 3182 this.PartialStatement(partialBlock); 3183 }, 3184 3185 MustacheStatement: function MustacheStatement(mustache) { 3186 this.SubExpression(mustache); 3187 3188 if (mustache.escaped && !this.options.noEscape) { 3189 this.opcode('appendEscaped'); 3190 } else { 3191 this.opcode('append'); 3192 } 3193 }, 3194 Decorator: function Decorator(decorator) { 3195 this.DecoratorBlock(decorator); 3196 }, 3197 3198 ContentStatement: function ContentStatement(content) { 3199 if (content.value) { 3200 this.opcode('appendContent', content.value); 3201 } 3202 }, 3203 3204 CommentStatement: function CommentStatement() {}, 3205 3206 SubExpression: function SubExpression(sexpr) { 3207 transformLiteralToPath(sexpr); 3208 var type = this.classifySexpr(sexpr); 3209 3210 if (type === 'simple') { 3211 this.simpleSexpr(sexpr); 3212 } else if (type === 'helper') { 3213 this.helperSexpr(sexpr); 3214 } else { 3215 this.ambiguousSexpr(sexpr); 3216 } 3217 }, 3218 ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) { 3219 var path = sexpr.path, 3220 name = path.parts[0], 3221 isBlock = program != null || inverse != null; 3222 3223 this.opcode('getContext', path.depth); 3224 3225 this.opcode('pushProgram', program); 3226 this.opcode('pushProgram', inverse); 3227 3228 path.strict = true; 3229 this.accept(path); 3230 3231 this.opcode('invokeAmbiguous', name, isBlock); 3232 }, 3233 3234 simpleSexpr: function simpleSexpr(sexpr) { 3235 var path = sexpr.path; 3236 path.strict = true; 3237 this.accept(path); 3238 this.opcode('resolvePossibleLambda'); 3239 }, 3240 3241 helperSexpr: function helperSexpr(sexpr, program, inverse) { 3242 var params = this.setupFullMustacheParams(sexpr, program, inverse), 3243 path = sexpr.path, 3244 name = path.parts[0]; 3245 3246 if (this.options.knownHelpers[name]) { 3247 this.opcode('invokeKnownHelper', params.length, name); 3248 } else if (this.options.knownHelpersOnly) { 3249 throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); 3250 } else { 3251 path.strict = true; 3252 path.falsy = true; 3253 3254 this.accept(path); 3255 this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path)); 3256 } 3257 }, 3258 3259 PathExpression: function PathExpression(path) { 3260 this.addDepth(path.depth); 3261 this.opcode('getContext', path.depth); 3262 3263 var name = path.parts[0], 3264 scoped = _ast2['default'].helpers.scopedId(path), 3265 blockParamId = !path.depth && !scoped && this.blockParamIndex(name); 3266 3267 if (blockParamId) { 3268 this.opcode('lookupBlockParam', blockParamId, path.parts); 3269 } else if (!name) { 3270 // Context reference, i.e. `{{foo .}}` or `{{foo ..}}` 3271 this.opcode('pushContext'); 3272 } else if (path.data) { 3273 this.options.data = true; 3274 this.opcode('lookupData', path.depth, path.parts, path.strict); 3275 } else { 3276 this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped); 3277 } 3278 }, 3279 3280 StringLiteral: function StringLiteral(string) { 3281 this.opcode('pushString', string.value); 3282 }, 3283 3284 NumberLiteral: function NumberLiteral(number) { 3285 this.opcode('pushLiteral', number.value); 3286 }, 3287 3288 BooleanLiteral: function BooleanLiteral(bool) { 3289 this.opcode('pushLiteral', bool.value); 3290 }, 3291 3292 UndefinedLiteral: function UndefinedLiteral() { 3293 this.opcode('pushLiteral', 'undefined'); 3294 }, 3295 3296 NullLiteral: function NullLiteral() { 3297 this.opcode('pushLiteral', 'null'); 3298 }, 3299 3300 Hash: function Hash(hash) { 3301 var pairs = hash.pairs, 3302 i = 0, 3303 l = pairs.length; 3304 3305 this.opcode('pushHash'); 3306 3307 for (; i < l; i++) { 3308 this.pushParam(pairs[i].value); 3309 } 3310 while (i--) { 3311 this.opcode('assignToHash', pairs[i].key); 3312 } 3313 this.opcode('popHash'); 3314 }, 3315 3316 // HELPERS 3317 opcode: function opcode(name) { 3318 this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc }); 3319 }, 3320 3321 addDepth: function addDepth(depth) { 3322 if (!depth) { 3323 return; 3324 } 3325 3326 this.useDepths = true; 3327 }, 3328 3329 classifySexpr: function classifySexpr(sexpr) { 3330 var isSimple = _ast2['default'].helpers.simpleId(sexpr.path); 3331 3332 var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); 3333 3334 // a mustache is an eligible helper if: 3335 // * its id is simple (a single part, not `this` or `..`) 3336 var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr); 3337 3338 // if a mustache is an eligible helper but not a definite 3339 // helper, it is ambiguous, and will be resolved in a later 3340 // pass or at runtime. 3341 var isEligible = !isBlockParam && (isHelper || isSimple); 3342 3343 // if ambiguous, we can possibly resolve the ambiguity now 3344 // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc. 3345 if (isEligible && !isHelper) { 3346 var _name
vendor: 4,602 bytes, lines 3346-3503
33462 = sexpr.path.parts[0], 3347 options = this.options; 3348 3349 if (options.knownHelpers[_name2]) { 3350 isHelper = true; 3351 } else if (options.knownHelpersOnly) { 3352 isEligible = false; 3353 } 3354 } 3355 3356 if (isHelper) { 3357 return 'helper'; 3358 } else if (isEligible) { 3359 return 'ambiguous'; 3360 } else { 3361 return 'simple'; 3362 } 3363 }, 3364 3365 pushParams: function pushParams(params) { 3366 for (var i = 0, l = params.length; i < l; i++) { 3367 this.pushParam(params[i]); 3368 } 3369 }, 3370 3371 pushParam: function pushParam(val) { 3372 var value = val.value != null ? val.value : val.original || ''; 3373 3374 if (this.stringParams) { 3375 if (value.replace) { 3376 value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.'); 3377 } 3378 3379 if (val.depth) { 3380 this.addDepth(val.depth); 3381 } 3382 this.opcode('getContext', val.depth || 0); 3383 this.opcode('pushStringParam', value, val.type); 3384 3385 if (val.type === 'SubExpression') { 3386 // SubExpressions get evaluated and passed in 3387 // in string params mode. 3388 this.accept(val); 3389 } 3390 } else { 3391 if (this.trackIds) { 3392 var blockParamIndex = undefined; 3393 if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) { 3394 blockParamIndex = this.blockParamIndex(val.parts[0]); 3395 } 3396 if (blockParamIndex) { 3397 var blockParamChild = val.parts.slice(1).join('.'); 3398 this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild); 3399 } else { 3400 value = val.original || value; 3401 if (value.replace) { 3402 value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, ''); 3403 } 3404 3405 this.opcode('pushId', val.type, value); 3406 } 3407 } 3408 this.accept(val); 3409 } 3410 }, 3411 3412 setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) { 3413 var params = sexpr.params; 3414 this.pushParams(params); 3415 3416 this.opcode('pushProgram', program); 3417 this.opcode('pushProgram', inverse); 3418 3419 if (sexpr.hash) { 3420 this.accept(sexpr.hash); 3421 } else { 3422 this.opcode('emptyHash', omitEmpty); 3423 } 3424 3425 return params; 3426 }, 3427 3428 blockParamIndex: function blockParamIndex(name) { 3429 for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) { 3430 var blockParams = this.options.blockParams[depth], 3431 param = blockParams && _utils.indexOf(blockParams, name); 3432 if (blockParams && param >= 0) { 3433 return [depth, param]; 3434 } 3435 } 3436 } 3437 }; 3438 3439 function precompile(input, options, env) { 3440 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 3441 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); 3442 } 3443 3444 options = options || {}; 3445 if (!('data' in options)) { 3446 options.data = true; 3447 } 3448 if (options.compat) { 3449 options.useDepths = true; 3450 } 3451 3452 var ast = env.parse(input, options), 3453 environment = new env.Compiler().compile(ast, options); 3454 return new env.JavaScriptCompiler().compile(environment, options); 3455 } 3456 3457 function compile(input, options, env) { 3458 if (options === undefined) options = {}; 3459 3460 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 3461 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); 3462 } 3463 3464 options = _utils.extend({}, options); 3465 if (!('data' in options)) { 3466 options.data = true; 3467 } 3468 if (options.compat) { 3469 options.useDepths = true; 3470 } 3471 3472 var compiled = undefined; 3473 3474 function compileInput() { 3475 var ast = env.parse(input, options), 3476 environment = new env.Compiler().compile(ast, options), 3477 templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); 3478 return env.template(templateSpec); 3479 } 3480 3481 // Template is only compiled on first use and cached after that point. 3482 function ret(context, execOptions) { 3483 if (!compiled) { 3484 compiled = compileInput(); 3485 } 3486 return compiled.call(this, context, execOptions); 3487 } 3488 ret._setup = function (setupOptions) { 3489 if (!compiled) { 3490 compiled = compileInput(); 3491 } 3492 return compiled._setup(setupOptions); 3493 }; 3494 ret._child = function (i, data, blockParams, depths) { 3495 if (!compiled) { 3496 compiled = compileInput(); 3497 } 3498 return compiled._child(i, data, blockParams, depths); 3499 }; 3500 return ret; 3501 } 3502 3503 function argEquals(a, b) {
vendor: 8,012 bytes, lines 3504-3770
3504 if (a === b) { 3505 return true; 3506 } 3507 3508 if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) { 3509 for (var i = 0; i < a.length; i++) { 3510 if (!argEquals(a[i], b[i])) { 3511 return false; 3512 } 3513 } 3514 return true; 3515 } 3516 } 3517 3518 function transformLiteralToPath(sexpr) { 3519 if (!sexpr.path.parts) { 3520 var literal = sexpr.path; 3521 // Casting to string here to make false and 0 literal values play nicely with the rest 3522 // of the system. 3523 sexpr.path = { 3524 type: 'PathExpression', 3525 data: false, 3526 depth: 0, 3527 parts: [literal.original + ''], 3528 original: literal.original + '', 3529 loc: literal.loc 3530 }; 3531 } 3532 } 3533 3534/***/ }), 3535/* 42 */ 3536/***/ (function(module, exports, __webpack_require__) { 3537 3538 'use strict'; 3539 3540 var _interopRequireDefault = __webpack_require__(1)['default']; 3541 3542 exports.__esModule = true; 3543 3544 var _base = __webpack_require__(4); 3545 3546 var _exception = __webpack_require__(6); 3547 3548 var _exception2 = _interopRequireDefault(_exception); 3549 3550 var _utils = __webpack_require__(5); 3551 3552 var _codeGen = __webpack_require__(43); 3553 3554 var _codeGen2 = _interopRequireDefault(_codeGen); 3555 3556 function Literal(value) { 3557 this.value = value; 3558 } 3559 3560 function JavaScriptCompiler() {} 3561 3562 JavaScriptCompiler.prototype = { 3563 // PUBLIC API: You can override these methods in a subclass to provide 3564 // alternative compiled forms for name lookup and buffering semantics 3565 nameLookup: function nameLookup(parent, name /* , type*/) { 3566 if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { 3567 return [parent, '.', name]; 3568 } else { 3569 return [parent, '[', JSON.stringify(name), ']']; 3570 } 3571 }, 3572 depthedLookup: function depthedLookup(name) { 3573 return [this.aliasable('container.lookup'), '(depths, "', name, '")']; 3574 }, 3575 3576 compilerInfo: function compilerInfo() { 3577 var revision = _base.COMPILER_REVISION, 3578 versions = _base.REVISION_CHANGES[revision]; 3579 return [revision, versions]; 3580 }, 3581 3582 appendToBuffer: function appendToBuffer(source, location, explicit) { 3583 // Force a source as this simplifies the merge logic. 3584 if (!_utils.isArray(source)) { 3585 source = [source]; 3586 } 3587 source = this.source.wrap(source, location); 3588 3589 if (this.environment.isSimple) { 3590 return ['return ', source, ';']; 3591 } else if (explicit) { 3592 // This is a case where the buffer operation occurs as a child of another 3593 // construct, generally braces. We have to explicitly output these buffer 3594 // operations to ensure that the emitted code goes in the correct location. 3595 return ['buffer += ', source, ';']; 3596 } else { 3597 source.appendToBuffer = true; 3598 return source; 3599 } 3600 }, 3601 3602 initializeBuffer: function initializeBuffer() { 3603 return this.quotedString(''); 3604 }, 3605 // END PUBLIC API 3606 3607 compile: function compile(environment, options, context, asObject) { 3608 this.environment = environment; 3609 this.options = options; 3610 this.stringParams = this.options.stringParams; 3611 this.trackIds = this.options.trackIds; 3612 this.precompile = !asObject; 3613 3614 this.name = this.environment.name; 3615 this.isChild = !!context; 3616 this.context = context || { 3617 decorators: [], 3618 programs: [], 3619 environments: [] 3620 }; 3621 3622 this.preamble(); 3623 3624 this.stackSlot = 0; 3625 this.stackVars = []; 3626 this.aliases = {}; 3627 this.registers = { list: [] }; 3628 this.hashes = []; 3629 this.compileStack = []; 3630 this.inlineStack = []; 3631 this.blockParams = []; 3632 3633 this.compileChildren(environment, options); 3634 3635 this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat; 3636 this.useBlockParams = this.useBlockParams || environment.useBlockParams; 3637 3638 var opcodes = environment.opcodes, 3639 opcode = undefined, 3640 firstLoc = undefined, 3641 i = undefined, 3642 l = undefined; 3643 3644 for (i = 0, l = opcodes.length; i < l; i++) { 3645 opcode = opcodes[i]; 3646 3647 this.source.currentLocation = opcode.loc; 3648 firstLoc = firstLoc || opcode.loc; 3649 this[opcode.opcode].apply(this, opcode.args); 3650 } 3651 3652 // Flush any trailing content that might be pending. 3653 this.source.currentLocation = firstLoc; 3654 this.pushSource(''); 3655 3656 /* istanbul ignore next */ 3657 if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { 3658 throw new _exception2['default']('Compile completed with content left on stack'); 3659 } 3660 3661 if (!this.decorators.isEmpty()) { 3662 this.useDecorators = true; 3663 3664 this.decorators.prepend('var decorators = container.decorators;\n'); 3665 this.decorators.push('return fn;'); 3666 3667 if (asObject) { 3668 this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]); 3669 } else { 3670 this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n'); 3671 this.decorators.push('}\n'); 3672 this.decorators = this.decorators.merge(); 3673 } 3674 } else { 3675 this.decorators = undefined; 3676 } 3677 3678 var fn = this.createFunctionContext(asObject); 3679 if (!this.isChild) { 3680 var ret = { 3681 compiler: this.compilerInfo(), 3682 main: fn 3683 }; 3684 3685 if (this.decorators) { 3686 ret.main_d = this.decorators; // eslint-disable-line camelcase 3687 ret.useDecorators = true; 3688 } 3689 3690 var _context = this.context; 3691 var programs = _context.programs; 3692 var decorators = _context.decorators; 3693 3694 for (i = 0, l = programs.length; i < l; i++) { 3695 if (programs[i]) { 3696 ret[i] = programs[i]; 3697 if (decorators[i]) { 3698 ret[i + '_d'] = decorators[i]; 3699 ret.useDecorators = true; 3700 } 3701 } 3702 } 3703 3704 if (this.environment.usePartial) { 3705 ret.usePartial = true; 3706 } 3707 if (this.options.data) { 3708 ret.useData = true; 3709 } 3710 if (this.useDepths) { 3711 ret.useDepths = true; 3712 } 3713 if (this.useBlockParams) { 3714 ret.useBlockParams = true; 3715 } 3716 if (this.options.compat) { 3717 ret.compat = true; 3718 } 3719 3720 if (!asObject) { 3721 ret.compiler = JSON.stringify(ret.compiler); 3722 3723 this.source.currentLocation = { start: { line: 1, column: 0 } }; 3724 ret = this.objectLiteral(ret); 3725 3726 if (options.srcName) { 3727 ret = ret.toStringWithSourceMap({ file: options.destName }); 3728 ret.map = ret.map && ret.map.toString(); 3729 } else { 3730 ret = ret.toString(); 3731 } 3732 } else { 3733 ret.compilerOptions = this.options; 3734 } 3735 3736 return ret; 3737 } else { 3738 return fn; 3739 } 3740 }, 3741 3742 preamble: function preamble() { 3743 // track the last context pushed into place to allow skipping the 3744 // getContext opcode when it would be a noop 3745 this.lastContext = 0; 3746 this.source = new _codeGen2['default'](this.options.srcName); 3747 this.decorators = new _codeGen2['default'](this.options.srcName); 3748 }, 3749 3750 createFunctionContext: function createFunctionContext(asObject) { 3751 var varDeclarations = ''; 3752 3753 var locals = this.stackVars.concat(this.registers.list); 3754 if (locals.length > 0) { 3755 varDeclarations += ', ' + locals.join(', '); 3756 } 3757 3758 // Generate minimizer alias mappings 3759 // 3760 // When using true SourceNodes, this will update all references to the given alias 3761 // as the source nodes are reused in situ. For the non-source node compilation mode, 3762 // aliases will not be used, but this case is already being run on the client and 3763 // we aren't concern about minimizing the template size. 3764 var aliasCount = 0; 3765 for (var alias in this.aliases) { 3766 // eslint-disable-line guard-for-in 3767 var node = this.aliases[alias]; 3768 3769 if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) { 3770 varDeclarations += ', alias' + ++aliasCount + '=' + alias;
vendor: 4,556 bytes, lines 3771-3920
3771 node.children[0] = 'alias' + aliasCount; 3772 } 3773 } 3774 3775 var params = ['container', 'depth0', 'helpers', 'partials', 'data']; 3776 3777 if (this.useBlockParams || this.useDepths) { 3778 params.push('blockParams'); 3779 } 3780 if (this.useDepths) { 3781 params.push('depths'); 3782 } 3783 3784 // Perform a second pass over the output to merge content when possible 3785 var source = this.mergeSource(varDeclarations); 3786 3787 if (asObject) { 3788 params.push(source); 3789 3790 return Function.apply(this, params); 3791 } else { 3792 return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); 3793 } 3794 }, 3795 mergeSource: function mergeSource(varDeclarations) { 3796 var isSimple = this.environment.isSimple, 3797 appendOnly = !this.forceBuffer, 3798 appendFirst = undefined, 3799 sourceSeen = undefined, 3800 bufferStart = undefined, 3801 bufferEnd = undefined; 3802 this.source.each(function (line) { 3803 if (line.appendToBuffer) { 3804 if (bufferStart) { 3805 line.prepend(' + '); 3806 } else { 3807 bufferStart = line; 3808 } 3809 bufferEnd = line; 3810 } else { 3811 if (bufferStart) { 3812 if (!sourceSeen) { 3813 appendFirst = true; 3814 } else { 3815 bufferStart.prepend('buffer += '); 3816 } 3817 bufferEnd.add(';'); 3818 bufferStart = bufferEnd = undefined; 3819 } 3820 3821 sourceSeen = true; 3822 if (!isSimple) { 3823 appendOnly = false; 3824 } 3825 } 3826 }); 3827 3828 if (appendOnly) { 3829 if (bufferStart) { 3830 bufferStart.prepend('return '); 3831 bufferEnd.add(';'); 3832 } else if (!sourceSeen) { 3833 this.source.push('return "";'); 3834 } 3835 } else { 3836 varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); 3837 3838 if (bufferStart) { 3839 bufferStart.prepend('return buffer + '); 3840 bufferEnd.add(';'); 3841 } else { 3842 this.source.push('return buffer;'); 3843 } 3844 } 3845 3846 if (varDeclarations) { 3847 this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); 3848 } 3849 3850 return this.source.merge(); 3851 }, 3852 3853 // [blockValue] 3854 // 3855 // On stack, before: hash, inverse, program, value 3856 // On stack, after: return value of blockHelperMissing 3857 // 3858 // The purpose of this opcode is to take a block of the form 3859 // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and 3860 // replace it on the stack with the result of properly 3861 // invoking blockHelperMissing. 3862 blockValue: function blockValue(name) { 3863 var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), 3864 params = [this.contextName(0)]; 3865 this.setupHelperArgs(name, 0, params); 3866 3867 var blockName = this.popStack(); 3868 params.splice(1, 0, blockName); 3869 3870 this.push(this.source.functionCall(blockHelperMissing, 'call', params)); 3871 }, 3872 3873 // [ambiguousBlockValue] 3874 // 3875 // On stack, before: hash, inverse, program, value 3876 // Compiler value, before: lastHelper=value of last found helper, if any 3877 // On stack, after, if no lastHelper: same as [blockValue] 3878 // On stack, after, if lastHelper: value 3879 ambiguousBlockValue: function ambiguousBlockValue() { 3880 // We're being a bit cheeky and reusing the options value from the prior exec 3881 var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), 3882 params = [this.contextName(0)]; 3883 this.setupHelperArgs('', 0, params, true); 3884 3885 this.flushInline(); 3886 3887 var current = this.topStack(); 3888 params.splice(1, 0, current); 3889 3890 this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']); 3891 }, 3892 3893 // [appendContent] 3894 // 3895 // On stack, before: ... 3896 // On stack, after: ... 3897 // 3898 // Appends the string value of `content` to the current buffer 3899 appendContent: function appendContent(content) { 3900 if (this.pendingContent) { 3901 content = this.pendingContent + content; 3902 } else { 3903 this.pendingLocation = this.source.currentLocation; 3904 } 3905 3906 this.pendingContent = content; 3907 }, 3908 3909 // [append] 3910 // 3911 // On stack, before: value, ... 3912 // On stack, after: ... 3913 // 3914 // Coerces `value` to a String and appends it to the current buffer. 3915 // 3916 // If `value` is truthy, or 0, it is coerced into a string and appended 3917 // Otherwise, the empty string is appended 3918 append: function append() { 3919 if (this.isInline()) { 3920 this.replaceStack(function (current) {
vendor: 5,813 bytes, lines 3921-4113
3921 return [' != null ? ', current, ' : ""']; 3922 }); 3923 3924 this.pushSource(this.appendToBuffer(this.popStack())); 3925 } else { 3926 var local = this.popStack(); 3927 this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); 3928 if (this.environment.isSimple) { 3929 this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']); 3930 } 3931 } 3932 }, 3933 3934 // [appendEscaped] 3935 // 3936 // On stack, before: value, ... 3937 // On stack, after: ... 3938 // 3939 // Escape `value` and append it to the buffer 3940 appendEscaped: function appendEscaped() { 3941 this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')'])); 3942 }, 3943 3944 // [getContext] 3945 // 3946 // On stack, before: ... 3947 // On stack, after: ... 3948 // Compiler value, after: lastContext=depth 3949 // 3950 // Set the value of the `lastContext` compiler value to the depth 3951 getContext: function getContext(depth) { 3952 this.lastContext = depth; 3953 }, 3954 3955 // [pushContext] 3956 // 3957 // On stack, before: ... 3958 // On stack, after: currentContext, ... 3959 // 3960 // Pushes the value of the current context onto the stack. 3961 pushContext: function pushContext() { 3962 this.pushStackLiteral(this.contextName(this.lastContext)); 3963 }, 3964 3965 // [lookupOnContext] 3966 // 3967 // On stack, before: ... 3968 // On stack, after: currentContext[name], ... 3969 // 3970 // Looks up the value of `name` on the current context and pushes 3971 // it onto the stack. 3972 lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) { 3973 var i = 0; 3974 3975 if (!scoped && this.options.compat && !this.lastContext) { 3976 // The depthed query is expected to handle the undefined logic for the root level that 3977 // is implemented below, so we evaluate that directly in compat mode 3978 this.push(this.depthedLookup(parts[i++])); 3979 } else { 3980 this.pushContext(); 3981 } 3982 3983 this.resolvePath('context', parts, i, falsy, strict); 3984 }, 3985 3986 // [lookupBlockParam] 3987 // 3988 // On stack, before: ... 3989 // On stack, after: blockParam[name], ... 3990 // 3991 // Looks up the value of `parts` on the given block param and pushes 3992 // it onto the stack. 3993 lookupBlockParam: function lookupBlockParam(blockParamId, parts) { 3994 this.useBlockParams = true; 3995 3996 this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); 3997 this.resolvePath('context', parts, 1); 3998 }, 3999 4000 // [lookupData] 4001 // 4002 // On stack, before: ... 4003 // On stack, after: data, ... 4004 // 4005 // Push the data lookup operator 4006 lookupData: function lookupData(depth, parts, strict) { 4007 if (!depth) { 4008 this.pushStackLiteral('data'); 4009 } else { 4010 this.pushStackLiteral('container.data(data, ' + depth + ')'); 4011 } 4012 4013 this.resolvePath('data', parts, 0, true, strict); 4014 }, 4015 4016 resolvePath: function resolvePath(type, parts, i, falsy, strict) { 4017 // istanbul ignore next 4018 4019 var _this = this; 4020 4021 if (this.options.strict || this.options.assumeObjects) { 4022 this.push(strictLookup(this.options.strict && strict, this, parts, type)); 4023 return; 4024 } 4025 4026 var len = parts.length; 4027 for (; i < len; i++) { 4028 /* eslint-disable no-loop-func */ 4029 this.replaceStack(function (current) { 4030 var lookup = _this.nameLookup(current, parts[i], type); 4031 // We want to ensure that zero and false are handled properly if the context (falsy flag) 4032 // needs to have the special handling for these values. 4033 if (!falsy) { 4034 return [' != null ? ', lookup, ' : ', current]; 4035 } else { 4036 // Otherwise we can use generic falsy handling 4037 return [' && ', lookup]; 4038 } 4039 }); 4040 /* eslint-enable no-loop-func */ 4041 } 4042 }, 4043 4044 // [resolvePossibleLambda] 4045 // 4046 // On stack, before: value, ... 4047 // On stack, after: resolved value, ... 4048 // 4049 // If the `value` is a lambda, replace it on the stack by 4050 // the return value of the lambda 4051 resolvePossibleLambda: function resolvePossibleLambda() { 4052 this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); 4053 }, 4054 4055 // [pushStringParam] 4056 // 4057 // On stack, before: ... 4058 // On stack, after: string, currentContext, ... 4059 // 4060 // This opcode is designed for use in string mode, which 4061 // provides the string value of a parameter along with its 4062 // depth rather than resolving it immediately. 4063 pushStringParam: function pushStringParam(string, type) { 4064 this.pushContext(); 4065 this.pushString(type); 4066 4067 // If it's a subexpression, the string result 4068 // will be pushed after this opcode. 4069 if (type !== 'SubExpression') { 4070 if (typeof string === 'string') { 4071 this.pushString(string); 4072 } else { 4073 this.pushStackLiteral(string); 4074 } 4075 } 4076 }, 4077 4078 emptyHash: function emptyHash(omitEmpty) { 4079 if (this.trackIds) { 4080 this.push('{}'); // hashIds 4081 } 4082 if (this.stringParams) { 4083 this.push('{}'); // hashContexts 4084 this.push('{}'); // hashTypes 4085 } 4086 this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); 4087 }, 4088 pushHash: function pushHash() { 4089 if (this.hash) { 4090 this.hashes.push(this.hash); 4091 } 4092 this.hash = { values: [], types: [], contexts: [], ids: [] }; 4093 }, 4094 popHash: function popHash() { 4095 var hash = this.hash; 4096 this.hash = this.hashes.pop(); 4097 4098 if (this.trackIds) { 4099 this.push(this.objectLiteral(hash.ids)); 4100 } 4101 if (this.stringParams) { 4102 this.push(this.objectLiteral(hash.contexts)); 4103 this.push(this.objectLiteral(hash.types)); 4104 } 4105 4106 this.push(this.objectLiteral(hash.values)); 4107 }, 4108 4109 // [pushString] 4110 // 4111 // On stack, before: ... 4112 // On stack, after: quotedString(string), ... 4113 //
vendor: 3,793 bytes, lines 4114-4221
4114 // Push a quoted version of `string` onto the stack 4115 pushString: function pushString(string) { 4116 this.pushStackLiteral(this.quotedString(string)); 4117 }, 4118 4119 // [pushLiteral] 4120 // 4121 // On stack, before: ... 4122 // On stack, after: value, ... 4123 // 4124 // Pushes a value onto the stack. This operation prevents 4125 // the compiler from creating a temporary variable to hold 4126 // it. 4127 pushLiteral: function pushLiteral(value) { 4128 this.pushStackLiteral(value); 4129 }, 4130 4131 // [pushProgram] 4132 // 4133 // On stack, before: ... 4134 // On stack, after: program(guid), ... 4135 // 4136 // Push a program expression onto the stack. This takes 4137 // a compile-time guid and converts it into a runtime-accessible 4138 // expression. 4139 pushProgram: function pushProgram(guid) { 4140 if (guid != null) { 4141 this.pushStackLiteral(this.programExpression(guid)); 4142 } else { 4143 this.pushStackLiteral(null); 4144 } 4145 }, 4146 4147 // [registerDecorator] 4148 // 4149 // On stack, before: hash, program, params..., ... 4150 // On stack, after: ... 4151 // 4152 // Pops off the decorator's parameters, invokes the decorator, 4153 // and inserts the decorator into the decorators list. 4154 registerDecorator: function registerDecorator(paramSize, name) { 4155 var foundDecorator = this.nameLookup('decorators', name, 'decorator'), 4156 options = this.setupHelperArgs(name, paramSize); 4157 4158 this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']); 4159 }, 4160 4161 // [invokeHelper] 4162 // 4163 // On stack, before: hash, inverse, program, params..., ... 4164 // On stack, after: result of helper invocation 4165 // 4166 // Pops off the helper's parameters, invokes the helper, 4167 // and pushes the helper's return value onto the stack. 4168 // 4169 // If the helper is not found, `helperMissing` is called. 4170 invokeHelper: function invokeHelper(paramSize, name, isSimple) { 4171 var nonHelper = this.popStack(), 4172 helper = this.setupHelper(paramSize, name), 4173 simple = isSimple ? [helper.name, ' || '] : ''; 4174 4175 var lookup = ['('].concat(simple, nonHelper); 4176 if (!this.options.strict) { 4177 lookup.push(' || ', this.aliasable('helpers.helperMissing')); 4178 } 4179 lookup.push(')'); 4180 4181 this.push(this.source.functionCall(lookup, 'call', helper.callParams)); 4182 }, 4183 4184 // [invokeKnownHelper] 4185 // 4186 // On stack, before: hash, inverse, program, params..., ... 4187 // On stack, after: result of helper invocation 4188 // 4189 // This operation is used when the helper is known to exist, 4190 // so a `helperMissing` fallback is not required. 4191 invokeKnownHelper: function invokeKnownHelper(paramSize, name) { 4192 var helper = this.setupHelper(paramSize, name); 4193 this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); 4194 }, 4195 4196 // [invokeAmbiguous] 4197 // 4198 // On stack, before: hash, inverse, program, params..., ... 4199 // On stack, after: result of disambiguation 4200 // 4201 // This operation is used when an expression like `{{foo}}` 4202 // is provided, but we don't know at compile-time whether it 4203 // is a helper or a path. 4204 // 4205 // This operation emits more code than the other options, 4206 // and can be avoided by passing the `knownHelpers` and 4207 // `knownHelpersOnly` flags at compile-time. 4208 invokeAmbiguous: function invokeAmbiguous(name, helperCall) { 4209 this.useRegister('helper'); 4210 4211 var nonHelper = this.popStack(); 4212 4213 this.emptyHash(); 4214 var helper = this.setupHelper(0, name, helperCall); 4215 4216 var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); 4217 4218 var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; 4219 if (!this.options.strict) { 4220 lookup[0] = '(helper = '; 4221 lookup.push(' != null ? helper : ', this.aliasable('helper
vendor: 11,305 bytes, lines 4221-4615
4221s.helperMissing')); 4222 } 4223 4224 this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']); 4225 }, 4226 4227 // [invokePartial] 4228 // 4229 // On stack, before: context, ... 4230 // On stack after: result of partial invocation 4231 // 4232 // This operation pops off a context, invokes a partial with that context, 4233 // and pushes the result of the invocation back. 4234 invokePartial: function invokePartial(isDynamic, name, indent) { 4235 var params = [], 4236 options = this.setupParams(name, 1, params); 4237 4238 if (isDynamic) { 4239 name = this.popStack(); 4240 delete options.name; 4241 } 4242 4243 if (indent) { 4244 options.indent = JSON.stringify(indent); 4245 } 4246 options.helpers = 'helpers'; 4247 options.partials = 'partials'; 4248 options.decorators = 'container.decorators'; 4249 4250 if (!isDynamic) { 4251 params.unshift(this.nameLookup('partials', name, 'partial')); 4252 } else { 4253 params.unshift(name); 4254 } 4255 4256 if (this.options.compat) { 4257 options.depths = 'depths'; 4258 } 4259 options = this.objectLiteral(options); 4260 params.push(options); 4261 4262 this.push(this.source.functionCall('container.invokePartial', '', params)); 4263 }, 4264 4265 // [assignToHash] 4266 // 4267 // On stack, before: value, ..., hash, ... 4268 // On stack, after: ..., hash, ... 4269 // 4270 // Pops a value off the stack and assigns it to the current hash 4271 assignToHash: function assignToHash(key) { 4272 var value = this.popStack(), 4273 context = undefined, 4274 type = undefined, 4275 id = undefined; 4276 4277 if (this.trackIds) { 4278 id = this.popStack(); 4279 } 4280 if (this.stringParams) { 4281 type = this.popStack(); 4282 context = this.popStack(); 4283 } 4284 4285 var hash = this.hash; 4286 if (context) { 4287 hash.contexts[key] = context; 4288 } 4289 if (type) { 4290 hash.types[key] = type; 4291 } 4292 if (id) { 4293 hash.ids[key] = id; 4294 } 4295 hash.values[key] = value; 4296 }, 4297 4298 pushId: function pushId(type, name, child) { 4299 if (type === 'BlockParam') { 4300 this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : '')); 4301 } else if (type === 'PathExpression') { 4302 this.pushString(name); 4303 } else if (type === 'SubExpression') { 4304 this.pushStackLiteral('true'); 4305 } else { 4306 this.pushStackLiteral('null'); 4307 } 4308 }, 4309 4310 // HELPERS 4311 4312 compiler: JavaScriptCompiler, 4313 4314 compileChildren: function compileChildren(environment, options) { 4315 var children = environment.children, 4316 child = undefined, 4317 compiler = undefined; 4318 4319 for (var i = 0, l = children.length; i < l; i++) { 4320 child = children[i]; 4321 compiler = new this.compiler(); // eslint-disable-line new-cap 4322 4323 var existing = this.matchExistingProgram(child); 4324 4325 if (existing == null) { 4326 this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children 4327 var index = this.context.programs.length; 4328 child.index = index; 4329 child.name = 'program' + index; 4330 this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile); 4331 this.context.decorators[index] = compiler.decorators; 4332 this.context.environments[index] = child; 4333 4334 this.useDepths = this.useDepths || compiler.useDepths; 4335 this.useBlockParams = this.useBlockParams || compiler.useBlockParams; 4336 child.useDepths = this.useDepths; 4337 child.useBlockParams = this.useBlockParams; 4338 } else { 4339 child.index = existing.index; 4340 child.name = 'program' + existing.index; 4341 4342 this.useDepths = this.useDepths || existing.useDepths; 4343 this.useBlockParams = this.useBlockParams || existing.useBlockParams; 4344 } 4345 } 4346 }, 4347 matchExistingProgram: function matchExistingProgram(child) { 4348 for (var i = 0, len = this.context.environments.length; i < len; i++) { 4349 var environment = this.context.environments[i]; 4350 if (environment && environment.equals(child)) { 4351 return environment; 4352 } 4353 } 4354 }, 4355 4356 programExpression: function programExpression(guid) { 4357 var child = this.environment.children[guid], 4358 programParams = [child.index, 'data', child.blockParams]; 4359 4360 if (this.useBlockParams || this.useDepths) { 4361 programParams.push('blockParams'); 4362 } 4363 if (this.useDepths) { 4364 programParams.push('depths'); 4365 } 4366 4367 return 'container.program(' + programParams.join(', ') + ')'; 4368 }, 4369 4370 useRegister: function useRegister(name) { 4371 if (!this.registers[name]) { 4372 this.registers[name] = true; 4373 this.registers.list.push(name); 4374 } 4375 }, 4376 4377 push: function push(expr) { 4378 if (!(expr instanceof Literal)) { 4379 expr = this.source.wrap(expr); 4380 } 4381 4382 this.inlineStack.push(expr); 4383 return expr; 4384 }, 4385 4386 pushStackLiteral: function pushStackLiteral(item) { 4387 this.push(new Literal(item)); 4388 }, 4389 4390 pushSource: function pushSource(source) { 4391 if (this.pendingContent) { 4392 this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)); 4393 this.pendingContent = undefined; 4394 } 4395 4396 if (source) { 4397 this.source.push(source); 4398 } 4399 }, 4400 4401 replaceStack: function replaceStack(callback) { 4402 var prefix = ['('], 4403 stack = undefined, 4404 createdStack = undefined, 4405 usedLiteral = undefined; 4406 4407 /* istanbul ignore next */ 4408 if (!this.isInline()) { 4409 throw new _exception2['default']('replaceStack on non-inline'); 4410 } 4411 4412 // We want to merge the inline statement into the replacement statement via ',' 4413 var top = this.popStack(true); 4414 4415 if (top instanceof Literal) { 4416 // Literals do not need to be inlined 4417 stack = [top.value]; 4418 prefix = ['(', stack]; 4419 usedLiteral = true; 4420 } else { 4421 // Get or create the current stack name for use by the inline 4422 createdStack = true; 4423 var _name = this.incrStack(); 4424 4425 prefix = ['((', this.push(_name), ' = ', top, ')']; 4426 stack = this.topStack(); 4427 } 4428 4429 var item = callback.call(this, stack); 4430 4431 if (!usedLiteral) { 4432 this.popStack(); 4433 } 4434 if (createdStack) { 4435 this.stackSlot--; 4436 } 4437 this.push(prefix.concat(item, ')')); 4438 }, 4439 4440 incrStack: function incrStack() { 4441 this.stackSlot++; 4442 if (this.stackSlot > this.stackVars.length) { 4443 this.stackVars.push('stack' + this.stackSlot); 4444 } 4445 return this.topStackName(); 4446 }, 4447 topStackName: function topStackName() { 4448 return 'stack' + this.stackSlot; 4449 }, 4450 flushInline: function flushInline() { 4451 var inlineStack = this.inlineStack; 4452 this.inlineStack = []; 4453 for (var i = 0, len = inlineStack.length; i < len; i++) { 4454 var entry = inlineStack[i]; 4455 /* istanbul ignore if */ 4456 if (entry instanceof Literal) { 4457 this.compileStack.push(entry); 4458 } else { 4459 var stack = this.incrStack(); 4460 this.pushSource([stack, ' = ', entry, ';']); 4461 this.compileStack.push(stack); 4462 } 4463 } 4464 }, 4465 isInline: function isInline() { 4466 return this.inlineStack.length; 4467 }, 4468 4469 popStack: function popStack(wrapped) { 4470 var inline = this.isInline(), 4471 item = (inline ? this.inlineStack : this.compileStack).pop(); 4472 4473 if (!wrapped && item instanceof Literal) { 4474 return item.value; 4475 } else { 4476 if (!inline) { 4477 /* istanbul ignore next */ 4478 if (!this.stackSlot) { 4479 throw new _exception2['default']('Invalid stack pop'); 4480 } 4481 this.stackSlot--; 4482 } 4483 return item; 4484 } 4485 }, 4486 4487 topStack: function topStack() { 4488 var stack = this.isInline() ? this.inlineStack : this.compileStack, 4489 item = stack[stack.length - 1]; 4490 4491 /* istanbul ignore if */ 4492 if (item instanceof Literal) { 4493 return item.value; 4494 } else { 4495 return item; 4496 } 4497 }, 4498 4499 contextName: function contextName(context) { 4500 if (this.useDepths && context) { 4501 return 'depths[' + context + ']'; 4502 } else { 4503 return 'depth' + context; 4504 } 4505 }, 4506 4507 quotedString: function quotedString(str) { 4508 return this.source.quotedString(str); 4509 }, 4510 4511 objectLiteral: function objectLiteral(obj) { 4512 return this.source.objectLiteral(obj); 4513 }, 4514 4515 aliasable: function aliasable(name) { 4516 var ret = this.aliases[name]; 4517 if (ret) { 4518 ret.referenceCount++; 4519 return ret; 4520 } 4521 4522 ret = this.aliases[name] = this.source.wrap(name); 4523 ret.aliasable = true; 4524 ret.referenceCount = 1; 4525 4526 return ret; 4527 }, 4528 4529 setupHelper: function setupHelper(paramSize, name, blockHelper) { 4530 var params = [], 4531 paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); 4532 var foundHelper = this.nameLookup('helpers', name, 'helper'), 4533 callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})'); 4534 4535 return { 4536 params: params, 4537 paramsInit: paramsInit, 4538 name: foundHelper, 4539 callParams: [callContext].concat(params) 4540 }; 4541 }, 4542 4543 setupParams: function setupParams(helper, paramSize, params) { 4544 var options = {}, 4545 contexts = [], 4546 types = [], 4547 ids = [], 4548 objectArgs = !params, 4549 param = undefined; 4550 4551 if (objectArgs) { 4552 params = []; 4553 } 4554 4555 options.name = this.quotedString(helper); 4556 options.hash = this.popStack(); 4557 4558 if (this.trackIds) { 4559 options.hashIds = this.popStack(); 4560 } 4561 if (this.stringParams) { 4562 options.hashTypes = this.popStack(); 4563 options.hashContexts = this.popStack(); 4564 } 4565 4566 var inverse = this.popStack(), 4567 program = this.popStack(); 4568 4569 // Avoid setting fn and inverse if neither are set. This allows 4570 // helpers to do a check for `if (options.fn)` 4571 if (program || inverse) { 4572 options.fn = program || 'container.noop'; 4573 options.inverse = inverse || 'container.noop'; 4574 } 4575 4576 // The parameters go on to the stack in order (making sure that they are evaluated in order) 4577 // so we need to pop them off the stack in reverse order 4578 var i = paramSize; 4579 while (i--) { 4580 param = this.popStack(); 4581 params[i] = param; 4582 4583 if (this.trackIds) { 4584 ids[i] = this.popStack(); 4585 } 4586 if (this.stringParams) { 4587 types[i] = this.popStack(); 4588 contexts[i] = this.popStack(); 4589 } 4590 } 4591 4592 if (objectArgs) { 4593 options.args = this.source.generateArray(params); 4594 } 4595 4596 if (this.trackIds) { 4597 options.ids = this.source.generateArray(ids); 4598 } 4599 if (this.stringParams) { 4600 options.types = this.source.generateArray(types); 4601 options.contexts = this.source.generateArray(contexts); 4602 } 4603 4604 if (this.options.data) { 4605 options.data = 'data'; 4606 } 4607 if (this.useBlockParams) { 4608 options.blockParams = 'blockParams'; 4609 } 4610 return options; 4611 }, 4612 4613 setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) { 4614 var options = this.setupParams(helper, paramSize, params); 4615 options
vendor: 1,005 bytes, lines 4615-4638
4615 = this.objectLiteral(options); 4616 if (useRegister) { 4617 this.useRegister('options'); 4618 params.push('options'); 4619 return ['options=', options]; 4620 } else if (params) { 4621 params.push(options); 4622 return ''; 4623 } else { 4624 return options; 4625 } 4626 } 4627 }; 4628 4629 (function () { 4630 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(' '); 4631 4632 var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; 4633 4634 for (var i = 0, l = reservedWords.length; i < l; i++) { 4635 compilerWords[reservedWords[i]] = true; 4636 } 4637 })(); 4638
vendor: 4,122 bytes, lines 4639-4790
4639 JavaScriptCompiler.isValidJavaScriptVariableName = function (name) { 4640 return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name); 4641 }; 4642 4643 function strictLookup(requireTerminal, compiler, parts, type) { 4644 var stack = compiler.popStack(), 4645 i = 0, 4646 len = parts.length; 4647 if (requireTerminal) { 4648 len--; 4649 } 4650 4651 for (; i < len; i++) { 4652 stack = compiler.nameLookup(stack, parts[i], type); 4653 } 4654 4655 if (requireTerminal) { 4656 return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')']; 4657 } else { 4658 return stack; 4659 } 4660 } 4661 4662 exports['default'] = JavaScriptCompiler; 4663 module.exports = exports['default']; 4664 4665/***/ }), 4666/* 43 */ 4667/***/ (function(module, exports, __webpack_require__) { 4668 4669 /* global define */ 4670 'use strict'; 4671 4672 exports.__esModule = true; 4673 4674 var _utils = __webpack_require__(5); 4675 4676 var SourceNode = undefined; 4677 4678 try { 4679 /* istanbul ignore next */ 4680 if (false) { 4681 // We don't support this in AMD environments. For these environments, we asusme that 4682 // they are running on the browser and thus have no need for the source-map library. 4683 var SourceMap = require('source-map'); 4684 SourceNode = SourceMap.SourceNode; 4685 } 4686 } catch (err) {} 4687 /* NOP */ 4688 4689 /* istanbul ignore if: tested but not covered in istanbul due to dist build */ 4690 if (!SourceNode) { 4691 SourceNode = function (line, column, srcFile, chunks) { 4692 this.src = ''; 4693 if (chunks) { 4694 this.add(chunks); 4695 } 4696 }; 4697 /* istanbul ignore next */ 4698 SourceNode.prototype = { 4699 add: function add(chunks) { 4700 if (_utils.isArray(chunks)) { 4701 chunks = chunks.join(''); 4702 } 4703 this.src += chunks; 4704 }, 4705 prepend: function prepend(chunks) { 4706 if (_utils.isArray(chunks)) { 4707 chunks = chunks.join(''); 4708 } 4709 this.src = chunks + this.src; 4710 }, 4711 toStringWithSourceMap: function toStringWithSourceMap() { 4712 return { code: this.toString() }; 4713 }, 4714 toString: function toString() { 4715 return this.src; 4716 } 4717 }; 4718 } 4719 4720 function castChunk(chunk, codeGen, loc) { 4721 if (_utils.isArray(chunk)) { 4722 var ret = []; 4723 4724 for (var i = 0, len = chunk.length; i < len; i++) { 4725 ret.push(codeGen.wrap(chunk[i], loc)); 4726 } 4727 return ret; 4728 } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { 4729 // Handle primitives that the SourceNode will throw up on 4730 return chunk + ''; 4731 } 4732 return chunk; 4733 } 4734 4735 function CodeGen(srcFile) { 4736 this.srcFile = srcFile; 4737 this.source = []; 4738 } 4739 4740 CodeGen.prototype = { 4741 isEmpty: function isEmpty() { 4742 return !this.source.length; 4743 }, 4744 prepend: function prepend(source, loc) { 4745 this.source.unshift(this.wrap(source, loc)); 4746 }, 4747 push: function push(source, loc) { 4748 this.source.push(this.wrap(source, loc)); 4749 }, 4750 4751 merge: function merge() { 4752 var source = this.empty(); 4753 this.each(function (line) { 4754 source.add([' ', line, '\n']); 4755 }); 4756 return source; 4757 }, 4758 4759 each: function each(iter) { 4760 for (var i = 0, len = this.source.length; i < len; i++) { 4761 iter(this.source[i]); 4762 } 4763 }, 4764 4765 empty: function empty() { 4766 var loc = this.currentLocation || { start: {} }; 4767 return new SourceNode(loc.start.line, loc.start.column, this.srcFile); 4768 }, 4769 wrap: function wrap(chunk) { 4770 var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; 4771 4772 if (chunk instanceof SourceNode) { 4773 return chunk; 4774 } 4775 4776 chunk = castChunk(chunk, this, loc); 4777 4778 return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); 4779 }, 4780 4781 functionCall: function functionCall(fn, type, params) { 4782 params = this.generateList(params); 4783 return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); 4784 }, 4785 4786 quotedString: function quotedString(str) { 4787 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 4788 .replace(/\u2029/g, '\\u2029') + '"'; 4789 }, 4790
4791 objectLiteral: function objectLiteral(obj) { 4792 var pairs = []; 4793 4794 for (var key in obj) { 4795 if (obj.hasOwnProperty(key)) { 4796 var value = castChunk(obj[key], this); 4797 if (value !== 'undefined') { 4798 pairs.push([this.quotedString(key), ':', value]); 4799 } 4800 } 4801 } 4802 4803 var ret = this.generateList(pairs); 4804 ret.prepend('{'); 4805 ret.add('}'); 4806 return ret; 4807 }, 4808 4809 generateList: function generateList(entries) { 4810 var ret = this.empty(); 4811 4812 for (var i = 0, len = entries.length; i < len; i++) { 4813 if (i) { 4814 ret.add(','); 4815 } 4816 4817 ret.add(castChunk(entries[i], this)); 4818 } 4819 4820 return ret; 4821 }, 4822 4823 generateArray: function generateArray(entries) { 4824 var ret = this.generateList(entries); 4825 ret.prepend('['); 4826 ret.add(']'); 4827 4828 return ret; 4829 } 4830 }; 4831 4832 exports['default'] = CodeGen; 4833 module.exports = exports['default']; 4834 4835/***/ }) 4836/******/ ]) 4837}); 4838;
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.