diff --git a/dist/redoc.js b/dist/redoc.js index 4419013a..a7e38ee9 100644 --- a/dist/redoc.js +++ b/dist/redoc.js @@ -1322,6 +1322,174 @@ catch(e){window.attachEvent('onload', $buo_f);} exports.patchTimer = patchTimer; +/***/ } +/******/ ]); +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports) { + + 'use strict'; + (function () { + var NEWLINE = '\n'; + var SEP = ' ------------- '; + var IGNORE_FRAMES = []; + var creationTrace = '__creationTrace__'; + var LongStackTrace = (function () { + function LongStackTrace() { + this.error = getStacktrace(); + this.timestamp = new Date(); + } + return LongStackTrace; + }()); + function getStacktraceWithUncaughtError() { + return new Error('STACKTRACE TRACKING'); + } + function getStacktraceWithCaughtError() { + try { + throw getStacktraceWithUncaughtError(); + } + catch (e) { + return e; + } + } + // Some implementations of exception handling don't create a stack trace if the exception + // isn't thrown, however it's faster not to actually throw the exception. + var error = getStacktraceWithUncaughtError(); + var coughtError = getStacktraceWithCaughtError(); + var getStacktrace = error.stack + ? getStacktraceWithUncaughtError + : (coughtError.stack ? getStacktraceWithCaughtError : getStacktraceWithUncaughtError); + function getFrames(error) { + return error.stack ? error.stack.split(NEWLINE) : []; + } + function addErrorStack(lines, error) { + var trace = getFrames(error); + for (var i = 0; i < trace.length; i++) { + var frame = trace[i]; + // Filter out the Frames which are part of stack capturing. + if (!(i < IGNORE_FRAMES.length && IGNORE_FRAMES[i] === frame)) { + lines.push(trace[i]); + } + } + } + function renderLongStackTrace(frames, stack) { + var longTrace = [stack]; + if (frames) { + var timestamp = new Date().getTime(); + for (var i = 0; i < frames.length; i++) { + var traceFrames = frames[i]; + var lastTime = traceFrames.timestamp; + longTrace.push(SEP + " Elapsed: " + (timestamp - lastTime.getTime()) + " ms; At: " + lastTime + " " + SEP); + addErrorStack(longTrace, traceFrames.error); + timestamp = lastTime.getTime(); + } + } + return longTrace.join(NEWLINE); + } + Zone['longStackTraceZoneSpec'] = { + name: 'long-stack-trace', + longStackTraceLimit: 10, + onScheduleTask: function (parentZoneDelegate, currentZone, targetZone, task) { + var currentTask = Zone.currentTask; + var trace = currentTask && currentTask.data && currentTask.data[creationTrace] || []; + trace = [new LongStackTrace()].concat(trace); + if (trace.length > this.longStackTraceLimit) { + trace.length = this.longStackTraceLimit; + } + if (!task.data) + task.data = {}; + task.data[creationTrace] = trace; + return parentZoneDelegate.scheduleTask(targetZone, task); + }, + onHandleError: function (parentZoneDelegate, currentZone, targetZone, error) { + var parentTask = Zone.currentTask; + if (error instanceof Error && parentTask) { + var descriptor = Object.getOwnPropertyDescriptor(error, 'stack'); + if (descriptor) { + var delegateGet_1 = descriptor.get; + var value_1 = descriptor.value; + descriptor = { + get: function () { + return renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], delegateGet_1 ? delegateGet_1.apply(this) : value_1); + } + }; + Object.defineProperty(error, 'stack', descriptor); + } + else { + error.stack = renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], error.stack); + } + } + return parentZoneDelegate.handleError(targetZone, error); + } + }; + function captureStackTraces(stackTraces, count) { + if (count > 0) { + stackTraces.push(getFrames((new LongStackTrace()).error)); + captureStackTraces(stackTraces, count - 1); + } + } + function computeIgnoreFrames() { + var frames = []; + captureStackTraces(frames, 2); + var frames1 = frames[0]; + var frames2 = frames[1]; + for (var i = 0; i < frames1.length; i++) { + var frame1 = frames1[i]; + var frame2 = frames2[i]; + if (frame1 === frame2) { + IGNORE_FRAMES.push(frame1); + } + else { + break; + } + } + } + computeIgnoreFrames(); + })(); + + /***/ } /******/ ]); /*! ***************************************************************************** @@ -6702,1747 +6870,17 @@ module.exports = _dereq_(17); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}]},{},[1]); -!function(e){function r(e,r,o){return 4===arguments.length?t.apply(this,arguments):void n(e,{declarative:!0,deps:r,declare:o})}function t(e,r,t,o){n(e,{declarative:!1,deps:r,executingRequire:t,execute:o})}function n(e,r){r.name=e,e in p||(p[e]=r),r.normalizedDeps=r.deps}function o(e,r){if(r[e.groupIndex]=r[e.groupIndex]||[],-1==v.call(r[e.groupIndex],e)){r[e.groupIndex].push(e);for(var t=0,n=e.normalizedDeps.length;n>t;t++){var a=e.normalizedDeps[t],u=p[a];if(u&&!u.evaluated){var d=e.groupIndex+(u.declarative!=e.declarative);if(void 0===u.groupIndex||u.groupIndex=0;a--){for(var u=t[a],i=0;ia;a++){var d=t.importers[a];if(!d.locked)for(var i=0;ia;a++){var l,s=r.normalizedDeps[a],c=p[s],v=x[s];v?l=v.exports:c&&!c.declarative?l=c.esModule:c?(d(c),v=c.module,l=v.exports):l=f(s),v&&v.importers?(v.importers.push(t),t.dependencies.push(v)):t.dependencies.push(null),t.setters[a]&&t.setters[a](l)}}}function i(e){var r,t=p[e];if(t)t.declarative?c(e,[]):t.evaluated||l(t),r=t.module.exports;else if(r=f(e),!r)throw new Error("Unable to load dependency "+e+".");return(!t||t.declarative)&&r&&r.__useDefault?r["default"]:r}function l(r){if(!r.module){var t={},n=r.module={exports:t,id:r.name};if(!r.executingRequire)for(var o=0,a=r.normalizedDeps.length;a>o;o++){var u=r.normalizedDeps[o],d=p[u];d&&l(d)}r.evaluated=!0;var c=r.execute.call(e,function(e){for(var t=0,n=r.deps.length;n>t;t++)if(r.deps[t]==e)return i(r.normalizedDeps[t]);throw new TypeError("Module "+e+" not declared as a dependency.")},t,n);c&&(n.exports=c),t=n.exports,t&&t.__esModule?r.esModule=t:r.esModule=s(t)}}function s(r){if(r===e)return r;var t={};if("object"==typeof r||"function"==typeof r)if(g){var n;for(var o in r)(n=Object.getOwnPropertyDescriptor(r,o))&&h(t,o,n)}else{var a=r&&r.hasOwnProperty;for(var o in r)(!a||r.hasOwnProperty(o))&&(t[o]=r[o])}return t["default"]=r,h(t,"__useDefault",{value:!0}),t}function c(r,t){var n=p[r];if(n&&!n.evaluated&&n.declarative){t.push(r);for(var o=0,a=n.normalizedDeps.length;a>o;o++){var u=n.normalizedDeps[o];-1==v.call(t,u)&&(p[u]?c(u,t):f(u))}n.evaluated||(n.evaluated=!0,n.module.execute.call(e))}}function f(e){if(D[e])return D[e];if("@node/"==e.substr(0,6))return y(e.substr(6));var r=p[e];if(!r)throw"Module "+e+" not present.";return a(e),c(e,[]),p[e]=void 0,r.declarative&&h(r.module.exports,"__esModule",{value:!0}),D[e]=r.declarative?r.module.exports:r.esModule}var p={},v=Array.prototype.indexOf||function(e){for(var r=0,t=this.length;t>r;r++)if(this[r]===e)return r;return-1},g=!0;try{Object.getOwnPropertyDescriptor({a:0},"a")}catch(m){g=!1}var h;!function(){try{Object.defineProperty({},"a",{})&&(h=Object.defineProperty)}catch(e){h=function(e,r,t){try{e[r]=t.value||t.get.call(e)}catch(n){}}}}();var x={},y="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&require.resolve&&"undefined"!=typeof process&&require,D={"@empty":{}};return function(e,n,o){return function(a){a(function(a){for(var u={_nodeRequire:y,register:r,registerDynamic:t,get:f,set:function(e,r){D[e]=r},newModule:function(e){return e}},d=0;d1)for(var d=1;dt;t++){var a=e.normalizedDeps[t],u=g[a];if(u&&!u.evaluated){var d=e.groupIndex+(u.declarative!=e.declarative);if(void 0===u.groupIndex||u.groupIndex=0;a--){for(var u=t[a],i=0;ia;a++){var d=t.importers[a];if(!d.locked)for(var i=0;ia;a++){var l,s=r.normalizedDeps[a],c=g[s],f=D[s];f?l=f.exports:c&&!c.declarative?l=c.esModule:c?(d(c),f=c.module,l=f.exports):l=v(s),f&&f.importers?(f.importers.push(t),t.dependencies.push(f)):t.dependencies.push(null),t.setters[a]&&t.setters[a](l)}}}function i(e){var r,t=g[e];if(t)t.declarative?p(e,[]):t.evaluated||l(t),r=t.module.exports;else if(r=v(e),!r)throw new Error("Unable to load dependency "+e+".");return(!t||t.declarative)&&r&&r.__useDefault?r["default"]:r}function l(r){if(!r.module){var t={},n=r.module={exports:t,id:r.name};if(!r.executingRequire)for(var o=0,a=r.normalizedDeps.length;a>o;o++){var u=r.normalizedDeps[o],d=g[u];d&&l(d)}r.evaluated=!0;var c=r.execute.call(e,function(e){for(var t=0,n=r.deps.length;n>t;t++)if(r.deps[t]==e)return i(r.normalizedDeps[t]);throw new TypeError("Module "+e+" not declared as a dependency.")},t,n);c&&(n.exports=c),t=n.exports,t&&t.__esModule?r.esModule=t:r.esModule=s(t)}}function s(e){var r={};if("object"==typeof e||"function"==typeof e){var t=e&&e.hasOwnProperty;if(h)for(var n in e)f(r,e,n)||c(r,e,n,t);else for(var n in e)c(r,e,n,t)}return r["default"]=e,y(r,"__useDefault",{value:!0}),r}function c(e,r,t,n){(!n||r.hasOwnProperty(t))&&(e[t]=r[t])}function f(e,r,t){try{var n;return(n=Object.getOwnPropertyDescriptor(r,t))&&y(e,t,n),!0}catch(o){return!1}}function p(r,t){var n=g[r];if(n&&!n.evaluated&&n.declarative){t.push(r);for(var o=0,a=n.normalizedDeps.length;a>o;o++){var u=n.normalizedDeps[o];-1==m.call(t,u)&&(g[u]?p(u,t):v(u))}n.evaluated||(n.evaluated=!0,n.module.execute.call(e))}}function v(e){if(I[e])return I[e];if("@node/"==e.substr(0,6))return _(e.substr(6));var r=g[e];if(!r)throw"Module "+e+" not present.";return a(e),p(e,[]),g[e]=void 0,r.declarative&&y(r.module.exports,"__esModule",{value:!0}),I[e]=r.declarative?r.module.exports:r.esModule}var g={},m=Array.prototype.indexOf||function(e){for(var r=0,t=this.length;t>r;r++)if(this[r]===e)return r;return-1},h=!0;try{Object.getOwnPropertyDescriptor({a:0},"a")}catch(x){h=!1}var y;!function(){try{Object.defineProperty({},"a",{})&&(y=Object.defineProperty)}catch(e){y=function(e,r,t){try{e[r]=t.value||t.get.call(e)}catch(n){}}}}();var D={},_="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&require.resolve&&"undefined"!=typeof process&&require,I={"@empty":{}};return function(e,n,o){return function(a){a(function(a){for(var u={_nodeRequire:_,register:r,registerDynamic:t,get:v,set:function(e,r){I[e]=r},newModule:function(e){return e}},d=0;d1)for(var d=1;dn;n++)if(this[n]===e)return n;return-1},l=["_g","sessionStorage","localStorage","clipboardData","frames","frameElement","external","mozAnimationStartTime","webkitStorageInfo","webkitIndexedDB"];i.set("@@global-helpers",i.newModule({prepareGlobal:function(t,i,f){var a=e.define;e.define=void 0,e.exports=void 0,e.module&&e.module.exports&&(e.module=void 0);var l;if(f){l={};for(var u in f)l[u]=e[u],e[u]=f[u]}return i||(o={},r(function(e,n){o[e]=n})),function(){var t;if(i)t=n(i,e);else{var f,u,s={};r(function(e,n){o[e]!==n&&"undefined"!=typeof n&&(s[e]=n,"undefined"!=typeof f?u||f===n||(u=!0):f=n)}),t=u?s:f}if(l)for(var c in l)e[c]=l[c];return e.define=a,t}}}))}("undefined"!=typeof self?self:global); -!function(){var t=$__System;if("undefined"!=typeof window&&"undefined"!=typeof document&&window.location)var s=location.protocol+"//"+location.hostname+(location.port?":"+location.port:"");t.set("@@cjs-helpers",t.newModule({getPathVars:function(t){var n,o=t.lastIndexOf("!");n=-1!=o?t.substr(0,o):t;var e=n.split("/");return e.pop(),e=e.join("/"),"file:///"==n.substr(0,8)?(n=n.substr(7),e=e.substr(7),isWindows&&(n=n.substr(1),e=e.substr(1))):s&&n.substr(0,s.length)===s&&(n=n.substr(s.length),e=e.substr(s.length)),{filename:n,dirname:e}}}))}(); -$__System.registerDynamic("2", [], true, function($__require, exports, module) { - ; - var global = this, - __define = global.define; - global.define = undefined; - ; - (function() { - var parents = function(node, ps) { - if (node.parentNode === null) { - return ps; - } - return parents(node.parentNode, ps.concat([node])); - }; - var style = function(node, prop) { - return getComputedStyle(node, null).getPropertyValue(prop); - }; - var overflow = function(node) { - return style(node, "overflow") + style(node, "overflow-y") + style(node, "overflow-x"); - }; - var scroll = function(node) { - return (/(auto|scroll)/).test(overflow(node)); - }; - var scrollParent = function(node) { - if (!(node instanceof HTMLElement)) { - return; - } - var ps = parents(node.parentNode, []); - for (var i = 0; i < ps.length; i += 1) { - if (scroll(ps[i])) { - return ps[i]; - } - } - return window; - }; - if (typeof module === "object" && module !== null) { - module.exports = scrollParent; - } else { - window.Scrollparent = scrollParent; - } - })(); - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("3", ["2"], true, function($__require, exports, module) { - ; - var global = this, - __define = global.define; - global.define = undefined; - module.exports = $__require('2'); - global.define = __define; - return module.exports; -}); - -$__System.register('4', ['5', '6', '7', '8', '9', 'a'], function (_export) { - var SchemaManager, RedocComponent, BaseComponent, OptionsManager, _get, _inherits, _createClass, _classCallCheck, ApiInfo; - - return { - setters: [function (_4) { - SchemaManager = _4.SchemaManager; - RedocComponent = _4.RedocComponent; - BaseComponent = _4.BaseComponent; - }, function (_5) { - OptionsManager = _5['default']; - }, function (_) { - _get = _['default']; - }, function (_2) { - _inherits = _2['default']; - }, function (_3) { - _createClass = _3['default']; - }, function (_a) { - _classCallCheck = _a['default']; - }], - execute: function () { - 'use strict'; - - ApiInfo = (function (_BaseComponent) { - _inherits(ApiInfo, _BaseComponent); - - function ApiInfo(schemaMgr, optionsMgr) { - _classCallCheck(this, _ApiInfo); - - _get(Object.getPrototypeOf(_ApiInfo.prototype), 'constructor', this).call(this, schemaMgr); - this.optionsMgr = optionsMgr; - } - - _createClass(ApiInfo, [{ - key: 'prepareModel', - value: function prepareModel() { - this.data = this.componentSchema.info; - this.specUrl = this.optionsMgr.options.specUrl; - } - }]); - - var _ApiInfo = ApiInfo; - ApiInfo = Reflect.metadata('parameters', [[SchemaManager], [OptionsManager]])(ApiInfo) || ApiInfo; - ApiInfo = RedocComponent({ - selector: 'api-info', - styles: ['\n .api-info-header{font-weight:normal}:host>div{width:60%}a.openapi-button{padding:3px 8px 4px 8px;color:#0033a0;border:1px solid #0033a0;margin-left:0.5em;font-weight:normal}\n '], - template: '\n
\n

{{data.title}} ({{data.version}})

\n

\n

\n \n Contact:\n \n {{data.contact.name || data.contact.url}}\n \n {{data.contact.email}}\n \n License:\n {{data.license.name}} \n {{data.license.name}} \n \n

\n

\n Download OpenAPI (fka Swagger) specification:\n Download \n

\n
\n ' - })(ApiInfo) || ApiInfo; - return ApiInfo; - })(BaseComponent); - - _export('default', ApiInfo); - } - }; -}); -$__System.register('b', ['5', '7', '8', '9', 'a'], function (_export) { - var RedocComponent, BaseComponent, _get, _inherits, _createClass, _classCallCheck, ApiLogo; - - return { - setters: [function (_4) { - RedocComponent = _4.RedocComponent; - BaseComponent = _4.BaseComponent; - }, function (_) { - _get = _['default']; - }, function (_2) { - _inherits = _2['default']; - }, function (_3) { - _createClass = _3['default']; - }, function (_a) { - _classCallCheck = _a['default']; - }], - execute: function () { - 'use strict'; - - ApiLogo = (function (_BaseComponent) { - _inherits(ApiLogo, _BaseComponent); - - function ApiLogo(schemaMgr) { - _classCallCheck(this, _ApiLogo); - - _get(Object.getPrototypeOf(_ApiLogo.prototype), 'constructor', this).call(this, schemaMgr); - } - - _createClass(ApiLogo, [{ - key: 'prepareModel', - value: function prepareModel() { - this.data = {}; - var logoInfo = this.componentSchema.info['x-logo']; - if (!logoInfo) return; - this.data.imgUrl = logoInfo.url; - this.data.bgColor = logoInfo.backgroundColor || 'transparent'; - } - }]); - - var _ApiLogo = ApiLogo; - ApiLogo = RedocComponent({ - selector: 'api-logo', - styles: ['\n img{max-height:150px;width:auto;display:inline-block;max-width:100%;box-sizing:border-box}\n '], - template: '\n \n ' - })(ApiLogo) || ApiLogo; - return ApiLogo; - })(BaseComponent); - - _export('default', ApiLogo); - } - }; -}); -$__System.register('c', ['5', '7', '8', '9', 'a', 'f', 'd', 'e'], function (_export) { - var RedocComponent, BaseComponent, _get, _inherits, _createClass, _classCallCheck, _Object$keys, JsonSchema, JsonSchemaLazy, ParamsList; - - function safePush(obj, prop, item) { - if (!obj[prop]) obj[prop] = []; - obj[prop].push(item); - } - - return { - setters: [function (_4) { - RedocComponent = _4.RedocComponent; - BaseComponent = _4.BaseComponent; - }, function (_) { - _get = _['default']; - }, function (_2) { - _inherits = _2['default']; - }, function (_3) { - _createClass = _3['default']; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_f) { - _Object$keys = _f['default']; - }, function (_d) { - JsonSchema = _d['default']; - }, function (_e) { - JsonSchemaLazy = _e['default']; - }], - execute: function () { - 'use strict'; - - ParamsList = (function (_BaseComponent) { - _inherits(ParamsList, _BaseComponent); - - function ParamsList(schemaMgr) { - _classCallCheck(this, _ParamsList); - - _get(Object.getPrototypeOf(_ParamsList.prototype), 'constructor', this).call(this, schemaMgr); - } - - _createClass(ParamsList, [{ - key: 'prepareModel', - value: function prepareModel() { - this.data = {}; - var paramsList = this.schemaMgr.getMethodParams(this.pointer, true); - - paramsList = paramsList.map(function (paramData) { - var propPointer = paramData._pointer; - if (paramData['in'] === 'body') return paramData; - return JsonSchema.injectPropertyData(paramData, paramData.name, propPointer); - }); - - var paramsMap = this.orderParams(paramsList); - - if (paramsMap.body && paramsMap.body.length) { - var bodyParam = paramsMap.body[0]; - bodyParam.pointer = bodyParam._pointer; - this.data.bodyParam = bodyParam; - paramsMap.body = undefined; - } - - this.data.noParams = !(_Object$keys(paramsMap).length || this.data.bodyParam); - - var paramsPlaces = ['path', 'query', 'formData', 'header', 'body']; - var placeHint = { - path: 'Used together with Path Templating, where the parameter value is actually part\n of the operation\'s URL. This does not include the host or base path of the API.\n For example, in /items/{itemId}, the path parameter is itemId', - query: 'Parameters that are appended to the URL.\n For example, in /items?id=###, the query parameter is id', - formData: 'Parameters that are submitted through a form.\n application/x-www-form-urlencoded, multipart/form-data or both are usually\n used as the content type of the request', - header: 'Custom headers that are expected as part of the request' - }; - var params = []; - paramsPlaces.forEach(function (place) { - if (paramsMap[place] && paramsMap[place].length) { - params.push({ place: place, placeHint: placeHint[place], params: paramsMap[place] }); - } - }); - this.data.params = params; - } - }, { - key: 'orderParams', - value: function orderParams(params) { - var res = {}; - params.forEach(function (param) { - return safePush(res, param['in'], param); - }); - return res; - } - }]); - - var _ParamsList = ParamsList; - ParamsList = RedocComponent({ - selector: 'params-list', - template: '\n
Parameters
\n \n\n
\n
Request Body
\n\n
\n
\n
\n \n \n
\n
\n ', - styles: ['\n .param-list-header{border-bottom:1px solid rgba(38,50,56,0.3);padding:0.2em 0;margin:3.5em 0 .8em 0;color:rgba(38,50,56,0.5);font-weight:normal;text-transform:uppercase}.param-name{font-size:0.929em;padding:10px 0 10px 0;font-weight:400;box-sizing:border-box;line-height:20px;border-left:1px solid rgba(0,51,160,0.5);white-space:nowrap;position:relative;vertical-align:top}.param-name-content{padding-right:25px;display:inline-block;font-family:Montserrat,sans-serif}.param-info{padding:10px 0;box-sizing:border-box;border-bottom:1px solid #ccc;width:75%}.param-range{color:rgba(0,51,160,0.7);position:relative;top:1px;padding:0 4px;border-radius:2px;background-color:rgba(0,51,160,0.1);margin-left:6px}.param-description{font-size:13px}.param-required{color:red;font-weight:bold;font-size:12px;line-height:20px;vertical-align:middle}.param-type{color:rgba(38,50,56,0.4);font-size:0.929em;line-height:20px;vertical-align:middle;font-weight:normal}.param-type.array:before{content:"Array of ";color:#263238;font-weight:300}.param-type.with-hint{display:inline-block;margin-bottom:0.4em;border-bottom:1px dotted rgba(38,50,56,0.4);padding:0;cursor:help}.param-type-trivial{margin:10px 10px 0;display:inline-block}.param-name>span:before{content:"";display:inline-block;width:1px;height:7px;background-color:#0033a0;margin:0 10px;vertical-align:middle}.param-name>span:after{content:"";position:absolute;border-top:1px solid rgba(0,51,160,0.5);width:10px;left:0;top:21px}.param:first-of-type>.param-name:before{content:"";display:block;position:absolute;left:-1px;top:0;border-left:2px solid #fff;height:21px}.param:last-of-type>.param-name,.param.last>.param-name{position:relative}.param:last-of-type>.param-name:after,.param.last>.param-name:after{content:"";display:block;position:absolute;left:-2px;border-left:2px solid #fff;top:22px;background-color:white;bottom:0}.param-wrap:last-of-type>.param-schema{border-left-color:transparent}.param-schema .param-wrap:first-of-type .param-name:before{display:none !important}.param-schema.last>td{border-left:0}.param-enum{color:#263238;font-size:13px}.param-enum:before{content:"Values: {"}.param-enum:after{content:"}"}.param-enum>.enum-value:after{content:", "}.param-enum>.enum-value:last-of-type:after{content:none}header.paramType{margin:10px 0;text-transform:capitalize}.params-wrap{display:table;width:100%}.param-name{display:table-cell;vertical-align:top}.param-info{display:table-cell;width:100%}.param{display:table-row}.param:last-of-type>.param-name{border-left:0}.param:last-of-type>.param-name:after{content:"";display:block;position:absolute;left:0;border-left:1px solid rgba(0,51,160,0.5);height:21px;background-color:white;top:0}.param:first-of-type .param-name:after{content:"";display:block;position:absolute;left:-1px;border-left:2px solid #fff;height:20px;background-color:white;top:0}[data-hint]{width:1.2em;text-align:center;border-radius:50%;vertical-align:middle;color:#999;line-height:1.2;text-transform:none;cursor:help;border:1px solid #999;margin-left:0.5em}@media (max-width: 520px){[data-hint]{float:right}[data-hint]:after{margin-left:12px;transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);-webkit-transform:translateX(-100%) translateY(-8px)}}\n '], - directives: [JsonSchema, JsonSchemaLazy] - })(ParamsList) || ParamsList; - return ParamsList; - })(BaseComponent); - - _export('default', ParamsList); - } - }; -}); -$__System.register('10', ['5', '7', '8', '9', '11', '12', '13', '14', '15', '16', 'a'], function (_export) { - var RedocComponent, BaseComponent, SchemaManager, _get, _inherits, _createClass, JsonPointer, Tabs, Tab, SchemaSample, PrismPipe, redocEvents, ViewChildren, QueryList, ChangeDetectorRef, ChangeDetectionStrategy, _classCallCheck, RequestSamples; - - return { - setters: [function (_6) { - RedocComponent = _6.RedocComponent; - BaseComponent = _6.BaseComponent; - SchemaManager = _6.SchemaManager; - }, function (_2) { - _get = _2['default']; - }, function (_3) { - _inherits = _3['default']; - }, function (_4) { - _createClass = _4['default']; - }, function (_7) { - JsonPointer = _7['default']; - }, function (_8) { - Tabs = _8.Tabs; - Tab = _8.Tab; - }, function (_9) { - SchemaSample = _9['default']; - }, function (_10) { - PrismPipe = _10.PrismPipe; - }, function (_11) { - redocEvents = _11.redocEvents; - }, function (_5) { - ViewChildren = _5.ViewChildren; - QueryList = _5.QueryList; - ChangeDetectorRef = _5.ChangeDetectorRef; - ChangeDetectionStrategy = _5.ChangeDetectionStrategy; - }, function (_a) { - _classCallCheck = _a['default']; - }], - execute: function () { - 'use strict'; - - RequestSamples = (function (_BaseComponent) { - _inherits(RequestSamples, _BaseComponent); - - function RequestSamples(schemaMgr, tabs, changeDetector) { - var _this = this; - - _classCallCheck(this, _RequestSamples); - - _get(Object.getPrototypeOf(_RequestSamples.prototype), 'constructor', this).call(this, schemaMgr); - tabs.changes.subscribe(function (_) { - _this.tabs = tabs.first; - _this.subscribeForEvents(_); - }); - this.changeDetector = changeDetector; - } - - _createClass(RequestSamples, [{ - key: 'changeLangNotify', - value: function changeLangNotify(lang) { - redocEvents.samplesLanguageChanged.next(lang); - } - }, { - key: 'subscribeForEvents', - value: function subscribeForEvents() { - var _this2 = this; - - if (!this.tabs) return; - redocEvents.samplesLanguageChanged.subscribe(function (sampleLang) { - _this2.tabs.selectyByTitle(sampleLang); - _this2.changeDetector.markForCheck(); - }); - } - }, { - key: 'prepareModel', - value: function prepareModel() { - this.data = {}; - this.data.bodySchemaPtr = JsonPointer.join(this.bodySchemaPtr, 'schema'); - this.data.samples = this.componentSchema['x-code-samples'] || []; - } - }]); - - var _RequestSamples = RequestSamples; - RequestSamples = Reflect.metadata('parameters', [[SchemaManager], [new ViewChildren(Tabs), QueryList], [ChangeDetectorRef]])(RequestSamples) || RequestSamples; - RequestSamples = RedocComponent({ - selector: 'request-samples', - template: '\n
Request samples
\n \n \n \n \n \n \n
\n      
\n
\n ', - styles: ['\n header{font-family:Montserrat;font-size:0.929em;text-transform:uppercase;margin:0;color:#9fb4be;text-transform:uppercase;font-weight:normal}:host>tabs>ul li{font-family:Montserrat;font-size:.9em;border-radius:2px;margin:2px 0;padding:3px 10px 2px 10px;line-height:1.25;color:#9fb4be}:host>tabs>ul li:hover{background-color:rgba(255,255,255,0.1);color:#ffffff}:host>tabs>ul li.active{background-color:#ffffff;color:#263238}:host tabs ul{padding-top:10px}pre{overflow-x:auto;word-break:break-all;word-wrap:break-word;white-space:pre-wrap}\n '], - directives: [SchemaSample, Tabs, Tab], - inputs: ['bodySchemaPtr'], - pipes: [PrismPipe], - changeDetection: ChangeDetectionStrategy.OnPush - })(RequestSamples) || RequestSamples; - return RequestSamples; - })(BaseComponent); - - _export('default', RequestSamples); - } - }; -}); -$__System.register('17', ['5', '7', '8', '9', '10', '11', '13', '18', '19', 'a', 'c'], function (_export) { - var RedocComponent, BaseComponent, _get, _inherits, _createClass, RequestSamples, JsonPointer, SchemaSample, ResponsesList, ResponsesSamples, _classCallCheck, ParamsList, Method; - - return { - setters: [function (_5) { - RedocComponent = _5.RedocComponent; - BaseComponent = _5.BaseComponent; - }, function (_) { - _get = _['default']; - }, function (_2) { - _inherits = _2['default']; - }, function (_3) { - _createClass = _3['default']; - }, function (_9) { - RequestSamples = _9['default']; - }, function (_4) { - JsonPointer = _4.JsonPointer; - }, function (_8) { - SchemaSample = _8['default']; - }, function (_6) { - ResponsesList = _6['default']; - }, function (_7) { - ResponsesSamples = _7['default']; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_c) { - ParamsList = _c['default']; - }], - execute: function () { - 'use strict'; - - Method = (function (_BaseComponent) { - _inherits(Method, _BaseComponent); - - function Method(schemaMgr) { - _classCallCheck(this, _Method); - - _get(Object.getPrototypeOf(_Method.prototype), 'constructor', this).call(this, schemaMgr); - } - - _createClass(Method, [{ - key: 'prepareModel', - value: function prepareModel() { - this.data = {}; - this.data.apiUrl = this.schemaMgr.apiUrl; - this.data.httpMethod = JsonPointer.baseName(this.pointer); - this.data.path = JsonPointer.baseName(this.pointer, 2); - this.data.methodInfo = this.componentSchema; - this.data.methodInfo.tags = this.filterMainTags(this.data.methodInfo.tags); - this.data.bodyParam = this.findBodyParam(); - if (this.componentSchema.operationId) { - this.data.methodAnchor = 'operation/' + encodeURIComponent(this.componentSchema.operationId); - } else { - this.data.methodAnchor = 'tag/' + encodeURIComponent(this.tag + this.pointer); - } - } - }, { - key: 'filterMainTags', - value: function filterMainTags(tags) { - var tagsMap = this.schemaMgr.getTagsMap(); - if (!tags) return []; - return tags.filter(function (tag) { - return tagsMap[tag] && tagsMap[tag]['x-traitTag']; - }); - } - }, { - key: 'findBodyParam', - value: function findBodyParam() { - var pathParams = this.schemaMgr.getMethodParams(this.pointer, true); - var bodyParam = pathParams.find(function (param) { - return param['in'] === 'body'; - }); - return bodyParam; - } - }]); - - var _Method = Method; - Method = RedocComponent({ - selector: 'method', - template: '\n
\n
\n

\n {{data.methodInfo.summary}}\n

\n \n

\n

\n \n \n
\n
\n
Definition
\n \n
{{data.httpMethod}}
\n {{data.apiUrl}} {{data.path}}\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n ', - styles: ['\n .share-link{cursor:pointer;margin-left:-15px;padding:0;line-height:1;width:15px;display:inline-block}.share-link:before{content:"";width:15px;height:15px;background-size:contain;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==");opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle}.sharable-header{color:#263238}.sharable-header:hover .share-link:before,.share-link:hover:before{visibility:visible}:host{padding-bottom:100px;display:block;border-bottom:1px solid rgba(127,127,127,0.25)}responses-list,params-list{display:block}.method-header{margin-bottom:.9em}.method-endpoint{margin:0 0 2em 0;padding:10px 20px;border-radius:4px;background-color:#222d32;display:block;font-weight:300}.method-endpoint>h5{padding-top:1px;padding-bottom:0;margin:0;font-size:.8em;color:#263238;vertical-align:middle;display:inline-block;border-radius:2px}.api-url{color:rgba(255,255,255,0.8);margin-left:10px;margin-top:2px;position:relative;top:1px;font-family:Montserrat,sans-serif;font-size:0.929em !important}.path{font-family:Montserrat,sans-serif;position:relative;top:1px;color:#ffffff;font-size:0.929em !important}.method-tags{margin-top:20px}.method-tags a{font-size:16px;color:#999;display:inline-block;padding:0 0.5em;text-decoration:none}.method-tags a:before{content:\'#\';margin-right:-0.4em}.method-tags a:first-of-type{padding:0}.method-content,.method-samples{display:block;box-sizing:border-box;float:left}.method-content{width:60%;padding:40px}.method-samples{color:#fafbfc;width:40%;padding:40px;background:#263238}responses-samples{display:block}.method-samples header,.method-samples>h5{color:#9fb4be;text-transform:uppercase}.method-samples>h5{margin-bottom:8px}.method-samples schema-sample{display:block}.method:after{content:"";display:table;clear:both}.method-description{padding:6px 0 10px 0;margin:0}.http-method{color:#263238;background:#ffffff;padding:3px 10px;text-transform:uppercase}@media (max-width: 1100px){.methods:before{display:none}.method-samples,.method-content{width:100%}.method-samples{margin-top:2em}:host{padding-bottom:0}}\n '], - directives: [ParamsList, ResponsesList, ResponsesSamples, SchemaSample, RequestSamples], - inputs: ['tag'] - })(Method) || Method; - return Method; - })(BaseComponent); - - _export('default', Method); - } - }; -}); -$__System.register('1a', ['5', '7', '8', '9', '14', '17', 'a', '1b', '1c'], function (_export) { - var RedocComponent, BaseComponent, _get, _inherits, _createClass, EncodeURIComponentPipe, Method, _classCallCheck, _slicedToArray, _Array$from, MethodsList; - - return { - setters: [function (_4) { - RedocComponent = _4.RedocComponent; - BaseComponent = _4.BaseComponent; - }, function (_) { - _get = _['default']; - }, function (_2) { - _inherits = _2['default']; - }, function (_3) { - _createClass = _3['default']; - }, function (_6) { - EncodeURIComponentPipe = _6.EncodeURIComponentPipe; - }, function (_5) { - Method = _5['default']; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_b) { - _slicedToArray = _b['default']; - }, function (_c) { - _Array$from = _c['default']; - }], - execute: function () { - 'use strict'; - - MethodsList = (function (_BaseComponent) { - _inherits(MethodsList, _BaseComponent); - - function MethodsList(schemaMgr) { - _classCallCheck(this, _MethodsList); - - _get(Object.getPrototypeOf(_MethodsList.prototype), 'constructor', this).call(this, schemaMgr); - } - - _createClass(MethodsList, [{ - key: 'prepareModel', - value: function prepareModel() { - this.data = {}; - // follow SwaggerUI behavior for cases when one method has more than one tag: - // duplicate methods - - var menuStructure = this.schemaMgr.buildMenuTree(); - var tags = _Array$from(menuStructure.entries()).map(function (entry) { - var _entry = _slicedToArray(entry, 2); - - var tag = _entry[0]; - var _entry$1 = _entry[1]; - var description = _entry$1.description; - var methods = _entry$1.methods; - - // inject tag name into method info - methods = methods || []; - methods.forEach(function (method) { - method.tag = tag; - }); - return { - name: tag, - description: description, - methods: methods - }; - }); - this.data.tags = tags; - // TODO: check $ref field - } - }]); - - var _MethodsList = MethodsList; - MethodsList = RedocComponent({ - selector: 'methods-list', - template: '\n
\n
\n
\n

{{tag.name}}

\n

\n
\n \n
\n
\n ', - styles: ['\n .share-link{cursor:pointer;margin-left:-15px;padding:0;line-height:1;width:15px;display:inline-block}.share-link:before{content:"";width:15px;height:15px;background-size:contain;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==");opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle}.sharable-header{color:#263238}.sharable-header:hover .share-link:before,.share-link:hover:before{visibility:visible}.tag-info{padding:40px;box-sizing:border-box;background-color:white;width:60%}@media (max-width: 1100px){.tag-info{width:100%}}.tag-info:after,.tag-info:before{content:"";display:table}.tag-info h1{color:#0033a0;text-transform:capitalize;font-weight:normal}.methods{display:block;position:relative}\n '], - directives: [Method], - pipes: [EncodeURIComponentPipe] - })(MethodsList) || MethodsList; - return MethodsList; - })(BaseComponent); - - _export('default', MethodsList); - } - }; -}); -$__System.register('1d', ['9', '16', 'a', '1e'], function (_export) { - var _createClass, Directive, ElementRef, _classCallCheck, BrowserDomAdapter, StickySidebar; - - return { - setters: [function (_) { - _createClass = _['default']; - }, function (_2) { - Directive = _2.Directive; - ElementRef = _2.ElementRef; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_e) { - BrowserDomAdapter = _e.BrowserDomAdapter; - }], - execute: function () { - 'use strict'; - - StickySidebar = (function () { - function StickySidebar(elementRef, dom) { - _classCallCheck(this, _StickySidebar); - - this.$element = elementRef.nativeElement; - this.dom = dom; - - // initial styling - this.dom.setStyle(this.$element, 'position', 'absolute'); - this.dom.setStyle(this.$element, 'top', '0'); - this.dom.setStyle(this.$element, 'bottom', '0'); - this.dom.setStyle(this.$element, 'max-height', '100%'); - } - - _createClass(StickySidebar, [{ - key: 'bind', - value: function bind() { - var _this = this; - - this.cancelScrollBinding = this.dom.onAndCancel(this.scrollParent, 'scroll', function () { - _this.updatePosition(); - }); - this.updatePosition(); - } - }, { - key: 'unbind', - value: function unbind() { - this.cancelScrollBinding && this.cancelScrollBinding(); - } - }, { - key: 'updatePosition', - value: function updatePosition() { - if (this.scrollY + this.scrollYOffset() >= this.$redocEl.offsetTop) { - this.stick(); - } else { - this.unstick(); - } - } - }, { - key: 'stick', - value: function stick() { - this.dom.setStyle(this.$element, 'position', 'fixed'); - this.dom.setStyle(this.$element, 'top', this.scrollYOffset() + 'px'); - } - }, { - key: 'unstick', - value: function unstick() { - this.dom.setStyle(this.$element, 'position', 'absolute'); - this.dom.setStyle(this.$element, 'top', 0); - } - }, { - key: 'ngOnInit', - value: function ngOnInit() { - // FIXME use more reliable code - this.$redocEl = this.$element.offsetParent; - this.bind(); - } - }, { - key: 'ngOnDestroy', - value: function ngOnDestroy() { - this.unbind(); - } - }, { - key: 'scrollY', - get: function get() { - return this.scrollParent.pageYOffset != null ? this.scrollParent.pageYOffset : this.scrollParent.scrollTop; - } - }]); - - var _StickySidebar = StickySidebar; - StickySidebar = Reflect.metadata('parameters', [[ElementRef], [BrowserDomAdapter]])(StickySidebar) || StickySidebar; - StickySidebar = Directive({ - selector: '[sticky-sidebar]', - inputs: ['scrollParent', 'scrollYOffset'] - })(StickySidebar) || StickySidebar; - return StickySidebar; - })(); - - _export('default', StickySidebar); - } - }; -}); -$__System.register("1f", [], function() { return { setters: [], execute: function() {} } }); - -$__System.register('20', ['3', '4', '5', '6', '7', '8', '9', '15', '16', '21', '22', 'a', '1e', 'b', '1a', '1d', '1f'], function (_export) { - var detectScollParent, ApiInfo, RedocComponent, BaseComponent, OptionsManager, _get, _inherits, _createClass, redocEvents, ChangeDetectionStrategy, provide, enableProdMode, ElementRef, SchemaManager, SideMenu, _classCallCheck, BrowserDomAdapter, bootstrap, ApiLogo, MethodsList, StickySidebar, dom, _modeLocked, Redoc; - - return { - setters: [function (_5) { - detectScollParent = _5['default']; - }, function (_8) { - ApiInfo = _8['default']; - }, function (_6) { - RedocComponent = _6.RedocComponent; - BaseComponent = _6.BaseComponent; - }, function (_10) { - OptionsManager = _10['default']; - }, function (_) { - _get = _['default']; - }, function (_2) { - _inherits = _2['default']; - }, function (_3) { - _createClass = _3['default']; - }, function (_11) { - redocEvents = _11.redocEvents; - }, function (_4) { - ChangeDetectionStrategy = _4.ChangeDetectionStrategy; - provide = _4.provide; - enableProdMode = _4.enableProdMode; - ElementRef = _4.ElementRef; - }, function (_7) { - SchemaManager = _7['default']; - }, function (_9) { - SideMenu = _9['default']; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_e) { - BrowserDomAdapter = _e.BrowserDomAdapter; - bootstrap = _e.bootstrap; - }, function (_b) { - ApiLogo = _b['default']; - }, function (_a2) { - MethodsList = _a2['default']; - }, function (_d) { - StickySidebar = _d['default']; - }, function (_f) {}], - execute: function () { - 'use strict'; - - dom = new BrowserDomAdapter(); - _modeLocked = false; - - Redoc = (function (_BaseComponent) { - _inherits(Redoc, _BaseComponent); - - function Redoc(schemaMgr, optionsMgr, elementRef) { - _classCallCheck(this, _Redoc); - - _get(Object.getPrototypeOf(_Redoc.prototype), 'constructor', this).call(this, schemaMgr); - this.element = elementRef.nativeElement; - //parse options (top level component doesn't support inputs) - optionsMgr.parseOptions(this.element); - optionsMgr.options.$scrollParent = detectScollParent(this.element); - this.options = optionsMgr.options; - } - - _createClass(Redoc, null, [{ - key: 'showLoadingAnimation', - value: function showLoadingAnimation() { - var elem = dom.query('redoc'); - dom.addClass(elem, 'loading'); - } - }, { - key: 'hideLoadingAnimation', - value: function hideLoadingAnimation() { - var redocEl = dom.query('redoc'); - dom.addClass(redocEl, 'loading-remove'); - setTimeout(function () { - dom.removeClass(redocEl, 'loading-remove'); - dom.removeClass(redocEl, 'loading'); - }, 400); - } - }, { - key: 'init', - value: function init(specUrl, options) { - var optionsMgr = new OptionsManager(); - optionsMgr.options = options; - optionsMgr.options.specUrl = optionsMgr.options.specUrl || specUrl; - var providers = [provide(OptionsManager, { useValue: optionsMgr })]; - - if (Redoc.appRef) { - Redoc.destroy(); - } - Redoc.showLoadingAnimation(); - return SchemaManager.instance().load(specUrl).then(function () { - if (!_modeLocked && !optionsMgr.options.debugMode) { - enableProdMode(); - _modeLocked = true; - } - return bootstrap(Redoc, providers); - }).then(function (appRef) { - Redoc.hideLoadingAnimation(); - Redoc.appRef = appRef; - // setTimeout to allow cached elements to init - setTimeout(function () { - return redocEvents.bootstrapped.next(); - }); - console.log('ReDoc bootstrapped!'); - }, function (error) { - console.log(error); - throw error; - }); - } - }, { - key: 'autoInit', - value: function autoInit() { - var specUrlAttributeName = 'spec-url'; - var redocEl = dom.query('redoc'); - if (!redocEl) return; - if (dom.hasAttribute(redocEl, specUrlAttributeName)) { - var url = dom.getAttribute(redocEl, specUrlAttributeName); - Redoc.init(url); - } - } - }, { - key: 'destroy', - value: function destroy() { - var el = dom.query('redoc'); - var elClone = undefined; - var parent = undefined; - var nextSibling = undefined; - if (el) { - parent = el.parentElement; - nextSibling = el.nextElementSibling; - } - - elClone = el.cloneNode(false); - - if (Redoc.appRef) { - Redoc.appRef.destroy(); - Redoc.appRef = null; - - // Redoc destroy removes host element, so need to restore it - elClone.innerHTML = 'Loading...'; - parent && parent.insertBefore(elClone, nextSibling); - } - } - }]); - - var _Redoc = Redoc; - Redoc = Reflect.metadata('parameters', [[SchemaManager], [OptionsManager], [ElementRef]])(Redoc) || Redoc; - Redoc = RedocComponent({ - selector: 'redoc', - providers: [SchemaManager, BrowserDomAdapter], - template: '\n
\n \n
\n \n \n \n
\n
\n ', - styles: ['\n :host{display:block;box-sizing:border-box;-webkit-tap-highlight-color:transparent;-moz-tap-highlight-color:transparent;-ms-tap-highlight-color:transparent;-o-tap-highlight-color:transparent;tap-highlight-color:transparent;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:antialiased;-webkit-osx-font-smoothing:grayscale;-moz-osx-font-smoothing:grayscale;osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;-webkit-text-shadow:1px 1px 1px rgba(0,0,0,0.004);-ms-text-shadow:1px 1px 1px rgba(0,0,0,0.004);text-shadow:1px 1px 1px rgba(0,0,0,0.004);text-rendering:optimizeSpeed !important;font-smooth:always;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}.redoc-wrap{position:relative;font-family:Roboto,sans-serif;font-size:14px;line-height:1.55em;color:#263238}side-menu{display:block;box-sizing:border-box}methods-list{display:block;overflow:hidden}api-info,.side-bar{display:block;padding:10px 0}api-info{padding:40px}api-logo{display:block;text-align:center}@media (max-width: 1000px){api-logo{display:none}}[sticky-sidebar]{width:260px;background-color:#FAFAFA;overflow-y:auto;overflow-x:hidden}@media (max-width: 1000px){[sticky-sidebar]{z-index:1;width:100%;bottom:auto !important}}#api-content{margin-left:260px;position:relative}@media (max-width: 1000px){#api-content{padding-top:3em;margin-left:0}}#api-content:before{content:"";background:#263238;height:100%;width:40%;top:0;right:0;position:absolute;z-index:-1}@media (max-width: 1100px){#api-content:before{display:none}}:host h1{margin-top:0;font-family:Montserrat,sans-serif;color:#0033a0;font-weight:400}:host h2{margin-top:0;font-family:Montserrat,sans-serif;color:#0033a0;font-weight:400}:host h3{margin-top:0;font-family:Montserrat,sans-serif;color:#0033a0;font-weight:400}:host h4{margin-top:0;font-family:Montserrat,sans-serif;color:#0033a0;font-weight:400}:host h5{margin-top:0;font-family:Montserrat,sans-serif;color:#0033a0;font-weight:400}:host h1{font-size:1.85714em}:host h2{font-size:1.57143em}:host h3{font-size:1.28571em}:host h4{font-size:1.14286em}:host h5{font-size:0.929em}:host p{font-family:Roboto,sans-serif;font-weight:300;margin:0;margin-bottom:1em;line-height:1.55em}:host a{text-decoration:none;color:#0033a0}:host p>code{color:#e53935;border:1px solid rgba(38,50,56,0.1)}footer{text-align:right;padding:10px;font-size:15px;background-color:white}footer strong{font-size:18px;color:#0033a0}:host .redoc-markdown-block pre{font-family:Courier, monospace;white-space:pre-wrap;background-color:rgba(38,50,56,0.04);padding:12px 14px 15px 14px;overflow-x:auto;line-height:normal;border-radius:2px;border:1px solid rgba(38,50,56,0.1)}:host .redoc-markdown-block pre code{background-color:transparent}:host .redoc-markdown-block pre code:before,:host .redoc-markdown-block pre code:after{content:none}:host .redoc-markdown-block code{font-family:Courier, monospace;background-color:rgba(38,50,56,0.04);padding:0.1em 0 0.2em 0;font-size:1em;border-radius:2px}:host .redoc-markdown-block code:before,:host .redoc-markdown-block code:after{letter-spacing:-0.2em;content:"\\00a0"}:host .redoc-markdown-block p:last-of-type{margin-bottom:0}:host .redoc-markdown-block blockquote{margin:0;margin-bottom:1em;padding:0 15px;color:#777;border-left:4px solid #ddd}:host .redoc-markdown-block img{max-width:100%;box-sizing:content-box}:host .redoc-markdown-block ul,:host .redoc-markdown-block ol{padding-left:2em;margin:0;margin-bottom:1em}:host .redoc-markdown-block table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;border-collapse:collapse;border-spacing:0;margin-top:0.5em;margin-bottom:0.5em}:host .redoc-markdown-block table tr{background-color:#fff;border-top:1px solid #ccc}:host .redoc-markdown-block table tr:nth-child(2n){background-color:#f8f8f8}:host .redoc-markdown-block table th,:host .redoc-markdown-block table td{padding:6px 13px;border:1px solid #ddd}:host .redoc-markdown-block table th{text-align:left;font-weight:bold}\n '], - directives: [ApiInfo, ApiLogo, MethodsList, SideMenu, StickySidebar], - changeDetection: ChangeDetectionStrategy.Default - })(Redoc) || Redoc; - return Redoc; - })(BaseComponent); - - _export('default', Redoc); - } - }; -}); -$__System.register('e', ['6', '9', '16', '21', '23', '24', 'a', 'd'], function (_export) { - var OptionsManager, _createClass, Component, ElementRef, ViewContainerRef, SchemaManager, CORE_DIRECTIVES, DynamicComponentLoader, _classCallCheck, JsonSchema, cache, JsonSchemaLazy; - - function insertAfter(newNode, referenceNode) { - referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); - } - return { - setters: [function (_5) { - OptionsManager = _5['default']; - }, function (_) { - _createClass = _['default']; - }, function (_2) { - Component = _2.Component; - ElementRef = _2.ElementRef; - ViewContainerRef = _2.ViewContainerRef; - }, function (_6) { - SchemaManager = _6['default']; - }, function (_3) { - CORE_DIRECTIVES = _3.CORE_DIRECTIVES; - }, function (_4) { - DynamicComponentLoader = _4.DynamicComponentLoader; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_d) { - JsonSchema = _d['default']; - }], - execute: function () { - 'use strict'; - - cache = {}; - - JsonSchemaLazy = (function () { - function JsonSchemaLazy(schemaMgr, viewRef, elementRef, dcl, optionsMgr) { - _classCallCheck(this, _JsonSchemaLazy); - - this.viewRef = viewRef; - this.elementRef = elementRef; - this.dcl = dcl; - this.optionsMgr = optionsMgr; - this.schemaMgr = schemaMgr; - } - - _createClass(JsonSchemaLazy, [{ - key: 'normalizePointer', - value: function normalizePointer() { - var schema = this.schemaMgr.byPointer(this.pointer); - return schema && schema.$ref || this.pointer; - } - }, { - key: 'load', - value: function load() { - var _this = this; - - if (this.optionsMgr.options.disableLazySchemas) return; - if (this.loaded) return; - if (this.pointer) { - this.dcl.loadNextToLocation(JsonSchema, this.viewRef).then(function (compRef) { - _this.initComponent(compRef); - // trigger change detection - compRef.hostView.changeDetectorRef.detectChanges(); - }); - } - this.loaded = true; - } - - // cache JsonSchema view - }, { - key: 'loadCached', - value: function loadCached() { - var _this2 = this; - - this.pointer = this.normalizePointer(this.pointer); - if (cache[this.pointer]) { - cache[this.pointer].then(function (compRef) { - setTimeout(function () { - var $element = compRef.location.nativeElement; - - // skip caching view with tabs inside (discriminator) as it needs attached controller - // FIXME: get rid of dependency on selector - if ($element.querySelector('.discriminator-wrap')) { - _this2.dcl.loadNextToLocation(JsonSchema, _this2.viewRef).then(function (compRef) { - _this2.initComponent(compRef); - compRef.hostView.changeDetectorRef.detectChanges(); - }); - return; - } - insertAfter($element.cloneNode(true), _this2.elementRef.nativeElement); - }); - }); - } else { - cache[this.pointer] = this.dcl.loadNextToLocation(JsonSchema, this.viewRef).then(function (compRef) { - _this2.initComponent(compRef); - compRef.hostView.changeDetectorRef.detectChanges(); - return compRef; - }); - } - } - }, { - key: 'initComponent', - value: function initComponent(compRef) { - compRef.instance.pointer = this.pointer; - compRef.instance.skipReadOnly = this.skipReadOnly; - } - }, { - key: 'ngAfterViewInit', - value: function ngAfterViewInit() { - if (!this.auto) return; - this.loadCached(); - } - }, { - key: 'ngOnDestroy', - value: function ngOnDestroy() { - // clear cache - cache = {}; - } - }]); - - var _JsonSchemaLazy = JsonSchemaLazy; - JsonSchemaLazy = Reflect.metadata('parameters', [[SchemaManager], [ViewContainerRef], [ElementRef], [DynamicComponentLoader], [OptionsManager]])(JsonSchemaLazy) || JsonSchemaLazy; - JsonSchemaLazy = Component({ - selector: 'json-schema-lazy', - inputs: ['pointer', 'auto', 'skipReadOnly'], - template: '', - directives: [CORE_DIRECTIVES] - })(JsonSchemaLazy) || JsonSchemaLazy; - return JsonSchemaLazy; - })(); - - _export('default', JsonSchemaLazy); - } - }; -}); -$__System.register('25', ['9', '16', '23', 'a'], function (_export) { - var _createClass, Component, EventEmitter, CORE_DIRECTIVES, _classCallCheck, Zippy; - - return { - setters: [function (_) { - _createClass = _['default']; - }, function (_2) { - Component = _2.Component; - EventEmitter = _2.EventEmitter; - }, function (_3) { - CORE_DIRECTIVES = _3.CORE_DIRECTIVES; - }, function (_a) { - _classCallCheck = _a['default']; - }], - execute: function () { - 'use strict'; - - Zippy = (function () { - function Zippy() { - _classCallCheck(this, _Zippy); - - this.type = 'general'; - this.visible = false; - this.empty = false; - this.open = new EventEmitter(); - this.close = new EventEmitter(); - } - - _createClass(Zippy, [{ - key: 'toggle', - value: function toggle() { - this.visible = !this.visible; - if (this.empty) return; - this.visible ? this.open.next() : this.close.next(); - } - }]); - - var _Zippy = Zippy; - Zippy = Component({ - selector: 'zippy', - events: ['open', 'close'], - inputs: ['title', 'visible', 'type', 'empty'], - template: '\n
\n
\n {{ visible ? \'▾\' : \'▸\' }}\n {{title}}\n
\n
\n \n
\n
\n ', - styles: ['\n .zippy-title{padding:10px;border-radius:2px;margin:2px 0;line-height:1.5em;background-color:#f2f2f2;cursor:pointer}.zippy-success>.zippy-title{color:#00aa13;background-color:rgba(0,170,19,0.08)}.zippy-error>.zippy-title{color:#e53935;background-color:rgba(229,57,53,0.06)}.zippy-redirect>.zippy-title{color:#263238;background-color:rgba(38,50,56,0.08)}.zippy-info>.zippy-title{color:#0033a0;background-color:rgba(0,51,160,0.08)}span.zippy-indicator{font-size:1.2em;margin-right:0.2em;position:relative;top:0}.zippy-content{padding:15px 0}.zippy-empty .zippy-title{cursor:default}.zippy-empty .zippy-indicator{display:none}.zippy-empty .zippy-content{display:none}.zippy-hidden{overflow:hidden;visibility:hidden;height:0;padding:0}\n '], - directives: [CORE_DIRECTIVES] - })(Zippy) || Zippy; - return Zippy; - })(); - - _export('default', Zippy); - } - }; -}); -$__System.register('18', ['5', '6', '7', '8', '9', '11', '25', '26', 'a', 'f', 'd', 'e'], function (_export) { - var RedocComponent, BaseComponent, SchemaManager, OptionsManager, _get, _inherits, _createClass, JsonPointer, Zippy, statusCodeType, _classCallCheck, _Object$keys, JsonSchema, JsonSchemaLazy, ResponsesList; - - function isNumeric(n) { - return !isNaN(parseFloat(n)) && isFinite(n); - } - - return { - setters: [function (_4) { - RedocComponent = _4.RedocComponent; - BaseComponent = _4.BaseComponent; - SchemaManager = _4.SchemaManager; - }, function (_8) { - OptionsManager = _8['default']; - }, function (_) { - _get = _['default']; - }, function (_2) { - _inherits = _2['default']; - }, function (_3) { - _createClass = _3['default']; - }, function (_5) { - JsonPointer = _5['default']; - }, function (_6) { - Zippy = _6['default']; - }, function (_7) { - statusCodeType = _7.statusCodeType; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_f) { - _Object$keys = _f['default']; - }, function (_d) { - JsonSchema = _d['default']; - }, function (_e) { - JsonSchemaLazy = _e['default']; - }], - execute: function () { - 'use strict'; - - ResponsesList = (function (_BaseComponent) { - _inherits(ResponsesList, _BaseComponent); - - function ResponsesList(schemaMgr, optionsMgr) { - _classCallCheck(this, _ResponsesList); - - _get(Object.getPrototypeOf(_ResponsesList.prototype), 'constructor', this).call(this, schemaMgr); - this.options = optionsMgr.options; - } - - _createClass(ResponsesList, [{ - key: 'prepareModel', - value: function prepareModel() { - var _this = this; - - this.data = {}; - this.data.responses = []; - - var responses = this.componentSchema; - if (!responses) return; - - responses = _Object$keys(responses).filter(function (respCode) { - // only response-codes and "default" - return isNumeric(respCode) || respCode === 'default'; - }).map(function (respCode) { - var resp = responses[respCode]; - resp.pointer = JsonPointer.join(_this.pointer, respCode); - if (resp.$ref) { - var ref = resp.$ref; - resp = _this.schemaMgr.byPointer(resp.$ref); - resp.pointer = ref; - } - - resp.empty = !resp.schema; - resp.code = respCode; - resp.type = statusCodeType(resp.code); - if (resp.headers) { - resp.headers = _Object$keys(resp.headers).map(function (k) { - var respInfo = resp.headers[k]; - respInfo.name = k; - return respInfo; - }); - resp.empty = false; - } - resp.extendable = resp.headers || resp.length; - return resp; - }); - this.data.responses = responses; - } - }]); - - var _ResponsesList = ResponsesList; - ResponsesList = Reflect.metadata('parameters', [[SchemaManager], [OptionsManager]])(ResponsesList) || ResponsesList; - ResponsesList = RedocComponent({ - selector: 'responses-list', - template: '\n

Responses

\n \n
\n
\n Headers\n
\n
\n
{{header.name}}
\n
{{header.type}}
\n
\n
\n
\n \n \n \n \n
\n ', - styles: ['\n .responses-list-header{font-size:18px;padding:0.2em 0;margin:3em 0 1.1em 0;color:#253137;font-weight:normal}:host .zippy-title{font-family:Montserrat,sans-serif}.header-name{font-weight:bold;display:inline-block}.header-type{display:inline-block;font-weight:bold;color:#999}header{font-size:14px;font-weight:bold;text-transform:uppercase;margin-bottom:15px}.header{margin-bottom:10px}\n '], - directives: [JsonSchema, Zippy, JsonSchemaLazy] - })(ResponsesList) || ResponsesList; - return ResponsesList; - })(BaseComponent); - - _export('default', ResponsesList); - } - }; -}); -$__System.register('12', ['9', '16', '23', 'a'], function (_export) { - var _createClass, Component, EventEmitter, CORE_DIRECTIVES, _classCallCheck, Tabs, Tab; - - return { - setters: [function (_) { - _createClass = _['default']; - }, function (_2) { - Component = _2.Component; - EventEmitter = _2.EventEmitter; - }, function (_3) { - CORE_DIRECTIVES = _3.CORE_DIRECTIVES; - }, function (_a) { - _classCallCheck = _a['default']; - }], - execute: function () { - 'use strict'; - - Tabs = (function () { - function Tabs() { - _classCallCheck(this, _Tabs); - - this.tabs = []; - this.change = new EventEmitter(); - } - - _createClass(Tabs, [{ - key: 'selectTab', - value: function selectTab(tab) { - var notify = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; - - if (tab.active) return; - this.tabs.forEach(function (tab) { - tab.active = false; - }); - tab.active = true; - notify && this.change.next(tab.tabTitle); - } - }, { - key: 'selectyByTitle', - value: function selectyByTitle(tabTitle) { - var notify = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; - - var prevActive = undefined; - var newActive = undefined; - this.tabs.forEach(function (tab) { - if (tab.active) prevActive = tab; - tab.active = false; - if (tab.tabTitle === tabTitle) { - newActive = tab; - } - }); - if (newActive) { - newActive.active = true; - } else { - prevActive.active = true; - } - notify && this.change.next(tabTitle); - } - }, { - key: 'addTab', - value: function addTab(tab) { - if (this.tabs.length === 0) { - tab.active = true; - } - this.tabs.push(tab); - } - }]); - - var _Tabs = Tabs; - Tabs = Component({ - selector: 'tabs', - events: ['change'], - template: '\n
    \n
  • {{tab.tabTitle}}
  • \n
\n \n ', - directives: [CORE_DIRECTIVES], - styles: ['\n ul{display:block;margin:0;padding:0}li{list-style:none;display:inline-block;cursor:pointer}.tab-success:before,.tab-error:before,.tab-redirect:before,.tab-info:before{content:"";display:inline-block;position:relative;top:-2px;height:4px;width:4px;border-radius:50%;margin-right:0.5em}.tab-success:before{box-shadow:0 0 3px 0 #00aa13;background-color:#00aa13}.tab-error:before{box-shadow:0 0 3px 0 #e53935;background-color:#e53935}.tab-redirect:before{box-shadow:0 0 3px 0 #f1c400;background-color:#f1c400}.tab-info:before{box-shadow:0 0 3px 0 #0033a0;background-color:#0033a0}\n '] - })(Tabs) || Tabs; - return Tabs; - })(); - - _export('Tabs', Tabs); - - Tab = (function () { - function Tab(tabs) { - _classCallCheck(this, _Tab); - - this.active = false; - tabs.addTab(this); - } - - var _Tab = Tab; - Tab = Reflect.metadata('parameters', [[Tabs]])(Tab) || Tab; - Tab = Component({ - selector: 'tab', - inputs: ['tabTitle', 'tabStatus'], - template: '\n
\n \n
\n ', - directives: [CORE_DIRECTIVES], - styles: ['\n .tab-wrap {\n display: none;\n }\n\n .tab-wrap.active {\n display: block;\n }'] - })(Tab) || Tab; - return Tab; - })(); - - _export('Tab', Tab); - } - }; -}); -$__System.register('26', [], function (_export) { - 'use strict'; - - _export('statusCodeType', statusCodeType); - - function statusCodeType(statusCode) { - if (statusCode < 100 || statusCode > 599) { - throw new Error('invalid HTTP code'); - } - var res = 'success'; - if (statusCode >= 300 && statusCode < 400) { - res = 'redirect'; - } else if (statusCode >= 400) { - res = 'error'; - } else if (statusCode < 200) { - res = 'info'; - } - return res; - } - - return { - setters: [], - execute: function () {} - }; -}); -$__System.register('19', ['5', '7', '8', '9', '11', '12', '13', '26', 'a', 'f'], function (_export) { - var RedocComponent, BaseComponent, _get, _inherits, _createClass, JsonPointer, Tabs, Tab, SchemaSample, statusCodeType, _classCallCheck, _Object$keys, ResponsesSamples; - - function isNumeric(n) { - return !isNaN(parseFloat(n)) && isFinite(n); - } - - function hasExample(response) { - return response.examples && response.examples['application/json'] || response.schema; - } - - return { - setters: [function (_4) { - RedocComponent = _4.RedocComponent; - BaseComponent = _4.BaseComponent; - }, function (_) { - _get = _['default']; - }, function (_2) { - _inherits = _2['default']; - }, function (_3) { - _createClass = _3['default']; - }, function (_5) { - JsonPointer = _5['default']; - }, function (_6) { - Tabs = _6.Tabs; - Tab = _6.Tab; - }, function (_7) { - SchemaSample = _7['default']; - }, function (_8) { - statusCodeType = _8.statusCodeType; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_f) { - _Object$keys = _f['default']; - }], - execute: function () { - 'use strict'; - - ResponsesSamples = (function (_BaseComponent) { - _inherits(ResponsesSamples, _BaseComponent); - - function ResponsesSamples(schemaMgr) { - _classCallCheck(this, _ResponsesSamples); - - _get(Object.getPrototypeOf(_ResponsesSamples.prototype), 'constructor', this).call(this, schemaMgr); - } - - _createClass(ResponsesSamples, [{ - key: 'prepareModel', - value: function prepareModel() { - var _this = this; - - this.data = {}; - this.data.responses = []; - - var responses = this.componentSchema; - if (!responses) return; - - responses = _Object$keys(responses).filter(function (respCode) { - // only response-codes and "default" - return isNumeric(respCode) || respCode === 'default'; - }).map(function (respCode) { - var resp = responses[respCode]; - resp.pointer = JsonPointer.join(_this.pointer, respCode); - if (resp.$ref) { - var ref = resp.$ref; - resp = _this.schemaMgr.byPointer(resp.$ref); - resp.pointer = ref; - } - - resp.code = respCode; - resp.type = statusCodeType(resp.code); - return resp; - }).filter(function (response) { - return hasExample(response); - }); - this.data.responses = responses; - } - }]); - - var _ResponsesSamples = ResponsesSamples; - ResponsesSamples = RedocComponent({ - selector: 'responses-samples', - template: '\n
Response samples
\n \n \n \n \n \n ', - styles: ['\n tab,tabs{display:block}schema-sample{display:block}header{font-family:Montserrat;font-size:0.929em;text-transform:uppercase;margin:0;color:#9fb4be;text-transform:uppercase;font-weight:normal}:host>tabs>ul li{font-family:Montserrat;font-size:0.929em;border-radius:2px;margin:2px 0;padding:2px 8px 3px 8px;color:#9fb4be;line-height:1.25}:host>tabs>ul li:hover{color:#ffffff;background-color:rgba(255,255,255,0.1)}:host>tabs>ul li.active{background-color:white;color:#263238}:host tabs ul{padding-top:10px}\n '], - directives: [SchemaSample, Tabs, Tab] - })(ResponsesSamples) || ResponsesSamples; - return ResponsesSamples; - })(BaseComponent); - - _export('default', ResponsesSamples); - } - }; -}); -$__System.registerDynamic("27", [], true, function($__require, exports, module) { +(["1","2"], [], function($__System) { +var require = this.require, exports = this.exports, module = this.module; +!function(e){function r(e,r){for(var n=e.split(".");n.length;)r=r[n.shift()];return r}function n(n){if("string"==typeof n)return r(n,e);if(!(n instanceof Array))throw new Error("Global exports must be a string or array.");for(var t={},o=!0,f=0;fr;r++)if(this[r]===e)return r;return-1},s=["_g","sessionStorage","localStorage","clipboardData","frames","frameElement","external","mozAnimationStartTime","webkitStorageInfo","webkitIndexedDB","mozInnerScreenY","mozInnerScreenX"];i.set("@@global-helpers",i.newModule({prepareGlobal:function(r,t,i){var a=e.define;e.define=void 0;var l;if(i){l={};for(var s in i)l[s]=e[s],e[s]=i[s]}return t||(f={},o(function(e,r){f[e]=r})),function(){var r;if(t)r=n(t);else{r={};var i,s;o(function(e,n){f[e]!==n&&"undefined"!=typeof n&&(r[e]=n,"undefined"!=typeof i?s||i===n||(s=!0):i=n)}),r=s?r:i}if(l)for(var u in l)e[u]=l[u];return e.define=a,r}}}))}("undefined"!=typeof self?self:global); +$__System.registerDynamic("3", [], true, function($__require, exports, module) { "use strict"; ; - var global = this, - __define = global.define; - global.define = undefined; - var typesInstantiator = { - 'string': '', - 'number': 0, - 'integer': 0, - 'null': null, - 'boolean': false, - 'object': {} - }; - function isPrimitive(obj) { - var type = obj.type; - return typesInstantiator[type] !== undefined; - } - function instantiatePrimitive(val) { - var type = val.type; - if (val.default) { - return val.default; - } - return typesInstantiator[type]; - } - function instantiate(schema) { - function visit(obj, name, data) { - if (!obj) { - return; - } - var i; - var type = obj.type; - if (type === 'object' && obj.properties) { - data[name] = data[name] || {}; - for (var property in obj.properties) { - if (obj.properties.hasOwnProperty(property)) { - visit(obj.properties[property], property, data[name]); - } - } - } else if (obj.allOf) { - for (i = 0; i < obj.allOf.length; i++) { - visit(obj.allOf[i], name, data); - } - } else if (type === 'array') { - data[name] = []; - var len = 1; - if (obj.minItems || obj.minItems === 0) { - len = obj.minItems; - } - for (i = 0; i < len; i++) { - visit(obj.items, i, data[name]); - } - } else if (isPrimitive(obj)) { - data[name] = instantiatePrimitive(obj); - } - } - var data = {}; - visit(schema, 'kek', data); - return data['kek']; - } - if (typeof module !== 'undefined') { - module.exports = {instantiate: instantiate}; - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("28", ["27"], true, function($__require, exports, module) { - ; - var global = this, - __define = global.define; - global.define = undefined; - module.exports = $__require('27'); - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("29", ["28"], true, function($__require, exports, module) { - ; - var global = this, - __define = global.define; - global.define = undefined; - module.exports = $__require('28'); - global.define = __define; - return module.exports; -}); - -$__System.register('2a', ['9', '16', 'a', 'f', '2b'], function (_export) { - var _createClass, Pipe, _classCallCheck, _Object$keys, isBlank, level, COLLAPSE_LEVEL, JsonFormatter; - - function htmlEncode(t) { - return t != null ? t.toString().replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>') : ''; - } - - function decorateWithSpan(value, className) { - return '' + htmlEncode(value) + ''; - } - - function valueToHTML(value) { - var valueType = typeof value, - output = ''; - if (value == null) { - output += decorateWithSpan('null', 'type-null'); - } else if (value && value.constructor === Array) { - level++; - output += arrayToHTML(value); - level--; - } else if (valueType === 'object') { - level++; - output += objectToHTML(value); - level--; - } else if (valueType === 'number') { - output += decorateWithSpan(value, 'type-number'); - } else if (valueType === 'string') { - if (/^(http|https):\/\/[^\\s]+$/.test(value)) { - output += decorateWithSpan('"', 'type-string') + '' + htmlEncode(value) + '' + decorateWithSpan('"', 'type-string'); - } else { - output += decorateWithSpan('"' + value + '"', 'type-string'); - } - } else if (valueType === 'boolean') { - output += decorateWithSpan(value, 'type-boolean'); - } - - return output; - } - - function arrayToHTML(json) { - var collapsed = level > COLLAPSE_LEVEL ? 'collapsed' : ''; - var i, length; - var output = '
[
    '; - var hasContents = false; - for (i = 0, length = json.length; i < length; i++) { - hasContents = true; - output += '
  • '; - } - output += '
]'; - if (!hasContents) { - output = '[ ]'; - } - return output; - } - - function objectToHTML(json) { - var collapsed = level > COLLAPSE_LEVEL ? 'collapsed' : ''; - var i, - key, - length, - keys = _Object$keys(json); - var output = '
{
    '; - var hasContents = false; - for (i = 0, length = keys.length; i < length; i++) { - key = keys[i]; - hasContents = true; - output += '
  • '; - } - output += '
}'; - if (!hasContents) { - output = '{ }'; - } - return output; - } - - function jsonToHTML(json) { - level = 1; - var output = ''; - output += '
'; - output += valueToHTML(json); - output += '
'; - return output; - } - return { - setters: [function (_) { - _createClass = _['default']; - }, function (_2) { - Pipe = _2.Pipe; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_f) { - _Object$keys = _f['default']; - }, function (_b) { - isBlank = _b.isBlank; - }], - execute: function () { - 'use strict'; - level = 1; - COLLAPSE_LEVEL = 2; - - JsonFormatter = (function () { - function JsonFormatter() { - _classCallCheck(this, _JsonFormatter); - } - - _createClass(JsonFormatter, [{ - key: 'transform', - value: function transform(value) { - if (isBlank(value)) return value; - return jsonToHTML(value); - } - }]); - - var _JsonFormatter = JsonFormatter; - JsonFormatter = Pipe({ name: 'jsonFormatter' })(JsonFormatter) || JsonFormatter; - return JsonFormatter; - })(); - - _export('JsonFormatter', JsonFormatter); - } - }; -}); -$__System.register('13', ['5', '7', '8', '9', '16', '29', 'a', '2a'], function (_export) { - var RedocComponent, BaseComponent, SchemaManager, _get, _inherits, _createClass, ElementRef, SchemaSampler, _classCallCheck, JsonFormatter, SchemaSample; - - return { - setters: [function (_6) { - RedocComponent = _6.RedocComponent; - BaseComponent = _6.BaseComponent; - SchemaManager = _6.SchemaManager; - }, function (_) { - _get = _['default']; - }, function (_2) { - _inherits = _2['default']; - }, function (_3) { - _createClass = _3['default']; - }, function (_4) { - ElementRef = _4.ElementRef; - }, function (_5) { - SchemaSampler = _5['default']; - }, function (_a) { - _classCallCheck = _a['default']; - }, function (_a2) { - JsonFormatter = _a2.JsonFormatter; - }], - execute: function () { - 'use strict'; - - SchemaSample = (function (_BaseComponent) { - _inherits(SchemaSample, _BaseComponent); - - function SchemaSample(schemaMgr, elementRef) { - _classCallCheck(this, _SchemaSample); - - _get(Object.getPrototypeOf(_SchemaSample.prototype), 'constructor', this).call(this, schemaMgr); - this.element = elementRef.nativeElement; - } - - _createClass(SchemaSample, [{ - key: 'init', - value: function init() { - this.data = {}; - - var base = {}; - var sample = undefined; - - // got pointer not directly to the schema but e.g. to response obj - if (this.componentSchema.schema) { - base = this.componentSchema; - this.componentSchema = this.componentSchema.schema; - } - - if (base.examples && base.examples['application/json']) { - sample = base.examples['application/json']; - } else { - this.dereference(this.componentSchema); - sample = SchemaSampler.instantiate(this.componentSchema); - } - - this.data.sample = sample; - - this.element.addEventListener('click', function (event) { - var collapsed, - target = event.target; - if (event.target.className === 'collapser') { - collapsed = target.parentNode.getElementsByClassName('collapsible')[0]; - if (collapsed.parentNode.classList.contains('collapsed')) { - collapsed.parentNode.classList.remove('collapsed'); - } else { - collapsed.parentNode.classList.add('collapsed'); - } - } - }); - } - }]); - - var _SchemaSample = SchemaSample; - SchemaSample = Reflect.metadata('parameters', [[SchemaManager], [ElementRef]])(SchemaSample) || SchemaSample; - SchemaSample = RedocComponent({ - selector: 'schema-sample', - template: '\n
\n \n
 Sample unavailable 
\n
\n    
\n ', - pipes: [JsonFormatter], - styles: ['\n pre{background-color:transparent;padding:0}:host .type-null{color:gray}:host .type-boolean{color:firebrick}:host .type-number{color:#4A8BB3}:host .type-string{color:#66B16E}:host .callback-function{color:gray}:host .collapser:after{content:"-";cursor:pointer}:host .collapsed>.collapser:after{content:"+";cursor:pointer}:host .ellipsis:after{content:" … "}:host .collapsible{margin-left:2em}:host .hoverable{padding-top:1px;padding-bottom:1px;padding-left:2px;padding-right:2px;border-radius:2px}:host .hovered{background-color:#ebeef9}:host .collapser{padding-right:6px;padding-left:6px}:host .redoc-json{padding:20px;border-radius:4px;background-color:#222d32;margin-bottom:36px}:host ul,:host .redoc-json ul{list-style-type:none;padding:0px;margin:0px 0px 0px 26px}:host li{position:relative}:host .hoverable{transition:background-color .2s ease-out 0s;-webkit-transition:background-color .2s ease-out 0s;display:inline-block}:host .hovered{transition-delay:.2s;-webkit-transition-delay:.2s}:host .selected{outline-style:solid;outline-width:1px;outline-style:dotted}:host .collapsed>.collapsible{display:none}:host .ellipsis{display:none}:host .collapsed>.ellipsis{display:inherit}:host .collapser{position:absolute;top:1px;left:-1.5em;cursor:default;user-select:none;-webkit-user-select:none}\n '] - })(SchemaSample) || SchemaSample; - return SchemaSample; - })(BaseComponent); - - _export('default', SchemaSample); - } - }; -}); -$__System.registerDynamic("2c", ["2d", "2e", "2f", "30"], true, function($__require, exports, module) { - ; - var global = this, - __define = global.define; - global.define = undefined; - var classof = $__require('2d'), - ITERATOR = $__require('2e')('iterator'), - Iterators = $__require('2f'); - module.exports = $__require('30').isIterable = function(it) { - var O = Object(it); - return O[ITERATOR] !== undefined || '@@iterator' in O || Iterators.hasOwnProperty(classof(O)); - }; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("31", ["32", "33", "2c"], true, function($__require, exports, module) { - ; - var global = this, - __define = global.define; - global.define = undefined; - $__require('32'); - $__require('33'); - module.exports = $__require('2c'); - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("34", ["31"], true, function($__require, exports, module) { - ; - var global = this, - __define = global.define; - global.define = undefined; - module.exports = { - "default": $__require('31'), - __esModule: true - }; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("1b", ["35", "34"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - var _getIterator = $__require('35')["default"]; - var _isIterable = $__require('34')["default"]; - exports["default"] = (function() { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - try { - for (var _i = _getIterator(arr), - _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) - break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) - _i["return"](); - } finally { - if (_d) - throw _e; - } - } - return _arr; - } - return function(arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (_isIterable(Object(arr))) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; - })(); - exports.__esModule = true; - global.define = __define; - return module.exports; -}); - -$__System.register('15', ['16'], function (_export) { - 'use strict'; - - var EventEmitter, bootsrEmmiter, langChanged, redocEvents; - return { - setters: [function (_) { - EventEmitter = _.EventEmitter; - }], - execute: function () { - bootsrEmmiter = new EventEmitter(); - langChanged = new EventEmitter(); - redocEvents = { - bootstrapped: bootsrEmmiter, - samplesLanguageChanged: langChanged - }; - - _export('redocEvents', redocEvents); - } - }; -}); -$__System.registerDynamic("36", ["37", "2b", "38", "39", "3a"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; + var define, + global = this, + GLOBAL = this; var __extends = (this && this.__extends) || function(d, b) { for (var p in b) if (b.hasOwnProperty(p)) @@ -8452,858 +6890,600 @@ $__System.registerDynamic("36", ["37", "2b", "38", "39", "3a"], true, function($ } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var dom_adapter_1 = $__require('37'); - var lang_1 = $__require('2b'); - var collection_1 = $__require('38'); - var event_manager_1 = $__require('39'); - var di_1 = $__require('3a'); - var modifierKeys = ['alt', 'control', 'meta', 'shift']; - var modifierKeyGetters = { - 'alt': function(event) { - return event.altKey; - }, - 'control': function(event) { - return event.ctrlKey; - }, - 'meta': function(event) { - return event.metaKey; - }, - 'shift': function(event) { - return event.shiftKey; + var BaseWrappedException = (function(_super) { + __extends(BaseWrappedException, _super); + function BaseWrappedException(message) { + _super.call(this, message); } - }; - var KeyEventsPlugin = (function(_super) { - __extends(KeyEventsPlugin, _super); - function KeyEventsPlugin() { - _super.call(this); - } - KeyEventsPlugin.prototype.supports = function(eventName) { - return lang_1.isPresent(KeyEventsPlugin.parseEventName(eventName)); - }; - KeyEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { - var parsedEvent = KeyEventsPlugin.parseEventName(eventName); - var outsideHandler = KeyEventsPlugin.eventCallback(element, collection_1.StringMapWrapper.get(parsedEvent, 'fullKey'), handler, this.manager.getZone()); - return this.manager.getZone().runOutsideAngular(function() { - return dom_adapter_1.DOM.onAndCancel(element, collection_1.StringMapWrapper.get(parsedEvent, 'domEventName'), outsideHandler); - }); - }; - KeyEventsPlugin.parseEventName = function(eventName) { - var parts = eventName.toLowerCase().split('.'); - var domEventName = parts.shift(); - if ((parts.length === 0) || !(lang_1.StringWrapper.equals(domEventName, 'keydown') || lang_1.StringWrapper.equals(domEventName, 'keyup'))) { - return null; - } - var key = KeyEventsPlugin._normalizeKey(parts.pop()); - var fullKey = ''; - modifierKeys.forEach(function(modifierName) { - if (collection_1.ListWrapper.contains(parts, modifierName)) { - collection_1.ListWrapper.remove(parts, modifierName); - fullKey += modifierName + '.'; - } - }); - fullKey += key; - if (parts.length != 0 || key.length === 0) { - return null; - } - var result = collection_1.StringMapWrapper.create(); - collection_1.StringMapWrapper.set(result, 'domEventName', domEventName); - collection_1.StringMapWrapper.set(result, 'fullKey', fullKey); - return result; - }; - KeyEventsPlugin.getEventFullKey = function(event) { - var fullKey = ''; - var key = dom_adapter_1.DOM.getEventKey(event); - key = key.toLowerCase(); - if (lang_1.StringWrapper.equals(key, ' ')) { - key = 'space'; - } else if (lang_1.StringWrapper.equals(key, '.')) { - key = 'dot'; - } - modifierKeys.forEach(function(modifierName) { - if (modifierName != key) { - var modifierGetter = collection_1.StringMapWrapper.get(modifierKeyGetters, modifierName); - if (modifierGetter(event)) { - fullKey += modifierName + '.'; - } - } - }); - fullKey += key; - return fullKey; - }; - KeyEventsPlugin.eventCallback = function(element, fullKey, handler, zone) { - return function(event) { - if (lang_1.StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { - zone.runGuarded(function() { - return handler(event); - }); - } - }; - }; - KeyEventsPlugin._normalizeKey = function(keyName) { - switch (keyName) { - case 'esc': - return 'escape'; - default: - return keyName; - } - }; - KeyEventsPlugin = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], KeyEventsPlugin); - return KeyEventsPlugin; - }(event_manager_1.EventManagerPlugin)); - exports.KeyEventsPlugin = KeyEventsPlugin; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("3b", ["38", "2b", "37", "3c"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var collection_1 = $__require('38'); - var lang_1 = $__require('2b'); - var dom_adapter_1 = $__require('37'); - var xhr_impl_1 = $__require('3c'); - var GenericBrowserDomAdapter = (function(_super) { - __extends(GenericBrowserDomAdapter, _super); - function GenericBrowserDomAdapter() { - var _this = this; - _super.call(this); - this._animationPrefix = null; - this._transitionEnd = null; - try { - var element = this.createElement('div', this.defaultDoc()); - if (lang_1.isPresent(this.getStyle(element, 'animationName'))) { - this._animationPrefix = ''; - } else { - var domPrefixes = ['Webkit', 'Moz', 'O', 'ms']; - for (var i = 0; i < domPrefixes.length; i++) { - if (lang_1.isPresent(this.getStyle(element, domPrefixes[i] + 'AnimationName'))) { - this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-'; - break; - } - } - } - var transEndEventNames = { - WebkitTransition: 'webkitTransitionEnd', - MozTransition: 'transitionend', - OTransition: 'oTransitionEnd otransitionend', - transition: 'transitionend' - }; - collection_1.StringMapWrapper.forEach(transEndEventNames, function(value, key) { - if (lang_1.isPresent(_this.getStyle(element, key))) { - _this._transitionEnd = value; - } - }); - } catch (e) { - this._animationPrefix = null; - this._transitionEnd = null; - } - } - GenericBrowserDomAdapter.prototype.getXHR = function() { - return xhr_impl_1.XHRImpl; - }; - GenericBrowserDomAdapter.prototype.getDistributedNodes = function(el) { - return el.getDistributedNodes(); - }; - GenericBrowserDomAdapter.prototype.resolveAndSetHref = function(el, baseUrl, href) { - el.href = href == null ? baseUrl : baseUrl + '/../' + href; - }; - GenericBrowserDomAdapter.prototype.supportsDOMEvents = function() { - return true; - }; - GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM = function() { - return lang_1.isFunction(this.defaultDoc().body.createShadowRoot); - }; - GenericBrowserDomAdapter.prototype.getAnimationPrefix = function() { - return lang_1.isPresent(this._animationPrefix) ? this._animationPrefix : ""; - }; - GenericBrowserDomAdapter.prototype.getTransitionEnd = function() { - return lang_1.isPresent(this._transitionEnd) ? this._transitionEnd : ""; - }; - GenericBrowserDomAdapter.prototype.supportsAnimation = function() { - return lang_1.isPresent(this._animationPrefix) && lang_1.isPresent(this._transitionEnd); - }; - return GenericBrowserDomAdapter; - }(dom_adapter_1.DomAdapter)); - exports.GenericBrowserDomAdapter = GenericBrowserDomAdapter; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("3d", ["38", "2b", "37", "3b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var collection_1 = $__require('38'); - var lang_1 = $__require('2b'); - var dom_adapter_1 = $__require('37'); - var generic_browser_adapter_1 = $__require('3b'); - var _attrToPropMap = { - 'class': 'className', - 'innerHtml': 'innerHTML', - 'readonly': 'readOnly', - 'tabindex': 'tabIndex' - }; - var DOM_KEY_LOCATION_NUMPAD = 3; - var _keyMap = { - '\b': 'Backspace', - '\t': 'Tab', - '\x7F': 'Delete', - '\x1B': 'Escape', - 'Del': 'Delete', - 'Esc': 'Escape', - 'Left': 'ArrowLeft', - 'Right': 'ArrowRight', - 'Up': 'ArrowUp', - 'Down': 'ArrowDown', - 'Menu': 'ContextMenu', - 'Scroll': 'ScrollLock', - 'Win': 'OS' - }; - var _chromeNumKeyPadMap = { - 'A': '1', - 'B': '2', - 'C': '3', - 'D': '4', - 'E': '5', - 'F': '6', - 'G': '7', - 'H': '8', - 'I': '9', - 'J': '*', - 'K': '+', - 'M': '-', - 'N': '.', - 'O': '/', - '\x60': '0', - '\x90': 'NumLock' - }; - var BrowserDomAdapter = (function(_super) { - __extends(BrowserDomAdapter, _super); - function BrowserDomAdapter() { - _super.apply(this, arguments); - } - BrowserDomAdapter.prototype.parse = function(templateHtml) { - throw new Error("parse not implemented"); - }; - BrowserDomAdapter.makeCurrent = function() { - dom_adapter_1.setRootDomAdapter(new BrowserDomAdapter()); - }; - BrowserDomAdapter.prototype.hasProperty = function(element, name) { - return name in element; - }; - BrowserDomAdapter.prototype.setProperty = function(el, name, value) { - el[name] = value; - }; - BrowserDomAdapter.prototype.getProperty = function(el, name) { - return el[name]; - }; - BrowserDomAdapter.prototype.invoke = function(el, methodName, args) { - el[methodName].apply(el, args); - }; - BrowserDomAdapter.prototype.logError = function(error) { - if (window.console.error) { - window.console.error(error); - } else { - window.console.log(error); - } - }; - BrowserDomAdapter.prototype.log = function(error) { - window.console.log(error); - }; - BrowserDomAdapter.prototype.logGroup = function(error) { - if (window.console.group) { - window.console.group(error); - this.logError(error); - } else { - window.console.log(error); - } - }; - BrowserDomAdapter.prototype.logGroupEnd = function() { - if (window.console.groupEnd) { - window.console.groupEnd(); - } - }; - Object.defineProperty(BrowserDomAdapter.prototype, "attrToPropMap", { + Object.defineProperty(BaseWrappedException.prototype, "wrapperMessage", { get: function() { - return _attrToPropMap; + return ''; }, enumerable: true, configurable: true }); - BrowserDomAdapter.prototype.query = function(selector) { - return document.querySelector(selector); - }; - BrowserDomAdapter.prototype.querySelector = function(el, selector) { - return el.querySelector(selector); - }; - BrowserDomAdapter.prototype.querySelectorAll = function(el, selector) { - return el.querySelectorAll(selector); - }; - BrowserDomAdapter.prototype.on = function(el, evt, listener) { - el.addEventListener(evt, listener, false); - }; - BrowserDomAdapter.prototype.onAndCancel = function(el, evt, listener) { - el.addEventListener(evt, listener, false); - return function() { - el.removeEventListener(evt, listener, false); - }; - }; - BrowserDomAdapter.prototype.dispatchEvent = function(el, evt) { - el.dispatchEvent(evt); - }; - BrowserDomAdapter.prototype.createMouseEvent = function(eventType) { - var evt = document.createEvent('MouseEvent'); - evt.initEvent(eventType, true, true); - return evt; - }; - BrowserDomAdapter.prototype.createEvent = function(eventType) { - var evt = document.createEvent('Event'); - evt.initEvent(eventType, true, true); - return evt; - }; - BrowserDomAdapter.prototype.preventDefault = function(evt) { - evt.preventDefault(); - evt.returnValue = false; - }; - BrowserDomAdapter.prototype.isPrevented = function(evt) { - return evt.defaultPrevented || lang_1.isPresent(evt.returnValue) && !evt.returnValue; - }; - BrowserDomAdapter.prototype.getInnerHTML = function(el) { - return el.innerHTML; - }; - BrowserDomAdapter.prototype.getOuterHTML = function(el) { - return el.outerHTML; - }; - BrowserDomAdapter.prototype.nodeName = function(node) { - return node.nodeName; - }; - BrowserDomAdapter.prototype.nodeValue = function(node) { - return node.nodeValue; - }; - BrowserDomAdapter.prototype.type = function(node) { - return node.type; - }; - BrowserDomAdapter.prototype.content = function(node) { - if (this.hasProperty(node, "content")) { - return node.content; - } else { - return node; + Object.defineProperty(BaseWrappedException.prototype, "wrapperStack", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseWrappedException.prototype, "originalException", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseWrappedException.prototype, "originalStack", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseWrappedException.prototype, "context", { + get: function() { + return null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseWrappedException.prototype, "message", { + get: function() { + return ''; + }, + enumerable: true, + configurable: true + }); + return BaseWrappedException; + }(Error)); + exports.BaseWrappedException = BaseWrappedException; + return module.exports; +}); + +$__System.registerDynamic("4", ["5"], true, function($__require, exports, module) { + "use strict"; + ; + var define, + global = this, + GLOBAL = this; + var lang_1 = $__require('5'); + exports.Map = lang_1.global.Map; + exports.Set = lang_1.global.Set; + var createMapFromPairs = (function() { + try { + if (new exports.Map([[1, 2]]).size === 1) { + return function createMapFromPairs(pairs) { + return new exports.Map(pairs); + }; } - }; - BrowserDomAdapter.prototype.firstChild = function(el) { - return el.firstChild; - }; - BrowserDomAdapter.prototype.nextSibling = function(el) { - return el.nextSibling; - }; - BrowserDomAdapter.prototype.parentElement = function(el) { - return el.parentNode; - }; - BrowserDomAdapter.prototype.childNodes = function(el) { - return el.childNodes; - }; - BrowserDomAdapter.prototype.childNodesAsList = function(el) { - var childNodes = el.childNodes; - var res = collection_1.ListWrapper.createFixedSize(childNodes.length); - for (var i = 0; i < childNodes.length; i++) { - res[i] = childNodes[i]; + } catch (e) {} + return function createMapAndPopulateFromPairs(pairs) { + var map = new exports.Map(); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + map.set(pair[0], pair[1]); } - return res; + return map; }; - BrowserDomAdapter.prototype.clearNodes = function(el) { - while (el.firstChild) { - el.removeChild(el.firstChild); + })(); + var createMapFromMap = (function() { + try { + if (new exports.Map(new exports.Map())) { + return function createMapFromMap(m) { + return new exports.Map(m); + }; } - }; - BrowserDomAdapter.prototype.appendChild = function(el, node) { - el.appendChild(node); - }; - BrowserDomAdapter.prototype.removeChild = function(el, node) { - el.removeChild(node); - }; - BrowserDomAdapter.prototype.replaceChild = function(el, newChild, oldChild) { - el.replaceChild(newChild, oldChild); - }; - BrowserDomAdapter.prototype.remove = function(node) { - if (node.parentNode) { - node.parentNode.removeChild(node); - } - return node; - }; - BrowserDomAdapter.prototype.insertBefore = function(el, node) { - el.parentNode.insertBefore(node, el); - }; - BrowserDomAdapter.prototype.insertAllBefore = function(el, nodes) { - nodes.forEach(function(n) { - return el.parentNode.insertBefore(n, el); + } catch (e) {} + return function createMapAndPopulateFromMap(m) { + var map = new exports.Map(); + m.forEach(function(v, k) { + map.set(k, v); }); + return map; }; - BrowserDomAdapter.prototype.insertAfter = function(el, node) { - el.parentNode.insertBefore(node, el.nextSibling); - }; - BrowserDomAdapter.prototype.setInnerHTML = function(el, value) { - el.innerHTML = value; - }; - BrowserDomAdapter.prototype.getText = function(el) { - return el.textContent; - }; - BrowserDomAdapter.prototype.setText = function(el, value) { - el.textContent = value; - }; - BrowserDomAdapter.prototype.getValue = function(el) { - return el.value; - }; - BrowserDomAdapter.prototype.setValue = function(el, value) { - el.value = value; - }; - BrowserDomAdapter.prototype.getChecked = function(el) { - return el.checked; - }; - BrowserDomAdapter.prototype.setChecked = function(el, value) { - el.checked = value; - }; - BrowserDomAdapter.prototype.createComment = function(text) { - return document.createComment(text); - }; - BrowserDomAdapter.prototype.createTemplate = function(html) { - var t = document.createElement('template'); - t.innerHTML = html; - return t; - }; - BrowserDomAdapter.prototype.createElement = function(tagName, doc) { - if (doc === void 0) { - doc = document; - } - return doc.createElement(tagName); - }; - BrowserDomAdapter.prototype.createElementNS = function(ns, tagName, doc) { - if (doc === void 0) { - doc = document; - } - return doc.createElementNS(ns, tagName); - }; - BrowserDomAdapter.prototype.createTextNode = function(text, doc) { - if (doc === void 0) { - doc = document; - } - return doc.createTextNode(text); - }; - BrowserDomAdapter.prototype.createScriptTag = function(attrName, attrValue, doc) { - if (doc === void 0) { - doc = document; - } - var el = doc.createElement('SCRIPT'); - el.setAttribute(attrName, attrValue); - return el; - }; - BrowserDomAdapter.prototype.createStyleElement = function(css, doc) { - if (doc === void 0) { - doc = document; - } - var style = doc.createElement('style'); - this.appendChild(style, this.createTextNode(css)); - return style; - }; - BrowserDomAdapter.prototype.createShadowRoot = function(el) { - return el.createShadowRoot(); - }; - BrowserDomAdapter.prototype.getShadowRoot = function(el) { - return el.shadowRoot; - }; - BrowserDomAdapter.prototype.getHost = function(el) { - return el.host; - }; - BrowserDomAdapter.prototype.clone = function(node) { - return node.cloneNode(true); - }; - BrowserDomAdapter.prototype.getElementsByClassName = function(element, name) { - return element.getElementsByClassName(name); - }; - BrowserDomAdapter.prototype.getElementsByTagName = function(element, name) { - return element.getElementsByTagName(name); - }; - BrowserDomAdapter.prototype.classList = function(element) { - return Array.prototype.slice.call(element.classList, 0); - }; - BrowserDomAdapter.prototype.addClass = function(element, className) { - element.classList.add(className); - }; - BrowserDomAdapter.prototype.removeClass = function(element, className) { - element.classList.remove(className); - }; - BrowserDomAdapter.prototype.hasClass = function(element, className) { - return element.classList.contains(className); - }; - BrowserDomAdapter.prototype.setStyle = function(element, styleName, styleValue) { - element.style[styleName] = styleValue; - }; - BrowserDomAdapter.prototype.removeStyle = function(element, stylename) { - element.style[stylename] = null; - }; - BrowserDomAdapter.prototype.getStyle = function(element, stylename) { - return element.style[stylename]; - }; - BrowserDomAdapter.prototype.hasStyle = function(element, styleName, styleValue) { - if (styleValue === void 0) { - styleValue = null; - } - var value = this.getStyle(element, styleName) || ''; - return styleValue ? value == styleValue : value.length > 0; - }; - BrowserDomAdapter.prototype.tagName = function(element) { - return element.tagName; - }; - BrowserDomAdapter.prototype.attributeMap = function(element) { - var res = new Map(); - var elAttrs = element.attributes; - for (var i = 0; i < elAttrs.length; i++) { - var attrib = elAttrs[i]; - res.set(attrib.name, attrib.value); + })(); + var _clearValues = (function() { + if ((new exports.Map()).keys().next) { + return function _clearValues(m) { + var keyIterator = m.keys(); + var k; + while (!((k = keyIterator.next()).done)) { + m.set(k.value, null); + } + }; + } else { + return function _clearValuesWithForeEach(m) { + m.forEach(function(v, k) { + m.set(k, null); + }); + }; + } + })(); + var _arrayFromMap = (function() { + try { + if ((new exports.Map()).values().next) { + return function createArrayFromMap(m, getValues) { + return getValues ? Array.from(m.values()) : Array.from(m.keys()); + }; } + } catch (e) {} + return function createArrayFromMapWithForeach(m, getValues) { + var res = ListWrapper.createFixedSize(m.size), + i = 0; + m.forEach(function(v, k) { + res[i] = getValues ? v : k; + i++; + }); return res; }; - BrowserDomAdapter.prototype.hasAttribute = function(element, attribute) { - return element.hasAttribute(attribute); + })(); + var MapWrapper = (function() { + function MapWrapper() {} + MapWrapper.clone = function(m) { + return createMapFromMap(m); }; - BrowserDomAdapter.prototype.hasAttributeNS = function(element, ns, attribute) { - return element.hasAttributeNS(ns, attribute); - }; - BrowserDomAdapter.prototype.getAttribute = function(element, attribute) { - return element.getAttribute(attribute); - }; - BrowserDomAdapter.prototype.getAttributeNS = function(element, ns, name) { - return element.getAttributeNS(ns, name); - }; - BrowserDomAdapter.prototype.setAttribute = function(element, name, value) { - element.setAttribute(name, value); - }; - BrowserDomAdapter.prototype.setAttributeNS = function(element, ns, name, value) { - element.setAttributeNS(ns, name, value); - }; - BrowserDomAdapter.prototype.removeAttribute = function(element, attribute) { - element.removeAttribute(attribute); - }; - BrowserDomAdapter.prototype.removeAttributeNS = function(element, ns, name) { - element.removeAttributeNS(ns, name); - }; - BrowserDomAdapter.prototype.templateAwareRoot = function(el) { - return this.isTemplateElement(el) ? this.content(el) : el; - }; - BrowserDomAdapter.prototype.createHtmlDocument = function() { - return document.implementation.createHTMLDocument('fakeTitle'); - }; - BrowserDomAdapter.prototype.defaultDoc = function() { - return document; - }; - BrowserDomAdapter.prototype.getBoundingClientRect = function(el) { - try { - return el.getBoundingClientRect(); - } catch (e) { - return { - top: 0, - bottom: 0, - left: 0, - right: 0, - width: 0, - height: 0 - }; + MapWrapper.createFromStringMap = function(stringMap) { + var result = new exports.Map(); + for (var prop in stringMap) { + result.set(prop, stringMap[prop]); } + return result; }; - BrowserDomAdapter.prototype.getTitle = function() { - return document.title; + MapWrapper.toStringMap = function(m) { + var r = {}; + m.forEach(function(v, k) { + return r[k] = v; + }); + return r; }; - BrowserDomAdapter.prototype.setTitle = function(newTitle) { - document.title = newTitle || ''; + MapWrapper.createFromPairs = function(pairs) { + return createMapFromPairs(pairs); }; - BrowserDomAdapter.prototype.elementMatches = function(n, selector) { - var matches = false; - if (n instanceof HTMLElement) { - if (n.matches) { - matches = n.matches(selector); - } else if (n.msMatchesSelector) { - matches = n.msMatchesSelector(selector); - } else if (n.webkitMatchesSelector) { - matches = n.webkitMatchesSelector(selector); + MapWrapper.clearValues = function(m) { + _clearValues(m); + }; + MapWrapper.iterable = function(m) { + return m; + }; + MapWrapper.keys = function(m) { + return _arrayFromMap(m, false); + }; + MapWrapper.values = function(m) { + return _arrayFromMap(m, true); + }; + return MapWrapper; + }()); + exports.MapWrapper = MapWrapper; + var StringMapWrapper = (function() { + function StringMapWrapper() {} + StringMapWrapper.create = function() { + return {}; + }; + StringMapWrapper.contains = function(map, key) { + return map.hasOwnProperty(key); + }; + StringMapWrapper.get = function(map, key) { + return map.hasOwnProperty(key) ? map[key] : undefined; + }; + StringMapWrapper.set = function(map, key, value) { + map[key] = value; + }; + StringMapWrapper.keys = function(map) { + return Object.keys(map); + }; + StringMapWrapper.values = function(map) { + return Object.keys(map).reduce(function(r, a) { + r.push(map[a]); + return r; + }, []); + }; + StringMapWrapper.isEmpty = function(map) { + for (var prop in map) { + return false; + } + return true; + }; + StringMapWrapper.delete = function(map, key) { + delete map[key]; + }; + StringMapWrapper.forEach = function(map, callback) { + for (var prop in map) { + if (map.hasOwnProperty(prop)) { + callback(map[prop], prop); } } - return matches; }; - BrowserDomAdapter.prototype.isTemplateElement = function(el) { - return el instanceof HTMLElement && el.nodeName == "TEMPLATE"; - }; - BrowserDomAdapter.prototype.isTextNode = function(node) { - return node.nodeType === Node.TEXT_NODE; - }; - BrowserDomAdapter.prototype.isCommentNode = function(node) { - return node.nodeType === Node.COMMENT_NODE; - }; - BrowserDomAdapter.prototype.isElementNode = function(node) { - return node.nodeType === Node.ELEMENT_NODE; - }; - BrowserDomAdapter.prototype.hasShadowRoot = function(node) { - return node instanceof HTMLElement && lang_1.isPresent(node.shadowRoot); - }; - BrowserDomAdapter.prototype.isShadowRoot = function(node) { - return node instanceof DocumentFragment; - }; - BrowserDomAdapter.prototype.importIntoDoc = function(node) { - var toImport = node; - if (this.isTemplateElement(node)) { - toImport = this.content(node); - } - return document.importNode(toImport, true); - }; - BrowserDomAdapter.prototype.adoptNode = function(node) { - return document.adoptNode(node); - }; - BrowserDomAdapter.prototype.getHref = function(el) { - return el.href; - }; - BrowserDomAdapter.prototype.getEventKey = function(event) { - var key = event.key; - if (lang_1.isBlank(key)) { - key = event.keyIdentifier; - if (lang_1.isBlank(key)) { - return 'Unidentified'; - } - if (key.startsWith('U+')) { - key = String.fromCharCode(parseInt(key.substring(2), 16)); - if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) { - key = _chromeNumKeyPadMap[key]; - } + StringMapWrapper.merge = function(m1, m2) { + var m = {}; + for (var attr in m1) { + if (m1.hasOwnProperty(attr)) { + m[attr] = m1[attr]; } } - if (_keyMap.hasOwnProperty(key)) { - key = _keyMap[key]; + for (var attr in m2) { + if (m2.hasOwnProperty(attr)) { + m[attr] = m2[attr]; + } } - return key; + return m; }; - BrowserDomAdapter.prototype.getGlobalEventTarget = function(target) { - if (target == "window") { - return window; - } else if (target == "document") { - return document; - } else if (target == "body") { - return document.body; + StringMapWrapper.equals = function(m1, m2) { + var k1 = Object.keys(m1); + var k2 = Object.keys(m2); + if (k1.length != k2.length) { + return false; + } + var key; + for (var i = 0; i < k1.length; i++) { + key = k1[i]; + if (m1[key] !== m2[key]) { + return false; + } + } + return true; + }; + return StringMapWrapper; + }()); + exports.StringMapWrapper = StringMapWrapper; + var ListWrapper = (function() { + function ListWrapper() {} + ListWrapper.createFixedSize = function(size) { + return new Array(size); + }; + ListWrapper.createGrowableSize = function(size) { + return new Array(size); + }; + ListWrapper.clone = function(array) { + return array.slice(0); + }; + ListWrapper.forEachWithIndex = function(array, fn) { + for (var i = 0; i < array.length; i++) { + fn(array[i], i); } }; - BrowserDomAdapter.prototype.getHistory = function() { - return window.history; - }; - BrowserDomAdapter.prototype.getLocation = function() { - return window.location; - }; - BrowserDomAdapter.prototype.getBaseHref = function() { - var href = getBaseElementHref(); - if (lang_1.isBlank(href)) { + ListWrapper.first = function(array) { + if (!array) return null; + return array[0]; + }; + ListWrapper.last = function(array) { + if (!array || array.length == 0) + return null; + return array[array.length - 1]; + }; + ListWrapper.indexOf = function(array, value, startIndex) { + if (startIndex === void 0) { + startIndex = 0; } - return relativePath(href); + return array.indexOf(value, startIndex); }; - BrowserDomAdapter.prototype.resetBaseElement = function() { - baseElement = null; + ListWrapper.contains = function(list, el) { + return list.indexOf(el) !== -1; }; - BrowserDomAdapter.prototype.getUserAgent = function() { - return window.navigator.userAgent; + ListWrapper.reversed = function(array) { + var a = ListWrapper.clone(array); + return a.reverse(); }; - BrowserDomAdapter.prototype.setData = function(element, name, value) { - this.setAttribute(element, 'data-' + name, value); + ListWrapper.concat = function(a, b) { + return a.concat(b); }; - BrowserDomAdapter.prototype.getData = function(element, name) { - return this.getAttribute(element, 'data-' + name); + ListWrapper.insert = function(list, index, value) { + list.splice(index, 0, value); }; - BrowserDomAdapter.prototype.getComputedStyle = function(element) { - return getComputedStyle(element); + ListWrapper.removeAt = function(list, index) { + var res = list[index]; + list.splice(index, 1); + return res; }; - BrowserDomAdapter.prototype.setGlobalVar = function(path, value) { - lang_1.setValueOnPath(lang_1.global, path, value); + ListWrapper.removeAll = function(list, items) { + for (var i = 0; i < items.length; ++i) { + var index = list.indexOf(items[i]); + list.splice(index, 1); + } }; - BrowserDomAdapter.prototype.requestAnimationFrame = function(callback) { - return window.requestAnimationFrame(callback); + ListWrapper.remove = function(list, el) { + var index = list.indexOf(el); + if (index > -1) { + list.splice(index, 1); + return true; + } + return false; }; - BrowserDomAdapter.prototype.cancelAnimationFrame = function(id) { - window.cancelAnimationFrame(id); + ListWrapper.clear = function(list) { + list.length = 0; }; - BrowserDomAdapter.prototype.performanceNow = function() { - if (lang_1.isPresent(window.performance) && lang_1.isPresent(window.performance.now)) { - return window.performance.now(); + ListWrapper.isEmpty = function(list) { + return list.length == 0; + }; + ListWrapper.fill = function(list, value, start, end) { + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = null; + } + list.fill(value, start, end === null ? list.length : end); + }; + ListWrapper.equals = function(a, b) { + if (a.length != b.length) + return false; + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) + return false; + } + return true; + }; + ListWrapper.slice = function(l, from, to) { + if (from === void 0) { + from = 0; + } + if (to === void 0) { + to = null; + } + return l.slice(from, to === null ? undefined : to); + }; + ListWrapper.splice = function(l, from, length) { + return l.splice(from, length); + }; + ListWrapper.sort = function(l, compareFn) { + if (lang_1.isPresent(compareFn)) { + l.sort(compareFn); } else { - return lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); + l.sort(); } }; - return BrowserDomAdapter; - }(generic_browser_adapter_1.GenericBrowserDomAdapter)); - exports.BrowserDomAdapter = BrowserDomAdapter; - var baseElement = null; - function getBaseElementHref() { - if (lang_1.isBlank(baseElement)) { - baseElement = document.querySelector('base'); - if (lang_1.isBlank(baseElement)) { + ListWrapper.toString = function(l) { + return l.toString(); + }; + ListWrapper.toJSON = function(l) { + return JSON.stringify(l); + }; + ListWrapper.maximum = function(list, predicate) { + if (list.length == 0) { return null; } - } - return baseElement.getAttribute('href'); - } - var urlParsingNode = null; - function relativePath(url) { - if (lang_1.isBlank(urlParsingNode)) { - urlParsingNode = document.createElement("a"); - } - urlParsingNode.setAttribute('href', url); - return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname; - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("3e", ["38", "2b", "37", "16"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var collection_1 = $__require('38'); - var lang_1 = $__require('2b'); - var dom_adapter_1 = $__require('37'); - var core_1 = $__require('16'); - var PublicTestability = (function() { - function PublicTestability(testability) { - this._testability = testability; - } - PublicTestability.prototype.isStable = function() { - return this._testability.isStable(); + var solution = null; + var maxValue = -Infinity; + for (var index = 0; index < list.length; index++) { + var candidate = list[index]; + if (lang_1.isBlank(candidate)) { + continue; + } + var candidateValue = predicate(candidate); + if (candidateValue > maxValue) { + solution = candidate; + maxValue = candidateValue; + } + } + return solution; }; - PublicTestability.prototype.whenStable = function(callback) { - this._testability.whenStable(callback); + ListWrapper.flatten = function(list) { + var target = []; + _flattenArray(list, target); + return target; }; - PublicTestability.prototype.findBindings = function(using, provider, exactMatch) { - return this.findProviders(using, provider, exactMatch); + ListWrapper.addAll = function(list, source) { + for (var i = 0; i < source.length; i++) { + list.push(source[i]); + } }; - PublicTestability.prototype.findProviders = function(using, provider, exactMatch) { - return this._testability.findBindings(using, provider, exactMatch); - }; - return PublicTestability; + return ListWrapper; }()); - var BrowserGetTestability = (function() { - function BrowserGetTestability() {} - BrowserGetTestability.init = function() { - core_1.setTestabilityGetter(new BrowserGetTestability()); - }; - BrowserGetTestability.prototype.addToWindow = function(registry) { - lang_1.global.getAngularTestability = function(elem, findInAncestors) { - if (findInAncestors === void 0) { - findInAncestors = true; + exports.ListWrapper = ListWrapper; + function _flattenArray(source, target) { + if (lang_1.isPresent(source)) { + for (var i = 0; i < source.length; i++) { + var item = source[i]; + if (lang_1.isArray(item)) { + _flattenArray(item, target); + } else { + target.push(item); } - var testability = registry.findTestabilityInTree(elem, findInAncestors); - if (testability == null) { - throw new Error('Could not find testability for element.'); - } - return new PublicTestability(testability); + } + } + return target; + } + function isListLikeIterable(obj) { + if (!lang_1.isJsObject(obj)) + return false; + return lang_1.isArray(obj) || (!(obj instanceof exports.Map) && lang_1.getSymbolIterator() in obj); + } + exports.isListLikeIterable = isListLikeIterable; + function areIterablesEqual(a, b, comparator) { + var iterator1 = a[lang_1.getSymbolIterator()](); + var iterator2 = b[lang_1.getSymbolIterator()](); + while (true) { + var item1 = iterator1.next(); + var item2 = iterator2.next(); + if (item1.done && item2.done) + return true; + if (item1.done || item2.done) + return false; + if (!comparator(item1.value, item2.value)) + return false; + } + } + exports.areIterablesEqual = areIterablesEqual; + function iterateListLike(obj, fn) { + if (lang_1.isArray(obj)) { + for (var i = 0; i < obj.length; i++) { + fn(obj[i]); + } + } else { + var iterator = obj[lang_1.getSymbolIterator()](); + var item; + while (!((item = iterator.next()).done)) { + fn(item.value); + } + } + } + exports.iterateListLike = iterateListLike; + var createSetFromList = (function() { + var test = new exports.Set([1, 2, 3]); + if (test.size === 3) { + return function createSetFromList(lst) { + return new exports.Set(lst); }; - lang_1.global.getAllAngularTestabilities = function() { - var testabilities = registry.getAllTestabilities(); - return testabilities.map(function(testability) { - return new PublicTestability(testability); - }); - }; - lang_1.global.getAllAngularRootElements = function() { - return registry.getAllRootElements(); - }; - var whenAllStable = function(callback) { - var testabilities = lang_1.global.getAllAngularTestabilities(); - var count = testabilities.length; - var didWork = false; - var decrement = function(didWork_) { - didWork = didWork || didWork_; - count--; - if (count == 0) { - callback(didWork); + } else { + return function createSetAndPopulateFromList(lst) { + var res = new exports.Set(lst); + if (res.size !== lst.length) { + for (var i = 0; i < lst.length; i++) { + res.add(lst[i]); } - }; - testabilities.forEach(function(testability) { - testability.whenStable(decrement); - }); + } + return res; }; - if (!lang_1.global.frameworkStabilizers) { - lang_1.global.frameworkStabilizers = collection_1.ListWrapper.createGrowableSize(0); - } - lang_1.global.frameworkStabilizers.push(whenAllStable); + } + })(); + var SetWrapper = (function() { + function SetWrapper() {} + SetWrapper.createFromList = function(lst) { + return createSetFromList(lst); }; - BrowserGetTestability.prototype.findTestabilityInTree = function(registry, elem, findInAncestors) { - if (elem == null) { - return null; - } - var t = registry.getTestability(elem); - if (lang_1.isPresent(t)) { - return t; - } else if (!findInAncestors) { - return null; - } - if (dom_adapter_1.DOM.isShadowRoot(elem)) { - return this.findTestabilityInTree(registry, dom_adapter_1.DOM.getHost(elem), true); - } - return this.findTestabilityInTree(registry, dom_adapter_1.DOM.parentElement(elem), true); + SetWrapper.has = function(s, key) { + return s.has(key); }; - return BrowserGetTestability; + SetWrapper.delete = function(m, k) { + m.delete(k); + }; + return SetWrapper; }()); - exports.BrowserGetTestability = BrowserGetTestability; - global.define = __define; + exports.SetWrapper = SetWrapper; return module.exports; }); -$__System.registerDynamic("3f", ["40", "41", "2b", "42"], true, function($__require, exports, module) { +$__System.registerDynamic("6", ["5", "3", "4"], true, function($__require, exports, module) { "use strict"; ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; + var define, + global = this, + GLOBAL = this; + var lang_1 = $__require('5'); + var base_wrapped_exception_1 = $__require('3'); + var collection_1 = $__require('4'); + var _ArrayLogger = (function() { + function _ArrayLogger() { + this.res = []; + } + _ArrayLogger.prototype.log = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logError = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroup = function(s) { + this.res.push(s); + }; + _ArrayLogger.prototype.logGroupEnd = function() {}; + ; + return _ArrayLogger; + }()); + var ExceptionHandler = (function() { + function ExceptionHandler(_logger, _rethrowException) { + if (_rethrowException === void 0) { + _rethrowException = true; + } + this._logger = _logger; + this._rethrowException = _rethrowException; + } + ExceptionHandler.exceptionToString = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var l = new _ArrayLogger(); + var e = new ExceptionHandler(l, false); + e.call(exception, stackTrace, reason); + return l.res.join("\n"); + }; + ExceptionHandler.prototype.call = function(exception, stackTrace, reason) { + if (stackTrace === void 0) { + stackTrace = null; + } + if (reason === void 0) { + reason = null; + } + var originalException = this._findOriginalException(exception); + var originalStack = this._findOriginalStack(exception); + var context = this._findContext(exception); + this._logger.logGroup("EXCEPTION: " + this._extractMessage(exception)); + if (lang_1.isPresent(stackTrace) && lang_1.isBlank(originalStack)) { + this._logger.logError("STACKTRACE:"); + this._logger.logError(this._longStackTrace(stackTrace)); + } + if (lang_1.isPresent(reason)) { + this._logger.logError("REASON: " + reason); + } + if (lang_1.isPresent(originalException)) { + this._logger.logError("ORIGINAL EXCEPTION: " + this._extractMessage(originalException)); + } + if (lang_1.isPresent(originalStack)) { + this._logger.logError("ORIGINAL STACKTRACE:"); + this._logger.logError(this._longStackTrace(originalStack)); + } + if (lang_1.isPresent(context)) { + this._logger.logError("ERROR CONTEXT:"); + this._logger.logError(context); + } + this._logger.logGroupEnd(); + if (this._rethrowException) + throw exception; + }; + ExceptionHandler.prototype._extractMessage = function(exception) { + return exception instanceof base_wrapped_exception_1.BaseWrappedException ? exception.wrapperMessage : exception.toString(); + }; + ExceptionHandler.prototype._longStackTrace = function(stackTrace) { + return collection_1.isListLikeIterable(stackTrace) ? stackTrace.join("\n\n-----async gap-----\n") : stackTrace.toString(); + }; + ExceptionHandler.prototype._findContext = function(exception) { + try { + if (!(exception instanceof base_wrapped_exception_1.BaseWrappedException)) + return null; + return lang_1.isPresent(exception.context) ? exception.context : this._findContext(exception.originalException); + } catch (e) { + return null; + } + }; + ExceptionHandler.prototype._findOriginalException = function(exception) { + if (!(exception instanceof base_wrapped_exception_1.BaseWrappedException)) + return null; + var e = exception.originalException; + while (e instanceof base_wrapped_exception_1.BaseWrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + } + return e; + }; + ExceptionHandler.prototype._findOriginalStack = function(exception) { + if (!(exception instanceof base_wrapped_exception_1.BaseWrappedException)) + return null; + var e = exception; + var stack = exception.originalStack; + while (e instanceof base_wrapped_exception_1.BaseWrappedException && lang_1.isPresent(e.originalException)) { + e = e.originalException; + if (e instanceof base_wrapped_exception_1.BaseWrappedException && lang_1.isPresent(e.originalException)) { + stack = e.originalStack; + } + } + return stack; + }; + return ExceptionHandler; + }()); + exports.ExceptionHandler = ExceptionHandler; + return module.exports; +}); + +$__System.registerDynamic("7", ["3", "6"], true, function($__require, exports, module) { "use strict"; + ; + var define, + global = this, + GLOBAL = this; var __extends = (this && this.__extends) || function(d, b) { for (var p in b) if (b.hasOwnProperty(p)) @@ -9313,10 +7493,114 @@ $__System.registerDynamic("3f", ["40", "41", "2b", "42"], true, function($__requ } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - var xhr_1 = $__require('40'); - var exceptions_1 = $__require('41'); - var lang_1 = $__require('2b'); - var promise_1 = $__require('42'); + var base_wrapped_exception_1 = $__require('3'); + var exception_handler_1 = $__require('6'); + var exception_handler_2 = $__require('6'); + exports.ExceptionHandler = exception_handler_2.ExceptionHandler; + var BaseException = (function(_super) { + __extends(BaseException, _super); + function BaseException(message) { + if (message === void 0) { + message = "--"; + } + _super.call(this, message); + this.message = message; + this.stack = (new Error(message)).stack; + } + BaseException.prototype.toString = function() { + return this.message; + }; + return BaseException; + }(Error)); + exports.BaseException = BaseException; + var WrappedException = (function(_super) { + __extends(WrappedException, _super); + function WrappedException(_wrapperMessage, _originalException, _originalStack, _context) { + _super.call(this, _wrapperMessage); + this._wrapperMessage = _wrapperMessage; + this._originalException = _originalException; + this._originalStack = _originalStack; + this._context = _context; + this._wrapperStack = (new Error(_wrapperMessage)).stack; + } + Object.defineProperty(WrappedException.prototype, "wrapperMessage", { + get: function() { + return this._wrapperMessage; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "wrapperStack", { + get: function() { + return this._wrapperStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalException", { + get: function() { + return this._originalException; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "originalStack", { + get: function() { + return this._originalStack; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "context", { + get: function() { + return this._context; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WrappedException.prototype, "message", { + get: function() { + return exception_handler_1.ExceptionHandler.exceptionToString(this); + }, + enumerable: true, + configurable: true + }); + WrappedException.prototype.toString = function() { + return this.message; + }; + return WrappedException; + }(base_wrapped_exception_1.BaseWrappedException)); + exports.WrappedException = WrappedException; + function makeTypeError(message) { + return new TypeError(message); + } + exports.makeTypeError = makeTypeError; + function unimplemented() { + throw new BaseException('unimplemented'); + } + exports.unimplemented = unimplemented; + return module.exports; +}); + +$__System.registerDynamic("8", ["a", "7", "5", "9"], true, function($__require, exports, module) { + "use strict"; + ; + var define, + global = this, + GLOBAL = this; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var compiler_1 = $__require('a'); + var exceptions_1 = $__require('7'); + var lang_1 = $__require('5'); + var promise_1 = $__require('9'); var CachedXHR = (function(_super) { __extends(CachedXHR, _super); function CachedXHR() { @@ -9334,1686 +7618,27 @@ $__System.registerDynamic("3f", ["40", "41", "2b", "42"], true, function($__requ } }; return CachedXHR; - }(xhr_1.XHR)); + }(compiler_1.XHR)); exports.CachedXHR = CachedXHR; - global.define = __define; return module.exports; }); -$__System.registerDynamic("43", [], true, function($__require, exports, module) { +$__System.registerDynamic("b", ["11", "c", "d", "e", "f", "10"], true, function($__require, exports, module) { "use strict"; ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - function wtfInit() {} - exports.wtfInit = wtfInit; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("44", ["37", "16", "39"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var dom_adapter_1 = $__require('37'); - var core_1 = $__require('16'); - var event_manager_1 = $__require('39'); - var DomEventsPlugin = (function(_super) { - __extends(DomEventsPlugin, _super); - function DomEventsPlugin() { - _super.apply(this, arguments); - } - DomEventsPlugin.prototype.supports = function(eventName) { - return true; - }; - DomEventsPlugin.prototype.addEventListener = function(element, eventName, handler) { - var zone = this.manager.getZone(); - var outsideHandler = function(event) { - return zone.runGuarded(function() { - return handler(event); - }); - }; - return this.manager.getZone().runOutsideAngular(function() { - return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); - }); - }; - DomEventsPlugin.prototype.addGlobalEventListener = function(target, eventName, handler) { - var element = dom_adapter_1.DOM.getGlobalEventTarget(target); - var zone = this.manager.getZone(); - var outsideHandler = function(event) { - return zone.runGuarded(function() { - return handler(event); - }); - }; - return this.manager.getZone().runOutsideAngular(function() { - return dom_adapter_1.DOM.onAndCancel(element, eventName, outsideHandler); - }); - }; - DomEventsPlugin = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], DomEventsPlugin); - return DomEventsPlugin; - }(event_manager_1.EventManagerPlugin)); - exports.DomEventsPlugin = DomEventsPlugin; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("45", ["2b", "37"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var dom_adapter_1 = $__require('37'); - var By = (function() { - function By() {} - By.all = function() { - return function(debugElement) { - return true; - }; - }; - By.css = function(selector) { - return function(debugElement) { - return lang_1.isPresent(debugElement.nativeElement) ? dom_adapter_1.DOM.elementMatches(debugElement.nativeElement, selector) : false; - }; - }; - By.directive = function(type) { - return function(debugElement) { - return debugElement.providerTokens.indexOf(type) !== -1; - }; - }; - return By; - }()); - exports.By = By; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("46", [], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var CssAnimationOptions = (function() { - function CssAnimationOptions() { - this.classesToAdd = []; - this.classesToRemove = []; - this.animationClasses = []; - } - return CssAnimationOptions; - }()); - exports.CssAnimationOptions = CssAnimationOptions; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("47", ["2b", "48", "49", "38", "37"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var math_1 = $__require('48'); - var util_1 = $__require('49'); - var collection_1 = $__require('38'); - var dom_adapter_1 = $__require('37'); - var Animation = (function() { - function Animation(element, data, browserDetails) { - var _this = this; - this.element = element; - this.data = data; - this.browserDetails = browserDetails; - this.callbacks = []; - this.eventClearFunctions = []; - this.completed = false; - this._stringPrefix = ''; - this.startTime = lang_1.DateWrapper.toMillis(lang_1.DateWrapper.now()); - this._stringPrefix = dom_adapter_1.DOM.getAnimationPrefix(); - this.setup(); - this.wait(function(timestamp) { - return _this.start(); - }); - } - Object.defineProperty(Animation.prototype, "totalTime", { - get: function() { - var delay = this.computedDelay != null ? this.computedDelay : 0; - var duration = this.computedDuration != null ? this.computedDuration : 0; - return delay + duration; - }, - enumerable: true, - configurable: true - }); - Animation.prototype.wait = function(callback) { - this.browserDetails.raf(callback, 2); - }; - Animation.prototype.setup = function() { - if (this.data.fromStyles != null) - this.applyStyles(this.data.fromStyles); - if (this.data.duration != null) - this.applyStyles({'transitionDuration': this.data.duration.toString() + 'ms'}); - if (this.data.delay != null) - this.applyStyles({'transitionDelay': this.data.delay.toString() + 'ms'}); - }; - Animation.prototype.start = function() { - this.addClasses(this.data.classesToAdd); - this.addClasses(this.data.animationClasses); - this.removeClasses(this.data.classesToRemove); - if (this.data.toStyles != null) - this.applyStyles(this.data.toStyles); - var computedStyles = dom_adapter_1.DOM.getComputedStyle(this.element); - this.computedDelay = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-delay')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-delay'))); - this.computedDuration = math_1.Math.max(this.parseDurationString(computedStyles.getPropertyValue(this._stringPrefix + 'transition-duration')), this.parseDurationString(this.element.style.getPropertyValue(this._stringPrefix + 'transition-duration'))); - this.addEvents(); - }; - Animation.prototype.applyStyles = function(styles) { - var _this = this; - collection_1.StringMapWrapper.forEach(styles, function(value, key) { - var dashCaseKey = util_1.camelCaseToDashCase(key); - if (lang_1.isPresent(dom_adapter_1.DOM.getStyle(_this.element, dashCaseKey))) { - dom_adapter_1.DOM.setStyle(_this.element, dashCaseKey, value.toString()); - } else { - dom_adapter_1.DOM.setStyle(_this.element, _this._stringPrefix + dashCaseKey, value.toString()); - } - }); - }; - Animation.prototype.addClasses = function(classes) { - for (var i = 0, - len = classes.length; i < len; i++) - dom_adapter_1.DOM.addClass(this.element, classes[i]); - }; - Animation.prototype.removeClasses = function(classes) { - for (var i = 0, - len = classes.length; i < len; i++) - dom_adapter_1.DOM.removeClass(this.element, classes[i]); - }; - Animation.prototype.addEvents = function() { - var _this = this; - if (this.totalTime > 0) { - this.eventClearFunctions.push(dom_adapter_1.DOM.onAndCancel(this.element, dom_adapter_1.DOM.getTransitionEnd(), function(event) { - return _this.handleAnimationEvent(event); - })); - } else { - this.handleAnimationCompleted(); - } - }; - Animation.prototype.handleAnimationEvent = function(event) { - var elapsedTime = math_1.Math.round(event.elapsedTime * 1000); - if (!this.browserDetails.elapsedTimeIncludesDelay) - elapsedTime += this.computedDelay; - event.stopPropagation(); - if (elapsedTime >= this.totalTime) - this.handleAnimationCompleted(); - }; - Animation.prototype.handleAnimationCompleted = function() { - this.removeClasses(this.data.animationClasses); - this.callbacks.forEach(function(callback) { - return callback(); - }); - this.callbacks = []; - this.eventClearFunctions.forEach(function(fn) { - return fn(); - }); - this.eventClearFunctions = []; - this.completed = true; - }; - Animation.prototype.onComplete = function(callback) { - if (this.completed) { - callback(); - } else { - this.callbacks.push(callback); - } - return this; - }; - Animation.prototype.parseDurationString = function(duration) { - var maxValue = 0; - if (duration == null || duration.length < 2) { - return maxValue; - } else if (duration.substring(duration.length - 2) == 'ms') { - var value = lang_1.NumberWrapper.parseInt(this.stripLetters(duration), 10); - if (value > maxValue) - maxValue = value; - } else if (duration.substring(duration.length - 1) == 's') { - var ms = lang_1.NumberWrapper.parseFloat(this.stripLetters(duration)) * 1000; - var value = math_1.Math.floor(ms); - if (value > maxValue) - maxValue = value; - } - return maxValue; - }; - Animation.prototype.stripLetters = function(str) { - return lang_1.StringWrapper.replaceAll(str, lang_1.RegExpWrapper.create('[^0-9]+$', ''), ''); - }; - return Animation; - }()); - exports.Animation = Animation; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("4a", ["46", "47"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var css_animation_options_1 = $__require('46'); - var animation_1 = $__require('47'); - var CssAnimationBuilder = (function() { - function CssAnimationBuilder(browserDetails) { - this.browserDetails = browserDetails; - this.data = new css_animation_options_1.CssAnimationOptions(); - } - CssAnimationBuilder.prototype.addAnimationClass = function(className) { - this.data.animationClasses.push(className); - return this; - }; - CssAnimationBuilder.prototype.addClass = function(className) { - this.data.classesToAdd.push(className); - return this; - }; - CssAnimationBuilder.prototype.removeClass = function(className) { - this.data.classesToRemove.push(className); - return this; - }; - CssAnimationBuilder.prototype.setDuration = function(duration) { - this.data.duration = duration; - return this; - }; - CssAnimationBuilder.prototype.setDelay = function(delay) { - this.data.delay = delay; - return this; - }; - CssAnimationBuilder.prototype.setStyles = function(from, to) { - return this.setFromStyles(from).setToStyles(to); - }; - CssAnimationBuilder.prototype.setFromStyles = function(from) { - this.data.fromStyles = from; - return this; - }; - CssAnimationBuilder.prototype.setToStyles = function(to) { - this.data.toStyles = to; - return this; - }; - CssAnimationBuilder.prototype.start = function(element) { - return new animation_1.Animation(element, this.data, this.browserDetails); - }; - return CssAnimationBuilder; - }()); - exports.CssAnimationBuilder = CssAnimationBuilder; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("48", ["2b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - exports.Math = lang_1.global.Math; - exports.NaN = typeof exports.NaN; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("4b", ["3a", "48", "37"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = $__require('3a'); - var math_1 = $__require('48'); - var dom_adapter_1 = $__require('37'); - var BrowserDetails = (function() { - function BrowserDetails() { - this.elapsedTimeIncludesDelay = false; - this.doesElapsedTimeIncludesDelay(); - } - BrowserDetails.prototype.doesElapsedTimeIncludesDelay = function() { - var _this = this; - var div = dom_adapter_1.DOM.createElement('div'); - dom_adapter_1.DOM.setAttribute(div, 'style', "position: absolute; top: -9999px; left: -9999px; width: 1px;\n height: 1px; transition: all 1ms linear 1ms;"); - this.raf(function(timestamp) { - dom_adapter_1.DOM.on(div, 'transitionend', function(event) { - var elapsed = math_1.Math.round(event.elapsedTime * 1000); - _this.elapsedTimeIncludesDelay = elapsed == 2; - dom_adapter_1.DOM.remove(div); - }); - dom_adapter_1.DOM.setStyle(div, 'width', '2px'); - }, 2); - }; - BrowserDetails.prototype.raf = function(callback, frames) { - if (frames === void 0) { - frames = 1; - } - var queue = new RafQueue(callback, frames); - return function() { - return queue.cancel(); - }; - }; - BrowserDetails = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], BrowserDetails); - return BrowserDetails; - }()); - exports.BrowserDetails = BrowserDetails; - var RafQueue = (function() { - function RafQueue(callback, frames) { - this.callback = callback; - this.frames = frames; - this._raf(); - } - RafQueue.prototype._raf = function() { - var _this = this; - this.currentFrameId = dom_adapter_1.DOM.requestAnimationFrame(function(timestamp) { - return _this._nextFrame(timestamp); - }); - }; - RafQueue.prototype._nextFrame = function(timestamp) { - this.frames--; - if (this.frames > 0) { - this._raf(); - } else { - this.callback(timestamp); - } - }; - RafQueue.prototype.cancel = function() { - dom_adapter_1.DOM.cancelAnimationFrame(this.currentFrameId); - this.currentFrameId = null; - }; - return RafQueue; - }()); - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("4c", ["3a", "4a", "4b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = $__require('3a'); - var css_animation_builder_1 = $__require('4a'); - var browser_details_1 = $__require('4b'); - var AnimationBuilder = (function() { - function AnimationBuilder(browserDetails) { - this.browserDetails = browserDetails; - } - AnimationBuilder.prototype.css = function() { - return new css_animation_builder_1.CssAnimationBuilder(this.browserDetails); - }; - AnimationBuilder = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [browser_details_1.BrowserDetails])], AnimationBuilder); - return AnimationBuilder; - }()); - exports.AnimationBuilder = AnimationBuilder; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("4d", ["37", "3a", "38", "4e"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var dom_adapter_1 = $__require('37'); - var di_1 = $__require('3a'); - var collection_1 = $__require('38'); - var dom_tokens_1 = $__require('4e'); - var SharedStylesHost = (function() { - function SharedStylesHost() { - this._styles = []; - this._stylesSet = new Set(); - } - SharedStylesHost.prototype.addStyles = function(styles) { - var _this = this; - var additions = []; - styles.forEach(function(style) { - if (!collection_1.SetWrapper.has(_this._stylesSet, style)) { - _this._stylesSet.add(style); - _this._styles.push(style); - additions.push(style); - } - }); - this.onStylesAdded(additions); - }; - SharedStylesHost.prototype.onStylesAdded = function(additions) {}; - SharedStylesHost.prototype.getAllStyles = function() { - return this._styles; - }; - SharedStylesHost = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], SharedStylesHost); - return SharedStylesHost; - }()); - exports.SharedStylesHost = SharedStylesHost; - var DomSharedStylesHost = (function(_super) { - __extends(DomSharedStylesHost, _super); - function DomSharedStylesHost(doc) { - _super.call(this); - this._hostNodes = new Set(); - this._hostNodes.add(doc.head); - } - DomSharedStylesHost.prototype._addStylesToHost = function(styles, host) { - for (var i = 0; i < styles.length; i++) { - var style = styles[i]; - dom_adapter_1.DOM.appendChild(host, dom_adapter_1.DOM.createStyleElement(style)); - } - }; - DomSharedStylesHost.prototype.addHost = function(hostNode) { - this._addStylesToHost(this._styles, hostNode); - this._hostNodes.add(hostNode); - }; - DomSharedStylesHost.prototype.removeHost = function(hostNode) { - collection_1.SetWrapper.delete(this._hostNodes, hostNode); - }; - DomSharedStylesHost.prototype.onStylesAdded = function(additions) { - var _this = this; - this._hostNodes.forEach(function(hostNode) { - _this._addStylesToHost(additions, hostNode); - }); - }; - DomSharedStylesHost = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object])], DomSharedStylesHost); - return DomSharedStylesHost; - }(SharedStylesHost)); - exports.DomSharedStylesHost = DomSharedStylesHost; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("4e", ["3a", "2b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var di_1 = $__require('3a'); - var lang_1 = $__require('2b'); - exports.DOCUMENT = lang_1.CONST_EXPR(new di_1.OpaqueToken('DocumentToken')); - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("49", ["2b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var CAMEL_CASE_REGEXP = /([A-Z])/g; - var DASH_CASE_REGEXP = /-([a-z])/g; - function camelCaseToDashCase(input) { - return lang_1.StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP, function(m) { - return '-' + m[1].toLowerCase(); - }); - } - exports.camelCaseToDashCase = camelCaseToDashCase; - function dashCaseToCamelCase(input) { - return lang_1.StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP, function(m) { - return m[1].toUpperCase(); - }); - } - exports.dashCaseToCamelCase = dashCaseToCamelCase; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("4f", ["3a", "4c", "2b", "41", "4d", "39", "4e", "50", "37", "49"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var di_1 = $__require('3a'); - var animation_builder_1 = $__require('4c'); - var lang_1 = $__require('2b'); - var exceptions_1 = $__require('41'); - var shared_styles_host_1 = $__require('4d'); - var event_manager_1 = $__require('39'); - var dom_tokens_1 = $__require('4e'); - var metadata_1 = $__require('50'); - var dom_adapter_1 = $__require('37'); - var util_1 = $__require('49'); - var NAMESPACE_URIS = lang_1.CONST_EXPR({ - 'xlink': 'http://www.w3.org/1999/xlink', - 'svg': 'http://www.w3.org/2000/svg' - }); - var TEMPLATE_COMMENT_TEXT = 'template bindings={}'; - var TEMPLATE_BINDINGS_EXP = /^template bindings=(.*)$/g; - var DomRootRenderer = (function() { - function DomRootRenderer(document, eventManager, sharedStylesHost, animate) { - this.document = document; - this.eventManager = eventManager; - this.sharedStylesHost = sharedStylesHost; - this.animate = animate; - this._registeredComponents = new Map(); - } - DomRootRenderer.prototype.renderComponent = function(componentProto) { - var renderer = this._registeredComponents.get(componentProto.id); - if (lang_1.isBlank(renderer)) { - renderer = new DomRenderer(this, componentProto); - this._registeredComponents.set(componentProto.id, renderer); - } - return renderer; - }; - return DomRootRenderer; - }()); - exports.DomRootRenderer = DomRootRenderer; - var DomRootRenderer_ = (function(_super) { - __extends(DomRootRenderer_, _super); - function DomRootRenderer_(_document, _eventManager, sharedStylesHost, animate) { - _super.call(this, _document, _eventManager, sharedStylesHost, animate); - } - DomRootRenderer_ = __decorate([di_1.Injectable(), __param(0, di_1.Inject(dom_tokens_1.DOCUMENT)), __metadata('design:paramtypes', [Object, event_manager_1.EventManager, shared_styles_host_1.DomSharedStylesHost, animation_builder_1.AnimationBuilder])], DomRootRenderer_); - return DomRootRenderer_; - }(DomRootRenderer)); - exports.DomRootRenderer_ = DomRootRenderer_; - var DomRenderer = (function() { - function DomRenderer(_rootRenderer, componentProto) { - this._rootRenderer = _rootRenderer; - this.componentProto = componentProto; - this._styles = _flattenStyles(componentProto.id, componentProto.styles, []); - if (componentProto.encapsulation !== metadata_1.ViewEncapsulation.Native) { - this._rootRenderer.sharedStylesHost.addStyles(this._styles); - } - if (this.componentProto.encapsulation === metadata_1.ViewEncapsulation.Emulated) { - this._contentAttr = _shimContentAttribute(componentProto.id); - this._hostAttr = _shimHostAttribute(componentProto.id); - } else { - this._contentAttr = null; - this._hostAttr = null; - } - } - DomRenderer.prototype.selectRootElement = function(selectorOrNode, debugInfo) { - var el; - if (lang_1.isString(selectorOrNode)) { - el = dom_adapter_1.DOM.querySelector(this._rootRenderer.document, selectorOrNode); - if (lang_1.isBlank(el)) { - throw new exceptions_1.BaseException("The selector \"" + selectorOrNode + "\" did not match any elements"); - } - } else { - el = selectorOrNode; - } - dom_adapter_1.DOM.clearNodes(el); - return el; - }; - DomRenderer.prototype.createElement = function(parent, name, debugInfo) { - var nsAndName = splitNamespace(name); - var el = lang_1.isPresent(nsAndName[0]) ? dom_adapter_1.DOM.createElementNS(NAMESPACE_URIS[nsAndName[0]], nsAndName[1]) : dom_adapter_1.DOM.createElement(nsAndName[1]); - if (lang_1.isPresent(this._contentAttr)) { - dom_adapter_1.DOM.setAttribute(el, this._contentAttr, ''); - } - if (lang_1.isPresent(parent)) { - dom_adapter_1.DOM.appendChild(parent, el); - } - return el; - }; - DomRenderer.prototype.createViewRoot = function(hostElement) { - var nodesParent; - if (this.componentProto.encapsulation === metadata_1.ViewEncapsulation.Native) { - nodesParent = dom_adapter_1.DOM.createShadowRoot(hostElement); - this._rootRenderer.sharedStylesHost.addHost(nodesParent); - for (var i = 0; i < this._styles.length; i++) { - dom_adapter_1.DOM.appendChild(nodesParent, dom_adapter_1.DOM.createStyleElement(this._styles[i])); - } - } else { - if (lang_1.isPresent(this._hostAttr)) { - dom_adapter_1.DOM.setAttribute(hostElement, this._hostAttr, ''); - } - nodesParent = hostElement; - } - return nodesParent; - }; - DomRenderer.prototype.createTemplateAnchor = function(parentElement, debugInfo) { - var comment = dom_adapter_1.DOM.createComment(TEMPLATE_COMMENT_TEXT); - if (lang_1.isPresent(parentElement)) { - dom_adapter_1.DOM.appendChild(parentElement, comment); - } - return comment; - }; - DomRenderer.prototype.createText = function(parentElement, value, debugInfo) { - var node = dom_adapter_1.DOM.createTextNode(value); - if (lang_1.isPresent(parentElement)) { - dom_adapter_1.DOM.appendChild(parentElement, node); - } - return node; - }; - DomRenderer.prototype.projectNodes = function(parentElement, nodes) { - if (lang_1.isBlank(parentElement)) - return; - appendNodes(parentElement, nodes); - }; - DomRenderer.prototype.attachViewAfter = function(node, viewRootNodes) { - moveNodesAfterSibling(node, viewRootNodes); - for (var i = 0; i < viewRootNodes.length; i++) - this.animateNodeEnter(viewRootNodes[i]); - }; - DomRenderer.prototype.detachView = function(viewRootNodes) { - for (var i = 0; i < viewRootNodes.length; i++) { - var node = viewRootNodes[i]; - dom_adapter_1.DOM.remove(node); - this.animateNodeLeave(node); - } - }; - DomRenderer.prototype.destroyView = function(hostElement, viewAllNodes) { - if (this.componentProto.encapsulation === metadata_1.ViewEncapsulation.Native && lang_1.isPresent(hostElement)) { - this._rootRenderer.sharedStylesHost.removeHost(dom_adapter_1.DOM.getShadowRoot(hostElement)); - } - }; - DomRenderer.prototype.listen = function(renderElement, name, callback) { - return this._rootRenderer.eventManager.addEventListener(renderElement, name, decoratePreventDefault(callback)); - }; - DomRenderer.prototype.listenGlobal = function(target, name, callback) { - return this._rootRenderer.eventManager.addGlobalEventListener(target, name, decoratePreventDefault(callback)); - }; - DomRenderer.prototype.setElementProperty = function(renderElement, propertyName, propertyValue) { - dom_adapter_1.DOM.setProperty(renderElement, propertyName, propertyValue); - }; - DomRenderer.prototype.setElementAttribute = function(renderElement, attributeName, attributeValue) { - var attrNs; - var nsAndName = splitNamespace(attributeName); - if (lang_1.isPresent(nsAndName[0])) { - attributeName = nsAndName[0] + ':' + nsAndName[1]; - attrNs = NAMESPACE_URIS[nsAndName[0]]; - } - if (lang_1.isPresent(attributeValue)) { - if (lang_1.isPresent(attrNs)) { - dom_adapter_1.DOM.setAttributeNS(renderElement, attrNs, attributeName, attributeValue); - } else { - dom_adapter_1.DOM.setAttribute(renderElement, attributeName, attributeValue); - } - } else { - if (lang_1.isPresent(attrNs)) { - dom_adapter_1.DOM.removeAttributeNS(renderElement, attrNs, nsAndName[1]); - } else { - dom_adapter_1.DOM.removeAttribute(renderElement, attributeName); - } - } - }; - DomRenderer.prototype.setBindingDebugInfo = function(renderElement, propertyName, propertyValue) { - var dashCasedPropertyName = util_1.camelCaseToDashCase(propertyName); - if (dom_adapter_1.DOM.isCommentNode(renderElement)) { - var existingBindings = lang_1.RegExpWrapper.firstMatch(TEMPLATE_BINDINGS_EXP, lang_1.StringWrapper.replaceAll(dom_adapter_1.DOM.getText(renderElement), /\n/g, '')); - var parsedBindings = lang_1.Json.parse(existingBindings[1]); - parsedBindings[dashCasedPropertyName] = propertyValue; - dom_adapter_1.DOM.setText(renderElement, lang_1.StringWrapper.replace(TEMPLATE_COMMENT_TEXT, '{}', lang_1.Json.stringify(parsedBindings))); - } else { - this.setElementAttribute(renderElement, propertyName, propertyValue); - } - }; - DomRenderer.prototype.setElementClass = function(renderElement, className, isAdd) { - if (isAdd) { - dom_adapter_1.DOM.addClass(renderElement, className); - } else { - dom_adapter_1.DOM.removeClass(renderElement, className); - } - }; - DomRenderer.prototype.setElementStyle = function(renderElement, styleName, styleValue) { - if (lang_1.isPresent(styleValue)) { - dom_adapter_1.DOM.setStyle(renderElement, styleName, lang_1.stringify(styleValue)); - } else { - dom_adapter_1.DOM.removeStyle(renderElement, styleName); - } - }; - DomRenderer.prototype.invokeElementMethod = function(renderElement, methodName, args) { - dom_adapter_1.DOM.invoke(renderElement, methodName, args); - }; - DomRenderer.prototype.setText = function(renderNode, text) { - dom_adapter_1.DOM.setText(renderNode, text); - }; - DomRenderer.prototype.animateNodeEnter = function(node) { - if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { - dom_adapter_1.DOM.addClass(node, 'ng-enter'); - this._rootRenderer.animate.css().addAnimationClass('ng-enter-active').start(node).onComplete(function() { - dom_adapter_1.DOM.removeClass(node, 'ng-enter'); - }); - } - }; - DomRenderer.prototype.animateNodeLeave = function(node) { - if (dom_adapter_1.DOM.isElementNode(node) && dom_adapter_1.DOM.hasClass(node, 'ng-animate')) { - dom_adapter_1.DOM.addClass(node, 'ng-leave'); - this._rootRenderer.animate.css().addAnimationClass('ng-leave-active').start(node).onComplete(function() { - dom_adapter_1.DOM.removeClass(node, 'ng-leave'); - dom_adapter_1.DOM.remove(node); - }); - } else { - dom_adapter_1.DOM.remove(node); - } - }; - return DomRenderer; - }()); - exports.DomRenderer = DomRenderer; - function moveNodesAfterSibling(sibling, nodes) { - var parent = dom_adapter_1.DOM.parentElement(sibling); - if (nodes.length > 0 && lang_1.isPresent(parent)) { - var nextSibling = dom_adapter_1.DOM.nextSibling(sibling); - if (lang_1.isPresent(nextSibling)) { - for (var i = 0; i < nodes.length; i++) { - dom_adapter_1.DOM.insertBefore(nextSibling, nodes[i]); - } - } else { - for (var i = 0; i < nodes.length; i++) { - dom_adapter_1.DOM.appendChild(parent, nodes[i]); - } - } - } - } - function appendNodes(parent, nodes) { - for (var i = 0; i < nodes.length; i++) { - dom_adapter_1.DOM.appendChild(parent, nodes[i]); - } - } - function decoratePreventDefault(eventHandler) { - return function(event) { - var allowDefaultBehavior = eventHandler(event); - if (allowDefaultBehavior === false) { - dom_adapter_1.DOM.preventDefault(event); - } - }; - } - var COMPONENT_REGEX = /%COMP%/g; - exports.COMPONENT_VARIABLE = '%COMP%'; - exports.HOST_ATTR = "_nghost-" + exports.COMPONENT_VARIABLE; - exports.CONTENT_ATTR = "_ngcontent-" + exports.COMPONENT_VARIABLE; - function _shimContentAttribute(componentShortId) { - return lang_1.StringWrapper.replaceAll(exports.CONTENT_ATTR, COMPONENT_REGEX, componentShortId); - } - function _shimHostAttribute(componentShortId) { - return lang_1.StringWrapper.replaceAll(exports.HOST_ATTR, COMPONENT_REGEX, componentShortId); - } - function _flattenStyles(compId, styles, target) { - for (var i = 0; i < styles.length; i++) { - var style = styles[i]; - if (lang_1.isArray(style)) { - _flattenStyles(compId, style, target); - } else { - style = lang_1.StringWrapper.replaceAll(style, COMPONENT_REGEX, compId); - target.push(style); - } - } - return target; - } - var NS_PREFIX_RE = /^@([^:]+):(.+)/g; - function splitNamespace(name) { - if (name[0] != '@') { - return [null, name]; - } - var match = lang_1.RegExpWrapper.firstMatch(NS_PREFIX_RE, name); - return [match[1], match[2]]; - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("51", ["2b", "52"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var debug_node_1 = $__require('52'); - var DebugDomRootRenderer = (function() { - function DebugDomRootRenderer(_delegate) { - this._delegate = _delegate; - } - DebugDomRootRenderer.prototype.renderComponent = function(componentProto) { - return new DebugDomRenderer(this._delegate.renderComponent(componentProto)); - }; - return DebugDomRootRenderer; - }()); - exports.DebugDomRootRenderer = DebugDomRootRenderer; - var DebugDomRenderer = (function() { - function DebugDomRenderer(_delegate) { - this._delegate = _delegate; - } - DebugDomRenderer.prototype.selectRootElement = function(selectorOrNode, debugInfo) { - var nativeEl = this._delegate.selectRootElement(selectorOrNode, debugInfo); - var debugEl = new debug_node_1.DebugElement(nativeEl, null, debugInfo); - debug_node_1.indexDebugNode(debugEl); - return nativeEl; - }; - DebugDomRenderer.prototype.createElement = function(parentElement, name, debugInfo) { - var nativeEl = this._delegate.createElement(parentElement, name, debugInfo); - var debugEl = new debug_node_1.DebugElement(nativeEl, debug_node_1.getDebugNode(parentElement), debugInfo); - debugEl.name = name; - debug_node_1.indexDebugNode(debugEl); - return nativeEl; - }; - DebugDomRenderer.prototype.createViewRoot = function(hostElement) { - return this._delegate.createViewRoot(hostElement); - }; - DebugDomRenderer.prototype.createTemplateAnchor = function(parentElement, debugInfo) { - var comment = this._delegate.createTemplateAnchor(parentElement, debugInfo); - var debugEl = new debug_node_1.DebugNode(comment, debug_node_1.getDebugNode(parentElement), debugInfo); - debug_node_1.indexDebugNode(debugEl); - return comment; - }; - DebugDomRenderer.prototype.createText = function(parentElement, value, debugInfo) { - var text = this._delegate.createText(parentElement, value, debugInfo); - var debugEl = new debug_node_1.DebugNode(text, debug_node_1.getDebugNode(parentElement), debugInfo); - debug_node_1.indexDebugNode(debugEl); - return text; - }; - DebugDomRenderer.prototype.projectNodes = function(parentElement, nodes) { - var debugParent = debug_node_1.getDebugNode(parentElement); - if (lang_1.isPresent(debugParent) && debugParent instanceof debug_node_1.DebugElement) { - var debugElement_1 = debugParent; - nodes.forEach(function(node) { - debugElement_1.addChild(debug_node_1.getDebugNode(node)); - }); - } - this._delegate.projectNodes(parentElement, nodes); - }; - DebugDomRenderer.prototype.attachViewAfter = function(node, viewRootNodes) { - var debugNode = debug_node_1.getDebugNode(node); - if (lang_1.isPresent(debugNode)) { - var debugParent = debugNode.parent; - if (viewRootNodes.length > 0 && lang_1.isPresent(debugParent)) { - var debugViewRootNodes = []; - viewRootNodes.forEach(function(rootNode) { - return debugViewRootNodes.push(debug_node_1.getDebugNode(rootNode)); - }); - debugParent.insertChildrenAfter(debugNode, debugViewRootNodes); - } - } - this._delegate.attachViewAfter(node, viewRootNodes); - }; - DebugDomRenderer.prototype.detachView = function(viewRootNodes) { - viewRootNodes.forEach(function(node) { - var debugNode = debug_node_1.getDebugNode(node); - if (lang_1.isPresent(debugNode) && lang_1.isPresent(debugNode.parent)) { - debugNode.parent.removeChild(debugNode); - } - }); - this._delegate.detachView(viewRootNodes); - }; - DebugDomRenderer.prototype.destroyView = function(hostElement, viewAllNodes) { - viewAllNodes.forEach(function(node) { - debug_node_1.removeDebugNodeFromIndex(debug_node_1.getDebugNode(node)); - }); - this._delegate.destroyView(hostElement, viewAllNodes); - }; - DebugDomRenderer.prototype.listen = function(renderElement, name, callback) { - var debugEl = debug_node_1.getDebugNode(renderElement); - if (lang_1.isPresent(debugEl)) { - debugEl.listeners.push(new debug_node_1.EventListener(name, callback)); - } - return this._delegate.listen(renderElement, name, callback); - }; - DebugDomRenderer.prototype.listenGlobal = function(target, name, callback) { - return this._delegate.listenGlobal(target, name, callback); - }; - DebugDomRenderer.prototype.setElementProperty = function(renderElement, propertyName, propertyValue) { - var debugEl = debug_node_1.getDebugNode(renderElement); - if (lang_1.isPresent(debugEl) && debugEl instanceof debug_node_1.DebugElement) { - debugEl.properties[propertyName] = propertyValue; - } - this._delegate.setElementProperty(renderElement, propertyName, propertyValue); - }; - DebugDomRenderer.prototype.setElementAttribute = function(renderElement, attributeName, attributeValue) { - var debugEl = debug_node_1.getDebugNode(renderElement); - if (lang_1.isPresent(debugEl) && debugEl instanceof debug_node_1.DebugElement) { - debugEl.attributes[attributeName] = attributeValue; - } - this._delegate.setElementAttribute(renderElement, attributeName, attributeValue); - }; - DebugDomRenderer.prototype.setBindingDebugInfo = function(renderElement, propertyName, propertyValue) { - this._delegate.setBindingDebugInfo(renderElement, propertyName, propertyValue); - }; - DebugDomRenderer.prototype.setElementClass = function(renderElement, className, isAdd) { - this._delegate.setElementClass(renderElement, className, isAdd); - }; - DebugDomRenderer.prototype.setElementStyle = function(renderElement, styleName, styleValue) { - this._delegate.setElementStyle(renderElement, styleName, styleValue); - }; - DebugDomRenderer.prototype.invokeElementMethod = function(renderElement, methodName, args) { - this._delegate.invokeElementMethod(renderElement, methodName, args); - }; - DebugDomRenderer.prototype.setText = function(renderNode, text) { - this._delegate.setText(renderNode, text); - }; - return DebugDomRenderer; - }()); - exports.DebugDomRenderer = DebugDomRenderer; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("53", ["2b", "3a", "37", "52", "4f", "16", "51"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var di_1 = $__require('3a'); - var dom_adapter_1 = $__require('37'); - var debug_node_1 = $__require('52'); - var dom_renderer_1 = $__require('4f'); - var core_1 = $__require('16'); - var debug_renderer_1 = $__require('51'); - var CORE_TOKENS = lang_1.CONST_EXPR({ - 'ApplicationRef': core_1.ApplicationRef, - 'NgZone': core_1.NgZone - }); - var INSPECT_GLOBAL_NAME = 'ng.probe'; - var CORE_TOKENS_GLOBAL_NAME = 'ng.coreTokens'; - function inspectNativeElement(element) { - return debug_node_1.getDebugNode(element); - } - exports.inspectNativeElement = inspectNativeElement; - function _createConditionalRootRenderer(rootRenderer) { - if (lang_1.assertionsEnabled()) { - return _createRootRenderer(rootRenderer); - } - return rootRenderer; - } - function _createRootRenderer(rootRenderer) { - dom_adapter_1.DOM.setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement); - dom_adapter_1.DOM.setGlobalVar(CORE_TOKENS_GLOBAL_NAME, CORE_TOKENS); - return new debug_renderer_1.DebugDomRootRenderer(rootRenderer); - } - exports.ELEMENT_PROBE_PROVIDERS = lang_1.CONST_EXPR([new di_1.Provider(core_1.RootRenderer, { - useFactory: _createConditionalRootRenderer, - deps: [dom_renderer_1.DomRootRenderer] - })]); - exports.ELEMENT_PROBE_PROVIDERS_PROD_MODE = lang_1.CONST_EXPR([new di_1.Provider(core_1.RootRenderer, { - useFactory: _createRootRenderer, - deps: [dom_renderer_1.DomRootRenderer] - })]); - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("54", ["37", "4f", "4e", "4d", "44", "39", "45", "53"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - function __export(m) { - for (var p in m) - if (!exports.hasOwnProperty(p)) - exports[p] = m[p]; - } - var dom_adapter_1 = $__require('37'); - exports.DOM = dom_adapter_1.DOM; - exports.setRootDomAdapter = dom_adapter_1.setRootDomAdapter; - exports.DomAdapter = dom_adapter_1.DomAdapter; - var dom_renderer_1 = $__require('4f'); - exports.DomRenderer = dom_renderer_1.DomRenderer; - var dom_tokens_1 = $__require('4e'); - exports.DOCUMENT = dom_tokens_1.DOCUMENT; - var shared_styles_host_1 = $__require('4d'); - exports.SharedStylesHost = shared_styles_host_1.SharedStylesHost; - exports.DomSharedStylesHost = shared_styles_host_1.DomSharedStylesHost; - var dom_events_1 = $__require('44'); - exports.DomEventsPlugin = dom_events_1.DomEventsPlugin; - var event_manager_1 = $__require('39'); - exports.EVENT_MANAGER_PLUGINS = event_manager_1.EVENT_MANAGER_PLUGINS; - exports.EventManager = event_manager_1.EventManager; - exports.EventManagerPlugin = event_manager_1.EventManagerPlugin; - __export($__require('45')); - __export($__require('53')); - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("55", ["37"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var dom_adapter_1 = $__require('37'); - var Title = (function() { - function Title() {} - Title.prototype.getTitle = function() { - return dom_adapter_1.DOM.getTitle(); - }; - Title.prototype.setTitle = function(newTitle) { - dom_adapter_1.DOM.setTitle(newTitle); - }; - return Title; - }()); - exports.Title = Title; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("56", [], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var win = window; - exports.window = win; - exports.document = window.document; - exports.location = window.location; - exports.gc = window['gc'] ? function() { - return window['gc'](); - } : function() { - return null; - }; - exports.performance = window['performance'] ? window['performance'] : null; - exports.Event = window['Event']; - exports.MouseEvent = window['MouseEvent']; - exports.KeyboardEvent = window['KeyboardEvent']; - exports.EventTarget = window['EventTarget']; - exports.History = window['History']; - exports.Location = window['Location']; - exports.EventListener = window['EventListener']; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("57", ["58", "2b", "56", "37"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var application_ref_1 = $__require('58'); - var lang_1 = $__require('2b'); - var browser_1 = $__require('56'); - var dom_adapter_1 = $__require('37'); - var ChangeDetectionPerfRecord = (function() { - function ChangeDetectionPerfRecord(msPerTick, numTicks) { - this.msPerTick = msPerTick; - this.numTicks = numTicks; - } - return ChangeDetectionPerfRecord; - }()); - exports.ChangeDetectionPerfRecord = ChangeDetectionPerfRecord; - var AngularTools = (function() { - function AngularTools(ref) { - this.profiler = new AngularProfiler(ref); - } - return AngularTools; - }()); - exports.AngularTools = AngularTools; - var AngularProfiler = (function() { - function AngularProfiler(ref) { - this.appRef = ref.injector.get(application_ref_1.ApplicationRef); - } - AngularProfiler.prototype.timeChangeDetection = function(config) { - var record = lang_1.isPresent(config) && config['record']; - var profileName = 'Change Detection'; - var isProfilerAvailable = lang_1.isPresent(browser_1.window.console.profile); - if (record && isProfilerAvailable) { - browser_1.window.console.profile(profileName); - } - var start = dom_adapter_1.DOM.performanceNow(); - var numTicks = 0; - while (numTicks < 5 || (dom_adapter_1.DOM.performanceNow() - start) < 500) { - this.appRef.tick(); - numTicks++; - } - var end = dom_adapter_1.DOM.performanceNow(); - if (record && isProfilerAvailable) { - browser_1.window.console.profileEnd(profileName); - } - var msPerTick = (end - start) / numTicks; - browser_1.window.console.log("ran " + numTicks + " change detection cycles"); - browser_1.window.console.log(lang_1.NumberWrapper.toFixed(msPerTick, 2) + " ms per check"); - return new ChangeDetectionPerfRecord(msPerTick, numTicks); - }; - return AngularProfiler; - }()); - exports.AngularProfiler = AngularProfiler; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("59", ["2b", "57"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var common_tools_1 = $__require('57'); - var context = lang_1.global; - function enableDebugTools(ref) { - context.ng = new common_tools_1.AngularTools(ref); - } - exports.enableDebugTools = enableDebugTools; - function disableDebugTools() { - delete context.ng; - } - exports.disableDebugTools = disableDebugTools; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("39", ["2b", "41", "3a", "5a", "38"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var lang_1 = $__require('2b'); - var exceptions_1 = $__require('41'); - var di_1 = $__require('3a'); - var ng_zone_1 = $__require('5a'); - var collection_1 = $__require('38'); - exports.EVENT_MANAGER_PLUGINS = lang_1.CONST_EXPR(new di_1.OpaqueToken("EventManagerPlugins")); - var EventManager = (function() { - function EventManager(plugins, _zone) { - var _this = this; - this._zone = _zone; - plugins.forEach(function(p) { - return p.manager = _this; - }); - this._plugins = collection_1.ListWrapper.reversed(plugins); - } - EventManager.prototype.addEventListener = function(element, eventName, handler) { - var plugin = this._findPluginFor(eventName); - return plugin.addEventListener(element, eventName, handler); - }; - EventManager.prototype.addGlobalEventListener = function(target, eventName, handler) { - var plugin = this._findPluginFor(eventName); - return plugin.addGlobalEventListener(target, eventName, handler); - }; - EventManager.prototype.getZone = function() { - return this._zone; - }; - EventManager.prototype._findPluginFor = function(eventName) { - var plugins = this._plugins; - for (var i = 0; i < plugins.length; i++) { - var plugin = plugins[i]; - if (plugin.supports(eventName)) { - return plugin; - } - } - throw new exceptions_1.BaseException("No event manager plugin found for event " + eventName); - }; - EventManager = __decorate([di_1.Injectable(), __param(0, di_1.Inject(exports.EVENT_MANAGER_PLUGINS)), __metadata('design:paramtypes', [Array, ng_zone_1.NgZone])], EventManager); - return EventManager; - }()); - exports.EventManager = EventManager; - var EventManagerPlugin = (function() { - function EventManagerPlugin() {} - EventManagerPlugin.prototype.supports = function(eventName) { - return false; - }; - EventManagerPlugin.prototype.addEventListener = function(element, eventName, handler) { - throw "not implemented"; - }; - EventManagerPlugin.prototype.addGlobalEventListener = function(element, eventName, handler) { - throw "not implemented"; - }; - return EventManagerPlugin; - }()); - exports.EventManagerPlugin = EventManagerPlugin; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("5b", ["39", "38"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var event_manager_1 = $__require('39'); - var collection_1 = $__require('38'); - var _eventNames = { - 'pan': true, - 'panstart': true, - 'panmove': true, - 'panend': true, - 'pancancel': true, - 'panleft': true, - 'panright': true, - 'panup': true, - 'pandown': true, - 'pinch': true, - 'pinchstart': true, - 'pinchmove': true, - 'pinchend': true, - 'pinchcancel': true, - 'pinchin': true, - 'pinchout': true, - 'press': true, - 'pressup': true, - 'rotate': true, - 'rotatestart': true, - 'rotatemove': true, - 'rotateend': true, - 'rotatecancel': true, - 'swipe': true, - 'swipeleft': true, - 'swiperight': true, - 'swipeup': true, - 'swipedown': true, - 'tap': true - }; - var HammerGesturesPluginCommon = (function(_super) { - __extends(HammerGesturesPluginCommon, _super); - function HammerGesturesPluginCommon() { - _super.call(this); - } - HammerGesturesPluginCommon.prototype.supports = function(eventName) { - eventName = eventName.toLowerCase(); - return collection_1.StringMapWrapper.contains(_eventNames, eventName); - }; - return HammerGesturesPluginCommon; - }(event_manager_1.EventManagerPlugin)); - exports.HammerGesturesPluginCommon = HammerGesturesPluginCommon; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("5c", ["5b", "2b", "41", "16"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; - }; - var hammer_common_1 = $__require('5b'); - var lang_1 = $__require('2b'); - var exceptions_1 = $__require('41'); - var core_1 = $__require('16'); - exports.HAMMER_GESTURE_CONFIG = lang_1.CONST_EXPR(new core_1.OpaqueToken("HammerGestureConfig")); - var HammerGestureConfig = (function() { - function HammerGestureConfig() { - this.events = []; - this.overrides = {}; - } - HammerGestureConfig.prototype.buildHammer = function(element) { - var mc = new Hammer(element); - mc.get('pinch').set({enable: true}); - mc.get('rotate').set({enable: true}); - for (var eventName in this.overrides) { - mc.get(eventName).set(this.overrides[eventName]); - } - return mc; - }; - HammerGestureConfig = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], HammerGestureConfig); - return HammerGestureConfig; - }()); - exports.HammerGestureConfig = HammerGestureConfig; - var HammerGesturesPlugin = (function(_super) { - __extends(HammerGesturesPlugin, _super); - function HammerGesturesPlugin(_config) { - _super.call(this); - this._config = _config; - } - HammerGesturesPlugin.prototype.supports = function(eventName) { - if (!_super.prototype.supports.call(this, eventName) && !this.isCustomEvent(eventName)) - return false; - if (!lang_1.isPresent(window['Hammer'])) { - throw new exceptions_1.BaseException("Hammer.js is not loaded, can not bind " + eventName + " event"); - } - return true; - }; - HammerGesturesPlugin.prototype.addEventListener = function(element, eventName, handler) { - var _this = this; - var zone = this.manager.getZone(); - eventName = eventName.toLowerCase(); - return zone.runOutsideAngular(function() { - var mc = _this._config.buildHammer(element); - var callback = function(eventObj) { - zone.runGuarded(function() { - handler(eventObj); - }); - }; - mc.on(eventName, callback); - return function() { - mc.off(eventName, callback); - }; - }); - }; - HammerGesturesPlugin.prototype.isCustomEvent = function(eventName) { - return this._config.events.indexOf(eventName) > -1; - }; - HammerGesturesPlugin = __decorate([core_1.Injectable(), __param(0, core_1.Inject(exports.HAMMER_GESTURE_CONFIG)), __metadata('design:paramtypes', [HammerGestureConfig])], HammerGesturesPlugin); - return HammerGesturesPlugin; - }(hammer_common_1.HammerGesturesPluginCommon)); - exports.HammerGesturesPlugin = HammerGesturesPlugin; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("5d", ["2b", "3a", "40", "16", "23", "5e", "37", "44", "36", "4e", "4f", "4d", "4b", "4c", "3d", "3e", "3f", "43", "39", "5c", "54", "55", "59", "5c"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var di_1 = $__require('3a'); - var xhr_1 = $__require('40'); - var core_1 = $__require('16'); - var common_1 = $__require('23'); - var testability_1 = $__require('5e'); - var dom_adapter_1 = $__require('37'); - var dom_events_1 = $__require('44'); - var key_events_1 = $__require('36'); - var dom_tokens_1 = $__require('4e'); - var dom_renderer_1 = $__require('4f'); - var shared_styles_host_1 = $__require('4d'); - var browser_details_1 = $__require('4b'); - var animation_builder_1 = $__require('4c'); - var browser_adapter_1 = $__require('3d'); - var testability_2 = $__require('3e'); - var xhr_cache_1 = $__require('3f'); - var wtf_init_1 = $__require('43'); - var event_manager_1 = $__require('39'); - var hammer_gestures_1 = $__require('5c'); - var common_dom_1 = $__require('54'); - var dom_tokens_2 = $__require('4e'); - exports.DOCUMENT = dom_tokens_2.DOCUMENT; - var title_1 = $__require('55'); - exports.Title = title_1.Title; - var common_dom_2 = $__require('54'); - exports.ELEMENT_PROBE_PROVIDERS = common_dom_2.ELEMENT_PROBE_PROVIDERS; - exports.ELEMENT_PROBE_PROVIDERS_PROD_MODE = common_dom_2.ELEMENT_PROBE_PROVIDERS_PROD_MODE; - exports.inspectNativeElement = common_dom_2.inspectNativeElement; - exports.By = common_dom_2.By; - var browser_adapter_2 = $__require('3d'); - exports.BrowserDomAdapter = browser_adapter_2.BrowserDomAdapter; - var tools_1 = $__require('59'); - exports.enableDebugTools = tools_1.enableDebugTools; - exports.disableDebugTools = tools_1.disableDebugTools; - var hammer_gestures_2 = $__require('5c'); - exports.HAMMER_GESTURE_CONFIG = hammer_gestures_2.HAMMER_GESTURE_CONFIG; - exports.HammerGestureConfig = hammer_gestures_2.HammerGestureConfig; - exports.BROWSER_PLATFORM_MARKER = lang_1.CONST_EXPR(new di_1.OpaqueToken('BrowserPlatformMarker')); - exports.BROWSER_PROVIDERS = lang_1.CONST_EXPR([new di_1.Provider(exports.BROWSER_PLATFORM_MARKER, {useValue: true}), core_1.PLATFORM_COMMON_PROVIDERS, new di_1.Provider(core_1.PLATFORM_INITIALIZER, { - useValue: initDomAdapter, - multi: true - })]); - function _exceptionHandler() { - return new core_1.ExceptionHandler(dom_adapter_1.DOM, !lang_1.IS_DART); - } - function _document() { - return dom_adapter_1.DOM.defaultDoc(); - } - exports.BROWSER_APP_COMMON_PROVIDERS = lang_1.CONST_EXPR([core_1.APPLICATION_COMMON_PROVIDERS, common_1.FORM_PROVIDERS, new di_1.Provider(core_1.PLATFORM_PIPES, { - useValue: common_1.COMMON_PIPES, - multi: true - }), new di_1.Provider(core_1.PLATFORM_DIRECTIVES, { - useValue: common_1.COMMON_DIRECTIVES, - multi: true - }), new di_1.Provider(core_1.ExceptionHandler, { - useFactory: _exceptionHandler, - deps: [] - }), new di_1.Provider(dom_tokens_1.DOCUMENT, { - useFactory: _document, - deps: [] - }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { - useClass: dom_events_1.DomEventsPlugin, - multi: true - }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { - useClass: key_events_1.KeyEventsPlugin, - multi: true - }), new di_1.Provider(event_manager_1.EVENT_MANAGER_PLUGINS, { - useClass: hammer_gestures_1.HammerGesturesPlugin, - multi: true - }), new di_1.Provider(hammer_gestures_1.HAMMER_GESTURE_CONFIG, {useClass: hammer_gestures_1.HammerGestureConfig}), new di_1.Provider(dom_renderer_1.DomRootRenderer, {useClass: dom_renderer_1.DomRootRenderer_}), new di_1.Provider(core_1.RootRenderer, {useExisting: dom_renderer_1.DomRootRenderer}), new di_1.Provider(shared_styles_host_1.SharedStylesHost, {useExisting: shared_styles_host_1.DomSharedStylesHost}), shared_styles_host_1.DomSharedStylesHost, testability_1.Testability, browser_details_1.BrowserDetails, animation_builder_1.AnimationBuilder, event_manager_1.EventManager, common_dom_1.ELEMENT_PROBE_PROVIDERS]); - exports.CACHED_TEMPLATE_PROVIDER = lang_1.CONST_EXPR([new di_1.Provider(xhr_1.XHR, {useClass: xhr_cache_1.CachedXHR})]); - function initDomAdapter() { - browser_adapter_1.BrowserDomAdapter.makeCurrent(); - wtf_init_1.wtfInit(); - testability_2.BrowserGetTestability.init(); - } - exports.initDomAdapter = initDomAdapter; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("5f", ["60", "41", "38", "61", "62", "63"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var compile_metadata_1 = $__require('60'); - var exceptions_1 = $__require('41'); - var collection_1 = $__require('38'); - var o = $__require('61'); - var component_factory_1 = $__require('62'); - var util_1 = $__require('63'); + var define, + global = this, + GLOBAL = this; + var core_1 = $__require('11'); + var compile_metadata_1 = $__require('c'); + var exceptions_1 = $__require('d'); + var collection_1 = $__require('e'); + var o = $__require('f'); + var util_1 = $__require('10'); var _COMPONENT_FACTORY_IDENTIFIER = new compile_metadata_1.CompileIdentifierMetadata({ name: 'ComponentFactory', - runtime: component_factory_1.ComponentFactory, - moduleUrl: "asset:angular2/lib/src/core/linker/component_factory" + util_1.MODULE_SUFFIX + runtime: core_1.ComponentFactory, + moduleUrl: util_1.assetUrl('core', 'linker/component_factory') }); var SourceModule = (function() { function SourceModule(moduleUrl, source) { @@ -11023,6 +7648,14 @@ $__System.registerDynamic("5f", ["60", "41", "38", "61", "62", "63"], true, func return SourceModule; }()); exports.SourceModule = SourceModule; + var StyleSheetSourceWithImports = (function() { + function StyleSheetSourceWithImports(source, importedUrls) { + this.source = source; + this.importedUrls = importedUrls; + } + return StyleSheetSourceWithImports; + }()); + exports.StyleSheetSourceWithImports = StyleSheetSourceWithImports; var NormalizedComponentWithViewDirectives = (function() { function NormalizedComponentWithViewDirectives(component, directives, pipes) { this.component = component; @@ -11033,12 +7666,13 @@ $__System.registerDynamic("5f", ["60", "41", "38", "61", "62", "63"], true, func }()); exports.NormalizedComponentWithViewDirectives = NormalizedComponentWithViewDirectives; var OfflineCompiler = (function() { - function OfflineCompiler(_directiveNormalizer, _templateParser, _styleCompiler, _viewCompiler, _outputEmitter) { + function OfflineCompiler(_directiveNormalizer, _templateParser, _styleCompiler, _viewCompiler, _outputEmitter, _xhr) { this._directiveNormalizer = _directiveNormalizer; this._templateParser = _templateParser; this._styleCompiler = _styleCompiler; this._viewCompiler = _viewCompiler; this._outputEmitter = _outputEmitter; + this._xhr = _xhr; } OfflineCompiler.prototype.normalizeDirectiveMetadata = function(directive) { return this._directiveNormalizer.normalizeDirective(directive); @@ -11059,24 +7693,34 @@ $__System.registerDynamic("5f", ["60", "41", "38", "61", "62", "63"], true, func var hostMeta = compile_metadata_1.createHostComponentMeta(compMeta.type, compMeta.selector); var hostViewFactoryVar = _this._compileComponent(hostMeta, [compMeta], [], statements); var compFactoryVar = compMeta.type.name + "NgFactory"; - statements.push(o.variable(compFactoryVar).set(o.importExpr(_COMPONENT_FACTORY_IDENTIFIER).instantiate([o.literal(compMeta.selector), o.variable(hostViewFactoryVar), o.importExpr(compMeta.type)], o.importType(_COMPONENT_FACTORY_IDENTIFIER, null, [o.TypeModifier.Const]))).toDeclStmt(null, [o.StmtModifier.Final])); + statements.push(o.variable(compFactoryVar).set(o.importExpr(_COMPONENT_FACTORY_IDENTIFIER, [o.importType(compMeta.type)]).instantiate([o.literal(compMeta.selector), o.variable(hostViewFactoryVar), o.importExpr(compMeta.type)], o.importType(_COMPONENT_FACTORY_IDENTIFIER, [o.importType(compMeta.type)], [o.TypeModifier.Const]))).toDeclStmt(null, [o.StmtModifier.Final])); exportedVars.push(compFactoryVar); }); return this._codegenSourceModule(moduleUrl, statements, exportedVars); }; - OfflineCompiler.prototype.compileStylesheet = function(stylesheetUrl, cssText) { - var plainStyles = this._styleCompiler.compileStylesheet(stylesheetUrl, cssText, false); - var shimStyles = this._styleCompiler.compileStylesheet(stylesheetUrl, cssText, true); - return [this._codegenSourceModule(_stylesModuleUrl(stylesheetUrl, false), _resolveStyleStatements(plainStyles), [plainStyles.stylesVar]), this._codegenSourceModule(_stylesModuleUrl(stylesheetUrl, true), _resolveStyleStatements(shimStyles), [shimStyles.stylesVar])]; + OfflineCompiler.prototype.loadAndCompileStylesheet = function(stylesheetUrl, shim, suffix) { + var _this = this; + return this._xhr.get(stylesheetUrl).then(function(cssText) { + var compileResult = _this._styleCompiler.compileStylesheet(stylesheetUrl, cssText, shim); + var importedUrls = []; + compileResult.dependencies.forEach(function(dep) { + importedUrls.push(dep.moduleUrl); + dep.valuePlaceholder.moduleUrl = _stylesModuleUrl(dep.moduleUrl, dep.isShimmed, suffix); + }); + return new StyleSheetSourceWithImports(_this._codgenStyles(stylesheetUrl, shim, suffix, compileResult), importedUrls); + }); }; OfflineCompiler.prototype._compileComponent = function(compMeta, directives, pipes, targetStatements) { var styleResult = this._styleCompiler.compileComponent(compMeta); var parsedTemplate = this._templateParser.parse(compMeta, compMeta.template.template, directives, pipes, compMeta.type.name); var viewResult = this._viewCompiler.compileComponent(compMeta, parsedTemplate, o.variable(styleResult.stylesVar), pipes); - collection_1.ListWrapper.addAll(targetStatements, _resolveStyleStatements(styleResult)); + collection_1.ListWrapper.addAll(targetStatements, _resolveStyleStatements(compMeta.type.moduleUrl, styleResult)); collection_1.ListWrapper.addAll(targetStatements, _resolveViewStatements(viewResult)); return viewResult.viewFactoryVar; }; + OfflineCompiler.prototype._codgenStyles = function(inputUrl, shim, suffix, stylesCompileResult) { + return this._codegenSourceModule(_stylesModuleUrl(inputUrl, shim, suffix), stylesCompileResult.statements, [stylesCompileResult.stylesVar]); + }; OfflineCompiler.prototype._codegenSourceModule = function(moduleUrl, statements, exportedVars) { return new SourceModule(moduleUrl, this._outputEmitter.emitStatements(moduleUrl, statements, exportedVars)); }; @@ -11089,768 +7733,42 @@ $__System.registerDynamic("5f", ["60", "41", "38", "61", "62", "63"], true, func }); return compileResult.statements; } - function _resolveStyleStatements(compileResult) { + function _resolveStyleStatements(containingModuleUrl, compileResult) { + var containingSuffix = _splitSuffix(containingModuleUrl)[1]; compileResult.dependencies.forEach(function(dep) { - dep.valuePlaceholder.moduleUrl = _stylesModuleUrl(dep.sourceUrl, dep.isShimmed); + dep.valuePlaceholder.moduleUrl = _stylesModuleUrl(dep.moduleUrl, dep.isShimmed, containingSuffix); }); return compileResult.statements; } function _templateModuleUrl(comp) { - var moduleUrl = comp.type.moduleUrl; - var urlWithoutSuffix = moduleUrl.substring(0, moduleUrl.length - util_1.MODULE_SUFFIX.length); - return urlWithoutSuffix + ".ngfactory" + util_1.MODULE_SUFFIX; + var urlWithSuffix = _splitSuffix(comp.type.moduleUrl); + return urlWithSuffix[0] + ".ngfactory" + urlWithSuffix[1]; } - function _stylesModuleUrl(stylesheetUrl, shim) { - return shim ? stylesheetUrl + ".shim" + util_1.MODULE_SUFFIX : "" + stylesheetUrl + util_1.MODULE_SUFFIX; + function _stylesModuleUrl(stylesheetUrl, shim, suffix) { + return shim ? stylesheetUrl + ".shim" + suffix : "" + stylesheetUrl + suffix; } function _assertComponent(meta) { if (!meta.isComponent) { throw new exceptions_1.BaseException("Could not compile '" + meta.type.name + "' because it is not a component."); } } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("64", ["38", "2b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var collection_1 = $__require('38'); - var lang_1 = $__require('2b'); - var ShadowCss = (function() { - function ShadowCss() { - this.strictStyling = true; - } - ShadowCss.prototype.shimCssText = function(cssText, selector, hostSelector) { - if (hostSelector === void 0) { - hostSelector = ''; - } - cssText = stripComments(cssText); - cssText = this._insertDirectives(cssText); - return this._scopeCssText(cssText, selector, hostSelector); - }; - ShadowCss.prototype._insertDirectives = function(cssText) { - cssText = this._insertPolyfillDirectivesInCssText(cssText); - return this._insertPolyfillRulesInCssText(cssText); - }; - ShadowCss.prototype._insertPolyfillDirectivesInCssText = function(cssText) { - return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe, function(m) { - return m[1] + '{'; - }); - }; - ShadowCss.prototype._insertPolyfillRulesInCssText = function(cssText) { - return lang_1.StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m) { - var rule = m[0]; - rule = lang_1.StringWrapper.replace(rule, m[1], ''); - rule = lang_1.StringWrapper.replace(rule, m[2], ''); - return m[3] + rule; - }); - }; - ShadowCss.prototype._scopeCssText = function(cssText, scopeSelector, hostSelector) { - var unscoped = this._extractUnscopedRulesFromCssText(cssText); - cssText = this._insertPolyfillHostInCssText(cssText); - cssText = this._convertColonHost(cssText); - cssText = this._convertColonHostContext(cssText); - cssText = this._convertShadowDOMSelectors(cssText); - if (lang_1.isPresent(scopeSelector)) { - cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector); - } - cssText = cssText + '\n' + unscoped; - return cssText.trim(); - }; - ShadowCss.prototype._extractUnscopedRulesFromCssText = function(cssText) { - var r = '', - m; - var matcher = lang_1.RegExpWrapper.matcher(_cssContentUnscopedRuleRe, cssText); - while (lang_1.isPresent(m = lang_1.RegExpMatcherWrapper.next(matcher))) { - var rule = m[0]; - rule = lang_1.StringWrapper.replace(rule, m[2], ''); - rule = lang_1.StringWrapper.replace(rule, m[1], m[3]); - r += rule + '\n\n'; - } - return r; - }; - ShadowCss.prototype._convertColonHost = function(cssText) { - return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer); - }; - ShadowCss.prototype._convertColonHostContext = function(cssText) { - return this._convertColonRule(cssText, _cssColonHostContextRe, this._colonHostContextPartReplacer); - }; - ShadowCss.prototype._convertColonRule = function(cssText, regExp, partReplacer) { - return lang_1.StringWrapper.replaceAllMapped(cssText, regExp, function(m) { - if (lang_1.isPresent(m[2])) { - var parts = m[2].split(','), - r = []; - for (var i = 0; i < parts.length; i++) { - var p = parts[i]; - if (lang_1.isBlank(p)) - break; - p = p.trim(); - r.push(partReplacer(_polyfillHostNoCombinator, p, m[3])); - } - return r.join(','); - } else { - return _polyfillHostNoCombinator + m[3]; - } - }); - }; - ShadowCss.prototype._colonHostContextPartReplacer = function(host, part, suffix) { - if (lang_1.StringWrapper.contains(part, _polyfillHost)) { - return this._colonHostPartReplacer(host, part, suffix); - } else { - return host + part + suffix + ', ' + part + ' ' + host + suffix; - } - }; - ShadowCss.prototype._colonHostPartReplacer = function(host, part, suffix) { - return host + lang_1.StringWrapper.replace(part, _polyfillHost, '') + suffix; - }; - ShadowCss.prototype._convertShadowDOMSelectors = function(cssText) { - for (var i = 0; i < _shadowDOMSelectorsRe.length; i++) { - cssText = lang_1.StringWrapper.replaceAll(cssText, _shadowDOMSelectorsRe[i], ' '); - } - return cssText; - }; - ShadowCss.prototype._scopeSelectors = function(cssText, scopeSelector, hostSelector) { - var _this = this; - return processRules(cssText, function(rule) { - var selector = rule.selector; - var content = rule.content; - if (rule.selector[0] != '@' || rule.selector.startsWith('@page')) { - selector = _this._scopeSelector(rule.selector, scopeSelector, hostSelector, _this.strictStyling); - } else if (rule.selector.startsWith('@media')) { - content = _this._scopeSelectors(rule.content, scopeSelector, hostSelector); - } - return new CssRule(selector, content); - }); - }; - ShadowCss.prototype._scopeSelector = function(selector, scopeSelector, hostSelector, strict) { - var r = [], - parts = selector.split(','); - for (var i = 0; i < parts.length; i++) { - var p = parts[i].trim(); - var deepParts = lang_1.StringWrapper.split(p, _shadowDeepSelectors); - var shallowPart = deepParts[0]; - if (this._selectorNeedsScoping(shallowPart, scopeSelector)) { - deepParts[0] = strict && !lang_1.StringWrapper.contains(shallowPart, _polyfillHostNoCombinator) ? this._applyStrictSelectorScope(shallowPart, scopeSelector) : this._applySelectorScope(shallowPart, scopeSelector, hostSelector); - } - r.push(deepParts.join(' ')); - } - return r.join(', '); - }; - ShadowCss.prototype._selectorNeedsScoping = function(selector, scopeSelector) { - var re = this._makeScopeMatcher(scopeSelector); - return !lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(re, selector)); - }; - ShadowCss.prototype._makeScopeMatcher = function(scopeSelector) { - var lre = /\[/g; - var rre = /\]/g; - scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, lre, '\\['); - scopeSelector = lang_1.StringWrapper.replaceAll(scopeSelector, rre, '\\]'); - return lang_1.RegExpWrapper.create('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); - }; - ShadowCss.prototype._applySelectorScope = function(selector, scopeSelector, hostSelector) { - return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector); - }; - ShadowCss.prototype._applySimpleSelectorScope = function(selector, scopeSelector, hostSelector) { - if (lang_1.isPresent(lang_1.RegExpWrapper.firstMatch(_polyfillHostRe, selector))) { - var replaceBy = this.strictStyling ? "[" + hostSelector + "]" : scopeSelector; - selector = lang_1.StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy); - return lang_1.StringWrapper.replaceAll(selector, _polyfillHostRe, replaceBy + ' '); - } else { - return scopeSelector + ' ' + selector; - } - }; - ShadowCss.prototype._applyStrictSelectorScope = function(selector, scopeSelector) { - var isRe = /\[is=([^\]]*)\]/g; - scopeSelector = lang_1.StringWrapper.replaceAllMapped(scopeSelector, isRe, function(m) { - return m[1]; - }); - var splits = [' ', '>', '+', '~'], - scoped = selector, - attrName = '[' + scopeSelector + ']'; - for (var i = 0; i < splits.length; i++) { - var sep = splits[i]; - var parts = scoped.split(sep); - scoped = parts.map(function(p) { - var t = lang_1.StringWrapper.replaceAll(p.trim(), _polyfillHostRe, ''); - if (t.length > 0 && !collection_1.ListWrapper.contains(splits, t) && !lang_1.StringWrapper.contains(t, attrName)) { - var re = /([^:]*)(:*)(.*)/g; - var m = lang_1.RegExpWrapper.firstMatch(re, t); - if (lang_1.isPresent(m)) { - p = m[1] + attrName + m[2] + m[3]; - } - } - return p; - }).join(sep); - } - return scoped; - }; - ShadowCss.prototype._insertPolyfillHostInCssText = function(selector) { - selector = lang_1.StringWrapper.replaceAll(selector, _colonHostContextRe, _polyfillHostContext); - selector = lang_1.StringWrapper.replaceAll(selector, _colonHostRe, _polyfillHost); - return selector; - }; - return ShadowCss; - }()); - exports.ShadowCss = ShadowCss; - var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim; - var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; - var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim; - var _polyfillHost = '-shadowcsshost'; - var _polyfillHostContext = '-shadowcsscontext'; - var _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)'; - var _cssColonHostRe = lang_1.RegExpWrapper.create('(' + _polyfillHost + _parenSuffix, 'im'); - var _cssColonHostContextRe = lang_1.RegExpWrapper.create('(' + _polyfillHostContext + _parenSuffix, 'im'); - var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; - var _shadowDOMSelectorsRe = [/::shadow/g, /::content/g, /\/shadow-deep\//g, /\/shadow\//g]; - var _shadowDeepSelectors = /(?:>>>)|(?:\/deep\/)/g; - var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$'; - var _polyfillHostRe = lang_1.RegExpWrapper.create(_polyfillHost, 'im'); - var _colonHostRe = /:host/gim; - var _colonHostContextRe = /:host-context/gim; - var _commentRe = /\/\*[\s\S]*?\*\//g; - function stripComments(input) { - return lang_1.StringWrapper.replaceAllMapped(input, _commentRe, function(_) { - return ''; - }); - } - var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g; - var _curlyRe = /([{}])/g; - var OPEN_CURLY = '{'; - var CLOSE_CURLY = '}'; - var BLOCK_PLACEHOLDER = '%BLOCK%'; - var CssRule = (function() { - function CssRule(selector, content) { - this.selector = selector; - this.content = content; - } - return CssRule; - }()); - exports.CssRule = CssRule; - function processRules(input, ruleCallback) { - var inputWithEscapedBlocks = escapeBlocks(input); - var nextBlockIndex = 0; - return lang_1.StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function(m) { - var selector = m[2]; - var content = ''; - var suffix = m[4]; - var contentPrefix = ''; - if (lang_1.isPresent(m[4]) && m[4].startsWith('{' + BLOCK_PLACEHOLDER)) { - content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; - suffix = m[4].substring(BLOCK_PLACEHOLDER.length + 1); - contentPrefix = '{'; - } - var rule = ruleCallback(new CssRule(selector, content)); - return "" + m[1] + rule.selector + m[3] + contentPrefix + rule.content + suffix; - }); - } - exports.processRules = processRules; - var StringWithEscapedBlocks = (function() { - function StringWithEscapedBlocks(escapedString, blocks) { - this.escapedString = escapedString; - this.blocks = blocks; - } - return StringWithEscapedBlocks; - }()); - function escapeBlocks(input) { - var inputParts = lang_1.StringWrapper.split(input, _curlyRe); - var resultParts = []; - var escapedBlocks = []; - var bracketCount = 0; - var currentBlockParts = []; - for (var partIndex = 0; partIndex < inputParts.length; partIndex++) { - var part = inputParts[partIndex]; - if (part == CLOSE_CURLY) { - bracketCount--; - } - if (bracketCount > 0) { - currentBlockParts.push(part); - } else { - if (currentBlockParts.length > 0) { - escapedBlocks.push(currentBlockParts.join('')); - resultParts.push(BLOCK_PLACEHOLDER); - currentBlockParts = []; - } - resultParts.push(part); - } - if (part == OPEN_CURLY) { - bracketCount++; - } - } - if (currentBlockParts.length > 0) { - escapedBlocks.push(currentBlockParts.join('')); - resultParts.push(BLOCK_PLACEHOLDER); - } - return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks); - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("65", ["60", "61", "66", "64", "67", "68", "3a", "2b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var compile_metadata_1 = $__require('60'); - var o = $__require('61'); - var view_1 = $__require('66'); - var shadow_css_1 = $__require('64'); - var url_resolver_1 = $__require('67'); - var style_url_resolver_1 = $__require('68'); - var di_1 = $__require('3a'); - var lang_1 = $__require('2b'); - var COMPONENT_VARIABLE = '%COMP%'; - var HOST_ATTR = "_nghost-" + COMPONENT_VARIABLE; - var CONTENT_ATTR = "_ngcontent-" + COMPONENT_VARIABLE; - var StylesCompileDependency = (function() { - function StylesCompileDependency(sourceUrl, isShimmed, valuePlaceholder) { - this.sourceUrl = sourceUrl; - this.isShimmed = isShimmed; - this.valuePlaceholder = valuePlaceholder; - } - return StylesCompileDependency; - }()); - exports.StylesCompileDependency = StylesCompileDependency; - var StylesCompileResult = (function() { - function StylesCompileResult(statements, stylesVar, dependencies) { - this.statements = statements; - this.stylesVar = stylesVar; - this.dependencies = dependencies; - } - return StylesCompileResult; - }()); - exports.StylesCompileResult = StylesCompileResult; - var StyleCompiler = (function() { - function StyleCompiler(_urlResolver) { - this._urlResolver = _urlResolver; - this._shadowCss = new shadow_css_1.ShadowCss(); - } - StyleCompiler.prototype.compileComponent = function(comp) { - var shim = comp.template.encapsulation === view_1.ViewEncapsulation.Emulated; - return this._compileStyles(getStylesVarName(comp), comp.template.styles, comp.template.styleUrls, shim); - }; - StyleCompiler.prototype.compileStylesheet = function(stylesheetUrl, cssText, isShimmed) { - var styleWithImports = style_url_resolver_1.extractStyleUrls(this._urlResolver, stylesheetUrl, cssText); - return this._compileStyles(getStylesVarName(null), [styleWithImports.style], styleWithImports.styleUrls, isShimmed); - }; - StyleCompiler.prototype._compileStyles = function(stylesVar, plainStyles, absUrls, shim) { - var _this = this; - var styleExpressions = plainStyles.map(function(plainStyle) { - return o.literal(_this._shimIfNeeded(plainStyle, shim)); - }); - var dependencies = []; - for (var i = 0; i < absUrls.length; i++) { - var identifier = new compile_metadata_1.CompileIdentifierMetadata({name: getStylesVarName(null)}); - dependencies.push(new StylesCompileDependency(absUrls[i], shim, identifier)); - styleExpressions.push(new o.ExternalExpr(identifier)); - } - var stmt = o.variable(stylesVar).set(o.literalArr(styleExpressions, new o.ArrayType(o.DYNAMIC_TYPE, [o.TypeModifier.Const]))).toDeclStmt(null, [o.StmtModifier.Final]); - return new StylesCompileResult([stmt], stylesVar, dependencies); - }; - StyleCompiler.prototype._shimIfNeeded = function(style, shim) { - return shim ? this._shadowCss.shimCssText(style, CONTENT_ATTR, HOST_ATTR) : style; - }; - StyleCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [url_resolver_1.UrlResolver])], StyleCompiler); - return StyleCompiler; - }()); - exports.StyleCompiler = StyleCompiler; - function getStylesVarName(component) { - var result = "styles"; - if (lang_1.isPresent(component)) { - result += "_" + component.type.name; - } - return result; - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("69", ["2b", "41", "61", "6a", "6b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var exceptions_1 = $__require('41'); - var o = $__require('61'); - var identifiers_1 = $__require('6a'); - var util_1 = $__require('6b'); - var _PurePipeProxy = (function() { - function _PurePipeProxy(instance, argCount) { - this.instance = instance; - this.argCount = argCount; - } - return _PurePipeProxy; - }()); - var CompilePipe = (function() { - function CompilePipe(view, name) { - this.view = view; - this._purePipeProxies = []; - this.meta = _findPipeMeta(view, name); - this.instance = o.THIS_EXPR.prop("_pipe_" + name + "_" + view.pipeCount++); - } - Object.defineProperty(CompilePipe.prototype, "pure", { - get: function() { - return this.meta.pure; - }, - enumerable: true, - configurable: true - }); - CompilePipe.prototype.create = function() { - var _this = this; - var deps = this.meta.type.diDeps.map(function(diDep) { - if (diDep.token.equalsTo(identifiers_1.identifierToken(identifiers_1.Identifiers.ChangeDetectorRef))) { - return o.THIS_EXPR.prop('ref'); - } - return util_1.injectFromViewParentInjector(diDep.token, false); - }); - this.view.fields.push(new o.ClassField(this.instance.name, o.importType(this.meta.type), [o.StmtModifier.Private])); - this.view.createMethod.resetDebugInfo(null, null); - this.view.createMethod.addStmt(o.THIS_EXPR.prop(this.instance.name).set(o.importExpr(this.meta.type).instantiate(deps)).toStmt()); - this._purePipeProxies.forEach(function(purePipeProxy) { - util_1.createPureProxy(_this.instance.prop('transform').callMethod(o.BuiltinMethod.bind, [_this.instance]), purePipeProxy.argCount, purePipeProxy.instance, _this.view); - }); - }; - CompilePipe.prototype.call = function(callingView, args) { - if (this.meta.pure) { - var purePipeProxy = new _PurePipeProxy(o.THIS_EXPR.prop(this.instance.name + "_" + this._purePipeProxies.length), args.length); - this._purePipeProxies.push(purePipeProxy); - return util_1.getPropertyInView(o.importExpr(identifiers_1.Identifiers.castByValue).callFn([purePipeProxy.instance, this.instance.prop('transform')]), callingView, this.view).callFn(args); - } else { - return util_1.getPropertyInView(this.instance, callingView, this.view).callMethod('transform', args); - } - }; - return CompilePipe; - }()); - exports.CompilePipe = CompilePipe; - function _findPipeMeta(view, name) { - var pipeMeta = null; - for (var i = view.pipeMetas.length - 1; i >= 0; i--) { - var localPipeMeta = view.pipeMetas[i]; - if (localPipeMeta.name == name) { - pipeMeta = localPipeMeta; - break; - } - } - if (lang_1.isBlank(pipeMeta)) { - throw new exceptions_1.BaseException("Illegal state: Could not find pipe " + name + " although the parser should have detected this error!"); - } - return pipeMeta; - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("6c", ["2b", "38", "61", "6d", "6e", "6f", "69", "70", "60", "6b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var collection_1 = $__require('38'); - var o = $__require('61'); - var constants_1 = $__require('6d'); - var compile_query_1 = $__require('6e'); - var compile_method_1 = $__require('6f'); - var compile_pipe_1 = $__require('69'); - var view_type_1 = $__require('70'); - var compile_metadata_1 = $__require('60'); - var util_1 = $__require('6b'); - var CompileView = (function() { - function CompileView(component, genConfig, pipeMetas, styles, viewIndex, declarationElement, templateVariableBindings) { - var _this = this; - this.component = component; - this.genConfig = genConfig; - this.pipeMetas = pipeMetas; - this.styles = styles; - this.viewIndex = viewIndex; - this.declarationElement = declarationElement; - this.templateVariableBindings = templateVariableBindings; - this.nodes = []; - this.rootNodesOrAppElements = []; - this.bindings = []; - this.classStatements = []; - this.eventHandlerMethods = []; - this.fields = []; - this.getters = []; - this.disposables = []; - this.subscriptions = []; - this.purePipes = new Map(); - this.pipes = []; - this.locals = new Map(); - this.literalArrayCount = 0; - this.literalMapCount = 0; - this.pipeCount = 0; - this.createMethod = new compile_method_1.CompileMethod(this); - this.injectorGetMethod = new compile_method_1.CompileMethod(this); - this.updateContentQueriesMethod = new compile_method_1.CompileMethod(this); - this.dirtyParentQueriesMethod = new compile_method_1.CompileMethod(this); - this.updateViewQueriesMethod = new compile_method_1.CompileMethod(this); - this.detectChangesInInputsMethod = new compile_method_1.CompileMethod(this); - this.detectChangesRenderPropertiesMethod = new compile_method_1.CompileMethod(this); - this.afterContentLifecycleCallbacksMethod = new compile_method_1.CompileMethod(this); - this.afterViewLifecycleCallbacksMethod = new compile_method_1.CompileMethod(this); - this.destroyMethod = new compile_method_1.CompileMethod(this); - this.viewType = getViewType(component, viewIndex); - this.className = "_View_" + component.type.name + viewIndex; - this.classType = o.importType(new compile_metadata_1.CompileIdentifierMetadata({name: this.className})); - this.viewFactory = o.variable(util_1.getViewFactoryName(component, viewIndex)); - if (this.viewType === view_type_1.ViewType.COMPONENT || this.viewType === view_type_1.ViewType.HOST) { - this.componentView = this; - } else { - this.componentView = this.declarationElement.view.componentView; - } - var viewQueries = new compile_metadata_1.CompileTokenMap(); - if (this.viewType === view_type_1.ViewType.COMPONENT) { - var directiveInstance = o.THIS_EXPR.prop('context'); - collection_1.ListWrapper.forEachWithIndex(this.component.viewQueries, function(queryMeta, queryIndex) { - var propName = "_viewQuery_" + queryMeta.selectors[0].name + "_" + queryIndex; - var queryList = compile_query_1.createQueryList(queryMeta, directiveInstance, propName, _this); - var query = new compile_query_1.CompileQuery(queryMeta, queryList, directiveInstance, _this); - compile_query_1.addQueryToTokenMap(viewQueries, query); - }); - var constructorViewQueryCount = 0; - this.component.type.diDeps.forEach(function(dep) { - if (lang_1.isPresent(dep.viewQuery)) { - var queryList = o.THIS_EXPR.prop('declarationAppElement').prop('componentConstructorViewQueries').key(o.literal(constructorViewQueryCount++)); - var query = new compile_query_1.CompileQuery(dep.viewQuery, queryList, null, _this); - compile_query_1.addQueryToTokenMap(viewQueries, query); - } - }); - } - this.viewQueries = viewQueries; - templateVariableBindings.forEach(function(entry) { - _this.locals.set(entry[1], o.THIS_EXPR.prop('locals').key(o.literal(entry[0]))); - }); - if (!this.declarationElement.isNull()) { - this.declarationElement.setEmbeddedView(this); - } - } - CompileView.prototype.callPipe = function(name, input, args) { - var compView = this.componentView; - var pipe = compView.purePipes.get(name); - if (lang_1.isBlank(pipe)) { - pipe = new compile_pipe_1.CompilePipe(compView, name); - if (pipe.pure) { - compView.purePipes.set(name, pipe); - } - compView.pipes.push(pipe); - } - return pipe.call(this, [input].concat(args)); - }; - CompileView.prototype.getLocal = function(name) { - if (name == constants_1.EventHandlerVars.event.name) { - return constants_1.EventHandlerVars.event; - } - var currView = this; - var result = currView.locals.get(name); - while (lang_1.isBlank(result) && lang_1.isPresent(currView.declarationElement.view)) { - currView = currView.declarationElement.view; - result = currView.locals.get(name); - } - if (lang_1.isPresent(result)) { - return util_1.getPropertyInView(result, this, currView); - } else { - return null; - } - }; - CompileView.prototype.createLiteralArray = function(values) { - var proxyExpr = o.THIS_EXPR.prop("_arr_" + this.literalArrayCount++); - var proxyParams = []; - var proxyReturnEntries = []; - for (var i = 0; i < values.length; i++) { - var paramName = "p" + i; - proxyParams.push(new o.FnParam(paramName)); - proxyReturnEntries.push(o.variable(paramName)); - } - util_1.createPureProxy(o.fn(proxyParams, [new o.ReturnStatement(o.literalArr(proxyReturnEntries))]), values.length, proxyExpr, this); - return proxyExpr.callFn(values); - }; - CompileView.prototype.createLiteralMap = function(entries) { - var proxyExpr = o.THIS_EXPR.prop("_map_" + this.literalMapCount++); - var proxyParams = []; - var proxyReturnEntries = []; - var values = []; - for (var i = 0; i < entries.length; i++) { - var paramName = "p" + i; - proxyParams.push(new o.FnParam(paramName)); - proxyReturnEntries.push([entries[i][0], o.variable(paramName)]); - values.push(entries[i][1]); - } - util_1.createPureProxy(o.fn(proxyParams, [new o.ReturnStatement(o.literalMap(proxyReturnEntries))]), entries.length, proxyExpr, this); - return proxyExpr.callFn(values); - }; - CompileView.prototype.afterNodes = function() { - var _this = this; - this.pipes.forEach(function(pipe) { - return pipe.create(); - }); - this.viewQueries.values().forEach(function(queries) { - return queries.forEach(function(query) { - return query.afterChildren(_this.updateViewQueriesMethod); - }); - }); - }; - return CompileView; - }()); - exports.CompileView = CompileView; - function getViewType(component, embeddedTemplateIndex) { - if (embeddedTemplateIndex > 0) { - return view_type_1.ViewType.EMBEDDED; - } else if (component.type.isHost) { - return view_type_1.ViewType.HOST; + function _splitSuffix(path) { + var lastDot = path.lastIndexOf('.'); + if (lastDot !== -1) { + return [path.substring(0, lastDot), path.substring(lastDot)]; } else { - return view_type_1.ViewType.COMPONENT; + return [path, '']; } } - global.define = __define; return module.exports; }); -$__System.registerDynamic("6e", ["2b", "38", "61", "6a", "6b"], true, function($__require, exports, module) { +$__System.registerDynamic("12", ["13", "e", "14", "c", "15", "16"], true, function($__require, exports, module) { "use strict"; ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var collection_1 = $__require('38'); - var o = $__require('61'); - var identifiers_1 = $__require('6a'); - var util_1 = $__require('6b'); - var ViewQueryValues = (function() { - function ViewQueryValues(view, values) { - this.view = view; - this.values = values; - } - return ViewQueryValues; - }()); - var CompileQuery = (function() { - function CompileQuery(meta, queryList, ownerDirectiveExpression, view) { - this.meta = meta; - this.queryList = queryList; - this.ownerDirectiveExpression = ownerDirectiveExpression; - this.view = view; - this._values = new ViewQueryValues(view, []); - } - CompileQuery.prototype.addValue = function(value, view) { - var currentView = view; - var elPath = []; - while (lang_1.isPresent(currentView) && currentView !== this.view) { - var parentEl = currentView.declarationElement; - elPath.unshift(parentEl); - currentView = parentEl.view; - } - var queryListForDirtyExpr = util_1.getPropertyInView(this.queryList, view, this.view); - var viewValues = this._values; - elPath.forEach(function(el) { - var last = viewValues.values.length > 0 ? viewValues.values[viewValues.values.length - 1] : null; - if (last instanceof ViewQueryValues && last.view === el.embeddedView) { - viewValues = last; - } else { - var newViewValues = new ViewQueryValues(el.embeddedView, []); - viewValues.values.push(newViewValues); - viewValues = newViewValues; - } - }); - viewValues.values.push(value); - if (elPath.length > 0) { - view.dirtyParentQueriesMethod.addStmt(queryListForDirtyExpr.callMethod('setDirty', []).toStmt()); - } - }; - CompileQuery.prototype.afterChildren = function(targetMethod) { - var values = createQueryValues(this._values); - var updateStmts = [this.queryList.callMethod('reset', [o.literalArr(values)]).toStmt()]; - if (lang_1.isPresent(this.ownerDirectiveExpression)) { - var valueExpr = this.meta.first ? this.queryList.prop('first') : this.queryList; - updateStmts.push(this.ownerDirectiveExpression.prop(this.meta.propertyName).set(valueExpr).toStmt()); - } - if (!this.meta.first) { - updateStmts.push(this.queryList.callMethod('notifyOnChanges', []).toStmt()); - } - targetMethod.addStmt(new o.IfStmt(this.queryList.prop('dirty'), updateStmts)); - }; - return CompileQuery; - }()); - exports.CompileQuery = CompileQuery; - function createQueryValues(viewValues) { - return collection_1.ListWrapper.flatten(viewValues.values.map(function(entry) { - if (entry instanceof ViewQueryValues) { - return mapNestedViews(entry.view.declarationElement.appElement, entry.view, createQueryValues(entry)); - } else { - return entry; - } - })); - } - function mapNestedViews(declarationAppElement, view, expressions) { - var adjustedExpressions = expressions.map(function(expr) { - return o.replaceVarInExpression(o.THIS_EXPR.name, o.variable('nestedView'), expr); - }); - return declarationAppElement.callMethod('mapNestedViews', [o.variable(view.className), o.fn([new o.FnParam('nestedView', view.classType)], [new o.ReturnStatement(o.literalArr(adjustedExpressions))])]); - } - function createQueryList(query, directiveInstance, propertyName, compileView) { - compileView.fields.push(new o.ClassField(propertyName, o.importType(identifiers_1.Identifiers.QueryList), [o.StmtModifier.Private])); - var expr = o.THIS_EXPR.prop(propertyName); - compileView.createMethod.addStmt(o.THIS_EXPR.prop(propertyName).set(o.importExpr(identifiers_1.Identifiers.QueryList).instantiate([])).toStmt()); - return expr; - } - exports.createQueryList = createQueryList; - function addQueryToTokenMap(map, query) { - query.meta.selectors.forEach(function(selector) { - var entry = map.get(selector); - if (lang_1.isBlank(entry)) { - entry = []; - map.add(selector, entry); - } - entry.push(query); - }); - } - exports.addQueryToTokenMap = addQueryToTokenMap; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("71", ["61", "6a", "6d", "2b", "38", "72", "60", "6b", "6e", "6f"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; + var define, + global = this, + GLOBAL = this; var __extends = (this && this.__extends) || function(d, b) { for (var p in b) if (b.hasOwnProperty(p)) @@ -11860,1804 +7778,12 @@ $__System.registerDynamic("71", ["61", "6a", "6d", "2b", "38", "72", "60", "6b", } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - var o = $__require('61'); - var identifiers_1 = $__require('6a'); - var constants_1 = $__require('6d'); - var lang_1 = $__require('2b'); - var collection_1 = $__require('38'); - var template_ast_1 = $__require('72'); - var compile_metadata_1 = $__require('60'); - var util_1 = $__require('6b'); - var compile_query_1 = $__require('6e'); - var compile_method_1 = $__require('6f'); - var CompileNode = (function() { - function CompileNode(parent, view, nodeIndex, renderNode, sourceAst) { - this.parent = parent; - this.view = view; - this.nodeIndex = nodeIndex; - this.renderNode = renderNode; - this.sourceAst = sourceAst; - } - CompileNode.prototype.isNull = function() { - return lang_1.isBlank(this.renderNode); - }; - CompileNode.prototype.isRootElement = function() { - return this.view != this.parent.view; - }; - return CompileNode; - }()); - exports.CompileNode = CompileNode; - var CompileElement = (function(_super) { - __extends(CompileElement, _super); - function CompileElement(parent, view, nodeIndex, renderNode, sourceAst, component, _directives, _resolvedProvidersArray, hasViewContainer, hasEmbeddedView, references) { - var _this = this; - _super.call(this, parent, view, nodeIndex, renderNode, sourceAst); - this.component = component; - this._directives = _directives; - this._resolvedProvidersArray = _resolvedProvidersArray; - this.hasViewContainer = hasViewContainer; - this.hasEmbeddedView = hasEmbeddedView; - this._compViewExpr = null; - this._instances = new compile_metadata_1.CompileTokenMap(); - this._queryCount = 0; - this._queries = new compile_metadata_1.CompileTokenMap(); - this._componentConstructorViewQueryLists = []; - this.contentNodesByNgContentIndex = null; - this.referenceTokens = {}; - references.forEach(function(ref) { - return _this.referenceTokens[ref.name] = ref.value; - }); - this.elementRef = o.importExpr(identifiers_1.Identifiers.ElementRef).instantiate([this.renderNode]); - this._instances.add(identifiers_1.identifierToken(identifiers_1.Identifiers.ElementRef), this.elementRef); - this.injector = o.THIS_EXPR.callMethod('injector', [o.literal(this.nodeIndex)]); - this._instances.add(identifiers_1.identifierToken(identifiers_1.Identifiers.Injector), this.injector); - this._instances.add(identifiers_1.identifierToken(identifiers_1.Identifiers.Renderer), o.THIS_EXPR.prop('renderer')); - if (this.hasViewContainer || this.hasEmbeddedView || lang_1.isPresent(this.component)) { - this._createAppElement(); - } - } - CompileElement.createNull = function() { - return new CompileElement(null, null, null, null, null, null, [], [], false, false, []); - }; - CompileElement.prototype._createAppElement = function() { - var fieldName = "_appEl_" + this.nodeIndex; - var parentNodeIndex = this.isRootElement() ? null : this.parent.nodeIndex; - this.view.fields.push(new o.ClassField(fieldName, o.importType(identifiers_1.Identifiers.AppElement), [o.StmtModifier.Private])); - var statement = o.THIS_EXPR.prop(fieldName).set(o.importExpr(identifiers_1.Identifiers.AppElement).instantiate([o.literal(this.nodeIndex), o.literal(parentNodeIndex), o.THIS_EXPR, this.renderNode])).toStmt(); - this.view.createMethod.addStmt(statement); - this.appElement = o.THIS_EXPR.prop(fieldName); - this._instances.add(identifiers_1.identifierToken(identifiers_1.Identifiers.AppElement), this.appElement); - }; - CompileElement.prototype.setComponentView = function(compViewExpr) { - this._compViewExpr = compViewExpr; - this.contentNodesByNgContentIndex = collection_1.ListWrapper.createFixedSize(this.component.template.ngContentSelectors.length); - for (var i = 0; i < this.contentNodesByNgContentIndex.length; i++) { - this.contentNodesByNgContentIndex[i] = []; - } - }; - CompileElement.prototype.setEmbeddedView = function(embeddedView) { - this.embeddedView = embeddedView; - if (lang_1.isPresent(embeddedView)) { - var createTemplateRefExpr = o.importExpr(identifiers_1.Identifiers.TemplateRef_).instantiate([this.appElement, this.embeddedView.viewFactory]); - var provider = new compile_metadata_1.CompileProviderMetadata({ - token: identifiers_1.identifierToken(identifiers_1.Identifiers.TemplateRef), - useValue: createTemplateRefExpr - }); - this._resolvedProvidersArray.unshift(new template_ast_1.ProviderAst(provider.token, false, true, [provider], template_ast_1.ProviderAstType.Builtin, this.sourceAst.sourceSpan)); - } - }; - CompileElement.prototype.beforeChildren = function() { - var _this = this; - if (this.hasViewContainer) { - this._instances.add(identifiers_1.identifierToken(identifiers_1.Identifiers.ViewContainerRef), this.appElement.prop('vcRef')); - } - this._resolvedProviders = new compile_metadata_1.CompileTokenMap(); - this._resolvedProvidersArray.forEach(function(provider) { - return _this._resolvedProviders.add(provider.token, provider); - }); - this._resolvedProviders.values().forEach(function(resolvedProvider) { - var providerValueExpressions = resolvedProvider.providers.map(function(provider) { - if (lang_1.isPresent(provider.useExisting)) { - return _this._getDependency(resolvedProvider.providerType, new compile_metadata_1.CompileDiDependencyMetadata({token: provider.useExisting})); - } else if (lang_1.isPresent(provider.useFactory)) { - var deps = lang_1.isPresent(provider.deps) ? provider.deps : provider.useFactory.diDeps; - var depsExpr = deps.map(function(dep) { - return _this._getDependency(resolvedProvider.providerType, dep); - }); - return o.importExpr(provider.useFactory).callFn(depsExpr); - } else if (lang_1.isPresent(provider.useClass)) { - var deps = lang_1.isPresent(provider.deps) ? provider.deps : provider.useClass.diDeps; - var depsExpr = deps.map(function(dep) { - return _this._getDependency(resolvedProvider.providerType, dep); - }); - return o.importExpr(provider.useClass).instantiate(depsExpr, o.importType(provider.useClass)); - } else { - if (provider.useValue instanceof compile_metadata_1.CompileIdentifierMetadata) { - return o.importExpr(provider.useValue); - } else if (provider.useValue instanceof o.Expression) { - return provider.useValue; - } else { - return o.literal(provider.useValue); - } - } - }); - var propName = "_" + resolvedProvider.token.name + "_" + _this.nodeIndex + "_" + _this._instances.size; - var instance = createProviderProperty(propName, resolvedProvider, providerValueExpressions, resolvedProvider.multiProvider, resolvedProvider.eager, _this); - _this._instances.add(resolvedProvider.token, instance); - }); - this.directiveInstances = this._directives.map(function(directive) { - return _this._instances.get(identifiers_1.identifierToken(directive.type)); - }); - for (var i = 0; i < this.directiveInstances.length; i++) { - var directiveInstance = this.directiveInstances[i]; - var directive = this._directives[i]; - directive.queries.forEach(function(queryMeta) { - _this._addQuery(queryMeta, directiveInstance); - }); - } - var queriesWithReads = []; - this._resolvedProviders.values().forEach(function(resolvedProvider) { - var queriesForProvider = _this._getQueriesFor(resolvedProvider.token); - collection_1.ListWrapper.addAll(queriesWithReads, queriesForProvider.map(function(query) { - return new _QueryWithRead(query, resolvedProvider.token); - })); - }); - collection_1.StringMapWrapper.forEach(this.referenceTokens, function(_, varName) { - var token = _this.referenceTokens[varName]; - var varValue; - if (lang_1.isPresent(token)) { - varValue = _this._instances.get(token); - } else { - varValue = _this.renderNode; - } - _this.view.locals.set(varName, varValue); - var varToken = new compile_metadata_1.CompileTokenMetadata({value: varName}); - collection_1.ListWrapper.addAll(queriesWithReads, _this._getQueriesFor(varToken).map(function(query) { - return new _QueryWithRead(query, varToken); - })); - }); - queriesWithReads.forEach(function(queryWithRead) { - var value; - if (lang_1.isPresent(queryWithRead.read.identifier)) { - value = _this._instances.get(queryWithRead.read); - } else { - var token = _this.referenceTokens[queryWithRead.read.value]; - if (lang_1.isPresent(token)) { - value = _this._instances.get(token); - } else { - value = _this.elementRef; - } - } - if (lang_1.isPresent(value)) { - queryWithRead.query.addValue(value, _this.view); - } - }); - if (lang_1.isPresent(this.component)) { - var componentConstructorViewQueryList = lang_1.isPresent(this.component) ? o.literalArr(this._componentConstructorViewQueryLists) : o.NULL_EXPR; - var compExpr = lang_1.isPresent(this.getComponent()) ? this.getComponent() : o.NULL_EXPR; - this.view.createMethod.addStmt(this.appElement.callMethod('initComponent', [compExpr, componentConstructorViewQueryList, this._compViewExpr]).toStmt()); - } - }; - CompileElement.prototype.afterChildren = function(childNodeCount) { - var _this = this; - this._resolvedProviders.values().forEach(function(resolvedProvider) { - var providerExpr = _this._instances.get(resolvedProvider.token); - var providerChildNodeCount = resolvedProvider.providerType === template_ast_1.ProviderAstType.PrivateService ? 0 : childNodeCount; - _this.view.injectorGetMethod.addStmt(createInjectInternalCondition(_this.nodeIndex, providerChildNodeCount, resolvedProvider, providerExpr)); - }); - this._queries.values().forEach(function(queries) { - return queries.forEach(function(query) { - return query.afterChildren(_this.view.updateContentQueriesMethod); - }); - }); - }; - CompileElement.prototype.addContentNode = function(ngContentIndex, nodeExpr) { - this.contentNodesByNgContentIndex[ngContentIndex].push(nodeExpr); - }; - CompileElement.prototype.getComponent = function() { - return lang_1.isPresent(this.component) ? this._instances.get(identifiers_1.identifierToken(this.component.type)) : null; - }; - CompileElement.prototype.getProviderTokens = function() { - return this._resolvedProviders.values().map(function(resolvedProvider) { - return util_1.createDiTokenExpression(resolvedProvider.token); - }); - }; - CompileElement.prototype._getQueriesFor = function(token) { - var result = []; - var currentEl = this; - var distance = 0; - var queries; - while (!currentEl.isNull()) { - queries = currentEl._queries.get(token); - if (lang_1.isPresent(queries)) { - collection_1.ListWrapper.addAll(result, queries.filter(function(query) { - return query.meta.descendants || distance <= 1; - })); - } - if (currentEl._directives.length > 0) { - distance++; - } - currentEl = currentEl.parent; - } - queries = this.view.componentView.viewQueries.get(token); - if (lang_1.isPresent(queries)) { - collection_1.ListWrapper.addAll(result, queries); - } - return result; - }; - CompileElement.prototype._addQuery = function(queryMeta, directiveInstance) { - var propName = "_query_" + queryMeta.selectors[0].name + "_" + this.nodeIndex + "_" + this._queryCount++; - var queryList = compile_query_1.createQueryList(queryMeta, directiveInstance, propName, this.view); - var query = new compile_query_1.CompileQuery(queryMeta, queryList, directiveInstance, this.view); - compile_query_1.addQueryToTokenMap(this._queries, query); - return query; - }; - CompileElement.prototype._getLocalDependency = function(requestingProviderType, dep) { - var result = null; - if (lang_1.isBlank(result) && lang_1.isPresent(dep.query)) { - result = this._addQuery(dep.query, null).queryList; - } - if (lang_1.isBlank(result) && lang_1.isPresent(dep.viewQuery)) { - result = compile_query_1.createQueryList(dep.viewQuery, null, "_viewQuery_" + dep.viewQuery.selectors[0].name + "_" + this.nodeIndex + "_" + this._componentConstructorViewQueryLists.length, this.view); - this._componentConstructorViewQueryLists.push(result); - } - if (lang_1.isPresent(dep.token)) { - if (lang_1.isBlank(result)) { - if (dep.token.equalsTo(identifiers_1.identifierToken(identifiers_1.Identifiers.ChangeDetectorRef))) { - if (requestingProviderType === template_ast_1.ProviderAstType.Component) { - return this._compViewExpr.prop('ref'); - } else { - return o.THIS_EXPR.prop('ref'); - } - } - } - if (lang_1.isBlank(result)) { - result = this._instances.get(dep.token); - } - } - return result; - }; - CompileElement.prototype._getDependency = function(requestingProviderType, dep) { - var currElement = this; - var result = null; - if (dep.isValue) { - result = o.literal(dep.value); - } - if (lang_1.isBlank(result) && !dep.isSkipSelf) { - result = this._getLocalDependency(requestingProviderType, dep); - } - while (lang_1.isBlank(result) && !currElement.parent.isNull()) { - currElement = currElement.parent; - result = currElement._getLocalDependency(template_ast_1.ProviderAstType.PublicService, new compile_metadata_1.CompileDiDependencyMetadata({token: dep.token})); - } - if (lang_1.isBlank(result)) { - result = util_1.injectFromViewParentInjector(dep.token, dep.isOptional); - } - if (lang_1.isBlank(result)) { - result = o.NULL_EXPR; - } - return util_1.getPropertyInView(result, this.view, currElement.view); - }; - return CompileElement; - }(CompileNode)); - exports.CompileElement = CompileElement; - function createInjectInternalCondition(nodeIndex, childNodeCount, provider, providerExpr) { - var indexCondition; - if (childNodeCount > 0) { - indexCondition = o.literal(nodeIndex).lowerEquals(constants_1.InjectMethodVars.requestNodeIndex).and(constants_1.InjectMethodVars.requestNodeIndex.lowerEquals(o.literal(nodeIndex + childNodeCount))); - } else { - indexCondition = o.literal(nodeIndex).identical(constants_1.InjectMethodVars.requestNodeIndex); - } - return new o.IfStmt(constants_1.InjectMethodVars.token.identical(util_1.createDiTokenExpression(provider.token)).and(indexCondition), [new o.ReturnStatement(providerExpr)]); - } - function createProviderProperty(propName, provider, providerValueExpressions, isMulti, isEager, compileElement) { - var view = compileElement.view; - var resolvedProviderValueExpr; - var type; - if (isMulti) { - resolvedProviderValueExpr = o.literalArr(providerValueExpressions); - type = new o.ArrayType(o.DYNAMIC_TYPE); - } else { - resolvedProviderValueExpr = providerValueExpressions[0]; - type = providerValueExpressions[0].type; - } - if (lang_1.isBlank(type)) { - type = o.DYNAMIC_TYPE; - } - if (isEager) { - view.fields.push(new o.ClassField(propName, type, [o.StmtModifier.Private])); - view.createMethod.addStmt(o.THIS_EXPR.prop(propName).set(resolvedProviderValueExpr).toStmt()); - } else { - var internalField = "_" + propName; - view.fields.push(new o.ClassField(internalField, type, [o.StmtModifier.Private])); - var getter = new compile_method_1.CompileMethod(view); - getter.resetDebugInfo(compileElement.nodeIndex, compileElement.sourceAst); - getter.addStmt(new o.IfStmt(o.THIS_EXPR.prop(internalField).isBlank(), [o.THIS_EXPR.prop(internalField).set(resolvedProviderValueExpr).toStmt()])); - getter.addStmt(new o.ReturnStatement(o.THIS_EXPR.prop(internalField))); - view.getters.push(new o.ClassGetter(propName, getter.finish(), type)); - } - return o.THIS_EXPR.prop(propName); - } - var _QueryWithRead = (function() { - function _QueryWithRead(query, match) { - this.query = query; - this.read = lang_1.isPresent(query.meta.read) ? query.meta.read : match; - } - return _QueryWithRead; - }()); - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("6b", ["2b", "41", "61", "6a"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var exceptions_1 = $__require('41'); - var o = $__require('61'); - var identifiers_1 = $__require('6a'); - function getPropertyInView(property, callingView, definedView) { - if (callingView === definedView) { - return property; - } else { - var viewProp = o.THIS_EXPR; - var currView = callingView; - while (currView !== definedView && lang_1.isPresent(currView.declarationElement.view)) { - currView = currView.declarationElement.view; - viewProp = viewProp.prop('parent'); - } - if (currView !== definedView) { - throw new exceptions_1.BaseException("Internal error: Could not calculate a property in a parent view: " + property); - } - if (property instanceof o.ReadPropExpr) { - var readPropExpr_1 = property; - if (definedView.fields.some(function(field) { - return field.name == readPropExpr_1.name; - }) || definedView.getters.some(function(field) { - return field.name == readPropExpr_1.name; - })) { - viewProp = viewProp.cast(definedView.classType); - } - } - return o.replaceVarInExpression(o.THIS_EXPR.name, viewProp, property); - } - } - exports.getPropertyInView = getPropertyInView; - function injectFromViewParentInjector(token, optional) { - var args = [createDiTokenExpression(token)]; - if (optional) { - args.push(o.NULL_EXPR); - } - return o.THIS_EXPR.prop('parentInjector').callMethod('get', args); - } - exports.injectFromViewParentInjector = injectFromViewParentInjector; - function getViewFactoryName(component, embeddedTemplateIndex) { - return "viewFactory_" + component.type.name + embeddedTemplateIndex; - } - exports.getViewFactoryName = getViewFactoryName; - function createDiTokenExpression(token) { - if (lang_1.isPresent(token.value)) { - return o.literal(token.value); - } else if (token.identifierIsInstance) { - return o.importExpr(token.identifier).instantiate([], o.importType(token.identifier, [], [o.TypeModifier.Const])); - } else { - return o.importExpr(token.identifier); - } - } - exports.createDiTokenExpression = createDiTokenExpression; - function createFlatArray(expressions) { - var lastNonArrayExpressions = []; - var result = o.literalArr([]); - for (var i = 0; i < expressions.length; i++) { - var expr = expressions[i]; - if (expr.type instanceof o.ArrayType) { - if (lastNonArrayExpressions.length > 0) { - result = result.callMethod(o.BuiltinMethod.ConcatArray, [o.literalArr(lastNonArrayExpressions)]); - lastNonArrayExpressions = []; - } - result = result.callMethod(o.BuiltinMethod.ConcatArray, [expr]); - } else { - lastNonArrayExpressions.push(expr); - } - } - if (lastNonArrayExpressions.length > 0) { - result = result.callMethod(o.BuiltinMethod.ConcatArray, [o.literalArr(lastNonArrayExpressions)]); - } - return result; - } - exports.createFlatArray = createFlatArray; - function createPureProxy(fn, argCount, pureProxyProp, view) { - view.fields.push(new o.ClassField(pureProxyProp.name, null, [o.StmtModifier.Private])); - var pureProxyId = argCount < identifiers_1.Identifiers.pureProxies.length ? identifiers_1.Identifiers.pureProxies[argCount] : null; - if (lang_1.isBlank(pureProxyId)) { - throw new exceptions_1.BaseException("Unsupported number of argument for pure functions: " + argCount); - } - view.createMethod.addStmt(o.THIS_EXPR.prop(pureProxyProp.name).set(o.importExpr(pureProxyId).callFn([fn])).toStmt()); - } - exports.createPureProxy = createPureProxy; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("73", ["2b", "38", "61", "6a", "6d", "74", "6c", "71", "72", "6b", "70", "66", "60"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var collection_1 = $__require('38'); - var o = $__require('61'); - var identifiers_1 = $__require('6a'); - var constants_1 = $__require('6d'); - var change_detection_1 = $__require('74'); - var compile_view_1 = $__require('6c'); - var compile_element_1 = $__require('71'); - var template_ast_1 = $__require('72'); - var util_1 = $__require('6b'); - var view_type_1 = $__require('70'); - var view_1 = $__require('66'); - var compile_metadata_1 = $__require('60'); - var IMPLICIT_TEMPLATE_VAR = '\$implicit'; - var CLASS_ATTR = 'class'; - var STYLE_ATTR = 'style'; - var parentRenderNodeVar = o.variable('parentRenderNode'); - var rootSelectorVar = o.variable('rootSelector'); - var ViewCompileDependency = (function() { - function ViewCompileDependency(comp, factoryPlaceholder) { - this.comp = comp; - this.factoryPlaceholder = factoryPlaceholder; - } - return ViewCompileDependency; - }()); - exports.ViewCompileDependency = ViewCompileDependency; - function buildView(view, template, targetDependencies) { - var builderVisitor = new ViewBuilderVisitor(view, targetDependencies); - template_ast_1.templateVisitAll(builderVisitor, template, view.declarationElement.isNull() ? view.declarationElement : view.declarationElement.parent); - return builderVisitor.nestedViewCount; - } - exports.buildView = buildView; - function finishView(view, targetStatements) { - view.afterNodes(); - createViewTopLevelStmts(view, targetStatements); - view.nodes.forEach(function(node) { - if (node instanceof compile_element_1.CompileElement && node.hasEmbeddedView) { - finishView(node.embeddedView, targetStatements); - } - }); - } - exports.finishView = finishView; - var ViewBuilderVisitor = (function() { - function ViewBuilderVisitor(view, targetDependencies) { - this.view = view; - this.targetDependencies = targetDependencies; - this.nestedViewCount = 0; - } - ViewBuilderVisitor.prototype._isRootNode = function(parent) { - return parent.view !== this.view; - }; - ViewBuilderVisitor.prototype._addRootNodeAndProject = function(node, ngContentIndex, parent) { - var vcAppEl = (node instanceof compile_element_1.CompileElement && node.hasViewContainer) ? node.appElement : null; - if (this._isRootNode(parent)) { - if (this.view.viewType !== view_type_1.ViewType.COMPONENT) { - this.view.rootNodesOrAppElements.push(lang_1.isPresent(vcAppEl) ? vcAppEl : node.renderNode); - } - } else if (lang_1.isPresent(parent.component) && lang_1.isPresent(ngContentIndex)) { - parent.addContentNode(ngContentIndex, lang_1.isPresent(vcAppEl) ? vcAppEl : node.renderNode); - } - }; - ViewBuilderVisitor.prototype._getParentRenderNode = function(parent) { - if (this._isRootNode(parent)) { - if (this.view.viewType === view_type_1.ViewType.COMPONENT) { - return parentRenderNodeVar; - } else { - return o.NULL_EXPR; - } - } else { - return lang_1.isPresent(parent.component) && parent.component.template.encapsulation !== view_1.ViewEncapsulation.Native ? o.NULL_EXPR : parent.renderNode; - } - }; - ViewBuilderVisitor.prototype.visitBoundText = function(ast, parent) { - return this._visitText(ast, '', ast.ngContentIndex, parent); - }; - ViewBuilderVisitor.prototype.visitText = function(ast, parent) { - return this._visitText(ast, ast.value, ast.ngContentIndex, parent); - }; - ViewBuilderVisitor.prototype._visitText = function(ast, value, ngContentIndex, parent) { - var fieldName = "_text_" + this.view.nodes.length; - this.view.fields.push(new o.ClassField(fieldName, o.importType(this.view.genConfig.renderTypes.renderText), [o.StmtModifier.Private])); - var renderNode = o.THIS_EXPR.prop(fieldName); - var compileNode = new compile_element_1.CompileNode(parent, this.view, this.view.nodes.length, renderNode, ast); - var createRenderNode = o.THIS_EXPR.prop(fieldName).set(constants_1.ViewProperties.renderer.callMethod('createText', [this._getParentRenderNode(parent), o.literal(value), this.view.createMethod.resetDebugInfoExpr(this.view.nodes.length, ast)])).toStmt(); - this.view.nodes.push(compileNode); - this.view.createMethod.addStmt(createRenderNode); - this._addRootNodeAndProject(compileNode, ngContentIndex, parent); - return renderNode; - }; - ViewBuilderVisitor.prototype.visitNgContent = function(ast, parent) { - this.view.createMethod.resetDebugInfo(null, ast); - var parentRenderNode = this._getParentRenderNode(parent); - var nodesExpression = constants_1.ViewProperties.projectableNodes.key(o.literal(ast.index), new o.ArrayType(o.importType(this.view.genConfig.renderTypes.renderNode))); - if (parentRenderNode !== o.NULL_EXPR) { - this.view.createMethod.addStmt(constants_1.ViewProperties.renderer.callMethod('projectNodes', [parentRenderNode, o.importExpr(identifiers_1.Identifiers.flattenNestedViewRenderNodes).callFn([nodesExpression])]).toStmt()); - } else if (this._isRootNode(parent)) { - if (this.view.viewType !== view_type_1.ViewType.COMPONENT) { - this.view.rootNodesOrAppElements.push(nodesExpression); - } - } else { - if (lang_1.isPresent(parent.component) && lang_1.isPresent(ast.ngContentIndex)) { - parent.addContentNode(ast.ngContentIndex, nodesExpression); - } - } - return null; - }; - ViewBuilderVisitor.prototype.visitElement = function(ast, parent) { - var nodeIndex = this.view.nodes.length; - var createRenderNodeExpr; - var debugContextExpr = this.view.createMethod.resetDebugInfoExpr(nodeIndex, ast); - if (nodeIndex === 0 && this.view.viewType === view_type_1.ViewType.HOST) { - createRenderNodeExpr = o.THIS_EXPR.callMethod('selectOrCreateHostElement', [o.literal(ast.name), rootSelectorVar, debugContextExpr]); - } else { - createRenderNodeExpr = constants_1.ViewProperties.renderer.callMethod('createElement', [this._getParentRenderNode(parent), o.literal(ast.name), debugContextExpr]); - } - var fieldName = "_el_" + nodeIndex; - this.view.fields.push(new o.ClassField(fieldName, o.importType(this.view.genConfig.renderTypes.renderElement), [o.StmtModifier.Private])); - this.view.createMethod.addStmt(o.THIS_EXPR.prop(fieldName).set(createRenderNodeExpr).toStmt()); - var renderNode = o.THIS_EXPR.prop(fieldName); - var component = ast.getComponent(); - var directives = ast.directives.map(function(directiveAst) { - return directiveAst.directive; - }); - var htmlAttrs = _readHtmlAttrs(ast.attrs); - var attrNameAndValues = _mergeHtmlAndDirectiveAttrs(htmlAttrs, directives); - for (var i = 0; i < attrNameAndValues.length; i++) { - var attrName = attrNameAndValues[i][0]; - var attrValue = attrNameAndValues[i][1]; - this.view.createMethod.addStmt(constants_1.ViewProperties.renderer.callMethod('setElementAttribute', [renderNode, o.literal(attrName), o.literal(attrValue)]).toStmt()); - } - var compileElement = new compile_element_1.CompileElement(parent, this.view, nodeIndex, renderNode, ast, component, directives, ast.providers, ast.hasViewContainer, false, ast.references); - this.view.nodes.push(compileElement); - var compViewExpr = null; - if (lang_1.isPresent(component)) { - var nestedComponentIdentifier = new compile_metadata_1.CompileIdentifierMetadata({name: util_1.getViewFactoryName(component, 0)}); - this.targetDependencies.push(new ViewCompileDependency(component, nestedComponentIdentifier)); - compViewExpr = o.variable("compView_" + nodeIndex); - compileElement.setComponentView(compViewExpr); - this.view.createMethod.addStmt(compViewExpr.set(o.importExpr(nestedComponentIdentifier).callFn([constants_1.ViewProperties.viewUtils, compileElement.injector, compileElement.appElement])).toDeclStmt()); - } - compileElement.beforeChildren(); - this._addRootNodeAndProject(compileElement, ast.ngContentIndex, parent); - template_ast_1.templateVisitAll(this, ast.children, compileElement); - compileElement.afterChildren(this.view.nodes.length - nodeIndex - 1); - if (lang_1.isPresent(compViewExpr)) { - var codeGenContentNodes; - if (this.view.component.type.isHost) { - codeGenContentNodes = constants_1.ViewProperties.projectableNodes; - } else { - codeGenContentNodes = o.literalArr(compileElement.contentNodesByNgContentIndex.map(function(nodes) { - return util_1.createFlatArray(nodes); - })); - } - this.view.createMethod.addStmt(compViewExpr.callMethod('create', [codeGenContentNodes, o.NULL_EXPR]).toStmt()); - } - return null; - }; - ViewBuilderVisitor.prototype.visitEmbeddedTemplate = function(ast, parent) { - var nodeIndex = this.view.nodes.length; - var fieldName = "_anchor_" + nodeIndex; - this.view.fields.push(new o.ClassField(fieldName, o.importType(this.view.genConfig.renderTypes.renderComment), [o.StmtModifier.Private])); - this.view.createMethod.addStmt(o.THIS_EXPR.prop(fieldName).set(constants_1.ViewProperties.renderer.callMethod('createTemplateAnchor', [this._getParentRenderNode(parent), this.view.createMethod.resetDebugInfoExpr(nodeIndex, ast)])).toStmt()); - var renderNode = o.THIS_EXPR.prop(fieldName); - var templateVariableBindings = ast.variables.map(function(varAst) { - return [varAst.value.length > 0 ? varAst.value : IMPLICIT_TEMPLATE_VAR, varAst.name]; - }); - var directives = ast.directives.map(function(directiveAst) { - return directiveAst.directive; - }); - var compileElement = new compile_element_1.CompileElement(parent, this.view, nodeIndex, renderNode, ast, null, directives, ast.providers, ast.hasViewContainer, true, ast.references); - this.view.nodes.push(compileElement); - this.nestedViewCount++; - var embeddedView = new compile_view_1.CompileView(this.view.component, this.view.genConfig, this.view.pipeMetas, o.NULL_EXPR, this.view.viewIndex + this.nestedViewCount, compileElement, templateVariableBindings); - this.nestedViewCount += buildView(embeddedView, ast.children, this.targetDependencies); - compileElement.beforeChildren(); - this._addRootNodeAndProject(compileElement, ast.ngContentIndex, parent); - compileElement.afterChildren(0); - return null; - }; - ViewBuilderVisitor.prototype.visitAttr = function(ast, ctx) { - return null; - }; - ViewBuilderVisitor.prototype.visitDirective = function(ast, ctx) { - return null; - }; - ViewBuilderVisitor.prototype.visitEvent = function(ast, eventTargetAndNames) { - return null; - }; - ViewBuilderVisitor.prototype.visitReference = function(ast, ctx) { - return null; - }; - ViewBuilderVisitor.prototype.visitVariable = function(ast, ctx) { - return null; - }; - ViewBuilderVisitor.prototype.visitDirectiveProperty = function(ast, context) { - return null; - }; - ViewBuilderVisitor.prototype.visitElementProperty = function(ast, context) { - return null; - }; - return ViewBuilderVisitor; - }()); - function _mergeHtmlAndDirectiveAttrs(declaredHtmlAttrs, directives) { - var result = {}; - collection_1.StringMapWrapper.forEach(declaredHtmlAttrs, function(value, key) { - result[key] = value; - }); - directives.forEach(function(directiveMeta) { - collection_1.StringMapWrapper.forEach(directiveMeta.hostAttributes, function(value, name) { - var prevValue = result[name]; - result[name] = lang_1.isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value; - }); - }); - return mapToKeyValueArray(result); - } - function _readHtmlAttrs(attrs) { - var htmlAttrs = {}; - attrs.forEach(function(ast) { - htmlAttrs[ast.name] = ast.value; - }); - return htmlAttrs; - } - function mergeAttributeValue(attrName, attrValue1, attrValue2) { - if (attrName == CLASS_ATTR || attrName == STYLE_ATTR) { - return attrValue1 + " " + attrValue2; - } else { - return attrValue2; - } - } - function mapToKeyValueArray(data) { - var entryArray = []; - collection_1.StringMapWrapper.forEach(data, function(value, name) { - entryArray.push([name, value]); - }); - collection_1.ListWrapper.sort(entryArray, function(entry1, entry2) { - return lang_1.StringWrapper.compare(entry1[0], entry2[0]); - }); - var keyValueArray = []; - entryArray.forEach(function(entry) { - keyValueArray.push([entry[0], entry[1]]); - }); - return keyValueArray; - } - function createViewTopLevelStmts(view, targetStatements) { - var nodeDebugInfosVar = o.NULL_EXPR; - if (view.genConfig.genDebugInfo) { - nodeDebugInfosVar = o.variable("nodeDebugInfos_" + view.component.type.name + view.viewIndex); - targetStatements.push(nodeDebugInfosVar.set(o.literalArr(view.nodes.map(createStaticNodeDebugInfo), new o.ArrayType(new o.ExternalType(identifiers_1.Identifiers.StaticNodeDebugInfo), [o.TypeModifier.Const]))).toDeclStmt(null, [o.StmtModifier.Final])); - } - var renderCompTypeVar = o.variable("renderType_" + view.component.type.name); - if (view.viewIndex === 0) { - targetStatements.push(renderCompTypeVar.set(o.NULL_EXPR).toDeclStmt(o.importType(identifiers_1.Identifiers.RenderComponentType))); - } - var viewClass = createViewClass(view, renderCompTypeVar, nodeDebugInfosVar); - targetStatements.push(viewClass); - targetStatements.push(createViewFactory(view, viewClass, renderCompTypeVar)); - } - function createStaticNodeDebugInfo(node) { - var compileElement = node instanceof compile_element_1.CompileElement ? node : null; - var providerTokens = []; - var componentToken = o.NULL_EXPR; - var varTokenEntries = []; - if (lang_1.isPresent(compileElement)) { - providerTokens = compileElement.getProviderTokens(); - if (lang_1.isPresent(compileElement.component)) { - componentToken = util_1.createDiTokenExpression(identifiers_1.identifierToken(compileElement.component.type)); - } - collection_1.StringMapWrapper.forEach(compileElement.referenceTokens, function(token, varName) { - varTokenEntries.push([varName, lang_1.isPresent(token) ? util_1.createDiTokenExpression(token) : o.NULL_EXPR]); - }); - } - return o.importExpr(identifiers_1.Identifiers.StaticNodeDebugInfo).instantiate([o.literalArr(providerTokens, new o.ArrayType(o.DYNAMIC_TYPE, [o.TypeModifier.Const])), componentToken, o.literalMap(varTokenEntries, new o.MapType(o.DYNAMIC_TYPE, [o.TypeModifier.Const]))], o.importType(identifiers_1.Identifiers.StaticNodeDebugInfo, null, [o.TypeModifier.Const])); - } - function createViewClass(view, renderCompTypeVar, nodeDebugInfosVar) { - var emptyTemplateVariableBindings = view.templateVariableBindings.map(function(entry) { - return [entry[0], o.NULL_EXPR]; - }); - var viewConstructorArgs = [new o.FnParam(constants_1.ViewConstructorVars.viewUtils.name, o.importType(identifiers_1.Identifiers.ViewUtils)), new o.FnParam(constants_1.ViewConstructorVars.parentInjector.name, o.importType(identifiers_1.Identifiers.Injector)), new o.FnParam(constants_1.ViewConstructorVars.declarationEl.name, o.importType(identifiers_1.Identifiers.AppElement))]; - var viewConstructor = new o.ClassMethod(null, viewConstructorArgs, [o.SUPER_EXPR.callFn([o.variable(view.className), renderCompTypeVar, constants_1.ViewTypeEnum.fromValue(view.viewType), o.literalMap(emptyTemplateVariableBindings), constants_1.ViewConstructorVars.viewUtils, constants_1.ViewConstructorVars.parentInjector, constants_1.ViewConstructorVars.declarationEl, constants_1.ChangeDetectionStrategyEnum.fromValue(getChangeDetectionMode(view)), nodeDebugInfosVar]).toStmt()]); - var viewMethods = [new o.ClassMethod('createInternal', [new o.FnParam(rootSelectorVar.name, o.STRING_TYPE)], generateCreateMethod(view), o.importType(identifiers_1.Identifiers.AppElement)), new o.ClassMethod('injectorGetInternal', [new o.FnParam(constants_1.InjectMethodVars.token.name, o.DYNAMIC_TYPE), new o.FnParam(constants_1.InjectMethodVars.requestNodeIndex.name, o.NUMBER_TYPE), new o.FnParam(constants_1.InjectMethodVars.notFoundResult.name, o.DYNAMIC_TYPE)], addReturnValuefNotEmpty(view.injectorGetMethod.finish(), constants_1.InjectMethodVars.notFoundResult), o.DYNAMIC_TYPE), new o.ClassMethod('detectChangesInternal', [new o.FnParam(constants_1.DetectChangesVars.throwOnChange.name, o.BOOL_TYPE)], generateDetectChangesMethod(view)), new o.ClassMethod('dirtyParentQueriesInternal', [], view.dirtyParentQueriesMethod.finish()), new o.ClassMethod('destroyInternal', [], view.destroyMethod.finish())].concat(view.eventHandlerMethods); - var viewClass = new o.ClassStmt(view.className, o.importExpr(identifiers_1.Identifiers.AppView, [getContextType(view)]), view.fields, view.getters, viewConstructor, viewMethods.filter(function(method) { - return method.body.length > 0; - })); - return viewClass; - } - function createViewFactory(view, viewClass, renderCompTypeVar) { - var viewFactoryArgs = [new o.FnParam(constants_1.ViewConstructorVars.viewUtils.name, o.importType(identifiers_1.Identifiers.ViewUtils)), new o.FnParam(constants_1.ViewConstructorVars.parentInjector.name, o.importType(identifiers_1.Identifiers.Injector)), new o.FnParam(constants_1.ViewConstructorVars.declarationEl.name, o.importType(identifiers_1.Identifiers.AppElement))]; - var initRenderCompTypeStmts = []; - var templateUrlInfo; - if (view.component.template.templateUrl == view.component.type.moduleUrl) { - templateUrlInfo = view.component.type.moduleUrl + " class " + view.component.type.name + " - inline template"; - } else { - templateUrlInfo = view.component.template.templateUrl; - } - if (view.viewIndex === 0) { - initRenderCompTypeStmts = [new o.IfStmt(renderCompTypeVar.identical(o.NULL_EXPR), [renderCompTypeVar.set(constants_1.ViewConstructorVars.viewUtils.callMethod('createRenderComponentType', [o.literal(templateUrlInfo), o.literal(view.component.template.ngContentSelectors.length), constants_1.ViewEncapsulationEnum.fromValue(view.component.template.encapsulation), view.styles])).toStmt()])]; - } - return o.fn(viewFactoryArgs, initRenderCompTypeStmts.concat([new o.ReturnStatement(o.variable(viewClass.name).instantiate(viewClass.constructorMethod.params.map(function(param) { - return o.variable(param.name); - })))]), o.importType(identifiers_1.Identifiers.AppView, [getContextType(view)])).toDeclStmt(view.viewFactory.name, [o.StmtModifier.Final]); - } - function generateCreateMethod(view) { - var parentRenderNodeExpr = o.NULL_EXPR; - var parentRenderNodeStmts = []; - if (view.viewType === view_type_1.ViewType.COMPONENT) { - parentRenderNodeExpr = constants_1.ViewProperties.renderer.callMethod('createViewRoot', [o.THIS_EXPR.prop('declarationAppElement').prop('nativeElement')]); - parentRenderNodeStmts = [parentRenderNodeVar.set(parentRenderNodeExpr).toDeclStmt(o.importType(view.genConfig.renderTypes.renderNode), [o.StmtModifier.Final])]; - } - var resultExpr; - if (view.viewType === view_type_1.ViewType.HOST) { - resultExpr = view.nodes[0].appElement; - } else { - resultExpr = o.NULL_EXPR; - } - return parentRenderNodeStmts.concat(view.createMethod.finish()).concat([o.THIS_EXPR.callMethod('init', [util_1.createFlatArray(view.rootNodesOrAppElements), o.literalArr(view.nodes.map(function(node) { - return node.renderNode; - })), o.literalArr(view.disposables), o.literalArr(view.subscriptions)]).toStmt(), new o.ReturnStatement(resultExpr)]); - } - function generateDetectChangesMethod(view) { - var stmts = []; - if (view.detectChangesInInputsMethod.isEmpty() && view.updateContentQueriesMethod.isEmpty() && view.afterContentLifecycleCallbacksMethod.isEmpty() && view.detectChangesRenderPropertiesMethod.isEmpty() && view.updateViewQueriesMethod.isEmpty() && view.afterViewLifecycleCallbacksMethod.isEmpty()) { - return stmts; - } - collection_1.ListWrapper.addAll(stmts, view.detectChangesInInputsMethod.finish()); - stmts.push(o.THIS_EXPR.callMethod('detectContentChildrenChanges', [constants_1.DetectChangesVars.throwOnChange]).toStmt()); - var afterContentStmts = view.updateContentQueriesMethod.finish().concat(view.afterContentLifecycleCallbacksMethod.finish()); - if (afterContentStmts.length > 0) { - stmts.push(new o.IfStmt(o.not(constants_1.DetectChangesVars.throwOnChange), afterContentStmts)); - } - collection_1.ListWrapper.addAll(stmts, view.detectChangesRenderPropertiesMethod.finish()); - stmts.push(o.THIS_EXPR.callMethod('detectViewChildrenChanges', [constants_1.DetectChangesVars.throwOnChange]).toStmt()); - var afterViewStmts = view.updateViewQueriesMethod.finish().concat(view.afterViewLifecycleCallbacksMethod.finish()); - if (afterViewStmts.length > 0) { - stmts.push(new o.IfStmt(o.not(constants_1.DetectChangesVars.throwOnChange), afterViewStmts)); - } - var varStmts = []; - var readVars = o.findReadVarNames(stmts); - if (collection_1.SetWrapper.has(readVars, constants_1.DetectChangesVars.changed.name)) { - varStmts.push(constants_1.DetectChangesVars.changed.set(o.literal(true)).toDeclStmt(o.BOOL_TYPE)); - } - if (collection_1.SetWrapper.has(readVars, constants_1.DetectChangesVars.changes.name)) { - varStmts.push(constants_1.DetectChangesVars.changes.set(o.NULL_EXPR).toDeclStmt(new o.MapType(o.importType(identifiers_1.Identifiers.SimpleChange)))); - } - if (collection_1.SetWrapper.has(readVars, constants_1.DetectChangesVars.valUnwrapper.name)) { - varStmts.push(constants_1.DetectChangesVars.valUnwrapper.set(o.importExpr(identifiers_1.Identifiers.ValueUnwrapper).instantiate([])).toDeclStmt(null, [o.StmtModifier.Final])); - } - return varStmts.concat(stmts); - } - function addReturnValuefNotEmpty(statements, value) { - if (statements.length > 0) { - return statements.concat([new o.ReturnStatement(value)]); - } else { - return statements; - } - } - function getContextType(view) { - var typeMeta = view.component.type; - return typeMeta.isHost ? o.DYNAMIC_TYPE : o.importType(typeMeta); - } - function getChangeDetectionMode(view) { - var mode; - if (view.viewType === view_type_1.ViewType.COMPONENT) { - mode = change_detection_1.isDefaultChangeDetectionStrategy(view.component.changeDetection) ? change_detection_1.ChangeDetectionStrategy.CheckAlways : change_detection_1.ChangeDetectionStrategy.CheckOnce; - } else { - mode = change_detection_1.ChangeDetectionStrategy.CheckAlways; - } - return mode; - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("75", ["61", "6a", "6d", "72", "2b", "76", "77", "63", "78", "79"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var o = $__require('61'); - var identifiers_1 = $__require('6a'); - var constants_1 = $__require('6d'); - var template_ast_1 = $__require('72'); - var lang_1 = $__require('2b'); - var lifecycle_hooks_1 = $__require('76'); - var constants_2 = $__require('77'); - var util_1 = $__require('63'); - var expression_converter_1 = $__require('78'); - var compile_binding_1 = $__require('79'); - function createBindFieldExpr(exprIndex) { - return o.THIS_EXPR.prop("_expr_" + exprIndex); - } - function createCurrValueExpr(exprIndex) { - return o.variable("currVal_" + exprIndex); - } - function bind(view, currValExpr, fieldExpr, parsedExpression, context, actions, method) { - var checkExpression = expression_converter_1.convertCdExpressionToIr(view, context, parsedExpression, constants_1.DetectChangesVars.valUnwrapper); - if (lang_1.isBlank(checkExpression.expression)) { - return; - } - view.fields.push(new o.ClassField(fieldExpr.name, null, [o.StmtModifier.Private])); - view.createMethod.addStmt(o.THIS_EXPR.prop(fieldExpr.name).set(o.importExpr(identifiers_1.Identifiers.uninitialized)).toStmt()); - if (checkExpression.needsValueUnwrapper) { - var initValueUnwrapperStmt = constants_1.DetectChangesVars.valUnwrapper.callMethod('reset', []).toStmt(); - method.addStmt(initValueUnwrapperStmt); - } - method.addStmt(currValExpr.set(checkExpression.expression).toDeclStmt(null, [o.StmtModifier.Final])); - var condition = o.importExpr(identifiers_1.Identifiers.checkBinding).callFn([constants_1.DetectChangesVars.throwOnChange, fieldExpr, currValExpr]); - if (checkExpression.needsValueUnwrapper) { - condition = constants_1.DetectChangesVars.valUnwrapper.prop('hasWrappedValue').or(condition); - } - method.addStmt(new o.IfStmt(condition, actions.concat([o.THIS_EXPR.prop(fieldExpr.name).set(currValExpr).toStmt()]))); - } - function bindRenderText(boundText, compileNode, view) { - var bindingIndex = view.bindings.length; - view.bindings.push(new compile_binding_1.CompileBinding(compileNode, boundText)); - var currValExpr = createCurrValueExpr(bindingIndex); - var valueField = createBindFieldExpr(bindingIndex); - view.detectChangesRenderPropertiesMethod.resetDebugInfo(compileNode.nodeIndex, boundText); - bind(view, currValExpr, valueField, boundText.value, o.THIS_EXPR.prop('context'), [o.THIS_EXPR.prop('renderer').callMethod('setText', [compileNode.renderNode, currValExpr]).toStmt()], view.detectChangesRenderPropertiesMethod); - } - exports.bindRenderText = bindRenderText; - function bindAndWriteToRenderer(boundProps, context, compileElement) { - var view = compileElement.view; - var renderNode = compileElement.renderNode; - boundProps.forEach(function(boundProp) { - var bindingIndex = view.bindings.length; - view.bindings.push(new compile_binding_1.CompileBinding(compileElement, boundProp)); - view.detectChangesRenderPropertiesMethod.resetDebugInfo(compileElement.nodeIndex, boundProp); - var fieldExpr = createBindFieldExpr(bindingIndex); - var currValExpr = createCurrValueExpr(bindingIndex); - var renderMethod; - var renderValue = currValExpr; - var updateStmts = []; - switch (boundProp.type) { - case template_ast_1.PropertyBindingType.Property: - renderMethod = 'setElementProperty'; - if (view.genConfig.logBindingUpdate) { - updateStmts.push(logBindingUpdateStmt(renderNode, boundProp.name, currValExpr)); - } - break; - case template_ast_1.PropertyBindingType.Attribute: - renderMethod = 'setElementAttribute'; - renderValue = renderValue.isBlank().conditional(o.NULL_EXPR, renderValue.callMethod('toString', [])); - break; - case template_ast_1.PropertyBindingType.Class: - renderMethod = 'setElementClass'; - break; - case template_ast_1.PropertyBindingType.Style: - renderMethod = 'setElementStyle'; - var strValue = renderValue.callMethod('toString', []); - if (lang_1.isPresent(boundProp.unit)) { - strValue = strValue.plus(o.literal(boundProp.unit)); - } - renderValue = renderValue.isBlank().conditional(o.NULL_EXPR, strValue); - break; - } - updateStmts.push(o.THIS_EXPR.prop('renderer').callMethod(renderMethod, [renderNode, o.literal(boundProp.name), renderValue]).toStmt()); - bind(view, currValExpr, fieldExpr, boundProp.value, context, updateStmts, view.detectChangesRenderPropertiesMethod); - }); - } - function bindRenderInputs(boundProps, compileElement) { - bindAndWriteToRenderer(boundProps, o.THIS_EXPR.prop('context'), compileElement); - } - exports.bindRenderInputs = bindRenderInputs; - function bindDirectiveHostProps(directiveAst, directiveInstance, compileElement) { - bindAndWriteToRenderer(directiveAst.hostProperties, directiveInstance, compileElement); - } - exports.bindDirectiveHostProps = bindDirectiveHostProps; - function bindDirectiveInputs(directiveAst, directiveInstance, compileElement) { - if (directiveAst.inputs.length === 0) { - return; - } - var view = compileElement.view; - var detectChangesInInputsMethod = view.detectChangesInInputsMethod; - detectChangesInInputsMethod.resetDebugInfo(compileElement.nodeIndex, compileElement.sourceAst); - var lifecycleHooks = directiveAst.directive.lifecycleHooks; - var calcChangesMap = lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.OnChanges) !== -1; - var isOnPushComp = directiveAst.directive.isComponent && !constants_2.isDefaultChangeDetectionStrategy(directiveAst.directive.changeDetection); - if (calcChangesMap) { - detectChangesInInputsMethod.addStmt(constants_1.DetectChangesVars.changes.set(o.NULL_EXPR).toStmt()); - } - if (isOnPushComp) { - detectChangesInInputsMethod.addStmt(constants_1.DetectChangesVars.changed.set(o.literal(false)).toStmt()); - } - directiveAst.inputs.forEach(function(input) { - var bindingIndex = view.bindings.length; - view.bindings.push(new compile_binding_1.CompileBinding(compileElement, input)); - detectChangesInInputsMethod.resetDebugInfo(compileElement.nodeIndex, input); - var fieldExpr = createBindFieldExpr(bindingIndex); - var currValExpr = createCurrValueExpr(bindingIndex); - var statements = [directiveInstance.prop(input.directiveName).set(currValExpr).toStmt()]; - if (calcChangesMap) { - statements.push(new o.IfStmt(constants_1.DetectChangesVars.changes.identical(o.NULL_EXPR), [constants_1.DetectChangesVars.changes.set(o.literalMap([], new o.MapType(o.importType(identifiers_1.Identifiers.SimpleChange)))).toStmt()])); - statements.push(constants_1.DetectChangesVars.changes.key(o.literal(input.directiveName)).set(o.importExpr(identifiers_1.Identifiers.SimpleChange).instantiate([fieldExpr, currValExpr])).toStmt()); - } - if (isOnPushComp) { - statements.push(constants_1.DetectChangesVars.changed.set(o.literal(true)).toStmt()); - } - if (view.genConfig.logBindingUpdate) { - statements.push(logBindingUpdateStmt(compileElement.renderNode, input.directiveName, currValExpr)); - } - bind(view, currValExpr, fieldExpr, input.value, o.THIS_EXPR.prop('context'), statements, detectChangesInInputsMethod); - }); - if (isOnPushComp) { - detectChangesInInputsMethod.addStmt(new o.IfStmt(constants_1.DetectChangesVars.changed, [compileElement.appElement.prop('componentView').callMethod('markAsCheckOnce', []).toStmt()])); - } - } - exports.bindDirectiveInputs = bindDirectiveInputs; - function logBindingUpdateStmt(renderNode, propName, value) { - return o.THIS_EXPR.prop('renderer').callMethod('setBindingDebugInfo', [renderNode, o.literal("ng-reflect-" + util_1.camelCaseToDashCase(propName)), value.isBlank().conditional(o.NULL_EXPR, value.callMethod('toString', []))]).toStmt(); - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("6f", ["2b", "38", "61"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var collection_1 = $__require('38'); - var o = $__require('61'); - var _DebugState = (function() { - function _DebugState(nodeIndex, sourceAst) { - this.nodeIndex = nodeIndex; - this.sourceAst = sourceAst; - } - return _DebugState; - }()); - var NULL_DEBUG_STATE = new _DebugState(null, null); - var CompileMethod = (function() { - function CompileMethod(_view) { - this._view = _view; - this._newState = NULL_DEBUG_STATE; - this._currState = NULL_DEBUG_STATE; - this._bodyStatements = []; - this._debugEnabled = this._view.genConfig.genDebugInfo; - } - CompileMethod.prototype._updateDebugContextIfNeeded = function() { - if (this._newState.nodeIndex !== this._currState.nodeIndex || this._newState.sourceAst !== this._currState.sourceAst) { - var expr = this._updateDebugContext(this._newState); - if (lang_1.isPresent(expr)) { - this._bodyStatements.push(expr.toStmt()); - } - } - }; - CompileMethod.prototype._updateDebugContext = function(newState) { - this._currState = this._newState = newState; - if (this._debugEnabled) { - var sourceLocation = lang_1.isPresent(newState.sourceAst) ? newState.sourceAst.sourceSpan.start : null; - return o.THIS_EXPR.callMethod('debug', [o.literal(newState.nodeIndex), lang_1.isPresent(sourceLocation) ? o.literal(sourceLocation.line) : o.NULL_EXPR, lang_1.isPresent(sourceLocation) ? o.literal(sourceLocation.col) : o.NULL_EXPR]); - } else { - return null; - } - }; - CompileMethod.prototype.resetDebugInfoExpr = function(nodeIndex, templateAst) { - var res = this._updateDebugContext(new _DebugState(nodeIndex, templateAst)); - return lang_1.isPresent(res) ? res : o.NULL_EXPR; - }; - CompileMethod.prototype.resetDebugInfo = function(nodeIndex, templateAst) { - this._newState = new _DebugState(nodeIndex, templateAst); - }; - CompileMethod.prototype.addStmt = function(stmt) { - this._updateDebugContextIfNeeded(); - this._bodyStatements.push(stmt); - }; - CompileMethod.prototype.addStmts = function(stmts) { - this._updateDebugContextIfNeeded(); - collection_1.ListWrapper.addAll(this._bodyStatements, stmts); - }; - CompileMethod.prototype.finish = function() { - return this._bodyStatements; - }; - CompileMethod.prototype.isEmpty = function() { - return this._bodyStatements.length === 0; - }; - return CompileMethod; - }()); - exports.CompileMethod = CompileMethod; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("78", ["61", "6a", "41", "2b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var o = $__require('61'); - var identifiers_1 = $__require('6a'); - var exceptions_1 = $__require('41'); - var lang_1 = $__require('2b'); - var IMPLICIT_RECEIVER = o.variable('#implicit'); - var ExpressionWithWrappedValueInfo = (function() { - function ExpressionWithWrappedValueInfo(expression, needsValueUnwrapper) { - this.expression = expression; - this.needsValueUnwrapper = needsValueUnwrapper; - } - return ExpressionWithWrappedValueInfo; - }()); - exports.ExpressionWithWrappedValueInfo = ExpressionWithWrappedValueInfo; - function convertCdExpressionToIr(nameResolver, implicitReceiver, expression, valueUnwrapper) { - var visitor = new _AstToIrVisitor(nameResolver, implicitReceiver, valueUnwrapper); - var irAst = expression.visit(visitor, _Mode.Expression); - return new ExpressionWithWrappedValueInfo(irAst, visitor.needsValueUnwrapper); - } - exports.convertCdExpressionToIr = convertCdExpressionToIr; - function convertCdStatementToIr(nameResolver, implicitReceiver, stmt) { - var visitor = new _AstToIrVisitor(nameResolver, implicitReceiver, null); - var statements = []; - flattenStatements(stmt.visit(visitor, _Mode.Statement), statements); - return statements; - } - exports.convertCdStatementToIr = convertCdStatementToIr; - var _Mode; - (function(_Mode) { - _Mode[_Mode["Statement"] = 0] = "Statement"; - _Mode[_Mode["Expression"] = 1] = "Expression"; - })(_Mode || (_Mode = {})); - function ensureStatementMode(mode, ast) { - if (mode !== _Mode.Statement) { - throw new exceptions_1.BaseException("Expected a statement, but saw " + ast); - } - } - function ensureExpressionMode(mode, ast) { - if (mode !== _Mode.Expression) { - throw new exceptions_1.BaseException("Expected an expression, but saw " + ast); - } - } - function convertToStatementIfNeeded(mode, expr) { - if (mode === _Mode.Statement) { - return expr.toStmt(); - } else { - return expr; - } - } - var _AstToIrVisitor = (function() { - function _AstToIrVisitor(_nameResolver, _implicitReceiver, _valueUnwrapper) { - this._nameResolver = _nameResolver; - this._implicitReceiver = _implicitReceiver; - this._valueUnwrapper = _valueUnwrapper; - this.needsValueUnwrapper = false; - } - _AstToIrVisitor.prototype.visitBinary = function(ast, mode) { - var op; - switch (ast.operation) { - case '+': - op = o.BinaryOperator.Plus; - break; - case '-': - op = o.BinaryOperator.Minus; - break; - case '*': - op = o.BinaryOperator.Multiply; - break; - case '/': - op = o.BinaryOperator.Divide; - break; - case '%': - op = o.BinaryOperator.Modulo; - break; - case '&&': - op = o.BinaryOperator.And; - break; - case '||': - op = o.BinaryOperator.Or; - break; - case '==': - op = o.BinaryOperator.Equals; - break; - case '!=': - op = o.BinaryOperator.NotEquals; - break; - case '===': - op = o.BinaryOperator.Identical; - break; - case '!==': - op = o.BinaryOperator.NotIdentical; - break; - case '<': - op = o.BinaryOperator.Lower; - break; - case '>': - op = o.BinaryOperator.Bigger; - break; - case '<=': - op = o.BinaryOperator.LowerEquals; - break; - case '>=': - op = o.BinaryOperator.BiggerEquals; - break; - default: - throw new exceptions_1.BaseException("Unsupported operation " + ast.operation); - } - return convertToStatementIfNeeded(mode, new o.BinaryOperatorExpr(op, ast.left.visit(this, _Mode.Expression), ast.right.visit(this, _Mode.Expression))); - }; - _AstToIrVisitor.prototype.visitChain = function(ast, mode) { - ensureStatementMode(mode, ast); - return this.visitAll(ast.expressions, mode); - }; - _AstToIrVisitor.prototype.visitConditional = function(ast, mode) { - var value = ast.condition.visit(this, _Mode.Expression); - return convertToStatementIfNeeded(mode, value.conditional(ast.trueExp.visit(this, _Mode.Expression), ast.falseExp.visit(this, _Mode.Expression))); - }; - _AstToIrVisitor.prototype.visitPipe = function(ast, mode) { - var input = ast.exp.visit(this, _Mode.Expression); - var args = this.visitAll(ast.args, _Mode.Expression); - var value = this._nameResolver.callPipe(ast.name, input, args); - this.needsValueUnwrapper = true; - return convertToStatementIfNeeded(mode, this._valueUnwrapper.callMethod('unwrap', [value])); - }; - _AstToIrVisitor.prototype.visitFunctionCall = function(ast, mode) { - return convertToStatementIfNeeded(mode, ast.target.visit(this, _Mode.Expression).callFn(this.visitAll(ast.args, _Mode.Expression))); - }; - _AstToIrVisitor.prototype.visitImplicitReceiver = function(ast, mode) { - ensureExpressionMode(mode, ast); - return IMPLICIT_RECEIVER; - }; - _AstToIrVisitor.prototype.visitInterpolation = function(ast, mode) { - ensureExpressionMode(mode, ast); - var args = [o.literal(ast.expressions.length)]; - for (var i = 0; i < ast.strings.length - 1; i++) { - args.push(o.literal(ast.strings[i])); - args.push(ast.expressions[i].visit(this, _Mode.Expression)); - } - args.push(o.literal(ast.strings[ast.strings.length - 1])); - return o.importExpr(identifiers_1.Identifiers.interpolate).callFn(args); - }; - _AstToIrVisitor.prototype.visitKeyedRead = function(ast, mode) { - return convertToStatementIfNeeded(mode, ast.obj.visit(this, _Mode.Expression).key(ast.key.visit(this, _Mode.Expression))); - }; - _AstToIrVisitor.prototype.visitKeyedWrite = function(ast, mode) { - var obj = ast.obj.visit(this, _Mode.Expression); - var key = ast.key.visit(this, _Mode.Expression); - var value = ast.value.visit(this, _Mode.Expression); - return convertToStatementIfNeeded(mode, obj.key(key).set(value)); - }; - _AstToIrVisitor.prototype.visitLiteralArray = function(ast, mode) { - return convertToStatementIfNeeded(mode, this._nameResolver.createLiteralArray(this.visitAll(ast.expressions, mode))); - }; - _AstToIrVisitor.prototype.visitLiteralMap = function(ast, mode) { - var parts = []; - for (var i = 0; i < ast.keys.length; i++) { - parts.push([ast.keys[i], ast.values[i].visit(this, _Mode.Expression)]); - } - return convertToStatementIfNeeded(mode, this._nameResolver.createLiteralMap(parts)); - }; - _AstToIrVisitor.prototype.visitLiteralPrimitive = function(ast, mode) { - return convertToStatementIfNeeded(mode, o.literal(ast.value)); - }; - _AstToIrVisitor.prototype.visitMethodCall = function(ast, mode) { - var args = this.visitAll(ast.args, _Mode.Expression); - var result = null; - var receiver = ast.receiver.visit(this, _Mode.Expression); - if (receiver === IMPLICIT_RECEIVER) { - var varExpr = this._nameResolver.getLocal(ast.name); - if (lang_1.isPresent(varExpr)) { - result = varExpr.callFn(args); - } else { - receiver = this._implicitReceiver; - } - } - if (lang_1.isBlank(result)) { - result = receiver.callMethod(ast.name, args); - } - return convertToStatementIfNeeded(mode, result); - }; - _AstToIrVisitor.prototype.visitPrefixNot = function(ast, mode) { - return convertToStatementIfNeeded(mode, o.not(ast.expression.visit(this, _Mode.Expression))); - }; - _AstToIrVisitor.prototype.visitPropertyRead = function(ast, mode) { - var result = null; - var receiver = ast.receiver.visit(this, _Mode.Expression); - if (receiver === IMPLICIT_RECEIVER) { - result = this._nameResolver.getLocal(ast.name); - if (lang_1.isBlank(result)) { - receiver = this._implicitReceiver; - } - } - if (lang_1.isBlank(result)) { - result = receiver.prop(ast.name); - } - return convertToStatementIfNeeded(mode, result); - }; - _AstToIrVisitor.prototype.visitPropertyWrite = function(ast, mode) { - var receiver = ast.receiver.visit(this, _Mode.Expression); - if (receiver === IMPLICIT_RECEIVER) { - var varExpr = this._nameResolver.getLocal(ast.name); - if (lang_1.isPresent(varExpr)) { - throw new exceptions_1.BaseException('Cannot assign to a reference or variable!'); - } - receiver = this._implicitReceiver; - } - return convertToStatementIfNeeded(mode, receiver.prop(ast.name).set(ast.value.visit(this, _Mode.Expression))); - }; - _AstToIrVisitor.prototype.visitSafePropertyRead = function(ast, mode) { - var receiver = ast.receiver.visit(this, _Mode.Expression); - return convertToStatementIfNeeded(mode, receiver.isBlank().conditional(o.NULL_EXPR, receiver.prop(ast.name))); - }; - _AstToIrVisitor.prototype.visitSafeMethodCall = function(ast, mode) { - var receiver = ast.receiver.visit(this, _Mode.Expression); - var args = this.visitAll(ast.args, _Mode.Expression); - return convertToStatementIfNeeded(mode, receiver.isBlank().conditional(o.NULL_EXPR, receiver.callMethod(ast.name, args))); - }; - _AstToIrVisitor.prototype.visitAll = function(asts, mode) { - var _this = this; - return asts.map(function(ast) { - return ast.visit(_this, mode); - }); - }; - _AstToIrVisitor.prototype.visitQuote = function(ast, mode) { - throw new exceptions_1.BaseException('Quotes are not supported for evaluation!'); - }; - return _AstToIrVisitor; - }()); - function flattenStatements(arg, output) { - if (lang_1.isArray(arg)) { - arg.forEach(function(entry) { - return flattenStatements(entry, output); - }); - } else { - output.push(arg); - } - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("79", [], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var CompileBinding = (function() { - function CompileBinding(node, sourceAst) { - this.node = node; - this.sourceAst = sourceAst; - } - return CompileBinding; - }()); - exports.CompileBinding = CompileBinding; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("7a", ["2b", "38", "6d", "61", "6f", "78", "79"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var collection_1 = $__require('38'); - var constants_1 = $__require('6d'); - var o = $__require('61'); - var compile_method_1 = $__require('6f'); - var expression_converter_1 = $__require('78'); - var compile_binding_1 = $__require('79'); - var CompileEventListener = (function() { - function CompileEventListener(compileElement, eventTarget, eventName, listenerIndex) { - this.compileElement = compileElement; - this.eventTarget = eventTarget; - this.eventName = eventName; - this._hasComponentHostListener = false; - this._actionResultExprs = []; - this._method = new compile_method_1.CompileMethod(compileElement.view); - this._methodName = "_handle_" + santitizeEventName(eventName) + "_" + compileElement.nodeIndex + "_" + listenerIndex; - this._eventParam = new o.FnParam(constants_1.EventHandlerVars.event.name, o.importType(this.compileElement.view.genConfig.renderTypes.renderEvent)); - } - CompileEventListener.getOrCreate = function(compileElement, eventTarget, eventName, targetEventListeners) { - var listener = targetEventListeners.find(function(listener) { - return listener.eventTarget == eventTarget && listener.eventName == eventName; - }); - if (lang_1.isBlank(listener)) { - listener = new CompileEventListener(compileElement, eventTarget, eventName, targetEventListeners.length); - targetEventListeners.push(listener); - } - return listener; - }; - CompileEventListener.prototype.addAction = function(hostEvent, directive, directiveInstance) { - if (lang_1.isPresent(directive) && directive.isComponent) { - this._hasComponentHostListener = true; - } - this._method.resetDebugInfo(this.compileElement.nodeIndex, hostEvent); - var context = lang_1.isPresent(directiveInstance) ? directiveInstance : o.THIS_EXPR.prop('context'); - var actionStmts = expression_converter_1.convertCdStatementToIr(this.compileElement.view, context, hostEvent.handler); - var lastIndex = actionStmts.length - 1; - if (lastIndex >= 0) { - var lastStatement = actionStmts[lastIndex]; - var returnExpr = convertStmtIntoExpression(lastStatement); - var preventDefaultVar = o.variable("pd_" + this._actionResultExprs.length); - this._actionResultExprs.push(preventDefaultVar); - if (lang_1.isPresent(returnExpr)) { - actionStmts[lastIndex] = preventDefaultVar.set(returnExpr.cast(o.DYNAMIC_TYPE).notIdentical(o.literal(false))).toDeclStmt(null, [o.StmtModifier.Final]); - } - } - this._method.addStmts(actionStmts); - }; - CompileEventListener.prototype.finishMethod = function() { - var markPathToRootStart = this._hasComponentHostListener ? this.compileElement.appElement.prop('componentView') : o.THIS_EXPR; - var resultExpr = o.literal(true); - this._actionResultExprs.forEach(function(expr) { - resultExpr = resultExpr.and(expr); - }); - var stmts = [markPathToRootStart.callMethod('markPathToRootAsCheckOnce', []).toStmt()].concat(this._method.finish()).concat([new o.ReturnStatement(resultExpr)]); - this.compileElement.view.eventHandlerMethods.push(new o.ClassMethod(this._methodName, [this._eventParam], stmts, o.BOOL_TYPE, [o.StmtModifier.Private])); - }; - CompileEventListener.prototype.listenToRenderer = function() { - var listenExpr; - var eventListener = o.THIS_EXPR.callMethod('eventHandler', [o.fn([this._eventParam], [new o.ReturnStatement(o.THIS_EXPR.callMethod(this._methodName, [constants_1.EventHandlerVars.event]))])]); - if (lang_1.isPresent(this.eventTarget)) { - listenExpr = constants_1.ViewProperties.renderer.callMethod('listenGlobal', [o.literal(this.eventTarget), o.literal(this.eventName), eventListener]); - } else { - listenExpr = constants_1.ViewProperties.renderer.callMethod('listen', [this.compileElement.renderNode, o.literal(this.eventName), eventListener]); - } - var disposable = o.variable("disposable_" + this.compileElement.view.disposables.length); - this.compileElement.view.disposables.push(disposable); - this.compileElement.view.createMethod.addStmt(disposable.set(listenExpr).toDeclStmt(o.FUNCTION_TYPE, [o.StmtModifier.Private])); - }; - CompileEventListener.prototype.listenToDirective = function(directiveInstance, observablePropName) { - var subscription = o.variable("subscription_" + this.compileElement.view.subscriptions.length); - this.compileElement.view.subscriptions.push(subscription); - var eventListener = o.THIS_EXPR.callMethod('eventHandler', [o.fn([this._eventParam], [o.THIS_EXPR.callMethod(this._methodName, [constants_1.EventHandlerVars.event]).toStmt()])]); - this.compileElement.view.createMethod.addStmt(subscription.set(directiveInstance.prop(observablePropName).callMethod(o.BuiltinMethod.SubscribeObservable, [eventListener])).toDeclStmt(null, [o.StmtModifier.Final])); - }; - return CompileEventListener; - }()); - exports.CompileEventListener = CompileEventListener; - function collectEventListeners(hostEvents, dirs, compileElement) { - var eventListeners = []; - hostEvents.forEach(function(hostEvent) { - compileElement.view.bindings.push(new compile_binding_1.CompileBinding(compileElement, hostEvent)); - var listener = CompileEventListener.getOrCreate(compileElement, hostEvent.target, hostEvent.name, eventListeners); - listener.addAction(hostEvent, null, null); - }); - collection_1.ListWrapper.forEachWithIndex(dirs, function(directiveAst, i) { - var directiveInstance = compileElement.directiveInstances[i]; - directiveAst.hostEvents.forEach(function(hostEvent) { - compileElement.view.bindings.push(new compile_binding_1.CompileBinding(compileElement, hostEvent)); - var listener = CompileEventListener.getOrCreate(compileElement, hostEvent.target, hostEvent.name, eventListeners); - listener.addAction(hostEvent, directiveAst.directive, directiveInstance); - }); - }); - eventListeners.forEach(function(listener) { - return listener.finishMethod(); - }); - return eventListeners; - } - exports.collectEventListeners = collectEventListeners; - function bindDirectiveOutputs(directiveAst, directiveInstance, eventListeners) { - collection_1.StringMapWrapper.forEach(directiveAst.directive.outputs, function(eventName, observablePropName) { - eventListeners.filter(function(listener) { - return listener.eventName == eventName; - }).forEach(function(listener) { - listener.listenToDirective(directiveInstance, observablePropName); - }); - }); - } - exports.bindDirectiveOutputs = bindDirectiveOutputs; - function bindRenderOutputs(eventListeners) { - eventListeners.forEach(function(listener) { - return listener.listenToRenderer(); - }); - } - exports.bindRenderOutputs = bindRenderOutputs; - function convertStmtIntoExpression(stmt) { - if (stmt instanceof o.ExpressionStatement) { - return stmt.expr; - } else if (stmt instanceof o.ReturnStatement) { - return stmt.value; - } - return null; - } - function santitizeEventName(name) { - return lang_1.StringWrapper.replaceAll(name, /[^a-zA-Z_]/g, '_'); - } - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("6d", ["2b", "60", "74", "66", "70", "61", "6a"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var lang_1 = $__require('2b'); - var compile_metadata_1 = $__require('60'); - var change_detection_1 = $__require('74'); - var view_1 = $__require('66'); - var view_type_1 = $__require('70'); - var o = $__require('61'); - var identifiers_1 = $__require('6a'); - function _enumExpression(classIdentifier, value) { - if (lang_1.isBlank(value)) - return o.NULL_EXPR; - var name = lang_1.resolveEnumToken(classIdentifier.runtime, value); - return o.importExpr(new compile_metadata_1.CompileIdentifierMetadata({ - name: classIdentifier.name + "." + name, - moduleUrl: classIdentifier.moduleUrl, - runtime: value - })); - } - var ViewTypeEnum = (function() { - function ViewTypeEnum() {} - ViewTypeEnum.fromValue = function(value) { - return _enumExpression(identifiers_1.Identifiers.ViewType, value); - }; - ViewTypeEnum.HOST = ViewTypeEnum.fromValue(view_type_1.ViewType.HOST); - ViewTypeEnum.COMPONENT = ViewTypeEnum.fromValue(view_type_1.ViewType.COMPONENT); - ViewTypeEnum.EMBEDDED = ViewTypeEnum.fromValue(view_type_1.ViewType.EMBEDDED); - return ViewTypeEnum; - }()); - exports.ViewTypeEnum = ViewTypeEnum; - var ViewEncapsulationEnum = (function() { - function ViewEncapsulationEnum() {} - ViewEncapsulationEnum.fromValue = function(value) { - return _enumExpression(identifiers_1.Identifiers.ViewEncapsulation, value); - }; - ViewEncapsulationEnum.Emulated = ViewEncapsulationEnum.fromValue(view_1.ViewEncapsulation.Emulated); - ViewEncapsulationEnum.Native = ViewEncapsulationEnum.fromValue(view_1.ViewEncapsulation.Native); - ViewEncapsulationEnum.None = ViewEncapsulationEnum.fromValue(view_1.ViewEncapsulation.None); - return ViewEncapsulationEnum; - }()); - exports.ViewEncapsulationEnum = ViewEncapsulationEnum; - var ChangeDetectorStateEnum = (function() { - function ChangeDetectorStateEnum() {} - ChangeDetectorStateEnum.fromValue = function(value) { - return _enumExpression(identifiers_1.Identifiers.ChangeDetectorState, value); - }; - ChangeDetectorStateEnum.NeverChecked = ChangeDetectorStateEnum.fromValue(change_detection_1.ChangeDetectorState.NeverChecked); - ChangeDetectorStateEnum.CheckedBefore = ChangeDetectorStateEnum.fromValue(change_detection_1.ChangeDetectorState.CheckedBefore); - ChangeDetectorStateEnum.Errored = ChangeDetectorStateEnum.fromValue(change_detection_1.ChangeDetectorState.Errored); - return ChangeDetectorStateEnum; - }()); - exports.ChangeDetectorStateEnum = ChangeDetectorStateEnum; - var ChangeDetectionStrategyEnum = (function() { - function ChangeDetectionStrategyEnum() {} - ChangeDetectionStrategyEnum.fromValue = function(value) { - return _enumExpression(identifiers_1.Identifiers.ChangeDetectionStrategy, value); - }; - ChangeDetectionStrategyEnum.CheckOnce = ChangeDetectionStrategyEnum.fromValue(change_detection_1.ChangeDetectionStrategy.CheckOnce); - ChangeDetectionStrategyEnum.Checked = ChangeDetectionStrategyEnum.fromValue(change_detection_1.ChangeDetectionStrategy.Checked); - ChangeDetectionStrategyEnum.CheckAlways = ChangeDetectionStrategyEnum.fromValue(change_detection_1.ChangeDetectionStrategy.CheckAlways); - ChangeDetectionStrategyEnum.Detached = ChangeDetectionStrategyEnum.fromValue(change_detection_1.ChangeDetectionStrategy.Detached); - ChangeDetectionStrategyEnum.OnPush = ChangeDetectionStrategyEnum.fromValue(change_detection_1.ChangeDetectionStrategy.OnPush); - ChangeDetectionStrategyEnum.Default = ChangeDetectionStrategyEnum.fromValue(change_detection_1.ChangeDetectionStrategy.Default); - return ChangeDetectionStrategyEnum; - }()); - exports.ChangeDetectionStrategyEnum = ChangeDetectionStrategyEnum; - var ViewConstructorVars = (function() { - function ViewConstructorVars() {} - ViewConstructorVars.viewUtils = o.variable('viewUtils'); - ViewConstructorVars.parentInjector = o.variable('parentInjector'); - ViewConstructorVars.declarationEl = o.variable('declarationEl'); - return ViewConstructorVars; - }()); - exports.ViewConstructorVars = ViewConstructorVars; - var ViewProperties = (function() { - function ViewProperties() {} - ViewProperties.renderer = o.THIS_EXPR.prop('renderer'); - ViewProperties.projectableNodes = o.THIS_EXPR.prop('projectableNodes'); - ViewProperties.viewUtils = o.THIS_EXPR.prop('viewUtils'); - return ViewProperties; - }()); - exports.ViewProperties = ViewProperties; - var EventHandlerVars = (function() { - function EventHandlerVars() {} - EventHandlerVars.event = o.variable('$event'); - return EventHandlerVars; - }()); - exports.EventHandlerVars = EventHandlerVars; - var InjectMethodVars = (function() { - function InjectMethodVars() {} - InjectMethodVars.token = o.variable('token'); - InjectMethodVars.requestNodeIndex = o.variable('requestNodeIndex'); - InjectMethodVars.notFoundResult = o.variable('notFoundResult'); - return InjectMethodVars; - }()); - exports.InjectMethodVars = InjectMethodVars; - var DetectChangesVars = (function() { - function DetectChangesVars() {} - DetectChangesVars.throwOnChange = o.variable("throwOnChange"); - DetectChangesVars.changes = o.variable("changes"); - DetectChangesVars.changed = o.variable("changed"); - DetectChangesVars.valUnwrapper = o.variable("valUnwrapper"); - return DetectChangesVars; - }()); - exports.DetectChangesVars = DetectChangesVars; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("7b", ["61", "6d", "76"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var o = $__require('61'); - var constants_1 = $__require('6d'); - var lifecycle_hooks_1 = $__require('76'); - var STATE_IS_NEVER_CHECKED = o.THIS_EXPR.prop('cdState').identical(constants_1.ChangeDetectorStateEnum.NeverChecked); - var NOT_THROW_ON_CHANGES = o.not(constants_1.DetectChangesVars.throwOnChange); - function bindDirectiveDetectChangesLifecycleCallbacks(directiveAst, directiveInstance, compileElement) { - var view = compileElement.view; - var detectChangesInInputsMethod = view.detectChangesInInputsMethod; - var lifecycleHooks = directiveAst.directive.lifecycleHooks; - if (lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.OnChanges) !== -1 && directiveAst.inputs.length > 0) { - detectChangesInInputsMethod.addStmt(new o.IfStmt(constants_1.DetectChangesVars.changes.notIdentical(o.NULL_EXPR), [directiveInstance.callMethod('ngOnChanges', [constants_1.DetectChangesVars.changes]).toStmt()])); - } - if (lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.OnInit) !== -1) { - detectChangesInInputsMethod.addStmt(new o.IfStmt(STATE_IS_NEVER_CHECKED.and(NOT_THROW_ON_CHANGES), [directiveInstance.callMethod('ngOnInit', []).toStmt()])); - } - if (lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.DoCheck) !== -1) { - detectChangesInInputsMethod.addStmt(new o.IfStmt(NOT_THROW_ON_CHANGES, [directiveInstance.callMethod('ngDoCheck', []).toStmt()])); - } - } - exports.bindDirectiveDetectChangesLifecycleCallbacks = bindDirectiveDetectChangesLifecycleCallbacks; - function bindDirectiveAfterContentLifecycleCallbacks(directiveMeta, directiveInstance, compileElement) { - var view = compileElement.view; - var lifecycleHooks = directiveMeta.lifecycleHooks; - var afterContentLifecycleCallbacksMethod = view.afterContentLifecycleCallbacksMethod; - afterContentLifecycleCallbacksMethod.resetDebugInfo(compileElement.nodeIndex, compileElement.sourceAst); - if (lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.AfterContentInit) !== -1) { - afterContentLifecycleCallbacksMethod.addStmt(new o.IfStmt(STATE_IS_NEVER_CHECKED, [directiveInstance.callMethod('ngAfterContentInit', []).toStmt()])); - } - if (lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.AfterContentChecked) !== -1) { - afterContentLifecycleCallbacksMethod.addStmt(directiveInstance.callMethod('ngAfterContentChecked', []).toStmt()); - } - } - exports.bindDirectiveAfterContentLifecycleCallbacks = bindDirectiveAfterContentLifecycleCallbacks; - function bindDirectiveAfterViewLifecycleCallbacks(directiveMeta, directiveInstance, compileElement) { - var view = compileElement.view; - var lifecycleHooks = directiveMeta.lifecycleHooks; - var afterViewLifecycleCallbacksMethod = view.afterViewLifecycleCallbacksMethod; - afterViewLifecycleCallbacksMethod.resetDebugInfo(compileElement.nodeIndex, compileElement.sourceAst); - if (lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.AfterViewInit) !== -1) { - afterViewLifecycleCallbacksMethod.addStmt(new o.IfStmt(STATE_IS_NEVER_CHECKED, [directiveInstance.callMethod('ngAfterViewInit', []).toStmt()])); - } - if (lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.AfterViewChecked) !== -1) { - afterViewLifecycleCallbacksMethod.addStmt(directiveInstance.callMethod('ngAfterViewChecked', []).toStmt()); - } - } - exports.bindDirectiveAfterViewLifecycleCallbacks = bindDirectiveAfterViewLifecycleCallbacks; - function bindDirectiveDestroyLifecycleCallbacks(directiveMeta, directiveInstance, compileElement) { - var onDestroyMethod = compileElement.view.destroyMethod; - onDestroyMethod.resetDebugInfo(compileElement.nodeIndex, compileElement.sourceAst); - if (directiveMeta.lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.OnDestroy) !== -1) { - onDestroyMethod.addStmt(directiveInstance.callMethod('ngOnDestroy', []).toStmt()); - } - } - exports.bindDirectiveDestroyLifecycleCallbacks = bindDirectiveDestroyLifecycleCallbacks; - function bindPipeDestroyLifecycleCallbacks(pipeMeta, pipeInstance, view) { - var onDestroyMethod = view.destroyMethod; - if (pipeMeta.lifecycleHooks.indexOf(lifecycle_hooks_1.LifecycleHooks.OnDestroy) !== -1) { - onDestroyMethod.addStmt(pipeInstance.callMethod('ngOnDestroy', []).toStmt()); - } - } - exports.bindPipeDestroyLifecycleCallbacks = bindPipeDestroyLifecycleCallbacks; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("7c", ["38", "72", "75", "7a", "7b"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var collection_1 = $__require('38'); - var template_ast_1 = $__require('72'); - var property_binder_1 = $__require('75'); - var event_binder_1 = $__require('7a'); - var lifecycle_binder_1 = $__require('7b'); - function bindView(view, parsedTemplate) { - var visitor = new ViewBinderVisitor(view); - template_ast_1.templateVisitAll(visitor, parsedTemplate); - view.pipes.forEach(function(pipe) { - lifecycle_binder_1.bindPipeDestroyLifecycleCallbacks(pipe.meta, pipe.instance, pipe.view); - }); - } - exports.bindView = bindView; - var ViewBinderVisitor = (function() { - function ViewBinderVisitor(view) { - this.view = view; - this._nodeIndex = 0; - } - ViewBinderVisitor.prototype.visitBoundText = function(ast, parent) { - var node = this.view.nodes[this._nodeIndex++]; - property_binder_1.bindRenderText(ast, node, this.view); - return null; - }; - ViewBinderVisitor.prototype.visitText = function(ast, parent) { - this._nodeIndex++; - return null; - }; - ViewBinderVisitor.prototype.visitNgContent = function(ast, parent) { - return null; - }; - ViewBinderVisitor.prototype.visitElement = function(ast, parent) { - var compileElement = this.view.nodes[this._nodeIndex++]; - var eventListeners = event_binder_1.collectEventListeners(ast.outputs, ast.directives, compileElement); - property_binder_1.bindRenderInputs(ast.inputs, compileElement); - event_binder_1.bindRenderOutputs(eventListeners); - collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { - var directiveInstance = compileElement.directiveInstances[index]; - property_binder_1.bindDirectiveInputs(directiveAst, directiveInstance, compileElement); - lifecycle_binder_1.bindDirectiveDetectChangesLifecycleCallbacks(directiveAst, directiveInstance, compileElement); - property_binder_1.bindDirectiveHostProps(directiveAst, directiveInstance, compileElement); - event_binder_1.bindDirectiveOutputs(directiveAst, directiveInstance, eventListeners); - }); - template_ast_1.templateVisitAll(this, ast.children, compileElement); - collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { - var directiveInstance = compileElement.directiveInstances[index]; - lifecycle_binder_1.bindDirectiveAfterContentLifecycleCallbacks(directiveAst.directive, directiveInstance, compileElement); - lifecycle_binder_1.bindDirectiveAfterViewLifecycleCallbacks(directiveAst.directive, directiveInstance, compileElement); - lifecycle_binder_1.bindDirectiveDestroyLifecycleCallbacks(directiveAst.directive, directiveInstance, compileElement); - }); - return null; - }; - ViewBinderVisitor.prototype.visitEmbeddedTemplate = function(ast, parent) { - var compileElement = this.view.nodes[this._nodeIndex++]; - var eventListeners = event_binder_1.collectEventListeners(ast.outputs, ast.directives, compileElement); - collection_1.ListWrapper.forEachWithIndex(ast.directives, function(directiveAst, index) { - var directiveInstance = compileElement.directiveInstances[index]; - property_binder_1.bindDirectiveInputs(directiveAst, directiveInstance, compileElement); - lifecycle_binder_1.bindDirectiveDetectChangesLifecycleCallbacks(directiveAst, directiveInstance, compileElement); - event_binder_1.bindDirectiveOutputs(directiveAst, directiveInstance, eventListeners); - lifecycle_binder_1.bindDirectiveAfterContentLifecycleCallbacks(directiveAst.directive, directiveInstance, compileElement); - lifecycle_binder_1.bindDirectiveAfterViewLifecycleCallbacks(directiveAst.directive, directiveInstance, compileElement); - lifecycle_binder_1.bindDirectiveDestroyLifecycleCallbacks(directiveAst.directive, directiveInstance, compileElement); - }); - bindView(compileElement.embeddedView, ast.children); - return null; - }; - ViewBinderVisitor.prototype.visitAttr = function(ast, ctx) { - return null; - }; - ViewBinderVisitor.prototype.visitDirective = function(ast, ctx) { - return null; - }; - ViewBinderVisitor.prototype.visitEvent = function(ast, eventTargetAndNames) { - return null; - }; - ViewBinderVisitor.prototype.visitReference = function(ast, ctx) { - return null; - }; - ViewBinderVisitor.prototype.visitVariable = function(ast, ctx) { - return null; - }; - ViewBinderVisitor.prototype.visitDirectiveProperty = function(ast, context) { - return null; - }; - ViewBinderVisitor.prototype.visitElementProperty = function(ast, context) { - return null; - }; - return ViewBinderVisitor; - }()); - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("7d", ["3a", "71", "6c", "73", "7c", "7e"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var di_1 = $__require('3a'); - var compile_element_1 = $__require('71'); - var compile_view_1 = $__require('6c'); - var view_builder_1 = $__require('73'); - var view_binder_1 = $__require('7c'); - var config_1 = $__require('7e'); - var ViewCompileResult = (function() { - function ViewCompileResult(statements, viewFactoryVar, dependencies) { - this.statements = statements; - this.viewFactoryVar = viewFactoryVar; - this.dependencies = dependencies; - } - return ViewCompileResult; - }()); - exports.ViewCompileResult = ViewCompileResult; - var ViewCompiler = (function() { - function ViewCompiler(_genConfig) { - this._genConfig = _genConfig; - } - ViewCompiler.prototype.compileComponent = function(component, template, styles, pipes) { - var statements = []; - var dependencies = []; - var view = new compile_view_1.CompileView(component, this._genConfig, pipes, styles, 0, compile_element_1.CompileElement.createNull(), []); - view_builder_1.buildView(view, template, dependencies); - view_binder_1.bindView(view, template); - view_builder_1.finishView(view, statements); - return new ViewCompileResult(statements, view.viewFactory.name, dependencies); - }; - ViewCompiler = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [config_1.CompilerConfig])], ViewCompiler); - return ViewCompiler; - }()); - exports.ViewCompiler = ViewCompiler; - global.define = __define; - return module.exports; -}); - -$__System.registerDynamic("7f", ["2b", "38", "72", "60", "6a", "80"], true, function($__require, exports, module) { - "use strict"; - ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var lang_1 = $__require('2b'); - var collection_1 = $__require('38'); - var template_ast_1 = $__require('72'); - var compile_metadata_1 = $__require('60'); - var identifiers_1 = $__require('6a'); - var parse_util_1 = $__require('80'); + var lang_1 = $__require('13'); + var collection_1 = $__require('e'); + var template_ast_1 = $__require('14'); + var compile_metadata_1 = $__require('c'); + var identifiers_1 = $__require('15'); + var parse_util_1 = $__require('16'); var ProviderError = (function(_super) { __extends(ProviderError, _super); function ProviderError(message, span) { @@ -14040,3559 +8166,768 @@ $__System.registerDynamic("7f", ["2b", "38", "72", "60", "6a", "80"], true, func entry.push(query); }); } - global.define = __define; return module.exports; }); -$__System.registerDynamic("81", ["38", "2b", "16", "82", "41", "83", "84", "85", "86", "80", "87", "72", "88", "89", "8a", "68", "8b", "63", "6a", "7f"], true, function($__require, exports, module) { - "use strict"; +$__System.registerDynamic("17", ["11", "18", "e", "13", "d", "19", "1a", "1b", "1c", "16", "14", "1d", "1e", "1f", "20", "21", "10", "15", "12", "22"], true, function($__require, exports, module) { ; - var global = this, - __define = global.define; - global.define = undefined; - "format cjs"; - "use strict"; - var __extends = (this && this.__extends) || function(d, b) { - for (var p in b) - if (b.hasOwnProperty(p)) - d[p] = b[p]; - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function(k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(k, v); - }; - var __param = (this && this.__param) || function(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); + var define, + global = this, + GLOBAL = this; + (function(process) { + "use strict"; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - }; - var collection_1 = $__require('38'); - var lang_1 = $__require('2b'); - var core_1 = $__require('16'); - var console_1 = $__require('82'); - var exceptions_1 = $__require('41'); - var ast_1 = $__require('83'); - var parser_1 = $__require('84'); - var html_parser_1 = $__require('85'); - var html_tags_1 = $__require('86'); - var parse_util_1 = $__require('80'); - var view_utils_1 = $__require('87'); - var template_ast_1 = $__require('72'); - var selector_1 = $__require('88'); - var element_schema_registry_1 = $__require('89'); - var template_preparser_1 = $__require('8a'); - var style_url_resolver_1 = $__require('68'); - var html_ast_1 = $__require('8b'); - var util_1 = $__require('63'); - var identifiers_1 = $__require('6a'); - var provider_parser_1 = $__require('7f'); - var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(var-)|(let-)|(ref-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g; - var TEMPLATE_ELEMENT = 'template'; - var TEMPLATE_ATTR = 'template'; - var TEMPLATE_ATTR_PREFIX = '*'; - var CLASS_ATTR = 'class'; - var PROPERTY_PARTS_SEPARATOR = '.'; - var ATTRIBUTE_PREFIX = 'attr'; - var CLASS_PREFIX = 'class'; - var STYLE_PREFIX = 'style'; - var TEXT_CSS_SELECTOR = selector_1.CssSelector.parse('*')[0]; - exports.TEMPLATE_TRANSFORMS = lang_1.CONST_EXPR(new core_1.OpaqueToken('TemplateTransforms')); - var TemplateParseError = (function(_super) { - __extends(TemplateParseError, _super); - function TemplateParseError(message, span, level) { - _super.call(this, span, message, level); - } - return TemplateParseError; - }(parse_util_1.ParseError)); - exports.TemplateParseError = TemplateParseError; - var TemplateParseResult = (function() { - function TemplateParseResult(templateAst, errors) { - this.templateAst = templateAst; - this.errors = errors; - } - return TemplateParseResult; - }()); - exports.TemplateParseResult = TemplateParseResult; - var TemplateParser = (function() { - function TemplateParser(_exprParser, _schemaRegistry, _htmlParser, _console, transforms) { - this._exprParser = _exprParser; - this._schemaRegistry = _schemaRegistry; - this._htmlParser = _htmlParser; - this._console = _console; - this.transforms = transforms; - } - TemplateParser.prototype.parse = function(component, template, directives, pipes, templateUrl) { - var result = this.tryParse(component, template, directives, pipes, templateUrl); - var warnings = result.errors.filter(function(error) { - return error.level === parse_util_1.ParseErrorLevel.WARNING; - }); - var errors = result.errors.filter(function(error) { - return error.level === parse_util_1.ParseErrorLevel.FATAL; - }); - if (warnings.length > 0) { - this._console.warn("Template parse warnings:\n" + warnings.join('\n')); + var core_1 = $__require('11'); + var core_private_1 = $__require('18'); + var collection_1 = $__require('e'); + var lang_1 = $__require('13'); + var exceptions_1 = $__require('d'); + var ast_1 = $__require('19'); + var parser_1 = $__require('1a'); + var html_parser_1 = $__require('1b'); + var html_tags_1 = $__require('1c'); + var parse_util_1 = $__require('16'); + var template_ast_1 = $__require('14'); + var selector_1 = $__require('1d'); + var element_schema_registry_1 = $__require('1e'); + var template_preparser_1 = $__require('1f'); + var style_url_resolver_1 = $__require('20'); + var html_ast_1 = $__require('21'); + var util_1 = $__require('10'); + var identifiers_1 = $__require('15'); + var provider_parser_1 = $__require('12'); + var BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(var-)|(let-)|(ref-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g; + var TEMPLATE_ELEMENT = 'template'; + var TEMPLATE_ATTR = 'template'; + var TEMPLATE_ATTR_PREFIX = '*'; + var CLASS_ATTR = 'class'; + var PROPERTY_PARTS_SEPARATOR = '.'; + var ATTRIBUTE_PREFIX = 'attr'; + var CLASS_PREFIX = 'class'; + var STYLE_PREFIX = 'style'; + var TEXT_CSS_SELECTOR = selector_1.CssSelector.parse('*')[0]; + exports.TEMPLATE_TRANSFORMS = new core_1.OpaqueToken('TemplateTransforms'); + var TemplateParseError = (function(_super) { + __extends(TemplateParseError, _super); + function TemplateParseError(message, span, level) { + _super.call(this, span, message, level); } - if (errors.length > 0) { - var errorString = errors.join('\n'); - throw new exceptions_1.BaseException("Template parse errors:\n" + errorString); + return TemplateParseError; + }(parse_util_1.ParseError)); + exports.TemplateParseError = TemplateParseError; + var TemplateParseResult = (function() { + function TemplateParseResult(templateAst, errors) { + this.templateAst = templateAst; + this.errors = errors; } - return result.templateAst; - }; - TemplateParser.prototype.tryParse = function(component, template, directives, pipes, templateUrl) { - var htmlAstWithErrors = this._htmlParser.parse(template, templateUrl); - var errors = htmlAstWithErrors.errors; - var result; - if (htmlAstWithErrors.rootNodes.length > 0) { - var uniqDirectives = removeDuplicates(directives); - var uniqPipes = removeDuplicates(pipes); - var providerViewContext = new provider_parser_1.ProviderViewContext(component, htmlAstWithErrors.rootNodes[0].sourceSpan); - var parseVisitor = new TemplateParseVisitor(providerViewContext, uniqDirectives, uniqPipes, this._exprParser, this._schemaRegistry); - result = html_ast_1.htmlVisitAll(parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_ELEMENT_CONTEXT); - errors = errors.concat(parseVisitor.errors).concat(providerViewContext.errors); - } else { - result = []; + return TemplateParseResult; + }()); + exports.TemplateParseResult = TemplateParseResult; + var TemplateParser = (function() { + function TemplateParser(_exprParser, _schemaRegistry, _htmlParser, _console, transforms) { + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this._htmlParser = _htmlParser; + this._console = _console; + this.transforms = transforms; } - if (errors.length > 0) { + TemplateParser.prototype.parse = function(component, template, directives, pipes, templateUrl) { + var result = this.tryParse(component, template, directives, pipes, templateUrl); + var warnings = result.errors.filter(function(error) { + return error.level === parse_util_1.ParseErrorLevel.WARNING; + }); + var errors = result.errors.filter(function(error) { + return error.level === parse_util_1.ParseErrorLevel.FATAL; + }); + if (warnings.length > 0) { + this._console.warn("Template parse warnings:\n" + warnings.join('\n')); + } + if (errors.length > 0) { + var errorString = errors.join('\n'); + throw new exceptions_1.BaseException("Template parse errors:\n" + errorString); + } + return result.templateAst; + }; + TemplateParser.prototype.tryParse = function(component, template, directives, pipes, templateUrl) { + var htmlAstWithErrors = this._htmlParser.parse(template, templateUrl); + var errors = htmlAstWithErrors.errors; + var result; + if (htmlAstWithErrors.rootNodes.length > 0) { + var uniqDirectives = removeDuplicates(directives); + var uniqPipes = removeDuplicates(pipes); + var providerViewContext = new provider_parser_1.ProviderViewContext(component, htmlAstWithErrors.rootNodes[0].sourceSpan); + var parseVisitor = new TemplateParseVisitor(providerViewContext, uniqDirectives, uniqPipes, this._exprParser, this._schemaRegistry); + result = html_ast_1.htmlVisitAll(parseVisitor, htmlAstWithErrors.rootNodes, EMPTY_ELEMENT_CONTEXT); + errors = errors.concat(parseVisitor.errors).concat(providerViewContext.errors); + } else { + result = []; + } + if (errors.length > 0) { + return new TemplateParseResult(result, errors); + } + if (lang_1.isPresent(this.transforms)) { + this.transforms.forEach(function(transform) { + result = template_ast_1.templateVisitAll(transform, result); + }); + } return new TemplateParseResult(result, errors); - } - if (lang_1.isPresent(this.transforms)) { - this.transforms.forEach(function(transform) { - result = template_ast_1.templateVisitAll(transform, result); + }; + TemplateParser.decorators = [{type: core_1.Injectable}]; + TemplateParser.ctorParameters = [{type: parser_1.Parser}, {type: element_schema_registry_1.ElementSchemaRegistry}, {type: html_parser_1.HtmlParser}, {type: core_private_1.Console}, { + type: undefined, + decorators: [{type: core_1.Optional}, { + type: core_1.Inject, + args: [exports.TEMPLATE_TRANSFORMS] + }] + }]; + return TemplateParser; + }()); + exports.TemplateParser = TemplateParser; + var TemplateParseVisitor = (function() { + function TemplateParseVisitor(providerViewContext, directives, pipes, _exprParser, _schemaRegistry) { + var _this = this; + this.providerViewContext = providerViewContext; + this._exprParser = _exprParser; + this._schemaRegistry = _schemaRegistry; + this.errors = []; + this.directivesIndex = new Map(); + this.ngContentCount = 0; + this.selectorMatcher = new selector_1.SelectorMatcher(); + collection_1.ListWrapper.forEachWithIndex(directives, function(directive, index) { + var selector = selector_1.CssSelector.parse(directive.selector); + _this.selectorMatcher.addSelectables(selector, directive); + _this.directivesIndex.set(directive, index); + }); + this.pipesByName = new Map(); + pipes.forEach(function(pipe) { + return _this.pipesByName.set(pipe.name, pipe); }); } - return new TemplateParseResult(result, errors); - }; - TemplateParser = __decorate([core_1.Injectable(), __param(4, core_1.Optional()), __param(4, core_1.Inject(exports.TEMPLATE_TRANSFORMS)), __metadata('design:paramtypes', [parser_1.Parser, element_schema_registry_1.ElementSchemaRegistry, html_parser_1.HtmlParser, console_1.Console, Array])], TemplateParser); - return TemplateParser; - }()); - exports.TemplateParser = TemplateParser; - var TemplateParseVisitor = (function() { - function TemplateParseVisitor(providerViewContext, directives, pipes, _exprParser, _schemaRegistry) { - var _this = this; - this.providerViewContext = providerViewContext; - this._exprParser = _exprParser; - this._schemaRegistry = _schemaRegistry; - this.errors = []; - this.directivesIndex = new Map(); - this.ngContentCount = 0; - this.selectorMatcher = new selector_1.SelectorMatcher(); - collection_1.ListWrapper.forEachWithIndex(directives, function(directive, index) { - var selector = selector_1.CssSelector.parse(directive.selector); - _this.selectorMatcher.addSelectables(selector, directive); - _this.directivesIndex.set(directive, index); - }); - this.pipesByName = new Map(); - pipes.forEach(function(pipe) { - return _this.pipesByName.set(pipe.name, pipe); - }); - } - TemplateParseVisitor.prototype._reportError = function(message, sourceSpan, level) { - if (level === void 0) { - level = parse_util_1.ParseErrorLevel.FATAL; - } - this.errors.push(new TemplateParseError(message, sourceSpan, level)); - }; - TemplateParseVisitor.prototype._parseInterpolation = function(value, sourceSpan) { - var sourceInfo = sourceSpan.start.toString(); - try { - var ast = this._exprParser.parseInterpolation(value, sourceInfo); - this._checkPipes(ast, sourceSpan); - if (lang_1.isPresent(ast) && ast.ast.expressions.length > view_utils_1.MAX_INTERPOLATION_VALUES) { - throw new exceptions_1.BaseException("Only support at most " + view_utils_1.MAX_INTERPOLATION_VALUES + " interpolation values!"); + TemplateParseVisitor.prototype._reportError = function(message, sourceSpan, level) { + if (level === void 0) { + level = parse_util_1.ParseErrorLevel.FATAL; } - return ast; - } catch (e) { - this._reportError("" + e, sourceSpan); - return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); - } - }; - TemplateParseVisitor.prototype._parseAction = function(value, sourceSpan) { - var sourceInfo = sourceSpan.start.toString(); - try { - var ast = this._exprParser.parseAction(value, sourceInfo); - this._checkPipes(ast, sourceSpan); - return ast; - } catch (e) { - this._reportError("" + e, sourceSpan); - return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); - } - }; - TemplateParseVisitor.prototype._parseBinding = function(value, sourceSpan) { - var sourceInfo = sourceSpan.start.toString(); - try { - var ast = this._exprParser.parseBinding(value, sourceInfo); - this._checkPipes(ast, sourceSpan); - return ast; - } catch (e) { - this._reportError("" + e, sourceSpan); - return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo); - } - }; - TemplateParseVisitor.prototype._parseTemplateBindings = function(value, sourceSpan) { - var _this = this; - var sourceInfo = sourceSpan.start.toString(); - try { - var bindingsResult = this._exprParser.parseTemplateBindings(value, sourceInfo); - bindingsResult.templateBindings.forEach(function(binding) { - if (lang_1.isPresent(binding.expression)) { - _this._checkPipes(binding.expression, sourceSpan); - } - }); - bindingsResult.warnings.forEach(function(warning) { - _this._reportError(warning, sourceSpan, parse_util_1.ParseErrorLevel.WARNING); - }); - return bindingsResult.templateBindings; - } catch (e) { - this._reportError("" + e, sourceSpan); - return []; - } - }; - TemplateParseVisitor.prototype._checkPipes = function(ast, sourceSpan) { - var _this = this; - if (lang_1.isPresent(ast)) { - var collector = new PipeCollector(); - ast.visit(collector); - collector.pipes.forEach(function(pipeName) { - if (!_this.pipesByName.has(pipeName)) { - _this._reportError("The pipe '" + pipeName + "' could not be found", sourceSpan); - } - }); - } - }; - TemplateParseVisitor.prototype.visitExpansion = function(ast, context) { - return null; - }; - TemplateParseVisitor.prototype.visitExpansionCase = function(ast, context) { - return null; - }; - TemplateParseVisitor.prototype.visitText = function(ast, parent) { - var ngContentIndex = parent.findNgContentIndex(TEXT_CSS_SELECTOR); - var expr = this._parseInterpolation(ast.value, ast.sourceSpan); - if (lang_1.isPresent(expr)) { - return new template_ast_1.BoundTextAst(expr, ngContentIndex, ast.sourceSpan); - } else { - return new template_ast_1.TextAst(ast.value, ngContentIndex, ast.sourceSpan); - } - }; - TemplateParseVisitor.prototype.visitAttr = function(ast, contex) { - return new template_ast_1.AttrAst(ast.name, ast.value, ast.sourceSpan); - }; - TemplateParseVisitor.prototype.visitComment = function(ast, context) { - return null; - }; - TemplateParseVisitor.prototype.visitElement = function(element, parent) { - var _this = this; - var nodeName = element.name; - var preparsedElement = template_preparser_1.preparseElement(element); - if (preparsedElement.type === template_preparser_1.PreparsedElementType.SCRIPT || preparsedElement.type === template_preparser_1.PreparsedElementType.STYLE) { - return null; - } - if (preparsedElement.type === template_preparser_1.PreparsedElementType.STYLESHEET && style_url_resolver_1.isStyleUrlResolvable(preparsedElement.hrefAttr)) { - return null; - } - var matchableAttrs = []; - var elementOrDirectiveProps = []; - var elementOrDirectiveRefs = []; - var elementVars = []; - var events = []; - var templateElementOrDirectiveProps = []; - var templateMatchableAttrs = []; - var templateElementVars = []; - var hasInlineTemplates = false; - var attrs = []; - var lcElName = html_tags_1.splitNsName(nodeName.toLowerCase())[1]; - var isTemplateElement = lcElName == TEMPLATE_ELEMENT; - element.attrs.forEach(function(attr) { - var hasBinding = _this._parseAttr(isTemplateElement, attr, matchableAttrs, elementOrDirectiveProps, events, elementOrDirectiveRefs, elementVars); - var hasTemplateBinding = _this._parseInlineTemplateBinding(attr, templateMatchableAttrs, templateElementOrDirectiveProps, templateElementVars); - if (!hasBinding && !hasTemplateBinding) { - attrs.push(_this.visitAttr(attr, null)); - matchableAttrs.push([attr.name, attr.value]); - } - if (hasTemplateBinding) { - hasInlineTemplates = true; - } - }); - var elementCssSelector = createElementCssSelector(nodeName, matchableAttrs); - var directiveMetas = this._parseDirectives(this.selectorMatcher, elementCssSelector); - var references = []; - var directiveAsts = this._createDirectiveAsts(isTemplateElement, element.name, directiveMetas, elementOrDirectiveProps, elementOrDirectiveRefs, element.sourceSpan, references); - var elementProps = this._createElementPropertyAsts(element.name, elementOrDirectiveProps, directiveAsts); - var isViewRoot = parent.isTemplateElement || hasInlineTemplates; - var providerContext = new provider_parser_1.ProviderElementContext(this.providerViewContext, parent.providerContext, isViewRoot, directiveAsts, attrs, references, element.sourceSpan); - var children = html_ast_1.htmlVisitAll(preparsedElement.nonBindable ? NON_BINDABLE_VISITOR : this, element.children, ElementContext.create(isTemplateElement, directiveAsts, isTemplateElement ? parent.providerContext : providerContext)); - providerContext.afterElement(); - var projectionSelector = lang_1.isPresent(preparsedElement.projectAs) ? selector_1.CssSelector.parse(preparsedElement.projectAs)[0] : elementCssSelector; - var ngContentIndex = parent.findNgContentIndex(projectionSelector); - var parsedElement; - if (preparsedElement.type === template_preparser_1.PreparsedElementType.NG_CONTENT) { - if (lang_1.isPresent(element.children) && element.children.length > 0) { - this._reportError(" element cannot have content. must be immediately followed by ", element.sourceSpan); - } - parsedElement = new template_ast_1.NgContentAst(this.ngContentCount++, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan); - } else if (isTemplateElement) { - this._assertAllEventsPublishedByDirectives(directiveAsts, events); - this._assertNoComponentsNorElementBindingsOnTemplate(directiveAsts, elementProps, element.sourceSpan); - parsedElement = new template_ast_1.EmbeddedTemplateAst(attrs, events, references, elementVars, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, children, hasInlineTemplates ? null : ngContentIndex, element.sourceSpan); - } else { - this._assertOnlyOneComponent(directiveAsts, element.sourceSpan); - var ngContentIndex_1 = hasInlineTemplates ? null : parent.findNgContentIndex(projectionSelector); - parsedElement = new template_ast_1.ElementAst(nodeName, attrs, elementProps, events, references, providerContext.transformedDirectiveAsts, providerContext.transformProviders, providerContext.transformedHasViewContainer, children, hasInlineTemplates ? null : ngContentIndex_1, element.sourceSpan); - } - if (hasInlineTemplates) { - var templateCssSelector = createElementCssSelector(TEMPLATE_ELEMENT, templateMatchableAttrs); - var templateDirectiveMetas = this._parseDirectives(this.selectorMatcher, templateCssSelector); - var templateDirectiveAsts = this._createDirectiveAsts(true, element.name, templateDirectiveMetas, templateElementOrDirectiveProps, [], element.sourceSpan, []); - var templateElementProps = this._createElementPropertyAsts(element.name, templateElementOrDirectiveProps, templateDirectiveAsts); - this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectiveAsts, templateElementProps, element.sourceSpan); - var templateProviderContext = new provider_parser_1.ProviderElementContext(this.providerViewContext, parent.providerContext, parent.isTemplateElement, templateDirectiveAsts, [], [], element.sourceSpan); - templateProviderContext.afterElement(); - parsedElement = new template_ast_1.EmbeddedTemplateAst([], [], [], templateElementVars, templateProviderContext.transformedDirectiveAsts, templateProviderContext.transformProviders, templateProviderContext.transformedHasViewContainer, [parsedElement], ngContentIndex, element.sourceSpan); - } - return parsedElement; - }; - TemplateParseVisitor.prototype._parseInlineTemplateBinding = function(attr, targetMatchableAttrs, targetProps, targetVars) { - var templateBindingsSource = null; - if (attr.name == TEMPLATE_ATTR) { - templateBindingsSource = attr.value; - } else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) { - var key = attr.name.substring(TEMPLATE_ATTR_PREFIX.length); - templateBindingsSource = (attr.value.length == 0) ? key : key + ' ' + attr.value; - } - if (lang_1.isPresent(templateBindingsSource)) { - var bindings = this._parseTemplateBindings(templateBindingsSource, attr.sourceSpan); - for (var i = 0; i < bindings.length; i++) { - var binding = bindings[i]; - if (binding.keyIsVar) { - targetVars.push(new template_ast_1.VariableAst(binding.key, binding.name, attr.sourceSpan)); - } else if (lang_1.isPresent(binding.expression)) { - this._parsePropertyAst(binding.key, binding.expression, attr.sourceSpan, targetMatchableAttrs, targetProps); - } else { - targetMatchableAttrs.push([binding.key, '']); - this._parseLiteralAttr(binding.key, null, attr.sourceSpan, targetProps); - } - } - return true; - } - return false; - }; - TemplateParseVisitor.prototype._parseAttr = function(isTemplateElement, attr, targetMatchableAttrs, targetProps, targetEvents, targetRefs, targetVars) { - var attrName = this._normalizeAttributeName(attr.name); - var attrValue = attr.value; - var bindParts = lang_1.RegExpWrapper.firstMatch(BIND_NAME_REGEXP, attrName); - var hasBinding = false; - if (lang_1.isPresent(bindParts)) { - hasBinding = true; - if (lang_1.isPresent(bindParts[1])) { - this._parseProperty(bindParts[7], attrValue, attr.sourceSpan, targetMatchableAttrs, targetProps); - } else if (lang_1.isPresent(bindParts[2])) { - var identifier = bindParts[7]; - if (isTemplateElement) { - this._reportError("\"var-\" on