handlebars.runtime.js 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800
  1. /**!
  2. @license
  3. handlebars v4.7.7
  4. Copyright (C) 2011-2019 by Yehuda Katz
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. THE SOFTWARE.
  20. */
  21. (function webpackUniversalModuleDefinition(root, factory) {
  22. if(typeof exports === 'object' && typeof module === 'object')
  23. module.exports = factory();
  24. else if(typeof define === 'function' && define.amd)
  25. define([], factory);
  26. else if(typeof exports === 'object')
  27. exports["Handlebars"] = factory();
  28. else
  29. root["Handlebars"] = factory();
  30. })(this, function() {
  31. return /******/ (function(modules) { // webpackBootstrap
  32. /******/ // The module cache
  33. /******/ var installedModules = {};
  34. /******/ // The require function
  35. /******/ function __webpack_require__(moduleId) {
  36. /******/ // Check if module is in cache
  37. /******/ if(installedModules[moduleId])
  38. /******/ return installedModules[moduleId].exports;
  39. /******/ // Create a new module (and put it into the cache)
  40. /******/ var module = installedModules[moduleId] = {
  41. /******/ exports: {},
  42. /******/ id: moduleId,
  43. /******/ loaded: false
  44. /******/ };
  45. /******/ // Execute the module function
  46. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  47. /******/ // Flag the module as loaded
  48. /******/ module.loaded = true;
  49. /******/ // Return the exports of the module
  50. /******/ return module.exports;
  51. /******/ }
  52. /******/ // expose the modules object (__webpack_modules__)
  53. /******/ __webpack_require__.m = modules;
  54. /******/ // expose the module cache
  55. /******/ __webpack_require__.c = installedModules;
  56. /******/ // __webpack_public_path__
  57. /******/ __webpack_require__.p = "";
  58. /******/ // Load entry module and return exports
  59. /******/ return __webpack_require__(0);
  60. /******/ })
  61. /************************************************************************/
  62. /******/ ([
  63. /* 0 */
  64. /***/ (function(module, exports, __webpack_require__) {
  65. 'use strict';
  66. var _interopRequireWildcard = __webpack_require__(1)['default'];
  67. var _interopRequireDefault = __webpack_require__(2)['default'];
  68. exports.__esModule = true;
  69. var _handlebarsBase = __webpack_require__(3);
  70. var base = _interopRequireWildcard(_handlebarsBase);
  71. // Each of these augment the Handlebars object. No need to setup here.
  72. // (This is done to easily share code between commonjs and browse envs)
  73. var _handlebarsSafeString = __webpack_require__(36);
  74. var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
  75. var _handlebarsException = __webpack_require__(5);
  76. var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
  77. var _handlebarsUtils = __webpack_require__(4);
  78. var Utils = _interopRequireWildcard(_handlebarsUtils);
  79. var _handlebarsRuntime = __webpack_require__(37);
  80. var runtime = _interopRequireWildcard(_handlebarsRuntime);
  81. var _handlebarsNoConflict = __webpack_require__(43);
  82. var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
  83. // For compatibility and usage outside of module systems, make the Handlebars object a namespace
  84. function create() {
  85. var hb = new base.HandlebarsEnvironment();
  86. Utils.extend(hb, base);
  87. hb.SafeString = _handlebarsSafeString2['default'];
  88. hb.Exception = _handlebarsException2['default'];
  89. hb.Utils = Utils;
  90. hb.escapeExpression = Utils.escapeExpression;
  91. hb.VM = runtime;
  92. hb.template = function (spec) {
  93. return runtime.template(spec, hb);
  94. };
  95. return hb;
  96. }
  97. var inst = create();
  98. inst.create = create;
  99. _handlebarsNoConflict2['default'](inst);
  100. inst['default'] = inst;
  101. exports['default'] = inst;
  102. module.exports = exports['default'];
  103. /***/ }),
  104. /* 1 */
  105. /***/ (function(module, exports) {
  106. "use strict";
  107. exports["default"] = function (obj) {
  108. if (obj && obj.__esModule) {
  109. return obj;
  110. } else {
  111. var newObj = {};
  112. if (obj != null) {
  113. for (var key in obj) {
  114. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  115. }
  116. }
  117. newObj["default"] = obj;
  118. return newObj;
  119. }
  120. };
  121. exports.__esModule = true;
  122. /***/ }),
  123. /* 2 */
  124. /***/ (function(module, exports) {
  125. "use strict";
  126. exports["default"] = function (obj) {
  127. return obj && obj.__esModule ? obj : {
  128. "default": obj
  129. };
  130. };
  131. exports.__esModule = true;
  132. /***/ }),
  133. /* 3 */
  134. /***/ (function(module, exports, __webpack_require__) {
  135. 'use strict';
  136. var _interopRequireDefault = __webpack_require__(2)['default'];
  137. exports.__esModule = true;
  138. exports.HandlebarsEnvironment = HandlebarsEnvironment;
  139. var _utils = __webpack_require__(4);
  140. var _exception = __webpack_require__(5);
  141. var _exception2 = _interopRequireDefault(_exception);
  142. var _helpers = __webpack_require__(9);
  143. var _decorators = __webpack_require__(29);
  144. var _logger = __webpack_require__(31);
  145. var _logger2 = _interopRequireDefault(_logger);
  146. var _internalProtoAccess = __webpack_require__(32);
  147. var VERSION = '4.7.7';
  148. exports.VERSION = VERSION;
  149. var COMPILER_REVISION = 8;
  150. exports.COMPILER_REVISION = COMPILER_REVISION;
  151. var LAST_COMPATIBLE_COMPILER_REVISION = 7;
  152. exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
  153. var REVISION_CHANGES = {
  154. 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
  155. 2: '== 1.0.0-rc.3',
  156. 3: '== 1.0.0-rc.4',
  157. 4: '== 1.x.x',
  158. 5: '== 2.0.0-alpha.x',
  159. 6: '>= 2.0.0-beta.1',
  160. 7: '>= 4.0.0 <4.3.0',
  161. 8: '>= 4.3.0'
  162. };
  163. exports.REVISION_CHANGES = REVISION_CHANGES;
  164. var objectType = '[object Object]';
  165. function HandlebarsEnvironment(helpers, partials, decorators) {
  166. this.helpers = helpers || {};
  167. this.partials = partials || {};
  168. this.decorators = decorators || {};
  169. _helpers.registerDefaultHelpers(this);
  170. _decorators.registerDefaultDecorators(this);
  171. }
  172. HandlebarsEnvironment.prototype = {
  173. constructor: HandlebarsEnvironment,
  174. logger: _logger2['default'],
  175. log: _logger2['default'].log,
  176. registerHelper: function registerHelper(name, fn) {
  177. if (_utils.toString.call(name) === objectType) {
  178. if (fn) {
  179. throw new _exception2['default']('Arg not supported with multiple helpers');
  180. }
  181. _utils.extend(this.helpers, name);
  182. } else {
  183. this.helpers[name] = fn;
  184. }
  185. },
  186. unregisterHelper: function unregisterHelper(name) {
  187. delete this.helpers[name];
  188. },
  189. registerPartial: function registerPartial(name, partial) {
  190. if (_utils.toString.call(name) === objectType) {
  191. _utils.extend(this.partials, name);
  192. } else {
  193. if (typeof partial === 'undefined') {
  194. throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
  195. }
  196. this.partials[name] = partial;
  197. }
  198. },
  199. unregisterPartial: function unregisterPartial(name) {
  200. delete this.partials[name];
  201. },
  202. registerDecorator: function registerDecorator(name, fn) {
  203. if (_utils.toString.call(name) === objectType) {
  204. if (fn) {
  205. throw new _exception2['default']('Arg not supported with multiple decorators');
  206. }
  207. _utils.extend(this.decorators, name);
  208. } else {
  209. this.decorators[name] = fn;
  210. }
  211. },
  212. unregisterDecorator: function unregisterDecorator(name) {
  213. delete this.decorators[name];
  214. },
  215. /**
  216. * Reset the memory of illegal property accesses that have already been logged.
  217. * @deprecated should only be used in handlebars test-cases
  218. */
  219. resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
  220. _internalProtoAccess.resetLoggedProperties();
  221. }
  222. };
  223. var log = _logger2['default'].log;
  224. exports.log = log;
  225. exports.createFrame = _utils.createFrame;
  226. exports.logger = _logger2['default'];
  227. /***/ }),
  228. /* 4 */
  229. /***/ (function(module, exports) {
  230. 'use strict';
  231. exports.__esModule = true;
  232. exports.extend = extend;
  233. exports.indexOf = indexOf;
  234. exports.escapeExpression = escapeExpression;
  235. exports.isEmpty = isEmpty;
  236. exports.createFrame = createFrame;
  237. exports.blockParams = blockParams;
  238. exports.appendContextPath = appendContextPath;
  239. var escape = {
  240. '&': '&amp;',
  241. '<': '&lt;',
  242. '>': '&gt;',
  243. '"': '&quot;',
  244. "'": '&#x27;',
  245. '`': '&#x60;',
  246. '=': '&#x3D;'
  247. };
  248. var badChars = /[&<>"'`=]/g,
  249. possible = /[&<>"'`=]/;
  250. function escapeChar(chr) {
  251. return escape[chr];
  252. }
  253. function extend(obj /* , ...source */) {
  254. for (var i = 1; i < arguments.length; i++) {
  255. for (var key in arguments[i]) {
  256. if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
  257. obj[key] = arguments[i][key];
  258. }
  259. }
  260. }
  261. return obj;
  262. }
  263. var toString = Object.prototype.toString;
  264. exports.toString = toString;
  265. // Sourced from lodash
  266. // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
  267. /* eslint-disable func-style */
  268. var isFunction = function isFunction(value) {
  269. return typeof value === 'function';
  270. };
  271. // fallback for older versions of Chrome and Safari
  272. /* istanbul ignore next */
  273. if (isFunction(/x/)) {
  274. exports.isFunction = isFunction = function (value) {
  275. return typeof value === 'function' && toString.call(value) === '[object Function]';
  276. };
  277. }
  278. exports.isFunction = isFunction;
  279. /* eslint-enable func-style */
  280. /* istanbul ignore next */
  281. var isArray = Array.isArray || function (value) {
  282. return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
  283. };
  284. exports.isArray = isArray;
  285. // Older IE versions do not directly support indexOf so we must implement our own, sadly.
  286. function indexOf(array, value) {
  287. for (var i = 0, len = array.length; i < len; i++) {
  288. if (array[i] === value) {
  289. return i;
  290. }
  291. }
  292. return -1;
  293. }
  294. function escapeExpression(string) {
  295. if (typeof string !== 'string') {
  296. // don't escape SafeStrings, since they're already safe
  297. if (string && string.toHTML) {
  298. return string.toHTML();
  299. } else if (string == null) {
  300. return '';
  301. } else if (!string) {
  302. return string + '';
  303. }
  304. // Force a string conversion as this will be done by the append regardless and
  305. // the regex test will do this transparently behind the scenes, causing issues if
  306. // an object's to string has escaped characters in it.
  307. string = '' + string;
  308. }
  309. if (!possible.test(string)) {
  310. return string;
  311. }
  312. return string.replace(badChars, escapeChar);
  313. }
  314. function isEmpty(value) {
  315. if (!value && value !== 0) {
  316. return true;
  317. } else if (isArray(value) && value.length === 0) {
  318. return true;
  319. } else {
  320. return false;
  321. }
  322. }
  323. function createFrame(object) {
  324. var frame = extend({}, object);
  325. frame._parent = object;
  326. return frame;
  327. }
  328. function blockParams(params, ids) {
  329. params.path = ids;
  330. return params;
  331. }
  332. function appendContextPath(contextPath, id) {
  333. return (contextPath ? contextPath + '.' : '') + id;
  334. }
  335. /***/ }),
  336. /* 5 */
  337. /***/ (function(module, exports, __webpack_require__) {
  338. 'use strict';
  339. var _Object$defineProperty = __webpack_require__(6)['default'];
  340. exports.__esModule = true;
  341. var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
  342. function Exception(message, node) {
  343. var loc = node && node.loc,
  344. line = undefined,
  345. endLineNumber = undefined,
  346. column = undefined,
  347. endColumn = undefined;
  348. if (loc) {
  349. line = loc.start.line;
  350. endLineNumber = loc.end.line;
  351. column = loc.start.column;
  352. endColumn = loc.end.column;
  353. message += ' - ' + line + ':' + column;
  354. }
  355. var tmp = Error.prototype.constructor.call(this, message);
  356. // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
  357. for (var idx = 0; idx < errorProps.length; idx++) {
  358. this[errorProps[idx]] = tmp[errorProps[idx]];
  359. }
  360. /* istanbul ignore else */
  361. if (Error.captureStackTrace) {
  362. Error.captureStackTrace(this, Exception);
  363. }
  364. try {
  365. if (loc) {
  366. this.lineNumber = line;
  367. this.endLineNumber = endLineNumber;
  368. // Work around issue under safari where we can't directly set the column value
  369. /* istanbul ignore next */
  370. if (_Object$defineProperty) {
  371. Object.defineProperty(this, 'column', {
  372. value: column,
  373. enumerable: true
  374. });
  375. Object.defineProperty(this, 'endColumn', {
  376. value: endColumn,
  377. enumerable: true
  378. });
  379. } else {
  380. this.column = column;
  381. this.endColumn = endColumn;
  382. }
  383. }
  384. } catch (nop) {
  385. /* Ignore if the browser is very particular */
  386. }
  387. }
  388. Exception.prototype = new Error();
  389. exports['default'] = Exception;
  390. module.exports = exports['default'];
  391. /***/ }),
  392. /* 6 */
  393. /***/ (function(module, exports, __webpack_require__) {
  394. module.exports = { "default": __webpack_require__(7), __esModule: true };
  395. /***/ }),
  396. /* 7 */
  397. /***/ (function(module, exports, __webpack_require__) {
  398. var $ = __webpack_require__(8);
  399. module.exports = function defineProperty(it, key, desc){
  400. return $.setDesc(it, key, desc);
  401. };
  402. /***/ }),
  403. /* 8 */
  404. /***/ (function(module, exports) {
  405. var $Object = Object;
  406. module.exports = {
  407. create: $Object.create,
  408. getProto: $Object.getPrototypeOf,
  409. isEnum: {}.propertyIsEnumerable,
  410. getDesc: $Object.getOwnPropertyDescriptor,
  411. setDesc: $Object.defineProperty,
  412. setDescs: $Object.defineProperties,
  413. getKeys: $Object.keys,
  414. getNames: $Object.getOwnPropertyNames,
  415. getSymbols: $Object.getOwnPropertySymbols,
  416. each: [].forEach
  417. };
  418. /***/ }),
  419. /* 9 */
  420. /***/ (function(module, exports, __webpack_require__) {
  421. 'use strict';
  422. var _interopRequireDefault = __webpack_require__(2)['default'];
  423. exports.__esModule = true;
  424. exports.registerDefaultHelpers = registerDefaultHelpers;
  425. exports.moveHelperToHooks = moveHelperToHooks;
  426. var _helpersBlockHelperMissing = __webpack_require__(10);
  427. var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
  428. var _helpersEach = __webpack_require__(11);
  429. var _helpersEach2 = _interopRequireDefault(_helpersEach);
  430. var _helpersHelperMissing = __webpack_require__(24);
  431. var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
  432. var _helpersIf = __webpack_require__(25);
  433. var _helpersIf2 = _interopRequireDefault(_helpersIf);
  434. var _helpersLog = __webpack_require__(26);
  435. var _helpersLog2 = _interopRequireDefault(_helpersLog);
  436. var _helpersLookup = __webpack_require__(27);
  437. var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
  438. var _helpersWith = __webpack_require__(28);
  439. var _helpersWith2 = _interopRequireDefault(_helpersWith);
  440. function registerDefaultHelpers(instance) {
  441. _helpersBlockHelperMissing2['default'](instance);
  442. _helpersEach2['default'](instance);
  443. _helpersHelperMissing2['default'](instance);
  444. _helpersIf2['default'](instance);
  445. _helpersLog2['default'](instance);
  446. _helpersLookup2['default'](instance);
  447. _helpersWith2['default'](instance);
  448. }
  449. function moveHelperToHooks(instance, helperName, keepHelper) {
  450. if (instance.helpers[helperName]) {
  451. instance.hooks[helperName] = instance.helpers[helperName];
  452. if (!keepHelper) {
  453. delete instance.helpers[helperName];
  454. }
  455. }
  456. }
  457. /***/ }),
  458. /* 10 */
  459. /***/ (function(module, exports, __webpack_require__) {
  460. 'use strict';
  461. exports.__esModule = true;
  462. var _utils = __webpack_require__(4);
  463. exports['default'] = function (instance) {
  464. instance.registerHelper('blockHelperMissing', function (context, options) {
  465. var inverse = options.inverse,
  466. fn = options.fn;
  467. if (context === true) {
  468. return fn(this);
  469. } else if (context === false || context == null) {
  470. return inverse(this);
  471. } else if (_utils.isArray(context)) {
  472. if (context.length > 0) {
  473. if (options.ids) {
  474. options.ids = [options.name];
  475. }
  476. return instance.helpers.each(context, options);
  477. } else {
  478. return inverse(this);
  479. }
  480. } else {
  481. if (options.data && options.ids) {
  482. var data = _utils.createFrame(options.data);
  483. data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
  484. options = { data: data };
  485. }
  486. return fn(context, options);
  487. }
  488. });
  489. };
  490. module.exports = exports['default'];
  491. /***/ }),
  492. /* 11 */
  493. /***/ (function(module, exports, __webpack_require__) {
  494. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  495. var _Object$keys = __webpack_require__(12)['default'];
  496. var _interopRequireDefault = __webpack_require__(2)['default'];
  497. exports.__esModule = true;
  498. var _utils = __webpack_require__(4);
  499. var _exception = __webpack_require__(5);
  500. var _exception2 = _interopRequireDefault(_exception);
  501. exports['default'] = function (instance) {
  502. instance.registerHelper('each', function (context, options) {
  503. if (!options) {
  504. throw new _exception2['default']('Must pass iterator to #each');
  505. }
  506. var fn = options.fn,
  507. inverse = options.inverse,
  508. i = 0,
  509. ret = '',
  510. data = undefined,
  511. contextPath = undefined;
  512. if (options.data && options.ids) {
  513. contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
  514. }
  515. if (_utils.isFunction(context)) {
  516. context = context.call(this);
  517. }
  518. if (options.data) {
  519. data = _utils.createFrame(options.data);
  520. }
  521. function execIteration(field, index, last) {
  522. if (data) {
  523. data.key = field;
  524. data.index = index;
  525. data.first = index === 0;
  526. data.last = !!last;
  527. if (contextPath) {
  528. data.contextPath = contextPath + field;
  529. }
  530. }
  531. ret = ret + fn(context[field], {
  532. data: data,
  533. blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
  534. });
  535. }
  536. if (context && typeof context === 'object') {
  537. if (_utils.isArray(context)) {
  538. for (var j = context.length; i < j; i++) {
  539. if (i in context) {
  540. execIteration(i, i, i === context.length - 1);
  541. }
  542. }
  543. } else if (global.Symbol && context[global.Symbol.iterator]) {
  544. var newContext = [];
  545. var iterator = context[global.Symbol.iterator]();
  546. for (var it = iterator.next(); !it.done; it = iterator.next()) {
  547. newContext.push(it.value);
  548. }
  549. context = newContext;
  550. for (var j = context.length; i < j; i++) {
  551. execIteration(i, i, i === context.length - 1);
  552. }
  553. } else {
  554. (function () {
  555. var priorKey = undefined;
  556. _Object$keys(context).forEach(function (key) {
  557. // We're running the iterations one step out of sync so we can detect
  558. // the last iteration without have to scan the object twice and create
  559. // an itermediate keys array.
  560. if (priorKey !== undefined) {
  561. execIteration(priorKey, i - 1);
  562. }
  563. priorKey = key;
  564. i++;
  565. });
  566. if (priorKey !== undefined) {
  567. execIteration(priorKey, i - 1, true);
  568. }
  569. })();
  570. }
  571. }
  572. if (i === 0) {
  573. ret = inverse(this);
  574. }
  575. return ret;
  576. });
  577. };
  578. module.exports = exports['default'];
  579. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  580. /***/ }),
  581. /* 12 */
  582. /***/ (function(module, exports, __webpack_require__) {
  583. module.exports = { "default": __webpack_require__(13), __esModule: true };
  584. /***/ }),
  585. /* 13 */
  586. /***/ (function(module, exports, __webpack_require__) {
  587. __webpack_require__(14);
  588. module.exports = __webpack_require__(20).Object.keys;
  589. /***/ }),
  590. /* 14 */
  591. /***/ (function(module, exports, __webpack_require__) {
  592. // 19.1.2.14 Object.keys(O)
  593. var toObject = __webpack_require__(15);
  594. __webpack_require__(17)('keys', function($keys){
  595. return function keys(it){
  596. return $keys(toObject(it));
  597. };
  598. });
  599. /***/ }),
  600. /* 15 */
  601. /***/ (function(module, exports, __webpack_require__) {
  602. // 7.1.13 ToObject(argument)
  603. var defined = __webpack_require__(16);
  604. module.exports = function(it){
  605. return Object(defined(it));
  606. };
  607. /***/ }),
  608. /* 16 */
  609. /***/ (function(module, exports) {
  610. // 7.2.1 RequireObjectCoercible(argument)
  611. module.exports = function(it){
  612. if(it == undefined)throw TypeError("Can't call method on " + it);
  613. return it;
  614. };
  615. /***/ }),
  616. /* 17 */
  617. /***/ (function(module, exports, __webpack_require__) {
  618. // most Object methods by ES6 should accept primitives
  619. var $export = __webpack_require__(18)
  620. , core = __webpack_require__(20)
  621. , fails = __webpack_require__(23);
  622. module.exports = function(KEY, exec){
  623. var fn = (core.Object || {})[KEY] || Object[KEY]
  624. , exp = {};
  625. exp[KEY] = exec(fn);
  626. $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
  627. };
  628. /***/ }),
  629. /* 18 */
  630. /***/ (function(module, exports, __webpack_require__) {
  631. var global = __webpack_require__(19)
  632. , core = __webpack_require__(20)
  633. , ctx = __webpack_require__(21)
  634. , PROTOTYPE = 'prototype';
  635. var $export = function(type, name, source){
  636. var IS_FORCED = type & $export.F
  637. , IS_GLOBAL = type & $export.G
  638. , IS_STATIC = type & $export.S
  639. , IS_PROTO = type & $export.P
  640. , IS_BIND = type & $export.B
  641. , IS_WRAP = type & $export.W
  642. , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
  643. , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
  644. , key, own, out;
  645. if(IS_GLOBAL)source = name;
  646. for(key in source){
  647. // contains in native
  648. own = !IS_FORCED && target && key in target;
  649. if(own && key in exports)continue;
  650. // export native or passed
  651. out = own ? target[key] : source[key];
  652. // prevent global pollution for namespaces
  653. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  654. // bind timers to global for call from export context
  655. : IS_BIND && own ? ctx(out, global)
  656. // wrap global constructors for prevent change them in library
  657. : IS_WRAP && target[key] == out ? (function(C){
  658. var F = function(param){
  659. return this instanceof C ? new C(param) : C(param);
  660. };
  661. F[PROTOTYPE] = C[PROTOTYPE];
  662. return F;
  663. // make static versions for prototype methods
  664. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  665. if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
  666. }
  667. };
  668. // type bitmap
  669. $export.F = 1; // forced
  670. $export.G = 2; // global
  671. $export.S = 4; // static
  672. $export.P = 8; // proto
  673. $export.B = 16; // bind
  674. $export.W = 32; // wrap
  675. module.exports = $export;
  676. /***/ }),
  677. /* 19 */
  678. /***/ (function(module, exports) {
  679. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  680. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  681. ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
  682. if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
  683. /***/ }),
  684. /* 20 */
  685. /***/ (function(module, exports) {
  686. var core = module.exports = {version: '1.2.6'};
  687. if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
  688. /***/ }),
  689. /* 21 */
  690. /***/ (function(module, exports, __webpack_require__) {
  691. // optional / simple context binding
  692. var aFunction = __webpack_require__(22);
  693. module.exports = function(fn, that, length){
  694. aFunction(fn);
  695. if(that === undefined)return fn;
  696. switch(length){
  697. case 1: return function(a){
  698. return fn.call(that, a);
  699. };
  700. case 2: return function(a, b){
  701. return fn.call(that, a, b);
  702. };
  703. case 3: return function(a, b, c){
  704. return fn.call(that, a, b, c);
  705. };
  706. }
  707. return function(/* ...args */){
  708. return fn.apply(that, arguments);
  709. };
  710. };
  711. /***/ }),
  712. /* 22 */
  713. /***/ (function(module, exports) {
  714. module.exports = function(it){
  715. if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  716. return it;
  717. };
  718. /***/ }),
  719. /* 23 */
  720. /***/ (function(module, exports) {
  721. module.exports = function(exec){
  722. try {
  723. return !!exec();
  724. } catch(e){
  725. return true;
  726. }
  727. };
  728. /***/ }),
  729. /* 24 */
  730. /***/ (function(module, exports, __webpack_require__) {
  731. 'use strict';
  732. var _interopRequireDefault = __webpack_require__(2)['default'];
  733. exports.__esModule = true;
  734. var _exception = __webpack_require__(5);
  735. var _exception2 = _interopRequireDefault(_exception);
  736. exports['default'] = function (instance) {
  737. instance.registerHelper('helperMissing', function () /* [args, ]options */{
  738. if (arguments.length === 1) {
  739. // A missing field in a {{foo}} construct.
  740. return undefined;
  741. } else {
  742. // Someone is actually trying to call something, blow up.
  743. throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
  744. }
  745. });
  746. };
  747. module.exports = exports['default'];
  748. /***/ }),
  749. /* 25 */
  750. /***/ (function(module, exports, __webpack_require__) {
  751. 'use strict';
  752. var _interopRequireDefault = __webpack_require__(2)['default'];
  753. exports.__esModule = true;
  754. var _utils = __webpack_require__(4);
  755. var _exception = __webpack_require__(5);
  756. var _exception2 = _interopRequireDefault(_exception);
  757. exports['default'] = function (instance) {
  758. instance.registerHelper('if', function (conditional, options) {
  759. if (arguments.length != 2) {
  760. throw new _exception2['default']('#if requires exactly one argument');
  761. }
  762. if (_utils.isFunction(conditional)) {
  763. conditional = conditional.call(this);
  764. }
  765. // Default behavior is to render the positive path if the value is truthy and not empty.
  766. // The `includeZero` option may be set to treat the condtional as purely not empty based on the
  767. // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
  768. if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
  769. return options.inverse(this);
  770. } else {
  771. return options.fn(this);
  772. }
  773. });
  774. instance.registerHelper('unless', function (conditional, options) {
  775. if (arguments.length != 2) {
  776. throw new _exception2['default']('#unless requires exactly one argument');
  777. }
  778. return instance.helpers['if'].call(this, conditional, {
  779. fn: options.inverse,
  780. inverse: options.fn,
  781. hash: options.hash
  782. });
  783. });
  784. };
  785. module.exports = exports['default'];
  786. /***/ }),
  787. /* 26 */
  788. /***/ (function(module, exports) {
  789. 'use strict';
  790. exports.__esModule = true;
  791. exports['default'] = function (instance) {
  792. instance.registerHelper('log', function () /* message, options */{
  793. var args = [undefined],
  794. options = arguments[arguments.length - 1];
  795. for (var i = 0; i < arguments.length - 1; i++) {
  796. args.push(arguments[i]);
  797. }
  798. var level = 1;
  799. if (options.hash.level != null) {
  800. level = options.hash.level;
  801. } else if (options.data && options.data.level != null) {
  802. level = options.data.level;
  803. }
  804. args[0] = level;
  805. instance.log.apply(instance, args);
  806. });
  807. };
  808. module.exports = exports['default'];
  809. /***/ }),
  810. /* 27 */
  811. /***/ (function(module, exports) {
  812. 'use strict';
  813. exports.__esModule = true;
  814. exports['default'] = function (instance) {
  815. instance.registerHelper('lookup', function (obj, field, options) {
  816. if (!obj) {
  817. // Note for 5.0: Change to "obj == null" in 5.0
  818. return obj;
  819. }
  820. return options.lookupProperty(obj, field);
  821. });
  822. };
  823. module.exports = exports['default'];
  824. /***/ }),
  825. /* 28 */
  826. /***/ (function(module, exports, __webpack_require__) {
  827. 'use strict';
  828. var _interopRequireDefault = __webpack_require__(2)['default'];
  829. exports.__esModule = true;
  830. var _utils = __webpack_require__(4);
  831. var _exception = __webpack_require__(5);
  832. var _exception2 = _interopRequireDefault(_exception);
  833. exports['default'] = function (instance) {
  834. instance.registerHelper('with', function (context, options) {
  835. if (arguments.length != 2) {
  836. throw new _exception2['default']('#with requires exactly one argument');
  837. }
  838. if (_utils.isFunction(context)) {
  839. context = context.call(this);
  840. }
  841. var fn = options.fn;
  842. if (!_utils.isEmpty(context)) {
  843. var data = options.data;
  844. if (options.data && options.ids) {
  845. data = _utils.createFrame(options.data);
  846. data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
  847. }
  848. return fn(context, {
  849. data: data,
  850. blockParams: _utils.blockParams([context], [data && data.contextPath])
  851. });
  852. } else {
  853. return options.inverse(this);
  854. }
  855. });
  856. };
  857. module.exports = exports['default'];
  858. /***/ }),
  859. /* 29 */
  860. /***/ (function(module, exports, __webpack_require__) {
  861. 'use strict';
  862. var _interopRequireDefault = __webpack_require__(2)['default'];
  863. exports.__esModule = true;
  864. exports.registerDefaultDecorators = registerDefaultDecorators;
  865. var _decoratorsInline = __webpack_require__(30);
  866. var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
  867. function registerDefaultDecorators(instance) {
  868. _decoratorsInline2['default'](instance);
  869. }
  870. /***/ }),
  871. /* 30 */
  872. /***/ (function(module, exports, __webpack_require__) {
  873. 'use strict';
  874. exports.__esModule = true;
  875. var _utils = __webpack_require__(4);
  876. exports['default'] = function (instance) {
  877. instance.registerDecorator('inline', function (fn, props, container, options) {
  878. var ret = fn;
  879. if (!props.partials) {
  880. props.partials = {};
  881. ret = function (context, options) {
  882. // Create a new partials stack frame prior to exec.
  883. var original = container.partials;
  884. container.partials = _utils.extend({}, original, props.partials);
  885. var ret = fn(context, options);
  886. container.partials = original;
  887. return ret;
  888. };
  889. }
  890. props.partials[options.args[0]] = options.fn;
  891. return ret;
  892. });
  893. };
  894. module.exports = exports['default'];
  895. /***/ }),
  896. /* 31 */
  897. /***/ (function(module, exports, __webpack_require__) {
  898. 'use strict';
  899. exports.__esModule = true;
  900. var _utils = __webpack_require__(4);
  901. var logger = {
  902. methodMap: ['debug', 'info', 'warn', 'error'],
  903. level: 'info',
  904. // Maps a given level value to the `methodMap` indexes above.
  905. lookupLevel: function lookupLevel(level) {
  906. if (typeof level === 'string') {
  907. var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
  908. if (levelMap >= 0) {
  909. level = levelMap;
  910. } else {
  911. level = parseInt(level, 10);
  912. }
  913. }
  914. return level;
  915. },
  916. // Can be overridden in the host environment
  917. log: function log(level) {
  918. level = logger.lookupLevel(level);
  919. if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
  920. var method = logger.methodMap[level];
  921. // eslint-disable-next-line no-console
  922. if (!console[method]) {
  923. method = 'log';
  924. }
  925. for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  926. message[_key - 1] = arguments[_key];
  927. }
  928. console[method].apply(console, message); // eslint-disable-line no-console
  929. }
  930. }
  931. };
  932. exports['default'] = logger;
  933. module.exports = exports['default'];
  934. /***/ }),
  935. /* 32 */
  936. /***/ (function(module, exports, __webpack_require__) {
  937. 'use strict';
  938. var _Object$create = __webpack_require__(33)['default'];
  939. var _Object$keys = __webpack_require__(12)['default'];
  940. var _interopRequireWildcard = __webpack_require__(1)['default'];
  941. exports.__esModule = true;
  942. exports.createProtoAccessControl = createProtoAccessControl;
  943. exports.resultIsAllowed = resultIsAllowed;
  944. exports.resetLoggedProperties = resetLoggedProperties;
  945. var _createNewLookupObject = __webpack_require__(35);
  946. var _logger = __webpack_require__(31);
  947. var logger = _interopRequireWildcard(_logger);
  948. var loggedProperties = _Object$create(null);
  949. function createProtoAccessControl(runtimeOptions) {
  950. var defaultMethodWhiteList = _Object$create(null);
  951. defaultMethodWhiteList['constructor'] = false;
  952. defaultMethodWhiteList['__defineGetter__'] = false;
  953. defaultMethodWhiteList['__defineSetter__'] = false;
  954. defaultMethodWhiteList['__lookupGetter__'] = false;
  955. var defaultPropertyWhiteList = _Object$create(null);
  956. // eslint-disable-next-line no-proto
  957. defaultPropertyWhiteList['__proto__'] = false;
  958. return {
  959. properties: {
  960. whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
  961. defaultValue: runtimeOptions.allowProtoPropertiesByDefault
  962. },
  963. methods: {
  964. whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
  965. defaultValue: runtimeOptions.allowProtoMethodsByDefault
  966. }
  967. };
  968. }
  969. function resultIsAllowed(result, protoAccessControl, propertyName) {
  970. if (typeof result === 'function') {
  971. return checkWhiteList(protoAccessControl.methods, propertyName);
  972. } else {
  973. return checkWhiteList(protoAccessControl.properties, propertyName);
  974. }
  975. }
  976. function checkWhiteList(protoAccessControlForType, propertyName) {
  977. if (protoAccessControlForType.whitelist[propertyName] !== undefined) {
  978. return protoAccessControlForType.whitelist[propertyName] === true;
  979. }
  980. if (protoAccessControlForType.defaultValue !== undefined) {
  981. return protoAccessControlForType.defaultValue;
  982. }
  983. logUnexpecedPropertyAccessOnce(propertyName);
  984. return false;
  985. }
  986. function logUnexpecedPropertyAccessOnce(propertyName) {
  987. if (loggedProperties[propertyName] !== true) {
  988. loggedProperties[propertyName] = true;
  989. logger.log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
  990. }
  991. }
  992. function resetLoggedProperties() {
  993. _Object$keys(loggedProperties).forEach(function (propertyName) {
  994. delete loggedProperties[propertyName];
  995. });
  996. }
  997. /***/ }),
  998. /* 33 */
  999. /***/ (function(module, exports, __webpack_require__) {
  1000. module.exports = { "default": __webpack_require__(34), __esModule: true };
  1001. /***/ }),
  1002. /* 34 */
  1003. /***/ (function(module, exports, __webpack_require__) {
  1004. var $ = __webpack_require__(8);
  1005. module.exports = function create(P, D){
  1006. return $.create(P, D);
  1007. };
  1008. /***/ }),
  1009. /* 35 */
  1010. /***/ (function(module, exports, __webpack_require__) {
  1011. 'use strict';
  1012. var _Object$create = __webpack_require__(33)['default'];
  1013. exports.__esModule = true;
  1014. exports.createNewLookupObject = createNewLookupObject;
  1015. var _utils = __webpack_require__(4);
  1016. /**
  1017. * Create a new object with "null"-prototype to avoid truthy results on prototype properties.
  1018. * The resulting object can be used with "object[property]" to check if a property exists
  1019. * @param {...object} sources a varargs parameter of source objects that will be merged
  1020. * @returns {object}
  1021. */
  1022. function createNewLookupObject() {
  1023. for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
  1024. sources[_key] = arguments[_key];
  1025. }
  1026. return _utils.extend.apply(undefined, [_Object$create(null)].concat(sources));
  1027. }
  1028. /***/ }),
  1029. /* 36 */
  1030. /***/ (function(module, exports) {
  1031. // Build out our basic SafeString type
  1032. 'use strict';
  1033. exports.__esModule = true;
  1034. function SafeString(string) {
  1035. this.string = string;
  1036. }
  1037. SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
  1038. return '' + this.string;
  1039. };
  1040. exports['default'] = SafeString;
  1041. module.exports = exports['default'];
  1042. /***/ }),
  1043. /* 37 */
  1044. /***/ (function(module, exports, __webpack_require__) {
  1045. 'use strict';
  1046. var _Object$seal = __webpack_require__(38)['default'];
  1047. var _Object$keys = __webpack_require__(12)['default'];
  1048. var _interopRequireWildcard = __webpack_require__(1)['default'];
  1049. var _interopRequireDefault = __webpack_require__(2)['default'];
  1050. exports.__esModule = true;
  1051. exports.checkRevision = checkRevision;
  1052. exports.template = template;
  1053. exports.wrapProgram = wrapProgram;
  1054. exports.resolvePartial = resolvePartial;
  1055. exports.invokePartial = invokePartial;
  1056. exports.noop = noop;
  1057. var _utils = __webpack_require__(4);
  1058. var Utils = _interopRequireWildcard(_utils);
  1059. var _exception = __webpack_require__(5);
  1060. var _exception2 = _interopRequireDefault(_exception);
  1061. var _base = __webpack_require__(3);
  1062. var _helpers = __webpack_require__(9);
  1063. var _internalWrapHelper = __webpack_require__(42);
  1064. var _internalProtoAccess = __webpack_require__(32);
  1065. function checkRevision(compilerInfo) {
  1066. var compilerRevision = compilerInfo && compilerInfo[0] || 1,
  1067. currentRevision = _base.COMPILER_REVISION;
  1068. if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {
  1069. return;
  1070. }
  1071. if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
  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. function template(templateSpec, env) {
  1081. /* istanbul ignore next */
  1082. if (!env) {
  1083. throw new _exception2['default']('No environment passed to template');
  1084. }
  1085. if (!templateSpec || !templateSpec.main) {
  1086. throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
  1087. }
  1088. templateSpec.main.decorator = templateSpec.main_d;
  1089. // Note: Using env.VM references rather than local var references throughout this section to allow
  1090. // for external users to override these as pseudo-supported APIs.
  1091. env.VM.checkRevision(templateSpec.compiler);
  1092. // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)
  1093. var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
  1094. function invokePartialWrapper(partial, context, options) {
  1095. if (options.hash) {
  1096. context = Utils.extend({}, context, options.hash);
  1097. if (options.ids) {
  1098. options.ids[0] = true;
  1099. }
  1100. }
  1101. partial = env.VM.resolvePartial.call(this, partial, context, options);
  1102. var extendedOptions = Utils.extend({}, options, {
  1103. hooks: this.hooks,
  1104. protoAccessControl: this.protoAccessControl
  1105. });
  1106. var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
  1107. if (result == null && env.compile) {
  1108. options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
  1109. result = options.partials[options.name](context, extendedOptions);
  1110. }
  1111. if (result != null) {
  1112. if (options.indent) {
  1113. var lines = result.split('\n');
  1114. for (var i = 0, l = lines.length; i < l; i++) {
  1115. if (!lines[i] && i + 1 === l) {
  1116. break;
  1117. }
  1118. lines[i] = options.indent + lines[i];
  1119. }
  1120. result = lines.join('\n');
  1121. }
  1122. return result;
  1123. } else {
  1124. throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
  1125. }
  1126. }
  1127. // Just add water
  1128. var container = {
  1129. strict: function strict(obj, name, loc) {
  1130. if (!obj || !(name in obj)) {
  1131. throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
  1132. loc: loc
  1133. });
  1134. }
  1135. return container.lookupProperty(obj, name);
  1136. },
  1137. lookupProperty: function lookupProperty(parent, propertyName) {
  1138. var result = parent[propertyName];
  1139. if (result == null) {
  1140. return result;
  1141. }
  1142. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  1143. return result;
  1144. }
  1145. if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
  1146. return result;
  1147. }
  1148. return undefined;
  1149. },
  1150. lookup: function lookup(depths, name) {
  1151. var len = depths.length;
  1152. for (var i = 0; i < len; i++) {
  1153. var result = depths[i] && container.lookupProperty(depths[i], name);
  1154. if (result != null) {
  1155. return depths[i][name];
  1156. }
  1157. }
  1158. },
  1159. lambda: function lambda(current, context) {
  1160. return typeof current === 'function' ? current.call(context) : current;
  1161. },
  1162. escapeExpression: Utils.escapeExpression,
  1163. invokePartial: invokePartialWrapper,
  1164. fn: function fn(i) {
  1165. var ret = templateSpec[i];
  1166. ret.decorator = templateSpec[i + '_d'];
  1167. return ret;
  1168. },
  1169. programs: [],
  1170. program: function program(i, data, declaredBlockParams, blockParams, depths) {
  1171. var programWrapper = this.programs[i],
  1172. fn = this.fn(i);
  1173. if (data || depths || blockParams || declaredBlockParams) {
  1174. programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
  1175. } else if (!programWrapper) {
  1176. programWrapper = this.programs[i] = wrapProgram(this, i, fn);
  1177. }
  1178. return programWrapper;
  1179. },
  1180. data: function data(value, depth) {
  1181. while (value && depth--) {
  1182. value = value._parent;
  1183. }
  1184. return value;
  1185. },
  1186. mergeIfNeeded: function mergeIfNeeded(param, common) {
  1187. var obj = param || common;
  1188. if (param && common && param !== common) {
  1189. obj = Utils.extend({}, common, param);
  1190. }
  1191. return obj;
  1192. },
  1193. // An empty object to use as replacement for null-contexts
  1194. nullContext: _Object$seal({}),
  1195. noop: env.VM.noop,
  1196. compilerInfo: templateSpec.compiler
  1197. };
  1198. function ret(context) {
  1199. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  1200. var data = options.data;
  1201. ret._setup(options);
  1202. if (!options.partial && templateSpec.useData) {
  1203. data = initData(context, data);
  1204. }
  1205. var depths = undefined,
  1206. blockParams = templateSpec.useBlockParams ? [] : undefined;
  1207. if (templateSpec.useDepths) {
  1208. if (options.depths) {
  1209. depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
  1210. } else {
  1211. depths = [context];
  1212. }
  1213. }
  1214. function main(context /*, options*/) {
  1215. return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
  1216. }
  1217. main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
  1218. return main(context, options);
  1219. }
  1220. ret.isTop = true;
  1221. ret._setup = function (options) {
  1222. if (!options.partial) {
  1223. var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
  1224. wrapHelpersToPassLookupProperty(mergedHelpers, container);
  1225. container.helpers = mergedHelpers;
  1226. if (templateSpec.usePartial) {
  1227. // Use mergeIfNeeded here to prevent compiling global partials multiple times
  1228. container.partials = container.mergeIfNeeded(options.partials, env.partials);
  1229. }
  1230. if (templateSpec.usePartial || templateSpec.useDecorators) {
  1231. container.decorators = Utils.extend({}, env.decorators, options.decorators);
  1232. }
  1233. container.hooks = {};
  1234. container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
  1235. var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
  1236. _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
  1237. _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
  1238. } else {
  1239. container.protoAccessControl = options.protoAccessControl; // internal option
  1240. container.helpers = options.helpers;
  1241. container.partials = options.partials;
  1242. container.decorators = options.decorators;
  1243. container.hooks = options.hooks;
  1244. }
  1245. };
  1246. ret._child = function (i, data, blockParams, depths) {
  1247. if (templateSpec.useBlockParams && !blockParams) {
  1248. throw new _exception2['default']('must pass block params');
  1249. }
  1250. if (templateSpec.useDepths && !depths) {
  1251. throw new _exception2['default']('must pass parent depths');
  1252. }
  1253. return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
  1254. };
  1255. return ret;
  1256. }
  1257. function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
  1258. function prog(context) {
  1259. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  1260. var currentDepths = depths;
  1261. if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
  1262. currentDepths = [context].concat(depths);
  1263. }
  1264. return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
  1265. }
  1266. prog = executeDecorators(fn, prog, container, depths, data, blockParams);
  1267. prog.program = i;
  1268. prog.depth = depths ? depths.length : 0;
  1269. prog.blockParams = declaredBlockParams || 0;
  1270. return prog;
  1271. }
  1272. /**
  1273. * This is currently part of the official API, therefore implementation details should not be changed.
  1274. */
  1275. function resolvePartial(partial, context, options) {
  1276. if (!partial) {
  1277. if (options.name === '@partial-block') {
  1278. partial = options.data['partial-block'];
  1279. } else {
  1280. partial = options.partials[options.name];
  1281. }
  1282. } else if (!partial.call && !options.name) {
  1283. // This is a dynamic partial that returned a string
  1284. options.name = partial;
  1285. partial = options.partials[partial];
  1286. }
  1287. return partial;
  1288. }
  1289. function invokePartial(partial, context, options) {
  1290. // Use the current closure context to save the partial-block if this partial
  1291. var currentPartialBlock = options.data && options.data['partial-block'];
  1292. options.partial = true;
  1293. if (options.ids) {
  1294. options.data.contextPath = options.ids[0] || options.data.contextPath;
  1295. }
  1296. var partialBlock = undefined;
  1297. if (options.fn && options.fn !== noop) {
  1298. (function () {
  1299. options.data = _base.createFrame(options.data);
  1300. // Wrapper function to get access to currentPartialBlock from the closure
  1301. var fn = options.fn;
  1302. partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
  1303. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  1304. // Restore the partial-block from the closure for the execution of the block
  1305. // i.e. the part inside the block of the partial call.
  1306. options.data = _base.createFrame(options.data);
  1307. options.data['partial-block'] = currentPartialBlock;
  1308. return fn(context, options);
  1309. };
  1310. if (fn.partials) {
  1311. options.partials = Utils.extend({}, options.partials, fn.partials);
  1312. }
  1313. })();
  1314. }
  1315. if (partial === undefined && partialBlock) {
  1316. partial = partialBlock;
  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. function noop() {
  1325. return '';
  1326. }
  1327. function initData(context, data) {
  1328. if (!data || !('root' in data)) {
  1329. data = data ? _base.createFrame(data) : {};
  1330. data.root = context;
  1331. }
  1332. return data;
  1333. }
  1334. function executeDecorators(fn, prog, container, depths, data, blockParams) {
  1335. if (fn.decorator) {
  1336. var props = {};
  1337. prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
  1338. Utils.extend(prog, props);
  1339. }
  1340. return prog;
  1341. }
  1342. function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
  1343. _Object$keys(mergedHelpers).forEach(function (helperName) {
  1344. var helper = mergedHelpers[helperName];
  1345. mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
  1346. });
  1347. }
  1348. function passLookupPropertyOption(helper, container) {
  1349. var lookupProperty = container.lookupProperty;
  1350. return _internalWrapHelper.wrapHelper(helper, function (options) {
  1351. return Utils.extend({ lookupProperty: lookupProperty }, options);
  1352. });
  1353. }
  1354. /***/ }),
  1355. /* 38 */
  1356. /***/ (function(module, exports, __webpack_require__) {
  1357. module.exports = { "default": __webpack_require__(39), __esModule: true };
  1358. /***/ }),
  1359. /* 39 */
  1360. /***/ (function(module, exports, __webpack_require__) {
  1361. __webpack_require__(40);
  1362. module.exports = __webpack_require__(20).Object.seal;
  1363. /***/ }),
  1364. /* 40 */
  1365. /***/ (function(module, exports, __webpack_require__) {
  1366. // 19.1.2.17 Object.seal(O)
  1367. var isObject = __webpack_require__(41);
  1368. __webpack_require__(17)('seal', function($seal){
  1369. return function seal(it){
  1370. return $seal && isObject(it) ? $seal(it) : it;
  1371. };
  1372. });
  1373. /***/ }),
  1374. /* 41 */
  1375. /***/ (function(module, exports) {
  1376. module.exports = function(it){
  1377. return typeof it === 'object' ? it !== null : typeof it === 'function';
  1378. };
  1379. /***/ }),
  1380. /* 42 */
  1381. /***/ (function(module, exports) {
  1382. 'use strict';
  1383. exports.__esModule = true;
  1384. exports.wrapHelper = wrapHelper;
  1385. function wrapHelper(helper, transformOptionsFn) {
  1386. if (typeof helper !== 'function') {
  1387. // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639
  1388. // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.
  1389. return helper;
  1390. }
  1391. var wrapper = function wrapper() /* dynamic arguments */{
  1392. var options = arguments[arguments.length - 1];
  1393. arguments[arguments.length - 1] = transformOptionsFn(options);
  1394. return helper.apply(this, arguments);
  1395. };
  1396. return wrapper;
  1397. }
  1398. /***/ }),
  1399. /* 43 */
  1400. /***/ (function(module, exports) {
  1401. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  1402. exports.__esModule = true;
  1403. exports['default'] = function (Handlebars) {
  1404. /* istanbul ignore next */
  1405. var root = typeof global !== 'undefined' ? global : window,
  1406. $Handlebars = root.Handlebars;
  1407. /* istanbul ignore next */
  1408. Handlebars.noConflict = function () {
  1409. if (root.Handlebars === Handlebars) {
  1410. root.Handlebars = $Handlebars;
  1411. }
  1412. return Handlebars;
  1413. };
  1414. };
  1415. module.exports = exports['default'];
  1416. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  1417. /***/ })
  1418. /******/ ])
  1419. });
  1420. ;